2 # include "elementary_config.h"
6 #include <dlfcn.h> /* dlopen,dlclose,etc */
9 #ifdef HAVE_CRT_EXTERNS_H
10 # include <crt_externs.h>
17 #include <Elementary.h>
20 #define SEMI_BROKEN_QUICKLAUNCH 1
22 static Elm_Version _version = { VMAJ, VMIN, VMIC, VREV };
23 EAPI Elm_Version *elm_version = &_version;
26 _elm_dangerous_call_check(const char *call)
31 snprintf(buf, sizeof(buf), "%i.%i.%i.%i", VMAJ, VMIN, VMIC, VREV);
32 eval = getenv("ELM_NO_FINGER_WAGGLING");
33 if ((eval) && (!strcmp(eval, buf)))
35 printf("ELEMENTARY FINGER WAGGLE!!!!!!!!!!\n"
38 "PLEASE see the API documentation for this function. This call\n"
39 "should almost never be used. Only in very special cases.\n"
41 "To remove this warning please set the environment variable:\n"
42 " ELM_NO_FINGER_WAGGLING\n"
43 "To the value of the Elementary version + revision number. e.g.:\n"
51 static Eina_Bool _elm_signal_exit(void *data,
55 static Eina_Prefix *pfx = NULL;
56 char *_elm_appname = NULL;
57 const char *_elm_data_dir = NULL;
58 const char *_elm_lib_dir = NULL;
59 int _elm_log_dom = -1;
61 EAPI int ELM_EVENT_POLICY_CHANGED = 0;
63 static int _elm_init_count = 0;
64 static int _elm_sub_init_count = 0;
65 static int _elm_ql_init_count = 0;
66 static int _elm_policies[ELM_POLICY_LAST];
67 static Ecore_Event_Handler *_elm_exit_handler = NULL;
68 static Eina_Bool quicklaunch_on = 0;
71 _elm_signal_exit(void *data __UNUSED__,
72 int ev_type __UNUSED__,
76 return ECORE_CALLBACK_PASS_ON;
82 edje_scale_set(_elm_config->scale);
83 _elm_win_rescale(NULL, EINA_FALSE);
84 _elm_ews_wm_rescale(NULL, EINA_FALSE);
87 static void *app_mainfunc = NULL;
88 static const char *app_domain = NULL;
89 static const char *app_checkfile = NULL;
91 static const char *app_compile_bin_dir = NULL;
92 static const char *app_compile_lib_dir = NULL;
93 static const char *app_compile_data_dir = NULL;
94 static const char *app_compile_locale_dir = NULL;
95 static const char *app_prefix_dir = NULL;
96 static const char *app_bin_dir = NULL;
97 static const char *app_lib_dir = NULL;
98 static const char *app_data_dir = NULL;
99 static const char *app_locale_dir = NULL;
101 static Eina_Prefix *app_pfx = NULL;
108 const char *dirs[4] = { NULL, NULL, NULL, NULL };
109 char *caps = NULL, *p1, *p2;
112 if (!app_domain) return;
114 ecore_app_args_get(&argc, &argv);
115 if (argc < 1) return;
117 dirs[0] = app_compile_bin_dir;
118 dirs[1] = app_compile_lib_dir;
119 dirs[2] = app_compile_data_dir;
120 dirs[3] = app_compile_locale_dir;
122 if (!dirs[1]) dirs[1] = dirs[0];
123 if (!dirs[0]) dirs[0] = dirs[1];
124 if (!dirs[3]) dirs[3] = dirs[2];
125 if (!dirs[2]) dirs[2] = dirs[3];
129 caps = alloca(strlen(app_domain) + 1);
130 for (p1 = (char *)app_domain, p2 = caps; *p1; p1++, p2++)
134 app_pfx = eina_prefix_new(argv[0], app_mainfunc, caps, app_domain,
135 app_checkfile, dirs[0], dirs[1], dirs[2], dirs[3]);
139 _prefix_shutdown(void)
141 if (app_pfx) eina_prefix_free(app_pfx);
142 if (app_domain) eina_stringshare_del(app_domain);
143 if (app_checkfile) eina_stringshare_del(app_checkfile);
144 if (app_compile_bin_dir) eina_stringshare_del(app_compile_bin_dir);
145 if (app_compile_lib_dir) eina_stringshare_del(app_compile_lib_dir);
146 if (app_compile_data_dir) eina_stringshare_del(app_compile_data_dir);
147 if (app_compile_locale_dir) eina_stringshare_del(app_compile_locale_dir);
148 if (app_prefix_dir) eina_stringshare_del(app_prefix_dir);
149 if (app_bin_dir) eina_stringshare_del(app_bin_dir);
150 if (app_lib_dir) eina_stringshare_del(app_lib_dir);
151 if (app_data_dir) eina_stringshare_del(app_data_dir);
152 if (app_locale_dir) eina_stringshare_del(app_locale_dir);
155 app_checkfile = NULL;
156 app_compile_bin_dir = NULL;
157 app_compile_lib_dir = NULL;
158 app_compile_data_dir = NULL;
159 app_compile_locale_dir = NULL;
160 app_prefix_dir = NULL;
164 app_locale_dir = NULL;
173 if (_elm_init_count > 1) return _elm_init_count;
174 elm_quicklaunch_init(argc, argv);
175 elm_quicklaunch_sub_init(argc, argv);
177 return _elm_init_count;
184 if (_elm_init_count > 0) return _elm_init_count;
186 while (_elm_win_deferred_free) ecore_main_loop_iterate();
188 // _prefix_shutdown();
189 elm_quicklaunch_sub_shutdown();
190 elm_quicklaunch_shutdown();
191 return _elm_init_count;
195 elm_app_info_set(void *mainfunc, const char *dom, const char *checkfile)
197 app_mainfunc = mainfunc;
198 eina_stringshare_replace(&app_domain, dom);
199 eina_stringshare_replace(&app_checkfile, checkfile);
203 elm_app_compile_bin_dir_set(const char *dir)
205 eina_stringshare_replace(&app_compile_bin_dir, dir);
209 elm_app_compile_lib_dir_set(const char *dir)
211 eina_stringshare_replace(&app_compile_lib_dir, dir);
215 elm_app_compile_data_dir_set(const char *dir)
217 eina_stringshare_replace(&app_compile_data_dir, dir);
221 elm_app_compile_locale_set(const char *dir)
223 eina_stringshare_replace(&app_compile_locale_dir, dir);
227 elm_app_prefix_dir_get(void)
229 if (app_prefix_dir) return app_prefix_dir;
231 if (!app_pfx) return "";
232 app_prefix_dir = eina_prefix_get(app_pfx);
233 return app_prefix_dir;
237 elm_app_bin_dir_get(void)
239 if (app_bin_dir) return app_bin_dir;
241 if (!app_pfx) return "";
242 app_bin_dir = eina_prefix_bin_get(app_pfx);
247 elm_app_lib_dir_get(void)
249 if (app_lib_dir) return app_lib_dir;
251 if (!app_pfx) return "";
252 app_lib_dir = eina_prefix_lib_get(app_pfx);
257 elm_app_data_dir_get(void)
259 if (app_data_dir) return app_data_dir;
261 if (!app_pfx) return "";
262 app_data_dir = eina_prefix_data_get(app_pfx);
267 elm_app_locale_dir_get(void)
269 if (app_locale_dir) return app_locale_dir;
271 if (!app_pfx) return "";
272 app_locale_dir = eina_prefix_locale_get(app_pfx);
273 return app_locale_dir;
277 static int _elm_need_e_dbus = 0;
280 elm_need_e_dbus(void)
283 if (_elm_need_e_dbus++) return EINA_TRUE;
292 _elm_unneed_e_dbus(void)
295 if (--_elm_need_e_dbus) return;
297 _elm_need_e_dbus = 0;
303 static int _elm_need_efreet = 0;
306 elm_need_efreet(void)
309 if (_elm_need_efreet++) return EINA_TRUE;
317 list = efreet_icon_extra_list_get();
320 e_user_dir_concat_static(buf, "icons");
321 *list = eina_list_prepend(*list, (void *)eina_stringshare_add(buf));
322 e_prefix_data_concat_static(buf, "data/icons");
323 *list = eina_list_prepend(*list, (void *)eina_stringshare_add(buf));
334 _elm_unneed_efreet(void)
337 if (--_elm_need_efreet) return;
339 _elm_need_efreet = 0;
340 efreet_trash_shutdown();
341 efreet_mime_shutdown();
347 elm_quicklaunch_mode_set(Eina_Bool ql_on)
349 quicklaunch_on = ql_on;
353 elm_quicklaunch_mode_get(void)
355 return quicklaunch_on;
359 elm_quicklaunch_init(int argc,
362 _elm_ql_init_count++;
363 if (_elm_ql_init_count > 1) return _elm_ql_init_count;
365 _elm_log_dom = eina_log_domain_register("elementary", EINA_COLOR_LIGHTBLUE);
368 EINA_LOG_ERR("could not register elementary log domain.");
369 _elm_log_dom = EINA_LOG_DOMAIN_GLOBAL;
375 #ifdef HAVE_ELEMENTARY_EMAP
378 ecore_app_args_set(argc, (const char **)argv);
380 memset(_elm_policies, 0, sizeof(_elm_policies));
381 if (!ELM_EVENT_POLICY_CHANGED)
382 ELM_EVENT_POLICY_CHANGED = ecore_event_type_new();
386 _elm_exit_handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _elm_signal_exit, NULL);
388 if (argv) _elm_appname = strdup(ecore_file_file_get(argv[0]));
390 pfx = eina_prefix_new(argv ? argv[0] : NULL, elm_quicklaunch_init,
391 "ELM", "elementary", "config/profile.cfg",
392 PACKAGE_LIB_DIR, /* don't have a bin dir currently */
398 _elm_data_dir = eina_stringshare_add(eina_prefix_data_get(pfx));
399 _elm_lib_dir = eina_stringshare_add(eina_prefix_lib_get(pfx));
401 if (!_elm_data_dir) _elm_data_dir = eina_stringshare_add("/");
402 if (!_elm_lib_dir) _elm_lib_dir = eina_stringshare_add("/");
404 return _elm_ql_init_count;
408 elm_quicklaunch_sub_init(int argc,
411 _elm_sub_init_count++;
412 if (_elm_sub_init_count > 1) return _elm_sub_init_count;
416 #ifdef SEMI_BROKEN_QUICKLAUNCH
417 return _elm_sub_init_count;
422 ecore_app_args_set(argc, (const char **)argv);
427 _elm_config_sub_init();
428 ecore_evas_init(); // FIXME: check errors
429 #ifdef HAVE_ELEMENTARY_ECORE_IMF
432 #ifdef HAVE_ELEMENTARY_ECORE_CON
434 ecore_con_url_init();
438 return _elm_sub_init_count;
442 elm_quicklaunch_sub_shutdown(void)
444 _elm_sub_init_count--;
445 if (_elm_sub_init_count > 0) return _elm_sub_init_count;
448 #ifdef SEMI_BROKEN_QUICKLAUNCH
449 return _elm_sub_init_count;
455 _elm_module_shutdown();
456 _elm_ews_wm_shutdown();
457 #ifdef HAVE_ELEMENTARY_ECORE_CON
458 ecore_con_url_shutdown();
459 ecore_con_shutdown();
461 #ifdef HAVE_ELEMENTARY_ECORE_IMF
462 ecore_imf_shutdown();
464 ecore_evas_shutdown();
465 _elm_config_sub_shutdown();
466 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
467 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
468 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
469 ENGINE_COMPARE(ELM_XRENDER_X11) ||
470 ENGINE_COMPARE(ELM_OPENGL_X11) ||
471 ENGINE_COMPARE(ELM_SOFTWARE_SDL) ||
472 ENGINE_COMPARE(ELM_SOFTWARE_16_SDL) ||
473 ENGINE_COMPARE(ELM_OPENGL_SDL) ||
474 ENGINE_COMPARE(ELM_OPENGL_COCOA) ||
475 ENGINE_COMPARE(ELM_SOFTWARE_WIN32) ||
476 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE) ||
477 ENGINE_COMPARE(ELM_EWS))
478 #undef ENGINE_COMPARE
479 evas_cserve_disconnect();
483 return _elm_sub_init_count;
487 elm_quicklaunch_shutdown(void)
489 _elm_ql_init_count--;
490 if (_elm_ql_init_count > 0) return _elm_ql_init_count;
491 if (pfx) eina_prefix_free(pfx);
493 eina_stringshare_del(_elm_data_dir);
494 _elm_data_dir = NULL;
495 eina_stringshare_del(_elm_lib_dir);
501 _elm_config_shutdown();
503 ecore_event_handler_del(_elm_exit_handler);
504 _elm_exit_handler = NULL;
506 _elm_theme_shutdown();
507 _elm_unneed_efreet();
508 _elm_unneed_e_dbus();
509 _elm_unneed_ethumb();
511 ecore_file_shutdown();
513 #ifdef HAVE_ELEMENTARY_EMAP
520 if ((_elm_log_dom > -1) && (_elm_log_dom != EINA_LOG_DOMAIN_GLOBAL))
522 eina_log_domain_unregister(_elm_log_dom);
526 _elm_widget_type_clear();
529 return _elm_ql_init_count;
533 elm_quicklaunch_seed(void)
535 #ifndef SEMI_BROKEN_QUICKLAUNCH
538 Evas_Object *win, *bg, *bt;
540 win = elm_win_add(NULL, "seed", ELM_WIN_BASIC);
541 bg = elm_bg_add(win);
542 elm_win_resize_object_add(win, bg);
543 evas_object_show(bg);
544 bt = elm_button_add(win);
545 elm_object_text_set(bt, " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~-_=+\\|]}[{;:'\",<.>/?");
546 elm_win_resize_object_add(win, bt);
547 ecore_main_loop_iterate();
548 evas_object_del(win);
549 ecore_main_loop_iterate();
550 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
551 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
552 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
553 ENGINE_COMPARE(ELM_XRENDER_X11) ||
554 ENGINE_COMPARE(ELM_OPENGL_X11))
555 #undef ENGINE_COMPARE
557 # ifdef HAVE_ELEMENTARY_X
561 ecore_main_loop_iterate();
567 static void *qr_handle = NULL;
569 static int (*qr_main)(int argc,
573 elm_quicklaunch_prepare(int argc __UNUSED__,
577 char *exe = elm_quicklaunch_exe_path_get(argv[0]);
580 ERR("requested quicklaunch binary '%s' does not exist\n", argv[0]);
588 exe2 = malloc(strlen(exe) + 1 + 10);
590 p = strrchr(exe2, '/');
593 exename = alloca(strlen(p) + 1);
596 strcat(p, "../lib/");
599 if (!access(exe2, R_OK | X_OK))
607 qr_handle = dlopen(exe, RTLD_NOW | RTLD_GLOBAL);
610 fprintf(stderr, "dlerr: %s\n", dlerror());
611 WRN("dlopen('%s') failed: %s", exe, dlerror());
615 INF("dlopen('%s') = %p", exe, qr_handle);
616 qr_main = dlsym(qr_handle, "elm_main");
617 INF("dlsym(%p, 'elm_main') = %p", qr_handle, qr_main);
620 WRN("not quicklauncher capable: no elm_main in '%s'", exe);
639 extern char **environ;
644 for (i = 0, size = 0; environ[i]; i++)
645 size += strlen(environ[i]) + 1;
647 p = malloc((i + 1) * sizeof(char *));
652 for (i = 0; oldenv[i]; i++)
653 environ[i] = strdup(oldenv[i]);
660 elm_quicklaunch_fork(int argc,
663 void (postfork_func) (void *data),
673 // need to accept current environment from elementary_run
680 if (child > 0) return EINA_TRUE;
683 perror("could not fork");
688 perror("could not chdir");
689 args = alloca((argc + 1) * sizeof(char *));
690 for (i = 0; i < argc; i++) args[i] = argv[i];
692 WRN("%s not quicklaunch capable, fallback...", argv[0]);
693 execvp(argv[0], args);
694 ERR("failed to execute '%s': %s", argv[0], strerror(errno));
698 if (child > 0) return EINA_TRUE;
701 perror("could not fork");
704 if (postfork_func) postfork_func(postfork_data);
708 #ifdef SEMI_BROKEN_QUICKLAUNCH
709 ecore_app_args_set(argc, (const char **)argv);
712 _elm_config_sub_init();
713 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
714 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
715 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
716 ENGINE_COMPARE(ELM_XRENDER_X11) ||
717 ENGINE_COMPARE(ELM_OPENGL_X11))
718 #undef ENGINE_COMPARE
720 # ifdef HAVE_ELEMENTARY_X
724 ecore_evas_init(); // FIXME: check errors
732 perror("could not chdir");
733 // FIXME: this is very linux specific. it changes argv[0] of the process
734 // so ps etc. report what you'd expect. for other unixes and os's this
741 ecore_app_args_get(&real_argc, &real_argv);
742 lastarg = real_argv[real_argc - 1] + strlen(real_argv[real_argc - 1]);
743 for (p = real_argv[0]; p < lastarg; p++) *p = 0;
744 strcpy(real_argv[0], argv[0]);
746 ecore_app_args_set(argc, (const char **)argv);
747 ret = qr_main(argc, argv);
761 elm_quicklaunch_cleanup(void)
774 elm_quicklaunch_fallback(int argc,
778 elm_quicklaunch_init(argc, argv);
779 elm_quicklaunch_sub_init(argc, argv);
780 elm_quicklaunch_prepare(argc, argv);
781 ret = qr_main(argc, argv);
787 elm_quicklaunch_exe_path_get(const char *exe)
789 static char *path = NULL;
790 static Eina_List *pathlist = NULL;
794 if (exe[0] == '/') return strdup(exe);
795 if ((exe[0] == '.') && (exe[1] == '/')) return strdup(exe);
796 if ((exe[0] == '.') && (exe[1] == '.') && (exe[2] == '/')) return strdup(exe);
801 path = getenv("PATH");
802 buf2 = alloca(strlen(path) + 1);
807 if ((*p == ':') || (!*p))
812 strncpy(buf2, pp, len);
814 pathlist = eina_list_append(pathlist, eina_stringshare_add(buf2));
826 EINA_LIST_FOREACH(pathlist, l, pathitr)
828 snprintf(buf, sizeof(buf), "%s/%s", pathitr, exe);
829 if (!access(buf, R_OK | X_OK)) return strdup(buf);
837 ecore_main_loop_begin();
843 ecore_main_loop_quit();
847 elm_policy_set(unsigned int policy,
850 Elm_Event_Policy_Changed *ev;
852 if (policy >= ELM_POLICY_LAST)
855 if (value == _elm_policies[policy])
858 /* TODO: validade policy? */
860 ev = malloc(sizeof(*ev));
862 ev->new_value = value;
863 ev->old_value = _elm_policies[policy];
865 _elm_policies[policy] = value;
867 ecore_event_add(ELM_EVENT_POLICY_CHANGED, ev, NULL, NULL);
873 elm_policy_get(unsigned int policy)
875 if (policy >= ELM_POLICY_LAST)
877 return _elm_policies[policy];
881 elm_language_set(const char *lang)
883 setlocale(LC_ALL, lang);
884 _elm_win_translate();
888 elm_object_mirrored_get(const Evas_Object *obj)
890 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
891 return elm_widget_mirrored_get(obj);
895 elm_object_mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
897 EINA_SAFETY_ON_NULL_RETURN(obj);
898 elm_widget_mirrored_set(obj, mirrored);
902 elm_object_mirrored_automatic_get(const Evas_Object *obj)
904 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
905 return elm_widget_mirrored_automatic_get(obj);
909 elm_object_mirrored_automatic_set(Evas_Object *obj, Eina_Bool automatic)
911 EINA_SAFETY_ON_NULL_RETURN(obj);
912 elm_widget_mirrored_automatic_set(obj, automatic);
920 elm_object_scale_set(Evas_Object *obj,
923 EINA_SAFETY_ON_NULL_RETURN(obj);
924 elm_widget_scale_set(obj, scale);
928 elm_object_scale_get(const Evas_Object *obj)
930 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, 0.0);
931 return elm_widget_scale_get(obj);
935 elm_object_text_part_set(Evas_Object *obj, const char *part, const char *label)
937 EINA_SAFETY_ON_NULL_RETURN(obj);
938 elm_widget_text_part_set(obj, part, label);
942 elm_object_text_part_get(const Evas_Object *obj, const char *part)
944 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
945 return elm_widget_text_part_get(obj, part);
949 elm_object_part_text_set(Evas_Object *obj, const char *part, const char *label)
951 EINA_SAFETY_ON_NULL_RETURN(obj);
952 elm_widget_text_part_set(obj, part, label);
956 elm_object_part_text_get(const Evas_Object *obj, const char *part)
958 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
959 return elm_widget_text_part_get(obj, part);
963 elm_object_domain_translatable_text_part_set(Evas_Object *obj, const char *part, const char *domain, const char *text)
965 EINA_SAFETY_ON_NULL_RETURN(obj);
966 elm_widget_domain_translatable_text_part_set(obj, part, domain, text);
970 elm_object_translatable_text_part_get(const Evas_Object *obj, const char *part)
972 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
973 return elm_widget_translatable_text_part_get(obj, part);
977 elm_object_part_content_set(Evas_Object *obj, const char *part, Evas_Object *content)
979 EINA_SAFETY_ON_NULL_RETURN(obj);
980 elm_widget_content_part_set(obj, part, content);
984 elm_object_content_part_set(Evas_Object *obj, const char *part, Evas_Object *content)
986 EINA_SAFETY_ON_NULL_RETURN(obj);
987 elm_widget_content_part_set(obj, part, content);
992 elm_object_part_content_get(const Evas_Object *obj, const char *part)
994 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
995 return elm_widget_content_part_get(obj, part);
999 elm_object_content_part_get(const Evas_Object *obj, const char *part)
1001 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1002 return elm_widget_content_part_get(obj, part);
1006 elm_object_part_content_unset(Evas_Object *obj, const char *part)
1008 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1009 return elm_widget_content_part_unset(obj, part);
1014 elm_object_content_part_unset(Evas_Object *obj, const char *part)
1016 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1017 return elm_widget_content_part_unset(obj, part);
1021 elm_object_style_set(Evas_Object *obj,
1024 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1025 return elm_widget_style_set(obj, style);
1029 elm_object_style_get(const Evas_Object *obj)
1031 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1032 return elm_widget_style_get(obj);
1036 elm_object_disabled_set(Evas_Object *obj,
1039 EINA_SAFETY_ON_NULL_RETURN(obj);
1040 elm_widget_disabled_set(obj, disabled);
1044 elm_object_disabled_get(const Evas_Object *obj)
1046 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1047 return elm_widget_disabled_get(obj);
1051 elm_cache_all_flush(void)
1056 edje_file_cache_flush();
1057 edje_collection_cache_flush();
1059 EINA_LIST_FOREACH(_elm_win_list, l, obj)
1061 Evas *e = evas_object_evas_get(obj);
1062 evas_image_cache_flush(e);
1063 evas_font_cache_flush(e);
1064 evas_render_dump(e);
1068 EINA_DEPRECATED EAPI void
1071 elm_cache_all_flush();
1075 elm_object_focus_get(const Evas_Object *obj)
1077 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1078 return elm_widget_focus_get(obj);
1082 elm_object_focus_set(Evas_Object *obj,
1085 EINA_SAFETY_ON_NULL_RETURN(obj);
1087 if (focus == elm_widget_focus_get(obj)) return;
1090 elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
1092 elm_widget_focused_object_clear(obj);
1096 elm_object_focus_allow_set(Evas_Object *obj,
1099 EINA_SAFETY_ON_NULL_RETURN(obj);
1100 elm_widget_can_focus_set(obj, enable);
1101 /*FIXME: According to the elm_object_focus_allow_get(), child_can_focus field
1102 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() */
1106 elm_object_focus_allow_get(const Evas_Object *obj)
1108 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1109 return (elm_widget_can_focus_get(obj)) || (elm_widget_child_can_focus_get(obj));
1113 elm_object_focus_custom_chain_set(Evas_Object *obj,
1116 EINA_SAFETY_ON_NULL_RETURN(obj);
1117 elm_widget_focus_custom_chain_set(obj, objs);
1121 elm_object_focus_custom_chain_unset(Evas_Object *obj)
1123 EINA_SAFETY_ON_NULL_RETURN(obj);
1124 elm_widget_focus_custom_chain_unset(obj);
1127 EAPI const Eina_List *
1128 elm_object_focus_custom_chain_get(const Evas_Object *obj)
1130 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1131 return elm_widget_focus_custom_chain_get(obj);
1135 elm_object_focus_custom_chain_append(Evas_Object *obj,
1137 Evas_Object *relative_child)
1139 EINA_SAFETY_ON_NULL_RETURN(obj);
1140 elm_widget_focus_custom_chain_append(obj, child, relative_child);
1144 elm_object_focus_custom_chain_prepend(Evas_Object *obj,
1146 Evas_Object *relative_child)
1148 EINA_SAFETY_ON_NULL_RETURN(obj);
1149 elm_widget_focus_custom_chain_prepend(obj, child, relative_child);
1152 EINA_DEPRECATED EAPI void
1153 elm_object_focus_cycle(Evas_Object *obj,
1154 Elm_Focus_Direction dir)
1156 elm_object_focus_next(obj, dir);
1160 elm_object_focus_next(Evas_Object *obj,
1161 Elm_Focus_Direction dir)
1163 EINA_SAFETY_ON_NULL_RETURN(obj);
1164 elm_widget_focus_cycle(obj, dir);
1167 EINA_DEPRECATED EAPI void
1168 elm_object_tree_unfocusable_set(Evas_Object *obj,
1169 Eina_Bool unfocusable)
1171 elm_object_tree_focus_allow_set(obj, unfocusable);
1174 EINA_DEPRECATED EAPI Eina_Bool
1175 elm_object_tree_unfocusable_get(const Evas_Object *obj)
1177 return elm_object_tree_focus_allow_get(obj);
1181 elm_object_tree_focus_allow_set(Evas_Object *obj,
1182 Eina_Bool tree_focusable)
1184 EINA_SAFETY_ON_NULL_RETURN(obj);
1185 elm_widget_tree_unfocusable_set(obj, !tree_focusable);
1189 elm_object_tree_focus_allow_get(const Evas_Object *obj)
1191 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1192 return elm_widget_tree_unfocusable_get(obj);
1196 elm_object_scroll_hold_push(Evas_Object *obj)
1198 EINA_SAFETY_ON_NULL_RETURN(obj);
1199 elm_widget_scroll_hold_push(obj);
1203 elm_object_scroll_hold_pop(Evas_Object *obj)
1205 EINA_SAFETY_ON_NULL_RETURN(obj);
1206 elm_widget_scroll_hold_pop(obj);
1210 elm_object_scroll_freeze_push(Evas_Object *obj)
1212 EINA_SAFETY_ON_NULL_RETURN(obj);
1213 elm_widget_scroll_freeze_push(obj);
1217 elm_object_scroll_lock_x_set(Evas_Object *obj,
1220 EINA_SAFETY_ON_NULL_RETURN(obj);
1221 elm_widget_drag_lock_x_set(obj, lock);
1225 elm_object_scroll_lock_y_set(Evas_Object *obj,
1228 EINA_SAFETY_ON_NULL_RETURN(obj);
1229 elm_widget_drag_lock_y_set(obj, lock);
1233 elm_object_scroll_lock_x_get(const Evas_Object *obj)
1235 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1236 return elm_widget_drag_lock_x_get(obj);
1240 elm_object_scroll_lock_y_get(const Evas_Object *obj)
1242 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1243 return elm_widget_drag_lock_y_get(obj);
1247 elm_object_scroll_freeze_pop(Evas_Object *obj)
1249 EINA_SAFETY_ON_NULL_RETURN(obj);
1250 elm_widget_scroll_freeze_pop(obj);
1254 elm_object_widget_check(const Evas_Object *obj)
1256 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1257 return elm_widget_is(obj);
1261 elm_object_parent_widget_get(const Evas_Object *obj)
1263 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1264 return elm_widget_parent_widget_get(obj);
1268 elm_object_top_widget_get(const Evas_Object *obj)
1270 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1271 return elm_widget_top_get(obj);
1275 elm_object_widget_type_get(const Evas_Object *obj)
1277 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1278 return elm_widget_type_get(obj);
1282 elm_object_signal_emit(Evas_Object *obj,
1283 const char *emission,
1286 EINA_SAFETY_ON_NULL_RETURN(obj);
1287 elm_widget_signal_emit(obj, emission, source);
1291 elm_object_signal_callback_add(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data)
1293 EINA_SAFETY_ON_NULL_RETURN(obj);
1294 EINA_SAFETY_ON_NULL_RETURN(func);
1295 elm_widget_signal_callback_add(obj, emission, source, func, data);
1299 elm_object_signal_callback_del(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func)
1301 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1302 EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
1303 return elm_widget_signal_callback_del(obj, emission, source, func);
1307 elm_object_event_callback_add(Evas_Object *obj, Elm_Event_Cb func, const void *data)
1309 EINA_SAFETY_ON_NULL_RETURN(obj);
1310 EINA_SAFETY_ON_NULL_RETURN(func);
1311 elm_widget_event_callback_add(obj, func, data);
1315 elm_object_event_callback_del(Evas_Object *obj, Elm_Event_Cb func, const void *data)
1317 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1318 EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
1319 return elm_widget_event_callback_del(obj, func, data);
1323 elm_object_tree_dump(const Evas_Object *top)
1326 elm_widget_tree_dump(top);
1334 elm_object_tree_dot_dump(const Evas_Object *top,
1338 FILE *f = fopen(file, "wb");
1339 elm_widget_tree_dot_dump(top, f);
1349 elm_coords_finger_size_adjust(int times_w,
1354 if ((w) && (*w < (_elm_config->finger_size * times_w)))
1355 *w = _elm_config->finger_size * times_w;
1356 if ((h) && (*h < (_elm_config->finger_size * times_h)))
1357 *h = _elm_config->finger_size * times_h;
1361 elm_object_item_widget_get(const Elm_Object_Item *it)
1367 elm_object_item_content_part_set(Elm_Object_Item *it,
1369 Evas_Object *content)
1371 _elm_widget_item_content_part_set((Elm_Widget_Item *)it, part, content);
1375 elm_object_item_part_content_set(Elm_Object_Item *it,
1377 Evas_Object *content)
1379 _elm_widget_item_content_part_set((Elm_Widget_Item *)it, part, content);
1383 elm_object_item_content_part_get(const Elm_Object_Item *it,
1386 return _elm_widget_item_content_part_get((Elm_Widget_Item *)it, part);
1390 elm_object_item_part_content_get(const Elm_Object_Item *it,
1393 return _elm_widget_item_content_part_get((Elm_Widget_Item *)it, part);
1397 elm_object_item_content_part_unset(Elm_Object_Item *it, const char *part)
1399 return _elm_widget_item_content_part_unset((Elm_Widget_Item *)it, part);
1403 elm_object_item_part_content_unset(Elm_Object_Item *it, const char *part)
1405 return _elm_widget_item_content_part_unset((Elm_Widget_Item *)it, part);
1409 elm_object_item_text_part_set(Elm_Object_Item *it,
1413 _elm_widget_item_text_part_set((Elm_Widget_Item *)it, part, label);
1417 elm_object_item_part_text_set(Elm_Object_Item *it,
1421 _elm_widget_item_text_part_set((Elm_Widget_Item *)it, part, label);
1425 elm_object_item_text_part_get(const Elm_Object_Item *it, const char *part)
1427 return _elm_widget_item_text_part_get((Elm_Widget_Item *)it, part);
1431 elm_object_item_part_text_get(const Elm_Object_Item *it, const char *part)
1433 return _elm_widget_item_text_part_get((Elm_Widget_Item *)it, part);
1437 elm_object_access_info_set(Evas_Object *obj, const char *txt)
1439 elm_widget_access_info_set(obj, txt);
1443 elm_object_name_find(const Evas_Object *obj, const char *name, int recurse)
1445 return elm_widget_name_find(obj, name, recurse);
1449 elm_object_item_access_info_set(Elm_Object_Item *it, const char *txt)
1451 _elm_widget_item_access_info_set((Elm_Widget_Item *)it, txt);
1455 elm_object_item_data_get(const Elm_Object_Item *it)
1457 return elm_widget_item_data_get(it);
1461 elm_object_item_data_set(Elm_Object_Item *it, void *data)
1463 elm_widget_item_data_set(it, data);
1467 elm_object_item_signal_emit(Elm_Object_Item *it, const char *emission, const char *source)
1469 _elm_widget_item_signal_emit((Elm_Widget_Item *)it, emission, source);
1472 EAPI void elm_object_item_disabled_set(Elm_Object_Item *it, Eina_Bool disabled)
1474 _elm_widget_item_disabled_set((Elm_Widget_Item *)it, disabled);
1477 EAPI Eina_Bool elm_object_item_disabled_get(const Elm_Object_Item *it)
1479 return _elm_widget_item_disabled_get((Elm_Widget_Item *)it);
1482 EAPI void elm_object_item_del_cb_set(Elm_Object_Item *it, Evas_Smart_Cb del_cb)
1484 _elm_widget_item_del_cb_set((Elm_Widget_Item *)it, del_cb);
1487 EAPI void elm_object_item_del(Elm_Object_Item *it)
1489 _elm_widget_item_del((Elm_Widget_Item *)it);
1493 elm_object_item_tooltip_text_set(Elm_Object_Item *it, const char *text)
1495 elm_widget_item_tooltip_text_set(it, text);
1499 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)
1501 elm_widget_item_tooltip_content_cb_set(it, func, data, del_cb);
1505 elm_object_item_tooltip_unset(Elm_Object_Item *it)
1507 elm_widget_item_tooltip_unset(it);
1511 elm_object_item_tooltip_window_mode_set(Elm_Object_Item *it, Eina_Bool disable)
1513 return elm_widget_item_tooltip_window_mode_set(it, disable);
1517 elm_object_item_tooltip_window_mode_get(const Elm_Object_Item *it)
1519 return elm_widget_item_tooltip_window_mode_get(it);
1523 elm_object_item_tooltip_style_set(Elm_Object_Item *it, const char *style)
1525 elm_widget_item_tooltip_style_set(it, style);
1529 elm_object_item_tooltip_style_get(const Elm_Object_Item *it)
1531 return elm_widget_item_tooltip_style_get(it);
1535 elm_object_item_cursor_set(Elm_Object_Item *it, const char *cursor)
1537 elm_widget_item_cursor_set(it, cursor);
1541 elm_object_item_cursor_get(const Elm_Object_Item *it)
1543 return elm_widget_item_cursor_get(it);
1547 elm_object_item_cursor_unset(Elm_Object_Item *it)
1549 elm_widget_item_cursor_unset(it);
1553 elm_object_item_cursor_style_set(Elm_Object_Item *it, const char *style)
1555 elm_widget_item_cursor_style_set(it, style);
1559 elm_object_item_cursor_style_get(const Elm_Object_Item *it)
1561 return elm_widget_item_cursor_style_get(it);
1565 elm_object_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only)
1567 elm_widget_item_cursor_engine_only_set(it, engine_only);
1571 elm_object_item_cursor_engine_only_get(const Elm_Object_Item *it)
1573 return elm_widget_item_cursor_engine_only_get(it);
1577 elm_object_item_smart_callback_add(Elm_Object_Item *it, const char *event, Elm_Object_Item_Smart_Cb func, const void *data)
1579 elm_widget_item_smart_callback_add((Elm_Widget_Item *)it, event, func, data);
1583 elm_object_item_smart_callback_del(Elm_Object_Item *it, const char *event, Elm_Object_Item_Smart_Cb func)
1585 return elm_widget_item_smart_callback_del((Elm_Widget_Item *)it, event,