fix OPENGL issue
[framework/uifw/elementary.git] / src / lib / elm_main.c
1 #ifdef HAVE_CONFIG_H
2 # include "elementary_config.h"
3 #endif
4
5 #ifdef HAVE_FORK
6 #include <dlfcn.h> /* dlopen,dlclose,etc */
7 #endif
8
9 #ifdef HAVE_CRT_EXTERNS_H
10 # include <crt_externs.h>
11 #endif
12
13 #ifdef HAVE_EVIL
14 # include <Evil.h>
15 #endif
16
17 #include <Elementary.h>
18 #include "elm_priv.h"
19
20 #define SEMI_BROKEN_QUICKLAUNCH 1
21
22 static Elm_Version _version = { VMAJ, VMIN, VMIC, VREV };
23 EAPI Elm_Version *elm_version = &_version;
24
25 Eina_Bool
26 _elm_dangerous_call_check(const char *call)
27 {
28    char buf[256];
29    const char *eval;
30
31    snprintf(buf, sizeof(buf), "%i.%i.%i.%i", VMAJ, VMIN, VMIC, VREV);
32    eval = getenv("ELM_NO_FINGER_WAGGLING");
33    if ((eval) && (!strcmp(eval, buf)))
34      return 0;
35    printf("ELEMENTARY FINGER WAGGLE!!!!!!!!!!\n"
36           "\n"
37           "  %s() used.\n"
38           "PLEASE see the API documentation for this function. This call\n"
39           "should almost never be used. Only in very special cases.\n"
40           "\n"
41           "To remove this warning please set the environment variable:\n"
42           "  ELM_NO_FINGER_WAGGLING\n"
43           "To the value of the Elementary version + revision number. e.g.:\n"
44           "  1.2.5.40295\n"
45           "\n"
46           ,
47           call);
48    return 1;
49 }
50
51 static Eina_Bool _elm_signal_exit(void *data,
52                                   int   ev_type,
53                                   void *ev);
54
55 static Eina_Prefix *pfx = NULL;
56 char *_elm_appname = NULL;
57 const char *_elm_data_dir = NULL;
58 const char *_elm_lib_dir = NULL;
59 int _elm_log_dom = -1;
60
61 EAPI int ELM_EVENT_POLICY_CHANGED = 0;
62
63 static int _elm_init_count = 0;
64 static int _elm_sub_init_count = 0;
65 static int _elm_ql_init_count = 0;
66 static int _elm_policies[ELM_POLICY_LAST];
67 static Ecore_Event_Handler *_elm_exit_handler = NULL;
68 static Eina_Bool quicklaunch_on = 0;
69
70 static Eina_Bool
71 _elm_signal_exit(void *data  __UNUSED__,
72                  int ev_type __UNUSED__,
73                  void *ev    __UNUSED__)
74 {
75    elm_exit();
76    return ECORE_CALLBACK_PASS_ON;
77 }
78
79 void
80 _elm_rescale(void)
81 {
82    edje_scale_set(_elm_config->scale);
83    _elm_win_rescale(NULL, EINA_FALSE);
84    _elm_ews_wm_rescale(NULL, EINA_FALSE);
85 }
86
87 static void *app_mainfunc = NULL;
88 static const char *app_domain = NULL;
89 static const char *app_checkfile = NULL;
90
91 static const char *app_compile_bin_dir = NULL;
92 static const char *app_compile_lib_dir = NULL;
93 static const char *app_compile_data_dir = NULL;
94 static const char *app_compile_locale_dir = NULL;
95 static const char *app_prefix_dir = NULL;
96 static const char *app_bin_dir = NULL;
97 static const char *app_lib_dir = NULL;
98 static const char *app_data_dir = NULL;
99 static const char *app_locale_dir = NULL;
100
101 static Eina_Prefix *app_pfx = NULL;
102
103 static void
104 _prefix_check(void)
105 {
106    int argc = 0;
107    char **argv = NULL;
108    const char *dirs[4] = { NULL, NULL, NULL, NULL };
109    char *caps = NULL, *p1, *p2;
110
111    if (app_pfx) return;
112    if (!app_domain) return;
113
114    ecore_app_args_get(&argc, &argv);
115    if (argc < 1) return;
116
117    dirs[0] = app_compile_bin_dir;
118    dirs[1] = app_compile_lib_dir;
119    dirs[2] = app_compile_data_dir;
120    dirs[3] = app_compile_locale_dir;
121
122    if (!dirs[1]) dirs[1] = dirs[0];
123    if (!dirs[0]) dirs[0] = dirs[1];
124    if (!dirs[3]) dirs[3] = dirs[2];
125    if (!dirs[2]) dirs[2] = dirs[3];
126
127    if (app_domain)
128      {
129         caps = alloca(strlen(app_domain) + 1);
130         for (p1 = (char *)app_domain, p2 = caps; *p1; p1++, p2++)
131            *p2 = toupper(*p1);
132         *p2 = 0;
133      }
134    app_pfx = eina_prefix_new(argv[0], app_mainfunc, caps, app_domain,
135                              app_checkfile, dirs[0], dirs[1], dirs[2], dirs[3]);
136 }
137
138 static void
139 _prefix_shutdown(void)
140 {
141    if (app_pfx) eina_prefix_free(app_pfx);
142    if (app_domain) eina_stringshare_del(app_domain);
143    if (app_checkfile) eina_stringshare_del(app_checkfile);
144    if (app_compile_bin_dir) eina_stringshare_del(app_compile_bin_dir);
145    if (app_compile_lib_dir) eina_stringshare_del(app_compile_lib_dir);
146    if (app_compile_data_dir) eina_stringshare_del(app_compile_data_dir);
147    if (app_compile_locale_dir) eina_stringshare_del(app_compile_locale_dir);
148    if (app_prefix_dir) eina_stringshare_del(app_prefix_dir);
149    if (app_bin_dir) eina_stringshare_del(app_bin_dir);
150    if (app_lib_dir) eina_stringshare_del(app_lib_dir);
151    if (app_data_dir) eina_stringshare_del(app_data_dir);
152    if (app_locale_dir) eina_stringshare_del(app_locale_dir);
153    app_mainfunc = NULL;
154    app_domain = NULL;
155    app_checkfile = NULL;
156    app_compile_bin_dir = NULL;
157    app_compile_lib_dir = NULL;
158    app_compile_data_dir = NULL;
159    app_compile_locale_dir = NULL;
160    app_prefix_dir = NULL;
161    app_bin_dir = NULL;
162    app_lib_dir = NULL;
163    app_data_dir = NULL;
164    app_locale_dir = NULL;
165    app_pfx = NULL;
166 }
167
168 EAPI int
169 elm_init(int    argc,
170          char **argv)
171 {
172    _elm_init_count++;
173    if (_elm_init_count > 1) return _elm_init_count;
174    elm_quicklaunch_init(argc, argv);
175    elm_quicklaunch_sub_init(argc, argv);
176    _prefix_shutdown();
177    return _elm_init_count;
178 }
179
180 EAPI int
181 elm_shutdown(void)
182 {
183    _elm_init_count--;
184    if (_elm_init_count > 0) return _elm_init_count;
185    _elm_win_shutdown();
186    while (_elm_win_deferred_free) ecore_main_loop_iterate();
187 // wrningz :(
188 //   _prefix_shutdown();
189    elm_quicklaunch_sub_shutdown();
190    elm_quicklaunch_shutdown();
191    return _elm_init_count;
192 }
193
194 EAPI void
195 elm_app_info_set(void *mainfunc, const char *dom, const char *checkfile)
196 {
197    app_mainfunc = mainfunc;
198    eina_stringshare_replace(&app_domain, dom);
199    eina_stringshare_replace(&app_checkfile, checkfile);
200 }
201
202 EAPI void
203 elm_app_compile_bin_dir_set(const char *dir)
204 {
205    eina_stringshare_replace(&app_compile_bin_dir, dir);
206 }
207
208 EAPI void
209 elm_app_compile_lib_dir_set(const char *dir)
210 {
211    eina_stringshare_replace(&app_compile_lib_dir, dir);
212 }
213
214 EAPI void
215 elm_app_compile_data_dir_set(const char *dir)
216 {
217    eina_stringshare_replace(&app_compile_data_dir, dir);
218 }
219
220 EAPI void
221 elm_app_compile_locale_set(const char *dir)
222 {
223    eina_stringshare_replace(&app_compile_locale_dir, dir);
224 }
225
226 EAPI const char *
227 elm_app_prefix_dir_get(void)
228 {
229    if (app_prefix_dir) return app_prefix_dir;
230    _prefix_check();
231   if (!app_pfx) return "";
232    app_prefix_dir = eina_prefix_get(app_pfx);
233    return app_prefix_dir;
234 }
235
236 EAPI const char *
237 elm_app_bin_dir_get(void)
238 {
239    if (app_bin_dir) return app_bin_dir;
240    _prefix_check();
241    if (!app_pfx) return "";
242    app_bin_dir = eina_prefix_bin_get(app_pfx);
243    return app_bin_dir;
244 }
245
246 EAPI const char *
247 elm_app_lib_dir_get(void)
248 {
249    if (app_lib_dir) return app_lib_dir;
250    _prefix_check();
251    if (!app_pfx) return "";
252    app_lib_dir = eina_prefix_lib_get(app_pfx);
253    return app_lib_dir;
254 }
255
256 EAPI const char *
257 elm_app_data_dir_get(void)
258 {
259    if (app_data_dir) return app_data_dir;
260    _prefix_check();
261    if (!app_pfx) return "";
262    app_data_dir = eina_prefix_data_get(app_pfx);
263    return app_data_dir;
264 }
265
266 EAPI const char *
267 elm_app_locale_dir_get(void)
268 {
269    if (app_locale_dir) return app_locale_dir;
270    _prefix_check();
271    if (!app_pfx) return "";
272    app_locale_dir = eina_prefix_locale_get(app_pfx);
273    return app_locale_dir;
274 }
275
276 #ifdef ELM_EDBUS
277 static int _elm_need_e_dbus = 0;
278 #endif
279 EAPI Eina_Bool
280 elm_need_e_dbus(void)
281 {
282 #ifdef ELM_EDBUS
283    if (_elm_need_e_dbus++) return EINA_TRUE;
284    e_dbus_init();
285    return EINA_TRUE;
286 #else
287    return EINA_FALSE;
288 #endif
289 }
290
291 static void
292 _elm_unneed_e_dbus(void)
293 {
294 #ifdef ELM_EDBUS
295    if (--_elm_need_e_dbus) return;
296
297    _elm_need_e_dbus = 0;
298    e_dbus_shutdown();
299 #endif
300 }
301
302 #ifdef ELM_EFREET
303 static int _elm_need_efreet = 0;
304 #endif
305 EAPI Eina_Bool
306 elm_need_efreet(void)
307 {
308 #ifdef ELM_EFREET
309    if (_elm_need_efreet++) return EINA_TRUE;
310    efreet_init();
311    efreet_mime_init();
312    efreet_trash_init();
313     /*
314      {
315         Eina_List **list;
316
317         list = efreet_icon_extra_list_get();
318         if (list)
319           {
320              e_user_dir_concat_static(buf, "icons");
321              *list = eina_list_prepend(*list, (void *)eina_stringshare_add(buf));
322              e_prefix_data_concat_static(buf, "data/icons");
323              *list = eina_list_prepend(*list, (void *)eina_stringshare_add(buf));
324           }
325      }
326    */
327    return EINA_TRUE;
328 #else
329    return EINA_FALSE;
330 #endif
331 }
332
333 static void
334 _elm_unneed_efreet(void)
335 {
336 #ifdef ELM_EFREET
337    if (--_elm_need_efreet) return;
338
339    _elm_need_efreet = 0;
340    efreet_trash_shutdown();
341    efreet_mime_shutdown();
342    efreet_shutdown();
343 #endif
344 }
345
346 EAPI void
347 elm_quicklaunch_mode_set(Eina_Bool ql_on)
348 {
349    quicklaunch_on = ql_on;
350 }
351
352 EAPI Eina_Bool
353 elm_quicklaunch_mode_get(void)
354 {
355    return quicklaunch_on;
356 }
357
358 EAPI int
359 elm_quicklaunch_init(int    argc,
360                      char **argv)
361 {
362    _elm_ql_init_count++;
363    if (_elm_ql_init_count > 1) return _elm_ql_init_count;
364    eina_init();
365    _elm_log_dom = eina_log_domain_register("elementary", EINA_COLOR_LIGHTBLUE);
366    if (!_elm_log_dom)
367      {
368         EINA_LOG_ERR("could not register elementary log domain.");
369         _elm_log_dom = EINA_LOG_DOMAIN_GLOBAL;
370      }
371
372    eet_init();
373    ecore_init();
374
375 #ifdef HAVE_ELEMENTARY_EMAP
376    emap_init();
377 #endif
378    ecore_app_args_set(argc, (const char **)argv);
379
380    memset(_elm_policies, 0, sizeof(_elm_policies));
381    if (!ELM_EVENT_POLICY_CHANGED)
382      ELM_EVENT_POLICY_CHANGED = ecore_event_type_new();
383
384    ecore_file_init();
385
386    _elm_exit_handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _elm_signal_exit, NULL);
387
388    if (argv) _elm_appname = strdup(ecore_file_file_get(argv[0]));
389
390    pfx = eina_prefix_new(argv ? argv[0] : NULL, elm_quicklaunch_init,
391                          "ELM", "elementary", "config/profile.cfg",
392                          PACKAGE_LIB_DIR, /* don't have a bin dir currently */
393                          PACKAGE_LIB_DIR,
394                          PACKAGE_DATA_DIR,
395                          LOCALE_DIR);
396    if (pfx)
397      {
398         _elm_data_dir = eina_stringshare_add(eina_prefix_data_get(pfx));
399         _elm_lib_dir = eina_stringshare_add(eina_prefix_lib_get(pfx));
400      }
401    if (!_elm_data_dir) _elm_data_dir = eina_stringshare_add("/");
402    if (!_elm_lib_dir) _elm_lib_dir = eina_stringshare_add("/");
403
404    _elm_config_init();
405    return _elm_ql_init_count;
406 }
407
408 EAPI int
409 elm_quicklaunch_sub_init(int    argc,
410                          char **argv)
411 {
412    _elm_sub_init_count++;
413    if (_elm_sub_init_count > 1) return _elm_sub_init_count;
414    if (quicklaunch_on)
415      {
416 #ifdef SEMI_BROKEN_QUICKLAUNCH
417         return _elm_sub_init_count;
418 #endif
419      }
420    if (!quicklaunch_on)
421      {
422         ecore_app_args_set(argc, (const char **)argv);
423         evas_init();
424         edje_init();
425         _elm_module_init();
426         _elm_config_sub_init();
427 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
428         if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
429             ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
430             ENGINE_COMPARE(ELM_XRENDER_X11) ||
431             ENGINE_COMPARE(ELM_OPENGL_X11))
432 #undef ENGINE_COMPARE
433           {
434 #ifdef HAVE_ELEMENTARY_X
435              ecore_x_init(NULL);
436 #endif
437           }
438         ecore_evas_init(); // FIXME: check errors
439 #ifdef HAVE_ELEMENTARY_ECORE_IMF
440         ecore_imf_init();
441 #endif
442 #ifdef HAVE_ELEMENTARY_ECORE_CON
443         ecore_con_init();
444         ecore_con_url_init();
445 #endif
446         _elm_ews_wm_init();
447      }
448    return _elm_sub_init_count;
449 }
450
451 EAPI int
452 elm_quicklaunch_sub_shutdown(void)
453 {
454    _elm_sub_init_count--;
455    if (_elm_sub_init_count > 0) return _elm_sub_init_count;
456    if (quicklaunch_on)
457      {
458 #ifdef SEMI_BROKEN_QUICKLAUNCH
459         return _elm_sub_init_count;
460 #endif
461      }
462    if (!quicklaunch_on)
463      {
464         _elm_win_shutdown();
465         _elm_module_shutdown();
466         _elm_ews_wm_shutdown();
467 #ifdef HAVE_ELEMENTARY_ECORE_CON
468         ecore_con_url_shutdown();
469         ecore_con_shutdown();
470 #endif
471 #ifdef HAVE_ELEMENTARY_ECORE_IMF
472         ecore_imf_shutdown();
473 #endif
474         ecore_evas_shutdown();
475         _elm_config_sub_shutdown();
476 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
477         if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
478             ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
479             ENGINE_COMPARE(ELM_XRENDER_X11) ||
480             ENGINE_COMPARE(ELM_OPENGL_X11) ||
481             ENGINE_COMPARE(ELM_SOFTWARE_SDL) ||
482             ENGINE_COMPARE(ELM_SOFTWARE_16_SDL) ||
483             ENGINE_COMPARE(ELM_OPENGL_SDL) ||
484             ENGINE_COMPARE(ELM_OPENGL_COCOA) ||
485             ENGINE_COMPARE(ELM_SOFTWARE_WIN32) ||
486             ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE) ||
487             ENGINE_COMPARE(ELM_EWS))
488 #undef ENGINE_COMPARE
489           evas_cserve_disconnect();
490         edje_shutdown();
491         evas_shutdown();
492      }
493    return _elm_sub_init_count;
494 }
495
496 EAPI int
497 elm_quicklaunch_shutdown(void)
498 {
499    _elm_ql_init_count--;
500    if (_elm_ql_init_count > 0) return _elm_ql_init_count;
501    if (pfx) eina_prefix_free(pfx);
502    pfx = NULL;
503    eina_stringshare_del(_elm_data_dir);
504    _elm_data_dir = NULL;
505    eina_stringshare_del(_elm_lib_dir);
506    _elm_lib_dir = NULL;
507
508    free(_elm_appname);
509    _elm_appname = NULL;
510
511    _elm_config_shutdown();
512
513    ecore_event_handler_del(_elm_exit_handler);
514    _elm_exit_handler = NULL;
515
516    _elm_theme_shutdown();
517    _elm_unneed_efreet();
518    _elm_unneed_e_dbus();
519    _elm_unneed_ethumb();
520    _elm_unneed_web();
521    ecore_file_shutdown();
522
523 #ifdef HAVE_ELEMENTARY_EMAP
524    emap_shutdown();
525 #endif
526
527    ecore_shutdown();
528    eet_shutdown();
529
530    if ((_elm_log_dom > -1) && (_elm_log_dom != EINA_LOG_DOMAIN_GLOBAL))
531      {
532         eina_log_domain_unregister(_elm_log_dom);
533         _elm_log_dom = -1;
534      }
535
536    _elm_widget_type_clear();
537
538    eina_shutdown();
539    return _elm_ql_init_count;
540 }
541
542 EAPI void
543 elm_quicklaunch_seed(void)
544 {
545 #ifndef SEMI_BROKEN_QUICKLAUNCH
546    if (quicklaunch_on)
547      {
548         Evas_Object *win, *bg, *bt;
549
550         win = elm_win_add(NULL, "seed", ELM_WIN_BASIC);
551         bg = elm_bg_add(win);
552         elm_win_resize_object_add(win, bg);
553         evas_object_show(bg);
554         bt = elm_button_add(win);
555         elm_button_label_set(bt, " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~-_=+\\|]}[{;:'\",<.>/?");
556         elm_win_resize_object_add(win, bt);
557         ecore_main_loop_iterate();
558         evas_object_del(win);
559         ecore_main_loop_iterate();
560 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
561         if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
562             ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
563             ENGINE_COMPARE(ELM_XRENDER_X11) ||
564             ENGINE_COMPARE(ELM_OPENGL_X11))
565 #undef ENGINE_COMPARE
566           {
567 # ifdef HAVE_ELEMENTARY_X
568              ecore_x_sync();
569 # endif
570           }
571         ecore_main_loop_iterate();
572      }
573 #endif
574 }
575
576 #ifdef HAVE_FORK
577 static void *qr_handle = NULL;
578 #endif
579 static int (*qr_main)(int    argc,
580                       char **argv) = NULL;
581
582 EAPI Eina_Bool
583 elm_quicklaunch_prepare(int argc __UNUSED__,
584                         char   **argv)
585 {
586 #ifdef HAVE_FORK
587    char *exe = elm_quicklaunch_exe_path_get(argv[0]);
588    if (!exe)
589      {
590         ERR("requested quicklaunch binary '%s' does not exist\n", argv[0]);
591         return EINA_FALSE;
592      }
593    else
594      {
595         char *exe2, *p;
596         char *exename;
597
598         exe2 = malloc(strlen(exe) + 1 + 10);
599         strcpy(exe2, exe);
600         p = strrchr(exe2, '/');
601         if (p) p++;
602         else p = exe2;
603         exename = alloca(strlen(p) + 1);
604         strcpy(exename, p);
605         *p = 0;
606         strcat(p, "../lib/");
607         strcat(p, exename);
608         strcat(p, ".so");
609         if (!access(exe2, R_OK | X_OK))
610           {
611              free(exe);
612              exe = exe2;
613           }
614         else
615           free(exe2);
616      }
617    qr_handle = dlopen(exe, RTLD_NOW | RTLD_GLOBAL);
618    if (!qr_handle)
619      {
620         fprintf(stderr, "dlerr: %s\n", dlerror());
621         WRN("dlopen('%s') failed: %s", exe, dlerror());
622         free(exe);
623         return EINA_FALSE;
624      }
625    INF("dlopen('%s') = %p", exe, qr_handle);
626    qr_main = dlsym(qr_handle, "elm_main");
627    INF("dlsym(%p, 'elm_main') = %p", qr_handle, qr_main);
628    if (!qr_main)
629      {
630         WRN("not quicklauncher capable: no elm_main in '%s'", exe);
631         dlclose(qr_handle);
632         qr_handle = NULL;
633         free(exe);
634         return EINA_FALSE;
635      }
636    free(exe);
637    return EINA_TRUE;
638 #else
639    return EINA_FALSE;
640    (void)argv;
641 #endif
642 }
643
644 #ifdef HAVE_FORK
645 static void
646 save_env(void)
647 {
648    int i, size;
649    extern char **environ;
650    char **oldenv, **p;
651
652    oldenv = environ;
653
654    for (i = 0, size = 0; environ[i]; i++)
655      size += strlen(environ[i]) + 1;
656
657    p = malloc((i + 1) * sizeof(char *));
658    if (!p) return;
659
660    environ = p;
661
662    for (i = 0; oldenv[i]; i++)
663      environ[i] = strdup(oldenv[i]);
664    environ[i] = NULL;
665 }
666
667 #endif
668
669 EAPI Eina_Bool
670 elm_quicklaunch_fork(int    argc,
671                      char **argv,
672                      char  *cwd,
673                      void (postfork_func) (void *data),
674                      void  *postfork_data)
675 {
676 #ifdef HAVE_FORK
677    pid_t child;
678    int ret;
679    int real_argc;
680    char **real_argv;
681
682    // FIXME:
683    // need to accept current environment from elementary_run
684    if (!qr_main)
685      {
686         int i;
687         char **args;
688
689         child = fork();
690         if (child > 0) return EINA_TRUE;
691         else if (child < 0)
692           {
693              perror("could not fork");
694              return EINA_FALSE;
695           }
696         setsid();
697         if (chdir(cwd) != 0)
698           perror("could not chdir");
699         args = alloca((argc + 1) * sizeof(char *));
700         for (i = 0; i < argc; i++) args[i] = argv[i];
701         args[argc] = NULL;
702         WRN("%s not quicklaunch capable, fallback...", argv[0]);
703         execvp(argv[0], args);
704         ERR("failed to execute '%s': %s", argv[0], strerror(errno));
705         exit(-1);
706      }
707    child = fork();
708    if (child > 0) return EINA_TRUE;
709    else if (child < 0)
710      {
711         perror("could not fork");
712         return EINA_FALSE;
713      }
714    if (postfork_func) postfork_func(postfork_data);
715
716    if (quicklaunch_on)
717      {
718 #ifdef SEMI_BROKEN_QUICKLAUNCH
719         ecore_app_args_set(argc, (const char **)argv);
720         evas_init();
721         edje_init();
722         _elm_config_sub_init();
723 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
724         if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
725             ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
726             ENGINE_COMPARE(ELM_XRENDER_X11) ||
727             ENGINE_COMPARE(ELM_OPENGL_X11))
728 #undef ENGINE_COMPARE
729           {
730 # ifdef HAVE_ELEMENTARY_X
731              ecore_x_init(NULL);
732 # endif
733           }
734         ecore_evas_init(); // FIXME: check errors
735         ecore_imf_init();
736         _elm_module_init();
737 #endif
738      }
739
740    setsid();
741    if (chdir(cwd) != 0)
742      perror("could not chdir");
743    // FIXME: this is very linux specific. it changes argv[0] of the process
744    // so ps etc. report what you'd expect. for other unixes and os's this
745    // may just not work
746    save_env();
747    if (argv)
748      {
749         char *lastarg, *p;
750
751         ecore_app_args_get(&real_argc, &real_argv);
752         lastarg = real_argv[real_argc - 1] + strlen(real_argv[real_argc - 1]);
753         for (p = real_argv[0]; p < lastarg; p++) *p = 0;
754         strcpy(real_argv[0], argv[0]);
755      }
756    ecore_app_args_set(argc, (const char **)argv);
757    ret = qr_main(argc, argv);
758    exit(ret);
759    return EINA_TRUE;
760 #else
761    return EINA_FALSE;
762    (void)argc;
763    (void)argv;
764    (void)cwd;
765    (void)postfork_func;
766    (void)postfork_data;
767 #endif
768 }
769
770 EAPI void
771 elm_quicklaunch_cleanup(void)
772 {
773 #ifdef HAVE_FORK
774    if (qr_handle)
775      {
776         dlclose(qr_handle);
777         qr_handle = NULL;
778         qr_main = NULL;
779      }
780 #endif
781 }
782
783 EAPI int
784 elm_quicklaunch_fallback(int    argc,
785                          char **argv)
786 {
787    int ret;
788    elm_quicklaunch_init(argc, argv);
789    elm_quicklaunch_sub_init(argc, argv);
790    elm_quicklaunch_prepare(argc, argv);
791    ret = qr_main(argc, argv);
792    exit(ret);
793    return ret;
794 }
795
796 EAPI char *
797 elm_quicklaunch_exe_path_get(const char *exe)
798 {
799    static char *path = NULL;
800    static Eina_List *pathlist = NULL;
801    const char *pathitr;
802    const Eina_List *l;
803    char buf[PATH_MAX];
804    if (exe[0] == '/') return strdup(exe);
805    if ((exe[0] == '.') && (exe[1] == '/')) return strdup(exe);
806    if ((exe[0] == '.') && (exe[1] == '.') && (exe[2] == '/')) return strdup(exe);
807    if (!path)
808      {
809         const char *p, *pp;
810         char *buf2;
811         path = getenv("PATH");
812         buf2 = alloca(strlen(path) + 1);
813         p = path;
814         pp = p;
815         for (;; )
816           {
817              if ((*p == ':') || (!*p))
818                {
819                   int len;
820
821                   len = p - pp;
822                   strncpy(buf2, pp, len);
823                   buf2[len] = 0;
824                   pathlist = eina_list_append(pathlist, eina_stringshare_add(buf2));
825                   if (!*p) break;
826                   p++;
827                   pp = p;
828                }
829              else
830                {
831                   if (!*p) break;
832                   p++;
833                }
834           }
835      }
836    EINA_LIST_FOREACH(pathlist, l, pathitr)
837      {
838         snprintf(buf, sizeof(buf), "%s/%s", pathitr, exe);
839         if (!access(buf, R_OK | X_OK)) return strdup(buf);
840      }
841    return NULL;
842 }
843
844 EAPI void
845 elm_run(void)
846 {
847    ecore_main_loop_begin();
848 }
849
850 EAPI void
851 elm_exit(void)
852 {
853    ecore_main_loop_quit();
854 }
855
856 EAPI Eina_Bool
857 elm_policy_set(unsigned int policy,
858                int          value)
859 {
860    Elm_Event_Policy_Changed *ev;
861
862    if (policy >= ELM_POLICY_LAST)
863      return EINA_FALSE;
864
865    if (value == _elm_policies[policy])
866      return EINA_TRUE;
867
868    /* TODO: validade policy? */
869
870    ev = malloc(sizeof(*ev));
871    ev->policy = policy;
872    ev->new_value = value;
873    ev->old_value = _elm_policies[policy];
874
875    _elm_policies[policy] = value;
876
877    ecore_event_add(ELM_EVENT_POLICY_CHANGED, ev, NULL, NULL);
878
879    return EINA_TRUE;
880 }
881
882 EAPI int
883 elm_policy_get(unsigned int policy)
884 {
885    if (policy >= ELM_POLICY_LAST)
886      return 0;
887    return _elm_policies[policy];
888 }
889
890 EAPI void
891 elm_language_set(const char *lang)
892 {
893    setlocale(LC_ALL, lang);
894    _elm_win_translate();
895 }
896
897 EAPI Eina_Bool
898 elm_object_mirrored_get(const Evas_Object *obj)
899 {
900    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
901    return elm_widget_mirrored_get(obj);
902 }
903
904 EAPI void
905 elm_object_mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
906 {
907    EINA_SAFETY_ON_NULL_RETURN(obj);
908    elm_widget_mirrored_set(obj, mirrored);
909 }
910
911 EAPI Eina_Bool
912 elm_object_mirrored_automatic_get(const Evas_Object *obj)
913 {
914    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
915    return elm_widget_mirrored_automatic_get(obj);
916 }
917
918 EAPI void
919 elm_object_mirrored_automatic_set(Evas_Object *obj, Eina_Bool automatic)
920 {
921    EINA_SAFETY_ON_NULL_RETURN(obj);
922    elm_widget_mirrored_automatic_set(obj, automatic);
923 }
924
925 /**
926  * @}
927  */
928
929 EAPI void
930 elm_object_scale_set(Evas_Object *obj,
931                      double       scale)
932 {
933    EINA_SAFETY_ON_NULL_RETURN(obj);
934    elm_widget_scale_set(obj, scale);
935 }
936
937 EAPI double
938 elm_object_scale_get(const Evas_Object *obj)
939 {
940    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, 0.0);
941    return elm_widget_scale_get(obj);
942 }
943
944 EAPI void
945 elm_object_text_part_set(Evas_Object *obj, const char *part, const char *label)
946 {
947    EINA_SAFETY_ON_NULL_RETURN(obj);
948    elm_widget_text_part_set(obj, part, label);
949 }
950
951 EAPI const char *
952 elm_object_text_part_get(const Evas_Object *obj, const char *part)
953 {
954    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
955    return elm_widget_text_part_get(obj, part);
956 }
957
958 EAPI void
959 elm_object_part_text_set(Evas_Object *obj, const char *part, const char *label)
960 {
961    EINA_SAFETY_ON_NULL_RETURN(obj);
962    elm_widget_text_part_set(obj, part, label);
963 }
964
965 EAPI const char *
966 elm_object_part_text_get(const Evas_Object *obj, const char *part)
967 {
968    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
969    return elm_widget_text_part_get(obj, part);
970 }
971
972 EAPI void
973 elm_object_domain_translatable_text_part_set(Evas_Object *obj, const char *part, const char *domain, const char *text)
974 {
975    EINA_SAFETY_ON_NULL_RETURN(obj);
976    elm_widget_domain_translatable_text_part_set(obj, part, domain, text);
977 }
978
979 EAPI const char *
980 elm_object_translatable_text_part_get(const Evas_Object *obj, const char *part)
981 {
982    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
983    return elm_widget_translatable_text_part_get(obj, part);
984 }
985
986 EAPI void
987 elm_object_part_content_set(Evas_Object *obj, const char *part, Evas_Object *content)
988 {
989    EINA_SAFETY_ON_NULL_RETURN(obj);
990    elm_widget_content_part_set(obj, part, content);
991 }
992
993 EAPI void
994 elm_object_content_part_set(Evas_Object *obj, const char *part, Evas_Object *content)
995 {
996    EINA_SAFETY_ON_NULL_RETURN(obj);
997    elm_widget_content_part_set(obj, part, content);
998 }
999
1000
1001 EAPI Evas_Object *
1002 elm_object_part_content_get(const Evas_Object *obj, const char *part)
1003 {
1004    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1005    return elm_widget_content_part_get(obj, part);
1006 }
1007
1008 EAPI Evas_Object *
1009 elm_object_content_part_get(const Evas_Object *obj, const char *part)
1010 {
1011    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1012    return elm_widget_content_part_get(obj, part);
1013 }
1014
1015 EAPI Evas_Object *
1016 elm_object_part_content_unset(Evas_Object *obj, const char *part)
1017 {
1018    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1019    return elm_widget_content_part_unset(obj, part);
1020 }
1021
1022
1023 EAPI Evas_Object *
1024 elm_object_content_part_unset(Evas_Object *obj, const char *part)
1025 {
1026    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1027    return elm_widget_content_part_unset(obj, part);
1028 }
1029
1030 EAPI double
1031 elm_scale_get(void)
1032 {
1033    return _elm_config->scale;
1034 }
1035
1036 EAPI void
1037 elm_scale_set(double scale)
1038 {
1039    if (_elm_config->scale == scale) return;
1040    _elm_config->scale = scale;
1041    _elm_rescale();
1042 }
1043
1044 EAPI void
1045 elm_scale_all_set(double scale)
1046 {
1047    elm_scale_set(scale);
1048    _elm_config_all_update();
1049 }
1050
1051 EAPI Eina_Bool
1052 elm_password_show_last_get(void)
1053 {
1054    return _elm_config->password_show_last;
1055 }
1056
1057 EAPI void
1058 elm_password_show_last_set(Eina_Bool password_show_last)
1059 {
1060    if (_elm_config->password_show_last == password_show_last) return;
1061    _elm_config->password_show_last = password_show_last;
1062    edje_password_show_last_set(_elm_config->password_show_last);
1063 }
1064
1065 EAPI double
1066 elm_password_show_last_timeout_get(void)
1067 {
1068    return _elm_config->password_show_last_timeout;
1069 }
1070
1071 EAPI void
1072 elm_password_show_last_timeout_set(double password_show_last_timeout)
1073 {
1074    if (_elm_config->password_show_last_timeout == password_show_last_timeout) return;
1075    _elm_config->password_show_last_timeout = password_show_last_timeout;
1076    edje_password_show_last_timeout_set(_elm_config->password_show_last_timeout);
1077 }
1078
1079 EAPI void
1080 elm_object_style_set(Evas_Object *obj,
1081                      const char  *style)
1082 {
1083    EINA_SAFETY_ON_NULL_RETURN(obj);
1084    elm_widget_style_set(obj, style);
1085 }
1086
1087 EAPI const char *
1088 elm_object_style_get(const Evas_Object *obj)
1089 {
1090    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1091    return elm_widget_style_get(obj);
1092 }
1093
1094 EAPI void
1095 elm_object_disabled_set(Evas_Object *obj,
1096                         Eina_Bool    disabled)
1097 {
1098    EINA_SAFETY_ON_NULL_RETURN(obj);
1099    elm_widget_disabled_set(obj, disabled);
1100 }
1101
1102 EAPI Eina_Bool
1103 elm_object_disabled_get(const Evas_Object *obj)
1104 {
1105    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1106    return elm_widget_disabled_get(obj);
1107 }
1108
1109 EAPI Eina_Bool
1110 elm_config_save(void)
1111 {
1112    return _elm_config_save();
1113 }
1114
1115 EAPI void
1116 elm_config_reload(void)
1117 {
1118    _elm_config_reload();
1119 }
1120
1121 EAPI const char *
1122 elm_profile_current_get(void)
1123 {
1124    return _elm_config_current_profile_get();
1125 }
1126
1127 EAPI const char *
1128 elm_profile_dir_get(const char *profile,
1129                     Eina_Bool   is_user)
1130 {
1131    return _elm_config_profile_dir_get(profile, is_user);
1132 }
1133
1134 EAPI void
1135 elm_profile_dir_free(const char *p_dir)
1136 {
1137    free((void *)p_dir);
1138 }
1139
1140 EAPI Eina_List *
1141 elm_profile_list_get(void)
1142 {
1143    return _elm_config_profiles_list();
1144 }
1145
1146 EAPI void
1147 elm_profile_list_free(Eina_List *l)
1148 {
1149    const char *dir;
1150
1151    EINA_LIST_FREE(l, dir)
1152      eina_stringshare_del(dir);
1153 }
1154
1155 EAPI void
1156 elm_profile_set(const char *profile)
1157 {
1158    EINA_SAFETY_ON_NULL_RETURN(profile);
1159    _elm_config_profile_set(profile);
1160 }
1161
1162 EAPI void
1163 elm_profile_all_set(const char *profile)
1164 {
1165    _elm_config_profile_set(profile);
1166    _elm_config_all_update();
1167 }
1168
1169 EAPI const char *
1170 elm_engine_current_get(void)
1171 {
1172    return _elm_config->engine;
1173 }
1174
1175 EAPI void
1176 elm_engine_set(const char *engine)
1177 {
1178    EINA_SAFETY_ON_NULL_RETURN(engine);
1179
1180    _elm_config_engine_set(engine);
1181 }
1182
1183 EAPI const Eina_List *
1184 elm_text_classes_list_get(void)
1185 {
1186    return _elm_config_text_classes_get();
1187 }
1188
1189 EAPI void
1190 elm_text_classes_list_free(const Eina_List *list)
1191 {
1192    _elm_config_text_classes_free((Eina_List *)list);
1193 }
1194
1195 EAPI const Eina_List *
1196 elm_font_overlay_list_get(void)
1197 {
1198    return _elm_config_font_overlays_list();
1199 }
1200
1201 EAPI void
1202 elm_font_overlay_set(const char    *text_class,
1203                      const char    *font,
1204                      Evas_Font_Size size)
1205 {
1206    _elm_config_font_overlay_set(text_class, font, size);
1207 }
1208
1209 EAPI void
1210 elm_font_overlay_unset(const char *text_class)
1211 {
1212    _elm_config_font_overlay_remove(text_class);
1213 }
1214
1215 EAPI void
1216 elm_font_overlay_apply(void)
1217 {
1218    _elm_config_font_overlay_apply();
1219 }
1220
1221 EAPI void
1222 elm_font_overlay_all_apply(void)
1223 {
1224    elm_font_overlay_apply();
1225    _elm_config_all_update();
1226 }
1227
1228 EAPI Elm_Font_Properties *
1229 elm_font_properties_get(const char *font)
1230 {
1231    EINA_SAFETY_ON_NULL_RETURN_VAL(font, NULL);
1232    return _elm_font_properties_get(NULL, font);
1233 }
1234
1235 EAPI void
1236 elm_font_properties_free(Elm_Font_Properties *efp)
1237 {
1238    const char *str;
1239
1240    EINA_SAFETY_ON_NULL_RETURN(efp);
1241    EINA_LIST_FREE(efp->styles, str)
1242      if (str) eina_stringshare_del(str);
1243    if (efp->name) eina_stringshare_del(efp->name);
1244    free(efp);
1245 }
1246
1247 EAPI const char *
1248 elm_font_fontconfig_name_get(const char *name,
1249                              const char *style)
1250 {
1251    char buf[256];
1252
1253    EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
1254    if (!style || style[0] == 0) return eina_stringshare_add(name);
1255    snprintf(buf, 256, "%s" ELM_FONT_TOKEN_STYLE "%s", name, style);
1256    return eina_stringshare_add(buf);
1257 }
1258
1259 EAPI void
1260 elm_font_fontconfig_name_free(const char *name)
1261 {
1262    eina_stringshare_del(name);
1263 }
1264
1265 EAPI Eina_Hash *
1266 elm_font_available_hash_add(Eina_List *list)
1267 {
1268    Eina_Hash *font_hash;
1269    Eina_List *l;
1270    void *key;
1271
1272    font_hash = NULL;
1273
1274    /* populate with default font families */
1275    font_hash = _elm_font_available_hash_add(font_hash, "Sans:style=Regular");
1276    font_hash = _elm_font_available_hash_add(font_hash, "Sans:style=Bold");
1277    font_hash = _elm_font_available_hash_add(font_hash, "Sans:style=Oblique");
1278    font_hash = _elm_font_available_hash_add(font_hash,
1279                                             "Sans:style=Bold Oblique");
1280
1281    font_hash = _elm_font_available_hash_add(font_hash, "Serif:style=Regular");
1282    font_hash = _elm_font_available_hash_add(font_hash, "Serif:style=Bold");
1283    font_hash = _elm_font_available_hash_add(font_hash, "Serif:style=Oblique");
1284    font_hash = _elm_font_available_hash_add(font_hash,
1285                                             "Serif:style=Bold Oblique");
1286
1287    font_hash = _elm_font_available_hash_add(font_hash,
1288                                             "Monospace:style=Regular");
1289    font_hash = _elm_font_available_hash_add(font_hash,
1290                                             "Monospace:style=Bold");
1291    font_hash = _elm_font_available_hash_add(font_hash,
1292                                             "Monospace:style=Oblique");
1293    font_hash = _elm_font_available_hash_add(font_hash,
1294                                             "Monospace:style=Bold Oblique");
1295
1296    EINA_LIST_FOREACH(list, l, key)
1297      font_hash = _elm_font_available_hash_add(font_hash, key);
1298
1299    return font_hash;
1300 }
1301
1302 EAPI void
1303 elm_font_available_hash_del(Eina_Hash *hash)
1304 {
1305    _elm_font_available_hash_del(hash);
1306 }
1307
1308 EAPI Evas_Coord
1309 elm_finger_size_get(void)
1310 {
1311    return _elm_config->finger_size;
1312 }
1313
1314 EAPI void
1315 elm_finger_size_set(Evas_Coord size)
1316 {
1317    if (_elm_config->finger_size == size) return;
1318    _elm_config->finger_size = size;
1319    _elm_rescale();
1320 }
1321
1322 EAPI void
1323 elm_finger_size_all_set(Evas_Coord size)
1324 {
1325    elm_finger_size_set(size);
1326    _elm_config_all_update();
1327 }
1328
1329 EAPI void
1330 elm_coords_finger_size_adjust(int         times_w,
1331                               Evas_Coord *w,
1332                               int         times_h,
1333                               Evas_Coord *h)
1334 {
1335    if ((w) && (*w < (_elm_config->finger_size * times_w)))
1336      *w = _elm_config->finger_size * times_w;
1337    if ((h) && (*h < (_elm_config->finger_size * times_h)))
1338      *h = _elm_config->finger_size * times_h;
1339 }
1340
1341 EAPI void
1342 elm_all_flush(void)
1343 {
1344    const Eina_List *l;
1345    Evas_Object *obj;
1346
1347    edje_file_cache_flush();
1348    edje_collection_cache_flush();
1349    eet_clearcache();
1350    EINA_LIST_FOREACH(_elm_win_list, l, obj)
1351      {
1352         Evas *e = evas_object_evas_get(obj);
1353         evas_image_cache_flush(e);
1354         evas_font_cache_flush(e);
1355         evas_render_dump(e);
1356      }
1357 }
1358
1359 EAPI int
1360 elm_cache_flush_interval_get(void)
1361 {
1362    return _elm_config->cache_flush_poll_interval;
1363 }
1364
1365 EAPI void
1366 elm_cache_flush_interval_set(int size)
1367 {
1368    if (_elm_config->cache_flush_poll_interval == size) return;
1369    _elm_config->cache_flush_poll_interval = size;
1370
1371    _elm_recache();
1372 }
1373
1374 EAPI void
1375 elm_cache_flush_interval_all_set(int size)
1376 {
1377    elm_cache_flush_interval_set(size);
1378    _elm_config_all_update();
1379 }
1380
1381 EAPI Eina_Bool
1382 elm_cache_flush_enabled_get(void)
1383 {
1384    return _elm_config->cache_flush_enable;
1385 }
1386
1387 EAPI void
1388 elm_cache_flush_enabled_set(Eina_Bool enabled)
1389 {
1390    enabled = !!enabled;
1391    if (_elm_config->cache_flush_enable == enabled) return;
1392    _elm_config->cache_flush_enable = enabled;
1393
1394    _elm_recache();
1395 }
1396
1397 EAPI void
1398 elm_cache_flush_enabled_all_set(Eina_Bool enabled)
1399 {
1400    elm_cache_flush_enabled_set(enabled);
1401    _elm_config_all_update();
1402 }
1403
1404 EAPI int
1405 elm_font_cache_get(void)
1406 {
1407    return _elm_config->font_cache;
1408 }
1409
1410 EAPI void
1411 elm_font_cache_set(int size)
1412 {
1413    if (_elm_config->font_cache == size) return;
1414    _elm_config->font_cache = size;
1415
1416    _elm_recache();
1417 }
1418
1419 EAPI void
1420 elm_font_cache_all_set(int size)
1421 {
1422    elm_font_cache_set(size);
1423    _elm_config_all_update();
1424 }
1425
1426 EAPI int
1427 elm_image_cache_get(void)
1428 {
1429    return _elm_config->image_cache;
1430 }
1431
1432 EAPI void
1433 elm_image_cache_set(int size)
1434 {
1435    if (_elm_config->image_cache == size) return;
1436    _elm_config->image_cache = size;
1437
1438    _elm_recache();
1439 }
1440
1441 EAPI void
1442 elm_image_cache_all_set(int size)
1443 {
1444    elm_image_cache_set(size);
1445    _elm_config_all_update();
1446 }
1447
1448 EAPI int
1449 elm_edje_file_cache_get(void)
1450 {
1451    return _elm_config->edje_cache;
1452 }
1453
1454 EAPI void
1455 elm_edje_file_cache_set(int size)
1456 {
1457    if (_elm_config->edje_cache == size) return;
1458    _elm_config->edje_cache = size;
1459
1460    _elm_recache();
1461 }
1462
1463 EAPI void
1464 elm_edje_file_cache_all_set(int size)
1465 {
1466    elm_edje_file_cache_set(size);
1467    _elm_config_all_update();
1468 }
1469
1470 EAPI int
1471 elm_edje_collection_cache_get(void)
1472 {
1473    return _elm_config->edje_collection_cache;
1474 }
1475
1476 EAPI void
1477 elm_edje_collection_cache_set(int size)
1478 {
1479    if (_elm_config->edje_collection_cache == size) return;
1480    _elm_config->edje_collection_cache = size;
1481
1482    _elm_recache();
1483 }
1484
1485 EAPI void
1486 elm_edje_collection_cache_all_set(int size)
1487 {
1488    elm_edje_collection_cache_set(size);
1489    _elm_config_all_update();
1490 }
1491
1492 EAPI Eina_Bool
1493 elm_object_focus_get(const Evas_Object *obj)
1494 {
1495    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1496    return elm_widget_focus_get(obj);
1497 }
1498
1499 EAPI void
1500 elm_object_focus_set(Evas_Object *obj,
1501                      Eina_Bool    focus)
1502 {
1503    EINA_SAFETY_ON_NULL_RETURN(obj);
1504    if (focus)
1505      {
1506         if (elm_widget_focus_get(obj)) return;
1507         elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
1508      }
1509    else
1510      {
1511         if (!elm_widget_can_focus_get(obj)) return;
1512         elm_widget_focused_object_clear(obj);
1513      }
1514 }
1515
1516 EAPI void
1517 elm_object_focus(Evas_Object *obj)
1518 {
1519    EINA_SAFETY_ON_NULL_RETURN(obj);
1520    elm_object_focus_set(obj, EINA_TRUE);
1521 }
1522
1523 EAPI void
1524 elm_object_unfocus(Evas_Object *obj)
1525 {
1526    EINA_SAFETY_ON_NULL_RETURN(obj);
1527    elm_object_focus_set(obj, EINA_FALSE);
1528 }
1529
1530 EAPI void
1531 elm_object_focus_allow_set(Evas_Object *obj,
1532                            Eina_Bool    enable)
1533 {
1534    EINA_SAFETY_ON_NULL_RETURN(obj);
1535    elm_widget_can_focus_set(obj, enable);
1536 }
1537
1538 EAPI Eina_Bool
1539 elm_object_focus_allow_get(const Evas_Object *obj)
1540 {
1541    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1542    return (elm_widget_can_focus_get(obj)) || (elm_widget_child_can_focus_get(obj));
1543 }
1544
1545 EAPI void
1546 elm_object_focus_custom_chain_set(Evas_Object *obj,
1547                                   Eina_List   *objs)
1548 {
1549    EINA_SAFETY_ON_NULL_RETURN(obj);
1550    elm_widget_focus_custom_chain_set(obj, objs);
1551 }
1552
1553 EAPI void
1554 elm_object_focus_custom_chain_unset(Evas_Object *obj)
1555 {
1556    EINA_SAFETY_ON_NULL_RETURN(obj);
1557    elm_widget_focus_custom_chain_unset(obj);
1558 }
1559
1560 EAPI const Eina_List *
1561 elm_object_focus_custom_chain_get(const Evas_Object *obj)
1562 {
1563    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1564    return elm_widget_focus_custom_chain_get(obj);
1565 }
1566
1567 EAPI void
1568 elm_object_focus_custom_chain_append(Evas_Object *obj,
1569                                      Evas_Object *child,
1570                                      Evas_Object *relative_child)
1571 {
1572    EINA_SAFETY_ON_NULL_RETURN(obj);
1573    EINA_SAFETY_ON_NULL_RETURN(child);
1574    elm_widget_focus_custom_chain_append(obj, child, relative_child);
1575 }
1576
1577 EAPI void
1578 elm_object_focus_custom_chain_prepend(Evas_Object *obj,
1579                                       Evas_Object *child,
1580                                       Evas_Object *relative_child)
1581 {
1582    EINA_SAFETY_ON_NULL_RETURN(obj);
1583    EINA_SAFETY_ON_NULL_RETURN(child);
1584    elm_widget_focus_custom_chain_prepend(obj, child, relative_child);
1585 }
1586
1587 EAPI void
1588 elm_object_focus_cycle(Evas_Object        *obj,
1589                        Elm_Focus_Direction dir)
1590 {
1591    EINA_SAFETY_ON_NULL_RETURN(obj);
1592    elm_widget_focus_cycle(obj, dir);
1593 }
1594
1595 EAPI void
1596 elm_object_focus_direction_go(Evas_Object *obj,
1597                               int          x,
1598                               int          y)
1599 {
1600    EINA_SAFETY_ON_NULL_RETURN(obj);
1601    elm_widget_focus_direction_go(obj, x, y);
1602 }
1603
1604 EAPI void
1605 elm_object_tree_unfocusable_set(Evas_Object *obj,
1606                                 Eina_Bool    tree_unfocusable)
1607 {
1608    EINA_SAFETY_ON_NULL_RETURN(obj);
1609    elm_widget_tree_unfocusable_set(obj, tree_unfocusable);
1610 }
1611
1612 EAPI Eina_Bool
1613 elm_object_tree_unfocusable_get(const Evas_Object *obj)
1614 {
1615    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1616    return elm_widget_tree_unfocusable_get(obj);
1617 }
1618
1619 EAPI Eina_Bool
1620 elm_focus_highlight_enabled_get(void)
1621 {
1622    return _elm_config->focus_highlight_enable;
1623 }
1624
1625 EAPI void
1626 elm_focus_highlight_enabled_set(Eina_Bool enable)
1627 {
1628    _elm_config->focus_highlight_enable = !!enable;
1629 }
1630
1631 EAPI Eina_Bool
1632 elm_focus_highlight_animate_get(void)
1633 {
1634    return _elm_config->focus_highlight_animate;
1635 }
1636
1637 EAPI void
1638 elm_focus_highlight_animate_set(Eina_Bool animate)
1639 {
1640    _elm_config->focus_highlight_animate = !!animate;
1641 }
1642
1643 EAPI Eina_Bool
1644 elm_scroll_bounce_enabled_get(void)
1645 {
1646    return _elm_config->thumbscroll_bounce_enable;
1647 }
1648
1649 EAPI void
1650 elm_scroll_bounce_enabled_set(Eina_Bool enabled)
1651 {
1652    _elm_config->thumbscroll_bounce_enable = enabled;
1653 }
1654
1655 EAPI void
1656 elm_scroll_bounce_enabled_all_set(Eina_Bool enabled)
1657 {
1658    elm_scroll_bounce_enabled_set(enabled);
1659    _elm_config_all_update();
1660 }
1661
1662 EAPI double
1663 elm_scroll_bounce_friction_get(void)
1664 {
1665    return _elm_config->thumbscroll_bounce_friction;
1666 }
1667
1668 EAPI void
1669 elm_scroll_bounce_friction_set(double friction)
1670 {
1671    _elm_config->thumbscroll_bounce_friction = friction;
1672 }
1673
1674 EAPI void
1675 elm_scroll_bounce_friction_all_set(double friction)
1676 {
1677    elm_scroll_bounce_friction_set(friction);
1678    _elm_config_all_update();
1679 }
1680
1681 EAPI double
1682 elm_scroll_page_scroll_friction_get(void)
1683 {
1684    return _elm_config->page_scroll_friction;
1685 }
1686
1687 EAPI void
1688 elm_scroll_page_scroll_friction_set(double friction)
1689 {
1690    _elm_config->page_scroll_friction = friction;
1691 }
1692
1693 EAPI void
1694 elm_scroll_page_scroll_friction_all_set(double friction)
1695 {
1696    elm_scroll_page_scroll_friction_set(friction);
1697    _elm_config_all_update();
1698 }
1699
1700 EAPI double
1701 elm_scroll_bring_in_scroll_friction_get(void)
1702 {
1703    return _elm_config->bring_in_scroll_friction;
1704 }
1705
1706 EAPI void
1707 elm_scroll_bring_in_scroll_friction_set(double friction)
1708 {
1709    _elm_config->bring_in_scroll_friction = friction;
1710 }
1711
1712 EAPI void
1713 elm_scroll_bring_in_scroll_friction_all_set(double friction)
1714 {
1715    elm_scroll_bring_in_scroll_friction_set(friction);
1716    _elm_config_all_update();
1717 }
1718
1719 EAPI double
1720 elm_scroll_zoom_friction_get(void)
1721 {
1722    return _elm_config->zoom_friction;
1723 }
1724
1725 EAPI void
1726 elm_scroll_zoom_friction_set(double friction)
1727 {
1728    _elm_config->zoom_friction = friction;
1729 }
1730
1731 EAPI void
1732 elm_scroll_zoom_friction_all_set(double friction)
1733 {
1734    elm_scroll_zoom_friction_set(friction);
1735    _elm_config_all_update();
1736 }
1737
1738 EAPI Eina_Bool
1739 elm_scroll_thumbscroll_enabled_get(void)
1740 {
1741    return _elm_config->thumbscroll_enable;
1742 }
1743
1744 EAPI void
1745 elm_scroll_thumbscroll_enabled_set(Eina_Bool enabled)
1746 {
1747    _elm_config->thumbscroll_enable = enabled;
1748 }
1749
1750 EAPI void
1751 elm_scroll_thumbscroll_enabled_all_set(Eina_Bool enabled)
1752 {
1753    elm_scroll_thumbscroll_enabled_set(enabled);
1754    _elm_config_all_update();
1755 }
1756
1757 EAPI unsigned int
1758 elm_scroll_thumbscroll_threshold_get(void)
1759 {
1760    return _elm_config->thumbscroll_threshold;
1761 }
1762
1763 EAPI void
1764 elm_scroll_thumbscroll_threshold_set(unsigned int threshold)
1765 {
1766    _elm_config->thumbscroll_threshold = threshold;
1767 }
1768
1769 EAPI void
1770 elm_scroll_thumbscroll_threshold_all_set(unsigned int threshold)
1771 {
1772    elm_scroll_thumbscroll_threshold_set(threshold);
1773    _elm_config_all_update();
1774 }
1775
1776 EAPI double
1777 elm_scroll_thumbscroll_momentum_threshold_get(void)
1778 {
1779    return _elm_config->thumbscroll_momentum_threshold;
1780 }
1781
1782 EAPI void
1783 elm_scroll_thumbscroll_momentum_threshold_set(double threshold)
1784 {
1785    _elm_config->thumbscroll_momentum_threshold = threshold;
1786 }
1787
1788 EAPI void
1789 elm_scroll_thumbscroll_momentum_threshold_all_set(double threshold)
1790 {
1791    elm_scroll_thumbscroll_momentum_threshold_set(threshold);
1792    _elm_config_all_update();
1793 }
1794
1795 EAPI double
1796 elm_scroll_thumbscroll_friction_get(void)
1797 {
1798    return _elm_config->thumbscroll_friction;
1799 }
1800
1801 EAPI void
1802 elm_scroll_thumbscroll_friction_set(double friction)
1803 {
1804    _elm_config->thumbscroll_friction = friction;
1805 }
1806
1807 EAPI void
1808 elm_scroll_thumbscroll_friction_all_set(double friction)
1809 {
1810    elm_scroll_thumbscroll_friction_set(friction);
1811    _elm_config_all_update();
1812 }
1813
1814 EAPI double
1815 elm_scroll_thumbscroll_border_friction_get(void)
1816 {
1817    return _elm_config->thumbscroll_border_friction;
1818 }
1819
1820 EAPI void
1821 elm_scroll_thumbscroll_border_friction_set(double friction)
1822 {
1823    if (friction < 0.0) friction = 0.0;
1824    if (friction > 1.0) friction = 1.0;
1825    _elm_config->thumbscroll_friction = friction;
1826 }
1827
1828 EAPI void
1829 elm_scroll_thumbscroll_border_friction_all_set(double friction)
1830 {
1831    elm_scroll_thumbscroll_border_friction_set(friction);
1832    _elm_config_all_update();
1833 }
1834
1835 EAPI double
1836 elm_scroll_thumbscroll_sensitivity_friction_get(void)
1837 {
1838    return _elm_config->thumbscroll_sensitivity_friction;
1839 }
1840
1841 EAPI void
1842 elm_scroll_thumbscroll_sensitivity_friction_set(double friction)
1843 {
1844    if (friction < 0.1) friction = 0.1;
1845    if (friction > 1.0) friction = 1.0;
1846    _elm_config->thumbscroll_friction = friction;
1847 }
1848
1849 EAPI void
1850 elm_scroll_thumbscroll_sensitivity_friction_all_set(double friction)
1851 {
1852    elm_scroll_thumbscroll_sensitivity_friction_set(friction);
1853    _elm_config_all_update();
1854 }
1855
1856 EAPI void
1857 elm_object_scroll_hold_push(Evas_Object *obj)
1858 {
1859    EINA_SAFETY_ON_NULL_RETURN(obj);
1860    elm_widget_scroll_hold_push(obj);
1861 }
1862
1863 EAPI void
1864 elm_object_scroll_hold_pop(Evas_Object *obj)
1865 {
1866    EINA_SAFETY_ON_NULL_RETURN(obj);
1867    elm_widget_scroll_hold_pop(obj);
1868 }
1869
1870 EAPI void
1871 elm_object_scroll_freeze_push(Evas_Object *obj)
1872 {
1873    EINA_SAFETY_ON_NULL_RETURN(obj);
1874    elm_widget_scroll_freeze_push(obj);
1875 }
1876
1877 EAPI void
1878 elm_object_scroll_lock_x_set(Evas_Object *obj,
1879                              Eina_Bool    lock)
1880 {
1881    EINA_SAFETY_ON_NULL_RETURN(obj);
1882    elm_widget_drag_lock_x_set(obj, lock);
1883 }
1884
1885 EAPI void
1886 elm_object_scroll_lock_y_set(Evas_Object *obj,
1887                              Eina_Bool    lock)
1888 {
1889    EINA_SAFETY_ON_NULL_RETURN(obj);
1890    elm_widget_drag_lock_y_set(obj, lock);
1891 }
1892
1893 EAPI Eina_Bool
1894 elm_object_scroll_lock_x_get(const Evas_Object *obj)
1895 {
1896    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1897    return elm_widget_drag_lock_x_get(obj);
1898 }
1899
1900 EAPI Eina_Bool
1901 elm_object_scroll_lock_y_get(const Evas_Object *obj)
1902 {
1903    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1904    return elm_widget_drag_lock_y_get(obj);
1905 }
1906
1907 EAPI void
1908 elm_object_scroll_freeze_pop(Evas_Object *obj)
1909 {
1910    EINA_SAFETY_ON_NULL_RETURN(obj);
1911    elm_widget_scroll_freeze_pop(obj);
1912 }
1913
1914 EAPI Eina_Bool
1915 elm_object_widget_check(const Evas_Object *obj)
1916 {
1917    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1918    return elm_widget_is(obj);
1919 }
1920
1921 EAPI Evas_Object *
1922 elm_object_parent_widget_get(const Evas_Object *obj)
1923 {
1924    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1925    return elm_widget_parent_widget_get(obj);
1926 }
1927
1928 EAPI Evas_Object *
1929 elm_object_top_widget_get(const Evas_Object *obj)
1930 {
1931    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1932    return elm_widget_top_get(obj);
1933 }
1934
1935 EAPI const char *
1936 elm_object_widget_type_get(const Evas_Object *obj)
1937 {
1938    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1939    return elm_widget_type_get(obj);
1940 }
1941
1942 EAPI void
1943 elm_object_signal_emit(Evas_Object *obj,
1944                        const char  *emission,
1945                        const char  *source)
1946 {
1947    EINA_SAFETY_ON_NULL_RETURN(obj);
1948    elm_widget_signal_emit(obj, emission, source);
1949 }
1950
1951 EAPI void
1952 elm_object_signal_callback_add(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data)
1953 {
1954     EINA_SAFETY_ON_NULL_RETURN(obj);
1955     EINA_SAFETY_ON_NULL_RETURN(func);
1956     elm_widget_signal_callback_add(obj, emission, source, func, data);
1957 }
1958
1959 EAPI void *
1960 elm_object_signal_callback_del(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func)
1961 {
1962     EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1963     EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
1964     return elm_widget_signal_callback_del(obj, emission, source, func);
1965 }
1966
1967 EAPI void
1968 elm_object_event_callback_add(Evas_Object *obj, Elm_Event_Cb func, const void *data)
1969 {
1970    EINA_SAFETY_ON_NULL_RETURN(obj);
1971    EINA_SAFETY_ON_NULL_RETURN(func);
1972    elm_widget_event_callback_add(obj, func, data);
1973 }
1974
1975 EAPI void *
1976 elm_object_event_callback_del(Evas_Object *obj, Elm_Event_Cb func, const void *data)
1977 {
1978    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1979    EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
1980    return elm_widget_event_callback_del(obj, func, data);
1981 }
1982
1983 EAPI void
1984 elm_object_tree_dump(const Evas_Object *top)
1985 {
1986 #ifdef ELM_DEBUG
1987    elm_widget_tree_dump(top);
1988 #else
1989    return;
1990    (void)top;
1991 #endif
1992 }
1993
1994 EAPI void
1995 elm_object_tree_dot_dump(const Evas_Object *top,
1996                          const char        *file)
1997 {
1998 #ifdef ELM_DEBUG
1999    FILE *f = fopen(file, "wb");
2000    elm_widget_tree_dot_dump(top, f);
2001    fclose(f);
2002 #else
2003    return;
2004    (void)top;
2005    (void)file;
2006 #endif
2007 }
2008
2009 EAPI void
2010 elm_longpress_timeout_set(double longpress_timeout)
2011 {
2012    _elm_config->longpress_timeout = longpress_timeout;
2013 }
2014
2015 EAPI double
2016 elm_longpress_timeout_get(void)
2017 {
2018    return _elm_config->longpress_timeout;
2019 }
2020
2021 EAPI Evas_Object *
2022 elm_object_item_widget_get(const Elm_Object_Item *it)
2023 {
2024    return WIDGET(it);
2025 }
2026
2027 EAPI void
2028 elm_object_item_content_part_set(Elm_Object_Item *it,
2029                                  const char *part,
2030                                  Evas_Object *content)
2031 {
2032    _elm_widget_item_content_part_set((Elm_Widget_Item *) it, part, content);
2033 }
2034
2035 EAPI void
2036 elm_object_item_part_content_set(Elm_Object_Item *it,
2037                                  const char *part,
2038                                  Evas_Object *content)
2039 {
2040    _elm_widget_item_content_part_set((Elm_Widget_Item *) it, part, content);
2041 }
2042
2043 EAPI Evas_Object *
2044 elm_object_item_content_part_get(const Elm_Object_Item *it,
2045                                  const char *part)
2046 {
2047    return _elm_widget_item_content_part_get((Elm_Widget_Item *) it, part);
2048 }
2049
2050 EAPI Evas_Object *
2051 elm_object_item_part_content_get(const Elm_Object_Item *it,
2052                                  const char *part)
2053 {
2054    return _elm_widget_item_content_part_get((Elm_Widget_Item *) it, part);
2055 }
2056
2057 EAPI Evas_Object *
2058 elm_object_item_content_part_unset(Elm_Object_Item *it, const char *part)
2059 {
2060    return _elm_widget_item_content_part_unset((Elm_Widget_Item *) it, part);
2061 }
2062
2063 EAPI Evas_Object *
2064 elm_object_item_part_content_unset(Elm_Object_Item *it, const char *part)
2065 {
2066    return _elm_widget_item_content_part_unset((Elm_Widget_Item *) it, part);
2067 }
2068
2069 EAPI void
2070 elm_object_item_text_part_set(Elm_Object_Item *it,
2071                               const char *part,
2072                               const char *label)
2073 {
2074    _elm_widget_item_text_part_set((Elm_Widget_Item *) it, part, label);
2075 }
2076
2077 EAPI void
2078 elm_object_item_part_text_set(Elm_Object_Item *it,
2079                               const char *part,
2080                               const char *label)
2081 {
2082    _elm_widget_item_text_part_set((Elm_Widget_Item *) it, part, label);
2083 }
2084
2085 EAPI const char *
2086 elm_object_item_text_part_get(const Elm_Object_Item *it, const char *part)
2087 {
2088    return _elm_widget_item_text_part_get((Elm_Widget_Item *) it, part);
2089 }
2090
2091 EAPI const char *
2092 elm_object_item_part_text_get(const Elm_Object_Item *it, const char *part)
2093 {
2094    return _elm_widget_item_text_part_get((Elm_Widget_Item *) it, part);
2095 }
2096
2097 EAPI void
2098 elm_object_access_info_set(Evas_Object *obj, const char *txt)
2099 {
2100    elm_widget_access_info_set(obj, txt);
2101 }
2102
2103 EAPI Evas_Object *
2104 elm_object_name_find(const Evas_Object *obj, const char *name, int recurse)
2105 {
2106    return elm_widget_name_find(obj, name, recurse);
2107 }
2108
2109 EAPI void
2110 elm_object_item_access_info_set(Elm_Object_Item *it, const char *txt)
2111 {
2112    _elm_widget_item_access_info_set((Elm_Widget_Item *) it, txt);
2113 }
2114
2115 EAPI void *
2116 elm_object_item_data_get(const Elm_Object_Item *it)
2117 {
2118    return elm_widget_item_data_get(it);
2119 }
2120
2121 EAPI void
2122 elm_object_item_data_set(Elm_Object_Item *it, void *data)
2123 {
2124    elm_widget_item_data_set(it, data);
2125 }
2126
2127 EAPI void
2128 elm_object_item_signal_emit(Elm_Object_Item *it, const char *emission, const char *source)
2129 {
2130    _elm_widget_item_signal_emit((Elm_Widget_Item *) it, emission, source);
2131 }
2132
2133 EAPI void elm_object_item_disabled_set(Elm_Object_Item *it, Eina_Bool disabled)
2134 {
2135    _elm_widget_item_disabled_set((Elm_Widget_Item *) it, disabled);
2136 }
2137
2138 EAPI Eina_Bool elm_object_item_disabled_get(const Elm_Object_Item *it)
2139 {
2140    return _elm_widget_item_disabled_get((Elm_Widget_Item *) it);
2141 }
2142
2143 EAPI void elm_object_item_del_cb_set(Elm_Object_Item *it, Evas_Smart_Cb del_cb)
2144 {
2145    _elm_widget_item_del_cb_set((Elm_Widget_Item *) it, del_cb);
2146 }
2147
2148 EAPI void elm_object_item_del(Elm_Object_Item *it)
2149 {
2150    _elm_widget_item_del((Elm_Widget_Item *) it);
2151 }
2152
2153 EAPI void
2154 elm_object_item_tooltip_text_set(Elm_Object_Item *item, const char *text)
2155 {
2156    elm_widget_item_tooltip_text_set(item, text);
2157 }
2158
2159 EAPI void
2160 elm_object_item_tooltip_content_cb_set(Elm_Object_Item *item, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb)
2161 {
2162    elm_widget_item_tooltip_content_cb_set(item, func, data, del_cb);
2163 }
2164
2165 EAPI void
2166 elm_object_item_tooltip_unset(Elm_Object_Item *item)
2167 {
2168    elm_widget_item_tooltip_unset(item);
2169 }
2170
2171 EAPI Eina_Bool
2172 elm_object_item_tooltip_window_mode_set(Elm_Object_Item *item, Eina_Bool disable)
2173 {
2174    return elm_widget_item_tooltip_window_mode_set(item, disable);
2175 }
2176
2177 EAPI Eina_Bool
2178 elm_object_item_tooltip_window_mode_get(const Elm_Object_Item *item)
2179 {
2180    return elm_widget_item_tooltip_window_mode_get(item);
2181 }
2182
2183 EAPI void
2184 elm_object_item_tooltip_style_set(Elm_Object_Item *item, const char *style)
2185 {
2186    elm_widget_item_tooltip_style_set(item, style);
2187 }
2188
2189 EAPI const char *
2190 elm_object_item_tooltip_style_get(const Elm_Object_Item *item)
2191 {
2192    return elm_widget_item_tooltip_style_get(item);
2193 }
2194
2195 EINA_DEPRECATED EAPI Evas_Object *
2196 elm_object_item_object_get(const Elm_Object_Item *it)
2197 {
2198    return elm_object_item_widget_get(it);
2199 }
2200
2201 EAPI void
2202 elm_object_item_cursor_set(Elm_Object_Item *item, const char *cursor)
2203 {
2204    elm_widget_item_tooltip_style_set(item, cursor);
2205 }
2206
2207 EAPI const char *
2208 elm_object_item_cursor_get(const Elm_Object_Item *item)
2209 {
2210    return elm_widget_item_cursor_get(item);
2211 }
2212
2213 EAPI void
2214 elm_object_item_cursor_unset(Elm_Object_Item *item)
2215 {
2216    elm_widget_item_cursor_unset(item);
2217 }
2218
2219 EAPI void
2220 elm_object_item_cursor_style_set(Elm_Object_Item *item, const char *style)
2221 {
2222    elm_widget_item_cursor_style_set(item, style);
2223 }
2224
2225 EAPI const char *
2226 elm_object_item_cursor_style_get(const Elm_Object_Item *item)
2227 {
2228    return elm_widget_item_cursor_style_get(item);
2229 }
2230
2231 EAPI void
2232 elm_object_item_cursor_engine_only_set(Elm_Object_Item *item, Eina_Bool engine_only)
2233 {
2234    elm_widget_item_cursor_engine_only_set(item, engine_only);
2235 }
2236
2237 EAPI Eina_Bool
2238 elm_object_item_cursor_engine_only_get(const Elm_Object_Item *item)
2239 {
2240    return elm_widget_item_cursor_engine_only_get(item);
2241 }