2 # include "elementary_config.h"
6 #include <dlfcn.h> /* dlopen,dlclose,etc */
9 #ifdef HAVE_CRT_EXTERNS_H
10 # include <crt_externs.h>
21 #include <Elementary.h>
24 #define SEMI_BROKEN_QUICKLAUNCH 1
26 static Elm_Version _version = { VMAJ, VMIN, VMIC, VREV };
27 EAPI Elm_Version *elm_version = &_version;
30 _elm_dangerous_call_check(const char *call)
35 snprintf(buf, sizeof(buf), "%i.%i.%i.%i", VMAJ, VMIN, VMIC, VREV);
36 eval = getenv("ELM_NO_FINGER_WAGGLING");
37 if ((eval) && (!strcmp(eval, buf)))
39 printf("ELEMENTARY FINGER WAGGLE!!!!!!!!!!\n"
42 "PLEASE see the API documentation for this function. This call\n"
43 "should almost never be used. Only in very special cases.\n"
45 "To remove this warning please set the environment variable:\n"
46 " ELM_NO_FINGER_WAGGLING\n"
47 "To the value of the Elementary version + revision number. e.g.:\n"
55 static Eina_Bool _elm_signal_exit(void *data,
59 static Eina_Prefix *pfx = NULL;
60 char *_elm_appname = NULL;
61 const char *_elm_data_dir = NULL;
62 const char *_elm_lib_dir = NULL;
63 int _elm_log_dom = -1;
65 EAPI int ELM_EVENT_POLICY_CHANGED = 0;
67 static int _elm_init_count = 0;
68 static int _elm_sub_init_count = 0;
69 static int _elm_ql_init_count = 0;
70 static int _elm_policies[ELM_POLICY_LAST];
71 static Ecore_Event_Handler *_elm_exit_handler = NULL;
72 static Eina_Bool quicklaunch_on = 0;
75 _elm_signal_exit(void *data __UNUSED__,
76 int ev_type __UNUSED__,
80 return ECORE_CALLBACK_PASS_ON;
86 edje_scale_set(_elm_config->scale);
87 _elm_win_rescale(NULL, EINA_FALSE);
88 _elm_ews_wm_rescale(NULL, EINA_FALSE);
91 static Eina_Bool _emotion_inited = EINA_FALSE;
94 _elm_emotion_init(void)
96 if (_emotion_inited) return ;
100 _emotion_inited = EINA_TRUE;
105 _elm_emotion_shutdown(void)
107 if (!_emotion_inited) return ;
111 _emotion_inited = EINA_FALSE;
115 static void *app_mainfunc = NULL;
116 static const char *app_domain = NULL;
117 static const char *app_checkfile = NULL;
119 static const char *app_compile_bin_dir = NULL;
120 static const char *app_compile_lib_dir = NULL;
121 static const char *app_compile_data_dir = NULL;
122 static const char *app_compile_locale_dir = NULL;
123 static const char *app_prefix_dir = NULL;
124 static const char *app_bin_dir = NULL;
125 static const char *app_lib_dir = NULL;
126 static const char *app_data_dir = NULL;
127 static const char *app_locale_dir = NULL;
129 static Eina_Prefix *app_pfx = NULL;
136 const char *dirs[4] = { NULL, NULL, NULL, NULL };
137 char *caps = NULL, *p1, *p2;
141 if (!app_domain) return;
143 ecore_app_args_get(&argc, &argv);
144 if (argc < 1) return;
146 dirs[0] = app_compile_bin_dir;
147 dirs[1] = app_compile_lib_dir;
148 dirs[2] = app_compile_data_dir;
149 dirs[3] = app_compile_locale_dir;
151 if (!dirs[0]) dirs[0] = "/usr/local/bin";
152 if (!dirs[1]) dirs[1] = "/usr/local/lib";
155 snprintf(buf, sizeof(buf), "/usr/local/share/%s", app_domain);
158 if (!dirs[3]) dirs[3] = dirs[2];
162 caps = alloca(strlen(app_domain) + 1);
163 for (p1 = (char *)app_domain, p2 = caps; *p1; p1++, p2++)
167 app_pfx = eina_prefix_new(argv[0], app_mainfunc, caps, app_domain,
168 app_checkfile, dirs[0], dirs[1], dirs[2], dirs[3]);
172 _prefix_shutdown(void)
174 if (app_pfx) eina_prefix_free(app_pfx);
175 if (app_domain) eina_stringshare_del(app_domain);
176 if (app_checkfile) eina_stringshare_del(app_checkfile);
177 if (app_compile_bin_dir) eina_stringshare_del(app_compile_bin_dir);
178 if (app_compile_lib_dir) eina_stringshare_del(app_compile_lib_dir);
179 if (app_compile_data_dir) eina_stringshare_del(app_compile_data_dir);
180 if (app_compile_locale_dir) eina_stringshare_del(app_compile_locale_dir);
181 if (app_prefix_dir) eina_stringshare_del(app_prefix_dir);
182 if (app_bin_dir) eina_stringshare_del(app_bin_dir);
183 if (app_lib_dir) eina_stringshare_del(app_lib_dir);
184 if (app_data_dir) eina_stringshare_del(app_data_dir);
185 if (app_locale_dir) eina_stringshare_del(app_locale_dir);
188 app_checkfile = NULL;
189 app_compile_bin_dir = NULL;
190 app_compile_lib_dir = NULL;
191 app_compile_data_dir = NULL;
192 app_compile_locale_dir = NULL;
193 app_prefix_dir = NULL;
197 app_locale_dir = NULL;
206 if (_elm_init_count > 1) return _elm_init_count;
207 elm_quicklaunch_init(argc, argv);
208 elm_quicklaunch_sub_init(argc, argv);
210 return _elm_init_count;
216 if (_elm_init_count <= 0)
218 ERR("Init count not greater than 0 in shutdown.");
222 if (_elm_init_count > 0) return _elm_init_count;
224 while (_elm_win_deferred_free) ecore_main_loop_iterate();
226 // _prefix_shutdown();
227 elm_quicklaunch_sub_shutdown();
228 elm_quicklaunch_shutdown();
229 return _elm_init_count;
233 elm_app_info_set(void *mainfunc, const char *dom, const char *checkfile)
235 app_mainfunc = mainfunc;
236 eina_stringshare_replace(&app_domain, dom);
237 eina_stringshare_replace(&app_checkfile, checkfile);
241 elm_app_compile_bin_dir_set(const char *dir)
243 eina_stringshare_replace(&app_compile_bin_dir, dir);
247 elm_app_compile_lib_dir_set(const char *dir)
249 eina_stringshare_replace(&app_compile_lib_dir, dir);
253 elm_app_compile_data_dir_set(const char *dir)
255 eina_stringshare_replace(&app_compile_data_dir, dir);
259 elm_app_compile_locale_set(const char *dir)
261 eina_stringshare_replace(&app_compile_locale_dir, dir);
265 elm_app_prefix_dir_get(void)
267 if (app_prefix_dir) return app_prefix_dir;
269 if (!app_pfx) return "";
270 app_prefix_dir = eina_prefix_get(app_pfx);
271 return app_prefix_dir;
275 elm_app_bin_dir_get(void)
277 if (app_bin_dir) return app_bin_dir;
279 if (!app_pfx) return "";
280 app_bin_dir = eina_prefix_bin_get(app_pfx);
285 elm_app_lib_dir_get(void)
287 if (app_lib_dir) return app_lib_dir;
289 if (!app_pfx) return "";
290 app_lib_dir = eina_prefix_lib_get(app_pfx);
295 elm_app_data_dir_get(void)
297 if (app_data_dir) return app_data_dir;
299 if (!app_pfx) return "";
300 app_data_dir = eina_prefix_data_get(app_pfx);
305 elm_app_locale_dir_get(void)
307 if (app_locale_dir) return app_locale_dir;
309 if (!app_pfx) return "";
310 app_locale_dir = eina_prefix_locale_get(app_pfx);
311 return app_locale_dir;
315 static int _elm_need_e_dbus = 0;
318 elm_need_e_dbus(void)
321 if (_elm_need_e_dbus++) return EINA_TRUE;
330 _elm_unneed_e_dbus(void)
333 if (--_elm_need_e_dbus) return;
335 _elm_need_e_dbus = 0;
341 static int _elm_need_efreet = 0;
344 elm_need_efreet(void)
347 if (_elm_need_efreet++) return EINA_TRUE;
355 list = efreet_icon_extra_list_get();
358 e_user_dir_concat_static(buf, "icons");
359 *list = eina_list_prepend(*list, (void *)eina_stringshare_add(buf));
360 e_prefix_data_concat_static(buf, "data/icons");
361 *list = eina_list_prepend(*list, (void *)eina_stringshare_add(buf));
372 _elm_unneed_efreet(void)
375 if (--_elm_need_efreet) return;
377 _elm_need_efreet = 0;
378 efreet_trash_shutdown();
379 efreet_mime_shutdown();
385 elm_quicklaunch_mode_set(Eina_Bool ql_on)
387 quicklaunch_on = ql_on;
391 elm_quicklaunch_mode_get(void)
393 return quicklaunch_on;
397 elm_quicklaunch_init(int argc,
400 _elm_ql_init_count++;
401 if (_elm_ql_init_count > 1) return _elm_ql_init_count;
403 _elm_log_dom = eina_log_domain_register("elementary", EINA_COLOR_LIGHTBLUE);
406 EINA_LOG_ERR("could not register elementary log domain.");
407 _elm_log_dom = EINA_LOG_DOMAIN_GLOBAL;
413 #ifdef HAVE_ELEMENTARY_EMAP
416 ecore_app_args_set(argc, (const char **)argv);
418 memset(_elm_policies, 0, sizeof(_elm_policies));
419 if (!ELM_EVENT_POLICY_CHANGED)
420 ELM_EVENT_POLICY_CHANGED = ecore_event_type_new();
424 _elm_exit_handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _elm_signal_exit, NULL);
426 if (argv) _elm_appname = strdup(ecore_file_file_get(argv[0]));
428 pfx = eina_prefix_new(argv ? argv[0] : NULL, elm_quicklaunch_init,
429 "ELM", "elementary", "config/profile.cfg",
430 PACKAGE_LIB_DIR, /* don't have a bin dir currently */
436 _elm_data_dir = eina_stringshare_add(eina_prefix_data_get(pfx));
437 _elm_lib_dir = eina_stringshare_add(eina_prefix_lib_get(pfx));
439 if (!_elm_data_dir) _elm_data_dir = eina_stringshare_add("/");
440 if (!_elm_lib_dir) _elm_lib_dir = eina_stringshare_add("/");
442 return _elm_ql_init_count;
446 elm_quicklaunch_sub_init(int argc,
449 _elm_sub_init_count++;
450 if (_elm_sub_init_count > 1) return _elm_sub_init_count;
454 #ifdef SEMI_BROKEN_QUICKLAUNCH
455 return _elm_sub_init_count;
461 ecore_app_args_set(argc, (const char **)argv);
466 _elm_config_sub_init();
467 ecore_evas_init(); // FIXME: check errors
468 #ifdef HAVE_ELEMENTARY_ECORE_IMF
471 #ifdef HAVE_ELEMENTARY_ECORE_CON
473 ecore_con_url_init();
477 return _elm_sub_init_count;
481 elm_quicklaunch_sub_shutdown(void)
483 _elm_sub_init_count--;
484 if (_elm_sub_init_count > 0) return _elm_sub_init_count;
487 #ifdef SEMI_BROKEN_QUICKLAUNCH
488 return _elm_sub_init_count;
494 _elm_module_shutdown();
495 _elm_ews_wm_shutdown();
496 #ifdef HAVE_ELEMENTARY_ECORE_CON
497 ecore_con_url_shutdown();
498 ecore_con_shutdown();
500 #ifdef HAVE_ELEMENTARY_ECORE_IMF
501 ecore_imf_shutdown();
503 ecore_evas_shutdown();
504 _elm_config_sub_shutdown();
505 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
506 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
507 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
508 ENGINE_COMPARE(ELM_XRENDER_X11) ||
509 ENGINE_COMPARE(ELM_OPENGL_X11) ||
510 ENGINE_COMPARE(ELM_SOFTWARE_SDL) ||
511 ENGINE_COMPARE(ELM_SOFTWARE_16_SDL) ||
512 ENGINE_COMPARE(ELM_OPENGL_SDL) ||
513 ENGINE_COMPARE(ELM_OPENGL_COCOA) ||
514 ENGINE_COMPARE(ELM_SOFTWARE_WIN32) ||
515 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE) ||
516 ENGINE_COMPARE(ELM_EWS))
517 #undef ENGINE_COMPARE
518 evas_cserve_disconnect();
522 return _elm_sub_init_count;
526 elm_quicklaunch_shutdown(void)
528 _elm_ql_init_count--;
529 if (_elm_ql_init_count > 0) return _elm_ql_init_count;
530 if (pfx) eina_prefix_free(pfx);
532 eina_stringshare_del(_elm_data_dir);
533 _elm_data_dir = NULL;
534 eina_stringshare_del(_elm_lib_dir);
540 _elm_config_shutdown();
542 ecore_event_handler_del(_elm_exit_handler);
543 _elm_exit_handler = NULL;
545 _elm_theme_shutdown();
546 _elm_unneed_efreet();
547 _elm_unneed_e_dbus();
548 _elm_unneed_ethumb();
550 ecore_file_shutdown();
552 #ifdef HAVE_ELEMENTARY_EMAP
556 _elm_emotion_shutdown();
562 if ((_elm_log_dom > -1) && (_elm_log_dom != EINA_LOG_DOMAIN_GLOBAL))
564 eina_log_domain_unregister(_elm_log_dom);
569 return _elm_ql_init_count;
573 elm_quicklaunch_seed(void)
575 #ifndef SEMI_BROKEN_QUICKLAUNCH
578 Evas_Object *win, *bg, *bt;
580 win = elm_win_add(NULL, "seed", ELM_WIN_BASIC);
581 bg = elm_bg_add(win);
582 elm_win_resize_object_add(win, bg);
583 evas_object_show(bg);
584 bt = elm_button_add(win);
585 elm_object_text_set(bt, " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~-_=+\\|]}[{;:'\",<.>/?");
586 elm_win_resize_object_add(win, bt);
587 ecore_main_loop_iterate();
588 evas_object_del(win);
589 ecore_main_loop_iterate();
590 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
591 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
592 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
593 ENGINE_COMPARE(ELM_XRENDER_X11) ||
594 ENGINE_COMPARE(ELM_OPENGL_X11))
595 #undef ENGINE_COMPARE
597 # ifdef HAVE_ELEMENTARY_X
601 ecore_main_loop_iterate();
607 static void *qr_handle = NULL;
609 static int (*qr_main)(int argc,
613 elm_quicklaunch_prepare(int argc,
619 if (argc <= 0 || argv == NULL) return EINA_FALSE;
621 exe = elm_quicklaunch_exe_path_get(argv[0]);
624 ERR("requested quicklaunch binary '%s' does not exist\n", argv[0]);
632 exe2 = malloc(strlen(exe) + 1 + 10);
634 p = strrchr(exe2, '/');
637 exename = alloca(strlen(p) + 1);
640 strcat(p, "../lib/");
643 if (!access(exe2, R_OK | X_OK))
651 qr_handle = dlopen(exe, RTLD_NOW | RTLD_GLOBAL);
654 fprintf(stderr, "dlerr: %s\n", dlerror());
655 WRN("dlopen('%s') failed: %s", exe, dlerror());
659 INF("dlopen('%s') = %p", exe, qr_handle);
660 qr_main = dlsym(qr_handle, "elm_main");
661 INF("dlsym(%p, 'elm_main') = %p", qr_handle, qr_main);
664 WRN("not quicklauncher capable: no elm_main in '%s'", exe);
679 elm_quicklaunch_fork(int argc,
682 void (postfork_func) (void *data),
695 if (child > 0) return EINA_TRUE;
698 perror("could not fork");
702 if (chdir(cwd) != 0) perror("could not chdir");
703 args = alloca((argc + 1) * sizeof(char *));
704 for (i = 0; i < argc; i++) args[i] = argv[i];
706 WRN("%s not quicklaunch capable, fallback...", argv[0]);
707 execvp(argv[0], args);
708 ERR("failed to execute '%s': %s", argv[0], strerror(errno));
712 if (child > 0) return EINA_TRUE;
715 perror("could not fork");
718 if (postfork_func) postfork_func(postfork_data);
724 if (_elm_appname) free(_elm_appname);
726 if ((argv) && (argv[0]))
727 _elm_appname = strdup(ecore_file_file_get(argv[0]));
729 #ifdef SEMI_BROKEN_QUICKLAUNCH
730 ecore_app_args_set(argc, (const char **)argv);
734 _elm_config_sub_init();
735 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
736 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
737 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
738 ENGINE_COMPARE(ELM_XRENDER_X11) ||
739 ENGINE_COMPARE(ELM_OPENGL_X11))
740 #undef ENGINE_COMPARE
742 # ifdef HAVE_ELEMENTARY_X
746 ecore_evas_init(); // FIXME: check errors
747 # ifdef HAVE_ELEMENTARY_ECORE_IMF
754 if (chdir(cwd) != 0) perror("could not chdir");
755 ecore_app_args_set(argc, (const char **)argv);
756 ret = qr_main(argc, argv);
770 elm_quicklaunch_cleanup(void)
783 elm_quicklaunch_fallback(int argc,
787 elm_quicklaunch_init(argc, argv);
788 elm_quicklaunch_sub_init(argc, argv);
789 elm_quicklaunch_prepare(argc, argv);
790 ret = qr_main(argc, argv);
796 elm_quicklaunch_exe_path_get(const char *exe)
798 static char *path = NULL;
799 static Eina_List *pathlist = NULL;
803 if (exe[0] == '/') return strdup(exe);
804 if ((exe[0] == '.') && (exe[1] == '/')) return strdup(exe);
805 if ((exe[0] == '.') && (exe[1] == '.') && (exe[2] == '/')) return strdup(exe);
810 path = getenv("PATH");
811 buf2 = alloca(strlen(path) + 1);
816 if ((*p == ':') || (!*p))
821 strncpy(buf2, pp, len);
823 pathlist = eina_list_append(pathlist, eina_stringshare_add(buf2));
835 EINA_LIST_FOREACH(pathlist, l, pathitr)
837 snprintf(buf, sizeof(buf), "%s/%s", pathitr, exe);
838 if (!access(buf, R_OK | X_OK)) return strdup(buf);
846 ecore_main_loop_begin();
852 ecore_main_loop_quit();
854 if (elm_policy_get(ELM_POLICY_EXIT) == ELM_POLICY_EXIT_WINDOWS_DEL)
856 Eina_List *l, *l_next;
859 EINA_LIST_FOREACH_SAFE(_elm_win_list, l, l_next, win)
860 evas_object_del(win);
864 //FIXME: Use Elm_Policy Parameter when 2.0 is released.
866 elm_policy_set(unsigned int policy,
869 Elm_Event_Policy_Changed *ev;
871 if (policy >= ELM_POLICY_LAST)
874 if (value == _elm_policies[policy])
877 /* TODO: validate policy? */
879 ev = malloc(sizeof(*ev));
881 ev->new_value = value;
882 ev->old_value = _elm_policies[policy];
884 _elm_policies[policy] = value;
886 ecore_event_add(ELM_EVENT_POLICY_CHANGED, ev, NULL, NULL);
891 //FIXME: Use Elm_Policy Parameter when 2.0 is released.
893 elm_policy_get(unsigned int policy)
895 if (policy >= ELM_POLICY_LAST)
897 return _elm_policies[policy];
901 elm_language_set(const char *lang)
903 setlocale(LC_ALL, lang);
904 _elm_win_translate();
908 elm_object_mirrored_get(const Evas_Object *obj)
910 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
911 return elm_widget_mirrored_get(obj);
915 elm_object_mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
917 EINA_SAFETY_ON_NULL_RETURN(obj);
918 elm_widget_mirrored_set(obj, mirrored);
922 elm_object_mirrored_automatic_get(const Evas_Object *obj)
924 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
925 return elm_widget_mirrored_automatic_get(obj);
929 elm_object_mirrored_automatic_set(Evas_Object *obj, Eina_Bool automatic)
931 EINA_SAFETY_ON_NULL_RETURN(obj);
932 elm_widget_mirrored_automatic_set(obj, automatic);
940 elm_object_scale_set(Evas_Object *obj,
943 EINA_SAFETY_ON_NULL_RETURN(obj);
944 elm_widget_scale_set(obj, scale);
948 elm_object_scale_get(const Evas_Object *obj)
950 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, 0.0);
951 return elm_widget_scale_get(obj);
955 elm_object_part_text_set(Evas_Object *obj, const char *part, const char *label)
957 EINA_SAFETY_ON_NULL_RETURN(obj);
958 elm_widget_text_part_set(obj, part, label);
962 elm_object_part_text_get(const Evas_Object *obj, const char *part)
964 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
965 return elm_widget_text_part_get(obj, part);
969 elm_object_domain_translatable_part_text_set(Evas_Object *obj, const char *part, const char *domain, const char *text)
971 EINA_SAFETY_ON_NULL_RETURN(obj);
972 elm_widget_domain_translatable_part_text_set(obj, part, domain, text);
976 elm_object_translatable_part_text_get(const Evas_Object *obj, const char *part)
978 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
979 return elm_widget_translatable_part_text_get(obj, part);
982 EINA_DEPRECATED EAPI void
983 elm_object_domain_translatable_text_part_set(Evas_Object *obj, const char *part, const char *domain, const char *text)
985 elm_object_domain_translatable_part_text_set(obj, part, domain, text);
988 EINA_DEPRECATED EAPI const char *
989 elm_object_translatable_text_part_get(const Evas_Object *obj, const char *part)
991 return elm_object_translatable_part_text_get(obj, part);
995 elm_object_part_content_set(Evas_Object *obj, const char *part, Evas_Object *content)
997 EINA_SAFETY_ON_NULL_RETURN(obj);
998 elm_widget_content_part_set(obj, part, content);
1002 elm_object_part_content_get(const Evas_Object *obj, const char *part)
1004 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1005 return elm_widget_content_part_get(obj, part);
1009 elm_object_part_content_unset(Evas_Object *obj, const char *part)
1011 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1012 return elm_widget_content_part_unset(obj, part);
1016 elm_object_style_set(Evas_Object *obj,
1019 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1020 return elm_widget_style_set(obj, style);
1024 elm_object_style_get(const Evas_Object *obj)
1026 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1027 return elm_widget_style_get(obj);
1031 elm_object_disabled_set(Evas_Object *obj,
1034 EINA_SAFETY_ON_NULL_RETURN(obj);
1035 elm_widget_disabled_set(obj, disabled);
1039 elm_object_disabled_get(const Evas_Object *obj)
1041 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1042 return elm_widget_disabled_get(obj);
1046 elm_cache_all_flush(void)
1051 edje_file_cache_flush();
1052 edje_collection_cache_flush();
1054 EINA_LIST_FOREACH(_elm_win_list, l, obj)
1056 Evas *e = evas_object_evas_get(obj);
1057 evas_image_cache_flush(e);
1058 evas_font_cache_flush(e);
1059 evas_render_dump(e);
1064 elm_object_focus_get(const Evas_Object *obj)
1066 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1067 return elm_widget_focus_get(obj);
1071 elm_object_focus_set(Evas_Object *obj,
1074 EINA_SAFETY_ON_NULL_RETURN(obj);
1076 if (elm_widget_is(obj))
1080 if (focus == elm_widget_focus_get(obj)) return;
1082 // ugly, but, special case for inlined windows
1083 type = evas_object_type_get(obj);
1084 if ((type) && (!strcmp(type, "elm_win")))
1086 Evas_Object *inlined = elm_win_inlined_image_object_get(obj);
1090 evas_object_focus_set(inlined, focus);
1095 elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
1097 elm_widget_focused_object_clear(obj);
1101 evas_object_focus_set(obj, focus);
1106 elm_object_focus_allow_set(Evas_Object *obj,
1109 EINA_SAFETY_ON_NULL_RETURN(obj);
1110 elm_widget_can_focus_set(obj, enable);
1111 /*FIXME: According to the elm_object_focus_allow_get(), child_can_focus field
1112 of the parent should be updated. Otherwise, the checking of it's child focus allow states should not be in elm_object_focus_allow_get() */
1116 elm_object_focus_allow_get(const Evas_Object *obj)
1118 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1119 return (elm_widget_can_focus_get(obj)) || (elm_widget_child_can_focus_get(obj));
1123 elm_object_focus_custom_chain_set(Evas_Object *obj,
1126 EINA_SAFETY_ON_NULL_RETURN(obj);
1127 elm_widget_focus_custom_chain_set(obj, objs);
1131 elm_object_focus_custom_chain_unset(Evas_Object *obj)
1133 EINA_SAFETY_ON_NULL_RETURN(obj);
1134 elm_widget_focus_custom_chain_unset(obj);
1137 EAPI const Eina_List *
1138 elm_object_focus_custom_chain_get(const Evas_Object *obj)
1140 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1141 return elm_widget_focus_custom_chain_get(obj);
1145 elm_object_focus_custom_chain_append(Evas_Object *obj,
1147 Evas_Object *relative_child)
1149 EINA_SAFETY_ON_NULL_RETURN(obj);
1150 elm_widget_focus_custom_chain_append(obj, child, relative_child);
1154 elm_object_focus_custom_chain_prepend(Evas_Object *obj,
1156 Evas_Object *relative_child)
1158 EINA_SAFETY_ON_NULL_RETURN(obj);
1159 elm_widget_focus_custom_chain_prepend(obj, child, relative_child);
1162 EINA_DEPRECATED EAPI void
1163 elm_object_focus_cycle(Evas_Object *obj,
1164 Elm_Focus_Direction dir)
1166 elm_object_focus_next(obj, dir);
1170 elm_object_focus_next(Evas_Object *obj,
1171 Elm_Focus_Direction dir)
1173 EINA_SAFETY_ON_NULL_RETURN(obj);
1174 elm_widget_focus_cycle(obj, dir);
1178 elm_object_focus_next_object_get(const Evas_Object *obj,
1179 Elm_Focus_Direction dir)
1181 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1182 return elm_widget_focus_next_object_get(obj, dir);
1186 elm_object_focus_next_object_set(Evas_Object *obj,
1188 Elm_Focus_Direction dir)
1190 EINA_SAFETY_ON_NULL_RETURN(obj);
1191 elm_widget_focus_next_object_set(obj, next, dir);
1195 elm_object_focused_object_get(const Evas_Object *obj)
1197 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1198 return elm_widget_focused_object_get(obj);
1202 elm_object_tree_focus_allow_set(Evas_Object *obj,
1203 Eina_Bool tree_focusable)
1205 EINA_SAFETY_ON_NULL_RETURN(obj);
1206 elm_widget_tree_unfocusable_set(obj, !tree_focusable);
1210 elm_object_tree_focus_allow_get(const Evas_Object *obj)
1212 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1213 return !elm_widget_tree_unfocusable_get(obj);
1217 elm_object_scroll_hold_push(Evas_Object *obj)
1219 EINA_SAFETY_ON_NULL_RETURN(obj);
1220 elm_widget_scroll_hold_push(obj);
1224 elm_object_scroll_hold_pop(Evas_Object *obj)
1226 EINA_SAFETY_ON_NULL_RETURN(obj);
1227 elm_widget_scroll_hold_pop(obj);
1231 elm_object_scroll_hold_get(const Evas_Object *obj)
1233 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, 0);
1234 return elm_widget_scroll_hold_get(obj);
1238 elm_object_scroll_freeze_push(Evas_Object *obj)
1240 EINA_SAFETY_ON_NULL_RETURN(obj);
1241 elm_widget_scroll_freeze_push(obj);
1245 elm_object_scroll_freeze_pop(Evas_Object *obj)
1247 EINA_SAFETY_ON_NULL_RETURN(obj);
1248 elm_widget_scroll_freeze_pop(obj);
1252 elm_object_scroll_freeze_get(const Evas_Object *obj)
1254 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, 0);
1255 return elm_widget_scroll_freeze_get(obj);
1259 elm_object_scroll_lock_x_set(Evas_Object *obj,
1262 EINA_SAFETY_ON_NULL_RETURN(obj);
1263 elm_widget_drag_lock_x_set(obj, lock);
1267 elm_object_scroll_lock_y_set(Evas_Object *obj,
1270 EINA_SAFETY_ON_NULL_RETURN(obj);
1271 elm_widget_drag_lock_y_set(obj, lock);
1275 elm_object_scroll_lock_x_get(const Evas_Object *obj)
1277 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1278 return elm_widget_drag_lock_x_get(obj);
1282 elm_object_scroll_lock_y_get(const Evas_Object *obj)
1284 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1285 return elm_widget_drag_lock_y_get(obj);
1289 elm_object_widget_check(const Evas_Object *obj)
1291 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1292 return elm_widget_is(obj);
1296 elm_object_parent_widget_get(const Evas_Object *obj)
1298 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1299 return elm_widget_parent_widget_get(obj);
1303 elm_object_top_widget_get(const Evas_Object *obj)
1305 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1306 return elm_widget_top_get(obj);
1310 elm_object_widget_type_get(const Evas_Object *obj)
1312 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1313 return elm_widget_type_get(obj);
1317 elm_object_signal_emit(Evas_Object *obj,
1318 const char *emission,
1321 EINA_SAFETY_ON_NULL_RETURN(obj);
1322 elm_widget_signal_emit(obj, emission, source);
1326 elm_object_signal_callback_add(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data)
1328 EINA_SAFETY_ON_NULL_RETURN(obj);
1329 EINA_SAFETY_ON_NULL_RETURN(func);
1330 elm_widget_signal_callback_add(obj, emission, source, func, data);
1334 elm_object_signal_callback_del(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func)
1336 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1337 EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
1338 return elm_widget_signal_callback_del(obj, emission, source, func);
1342 elm_object_event_callback_add(Evas_Object *obj, Elm_Event_Cb func, const void *data)
1344 EINA_SAFETY_ON_NULL_RETURN(obj);
1345 EINA_SAFETY_ON_NULL_RETURN(func);
1346 elm_widget_event_callback_add(obj, func, data);
1350 elm_object_event_callback_del(Evas_Object *obj, Elm_Event_Cb func, const void *data)
1352 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1353 EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
1354 return elm_widget_event_callback_del(obj, func, data);
1358 elm_object_tree_dump(const Evas_Object *top)
1361 elm_widget_tree_dump(top);
1369 elm_object_tree_dot_dump(const Evas_Object *top,
1373 FILE *f = fopen(file, "wb");
1374 elm_widget_tree_dot_dump(top, f);
1384 elm_coords_finger_size_adjust(int times_w,
1389 if ((w) && (*w < (elm_config_finger_size_get() * times_w)))
1390 *w = elm_config_finger_size_get() * times_w;
1391 if ((h) && (*h < (elm_config_finger_size_get() * times_h)))
1392 *h = elm_config_finger_size_get() * times_h;
1396 elm_object_item_widget_get(const Elm_Object_Item *it)
1398 return elm_widget_item_widget_get(it);
1402 elm_object_item_part_content_set(Elm_Object_Item *it,
1404 Evas_Object *content)
1406 _elm_widget_item_part_content_set((Elm_Widget_Item *)it, part, content);
1410 elm_object_item_part_content_get(const Elm_Object_Item *it,
1413 return _elm_widget_item_part_content_get((Elm_Widget_Item *)it, part);
1417 elm_object_item_part_content_unset(Elm_Object_Item *it, const char *part)
1419 return _elm_widget_item_part_content_unset((Elm_Widget_Item *)it, part);
1423 elm_object_item_part_text_set(Elm_Object_Item *it,
1427 _elm_widget_item_part_text_set((Elm_Widget_Item *)it, part, label);
1431 elm_object_item_part_text_get(const Elm_Object_Item *it, const char *part)
1433 return _elm_widget_item_part_text_get((Elm_Widget_Item *)it, part);
1437 elm_object_item_domain_translatable_part_text_set(Elm_Object_Item *it, const char *part, const char *domain, const char *text)
1439 _elm_widget_item_domain_translatable_part_text_set((Elm_Widget_Item *)it, part, domain, text);
1443 elm_object_item_translatable_part_text_get(const Elm_Object_Item *it, const char *part)
1445 return _elm_widget_item_translatable_part_text_get((Elm_Widget_Item *)it, part);
1449 elm_object_access_info_set(Evas_Object *obj, const char *txt)
1451 elm_widget_access_info_set(obj, txt);
1455 elm_object_name_find(const Evas_Object *obj, const char *name, int recurse)
1457 return elm_widget_name_find(obj, name, recurse);
1461 elm_object_orientation_mode_disabled_set(Evas_Object *obj, Eina_Bool disabled)
1463 elm_widget_orientation_mode_disabled_set(obj, disabled);
1467 elm_object_orientation_mode_disabled_get(const Evas_Object *obj)
1469 return elm_widget_orientation_mode_disabled_get(obj);
1473 elm_object_item_access_info_set(Elm_Object_Item *it, const char *txt)
1475 _elm_widget_item_access_info_set((Elm_Widget_Item *)it, txt);
1479 elm_object_item_access_register(Elm_Object_Item *item)
1481 Elm_Widget_Item *it;
1483 it = (Elm_Widget_Item *)item;
1485 _elm_access_widget_item_register(it);
1487 if (it) return it->access_obj;
1492 elm_object_item_access_unregister(Elm_Object_Item *item)
1494 _elm_access_widget_item_unregister((Elm_Widget_Item *)item);
1498 elm_object_item_access_object_get(const Elm_Object_Item *item)
1500 if (!item) return NULL;
1501 return ((Elm_Widget_Item *)item)->access_obj;
1505 elm_object_item_access_order_set(Elm_Object_Item *item, Eina_List *objs)
1507 _elm_access_widget_item_access_order_set((Elm_Widget_Item *)item, objs);
1510 EAPI const Eina_List *
1511 elm_object_item_access_order_get(const Elm_Object_Item *item)
1513 return _elm_access_widget_item_access_order_get((Elm_Widget_Item *)item);
1517 elm_object_item_access_order_unset(Elm_Object_Item *item)
1519 _elm_access_widget_item_access_order_unset((Elm_Widget_Item *)item);
1523 elm_object_item_data_get(const Elm_Object_Item *it)
1525 return elm_widget_item_data_get(it);
1529 elm_object_item_data_set(Elm_Object_Item *it, void *data)
1531 elm_widget_item_data_set(it, data);
1535 elm_object_item_signal_emit(Elm_Object_Item *it, const char *emission, const char *source)
1537 _elm_widget_item_signal_emit((Elm_Widget_Item *)it, emission, source);
1541 elm_object_item_signal_callback_add(Elm_Object_Item *it, const char *emission, const char *source, Elm_Object_Item_Signal_Cb func, void *data)
1543 _elm_widget_item_signal_callback_add((Elm_Widget_Item *)it, emission, source, (Elm_Widget_Item_Signal_Cb) func, data);
1547 elm_object_item_signal_callback_del(Elm_Object_Item *it, const char *emission, const char *source, Elm_Object_Item_Signal_Cb func)
1549 return _elm_widget_item_signal_callback_del((Elm_Widget_Item *)it, emission, source, (Elm_Widget_Item_Signal_Cb) func);
1552 EAPI void elm_object_item_disabled_set(Elm_Object_Item *it, Eina_Bool disabled)
1554 _elm_widget_item_disabled_set((Elm_Widget_Item *)it, disabled);
1557 EAPI Eina_Bool elm_object_item_disabled_get(const Elm_Object_Item *it)
1559 return _elm_widget_item_disabled_get((Elm_Widget_Item *)it);
1562 EAPI void elm_object_item_del_cb_set(Elm_Object_Item *it, Evas_Smart_Cb del_cb)
1564 _elm_widget_item_del_cb_set((Elm_Widget_Item *)it, del_cb);
1567 EAPI void elm_object_item_del(Elm_Object_Item *it)
1569 _elm_widget_item_del((Elm_Widget_Item *)it);
1573 elm_object_item_tooltip_text_set(Elm_Object_Item *it, const char *text)
1575 elm_widget_item_tooltip_text_set(it, text);
1579 elm_object_item_tooltip_content_cb_set(Elm_Object_Item *it, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb)
1581 elm_widget_item_tooltip_content_cb_set(it, func, data, del_cb);
1585 elm_object_item_tooltip_unset(Elm_Object_Item *it)
1587 elm_widget_item_tooltip_unset(it);
1591 elm_object_item_tooltip_window_mode_set(Elm_Object_Item *it, Eina_Bool disable)
1593 return elm_widget_item_tooltip_window_mode_set(it, disable);
1597 elm_object_item_tooltip_window_mode_get(const Elm_Object_Item *it)
1599 return elm_widget_item_tooltip_window_mode_get(it);
1603 elm_object_item_tooltip_style_set(Elm_Object_Item *it, const char *style)
1605 elm_widget_item_tooltip_style_set(it, style);
1609 elm_object_item_tooltip_style_get(const Elm_Object_Item *it)
1611 return elm_widget_item_tooltip_style_get(it);
1615 elm_object_item_cursor_set(Elm_Object_Item *it, const char *cursor)
1617 elm_widget_item_cursor_set(it, cursor);
1621 elm_object_item_cursor_get(const Elm_Object_Item *it)
1623 return elm_widget_item_cursor_get(it);
1627 elm_object_item_cursor_unset(Elm_Object_Item *it)
1629 elm_widget_item_cursor_unset(it);
1633 elm_object_item_cursor_style_set(Elm_Object_Item *it, const char *style)
1635 elm_widget_item_cursor_style_set(it, style);
1639 elm_object_item_cursor_style_get(const Elm_Object_Item *it)
1641 return elm_widget_item_cursor_style_get(it);
1645 elm_object_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only)
1647 elm_widget_item_cursor_engine_only_set(it, engine_only);
1651 elm_object_item_cursor_engine_only_get(const Elm_Object_Item *it)
1653 return elm_widget_item_cursor_engine_only_get(it);