本文整理汇总了C++中eina_shutdown函数的典型用法代码示例。如果您正苦于以下问题:C++ eina_shutdown函数的具体用法?C++ eina_shutdown怎么用?C++ eina_shutdown使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eina_shutdown函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: platformInitialize
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;
}
示例2: elicit_libs_init
/**
* Initialize libraries
*/
int
elicit_libs_init(void)
{
BrInitError error;
if (!br_init(&error) && error != BR_INIT_ERROR_DISABLED)
fprintf(stderr, "[Elicit] Failed to initialize binreloc (error code: %d)\nFalling back to hardcoded paths.", error);
if (!eina_init())
{
fprintf(stderr, "[Elicit] Failed to initialize eina.\n");
return 0;
}
if (!ecore_init())
{
fprintf(stderr, "[Elicit] Failed to initialize ecore.\n");
eina_shutdown();
return 0;
}
if (!ecore_evas_init() ||
!ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_SOFTWARE_XLIB))
{
fprintf(stderr, "[Elicit] Failed to initialize ecore_evas.\n");
fprintf(stderr, "[Elicit] Make sure you have the evas software X11 engine installed.\n");
eina_shutdown();
ecore_shutdown();
return 0;
}
if (!ecore_file_init())
{
fprintf(stderr, "[Elicit] Failed to initialize ecore_file.\n");
eina_shutdown();
ecore_shutdown();
ecore_evas_shutdown();
return 0;
}
if (!edje_init())
{
fprintf(stderr, "[Elicit] Failed to initialize edje.\n");
eina_shutdown();
ecore_shutdown();
ecore_evas_shutdown();
ecore_file_shutdown();
return 0;
}
return 1;
}
示例3: ecore_init
/**
* Set up connections, signal handlers, sockets etc.
* @return 1 or greater on success, 0 otherwise
*
* This function sets up all singal handlers and the basic event loop. If it
* succeeds, 1 will be returned, otherwise 0 will be returned.
*
* @code
* #include <Ecore.h>
*
* int main(int argc, char **argv)
* {
* if (!ecore_init())
* {
* printf("ERROR: Cannot init Ecore!\n");
* return -1;
* }
* ecore_main_loop_begin();
* ecore_shutdown();
* }
* @endcode
*/
EAPI int ecore_init(void)
{
if (++_ecore_init_count != 1)
return _ecore_init_count;
#ifdef HAVE_LOCALE_H
setlocale(LC_CTYPE, "");
#endif
/*
if (strcmp(nl_langinfo(CODESET), "UTF-8"))
{
WRN("Not a utf8 locale!");
}
*/
#ifdef HAVE_EVIL
if (!evil_init())
return --_ecore_init_count;
#endif
if (!eina_init())
goto shutdown_evil;
_ecore_log_dom =
eina_log_domain_register("Ecore", ECORE_DEFAULT_LOG_COLOR);
if (_ecore_log_dom < 0) {
EINA_LOG_ERR("Ecore was unable to create a log domain.");
goto shutdown_log_dom;
}
if (getenv("ECORE_FPS_DEBUG"))
_ecore_fps_debug = 1;
if (_ecore_fps_debug)
_ecore_fps_debug_init();
_ecore_main_loop_init();
_ecore_signal_init();
_ecore_exe_init();
_ecore_thread_init();
_ecore_glib_init();
_ecore_job_init();
_ecore_time_init();
#if HAVE_MALLINFO
if (getenv("ECORE_MEM_STAT")) {
_ecore_memory_pid = getpid();
ecore_animator_add(_ecore_memory_statistic, NULL);
}
#endif
#if defined(GLIB_INTEGRATION_ALWAYS)
if (_ecore_glib_always_integrate)
ecore_main_loop_glib_integrate();
#endif
return _ecore_init_count;
shutdown_log_dom:
eina_shutdown();
shutdown_evil:
#ifdef HAVE_EVIL
evil_shutdown();
#endif
return --_ecore_init_count;
}
示例4: START_TEST
END_TEST
START_TEST(eina_binshare_small)
{
char buf[4];
int i;
eina_init();
for (i = 1; i < 3; i++)
{
const char *t0, *t1;
int j;
for (j = 0; j < i; j++)
{
char c;
for (c = 'a'; c <= 'z'; c++)
buf[j] = c;
}
buf[i] = '\0';
t0 = eina_binshare_add_length(buf, i);
t1 = eina_binshare_add_length(buf, i);
fail_if(t0 == NULL);
fail_if(t1 == NULL);
fail_if(t0 != t1);
fail_if(memcmp(t0, buf, i) != 0);
eina_binshare_del(t0);
eina_binshare_del(t1);
}
eina_shutdown();
}
示例5: escarg_init
int
escarg_init(void)
{
if (++_escarg_init_count != 1)
return _escarg_init_count;
if (!eina_init())
{
fprintf(stderr, "Escarg can not initialize Eina\n");
return --_escarg_init_count;
}
_escarg_log_dom_global = eina_log_domain_register("escarg", EINA_COLOR_RED);
if (_escarg_log_dom_global < 0)
{
EINA_LOG_ERR("Escarg can not create a general log domain.");
goto shutdown_eina;
}
DBG("Successfully started");
return _escarg_init_count;
shutdown_eina:
eina_shutdown();
return --_escarg_init_count;
}
示例6: START_TEST
END_TEST
START_TEST(eina_hash_extended)
{
Eina_Hash *hash = NULL;
int i;
fail_if(eina_init() != 2);
hash = eina_hash_string_djb2_new(NULL);
fail_if(hash == NULL);
fail_if(eina_hash_direct_add(hash, "42", "42") != EINA_TRUE);
for (i = 43; i < 3043; ++i)
{
char *tmp = malloc(10);
fail_if(!tmp);
eina_convert_itoa(i, tmp);
fail_if(eina_hash_direct_add(hash, tmp, tmp) != EINA_TRUE);
}
fail_if(eina_hash_find(hash, "42") == NULL);
eina_hash_free(hash);
fail_if(eina_shutdown() != 1);
}
示例7: START_TEST
END_TEST
START_TEST(binbuf_manage_simple)
{
Eina_Binbuf *buf;
const char *_cbuf = "12\0 456 78\0 abcthis is some more random junk here!";
const unsigned char *cbuf = (const unsigned char *) _cbuf;
size_t size = sizeof(cbuf) - 1; /* We don't care about the real NULL */
unsigned char *alloc_buf = malloc(size);
memcpy(alloc_buf, cbuf, size);
eina_init();
buf = eina_binbuf_manage_new_length(alloc_buf, size);
fail_if(!buf);
fail_if(memcmp(eina_binbuf_string_get(buf), cbuf, size));
fail_if(size != eina_binbuf_length_get(buf));
eina_binbuf_append_length(buf, cbuf, size);
fail_if(memcmp(eina_binbuf_string_get(buf), cbuf, size));
fail_if(memcmp(eina_binbuf_string_get(buf) + size, cbuf, size));
fail_if(2 * size != eina_binbuf_length_get(buf));
eina_binbuf_free(buf);
eina_shutdown();
}
示例8: estate_init
EAPI int
estate_init(void)
{
if (++_init_count == 1)
{
if (EINA_UNLIKELY(!eina_init()))
{
EINA_LOG_CRIT("Failed to init Eina");
return --_init_count;
}
_estate_log_dom = eina_log_domain_register("estate", EINA_COLOR_WHITE);
if (EINA_UNLIKELY(_estate_log_dom < 0))
{
EINA_LOG_CRIT("Failed to create log domain");
eina_shutdown();
return --_init_count;
}
#if 0
ESTATE_EVENT_ENTERER = ecore_event_type_new();
ESTATE_EVENT_EXITER = ecore_event_type_new();
ESTATE_EVENT_TRANSITION = ecore_event_type_new();
#endif
}
return _init_count;
}
示例9: START_TEST
END_TEST
/* eina_binbuf_manage_new_length and eina_binbuf_manage_read_only_new_length
* are deprecated */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
START_TEST(binbuf_manage_simple)
{
Eina_Binbuf *buf;
const char *_cbuf = "12\0 456 78\0 abcthis is some more random junk here!";
const unsigned char *cbuf = (const unsigned char *) _cbuf;
size_t size = sizeof(cbuf) - 1; /* We don't care about the real NULL */
unsigned char *alloc_buf = malloc(size);
memcpy(alloc_buf, cbuf, size);
eina_init();
buf = eina_binbuf_manage_new_length(alloc_buf, size);
fail_if(!buf);
fail_if(memcmp(eina_binbuf_string_get(buf), cbuf, size));
fail_if(size != eina_binbuf_length_get(buf));
eina_binbuf_append_length(buf, cbuf, size);
fail_if(memcmp(eina_binbuf_string_get(buf), cbuf, size));
fail_if(memcmp(eina_binbuf_string_get(buf) + size, cbuf, size));
fail_if(2 * size != eina_binbuf_length_get(buf));
eina_binbuf_free(buf);
eina_shutdown();
}
示例10: main
int
main(int argc, char **argv)
{
Eina_List *list = NULL;
Eina_List *l;
void *list_data;
eina_init();
list = eina_list_append(list, eina_stringshare_add("calvin"));
list = eina_list_append(list, eina_stringshare_add("Leoben"));
list = eina_list_append(list, eina_stringshare_add("D'Anna"));
list = eina_list_append(list, eina_stringshare_add("Simon"));
list = eina_list_append(list, eina_stringshare_add("Doral"));
list = eina_list_append(list, eina_stringshare_add("Six"));
list = eina_list_append(list, eina_stringshare_add("Sharon"));
for(l = list; l; l = eina_list_next(l))
printf("%s\n", (char*)l->data);
for(l = eina_list_last(list); l; l = eina_list_prev(l))
printf("%s\n", (char*)eina_list_data_get(l));
EINA_LIST_FREE(list, list_data)
eina_stringshare_del(list_data);
eina_shutdown();
return 0;
}
示例11: efreet_shutdown
EAPI int
efreet_shutdown(void)
{
if (_efreet_init_count <= 0)
{
EINA_LOG_ERR("Init count not greater than 0 in shutdown.");
return 0;
}
if (--_efreet_init_count != 0)
return _efreet_init_count;
efreet_util_shutdown();
efreet_menu_shutdown();
efreet_desktop_shutdown();
efreet_ini_shutdown();
efreet_icon_shutdown();
efreet_xml_shutdown();
efreet_cache_shutdown();
efreet_base_shutdown();
IF_RELEASE(efreet_lang);
IF_RELEASE(efreet_lang_country);
IF_RELEASE(efreet_lang_modifier);
IF_RELEASE(efreet_language);
efreet_parsed_locale = 0; /* reset this in case they init efreet again */
ecore_file_shutdown();
ecore_shutdown();
eet_shutdown();
eina_shutdown();
return _efreet_init_count;
}
示例12: main
int main(int argc, char **argv)
{
Eina_Strbuf *buf;
eina_init();
buf = eina_strbuf_new();
eina_strbuf_append_length(buf, "buffe", 5);
eina_strbuf_append_char(buf, 'r');
printf("%s\n", eina_strbuf_string_get(buf));
eina_strbuf_insert_escaped(buf, "my ", 0);
printf("%s\n", eina_strbuf_string_get(buf));
eina_strbuf_reset(buf);
eina_strbuf_append_escaped(buf, "my buffer");
printf("%s\n", eina_strbuf_string_get(buf));
eina_strbuf_reset(buf);
eina_strbuf_append_printf(buf, "%s%c", "buffe", 'r');
eina_strbuf_insert_printf(buf, " %s: %d", 6, "length", eina_strbuf_length_get(buf));
printf("%s\n", eina_strbuf_string_get(buf));
eina_strbuf_remove(buf, 0, 7);
printf("%s\n", eina_strbuf_string_get(buf));
eina_strbuf_replace_all(buf, "length", "size");
printf("%s\n", eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
eina_shutdown();
return 0;
}
示例13: START_TEST
END_TEST
START_TEST(eina_rectangle_intersect)
{
Eina_Rectangle r1, r2, r3, r4, rd;
fail_if(!eina_init());
EINA_RECTANGLE_SET(&r1, 10, 10, 50, 50);
EINA_RECTANGLE_SET(&r2, 20, 20, 20, 20);
EINA_RECTANGLE_SET(&r3, 0, 0, 10, 10);
EINA_RECTANGLE_SET(&r4, 30, 30, 50, 50);
rd = r1;
fail_if(eina_rectangle_intersection(&rd, &r3));
fail_if(!eina_rectangle_intersection(&rd, &r2));
fail_if(rd.x != r2.x
|| rd.y != r2.y
|| rd.w != r2.w
|| rd.h != r2.h);
rd = r1;
fail_if(!eina_rectangle_intersection(&rd, &r4));
fail_if(rd.x != 30
|| rd.y != 30
|| rd.w != 30
|| rd.h != 30);
eina_shutdown();
}
示例14: eeze_shutdown
EAPI int
eeze_shutdown(void)
{
if (_eeze_init_count <= 0)
{
EINA_LOG_ERR("Init count not greater than 0 in shutdown.");
return 0;
}
if (--_eeze_init_count != 0)
return _eeze_init_count;
udev_unref(udev);
#ifdef HAVE_EEZE_MOUNT
eeze_disk_shutdown();
#endif
eeze_sensor_shutdown();
eeze_net_shutdown();
ecore_shutdown();
eina_log_domain_unregister(_eeze_udev_log_dom);
_eeze_udev_log_dom = -1;
eina_log_domain_unregister(_eeze_net_log_dom);
_eeze_net_log_dom = -1;
eina_log_domain_unregister(_eeze_sensor_log_dom);
_eeze_sensor_log_dom = -1;
eina_shutdown();
return _eeze_init_count;
}
示例15: ecore_wince_shutdown
int
ecore_wince_shutdown()
{
HWND task_bar;
if (--_ecore_wince_init_count != 0)
return _ecore_wince_init_count;
/* force task bar to be shown (in case the application exits */
/* while being fullscreen) */
task_bar = FindWindow(L"HHTaskBar", NULL);
if (task_bar)
{
ShowWindow(task_bar, SW_SHOW);
EnableWindow(task_bar, TRUE);
}
if (!UnregisterClass(ECORE_WINCE_WINDOW_CLASS, _ecore_wince_instance))
ERR("UnregisterClass() failed");
if (!FreeLibrary(_ecore_wince_instance))
ERR("FreeLibrary() failed");
_ecore_wince_instance = NULL;
ecore_event_shutdown();
eina_log_domain_unregister(_ecore_wince_log_dom_global);
_ecore_wince_log_dom_global = -1;
eina_shutdown();
return _ecore_wince_init_count;
}