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. Use 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-generated 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 static Eina_Prefix *pfx = NULL;
294 char *_elm_appname = NULL;
295 const char *_elm_data_dir = NULL;
296 const char *_elm_lib_dir = NULL;
297 int _elm_log_dom = -1;
299 EAPI int ELM_EVENT_POLICY_CHANGED = 0;
301 static int _elm_init_count = 0;
302 static int _elm_sub_init_count = 0;
303 static int _elm_ql_init_count = 0;
304 static int _elm_policies[ELM_POLICY_LAST];
305 static Ecore_Event_Handler *_elm_exit_handler = NULL;
306 static Eina_Bool quicklaunch_on = 0;
309 _elm_signal_exit(void *data __UNUSED__,
310 int ev_type __UNUSED__,
314 return ECORE_CALLBACK_PASS_ON;
320 edje_scale_set(_elm_config->scale);
321 _elm_win_rescale(NULL, EINA_FALSE);
324 static void *app_mainfunc = NULL;
325 static const char *app_domain = NULL;
326 static const char *app_checkfile = NULL;
328 static const char *app_compile_bin_dir = NULL;
329 static const char *app_compile_lib_dir = NULL;
330 static const char *app_compile_data_dir = NULL;
331 static const char *app_compile_locale_dir = NULL;
332 static const char *app_prefix_dir = NULL;
333 static const char *app_bin_dir = NULL;
334 static const char *app_lib_dir = NULL;
335 static const char *app_data_dir = NULL;
336 static const char *app_locale_dir = NULL;
338 static Eina_Prefix *app_pfx = NULL;
345 const char *dirs[4] = { NULL, NULL, NULL, NULL };
346 char *caps = NULL, *p1, *p2;
349 if (!app_domain) return;
351 ecore_app_args_get(&argc, &argv);
352 if (argc < 1) return;
354 dirs[0] = app_compile_bin_dir;
355 dirs[1] = app_compile_lib_dir;
356 dirs[2] = app_compile_data_dir;
357 dirs[3] = app_compile_locale_dir;
359 if (!dirs[1]) dirs[1] = dirs[0];
360 if (!dirs[0]) dirs[0] = dirs[1];
361 if (!dirs[3]) dirs[3] = dirs[2];
362 if (!dirs[2]) dirs[2] = dirs[3];
366 caps = alloca(strlen(app_domain) + 1);
367 for (p1 = (char *)app_domain, p2 = caps; *p1; p1++, p2++)
371 app_pfx = eina_prefix_new(argv[0], app_mainfunc, caps, app_domain,
372 app_checkfile, dirs[0], dirs[1], dirs[2], dirs[3]);
376 _prefix_shutdown(void)
378 if (app_pfx) eina_prefix_free(app_pfx);
379 if (app_domain) eina_stringshare_del(app_domain);
380 if (app_checkfile) eina_stringshare_del(app_checkfile);
381 if (app_compile_bin_dir) eina_stringshare_del(app_compile_bin_dir);
382 if (app_compile_lib_dir) eina_stringshare_del(app_compile_lib_dir);
383 if (app_compile_data_dir) eina_stringshare_del(app_compile_data_dir);
384 if (app_compile_locale_dir) eina_stringshare_del(app_compile_locale_dir);
385 if (app_prefix_dir) eina_stringshare_del(app_prefix_dir);
386 if (app_bin_dir) eina_stringshare_del(app_bin_dir);
387 if (app_lib_dir) eina_stringshare_del(app_lib_dir);
388 if (app_data_dir) eina_stringshare_del(app_data_dir);
389 if (app_locale_dir) eina_stringshare_del(app_locale_dir);
392 app_checkfile = NULL;
393 app_compile_bin_dir = NULL;
394 app_compile_lib_dir = NULL;
395 app_compile_data_dir = NULL;
396 app_compile_locale_dir = NULL;
397 app_prefix_dir = NULL;
401 app_locale_dir = NULL;
410 if (_elm_init_count > 1) return _elm_init_count;
411 elm_quicklaunch_init(argc, argv);
412 elm_quicklaunch_sub_init(argc, argv);
414 return _elm_init_count;
421 if (_elm_init_count > 0) return _elm_init_count;
423 while (_elm_win_deferred_free) ecore_main_loop_iterate();
425 // _prefix_shutdown();
426 elm_quicklaunch_sub_shutdown();
427 elm_quicklaunch_shutdown();
428 return _elm_init_count;
432 elm_app_info_set(void *mainfunc, const char *dom, const char *checkfile)
434 app_mainfunc = mainfunc;
435 eina_stringshare_replace(&app_domain, dom);
436 eina_stringshare_replace(&app_checkfile, checkfile);
440 elm_app_compile_bin_dir_set(const char *dir)
442 eina_stringshare_replace(&app_compile_bin_dir, dir);
446 elm_app_compile_lib_dir_set(const char *dir)
448 eina_stringshare_replace(&app_compile_lib_dir, dir);
452 elm_app_compile_data_dir_set(const char *dir)
454 eina_stringshare_replace(&app_compile_data_dir, dir);
458 elm_app_compile_locale_set(const char *dir)
460 eina_stringshare_replace(&app_compile_locale_dir, dir);
464 elm_app_prefix_dir_get(void)
466 if (app_prefix_dir) return app_prefix_dir;
468 if (!app_pfx) return "";
469 app_prefix_dir = eina_prefix_get(app_pfx);
470 return app_prefix_dir;
474 elm_app_bin_dir_get(void)
476 if (app_bin_dir) return app_bin_dir;
478 if (!app_pfx) return "";
479 app_bin_dir = eina_prefix_bin_get(app_pfx);
484 elm_app_lib_dir_get(void)
486 if (app_lib_dir) return app_lib_dir;
488 if (!app_pfx) return "";
489 app_lib_dir = eina_prefix_lib_get(app_pfx);
494 elm_app_data_dir_get(void)
496 if (app_data_dir) return app_data_dir;
498 if (!app_pfx) return "";
499 app_data_dir = eina_prefix_data_get(app_pfx);
504 elm_app_locale_dir_get(void)
506 if (app_locale_dir) return app_locale_dir;
508 if (!app_pfx) return "";
509 app_locale_dir = eina_prefix_locale_get(app_pfx);
510 return app_locale_dir;
514 static int _elm_need_e_dbus = 0;
517 elm_need_e_dbus(void)
520 if (_elm_need_e_dbus++) return EINA_TRUE;
529 _elm_unneed_e_dbus(void)
532 if (--_elm_need_e_dbus) return;
534 _elm_need_e_dbus = 0;
540 static int _elm_need_efreet = 0;
543 elm_need_efreet(void)
546 if (_elm_need_efreet++) return EINA_TRUE;
554 list = efreet_icon_extra_list_get();
557 e_user_dir_concat_static(buf, "icons");
558 *list = eina_list_prepend(*list, (void *)eina_stringshare_add(buf));
559 e_prefix_data_concat_static(buf, "data/icons");
560 *list = eina_list_prepend(*list, (void *)eina_stringshare_add(buf));
571 _elm_unneed_efreet(void)
574 if (--_elm_need_efreet) return;
576 _elm_need_efreet = 0;
577 efreet_trash_shutdown();
578 efreet_mime_shutdown();
584 elm_quicklaunch_mode_set(Eina_Bool ql_on)
586 quicklaunch_on = ql_on;
590 elm_quicklaunch_mode_get(void)
592 return quicklaunch_on;
596 elm_quicklaunch_init(int argc,
599 _elm_ql_init_count++;
600 if (_elm_ql_init_count > 1) return _elm_ql_init_count;
602 _elm_log_dom = eina_log_domain_register("elementary", EINA_COLOR_LIGHTBLUE);
605 EINA_LOG_ERR("could not register elementary log domain.");
606 _elm_log_dom = EINA_LOG_DOMAIN_GLOBAL;
612 #ifdef HAVE_ELEMENTARY_EMAP
615 ecore_app_args_set(argc, (const char **)argv);
617 memset(_elm_policies, 0, sizeof(_elm_policies));
618 if (!ELM_EVENT_POLICY_CHANGED)
619 ELM_EVENT_POLICY_CHANGED = ecore_event_type_new();
623 _elm_exit_handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _elm_signal_exit, NULL);
625 if (argv) _elm_appname = strdup(ecore_file_file_get(argv[0]));
627 pfx = eina_prefix_new(NULL, elm_quicklaunch_init,
628 "ELM", "elementary", "config/profile.cfg",
629 PACKAGE_LIB_DIR, /* don't have a bin dir currently */
635 _elm_data_dir = eina_stringshare_add(eina_prefix_data_get(pfx));
636 _elm_lib_dir = eina_stringshare_add(eina_prefix_lib_get(pfx));
638 if (!_elm_data_dir) _elm_data_dir = eina_stringshare_add("/");
639 if (!_elm_lib_dir) _elm_lib_dir = eina_stringshare_add("/");
642 return _elm_ql_init_count;
646 elm_quicklaunch_sub_init(int argc,
649 _elm_sub_init_count++;
650 if (_elm_sub_init_count > 1) return _elm_sub_init_count;
653 #ifdef SEMI_BROKEN_QUICKLAUNCH
654 return _elm_sub_init_count;
659 ecore_app_args_set(argc, (const char **)argv);
663 _elm_config_sub_init();
664 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
665 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
666 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
667 ENGINE_COMPARE(ELM_XRENDER_X11) ||
668 ENGINE_COMPARE(ELM_OPENGL_X11))
669 #undef ENGINE_COMPARE
671 #ifdef HAVE_ELEMENTARY_X
675 ecore_evas_init(); // FIXME: check errors
678 return _elm_sub_init_count;
682 elm_quicklaunch_sub_shutdown(void)
684 _elm_sub_init_count--;
685 if (_elm_sub_init_count > 0) return _elm_sub_init_count;
688 #ifdef SEMI_BROKEN_QUICKLAUNCH
689 return _elm_sub_init_count;
695 _elm_module_shutdown();
696 ecore_imf_shutdown();
697 ecore_evas_shutdown();
698 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
699 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
700 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
701 ENGINE_COMPARE(ELM_XRENDER_X11) ||
702 ENGINE_COMPARE(ELM_OPENGL_X11))
703 #undef ENGINE_COMPARE
705 #ifdef HAVE_ELEMENTARY_X
706 ecore_x_disconnect();
709 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
710 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
711 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
712 ENGINE_COMPARE(ELM_XRENDER_X11) ||
713 ENGINE_COMPARE(ELM_OPENGL_X11) ||
714 ENGINE_COMPARE(ELM_SOFTWARE_SDL) ||
715 ENGINE_COMPARE(ELM_SOFTWARE_16_SDL) ||
716 ENGINE_COMPARE(ELM_OPENGL_SDL) ||
717 ENGINE_COMPARE(ELM_SOFTWARE_WIN32) ||
718 ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
719 #undef ENGINE_COMPARE
720 evas_cserve_disconnect();
724 return _elm_sub_init_count;
728 elm_quicklaunch_shutdown(void)
730 _elm_ql_init_count--;
731 if (_elm_ql_init_count > 0) return _elm_ql_init_count;
732 if (pfx) eina_prefix_free(pfx);
734 eina_stringshare_del(_elm_data_dir);
735 _elm_data_dir = NULL;
736 eina_stringshare_del(_elm_lib_dir);
742 _elm_config_shutdown();
744 ecore_event_handler_del(_elm_exit_handler);
745 _elm_exit_handler = NULL;
747 _elm_theme_shutdown();
748 _elm_unneed_efreet();
749 _elm_unneed_e_dbus();
750 _elm_unneed_ethumb();
751 ecore_file_shutdown();
753 #ifdef HAVE_ELEMENTARY_EMAP
760 if ((_elm_log_dom > -1) && (_elm_log_dom != EINA_LOG_DOMAIN_GLOBAL))
762 eina_log_domain_unregister(_elm_log_dom);
766 _elm_widget_type_clear();
769 return _elm_ql_init_count;
773 elm_quicklaunch_seed(void)
775 #ifndef SEMI_BROKEN_QUICKLAUNCH
778 Evas_Object *win, *bg, *bt;
780 win = elm_win_add(NULL, "seed", ELM_WIN_BASIC);
781 bg = elm_bg_add(win);
782 elm_win_resize_object_add(win, bg);
783 evas_object_show(bg);
784 bt = elm_button_add(win);
785 elm_button_label_set(bt, " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~-_=+\\|]}[{;:'\",<.>/?");
786 elm_win_resize_object_add(win, bt);
787 ecore_main_loop_iterate();
788 evas_object_del(win);
789 ecore_main_loop_iterate();
790 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
791 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
792 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
793 ENGINE_COMPARE(ELM_XRENDER_X11) ||
794 ENGINE_COMPARE(ELM_OPENGL_X11))
795 #undef ENGINE_COMPARE
797 # ifdef HAVE_ELEMENTARY_X
801 ecore_main_loop_iterate();
806 static void *qr_handle = NULL;
807 static int (*qr_main)(int argc,
811 elm_quicklaunch_prepare(int argc __UNUSED__,
815 char *exe = elm_quicklaunch_exe_path_get(argv[0]);
818 ERR("requested quicklaunch binary '%s' does not exist\n", argv[0]);
826 exe2 = malloc(strlen(exe) + 1 + 10);
828 p = strrchr(exe2, '/');
831 exename = alloca(strlen(p) + 1);
834 strcat(p, "../lib/");
837 if (!access(exe2, R_OK | X_OK))
845 qr_handle = dlopen(exe, RTLD_NOW | RTLD_GLOBAL);
848 fprintf(stderr, "dlerr: %s\n", dlerror());
849 WRN("dlopen('%s') failed: %s", exe, dlerror());
853 INF("dlopen('%s') = %p", exe, qr_handle);
854 qr_main = dlsym(qr_handle, "elm_main");
855 INF("dlsym(%p, 'elm_main') = %p", qr_handle, qr_main);
858 WRN("not quicklauncher capable: no elm_main in '%s'", exe);
877 extern char **environ;
882 for (i = 0, size = 0; environ[i]; i++)
883 size += strlen(environ[i]) + 1;
885 p = malloc((i + 1) * sizeof(char *));
890 for (i = 0; oldenv[i]; i++)
891 environ[i] = strdup(oldenv[i]);
898 elm_quicklaunch_fork(int argc,
901 void (postfork_func) (void *data),
911 // need to accept current environment from elementary_run
918 if (child > 0) return EINA_TRUE;
921 perror("could not fork");
926 perror("could not chdir");
927 args = alloca((argc + 1) * sizeof(char *));
928 for (i = 0; i < argc; i++) args[i] = argv[i];
930 WRN("%s not quicklaunch capable, fallback...", argv[0]);
931 execvp(argv[0], args);
932 ERR("failed to execute '%s': %s", argv[0], strerror(errno));
936 if (child > 0) return EINA_TRUE;
939 perror("could not fork");
942 if (postfork_func) postfork_func(postfork_data);
946 #ifdef SEMI_BROKEN_QUICKLAUNCH
947 ecore_app_args_set(argc, (const char **)argv);
950 _elm_config_sub_init();
951 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
952 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
953 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
954 ENGINE_COMPARE(ELM_XRENDER_X11) ||
955 ENGINE_COMPARE(ELM_OPENGL_X11))
956 #undef ENGINE_COMPARE
958 # ifdef HAVE_ELEMENTARY_X
962 ecore_evas_init(); // FIXME: check errors
970 perror("could not chdir");
971 // FIXME: this is very linux specific. it changes argv[0] of the process
972 // so ps etc. report what you'd expect. for other unixes and os's this
979 ecore_app_args_get(&real_argc, &real_argv);
980 lastarg = real_argv[real_argc - 1] + strlen(real_argv[real_argc - 1]);
981 for (p = real_argv[0]; p < lastarg; p++) *p = 0;
982 strcpy(real_argv[0], argv[0]);
984 ecore_app_args_set(argc, (const char **)argv);
985 ret = qr_main(argc, argv);
999 elm_quicklaunch_cleanup(void)
1012 elm_quicklaunch_fallback(int argc,
1016 elm_quicklaunch_init(argc, argv);
1017 elm_quicklaunch_sub_init(argc, argv);
1018 elm_quicklaunch_prepare(argc, argv);
1019 ret = qr_main(argc, argv);
1025 elm_quicklaunch_exe_path_get(const char *exe)
1027 static char *path = NULL;
1028 static Eina_List *pathlist = NULL;
1029 const char *pathitr;
1032 if (exe[0] == '/') return strdup(exe);
1033 if ((exe[0] == '.') && (exe[1] == '/')) return strdup(exe);
1034 if ((exe[0] == '.') && (exe[1] == '.') && (exe[2] == '/')) return strdup(exe);
1039 path = getenv("PATH");
1040 buf2 = alloca(strlen(path) + 1);
1045 if ((*p == ':') || (!*p))
1050 strncpy(buf2, pp, len);
1052 pathlist = eina_list_append(pathlist, eina_stringshare_add(buf2));
1064 EINA_LIST_FOREACH(pathlist, l, pathitr)
1066 snprintf(buf, sizeof(buf), "%s/%s", pathitr, exe);
1067 if (!access(buf, R_OK | X_OK)) return strdup(buf);
1075 ecore_main_loop_begin();
1081 ecore_main_loop_quit();
1085 elm_policy_set(unsigned int policy,
1088 Elm_Event_Policy_Changed *ev;
1090 if (policy >= ELM_POLICY_LAST)
1093 if (value == _elm_policies[policy])
1096 /* TODO: validade policy? */
1098 ev = malloc(sizeof(*ev));
1099 ev->policy = policy;
1100 ev->new_value = value;
1101 ev->old_value = _elm_policies[policy];
1103 _elm_policies[policy] = value;
1105 ecore_event_add(ELM_EVENT_POLICY_CHANGED, ev, NULL, NULL);
1111 elm_policy_get(unsigned int policy)
1113 if (policy >= ELM_POLICY_LAST)
1115 return _elm_policies[policy];
1119 * @defgroup UI-Mirroring Selective Widget mirroring
1121 * These functions allow you to set ui-mirroring on specific widgets or the
1122 * whole interface. Widgets can be in one of two modes, automatic and manual.
1123 * Automatic means they'll be changed according to the system mirroring mode
1124 * and manual means only explicit changes will matter. You are not supposed to
1125 * change mirroring state of a widget set to automatic, will mostly work, but
1126 * the behavior is not really defined.
1130 * Returns the widget's mirrored mode.
1132 * @param obj The widget.
1133 * @return mirrored mode of the object.
1137 elm_object_mirrored_get(const Evas_Object *obj)
1139 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1140 return elm_widget_mirrored_get(obj);
1144 * Sets the widget's mirrored mode.
1146 * @param obj The widget.
1147 * @param mirrored EINA_TRUE to set mirrored mode. EINA_FALSE to unset.
1150 elm_object_mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
1152 EINA_SAFETY_ON_NULL_RETURN(obj);
1153 elm_widget_mirrored_set(obj, mirrored);
1157 * Returns the widget's mirrored mode setting.
1159 * @param obj The widget.
1160 * @return mirrored mode setting of the object.
1164 elm_object_mirrored_automatic_get(const Evas_Object *obj)
1166 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1167 return elm_widget_mirrored_automatic_get(obj);
1171 * Sets the widget's mirrored mode setting.
1172 * When widget in automatic mode, it follows the system mirrored mode set by
1173 * elm_mirrored_set().
1174 * @param obj The widget.
1175 * @param automatic EINA_TRUE for auto mirrored mode. EINA_FALSE for manual.
1178 elm_object_mirrored_automatic_set(Evas_Object *obj, Eina_Bool automatic)
1180 EINA_SAFETY_ON_NULL_RETURN(obj);
1181 elm_widget_mirrored_automatic_set(obj, automatic);
1185 elm_object_scale_set(Evas_Object *obj,
1188 EINA_SAFETY_ON_NULL_RETURN(obj);
1189 elm_widget_scale_set(obj, scale);
1193 elm_object_scale_get(const Evas_Object *obj)
1195 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, 0.0);
1196 return elm_widget_scale_get(obj);
1200 elm_object_text_part_set(Evas_Object *obj, const char *item, const char *label)
1202 EINA_SAFETY_ON_NULL_RETURN(obj);
1203 elm_widget_text_part_set(obj, item, label);
1207 elm_object_text_part_get(const Evas_Object *obj, const char *item)
1209 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1210 return elm_widget_text_part_get(obj, item);
1214 * Get the global scaling factor
1216 * This gets the globally configured scaling factor that is applied to all
1219 * @return The scaling factor
1225 return _elm_config->scale;
1229 * Set the global scaling factor
1231 * This sets the globally configured scaling factor that is applied to all
1234 * @param scale The scaling factor to set
1238 elm_scale_set(double scale)
1240 if (_elm_config->scale == scale) return;
1241 _elm_config->scale = scale;
1246 * Set the global scaling factor for all applications on the display
1248 * This sets the globally configured scaling factor that is applied to all
1249 * objects for all applications.
1250 * @param scale The scaling factor to set
1254 elm_scale_all_set(double scale)
1256 #ifdef HAVE_ELEMENTARY_X
1257 static Ecore_X_Atom atom = 0;
1258 unsigned int scale_i = (unsigned int)(scale * 1000.0);
1260 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_SCALE");
1261 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
1267 elm_object_style_set(Evas_Object *obj,
1270 EINA_SAFETY_ON_NULL_RETURN(obj);
1271 elm_widget_style_set(obj, style);
1275 elm_object_style_get(const Evas_Object *obj)
1277 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1278 return elm_widget_style_get(obj);
1282 elm_object_disabled_set(Evas_Object *obj,
1285 EINA_SAFETY_ON_NULL_RETURN(obj);
1286 elm_widget_disabled_set(obj, 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 elm_finger_size_get(void)
1798 return _elm_config->finger_size;
1802 * Set the configured finger size
1804 * This sets the globally configured finger size in pixels
1806 * @param size The finger size
1810 elm_finger_size_set(Evas_Coord size)
1812 if (_elm_config->finger_size == size) return;
1813 _elm_config->finger_size = size;
1818 * Set the configured finger size for all applications on the display
1820 * This sets the globally configured finger size in pixels for all applications
1823 * @param size The finger size
1827 elm_finger_size_all_set(Evas_Coord size)
1829 #ifdef HAVE_ELEMENTARY_X
1830 static Ecore_X_Atom atom = 0;
1831 unsigned int size_i = (unsigned int)size;
1833 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_FINGER_SIZE");
1834 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
1840 elm_coords_finger_size_adjust(int times_w,
1845 if ((w) && (*w < (_elm_config->finger_size * times_w)))
1846 *w = _elm_config->finger_size * times_w;
1847 if ((h) && (*h < (_elm_config->finger_size * times_h)))
1848 *h = _elm_config->finger_size * times_h;
1852 * @defgroup Caches Caches
1854 * These are functions which let one fine-tune some cache values for
1855 * Elementary applications, thus allowing for performance adjustments.
1859 * Flush all caches & dump all data that can be to lean down to use
1870 edje_file_cache_flush();
1871 edje_collection_cache_flush();
1873 EINA_LIST_FOREACH(_elm_win_list, l, obj)
1875 Evas *e = evas_object_evas_get(obj);
1876 evas_image_cache_flush(e);
1877 evas_font_cache_flush(e);
1878 evas_render_dump(e);
1883 * Get the configured cache flush interval time
1885 * This gets the globally configured cache flush interval time, in
1888 * @return The cache flush interval time
1891 * @see elm_all_flush()
1894 elm_cache_flush_interval_get(void)
1896 return _elm_config->cache_flush_poll_interval;
1900 * Set the configured cache flush interval time
1902 * This sets the globally configured cache flush interval time, in ticks
1904 * @param size The cache flush interval time
1907 * @see elm_all_flush()
1910 elm_cache_flush_interval_set(int size)
1912 if (_elm_config->cache_flush_poll_interval == size) return;
1913 _elm_config->cache_flush_poll_interval = size;
1919 * Set the configured cache flush interval time for all applications on the
1922 * This sets the globally configured cache flush interval time -- in ticks
1923 * -- for all applications on the display.
1925 * @param size The cache flush interval time
1929 elm_cache_flush_interval_all_set(int size)
1931 #ifdef HAVE_ELEMENTARY_X
1932 static Ecore_X_Atom atom = 0;
1933 unsigned int size_i = (unsigned int)size;
1935 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_CACHE_FLUSH_INTERVAL");
1936 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
1942 * Get the configured cache flush enabled state
1944 * This gets the globally configured cache flush state - if it is enabled
1945 * or not. When cache flushing is enabled, elementary will regularly
1946 * (see elm_cache_flush_interval_get() ) flush caches and dump data out of
1947 * memory and allow usage to re-seed caches and data in memory where it
1948 * can do so. An idle application will thus minimise its memory usage as
1949 * data will be freed from memory and not be re-loaded as it is idle and
1950 * not rendering or doing anything graphically right now.
1952 * @return The cache flush state
1955 * @see elm_all_flush()
1958 elm_cache_flush_enabled_get(void)
1960 return _elm_config->cache_flush_enable;
1964 * Set the configured cache flush enabled state
1966 * This sets the globally configured cache flush enabled state
1968 * @param size The cache flush enabled state
1971 * @see elm_all_flush()
1974 elm_cache_flush_enabled_set(Eina_Bool enabled)
1976 enabled = !!enabled;
1977 if (_elm_config->cache_flush_enable == enabled) return;
1978 _elm_config->cache_flush_enable = enabled;
1984 * Set the configured cache flush enabled state for all applications on the
1987 * This sets the globally configured cache flush enabled state for all
1988 * applications on the display.
1990 * @param size The cache flush enabled state
1994 elm_cache_flush_enabled_all_set(Eina_Bool enabled)
1996 #ifdef HAVE_ELEMENTARY_X
1997 static Ecore_X_Atom atom = 0;
1998 unsigned int enabled_i = (unsigned int)enabled;
2000 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_CACHE_FLUSH_ENABLE");
2001 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2002 atom, &enabled_i, 1);
2007 * Get the configured font cache size
2009 * This gets the globally configured font cache size, in bytes
2011 * @return The font cache size
2015 elm_font_cache_get(void)
2017 return _elm_config->font_cache;
2021 * Set the configured font cache size
2023 * This sets the globally configured font cache size, in bytes
2025 * @param size The font cache size
2029 elm_font_cache_set(int size)
2031 if (_elm_config->font_cache == size) return;
2032 _elm_config->font_cache = size;
2038 * Set the configured font cache size for all applications on the
2041 * This sets the globally configured font cache size -- in bytes
2042 * -- for all applications on the display.
2044 * @param size The font cache size
2048 elm_font_cache_all_set(int size)
2050 #ifdef HAVE_ELEMENTARY_X
2051 static Ecore_X_Atom atom = 0;
2052 unsigned int size_i = (unsigned int)size;
2054 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_FONT_CACHE");
2055 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2061 * Get the configured image cache size
2063 * This gets the globally configured image cache size, in bytes
2065 * @return The image cache size
2069 elm_image_cache_get(void)
2071 return _elm_config->image_cache;
2075 * Set the configured image cache size
2077 * This sets the globally configured image cache size, in bytes
2079 * @param size The image cache size
2083 elm_image_cache_set(int size)
2085 if (_elm_config->image_cache == size) return;
2086 _elm_config->image_cache = size;
2092 * Set the configured image cache size for all applications on the
2095 * This sets the globally configured image cache size -- in bytes
2096 * -- for all applications on the display.
2098 * @param size The image cache size
2102 elm_image_cache_all_set(int size)
2104 #ifdef HAVE_ELEMENTARY_X
2105 static Ecore_X_Atom atom = 0;
2106 unsigned int size_i = (unsigned int)size;
2108 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_IMAGE_CACHE");
2109 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2115 * Get the configured edje file cache size.
2117 * This gets the globally configured edje file cache size, in number
2120 * @return The edje file cache size
2124 elm_edje_file_cache_get(void)
2126 return _elm_config->edje_cache;
2130 * Set the configured edje file cache size
2132 * This sets the globally configured edje file cache size, in number
2135 * @param size The edje file cache size
2139 elm_edje_file_cache_set(int size)
2141 if (_elm_config->edje_cache == size) return;
2142 _elm_config->edje_cache = size;
2148 * Set the configured edje file cache size for all applications on the
2151 * This sets the globally configured edje file cache size -- in number
2152 * of files -- for all applications on the display.
2154 * @param size The edje file cache size
2158 elm_edje_file_cache_all_set(int size)
2160 #ifdef HAVE_ELEMENTARY_X
2161 static Ecore_X_Atom atom = 0;
2162 unsigned int size_i = (unsigned int)size;
2164 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_EDJE_FILE_CACHE");
2165 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2171 * Get the configured edje collections (groups) cache size.
2173 * This gets the globally configured edje collections cache size, in
2174 * number of collections.
2176 * @return The edje collections cache size
2180 elm_edje_collection_cache_get(void)
2182 return _elm_config->edje_collection_cache;
2186 * Set the configured edje collections (groups) cache size
2188 * This sets the globally configured edje collections cache size, in
2189 * number of collections.
2191 * @param size The edje collections cache size
2195 elm_edje_collection_cache_set(int size)
2197 if (_elm_config->edje_collection_cache == size) return;
2198 _elm_config->edje_collection_cache = size;
2204 * Set the configured edje collections (groups) cache size for all
2205 * applications on the display
2207 * This sets the globally configured edje collections cache size -- in
2208 * number of collections -- for all applications on the display.
2210 * @param size The edje collections cache size
2214 elm_edje_collection_cache_all_set(int size)
2216 #ifdef HAVE_ELEMENTARY_X
2217 static Ecore_X_Atom atom = 0;
2218 unsigned int size_i = (unsigned int)size;
2220 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_EDJE_COLLECTION_CACHE");
2221 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2227 elm_object_focus_get(const Evas_Object *obj)
2229 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
2230 return elm_widget_focus_get(obj);
2234 elm_object_focus(Evas_Object *obj)
2236 EINA_SAFETY_ON_NULL_RETURN(obj);
2237 if (elm_widget_focus_get(obj))
2240 elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
2244 elm_object_unfocus(Evas_Object *obj)
2246 EINA_SAFETY_ON_NULL_RETURN(obj);
2247 if (!elm_widget_can_focus_get(obj)) return;
2248 elm_widget_focused_object_clear(obj);
2252 elm_object_focus_allow_set(Evas_Object *obj,
2255 EINA_SAFETY_ON_NULL_RETURN(obj);
2256 elm_widget_can_focus_set(obj, enable);
2260 elm_object_focus_allow_get(const Evas_Object *obj)
2262 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
2263 return (elm_widget_can_focus_get(obj)) || (elm_widget_child_can_focus_get(obj));
2267 * Set custom focus chain.
2269 * This function i set one new and overwrite any previous custom focus chain
2270 * with the list of objects. The previous list will be deleted and this list
2271 * will be managed. After setted, don't modity it.
2273 * @note On focus cycle, only will be evaluated children of this container.
2275 * @param obj The container object
2276 * @param objs Chain of objects to pass focus
2280 elm_object_focus_custom_chain_set(Evas_Object *obj,
2283 EINA_SAFETY_ON_NULL_RETURN(obj);
2284 elm_widget_focus_custom_chain_set(obj, objs);
2288 * Unset custom focus chain
2290 * @param obj The container object
2294 elm_object_focus_custom_chain_unset(Evas_Object *obj)
2296 EINA_SAFETY_ON_NULL_RETURN(obj);
2297 elm_widget_focus_custom_chain_unset(obj);
2301 * Get custom focus chain
2303 * @param obj The container object
2306 EAPI const Eina_List *
2307 elm_object_focus_custom_chain_get(const Evas_Object *obj)
2309 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
2310 return elm_widget_focus_custom_chain_get(obj);
2314 * Append object to custom focus chain.
2316 * @note If relative_child equal to NULL or not in custom chain, the object
2317 * will be added in end.
2319 * @note On focus cycle, only will be evaluated children of this container.
2321 * @param obj The container object
2322 * @param child The child to be added in custom chain
2323 * @param relative_child The relative object to position the child
2327 elm_object_focus_custom_chain_append(Evas_Object *obj,
2329 Evas_Object *relative_child)
2331 EINA_SAFETY_ON_NULL_RETURN(obj);
2332 EINA_SAFETY_ON_NULL_RETURN(child);
2333 elm_widget_focus_custom_chain_append(obj, child, relative_child);
2337 * Prepend object to custom focus chain.
2339 * @note If relative_child equal to NULL or not in custom chain, the object
2340 * will be added in begin.
2342 * @note On focus cycle, only will be evaluated children of this container.
2344 * @param obj The container object
2345 * @param child The child to be added in custom chain
2346 * @param relative_child The relative object to position the child
2350 elm_object_focus_custom_chain_prepend(Evas_Object *obj,
2352 Evas_Object *relative_child)
2354 EINA_SAFETY_ON_NULL_RETURN(obj);
2355 EINA_SAFETY_ON_NULL_RETURN(child);
2356 elm_widget_focus_custom_chain_prepend(obj, child, relative_child);
2360 * Give focus to next object in object tree.
2362 * Give focus to next object in focus chain of one object sub-tree.
2363 * If the last object of chain already have focus, the focus will go to the
2364 * first object of chain.
2366 * @param obj The object root of sub-tree
2367 * @param dir Direction to cycle the focus
2372 elm_object_focus_cycle(Evas_Object *obj,
2373 Elm_Focus_Direction dir)
2375 EINA_SAFETY_ON_NULL_RETURN(obj);
2376 elm_widget_focus_cycle(obj, dir);
2380 * Give focus to near object in one direction.
2382 * Give focus to near object in direction of one object.
2383 * If none focusable object in given direction, the focus will not change.
2385 * @param obj The reference object
2386 * @param x Horizontal component of direction to focus
2387 * @param y Vertical component of direction to focus
2392 elm_object_focus_direction_go(Evas_Object *obj,
2396 EINA_SAFETY_ON_NULL_RETURN(obj);
2397 elm_widget_focus_direction_go(obj, x, y);
2401 * Get the enable status of the focus highlight
2403 * This gets whether the highlight on focused objects is enabled or not
2407 elm_focus_highlight_enabled_get(void)
2409 return _elm_config->focus_highlight_enable;
2413 * Set the enable status of the focus highlight
2415 * Set whether to show or not the highlight on focused objects
2416 * @param enable Enable highlight if EINA_TRUE, disable otherwise
2420 elm_focus_highlight_enabled_set(Eina_Bool enable)
2422 _elm_config->focus_highlight_enable = !!enable;
2426 * Get the enable status of the highlight animation
2428 * Get whether the focus highlight, if enabled, will animate its switch from
2429 * one object to the next
2433 elm_focus_highlight_animate_get(void)
2435 return _elm_config->focus_highlight_animate;
2439 * Set the enable status of the highlight animation
2441 * Set whether the focus highlight, if enabled, will animate its switch from
2442 * one object to the next
2443 * @param animate Enable animation if EINA_TRUE, disable otherwise
2447 elm_focus_highlight_animate_set(Eina_Bool animate)
2449 _elm_config->focus_highlight_animate = !!animate;
2453 * @defgroup Scrolling Scrolling
2455 * These are functions setting how scrollable views in Elementary
2456 * widgets should behave on user interaction.
2460 * Get whether scrollers should bounce when they reach their
2461 * viewport's edge during a scroll.
2463 * @return the thumb scroll bouncing state
2465 * This is the default behavior for touch screens, in general.
2466 * @ingroup Scrolling
2469 elm_scroll_bounce_enabled_get(void)
2471 return _elm_config->thumbscroll_bounce_enable;
2475 * Set whether scrollers should bounce when they reach their
2476 * viewport's edge during a scroll.
2478 * @param enabled the thumb scroll bouncing state
2480 * @see elm_thumbscroll_bounce_enabled_get()
2481 * @ingroup Scrolling
2484 elm_scroll_bounce_enabled_set(Eina_Bool enabled)
2486 _elm_config->thumbscroll_bounce_enable = enabled;
2490 * Set whether scrollers should bounce when they reach their
2491 * viewport's edge during a scroll, for all Elementary application
2494 * @param enabled the thumb scroll bouncing state
2496 * @see elm_thumbscroll_bounce_enabled_get()
2497 * @ingroup Scrolling
2500 elm_scroll_bounce_enabled_all_set(Eina_Bool enabled)
2502 #ifdef HAVE_ELEMENTARY_X
2503 static Ecore_X_Atom atom = 0;
2504 unsigned int bounce_enable_i = (unsigned int)enabled;
2507 atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_BOUNCE_ENABLE");
2508 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2509 atom, &bounce_enable_i, 1);
2514 * Get the amount of inertia a scroller will impose at bounce
2517 * @return the thumb scroll bounce friction
2519 * @ingroup Scrolling
2522 elm_scroll_bounce_friction_get(void)
2524 return _elm_config->thumbscroll_bounce_friction;
2528 * Set the amount of inertia a scroller will impose at bounce
2531 * @param friction the thumb scroll bounce friction
2533 * @see elm_thumbscroll_bounce_friction_get()
2534 * @ingroup Scrolling
2537 elm_scroll_bounce_friction_set(double friction)
2539 _elm_config->thumbscroll_bounce_friction = friction;
2543 * Set the amount of inertia a scroller will impose at bounce
2544 * animations, for all Elementary application windows.
2546 * @param friction the thumb scroll bounce friction
2548 * @see elm_thumbscroll_bounce_friction_get()
2549 * @ingroup Scrolling
2552 elm_scroll_bounce_friction_all_set(double friction)
2554 #ifdef HAVE_ELEMENTARY_X
2555 static Ecore_X_Atom atom = 0;
2556 unsigned int bounce_friction_i = (unsigned int)(friction * 1000.0);
2559 atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_BOUNCE_FRICTION");
2560 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2561 atom, &bounce_friction_i, 1);
2566 * Get the amount of inertia a <b>paged</b> scroller will impose at
2567 * page fitting animations.
2569 * @return the page scroll friction
2571 * @ingroup Scrolling
2574 elm_scroll_page_scroll_friction_get(void)
2576 return _elm_config->page_scroll_friction;
2580 * Set the amount of inertia a <b>paged</b> scroller will impose at
2581 * page fitting animations.
2583 * @param friction the page scroll friction
2585 * @see elm_thumbscroll_page_scroll_friction_get()
2586 * @ingroup Scrolling
2589 elm_scroll_page_scroll_friction_set(double friction)
2591 _elm_config->page_scroll_friction = friction;
2595 * Set the amount of inertia a <b>paged</b> scroller will impose at
2596 * page fitting animations, for all Elementary application windows.
2598 * @param friction the page scroll friction
2600 * @see elm_thumbscroll_page_scroll_friction_get()
2601 * @ingroup Scrolling
2604 elm_scroll_page_scroll_friction_all_set(double friction)
2606 #ifdef HAVE_ELEMENTARY_X
2607 static Ecore_X_Atom atom = 0;
2608 unsigned int page_scroll_friction_i = (unsigned int)(friction * 1000.0);
2611 atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_PAGE_SCROLL_FRICTION");
2612 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2613 atom, &page_scroll_friction_i, 1);
2618 * Get the amount of inertia a scroller will impose at region bring
2621 * @return the bring in scroll friction
2623 * @ingroup Scrolling
2626 elm_scroll_bring_in_scroll_friction_get(void)
2628 return _elm_config->bring_in_scroll_friction;
2632 * Set the amount of inertia a scroller will impose at region bring
2635 * @param friction the bring in scroll friction
2637 * @see elm_thumbscroll_bring_in_scroll_friction_get()
2638 * @ingroup Scrolling
2641 elm_scroll_bring_in_scroll_friction_set(double friction)
2643 _elm_config->bring_in_scroll_friction = friction;
2647 * Set the amount of inertia a scroller will impose at region bring
2648 * animations, for all Elementary application windows.
2650 * @param friction the bring in scroll friction
2652 * @see elm_thumbscroll_bring_in_scroll_friction_get()
2653 * @ingroup Scrolling
2656 elm_scroll_bring_in_scroll_friction_all_set(double friction)
2658 #ifdef HAVE_ELEMENTARY_X
2659 static Ecore_X_Atom atom = 0;
2660 unsigned int bring_in_scroll_friction_i = (unsigned int)(friction * 1000.0);
2664 ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_BRING_IN_SCROLL_FRICTION");
2665 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2666 atom, &bring_in_scroll_friction_i, 1);
2671 * Get the amount of inertia scrollers will impose at animations
2672 * triggered by Elementary widgets' zooming API.
2674 * @return the zoom friction
2676 * @ingroup Scrolling
2679 elm_scroll_zoom_friction_get(void)
2681 return _elm_config->zoom_friction;
2685 * Set the amount of inertia scrollers will impose at animations
2686 * triggered by Elementary widgets' zooming API.
2688 * @param friction the zoom friction
2690 * @see elm_thumbscroll_zoom_friction_get()
2691 * @ingroup Scrolling
2694 elm_scroll_zoom_friction_set(double friction)
2696 _elm_config->zoom_friction = friction;
2700 * Set the amount of inertia scrollers will impose at animations
2701 * triggered by Elementary widgets' zooming API, for all Elementary
2702 * application windows.
2704 * @param friction the zoom friction
2706 * @see elm_thumbscroll_zoom_friction_get()
2707 * @ingroup Scrolling
2710 elm_scroll_zoom_friction_all_set(double friction)
2712 #ifdef HAVE_ELEMENTARY_X
2713 static Ecore_X_Atom atom = 0;
2714 unsigned int zoom_friction_i = (unsigned int)(friction * 1000.0);
2717 atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_ZOOM_FRICTION");
2718 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2719 atom, &zoom_friction_i, 1);
2724 * Get whether scrollers should be draggable from any point in their
2727 * @return the thumb scroll state
2729 * @note This is the default behavior for touch screens, in general.
2730 * @note All other functions namespaced with "thumbscroll" will only
2731 * have effect if this mode is enabled.
2733 * @ingroup Scrolling
2736 elm_scroll_thumbscroll_enabled_get(void)
2738 return _elm_config->thumbscroll_enable;
2742 * Set whether scrollers should be draggable from any point in their
2745 * @param enabled the thumb scroll state
2747 * @see elm_thumbscroll_enabled_get()
2748 * @ingroup Scrolling
2751 elm_scroll_thumbscroll_enabled_set(Eina_Bool enabled)
2753 _elm_config->thumbscroll_enable = enabled;
2757 * Set whether scrollers should be draggable from any point in their
2758 * views, for all Elementary application windows.
2760 * @param enabled the thumb scroll state
2762 * @see elm_thumbscroll_enabled_get()
2763 * @ingroup Scrolling
2766 elm_scroll_thumbscroll_enabled_all_set(Eina_Bool enabled)
2768 #ifdef HAVE_ELEMENTARY_X
2769 static Ecore_X_Atom atom = 0;
2770 unsigned int ts_enable_i = (unsigned int)enabled;
2772 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_ENABLE");
2773 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2774 atom, &ts_enable_i, 1);
2779 * Get the number of pixels one should travel while dragging a
2780 * scroller's view to actually trigger scrolling.
2782 * @return the thumb scroll threshould
2784 * One would use higher values for touch screens, in general, because
2785 * of their inherent imprecision.
2786 * @ingroup Scrolling
2789 elm_scroll_thumbscroll_threshold_get(void)
2791 return _elm_config->thumbscroll_threshold;
2795 * Set the number of pixels one should travel while dragging a
2796 * scroller's view to actually trigger scrolling.
2798 * @param threshold the thumb scroll threshould
2800 * @see elm_thumbscroll_threshould_get()
2801 * @ingroup Scrolling
2804 elm_scroll_thumbscroll_threshold_set(unsigned int threshold)
2806 _elm_config->thumbscroll_threshold = threshold;
2810 * Set the number of pixels one should travel while dragging a
2811 * scroller's view to actually trigger scrolling, for all Elementary
2812 * application windows.
2814 * @param threshold the thumb scroll threshould
2816 * @see elm_thumbscroll_threshould_get()
2817 * @ingroup Scrolling
2820 elm_scroll_thumbscroll_threshold_all_set(unsigned int threshold)
2822 #ifdef HAVE_ELEMENTARY_X
2823 static Ecore_X_Atom atom = 0;
2824 unsigned int ts_threshold_i = (unsigned int)threshold;
2826 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_THRESHOLD");
2827 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2828 atom, &ts_threshold_i, 1);
2833 * Get the minimum speed of mouse cursor movement which will trigger
2834 * list self scrolling animation after a mouse up event
2837 * @return the thumb scroll momentum threshould
2839 * @ingroup Scrolling
2842 elm_scroll_thumbscroll_momentum_threshold_get(void)
2844 return _elm_config->thumbscroll_momentum_threshold;
2848 * Set the minimum speed of mouse cursor movement which will trigger
2849 * list self scrolling animation after a mouse up event
2852 * @param threshold the thumb scroll momentum threshould
2854 * @see elm_thumbscroll_momentum_threshould_get()
2855 * @ingroup Scrolling
2858 elm_scroll_thumbscroll_momentum_threshold_set(double threshold)
2860 _elm_config->thumbscroll_momentum_threshold = threshold;
2864 * Set the minimum speed of mouse cursor movement which will trigger
2865 * list self scrolling animation after a mouse up event
2866 * (pixels/second), for all Elementary application windows.
2868 * @param threshold the thumb scroll momentum threshould
2870 * @see elm_thumbscroll_momentum_threshould_get()
2871 * @ingroup Scrolling
2874 elm_scroll_thumbscroll_momentum_threshold_all_set(double threshold)
2876 #ifdef HAVE_ELEMENTARY_X
2877 static Ecore_X_Atom atom = 0;
2878 unsigned int ts_momentum_threshold_i = (unsigned int)(threshold * 1000.0);
2881 atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_MOMENTUM_THRESHOLD");
2882 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2883 atom, &ts_momentum_threshold_i, 1);
2888 * Get the amount of inertia a scroller will impose at self scrolling
2891 * @return the thumb scroll friction
2893 * @ingroup Scrolling
2896 elm_scroll_thumbscroll_friction_get(void)
2898 return _elm_config->thumbscroll_friction;
2902 * Set the amount of inertia a scroller will impose at self scrolling
2905 * @param friction the thumb scroll friction
2907 * @see elm_thumbscroll_friction_get()
2908 * @ingroup Scrolling
2911 elm_scroll_thumbscroll_friction_set(double friction)
2913 _elm_config->thumbscroll_friction = friction;
2917 * Set the amount of inertia a scroller will impose at self scrolling
2918 * animations, for all Elementary application windows.
2920 * @param friction the thumb scroll friction
2922 * @see elm_thumbscroll_friction_get()
2923 * @ingroup Scrolling
2926 elm_scroll_thumbscroll_friction_all_set(double friction)
2928 #ifdef HAVE_ELEMENTARY_X
2929 static Ecore_X_Atom atom = 0;
2930 unsigned int ts_friction_i = (unsigned int)(friction * 1000.0);
2932 if (!atom) atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_FRICTION");
2933 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
2934 atom, &ts_friction_i, 1);
2939 * Get the amount of lag between your actual mouse cursor dragging
2940 * movement and a scroller's view movement itself, while pushing it
2941 * into bounce state manually.
2943 * @return the thumb scroll border friction
2945 * @ingroup Scrolling
2948 elm_scroll_thumbscroll_border_friction_get(void)
2950 return _elm_config->thumbscroll_border_friction;
2954 * Set the amount of lag between your actual mouse cursor dragging
2955 * movement and a scroller's view movement itself, while pushing it
2956 * into bounce state manually.
2958 * @param friction the thumb scroll border friction. @c 0.0 for
2959 * perfect synchrony between two movements, @c 1.0 for maximum
2962 * @see elm_thumbscroll_border_friction_get()
2963 * @note parameter value will get bound to 0.0 - 1.0 interval, always
2965 * @ingroup Scrolling
2968 elm_scroll_thumbscroll_border_friction_set(double friction)
2976 _elm_config->thumbscroll_friction = friction;
2980 * Set the amount of lag between your actual mouse cursor dragging
2981 * movement and a scroller's view movement itself, while pushing it
2982 * into bounce state manually, for all Elementary application windows.
2984 * @param friction the thumb scroll border friction. @c 0.0 for
2985 * perfect synchrony between two movements, @c 1.0 for maximum
2988 * @see elm_thumbscroll_border_friction_get()
2989 * @note parameter value will get bound to 0.0 - 1.0 interval, always
2991 * @ingroup Scrolling
2994 elm_scroll_thumbscroll_border_friction_all_set(double friction)
3002 #ifdef HAVE_ELEMENTARY_X
3003 static Ecore_X_Atom atom = 0;
3004 unsigned int border_friction_i = (unsigned int)(friction * 1000.0);
3007 atom = ecore_x_atom_get("ENLIGHTENMENT_THUMBSCROLL_BORDER_FRICTION");
3008 ecore_x_window_prop_card32_set(ecore_x_window_root_first_get(),
3009 atom, &border_friction_i, 1);
3014 * @defgroup Scrollhints Scrollhints
3016 * Objects when inside a scroller can scroll, but this may not always be
3017 * desirable in certain situations. This allows an object to hint to itself
3018 * and parents to "not scroll" in one of 2 ways.
3020 * 1. To hold on scrolling. This means just flicking and dragging may no
3021 * longer scroll, but pressing/dragging near an edge of the scroller will
3022 * still scroll. This is automastically used by the entry object when
3024 * 2. To totally freeze scrolling. This means it stops. until popped/released.
3028 * Push the scroll hold by 1
3030 * This increments the scroll hold count by one. If it is more than 0 it will
3031 * take effect on the parents of the indicated object.
3033 * @param obj The object
3034 * @ingroup Scrollhints
3037 elm_object_scroll_hold_push(Evas_Object *obj)
3039 EINA_SAFETY_ON_NULL_RETURN(obj);
3040 elm_widget_scroll_hold_push(obj);
3044 * Pop the scroll hold by 1
3046 * This decrements the scroll hold count by one. If it is more than 0 it will
3047 * take effect on the parents of the indicated object.
3049 * @param obj The object
3050 * @ingroup Scrollhints
3053 elm_object_scroll_hold_pop(Evas_Object *obj)
3055 EINA_SAFETY_ON_NULL_RETURN(obj);
3056 elm_widget_scroll_hold_pop(obj);
3060 * Push the scroll freeze by 1
3062 * This increments the scroll freeze count by one. If it is more than 0 it will
3063 * take effect on the parents of the indicated object.
3065 * @param obj The object
3066 * @ingroup Scrollhints
3069 elm_object_scroll_freeze_push(Evas_Object *obj)
3071 EINA_SAFETY_ON_NULL_RETURN(obj);
3072 elm_widget_scroll_freeze_push(obj);
3076 * Lock the scrolling of the given widget (and thus all parents)
3078 * This locks the given object from scrolling in the X axis (and implicitly
3079 * also locks all parent scrollers too from doing the same).
3081 * @param obj The object
3082 * @param lock The lock state (1 == locked, 0 == unlocked)
3083 * @ingroup Scrollhints
3086 elm_object_scroll_lock_x_set(Evas_Object *obj,
3089 EINA_SAFETY_ON_NULL_RETURN(obj);
3090 elm_widget_drag_lock_x_set(obj, lock);
3094 * Lock the scrolling of the given widget (and thus all parents)
3096 * This locks the given object from scrolling in the Y axis (and implicitly
3097 * also locks all parent scrollers too from doing the same).
3099 * @param obj The object
3100 * @param lock The lock state (1 == locked, 0 == unlocked)
3101 * @ingroup Scrollhints
3104 elm_object_scroll_lock_y_set(Evas_Object *obj,
3107 EINA_SAFETY_ON_NULL_RETURN(obj);
3108 elm_widget_drag_lock_y_set(obj, lock);
3112 * Get the scrolling lock of the given widget
3114 * This gets the lock for X axis scrolling.
3116 * @param obj The object
3117 * @ingroup Scrollhints
3120 elm_object_scroll_lock_x_get(const Evas_Object *obj)
3122 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
3123 return elm_widget_drag_lock_x_get(obj);
3127 * Get the scrolling lock of the given widget
3129 * This gets the lock for X axis scrolling.
3131 * @param obj The object
3132 * @ingroup Scrollhints
3135 elm_object_scroll_lock_y_get(const Evas_Object *obj)
3137 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
3138 return elm_widget_drag_lock_y_get(obj);
3142 * Pop the scroll freeze by 1
3144 * This decrements the scroll freeze count by one. If it is more than 0 it will
3145 * take effect on the parents of the indicated object.
3147 * @param obj The object
3148 * @ingroup Scrollhints
3151 elm_object_scroll_freeze_pop(Evas_Object *obj)
3153 EINA_SAFETY_ON_NULL_RETURN(obj);
3154 elm_widget_scroll_freeze_pop(obj);
3158 * Check if the given Evas Object is an Elementary widget.
3160 * @param obj the object to query.
3161 * @return @c EINA_TRUE if it is an elementary widget variant,
3162 * @c EINA_FALSE otherwise
3163 * @ingroup WidgetNavigation
3166 elm_object_widget_check(const Evas_Object *obj)
3168 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
3169 return elm_widget_is(obj);
3173 elm_object_parent_widget_get(const Evas_Object *obj)
3175 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
3176 return elm_widget_parent_widget_get(obj);
3180 * Get the top level parent of an Elementary widget.
3182 * @param obj The object to query.
3183 * @return The top level Elementary widget, or @c NULL if parent cannot be
3185 * @ingroup WidgetNavigation
3188 elm_object_top_widget_get(const Evas_Object *obj)
3190 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
3191 return elm_widget_top_get(obj);
3195 * Get the string that represents this Elementary widget.
3197 * @note Elementary is weird and exposes itself as a single
3198 * Evas_Object_Smart_Class of type "elm_widget", so
3199 * evas_object_type_get() always return that, making debug and
3200 * language bindings hard. This function tries to mitigate this
3201 * problem, but the solution is to change Elementary to use
3202 * proper inheritance.
3204 * @param obj the object to query.
3205 * @return Elementary widget name, or @c NULL if not a valid widget.
3206 * @ingroup WidgetNavigation
3209 elm_object_widget_type_get(const Evas_Object *obj)
3211 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
3212 return elm_widget_type_get(obj);
3216 * Send a signal to the widget edje object.
3218 * This function sends a signal to the edje object of the obj. An edje program
3219 * can respond to a signal by specifying matching 'signal' and
3222 * @param obj The object
3223 * @param emission The signal's name.
3224 * @param source The signal's source.
3228 elm_object_signal_emit(Evas_Object *obj,
3229 const char *emission,
3232 EINA_SAFETY_ON_NULL_RETURN(obj);
3233 elm_widget_signal_emit(obj, emission, source);
3237 * Add a callback for a signal emitted by widget edje object.
3239 * This function connects a callback function to a signal emitted by the
3240 * edje object of the obj.
3241 * Globs can occur in either the emission or source name.
3243 * @param obj The object
3244 * @param emission The signal's name.
3245 * @param source The signal's source.
3246 * @param func The callback function to be executed when the signal is
3248 * @param data A pointer to data to pass in to the callback function.
3252 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)
3254 EINA_SAFETY_ON_NULL_RETURN(obj);
3255 EINA_SAFETY_ON_NULL_RETURN(func);
3256 elm_widget_signal_callback_add(obj, emission, source, func, data);
3260 * Remove a signal-triggered callback from an widget edje object.
3262 * This function removes a callback, previoulsy attached to a signal emitted
3263 * by the edje object of the obj.
3264 * The parameters emission, source and func must match exactly those passed to
3265 * a previous call to elm_object_signal_callback_add(). The data pointer that
3266 * was passed to this call will be returned.
3268 * @param obj The object
3269 * @param emission The signal's name.
3270 * @param source The signal's source.
3271 * @param func The callback function to be executed when the signal is
3273 * @return The data pointer
3277 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))
3279 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
3280 EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
3281 return elm_widget_signal_callback_del(obj, emission, source, func);
3285 * Add a callback for a event emitted by widget or their children.
3287 * This function connects a callback function to any key_down key_up event
3288 * emitted by the @p obj or their children.
3289 * This only will be called if no other callback has consumed the event.
3290 * If you want consume the event, and no other get it, func should return
3291 * EINA_TRUE and put EVAS_EVENT_FLAG_ON_HOLD in event_flags.
3293 * @warning Accept duplicated callback addition.
3295 * @param obj The object
3296 * @param func The callback function to be executed when the event is
3298 * @param data Data to pass in to the callback function.
3302 elm_object_event_callback_add(Evas_Object *obj, Elm_Event_Cb func, const void *data)
3304 EINA_SAFETY_ON_NULL_RETURN(obj);
3305 EINA_SAFETY_ON_NULL_RETURN(func);
3306 elm_widget_event_callback_add(obj, func, data);
3310 * Remove a event callback from an widget.
3312 * This function removes a callback, previoulsy attached to event emission
3314 * The parameters func and data must match exactly those passed to
3315 * a previous call to elm_object_event_callback_add(). The data pointer that
3316 * was passed to this call will be returned.
3318 * @param obj The object
3319 * @param func The callback function to be executed when the event is
3321 * @param data Data to pass in to the callback function.
3322 * @return The data pointer
3326 elm_object_event_callback_del(Evas_Object *obj, Elm_Event_Cb func, const void *data)
3328 EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
3329 EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
3330 return elm_widget_event_callback_del(obj, func, data);
3335 * @defgroup Debug Debug
3339 * Print Tree object hierarchy in stdout
3341 * @param obj The root object
3345 elm_object_tree_dump(const Evas_Object *top)
3348 elm_widget_tree_dump(top);
3356 * Print Elm Objects tree hierarchy in file as dot(graphviz) syntax.
3358 * @param obj The root object
3359 * @param file The path of output file
3363 elm_object_tree_dot_dump(const Evas_Object *top,
3367 FILE *f = fopen(file, "wb");
3368 elm_widget_tree_dot_dump(top, f);
3378 * Set the duration for occuring long press event.
3380 * @param lonpress_timeout Timeout for long press event
3381 * @ingroup Longpress
3384 elm_longpress_timeout_set(double longpress_timeout)
3386 _elm_config->longpress_timeout = longpress_timeout;
3390 * Get the duration for occuring long press event.
3392 * @return Timeout for long press event
3393 * @ingroup Longpress
3396 elm_longpress_timeout_get(void)
3398 return _elm_config->longpress_timeout;