4 * - Need some kind of "wait for exit" system, maybe register with
5 * e_config? startup and restart apps could also be in e_config
8 /* local subsystem functions */
9 static void _e_startup(void);
10 static void _e_startup_next_cb(void *data);
11 static Eina_Bool _e_startup_event_cb(void *data, int ev_type, void *ev);
13 /* local subsystem globals */
14 static E_Order *startup_apps = NULL;
15 static int start_app_pos = -1;
16 static Ecore_Event_Handler *desktop_cache_update_handler = NULL;
18 /* externally accessible functions */
20 e_startup(E_Startup_Mode mode)
24 if (mode == E_STARTUP_START)
26 e_user_dir_concat_static(buf, "applications/startup/.order");
27 if (!ecore_file_exists(buf))
28 e_prefix_data_concat_static(buf, "data/applications/startup/.order");
30 else if (mode == E_STARTUP_RESTART)
32 e_user_dir_concat_static(buf, "applications/restart/.order");
33 if (!ecore_file_exists(buf))
34 e_prefix_data_concat_static(buf, "data/applications/restart/.order");
36 desktop_cache_update_handler =
37 ecore_event_handler_add(EFREET_EVENT_DESKTOP_CACHE_BUILD,
43 /* local subsystem functions */
47 Efreet_Desktop *desktop;
55 desktop = eina_list_nth(startup_apps->desktops, start_app_pos);
59 e_object_del(E_OBJECT(startup_apps));
65 e_exec(NULL, desktop, NULL, NULL, NULL);
66 snprintf(buf, sizeof(buf), "%s %s", _("Starting"), desktop->name);
67 e_init_status_set(buf);
68 ecore_job_add(_e_startup_next_cb, NULL);
72 _e_startup_next_cb(void *data __UNUSED__)
78 _e_startup_event_cb(void *data, int ev_type __UNUSED__, void *ev __UNUSED__)
82 ecore_event_handler_del(desktop_cache_update_handler);
84 startup_apps = e_order_new(buf);
89 return ECORE_CALLBACK_PASS_ON;