2004-12-20 19:01:19 -08:00
|
|
|
/*
|
|
|
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
|
|
|
*/
|
2004-11-24 19:37:45 -08:00
|
|
|
#include "e.h"
|
|
|
|
|
2004-11-26 03:11:05 -08:00
|
|
|
/* local subsystem functions */
|
2004-12-22 22:38:27 -08:00
|
|
|
static void _e_main_shutdown_push(int (*func)(void));
|
2004-11-24 19:37:45 -08:00
|
|
|
static void _e_main_shutdown(int errorcode);
|
|
|
|
|
2005-01-05 15:40:23 -08:00
|
|
|
static int _e_main_x_shutdown(void);
|
2004-11-24 19:37:45 -08:00
|
|
|
static int _e_main_dirs_init(void);
|
2004-12-22 22:38:27 -08:00
|
|
|
static int _e_main_dirs_shutdown(void);
|
2004-11-24 19:37:45 -08:00
|
|
|
static int _e_main_screens_init(void);
|
2004-12-22 22:38:27 -08:00
|
|
|
static int _e_main_screens_shutdown(void);
|
2004-11-24 19:37:45 -08:00
|
|
|
static int _e_main_path_init(void);
|
2004-12-22 22:38:27 -08:00
|
|
|
static int _e_main_path_shutdown(void);
|
2004-11-24 19:37:45 -08:00
|
|
|
static int _e_main_ipc_init(void);
|
2004-12-22 22:38:27 -08:00
|
|
|
static int _e_main_ipc_shutdown(void);
|
2004-11-24 19:37:45 -08:00
|
|
|
|
|
|
|
static void _e_main_cb_x_fatal(void *data);
|
|
|
|
static int _e_main_cb_signal_exit(void *data, int ev_type, void *ev);
|
2005-01-27 02:14:22 -08:00
|
|
|
static int _e_main_cb_signal_hup(void *data, int ev_type, void *ev);
|
2004-11-24 19:37:45 -08:00
|
|
|
static int _e_main_cb_x_flusher(void *data);
|
|
|
|
static int _e_main_cb_idler_before(void *data);
|
|
|
|
static int _e_main_cb_idler_after(void *data);
|
|
|
|
|
|
|
|
static int _e_main_cb_startup_fake_status(void *data);
|
|
|
|
static int _e_main_cb_startup_fake_end(void *data);
|
|
|
|
|
|
|
|
E_Path *path_data = NULL;
|
|
|
|
E_Path *path_images = NULL;
|
|
|
|
E_Path *path_fonts = NULL;
|
|
|
|
E_Path *path_themes = NULL;
|
|
|
|
E_Path *path_init = NULL;
|
2004-12-23 20:30:58 -08:00
|
|
|
E_Path *path_icons = NULL;
|
2004-11-24 20:07:48 -08:00
|
|
|
int restart = 0;
|
2005-05-08 23:50:36 -07:00
|
|
|
int good = 0;
|
|
|
|
int evil = 0;
|
2004-11-24 19:37:45 -08:00
|
|
|
|
2004-11-26 03:11:05 -08:00
|
|
|
/* local subsystem globals */
|
2004-11-24 19:37:45 -08:00
|
|
|
#define MAX_LEVEL 32
|
2004-12-22 22:38:27 -08:00
|
|
|
static int (*_e_main_shutdown_func[MAX_LEVEL]) (void);
|
2004-11-24 19:37:45 -08:00
|
|
|
static int _e_main_level = 0;
|
|
|
|
|
|
|
|
static Evas_List *_e_main_idler_before_list = NULL;
|
|
|
|
|
|
|
|
static Ecore_Idle_Enterer *_e_main_idle_enterer_before = NULL;
|
|
|
|
static Ecore_Idle_Enterer *_e_main_idle_enterer_after = NULL;
|
|
|
|
static Ecore_Idle_Enterer *_e_main_idle_enterer_flusher = NULL;
|
|
|
|
|
|
|
|
/* externally accessible functions */
|
|
|
|
int
|
|
|
|
main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
int ipc_failed = 0;
|
|
|
|
int i;
|
|
|
|
int nosplash = 0;
|
2004-12-10 20:02:26 -08:00
|
|
|
int nostartup = 0;
|
2004-12-09 05:56:06 -08:00
|
|
|
int after_restart = 0;
|
|
|
|
char buf[1024];
|
2005-01-05 01:09:03 -08:00
|
|
|
char *s;
|
2005-04-01 08:12:31 -08:00
|
|
|
#if 0
|
2005-01-27 02:14:22 -08:00
|
|
|
/* install the signal handlers. */
|
|
|
|
struct sigaction sigsegv_action;
|
2005-04-01 08:12:31 -08:00
|
|
|
|
|
|
|
sigsegv_action.sa_sigaction = &e_sigseg_act;
|
|
|
|
sigsegv_action.sa_flags = 0;
|
|
|
|
sigemptyset(&sigsegv_action.sa_mask);
|
2005-01-27 02:14:22 -08:00
|
|
|
sigaction(SIGSEGV, &sigsegv_action, NULL);
|
2005-04-01 08:12:31 -08:00
|
|
|
#endif
|
2005-01-27 02:14:22 -08:00
|
|
|
|
2004-12-23 20:44:05 -08:00
|
|
|
/* for debugging by redirecting stdout of e to a log file to tail */
|
|
|
|
setvbuf(stdout, NULL, _IONBF, 0);
|
2005-01-27 02:14:22 -08:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
if (getenv("NOSPLASH")) nosplash = 1;
|
2004-12-10 20:02:26 -08:00
|
|
|
if (getenv("NOSTARTUP")) nostartup = 1;
|
2005-05-08 23:50:36 -07:00
|
|
|
if (getenv("RESTART")) after_restart = 1;
|
2004-12-10 20:02:26 -08:00
|
|
|
|
2005-04-14 02:09:22 -07:00
|
|
|
e_util_env_set("RESTART", "1");
|
2005-04-11 13:25:52 -07:00
|
|
|
|
|
|
|
e_intl_init();
|
2004-12-09 05:56:06 -08:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
/* handle some command-line parameters */
|
|
|
|
for (i = 1; i < argc; i++)
|
|
|
|
{
|
|
|
|
if ((!strcmp(argv[i], "-display")) && (i < (argc - 1)))
|
|
|
|
{
|
|
|
|
i++;
|
2004-12-01 20:24:54 -08:00
|
|
|
|
2005-04-14 02:09:22 -07:00
|
|
|
e_util_env_set("DISPLAY", argv[i]);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
2005-03-19 09:31:42 -08:00
|
|
|
else if ((!strcmp(argv[i], "-fake-xinerama-screen")) && (i < (argc - 1)))
|
|
|
|
{
|
|
|
|
int x, y, w, h;
|
|
|
|
|
|
|
|
i++;
|
|
|
|
/* WWxHH+XX+YY */
|
|
|
|
if (sscanf(argv[i], "%ix%i+%i+%i", &w, &h, &x, &y) == 4)
|
|
|
|
e_xinerama_fake_screen_add(x, y, w, h);
|
|
|
|
}
|
2005-05-08 23:50:36 -07:00
|
|
|
else if (!strcmp(argv[i], "-good"))
|
|
|
|
{
|
|
|
|
good = 1;
|
|
|
|
evil = 0;
|
|
|
|
}
|
|
|
|
else if (!strcmp(argv[i], "-evil"))
|
|
|
|
{
|
|
|
|
good = 0;
|
|
|
|
evil = 1;
|
|
|
|
}
|
|
|
|
else if (!strcmp(argv[i], "-psychotic"))
|
|
|
|
{
|
|
|
|
good = 1;
|
|
|
|
evil = 1;
|
|
|
|
}
|
2005-03-19 09:31:42 -08:00
|
|
|
else if ((!strcmp(argv[i], "-h")) ||
|
|
|
|
(!strcmp(argv[i], "-help")) ||
|
|
|
|
(!strcmp(argv[i], "--help")))
|
|
|
|
{
|
|
|
|
printf
|
2005-05-08 23:50:36 -07:00
|
|
|
(_(
|
|
|
|
"Options:\n"
|
2005-04-11 13:25:52 -07:00
|
|
|
"\t-display DISPLAY\n"
|
|
|
|
"\t\tConnect to display named DISPLAY.\n"
|
|
|
|
"\t\tEG: -display :1.0\n"
|
|
|
|
"\t-fake-xinerama-screen WxH+X+Y\n"
|
|
|
|
"\t\tAdd a FAKE xinerama screen (instead of the real ones)\n"
|
|
|
|
"\t\tgiven the geometry. Add as many as you like. They all\n"
|
|
|
|
"\t\treplace the real xinerama screens, if any. This can\n"
|
|
|
|
"\t\tbe used to simulate xinerama.\n"
|
2005-05-08 23:50:36 -07:00
|
|
|
"\t\tEG: -fake-xinerama-screen 800x600+0+0 -fake-xinerama-screen 800x600+800+0\n"
|
|
|
|
"\t-good\n"
|
|
|
|
"\t\tBe good.\n"
|
|
|
|
"\t-evil\n"
|
|
|
|
"\t\tBe evil.\n"
|
|
|
|
"\t-psychotic\n"
|
|
|
|
"\t\tBe psychotic.\n"
|
|
|
|
)
|
2005-03-19 09:31:42 -08:00
|
|
|
);
|
|
|
|
exit(0);
|
|
|
|
}
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
2005-01-05 01:09:03 -08:00
|
|
|
|
|
|
|
/* fix up DISPLAY to be :N.0 if no .screen is in it */
|
|
|
|
s = getenv("DISPLAY");
|
|
|
|
if (s)
|
|
|
|
{
|
|
|
|
char *p;
|
|
|
|
|
|
|
|
p = strrchr(s, ':');
|
|
|
|
if (!p)
|
|
|
|
{
|
2005-04-14 02:09:22 -07:00
|
|
|
snprintf(buf, sizeof(buf), "%s:0.0", s);
|
|
|
|
e_util_env_set("DISPLAY", buf);
|
2005-01-05 01:09:03 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
p = strrchr(p, '.');
|
|
|
|
if (!p)
|
|
|
|
{
|
2005-04-14 02:09:22 -07:00
|
|
|
snprintf(buf, sizeof(buf), "%s.0", s);
|
|
|
|
e_util_env_set("DISPLAY", buf);
|
2005-01-05 01:09:03 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
/* init edje and set it up in frozen mode */
|
|
|
|
edje_init();
|
|
|
|
edje_freeze();
|
|
|
|
|
|
|
|
/* basic ecore init */
|
|
|
|
if (!ecore_init())
|
|
|
|
{
|
2005-04-11 13:25:52 -07:00
|
|
|
e_error_message_show(_("Enlightenment cannot Initialize Ecore!\n"
|
|
|
|
"Perhaps you are out of memory?"));
|
2004-11-24 19:37:45 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
_e_main_shutdown_push(ecore_shutdown);
|
|
|
|
/* setup my args */
|
2005-02-21 08:16:40 -08:00
|
|
|
ecore_app_args_set(argc, (const char **)argv);
|
2004-11-24 19:37:45 -08:00
|
|
|
/* setup a handler for when e is asked to exit via a system signal */
|
|
|
|
if (!ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _e_main_cb_signal_exit, NULL))
|
|
|
|
{
|
2005-04-11 13:25:52 -07:00
|
|
|
e_error_message_show(_("Enlightenment cannot set up an exit signal handler.\n"
|
|
|
|
"Perhaps you are out of memory?"));
|
2004-11-24 19:37:45 -08:00
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
2005-01-27 02:14:22 -08:00
|
|
|
if(!ecore_event_handler_add(ECORE_EVENT_SIGNAL_HUP, _e_main_cb_signal_hup, NULL))
|
|
|
|
{
|
2005-04-11 13:25:52 -07:00
|
|
|
e_error_message_show(_("Enlightenment cannot set up a HUP signal handler.\n"
|
|
|
|
"Perhaps you are out of memory?"));
|
2005-01-27 02:14:22 -08:00
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
2004-11-24 19:37:45 -08:00
|
|
|
|
2004-12-29 21:37:53 -08:00
|
|
|
/* an idle enterer to be called before all others */
|
2004-11-24 19:37:45 -08:00
|
|
|
_e_main_idle_enterer_before = ecore_idle_enterer_add(_e_main_cb_idler_before, NULL);
|
|
|
|
|
|
|
|
/* init x */
|
2004-12-01 20:24:54 -08:00
|
|
|
if (!ecore_x_init(NULL))
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2005-04-11 13:25:52 -07:00
|
|
|
e_error_message_show(_("Enlightenment cannot initialize its X connection.\n"
|
|
|
|
"Have you set your DISPLAY variable?"));
|
2004-11-24 19:37:45 -08:00
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
2005-01-05 15:40:23 -08:00
|
|
|
_e_main_shutdown_push(_e_main_x_shutdown);
|
2005-03-07 22:51:21 -08:00
|
|
|
if (!e_xinerama_init())
|
|
|
|
{
|
2005-04-11 13:25:52 -07:00
|
|
|
e_error_message_show(_("Enlightenment cannot setup xinerama wrapping.\n"
|
|
|
|
"This should not happen."));
|
2005-03-07 22:51:21 -08:00
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
|
|
|
_e_main_shutdown_push(e_xinerama_shutdown);
|
2004-11-24 19:37:45 -08:00
|
|
|
|
2005-05-07 06:50:38 -07:00
|
|
|
// ecore_x_grab();
|
2004-11-24 19:37:45 -08:00
|
|
|
|
|
|
|
ecore_x_io_error_handler_set(_e_main_cb_x_fatal, NULL);
|
2004-12-29 21:37:53 -08:00
|
|
|
|
|
|
|
/* Init window manager hints */
|
|
|
|
e_hints_init();
|
2004-11-24 19:37:45 -08:00
|
|
|
|
|
|
|
/* init generic communications */
|
|
|
|
if (!ecore_con_init())
|
|
|
|
{
|
2005-04-11 13:25:52 -07:00
|
|
|
e_error_message_show(_("Enlightenment cannot initialize the connections system.\n"
|
|
|
|
"Perhaps you are out of memory?"));
|
2004-11-24 19:37:45 -08:00
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
|
|
|
_e_main_shutdown_push(ecore_con_shutdown);
|
|
|
|
/* init ipc */
|
|
|
|
if (!ecore_ipc_init())
|
|
|
|
{
|
2005-04-11 13:25:52 -07:00
|
|
|
e_error_message_show(_("Enlightenment cannot initialize the IPC system.\n"
|
|
|
|
"Perhaps you are out of memory?"));
|
2004-11-24 19:37:45 -08:00
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
|
|
|
_e_main_shutdown_push(ecore_ipc_shutdown);
|
|
|
|
/* init the evas wrapper */
|
|
|
|
if (!ecore_evas_init())
|
2005-05-06 01:33:50 -07:00
|
|
|
{
|
2005-04-11 13:25:52 -07:00
|
|
|
e_error_message_show(_("Enlightenment cannot initialize the Evas system.\n"
|
|
|
|
"Perhaps you are out of memory?"));
|
2004-11-24 19:37:45 -08:00
|
|
|
_e_main_shutdown(-1);
|
2005-05-06 01:33:50 -07:00
|
|
|
}
|
|
|
|
if (!ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_SOFTWARE_X11))
|
|
|
|
{
|
|
|
|
e_error_message_show(_("Enlightenment found ecore_evas doesnt support Software X11\n"
|
|
|
|
"rendering in Evas. Please check your installation of Evas and\n"
|
|
|
|
"Ecore and check they support Software X11 rendering."));
|
|
|
|
_e_main_shutdown(-1);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
_e_main_shutdown_push(ecore_evas_shutdown);
|
2005-04-14 02:48:36 -07:00
|
|
|
/* init the file system */
|
|
|
|
if (!ecore_file_init())
|
|
|
|
{
|
|
|
|
e_error_message_show(_("Enlightenment cannot initialize the File system.\n"
|
|
|
|
"Perhaps you are out of memory?"));
|
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
|
|
|
_e_main_shutdown_push(ecore_file_shutdown);
|
2004-11-24 19:37:45 -08:00
|
|
|
|
2005-04-02 08:40:37 -08:00
|
|
|
|
|
|
|
/*** Finished loading subsystems, Loading WM Specifics ***/
|
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
/* setup directories we will be using for configurations sotrage etc. */
|
|
|
|
if (!_e_main_dirs_init())
|
|
|
|
{
|
2005-04-11 13:25:52 -07:00
|
|
|
e_error_message_show(_("Enlightenment cannot create directories in your home directory.\n"
|
|
|
|
"Perhaps you have no home directory or the disk is full?"));
|
2004-11-24 19:37:45 -08:00
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
|
|
|
_e_main_shutdown_push(_e_main_dirs_shutdown);
|
|
|
|
/* setup paths for finding things */
|
|
|
|
if (!_e_main_path_init())
|
|
|
|
{
|
2005-04-11 13:25:52 -07:00
|
|
|
e_error_message_show(_("Enlightenment cannot set up paths for finding files.\n"
|
|
|
|
"Perhaps you are out of memory?"));
|
2004-11-24 19:37:45 -08:00
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
|
|
|
_e_main_shutdown_push(_e_main_path_shutdown);
|
|
|
|
/* init config system */
|
|
|
|
if (!e_config_init())
|
|
|
|
{
|
2005-04-11 13:25:52 -07:00
|
|
|
e_error_message_show(_("Enlightenment cannot set up its config system."));
|
2004-11-24 19:37:45 -08:00
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
|
|
|
_e_main_shutdown_push(e_config_shutdown);
|
2005-04-29 09:04:43 -07:00
|
|
|
/* init actions system */
|
|
|
|
if (!e_actions_init())
|
|
|
|
{
|
|
|
|
e_error_message_show(_("Enlightenment cannot set up its actions system."));
|
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
|
|
|
_e_main_shutdown_push(e_actions_shutdown);
|
|
|
|
/* init bindings system */
|
|
|
|
if (!e_bindings_init())
|
|
|
|
{
|
|
|
|
e_error_message_show(_("Enlightenment cannot set up its bindings system."));
|
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
|
|
|
_e_main_shutdown_push(e_bindings_shutdown);
|
2005-05-06 21:34:26 -07:00
|
|
|
/* init popup system */
|
|
|
|
if (!e_popup_init())
|
|
|
|
{
|
|
|
|
e_error_message_show(_("Enlightenment cannot set up its popup system."));
|
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
|
|
|
_e_main_shutdown_push(e_popup_shutdown);
|
2004-11-24 19:37:45 -08:00
|
|
|
|
2004-12-04 23:43:51 -08:00
|
|
|
/* setup edje to animate @ e_config->framerate frames per sec. */
|
|
|
|
edje_frametime_set(1.0 / e_config->framerate);
|
2005-04-02 08:40:37 -08:00
|
|
|
|
|
|
|
/* init font system */
|
|
|
|
if (!e_font_init())
|
|
|
|
{
|
2005-04-11 13:25:52 -07:00
|
|
|
e_error_message_show(_("Enlightenment cannot set up its font system."));
|
2005-04-02 08:40:37 -08:00
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
|
|
|
_e_main_shutdown_push(e_font_shutdown);
|
|
|
|
e_font_apply();
|
2004-11-24 19:37:45 -08:00
|
|
|
e_canvas_recache();
|
2005-04-23 06:13:57 -07:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
/* setup init status window/screen */
|
|
|
|
if (!e_init_init())
|
|
|
|
{
|
2005-04-11 13:25:52 -07:00
|
|
|
e_error_message_show(_("Enlightenment cannot set up init screen.\n"
|
|
|
|
"Perhaps you are out of memory?"));
|
2004-11-24 19:37:45 -08:00
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
|
|
|
_e_main_shutdown_push(e_init_shutdown);
|
|
|
|
/* manage the root window */
|
|
|
|
if (!_e_main_screens_init())
|
|
|
|
{
|
2005-04-11 13:25:52 -07:00
|
|
|
e_error_message_show(_("Enlightenment set up window management for all the screens on your system\n"
|
|
|
|
"failed. Perhaps another window manager is running?\n"));
|
2004-11-24 19:37:45 -08:00
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
|
|
|
_e_main_shutdown_push(_e_main_screens_shutdown);
|
|
|
|
/* init app system */
|
|
|
|
if (!e_app_init())
|
|
|
|
{
|
2005-04-11 13:25:52 -07:00
|
|
|
e_error_message_show(_("Enlightenment cannot set up its app system."));
|
2004-11-24 19:37:45 -08:00
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
|
|
|
_e_main_shutdown_push(e_app_shutdown);
|
2005-04-21 03:09:28 -07:00
|
|
|
/* init theme system */
|
|
|
|
if (!e_theme_init())
|
|
|
|
{
|
|
|
|
e_error_message_show(_("Enlightenment cannot set up its theme system."));
|
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
|
|
|
_e_main_shutdown_push(e_theme_shutdown);
|
2004-11-24 19:37:45 -08:00
|
|
|
|
2005-04-24 20:06:06 -07:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
/* tell the error system that it can use gui dialogs now */
|
|
|
|
e_error_gui_set(1);
|
|
|
|
|
|
|
|
/* setup e ipc service */
|
|
|
|
if (!_e_main_ipc_init())
|
|
|
|
{
|
2005-04-11 15:01:51 -07:00
|
|
|
e_error_message_show(_("Enlightenment cannot set up the IPC socket.\n"
|
2005-04-11 13:25:52 -07:00
|
|
|
"It likely is already in use by an exisiting copy of Enlightenment.\n"
|
|
|
|
"Double check to see if Enlightenment is not already on this display,\n"
|
|
|
|
"but if that fails try deleting all files in ~/.ecore/enlightenment-*\n"
|
|
|
|
"and try running again."));
|
2004-11-24 19:37:45 -08:00
|
|
|
ipc_failed = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
_e_main_shutdown_push(_e_main_ipc_shutdown);
|
|
|
|
|
2005-03-06 23:27:52 -08:00
|
|
|
/* setup module loading etc */
|
|
|
|
if (!e_module_init())
|
|
|
|
{
|
2005-04-11 13:25:52 -07:00
|
|
|
e_error_message_show(_("Enlightenment cannot set up its module system."));
|
2005-03-06 23:27:52 -08:00
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
|
|
|
_e_main_shutdown_push(e_module_shutdown);
|
2005-04-23 06:13:57 -07:00
|
|
|
|
|
|
|
/* setup dnd */
|
|
|
|
if (!e_dnd_init())
|
|
|
|
{
|
|
|
|
e_error_message_show(_("Enlightenment cannot set up its dnd system."));
|
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
|
|
|
_e_main_shutdown_push(e_dnd_shutdown);
|
2005-04-30 00:15:22 -07:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
if (ipc_failed)
|
2005-04-11 13:25:52 -07:00
|
|
|
e_error_dialog_show(_("Enlightenment IPC setup error!"),
|
|
|
|
_("Enlightenment cannot set up the IPC socket.\n"
|
|
|
|
"It likely is already in use by an exisiting copy of Enlightenment.\n"
|
|
|
|
"Double check to see if Enlightenment is not already on this display,\n"
|
|
|
|
"but if that fails try deleting all files in ~/.ecore/enlightenment-*\n"
|
|
|
|
"and try running again."));
|
2004-11-24 19:37:45 -08:00
|
|
|
|
|
|
|
/* add in a handler that just before we go idle we flush x */
|
|
|
|
_e_main_idle_enterer_flusher = ecore_idle_enterer_add(_e_main_cb_x_flusher, NULL);
|
|
|
|
|
2005-03-06 23:27:52 -08:00
|
|
|
/* an idle enterer to be called after all others */
|
2004-11-24 19:37:45 -08:00
|
|
|
_e_main_idle_enterer_after = ecore_idle_enterer_add(_e_main_cb_idler_after, NULL);
|
|
|
|
|
2005-04-29 12:42:19 -07:00
|
|
|
e_managers_keys_grab();
|
|
|
|
|
2005-05-07 06:50:38 -07:00
|
|
|
// ecore_x_ungrab();
|
2004-11-24 19:37:45 -08:00
|
|
|
|
2005-04-11 13:25:52 -07:00
|
|
|
e_init_title_set(_("Enlightenment"));
|
2004-11-24 19:37:45 -08:00
|
|
|
e_init_version_set(VERSION);
|
2005-04-11 13:25:52 -07:00
|
|
|
e_init_status_set(_("Enlightenment Starting. Please wait."));
|
2004-12-09 05:56:06 -08:00
|
|
|
|
2004-12-10 20:02:26 -08:00
|
|
|
if (!nostartup)
|
|
|
|
{
|
|
|
|
if (after_restart) e_startup(E_STARTUP_RESTART);
|
|
|
|
else e_startup(E_STARTUP_START);
|
|
|
|
}
|
2004-12-09 05:56:06 -08:00
|
|
|
|
|
|
|
if ((nosplash) || (after_restart))
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
ecore_timer_add(0.0, _e_main_cb_startup_fake_end, NULL);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-04-11 13:25:52 -07:00
|
|
|
ecore_timer_add( 3.0, _e_main_cb_startup_fake_status, _("Artificially slowing startup so you can see it all."));
|
|
|
|
ecore_timer_add( 7.5, _e_main_cb_startup_fake_status, _("This is development code, so be warned."));
|
|
|
|
ecore_timer_add(12.0, _e_main_cb_startup_fake_status, _("Most features do not work yet, and those that do are buggy."));
|
2004-11-24 19:37:45 -08:00
|
|
|
ecore_timer_add(16.0, _e_main_cb_startup_fake_end, NULL);
|
|
|
|
}
|
|
|
|
|
2005-03-13 03:17:27 -08:00
|
|
|
/* run any testing code now we are set up */
|
|
|
|
e_test();
|
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
/* start our main loop */
|
|
|
|
ecore_main_loop_begin();
|
|
|
|
|
|
|
|
/* ask all modules to save their config and then shutdown */
|
2005-02-07 19:51:08 -08:00
|
|
|
/* NB: no need to do this as config shutdown will flush any saves */
|
|
|
|
/* and all changed config was already saved before */
|
|
|
|
e_config_save_flush();
|
2004-11-24 19:37:45 -08:00
|
|
|
|
|
|
|
/* unroll our stack of shutdown functions with exit code of 0 */
|
|
|
|
_e_main_shutdown(0);
|
2004-11-24 20:07:48 -08:00
|
|
|
|
2005-04-13 19:10:32 -07:00
|
|
|
e_intl_shutdown();
|
|
|
|
|
2004-11-24 20:07:48 -08:00
|
|
|
/* if we were flagged to restart, then restart. */
|
|
|
|
if (restart)
|
|
|
|
{
|
|
|
|
ecore_app_restart();
|
|
|
|
}
|
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
/* just return 0 to keep the compiler quiet */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2005-04-02 08:40:37 -08:00
|
|
|
/* FIXME: make safe to delete within a callback */
|
2004-11-24 19:37:45 -08:00
|
|
|
E_Before_Idler *
|
|
|
|
e_main_idler_before_add(int (*func) (void *data), void *data, int once)
|
|
|
|
{
|
|
|
|
E_Before_Idler *eb;
|
|
|
|
|
|
|
|
eb = calloc(1, sizeof(E_Before_Idler));
|
|
|
|
eb->func = func;
|
|
|
|
eb->data = data;
|
|
|
|
eb->once = once;
|
|
|
|
_e_main_idler_before_list = evas_list_append(_e_main_idler_before_list, eb);
|
|
|
|
return eb;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
e_main_idler_before_del(E_Before_Idler *eb)
|
|
|
|
{
|
|
|
|
eb->delete_me = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* local subsystem functions */
|
|
|
|
static void
|
2004-12-22 22:38:27 -08:00
|
|
|
_e_main_shutdown_push(int (*func) (void))
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
_e_main_level++;
|
|
|
|
if (_e_main_level > MAX_LEVEL)
|
|
|
|
{
|
|
|
|
_e_main_level--;
|
|
|
|
e_error_message_show("WARNING: too many init levels. MAX = %i", MAX_LEVEL);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
_e_main_shutdown_func[_e_main_level - 1] = func;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_e_main_shutdown(int errorcode)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
printf("E17: Begin shutdown procedure!\n");
|
|
|
|
if (_e_main_idle_enterer_before)
|
|
|
|
{
|
|
|
|
ecore_idle_enterer_del(_e_main_idle_enterer_before);
|
|
|
|
_e_main_idle_enterer_before = NULL;
|
|
|
|
}
|
|
|
|
if (_e_main_idle_enterer_after)
|
|
|
|
{
|
|
|
|
ecore_idle_enterer_del(_e_main_idle_enterer_after);
|
|
|
|
_e_main_idle_enterer_after = NULL;
|
|
|
|
}
|
|
|
|
if (_e_main_idle_enterer_flusher)
|
|
|
|
{
|
|
|
|
ecore_idle_enterer_del(_e_main_idle_enterer_flusher);
|
|
|
|
_e_main_idle_enterer_flusher = NULL;
|
|
|
|
}
|
|
|
|
for (i = _e_main_level - 1; i >= 0; i--)
|
|
|
|
(*_e_main_shutdown_func[i])();
|
2004-11-24 20:07:48 -08:00
|
|
|
if (errorcode < 0) exit(errorcode);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
2005-01-05 15:40:23 -08:00
|
|
|
static int
|
|
|
|
_e_main_x_shutdown(void)
|
|
|
|
{
|
2005-05-07 06:50:38 -07:00
|
|
|
// ecore_x_ungrab();
|
2005-01-05 15:40:23 -08:00
|
|
|
ecore_x_focus_reset();
|
|
|
|
ecore_x_events_allow_all();
|
|
|
|
|
|
|
|
ecore_x_shutdown();
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
static int
|
|
|
|
_e_main_dirs_init(void)
|
|
|
|
{
|
|
|
|
char *homedir;
|
|
|
|
char buf[PATH_MAX];
|
|
|
|
const char *dirs[] =
|
|
|
|
{
|
|
|
|
"%s/.e",
|
|
|
|
"%s/.e/e",
|
|
|
|
"%s/.e/e/images",
|
|
|
|
"%s/.e/e/fonts",
|
|
|
|
"%s/.e/e/themes",
|
|
|
|
"%s/.e/e/init",
|
2004-12-23 20:30:58 -08:00
|
|
|
"%s/.e/e/icons",
|
2004-11-24 19:37:45 -08:00
|
|
|
"%s/.e/e/backgrounds",
|
|
|
|
"%s/.e/e/applications",
|
|
|
|
"%s/.e/e/applications/all",
|
|
|
|
"%s/.e/e/applications/favorite",
|
|
|
|
"%s/.e/e/applications/bar",
|
2004-12-09 05:56:06 -08:00
|
|
|
"%s/.e/e/applications/startup",
|
|
|
|
"%s/.e/e/applications/restart",
|
2004-12-04 23:43:51 -08:00
|
|
|
"%s/.e/e/modules",
|
|
|
|
"%s/.e/e/config"
|
2004-11-24 19:37:45 -08:00
|
|
|
};
|
|
|
|
int i;
|
|
|
|
|
|
|
|
homedir = e_user_homedir_get();
|
|
|
|
if (!homedir) return 0;
|
2004-12-22 22:38:27 -08:00
|
|
|
for (i = 0; i < (int)(sizeof(dirs) / sizeof(char *)); i++)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), dirs[i], homedir);
|
2005-02-21 08:16:40 -08:00
|
|
|
if (!ecore_file_mkpath(buf))
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
e_error_message_show("Error creating directory:\n"
|
|
|
|
"%s",
|
|
|
|
buf);
|
|
|
|
free(homedir);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
2004-12-01 23:00:30 -08:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
/* FIXME: THIS is a hack to get people started!!! */
|
2005-02-08 22:40:23 -08:00
|
|
|
/* err dont just disable it - replace it with a proper wizard tool */
|
|
|
|
/* outside e's main source to populate these directories from gnome/kde */
|
|
|
|
/* app menu data etc. */
|
2005-03-06 23:27:52 -08:00
|
|
|
snprintf(buf, sizeof(buf), "%s/.e/e/applications/bar/.order", homedir);
|
2005-02-21 08:16:40 -08:00
|
|
|
if (!ecore_file_exists(buf))
|
2004-12-03 00:56:35 -08:00
|
|
|
{
|
|
|
|
printf("GETTING YOU STARTED!\n");
|
|
|
|
snprintf(buf, sizeof(buf),
|
|
|
|
"gzip -d -c < %s/data/other/applications.tar.gz | "
|
|
|
|
"(cd %s/.e/e/ ; tar -xf -)",
|
|
|
|
PACKAGE_DATA_DIR,
|
|
|
|
homedir);
|
2004-12-09 05:56:06 -08:00
|
|
|
system(buf);
|
2004-12-03 00:56:35 -08:00
|
|
|
}
|
2004-11-24 19:37:45 -08:00
|
|
|
free(homedir);
|
2005-04-11 13:25:52 -07:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2004-12-22 22:38:27 -08:00
|
|
|
static int
|
2004-11-24 19:37:45 -08:00
|
|
|
_e_main_dirs_shutdown(void)
|
|
|
|
{
|
2004-12-22 22:38:27 -08:00
|
|
|
return 1;
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
_e_main_screens_init(void)
|
|
|
|
{
|
|
|
|
Ecore_X_Window *roots;
|
|
|
|
int num, i;
|
|
|
|
|
2005-01-14 06:01:08 -08:00
|
|
|
if (!e_atoms_init()) return 0;
|
2004-11-24 19:37:45 -08:00
|
|
|
if (!e_manager_init()) return 0;
|
2004-12-25 07:33:48 -08:00
|
|
|
if (!e_container_init()) return 0;
|
2005-01-05 02:37:53 -08:00
|
|
|
if (!e_zone_init()) return 0;
|
|
|
|
if (!e_desk_init()) return 0;
|
2005-01-15 01:50:26 -08:00
|
|
|
if (!e_gadman_init()) return 0;
|
|
|
|
if (!e_menu_init()) return 0;
|
2004-11-24 19:37:45 -08:00
|
|
|
|
|
|
|
num = 0;
|
|
|
|
roots = ecore_x_window_root_list(&num);
|
|
|
|
if ((!roots) || (num <= 0))
|
|
|
|
{
|
|
|
|
e_error_message_show("X reports there are no root windows and %i screens!\n",
|
|
|
|
num);
|
|
|
|
return 0;
|
|
|
|
}
|
2005-01-14 06:01:08 -08:00
|
|
|
if (!e_focus_init()) return 0;
|
|
|
|
if (!e_border_init()) return 0;
|
2004-11-24 19:37:45 -08:00
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
{
|
|
|
|
E_Manager *man;
|
|
|
|
E_Container *con;
|
|
|
|
|
|
|
|
man = e_manager_new(roots[i]);
|
|
|
|
e_init_show();
|
|
|
|
if (man) e_manager_show(man);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
e_error_message_show("Cannot create manager object for screen %i\n",
|
|
|
|
i);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
con = e_container_new(man);
|
|
|
|
if (con)
|
|
|
|
{
|
2005-02-13 03:17:46 -08:00
|
|
|
e_manager_manage_windows(man);
|
2005-03-11 05:09:06 -08:00
|
|
|
if (e_config->use_virtual_roots)
|
|
|
|
{
|
|
|
|
ecore_x_netwm_desk_roots_set(man->root, 1, &(con->win));
|
|
|
|
}
|
2004-11-24 19:37:45 -08:00
|
|
|
e_container_show(con);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-01-03 01:34:24 -08:00
|
|
|
e_error_message_show("Cannot create desktop object for manager on screen %i\n",
|
2004-11-24 19:37:45 -08:00
|
|
|
i);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
free(roots);
|
|
|
|
ecore_x_sync();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2004-12-22 22:38:27 -08:00
|
|
|
static int
|
2004-11-24 19:37:45 -08:00
|
|
|
_e_main_screens_shutdown(void)
|
|
|
|
{
|
2005-01-14 06:01:08 -08:00
|
|
|
e_border_shutdown();
|
|
|
|
e_focus_shutdown();
|
2005-01-15 01:50:26 -08:00
|
|
|
e_menu_shutdown();
|
|
|
|
e_gadman_shutdown();
|
2005-01-05 02:37:53 -08:00
|
|
|
e_desk_shutdown();
|
|
|
|
e_zone_shutdown();
|
2004-12-25 07:33:48 -08:00
|
|
|
e_container_shutdown();
|
2004-11-24 19:37:45 -08:00
|
|
|
e_manager_shutdown();
|
2005-01-14 06:01:08 -08:00
|
|
|
e_atoms_shutdown();
|
2004-12-22 22:38:27 -08:00
|
|
|
return 1;
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
_e_main_path_init(void)
|
|
|
|
{
|
|
|
|
path_data = e_path_new();
|
|
|
|
if (!path_data)
|
|
|
|
{
|
|
|
|
e_error_message_show("Cannot allocate path for path_data\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
e_path_path_append(path_data, PACKAGE_DATA_DIR"/data");
|
|
|
|
path_images = e_path_new();
|
|
|
|
if (!path_images)
|
|
|
|
{
|
|
|
|
e_error_message_show("Cannot allocate path for path_images\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
e_path_path_append(path_images, "~/.e/e/images");
|
|
|
|
e_path_path_append(path_images, PACKAGE_DATA_DIR"/data/images");
|
|
|
|
path_fonts = e_path_new();
|
|
|
|
if (!path_fonts)
|
|
|
|
{
|
|
|
|
e_error_message_show("Cannot allocate path for path_fonts\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
e_path_path_append(path_fonts, "~/.e/e/fonts");
|
|
|
|
e_path_path_append(path_fonts, PACKAGE_DATA_DIR"/data/fonts");
|
|
|
|
path_themes = e_path_new();
|
|
|
|
if (!path_themes)
|
|
|
|
{
|
|
|
|
e_error_message_show("Cannot allocate path for path_themes\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
e_path_path_append(path_themes, "~/.e/e/themes");
|
|
|
|
e_path_path_append(path_themes, PACKAGE_DATA_DIR"/data/themes");
|
2004-12-23 20:30:58 -08:00
|
|
|
path_icons = e_path_new();
|
|
|
|
if (!path_icons)
|
|
|
|
{
|
|
|
|
e_error_message_show("Cannot allocate path for path_icons\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
e_path_path_append(path_icons, "~/.e/e/icons");
|
|
|
|
e_path_path_append(path_icons, PACKAGE_DATA_DIR"/data/icons");
|
2004-11-24 19:37:45 -08:00
|
|
|
path_init = e_path_new();
|
|
|
|
if (!path_init)
|
|
|
|
{
|
|
|
|
e_error_message_show("Cannot allocate path for path_init\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
e_path_path_append(path_init, "~/.e/e/init");
|
|
|
|
e_path_path_append(path_init, PACKAGE_DATA_DIR"/data/init");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2004-12-22 22:38:27 -08:00
|
|
|
static int
|
2004-11-24 19:37:45 -08:00
|
|
|
_e_main_path_shutdown(void)
|
|
|
|
{
|
|
|
|
if (path_data)
|
|
|
|
{
|
2005-02-08 10:07:00 -08:00
|
|
|
e_object_del(E_OBJECT(path_data));
|
2004-11-24 19:37:45 -08:00
|
|
|
path_data = NULL;
|
|
|
|
}
|
|
|
|
if (path_images)
|
|
|
|
{
|
2005-02-08 10:07:00 -08:00
|
|
|
e_object_del(E_OBJECT(path_images));
|
2004-11-24 19:37:45 -08:00
|
|
|
path_images = NULL;
|
|
|
|
}
|
|
|
|
if (path_fonts)
|
|
|
|
{
|
2005-02-08 10:07:00 -08:00
|
|
|
e_object_del(E_OBJECT(path_fonts));
|
2004-11-24 19:37:45 -08:00
|
|
|
path_fonts = NULL;
|
|
|
|
}
|
|
|
|
if (path_themes)
|
|
|
|
{
|
2005-02-08 10:07:00 -08:00
|
|
|
e_object_del(E_OBJECT(path_themes));
|
2004-11-24 19:37:45 -08:00
|
|
|
path_themes = NULL;
|
|
|
|
}
|
2004-12-23 20:30:58 -08:00
|
|
|
if (path_icons)
|
|
|
|
{
|
2005-02-08 10:07:00 -08:00
|
|
|
e_object_del(E_OBJECT(path_icons));
|
2004-12-23 20:30:58 -08:00
|
|
|
path_icons = NULL;
|
|
|
|
}
|
2004-11-24 19:37:45 -08:00
|
|
|
if (path_init)
|
|
|
|
{
|
2005-02-08 10:07:00 -08:00
|
|
|
e_object_del(E_OBJECT(path_init));
|
2004-11-24 19:37:45 -08:00
|
|
|
path_init = NULL;
|
|
|
|
}
|
2004-12-22 22:38:27 -08:00
|
|
|
return 1;
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
_e_main_ipc_init(void)
|
|
|
|
{
|
|
|
|
if (!e_ipc_init())
|
|
|
|
{
|
|
|
|
e_error_message_show("Cannot init IPC subsystem!\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2004-12-22 22:38:27 -08:00
|
|
|
static int
|
2004-11-24 19:37:45 -08:00
|
|
|
_e_main_ipc_shutdown(void)
|
|
|
|
{
|
|
|
|
e_ipc_shutdown();
|
2004-12-22 22:38:27 -08:00
|
|
|
return 1;
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-04-12 23:03:50 -07:00
|
|
|
_e_main_cb_x_fatal(void *data __UNUSED__)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
e_error_gui_set(0);
|
|
|
|
e_error_message_show("Lost X connection.");
|
|
|
|
ecore_main_loop_quit();
|
|
|
|
_e_main_shutdown(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2005-04-12 23:03:50 -07:00
|
|
|
_e_main_cb_signal_exit(void *data __UNUSED__, int ev_type __UNUSED__, void *ev __UNUSED__)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
/* called on ctrl-c, kill (pid) (also SIGINT, SIGTERM and SIGQIT) */
|
|
|
|
ecore_main_loop_quit();
|
|
|
|
return 1;
|
|
|
|
}
|
2005-02-07 05:51:09 -08:00
|
|
|
|
2005-01-27 02:14:22 -08:00
|
|
|
static int
|
2005-04-12 23:03:50 -07:00
|
|
|
_e_main_cb_signal_hup(void *data __UNUSED__, int ev_type __UNUSED__, void *ev __UNUSED__)
|
2005-01-27 02:14:22 -08:00
|
|
|
{
|
|
|
|
/* called on SIGHUP to restart Enlightenment */
|
|
|
|
printf("RESTART ON!\n");
|
|
|
|
restart = 1;
|
|
|
|
ecore_main_loop_quit();
|
2005-02-07 05:51:09 -08:00
|
|
|
return 1;
|
2005-01-27 02:14:22 -08:00
|
|
|
}
|
2004-11-24 19:37:45 -08:00
|
|
|
|
|
|
|
static int
|
2005-04-12 23:03:50 -07:00
|
|
|
_e_main_cb_x_flusher(void *data __UNUSED__)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
ecore_x_flush();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2005-04-12 23:03:50 -07:00
|
|
|
_e_main_cb_idler_before(void *data __UNUSED__)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
Evas_List *l, *pl;
|
|
|
|
|
|
|
|
e_menu_idler_before();
|
|
|
|
e_focus_idler_before();
|
|
|
|
e_border_idler_before();
|
2005-05-06 21:34:26 -07:00
|
|
|
e_popup_idler_before();
|
2004-11-24 19:37:45 -08:00
|
|
|
for (l = _e_main_idler_before_list; l; l = l->next)
|
|
|
|
{
|
|
|
|
E_Before_Idler *eb;
|
|
|
|
|
|
|
|
eb = l->data;
|
|
|
|
if (!eb->delete_me)
|
|
|
|
{
|
|
|
|
if (!eb->func(eb->data)) eb->delete_me = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (l = _e_main_idler_before_list; l;)
|
|
|
|
{
|
|
|
|
E_Before_Idler *eb;
|
|
|
|
|
|
|
|
eb = l->data;
|
|
|
|
pl = l;
|
|
|
|
l = l->next;
|
|
|
|
if ((eb->once) || (eb->delete_me))
|
|
|
|
{
|
|
|
|
_e_main_idler_before_list =
|
|
|
|
evas_list_remove_list(_e_main_idler_before_list, pl);
|
|
|
|
free(eb);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
edje_thaw();
|
|
|
|
// printf("IN to idle... %3.3f\n", ecore_time_get());
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2005-04-12 23:03:50 -07:00
|
|
|
_e_main_cb_idler_after(void *data __UNUSED__)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
// printf("OUT of idle... %3.3f\n", ecore_time_get());
|
|
|
|
edje_freeze();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
_e_main_cb_startup_fake_status(void *data)
|
|
|
|
{
|
|
|
|
e_init_status_set((const char *)data);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2005-04-12 23:03:50 -07:00
|
|
|
_e_main_cb_startup_fake_end(void *data __UNUSED__)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
|
|
|
e_init_hide();
|
|
|
|
return 0;
|
|
|
|
}
|