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
;
527 struct ladish_app
* app_ptr
;
529 if (!dbus_message_get_args(
532 DBUS_TYPE_BOOLEAN
, &terminal
,
533 DBUS_TYPE_STRING
, &commandline
,
534 DBUS_TYPE_STRING
, &name_param
,
537 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "Invalid arguments to method \"%s\": %s", call_ptr
->method_name
, g_dbus_error
.message
);
538 dbus_error_free(&g_dbus_error
);
542 log_info("run_custom('%s', %s, '%s') called", name_param
, terminal
? "terminal" : "shell", commandline
);
546 /* allocate and copy app name */
547 len
= strlen(name_param
);
548 name_buffer
= malloc(len
+ 100);
549 if (name_buffer
== NULL
)
551 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_GENERIC
, "malloc of app name failed");
557 strcpy(name
, name_param
);
563 /* allocate app name */
564 len
= strlen(commandline
) + 100;
565 name_buffer
= malloc(len
);
566 if (name_buffer
== NULL
)
568 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_GENERIC
, "malloc of app name failed");
572 strcpy(name_buffer
, commandline
);
574 /* use first word as name */
587 name
= strrchr(name_buffer
, '/');
598 /* make the app name unique */
600 while (ladish_app_supervisor_find_app_by_name(supervisor_ptr
, name
) != NULL
)
602 sprintf(end
, "-%u", index
);
606 app_ptr
= add_app_internal(supervisor_ptr
, name
, commandline
, terminal
, true, 0);
612 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_GENERIC
, "add_app_internal() failed");
616 if (studio_is_started())
618 if (!loader_execute(supervisor_ptr
->name
, app_ptr
->name
, "/", terminal
, commandline
, &app_ptr
->pid
))
620 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_GENERIC
, "Execution of '%s' failed", commandline
);
621 remove_app_internal(supervisor_ptr
, app_ptr
);
625 log_info("%s pid is %lu", app_ptr
->name
, (unsigned long)app_ptr
->pid
);
627 emit_app_state_changed(supervisor_ptr
, app_ptr
);
630 method_return_new_void(call_ptr
);
633 static void start_app(struct dbus_method_call
* call_ptr
)
636 struct ladish_app
* app_ptr
;
638 if (!dbus_message_get_args(
641 DBUS_TYPE_UINT64
, &id
,
644 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "Invalid arguments to method \"%s\": %s", call_ptr
->method_name
, g_dbus_error
.message
);
645 dbus_error_free(&g_dbus_error
);
649 app_ptr
= ladish_app_supervisor_find_app_by_id(supervisor_ptr
, id
);
652 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App with ID %"PRIu64
" not found", id
);
656 if (app_ptr
->pid
!= 0)
658 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App %s is already running", app_ptr
->name
);
662 app_ptr
->zombie
= false;
663 if (!loader_execute(supervisor_ptr
->name
, app_ptr
->name
, "/", app_ptr
->terminal
, app_ptr
->commandline
, &app_ptr
->pid
))
665 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_GENERIC
, "Execution of '%s' failed", app_ptr
->commandline
);
669 emit_app_state_changed(supervisor_ptr
, app_ptr
);
670 log_info("%s pid is %lu", app_ptr
->name
, (unsigned long)app_ptr
->pid
);
672 method_return_new_void(call_ptr
);
675 static void stop_app(struct dbus_method_call
* call_ptr
)
678 struct ladish_app
* app_ptr
;
680 if (!dbus_message_get_args(
683 DBUS_TYPE_UINT64
, &id
,
686 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "Invalid arguments to method \"%s\": %s", call_ptr
->method_name
, g_dbus_error
.message
);
687 dbus_error_free(&g_dbus_error
);
691 app_ptr
= ladish_app_supervisor_find_app_by_id(supervisor_ptr
, id
);
694 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App with ID %"PRIu64
" not found", id
);
698 if (app_ptr
->pid
== 0)
700 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App %s is not running", app_ptr
->name
);
704 kill(app_ptr
->pid
, SIGTERM
);
706 method_return_new_void(call_ptr
);
709 static void kill_app(struct dbus_method_call
* call_ptr
)
712 struct ladish_app
* app_ptr
;
714 if (!dbus_message_get_args(
717 DBUS_TYPE_UINT64
, &id
,
720 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "Invalid arguments to method \"%s\": %s", call_ptr
->method_name
, g_dbus_error
.message
);
721 dbus_error_free(&g_dbus_error
);
725 app_ptr
= ladish_app_supervisor_find_app_by_id(supervisor_ptr
, id
);
728 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App with ID %"PRIu64
" not found", id
);
732 if (app_ptr
->pid
== 0)
734 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App %s is not running", app_ptr
->name
);
738 kill(app_ptr
->pid
, SIGKILL
);
740 method_return_new_void(call_ptr
);
743 static void get_app_properties(struct dbus_method_call
* call_ptr
)
747 static void set_app_properties(struct dbus_method_call
* call_ptr
)
751 static void remove_app(struct dbus_method_call
* call_ptr
)
754 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 if (app_ptr
->pid
!= 0)
776 app_ptr
->zombie
= true;
777 kill(app_ptr
->pid
, SIGTERM
);
781 remove_app_internal(supervisor_ptr
, app_ptr
);
784 method_return_new_void(call_ptr
);
787 static void is_app_running(struct dbus_method_call
* call_ptr
)
790 struct ladish_app
* app_ptr
;
793 if (!dbus_message_get_args(
796 DBUS_TYPE_UINT64
, &id
,
799 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "Invalid arguments to method \"%s\": %s", call_ptr
->method_name
, g_dbus_error
.message
);
800 dbus_error_free(&g_dbus_error
);
804 app_ptr
= ladish_app_supervisor_find_app_by_id(supervisor_ptr
, id
);
807 lash_dbus_error(call_ptr
, LASH_DBUS_ERROR_INVALID_ARGS
, "App with ID %"PRIu64
" not found", id
);
811 running
= app_ptr
->pid
!= 0;
813 method_return_new_single(call_ptr
, DBUS_TYPE_BOOLEAN
, &running
);
816 #undef supervisor_ptr
818 METHOD_ARGS_BEGIN(GetAll
, "Get list of apps")
819 METHOD_ARG_DESCRIBE_OUT("list_version", DBUS_TYPE_UINT64_AS_STRING
, "Version of the list")
820 METHOD_ARG_DESCRIBE_OUT("apps_list", "a(tsbby)", "List of apps")
823 METHOD_ARGS_BEGIN(RunCustom
, "Start application by supplying commandline")
824 METHOD_ARG_DESCRIBE_IN("terminal", DBUS_TYPE_BOOLEAN_AS_STRING
, "Whether to run in terminal")
825 METHOD_ARG_DESCRIBE_IN("commandline", DBUS_TYPE_STRING_AS_STRING
, "Commandline")
826 METHOD_ARG_DESCRIBE_IN("name", DBUS_TYPE_STRING_AS_STRING
, "Name")
827 METHOD_ARG_DESCRIBE_IN("level", DBUS_TYPE_BYTE_AS_STRING
, "Level")
830 METHOD_ARGS_BEGIN(StartApp
, "Start application")
831 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
834 METHOD_ARGS_BEGIN(StopApp
, "Stop application")
835 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
838 METHOD_ARGS_BEGIN(KillApp
, "Kill application")
839 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
842 METHOD_ARGS_BEGIN(RemoveApp
, "Remove application")
843 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
846 METHOD_ARGS_BEGIN(GetAppProperties
, "Get properties of an application")
847 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
848 METHOD_ARG_DESCRIBE_OUT("name", DBUS_TYPE_STRING_AS_STRING
, "")
849 METHOD_ARG_DESCRIBE_OUT("commandline", DBUS_TYPE_STRING_AS_STRING
, "Commandline")
850 METHOD_ARG_DESCRIBE_OUT("terminal", DBUS_TYPE_BOOLEAN_AS_STRING
, "Whether to run in terminal")
851 METHOD_ARG_DESCRIBE_OUT("level", DBUS_TYPE_BYTE_AS_STRING
, "Level")
854 METHOD_ARGS_BEGIN(SetAppProperties
, "Set properties of an application")
855 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
856 METHOD_ARG_DESCRIBE_IN("name", DBUS_TYPE_STRING_AS_STRING
, "")
857 METHOD_ARG_DESCRIBE_IN("commandline", DBUS_TYPE_STRING_AS_STRING
, "Commandline")
858 METHOD_ARG_DESCRIBE_IN("terminal", DBUS_TYPE_BOOLEAN_AS_STRING
, "Whether to run in terminal")
859 METHOD_ARG_DESCRIBE_IN("level", DBUS_TYPE_BYTE_AS_STRING
, "Level")
862 METHOD_ARGS_BEGIN(IsAppRunning
, "Check whether application is running")
863 METHOD_ARG_DESCRIBE_IN("id", DBUS_TYPE_UINT64_AS_STRING
, "id of app")
864 METHOD_ARG_DESCRIBE_IN("terminal", DBUS_TYPE_BOOLEAN_AS_STRING
, "Whether app is running")
869 METHOD_DESCRIBE(GetAll
, get_all
)
870 METHOD_DESCRIBE(RunCustom
, run_custom
)
871 METHOD_DESCRIBE(StartApp
, start_app
)
872 METHOD_DESCRIBE(StopApp
, stop_app
)
873 METHOD_DESCRIBE(KillApp
, kill_app
)
874 METHOD_DESCRIBE(GetAppProperties
, get_app_properties
)
875 METHOD_DESCRIBE(SetAppProperties
, set_app_properties
)
876 METHOD_DESCRIBE(RemoveApp
, remove_app
)
877 METHOD_DESCRIBE(IsAppRunning
, is_app_running
)
880 SIGNAL_ARGS_BEGIN(AppAdded
, "")
881 SIGNAL_ARG_DESCRIBE("new_list_version", DBUS_TYPE_UINT64_AS_STRING
, "")
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")
889 SIGNAL_ARGS_BEGIN(AppRemoved
, "")
890 SIGNAL_ARG_DESCRIBE("new_list_version", DBUS_TYPE_UINT64_AS_STRING
, "")
891 SIGNAL_ARG_DESCRIBE("id", DBUS_TYPE_UINT64_AS_STRING
, "")
894 SIGNAL_ARGS_BEGIN(AppStateChanged
, "")
895 SIGNAL_ARG_DESCRIBE("id", DBUS_TYPE_UINT64_AS_STRING
, "")
896 SIGNAL_ARG_DESCRIBE("name", DBUS_TYPE_STRING_AS_STRING
, "")
897 SIGNAL_ARG_DESCRIBE("running", DBUS_TYPE_BOOLEAN_AS_STRING
, "")
898 SIGNAL_ARG_DESCRIBE("terminal", DBUS_TYPE_BOOLEAN_AS_STRING
, "Whether to run in terminal")
899 SIGNAL_ARG_DESCRIBE("level", DBUS_TYPE_BYTE_AS_STRING
, "Level")
903 SIGNAL_DESCRIBE(AppAdded
)
904 SIGNAL_DESCRIBE(AppRemoved
)
905 SIGNAL_DESCRIBE(AppStateChanged
)
908 INTERFACE_BEGIN(g_iface_app_supervisor
, IFACE_APP_SUPERVISOR
)
909 INTERFACE_DEFAULT_HANDLER
910 INTERFACE_EXPOSE_METHODS
911 INTERFACE_EXPOSE_SIGNALS