enlightenment/src/bin/e_main.c

1912 lines
55 KiB
C
Raw Normal View History

#include "e.h"
#define MAX_LEVEL 80
#define TS_DO
#ifdef TS_DO
2012-06-19 05:20:33 -07:00
# define TS(x) \
{ \
t1 = ecore_time_unix_get(); \
printf("ESTART: %1.5f [%1.5f] - %s\n", t1 - t0, t1 - t2, x); \
t2 = t1; \
}
static double t0, t1, t2;
#else
# define TS(x)
#endif
/*
* i need to make more use of these when i'm baffled as to when something is
* up. other hooks:
2012-06-19 05:20:33 -07:00
*
* void *(*__malloc_hook)(size_t size, const void *caller);
2012-06-19 05:20:33 -07:00
*
* void *(*__realloc_hook)(void *ptr, size_t size, const void *caller);
*
* void *(*__memalign_hook)(size_t alignment, size_t size,
* const void *caller);
*
* void (*__free_hook)(void *ptr, const void *caller);
*
* void (*__malloc_initialize_hook)(void);
*
* void (*__after_morecore_hook)(void);
*
2012-06-19 05:20:33 -07:00
static void my_init_hook(void);
static void my_free_hook(void *p, const void *caller);
2012-06-19 05:20:33 -07:00
static void (*old_free_hook)(void *ptr, const void *caller) = NULL;
void (*__free_hook)(void *ptr, const void *caller);
2012-06-19 05:20:33 -07:00
void (*__malloc_initialize_hook) (void) = my_init_hook;
static void
my_init_hook(void)
{
old_free_hook = __free_hook;
__free_hook = my_free_hook;
2012-06-19 05:20:33 -07:00
}
2012-06-19 05:20:33 -07:00
//void *magicfree = NULL;
2012-06-19 05:20:33 -07:00
static void
my_free_hook(void *p, const void *caller)
{
__free_hook = old_free_hook;
2012-06-19 05:20:33 -07:00
// if ((p) && (p == magicfree))
// {
// printf("CAUGHT!!!!! %p ...\n", p);
// abort();
// }
free(p);
__free_hook = my_free_hook;
2012-06-19 05:20:33 -07:00
}
*/
/* local function prototypes */
2012-06-19 05:20:33 -07:00
static void _e_main_shutdown(int errcode);
static void _e_main_shutdown_push(int (*func)(void));
static void _e_main_parse_arguments(int argc, char **argv);
static void _e_main_cb_x_fatal(void *data __UNUSED__);
static Eina_Bool _e_main_cb_signal_exit(void *data __UNUSED__, int ev_type __UNUSED__, void *ev __UNUSED__);
static Eina_Bool _e_main_cb_signal_hup(void *data __UNUSED__, int ev_type __UNUSED__, void *ev __UNUSED__);
static Eina_Bool _e_main_cb_signal_user(void *data __UNUSED__, int ev_type __UNUSED__, void *ev);
2012-06-19 05:20:33 -07:00
static int _e_main_x_shutdown(void);
static int _e_main_dirs_init(void);
static int _e_main_dirs_shutdown(void);
static int _e_main_path_init(void);
static int _e_main_path_shutdown(void);
static void _e_main_test_formats(void);
static int _e_main_screens_init(void);
static int _e_main_screens_shutdown(void);
static void _e_main_desk_save(void);
static void _e_main_desk_restore(E_Manager *man, E_Container *con);
static void _e_main_efreet_paths_init(void);
static void _e_main_modules_load(Eina_Bool safe_mode);
static void _e_main_manage_all(void);
static Eina_Bool _e_main_cb_x_flusher(void *data __UNUSED__);
static Eina_Bool _e_main_cb_idle_before(void *data __UNUSED__);
static Eina_Bool _e_main_cb_idle_after(void *data __UNUSED__);
static Eina_Bool _e_main_cb_startup_fake_end(void *data __UNUSED__);
/* local variables */
static Eina_Bool really_know = EINA_FALSE;
static Eina_Bool locked = EINA_FALSE;
static Eina_Bool inloop = EINA_FALSE;
static jmp_buf x_fatal_buff;
static int _e_main_lvl = 0;
2012-06-19 05:20:33 -07:00
static int(*_e_main_shutdown_func[MAX_LEVEL]) (void);
static Eina_List *_idle_before_list = NULL;
static Ecore_Idle_Enterer *_idle_before = NULL;
static Ecore_Idle_Enterer *_idle_after = NULL;
static Ecore_Idle_Enterer *_idle_flush = NULL;
static Ecore_Event_Handler *mod_init_end = NULL;
/* external variables */
EAPI Eina_Bool e_precache_end = EINA_FALSE;
EAPI Eina_Bool x_fatal = EINA_FALSE;
EAPI Eina_Bool good = EINA_FALSE;
EAPI Eina_Bool evil = EINA_FALSE;
EAPI Eina_Bool starting = EINA_TRUE;
EAPI Eina_Bool stopping = EINA_FALSE;
EAPI Eina_Bool restart = EINA_FALSE;
EAPI Eina_Bool e_nopause = EINA_FALSE;
static void
_xdg_data_dirs_augment(void)
{
const char *s = getenv("XDG_DATA_DIRS");
const char *p = e_prefix_get();
char newpath[4096], buf[4096];
if (!p) return;
snprintf(newpath, sizeof(newpath), "%s:%s/share", e_prefix_data_get(), p);
if (s)
{
if (strncmp(s, newpath, strlen(newpath)))
{
snprintf(buf, sizeof(buf), "%s:%s", newpath, s);
e_util_env_set("XDG_DATA_DIRS", buf);
}
}
else
{
snprintf(buf, sizeof(buf), "%s:/usr/local/share:/usr/share", newpath);
e_util_env_set("XDG_DATA_DIRS", buf);
}
if (!getenv("XDG_RUNTIME_DIR"))
{
const char *dir;
snprintf(buf, sizeof(buf), "/tmp/xdg-XXXXXX");
dir = mkdtemp(buf);
if (!dir) dir = "/tmp";
e_util_env_set("XDG_RUNTIME_DIR", dir);
}
}
static Eina_Bool
_e_main_shelf_init_job(void *data EINA_UNUSED)
{
e_shelf_config_update();
return ECORE_CALLBACK_CANCEL;
}
/* externally accessible functions */
2012-06-19 05:20:33 -07:00
int
main(int argc, char **argv)
{
Eina_Bool nostartup = EINA_FALSE;
Eina_Bool safe_mode = EINA_FALSE;
Eina_Bool after_restart = EINA_FALSE;
Eina_Bool waslocked = EINA_FALSE;
double t = 0.0, tstart = 0.0;
char *s = NULL, buff[32];
struct sigaction action;
#ifdef TS_DO
t0 = t1 = t2 = ecore_time_unix_get();
#endif
TS("Begin Startup");
/* trap deadly bug signals and allow some form of sane recovery */
/* or ability to gdb attach and debug at this point - better than your */
/* wm/desktop vanishing and not knowing what happened */
if (!getenv("NOTIFY_SOCKET"))
{
TS("Signal Trap");
action.sa_sigaction = e_sigseg_act;
action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
sigemptyset(&action.sa_mask);
sigaction(SIGSEGV, &action, NULL);
action.sa_sigaction = e_sigill_act;
action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
sigemptyset(&action.sa_mask);
sigaction(SIGILL, &action, NULL);
action.sa_sigaction = e_sigfpe_act;
action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
sigemptyset(&action.sa_mask);
sigaction(SIGFPE, &action, NULL);
action.sa_sigaction = e_sigbus_act;
action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
sigemptyset(&action.sa_mask);
sigaction(SIGBUS, &action, NULL);
action.sa_sigaction = e_sigabrt_act;
action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
sigemptyset(&action.sa_mask);
sigaction(SIGABRT, &action, NULL);
TS("Signal Trap Done");
}
t = ecore_time_unix_get();
s = getenv("E_START_TIME");
2012-06-19 05:20:33 -07:00
if ((s) && (!getenv("E_RESTART_OK")))
{
tstart = atof(s);
if ((t - tstart) < 5.0) safe_mode = EINA_TRUE;
}
tstart = t;
snprintf(buff, sizeof(buff), "%1.1f", tstart);
e_util_env_set("E_START_TIME", buff);
if (getenv("E_START_MTRACK"))
e_util_env_set("MTRACK", NULL);
TS("Eina Init");
2012-06-19 05:20:33 -07:00
if (!eina_init())
{
e_error_message_show(_("Enlightenment cannot initialize Eina!\n"));
_e_main_shutdown(-1);
}
_e_main_shutdown_push(eina_shutdown);
if (!e_log_init())
{
e_error_message_show(_("Enlightenment could not create a logging domain!\n"));
_e_main_shutdown(-1);
}
#ifdef TS_DO
#undef TS
# define TS(x) \
{ \
t1 = ecore_time_unix_get(); \
printf("ESTART: %1.5f [%1.5f] - %s\n", t1 - t0, t1 - t2, x); \
t2 = t1; \
2012-06-19 05:20:33 -07:00
}
#endif
TS("Eina Init Done");
_e_main_shutdown_push(e_log_shutdown);
TS("Determine Prefix");
2012-06-19 05:20:33 -07:00
if (!e_prefix_determine(argv[0]))
{
2012-06-19 05:20:33 -07:00
fprintf(stderr,
"ERROR: Enlightenment cannot determine it's installed\n"
" prefix from the system or argv[0].\n"
" This is because it is not on Linux AND has been\n"
" executed strangely. This is unusual.\n");
}
TS("Determine Prefix Done");
/* for debugging by redirecting stdout of e to a log file to tail */
setvbuf(stdout, NULL, _IONBF, 0);
TS("Environment Variables");
if (getenv("E_RESTART")) after_restart = EINA_TRUE;
if (getenv("DESKTOP_STARTUP_ID"))
e_util_env_set("DESKTOP_STARTUP_ID", NULL);
e_util_env_set("E_RESTART_OK", NULL);
e_util_env_set("PANTS", "ON");
e_util_env_set("DESKTOP", "Enlightenment-0.17.0");
TS("Environment Variables Done");
TS("Parse Arguments");
_e_main_parse_arguments(argc, argv);
TS("Parse Arguments Done");
/*** Initialize Core EFL Libraries We Need ***/
TS("Eet Init");
2012-06-19 05:20:33 -07:00
if (!eet_init())
{
e_error_message_show(_("Enlightenment cannot initialize Eet!\n"));
_e_main_shutdown(-1);
}
TS("Eet Init Done");
_e_main_shutdown_push(eet_shutdown);
TS("Ecore Init");
2012-06-19 05:20:33 -07:00
if (!ecore_init())
{
e_error_message_show(_("Enlightenment cannot initialize Ecore!\n"));
_e_main_shutdown(-1);
}
TS("Ecore Init Done");
_e_main_shutdown_push(ecore_shutdown);
TS("EIO Init");
if (!eio_init())
{
e_error_message_show(_("Enlightenment cannot initialize EIO!\n"));
_e_main_shutdown(-1);
}
TS("EIO Init Done");
_e_main_shutdown_push(eio_shutdown);
ecore_app_args_set(argc, (const char **)argv);
TS("Ecore Event Handlers");
2012-06-19 05:20:33 -07:00
if (!ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT,
_e_main_cb_signal_exit, NULL))
{
2012-06-19 05:20:33 -07:00
e_error_message_show(_("Enlightenment cannot set up an exit signal handler.\n"
"Perhaps you are out of memory?"));
_e_main_shutdown(-1);
}
2012-06-19 05:20:33 -07:00
if (!ecore_event_handler_add(ECORE_EVENT_SIGNAL_HUP,
_e_main_cb_signal_hup, NULL))
{
2012-06-19 05:20:33 -07:00
e_error_message_show(_("Enlightenment cannot set up a HUP signal handler.\n"
"Perhaps you are out of memory?"));
_e_main_shutdown(-1);
}
2012-06-19 05:20:33 -07:00
if (!ecore_event_handler_add(ECORE_EVENT_SIGNAL_USER,
_e_main_cb_signal_user, NULL))
{
2012-06-19 05:20:33 -07:00
e_error_message_show(_("Enlightenment cannot set up a USER signal handler.\n"
"Perhaps you are out of memory?"));
_e_main_shutdown(-1);
}
TS("Ecore Event Handlers Done");
TS("Ecore_File Init");
2012-06-19 05:20:33 -07:00
if (!ecore_file_init())
{
e_error_message_show(_("Enlightenment cannot initialize Ecore_File!\n"));
_e_main_shutdown(-1);
}
TS("Ecore_File Init Done");
_e_main_shutdown_push(ecore_file_shutdown);
TS("Ecore_Con Init");
2012-06-19 05:20:33 -07:00
if (!ecore_con_init())
{
e_error_message_show(_("Enlightenment cannot initialize Ecore_Con!\n"));
_e_main_shutdown(-1);
}
TS("Ecore_Con Init Done");
_e_main_shutdown_push(ecore_con_shutdown);
TS("Ecore_Ipc Init");
2012-06-19 05:20:33 -07:00
if (!ecore_ipc_init())
{
e_error_message_show(_("Enlightenment cannot initialize Ecore_Ipc!\n"));
_e_main_shutdown(-1);
}
TS("Ecore_Ipc Init Done");
_e_main_shutdown_push(ecore_ipc_shutdown);
_idle_before = ecore_idle_enterer_before_add(_e_main_cb_idle_before, NULL);
TS("Ecore_X Init");
2012-06-19 05:20:33 -07:00
if (!ecore_x_init(NULL))
2005-01-27 02:14:22 -08:00
{
e_error_message_show(_("Enlightenment cannot initialize Ecore_X!\n"));
_e_main_shutdown(-1);
2005-01-27 02:14:22 -08:00
}
TS("Ecore_X Init Done");
_e_main_shutdown_push(_e_main_x_shutdown);
ecore_x_io_error_handler_set(_e_main_cb_x_fatal, NULL);
_xdg_data_dirs_augment();
TS("Ecore_Evas Init");
2012-06-19 05:20:33 -07:00
if (!ecore_evas_init())
{
e_error_message_show(_("Enlightenment cannot initialize Ecore_Evas!\n"));
_e_main_shutdown(-1);
}
TS("Ecore_Evas Init Done");
// _e_main_shutdown_push(ecore_evas_shutdown);
TS("Elementary Init");
if (!elm_init(argc, argv))
{
e_error_message_show(_("Enlightenment cannot initialize Elementary!\n"));
_e_main_shutdown(-1);
}
TS("Elementary Init Done");
_e_main_shutdown_push(elm_shutdown);
TS("Emotion Init");
if (!emotion_init())
{
e_error_message_show(_("Enlightenment cannot initialize Emotion!\n"));
_e_main_shutdown(-1);
}
TS("Emotion Init Done");
_e_main_shutdown_push((void *)emotion_shutdown);
/* e doesn't sync to compositor - it should be one */
ecore_evas_app_comp_sync_set(0);
TS("Ecore_Evas Engine Check");
2012-06-19 05:20:33 -07:00
if (!ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_SOFTWARE_XCB))
{
if (!ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_SOFTWARE_XLIB))
{
e_error_message_show(_("Enlightenment found ecore_evas doesn't support the Software X11\n"
"rendering in Evas. Please check your installation of Evas and\n"
"Ecore and check they support the Software X11 rendering engine."));
_e_main_shutdown(-1);
}
}
if (!ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_SOFTWARE_BUFFER))
{
2012-06-19 05:20:33 -07:00
e_error_message_show(_("Enlightenment found ecore_evas doesn't support the Software Buffer\n"
"rendering in Evas. Please check your installation of Evas and\n"
"Ecore and check they support the Software Buffer rendering engine."));
_e_main_shutdown(-1);
}
TS("Ecore_Evas Engine Check Done");
TS("Edje Init");
2012-06-19 05:20:33 -07:00
if (!edje_init())
{
e_error_message_show(_("Enlightenment cannot initialize Edje!\n"));
_e_main_shutdown(-1);
}
TS("Edje Init Done");
_e_main_shutdown_push(edje_shutdown);
edje_freeze();
/*** Initialize E Subsystems We Need ***/
TS("E Intl Init");
2012-06-19 05:20:33 -07:00
if (!e_intl_init())
{
e_error_message_show(_("Enlightenment cannot initialize E_Intl!\n"));
_e_main_shutdown(-1);
}
TS("E Intl Init Done");
_e_main_shutdown_push(e_intl_shutdown);
/* init white box of death alert */
TS("E_Alert Init");
if (!e_alert_init())
{
2012-06-19 05:20:33 -07:00
e_error_message_show(_("Enlightenment cannot initialize its emergency alert system.\n"
"Have you set your DISPLAY variable?"));
_e_main_shutdown(-1);
}
TS("E_Alert Init Done");
_e_main_shutdown_push(e_alert_shutdown);
TS("E_Hints Init");
e_hints_init();
TS("E_Hints Init Done");
TS("E_Configure Init");
2012-06-19 05:20:33 -07:00
e_configure_init();
TS("E_Configure Init Done");
TS("E Directories Init");
2005-06-25 21:41:29 -07:00
/* setup directories we will be using for configurations storage etc. */
if (!_e_main_dirs_init())
{
2012-06-19 05:20:33 -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?"));
_e_main_shutdown(-1);
}
TS("E Directories Init Done");
_e_main_shutdown_push(_e_main_dirs_shutdown);
TS("E_Filereg Init");
2006-10-17 05:29:00 -07:00
if (!e_filereg_init())
{
e_error_message_show(_("Enlightenment cannot set up its file registry system.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
2006-10-17 05:29:00 -07:00
}
TS("E_Filereg Init Done");
2006-10-17 05:29:00 -07:00
_e_main_shutdown_push(e_filereg_shutdown);
TS("E_Config Init");
2005-05-19 20:09:44 -07:00
if (!e_config_init())
{
e_error_message_show(_("Enlightenment cannot set up its config system.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
2005-05-19 20:09:44 -07:00
}
TS("E_Config Init Done");
2005-05-19 20:09:44 -07:00
_e_main_shutdown_push(e_config_shutdown);
TS("E_Randr Init");
if (!e_randr_init())
{
e_error_message_show(_("Enlightenment cannot initialize E_Randr!\n"));
}
else
_e_main_shutdown_push(e_randr_shutdown);
TS("E_Randr Init Done");
TS("E_Xinerama Init");
if (!e_xinerama_init())
{
e_error_message_show(_("Enlightenment cannot initialize E_Xinerama!\n"));
_e_main_shutdown(-1);
}
TS("E_Xinerama Init Done");
_e_main_shutdown_push(e_xinerama_shutdown);
TS("E_Env Init");
if (!e_env_init())
{
e_error_message_show(_("Enlightenment cannot set up its environment.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Env Init Done");
_e_main_shutdown_push(e_env_shutdown);
e_util_env_set("E_ICON_THEME", e_config->icon_theme);
ecore_exe_run_priority_set(e_config->priority);
locked |= e_config->desklock_start_locked;
2012-06-19 05:20:33 -07:00
s = getenv("E_DESKLOCK_LOCKED");
if ((s) && (!strcmp(s, "locked"))) waslocked = EINA_TRUE;
TS("E_Scale Init");
if (!e_scale_init())
{
e_error_message_show(_("Enlightenment cannot set up its scale system.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Scale Init Done");
_e_main_shutdown_push(e_scale_shutdown);
TS("E_Pointer Init");
2012-06-19 05:20:33 -07:00
if (!e_pointer_init())
{
e_error_message_show(_("Enlightenment cannot set up its pointer system.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Pointer Init Done");
_e_main_shutdown_push(e_pointer_shutdown);
TS("E Paths Init");
if (!_e_main_path_init())
{
2012-06-19 05:20:33 -07:00
e_error_message_show(_("Enlightenment cannot set up paths for finding files.\n"
"Perhaps you are out of memory?"));
_e_main_shutdown(-1);
}
TS("E Paths Init Done");
_e_main_shutdown_push(_e_main_path_shutdown);
TS("E_Ipc Init");
if (!e_ipc_init()) _e_main_shutdown(-1);
TS("E_Ipc Init Done");
_e_main_shutdown_push(e_ipc_shutdown);
edje_frametime_set(1.0 / e_config->framerate);
TS("E_Font Init");
2012-06-19 05:20:33 -07:00
if (!e_font_init())
{
e_error_message_show(_("Enlightenment cannot set up its font system.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Font Init Done");
_e_main_shutdown_push(e_font_shutdown);
TS("E_Font Apply");
e_font_apply();
TS("E_Font Apply Done");
TS("E_Canvas Recache");
e_canvas_recache();
TS("E_Canvas Recache Done");
TS("E_Theme Init");
2012-06-19 05:20:33 -07:00
if (!e_theme_init())
{
e_error_message_show(_("Enlightenment cannot set up its theme system.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Theme Init Done");
_e_main_shutdown_push(e_theme_shutdown);
TS("E_Moveresize Init");
e_moveresize_init();
TS("E_Moveresize Init Done");
_e_main_shutdown_push(e_moveresize_shutdown);
TS("Efreet Init");
if (!efreet_init())
{
e_error_message_show(_("Enlightenment cannot initialize the FDO desktop system.\n"
"Perhaps you lack permissions on ~/.cache/efreet or are\n"
"out of memory or disk space?"));
_e_main_shutdown(-1);
}
TS("Efreet Init Done");
_e_main_shutdown_push(efreet_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Starting International Support"));
TS("E_Intl Post Init");
if (!e_intl_post_init())
{
e_error_message_show(_("Enlightenment cannot set up its intl system.\n"));
_e_main_shutdown(-1);
}
TS("E_Intl Post Init Done");
_e_main_shutdown_push(e_intl_post_shutdown);
e_screensaver_preinit();
if (e_config->show_splash)
e_init_status_set(_("Setup Actions"));
TS("E_Actions Init");
if (!e_actions_init())
{
e_error_message_show(_("Enlightenment cannot set up its actions system.\n"));
_e_main_shutdown(-1);
}
TS("E_Actions Init Done");
_e_main_shutdown_push(e_actions_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup Screens"));
TS("Screens Init");
if (!_e_main_screens_init())
{
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"));
_e_main_shutdown(-1);
}
TS("Screens Init Done");
_e_main_shutdown_push(_e_main_screens_shutdown);
2012-06-19 05:20:33 -07:00
if (e_config->show_splash)
{
TS("E_Splash Init");
2012-06-19 05:20:33 -07:00
if (!e_init_init())
{
e_error_message_show(_("Enlightenment cannot set up its init screen.\n"));
_e_main_shutdown(-1);
}
TS("E_Splash Init Done");
_e_main_shutdown_push(e_init_shutdown);
}
2012-06-19 05:20:33 -07:00
if (!((!e_config->show_splash) || (after_restart)))
e_init_show();
2012-06-19 05:20:33 -07:00
if (!really_know)
{
TS("Test File Format Support");
_e_main_test_formats();
TS("Test File Format Support Done");
}
2012-06-19 05:20:33 -07:00
else
{
efreet_icon_extension_add(".svg");
efreet_icon_extension_add(".jpg");
efreet_icon_extension_add(".png");
efreet_icon_extension_add(".edj");
}
if (e_config->show_splash)
e_init_status_set(_("Setup ACPI"));
TS("E_Acpi Init");
e_acpi_init();
TS("E_Acpi Init Done");
_e_main_shutdown_push(e_acpi_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup Backlight"));
TS("E_Backlight Init");
2012-06-19 05:20:33 -07:00
if (!e_backlight_init())
{
e_error_message_show(_("Enlightenment cannot configure the backlight.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Backlight Init Done");
if (e_config->show_splash)
e_init_status_set(_("Setup Screensaver"));
TS("E_Screensaver Init");
2012-06-19 05:20:33 -07:00
if (!e_screensaver_init())
{
e_error_message_show(_("Enlightenment cannot configure the X screensaver.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Screensaver Init Done");
_e_main_shutdown_push(e_screensaver_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup DPMS"));
TS("E_Dpms Init");
if (!e_dpms_init())
{
e_error_message_show(_("Enlightenment cannot configure the DPMS settings.\n"));
_e_main_shutdown(-1);
}
TS("E_Dpms Init Done");
_e_main_shutdown_push(e_dpms_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup Powersave Modes"));
TS("E_Powersave Init");
2012-06-19 05:20:33 -07:00
if (!e_powersave_init())
{
e_error_message_show(_("Enlightenment cannot set up its powersave modes.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Powersave Init Done");
_e_main_shutdown_push(e_powersave_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup Desklock"));
TS("E_Desklock Init");
2012-06-19 05:20:33 -07:00
if (!e_desklock_init())
{
e_error_message_show(_("Enlightenment cannot set up its desk locking system.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Desklock Init Done");
_e_main_shutdown_push(e_desklock_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup Popups"));
TS("E_Popups Init");
2012-06-19 05:20:33 -07:00
if (!e_popup_init())
{
e_error_message_show(_("Enlightenment cannot set up its popup system.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Popups Init Done");
_e_main_shutdown_push(e_popup_shutdown);
if (waslocked || (locked && ((!after_restart) || (!getenv("E_DESKLOCK_UNLOCKED")))))
e_desklock_show(EINA_TRUE);
if (e_config->show_splash)
e_init_status_set(_("Setup Message Bus"));
TS("E_Msgbus Init");
2012-06-19 05:20:33 -07:00
if (e_msgbus_init())
_e_main_shutdown_push(e_msgbus_shutdown);
TS("E_Msgbus Init Done");
if (e_config->show_splash)
e_init_status_set(_("Setup Paths"));
TS("Efreet Paths");
_e_main_efreet_paths_init();
TS("Efreet Paths Done");
if (e_config->show_splash)
e_init_status_set(_("Setup System Controls"));
TS("E_Sys Init");
2012-06-19 05:20:33 -07:00
if (!e_sys_init())
{
2012-06-19 05:20:33 -07:00
e_error_message_show(_("Enlightenment cannot initialize the System Command system.\n"));
_e_main_shutdown(-1);
}
TS("E_Sys Init Done");
_e_main_shutdown_push(e_sys_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup Execution System"));
TS("E_Exec Init");
2012-06-19 05:20:33 -07:00
if (!e_exec_init())
{
e_error_message_show(_("Enlightenment cannot set up its exec system.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Exec Init Done");
_e_main_shutdown_push(e_exec_shutdown);
TS("E_Container Freeze");
e_container_all_freeze();
TS("E_Container Freeze Done");
if (e_config->show_splash)
e_init_status_set(_("Setup Filemanager"));
TS("E_Fm2 Init");
2012-06-19 05:20:33 -07:00
if (!e_fm2_init())
{
2012-06-19 05:20:33 -07:00
e_error_message_show(_("Enlightenment cannot initialize the File manager.\n"));
_e_main_shutdown(-1);
}
TS("E_Fm2 Init Done");
_e_main_shutdown_push(e_fm2_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup Message System"));
TS("E_Msg Init");
2012-06-19 05:20:33 -07:00
if (!e_msg_init())
{
e_error_message_show(_("Enlightenment cannot set up its msg system.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Msg Init Done");
_e_main_shutdown_push(e_msg_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup Grab Input Handling"));
TS("E_Grabinput Init");
2012-06-19 05:20:33 -07:00
if (!e_grabinput_init())
{
e_error_message_show(_("Enlightenment cannot set up its grab input handling system.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Grabinput Init Done");
_e_main_shutdown_push(e_grabinput_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup Modules"));
TS("E_Module Init");
2012-06-19 05:20:33 -07:00
if (!e_module_init())
{
e_error_message_show(_("Enlightenment cannot set up its module system.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Module Init Done");
_e_main_shutdown_push(e_module_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup Remembers"));
TS("E_Remember Init");
2012-06-19 05:20:33 -07:00
if (!e_remember_init(after_restart ? E_STARTUP_RESTART : E_STARTUP_START))
{
e_error_message_show(_("Enlightenment cannot setup remember settings.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Remember Init Done");
_e_main_shutdown_push(e_remember_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup Color Classes"));
TS("E_Color_Class Init");
2012-06-19 05:20:33 -07:00
if (!e_color_class_init())
{
e_error_message_show(_("Enlightenment cannot set up its color class system.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Color_Class Init Done");
_e_main_shutdown_push(e_color_class_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup Gadcon"));
TS("E_Gadcon Init");
2012-06-19 05:20:33 -07:00
if (!e_gadcon_init())
{
e_error_message_show(_("Enlightenment cannot set up its gadget control system.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Gadcon Init Done");
_e_main_shutdown_push(e_gadcon_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup Toolbars"));
TS("E_Toolbar Init");
if (!e_toolbar_init())
{
e_error_message_show(_("Enlightenment cannot set up its toolbars.\n"));
_e_main_shutdown(-1);
}
TS("E_Toolbar Init Done");
_e_main_shutdown_push(e_toolbar_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup Wallpaper"));
TS("E_Bg Init");
2012-06-19 05:20:33 -07:00
if (!e_bg_init())
{
e_error_message_show(_("Enlightenment cannot set up its desktop background system.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Bg Init Done");
_e_main_shutdown_push(e_bg_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup Mouse"));
TS("E_Mouse Init");
2012-06-19 05:20:33 -07:00
if (!e_mouse_update())
{
e_error_message_show(_("Enlightenment cannot configure the mouse settings.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Mouse Init Done");
2012-06-19 05:20:33 -07:00
if (e_config->show_splash)
e_init_status_set(_("Setup Bindings"));
TS("E_Bindings Init");
2012-06-19 05:20:33 -07:00
if (!e_bindings_init())
{
e_error_message_show(_("Enlightenment cannot set up its bindings system.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Bindings Init Done");
_e_main_shutdown_push(e_bindings_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup Thumbnailer"));
TS("E_Thumb Init");
2012-06-19 05:20:33 -07:00
if (!e_thumb_init())
{
e_error_message_show(_("Enlightenment cannot initialize the Thumbnailing system.\n"));
_e_main_shutdown(-1);
}
TS("E_Thumb Init Done");
_e_main_shutdown_push(e_thumb_shutdown);
TS("E_Icon Init");
2012-06-19 05:20:33 -07:00
if (!e_icon_init())
{
e_error_message_show(_("Enlightenment cannot initialize the Icon Cache system.\n"));
_e_main_shutdown(-1);
}
TS("E_Icon Init Done");
_e_main_shutdown_push(e_icon_shutdown);
TS("E_XSettings Init");
2012-06-19 05:20:33 -07:00
if (!e_xsettings_init())
{
e_error_message_show(_("Enlightenment cannot initialize the XSettings system.\n"));
_e_main_shutdown(-1);
}
TS("E_XSettings Init Done");
_e_main_shutdown_push(e_xsettings_shutdown);
TS("E_Update Init");
2012-06-19 05:20:33 -07:00
if (!e_update_init())
{
e_error_message_show(_("Enlightenment cannot initialize the Update system.\n"));
_e_main_shutdown(-1);
}
TS("E_Update Init Done");
_e_main_shutdown_push(e_update_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup Desktop Environment"));
TS("E_Deskenv Init");
if (!e_deskenv_init())
{
e_error_message_show(_("Enlightenment cannot initialize its desktop environment.\n"));
_e_main_shutdown(-1);
}
TS("E_Deskenv Init Done");
_e_main_shutdown_push(e_deskenv_shutdown);
if (e_config->show_splash)
e_init_status_set(_("Setup File Ordering"));
TS("E_Order Init");
2012-06-19 05:20:33 -07:00
if (!e_order_init())
{
e_error_message_show(_("Enlightenment cannot set up its order file system.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
TS("E_Order Init Done");
_e_main_shutdown_push(e_order_shutdown);
TS("Add Idler For X Flush");
_idle_flush = ecore_idle_enterer_add(_e_main_cb_x_flusher, NULL);
TS("Add Idler For X Flush Done");
TS("E_Manager Keys Grab");
e_managers_keys_grab();
TS("E_Manager Keys Grab Done");
if (e_config->show_splash)
e_init_status_set(_("Load Modules"));
TS("Load Modules");
_e_main_modules_load(safe_mode);
TS("Load Modules Done");
TS("Run Startup Apps");
2012-06-19 05:20:33 -07:00
if (!nostartup)
{
2012-06-19 05:20:33 -07:00
if (after_restart)
e_startup(E_STARTUP_RESTART);
else
e_startup(E_STARTUP_START);
}
TS("Run Startup Apps Done");
if (e_config->show_splash && (!after_restart))
ecore_timer_add(2.0, _e_main_cb_startup_fake_end, NULL);
TS("E_Container Thaw");
e_container_all_thaw();
TS("E_Container Thaw Done");
TS("E_Test Init");
e_test();
TS("E_Test Done");
if (e_config->show_splash)
e_init_status_set(_("Setup Shelves"));
TS("E_Shelf Init");
if (!e_shelf_init())
{
e_error_message_show(_("Enlightenment cannot set up its module system.\n"));
_e_main_shutdown(-1);
}
TS("E_Shelf Init Done");
_e_main_shutdown_push(e_shelf_shutdown);
ecore_idle_enterer_before_add(_e_main_shelf_init_job, NULL);
TS("Manage all windows");
_e_main_manage_all();
_idle_after = ecore_idle_enterer_add(_e_main_cb_idle_after, NULL);
if (e_config->show_splash)
e_init_status_set(_("Almost Done"));
starting = EINA_FALSE;
inloop = EINA_TRUE;
e_util_env_set("E_RESTART", "1");
TS("MAIN LOOP AT LAST");
if (!setjmp(x_fatal_buff))
ecore_main_loop_begin();
else
CRI("FATAL: X Died. Connection gone. Abbreviated Shutdown\n");
inloop = EINA_FALSE;
stopping = EINA_TRUE;
if (!x_fatal) e_canvas_idle_flush();
e_config_save_flush();
_e_main_desk_save();
e_remember_internal_save();
e_comp_internal_save();
_e_main_shutdown(0);
2012-06-19 05:20:33 -07:00
if (restart)
{
e_util_env_set("E_RESTART_OK", "1");
if (getenv("E_START_MTRACK"))
e_util_env_set("MTRACK", "track");
ecore_app_restart();
}
e_prefix_shutdown();
return 0;
}
/* FIXME: make safe to delete within a callback */
2006-01-07 02:39:46 -08:00
EAPI E_Before_Idler *
2012-06-19 05:20:33 -07:00
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;
_idle_before_list = eina_list_append(_idle_before_list, eb);
return eb;
}
2006-01-07 02:39:46 -08:00
EAPI void
e_main_idler_before_del(E_Before_Idler *eb)
{
eb->delete_me = 1;
}
EAPI double
e_main_ts(const char *str)
{
double ret;
t1 = ecore_time_unix_get();
printf("ESTART: %1.5f [%1.5f] - %s\n", t1 - t0, t1 - t2, str);
ret = t1 - t2;
t2 = t1;
return ret;
}
/* local functions */
2012-06-19 05:20:33 -07:00
static void
_e_main_shutdown(int errcode)
{
int i = 0;
2013-06-18 07:39:53 -07:00
printf("E18: Begin Shutdown Procedure!\n");
if (_idle_before) ecore_idle_enterer_del(_idle_before);
_idle_before = NULL;
if (_idle_after) ecore_idle_enterer_del(_idle_after);
_idle_after = NULL;
if (_idle_flush) ecore_idle_enterer_del(_idle_flush);
_idle_flush = NULL;
for (i = (_e_main_lvl - 1); i >= 0; i--)
(*_e_main_shutdown_func[i])();
if (errcode < 0) exit(errcode);
}
2012-06-19 05:20:33 -07:00
static void
_e_main_shutdown_push(int (*func)(void))
{
_e_main_lvl++;
2012-06-19 05:20:33 -07:00
if (_e_main_lvl > MAX_LEVEL)
{
_e_main_lvl--;
e_error_message_show("WARNING: too many init levels. MAX = %i\n",
MAX_LEVEL);
return;
}
_e_main_shutdown_func[_e_main_lvl - 1] = func;
}
2012-06-19 05:20:33 -07:00
static void
_e_main_parse_arguments(int argc, char **argv)
{
char *s = NULL;
int i = 0;
/* handle some command-line parameters */
for (i = 1; i < argc; i++)
{
2012-06-19 05:20:33 -07:00
if ((!strcmp(argv[i], "-display")) && (i < (argc - 1)))
{
i++;
e_util_env_set("DISPLAY", argv[i]);
}
else if ((!strcmp(argv[i], "-fake-xinerama-screen")) && (i < (argc - 1)))
{
int x, y, w, h;
i++;
if (sscanf(argv[i], "%ix%i+%i+%i", &w, &h, &x, &y) == 4)
e_xinerama_fake_screen_add(x, y, w, h);
}
else if (!strcmp(argv[i], "-good"))
{
good = EINA_TRUE;
evil = EINA_FALSE;
printf("LA LA LA\n");
}
else if (!strcmp(argv[i], "-evil"))
{
good = EINA_FALSE;
evil = EINA_TRUE;
printf("MUHAHAHAHHAHAHAHAHA\n");
}
else if (!strcmp(argv[i], "-psychotic"))
{
good = EINA_TRUE;
evil = EINA_TRUE;
printf("MUHAHALALALALALALALA\n");
}
else if ((!strcmp(argv[i], "-profile")) && (i < (argc - 1)))
{
i++;
if (!getenv("E_CONF_PROFILE"))
e_util_env_set("E_CONF_PROFILE", argv[i]);
}
else if (!strcmp(argv[i], "-i-really-know-what-i-am-doing-and-accept-full-responsibility-for-it"))
really_know = EINA_TRUE;
2012-06-19 05:20:33 -07:00
else if (!strcmp(argv[i], "-locked"))
locked = EINA_TRUE;
else if (!strcmp(argv[i], "-nopause"))
e_nopause = EINA_TRUE;
2012-06-19 05:20:33 -07:00
else if ((!strcmp(argv[i], "-h")) ||
(!strcmp(argv[i], "-help")) ||
(!strcmp(argv[i], "--help")))
{
printf
(_(
"Options:\n"
"\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"
"\t\tEG: -fake-xinerama-screen 800x600+0+0 -fake-xinerama-screen 800x600+800+0\n"
"\t-profile CONF_PROFILE\n"
"\t\tUse the configuration profile CONF_PROFILE instead of the user selected default or just \"default\".\n"
"\t-good\n"
"\t\tBe good.\n"
"\t-evil\n"
"\t\tBe evil.\n"
"\t-psychotic\n"
"\t\tBe psychotic.\n"
"\t-locked\n"
"\t\tStart with desklock on, so password will be asked.\n"
"\t-i-really-know-what-i-am-doing-and-accept-full-responsibility-for-it\n"
"\t\tIf you need this help, you don't need this option.\n"
)
);
_e_main_shutdown(-1);
}
}
/* fix up DISPLAY to be :N.0 if no .screen is in it */
s = getenv("DISPLAY");
if (s)
{
char *p, buff[4096];
2012-06-19 05:20:33 -07:00
if (!(p = strrchr(s, ':')))
{
snprintf(buff, sizeof(buff), "%s:0.0", s);
e_util_env_set("DISPLAY", buff);
2012-06-19 05:20:33 -07:00
}
else
{
if (!strrchr(p, '.'))
2012-06-19 05:20:33 -07:00
{
snprintf(buff, sizeof(buff), "%s.0", s);
e_util_env_set("DISPLAY", buff);
}
}
}
/* we want to have been launched by enlightenment_start. there is a very */
/* good reason we want to have been launched this way, thus check */
if (!getenv("E_START"))
{
2012-06-19 05:20:33 -07:00
e_error_message_show(_("You are executing enlightenment directly. This is\n"
"bad. Please do not execute the \"enlightenment\"\n"
"binary. Use the \"enlightenment_start\" launcher. It\n"
"will handle setting up environment variables, paths,\n"
"and launching any other required services etc.\n"
"before enlightenment itself begins running.\n"));
2012-06-19 05:20:33 -07:00
_e_main_shutdown(-1);
}
}
2012-06-19 05:20:33 -07:00
static void
_e_main_cb_x_fatal(void *data __UNUSED__)
{
e_error_message_show("Lost X Connection.\n");
ecore_main_loop_quit();
2012-06-19 05:20:33 -07:00
if (!x_fatal)
{
x_fatal = EINA_TRUE;
if (inloop) longjmp(x_fatal_buff, -99);
}
}
static Eina_Bool
_e_main_cb_signal_exit(void *data __UNUSED__, int ev_type __UNUSED__, void *ev __UNUSED__)
{
/* called on ctrl-c, kill (pid) (also SIGINT, SIGTERM and SIGQIT) */
e_sys_action_do(E_SYS_EXIT, NULL);
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
_e_main_cb_signal_hup(void *data __UNUSED__, int ev_type __UNUSED__, void *ev __UNUSED__)
{
e_sys_action_do(E_SYS_RESTART, NULL);
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
_e_main_cb_signal_user(void *data __UNUSED__, int ev_type __UNUSED__, void *ev)
{
Ecore_Event_Signal_User *e = ev;
2012-06-19 05:20:33 -07:00
if (e->number == 1)
{
// E_Action *a = e_action_find("configuration");
// if ((a) && (a->func.go)) a->func.go(NULL, NULL);
}
else if (e->number == 2)
{
// comp module has its own handler for this for enabling/disabling fps debug
}
return ECORE_CALLBACK_RENEW;
}
2012-06-19 05:20:33 -07:00
static int
_e_main_x_shutdown(void)
{
if (x_fatal) return 1;
/* ecore_x_ungrab(); */
ecore_x_focus_reset();
ecore_x_events_allow_all();
ecore_x_shutdown();
return 1;
}
2012-06-19 05:20:33 -07:00
static int
_e_main_dirs_init(void)
{
const char *base;
2012-06-19 05:20:33 -07:00
const char *dirs[] =
{
"images",
"fonts",
"themes",
"icons",
"backgrounds",
"applications",
"applications/menu",
"applications/menu/favorite",
"applications/menu/all",
"applications/bar",
"applications/bar/default",
"applications/startup",
"applications/restart",
"applications/trash",
"applications/desk-lock",
"applications/desk-unlock",
2012-06-19 05:20:33 -07:00
"modules",
"config",
"locale",
"input_methods",
NULL
};
base = e_user_dir_get();
2012-06-19 05:20:33 -07:00
if (ecore_file_mksubdirs(base, dirs) != sizeof(dirs) / sizeof(dirs[0]) - 1)
{
2012-06-19 05:20:33 -07:00
e_error_message_show("Could not create one of the required "
"subdirectories of '%s'\n", base);
2012-06-19 05:20:33 -07:00
return 0;
}
return 1;
}
2012-06-19 05:20:33 -07:00
static int
_e_main_dirs_shutdown(void)
{
return 1;
}
static int
_e_main_path_init(void)
{
char buf[PATH_MAX];
2005-05-19 20:09:44 -07:00
/* setup data paths */
path_data = e_path_new();
if (!path_data)
{
2012-06-19 05:20:33 -07:00
e_error_message_show("Cannot allocate path for path_data\n");
return 0;
}
e_prefix_data_concat_static(buf, "data");
e_path_default_path_append(path_data, buf);
2005-05-19 20:09:44 -07:00
e_path_user_path_set(path_data, &(e_config->path_append_data));
/* setup image paths */
path_images = e_path_new();
if (!path_images)
{
2012-06-19 05:20:33 -07:00
e_error_message_show("Cannot allocate path for path_images\n");
return 0;
}
e_user_dir_concat_static(buf, "/images");
e_path_default_path_append(path_images, buf);
e_prefix_data_concat_static(buf, "data/images");
e_path_default_path_append(path_images, buf);
2005-05-19 20:09:44 -07:00
e_path_user_path_set(path_images, &(e_config->path_append_images));
2005-05-19 20:09:44 -07:00
/* setup font paths */
path_fonts = e_path_new();
if (!path_fonts)
{
2012-06-19 05:20:33 -07:00
e_error_message_show("Cannot allocate path for path_fonts\n");
return 0;
}
e_user_dir_concat_static(buf, "/fonts");
e_path_default_path_append(path_fonts, buf);
e_prefix_data_concat_static(buf, "data/fonts");
e_path_default_path_append(path_fonts, buf);
2005-05-19 20:09:44 -07:00
e_path_user_path_set(path_fonts, &(e_config->path_append_fonts));
/* setup icon paths */
path_icons = e_path_new();
if (!path_icons)
{
2012-06-19 05:20:33 -07:00
e_error_message_show("Cannot allocate path for path_icons\n");
return 0;
}
e_user_dir_concat_static(buf, "/icons");
e_path_default_path_append(path_icons, buf);
e_prefix_data_concat_static(buf, "data/icons");
e_path_default_path_append(path_icons, buf);
2005-05-19 20:09:44 -07:00
e_path_user_path_set(path_icons, &(e_config->path_append_icons));
/* setup module paths */
path_modules = e_path_new();
2012-06-19 05:20:33 -07:00
if (!path_modules)
2005-05-19 20:09:44 -07:00
{
2012-06-19 05:20:33 -07:00
e_error_message_show("Cannot allocate path for path_modules\n");
return 0;
2005-05-19 20:09:44 -07:00
}
e_user_dir_concat_static(buf, "/modules");
e_path_default_path_append(path_modules, buf);
2005-08-01 02:12:45 -07:00
snprintf(buf, sizeof(buf), "%s/enlightenment/modules", e_prefix_lib_get());
e_path_default_path_append(path_modules, buf);
Fix common misspellings Some misspellings were manually reverted since in E there are tons of .po with phrases in other languages. Other than that all the changes in the following files were reverted: * src/modules/illume/dicts/English_(US).dic * src/modules/illume-keyboard/dicts/English_(US).dic Following misspellings were fixed: acquited->acquitted adres->address adress->address alreayd->already aquire->acquire arbitarily->arbitrarily cant->can't Capetown->Cape carefull->careful causalities->casualties Celcius->Celsius certian->certain commandoes->commandos considerd->considered conveyer->conveyor dependant->dependent didnt->didn't discontentment->discontent doesnt->doesn't everytime->every exemple->example existance->existence existant->existent existince->existence Farenheit->Fahrenheit forbad->forbade funguses->fungi guage->gauge guerilla->guerrilla guerillas->guerrillas happend->happened hasnt->hasn't heros->heroes inbetween->between independant->independent inital->initial intrusted->entrusted irregardless->regardless isnt->isn't knifes->knives layed->laid loosing->losing marrage->marriage midwifes->midwives miniscule->minuscule monickers->monikers mroe->more noone->no one occured->occurred omre->more paralell->parallel payed->paid planed->planned quitted->quit quizes->quizzes seperated->separated seperate->separate shoudl->should similiar->similar simplier->simpler specifiying->specifying teh->the toke->took torpedos->torpedoes Tuscon->Tucson unecessary->unnecessary useage->usage usefull->useful useing->using waht->what wanna->want whith->with wich->which withing->within SVN revision: 52006
2010-09-08 16:59:07 -07:00
/* FIXME: eventually this has to go - moduels should have installers that
* add appropriate install paths (if not installed to user homedir) to
* e's module search dirs
*/
2005-08-01 02:12:45 -07:00
snprintf(buf, sizeof(buf), "%s/enlightenment/modules_extra", e_prefix_lib_get());
e_path_default_path_append(path_modules, buf);
2012-06-19 05:20:33 -07:00
e_path_user_path_set(path_modules, &(e_config->path_append_modules));
2005-05-19 20:09:44 -07:00
/* setup background paths */
path_backgrounds = e_path_new();
2012-06-19 05:20:33 -07:00
if (!path_backgrounds)
2005-05-19 20:09:44 -07:00
{
2012-06-19 05:20:33 -07:00
e_error_message_show("Cannot allocate path for path_backgrounds\n");
return 0;
2005-05-19 20:09:44 -07:00
}
e_user_dir_concat_static(buf, "/backgrounds");
e_path_default_path_append(path_backgrounds, buf);
e_prefix_data_concat_static(buf, "data/backgrounds");
e_path_default_path_append(path_backgrounds, buf);
2005-05-19 20:09:44 -07:00
e_path_user_path_set(path_backgrounds, &(e_config->path_append_backgrounds));
path_messages = e_path_new();
2012-06-19 05:20:33 -07:00
if (!path_messages)
{
2012-06-19 05:20:33 -07:00
e_error_message_show("Cannot allocate path for path_messages\n");
return 0;
}
e_user_dir_concat_static(buf, "/locale");
2012-06-19 05:20:33 -07:00
e_path_default_path_append(path_messages, buf);
e_path_default_path_append(path_messages, e_prefix_locale_get());
e_path_user_path_set(path_messages, &(e_config->path_append_messages));
return 1;
}
static int
_e_main_path_shutdown(void)
{
if (path_data)
{
2012-06-19 05:20:33 -07:00
e_object_del(E_OBJECT(path_data));
path_data = NULL;
}
if (path_images)
{
2012-06-19 05:20:33 -07:00
e_object_del(E_OBJECT(path_images));
path_images = NULL;
}
if (path_fonts)
{
2012-06-19 05:20:33 -07:00
e_object_del(E_OBJECT(path_fonts));
path_fonts = NULL;
}
if (path_icons)
{
2012-06-19 05:20:33 -07:00
e_object_del(E_OBJECT(path_icons));
path_icons = NULL;
}
2005-05-19 20:09:44 -07:00
if (path_modules)
{
e_object_del(E_OBJECT(path_modules));
path_modules = NULL;
}
if (path_backgrounds)
{
2012-06-19 05:20:33 -07:00
e_object_del(E_OBJECT(path_backgrounds));
2005-05-19 20:09:44 -07:00
path_backgrounds = NULL;
}
if (path_messages)
{
2012-06-19 05:20:33 -07:00
e_object_del(E_OBJECT(path_messages));
path_messages = NULL;
}
return 1;
}
2012-06-19 05:20:33 -07:00
static void
_e_main_test_formats(void)
{
Evas *evas;
Ecore_Evas *ee;
Evas_Object *im, *txt;
Evas_Coord tw, th;
char buff[PATH_MAX];
if (e_config->show_splash)
e_init_status_set(_("Testing Format Support"));
2012-06-19 05:20:33 -07:00
if (!(ee = ecore_evas_buffer_new(1, 1)))
{
e_error_message_show(_("Enlightenment found Evas can't create a buffer canvas. Please check\n"
"Evas has Software Buffer engine support.\n"));
_e_main_shutdown(-1);
}
e_canvas_add(ee);
evas = ecore_evas_get(ee);
im = evas_object_image_add(evas);
e_prefix_data_concat_static(buff, "data/images/test.svg");
evas_object_image_file_set(im, buff, NULL);
2012-06-19 05:20:33 -07:00
if (evas_object_image_load_error_get(im) != EVAS_LOAD_ERROR_NONE)
{
e_error_message_show(_("Enlightenment found Evas can't load SVG files. "
"Check Evas has SVG loader support.\n"));
}
2012-06-19 05:20:33 -07:00
else
efreet_icon_extension_add(".svg");
2005-02-07 05:51:09 -08:00
e_prefix_data_concat_static(buff, "data/images/test.jpg");
evas_object_image_file_set(im, buff, NULL);
if (evas_object_image_load_error_get(im) != EVAS_LOAD_ERROR_NONE)
{
e_error_message_show(_("Enlightenment found Evas can't load JPEG files. "
"Check Evas has JPEG loader support.\n"));
_e_main_shutdown(-1);
}
efreet_icon_extension_add(".jpg");
e_prefix_data_concat_static(buff, "data/images/test.png");
evas_object_image_file_set(im, buff, NULL);
2012-06-19 05:20:33 -07:00
if (evas_object_image_load_error_get(im) != EVAS_LOAD_ERROR_NONE)
{
e_error_message_show(_("Enlightenment found Evas can't load PNG files. "
"Check Evas has PNG loader support.\n"));
_e_main_shutdown(-1);
}
efreet_icon_extension_add(".png");
e_prefix_data_concat_static(buff, "data/images/test.edj");
evas_object_image_file_set(im, buff, "images/0");
if (evas_object_image_load_error_get(im) != EVAS_LOAD_ERROR_NONE)
{
e_error_message_show(_("Enlightenment found Evas can't load EET files. "
"Check Evas has EET loader support.\n"));
_e_main_shutdown(-1);
}
efreet_icon_extension_add(".edj");
evas_object_del(im);
txt = evas_object_text_add(evas);
evas_object_text_font_set(txt, "Sans", 10);
evas_object_text_text_set(txt, "Hello");
evas_object_geometry_get(txt, NULL, NULL, &tw, &th);
if ((tw <= 0) && (th <= 0))
{
e_error_message_show(_("Enlightenment found Evas can't load the 'Sans' font. Check Evas has fontconfig\n"
"support and system fontconfig defines a 'Sans' font.\n"));
_e_main_shutdown(-1);
}
evas_object_del(txt);
e_canvas_del(ee);
ecore_evas_free(ee);
}
static int
_e_main_screens_init(void)
{
Ecore_X_Window *roots;
int num, i;
TS("\tscreens: atoms");
if (!e_atoms_init()) return 0;
TS("\tscreens: manager");
if (!e_manager_init()) return 0;
TS("\tscreens: container");
if (!e_container_init()) return 0;
TS("\tscreens: zone");
if (!e_zone_init()) return 0;
TS("\tscreens: desk");
if (!e_desk_init()) return 0;
TS("\tscreens: menu");
if (!e_menu_init()) return 0;
TS("\tscreens: exehist");
if (!e_exehist_init()) return 0;
TS("\tscreens: get roots");
num = 0;
roots = ecore_x_window_root_list(&num);
if ((!roots) || (num <= 0))
{
free(roots);
2012-06-19 05:20:33 -07:00
e_error_message_show("X reports there are no root windows and %i screens!\n",
num);
return 0;
}
TS("\tscreens: focus");
Dear all, As I've said before, I'm attached a patch for minor bugs in the e17 again. Please take a look at attached patch. 01. missing E_FREE(wev) if zone is null File: src/bin/e_actions.c: 1467 Function: ACT_FN_GO_EDGE macro function null check of zone and wev, it would be better to separate them. 02. dead code File: src/bin/e_configure.c: 338 Function: _e_configure_efreet_desktop_update 03. array buf might be overwritten by "buf[i] = '\0'" File: src/bin/e_eap_editor.c: 412 Function: _e_desktop_edit_user_local_desktop_filename_generate 04. missing null check File: src/bin/e_fm.c Function: e_fm2_icon_get: 2196 It would be better to check ic->info.file in e_fm2_icon_get before passing to _e_fm2_file_is_edje because it doesn't check null pointer. 05. array 'path' might be overwritten by "path[i + 1] = XXX" File: src/bin/e_fm.c: 4299 Function: _e_fm2_uri_parse 06. missing null check File: src/bin/e_fm_device.c: 468 Function: e_fm2_device_mount_find If the null pointer is passed to e_fm2_device_mount_find, then it attempt to compare string using strncmp without null check. e.g., e_fm2_path_set -> real_path = _e_fm2_dev_path_map: this function could return null. -> sd->realpath = real_path; -> e_fm2_device_mount_find(sd->realpath) 07. missing free(fstrip) File: src/bin/e_import_config_dialog.c: 34 Function: _import_edj_gen 08. missing _module_free(cfm) File: src/bin/e_int_config_modules.c: 530 Function: _load_modules 09. missing free(class) in for loop File: src/bin/e_int_menus.c: 1187 Function: _e_int_menus_clients_add_by_class 10. missing free(roots) File: src/bin/e_main.c: 1646 Function: _e_main_screens_init Actually only e_win_init function could return 0. But I've added free to other codes for the consistency. 11. missing null check of 'es->cfg' File: src/bin/e_shelf.c: 2583 Function: _e_shelf_bindings_add 'es->cfg' might be null. please look at e_shelf_position_calc. 12. no ect->category check before comparing string values File: src/bin/e_theme.c: 387 Function: e_theme_config_remove I'm not sure, but inner if block checks ect->category before deleting a string. 13. missing E_FREE(wcb) in while loop File: src/bin/e_widget_ilist.c: 146 Function: _queue_timer 14. dereferencing freed pointer 'entry' File: src/modules/quickaccess/e_mod_quickaccess.c: 583 Function: _e_qa_event_border_remove_cb 15. missing E_FREE(trov) File: src/modules/tiling/e_mod_tiling.c: 3106 Function: _do_transition_overlay Thanks & Regards, Gwanglim SVN revision: 80231
2012-12-05 03:13:09 -08:00
if (!e_focus_init())
{
free(roots);
return 0;
}
TS("\tscreens: border");
Dear all, As I've said before, I'm attached a patch for minor bugs in the e17 again. Please take a look at attached patch. 01. missing E_FREE(wev) if zone is null File: src/bin/e_actions.c: 1467 Function: ACT_FN_GO_EDGE macro function null check of zone and wev, it would be better to separate them. 02. dead code File: src/bin/e_configure.c: 338 Function: _e_configure_efreet_desktop_update 03. array buf might be overwritten by "buf[i] = '\0'" File: src/bin/e_eap_editor.c: 412 Function: _e_desktop_edit_user_local_desktop_filename_generate 04. missing null check File: src/bin/e_fm.c Function: e_fm2_icon_get: 2196 It would be better to check ic->info.file in e_fm2_icon_get before passing to _e_fm2_file_is_edje because it doesn't check null pointer. 05. array 'path' might be overwritten by "path[i + 1] = XXX" File: src/bin/e_fm.c: 4299 Function: _e_fm2_uri_parse 06. missing null check File: src/bin/e_fm_device.c: 468 Function: e_fm2_device_mount_find If the null pointer is passed to e_fm2_device_mount_find, then it attempt to compare string using strncmp without null check. e.g., e_fm2_path_set -> real_path = _e_fm2_dev_path_map: this function could return null. -> sd->realpath = real_path; -> e_fm2_device_mount_find(sd->realpath) 07. missing free(fstrip) File: src/bin/e_import_config_dialog.c: 34 Function: _import_edj_gen 08. missing _module_free(cfm) File: src/bin/e_int_config_modules.c: 530 Function: _load_modules 09. missing free(class) in for loop File: src/bin/e_int_menus.c: 1187 Function: _e_int_menus_clients_add_by_class 10. missing free(roots) File: src/bin/e_main.c: 1646 Function: _e_main_screens_init Actually only e_win_init function could return 0. But I've added free to other codes for the consistency. 11. missing null check of 'es->cfg' File: src/bin/e_shelf.c: 2583 Function: _e_shelf_bindings_add 'es->cfg' might be null. please look at e_shelf_position_calc. 12. no ect->category check before comparing string values File: src/bin/e_theme.c: 387 Function: e_theme_config_remove I'm not sure, but inner if block checks ect->category before deleting a string. 13. missing E_FREE(wcb) in while loop File: src/bin/e_widget_ilist.c: 146 Function: _queue_timer 14. dereferencing freed pointer 'entry' File: src/modules/quickaccess/e_mod_quickaccess.c: 583 Function: _e_qa_event_border_remove_cb 15. missing E_FREE(trov) File: src/modules/tiling/e_mod_tiling.c: 3106 Function: _do_transition_overlay Thanks & Regards, Gwanglim SVN revision: 80231
2012-12-05 03:13:09 -08:00
if (!e_border_init())
{
free(roots);
return 0;
}
TS("E_Comp Init");
if (!e_comp_init())
{
e_error_message_show(_("Enlightenment cannot setup compositing.\n"));
_e_main_shutdown(-1);
}
TS("E_Comp Init Done");
TS("\tscreens: win");
Dear all, As I've said before, I'm attached a patch for minor bugs in the e17 again. Please take a look at attached patch. 01. missing E_FREE(wev) if zone is null File: src/bin/e_actions.c: 1467 Function: ACT_FN_GO_EDGE macro function null check of zone and wev, it would be better to separate them. 02. dead code File: src/bin/e_configure.c: 338 Function: _e_configure_efreet_desktop_update 03. array buf might be overwritten by "buf[i] = '\0'" File: src/bin/e_eap_editor.c: 412 Function: _e_desktop_edit_user_local_desktop_filename_generate 04. missing null check File: src/bin/e_fm.c Function: e_fm2_icon_get: 2196 It would be better to check ic->info.file in e_fm2_icon_get before passing to _e_fm2_file_is_edje because it doesn't check null pointer. 05. array 'path' might be overwritten by "path[i + 1] = XXX" File: src/bin/e_fm.c: 4299 Function: _e_fm2_uri_parse 06. missing null check File: src/bin/e_fm_device.c: 468 Function: e_fm2_device_mount_find If the null pointer is passed to e_fm2_device_mount_find, then it attempt to compare string using strncmp without null check. e.g., e_fm2_path_set -> real_path = _e_fm2_dev_path_map: this function could return null. -> sd->realpath = real_path; -> e_fm2_device_mount_find(sd->realpath) 07. missing free(fstrip) File: src/bin/e_import_config_dialog.c: 34 Function: _import_edj_gen 08. missing _module_free(cfm) File: src/bin/e_int_config_modules.c: 530 Function: _load_modules 09. missing free(class) in for loop File: src/bin/e_int_menus.c: 1187 Function: _e_int_menus_clients_add_by_class 10. missing free(roots) File: src/bin/e_main.c: 1646 Function: _e_main_screens_init Actually only e_win_init function could return 0. But I've added free to other codes for the consistency. 11. missing null check of 'es->cfg' File: src/bin/e_shelf.c: 2583 Function: _e_shelf_bindings_add 'es->cfg' might be null. please look at e_shelf_position_calc. 12. no ect->category check before comparing string values File: src/bin/e_theme.c: 387 Function: e_theme_config_remove I'm not sure, but inner if block checks ect->category before deleting a string. 13. missing E_FREE(wcb) in while loop File: src/bin/e_widget_ilist.c: 146 Function: _queue_timer 14. dereferencing freed pointer 'entry' File: src/modules/quickaccess/e_mod_quickaccess.c: 583 Function: _e_qa_event_border_remove_cb 15. missing E_FREE(trov) File: src/modules/tiling/e_mod_tiling.c: 3106 Function: _do_transition_overlay Thanks & Regards, Gwanglim SVN revision: 80231
2012-12-05 03:13:09 -08:00
if (!e_win_init())
{
free(roots);
return 0;
}
TS("E_Xkb Init");
if (!e_xkb_init())
{
e_error_message_show(_("Enlightenment cannot setup XKB Keyboard layouts.\n"));
_e_main_shutdown(-1);
}
TS("E_Xkb Init Done");
if (e_config->show_splash)
e_init_status_set(_("Setup DND"));
TS("E_Dnd Init");
if (!e_dnd_init())
{
e_error_message_show(_("Enlightenment cannot set up its dnd system.\n"));
_e_main_shutdown(-1);
}
TS("E_Dnd Init Done");
_e_main_shutdown_push(e_dnd_shutdown);
TS("\tscreens: manage roots");
for (i = 0; i < num; i++)
{
2012-06-19 05:20:33 -07:00
E_Manager *man;
E_Container *con;
man = e_manager_new(roots[i], i);
if (man)
e_manager_show(man);
else
{
e_error_message_show("Cannot create manager object for screen %i\n",
i);
free(roots);
return 0;
}
con = e_container_new(man);
if (con)
{
e_container_show(con);
e_grabinput_focus(con->bg_win, E_FOCUS_METHOD_PASSIVE);
e_hints_manager_init(man);
_e_main_desk_restore(man, con);
// e_manager_manage_windows(man);
2012-06-19 05:20:33 -07:00
}
else
{
e_error_message_show("Cannot create desktop object for manager on screen %i\n",
i);
free(roots);
return 0;
}
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
ecore_x_e_window_profile_supported_set(roots[i],
e_config->use_desktop_window_profile);
#endif
}
free(roots);
TS("\tscreens: sync");
ecore_x_sync();
return 1;
}
static int
_e_main_screens_shutdown(void)
{
e_win_shutdown();
e_comp_shutdown();
e_border_shutdown();
e_focus_shutdown();
e_exehist_shutdown();
e_menu_shutdown();
e_backlight_shutdown();
// ecore_evas closes evas - deletes objs - deletes fm widgets which tries to
// ipc to slave to stop monitoring - but ipc has been shut down. dont shut
2012-06-19 05:20:33 -07:00
// down.
// e_desk_shutdown();
// e_zone_shutdown();
// e_container_shutdown();
// e_manager_shutdown();
e_atoms_shutdown();
return 1;
}
static void
_e_main_desk_save(void)
{
Eina_List *ml;
E_Manager *man;
char env[1024], name[1024];
EINA_LIST_FOREACH(e_manager_list(), ml, man)
{
2012-06-19 05:20:33 -07:00
Eina_List *cl;
E_Container *con;
2012-06-19 05:20:33 -07:00
EINA_LIST_FOREACH(man->containers, cl, con)
{
Eina_List *zl;
E_Zone *zone;
EINA_LIST_FOREACH(con->zones, zl, zone)
{
snprintf(name, sizeof(name), "DESK_%d_%d_%d", man->num, con->num, zone->num);
snprintf(env, sizeof(env), "%d,%d", zone->desk_x_current, zone->desk_y_current);
e_util_env_set(name, env);
}
}
}
}
static void
_e_main_desk_restore(E_Manager *man, E_Container *con)
{
Eina_List *zl;
E_Zone *zone;
char *env;
char name[1024];
EINA_LIST_FOREACH(con->zones, zl, zone)
{
2012-06-19 05:20:33 -07:00
E_Desk *desk;
int desk_x, desk_y;
2012-06-19 05:20:33 -07:00
snprintf(name, sizeof(name), "DESK_%d_%d_%d", man->num, con->num, zone->num);
env = getenv(name);
if (!env) continue;
if (!sscanf(env, "%d,%d", &desk_x, &desk_y)) continue;
desk = e_desk_at_xy_get(zone, desk_x, desk_y);
if (!desk) continue;
e_desk_show(desk);
}
}
2012-06-19 05:20:33 -07:00
static void
_e_main_efreet_paths_init(void)
{
Eina_List **list;
if ((list = efreet_icon_extra_list_get()))
{
char buff[PATH_MAX];
e_user_dir_concat_static(buff, "icons");
*list = eina_list_prepend(*list, (void *)eina_stringshare_add(buff));
e_prefix_data_concat_static(buff, "data/icons");
*list = eina_list_prepend(*list, (void *)eina_stringshare_add(buff));
}
}
static Eina_Bool
_e_main_modules_load_after(void *d EINA_UNUSED, int type EINA_UNUSED, void *ev EINA_UNUSED)
{
e_int_config_modules(NULL, NULL);
E_FREE_FUNC(mod_init_end, ecore_event_handler_del);
return ECORE_CALLBACK_RENEW;
}
2012-06-19 05:20:33 -07:00
static void
_e_main_modules_load(Eina_Bool safe_mode)
{
if (!safe_mode)
e_module_all_load();
2012-06-19 05:20:33 -07:00
else
{
E_Module *m;
char *crashmodule;
crashmodule = getenv("E_MODULE_LOAD");
if (crashmodule) m = e_module_new(crashmodule);
if ((crashmodule) && (m))
{
e_module_disable(m);
e_object_del(E_OBJECT(m));
e_error_message_show
(_("Enlightenment crashed early on start and has<br>"
"been restarted. There was an error loading the<br>"
2012-06-19 05:20:33 -07:00
"module named: %s. This module has been disabled<br>"
"and will not be loaded."), crashmodule);
e_util_dialog_show
(_("Enlightenment crashed early on start and has been restarted"),
_("Enlightenment crashed early on start and has been restarted.<br>"
"There was an error loading the module named: %s<br><br>"
2012-06-19 05:20:33 -07:00
"This module has been disabled and will not be loaded."), crashmodule);
e_module_all_load();
}
else
{
e_error_message_show
(_("Enlightenment crashed early on start and has<br>"
"been restarted. All modules have been disabled<br>"
"and will not be loaded to help remove any problem<br>"
"modules from your configuration. The module<br>"
"configuration dialog should let you select your<br>"
"modules again.\n"));
2012-06-19 05:20:33 -07:00
e_util_dialog_show
(_("Enlightenment crashed early on start and has been restarted"),
_("Enlightenment crashed early on start and has been restarted.<br>"
"All modules have been disabled and will not be loaded to help<br>"
"remove any problem modules from your configuration.<br><br>"
"The module configuration dialog should let you select your<br>"
"modules again."));
}
mod_init_end = ecore_event_handler_add(E_EVENT_MODULE_INIT_END, _e_main_modules_load_after, NULL);
}
}
static void
_e_main_manage_all(void)
{
Eina_List *l;
E_Manager *man;
EINA_LIST_FOREACH(e_manager_list(), l, man)
{
e_manager_manage_windows(man);
e_comp_populate(man->comp);
}
}
static Eina_Bool
_e_main_cb_idle_before(void *data __UNUSED__)
{
Eina_List *l, *pl;
E_Before_Idler *eb;
e_menu_idler_before();
e_focus_idler_before();
e_border_idler_before();
e_pointer_idler_before();
EINA_LIST_FOREACH(_idle_before_list, l, eb)
{
2012-06-19 05:20:33 -07:00
if (!eb->delete_me)
{
if (!eb->func(eb->data)) eb->delete_me = 1;
}
}
EINA_LIST_FOREACH_SAFE(_idle_before_list, pl, l, eb)
{
2012-06-19 05:20:33 -07:00
if ((eb->once) || (eb->delete_me))
{
_idle_before_list =
eina_list_remove_list(_idle_before_list, pl);
free(eb);
}
}
edje_thaw();
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
_e_main_cb_idle_after(void *data __UNUSED__)
{
static int first_idle = 1;
edje_freeze();
2013-06-18 07:39:53 -07:00
#ifdef E18_RELEASE_BUILD
if (first_idle)
{
TS("SLEEP");
first_idle = 0;
e_precache_end = EINA_TRUE;
}
#else
if (first_idle++ < 60)
{
TS("SLEEP");
if (!first_idle)
e_precache_end = EINA_TRUE;
}
#endif
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
_e_main_cb_x_flusher(void *data __UNUSED__)
{
eet_clearcache();
ecore_x_flush();
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
_e_main_cb_startup_fake_end(void *data __UNUSED__)
{
e_init_hide();
return ECORE_CALLBACK_CANCEL;
}