示例#1
0
END_TEST

/* Basic testing for position API */
START_TEST(elocation_test_api_position)
{
   Eina_Bool ret;
   Elocation_Position *position = NULL;

   ret = ecore_init();
   fail_if(ret != EINA_TRUE);
   ret = edbus_init();
   fail_if(ret != EINA_TRUE);
   ret = elocation_init();
   fail_if(ret != EINA_TRUE);

   position = elocation_position_new();
   fail_if(position == NULL);

   ret = elocation_position_get(position);
   fail_if(ret != EINA_TRUE);

   elocation_position_free(position);

   elocation_shutdown();
   edbus_shutdown();
   ecore_shutdown();
}
示例#2
0
END_TEST

/* Basic testing for address API */
START_TEST(elocation_test_api_address)
{
   Eina_Bool ret;
   Elocation_Address *address = NULL;

   ret = ecore_init();
   fail_if(ret != EINA_TRUE);
   ret = edbus_init();
   fail_if(ret != EINA_TRUE);
   ret = elocation_init();
   fail_if(ret != EINA_TRUE);

   address = elocation_address_new();
   fail_if(address == NULL);

   ret = elocation_address_get(address);
   fail_if(ret != EINA_TRUE);

   elocation_address_free(address);

   elocation_shutdown();
   edbus_shutdown();
   ecore_shutdown();
}
    bool platformInitialize() override
    {
        if (!ecore_init())
            return false;

        return true;
    }
int
main (int argc, char *argv[])
{
   Ecore_Pipe *pipe;
   pid_t child_pid;

   ecore_init();

   pipe = ecore_pipe_add(handler, NULL);

   child_pid = fork();
   if(!child_pid)
     {
        ecore_pipe_read_close(pipe);
        do_lengthy_task(pipe);
     }
   else
     {
        ecore_pipe_write_close(pipe);
        ecore_main_loop_begin();
     }

   ecore_pipe_del(pipe);
   ecore_shutdown();

   return 0;
}
示例#5
0
int
main()
{
   Ecore_Con_Server *svr;
   eina_init();
   ecore_init();
   ecore_con_init();

/* comment if not using gnutls */
   gnutls_global_set_log_level(9);
   gnutls_global_set_log_function(tls_log_func);

/* to use a PEM certificate with TLS and SSL3, uncomment the lines below */
   if (!(svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP | ECORE_CON_USE_TLS | ECORE_CON_USE_SSL3 | ECORE_CON_LOAD_CERT, "127.0.0.1", 8080, NULL)))
/* to use simple tcp with ssl/tls, use this line */
//   if (!ecore_con_server_add(ECORE_CON_REMOTE_TCP | ECORE_CON_USE_SSL3, "127.0.0.1", 8080, NULL))
     exit(1);

   ecore_con_ssl_server_cert_add(svr, "server.pem");
   ecore_con_ssl_server_privkey_add(svr, "server.pem");
/* set event handler for client connect */
   ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ADD, (Ecore_Event_Handler_Cb)_add, NULL);
/* set event handler for client disconnect */
   ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DEL, (Ecore_Event_Handler_Cb)_del, NULL);
/* set event handler for receiving client data */
   ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DATA, (Ecore_Event_Handler_Cb)_data, NULL);

