1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
3 * LADI Session Handler (ladish)
5 * Copyright (C) 2009 Nedko Arnaudov <nedko@arnaudov.name>
7 **************************************************************************
8 * This file contains implementation of app supervisor object
9 **************************************************************************
11 * LADI Session Handler is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * LADI Session Handler is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with LADI Session Handler. If not, see <http://www.gnu.org/licenses/>
23 * or write to the Free Software Foundation, Inc.,
24 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
28 #include <sys/types.h>
31 #include "app_supervisor.h"
32 #include "../dbus/error.h"
33 #include "../dbus_constants.h"
35 #include "studio_internal.h"
39 struct list_head siblings
;
51 struct ladish_app_supervisor
57 struct list_head applist
;
60 bool ladish_app_supervisor_create(ladish_app_supervisor_handle
* supervisor_handle_ptr
, const char * opath
, const char * name
)
62 struct ladish_app_supervisor
* supervisor_ptr
;
64 supervisor_ptr
= malloc(sizeof(struct ladish_app_supervisor
));
65 if (supervisor_ptr
== NULL
)
67 log_error("malloc() failed to allocate struct ladish_app_supervisor");
71 supervisor_ptr
->opath
= strdup(opath
);
72 if (supervisor_ptr
->opath
== NULL
)
74 log_error("strdup() failed for app supervisor opath");
79 supervisor_ptr
->name
= strdup(name
);
80 if (supervisor_ptr
->name
== NULL
)
82 log_error("strdup() failed for app supervisor name");
83 free(supervisor_ptr
->opath
);
88 supervisor_ptr
->version
= 0;
89 supervisor_ptr
->next_id
= 1;
91 INIT_LIST_HEAD(&supervisor_ptr
->applist
);
93 *supervisor_handle_ptr
= (ladish_app_supervisor_handle
)supervisor_ptr
;
98 struct ladish_app
* ladish_app_supervisor_find_app_by_name(struct ladish_app_supervisor
* supervisor_ptr
, const char * name
)
100 struct list_head
* node_ptr
;
101 struct ladish_app
* app_ptr
;
103 list_for_each(node_ptr
, &supervisor_ptr
->applist
)
105 app_ptr
= list_entry(node_ptr
, struct ladish_app
, siblings
);
106 if (strcmp(app_ptr
->name
, name
) == 0)
115 struct ladish_app
* ladish_app_supervisor_find_app_by_id(struct ladish_app_supervisor
* supervisor_ptr
, uint64_t id
)
117 struct list_head
* node_ptr
;
118 struct ladish_app
* app_ptr
;
120 list_for_each(node_ptr
, &supervisor_ptr
->applist
)
122 app_ptr
= list_entry(node_ptr
, struct ladish_app
, siblings
);
123 if (app_ptr
->id
== id
)
135 struct ladish_app_supervisor
* supervisor_ptr
,
137 const char * commandline
,
138 dbus_bool_t terminal
,
142 struct ladish_app
* app_ptr
;
145 app_ptr
= malloc(sizeof(struct ladish_app
));
148 log_error("malloc of struct ladish_app failed");
152 app_ptr
->name
= strdup(name
);
153 if (app_ptr
->name
== NULL
)
155 log_error("strdup() failed for app name");
160 app_ptr
->commandline
= strdup(commandline
);
161 if (app_ptr
->commandline
== NULL
)
163 log_error("strdup() failed for app commandline");
169 app_ptr
->terminal
= terminal
;
170 app_ptr
->level
= level
;
173 app_ptr
->id
= supervisor_ptr
->next_id
++;
174 app_ptr
->zombie
= false;
175 app_ptr
->hidden
= false;
176 app_ptr
->autorun
= autorun
;
177 list_add_tail(&app_ptr
->siblings
, &supervisor_ptr
->applist
);
182 supervisor_ptr
->opath
,
183 IFACE_APP_SUPERVISOR
,
186 &supervisor_ptr
->version
,
196 void remove_app_internal(struct ladish_app_supervisor
* supervisor_ptr
, struct ladish_app
* app_ptr
)
198 list_del(&app_ptr
->siblings
);
200 if (!app_ptr
->hidden
)
204 supervisor_ptr
->opath
,
205 IFACE_APP_SUPERVISOR
,
208 &supervisor_ptr
->version
,
213 free(app_ptr
->commandline
);
217 void emit_app_state_changed(struct ladish_app_supervisor
* supervisor_ptr
, struct ladish_app
* app_ptr
)
220 dbus_bool_t terminal
;
227 running
= app_ptr
->pid
!= 0;
228 terminal
= app_ptr
->terminal
;
232 supervisor_ptr
->opath
,
233 IFACE_APP_SUPERVISOR
,
243 #define supervisor_ptr ((struct ladish_app_supervisor *)supervisor_handle)
245 void ladish_app_supervisor_clear(ladish_app_supervisor_handle supervisor_handle
)
247 struct list_head
* node_ptr
;
248 struct list_head
* safe_node_ptr
;
249 struct ladish_app
* app_ptr
;
251 list_for_each_safe(node_ptr
, safe_node_ptr
, &supervisor_ptr
->applist
)
253 app_ptr
= list_entry(node_ptr
, struct ladish_app
, siblings
);
254 if (app_ptr
->pid
!= 0)
256 log_info("terminating '%s'...", app_ptr
->name
);
257 app_ptr
->zombie
= true;
258 kill(app_ptr
->pid
, SIGTERM
);
262 log_info("removing '%s'", app_ptr
->name
);
263 remove_app_internal(supervisor_ptr
, app_ptr
);
268 void ladish_app_supervisor_destroy(ladish_app_supervisor_handle supervisor_handle
)
270 ladish_app_supervisor_clear(supervisor_handle
);
271 free(supervisor_ptr
->name
);
272 free(supervisor_ptr
->opath
);
273 free(supervisor_ptr
);
276 bool ladish_app_supervisor_child_exit(ladish_app_supervisor_handle supervisor_handle
, pid_t pid
)
278 struct list_head
* node_ptr
;
279 struct ladish_app
* app_ptr
;
281 list_for_each(node_ptr
, &supervisor_ptr
->applist
)
283 app_ptr
= list_entry(node_ptr
, struct ladish_app
, siblings
);
284 if (app_ptr
->pid
== pid
)
286 log_info("exit of studio child '%s' detected.", app_ptr
->name
);
291 remove_app_internal(supervisor_ptr
, app_ptr
);
295 emit_app_state_changed(supervisor_ptr
, app_ptr
);
306 ladish_app_supervisor_enum(
307 ladish_app_supervisor_handle supervisor_handle
,
309 bool (* callback
)(void * context
, const char * name
, bool running
, const char * command
, bool terminal
, uint8_t level
))
311 struct list_head
* node_ptr
;
312 struct ladish_app
* app_ptr
;
314 list_for_each(node_ptr
, &supervisor_ptr
->applist
)
316 app_ptr
= list_entry(node_ptr
, struct ladish_app
, siblings
);
323 if (!callback(context
, app_ptr
->name
, app_ptr
->pid
!= 0, app_ptr
->commandline
, app_ptr
->terminal
, app_ptr
->level
))
333 ladish_app_supervisor_add(
334 ladish_app_supervisor_handle supervisor_handle
,
337 const char * command
,
341 struct ladish_app
* app_ptr
;
343 app_ptr
= add_app_internal(supervisor_ptr
, name
, command
, terminal
, autorun
, level
);
346 log_error("add_app_internal() failed");
353 void ladish_app_supervisor_autorun(ladish_app_supervisor_handle supervisor_handle
)
355 struct list_head
* node_ptr
;
356 struct ladish_app
* app_ptr
;
358 list_for_each(node_ptr
, &supervisor_ptr
->applist
)
360 app_ptr
= list_entry(node_ptr
, struct ladish_app
, siblings
);
362 if (!app_ptr
->autorun
)
367 app_ptr
->autorun
= false;
369 log_info("autorun('%s', %s, '%s') called", app_ptr
->name
, app_ptr
->terminal
? "terminal" : "shell", app_ptr
->commandline
);
371 if (!loader_execute(supervisor_ptr
->name
, app_ptr
->name
, "/", app_ptr
->terminal
, app_ptr
->commandline
, &app_ptr
->pid
))
373 log_error("Execution of '%s' failed", app_ptr
->commandline
);
377 emit_app_state_changed(supervisor_ptr
, app_ptr
);
381 void ladish_app_supervisor_stop(ladish_app_supervisor_handle supervisor_handle
)
383 struct list_head
* node_ptr
;
384 struct ladish_app
* app_ptr
;
386 list_for_each(node_ptr
, &supervisor_ptr
->applist
)
388 app_ptr
= list_entry(node_ptr
, struct ladish_app
, siblings
);
389 if (app_ptr
->pid
!= 0)
391 app_ptr
->autorun
= true;
392 log_info("terminating '%s'...", app_ptr
->name
);
393 kill(app_ptr
->pid
, SIGTERM
);
398 #undef supervisor_ptr
399 #define supervisor_ptr ((struct ladish_app_supervisor *)call_ptr->iface_context)
401 static void get_all(struct dbus_method_call
* call_ptr
)
403 DBusMessageIter iter
, array_iter
, struct_iter
;
404 struct list_head
* node_ptr
;
405 struct ladish_app
* app_ptr
;
407 dbus_bool_t terminal
;
409 log_info("get_all called");
411 call_ptr
->reply
= dbus_message_new_method_return(call_ptr
->message
);
412 if (call_ptr
->reply
== NULL
)
417 dbus_message_iter_init_append(call_ptr
->reply
, &iter
);
419 if (!dbus_message_iter_append_basic(&iter
, DBUS_TYPE_UINT64
, &supervisor_ptr
->version
))
424 if (!dbus_message_iter_open_container(&iter
, DBUS_TYPE_ARRAY
, "(tsbby)", &array_iter
))
429 list_for_each(node_ptr
, &supervisor_ptr
->applist
)
431 app_ptr
= list_entry(node_ptr
, struct ladish_app
, siblings
);
438 log_info("app '%s' (%llu)", app_ptr
->name
, (unsigned long long)app_ptr
->id
);
440 if (!dbus_message_iter_open_container (&array_iter
, DBUS_TYPE_STRUCT
, NULL
, &struct_iter
))
445 if (!dbus_message_iter_append_basic(&struct_iter
, DBUS_TYPE_UINT64
, &app_ptr
->id
))
450 if (!dbus_message_iter_append_basic(&struct_iter
, DBUS_TYPE_STRING
, &app_ptr
->name
))
455 running
= app_ptr
->pid
!= 0;
456 if (!dbus_message_iter_append_basic(&struct_iter
, DBUS_TYPE_BOOLEAN
, &running
))
461 terminal
= app_ptr
->terminal
;
462 if (!dbus_message_iter_append_basic(&struct_iter
, DBUS_TYPE_BOOLEAN
, &terminal
))
467 if (!dbus_message_iter_append_basic(&struct_iter
, DBUS_TYPE_BYTE
, &app_ptr
->level
))
472 if (!dbus_message_iter_close_container(&array_iter
, &struct_iter
))
478 if (!dbus_message_iter_close_container(&iter
, &array_iter
))
486 dbus_message_unref(call_ptr
->reply
);
487 call_ptr
->reply
= NULL
;
490 log_error("Ran out of memory trying to construct method return");
493 static void run_custom(struct dbus_method_call
* call_ptr
)
495 dbus_bool_t terminal
;
496 const char * commandline
;
497 const char * name_param
;
502 struct ladish_app
* app_ptr
;
504 if (!dbus_message_get_args(
507 DBUS_TYPE_BOOLEAN
, &terminal
,
508 DBUS_TYPE_STRING
, &commandline
,
509 DBUS_TYPE_STRING
, &name_param
,
512 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "Invalid arguments to method \"%s\": %s", call_ptr
->method_name
, g_dbus_error
.message
);
513 dbus_error_free(&g_dbus_error
);
517 log_info("run_custom('%s', %s, '%s') called", name_param
, terminal
? "terminal" : "shell", commandline
);
521 /* allocate and copy app name */
522 len
= strlen(name_param
);
523 name
= malloc(len
+ 100);
526 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_GENERIC
, "malloc of app name failed");
530 strcpy(name
, name_param
);
536 /* allocate app name */
537 len
= strlen(commandline
) + 100;
541 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_GENERIC
, "malloc of app name failed");
545 strcpy(name
, commandline
);
547 /* use first word as name */
561 /* make the app name unique */
563 while (ladish_app_supervisor_find_app_by_name(supervisor_ptr
, name
) != NULL
)
565 sprintf(end
, "-%u", index
);
569 app_ptr
= add_app_internal(supervisor_ptr
, name
, commandline
, terminal
, true, 0);
575 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_GENERIC
, "add_app_internal() failed");
579 if (studio_is_started())
581 if (!loader_execute(supervisor_ptr
->name
, app_ptr
->name
, "/", terminal
, commandline
, &app_ptr
->pid
))
583 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_GENERIC
, "Execution of '%s' failed", commandline
);
584 remove_app_internal(supervisor_ptr
, app_ptr
);
588 log_info("%s pid is %lu", app_ptr
->name
, (unsigned long)app_ptr
->pid
);
590 emit_app_state_changed(supervisor_ptr
, app_ptr
);
593 method_return_new_void(call_ptr
);
596 static void start_app(struct dbus_method_call
* call_ptr
)
599 struct ladish_app
* app_ptr
;
601 if (!dbus_message_get_args(
604 DBUS_TYPE_UINT64
, &id
,
607 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "Invalid arguments to method \"%s\": %s", call_ptr
->method_name
, g_dbus_error
.message
);
608 dbus_error_free(&g_dbus_error
);
612 app_ptr
= ladish_app_supervisor_find_app_by_id(supervisor_ptr
, id
);
615 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App with ID %"PRIu64
" not found", id
);
619 if (app_ptr
->pid
!= 0)
621 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App %s is already running", app_ptr
->name
);
625 app_ptr
->zombie
= false;
626 if (!loader_execute(supervisor_ptr
->name
, app_ptr
->name
, "/", app_ptr
->terminal
, app_ptr
->commandline
, &app_ptr
->pid
))
628 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_GENERIC
, "Execution of '%s' failed", app_ptr
->commandline
);
632 emit_app_state_changed(supervisor_ptr
, app_ptr
);
633 log_info("%s pid is %lu", app_ptr
->name
, (unsigned long)app_ptr
->pid
);
635 method_return_new_void(call_ptr
);
638 static void stop_app(struct dbus_method_call
* call_ptr
)
641 struct ladish_app
* app_ptr
;
643 if (!dbus_message_get_args(
646 DBUS_TYPE_UINT64
, &id
,
649 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "Invalid arguments to method \"%s\": %s", call_ptr
->method_name
, g_dbus_error
.message
);
650 dbus_error_free(&g_dbus_error
);
654 app_ptr
= ladish_app_supervisor_find_app_by_id(supervisor_ptr
, id
);
657 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App with ID %"PRIu64
" not found", id
);
661 if (app_ptr
->pid
== 0)
663 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App %s is not running", app_ptr
->name
);
667 kill(app_ptr
->pid
, SIGTERM
);
669 method_return_new_void(call_ptr
);
672 static void kill_app(struct dbus_method_call
* call_ptr
)
675 struct ladish_app
* app_ptr
;
677 if (!dbus_message_get_args(
680 DBUS_TYPE_UINT64
, &id
,
683 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "Invalid arguments to method \"%s\": %s", call_ptr
->method_name
, g_dbus_error
.message
);
684 dbus_error_free(&g_dbus_error
);
688 app_ptr
= ladish_app_supervisor_find_app_by_id(supervisor_ptr
, id
);
691 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App with ID %"PRIu64
" not found", id
);
695 if (app_ptr
->pid
== 0)
697 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App %s is not running", app_ptr
->name
);
701 kill(app_ptr
->pid
, SIGKILL
);
703 method_return_new_void(call_ptr
);
706 static void get_app_properties(struct dbus_method_call
* call_ptr
)
710 static void set_app_properties(struct dbus_method_call
* call_ptr
)
714 static void remove_app(struct dbus_method_call
* call_ptr
)
717 struct ladish_app
* app_ptr
;
719 if (!dbus_message_get_args(
722 DBUS_TYPE_UINT64
, &id
,
725 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "Invalid arguments to method \"%s\": %s", call_ptr
->method_name
, g_dbus_error
.message
);
726 dbus_error_free(&g_dbus_error
);
730 app_ptr
= ladish_app_supervisor_find_app_by_id(supervisor_ptr
, id
);
733 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App with ID %"PRIu64
" not found", id
);
737 if (app_ptr
->pid
!= 0)
739 app_ptr
->zombie
= true;
740 kill(app_ptr
->pid
, SIGTERM
);
744 remove_app_internal(supervisor_ptr
, app_ptr
);
747 method_return_new_void(call_ptr
);
750 static void is_app_running(struct dbus_method_call
* call_ptr
)
753 struct ladish_app
* app_ptr
;
756 if (!dbus_message_get_args(
759 DBUS_TYPE_UINT64
, &id
,
762 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "Invalid arguments to method \"%s\": %s", call_ptr
->method_name
, g_dbus_error
.message
);
763 dbus_error_free(&g_dbus_error
);
767 app_ptr
= ladish_app_supervisor_find_app_by_id(supervisor_ptr
, id
);
770 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App with ID %"PRIu64
" not found", id
);
774 running
= app_ptr
->pid
!= 0;
776 method_return_new_single(call_ptr
, DBUS_TYPE_BOOLEAN
, &running
);
779 #undef supervisor_ptr
781 METHOD_ARGS_BEGIN(GetAll
, "Get list of apps")
782 METHOD_ARG_DESCRIBE_OUT("list_version", DBUS_TYPE_UINT64_AS_STRING
, "Version of the list")
783 METHOD_ARG_DESCRIBE_OUT("apps_list", "a(tsbby)", "List of apps")
786 METHOD_ARGS_BEGIN(RunCustom
, "Start application by supplying commandline")
787 METHOD_ARG_DESCRIBE_IN("terminal", DBUS_TYPE_BOOLEAN_AS_STRING
, "Whether to run in terminal")
788 METHOD_ARG_DESCRIBE_IN("commandline", DBUS_TYPE_STRING_AS_STRING
, "Commandline")
789 METHOD_ARG_DESCRIBE_IN("name", DBUS_TYPE_STRING_AS_STRING
, "Name")
790 METHOD_ARG_DESCRIBE_IN("level", DBUS_TYPE_BYTE_AS_STRING
, "Level")
793 METHOD_ARGS_BEGIN(StartApp
, "Start application")
794 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
797 METHOD_ARGS_BEGIN(StopApp
, "Stop application")
798 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
801 METHOD_ARGS_BEGIN(KillApp
, "Kill application")
802 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
805 METHOD_ARGS_BEGIN(RemoveApp
, "Remove application")
806 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
809 METHOD_ARGS_BEGIN(GetAppProperties
, "Get properties of an application")
810 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
811 METHOD_ARG_DESCRIBE_OUT("name", DBUS_TYPE_STRING_AS_STRING
, "")
812 METHOD_ARG_DESCRIBE_OUT("commandline", DBUS_TYPE_STRING_AS_STRING
, "Commandline")
813 METHOD_ARG_DESCRIBE_OUT("terminal", DBUS_TYPE_BOOLEAN_AS_STRING
, "Whether to run in terminal")
814 METHOD_ARG_DESCRIBE_OUT("level", DBUS_TYPE_BYTE_AS_STRING
, "Level")
817 METHOD_ARGS_BEGIN(SetAppProperties
, "Set properties of an application")
818 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
819 METHOD_ARG_DESCRIBE_IN("name", DBUS_TYPE_STRING_AS_STRING
, "")
820 METHOD_ARG_DESCRIBE_IN("commandline", DBUS_TYPE_STRING_AS_STRING
, "Commandline")
821 METHOD_ARG_DESCRIBE_IN("terminal", DBUS_TYPE_BOOLEAN_AS_STRING
, "Whether to run in terminal")
822 METHOD_ARG_DESCRIBE_IN("level", DBUS_TYPE_BYTE_AS_STRING
, "Level")
825 METHOD_ARGS_BEGIN(IsAppRunning
, "Check whether application is running")
826 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
827 METHOD_ARG_DESCRIBE_IN("terminal", DBUS_TYPE_BOOLEAN_AS_STRING
, "Whether app is running")
832 METHOD_DESCRIBE(GetAll
, get_all
)
833 METHOD_DESCRIBE(RunCustom
, run_custom
)
834 METHOD_DESCRIBE(StartApp
, start_app
)
835 METHOD_DESCRIBE(StopApp
, stop_app
)
836 METHOD_DESCRIBE(KillApp
, kill_app
)
837 METHOD_DESCRIBE(GetAppProperties
, get_app_properties
)
838 METHOD_DESCRIBE(SetAppProperties
, set_app_properties
)
839 METHOD_DESCRIBE(RemoveApp
, remove_app
)
840 METHOD_DESCRIBE(IsAppRunning
, is_app_running
)
843 SIGNAL_ARGS_BEGIN(AppAdded
, "")
844 SIGNAL_ARG_DESCRIBE("new_list_version", DBUS_TYPE_UINT64_AS_STRING
, "")
845 SIGNAL_ARG_DESCRIBE("id", DBUS_TYPE_UINT64_AS_STRING
, "")
846 SIGNAL_ARG_DESCRIBE("name", DBUS_TYPE_STRING_AS_STRING
, "")
847 SIGNAL_ARG_DESCRIBE("running", DBUS_TYPE_BOOLEAN_AS_STRING
, "")
848 SIGNAL_ARG_DESCRIBE("terminal", DBUS_TYPE_BOOLEAN_AS_STRING
, "Whether to run in terminal")
849 SIGNAL_ARG_DESCRIBE("level", DBUS_TYPE_BYTE_AS_STRING
, "Level")
852 SIGNAL_ARGS_BEGIN(AppRemoved
, "")
853 SIGNAL_ARG_DESCRIBE("new_list_version", DBUS_TYPE_UINT64_AS_STRING
, "")
854 SIGNAL_ARG_DESCRIBE("id", DBUS_TYPE_UINT64_AS_STRING
, "")
857 SIGNAL_ARGS_BEGIN(AppStateChanged
, "")
858 SIGNAL_ARG_DESCRIBE("id", DBUS_TYPE_UINT64_AS_STRING
, "")
859 SIGNAL_ARG_DESCRIBE("name", DBUS_TYPE_STRING_AS_STRING
, "")
860 SIGNAL_ARG_DESCRIBE("running", DBUS_TYPE_BOOLEAN_AS_STRING
, "")
861 SIGNAL_ARG_DESCRIBE("terminal", DBUS_TYPE_BOOLEAN_AS_STRING
, "Whether to run in terminal")
862 SIGNAL_ARG_DESCRIBE("level", DBUS_TYPE_BYTE_AS_STRING
, "Level")
866 SIGNAL_DESCRIBE(AppAdded
)
867 SIGNAL_DESCRIBE(AppRemoved
)
868 SIGNAL_DESCRIBE(AppStateChanged
)
871 INTERFACE_BEGIN(g_iface_app_supervisor
, IFACE_APP_SUPERVISOR
)
872 INTERFACE_DEFAULT_HANDLER
873 INTERFACE_EXPOSE_METHODS
874 INTERFACE_EXPOSE_SIGNALS