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"
50 * @defgroup Start Getting Started
52 * To write an Elementary app, you can get started with the following:
55 * #include <Elementary.h>
56 * #ifndef ELM_LIB_QUICKLAUNCH
58 * elm_main(int argc, char **argv)
60 * // create window(s) here and do any application init
61 * elm_run(); // run main loop
62 * elm_shutdown(); // after mainloop finishes running, shutdown
63 * return 0; // exit 0 for exit code
69 * To take full advantage of the quicklaunch architecture for launching
70 * processes as quickly as possible (saving time at startup time like
71 * connecting to X11, loading and linking shared libraries) you may want to
72 * use the following configure.in/configure.ac and Makefile.am and autogen.sh
73 * script to generate your files. It is assumed your application uses the
74 * main.c file for its code.
76 * configure.in/configure.ac:
79 AC_INIT(myapp, 0.0.0, myname@mydomain.com)
81 AC_CONFIG_SRCDIR(configure.in)
83 AM_INIT_AUTOMAKE(1.6 dist-bzip2)
84 AM_CONFIG_HEADER(config.h)
94 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
95 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
98 PKG_CHECK_MODULES([ELEMENTARY], elementary)
106 AUTOMAKE_OPTIONS = 1.4 foreign
107 MAINTAINERCLEANFILES = Makefile.in
109 INCLUDES = -I$(top_srcdir) @ELEMENTARY_CFLAGS@
112 myapp_LTLIBRARIES = myapp.la
116 myapp_la_SOURCES = main.c
117 myapp_la_LIBADD = @ELEMENTARY_LIBS@
119 myapp_la_LDFLAGS = -module -avoid-version -no-undefined
121 myapp_SOURCES = main.c
122 myapp_LDADD = @ELEMENTARY_LIBS@
123 myapp_CFLAGS = -DELM_LIB_QUICKLAUNCH=1
130 rm -rf autom4te.cache
131 rm -f aclocal.m4 ltmain.sh
136 echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS -I m4 || exit 1
137 echo "Running autoheader..." ; autoheader || exit 1
138 echo "Running autoconf..." ; autoconf || exit 1
139 echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1
140 echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1
142 if [ -z "$NOCONFIGURE" ]; then
147 * To gnerate all the things needed to bootstrap just run:
153 * This will generate Makefile.in's, the confgure script and everything else.
154 * After this it works like all normal autotools projects:
161 * Note sudo was assumed to get root permissions, as this would install in
162 * /usr/local which is system-owned. Ue any way you like to gain root, or
163 * specify a different prefix with configure:
166 ./confiugre --prefix=$HOME/mysoftware
169 * Also remember that autotools buys you some useful commands like:
174 * This uninstalls the software after it was installed with "make install".
175 * It is very useful to clear up what you built if you wish to clean the
182 * This firstly checks if your build tree is "clean" and ready for
183 * distribution. It also builds a tarball (myapp-0.0.0.tar.gz) that is
184 * ready to upload and distribute to the world, that contains the generated
185 * Makefile.in's and configure script. The users do not need to run
186 * autogen.sh - just configure and on. They don't need autotools installed.
187 * This tarball also builds cleanly, has all the sources it needs to build
188 * included (that is sources for your application, not libraries it depends
189 * on like Elementary). It builds cleanly in a buildroot and does not
190 * contain any files that are temporarily generated like binaries and other
191 * build-gnerated files, so the tarball is clean, and no need to worry
192 * about cleaning up your tree before packaging.
198 * This cleans up all build files (binaries, objects etc.) from the tree.
204 * This cleans out all files from the build and from configure's output too.
207 make maintainer-clean
210 * This deletes all the files autogen.sh will produce so the tree is clean
211 * to be put into a revision-control system (like CVS, SVN or GIT for example).
213 * The above will build a library - libmyapp.so and install in the target
214 * library directory (default is /usr/local/lib). You will also get a
215 * myapp.a and myapp.la - these are useless and can be deleted. Libtool likes
216 * to generate these all the time. You will also get a binary in the target
217 * binary directory (default is /usr/local/bin). This is a "debug binary".
218 * This will run and dlopen() the myapp.so and then jump to it's elm_main
219 * function. This allows for easy debugging with GDB and Valgrind. When you
220 * are ready to go to production do the following:
222 * 1. delete the myapp binary. i.e. rm /usr/local/bin/myapp
224 * 2. symlink the myapp binary to elementary_run (supplied by elementary).
225 * i.e. ln -s elmentary_run /usr/local/bin/myapp
227 * 3. run elementary_quicklaunch as part of your graphical login session and
230 * This will man elementary_quicklaunch does pre-initialization before the
231 * application needs to be run, saving the effort at the time the application
232 * is needed, thus speeding up the time it takes to appear.
234 * If you don't want to use the quicklaunch infrastructure (which is
235 * optional), you can execute the old fashioned way by just running the
236 * myapp binary loader than will load the myapp.so for you, or you can
237 * remove the split-file binary and put it into one binary as things always
238 * have been with the following configure.in/configure.ac and Makfile.am
241 * configure.in/configure.ac:
244 AC_INIT(myapp, 0.0.0, myname@mydomain.com)
246 AC_CONFIG_SRCDIR(configure.in)
248 AM_INIT_AUTOMAKE(1.6 dist-bzip2)
249 AM_CONFIG_HEADER(config.h)
258 PKG_CHECK_MODULES([ELEMENTARY], elementary)
266 AUTOMAKE_OPTIONS = 1.4 foreign
267 MAINTAINERCLEANFILES = Makefile.in
269 INCLUDES = -I$(top_srcdir) @ELEMENTARY_CFLAGS@
273 myapp_SOURCES = main.c
274 myapp_LDADD = @ELEMENTARY_LIBS@
278 * Notice that they are the same as before, just with libtool and library
279 * building sections removed. Both ways work for building elementary
280 * applications. It is up to you to decide what is best for you. If you just
281 * follow the template above, you can do it both ways and can decide at build
282 * time. The more advanced of you may suggest making it a configure option.
283 * That is perfectly valid, but has been left out here for simplicity, as our
284 * aim to have an Elementary (and EFL) tutorial, not an autoconf & automake
289 static Eina_Bool _elm_signal_exit(void *data,
293 char *_elm_appname = NULL;
294 const char *_elm_data_dir = NULL;
295 const char *_elm_lib_dir = NULL;
296 int _elm_log_dom = -1;
298 EAPI int ELM_EVENT_POLICY_CHANGED = 0;
300 static int _elm_init_count = 0;
301 static int _elm_sub_init_count = 0;
302 static int _elm_ql_init_count = 0;
303 static int _elm_policies[ELM_POLICY_LAST];
304 static Ecore_Event_Handler *_elm_exit_handler = NULL;
305 static Eina_Bool quicklaunch_on = 0;
308 _elm_signal_exit(void *data __UNUSED__,
309 int ev_type __UNUSED__,
313 return ECORE_CALLBACK_PASS_ON;
319 edje_scale_set(_elm_config->scale);
320 _elm_win_rescale(NULL, EINA_FALSE);
324 * @defgroup General General
328 * Inititalise Elementary
330 * @return The init counter value.
332 * This call is exported only for use by the ELM_MAIN() macro. There is no
333 * need to use this if you use this macro (which is highly advisable).
341 if (_elm_init_count > 1) return _elm_init_count;
342 elm_quicklaunch_init(argc, argv);
343 elm_quicklaunch_sub_init(argc, argv);
344 return _elm_init_count;
348 * Shut down Elementary
350 * @return The init counter value.
352 * This should be called at the end of your application just before it ceases
353 * to do any more processing. This will clean up any permanent resources your
354 * application may have allocated via Elementary that would otherwise persist
355 * on an exit without this call.
362 if (_elm_init_count > 0) return _elm_init_count;
364 while (_elm_win_deferred_free) ecore_main_loop_iterate();
365 elm_quicklaunch_sub_shutdown();
366 elm_quicklaunch_shutdown();
367 return _elm_init_count;
371 static int _elm_need_e_dbus = 0;
374 elm_need_e_dbus(void)
377 if (_elm_need_e_dbus++) return EINA_TRUE;
386 _elm_unneed_e_dbus(void)
389 if (--_elm_need_e_dbus) return;
391 _elm_need_e_dbus = 0;
397 static int _elm_need_efreet = 0;
400 elm_need_efreet(void)
403 if (_elm_need_efreet++) return EINA_TRUE;
411 list = efreet_icon_extra_list_get();
414 e_user_dir_concat_static(buf, "icons");
415 *list = eina_list_prepend(*list, (void *)eina_stringshare_add(buf));
416 e_prefix_data_concat_static(buf, "data/icons");
417 *list = eina_list_prepend(*list, (void *)eina_stringshare_add(buf));
428 _elm_unneed_efreet(void)
431 if (--_elm_need_efreet) return;
433 _elm_need_efreet = 0;
434 efreet_trash_shutdown();
435 efreet_mime_shutdown();
441 elm_quicklaunch_mode_set(Eina_Bool ql_on)
443 quicklaunch_on = ql_on;
447 elm_quicklaunch_mode_get(void)
449 return quicklaunch_on;
453 elm_quicklaunch_init(int argc,
456 char buf[PATH_MAX], *s;
458 _elm_ql_init_count++;
459 if (_elm_ql_init_count > 1) return _elm_ql_init_count;
461 _elm_log_dom = eina_log_domain_register("elementary", EINA_COLOR_LIGHTBLUE);
464 EINA_LOG_ERR("could not register elementary log domain.");
465 _elm_log_dom = EINA_LOG_DOMAIN_GLOBAL;
470 ecore_app_args_set(argc, (const char **)argv);
472 memset(_elm_policies, 0, sizeof(_elm_policies));
473 if (!ELM_EVENT_POLICY_CHANGED)
474 ELM_EVENT_POLICY_CHANGED = ecore_event_type_new();
478 _elm_exit_handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _elm_signal_exit, NULL);
480 if (argv) _elm_appname = strdup(ecore_file_file_get(argv[0]));
484 s = getenv("ELM_DATA_DIR");
485 _elm_data_dir = eina_stringshare_add(s);
489 s = getenv("ELM_PREFIX");
492 snprintf(buf, sizeof(buf), "%s/share/elementary", s);
493 _elm_data_dir = eina_stringshare_add(buf);
498 s = getenv("ELM_LIB_DIR");
499 _elm_lib_dir = eina_stringshare_add(s);
503 s = getenv("ELM_PREFIX");
506 snprintf(buf, sizeof(buf), "%s/lib", s);
507 _elm_lib_dir = eina_stringshare_add(buf);
511 if ((!_elm_data_dir) || (!_elm_lib_dir))
513 Dl_info elementary_dl;
514 // libelementary.so/../../share/elementary/
515 if (dladdr(elm_init, &elementary_dl))
519 dir = ecore_file_dir_get(elementary_dl.dli_fname);
524 if (ecore_file_is_dir(dir))
525 _elm_lib_dir = eina_stringshare_add(dir);
529 dir2 = ecore_file_dir_get(dir);
532 snprintf(buf, sizeof(buf), "%s/share/elementary", dir2);
533 if (ecore_file_is_dir(buf))
534 _elm_data_dir = eina_stringshare_add(buf);
544 _elm_data_dir = eina_stringshare_add(PACKAGE_DATA_DIR);
546 _elm_data_dir = eina_stringshare_add("/");
548 _elm_lib_dir = eina_stringshare_add(PACKAGE_LIB_DIR);
550 _elm_lib_dir = eina_stringshare_add("/");
553 return _elm_ql_init_count;
557 elm_quicklaunch_sub_init(int argc,
560 _elm_sub_init_count++;
561 if (_elm_sub_init_count > 1) return _elm_sub_init_count;
564 #ifdef SEMI_BROKEN_QUICKLAUNCH
565 return _elm_sub_init_count;
570 ecore_app_args_set(argc, (const char **)argv);
574 _elm_config_sub_init();
575 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
576 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
577 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
578 ENGINE_COMPARE(ELM_XRENDER_X11) ||
579 ENGINE_COMPARE(ELM_OPENGL_X11))
580 #undef ENGINE_COMPARE
582 #ifdef HAVE_ELEMENTARY_X
586 ecore_evas_init(); // FIXME: check errors
589 return _elm_sub_init_count;
593 elm_quicklaunch_sub_shutdown(void)
595 _elm_sub_init_count--;
596 if (_elm_sub_init_count > 0) return _elm_sub_init_count;
599 #ifdef SEMI_BROKEN_QUICKLAUNCH
600 return _elm_sub_init_count;
606 _elm_module_shutdown();
607 ecore_imf_shutdown();
608 ecore_evas_shutdown();
609 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
610 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
611 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
612 ENGINE_COMPARE(ELM_XRENDER_X11) ||
613 ENGINE_COMPARE(ELM_OPENGL_X11))
614 #undef ENGINE_COMPARE
616 #ifdef HAVE_ELEMENTARY_X
617 ecore_x_disconnect();
620 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
621 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
622 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
623 ENGINE_COMPARE(ELM_XRENDER_X11) ||
624 ENGINE_COMPARE(ELM_OPENGL_X11) ||
625 ENGINE_COMPARE(ELM_SOFTWARE_SDL) ||
626 ENGINE_COMPARE(ELM_SOFTWARE_16_SDL) ||
627 ENGINE_COMPARE(ELM_OPENGL_SDL) ||
628 ENGINE_COMPARE(ELM_SOFTWARE_WIN32) ||
629 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
630 #undef ENGINE_COMPARE
631 evas_cserve_disconnect();
635 return _elm_sub_init_count;
639 elm_quicklaunch_shutdown(void)
641 _elm_ql_init_count--;
642 if (_elm_ql_init_count > 0) return _elm_ql_init_count;
643 eina_stringshare_del(_elm_data_dir);
644 _elm_data_dir = NULL;
645 eina_stringshare_del(_elm_lib_dir);
651 _elm_config_shutdown();
653 ecore_event_handler_del(_elm_exit_handler);
654 _elm_exit_handler = NULL;
656 _elm_theme_shutdown();
657 _elm_unneed_efreet();
658 _elm_unneed_e_dbus();
659 _elm_unneed_ethumb();
660 ecore_file_shutdown();
664 if ((_elm_log_dom > -1) && (_elm_log_dom != EINA_LOG_DOMAIN_GLOBAL))
666 eina_log_domain_unregister(_elm_log_dom);
670 _elm_widget_type_clear();
673 return _elm_ql_init_count;
677 elm_quicklaunch_seed(void)
679 #ifndef SEMI_BROKEN_QUICKLAUNCH
682 Evas_Object *win, *bg, *bt;
684 win = elm_win_add(NULL, "seed", ELM_WIN_BASIC);
685 bg = elm_bg_add(win);
686 elm_win_resize_object_add(win, bg);
687 evas_object_show(bg);
688 bt = elm_button_add(win);
689 elm_button_label_set(bt, " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~-_=+\\|]}[{;:'\",<.>/?");
690 elm_win_resize_object_add(win, bt);
691 ecore_main_loop_iterate();
692 evas_object_del(win);
693 ecore_main_loop_iterate();
694 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
695 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
696 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
697 ENGINE_COMPARE(ELM_XRENDER_X11) ||
698 ENGINE_COMPARE(ELM_OPENGL_X11))
699 #undef ENGINE_COMPARE
701 # ifdef HAVE_ELEMENTARY_X
705 ecore_main_loop_iterate();
710 static void *qr_handle = NULL;
711 static int (*qr_main)(int argc,
715 elm_quicklaunch_prepare(int argc __UNUSED__,
719 char *exe = elm_quicklaunch_exe_path_get(argv[0]);
722 ERR("requested quicklaunch binary '%s' does not exist\n", argv[0]);
730 exe2 = malloc(strlen(exe) + 1 + 10);
732 p = strrchr(exe2, '/');
735 exename = alloca(strlen(p) + 1);
738 strcat(p, "../lib/");
741 if (!access(exe2, R_OK | X_OK))
749 qr_handle = dlopen(exe, RTLD_NOW | RTLD_GLOBAL);
752 fprintf(stderr, "dlerr: %s\n", dlerror());
753 WRN("dlopen('%s') failed: %s", exe, dlerror());
757 INF("dlopen('%s') = %p", exe, qr_handle);
758 qr_main = dlsym(qr_handle, "elm_main");
759 INF("dlsym(%p, 'elm_main') = %p", qr_handle, qr_main);
762 WRN("not quicklauncher capable: no elm_main in '%s'", exe);
781 extern char **environ;
786 for (i = 0, size = 0; environ[i]; i++)
787 size += strlen(environ[i]) + 1;
789 p = malloc((i + 1) * sizeof(char *));
794 for (i = 0; oldenv[i]; i++)
795 environ[i] = strdup(oldenv[i]);
802 elm_quicklaunch_fork(int argc,
805 void (postfork_func) (void *data),
815 // need to accept current environment from elementary_run
822 if (child > 0) return EINA_TRUE;
825 perror("could not fork");
830 perror("could not chdir");
831 args = alloca((argc + 1) * sizeof(char *));
832 for (i = 0; i < argc; i++) args[i] = argv[i];
834 WRN("%s not quicklaunch capable, fallback...", argv[0]);
835 execvp(argv[0], args);
836 ERR("failed to execute '%s': %s", argv[0], strerror(errno));
840 if (child > 0) return EINA_TRUE;
843 perror("could not fork");
846 if (postfork_func) postfork_func(postfork_data);
850 #ifdef SEMI_BROKEN_QUICKLAUNCH
851 ecore_app_args_set(argc, (const char **)argv);
854 _elm_config_sub_init();
855 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
856 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
857 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
858 ENGINE_COMPARE(ELM_XRENDER_X11) ||
859 ENGINE_COMPARE(ELM_OPENGL_X11))
860 #undef ENGINE_COMPARE
862 # ifdef HAVE_ELEMENTARY_X
866 ecore_evas_init(); // FIXME: check errors
874 perror("could not chdir");
875 // FIXME: this is very linux specific. it changes argv[0] of the process
876 // so ps etc. report what you'd expect. for other unixes and os's this
883 ecore_app_args_get(&real_argc, &real_argv);
884 lastarg = real_argv[real_argc - 1] + strlen(real_argv[real_argc - 1]);
885 for (p = real_argv[0]; p < lastarg; p++) *p = 0;
886 strcpy(real_argv[0], argv[0]);
888 ecore_app_args_set(argc, (const char **)argv);
889 ret = qr_main(argc, argv);
903 elm_quicklaunch_cleanup(void)
916 elm_quicklaunch_fallback(int argc,
920 elm_quicklaunch_init(argc, argv);
921 elm_quicklaunch_sub_init(argc, argv);
922 elm_quicklaunch_prepare(argc, argv);
923 ret = qr_main(argc, argv);
929 elm_quicklaunch_exe_path_get(const char *exe)
931 static char *path = NULL;
932 static Eina_List *pathlist = NULL;
936 if (exe[0] == '/') return strdup(exe);
937 if ((exe[0] == '.') && (exe[1] == '/')) return strdup(exe);
938 if ((exe[0] == '.') && (exe[1] == '.') && (exe[2] == '/')) return strdup(exe);
943 path = getenv("PATH");
944 buf2 = alloca(strlen(path) + 1);
949 if ((*p == ':') || (!*p))
954 strncpy(buf2, pp, len);
956 pathlist = eina_list_append(pathlist, eina_stringshare_add(buf2));
968 EINA_LIST_FOREACH(pathlist, l, pathitr)
970 snprintf(buf, sizeof(buf), "%s/%s", pathitr, exe);
971 if (!access(buf, R_OK | X_OK)) return strdup(buf);
979 * This call should be called just after all initialization is complete. This
980 * function will not return until elm_exit() is called. It will keep looping
981 * running the main event/processing loop for Elementary.
987 ecore_main_loop_begin();
993 * If this call is called, it will flag the main loop to cease processing and
994 * return back to its parent function.
1000 ecore_main_loop_quit();
1004 * Set new policy value.
1006 * This will emit the ecore event ELM_EVENT_POLICY_CHANGED in the main
1007 * loop giving the event information Elm_Event_Policy_Changed with
1008 * policy identifier, new and old values.
1010 * @param policy policy identifier as in Elm_Policy.
1011 * @param value policy value, depends on identifiers, usually there is
1012 * an enumeration with the same prefix as the policy name, for
1013 * example: ELM_POLICY_QUIT and Elm_Policy_Quit
1014 * (ELM_POLICY_QUIT_NONE, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED).
1017 * @return @c EINA_TRUE on success or @c EINA_FALSE on error (right
1018 * now just invalid policy identifier, but in future policy
1019 * value might be enforced).
1022 elm_policy_set(unsigned int policy,
1025 Elm_Event_Policy_Changed *ev;
1027 if (policy >= ELM_POLICY_LAST)
1030 if (value == _elm_policies[policy])
1033 /* TODO: validade policy? */
1035 ev = malloc(sizeof(*ev));
1036 ev->policy = policy;
1037 ev->new_value = value;
1038 ev->old_value = _elm_policies[policy];
1040 _elm_policies[policy] = value;
1042 ecore_event_add(ELM_EVENT_POLICY_CHANGED, ev, NULL, NULL);
1048 * Gets the policy value set for given identifier.
1050 * @param policy policy identifier as in Elm_Policy.
1053 * @return policy value. Will be 0 if policy identifier is invalid.
1056 elm_policy_get(unsigned int policy)
1058 if (policy >= ELM_POLICY_LAST)
1060 return _elm_policies[policy];
1064 * @defgroup UI-Mirroring Selective Widget mirroring
1066 * These functions allow you to set ui-miroring on specific widgets or whe
1067 * whole interface. Widgets can be in one of two modes, automatic and manual.
1068 * Automatic means they'll be changed according to the system mirroring mode
1069 * and manual means only explicit changes will matter. You are not supposed to
1070 * change mirroring state of a widget set to automatic, will mostly work, but
1071 * the behavior is not really defined.
1075 * Returns the widget's mirrored mode.
1077 * @param obj The widget.
1078 * @return mirrored mode of the object.
1082 elm_object_mirrored_get(const Evas_Object *obj)
1084 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1085 return elm_widget_mirrored_get(obj);
1089 * Sets the widget's mirrored mode.
1091 * @param obj The widget.
1092 * @param mirrored EINA_TRUE to set mirrored mode. EINA_FALSE to unset.
1095 elm_object_mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
1097 EINA_SAFETY_ON_NULL_RETURN(obj);
1098 elm_widget_mirrored_set(obj, mirrored);
1102 * Returns the widget's mirrored mode setting.
1104 * @param obj The widget.
1105 * @return mirrored mode setting of the object.
1109 elm_object_mirrored_automatic_get(const Evas_Object *obj)
1111 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1112 return elm_widget_mirrored_automatic_get(obj);
1116 * Sets the widget's mirrored mode setting.
1117 * When widget in automatic mode, it follows the system mirrored mode set by
1118 * elm_mirrored_set().
1119 * @param obj The widget.
1120 * @param automatic EINA_TRUE for auto mirrored mode. EINA_FALSE for manual.
1123 elm_object_mirrored_automatic_set(Evas_Object *obj, Eina_Bool automatic)
1125 EINA_SAFETY_ON_NULL_RETURN(obj);
1126 elm_widget_mirrored_automatic_set(obj, automatic);
1130 * @defgroup Scaling Selective Widget Scaling
1132 * Different widgets can be scaled independently. These functions allow you to
1133 * manipulate this scaling on a per-widget basis. The object and all its
1134 * children get their scaling factors multiplied by the scale factor set.
1135 * This is multiplicative, in that if a child also has a scale size set it is
1136 * in turn multiplied by its parent's scale size. 1.0 means “don't scale”,
1137 * 2.0 is double size, 0.5 is half etc.
1141 * Set the scaling factor
1143 * @param obj The object
1144 * @param scale Scale factor (from 0.0 up, with 1.0 == no scaling)
1148 elm_object_scale_set(Evas_Object *obj,
1151 EINA_SAFETY_ON_NULL_RETURN(obj);
1152 elm_widget_scale_set(obj, scale);
1156 * Get the scaling factor
1158 * @param obj The object
1159 * @return The scaling factor set by elm_object_scale_set()
1163 elm_object_scale_get(const Evas_Object *obj)
1165 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, 0.0);
1166 return elm_widget_scale_get(obj);
1170 * Get the global scaling factor
1172 * This gets the globally configured scaling factor that is applied to all
1175 * @return The scaling factor
1181 return _elm_config->scale;
1185 * Set the global scaling factor
1187 * This sets the globally configured scaling factor that is applied to all
1190 * @param scale The scaling factor to set
1194 elm_scale_set(double scale)
1196 if (_elm_config->scale == scale) return;
1197 _elm_config->scale = scale;
1202 * Set the global scaling factor for all applications on the display
1204 * This sets the globally configured scaling factor that is applied to all
1205 * objects for all applications.
1206 * @param scale The scaling factor to set
1210 elm_scale_all_set(double scale)
1212 #ifdef HAVE_ELEMENTARY_X
1213 static Ecore_X_Atom atom = 0;
1214 unsigned int scale_i = (unsigned int)(scale * 1000.0);
1216 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_SCALE");
1217 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
1223 * @defgroup Styles Styles
1225 * Widgets can have different styles of look. These generic API's set
1226 * styles of widgets, if they support them (and if the theme(s) do).
1232 * This sets the name of the style
1233 * @param obj The object
1234 * @param style The style name to use
1238 elm_object_style_set(Evas_Object *obj,
1241 EINA_SAFETY_ON_NULL_RETURN(obj);
1242 elm_widget_style_set(obj, style);
1248 * This gets the style being used for that widget. Note that the string
1249 * pointer is only valid as longas the object is valid and the style doesn't
1252 * @param obj The object
1253 * @return The style name
1257 elm_object_style_get(const Evas_Object *obj)
1259 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1260 return elm_widget_style_get(obj);
1264 * Set the disable state
1266 * This sets the disable state for the widget.
1268 * @param obj The object
1269 * @param disabled The state
1273 elm_object_disabled_set(Evas_Object *obj,
1276 EINA_SAFETY_ON_NULL_RETURN(obj);
1277 elm_widget_disabled_set(obj, disabled);
1281 * Get the disable state
1283 * This gets the disable state for the widget.
1285 * @param obj The object
1286 * @return True, if the widget is disabled
1290 elm_object_disabled_get(const Evas_Object *obj)
1292 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1293 return elm_widget_disabled_get(obj);
1297 * @defgroup Config Elementary Config
1299 * Elementary configuration is formed by a set options bounded to a
1300 * given @ref Profile profile, like @ref Theme theme, @ref Fingers
1301 * "finger size", etc. These are functions with which one syncronizes
1302 * changes made to those values to the configuration storing files, de
1303 * facto. You most probably don't want to use the functions in this
1304 * group unlees you're writing an elementary configuration manager.
1308 * Save back Elementary's configuration, so that it will persist on
1311 * @return @c EINA_TRUE, when sucessful. @c EINA_FALSE, otherwise.
1314 * This function will take effect -- thus, do I/O -- immediately. Use
1315 * it when you want to apply all configuration changes at once. The
1316 * current configuration set will get saved onto the current profile
1317 * configuration file.
1321 elm_config_save(void)
1323 return _elm_config_save();
1327 * Reload Elementary's configuration, bounded to current selected
1330 * @return @c EINA_TRUE, when sucessful. @c EINA_FALSE, otherwise.
1333 * Useful when you want to force reloading of configuration values for
1334 * a profile. If one removes user custom configuration directories,
1335 * for example, it will force a reload with system values insted.
1339 elm_config_reload(void)
1341 _elm_config_reload();
1345 * @defgroup Profile Elementary Profile
1347 * Profiles are pre-set options that affect the whole look-and-feel of
1348 * Elementary-based applications. There are, for example, profiles
1349 * aimed at desktop computer applications and others aimed at mobile,
1350 * touchscreen-based ones. You most probably don't want to use the
1351 * functions in this group unlees you're writing an elementary
1352 * configuration manager.
1356 * Get Elementary's profile in use.
1358 * This gets the global profile that is applied to all Elementary
1361 * @return The profile's name
1365 elm_profile_current_get(void)
1367 return _elm_config_current_profile_get();
1371 * Get an Elementary's profile directory path in the filesystem. One
1372 * may want to fetch a system profile's dir or an user one (fetched
1375 * @param profile The profile's name
1376 * @param is_user Whether to lookup for an user profile (@c EINA_TRUE)
1377 * or a system one (@c EINA_FALSE)
1378 * @return The profile's directory path.
1381 * @note You must free it with elm_profile_dir_free().
1384 elm_profile_dir_get(const char *profile,
1387 return _elm_config_profile_dir_get(profile, is_user);
1391 * Free an Elementary's profile directory path, as returned by
1392 * elm_profile_dir_get().
1394 * @param p_dir The profile's path
1399 elm_profile_dir_free(const char *p_dir)
1401 free((void *)p_dir);
1405 * Get Elementary's list of available profiles.
1407 * @return The profiles list. List node data are the profile name
1411 * @note One must free this list, after usage, with the function
1412 * elm_profile_list_free().
1415 elm_profile_list_get(void)
1417 return _elm_config_profiles_list();
1421 * Free Elementary's list of available profiles.
1423 * @param The profiles list, as returned by elm_profile_list_get().
1428 elm_profile_list_free(Eina_List *l)
1432 EINA_LIST_FREE(l, dir)
1433 eina_stringshare_del(dir);
1437 * Set Elementary's profile.
1439 * This sets the global profile that is applied to Elementary
1440 * applications. Just the process the call comes from will be
1443 * @param profile The profile's name
1448 elm_profile_set(const char *profile)
1450 EINA_SAFETY_ON_NULL_RETURN(profile);
1451 _elm_config_profile_set(profile);
1455 * Set Elementary's profile.
1457 * This sets the global profile that is applied to all Elementary
1458 * applications. All running Elementary windows will be affected.
1460 * @param profile The profile's name
1465 elm_profile_all_set(const char *profile)
1467 #ifdef HAVE_ELEMENTARY_X
1468 static Ecore_X_Atom atom = 0;
1470 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_PROFILE");
1471 ecore_x_window_prop_string_set(ecore_x_window_root_first_get(),
1477 * @defgroup Engine Elementary Engine
1479 * These are functions setting and querying which rendering engine
1480 * Elementary will use for drawing its windows' pixels.
1484 * Get Elementary's rendering engine in use.
1486 * This gets the global rendering engine that is applied to all
1487 * Elementary applications.
1489 * @return The rendering engine's name
1492 * @note there's no need to free the returned string, here.
1495 elm_engine_current_get(void)
1497 return _elm_config->engine;
1501 * Set Elementary's rendering engine for use.
1503 * This gets sets global rendering engine that is applied to all
1504 * Elementary applications. Note that it will take effect only to
1505 * subsequent Elementary window creations.
1507 * @param The rendering engine's name
1510 * @note there's no need to free the returned string, here.
1513 elm_engine_set(const char *engine)
1515 EINA_SAFETY_ON_NULL_RETURN(engine);
1517 _elm_config_engine_set(engine);
1521 * @defgroup Fonts Elementary Fonts
1523 * These are functions dealing with font rendering, selection and the
1524 * like for Elementary applications. One might fetch which system
1525 * fonts are there to use and set custom fonts for individual classes
1526 * of UI items containing text (text classes).
1530 * Get Elementary's list of supported text classes.
1532 * @return The text classes list, with @c Elm_Text_Class blobs as data.
1535 * Release the list with elm_text_classes_list_free().
1537 EAPI const Eina_List *
1538 elm_text_classes_list_get(void)
1540 return _elm_config_text_classes_get();
1544 * Free Elementary's list of supported text classes.
1548 * @see elm_text_classes_list_get().
1551 elm_text_classes_list_free(const Eina_List *list)
1553 _elm_config_text_classes_free((Eina_List *)list);
1557 * Get Elementary's list of font overlays, set with
1558 * elm_font_overlay_set().
1560 * @return The font overlays list, with @c Elm_Font_Overlay blobs as
1565 * For each text class, one can set a <b>font overlay</b> for it,
1566 * overriding the default font properties for that class coming from
1567 * the theme in use. There is no need to free this list.
1569 * @see elm_font_overlay_set() and elm_font_overlay_unset().
1571 EAPI const Eina_List *
1572 elm_font_overlay_list_get(void)
1574 return _elm_config_font_overlays_list();
1578 * Set a font overlay for a given Elementary text class.
1580 * @param text_class Text class name
1581 * @param font Font name and style string
1582 * @param size Font size
1586 * @p font has to be in the format returned by
1587 * elm_font_fontconfig_name_get(). @see elm_font_overlay_list_get()
1588 * and @elm_font_overlay_unset().
1591 elm_font_overlay_set(const char *text_class,
1593 Evas_Font_Size size)
1595 _elm_config_font_overlay_set(text_class, font, size);
1599 * Unset a font overlay for a given Elementary text class.
1601 * @param text_class Text class name
1605 * This will bring back text elements belonging to text class @p
1606 * text_class back to their default font settings.
1609 elm_font_overlay_unset(const char *text_class)
1611 _elm_config_font_overlay_remove(text_class);
1615 * Apply the changes made with elm_font_overlay_set() and
1616 * elm_font_overlay_unset() on the current Elementary window.
1620 * This applies all font overlays set to all objects in the UI.
1623 elm_font_overlay_apply(void)
1625 _elm_config_font_overlay_apply();
1629 * Apply the changes made with elm_font_overlay_set() and
1630 * elm_font_overlay_unset() on all Elementary application windows.
1634 * This applies all font overlays set to all objects in the UI.
1637 elm_font_overlay_all_apply(void)
1639 #ifdef HAVE_ELEMENTARY_X
1640 static Ecore_X_Atom atom = 0;
1641 unsigned int dummy = (unsigned int)(1 * 1000.0);
1643 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_FONT_OVERLAY");
1644 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(), atom, &dummy,
1650 * Translate a font (family) name string in fontconfig's font names
1651 * syntax into an @c Elm_Font_Properties struct.
1653 * @param font The font name and styles string
1654 * @return the font properties struct
1658 * @note The reverse translation can be achived with
1659 * elm_font_fontconfig_name_get(), for one style only (single font
1660 * instance, not family).
1662 EAPI Elm_Font_Properties *
1663 elm_font_properties_get(const char *font)
1665 EINA_SAFETY_ON_NULL_RETURN_VAL(font, NULL);
1666 return _elm_font_properties_get(NULL, font);
1670 * Free font properties return by elm_font_properties_get().
1672 * @param efp the font properties struct
1677 elm_font_properties_free(Elm_Font_Properties *efp)
1681 EINA_SAFETY_ON_NULL_RETURN(efp);
1682 EINA_LIST_FREE(efp->styles, str)
1683 if (str) eina_stringshare_del(str);
1684 if (efp->name) eina_stringshare_del(efp->name);
1689 * Translate a font name, bound to a style, into fontconfig's font names
1692 * @param name The font (family) name
1693 * @param style The given style (may be @c NULL)
1695 * @return the font name and style string
1699 * @note The reverse translation can be achived with
1700 * elm_font_properties_get(), for one style only (single font
1701 * instance, not family).
1704 elm_font_fontconfig_name_get(const char *name,
1709 EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
1710 if (!style || style[0] == 0) return eina_stringshare_add(name);
1711 snprintf(buf, 256, "%s" ELM_FONT_TOKEN_STYLE "%s", name, style);
1712 return eina_stringshare_add(buf);
1716 * Free the font string return by elm_font_fontconfig_name_get().
1718 * @param efp the font properties struct
1723 elm_font_fontconfig_name_free(const char *name)
1725 eina_stringshare_del(name);
1729 * Create a font hash table of available system fonts.
1731 * One must call it with @p list being the return value of
1732 * evas_font_available_list(). The hash will be indexed by font
1733 * (family) names, being its values @c Elm_Font_Properties blobs.
1735 * @param list The list of available system fonts, as returned by
1736 * evas_font_available_list().
1737 * @return the font hash.
1741 * @note The user is supposed to get it populated at least with 3
1742 * default font families (Sans, Serif, Monospace), which should be
1743 * present on most systems.
1746 elm_font_available_hash_add(Eina_List *list)
1748 Eina_Hash *font_hash;
1754 /* populate with default font families */
1755 font_hash = _elm_font_available_hash_add(font_hash, "Sans:style=Regular");
1756 font_hash = _elm_font_available_hash_add(font_hash, "Sans:style=Bold");
1757 font_hash = _elm_font_available_hash_add(font_hash, "Sans:style=Oblique");
1758 font_hash = _elm_font_available_hash_add(font_hash,
1759 "Sans:style=Bold Oblique");
1761 font_hash = _elm_font_available_hash_add(font_hash, "Serif:style=Regular");
1762 font_hash = _elm_font_available_hash_add(font_hash, "Serif:style=Bold");
1763 font_hash = _elm_font_available_hash_add(font_hash, "Serif:style=Oblique");
1764 font_hash = _elm_font_available_hash_add(font_hash,
1765 "Serif:style=Bold Oblique");
1767 font_hash = _elm_font_available_hash_add(font_hash,
1768 "Monospace:style=Regular");
1769 font_hash = _elm_font_available_hash_add(font_hash,
1770 "Monospace:style=Bold");
1771 font_hash = _elm_font_available_hash_add(font_hash,
1772 "Monospace:style=Oblique");
1773 font_hash = _elm_font_available_hash_add(font_hash,
1774 "Monospace:style=Bold Oblique");
1776 EINA_LIST_FOREACH(list, l, key)
1777 font_hash = _elm_font_available_hash_add(font_hash, key);
1783 * Free the hash return by elm_font_available_hash_add().
1785 * @param hash the hash to be freed.
1790 elm_font_available_hash_del(Eina_Hash *hash)
1792 _elm_font_available_hash_del(hash);
1796 * @defgroup Fingers Fingers
1798 * Elementary is designed to be finger-friendly for touchscreens, and so in
1799 * addition to scaling for display resolution, it can also scale based on
1800 * finger "resolution" (or size).
1804 * Get the configured finger size
1806 * This gets the globally configured finger size in pixels
1808 * @return The finger size
1812 elm_finger_size_get(void)
1814 return _elm_config->finger_size;
1818 * Set the configured finger size
1820 * This sets the globally configured finger size in pixels
1822 * @param size The finger size
1826 elm_finger_size_set(Evas_Coord size)
1828 if (_elm_config->finger_size == size) return;
1829 _elm_config->finger_size = size;
1834 * Set the configured finger size for all applications on the display
1836 * This sets the globally configured finger size in pixels for all applications
1839 * @param size The finger size
1843 elm_finger_size_all_set(Evas_Coord size)
1845 #ifdef HAVE_ELEMENTARY_X
1846 static Ecore_X_Atom atom = 0;
1847 unsigned int size_i = (unsigned int)size;
1849 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_FINGER_SIZE");
1850 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
1856 * Adjust size of an element for finger usage
1858 * This takes width and height sizes (in pixels) as input and a size multiple
1859 * (which is how many fingers you want to place within the area), and adjusts
1860 * the size tobe large enough to accommodate finger. On return the w and h
1861 * sizes poiner do by these parameters will be modified.
1863 * @param times_w How many fingers should fit horizontally
1864 * @param w Pointer to the width size to adjust
1865 * @param times_h How many fingers should fit vertically
1866 * @param h Pointer to the height size to adjust
1870 elm_coords_finger_size_adjust(int times_w,
1875 if ((w) && (*w < (_elm_config->finger_size * times_w)))
1876 *w = _elm_config->finger_size * times_w;
1877 if ((h) && (*h < (_elm_config->finger_size * times_h)))
1878 *h = _elm_config->finger_size * times_h;
1882 * @defgroup Caches Caches
1884 * These are functions which let one fine-tune some cache values for
1885 * Elementary applications, thus allowing for performance adjustments.
1889 * Flush all caches & dump all data that can be to lean down to use
1900 edje_file_cache_flush();
1901 edje_collection_cache_flush();
1903 EINA_LIST_FOREACH(_elm_win_list, l, obj)
1905 Evas *e = evas_object_evas_get(obj);
1906 evas_image_cache_flush(e);
1907 evas_font_cache_flush(e);
1908 evas_render_dump(e);
1913 * Get the configured cache flush interval time
1915 * This gets the globally configured cache flush interval time, in
1918 * @return The cache flush interval time
1921 * @see elm_all_flush()
1924 elm_cache_flush_interval_get(void)
1926 return _elm_config->cache_flush_poll_interval;
1930 * Set the configured cache flush interval time
1932 * This sets the globally configured cache flush interval time, in ticks
1934 * @param size The cache flush interval time
1937 * @see elm_all_flush()
1940 elm_cache_flush_interval_set(int size)
1942 if (_elm_config->cache_flush_poll_interval == size) return;
1943 _elm_config->cache_flush_poll_interval = size;
1949 * Set the configured cache flush interval time for all applications on the
1952 * This sets the globally configured cache flush interval time -- in ticks
1953 * -- for all applications on the display.
1955 * @param size The cache flush interval time
1959 elm_cache_flush_interval_all_set(int size)
1961 #ifdef HAVE_ELEMENTARY_X
1962 static Ecore_X_Atom atom = 0;
1963 unsigned int size_i = (unsigned int)size;
1965 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_CACHE_FLUSH_INTERVAL");
1966 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
1972 * Get the configured cache flush enabled state
1974 * This gets the globally configured cache flush state - if it is enabled
1975 * or not. When cache flushing is enabled, elementary will regularly
1976 * (see elm_cache_flush_interval_get() ) flush caches and dump data out of
1977 * memory and allow usage to re-seed caches and data in memory where it
1978 * can do so. An idle application will thus minimise its memory usage as
1979 * data will be freed from memory and not be re-loaded as it is idle and
1980 * not rendering or doing anything graphically right now.
1982 * @return The cache flush state
1985 * @see elm_all_flush()
1988 elm_cache_flush_enmabled_get(void)
1990 return _elm_config->cache_flush_enable;
1994 * Set the configured cache flush enabled state
1996 * This sets the globally configured cache flush enabled state
1998 * @param size The cache flush enabled state
2001 * @see elm_all_flush()
2004 elm_cache_flush_enabled_set(Eina_Bool enabled)
2006 enabled = !!enabled;
2007 if (_elm_config->cache_flush_enable == enabled) return;
2008 _elm_config->cache_flush_enable = enabled;
2014 * Set the configured cache flush enabled state for all applications on the
2017 * This sets the globally configured cache flush enabled state for all
2018 * applications on the display.
2020 * @param size The cache flush enabled state
2024 elm_cache_flush_enabled_all_set(Eina_Bool enabled)
2026 #ifdef HAVE_ELEMENTARY_X
2027 static Ecore_X_Atom atom = 0;
2028 unsigned int enabled_i = (unsigned int)enabled;
2030 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_CACHE_FLUSH_ENABLE");
2031 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2032 atom, &enabled_i, 1);
2037 * Get the configured font cache size
2039 * This gets the globally configured font cache size, in bytes
2041 * @return The font cache size
2045 elm_font_cache_get(void)
2047 return _elm_config->font_cache;
2051 * Set the configured font cache size
2053 * This sets the globally configured font cache size, in bytes
2055 * @param size The font cache size
2059 elm_font_cache_set(int size)
2061 if (_elm_config->font_cache == size) return;
2062 _elm_config->font_cache = size;
2068 * Set the configured font cache size for all applications on the
2071 * This sets the globally configured font cache size -- in bytes
2072 * -- for all applications on the display.
2074 * @param size The font cache size
2078 elm_font_cache_all_set(int size)
2080 #ifdef HAVE_ELEMENTARY_X
2081 static Ecore_X_Atom atom = 0;
2082 unsigned int size_i = (unsigned int)size;
2084 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_FONT_CACHE");
2085 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2091 * Get the configured image cache size
2093 * This gets the globally configured image cache size, in bytes
2095 * @return The image cache size
2099 elm_image_cache_get(void)
2101 return _elm_config->image_cache;
2105 * Set the configured image cache size
2107 * This sets the globally configured image cache size, in bytes
2109 * @param size The image cache size
2113 elm_image_cache_set(int size)
2115 if (_elm_config->image_cache == size) return;
2116 _elm_config->image_cache = size;
2122 * Set the configured image cache size for all applications on the
2125 * This sets the globally configured image cache size -- in bytes
2126 * -- for all applications on the display.
2128 * @param size The image cache size
2132 elm_image_cache_all_set(int size)
2134 #ifdef HAVE_ELEMENTARY_X
2135 static Ecore_X_Atom atom = 0;
2136 unsigned int size_i = (unsigned int)size;
2138 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_IMAGE_CACHE");
2139 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2145 * Get the configured edje file cache size.
2147 * This gets the globally configured edje file cache size, in number
2150 * @return The edje file cache size
2154 elm_edje_file_cache_get(void)
2156 return _elm_config->edje_cache;
2160 * Set the configured edje file cache size
2162 * This sets the globally configured edje file cache size, in number
2165 * @param size The edje file cache size
2169 elm_edje_file_cache_set(int size)
2171 if (_elm_config->edje_cache == size) return;
2172 _elm_config->edje_cache = size;
2178 * Set the configured edje file cache size for all applications on the
2181 * This sets the globally configured edje file cache size -- in number
2182 * of files -- for all applications on the display.
2184 * @param size The edje file cache size
2188 elm_edje_file_cache_all_set(int size)
2190 #ifdef HAVE_ELEMENTARY_X
2191 static Ecore_X_Atom atom = 0;
2192 unsigned int size_i = (unsigned int)size;
2194 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_EDJE_FILE_CACHE");
2195 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2201 * Get the configured edje collections (groups) cache size.
2203 * This gets the globally configured edje collections cache size, in
2204 * number of collections.
2206 * @return The edje collections cache size
2210 elm_edje_collection_cache_get(void)
2212 return _elm_config->edje_collection_cache;
2216 * Set the configured edje collections (groups) cache size
2218 * This sets the globally configured edje collections cache size, in
2219 * number of collections.
2221 * @param size The edje collections cache size
2225 elm_edje_collection_cache_set(int size)
2227 if (_elm_config->edje_collection_cache == size) return;
2228 _elm_config->edje_collection_cache = size;
2234 * Set the configured edje collections (groups) cache size for all
2235 * applications on the display
2237 * This sets the globally configured edje collections cache size -- in
2238 * number of collections -- for all applications on the display.
2240 * @param size The edje collections cache size
2244 elm_edje_collection_cache_all_set(int size)
2246 #ifdef HAVE_ELEMENTARY_X
2247 static Ecore_X_Atom atom = 0;
2248 unsigned int size_i = (unsigned int)size;
2250 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_EDJE_COLLECTION_CACHE");
2251 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2257 * @defgroup Focus Focus
2259 * Objects have focus. This is what determines where the keyboard input goes to
2260 * within the application window.
2264 * Get the focus of the object
2266 * This gets the focused property of the object.
2268 * @param obj The object
2269 * @return 1 if the object is focused, 0 if not.
2273 elm_object_focus_get(const Evas_Object *obj)
2275 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
2276 return elm_widget_focus_get(obj);
2280 * Set the focus to the object
2282 * This sets the focus target for keyboard input to be the object indicated.
2284 * @param obj The object
2288 elm_object_focus(Evas_Object *obj)
2290 EINA_SAFETY_ON_NULL_RETURN(obj);
2291 if (elm_widget_focus_get(obj))
2294 elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
2298 * Remove the focus from the object
2300 * This removes the focus target for keyboard input from be the object
2303 * @param obj The object
2307 elm_object_unfocus(Evas_Object *obj)
2309 EINA_SAFETY_ON_NULL_RETURN(obj);
2310 if (!elm_widget_can_focus_get(obj)) return;
2311 elm_widget_focused_object_clear(obj);
2315 * Set the ability for the object to focus
2317 * This sets the ability for the object to be able to get keyboard focus or
2318 * not. By default all objects are able to be focused.
2320 * @param obj The object
2321 * @param enable 1 if the object can be focused, 0 if not
2325 elm_object_focus_allow_set(Evas_Object *obj,
2328 EINA_SAFETY_ON_NULL_RETURN(obj);
2329 elm_widget_can_focus_set(obj, enable);
2333 * Get the ability for the object to focus
2335 * This gets the ability for the object to be able to get keyboard focus or
2336 * not. By default all objects are able to be focused.
2338 * @param obj The object
2339 * @return 1 if the object is allowed to be focused, 0 if not.
2343 elm_object_focus_allow_get(const Evas_Object *obj)
2345 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
2346 return (elm_widget_can_focus_get(obj)) || (elm_widget_child_can_focus_get(obj));
2350 * Set custom focus chain.
2352 * This function i set one new and overwrite any previous custom focus chain
2353 * with the list of objects. The previous list will be deleted and this list
2354 * will be managed. After setted, don't modity it.
2356 * @note On focus cycle, only will be evaluated children of this container.
2358 * @param obj The container object
2359 * @param objs Chain of objects to pass focus
2363 elm_object_focus_custom_chain_set(Evas_Object *obj,
2366 EINA_SAFETY_ON_NULL_RETURN(obj);
2367 elm_widget_focus_custom_chain_set(obj, objs);
2371 * Unset custom focus chain
2373 * @param obj The container object
2377 elm_object_focus_custom_chain_unset(Evas_Object *obj)
2379 EINA_SAFETY_ON_NULL_RETURN(obj);
2380 elm_widget_focus_custom_chain_unset(obj);
2384 * Get custom focus chain
2386 * @param obj The container object
2389 EAPI const Eina_List *
2390 elm_object_focus_custom_chain_get(const Evas_Object *obj)
2392 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
2393 return elm_widget_focus_custom_chain_get(obj);
2397 * Append object to custom focus chain.
2399 * @note If relative_child equal to NULL or not in custom chain, the object
2400 * will be added in end.
2402 * @note On focus cycle, only will be evaluated children of this container.
2404 * @param obj The container object
2405 * @param child The child to be added in custom chain
2406 * @param relative_child The relative object to position the child
2410 elm_object_focus_custom_chain_append(Evas_Object *obj,
2412 Evas_Object *relative_child)
2414 EINA_SAFETY_ON_NULL_RETURN(obj);
2415 EINA_SAFETY_ON_NULL_RETURN(child);
2416 elm_widget_focus_custom_chain_append(obj, child, relative_child);
2420 * Prepend object to custom focus chain.
2422 * @note If relative_child equal to NULL or not in custom chain, the object
2423 * will be added in begin.
2425 * @note On focus cycle, only will be evaluated children of this container.
2427 * @param obj The container object
2428 * @param child The child to be added in custom chain
2429 * @param relative_child The relative object to position the child
2433 elm_object_focus_custom_chain_prepend(Evas_Object *obj,
2435 Evas_Object *relative_child)
2437 EINA_SAFETY_ON_NULL_RETURN(obj);
2438 EINA_SAFETY_ON_NULL_RETURN(child);
2439 elm_widget_focus_custom_chain_prepend(obj, child, relative_child);
2443 * Give focus to next object in object tree.
2445 * Give focus to next object in focus chain of one object sub-tree.
2446 * If the last object of chain already have focus, the focus will go to the
2447 * first object of chain.
2449 * @param obj The object root of sub-tree
2450 * @param dir Direction to cycle the focus
2455 elm_object_focus_cycle(Evas_Object *obj,
2456 Elm_Focus_Direction dir)
2458 EINA_SAFETY_ON_NULL_RETURN(obj);
2459 elm_widget_focus_cycle(obj, dir);
2463 * Give focus to near object in one direction.
2465 * Give focus to near object in direction of one object.
2466 * If none focusable object in given direction, the focus will not change.
2468 * @param obj The reference object
2469 * @param x Horizontal component of direction to focus
2470 * @param y Vertical component of direction to focus
2475 elm_object_focus_direction_go(Evas_Object *obj,
2479 EINA_SAFETY_ON_NULL_RETURN(obj);
2480 elm_widget_focus_direction_go(obj, x, y);
2484 * Get the enable status of the focus highlight
2486 * This gets whether the highlight on focused objects is enabled or not
2490 elm_focus_highlight_enabled_get(void)
2492 return _elm_config->focus_highlight_enable;
2496 * Set the enable status of the focus highlight
2498 * Set whether to show or not the highlight on focused objects
2499 * @param enable Enable highlight if EINA_TRUE, disable otherwise
2503 elm_focus_highlight_enabled_set(Eina_Bool enable)
2505 _elm_config->focus_highlight_enable = !!enable;
2509 * Get the enable status of the highlight animation
2511 * Get whether the focus highlight, if enabled, will animate its switch from
2512 * one object to the next
2516 elm_focus_highlight_animate_get(void)
2518 return _elm_config->focus_highlight_animate;
2522 * Set the enable status of the highlight animation
2524 * Set whether the focus highlight, if enabled, will animate its switch from
2525 * one object to the next
2526 * @param animate Enable animation if EINA_TRUE, disable otherwise
2530 elm_focus_highlight_animate_set(Eina_Bool animate)
2532 _elm_config->focus_highlight_animate = !!animate;
2536 * @defgroup Scrolling Scrolling
2538 * These are functions setting how scrollable views in Elementary
2539 * widgets should behave on user interaction.
2543 * Get whether scrollers should bounce when they reach their
2544 * viewport's edge during a scroll.
2546 * @return the thumb scroll bouncing state
2548 * This is the default behavior for touch screens, in general.
2549 * @ingroup Scrolling
2552 elm_scroll_bounce_enabled_get(void)
2554 return _elm_config->thumbscroll_bounce_enable;
2558 * Set whether scrollers should bounce when they reach their
2559 * viewport's edge during a scroll.
2561 * @param enabled the thumb scroll bouncing state
2563 * @see elm_thumbscroll_bounce_enabled_get()
2564 * @ingroup Scrolling
2567 elm_scroll_bounce_enabled_set(Eina_Bool enabled)
2569 _elm_config->thumbscroll_bounce_enable = enabled;
2573 * Set whether scrollers should bounce when they reach their
2574 * viewport's edge during a scroll, for all Elementary application
2577 * @param enabled the thumb scroll bouncing state
2579 * @see elm_thumbscroll_bounce_enabled_get()
2580 * @ingroup Scrolling
2583 elm_scroll_bounce_enabled_all_set(Eina_Bool enabled)
2585 #ifdef HAVE_ELEMENTARY_X
2586 static Ecore_X_Atom atom = 0;
2587 unsigned int bounce_enable_i = (unsigned int)enabled;
2590 atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_BOUNCE_ENABLE");
2591 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2592 atom, &bounce_enable_i, 1);
2597 * Get the amount of inertia a scroller will impose at bounce
2600 * @return the thumb scroll bounce friction
2602 * @ingroup Scrolling
2605 elm_scroll_bounce_friction_get(void)
2607 return _elm_config->thumbscroll_bounce_friction;
2611 * Set the amount of inertia a scroller will impose at bounce
2614 * @param friction the thumb scroll bounce friction
2616 * @see elm_thumbscroll_bounce_friction_get()
2617 * @ingroup Scrolling
2620 elm_scroll_bounce_friction_set(double friction)
2622 _elm_config->thumbscroll_bounce_friction = friction;
2626 * Set the amount of inertia a scroller will impose at bounce
2627 * animations, for all Elementary application windows.
2629 * @param friction the thumb scroll bounce friction
2631 * @see elm_thumbscroll_bounce_friction_get()
2632 * @ingroup Scrolling
2635 elm_scroll_bounce_friction_all_set(double friction)
2637 #ifdef HAVE_ELEMENTARY_X
2638 static Ecore_X_Atom atom = 0;
2639 unsigned int bounce_friction_i = (unsigned int)(friction * 1000.0);
2642 atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_BOUNCE_FRICTION");
2643 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2644 atom, &bounce_friction_i, 1);
2649 * Get the amount of inertia a <b>paged</b> scroller will impose at
2650 * page fitting animations.
2652 * @return the page scroll friction
2654 * @ingroup Scrolling
2657 elm_scroll_page_scroll_friction_get(void)
2659 return _elm_config->page_scroll_friction;
2663 * Set the amount of inertia a <b>paged</b> scroller will impose at
2664 * page fitting animations.
2666 * @param friction the page scroll friction
2668 * @see elm_thumbscroll_page_scroll_friction_get()
2669 * @ingroup Scrolling
2672 elm_scroll_page_scroll_friction_set(double friction)
2674 _elm_config->page_scroll_friction = friction;
2678 * Set the amount of inertia a <b>paged</b> scroller will impose at
2679 * page fitting animations, for all Elementary application windows.
2681 * @param friction the page scroll friction
2683 * @see elm_thumbscroll_page_scroll_friction_get()
2684 * @ingroup Scrolling
2687 elm_scroll_page_scroll_friction_all_set(double friction)
2689 #ifdef HAVE_ELEMENTARY_X
2690 static Ecore_X_Atom atom = 0;
2691 unsigned int page_scroll_friction_i = (unsigned int)(friction * 1000.0);
2694 atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_PAGE_SCROLL_FRICTION");
2695 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2696 atom, &page_scroll_friction_i, 1);
2701 * Get the amount of inertia a scroller will impose at region bring
2704 * @return the bring in scroll friction
2706 * @ingroup Scrolling
2709 elm_scroll_bring_in_scroll_friction_get(void)
2711 return _elm_config->bring_in_scroll_friction;
2715 * Set the amount of inertia a scroller will impose at region bring
2718 * @param friction the bring in scroll friction
2720 * @see elm_thumbscroll_bring_in_scroll_friction_get()
2721 * @ingroup Scrolling
2724 elm_scroll_bring_in_scroll_friction_set(double friction)
2726 _elm_config->bring_in_scroll_friction = friction;
2730 * Set the amount of inertia a scroller will impose at region bring
2731 * animations, for all Elementary application windows.
2733 * @param friction the bring in scroll friction
2735 * @see elm_thumbscroll_bring_in_scroll_friction_get()
2736 * @ingroup Scrolling
2739 elm_scroll_bring_in_scroll_friction_all_set(double friction)
2741 #ifdef HAVE_ELEMENTARY_X
2742 static Ecore_X_Atom atom = 0;
2743 unsigned int bring_in_scroll_friction_i = (unsigned int)(friction * 1000.0);
2747 ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_BRING_IN_SCROLL_FRICTION");
2748 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2749 atom, &bring_in_scroll_friction_i, 1);
2754 * Get the amount of inertia scrollers will impose at animations
2755 * triggered by Elementary widgets' zooming API.
2757 * @return the zoom friction
2759 * @ingroup Scrolling
2762 elm_scroll_zoom_friction_get(void)
2764 return _elm_config->zoom_friction;
2768 * Set the amount of inertia scrollers will impose at animations
2769 * triggered by Elementary widgets' zooming API.
2771 * @param friction the zoom friction
2773 * @see elm_thumbscroll_zoom_friction_get()
2774 * @ingroup Scrolling
2777 elm_scroll_zoom_friction_set(double friction)
2779 _elm_config->zoom_friction = friction;
2783 * Set the amount of inertia scrollers will impose at animations
2784 * triggered by Elementary widgets' zooming API, for all Elementary
2785 * application windows.
2787 * @param friction the zoom friction
2789 * @see elm_thumbscroll_zoom_friction_get()
2790 * @ingroup Scrolling
2793 elm_scroll_zoom_friction_all_set(double friction)
2795 #ifdef HAVE_ELEMENTARY_X
2796 static Ecore_X_Atom atom = 0;
2797 unsigned int zoom_friction_i = (unsigned int)(friction * 1000.0);
2800 atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_ZOOM_FRICTION");
2801 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2802 atom, &zoom_friction_i, 1);
2807 * Get whether scrollers should be draggable from any point in their
2810 * @return the thumb scroll state
2812 * @note This is the default behavior for touch screens, in general.
2813 * @note All other functions namespaced with "thumbscroll" will only
2814 * have effect if this mode is enabled.
2816 * @ingroup Scrolling
2819 elm_scroll_thumbscroll_enabled_get(void)
2821 return _elm_config->thumbscroll_enable;
2825 * Set whether scrollers should be draggable from any point in their
2828 * @param enabled the thumb scroll state
2830 * @see elm_thumbscroll_enabled_get()
2831 * @ingroup Scrolling
2834 elm_scroll_thumbscroll_enabled_set(Eina_Bool enabled)
2836 _elm_config->thumbscroll_enable = enabled;
2840 * Set whether scrollers should be draggable from any point in their
2841 * views, for all Elementary application windows.
2843 * @param enabled the thumb scroll state
2845 * @see elm_thumbscroll_enabled_get()
2846 * @ingroup Scrolling
2849 elm_scroll_thumbscroll_enabled_all_set(Eina_Bool enabled)
2851 #ifdef HAVE_ELEMENTARY_X
2852 static Ecore_X_Atom atom = 0;
2853 unsigned int ts_enable_i = (unsigned int)enabled;
2855 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_ENABLE");
2856 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2857 atom, &ts_enable_i, 1);
2862 * Get the number of pixels one should travel while dragging a
2863 * scroller's view to actually trigger scrolling.
2865 * @return the thumb scroll threshould
2867 * One would use higher values for touch screens, in general, because
2868 * of their inherent imprecision.
2869 * @ingroup Scrolling
2872 elm_scroll_thumbscroll_threshold_get(void)
2874 return _elm_config->thumbscroll_threshold;
2878 * Set the number of pixels one should travel while dragging a
2879 * scroller's view to actually trigger scrolling.
2881 * @param threshold the thumb scroll threshould
2883 * @see elm_thumbscroll_threshould_get()
2884 * @ingroup Scrolling
2887 elm_scroll_thumbscroll_threshold_set(unsigned int threshold)
2889 _elm_config->thumbscroll_threshold = threshold;
2893 * Set the number of pixels one should travel while dragging a
2894 * scroller's view to actually trigger scrolling, for all Elementary
2895 * application windows.
2897 * @param threshold the thumb scroll threshould
2899 * @see elm_thumbscroll_threshould_get()
2900 * @ingroup Scrolling
2903 elm_scroll_thumbscroll_threshold_all_set(unsigned int threshold)
2905 #ifdef HAVE_ELEMENTARY_X
2906 static Ecore_X_Atom atom = 0;
2907 unsigned int ts_threshold_i = (unsigned int)threshold;
2909 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_THRESHOLD");
2910 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2911 atom, &ts_threshold_i, 1);
2916 * Get the minimum speed of mouse cursor movement which will trigger
2917 * list self scrolling animation after a mouse up event
2920 * @return the thumb scroll momentum threshould
2922 * @ingroup Scrolling
2925 elm_scroll_thumbscroll_momentum_threshold_get(void)
2927 return _elm_config->thumbscroll_momentum_threshold;
2931 * Set the minimum speed of mouse cursor movement which will trigger
2932 * list self scrolling animation after a mouse up event
2935 * @param threshold the thumb scroll momentum threshould
2937 * @see elm_thumbscroll_momentum_threshould_get()
2938 * @ingroup Scrolling
2941 elm_scroll_thumbscroll_momentum_threshold_set(double threshold)
2943 _elm_config->thumbscroll_momentum_threshold = threshold;
2947 * Set the minimum speed of mouse cursor movement which will trigger
2948 * list self scrolling animation after a mouse up event
2949 * (pixels/second), for all Elementary application windows.
2951 * @param threshold the thumb scroll momentum threshould
2953 * @see elm_thumbscroll_momentum_threshould_get()
2954 * @ingroup Scrolling
2957 elm_scroll_thumbscroll_momentum_threshold_all_set(double threshold)
2959 #ifdef HAVE_ELEMENTARY_X
2960 static Ecore_X_Atom atom = 0;
2961 unsigned int ts_momentum_threshold_i = (unsigned int)(threshold * 1000.0);
2964 atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_MOMENTUM_THRESHOLD");
2965 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2966 atom, &ts_momentum_threshold_i, 1);
2971 * Get the amount of inertia a scroller will impose at self scrolling
2974 * @return the thumb scroll friction
2976 * @ingroup Scrolling
2979 elm_scroll_thumbscroll_friction_get(void)
2981 return _elm_config->thumbscroll_friction;
2985 * Set the amount of inertia a scroller will impose at self scrolling
2988 * @param friction the thumb scroll friction
2990 * @see elm_thumbscroll_friction_get()
2991 * @ingroup Scrolling
2994 elm_scroll_thumbscroll_friction_set(double friction)
2996 _elm_config->thumbscroll_friction = friction;
3000 * Set the amount of inertia a scroller will impose at self scrolling
3001 * animations, for all Elementary application windows.
3003 * @param friction the thumb scroll friction
3005 * @see elm_thumbscroll_friction_get()
3006 * @ingroup Scrolling
3009 elm_scroll_thumbscroll_friction_all_set(double friction)
3011 #ifdef HAVE_ELEMENTARY_X
3012 static Ecore_X_Atom atom = 0;
3013 unsigned int ts_friction_i = (unsigned int)(friction * 1000.0);
3015 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_FRICTION");
3016 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
3017 atom, &ts_friction_i, 1);
3022 * Get the amount of lag between your actual mouse cursor dragging
3023 * movement and a scroller's view movement itself, while pushing it
3024 * into bounce state manually.
3026 * @return the thumb scroll border friction
3028 * @ingroup Scrolling
3031 elm_scroll_thumbscroll_border_friction_get(void)
3033 return _elm_config->thumbscroll_border_friction;
3037 * Set the amount of lag between your actual mouse cursor dragging
3038 * movement and a scroller's view movement itself, while pushing it
3039 * into bounce state manually.
3041 * @param friction the thumb scroll border friction. @c 0.0 for
3042 * perfect synchrony between two movements, @c 1.0 for maximum
3045 * @see elm_thumbscroll_border_friction_get()
3046 * @note parameter value will get bound to 0.0 - 1.0 interval, always
3048 * @ingroup Scrolling
3051 elm_scroll_thumbscroll_border_friction_set(double friction)
3059 _elm_config->thumbscroll_friction = friction;
3063 * Set the amount of lag between your actual mouse cursor dragging
3064 * movement and a scroller's view movement itself, while pushing it
3065 * into bounce state manually, for all Elementary application windows.
3067 * @param friction the thumb scroll border friction. @c 0.0 for
3068 * perfect synchrony between two movements, @c 1.0 for maximum
3071 * @see elm_thumbscroll_border_friction_get()
3072 * @note parameter value will get bound to 0.0 - 1.0 interval, always
3074 * @ingroup Scrolling
3077 elm_scroll_thumbscroll_border_friction_all_set(double friction)
3085 #ifdef HAVE_ELEMENTARY_X
3086 static Ecore_X_Atom atom = 0;
3087 unsigned int border_friction_i = (unsigned int)(friction * 1000.0);
3090 atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_BORDER_FRICTION");
3091 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
3092 atom, &border_friction_i, 1);
3097 * @defgroup Scrollhints Scrollhints
3099 * Objects when inside a scroller can scroll, but this may not always be
3100 * desirable in certain situations. This allows an object to hint to itself
3101 * and parents to "not scroll" in one of 2 ways.
3103 * 1. To hold on scrolling. This means just flicking and dragging may no
3104 * longer scroll, but pressing/dragging near an edge of the scroller will
3105 * still scroll. This is automastically used by the entry object when
3107 * 2. To totally freeze scrolling. This means it stops. until popped/released.
3111 * Push the scroll hold by 1
3113 * This increments the scroll hold count by one. If it is more than 0 it will
3114 * take effect on the parents of the indicated object.
3116 * @param obj The object
3117 * @ingroup Scrollhints
3120 elm_object_scroll_hold_push(Evas_Object *obj)
3122 EINA_SAFETY_ON_NULL_RETURN(obj);
3123 elm_widget_scroll_hold_push(obj);
3127 * Pop the scroll hold by 1
3129 * This decrements the scroll hold count by one. If it is more than 0 it will
3130 * take effect on the parents of the indicated object.
3132 * @param obj The object
3133 * @ingroup Scrollhints
3136 elm_object_scroll_hold_pop(Evas_Object *obj)
3138 EINA_SAFETY_ON_NULL_RETURN(obj);
3139 elm_widget_scroll_hold_pop(obj);
3143 * Push the scroll freeze by 1
3145 * This increments the scroll freeze count by one. If it is more than 0 it will
3146 * take effect on the parents of the indicated object.
3148 * @param obj The object
3149 * @ingroup Scrollhints
3152 elm_object_scroll_freeze_push(Evas_Object *obj)
3154 EINA_SAFETY_ON_NULL_RETURN(obj);
3155 elm_widget_scroll_freeze_push(obj);
3159 * Lock the scrolling of the given widget (and thus all parents)
3161 * This locks the given object from scrolling in the X axis (and implicitly
3162 * also locks all parent scrollers too from doing the same).
3164 * @param obj The object
3165 * @param lock The lock state (1 == locked, 0 == unlocked)
3166 * @ingroup Scrollhints
3169 elm_object_scroll_lock_x_set(Evas_Object *obj,
3172 EINA_SAFETY_ON_NULL_RETURN(obj);
3173 elm_widget_drag_lock_x_set(obj, lock);
3177 * Lock the scrolling of the given widget (and thus all parents)
3179 * This locks the given object from scrolling in the Y axis (and implicitly
3180 * also locks all parent scrollers too from doing the same).
3182 * @param obj The object
3183 * @param lock The lock state (1 == locked, 0 == unlocked)
3184 * @ingroup Scrollhints
3187 elm_object_scroll_lock_y_set(Evas_Object *obj,
3190 EINA_SAFETY_ON_NULL_RETURN(obj);
3191 elm_widget_drag_lock_y_set(obj, lock);
3195 * Get the scrolling lock of the given widget
3197 * This gets the lock for X axis scrolling.
3199 * @param obj The object
3200 * @ingroup Scrollhints
3203 elm_object_scroll_lock_x_get(const Evas_Object *obj)
3205 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
3206 return elm_widget_drag_lock_x_get(obj);
3210 * Get the scrolling lock of the given widget
3212 * This gets the lock for X axis scrolling.
3214 * @param obj The object
3215 * @ingroup Scrollhints
3218 elm_object_scroll_lock_y_get(const Evas_Object *obj)
3220 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
3221 return elm_widget_drag_lock_y_get(obj);
3225 * Pop the scroll freeze by 1
3227 * This decrements the scroll freeze count by one. If it is more than 0 it will
3228 * take effect on the parents of the indicated object.
3230 * @param obj The object
3231 * @ingroup Scrollhints
3234 elm_object_scroll_freeze_pop(Evas_Object *obj)
3236 EINA_SAFETY_ON_NULL_RETURN(obj);
3237 elm_widget_scroll_freeze_pop(obj);
3241 * @defgroup WidgetNavigation Widget Tree Navigation.
3243 * How to check if an Evas Object is an Elementary widget? How to get
3244 * the first elementary widget that is parent of the given object?
3245 * These are all covered in widget tree navigation.
3249 * Check if the given Evas Object is an Elementary widget.
3251 * @param obj the object to query.
3252 * @return @c EINA_TRUE if it is an elementary widget variant,
3253 * @c EINA_FALSE otherwise
3254 * @ingroup WidgetNavigation
3257 elm_object_widget_check(const Evas_Object *obj)
3259 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
3260 return elm_widget_is(obj);
3264 * Get the first parent of the given object that is an Elementary widget.
3266 * @param obj the object to query.
3267 * @return the parent object that is an Elementary widget, or @c NULL
3268 * if no parent is, or no parents at all.
3269 * @ingroup WidgetNavigation
3272 elm_object_parent_widget_get(const Evas_Object *obj)
3274 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
3275 return elm_widget_parent_widget_get(obj);
3279 * Get the top level parent of an Elementary widget.
3281 * @param obj The object to query.
3282 * @return The top level Elementary widget, or @c NULL if parent cannot be
3284 * @ingroup WidgetNavigation
3287 elm_object_top_widget_get(const Evas_Object *obj)
3289 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
3290 return elm_widget_top_get(obj);
3294 * Get the string that represents this Elementary widget.
3296 * @note Elementary is weird and exposes itself as a single
3297 * Evas_Object_Smart_Class of type "elm_widget", so
3298 * evas_object_type_get() always return that, making debug and
3299 * language bindings hard. This function tries to mitigate this
3300 * problem, but the solution is to change Elementary to use
3301 * proper inheritance.
3303 * @param obj the object to query.
3304 * @return Elementary widget name, or @c NULL if not a valid widget.
3305 * @ingroup WidgetNavigation
3308 elm_object_widget_type_get(const Evas_Object *obj)
3310 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
3311 return elm_widget_type_get(obj);
3315 * Send a signal to the widget edje object.
3317 * This function sends a signal to the edje object of the obj. An edje program
3318 * can respond to a signal by specifying matching 'signal' and
3321 * @param obj The object
3322 * @param emission The signal's name.
3323 * @param source The signal's source.
3327 elm_object_signal_emit(Evas_Object *obj,
3328 const char *emission,
3331 EINA_SAFETY_ON_NULL_RETURN(obj);
3332 elm_widget_signal_emit(obj, emission, source);
3336 * Add a callback for a signal emitted by widget edje object.
3338 * This function connects a callback function to a signal emitted by the
3339 * edje object of the obj.
3340 * Globs can occur in either the emission or source name.
3342 * @param obj The object
3343 * @param emission The signal's name.
3344 * @param source The signal's source.
3345 * @param func The callback function to be executed when the signal is
3347 * @param data A pointer to data to pass in to the callback function.
3351 elm_object_signal_callback_add(Evas_Object *obj, const char *emission, const char *source, void (*func) (void *data, Evas_Object *o, const char *emission, const char *source), void *data)
3353 EINA_SAFETY_ON_NULL_RETURN(obj);
3354 EINA_SAFETY_ON_NULL_RETURN(func);
3355 elm_widget_signal_callback_add(obj, emission, source, func, data);
3359 * Remove a signal-triggered callback from an widget edje object.
3361 * This function removes a callback, previoulsy attached to a signal emitted
3362 * by the edje object of the obj.
3363 * The parameters emission, source and func must match exactly those passed to
3364 * a previous call to elm_object_signal_callback_add(). The data pointer that
3365 * was passed to this call will be returned.
3367 * @param obj The object
3368 * @param emission The signal's name.
3369 * @param source The signal's source.
3370 * @param func The callback function to be executed when the signal is
3372 * @return The data pointer
3376 elm_object_signal_callback_del(Evas_Object *obj, const char *emission, const char *source, void (*func) (void *data, Evas_Object *o, const char *emission, const char *source))
3378 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
3379 EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
3380 return elm_widget_signal_callback_del(obj, emission, source, func);
3384 * Add a callback for a event emitted by widget or their children.
3386 * This function connects a callback function to any key_down key_up event
3387 * emitted by the @p obj or their children.
3388 * This only will be called if no other callback has consumed the event.
3389 * If you want consume the event, and no other get it, func should return
3390 * EINA_TRUE and put EVAS_EVENT_FLAG_ON_HOLD in event_flags.
3392 * @warning Accept duplicated callback addition.
3394 * @param obj The object
3395 * @param func The callback function to be executed when the event is
3397 * @param data Data to pass in to the callback function.
3401 elm_object_event_callback_add(Evas_Object *obj, Elm_Event_Cb func, const void *data)
3403 EINA_SAFETY_ON_NULL_RETURN(obj);
3404 EINA_SAFETY_ON_NULL_RETURN(func);
3405 elm_widget_event_callback_add(obj, func, data);
3409 * Remove a event callback from an widget.
3411 * This function removes a callback, previoulsy attached to event emission
3413 * The parameters func and data must match exactly those passed to
3414 * a previous call to elm_object_event_callback_add(). The data pointer that
3415 * was passed to this call will be returned.
3417 * @param obj The object
3418 * @param func The callback function to be executed when the event is
3420 * @param data Data to pass in to the callback function.
3421 * @return The data pointer
3425 elm_object_event_callback_del(Evas_Object *obj, Elm_Event_Cb func, const void *data)
3427 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
3428 EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
3429 return elm_widget_event_callback_del(obj, func, data);
3434 * @defgroup Debug Debug
3438 * Print Tree object hierarchy in stdout
3440 * @param obj The root object
3444 elm_object_tree_dump(const Evas_Object *top)
3447 elm_widget_tree_dump(top);
3455 * Print Elm Objects tree hierarchy in file as dot(graphviz) syntax.
3457 * @param obj The root object
3458 * @param file The path of output file
3462 elm_object_tree_dot_dump(const Evas_Object *top,
3466 FILE *f = fopen(file, "w");
3467 elm_widget_tree_dot_dump(top, f);
3477 * Set the duration for occuring long press event.
3479 * @param lonpress_timeout Timeout for long press event
3480 * @ingroup Longpress
3483 elm_longpress_timeout_set(double longpress_timeout)
3485 _elm_config->longpress_timeout = longpress_timeout;
3489 * Get the duration for occuring long press event.
3491 * @return Timeout for long press event
3492 * @ingroup Longpress
3495 elm_longpress_timeout_get(void)
3497 return _elm_config->longpress_timeout;