/** * @return Returns no value. * @brief The main execution loop of EWL * * This is the main execution loop of ewl. It dispatches * incoming events and renders updates to the evas's used by ewl. */ void ewl_main(void) { DENTER_FUNCTION(DLEVEL_STABLE); ecore_main_loop_begin(); ewl_shutdown(); DLEAVE_FUNCTION(DLEVEL_STABLE); }
void ui_shutdown(ePlayer *player) { assert(player); ui_shutdown_edje(player); ewl_shutdown(); edje_shutdown(); ecore_evas_shutdown(); ecore_shutdown(); }
void eke_gui_ewl_shutdown(void) { ewl_shutdown(); }
void icon_editor_shutdown() { /* FIXME: how do we clean up the ewl widgets? */ ewl_shutdown(); }
/** * @param argc: the argc passed into the main function * @param argv: the argv passed into the main function * @return Returns 1 or greater on success, 0 otherwise. * @brief Initialize the internal variables of ewl to begin the program * * Sets up necessary internal variables for executing ewl * functions. This should be called before any other ewl functions are used. */ int ewl_init(int *argc, char **argv) { const char *locale; DENTER_FUNCTION(DLEVEL_STABLE); /* check if we are already initialized */ if (++ewl_init_count > 1) DRETURN_INT(ewl_init_count, DLEVEL_STABLE); /* set the locale for string collation if it isn't already set */ locale = setlocale(LC_COLLATE, NULL); if (strcmp(locale, "C") || strcmp(locale, "POSIX")) { setlocale(LC_COLLATE, ""); } shutdown_queue = ecore_list_new(); if (!shutdown_queue) { fprintf(stderr, "Could not create Ewl shutdown queue.\n"); goto FAILED; } if (!ecore_init()) { fprintf(stderr, "Could not initialize Ecore.\n"); goto FAILED; } ecore_list_prepend(shutdown_queue, ecore_shutdown); #ifdef BUILD_EFREET_SUPPORT if (!efreet_init()) { fprintf(stderr, "Could not initialize Efreet.\n"); goto FAILED; } ecore_list_prepend(shutdown_queue, efreet_shutdown); if (!efreet_mime_init()) { fprintf(stderr, "Could not initialize Efreet_Mime.\n"); goto FAILED; } ecore_list_prepend(shutdown_queue, efreet_mime_shutdown); #endif if (!ecore_string_init()) { fprintf(stderr, "Could not initialize Ecore Strings.\n"); goto FAILED; } ecore_list_prepend(shutdown_queue, ecore_string_shutdown); reveal_list = ecore_list_new(); obscure_list = ecore_list_new(); configure_active = ecore_list_new(); configure_available = ecore_list_new(); realize_list = ecore_list_new(); destroy_list = ecore_list_new(); free_evas_list = ecore_list_new(); free_evas_object_list = ecore_list_new(); child_add_list = ecore_list_new(); ewl_embed_list = ecore_list_new(); ewl_window_list = ecore_list_new(); shutdown_hooks = ecore_list_new(); if ((!reveal_list) || (!obscure_list) || (!configure_active) || (!configure_available) || (!realize_list) || (!destroy_list) || (!free_evas_list) || (!free_evas_object_list) || (!child_add_list) || (!ewl_embed_list) || (!ewl_window_list) || (!shutdown_hooks)) { fprintf(stderr, "Unable to initialize internal configuration." " Out of memory?\n"); goto FAILED; } /* * Cleanup the queue buffers when the management lists get freed. */ ecore_list_free_cb_set(configure_active, free); ecore_list_free_cb_set(configure_available, free); if (!ewl_system_directories_init()) { fprintf(stderr, "Could not initialize the system" " directories.\n"); goto FAILED; } ecore_list_prepend(shutdown_queue, ewl_system_directories_shutdown); /* now that the directories are init we can also set the text domain */ #ifdef ENABLE_NLS bindtextdomain(PACKAGE, ewl_system_directory_get(EWL_DIRECTORY_LOCALE)); bind_textdomain_codeset(PACKAGE, "UTF-8"); #endif if (!ewl_config_init()) { fprintf(stderr, "Could not initialize Ewl Config.\n"); goto FAILED; } ecore_list_prepend(shutdown_queue, ewl_config_shutdown); if (!ewl_engines_init()) { fprintf(stderr, "Could not intialize Ewl Engines.\n"); goto FAILED; } ecore_list_prepend(shutdown_queue, ewl_engines_shutdown); /* handle any command line options */ ewl_init_parse_options(argc, argv); /* initialize this _after_ we've handled the command line options */ ewl_config_cache_init(); /* we create the engine we will be working with here so that it is * initialized before we start to use it. */ if (!ewl_engine_new(ewl_config_string_get(ewl_config, EWL_CONFIG_ENGINE_NAME), argc, argv)) { fprintf(stderr, "Could not initialize Ewl Engine.\n"); goto FAILED; } if (!ewl_callbacks_init()) { fprintf(stderr, "Could not initialize Ewl Callback system.\n"); goto FAILED; } ecore_list_prepend(shutdown_queue, ewl_callbacks_shutdown); /* allocate the two window callbacks */ EWL_CALLBACK_EXPOSE = ewl_callback_type_add(); EWL_CALLBACK_DELETE_WINDOW = ewl_callback_type_add(); /* allocate the mvc callback */ EWL_CALLBACK_MVC_CLICKED = ewl_callback_type_add(); if (!ewl_theme_init()) { fprintf(stderr, "Could not setup Ewl Theme system.\n"); goto FAILED; } ecore_list_prepend(shutdown_queue, ewl_theme_shutdown); if (!ewl_icon_theme_init()) { fprintf(stderr, "Could not initialize Ewl Icon Theme system.\n"); goto FAILED; } ecore_list_prepend(shutdown_queue, ewl_icon_theme_shutdown); if (!ewl_dnd_init()) { fprintf(stderr, "Could not initialize Ewl DND support.\n"); goto FAILED; } ecore_list_prepend(shutdown_queue, ewl_dnd_shutdown); if (!ewl_io_manager_init()) { fprintf(stderr, "Could not initialize Ewl IO Manager.\n"); goto FAILED; } ecore_list_prepend(shutdown_queue, ewl_io_manager_shutdown); if (!ewl_text_context_init()) { fprintf(stderr, "Could not initialize Ewl Text Context system.\n"); goto FAILED; } ecore_list_prepend(shutdown_queue, ewl_text_context_shutdown); if (!(idle_enterer = ecore_idle_enterer_add(ewl_idle_render, NULL))) { fprintf(stderr, "Could not create Idle Enterer.\n"); goto FAILED; } DRETURN_INT(ewl_init_count, DLEVEL_STABLE); FAILED: ewl_shutdown(); DRETURN_INT(ewl_init_count, DLEVEL_STABLE); }
int main(int argc, char ** argv) { Eli_App * eap; eap = NULL; /* Initialize NLS */ #ifdef ENABLE_NLS setlocale(LC_MESSAGES, ""); setlocale(LC_MONETARY, ""); setlocale(LC_CTYPE, ""); bindtextdomain(PACKAGE, PACKAGE_LOCALE_DIR); bind_textdomain_codeset(PACKAGE, "UTF-8"); textdomain(PACKAGE); #endif /* Initialize Ecore */ if (!ecore_init()) { fprintf(stderr, _("Elitaire Error: Cannot init Ecore\n")); return 1; } if (!ecore_file_init()) { fprintf(stderr, _("Elitaire Error: Cannot init Ecore File\n")); return 1; } /* Initialize Edje */ if (!edje_init()) { fprintf(stderr, _("Elitaire Error: Cannot init Edje\n")); return 1; } /* Initialize Ecore_Config */ if (ecore_config_init("elitaire") != ECORE_CONFIG_ERR_SUCC) { fprintf(stderr, _("Elitaire Error: Cannot init Ecore Config\n")); return 1; } /* Initialize Ewl */ if (!ewl_init(&argc, argv)) { fprintf(stderr, _("Elitaire Error: Cannot init Ewl\n")); return 1; } /* Init Highscore and Statistics */ eli_highscore_init("elitaire"); eli_statistics_init("elitaire"); help_reader_init(PACKAGE_DATA_DIR"/doc/"); /* Init the main app */ eap = eli_app_new(); eli_app_init(eap, "edje"); eli_app_gui_make(eap); ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, sig_exit_cb, eap); /* ***Main Loop*** */ ecore_main_loop_begin(); eli_app_del(eap); /* shutdown all */ help_reader_shutdown(); eli_statistics_shutdown(); eli_highscore_shutdown(); ewl_shutdown(); //eli_app_gui_del(eap); ecore_config_shutdown(); ecore_file_shutdown(); edje_shutdown(); ecore_evas_shutdown(); ecore_shutdown(); return 0; }