示例#1
0
文件: x.c 项目: Limsik/e17
int
EDisplayOpen(const char *dstr, int scr)
{
   char                dbuf[256], *s;
   unsigned int        ddpy, dscr;

   if (!dstr)
      goto do_open;

   Esnprintf(dbuf, sizeof(dbuf), "%s", dstr);
   s = strchr(dbuf, ':');
   if (!s)
      return -1;
   s++;

   ddpy = dscr = 0;
   sscanf(s, "%u.%u", &ddpy, &dscr);
   if (scr >= 0)		/* Override screen */
      dscr = scr;
   Esnprintf(s, sizeof(dbuf) - (s - dbuf), "%u.%u", ddpy, dscr);
   dstr = dbuf;

 do_open:
#ifdef USE_ECORE_X
   ecore_x_init(dstr);
   disp = ecore_x_display_get();
#else
   disp = XOpenDisplay(dstr);
#endif

   return (disp) ? 0 : -1;
}
示例#2
0
static Eina_Bool
_ecore_imf_xim_init(void)
{
   eina_init();

   _ecore_imf_xim_log_dom = eina_log_domain_register("ecore_imf_xim", NULL);
   if (_ecore_imf_xim_log_dom < 0)
     {
        EINA_LOG_ERR("Could not register log domain: ecore_imf_xim");
        return EINA_FALSE;
     }

   DBG(" ");

   if (!ecore_x_init(NULL))
     {
        eina_shutdown();
        return EINA_FALSE;
     }

   ecore_imf_module_register(&xim_info,
                             xim_imf_module_create,
                             xim_imf_module_exit);

   return EINA_TRUE;
}
示例#3
0
void init_efl() {
    if (! ecore_init())
        fatal("Could not init ecore");
    if (! ecore_x_init(NULL))
        fatal("Could not init ecore_x");
    if (! ecore_evas_init())
        fatal("Could not init ecore_evas");
    if (! edje_init())
    	fatal("Could not init edje");
}
示例#4
0
Eina_Bool
ecore_imf_xim_init(void)
{
   EINA_LOG_DBG("%s in", __FUNCTION__);
   eina_init();
   ecore_x_init(NULL);
   ecore_imf_module_register(&xim_info,
                             xim_imf_module_create,
                             xim_imf_module_exit);

   return EINA_TRUE;
}
    bool platformInitialize() override
    {
#if PLATFORM(GTK)
        gtk_init(nullptr, nullptr);
#elif PLATFORM(EFL)
#ifdef HAVE_ECORE_X
        if (!ecore_x_init(0))
#endif
            return false;
#endif

        return true;
    }
示例#6
0
文件: main.c 项目: hchbaw/egauche
int main(int argc, char **argv)
{
   eina_init();
   ecore_init();

   e_mod_gauche_init("./test-main.scm");

   ecore_x_init(NULL);

   printf("start\n");

   ecore_main_loop_begin();
   return 0;
}
    bool platformInitialize() override
    {
        if (!eina_init())
            return false;

        if (!ecore_init()) {
            // Could not init ecore.
            eina_shutdown();
            return false;
        }

#ifdef HAVE_ECORE_X
        XSetExtensionErrorHandler(dummyExtensionErrorHandler);

        if (!ecore_x_init(0)) {
            // Could not init ecore_x.
            // PlatformScreenEfl and systemBeep() functions
            // depend on ecore_x functionality.
            ecore_shutdown();
            eina_shutdown();
            return false;
        }
#endif

        if (!ecore_evas_init()) {
#ifdef HAVE_ECORE_X
            ecore_x_shutdown();
#endif
            ecore_shutdown();
            eina_shutdown();
            return false;
        }

        if (!edje_init()) {
            ecore_evas_shutdown();
#ifdef HAVE_ECORE_X
            ecore_x_shutdown();
#endif
            ecore_shutdown();
            eina_shutdown();
            return false;
        }

        if (!ecore_main_loop_glib_integrate())
            return false;

        SoupNetworkSession::defaultSession().setupHTTPProxyFromEnvironment();
        return true;
    }