/* start server */
   ecore_main_loop_begin();
}
示例#6
0
int emqtt_init(void)
{
    if (++_emqtt_init_count != 1)
        return _emqtt_init_count;

    if (!eina_init ())
        return --_emqtt_init_count;

    _emqtt_log_dom_global =
            eina_log_domain_register("emqtt", EMQTT_DEFAULT_LOG_COLOR);
    if (_emqtt_log_dom_global < 0)
    {
        EINA_LOG_ERR("Enna-Server Can not create a general log domain.");
        goto shutdown_eina;
    }
    else
        INF("EMqtt Init");

    if (!ecore_init ())
        goto shutdown_eina;

    return _emqtt_init_count;

shutdown_eina:
    eina_shutdown ();
    return --_emqtt_init_count;
}
static void * document_create(Eon_Document *d, const char *options)
{
	Ecore_Ipc_Server *srv;

	printf("[REMOTE] Initializing engine\n");

	ecore_init();
	ecore_ipc_init();
	srv = ecore_ipc_server_connect(ECORE_IPC_LOCAL_SYSTEM, "eon-remote", 0, NULL);
	if (!srv)
	{
		/* FIXME add a good way to tell the system that the creation
		 * failed
		 */
		exit(1);
	}
	rdoc = calloc(1, sizeof(Engine_Remote_Document));
	ekeko_event_listener_add(d, EON_DOCUMENT_OBJECT_NEW, _object_new_cb, EINA_FALSE, NULL);

	ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_ADD,
		handler_server_add, NULL);
	ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DEL,
		handler_server_del, NULL);
	ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DATA,
		handler_server_data, NULL);

	rdoc->srv = srv;
	return rdoc;
}
示例#8
0
文件: eio_cp.c 项目: Limsik/e17
int
main(int argc, char **argv)
{
   Eio_File *cp;

   if (argc != 3)
     {
	fprintf(stderr, "eio_cp source_file destination_file\n");
	return -1;
     }

   ecore_init();
   eio_init();

   cp = eio_file_copy(argv[1], argv[2],
		      NULL,
		      _test_done_cb,
		      _test_error_cb,
		      NULL);

   ecore_main_loop_begin();

   eio_shutdown();
   ecore_shutdown();

   return 0;
}
示例#9
0
int
main(void)
{
   double done;
   eina_init();
   ecore_init();
   ecore_con_init();

   eina_log_domain_level_set("ecore_con", EINA_LOG_LEVEL_ERR);
   eina_log_domain_level_set("eina", EINA_LOG_LEVEL_ERR);
   counter = eina_counter_new("client");
   eina_counter_start(counter);
   done = ecore_time_get();

   ecore_job_add(_spawn, NULL);

/* set event handler for server connect */
   ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ADD, (Ecore_Event_Handler_Cb)_add, NULL);
   ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ADD, (Ecore_Event_Handler_Cb)_del, NULL);

