2 # include "elementary_config.h"
5 #include <dlfcn.h> /* dlopen,dlclose,etc */
7 #ifdef HAVE_CRT_EXTERNS_H
8 # include <crt_externs.h>
15 #include <Elementary.h>
18 #define SEMI_BROKEN_QUICKLAUNCH 1
20 static Elm_Version _version = { VMAJ, VMIN, VMIC, VREV };
21 EAPI Elm_Version *elm_version = &_version;
24 _elm_dangerous_call_check(const char *call)
29 snprintf(buf, sizeof(buf), "%i.%i.%i.%i", VMAJ, VMIN, VMIC, VREV);
30 eval = getenv("ELM_NO_FINGER_WAGGLING");
31 if ((eval) && (!strcmp(eval, buf)))
33 printf("ELEMENTARY FINGER WAGGLE!!!!!!!!!!\n"
36 "PLEASE see the API documentation for this function. This call\n"
37 "should almost never be used. Only in very special cases.\n"
39 "To remove this warning please set the environment variable:\n"
40 " ELM_NO_FINGER_WAGGLING\n"
41 "To the value of the Elementary version + revision number. e.g.:\n"
49 static Eina_Bool _elm_signal_exit(void *data,
53 static Eina_Prefix *pfx = NULL;
54 char *_elm_appname = NULL;
55 const char *_elm_data_dir = NULL;
56 const char *_elm_lib_dir = NULL;
57 int _elm_log_dom = -1;
59 EAPI int ELM_EVENT_POLICY_CHANGED = 0;
61 static int _elm_init_count = 0;
62 static int _elm_sub_init_count = 0;
63 static int _elm_ql_init_count = 0;
64 static int _elm_policies[ELM_POLICY_LAST];
65 static Ecore_Event_Handler *_elm_exit_handler = NULL;
66 static Eina_Bool quicklaunch_on = 0;
69 _elm_signal_exit(void *data __UNUSED__,
70 int ev_type __UNUSED__,
74 return ECORE_CALLBACK_PASS_ON;
80 edje_scale_set(_elm_config->scale);
81 _elm_win_rescale(NULL, EINA_FALSE);
84 static void *app_mainfunc = NULL;
85 static const char *app_domain = NULL;
86 static const char *app_checkfile = NULL;
88 static const char *app_compile_bin_dir = NULL;
89 static const char *app_compile_lib_dir = NULL;
90 static const char *app_compile_data_dir = NULL;
91 static const char *app_compile_locale_dir = NULL;
92 static const char *app_prefix_dir = NULL;
93 static const char *app_bin_dir = NULL;
94 static const char *app_lib_dir = NULL;
95 static const char *app_data_dir = NULL;
96 static const char *app_locale_dir = NULL;
98 static Eina_Prefix *app_pfx = NULL;
105 const char *dirs[4] = { NULL, NULL, NULL, NULL };
106 char *caps = NULL, *p1, *p2;
109 if (!app_domain) return;
111 ecore_app_args_get(&argc, &argv);
112 if (argc < 1) return;
114 dirs[0] = app_compile_bin_dir;
115 dirs[1] = app_compile_lib_dir;
116 dirs[2] = app_compile_data_dir;
117 dirs[3] = app_compile_locale_dir;
119 if (!dirs[1]) dirs[1] = dirs[0];
120 if (!dirs[0]) dirs[0] = dirs[1];
121 if (!dirs[3]) dirs[3] = dirs[2];
122 if (!dirs[2]) dirs[2] = dirs[3];
126 caps = alloca(strlen(app_domain) + 1);
127 for (p1 = (char *)app_domain, p2 = caps; *p1; p1++, p2++)
131 app_pfx = eina_prefix_new(argv[0], app_mainfunc, caps, app_domain,
132 app_checkfile, dirs[0], dirs[1], dirs[2], dirs[3]);
136 _prefix_shutdown(void)
138 if (app_pfx) eina_prefix_free(app_pfx);
139 if (app_domain) eina_stringshare_del(app_domain);
140 if (app_checkfile) eina_stringshare_del(app_checkfile);
141 if (app_compile_bin_dir) eina_stringshare_del(app_compile_bin_dir);
142 if (app_compile_lib_dir) eina_stringshare_del(app_compile_lib_dir);
143 if (app_compile_data_dir) eina_stringshare_del(app_compile_data_dir);
144 if (app_compile_locale_dir) eina_stringshare_del(app_compile_locale_dir);
145 if (app_prefix_dir) eina_stringshare_del(app_prefix_dir);
146 if (app_bin_dir) eina_stringshare_del(app_bin_dir);
147 if (app_lib_dir) eina_stringshare_del(app_lib_dir);
148 if (app_data_dir) eina_stringshare_del(app_data_dir);
149 if (app_locale_dir) eina_stringshare_del(app_locale_dir);
152 app_checkfile = NULL;
153 app_compile_bin_dir = NULL;
154 app_compile_lib_dir = NULL;
155 app_compile_data_dir = NULL;
156 app_compile_locale_dir = NULL;
157 app_prefix_dir = NULL;
161 app_locale_dir = NULL;
170 if (_elm_init_count > 1) return _elm_init_count;
171 elm_quicklaunch_init(argc, argv);
172 elm_quicklaunch_sub_init(argc, argv);
174 return _elm_init_count;
181 if (_elm_init_count > 0) return _elm_init_count;
183 while (_elm_win_deferred_free) ecore_main_loop_iterate();
185 // _prefix_shutdown();
186 elm_quicklaunch_sub_shutdown();
187 elm_quicklaunch_shutdown();
188 return _elm_init_count;
192 elm_app_info_set(void *mainfunc, const char *dom, const char *checkfile)
194 app_mainfunc = mainfunc;
195 eina_stringshare_replace(&app_domain, dom);
196 eina_stringshare_replace(&app_checkfile, checkfile);
200 elm_app_compile_bin_dir_set(const char *dir)
202 eina_stringshare_replace(&app_compile_bin_dir, dir);
206 elm_app_compile_lib_dir_set(const char *dir)
208 eina_stringshare_replace(&app_compile_lib_dir, dir);
212 elm_app_compile_data_dir_set(const char *dir)
214 eina_stringshare_replace(&app_compile_data_dir, dir);
218 elm_app_compile_locale_set(const char *dir)
220 eina_stringshare_replace(&app_compile_locale_dir, dir);
224 elm_app_prefix_dir_get(void)
226 if (app_prefix_dir) return app_prefix_dir;
228 if (!app_pfx) return "";
229 app_prefix_dir = eina_prefix_get(app_pfx);
230 return app_prefix_dir;
234 elm_app_bin_dir_get(void)
236 if (app_bin_dir) return app_bin_dir;
238 if (!app_pfx) return "";
239 app_bin_dir = eina_prefix_bin_get(app_pfx);
244 elm_app_lib_dir_get(void)
246 if (app_lib_dir) return app_lib_dir;
248 if (!app_pfx) return "";
249 app_lib_dir = eina_prefix_lib_get(app_pfx);
254 elm_app_data_dir_get(void)
256 if (app_data_dir) return app_data_dir;
258 if (!app_pfx) return "";
259 app_data_dir = eina_prefix_data_get(app_pfx);
264 elm_app_locale_dir_get(void)
266 if (app_locale_dir) return app_locale_dir;
268 if (!app_pfx) return "";
269 app_locale_dir = eina_prefix_locale_get(app_pfx);
270 return app_locale_dir;
274 static int _elm_need_e_dbus = 0;
277 elm_need_e_dbus(void)
280 if (_elm_need_e_dbus++) return EINA_TRUE;
289 _elm_unneed_e_dbus(void)
292 if (--_elm_need_e_dbus) return;
294 _elm_need_e_dbus = 0;
300 static int _elm_need_efreet = 0;
303 elm_need_efreet(void)
306 if (_elm_need_efreet++) return EINA_TRUE;
314 list = efreet_icon_extra_list_get();
317 e_user_dir_concat_static(buf, "icons");
318 *list = eina_list_prepend(*list, (void *)eina_stringshare_add(buf));
319 e_prefix_data_concat_static(buf, "data/icons");
320 *list = eina_list_prepend(*list, (void *)eina_stringshare_add(buf));
331 _elm_unneed_efreet(void)
334 if (--_elm_need_efreet) return;
336 _elm_need_efreet = 0;
337 efreet_trash_shutdown();
338 efreet_mime_shutdown();
344 elm_quicklaunch_mode_set(Eina_Bool ql_on)
346 quicklaunch_on = ql_on;
350 elm_quicklaunch_mode_get(void)
352 return quicklaunch_on;
356 elm_quicklaunch_init(int argc,
359 _elm_ql_init_count++;
360 if (_elm_ql_init_count > 1) return _elm_ql_init_count;
362 _elm_log_dom = eina_log_domain_register("elementary", EINA_COLOR_LIGHTBLUE);
365 EINA_LOG_ERR("could not register elementary log domain.");
366 _elm_log_dom = EINA_LOG_DOMAIN_GLOBAL;
372 #ifdef HAVE_ELEMENTARY_EMAP
375 ecore_app_args_set(argc, (const char **)argv);
377 memset(_elm_policies, 0, sizeof(_elm_policies));
378 if (!ELM_EVENT_POLICY_CHANGED)
379 ELM_EVENT_POLICY_CHANGED = ecore_event_type_new();
383 _elm_exit_handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _elm_signal_exit, NULL);
385 if (argv) _elm_appname = strdup(ecore_file_file_get(argv[0]));
387 pfx = eina_prefix_new(NULL, elm_quicklaunch_init,
388 "ELM", "elementary", "config/profile.cfg",
389 PACKAGE_LIB_DIR, /* don't have a bin dir currently */
395 _elm_data_dir = eina_stringshare_add(eina_prefix_data_get(pfx));
396 _elm_lib_dir = eina_stringshare_add(eina_prefix_lib_get(pfx));
398 if (!_elm_data_dir) _elm_data_dir = eina_stringshare_add("/");
399 if (!_elm_lib_dir) _elm_lib_dir = eina_stringshare_add("/");
402 return _elm_ql_init_count;
406 elm_quicklaunch_sub_init(int argc,
409 _elm_sub_init_count++;
410 if (_elm_sub_init_count > 1) return _elm_sub_init_count;
413 #ifdef SEMI_BROKEN_QUICKLAUNCH
414 return _elm_sub_init_count;
419 ecore_app_args_set(argc, (const char **)argv);
423 _elm_config_sub_init();
424 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
425 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
426 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
427 ENGINE_COMPARE(ELM_XRENDER_X11) ||
428 ENGINE_COMPARE(ELM_OPENGL_X11))
429 #undef ENGINE_COMPARE
431 #ifdef HAVE_ELEMENTARY_X
435 ecore_evas_init(); // FIXME: check errors
438 ecore_con_url_init();
440 return _elm_sub_init_count;
444 elm_quicklaunch_sub_shutdown(void)
446 _elm_sub_init_count--;
447 if (_elm_sub_init_count > 0) return _elm_sub_init_count;
450 #ifdef SEMI_BROKEN_QUICKLAUNCH
451 return _elm_sub_init_count;
457 _elm_module_shutdown();
458 ecore_con_url_shutdown();
459 ecore_con_shutdown();
460 ecore_imf_shutdown();
461 ecore_evas_shutdown();
462 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
463 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
464 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
465 ENGINE_COMPARE(ELM_XRENDER_X11) ||
466 ENGINE_COMPARE(ELM_OPENGL_X11))
467 #undef ENGINE_COMPARE
469 #ifdef HAVE_ELEMENTARY_X
470 ecore_x_disconnect();
473 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
474 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
475 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
476 ENGINE_COMPARE(ELM_XRENDER_X11) ||
477 ENGINE_COMPARE(ELM_OPENGL_X11) ||
478 ENGINE_COMPARE(ELM_SOFTWARE_SDL) ||
479 ENGINE_COMPARE(ELM_SOFTWARE_16_SDL) ||
480 ENGINE_COMPARE(ELM_OPENGL_SDL) ||
481 ENGINE_COMPARE(ELM_SOFTWARE_WIN32) ||
482 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
483 #undef ENGINE_COMPARE
484 evas_cserve_disconnect();
488 return _elm_sub_init_count;
492 elm_quicklaunch_shutdown(void)
494 _elm_ql_init_count--;
495 if (_elm_ql_init_count > 0) return _elm_ql_init_count;
496 if (pfx) eina_prefix_free(pfx);
498 eina_stringshare_del(_elm_data_dir);
499 _elm_data_dir = NULL;
500 eina_stringshare_del(_elm_lib_dir);
506 _elm_config_shutdown();
508 ecore_event_handler_del(_elm_exit_handler);
509 _elm_exit_handler = NULL;
511 _elm_theme_shutdown();
512 _elm_unneed_efreet();
513 _elm_unneed_e_dbus();
514 _elm_unneed_ethumb();
515 ecore_file_shutdown();
517 #ifdef HAVE_ELEMENTARY_EMAP
524 if ((_elm_log_dom > -1) && (_elm_log_dom != EINA_LOG_DOMAIN_GLOBAL))
526 eina_log_domain_unregister(_elm_log_dom);
530 _elm_widget_type_clear();
533 return _elm_ql_init_count;
537 elm_quicklaunch_seed(void)
539 #ifndef SEMI_BROKEN_QUICKLAUNCH
542 Evas_Object *win, *bg, *bt;
544 win = elm_win_add(NULL, "seed", ELM_WIN_BASIC);
545 bg = elm_bg_add(win);
546 elm_win_resize_object_add(win, bg);
547 evas_object_show(bg);
548 bt = elm_button_add(win);
549 elm_button_label_set(bt, " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~-_=+\\|]}[{;:'\",<.>/?");
550 elm_win_resize_object_add(win, bt);
551 ecore_main_loop_iterate();
552 evas_object_del(win);
553 ecore_main_loop_iterate();
554 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
555 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
556 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
557 ENGINE_COMPARE(ELM_XRENDER_X11) ||
558 ENGINE_COMPARE(ELM_OPENGL_X11))
559 #undef ENGINE_COMPARE
561 # ifdef HAVE_ELEMENTARY_X
565 ecore_main_loop_iterate();
570 static void *qr_handle = NULL;
571 static int (*qr_main)(int argc,
575 elm_quicklaunch_prepare(int argc __UNUSED__,
579 char *exe = elm_quicklaunch_exe_path_get(argv[0]);
582 ERR("requested quicklaunch binary '%s' does not exist\n", argv[0]);
590 exe2 = malloc(strlen(exe) + 1 + 10);
592 p = strrchr(exe2, '/');
595 exename = alloca(strlen(p) + 1);
598 strcat(p, "../lib/");
601 if (!access(exe2, R_OK | X_OK))
609 qr_handle = dlopen(exe, RTLD_NOW | RTLD_GLOBAL);
612 fprintf(stderr, "dlerr: %s\n", dlerror());
613 WRN("dlopen('%s') failed: %s", exe, dlerror());
617 INF("dlopen('%s') = %p", exe, qr_handle);
618 qr_main = dlsym(qr_handle, "elm_main");
619 INF("dlsym(%p, 'elm_main') = %p", qr_handle, qr_main);
622 WRN("not quicklauncher capable: no elm_main in '%s'", exe);
641 extern char **environ;
646 for (i = 0, size = 0; environ[i]; i++)
647 size += strlen(environ[i]) + 1;
649 p = malloc((i + 1) * sizeof(char *));
654 for (i = 0; oldenv[i]; i++)
655 environ[i] = strdup(oldenv[i]);
662 elm_quicklaunch_fork(int argc,
665 void (postfork_func) (void *data),
675 // need to accept current environment from elementary_run
682 if (child > 0) return EINA_TRUE;
685 perror("could not fork");
690 perror("could not chdir");
691 args = alloca((argc + 1) * sizeof(char *));
692 for (i = 0; i < argc; i++) args[i] = argv[i];
694 WRN("%s not quicklaunch capable, fallback...", argv[0]);
695 execvp(argv[0], args);
696 ERR("failed to execute '%s': %s", argv[0], strerror(errno));
700 if (child > 0) return EINA_TRUE;
703 perror("could not fork");
706 if (postfork_func) postfork_func(postfork_data);
710 #ifdef SEMI_BROKEN_QUICKLAUNCH
711 ecore_app_args_set(argc, (const char **)argv);
714 _elm_config_sub_init();
715 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
716 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
717 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
718 ENGINE_COMPARE(ELM_XRENDER_X11) ||
719 ENGINE_COMPARE(ELM_OPENGL_X11))
720 #undef ENGINE_COMPARE
722 # ifdef HAVE_ELEMENTARY_X
726 ecore_evas_init(); // FIXME: check errors
734 perror("could not chdir");
735 // FIXME: this is very linux specific. it changes argv[0] of the process
736 // so ps etc. report what you'd expect. for other unixes and os's this
743 ecore_app_args_get(&real_argc, &real_argv);
744 lastarg = real_argv[real_argc - 1] + strlen(real_argv[real_argc - 1]);
745 for (p = real_argv[0]; p < lastarg; p++) *p = 0;
746 strcpy(real_argv[0], argv[0]);
748 ecore_app_args_set(argc, (const char **)argv);
749 ret = qr_main(argc, argv);
763 elm_quicklaunch_cleanup(void)
776 elm_quicklaunch_fallback(int argc,
780 elm_quicklaunch_init(argc, argv);
781 elm_quicklaunch_sub_init(argc, argv);
782 elm_quicklaunch_prepare(argc, argv);
783 ret = qr_main(argc, argv);
789 elm_quicklaunch_exe_path_get(const char *exe)
791 static char *path = NULL;
792 static Eina_List *pathlist = NULL;
796 if (exe[0] == '/') return strdup(exe);
797 if ((exe[0] == '.') && (exe[1] == '/')) return strdup(exe);
798 if ((exe[0] == '.') && (exe[1] == '.') && (exe[2] == '/')) return strdup(exe);
803 path = getenv("PATH");
804 buf2 = alloca(strlen(path) + 1);
809 if ((*p == ':') || (!*p))
814 strncpy(buf2, pp, len);
816 pathlist = eina_list_append(pathlist, eina_stringshare_add(buf2));
828 EINA_LIST_FOREACH(pathlist, l, pathitr)
830 snprintf(buf, sizeof(buf), "%s/%s", pathitr, exe);
831 if (!access(buf, R_OK | X_OK)) return strdup(buf);
839 ecore_main_loop_begin();
845 ecore_main_loop_quit();
849 elm_policy_set(unsigned int policy,
852 Elm_Event_Policy_Changed *ev;
854 if (policy >= ELM_POLICY_LAST)
857 if (value == _elm_policies[policy])
860 /* TODO: validade policy? */
862 ev = malloc(sizeof(*ev));
864 ev->new_value = value;
865 ev->old_value = _elm_policies[policy];
867 _elm_policies[policy] = value;
869 ecore_event_add(ELM_EVENT_POLICY_CHANGED, ev, NULL, NULL);
875 elm_policy_get(unsigned int policy)
877 if (policy >= ELM_POLICY_LAST)
879 return _elm_policies[policy];
883 * @defgroup UI-Mirroring Selective Widget mirroring
885 * These functions allow you to set ui-mirroring on specific widgets or the
886 * whole interface. Widgets can be in one of two modes, automatic and manual.
887 * Automatic means they'll be changed according to the system mirroring mode
888 * and manual means only explicit changes will matter. You are not supposed to
889 * change mirroring state of a widget set to automatic, will mostly work, but
890 * the behavior is not really defined.
894 * Returns the widget's mirrored mode.
896 * @param obj The widget.
897 * @return mirrored mode of the object.
901 elm_object_mirrored_get(const Evas_Object *obj)
903 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
904 return elm_widget_mirrored_get(obj);
908 * Sets the widget's mirrored mode.
910 * @param obj The widget.
911 * @param mirrored EINA_TRUE to set mirrored mode. EINA_FALSE to unset.
914 elm_object_mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
916 EINA_SAFETY_ON_NULL_RETURN(obj);
917 elm_widget_mirrored_set(obj, mirrored);
921 * Returns the widget's mirrored mode setting.
923 * @param obj The widget.
924 * @return mirrored mode setting of the object.
928 elm_object_mirrored_automatic_get(const Evas_Object *obj)
930 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
931 return elm_widget_mirrored_automatic_get(obj);
935 * Sets the widget's mirrored mode setting.
936 * When widget in automatic mode, it follows the system mirrored mode set by
937 * elm_mirrored_set().
938 * @param obj The widget.
939 * @param automatic EINA_TRUE for auto mirrored mode. EINA_FALSE for manual.
942 elm_object_mirrored_automatic_set(Evas_Object *obj, Eina_Bool automatic)
944 EINA_SAFETY_ON_NULL_RETURN(obj);
945 elm_widget_mirrored_automatic_set(obj, automatic);
949 elm_object_scale_set(Evas_Object *obj,
952 EINA_SAFETY_ON_NULL_RETURN(obj);
953 elm_widget_scale_set(obj, scale);
957 elm_object_scale_get(const Evas_Object *obj)
959 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, 0.0);
960 return elm_widget_scale_get(obj);
964 elm_object_text_part_set(Evas_Object *obj, const char *part, const char *label)
966 EINA_SAFETY_ON_NULL_RETURN(obj);
967 elm_widget_text_part_set(obj, part, label);
971 elm_object_text_part_get(const Evas_Object *obj, const char *part)
973 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
974 return elm_widget_text_part_get(obj, part);
978 elm_object_content_part_set(Evas_Object *obj, const char *part, Evas_Object *content)
980 EINA_SAFETY_ON_NULL_RETURN(obj);
981 elm_widget_content_part_set(obj, part, content);
985 elm_object_content_part_get(const Evas_Object *obj, const char *part)
987 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
988 return elm_widget_content_part_get(obj, part);
992 elm_object_content_part_unset(Evas_Object *obj, const char *part)
994 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
995 return elm_widget_content_part_unset(obj, part);
999 * Get the global scaling factor
1001 * This gets the globally configured scaling factor that is applied to all
1004 * @return The scaling factor
1010 return _elm_config->scale;
1014 * Set the global scaling factor
1016 * This sets the globally configured scaling factor that is applied to all
1019 * @param scale The scaling factor to set
1023 elm_scale_set(double scale)
1025 if (_elm_config->scale == scale) return;
1026 _elm_config->scale = scale;
1031 * Set the global scaling factor for all applications on the display
1033 * This sets the globally configured scaling factor that is applied to all
1034 * objects for all applications.
1035 * @param scale The scaling factor to set
1039 elm_scale_all_set(double scale)
1041 #ifdef HAVE_ELEMENTARY_X
1042 static Ecore_X_Atom atom = 0;
1043 unsigned int scale_i = (unsigned int)(scale * 1000.0);
1045 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_SCALE");
1046 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
1052 elm_object_style_set(Evas_Object *obj,
1055 EINA_SAFETY_ON_NULL_RETURN(obj);
1056 elm_widget_style_set(obj, style);
1060 elm_object_style_get(const Evas_Object *obj)
1062 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1063 return elm_widget_style_get(obj);
1067 elm_object_disabled_set(Evas_Object *obj,
1070 EINA_SAFETY_ON_NULL_RETURN(obj);
1071 elm_widget_disabled_set(obj, disabled);
1075 elm_object_disabled_get(const Evas_Object *obj)
1077 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1078 return elm_widget_disabled_get(obj);
1082 * @defgroup Config Elementary Config
1084 * Elementary configuration is formed by a set options bounded to a
1085 * given @ref Profile profile, like @ref Theme theme, @ref Fingers
1086 * "finger size", etc. These are functions with which one syncronizes
1087 * changes made to those values to the configuration storing files, de
1088 * facto. You most probably don't want to use the functions in this
1089 * group unlees you're writing an elementary configuration manager.
1093 * Save back Elementary's configuration, so that it will persist on
1096 * @return @c EINA_TRUE, when sucessful. @c EINA_FALSE, otherwise.
1099 * This function will take effect -- thus, do I/O -- immediately. Use
1100 * it when you want to apply all configuration changes at once. The
1101 * current configuration set will get saved onto the current profile
1102 * configuration file.
1106 elm_config_save(void)
1108 return _elm_config_save();
1112 * Reload Elementary's configuration, bounded to current selected
1115 * @return @c EINA_TRUE, when sucessful. @c EINA_FALSE, otherwise.
1118 * Useful when you want to force reloading of configuration values for
1119 * a profile. If one removes user custom configuration directories,
1120 * for example, it will force a reload with system values insted.
1124 elm_config_reload(void)
1126 _elm_config_reload();
1130 * @defgroup Profile Elementary Profile
1132 * Profiles are pre-set options that affect the whole look-and-feel of
1133 * Elementary-based applications. There are, for example, profiles
1134 * aimed at desktop computer applications and others aimed at mobile,
1135 * touchscreen-based ones. You most probably don't want to use the
1136 * functions in this group unlees you're writing an elementary
1137 * configuration manager.
1141 * Get Elementary's profile in use.
1143 * This gets the global profile that is applied to all Elementary
1146 * @return The profile's name
1150 elm_profile_current_get(void)
1152 return _elm_config_current_profile_get();
1156 * Get an Elementary's profile directory path in the filesystem. One
1157 * may want to fetch a system profile's dir or an user one (fetched
1160 * @param profile The profile's name
1161 * @param is_user Whether to lookup for an user profile (@c EINA_TRUE)
1162 * or a system one (@c EINA_FALSE)
1163 * @return The profile's directory path.
1166 * @note You must free it with elm_profile_dir_free().
1169 elm_profile_dir_get(const char *profile,
1172 return _elm_config_profile_dir_get(profile, is_user);
1176 * Free an Elementary's profile directory path, as returned by
1177 * elm_profile_dir_get().
1179 * @param p_dir The profile's path
1184 elm_profile_dir_free(const char *p_dir)
1186 free((void *)p_dir);
1190 * Get Elementary's list of available profiles.
1192 * @return The profiles list. List node data are the profile name
1196 * @note One must free this list, after usage, with the function
1197 * elm_profile_list_free().
1200 elm_profile_list_get(void)
1202 return _elm_config_profiles_list();
1206 * Free Elementary's list of available profiles.
1208 * @param The profiles list, as returned by elm_profile_list_get().
1213 elm_profile_list_free(Eina_List *l)
1217 EINA_LIST_FREE(l, dir)
1218 eina_stringshare_del(dir);
1222 * Set Elementary's profile.
1224 * This sets the global profile that is applied to Elementary
1225 * applications. Just the process the call comes from will be
1228 * @param profile The profile's name
1233 elm_profile_set(const char *profile)
1235 EINA_SAFETY_ON_NULL_RETURN(profile);
1236 _elm_config_profile_set(profile);
1240 * Set Elementary's profile.
1242 * This sets the global profile that is applied to all Elementary
1243 * applications. All running Elementary windows will be affected.
1245 * @param profile The profile's name
1250 elm_profile_all_set(const char *profile)
1252 #ifdef HAVE_ELEMENTARY_X
1253 static Ecore_X_Atom atom = 0;
1255 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_PROFILE");
1256 ecore_x_window_prop_string_set(ecore_x_window_root_first_get(),
1262 * @defgroup Engine Elementary Engine
1264 * These are functions setting and querying which rendering engine
1265 * Elementary will use for drawing its windows' pixels.
1269 * Get Elementary's rendering engine in use.
1271 * This gets the global rendering engine that is applied to all
1272 * Elementary applications.
1274 * @return The rendering engine's name
1277 * @note there's no need to free the returned string, here.
1280 elm_engine_current_get(void)
1282 return _elm_config->engine;
1286 * Set Elementary's rendering engine for use.
1288 * This gets sets global rendering engine that is applied to all
1289 * Elementary applications. Note that it will take effect only to
1290 * subsequent Elementary window creations.
1292 * @param The rendering engine's name
1295 * @note there's no need to free the returned string, here.
1298 elm_engine_set(const char *engine)
1300 EINA_SAFETY_ON_NULL_RETURN(engine);
1302 _elm_config_engine_set(engine);
1306 * @defgroup Fonts Elementary Fonts
1308 * These are functions dealing with font rendering, selection and the
1309 * like for Elementary applications. One might fetch which system
1310 * fonts are there to use and set custom fonts for individual classes
1311 * of UI items containing text (text classes).
1315 * Get Elementary's list of supported text classes.
1317 * @return The text classes list, with @c Elm_Text_Class blobs as data.
1320 * Release the list with elm_text_classes_list_free().
1322 EAPI const Eina_List *
1323 elm_text_classes_list_get(void)
1325 return _elm_config_text_classes_get();
1329 * Free Elementary's list of supported text classes.
1333 * @see elm_text_classes_list_get().
1336 elm_text_classes_list_free(const Eina_List *list)
1338 _elm_config_text_classes_free((Eina_List *)list);
1342 * Get Elementary's list of font overlays, set with
1343 * elm_font_overlay_set().
1345 * @return The font overlays list, with @c Elm_Font_Overlay blobs as
1350 * For each text class, one can set a <b>font overlay</b> for it,
1351 * overriding the default font properties for that class coming from
1352 * the theme in use. There is no need to free this list.
1354 * @see elm_font_overlay_set() and elm_font_overlay_unset().
1356 EAPI const Eina_List *
1357 elm_font_overlay_list_get(void)
1359 return _elm_config_font_overlays_list();
1363 * Set a font overlay for a given Elementary text class.
1365 * @param text_class Text class name
1366 * @param font Font name and style string
1367 * @param size Font size
1371 * @p font has to be in the format returned by
1372 * elm_font_fontconfig_name_get(). @see elm_font_overlay_list_get()
1373 * and elm_font_overlay_unset().
1376 elm_font_overlay_set(const char *text_class,
1378 Evas_Font_Size size)
1380 _elm_config_font_overlay_set(text_class, font, size);
1384 * Unset a font overlay for a given Elementary text class.
1386 * @param text_class Text class name
1390 * This will bring back text elements belonging to text class @p
1391 * text_class back to their default font settings.
1394 elm_font_overlay_unset(const char *text_class)
1396 _elm_config_font_overlay_remove(text_class);
1400 * Apply the changes made with elm_font_overlay_set() and
1401 * elm_font_overlay_unset() on the current Elementary window.
1405 * This applies all font overlays set to all objects in the UI.
1408 elm_font_overlay_apply(void)
1410 _elm_config_font_overlay_apply();
1414 * Apply the changes made with elm_font_overlay_set() and
1415 * elm_font_overlay_unset() on all Elementary application windows.
1419 * This applies all font overlays set to all objects in the UI.
1422 elm_font_overlay_all_apply(void)
1424 #ifdef HAVE_ELEMENTARY_X
1425 static Ecore_X_Atom atom = 0;
1426 unsigned int dummy = (unsigned int)(1 * 1000.0);
1428 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_FONT_OVERLAY");
1429 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(), atom, &dummy,
1435 * Translate a font (family) name string in fontconfig's font names
1436 * syntax into an @c Elm_Font_Properties struct.
1438 * @param font The font name and styles string
1439 * @return the font properties struct
1443 * @note The reverse translation can be achived with
1444 * elm_font_fontconfig_name_get(), for one style only (single font
1445 * instance, not family).
1447 EAPI Elm_Font_Properties *
1448 elm_font_properties_get(const char *font)
1450 EINA_SAFETY_ON_NULL_RETURN_VAL(font, NULL);
1451 return _elm_font_properties_get(NULL, font);
1455 * Free font properties return by elm_font_properties_get().
1457 * @param efp the font properties struct
1462 elm_font_properties_free(Elm_Font_Properties *efp)
1466 EINA_SAFETY_ON_NULL_RETURN(efp);
1467 EINA_LIST_FREE(efp->styles, str)
1468 if (str) eina_stringshare_del(str);
1469 if (efp->name) eina_stringshare_del(efp->name);
1474 * Translate a font name, bound to a style, into fontconfig's font names
1477 * @param name The font (family) name
1478 * @param style The given style (may be @c NULL)
1480 * @return the font name and style string
1484 * @note The reverse translation can be achived with
1485 * elm_font_properties_get(), for one style only (single font
1486 * instance, not family).
1489 elm_font_fontconfig_name_get(const char *name,
1494 EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
1495 if (!style || style[0] == 0) return eina_stringshare_add(name);
1496 snprintf(buf, 256, "%s" ELM_FONT_TOKEN_STYLE "%s", name, style);
1497 return eina_stringshare_add(buf);
1501 * Free the font string return by elm_font_fontconfig_name_get().
1503 * @param efp the font properties struct
1508 elm_font_fontconfig_name_free(const char *name)
1510 eina_stringshare_del(name);
1514 * Create a font hash table of available system fonts.
1516 * One must call it with @p list being the return value of
1517 * evas_font_available_list(). The hash will be indexed by font
1518 * (family) names, being its values @c Elm_Font_Properties blobs.
1520 * @param list The list of available system fonts, as returned by
1521 * evas_font_available_list().
1522 * @return the font hash.
1526 * @note The user is supposed to get it populated at least with 3
1527 * default font families (Sans, Serif, Monospace), which should be
1528 * present on most systems.
1531 elm_font_available_hash_add(Eina_List *list)
1533 Eina_Hash *font_hash;
1539 /* populate with default font families */
1540 font_hash = _elm_font_available_hash_add(font_hash, "Sans:style=Regular");
1541 font_hash = _elm_font_available_hash_add(font_hash, "Sans:style=Bold");
1542 font_hash = _elm_font_available_hash_add(font_hash, "Sans:style=Oblique");
1543 font_hash = _elm_font_available_hash_add(font_hash,
1544 "Sans:style=Bold Oblique");
1546 font_hash = _elm_font_available_hash_add(font_hash, "Serif:style=Regular");
1547 font_hash = _elm_font_available_hash_add(font_hash, "Serif:style=Bold");
1548 font_hash = _elm_font_available_hash_add(font_hash, "Serif:style=Oblique");
1549 font_hash = _elm_font_available_hash_add(font_hash,
1550 "Serif:style=Bold Oblique");
1552 font_hash = _elm_font_available_hash_add(font_hash,
1553 "Monospace:style=Regular");
1554 font_hash = _elm_font_available_hash_add(font_hash,
1555 "Monospace:style=Bold");
1556 font_hash = _elm_font_available_hash_add(font_hash,
1557 "Monospace:style=Oblique");
1558 font_hash = _elm_font_available_hash_add(font_hash,
1559 "Monospace:style=Bold Oblique");
1561 EINA_LIST_FOREACH(list, l, key)
1562 font_hash = _elm_font_available_hash_add(font_hash, key);
1568 * Free the hash return by elm_font_available_hash_add().
1570 * @param hash the hash to be freed.
1575 elm_font_available_hash_del(Eina_Hash *hash)
1577 _elm_font_available_hash_del(hash);
1581 elm_finger_size_get(void)
1583 return _elm_config->finger_size;
1587 * Set the configured finger size
1589 * This sets the globally configured finger size in pixels
1591 * @param size The finger size
1595 elm_finger_size_set(Evas_Coord size)
1597 if (_elm_config->finger_size == size) return;
1598 _elm_config->finger_size = size;
1603 * Set the configured finger size for all applications on the display
1605 * This sets the globally configured finger size in pixels for all applications
1608 * @param size The finger size
1612 elm_finger_size_all_set(Evas_Coord size)
1614 #ifdef HAVE_ELEMENTARY_X
1615 static Ecore_X_Atom atom = 0;
1616 unsigned int size_i = (unsigned int)size;
1618 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_FINGER_SIZE");
1619 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
1625 elm_coords_finger_size_adjust(int times_w,
1630 if ((w) && (*w < (_elm_config->finger_size * times_w)))
1631 *w = _elm_config->finger_size * times_w;
1632 if ((h) && (*h < (_elm_config->finger_size * times_h)))
1633 *h = _elm_config->finger_size * times_h;
1637 * @defgroup Caches Caches
1639 * These are functions which let one fine-tune some cache values for
1640 * Elementary applications, thus allowing for performance adjustments.
1644 * Flush all caches & dump all data that can be to lean down to use
1655 edje_file_cache_flush();
1656 edje_collection_cache_flush();
1658 EINA_LIST_FOREACH(_elm_win_list, l, obj)
1660 Evas *e = evas_object_evas_get(obj);
1661 evas_image_cache_flush(e);
1662 evas_font_cache_flush(e);
1663 evas_render_dump(e);
1668 * Get the configured cache flush interval time
1670 * This gets the globally configured cache flush interval time, in
1673 * @return The cache flush interval time
1676 * @see elm_all_flush()
1679 elm_cache_flush_interval_get(void)
1681 return _elm_config->cache_flush_poll_interval;
1685 * Set the configured cache flush interval time
1687 * This sets the globally configured cache flush interval time, in ticks
1689 * @param size The cache flush interval time
1692 * @see elm_all_flush()
1695 elm_cache_flush_interval_set(int size)
1697 if (_elm_config->cache_flush_poll_interval == size) return;
1698 _elm_config->cache_flush_poll_interval = size;
1704 * Set the configured cache flush interval time for all applications on the
1707 * This sets the globally configured cache flush interval time -- in ticks
1708 * -- for all applications on the display.
1710 * @param size The cache flush interval time
1714 elm_cache_flush_interval_all_set(int size)
1716 #ifdef HAVE_ELEMENTARY_X
1717 static Ecore_X_Atom atom = 0;
1718 unsigned int size_i = (unsigned int)size;
1720 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_CACHE_FLUSH_INTERVAL");
1721 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
1727 * Get the configured cache flush enabled state
1729 * This gets the globally configured cache flush state - if it is enabled
1730 * or not. When cache flushing is enabled, elementary will regularly
1731 * (see elm_cache_flush_interval_get() ) flush caches and dump data out of
1732 * memory and allow usage to re-seed caches and data in memory where it
1733 * can do so. An idle application will thus minimise its memory usage as
1734 * data will be freed from memory and not be re-loaded as it is idle and
1735 * not rendering or doing anything graphically right now.
1737 * @return The cache flush state
1740 * @see elm_all_flush()
1743 elm_cache_flush_enabled_get(void)
1745 return _elm_config->cache_flush_enable;
1749 * Set the configured cache flush enabled state
1751 * This sets the globally configured cache flush enabled state
1753 * @param size The cache flush enabled state
1756 * @see elm_all_flush()
1759 elm_cache_flush_enabled_set(Eina_Bool enabled)
1761 enabled = !!enabled;
1762 if (_elm_config->cache_flush_enable == enabled) return;
1763 _elm_config->cache_flush_enable = enabled;
1769 * Set the configured cache flush enabled state for all applications on the
1772 * This sets the globally configured cache flush enabled state for all
1773 * applications on the display.
1775 * @param size The cache flush enabled state
1779 elm_cache_flush_enabled_all_set(Eina_Bool enabled)
1781 #ifdef HAVE_ELEMENTARY_X
1782 static Ecore_X_Atom atom = 0;
1783 unsigned int enabled_i = (unsigned int)enabled;
1785 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_CACHE_FLUSH_ENABLE");
1786 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
1787 atom, &enabled_i, 1);
1792 * Get the configured font cache size
1794 * This gets the globally configured font cache size, in bytes
1796 * @return The font cache size
1800 elm_font_cache_get(void)
1802 return _elm_config->font_cache;
1806 * Set the configured font cache size
1808 * This sets the globally configured font cache size, in bytes
1810 * @param size The font cache size
1814 elm_font_cache_set(int size)
1816 if (_elm_config->font_cache == size) return;
1817 _elm_config->font_cache = size;
1823 * Set the configured font cache size for all applications on the
1826 * This sets the globally configured font cache size -- in bytes
1827 * -- for all applications on the display.
1829 * @param size The font cache size
1833 elm_font_cache_all_set(int size)
1835 #ifdef HAVE_ELEMENTARY_X
1836 static Ecore_X_Atom atom = 0;
1837 unsigned int size_i = (unsigned int)size;
1839 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_FONT_CACHE");
1840 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
1846 * Get the configured image cache size
1848 * This gets the globally configured image cache size, in bytes
1850 * @return The image cache size
1854 elm_image_cache_get(void)
1856 return _elm_config->image_cache;
1860 * Set the configured image cache size
1862 * This sets the globally configured image cache size, in bytes
1864 * @param size The image cache size
1868 elm_image_cache_set(int size)
1870 if (_elm_config->image_cache == size) return;
1871 _elm_config->image_cache = size;
1877 * Set the configured image cache size for all applications on the
1880 * This sets the globally configured image cache size -- in bytes
1881 * -- for all applications on the display.
1883 * @param size The image cache size
1887 elm_image_cache_all_set(int size)
1889 #ifdef HAVE_ELEMENTARY_X
1890 static Ecore_X_Atom atom = 0;
1891 unsigned int size_i = (unsigned int)size;
1893 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_IMAGE_CACHE");
1894 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
1900 * Get the configured edje file cache size.
1902 * This gets the globally configured edje file cache size, in number
1905 * @return The edje file cache size
1909 elm_edje_file_cache_get(void)
1911 return _elm_config->edje_cache;
1915 * Set the configured edje file cache size
1917 * This sets the globally configured edje file cache size, in number
1920 * @param size The edje file cache size
1924 elm_edje_file_cache_set(int size)
1926 if (_elm_config->edje_cache == size) return;
1927 _elm_config->edje_cache = size;
1933 * Set the configured edje file cache size for all applications on the
1936 * This sets the globally configured edje file cache size -- in number
1937 * of files -- for all applications on the display.
1939 * @param size The edje file cache size
1943 elm_edje_file_cache_all_set(int size)
1945 #ifdef HAVE_ELEMENTARY_X
1946 static Ecore_X_Atom atom = 0;
1947 unsigned int size_i = (unsigned int)size;
1949 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_EDJE_FILE_CACHE");
1950 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
1956 * Get the configured edje collections (groups) cache size.
1958 * This gets the globally configured edje collections cache size, in
1959 * number of collections.
1961 * @return The edje collections cache size
1965 elm_edje_collection_cache_get(void)
1967 return _elm_config->edje_collection_cache;
1971 * Set the configured edje collections (groups) cache size
1973 * This sets the globally configured edje collections cache size, in
1974 * number of collections.
1976 * @param size The edje collections cache size
1980 elm_edje_collection_cache_set(int size)
1982 if (_elm_config->edje_collection_cache == size) return;
1983 _elm_config->edje_collection_cache = size;
1989 * Set the configured edje collections (groups) cache size for all
1990 * applications on the display
1992 * This sets the globally configured edje collections cache size -- in
1993 * number of collections -- for all applications on the display.
1995 * @param size The edje collections cache size
1999 elm_edje_collection_cache_all_set(int size)
2001 #ifdef HAVE_ELEMENTARY_X
2002 static Ecore_X_Atom atom = 0;
2003 unsigned int size_i = (unsigned int)size;
2005 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_EDJE_COLLECTION_CACHE");
2006 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2012 elm_object_focus_get(const Evas_Object *obj)
2014 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
2015 return elm_widget_focus_get(obj);
2019 elm_object_focus_set(Evas_Object *obj,
2022 EINA_SAFETY_ON_NULL_RETURN(obj);
2025 if (elm_widget_focus_get(obj)) return;
2026 elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
2030 if (!elm_widget_can_focus_get(obj)) return;
2031 elm_widget_focused_object_clear(obj);
2036 elm_object_focus(Evas_Object *obj)
2038 EINA_SAFETY_ON_NULL_RETURN(obj);
2039 elm_object_focus_set(obj, EINA_TRUE);
2043 elm_object_unfocus(Evas_Object *obj)
2045 EINA_SAFETY_ON_NULL_RETURN(obj);
2046 elm_object_focus_set(obj, EINA_FALSE);
2050 elm_object_focus_allow_set(Evas_Object *obj,
2053 EINA_SAFETY_ON_NULL_RETURN(obj);
2054 elm_widget_can_focus_set(obj, enable);
2058 elm_object_focus_allow_get(const Evas_Object *obj)
2060 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
2061 return (elm_widget_can_focus_get(obj)) || (elm_widget_child_can_focus_get(obj));
2065 * Set custom focus chain.
2067 * This function i set one new and overwrite any previous custom focus chain
2068 * with the list of objects. The previous list will be deleted and this list
2069 * will be managed. After setted, don't modity it.
2071 * @note On focus cycle, only will be evaluated children of this container.
2073 * @param obj The container object
2074 * @param objs Chain of objects to pass focus
2078 elm_object_focus_custom_chain_set(Evas_Object *obj,
2081 EINA_SAFETY_ON_NULL_RETURN(obj);
2082 elm_widget_focus_custom_chain_set(obj, objs);
2086 * Unset custom focus chain
2088 * @param obj The container object
2092 elm_object_focus_custom_chain_unset(Evas_Object *obj)
2094 EINA_SAFETY_ON_NULL_RETURN(obj);
2095 elm_widget_focus_custom_chain_unset(obj);
2099 * Get custom focus chain
2101 * @param obj The container object
2104 EAPI const Eina_List *
2105 elm_object_focus_custom_chain_get(const Evas_Object *obj)
2107 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
2108 return elm_widget_focus_custom_chain_get(obj);
2112 * Append object to custom focus chain.
2114 * @note If relative_child equal to NULL or not in custom chain, the object
2115 * will be added in end.
2117 * @note On focus cycle, only will be evaluated children of this container.
2119 * @param obj The container object
2120 * @param child The child to be added in custom chain
2121 * @param relative_child The relative object to position the child
2125 elm_object_focus_custom_chain_append(Evas_Object *obj,
2127 Evas_Object *relative_child)
2129 EINA_SAFETY_ON_NULL_RETURN(obj);
2130 EINA_SAFETY_ON_NULL_RETURN(child);
2131 elm_widget_focus_custom_chain_append(obj, child, relative_child);
2135 * Prepend object to custom focus chain.
2137 * @note If relative_child equal to NULL or not in custom chain, the object
2138 * will be added in begin.
2140 * @note On focus cycle, only will be evaluated children of this container.
2142 * @param obj The container object
2143 * @param child The child to be added in custom chain
2144 * @param relative_child The relative object to position the child
2148 elm_object_focus_custom_chain_prepend(Evas_Object *obj,
2150 Evas_Object *relative_child)
2152 EINA_SAFETY_ON_NULL_RETURN(obj);
2153 EINA_SAFETY_ON_NULL_RETURN(child);
2154 elm_widget_focus_custom_chain_prepend(obj, child, relative_child);
2158 * Give focus to next object in object tree.
2160 * Give focus to next object in focus chain of one object sub-tree.
2161 * If the last object of chain already have focus, the focus will go to the
2162 * first object of chain.
2164 * @param obj The object root of sub-tree
2165 * @param dir Direction to cycle the focus
2170 elm_object_focus_cycle(Evas_Object *obj,
2171 Elm_Focus_Direction dir)
2173 EINA_SAFETY_ON_NULL_RETURN(obj);
2174 elm_widget_focus_cycle(obj, dir);
2178 * Give focus to near object in one direction.
2180 * Give focus to near object in direction of one object.
2181 * If none focusable object in given direction, the focus will not change.
2183 * @param obj The reference object
2184 * @param x Horizontal component of direction to focus
2185 * @param y Vertical component of direction to focus
2190 elm_object_focus_direction_go(Evas_Object *obj,
2194 EINA_SAFETY_ON_NULL_RETURN(obj);
2195 elm_widget_focus_direction_go(obj, x, y);
2199 elm_object_tree_unfocusable_set(Evas_Object *obj,
2200 Eina_Bool tree_unfocusable)
2202 EINA_SAFETY_ON_NULL_RETURN(obj);
2203 elm_widget_tree_unfocusable_set(obj, tree_unfocusable);
2207 elm_object_tree_unfocusable_get(const Evas_Object *obj)
2209 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
2210 return elm_widget_tree_unfocusable_get(obj);
2214 * Get the enable status of the focus highlight
2216 * This gets whether the highlight on focused objects is enabled or not
2220 elm_focus_highlight_enabled_get(void)
2222 return _elm_config->focus_highlight_enable;
2226 * Set the enable status of the focus highlight
2228 * Set whether to show or not the highlight on focused objects
2229 * @param enable Enable highlight if EINA_TRUE, disable otherwise
2233 elm_focus_highlight_enabled_set(Eina_Bool enable)
2235 _elm_config->focus_highlight_enable = !!enable;
2239 * Get the enable status of the highlight animation
2241 * Get whether the focus highlight, if enabled, will animate its switch from
2242 * one object to the next
2246 elm_focus_highlight_animate_get(void)
2248 return _elm_config->focus_highlight_animate;
2252 * Set the enable status of the highlight animation
2254 * Set whether the focus highlight, if enabled, will animate its switch from
2255 * one object to the next
2256 * @param animate Enable animation if EINA_TRUE, disable otherwise
2260 elm_focus_highlight_animate_set(Eina_Bool animate)
2262 _elm_config->focus_highlight_animate = !!animate;
2266 * @defgroup Scrolling Scrolling
2268 * These are functions setting how scrollable views in Elementary
2269 * widgets should behave on user interaction.
2273 * Get whether scrollers should bounce when they reach their
2274 * viewport's edge during a scroll.
2276 * @return the thumb scroll bouncing state
2278 * This is the default behavior for touch screens, in general.
2279 * @ingroup Scrolling
2282 elm_scroll_bounce_enabled_get(void)
2284 return _elm_config->thumbscroll_bounce_enable;
2288 * Set whether scrollers should bounce when they reach their
2289 * viewport's edge during a scroll.
2291 * @param enabled the thumb scroll bouncing state
2293 * @see elm_thumbscroll_bounce_enabled_get()
2294 * @ingroup Scrolling
2297 elm_scroll_bounce_enabled_set(Eina_Bool enabled)
2299 _elm_config->thumbscroll_bounce_enable = enabled;
2303 * Set whether scrollers should bounce when they reach their
2304 * viewport's edge during a scroll, for all Elementary application
2307 * @param enabled the thumb scroll bouncing state
2309 * @see elm_thumbscroll_bounce_enabled_get()
2310 * @ingroup Scrolling
2313 elm_scroll_bounce_enabled_all_set(Eina_Bool enabled)
2315 #ifdef HAVE_ELEMENTARY_X
2316 static Ecore_X_Atom atom = 0;
2317 unsigned int bounce_enable_i = (unsigned int)enabled;
2320 atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_BOUNCE_ENABLE");
2321 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2322 atom, &bounce_enable_i, 1);
2327 * Get the amount of inertia a scroller will impose at bounce
2330 * @return the thumb scroll bounce friction
2332 * @ingroup Scrolling
2335 elm_scroll_bounce_friction_get(void)
2337 return _elm_config->thumbscroll_bounce_friction;
2341 * Set the amount of inertia a scroller will impose at bounce
2344 * @param friction the thumb scroll bounce friction
2346 * @see elm_thumbscroll_bounce_friction_get()
2347 * @ingroup Scrolling
2350 elm_scroll_bounce_friction_set(double friction)
2352 _elm_config->thumbscroll_bounce_friction = friction;
2356 * Set the amount of inertia a scroller will impose at bounce
2357 * animations, for all Elementary application windows.
2359 * @param friction the thumb scroll bounce friction
2361 * @see elm_thumbscroll_bounce_friction_get()
2362 * @ingroup Scrolling
2365 elm_scroll_bounce_friction_all_set(double friction)
2367 #ifdef HAVE_ELEMENTARY_X
2368 static Ecore_X_Atom atom = 0;
2369 unsigned int bounce_friction_i = (unsigned int)(friction * 1000.0);
2372 atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_BOUNCE_FRICTION");
2373 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2374 atom, &bounce_friction_i, 1);
2379 * Get the amount of inertia a <b>paged</b> scroller will impose at
2380 * page fitting animations.
2382 * @return the page scroll friction
2384 * @ingroup Scrolling
2387 elm_scroll_page_scroll_friction_get(void)
2389 return _elm_config->page_scroll_friction;
2393 * Set the amount of inertia a <b>paged</b> scroller will impose at
2394 * page fitting animations.
2396 * @param friction the page scroll friction
2398 * @see elm_thumbscroll_page_scroll_friction_get()
2399 * @ingroup Scrolling
2402 elm_scroll_page_scroll_friction_set(double friction)
2404 _elm_config->page_scroll_friction = friction;
2408 * Set the amount of inertia a <b>paged</b> scroller will impose at
2409 * page fitting animations, for all Elementary application windows.
2411 * @param friction the page scroll friction
2413 * @see elm_thumbscroll_page_scroll_friction_get()
2414 * @ingroup Scrolling
2417 elm_scroll_page_scroll_friction_all_set(double friction)
2419 #ifdef HAVE_ELEMENTARY_X
2420 static Ecore_X_Atom atom = 0;
2421 unsigned int page_scroll_friction_i = (unsigned int)(friction * 1000.0);
2424 atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_PAGE_SCROLL_FRICTION");
2425 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2426 atom, &page_scroll_friction_i, 1);
2431 * Get the amount of inertia a scroller will impose at region bring
2434 * @return the bring in scroll friction
2436 * @ingroup Scrolling
2439 elm_scroll_bring_in_scroll_friction_get(void)
2441 return _elm_config->bring_in_scroll_friction;
2445 * Set the amount of inertia a scroller will impose at region bring
2448 * @param friction the bring in scroll friction
2450 * @see elm_thumbscroll_bring_in_scroll_friction_get()
2451 * @ingroup Scrolling
2454 elm_scroll_bring_in_scroll_friction_set(double friction)
2456 _elm_config->bring_in_scroll_friction = friction;
2460 * Set the amount of inertia a scroller will impose at region bring
2461 * animations, for all Elementary application windows.
2463 * @param friction the bring in scroll friction
2465 * @see elm_thumbscroll_bring_in_scroll_friction_get()
2466 * @ingroup Scrolling
2469 elm_scroll_bring_in_scroll_friction_all_set(double friction)
2471 #ifdef HAVE_ELEMENTARY_X
2472 static Ecore_X_Atom atom = 0;
2473 unsigned int bring_in_scroll_friction_i = (unsigned int)(friction * 1000.0);
2477 ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_BRING_IN_SCROLL_FRICTION");
2478 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2479 atom, &bring_in_scroll_friction_i, 1);
2484 * Get the amount of inertia scrollers will impose at animations
2485 * triggered by Elementary widgets' zooming API.
2487 * @return the zoom friction
2489 * @ingroup Scrolling
2492 elm_scroll_zoom_friction_get(void)
2494 return _elm_config->zoom_friction;
2498 * Set the amount of inertia scrollers will impose at animations
2499 * triggered by Elementary widgets' zooming API.
2501 * @param friction the zoom friction
2503 * @see elm_thumbscroll_zoom_friction_get()
2504 * @ingroup Scrolling
2507 elm_scroll_zoom_friction_set(double friction)
2509 _elm_config->zoom_friction = friction;
2513 * Set the amount of inertia scrollers will impose at animations
2514 * triggered by Elementary widgets' zooming API, for all Elementary
2515 * application windows.
2517 * @param friction the zoom friction
2519 * @see elm_thumbscroll_zoom_friction_get()
2520 * @ingroup Scrolling
2523 elm_scroll_zoom_friction_all_set(double friction)
2525 #ifdef HAVE_ELEMENTARY_X
2526 static Ecore_X_Atom atom = 0;
2527 unsigned int zoom_friction_i = (unsigned int)(friction * 1000.0);
2530 atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_ZOOM_FRICTION");
2531 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2532 atom, &zoom_friction_i, 1);
2537 * Get whether scrollers should be draggable from any point in their
2540 * @return the thumb scroll state
2542 * @note This is the default behavior for touch screens, in general.
2543 * @note All other functions namespaced with "thumbscroll" will only
2544 * have effect if this mode is enabled.
2546 * @ingroup Scrolling
2549 elm_scroll_thumbscroll_enabled_get(void)
2551 return _elm_config->thumbscroll_enable;
2555 * Set whether scrollers should be draggable from any point in their
2558 * @param enabled the thumb scroll state
2560 * @see elm_thumbscroll_enabled_get()
2561 * @ingroup Scrolling
2564 elm_scroll_thumbscroll_enabled_set(Eina_Bool enabled)
2566 _elm_config->thumbscroll_enable = enabled;
2570 * Set whether scrollers should be draggable from any point in their
2571 * views, for all Elementary application windows.
2573 * @param enabled the thumb scroll state
2575 * @see elm_thumbscroll_enabled_get()
2576 * @ingroup Scrolling
2579 elm_scroll_thumbscroll_enabled_all_set(Eina_Bool enabled)
2581 #ifdef HAVE_ELEMENTARY_X
2582 static Ecore_X_Atom atom = 0;
2583 unsigned int ts_enable_i = (unsigned int)enabled;
2585 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_ENABLE");
2586 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2587 atom, &ts_enable_i, 1);
2592 * Get the number of pixels one should travel while dragging a
2593 * scroller's view to actually trigger scrolling.
2595 * @return the thumb scroll threshould
2597 * One would use higher values for touch screens, in general, because
2598 * of their inherent imprecision.
2599 * @ingroup Scrolling
2602 elm_scroll_thumbscroll_threshold_get(void)
2604 return _elm_config->thumbscroll_threshold;
2608 * Set the number of pixels one should travel while dragging a
2609 * scroller's view to actually trigger scrolling.
2611 * @param threshold the thumb scroll threshould
2613 * @see elm_thumbscroll_threshould_get()
2614 * @ingroup Scrolling
2617 elm_scroll_thumbscroll_threshold_set(unsigned int threshold)
2619 _elm_config->thumbscroll_threshold = threshold;
2623 * Set the number of pixels one should travel while dragging a
2624 * scroller's view to actually trigger scrolling, for all Elementary
2625 * application windows.
2627 * @param threshold the thumb scroll threshould
2629 * @see elm_thumbscroll_threshould_get()
2630 * @ingroup Scrolling
2633 elm_scroll_thumbscroll_threshold_all_set(unsigned int threshold)
2635 #ifdef HAVE_ELEMENTARY_X
2636 static Ecore_X_Atom atom = 0;
2637 unsigned int ts_threshold_i = (unsigned int)threshold;
2639 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_THRESHOLD");
2640 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2641 atom, &ts_threshold_i, 1);
2646 * Get the minimum speed of mouse cursor movement which will trigger
2647 * list self scrolling animation after a mouse up event
2650 * @return the thumb scroll momentum threshould
2652 * @ingroup Scrolling
2655 elm_scroll_thumbscroll_momentum_threshold_get(void)
2657 return _elm_config->thumbscroll_momentum_threshold;
2661 * Set the minimum speed of mouse cursor movement which will trigger
2662 * list self scrolling animation after a mouse up event
2665 * @param threshold the thumb scroll momentum threshould
2667 * @see elm_thumbscroll_momentum_threshould_get()
2668 * @ingroup Scrolling
2671 elm_scroll_thumbscroll_momentum_threshold_set(double threshold)
2673 _elm_config->thumbscroll_momentum_threshold = threshold;
2677 * Set the minimum speed of mouse cursor movement which will trigger
2678 * list self scrolling animation after a mouse up event
2679 * (pixels/second), for all Elementary application windows.
2681 * @param threshold the thumb scroll momentum threshould
2683 * @see elm_thumbscroll_momentum_threshould_get()
2684 * @ingroup Scrolling
2687 elm_scroll_thumbscroll_momentum_threshold_all_set(double threshold)
2689 #ifdef HAVE_ELEMENTARY_X
2690 static Ecore_X_Atom atom = 0;
2691 unsigned int ts_momentum_threshold_i = (unsigned int)(threshold * 1000.0);
2694 atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_MOMENTUM_THRESHOLD");
2695 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2696 atom, &ts_momentum_threshold_i, 1);
2701 * Get the amount of inertia a scroller will impose at self scrolling
2704 * @return the thumb scroll friction
2706 * @ingroup Scrolling
2709 elm_scroll_thumbscroll_friction_get(void)
2711 return _elm_config->thumbscroll_friction;
2715 * Set the amount of inertia a scroller will impose at self scrolling
2718 * @param friction the thumb scroll friction
2720 * @see elm_thumbscroll_friction_get()
2721 * @ingroup Scrolling
2724 elm_scroll_thumbscroll_friction_set(double friction)
2726 _elm_config->thumbscroll_friction = friction;
2730 * Set the amount of inertia a scroller will impose at self scrolling
2731 * animations, for all Elementary application windows.
2733 * @param friction the thumb scroll friction
2735 * @see elm_thumbscroll_friction_get()
2736 * @ingroup Scrolling
2739 elm_scroll_thumbscroll_friction_all_set(double friction)
2741 #ifdef HAVE_ELEMENTARY_X
2742 static Ecore_X_Atom atom = 0;
2743 unsigned int ts_friction_i = (unsigned int)(friction * 1000.0);
2745 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_FRICTION");
2746 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2747 atom, &ts_friction_i, 1);
2752 * Get the amount of lag between your actual mouse cursor dragging
2753 * movement and a scroller's view movement itself, while pushing it
2754 * into bounce state manually.
2756 * @return the thumb scroll border friction
2758 * @ingroup Scrolling
2761 elm_scroll_thumbscroll_border_friction_get(void)
2763 return _elm_config->thumbscroll_border_friction;
2767 * Set the amount of lag between your actual mouse cursor dragging
2768 * movement and a scroller's view movement itself, while pushing it
2769 * into bounce state manually.
2771 * @param friction the thumb scroll border friction. @c 0.0 for
2772 * perfect synchrony between two movements, @c 1.0 for maximum
2775 * @see elm_thumbscroll_border_friction_get()
2776 * @note parameter value will get bound to 0.0 - 1.0 interval, always
2778 * @ingroup Scrolling
2781 elm_scroll_thumbscroll_border_friction_set(double friction)
2789 _elm_config->thumbscroll_friction = friction;
2793 * Set the amount of lag between your actual mouse cursor dragging
2794 * movement and a scroller's view movement itself, while pushing it
2795 * into bounce state manually, for all Elementary application windows.
2797 * @param friction the thumb scroll border friction. @c 0.0 for
2798 * perfect synchrony between two movements, @c 1.0 for maximum
2801 * @see elm_thumbscroll_border_friction_get()
2802 * @note parameter value will get bound to 0.0 - 1.0 interval, always
2804 * @ingroup Scrolling
2807 elm_scroll_thumbscroll_border_friction_all_set(double friction)
2815 #ifdef HAVE_ELEMENTARY_X
2816 static Ecore_X_Atom atom = 0;
2817 unsigned int border_friction_i = (unsigned int)(friction * 1000.0);
2820 atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_BORDER_FRICTION");
2821 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2822 atom, &border_friction_i, 1);
2827 * @defgroup Scrollhints Scrollhints
2829 * Objects when inside a scroller can scroll, but this may not always be
2830 * desirable in certain situations. This allows an object to hint to itself
2831 * and parents to "not scroll" in one of 2 ways.
2833 * 1. To hold on scrolling. This means just flicking and dragging may no
2834 * longer scroll, but pressing/dragging near an edge of the scroller will
2835 * still scroll. This is automastically used by the entry object when
2837 * 2. To totally freeze scrolling. This means it stops. until popped/released.
2841 * Push the scroll hold by 1
2843 * This increments the scroll hold count by one. If it is more than 0 it will
2844 * take effect on the parents of the indicated object.
2846 * @param obj The object
2847 * @ingroup Scrollhints
2850 elm_object_scroll_hold_push(Evas_Object *obj)
2852 EINA_SAFETY_ON_NULL_RETURN(obj);
2853 elm_widget_scroll_hold_push(obj);
2857 * Pop the scroll hold by 1
2859 * This decrements the scroll hold count by one. If it is more than 0 it will
2860 * take effect on the parents of the indicated object.
2862 * @param obj The object
2863 * @ingroup Scrollhints
2866 elm_object_scroll_hold_pop(Evas_Object *obj)
2868 EINA_SAFETY_ON_NULL_RETURN(obj);
2869 elm_widget_scroll_hold_pop(obj);
2873 * Push the scroll freeze by 1
2875 * This increments the scroll freeze count by one. If it is more than 0 it will
2876 * take effect on the parents of the indicated object.
2878 * @param obj The object
2879 * @ingroup Scrollhints
2882 elm_object_scroll_freeze_push(Evas_Object *obj)
2884 EINA_SAFETY_ON_NULL_RETURN(obj);
2885 elm_widget_scroll_freeze_push(obj);
2889 * Lock the scrolling of the given widget (and thus all parents)
2891 * This locks the given object from scrolling in the X axis (and implicitly
2892 * also locks all parent scrollers too from doing the same).
2894 * @param obj The object
2895 * @param lock The lock state (1 == locked, 0 == unlocked)
2896 * @ingroup Scrollhints
2899 elm_object_scroll_lock_x_set(Evas_Object *obj,
2902 EINA_SAFETY_ON_NULL_RETURN(obj);
2903 elm_widget_drag_lock_x_set(obj, lock);
2907 * Lock the scrolling of the given widget (and thus all parents)
2909 * This locks the given object from scrolling in the Y axis (and implicitly
2910 * also locks all parent scrollers too from doing the same).
2912 * @param obj The object
2913 * @param lock The lock state (1 == locked, 0 == unlocked)
2914 * @ingroup Scrollhints
2917 elm_object_scroll_lock_y_set(Evas_Object *obj,
2920 EINA_SAFETY_ON_NULL_RETURN(obj);
2921 elm_widget_drag_lock_y_set(obj, lock);
2925 * Get the scrolling lock of the given widget
2927 * This gets the lock for X axis scrolling.
2929 * @param obj The object
2930 * @ingroup Scrollhints
2933 elm_object_scroll_lock_x_get(const Evas_Object *obj)
2935 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
2936 return elm_widget_drag_lock_x_get(obj);
2940 * Get the scrolling lock of the given widget
2942 * This gets the lock for X axis scrolling.
2944 * @param obj The object
2945 * @ingroup Scrollhints
2948 elm_object_scroll_lock_y_get(const Evas_Object *obj)
2950 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
2951 return elm_widget_drag_lock_y_get(obj);
2955 * Pop the scroll freeze by 1
2957 * This decrements the scroll freeze count by one. If it is more than 0 it will
2958 * take effect on the parents of the indicated object.
2960 * @param obj The object
2961 * @ingroup Scrollhints
2964 elm_object_scroll_freeze_pop(Evas_Object *obj)
2966 EINA_SAFETY_ON_NULL_RETURN(obj);
2967 elm_widget_scroll_freeze_pop(obj);
2971 * Check if the given Evas Object is an Elementary widget.
2973 * @param obj the object to query.
2974 * @return @c EINA_TRUE if it is an elementary widget variant,
2975 * @c EINA_FALSE otherwise
2976 * @ingroup WidgetNavigation
2979 elm_object_widget_check(const Evas_Object *obj)
2981 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
2982 return elm_widget_is(obj);
2986 elm_object_parent_widget_get(const Evas_Object *obj)
2988 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
2989 return elm_widget_parent_widget_get(obj);
2993 * Get the top level parent of an Elementary widget.
2995 * @param obj The object to query.
2996 * @return The top level Elementary widget, or @c NULL if parent cannot be
2998 * @ingroup WidgetNavigation
3001 elm_object_top_widget_get(const Evas_Object *obj)
3003 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
3004 return elm_widget_top_get(obj);
3008 * Get the string that represents this Elementary widget.
3010 * @note Elementary is weird and exposes itself as a single
3011 * Evas_Object_Smart_Class of type "elm_widget", so
3012 * evas_object_type_get() always return that, making debug and
3013 * language bindings hard. This function tries to mitigate this
3014 * problem, but the solution is to change Elementary to use
3015 * proper inheritance.
3017 * @param obj the object to query.
3018 * @return Elementary widget name, or @c NULL if not a valid widget.
3019 * @ingroup WidgetNavigation
3022 elm_object_widget_type_get(const Evas_Object *obj)
3024 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
3025 return elm_widget_type_get(obj);
3029 * Send a signal to the widget edje object.
3031 * This function sends a signal to the edje object of the obj. An edje program
3032 * can respond to a signal by specifying matching 'signal' and
3035 * @param obj The object
3036 * @param emission The signal's name.
3037 * @param source The signal's source.
3041 elm_object_signal_emit(Evas_Object *obj,
3042 const char *emission,
3045 EINA_SAFETY_ON_NULL_RETURN(obj);
3046 elm_widget_signal_emit(obj, emission, source);
3050 * Add a callback for a signal emitted by widget edje object.
3052 * This function connects a callback function to a signal emitted by the
3053 * edje object of the obj.
3054 * Globs can occur in either the emission or source name.
3056 * @param obj The object
3057 * @param emission The signal's name.
3058 * @param source The signal's source.
3059 * @param func The callback function to be executed when the signal is
3061 * @param data A pointer to data to pass in to the callback function.
3065 elm_object_signal_callback_add(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data)
3067 EINA_SAFETY_ON_NULL_RETURN(obj);
3068 EINA_SAFETY_ON_NULL_RETURN(func);
3069 elm_widget_signal_callback_add(obj, emission, source, func, data);
3073 * Remove a signal-triggered callback from an widget edje object.
3075 * This function removes a callback, previoulsy attached to a signal emitted
3076 * by the edje object of the obj.
3077 * The parameters emission, source and func must match exactly those passed to
3078 * a previous call to elm_object_signal_callback_add(). The data pointer that
3079 * was passed to this call will be returned.
3081 * @param obj The object
3082 * @param emission The signal's name.
3083 * @param source The signal's source.
3084 * @param func The callback function to be executed when the signal is
3086 * @return The data pointer
3090 elm_object_signal_callback_del(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func)
3092 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
3093 EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
3094 return elm_widget_signal_callback_del(obj, emission, source, func);
3098 * Add a callback for a event emitted by widget or their children.
3100 * This function connects a callback function to any key_down key_up event
3101 * emitted by the @p obj or their children.
3102 * This only will be called if no other callback has consumed the event.
3103 * If you want consume the event, and no other get it, func should return
3104 * EINA_TRUE and put EVAS_EVENT_FLAG_ON_HOLD in event_flags.
3106 * @warning Accept duplicated callback addition.
3108 * @param obj The object
3109 * @param func The callback function to be executed when the event is
3111 * @param data Data to pass in to the callback function.
3115 elm_object_event_callback_add(Evas_Object *obj, Elm_Event_Cb func, const void *data)
3117 EINA_SAFETY_ON_NULL_RETURN(obj);
3118 EINA_SAFETY_ON_NULL_RETURN(func);
3119 elm_widget_event_callback_add(obj, func, data);
3123 * Remove a event callback from an widget.
3125 * This function removes a callback, previoulsy attached to event emission
3127 * The parameters func and data must match exactly those passed to
3128 * a previous call to elm_object_event_callback_add(). The data pointer that
3129 * was passed to this call will be returned.
3131 * @param obj The object
3132 * @param func The callback function to be executed when the event is
3134 * @param data Data to pass in to the callback function.
3135 * @return The data pointer
3139 elm_object_event_callback_del(Evas_Object *obj, Elm_Event_Cb func, const void *data)
3141 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
3142 EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
3143 return elm_widget_event_callback_del(obj, func, data);
3148 * @defgroup Debug Debug
3152 * Print Tree object hierarchy in stdout
3154 * @param obj The root object
3158 elm_object_tree_dump(const Evas_Object *top)
3161 elm_widget_tree_dump(top);
3169 * Print Elm Objects tree hierarchy in file as dot(graphviz) syntax.
3171 * @param obj The root object
3172 * @param file The path of output file
3176 elm_object_tree_dot_dump(const Evas_Object *top,
3180 FILE *f = fopen(file, "wb");
3181 elm_widget_tree_dot_dump(top, f);
3191 * Set the duration for occuring long press event.
3193 * @param lonpress_timeout Timeout for long press event
3194 * @ingroup Longpress
3197 elm_longpress_timeout_set(double longpress_timeout)
3199 _elm_config->longpress_timeout = longpress_timeout;
3203 * Get the duration for occuring long press event.
3205 * @return Timeout for long press event
3206 * @ingroup Longpress
3209 elm_longpress_timeout_get(void)
3211 return _elm_config->longpress_timeout;
3215 elm_object_item_content_part_set(Elm_Object_Item *it,
3217 Evas_Object *content)
3219 elm_widget_item_content_part_set(it, part, content);
3223 elm_object_item_content_part_get(const Elm_Object_Item *it,
3226 return elm_widget_item_content_part_get(it, part);
3230 elm_object_item_content_part_unset(Elm_Object_Item *it, const char *part)
3232 return elm_widget_item_content_part_unset(it, part);
3236 elm_object_item_text_part_set(Elm_Object_Item *it,
3240 elm_widget_item_text_part_set(it, part, label);
3244 elm_object_item_text_part_get(const Elm_Object_Item *it, const char *part)
3246 return elm_widget_item_text_part_get(it, part);