WK_EXPORT int PluginProcessMainUnix(int argc, char* argv[])
{
#if PLUGIN_ARCHITECTURE(X11)
    bool scanPlugin = !strcmp(argv[1], "-scanPlugin");
#endif
    ASSERT_UNUSED(argc, argc == 3);

#if PLATFORM(GTK)
    gtk_init(&argc, &argv);
#elif PLATFORM(EFL)
#ifdef HAVE_ECORE_X
    if (!ecore_x_init(0))
#endif
        return 1;
#endif

    InitializeWebKit2();

#if PLUGIN_ARCHITECTURE(X11)
    if (scanPlugin) {
        String pluginPath(argv[2]);
        if (!NetscapePluginModule::scanPlugin(pluginPath))
            return EXIT_FAILURE;
        return EXIT_SUCCESS;
    }
#endif

    // Plugins can produce X errors that are handled by the GDK X error handler, which
    // exits the process. Since we don't want to crash due to plugin bugs, we install a
    // custom error handler to show a warning when a X error happens without aborting.
#if defined(XP_UNIX)
    programName = basename(argv[0]);
    XSetErrorHandler(webkitXError);
#endif

    int socket = atoi(argv[1]);

    WebKit::ChildProcessInitializationParameters parameters;
    parameters.connectionIdentifier = socket;
    parameters.extraInitializationData.add("plugin-path", argv[2]);

    WebKit::PluginProcess::shared().initialize(parameters);

    RunLoop::run();

    return 0;
}
示例#9
0
END_TEST