/* start client */
   ecore_main_loop_begin();
   eina_counter_stop(counter, 1);
   printf("\nTime elapsed for %i connections: %f seconds\n%s", NUM_CLIENTS, ecore_time_get() - done, eina_counter_dump(counter));
   return 0;
}
int main(void) {
    Evas_Object *o;
    Ecore_Evas *ee;
    int r;

    evas_init();
    ecore_init();
    ecore_evas_init();
    edje_init();

    ee = ecore_evas_new(NULL, 0, 0, 320, 240, NULL);
    if (!ee)
        return -1;

    o = edje_object_add(ecore_evas_get(ee));
    if (!edje_object_file_set(o, "test.edj", "main")) {
        fprintf(stderr, "could not load edje: %d\n",
                edje_object_load_error_get(o));
        return -2;
    }
    evas_object_resize(o, 320, 240);
    evas_object_show(o);

    ecore_evas_alpha_set(ee, 1);
    ecore_evas_borderless_set(ee, 1);
    ecore_evas_show(ee);
    ecore_main_loop_begin();

    return 0;
}
int
main(int argc, char **argv)
{
   struct context ctxt = {0};

   if (!ecore_init())
     {
        printf("ERROR: Cannot init Ecore!\n");
        return -1;
     }

   _event_type = ecore_event_type_new();

   ctxt.enterer = ecore_idle_enterer_add(_enterer_cb, &ctxt);
   ctxt.exiter = ecore_idle_exiter_add(_exiter_cb, &ctxt);
//   ctxt.idler = ecore_idler_add(_idler_cb, &ctxt);
   ctxt.idler = eo_add_custom(ECORE_IDLER_CLASS, NULL, ecore_idler_constructor(_idler_cb, &ctxt));
   ctxt.handler = ecore_event_handler_add(_event_type,
                                          _event_handler_cb,
                                          &ctxt);
   ctxt.timer = ecore_timer_add(0.0005, _timer_cb, &ctxt);

   ecore_main_loop_begin();
   ecore_shutdown();

   return 0;
}
示例#12
0
int main(int argc, char **argv)
{
	Eon_Window *win;
	Ender_Element *layout;
	Eon_Backend *backend;
	Ender_Element *e;
	int i;

	eon_init();
	ecore_init();

	//backend = eon_ecore_remote_new();
	backend = eon_ecore_sdl_new();

	layout = eon_stack_new();

	win = eon_window_new(backend, layout, 320, 240);
	eon_stack_orientation_set(layout, EON_STACK_ORIENTATION_VERTICAL);

	e = eon_color_new();
	eon_layout_child_add(layout, e);
	e = eon_color_new();
	eon_layout_child_add(layout, e);

	ecore_main_loop_begin();
	ecore_shutdown();
	eon_shutdown();

	return 0;
}
示例#13
0
EAPI int
ecore_audio_init(void)
{

   if (++_ecore_audio_init_count != 1)
     return _ecore_audio_init_count;

   if (!ecore_init())
     return --_ecore_audio_init_count;

   if (!efl_object_init()) {
     ecore_shutdown();
     return --_ecore_audio_init_count;
   }

   _ecore_audio_log_dom = eina_log_domain_register("ecore_audio", ECORE_AUDIO_DEFAULT_LOG_COLOR);
   if (_ecore_audio_log_dom < 0)
     {
        EINA_LOG_ERR("Impossible to create a log domain for the ecore audio module.");
        return --_ecore_audio_init_count;
     }

   DBG("Ecore_Audio init");
   ecore_audio_modules = NULL;


   eina_log_timing(_ecore_audio_log_dom,
		   EINA_LOG_STATE_STOP,
		   EINA_LOG_STATE_INIT);

   return _ecore_audio_init_count;
}
示例#14
0
int
main(int argc, char **argv)
{
   double interval = 0.3; // tick each 0.3 seconds
   Ecore_Poller *poller1, *poller2;
   char *str1 = "poller1";
   char *str2 = "poller2";

   if (!ecore_init())
     {
        printf("ERROR: Cannot init Ecore!\n");
        return -1;
     }

   _initial_time = ecore_time_get();

   ecore_poller_poll_interval_set(ECORE_POLLER_CORE, interval);

   poller1 = ecore_poller_add(ECORE_POLLER_CORE, 4, _poller_print_cb, str1);
   poller2 = ecore_poller_add(ECORE_POLLER_CORE, 8, _poller_print_cb, str2);

   ecore_main_loop_begin();

   printf("changing poller2 interval to 16\n");

   ecore_poller_poller_interval_set(poller2, 16);
   ecore_main_loop_begin();

   ecore_poller_del(poller1);
   ecore_poller_del(poller2);

   ecore_shutdown();
}
// return 0 for normal case
int daemonLoop(void)
{
	int return_value = 0;

	ecore_init();

	if (init_input_events() == -1) {
		return_value = -1;
		goto END_EVENT;
	}

	if (!initialize_events()) {
		return_value = -1;
		goto END_EFD;
	}

	if (launch_timer_start() < 0) {
		LOGE("Launch timer start failed\n");
		return_value = -1;
		goto END_EFD;
	}

	init_prof_session(&prof_session);

	ecore_main_loop_begin();
	ecore_shutdown();

 END_EFD:
	LOGI("close efd\n");
	close(manager.efd);
 END_EVENT:
	return return_value;
}
示例#16
0
EAPI int
ecore_event_init(void)
{
   if (++_ecore_event_init_count != 1)
     return _ecore_event_init_count;
   if (!ecore_init())
     {
        _ecore_event_init_count--;
        return 0;
     }

   _ecore_input_log_dom = eina_log_domain_register
     ("ecore_input", ECORE_INPUT_DEFAULT_LOG_COLOR);
   if(_ecore_input_log_dom < 0)
     {
       EINA_LOG_ERR("Impossible to create a log domain for the ecore input module.");
       return --_ecore_event_init_count;
     }

   ECORE_EVENT_KEY_DOWN = ecore_event_type_new();
   ECORE_EVENT_KEY_UP = ecore_event_type_new();
   ECORE_EVENT_MOUSE_BUTTON_DOWN = ecore_event_type_new();
   ECORE_EVENT_MOUSE_BUTTON_UP = ecore_event_type_new();
   ECORE_EVENT_MOUSE_MOVE = ecore_event_type_new();
   ECORE_EVENT_MOUSE_WHEEL = ecore_event_type_new();
   ECORE_EVENT_MOUSE_IN = ecore_event_type_new();
   ECORE_EVENT_MOUSE_OUT = ecore_event_type_new();
   ECORE_EVENT_AXIS_UPDATE = ecore_event_type_new();
   ECORE_EVENT_MOUSE_BUTTON_CANCEL = ecore_event_type_new();
   ECORE_EVENT_JOYSTICK = ecore_event_type_new();

   ecore_input_joystick_init();

   return _ecore_event_init_count;
}
示例#17
0
int
main(void)
{
   Esql *e;
   struct ctx ctx = {0, 0, 0};

   ecore_init();
   esql_init();

   eina_log_domain_level_set("esskyuehl", EINA_LOG_LEVEL_DBG);

   e = esql_new(ESQL_TYPE_SQLITE);
   assert(e != NULL);

   ecore_event_handler_add(ESQL_EVENT_CONNECT, on_connect, &ctx);
   ecore_event_handler_add(ESQL_EVENT_ERROR, on_error, &ctx);

   assert(esql_connect(e, ":memory:", NULL, NULL));

   ecore_main_loop_begin();
   esql_disconnect(e);

   esql_shutdown();
   ecore_shutdown();

   assert(ctx.conns == 1);
   assert(ctx.errors == 0);
   assert(ctx.res == 2 + INSERTED_ROWS);

   return 0;
}
示例#18
0
/* externally accessible functions */
int
main(int    argc,
     char **argv)
{
   int i;

   for (i = 1; i < argc; i++)
     {
        if ((!strcmp(argv[i], "-h")) ||
            (!strcmp(argv[i], "-help")) ||
            (!strcmp(argv[i], "--help")))
          {
             printf(
               "This is an internal tool for Enlightenment.\n"
               "do not use it.\n"
               );
             exit(0);
          }
        else if (!strncmp(argv[i], "--nice=", 7))
          {
             const char *val;
             int ret = 0;

             val = argv[i] + 7;
             if (*val)
               ret = nice(atoi(val));
          }
     }

   ecore_init();
   ecore_app_args_set(argc, (const char **)argv);
   eet_init();
   evas_init();
   ecore_evas_init();
   edje_init();
   ecore_file_init();
   ecore_ipc_init();

   e_user_dir_concat_static(_thumbdir, "fileman/thumbnails");
   ecore_file_mkpath(_thumbdir);

   if (_e_ipc_init()) ecore_main_loop_begin();

   if (_e_ipc_server)
     {
        ecore_ipc_server_del(_e_ipc_server);
        _e_ipc_server = NULL;
     }

   ecore_ipc_shutdown();
   ecore_file_shutdown();
   ecore_evas_shutdown();
   edje_shutdown();
   evas_shutdown();
   eet_shutdown();
   ecore_shutdown();

   return 0;
}
示例#19
0
文件: eio_main.c 项目: tguillem/efl
EAPI int
eio_init(void)
{
    if (++_eio_init_count != 1)
        return _eio_init_count;

    if (!eina_init())
    {
        fprintf(stderr, "Eio can not initialize Eina\n");
        return --_eio_init_count;
    }

    _eio_log_dom_global = eina_log_domain_register("eio", EIO_DEFAULT_LOG_COLOR);
    if (_eio_log_dom_global < 0)
    {
        EINA_LOG_ERR("Eio can not create a general log domain.");
        goto shutdown_eina;
    }

    if (!ecore_init())
    {
        ERR("Can not initialize Ecore\n");
        goto unregister_log_domain;
    }

    memset(&progress_pool, 0, sizeof(progress_pool));
    memset(&direct_info_pool, 0, sizeof(direct_info_pool));
    memset(&char_pool, 0, sizeof(char_pool));
    memset(&associate_pool, 0, sizeof(associate_pool));

    eina_lock_new(&(progress_pool.lock));
    progress_pool.mem_size = sizeof (Eio_Progress);
    eina_lock_new(&(direct_info_pool.lock));
    direct_info_pool.mem_size = sizeof (Eio_File_Direct_Info);
    eina_lock_new(&(char_pool.lock));
    char_pool.mem_size = sizeof (Eio_File_Char);
    eina_lock_new(&(associate_pool.lock));
    associate_pool.mem_size = sizeof (Eio_File_Associate);

    eina_spinlock_new(&(memory_pool_lock));
    eina_lock_new(&(memory_pool_mutex));
    eina_condition_new(&(memory_pool_cond), &(memory_pool_mutex));

    eio_monitor_init();

    eina_log_timing(_eio_log_dom_global,
                    EINA_LOG_STATE_STOP,
                    EINA_LOG_STATE_INIT);

    return _eio_init_count;

unregister_log_domain:
    eina_log_domain_unregister(_eio_log_dom_global);
    _eio_log_dom_global = -1;
shutdown_eina:
    eina_shutdown();
    return --_eio_init_count;
}
示例#20
0
int
main(int argc, char **argv)
{
   const char *tmp;
   int i = 0;

   for (i = 1; i < argc; i++)
     {
        if ((!strcmp(argv[i], "-h")) ||
            (!strcmp(argv[i], "-help")) ||
            (!strcmp(argv[i], "--help")))
          {
             printf("This is an internal tool for Moksha.\n"
                    "do not use it.\n");
             exit(0);
          }
        else if (i == 1)
          sig = atoi(argv[i]);  // signal
        else if (i == 2)
          pid = atoi(argv[i]);  // E's pid
        else if (i == 3)
          backtrace_str = argv[i];
	else if (i == 4)
	  exit_gdb = atoi(argv[i]);
     }

   fprintf(stderr, "exit_gdb: %i\n", exit_gdb);

   tmp = getenv("E17_TAINTED");
   if (tmp && !strcmp(tmp, "NO"))
     tainted = EINA_FALSE;

   if (!ecore_init()) return EXIT_FAILURE;
   ecore_app_args_set(argc, (const char **)argv);

   if (!_e_alert_connect())
     {
        printf("FAILED TO INIT ALERT SYSTEM!!!\n");
        ecore_shutdown();
        return EXIT_FAILURE;
     }

   title = "Moksha Error";
   str1 = "(F1) Recover";
   str2 = "(F12) Logout";

   _e_alert_create();
   _e_alert_display();
   _e_alert_run();
   _e_alert_shutdown();

   ecore_shutdown();

   /* ret == 1 => restart e => exit code 1 */
   /* ret == 2 => exit e => any code will do that */
   return ret;
}
示例#21
0
EAPI int
ecore_con_url_init(void)
{
   if (++_init_count > 1) return _init_count;
   if (!ecore_init()) return --_init_count;
   ECORE_CON_EVENT_URL_DATA = ecore_event_type_new();
   ECORE_CON_EVENT_URL_COMPLETE = ecore_event_type_new();
   ECORE_CON_EVENT_URL_PROGRESS = ecore_event_type_new();
   return _init_count;
}
示例#22
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");
}
示例#23
0
int
main(int argc, char **argv)
{
   ecore_init();

   ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _quitter, NULL);
   ecore_main_loop_begin();

   return 0;
}
示例#24
0
int
main (void)
{
  /* credentials */
  gnutls_anon_client_credentials_t c_anoncred;
  gnutls_certificate_credentials_t c_certcred;
  
  gnutls_session_t client;
  int sd, i;

  /* General init. */
  gnutls_global_init ();
  ecore_init();
//  gnutls_global_set_log_function (tls_log_func);
//  gnutls_global_set_log_level (2);

  /* Init client */
  gnutls_anon_allocate_client_credentials (&c_anoncred);
  gnutls_certificate_allocate_credentials (&c_certcred);


  for (i=0;i<5;i++) 
    {

      gnutls_init (&client, GNUTLS_CLIENT);
      /* set very specific priorities */
      gnutls_priority_set_direct(client, "NORMAL:+ANON-DH", NULL);
      gnutls_credentials_set (client, GNUTLS_CRD_ANON, c_anoncred);
      gnutls_credentials_set (client, GNUTLS_CRD_CERTIFICATE, c_certcred);
      gnutls_server_name_set(client, GNUTLS_NAME_DNS, "localhost", strlen("localhost"));

      /* connect to the peer
       */
      sd = tcp_connect ();

      /* associate gnutls with socket */
      gnutls_transport_set_ptr (client, (gnutls_transport_ptr_t) sd);
      /* add a callback for data being available for send/receive on socket */
      if (!ecore_main_fd_handler_add(sd, ECORE_FD_READ | ECORE_FD_WRITE, (Ecore_Fd_Cb)_process_data, client, NULL, NULL))
        {
           print("could not create fd handler!");
           exit(1);
        }
      /* begin main loop */
      ecore_main_loop_begin();

      gnutls_bye (client, GNUTLS_SHUT_RDWR);

      gnutls_deinit (client);

      tcp_close (sd);
    }
  
  return 0;
}
示例#25
0
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;
    }

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

    return ++_ewkInitCount;

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;
}
WK_EXPORT int NetworkProcessMain(int argc, char* argv[])
{
    if (argc != 2)
        return 1;

#if PLATFORM(EFL)
    if (!ecore_init())
        return 1;

    if (!ecore_main_loop_glib_integrate())
        return 1;
#endif

    InitializeWebKit2();

#if USE(SOUP)
    SoupSession* session = ResourceHandle::defaultSession();
#if PLATFORM(EFL)
    // Only for EFL because GTK port uses the default resolver, which uses GIO's proxy resolver.
    const char* httpProxy = getenv("http_proxy");
    if (httpProxy) {
        const char* noProxy = getenv("no_proxy");
        GRefPtr<SoupProxyURIResolver> resolver = adoptGRef(soupProxyResolverWkNew(httpProxy, noProxy));
        soup_session_add_feature(session, SOUP_SESSION_FEATURE(resolver.get()));
    }
#endif
#endif

    int socket = atoi(argv[1]);

    WebKit::ChildProcessInitializationParameters parameters;
    parameters.connectionIdentifier = int(socket);

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

#if USE(SOUP)
    // Despite using system CAs to validate certificates we're
    // accepting invalid certificates by default. New API will be
    // added later to let client accept/discard invalid certificates.
    g_object_set(session, SOUP_SESSION_SSL_USE_SYSTEM_CA_FILE, TRUE,
        SOUP_SESSION_SSL_STRICT, FALSE, NULL);
#endif

    RunLoop::run();

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

    return 0;
}
示例#27
0
EAPI int
ecore_drm2_init(void)
{
   if (++_ecore_drm2_init_count != 1) return _ecore_drm2_init_count;

   if (!eina_init()) goto eina_err;

   if (!ecore_init())
     {
        EINA_LOG_ERR("Could not initialize Ecore library");
        goto ecore_err;
     }

   if (!eeze_init())
     {
        EINA_LOG_ERR("Could not initialize Eeze library");
        goto eeze_err;
     }

   if (!elput_init())
     {
        EINA_LOG_ERR("Could not initialize Elput library");
        goto elput_err;
     }

   _ecore_drm2_log_dom =
     eina_log_domain_register("ecore_drm2", ECORE_DRM2_DEFAULT_LOG_COLOR);
   if (!_ecore_drm2_log_dom)
     {
        EINA_LOG_ERR("Could not create logging domain for Ecore_Drm2");
        goto log_err;
     }

   ECORE_DRM2_EVENT_OUTPUT_CHANGED = ecore_event_type_new();
   ECORE_DRM2_EVENT_ACTIVATE = ecore_event_type_new();

   if (!_ecore_drm2_link()) goto link_err;

   return _ecore_drm2_init_count;

link_err:
   eina_log_domain_unregister(_ecore_drm2_log_dom);
   _ecore_drm2_log_dom = -1;
log_err:
   elput_shutdown();
elput_err:
   eeze_shutdown();
eeze_err:
   ecore_shutdown();
ecore_err:
   eina_shutdown();
eina_err:
   return --_ecore_drm2_init_count;
}
示例#28
0
int
main(int argc, char **argv)
{
   ecore_init();
   timer1 = ecore_timer_add(5.0, timer1_tick, data1);
   fprintf(stdout, "This is an output message from the main function.\n");
   fprintf(stderr, "This is an error message from the main function.\n");
   ecore_main_loop_begin();
   ecore_shutdown();
   return 123;
}
示例#29
0
int
main(int argc, char *argv[])
{
   GstElement *pipeline;
   char *filename;
   Ecore_Pipe *pipe;

   gst_init(&argc, &argv);

   if (!ecore_init())
     {
        gst_deinit();
        return 0;
     }

   pipe = ecore_pipe_add(handler);
   if (!pipe)
     {
        ecore_shutdown();
        gst_deinit();
        return 0;
     }

   if (argc < 2)
     {
        g_print("usage: %s file.avi\n", argv[0]);
        ecore_pipe_del(pipe);
        ecore_shutdown();
        gst_deinit();
        return 0;
     }
   filename = argv[1];

   pipeline = _buid_pipeline(filename, pipe);
   if (!pipeline)
     {
        g_print("Error during the pipeline building\n");
        ecore_pipe_del(pipe);
        ecore_shutdown();
        gst_deinit();
        return -1;
     }

   gst_element_set_state(pipeline, GST_STATE_PLAYING);

   ecore_main_loop_begin();

   ecore_pipe_del(pipe);
   ecore_shutdown();
   gst_deinit();

   return 0;
}
示例#30
0
/**
 * @brief Initialize the store library and all it's required submodules.
 * @return 1 or greater on success, 0 otherwise.
 */
