#include "e.h"
+#include "e_actions_intern.h"
+#include "e_test_helper_intern.h"
+#include "e_user_intern.h"
+#include "e_utils_intern.h"
+#include "e_theme_intern.h"
+#include "e_signals_intern.h"
+#include "e_security_intern.h"
+#include "e_screensaver_intern.h"
+#include "e_scale_intern.h"
+
#ifdef __linux__
# include <sys/prctl.h>
#endif
static void _e_main_parse_arguments(int argc, char **argv);
static Eina_Bool _e_main_cb_signal_exit(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev EINA_UNUSED);
static Eina_Bool _e_main_cb_signal_hup(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev EINA_UNUSED);
-static Eina_Bool _e_main_cb_signal_user(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev);
static int _e_main_dirs_init(void);
static int _e_main_dirs_shutdown(void);
static int _e_main_path_init(void);
static void _e_main_hook_call(E_Main_Hook_Point hookpoint, void *data EINA_UNUSED);
/* local variables */
-static Eina_Bool inloop = EINA_FALSE;
-
static int _e_main_lvl = 0;
static int(*_e_main_shutdown_func[MAX_LEVEL]) (void);
static Eina_Inlist *_e_main_hooks[] =
{
[E_MAIN_HOOK_MODULE_LOAD_DONE] = NULL,
- [E_MAIN_HOOK_E_INFO_READY] = NULL
+ [E_MAIN_HOOK_E_INFO_READY] = NULL,
+ [E_MAIN_HOOK_POST_CLIENT_IDLER_BEFORE] = NULL
};
/* external variables */
-E_API Eina_Bool e_precache_end = EINA_FALSE;
-E_API Eina_Bool good = EINA_FALSE;
-E_API Eina_Bool evil = EINA_FALSE;
E_API Eina_Bool starting = EINA_TRUE;
E_API Eina_Bool stopping = EINA_FALSE;
-E_API Eina_Bool e_nopause = EINA_FALSE;
static Eina_Bool
_xdg_check_str(const char *env, const char *str)
{
char *s;
const char *p = e_prefix_get();
- char newpath[4096], buf[4096];
+ char newpath[PATH_MAX], buf[PATH_MAX + PATH_MAX + 200];
if (!p) return;
TSE("[DEFERRED] DPMS Init Done");
_e_main_shutdown_push(e_dpms_shutdown);
- TSB("[DEFERRED] Screens Init: win");
- if (!e_win_init())
- {
- e_error_message_show(_("Enlightenment cannot setup elementary trap!\n"));
- goto failed;
- }
- TSE("[DEFERRED] Screens Init: win Done");
-
TSB("[DEFERRED] E_Dnd Init");
if (!e_dnd_init())
{
# endif
# endif
#endif
+
+#ifdef TIZEN_TEST_GCOV
+ setenv("GCOV_PREFIX", "/tmp", 1);
+#endif
+
+ /* for debugging by redirecting stdout & stderr of e to a log file to tail */
+ setvbuf(stdout, NULL, _IONBF, 0);
+ setvbuf(stderr, NULL, _IONBF, 0);
+
#ifdef TS_DO
t0 = t1 = t2 = ecore_time_unix_get();
printf("ESTART(main) %1.5f\n", t0);
}
TSE("Determine Prefix Done");
- /* for debugging by redirecting stdout of e to a log file to tail */
- setvbuf(stdout, NULL, _IONBF, 0);
-
TSB("Parse Arguments");
_e_main_parse_arguments(argc, argv);
TSE("Parse Arguments Done");
"Perhaps you are out of memory?"));
goto failed;
}
- if (!ecore_event_handler_add(ECORE_EVENT_SIGNAL_USER,
- _e_main_cb_signal_user, NULL))
- {
- e_error_message_show(_("Enlightenment cannot set up a USER signal handler.\n"
- "Perhaps you are out of memory?"));
- goto failed;
- }
TSE("Ecore Event Handlers Done");
TSB("Ecore_File Init");
TSE("Ecore_File Init Done");
_e_main_shutdown_push(ecore_file_shutdown);
+ TSB("E_Util_File_Monitor Init");
+ e_util_file_monitor_init();
+ TSE("E_Util_File_Monitor Init Done");
+ _e_main_shutdown_push(e_util_file_monitor_shutdown);
+
_idle_before = ecore_idle_enterer_before_add(_e_main_cb_idle_before, NULL);
TSB("XDG_DATA_DIRS Init");
}
TSE("Ecore_Evas Init Done");
- /* e doesn't sync to compositor - it should be one */
- ecore_evas_app_comp_sync_set(0);
-
TSB("Edje Init");
if (!edje_init())
{
e_screensaver_preinit();
e_zone_init();
e_desk_init();
- e_slot_init();
+ e_magnifier_init();
TRACE_DS_BEGIN(MAIN:WAIT /dev/dri/card0);
if (e_config->sleep_for_dri)
}
TRACE_DS_END();
+ TSB("E_Msg Init");
+ if (!e_msg_init())
+ {
+ e_error_message_show(_("Enlightenment cannot set up its msg system."));
+ goto failed;
+ }
+ TSE("E_Msg Init Done");
+ _e_main_shutdown_push(e_msg_shutdown);
+
e_module_event_init();
TSB("E_Pointer Init");
_e_main_shutdown_push(_e_main_screens_shutdown);
TRACE_DS_END();
+ TSB("E_Devicemgr Init");
+ if (!e_devicemgr_init())
+ {
+ e_error_message_show(_("Enlightenment cannot set up its device_manager system.\n"));
+ goto failed;
+ }
+ TSE("E_Devicemgr Init Done");
+ _e_main_shutdown_push(e_devicemgr_shutdown);
+
TSB("E_Keyrouter Init");
if (!e_keyrouter_init())
{
e_comp_all_thaw();
TSE("E_Comp Thaw Done");
+ if (e_config->use_thread_max_cpu)
+ {
+ int cpus;
+
+ cpus = eina_cpu_count();
+ if (cpus >= 1)
+ {
+ TSM("Set ecore thread max");
+ ecore_thread_max_set(cpus);
+ }
+ }
+
_idle_after = ecore_idle_enterer_add(_e_main_cb_idle_after, NULL);
starting = EINA_FALSE;
- inloop = EINA_TRUE;
-
- e_util_env_set("E_RESTART", "1");
TSM("MAIN LOOP AT LAST");
#endif
ecore_main_loop_begin();
- inloop = EINA_FALSE;
-
- ELOGF("COMP", "STOPPING enlightenment...", NULL, NULL);
+ ELOGF("COMP", "STOPPING enlightenment...", NULL);
stopping = EINA_TRUE;
_e_main_desk_save();
dir = e_util_env_get("XDG_RUNTIME_DIR");
if (dir)
{
- char buf_env[PATH_MAX];
+ char buf_env[PATH_MAX - 12];
snprintf(buf_env, sizeof(buf_env), "%s", dir);
snprintf(buf, sizeof(buf), "%s/.e-deleteme", buf_env);
if (ecore_file_exists(buf)) ecore_file_recursive_rm(buf_env);
/* handle some command-line parameters */
for (i = 1; i < argc; i++)
{
- 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)))
+ 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], "-nopause"))
- e_nopause = EINA_TRUE;
else if ((!strcmp(argv[i], "-version")) ||
(!strcmp(argv[i], "--version")))
{
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-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"
"\t-version\n"
)
);
return ECORE_CALLBACK_RENEW;
}
-static Eina_Bool
-_e_main_cb_signal_user(void *data EINA_UNUSED, int ev_type EINA_UNUSED, void *ev)
-{
- Ecore_Event_Signal_User *e = ev;
-
- 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;
-
-}
-
static int
_e_main_dirs_init(void)
{
static int
_e_main_screens_shutdown(void)
{
- e_win_shutdown();
e_comp_shutdown();
e_client_shutdown();
- e_slot_shutdown();
+ e_magnifier_shutdown();
e_desk_shutdown();
e_zone_shutdown();
return 1;
_e_main_desk_restore(void)
{
E_Client *ec;
+ E_Zone *zone;
E_CLIENT_REVERSE_FOREACH(ec)
- if ((!e_client_util_ignored_get(ec)) && e_client_util_desk_visible(ec, e_desk_current_get(ec->zone)))
- {
- ec->want_focus = ec->take_focus = 1;
- break;
- }
+ {
+ zone = e_comp_zone_find_by_ec(ec);
+ if ((!e_client_util_ignored_get(ec)) && e_desk_has_ec(e_desk_current_get(zone), ec))
+ {
+ ec->want_focus = ec->take_focus = 1;
+ break;
+ }
+ }
}
static Eina_Bool
_e_main_cb_idle_before(void *data EINA_UNUSED)
{
- e_client_idler_before();
+ e_comp_idler_before();
+ _e_main_hook_call(E_MAIN_HOOK_POST_CLIENT_IDLER_BEFORE, NULL);
edje_thaw();
+
return ECORE_CALLBACK_RENEW;
}
eet_clearcache();
edje_freeze();
-#ifdef E_RELEASE_BUILD
if (first_idle)
{
TSM("SLEEP");
first_idle = 0;
- e_precache_end = EINA_TRUE;
- }
-#else
- if (first_idle++ < 60)
- {
- TSM("SLEEP");
- if (!first_idle)
- e_precache_end = EINA_TRUE;
}
-#endif
return ECORE_CALLBACK_RENEW;
}