START_TEST(ecore_test_ecore_x_bell)
{
   int i;
   int ret;

   ret = ecore_x_init(NULL);
   fail_if(ret != 1);

   printf("You should hear 3 beeps now.\n");
   for (i = 0; i < 3; i++)
     {
	ret = ecore_x_bell(0);
	fail_if(ret != EINA_TRUE);
	ecore_x_sync();
	sleep(1);
     }

   ecore_x_shutdown();
}
示例#10
0
WK_EXPORT int PluginProcessMainUnix(int argc, char* argv[])
{
    ASSERT_UNUSED(argc, argc == 2 || argc == 3);
    bool scanPlugin = !strcmp(argv[1], "-scanPlugin");
    ASSERT_UNUSED(argc, argc == 2 || (argc == 3 && scanPlugin));

#if PLATFORM(GTK)
    gtk_init(&argc, &argv);
#elif PLATFORM(EFL)
#ifdef HAVE_ECORE_X
    if (!ecore_x_init(0))
#endif
        return 1;
#endif

    ScriptController::initializeThreading();

    if (scanPlugin) {
        String pluginPath(argv[2]);
        if (!NetscapePluginModule::scanPlugin(pluginPath))
            return EXIT_FAILURE;
        return EXIT_SUCCESS;
    }

    RunLoop::initializeMainRunLoop();

    // Plugins can produce X errors that are handled by the GDK X error handler, which
    // exits the process. Since we don't want to crash due to plugin bugs, we install a
    // custom error handler to show a warning when a X error happens without aborting.
#if defined(XP_UNIX)
    programName = basename(argv[0]);
    XSetErrorHandler(webkitXError);
#endif

    int socket = atoi(argv[1]);
    WebKit::PluginProcess::shared().initialize(socket, RunLoop::main());
    RunLoop::run();

    return 0;
}
示例#11
0
int ewk_init(void)
{
    if (_ewkInitCount)
        return ++_ewkInitCount;

    if (!eina_init())
        goto error_eina;

    _ewk_log_dom = eina_log_domain_register("ewebkit2", EINA_COLOR_ORANGE);
    if (_ewk_log_dom < 0) {
        EINA_LOG_CRIT("could not register log domain 'ewebkit2'");
        goto error_log_domain;
    }

    if (!evas_init()) {
        CRITICAL("could not init evas.");
        goto error_evas;
    }

    if (!ecore_init()) {
        CRITICAL("could not init ecore.");
        goto error_ecore;
    }

    if (!ecore_evas_init()) {
        CRITICAL("could not init ecore_evas.");
        goto error_ecore_evas;
    }

    if (!ecore_imf_init()) {
        CRITICAL("could not init ecore_imf.");
        goto error_ecore_imf;
    }

    if (!efreet_init()) {
        CRITICAL("could not init efreet.");
        goto error_efreet;
    }

#ifdef HAVE_ECORE_X
    if (!ecore_x_init(0)) {
        CRITICAL("could not init ecore_x.");
        goto error_ecore_x;
    }
#endif

    if (!edje_init()) {
        CRITICAL("Could not init edje.");
        goto error_edje;
    }

    if (!ecore_main_loop_glib_integrate()) {
        WARN("Ecore was not compiled with GLib support, some plugins will not "
            "work (ie: Adobe Flash)");
    }

    return ++_ewkInitCount;

error_edje:
#ifdef HAVE_ECORE_X
    ecore_x_shutdown();
error_ecore_x:
#else
    efreet_shutdown();
#endif
error_efreet:
    ecore_imf_shutdown();
error_ecore_imf:
    ecore_evas_shutdown();
error_ecore_evas:
    ecore_shutdown();
error_ecore:
    evas_shutdown();
error_evas:
    eina_log_domain_unregister(_ewk_log_dom);
    _ewk_log_dom = -1;
error_log_domain:
    eina_shutdown();
error_eina:
    return 0;
}
示例#12
0
int EwkMain::initialize()
{
    if (m_initCount)
        return ++m_initCount;

    if (!eina_init()) {
        EINA_LOG_CRIT("could not init eina.");
        return 0;
    }

    m_logDomainId = eina_log_domain_register("ewebkit2", EINA_COLOR_ORANGE);
    if (m_logDomainId < 0) {
        EINA_LOG_CRIT("could not register log domain 'ewebkit2'");
        shutdownInitializedEFLModules(EFLModuleInitFailure::EinaLog);
        return 0;
    }

    if (!evas_init()) {
        CRITICAL("could not init evas.");
        shutdownInitializedEFLModules(EFLModuleInitFailure::Evas);
        return 0;
    }

    if (!ecore_init()) {
        CRITICAL("could not init ecore.");
        shutdownInitializedEFLModules(EFLModuleInitFailure::Ecore);
        return 0;
    }

    if (!ecore_evas_init()) {
        CRITICAL("could not init ecore_evas.");
        shutdownInitializedEFLModules(EFLModuleInitFailure::EcoreEvas);
        return 0;
    }

    if (!ecore_imf_init()) {
        CRITICAL("could not init ecore_imf.");
        shutdownInitializedEFLModules(EFLModuleInitFailure::EcoreImf);
        return 0;
    }

    if (!efreet_init()) {
        CRITICAL("could not init efreet.");
        shutdownInitializedEFLModules(EFLModuleInitFailure::Efreet);
        return 0;
    }

#ifdef HAVE_ECORE_X
    if (!ecore_x_init(0)) {
        CRITICAL("could not init ecore_x.");
        shutdownInitializedEFLModules(EFLModuleInitFailure::EcoreX);
        return 0;
    }
#endif

    if (!edje_init()) {
        CRITICAL("Could not init edje.");
        shutdownInitializedEFLModules(EFLModuleInitFailure::Edje);
        return 0;
    }

    if (!ecore_main_loop_glib_integrate()) {
        WARN("Ecore was not compiled with GLib support, some plugins will not "
            "work (ie: Adobe Flash)");
    }

    return ++m_initCount;
}
WK_EXPORT int WebProcessMainEfl(int argc, char* argv[])
{
    // WebProcess should be launched with an option.
    if (argc != 2)
        return 1;

    if (!eina_init())
        return 1;

    if (!ecore_init()) {
        // Could not init ecore.
        eina_shutdown();
        return 1;
    }

#ifdef HAVE_ECORE_X
    XSetExtensionErrorHandler(dummyExtensionErrorHandler);

    if (!ecore_x_init(0)) {
        // Could not init ecore_x.
        // PlatformScreenEfl and systemBeep() functions
        // depend on ecore_x functionality.
        ecore_shutdown();
        eina_shutdown();
        return 1;
    }
#endif

    if (!ecore_evas_init()) {
#ifdef HAVE_ECORE_X
        ecore_x_shutdown();
#endif
        ecore_shutdown();
        eina_shutdown();
        return 1;
    }

    if (!edje_init()) {
        ecore_evas_shutdown();
#ifdef HAVE_ECORE_X
        ecore_x_shutdown();
#endif
        ecore_shutdown();
        eina_shutdown();
        return 1;
    }

#if !GLIB_CHECK_VERSION(2, 35, 0)
    g_type_init();
#endif

    if (!ecore_main_loop_glib_integrate())
        return 1;

    InitializeWebKit2();

    SoupSession* session = WebCore::ResourceHandle::defaultSession();
    const char* httpProxy = getenv("http_proxy");
    if (httpProxy) {
        const char* noProxy = getenv("no_proxy");
        SoupProxyURIResolver* resolverEfl = soupProxyResolverWkNew(httpProxy, noProxy);
        soup_session_add_feature(session, SOUP_SESSION_FEATURE(resolverEfl));
        g_object_unref(resolverEfl);
    }

    int socket = atoi(argv[1]);

    ChildProcessInitializationParameters parameters;
    parameters.connectionIdentifier = socket;

    WebProcess::shared().initialize(parameters);

    RunLoop::run();

    if (SoupSessionFeature* soupCache = soup_session_get_feature(session, SOUP_TYPE_CACHE)) {
        soup_cache_flush(SOUP_CACHE(soupCache));
        soup_cache_dump(SOUP_CACHE(soupCache));
    }

    edje_shutdown();
    ecore_evas_shutdown();
#ifdef HAVE_ECORE_X
    ecore_x_shutdown();
#endif
    ecore_shutdown();
    eina_shutdown();

    return 0;

}
示例#14
0
文件: ewk_main.cpp 项目: dog-god/iptv
int ewk_init(void)
{
    if (_ewkInitCount)
        return ++_ewkInitCount;

    if (!eina_init())
        goto error_eina;

    _ewk_log_dom = eina_log_domain_register("ewebkit", EINA_COLOR_ORANGE);
    if (_ewk_log_dom < 0) {
        EINA_LOG_CRIT("could not register log domain 'ewebkit'");
        goto error_log_domain;
    }

    if (!evas_init()) {
        CRITICAL("could not init evas.");
        goto error_evas;
    }

    if (!ecore_init()) {
        CRITICAL("could not init ecore.");
        goto error_ecore;
    }

    if (!ecore_evas_init()) {
        CRITICAL("could not init ecore_evas.");
        goto error_ecore_evas;
    }

    if (!edje_init()) {
        CRITICAL("could not init edje.");
        goto error_edje;
    }

#ifdef HAVE_ECORE_X
    if (!ecore_x_init(0)) {
        CRITICAL("could not init ecore_x.");
        goto error_ecore_x;
    }
#endif

    if (!_ewk_init_body()) {
        CRITICAL("could not init body");
        goto error_edje;
    }

    return ++_ewkInitCount;

#ifdef HAVE_ECORE_X
error_ecore_x:
    edje_shutdown();
#endif
error_edje:
    ecore_evas_shutdown();
error_ecore_evas:
    ecore_shutdown();
error_ecore:
    evas_shutdown();
error_evas:
    eina_log_domain_unregister(_ewk_log_dom);
    _ewk_log_dom = -1;
error_log_domain:
    eina_shutdown();
error_eina:
    return 0;
}
示例#15
0
/**
 * @param argc: Number of command line arguments supplied.
 * @param argv: Char* array containing the command line arguments supplied.
 * @return: To the system, normally 0.
 * @brief: The first function once enotes is called.
 */