int
store_init(void)
{
   if (++_store_init_count != 1)
     return _store_init_count;

   if (!eina_init())
     {
        fprintf(stderr, "Store can not initialize Eina\n");
        return --_store_init_count;
     }

   _store_log_dom_global = eina_log_domain_register("store", EINA_COLOR_RED);
   if (_store_log_dom_global < 0)
     {
        EINA_LOG_ERR("Store can not create a general log domain");
        goto shutdown_eina;
     }

   if (!ecore_init())
     {
        ERR("Can not initialize Ecore");
        goto unregister_log_domain;
     }

   if (!ecore_con_init())
     {
        ERR("Can not initialize Ecore_Con");
        goto shutdown_ecore;
     }

   if (!ecore_con_url_init())
     {
        ERR("Can not initialize Ecore_Con_Url");
        goto shutdown_ecore_con;
     }

   if (!ecore_con_url_pipeline_get())
     ecore_con_url_pipeline_set(EINA_TRUE);

   return _store_init_count;

shutdown_ecore_con:
   ecore_con_shutdown();
shutdown_ecore:
   ecore_shutdown();
unregister_log_domain:
   eina_log_domain_unregister(_store_log_dom_global);
   _store_log_dom_global = -1;
shutdown_eina:
   eina_shutdown();
   return --_store_init_count;
}