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 char * ladish_app_supervisor_search_app(ladish_app_supervisor_handle supervisor_handle
, pid_t pid
)
400 struct list_head
* node_ptr
;
401 struct ladish_app
* app_ptr
;
404 list_for_each(node_ptr
, &supervisor_ptr
->applist
)
406 app_ptr
= list_entry(node_ptr
, struct ladish_app
, siblings
);
407 if (app_ptr
->pid
== pid
)
409 name
= strdup(app_ptr
->name
);
412 log_error("strdup() failed for '%s'", app_ptr
->name
);
422 #undef supervisor_ptr
423 #define supervisor_ptr ((struct ladish_app_supervisor *)call_ptr->iface_context)
425 static void get_all(struct dbus_method_call
* call_ptr
)
427 DBusMessageIter iter
, array_iter
, struct_iter
;
428 struct list_head
* node_ptr
;
429 struct ladish_app
* app_ptr
;
431 dbus_bool_t terminal
;
433 log_info("get_all called");
435 call_ptr
->reply
= dbus_message_new_method_return(call_ptr
->message
);
436 if (call_ptr
->reply
== NULL
)
441 dbus_message_iter_init_append(call_ptr
->reply
, &iter
);
443 if (!dbus_message_iter_append_basic(&iter
, DBUS_TYPE_UINT64
, &supervisor_ptr
->version
))
448 if (!dbus_message_iter_open_container(&iter
, DBUS_TYPE_ARRAY
, "(tsbby)", &array_iter
))
453 list_for_each(node_ptr
, &supervisor_ptr
->applist
)
455 app_ptr
= list_entry(node_ptr
, struct ladish_app
, siblings
);
462 log_info("app '%s' (%llu)", app_ptr
->name
, (unsigned long long)app_ptr
->id
);
464 if (!dbus_message_iter_open_container (&array_iter
, DBUS_TYPE_STRUCT
, NULL
, &struct_iter
))
469 if (!dbus_message_iter_append_basic(&struct_iter
, DBUS_TYPE_UINT64
, &app_ptr
->id
))
474 if (!dbus_message_iter_append_basic(&struct_iter
, DBUS_TYPE_STRING
, &app_ptr
->name
))
479 running
= app_ptr
->pid
!= 0;
480 if (!dbus_message_iter_append_basic(&struct_iter
, DBUS_TYPE_BOOLEAN
, &running
))
485 terminal
= app_ptr
->terminal
;
486 if (!dbus_message_iter_append_basic(&struct_iter
, DBUS_TYPE_BOOLEAN
, &terminal
))
491 if (!dbus_message_iter_append_basic(&struct_iter
, DBUS_TYPE_BYTE
, &app_ptr
->level
))
496 if (!dbus_message_iter_close_container(&array_iter
, &struct_iter
))
502 if (!dbus_message_iter_close_container(&iter
, &array_iter
))
510 dbus_message_unref(call_ptr
->reply
);
511 call_ptr
->reply
= NULL
;
514 log_error("Ran out of memory trying to construct method return");
517 static void run_custom(struct dbus_method_call
* call_ptr
)
519 dbus_bool_t terminal
;
520 const char * commandline
;
521 const char * name_param
;
526 struct ladish_app
* app_ptr
;
528 if (!dbus_message_get_args(
531 DBUS_TYPE_BOOLEAN
, &terminal
,
532 DBUS_TYPE_STRING
, &commandline
,
533 DBUS_TYPE_STRING
, &name_param
,
536 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "Invalid arguments to method \"%s\": %s", call_ptr
->method_name
, g_dbus_error
.message
);
537 dbus_error_free(&g_dbus_error
);
541 log_info("run_custom('%s', %s, '%s') called", name_param
, terminal
? "terminal" : "shell", commandline
);
545 /* allocate and copy app name */
546 len
= strlen(name_param
);
547 name
= malloc(len
+ 100);
550 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_GENERIC
, "malloc of app name failed");
554 strcpy(name
, name_param
);
560 /* allocate app name */
561 len
= strlen(commandline
) + 100;
565 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_GENERIC
, "malloc of app name failed");
569 strcpy(name
, commandline
);
571 /* use first word as name */
585 /* make the app name unique */
587 while (ladish_app_supervisor_find_app_by_name(supervisor_ptr
, name
) != NULL
)
589 sprintf(end
, "-%u", index
);
593 app_ptr
= add_app_internal(supervisor_ptr
, name
, commandline
, terminal
, true, 0);
599 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_GENERIC
, "add_app_internal() failed");
603 if (studio_is_started())
605 if (!loader_execute(supervisor_ptr
->name
, app_ptr
->name
, "/", terminal
, commandline
, &app_ptr
->pid
))
607 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_GENERIC
, "Execution of '%s' failed", commandline
);
608 remove_app_internal(supervisor_ptr
, app_ptr
);
612 log_info("%s pid is %lu", app_ptr
->name
, (unsigned long)app_ptr
->pid
);
614 emit_app_state_changed(supervisor_ptr
, app_ptr
);
617 method_return_new_void(call_ptr
);
620 static void start_app(struct dbus_method_call
* call_ptr
)
623 struct ladish_app
* app_ptr
;
625 if (!dbus_message_get_args(
628 DBUS_TYPE_UINT64
, &id
,
631 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "Invalid arguments to method \"%s\": %s", call_ptr
->method_name
, g_dbus_error
.message
);
632 dbus_error_free(&g_dbus_error
);
636 app_ptr
= ladish_app_supervisor_find_app_by_id(supervisor_ptr
, id
);
639 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App with ID %"PRIu64
" not found", id
);
643 if (app_ptr
->pid
!= 0)
645 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App %s is already running", app_ptr
->name
);
649 app_ptr
->zombie
= false;
650 if (!loader_execute(supervisor_ptr
->name
, app_ptr
->name
, "/", app_ptr
->terminal
, app_ptr
->commandline
, &app_ptr
->pid
))
652 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_GENERIC
, "Execution of '%s' failed", app_ptr
->commandline
);
656 emit_app_state_changed(supervisor_ptr
, app_ptr
);
657 log_info("%s pid is %lu", app_ptr
->name
, (unsigned long)app_ptr
->pid
);
659 method_return_new_void(call_ptr
);
662 static void stop_app(struct dbus_method_call
* call_ptr
)
665 struct ladish_app
* app_ptr
;
667 if (!dbus_message_get_args(
670 DBUS_TYPE_UINT64
, &id
,
673 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "Invalid arguments to method \"%s\": %s", call_ptr
->method_name
, g_dbus_error
.message
);
674 dbus_error_free(&g_dbus_error
);
678 app_ptr
= ladish_app_supervisor_find_app_by_id(supervisor_ptr
, id
);
681 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App with ID %"PRIu64
" not found", id
);
685 if (app_ptr
->pid
== 0)
687 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App %s is not running", app_ptr
->name
);
691 kill(app_ptr
->pid
, SIGTERM
);
693 method_return_new_void(call_ptr
);
696 static void kill_app(struct dbus_method_call
* call_ptr
)
699 struct ladish_app
* app_ptr
;
701 if (!dbus_message_get_args(
704 DBUS_TYPE_UINT64
, &id
,
707 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "Invalid arguments to method \"%s\": %s", call_ptr
->method_name
, g_dbus_error
.message
);
708 dbus_error_free(&g_dbus_error
);
712 app_ptr
= ladish_app_supervisor_find_app_by_id(supervisor_ptr
, id
);
715 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App with ID %"PRIu64
" not found", id
);
719 if (app_ptr
->pid
== 0)
721 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App %s is not running", app_ptr
->name
);
725 kill(app_ptr
->pid
, SIGKILL
);
727 method_return_new_void(call_ptr
);
730 static void get_app_properties(struct dbus_method_call
* call_ptr
)
734 static void set_app_properties(struct dbus_method_call
* call_ptr
)
738 static void remove_app(struct dbus_method_call
* call_ptr
)
741 struct ladish_app
* app_ptr
;
743 if (!dbus_message_get_args(
746 DBUS_TYPE_UINT64
, &id
,
749 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "Invalid arguments to method \"%s\": %s", call_ptr
->method_name
, g_dbus_error
.message
);
750 dbus_error_free(&g_dbus_error
);
754 app_ptr
= ladish_app_supervisor_find_app_by_id(supervisor_ptr
, id
);
757 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App with ID %"PRIu64
" not found", id
);
761 if (app_ptr
->pid
!= 0)
763 app_ptr
->zombie
= true;
764 kill(app_ptr
->pid
, SIGTERM
);
768 remove_app_internal(supervisor_ptr
, app_ptr
);
771 method_return_new_void(call_ptr
);
774 static void is_app_running(struct dbus_method_call
* call_ptr
)
777 struct ladish_app
* app_ptr
;
780 if (!dbus_message_get_args(
783 DBUS_TYPE_UINT64
, &id
,
786 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "Invalid arguments to method \"%s\": %s", call_ptr
->method_name
, g_dbus_error
.message
);
787 dbus_error_free(&g_dbus_error
);
791 app_ptr
= ladish_app_supervisor_find_app_by_id(supervisor_ptr
, id
);
794 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App with ID %"PRIu64
" not found", id
);
798 running
= app_ptr
->pid
!= 0;
800 method_return_new_single(call_ptr
, DBUS_TYPE_BOOLEAN
, &running
);
803 #undef supervisor_ptr
805 METHOD_ARGS_BEGIN(GetAll
, "Get list of apps")
806 METHOD_ARG_DESCRIBE_OUT("list_version", DBUS_TYPE_UINT64_AS_STRING
, "Version of the list")
807 METHOD_ARG_DESCRIBE_OUT("apps_list", "a(tsbby)", "List of apps")
810 METHOD_ARGS_BEGIN(RunCustom
, "Start application by supplying commandline")
811 METHOD_ARG_DESCRIBE_IN("terminal", DBUS_TYPE_BOOLEAN_AS_STRING
, "Whether to run in terminal")
812 METHOD_ARG_DESCRIBE_IN("commandline", DBUS_TYPE_STRING_AS_STRING
, "Commandline")
813 METHOD_ARG_DESCRIBE_IN("name", DBUS_TYPE_STRING_AS_STRING
, "Name")
814 METHOD_ARG_DESCRIBE_IN("level", DBUS_TYPE_BYTE_AS_STRING
, "Level")
817 METHOD_ARGS_BEGIN(StartApp
, "Start application")
818 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
821 METHOD_ARGS_BEGIN(StopApp
, "Stop application")
822 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
825 METHOD_ARGS_BEGIN(KillApp
, "Kill application")
826 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
829 METHOD_ARGS_BEGIN(RemoveApp
, "Remove application")
830 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
833 METHOD_ARGS_BEGIN(GetAppProperties
, "Get properties of an application")
834 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
835 METHOD_ARG_DESCRIBE_OUT("name", DBUS_TYPE_STRING_AS_STRING
, "")
836 METHOD_ARG_DESCRIBE_OUT("commandline", DBUS_TYPE_STRING_AS_STRING
, "Commandline")
837 METHOD_ARG_DESCRIBE_OUT("terminal", DBUS_TYPE_BOOLEAN_AS_STRING
, "Whether to run in terminal")
838 METHOD_ARG_DESCRIBE_OUT("level", DBUS_TYPE_BYTE_AS_STRING
, "Level")
841 METHOD_ARGS_BEGIN(SetAppProperties
, "Set properties of an application")
842 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
843 METHOD_ARG_DESCRIBE_IN("name", DBUS_TYPE_STRING_AS_STRING
, "")
844 METHOD_ARG_DESCRIBE_IN("commandline", DBUS_TYPE_STRING_AS_STRING
, "Commandline")
845 METHOD_ARG_DESCRIBE_IN("terminal", DBUS_TYPE_BOOLEAN_AS_STRING
, "Whether to run in terminal")
846 METHOD_ARG_DESCRIBE_IN("level", DBUS_TYPE_BYTE_AS_STRING
, "Level")
849 METHOD_ARGS_BEGIN(IsAppRunning
, "Check whether application is running")
850 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
851 METHOD_ARG_DESCRIBE_IN("terminal", DBUS_TYPE_BOOLEAN_AS_STRING
, "Whether app is running")
856 METHOD_DESCRIBE(GetAll
, get_all
)
857 METHOD_DESCRIBE(RunCustom
, run_custom
)
858 METHOD_DESCRIBE(StartApp
, start_app
)
859 METHOD_DESCRIBE(StopApp
, stop_app
)
860 METHOD_DESCRIBE(KillApp
, kill_app
)
861 METHOD_DESCRIBE(GetAppProperties
, get_app_properties
)
862 METHOD_DESCRIBE(SetAppProperties
, set_app_properties
)
863 METHOD_DESCRIBE(RemoveApp
, remove_app
)
864 METHOD_DESCRIBE(IsAppRunning
, is_app_running
)
867 SIGNAL_ARGS_BEGIN(AppAdded
, "")
868 SIGNAL_ARG_DESCRIBE("new_list_version", DBUS_TYPE_UINT64_AS_STRING
, "")
869 SIGNAL_ARG_DESCRIBE("id", DBUS_TYPE_UINT64_AS_STRING
, "")
870 SIGNAL_ARG_DESCRIBE("name", DBUS_TYPE_STRING_AS_STRING
, "")
871 SIGNAL_ARG_DESCRIBE("running", DBUS_TYPE_BOOLEAN_AS_STRING
, "")
872 SIGNAL_ARG_DESCRIBE("terminal", DBUS_TYPE_BOOLEAN_AS_STRING
, "Whether to run in terminal")
873 SIGNAL_ARG_DESCRIBE("level", DBUS_TYPE_BYTE_AS_STRING
, "Level")
876 SIGNAL_ARGS_BEGIN(AppRemoved
, "")
877 SIGNAL_ARG_DESCRIBE("new_list_version", DBUS_TYPE_UINT64_AS_STRING
, "")
878 SIGNAL_ARG_DESCRIBE("id", DBUS_TYPE_UINT64_AS_STRING
, "")
881 SIGNAL_ARGS_BEGIN(AppStateChanged
, "")
882 SIGNAL_ARG_DESCRIBE("id", DBUS_TYPE_UINT64_AS_STRING
, "")
883 SIGNAL_ARG_DESCRIBE("name", DBUS_TYPE_STRING_AS_STRING
, "")
884 SIGNAL_ARG_DESCRIBE("running", DBUS_TYPE_BOOLEAN_AS_STRING
, "")
885 SIGNAL_ARG_DESCRIBE("terminal", DBUS_TYPE_BOOLEAN_AS_STRING
, "Whether to run in terminal")
886 SIGNAL_ARG_DESCRIBE("level", DBUS_TYPE_BYTE_AS_STRING
, "Level")
890 SIGNAL_DESCRIBE(AppAdded
)
891 SIGNAL_DESCRIBE(AppRemoved
)
892 SIGNAL_DESCRIBE(AppStateChanged
)
895 INTERFACE_BEGIN(g_iface_app_supervisor
, IFACE_APP_SUPERVISOR
)
896 INTERFACE_DEFAULT_HANDLER
897 INTERFACE_EXPOSE_METHODS
898 INTERFACE_EXPOSE_SIGNALS