int
main(int argc, char *argv[])
{
	int             note_count;

	/* IPC Check */
	ecore_ipc_init();
	dml("IPC Initiated Successfully", 1);

	/* loading will increment this if there are notes if not we may need to
	 * create a blank one */
	note_count = 0;

	if ((ecore_config_init("enotes")) == ECORE_CONFIG_ERR_FAIL) {
		ecore_ipc_shutdown();
		return (-1);
	}
	ecore_app_args_set(argc, (const char **) argv);

	ecore_config_app_describe("E-Notes - Sticky Notes for Enlightenment\n\
Copyright (c) Thomas Fletcher\n\
Usage: enotes [options]");

	/* Read the Usage and Configurations */
	main_config = mainconfig_new();
	if (read_configuration(main_config) != ECORE_CONFIG_PARSE_CONTINUE) {
		ecore_config_shutdown();
		ecore_ipc_shutdown();
		ecore_shutdown();
		mainconfig_free(main_config);
		return (-1);
	}

	dml("Successfully Read Configurations and Usage", 1);

	process_note_storage_locations();

	if (find_server() != 0) {
		if (remotecmd != NULL)
			send_to_server(remotecmd);
		else
			send_to_server("DEFNOTE");
	} else {
		dml("Server wasn't found.. Creating one", 1);
		/* Setup Server */
		setup_server();

		/* Initialise the E-Libs */
		ecore_init();
		ecore_x_init(NULL);
		ecore_app_args_set(argc, (const char **) argv);
		if (!ecore_evas_init()) {
			mainconfig_free(main_config);
			return -1;
		}
		ewl_init(&argc, argv);
		edje_init();

		dml("Efl Successfully Initiated", 1);

		autoload();
		/* create autosave timer */
		update_autosave();

		if (remotecmd != NULL)
			handle_ipc_message(remotecmd);

		/* Begin the Control Centre */
		if (main_config->controlcentre == 1) {
			setup_cc();
			dml("Control Centre Setup", 1);
		} else {
			dml("No Control Centre - Displaying Notice", 1);
			if (get_note_count() == 0)
				new_note();
		}

		if (main_config->welcome == 1) {
			open_welcome();
		}

		/* Begin the main loop */
		dml("Starting Main Loop", 1);
		ecore_main_loop_begin();

		dml("Main Loop Ended", 1);

		/* Save Controlcentre Settings */
		set_cc_pos();

		autosave();
		if (autosave_timer)
			ecore_timer_del(autosave_timer);

		/* Save and Free the Configuration */
		ecore_config_save();
		dml("Configuration Saved", 1);
		mainconfig_free(main_config);
		dml("Configuration Structure Free'd", 1);

		/* Shutdown the E-Libs */
		edje_shutdown();
		ecore_evas_shutdown();
		ecore_x_shutdown();
		ecore_shutdown();
		dml("Efl Shutdown", 1);
	}

	/* End IPC */
	ecore_ipc_shutdown();
	dml("IPC Shutdown", 1);

	dml("Leaving.", 1);
	return (0);
}
示例#16
0
WK_EXPORT int WebProcessMainEfl(int argc, char* argv[])
{
    // WebProcess should be launched with an option.
    if (argc != 2)
        return 1;

    if (!eina_init())
        return 1;

    if (!ecore_init()) {
        // Could not init ecore.
        eina_shutdown();
        return 1;
    }

#ifdef HAVE_ECORE_X
    XSetExtensionErrorHandler(dummyExtensionErrorHandler);

    if (!ecore_x_init(0)) {
        // Could not init ecore_x.
        // PlatformScreenEfl and systemBeep() functions
        // depend on ecore_x functionality.
        ecore_shutdown();
        eina_shutdown();
        return 1;
    }
#endif

#if !GLIB_CHECK_VERSION(2, 35, 0)
    g_type_init();
#endif

    if (!ecore_main_loop_glib_integrate())
        return 1;

    JSC::initializeThreading();
    WTF::initializeMainThread();

    RunLoop::initializeMainRunLoop();

    SoupSession* session = WebCore::ResourceHandle::defaultSession();
    const char* httpProxy = getenv("http_proxy");
    if (httpProxy) {
        const char* noProxy = getenv("no_proxy");
        SoupProxyURIResolver* resolverEfl = soupProxyResolverWkNew(httpProxy, noProxy);
        soup_session_add_feature(session, SOUP_SESSION_FEATURE(resolverEfl));
        g_object_unref(resolverEfl);
    }

    // Set SOUP cache.
    String soupCacheDirectory = String::fromUTF8(efreet_cache_home_get()) + "/WebKitEfl";
    SoupCache* soupCache = soup_cache_new(soupCacheDirectory.utf8().data(), SOUP_CACHE_SINGLE_USER);
    soup_session_add_feature(session, SOUP_SESSION_FEATURE(soupCache));
    soup_cache_load(soupCache);

    int socket = atoi(argv[1]);

    ChildProcessInitializationParameters parameters;
    parameters.connectionIdentifier = socket;

    WebProcess::shared().initialize(parameters);

    RunLoop::run();

    soup_cache_flush(soupCache);
    soup_cache_dump(soupCache);
    g_object_unref(soupCache);

    ecore_x_shutdown();
    ecore_shutdown();
    eina_shutdown();

    return 0;

}
示例#17
0
void
create_view(void)
{
//    Window              win, ewin;
    Evas               *evas;
    Ecore_Evas * ee;
    int                 x, y, w, h, res;
    int                 maxcol;
    int                 engine;
    char               *fontdir;
    int                 font_cache, image_cache;
    char buf[4096];
    char *s;

    E_DB_INT_GET(shell->rcfile, "/main_win/win_x", x, res);
    ENGY_ASSERT(res);

    E_DB_INT_GET(shell->rcfile, "/main_win/win_y", y, res);
    ENGY_ASSERT(res);

    E_DB_INT_GET(shell->rcfile, "/main_win/win_w", w, res);
    ENGY_ASSERT(res);

    E_DB_INT_GET(shell->rcfile, "/main_win/win_h", h, res);
    ENGY_ASSERT(res);

    E_DB_STR_GET(shell->rcfile, "/aliases", (shell->aliases), res);
    ENGY_ASSERT(res);

    E_DB_INT_GET(shell->rcfile, "/maxcolors", maxcol, res);
    ENGY_ASSERT(res);

    E_DB_INT_GET(shell->rcfile, "/rendermethod", engine, res);
    ENGY_ASSERT(res);
    if (render_method != -1)
        engine = render_method;

    E_DB_INT_GET(shell->rcfile, "/maximagecache", image_cache, res);
    ENGY_ASSERT(res);

    E_DB_INT_GET(shell->rcfile, "/maxfontcache", font_cache, res);
    ENGY_ASSERT(res);
    
    E_DB_STR_GET(shell->rcfile, "/fontdir", s, res);
    ENGY_ASSERT(res);
    if (s[0] != '/')
    {
	snprintf(buf, 4000,"%s/%s", shell->home, s);
	imlib_add_path_to_font_path(buf);
	fontdir = DUP(buf);
    }
    else
    {
	imlib_add_path_to_font_path(s);
	fontdir = DUP(s);
    }
    FREE(s);
    
    
/*    win = ecore_window_new(0, x, y, w, h);
    ecore_window_set_events(win, XEV_CONFIGURE | XEV_KEY);
    
    evas = evas_new_all(ecore_display_get(),
                        win,
                        0,
                        0,
                        w, h, engine, maxcol, font_cache, image_cache, fontdir);
    ENGY_ASSERTS(evas, "evas_new");
    FREE(fontdir);
    evas_set_output_viewport(evas, 0, 0, w, h);
    ewin = evas_get_window(evas);
    ecore_window_set_events(ewin, XEV_EXPOSE | XEV_BUTTON | XEV_MOUSE_MOVE);
*/

    if (!ecore_x_init(NULL))
	    exit(-1);
	    //LOG_AND_RETURN (ERR_EFL);
    
    if (!ecore_evas_init())
	    exit(-1);
	    //LOG_AND_RETURN (ERR_EFL);
    
    ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 640, 480);
    
    if (!ee)
	    exit(-1);
	    //LOG_AND_RETURN (ERR_EFL);
    
    evas = ecore_evas_get(ee);
    evas_font_path_prepend(evas, fontdir);
    FREE(fontdir);
    ecore_evas_callback_delete_request_set(ee, engy_delete_request);
    ecore_evas_callback_pre_render_set(ee, engy_pre_rend);
    ecore_evas_callback_post_render_set(ee, engy_post_rend);
    ecore_evas_callback_resize_set(ee, engy_resize);
    ecore_evas_name_class_set(ee, "engy", "main");
    ecore_evas_show(ee);
    
    _get_title_dcd();

    shell->title = my_iconv(shell->title_dcd, TITLE);
    ecore_evas_title_set(ee, shell->title);

    shell->evas = evas;
    shell->win = ecore_evas_software_x11_window_get(ee);
    shell->ee = ee;
    shell->w = w;
    shell->h = h;

    // GLS
//    ecore_set_blank_pointer(win);
//    ecore_window_set_title(win, shell->title);
//  my_evas_init();
    _shell_bg_create();
    menu_init();
    // GLS
    engy_cl_init();
    cl_configure(w, h);
    log_init();
    info_init();
    info_sync();
    panel_init();
    pointer_init();
    serv_init();
    logo_init();
    alias_init();
//    evas_render(shell->evas);
}