a8a438295619cfa84722b0e3e99f35d4d9b38a76
[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    return _elm_ql_init_count;
405 }
406
407 EAPI int
408 elm_quicklaunch_sub_init(int    argc,
409                          char **argv)
410 {
411    _elm_sub_init_count++;
412    if (_elm_sub_init_count > 1) return _elm_sub_init_count;
413    if (quicklaunch_on)
414      {
415         _elm_config_init();
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_init();
427         _elm_config_sub_init();
428         ecore_evas_init(); // FIXME: check errors
429 #ifdef HAVE_ELEMENTARY_ECORE_IMF
430         ecore_imf_init();
431 #endif
432 #ifdef HAVE_ELEMENTARY_ECORE_CON
433         ecore_con_init();
434         ecore_con_url_init();
435 #endif
436         _elm_ews_wm_init();
437      }
438    return _elm_sub_init_count;
439 }
440
441 EAPI int
442 elm_quicklaunch_sub_shutdown(void)
443 {
444    _elm_sub_init_count--;
445    if (_elm_sub_init_count > 0) return _elm_sub_init_count;
446    if (quicklaunch_on)
447      {
448 #ifdef SEMI_BROKEN_QUICKLAUNCH
449         return _elm_sub_init_count;
450 #endif
451      }
452    if (!quicklaunch_on)
453      {
454         _elm_win_shutdown();
455         _elm_module_shutdown();
456         _elm_ews_wm_shutdown();
457 #ifdef HAVE_ELEMENTARY_ECORE_CON
458         ecore_con_url_shutdown();
459         ecore_con_shutdown();
460 #endif
461 #ifdef HAVE_ELEMENTARY_ECORE_IMF
462         ecore_imf_shutdown();
463 #endif
464         ecore_evas_shutdown();
465         _elm_config_sub_shutdown();
466 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
467         if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
468             ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
469             ENGINE_COMPARE(ELM_XRENDER_X11) ||
470             ENGINE_COMPARE(ELM_OPENGL_X11) ||
471             ENGINE_COMPARE(ELM_SOFTWARE_SDL) ||
472             ENGINE_COMPARE(ELM_SOFTWARE_16_SDL) ||
473             ENGINE_COMPARE(ELM_OPENGL_SDL) ||
474             ENGINE_COMPARE(ELM_OPENGL_COCOA) ||
475             ENGINE_COMPARE(ELM_SOFTWARE_WIN32) ||
476             ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE) ||
477             ENGINE_COMPARE(ELM_EWS))
478 #undef ENGINE_COMPARE
479           evas_cserve_disconnect();
480         edje_shutdown();
481         evas_shutdown();
482      }
483    return _elm_sub_init_count;
484 }
485
486 EAPI int
487 elm_quicklaunch_shutdown(void)
488 {
489    _elm_ql_init_count--;
490    if (_elm_ql_init_count > 0) return _elm_ql_init_count;
491    if (pfx) eina_prefix_free(pfx);
492    pfx = NULL;
493    eina_stringshare_del(_elm_data_dir);
494    _elm_data_dir = NULL;
495    eina_stringshare_del(_elm_lib_dir);
496    _elm_lib_dir = NULL;
497
498    free(_elm_appname);
499    _elm_appname = NULL;
500
501    _elm_config_shutdown();
502
503    ecore_event_handler_del(_elm_exit_handler);
504    _elm_exit_handler = NULL;
505
506    _elm_theme_shutdown();
507    _elm_unneed_efreet();
508    _elm_unneed_e_dbus();
509    _elm_unneed_ethumb();
510    _elm_unneed_web();
511    ecore_file_shutdown();
512
513 #ifdef HAVE_ELEMENTARY_EMAP
514    emap_shutdown();
515 #endif
516
517    ecore_shutdown();
518    eet_shutdown();
519
520    if ((_elm_log_dom > -1) && (_elm_log_dom != EINA_LOG_DOMAIN_GLOBAL))
521      {
522         eina_log_domain_unregister(_elm_log_dom);
523         _elm_log_dom = -1;
524      }
525
526    _elm_widget_type_clear();
527
528    eina_shutdown();
529    return _elm_ql_init_count;
530 }
531
532 EAPI void
533 elm_quicklaunch_seed(void)
534 {
535 #ifndef SEMI_BROKEN_QUICKLAUNCH
536    if (quicklaunch_on)
537      {
538         Evas_Object *win, *bg, *bt;
539
540         win = elm_win_add(NULL, "seed", ELM_WIN_BASIC);
541         bg = elm_bg_add(win);
542         elm_win_resize_object_add(win, bg);
543         evas_object_show(bg);
544         bt = elm_button_add(win);
545 <<<<<<< HEAD
546         elm_button_label_set(bt, " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~-_=+\\|]}[{;:'\",<.>/?");
547 =======
548         elm_object_text_set(bt, " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~-_=+\\|]}[{;:'\",<.>/?");
549 >>>>>>> remotes/origin/upstream
550         elm_win_resize_object_add(win, bt);
551         ecore_main_loop_iterate();
552         evas_object_del(win);
553         ecore_main_loop_iterate();
554 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
555         if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
556             ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
557             ENGINE_COMPARE(ELM_XRENDER_X11) ||
558             ENGINE_COMPARE(ELM_OPENGL_X11))
559 #undef ENGINE_COMPARE
560           {
561 # ifdef HAVE_ELEMENTARY_X
562              ecore_x_sync();
563 # endif
564           }
565         ecore_main_loop_iterate();
566      }
567 #endif
568 }
569
570 #ifdef HAVE_FORK
571 static void *qr_handle = NULL;
572 #endif
573 static int (*qr_main)(int    argc,
574                       char **argv) = NULL;
575
576 EAPI Eina_Bool
577 elm_quicklaunch_prepare(int argc __UNUSED__,
578                         char   **argv)
579 {
580 #ifdef HAVE_FORK
581    char *exe = elm_quicklaunch_exe_path_get(argv[0]);
582    if (!exe)
583      {
584         ERR("requested quicklaunch binary '%s' does not exist\n", argv[0]);
585         return EINA_FALSE;
586      }
587    else
588      {
589         char *exe2, *p;
590         char *exename;
591
592         exe2 = malloc(strlen(exe) + 1 + 10);
593         strcpy(exe2, exe);
594         p = strrchr(exe2, '/');
595         if (p) p++;
596         else p = exe2;
597         exename = alloca(strlen(p) + 1);
598         strcpy(exename, p);
599         *p = 0;
600         strcat(p, "../lib/");
601         strcat(p, exename);
602         strcat(p, ".so");
603         if (!access(exe2, R_OK | X_OK))
604           {
605              free(exe);
606              exe = exe2;
607           }
608         else
609           free(exe2);
610      }
611    qr_handle = dlopen(exe, RTLD_NOW | RTLD_GLOBAL);
612    if (!qr_handle)
613      {
614         fprintf(stderr, "dlerr: %s\n", dlerror());
615         WRN("dlopen('%s') failed: %s", exe, dlerror());
616         free(exe);
617         return EINA_FALSE;
618      }
619    INF("dlopen('%s') = %p", exe, qr_handle);
620    qr_main = dlsym(qr_handle, "elm_main");
621    INF("dlsym(%p, 'elm_main') = %p", qr_handle, qr_main);
622    if (!qr_main)
623      {
624         WRN("not quicklauncher capable: no elm_main in '%s'", exe);
625         dlclose(qr_handle);
626         qr_handle = NULL;
627         free(exe);
628         return EINA_FALSE;
629      }
630    free(exe);
631    return EINA_TRUE;
632 #else
633    return EINA_FALSE;
634    (void)argv;
635 #endif
636 }
637
638 #ifdef HAVE_FORK
639 static void
640 save_env(void)
641 {
642    int i, size;
643    extern char **environ;
644    char **oldenv, **p;
645
646    oldenv = environ;
647
648    for (i = 0, size = 0; environ[i]; i++)
649      size += strlen(environ[i]) + 1;
650
651    p = malloc((i + 1) * sizeof(char *));
652    if (!p) return;
653
654    environ = p;
655
656    for (i = 0; oldenv[i]; i++)
657      environ[i] = strdup(oldenv[i]);
658    environ[i] = NULL;
659 }
660
661 #endif
662
663 EAPI Eina_Bool
664 elm_quicklaunch_fork(int    argc,
665                      char **argv,
666                      char  *cwd,
667                      void (postfork_func) (void *data),
668                      void  *postfork_data)
669 {
670 #ifdef HAVE_FORK
671    pid_t child;
672    int ret;
673    int real_argc;
674    char **real_argv;
675
676    // FIXME:
677    // need to accept current environment from elementary_run
678    if (!qr_main)
679      {
680         int i;
681         char **args;
682
683         child = fork();
684         if (child > 0) return EINA_TRUE;
685         else if (child < 0)
686           {
687              perror("could not fork");
688              return EINA_FALSE;
689           }
690         setsid();
691         if (chdir(cwd) != 0)
692           perror("could not chdir");
693         args = alloca((argc + 1) * sizeof(char *));
694         for (i = 0; i < argc; i++) args[i] = argv[i];
695         args[argc] = NULL;
696         WRN("%s not quicklaunch capable, fallback...", argv[0]);
697         execvp(argv[0], args);
698         ERR("failed to execute '%s': %s", argv[0], strerror(errno));
699         exit(-1);
700      }
701    child = fork();
702    if (child > 0) return EINA_TRUE;
703    else if (child < 0)
704      {
705         perror("could not fork");
706         return EINA_FALSE;
707      }
708    if (postfork_func) postfork_func(postfork_data);
709
710    if (quicklaunch_on)
711      {
712 #ifdef SEMI_BROKEN_QUICKLAUNCH
713         ecore_app_args_set(argc, (const char **)argv);
714         evas_init();
715         edje_init();
716         _elm_config_sub_init();
717 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
718         if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
719             ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
720             ENGINE_COMPARE(ELM_XRENDER_X11) ||
721             ENGINE_COMPARE(ELM_OPENGL_X11))
722 #undef ENGINE_COMPARE
723           {
724 # ifdef HAVE_ELEMENTARY_X
725              ecore_x_init(NULL);
726 # endif
727           }
728         ecore_evas_init(); // FIXME: check errors
729         ecore_imf_init();
730         _elm_module_init();
731 #endif
732      }
733
734    setsid();
735    if (chdir(cwd) != 0)
736      perror("could not chdir");
737    // FIXME: this is very linux specific. it changes argv[0] of the process
738    // so ps etc. report what you'd expect. for other unixes and os's this
739    // may just not work
740    save_env();
741    if (argv)
742      {
743         char *lastarg, *p;
744
745         ecore_app_args_get(&real_argc, &real_argv);
746         lastarg = real_argv[real_argc - 1] + strlen(real_argv[real_argc - 1]);
747         for (p = real_argv[0]; p < lastarg; p++) *p = 0;
748         strcpy(real_argv[0], argv[0]);
749      }
750    ecore_app_args_set(argc, (const char **)argv);
751    ret = qr_main(argc, argv);
752    exit(ret);
753    return EINA_TRUE;
754 #else
755    return EINA_FALSE;
756    (void)argc;
757    (void)argv;
758    (void)cwd;
759    (void)postfork_func;
760    (void)postfork_data;
761 #endif
762 }
763
764 EAPI void
765 elm_quicklaunch_cleanup(void)
766 {
767 #ifdef HAVE_FORK
768    if (qr_handle)
769      {
770         dlclose(qr_handle);
771         qr_handle = NULL;
772         qr_main = NULL;
773      }
774 #endif
775 }
776
777 EAPI int
778 elm_quicklaunch_fallback(int    argc,
779                          char **argv)
780 {
781    int ret;
782    elm_quicklaunch_init(argc, argv);
783    elm_quicklaunch_sub_init(argc, argv);
784    elm_quicklaunch_prepare(argc, argv);
785    ret = qr_main(argc, argv);
786    exit(ret);
787    return ret;
788 }
789
790 EAPI char *
791 elm_quicklaunch_exe_path_get(const char *exe)
792 {
793    static char *path = NULL;
794    static Eina_List *pathlist = NULL;
795    const char *pathitr;
796    const Eina_List *l;
797    char buf[PATH_MAX];
798    if (exe[0] == '/') return strdup(exe);
799    if ((exe[0] == '.') && (exe[1] == '/')) return strdup(exe);
800    if ((exe[0] == '.') && (exe[1] == '.') && (exe[2] == '/')) return strdup(exe);
801    if (!path)
802      {
803         const char *p, *pp;
804         char *buf2;
805         path = getenv("PATH");
806         buf2 = alloca(strlen(path) + 1);
807         p = path;
808         pp = p;
809         for (;; )
810           {
811              if ((*p == ':') || (!*p))
812                {
813                   int len;
814
815                   len = p - pp;
816                   strncpy(buf2, pp, len);
817                   buf2[len] = 0;
818                   pathlist = eina_list_append(pathlist, eina_stringshare_add(buf2));
819                   if (!*p) break;
820                   p++;
821                   pp = p;
822                }
823              else
824                {
825                   if (!*p) break;
826                   p++;
827                }
828           }
829      }
830    EINA_LIST_FOREACH(pathlist, l, pathitr)
831      {
832         snprintf(buf, sizeof(buf), "%s/%s", pathitr, exe);
833         if (!access(buf, R_OK | X_OK)) return strdup(buf);
834      }
835    return NULL;
836 }
837
838 EAPI void
839 elm_run(void)
840 {
841    ecore_main_loop_begin();
842 }
843
844 EAPI void
845 elm_exit(void)
846 {
847    ecore_main_loop_quit();
848 }
849
850 EAPI Eina_Bool
851 elm_policy_set(unsigned int policy,
852                int          value)
853 {
854    Elm_Event_Policy_Changed *ev;
855
856    if (policy >= ELM_POLICY_LAST)
857      return EINA_FALSE;
858
859    if (value == _elm_policies[policy])
860      return EINA_TRUE;
861
862    /* TODO: validade policy? */
863
864    ev = malloc(sizeof(*ev));
865    ev->policy = policy;
866    ev->new_value = value;
867    ev->old_value = _elm_policies[policy];
868
869    _elm_policies[policy] = value;
870
871    ecore_event_add(ELM_EVENT_POLICY_CHANGED, ev, NULL, NULL);
872
873    return EINA_TRUE;
874 }
875
876 EAPI int
877 elm_policy_get(unsigned int policy)
878 {
879    if (policy >= ELM_POLICY_LAST)
880      return 0;
881    return _elm_policies[policy];
882 }
883
884 EAPI void
885 elm_language_set(const char *lang)
886 {
887    setlocale(LC_ALL, lang);
888    _elm_win_translate();
889 }
890
891 EAPI Eina_Bool
892 elm_object_mirrored_get(const Evas_Object *obj)
893 {
894    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
895    return elm_widget_mirrored_get(obj);
896 }
897
898 EAPI void
899 elm_object_mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
900 {
901    EINA_SAFETY_ON_NULL_RETURN(obj);
902    elm_widget_mirrored_set(obj, mirrored);
903 }
904
905 EAPI Eina_Bool
906 elm_object_mirrored_automatic_get(const Evas_Object *obj)
907 {
908    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
909    return elm_widget_mirrored_automatic_get(obj);
910 }
911
912 EAPI void
913 elm_object_mirrored_automatic_set(Evas_Object *obj, Eina_Bool automatic)
914 {
915    EINA_SAFETY_ON_NULL_RETURN(obj);
916    elm_widget_mirrored_automatic_set(obj, automatic);
917 }
918
919 /**
920  * @}
921  */
922
923 EAPI void
924 elm_object_scale_set(Evas_Object *obj,
925                      double       scale)
926 {
927    EINA_SAFETY_ON_NULL_RETURN(obj);
928    elm_widget_scale_set(obj, scale);
929 }
930
931 EAPI double
932 elm_object_scale_get(const Evas_Object *obj)
933 {
934    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, 0.0);
935    return elm_widget_scale_get(obj);
936 }
937
938 EAPI void
939 elm_object_text_part_set(Evas_Object *obj, const char *part, const char *label)
940 {
941    EINA_SAFETY_ON_NULL_RETURN(obj);
942    elm_widget_text_part_set(obj, part, label);
943 }
944
945 EAPI const char *
946 elm_object_text_part_get(const Evas_Object *obj, const char *part)
947 {
948    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
949    return elm_widget_text_part_get(obj, part);
950 }
951
952 EAPI void
953 elm_object_part_text_set(Evas_Object *obj, const char *part, const char *label)
954 {
955    EINA_SAFETY_ON_NULL_RETURN(obj);
956    elm_widget_text_part_set(obj, part, label);
957 }
958
959 EAPI const char *
960 elm_object_part_text_get(const Evas_Object *obj, const char *part)
961 {
962    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
963    return elm_widget_text_part_get(obj, part);
964 }
965
966 EAPI void
967 elm_object_domain_translatable_text_part_set(Evas_Object *obj, const char *part, const char *domain, const char *text)
968 {
969    EINA_SAFETY_ON_NULL_RETURN(obj);
970    elm_widget_domain_translatable_text_part_set(obj, part, domain, text);
971 }
972
973 EAPI const char *
974 elm_object_translatable_text_part_get(const Evas_Object *obj, const char *part)
975 {
976    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
977    return elm_widget_translatable_text_part_get(obj, part);
978 }
979
980 EAPI void
981 elm_object_part_content_set(Evas_Object *obj, const char *part, Evas_Object *content)
982 {
983    EINA_SAFETY_ON_NULL_RETURN(obj);
984    elm_widget_content_part_set(obj, part, content);
985 }
986
987 EAPI void
988 elm_object_content_part_set(Evas_Object *obj, const char *part, Evas_Object *content)
989 {
990    EINA_SAFETY_ON_NULL_RETURN(obj);
991    elm_widget_content_part_set(obj, part, content);
992 }
993
994
995 EAPI Evas_Object *
996 elm_object_part_content_get(const Evas_Object *obj, const char *part)
997 {
998    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
999    return elm_widget_content_part_get(obj, part);
1000 }
1001
1002 EAPI Evas_Object *
1003 elm_object_content_part_get(const Evas_Object *obj, const char *part)
1004 {
1005    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1006    return elm_widget_content_part_get(obj, part);
1007 }
1008
1009 EAPI Evas_Object *
1010 elm_object_part_content_unset(Evas_Object *obj, const char *part)
1011 {
1012    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1013    return elm_widget_content_part_unset(obj, part);
1014 }
1015
1016
1017 EAPI Evas_Object *
1018 elm_object_content_part_unset(Evas_Object *obj, const char *part)
1019 {
1020    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1021    return elm_widget_content_part_unset(obj, part);
1022 }
1023
1024 <<<<<<< HEAD
1025 EAPI double
1026 elm_scale_get(void)
1027 {
1028    return _elm_config->scale;
1029 }
1030
1031 EAPI void
1032 elm_scale_set(double scale)
1033 {
1034    if (_elm_config->scale == scale) return;
1035    _elm_config->scale = scale;
1036    _elm_rescale();
1037 }
1038
1039 EAPI void
1040 elm_scale_all_set(double scale)
1041 {
1042    elm_scale_set(scale);
1043    _elm_config_all_update();
1044 }
1045
1046 EAPI Eina_Bool
1047 elm_password_show_last_get(void)
1048 {
1049    return _elm_config->password_show_last;
1050 }
1051
1052 EAPI void
1053 elm_password_show_last_set(Eina_Bool password_show_last)
1054 {
1055    if (_elm_config->password_show_last == password_show_last) return;
1056    _elm_config->password_show_last = password_show_last;
1057    edje_password_show_last_set(_elm_config->password_show_last);
1058 }
1059
1060 EAPI double
1061 elm_password_show_last_timeout_get(void)
1062 {
1063    return _elm_config->password_show_last_timeout;
1064 }
1065
1066 EAPI void
1067 elm_password_show_last_timeout_set(double password_show_last_timeout)
1068 {
1069    if (_elm_config->password_show_last_timeout == password_show_last_timeout) return;
1070    _elm_config->password_show_last_timeout = password_show_last_timeout;
1071    edje_password_show_last_timeout_set(_elm_config->password_show_last_timeout);
1072 }
1073
1074 EAPI void
1075 elm_object_style_set(Evas_Object *obj,
1076                      const char  *style)
1077 {
1078    EINA_SAFETY_ON_NULL_RETURN(obj);
1079    elm_widget_style_set(obj, style);
1080 =======
1081 EAPI Eina_Bool
1082 elm_object_style_set(Evas_Object *obj,
1083                      const char  *style)
1084 {
1085    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1086    return elm_widget_style_set(obj, style);
1087 >>>>>>> remotes/origin/upstream
1088 }
1089
1090 EAPI const char *
1091 elm_object_style_get(const Evas_Object *obj)
1092 {
1093    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1094    return elm_widget_style_get(obj);
1095 }
1096
1097 EAPI void
1098 elm_object_disabled_set(Evas_Object *obj,
1099                         Eina_Bool    disabled)
1100 {
1101    EINA_SAFETY_ON_NULL_RETURN(obj);
1102    elm_widget_disabled_set(obj, disabled);
1103 }
1104
1105 EAPI Eina_Bool
1106 elm_object_disabled_get(const Evas_Object *obj)
1107 {
1108    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1109    return elm_widget_disabled_get(obj);
1110 }
1111
1112 <<<<<<< HEAD
1113 EAPI Eina_Bool
1114 elm_config_save(void)
1115 {
1116    return _elm_config_save();
1117 }
1118
1119 EAPI void
1120 elm_config_reload(void)
1121 {
1122    _elm_config_reload();
1123 }
1124
1125 EAPI const char *
1126 elm_profile_current_get(void)
1127 {
1128    return _elm_config_current_profile_get();
1129 }
1130
1131 EAPI const char *
1132 elm_profile_dir_get(const char *profile,
1133                     Eina_Bool   is_user)
1134 {
1135    return _elm_config_profile_dir_get(profile, is_user);
1136 }
1137
1138 EAPI void
1139 elm_profile_dir_free(const char *p_dir)
1140 {
1141    free((void *)p_dir);
1142 }
1143
1144 EAPI Eina_List *
1145 elm_profile_list_get(void)
1146 {
1147    return _elm_config_profiles_list();
1148 }
1149
1150 EAPI void
1151 elm_profile_list_free(Eina_List *l)
1152 {
1153    const char *dir;
1154
1155    EINA_LIST_FREE(l, dir)
1156      eina_stringshare_del(dir);
1157 }
1158
1159 EAPI void
1160 elm_profile_set(const char *profile)
1161 {
1162    EINA_SAFETY_ON_NULL_RETURN(profile);
1163    _elm_config_profile_set(profile);
1164 }
1165
1166 EAPI void
1167 elm_profile_all_set(const char *profile)
1168 {
1169    _elm_config_profile_set(profile);
1170    _elm_config_all_update();
1171 }
1172
1173 EAPI const char *
1174 elm_engine_current_get(void)
1175 {
1176    return _elm_config->engine;
1177 }
1178
1179 EAPI void
1180 elm_engine_set(const char *engine)
1181 {
1182    EINA_SAFETY_ON_NULL_RETURN(engine);
1183
1184    _elm_config_engine_set(engine);
1185 }
1186
1187 EAPI const Eina_List *
1188 elm_text_classes_list_get(void)
1189 {
1190    return _elm_config_text_classes_get();
1191 }
1192
1193 EAPI void
1194 elm_text_classes_list_free(const Eina_List *list)
1195 {
1196    _elm_config_text_classes_free((Eina_List *)list);
1197 }
1198
1199 EAPI const Eina_List *
1200 elm_font_overlay_list_get(void)
1201 {
1202    return _elm_config_font_overlays_list();
1203 }
1204
1205 EAPI void
1206 elm_font_overlay_set(const char    *text_class,
1207                      const char    *font,
1208                      Evas_Font_Size size)
1209 {
1210    _elm_config_font_overlay_set(text_class, font, size);
1211 }
1212
1213 EAPI void
1214 elm_font_overlay_unset(const char *text_class)
1215 {
1216    _elm_config_font_overlay_remove(text_class);
1217 }
1218
1219 EAPI void
1220 elm_font_overlay_apply(void)
1221 {
1222    _elm_config_font_overlay_apply();
1223 }
1224
1225 EAPI void
1226 elm_font_overlay_all_apply(void)
1227 {
1228    elm_font_overlay_apply();
1229    _elm_config_all_update();
1230 }
1231
1232 EAPI Elm_Font_Properties *
1233 elm_font_properties_get(const char *font)
1234 {
1235    EINA_SAFETY_ON_NULL_RETURN_VAL(font, NULL);
1236    return _elm_font_properties_get(NULL, font);
1237 }
1238
1239 EAPI void
1240 elm_font_properties_free(Elm_Font_Properties *efp)
1241 {
1242    const char *str;
1243
1244    EINA_SAFETY_ON_NULL_RETURN(efp);
1245    EINA_LIST_FREE(efp->styles, str)
1246      if (str) eina_stringshare_del(str);
1247    if (efp->name) eina_stringshare_del(efp->name);
1248    free(efp);
1249 }
1250
1251 EAPI const char *
1252 elm_font_fontconfig_name_get(const char *name,
1253                              const char *style)
1254 {
1255    char buf[256];
1256
1257    EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
1258    if (!style || style[0] == 0) return eina_stringshare_add(name);
1259    snprintf(buf, 256, "%s" ELM_FONT_TOKEN_STYLE "%s", name, style);
1260    return eina_stringshare_add(buf);
1261 }
1262
1263 EAPI void
1264 elm_font_fontconfig_name_free(const char *name)
1265 {
1266    eina_stringshare_del(name);
1267 }
1268
1269 EAPI Eina_Hash *
1270 elm_font_available_hash_add(Eina_List *list)
1271 {
1272    Eina_Hash *font_hash;
1273    Eina_List *l;
1274    void *key;
1275
1276    font_hash = NULL;
1277
1278    /* populate with default font families */
1279    font_hash = _elm_font_available_hash_add(font_hash, "Sans:style=Regular");
1280    font_hash = _elm_font_available_hash_add(font_hash, "Sans:style=Bold");
1281    font_hash = _elm_font_available_hash_add(font_hash, "Sans:style=Oblique");
1282    font_hash = _elm_font_available_hash_add(font_hash,
1283                                             "Sans:style=Bold Oblique");
1284
1285    font_hash = _elm_font_available_hash_add(font_hash, "Serif:style=Regular");
1286    font_hash = _elm_font_available_hash_add(font_hash, "Serif:style=Bold");
1287    font_hash = _elm_font_available_hash_add(font_hash, "Serif:style=Oblique");
1288    font_hash = _elm_font_available_hash_add(font_hash,
1289                                             "Serif:style=Bold Oblique");
1290
1291    font_hash = _elm_font_available_hash_add(font_hash,
1292                                             "Monospace:style=Regular");
1293    font_hash = _elm_font_available_hash_add(font_hash,
1294                                             "Monospace:style=Bold");
1295    font_hash = _elm_font_available_hash_add(font_hash,
1296                                             "Monospace:style=Oblique");
1297    font_hash = _elm_font_available_hash_add(font_hash,
1298                                             "Monospace:style=Bold Oblique");
1299
1300    EINA_LIST_FOREACH(list, l, key)
1301      font_hash = _elm_font_available_hash_add(font_hash, key);
1302
1303    return font_hash;
1304 }
1305
1306 EAPI void
1307 elm_font_available_hash_del(Eina_Hash *hash)
1308 {
1309    _elm_font_available_hash_del(hash);
1310 }
1311
1312 EAPI Evas_Coord
1313 elm_finger_size_get(void)
1314 {
1315    return _elm_config->finger_size;
1316 }
1317
1318 EAPI void
1319 elm_finger_size_set(Evas_Coord size)
1320 {
1321    if (_elm_config->finger_size == size) return;
1322    _elm_config->finger_size = size;
1323    _elm_rescale();
1324 }
1325
1326 EAPI void
1327 elm_finger_size_all_set(Evas_Coord size)
1328 {
1329    elm_finger_size_set(size);
1330    _elm_config_all_update();
1331 }
1332
1333 EAPI void
1334 elm_coords_finger_size_adjust(int         times_w,
1335                               Evas_Coord *w,
1336                               int         times_h,
1337                               Evas_Coord *h)
1338 {
1339    if ((w) && (*w < (_elm_config->finger_size * times_w)))
1340      *w = _elm_config->finger_size * times_w;
1341    if ((h) && (*h < (_elm_config->finger_size * times_h)))
1342      *h = _elm_config->finger_size * times_h;
1343 }
1344
1345 EAPI void
1346 elm_all_flush(void)
1347 =======
1348 EAPI void
1349 elm_cache_all_flush(void)
1350 >>>>>>> remotes/origin/upstream
1351 {
1352    const Eina_List *l;
1353    Evas_Object *obj;
1354
1355    edje_file_cache_flush();
1356    edje_collection_cache_flush();
1357    eet_clearcache();
1358    EINA_LIST_FOREACH(_elm_win_list, l, obj)
1359      {
1360         Evas *e = evas_object_evas_get(obj);
1361         evas_image_cache_flush(e);
1362         evas_font_cache_flush(e);
1363         evas_render_dump(e);
1364      }
1365 }
1366
1367 <<<<<<< HEAD
1368 EAPI int
1369 elm_cache_flush_interval_get(void)
1370 {
1371    return _elm_config->cache_flush_poll_interval;
1372 }
1373
1374 EAPI void
1375 elm_cache_flush_interval_set(int size)
1376 {
1377    if (_elm_config->cache_flush_poll_interval == size) return;
1378    _elm_config->cache_flush_poll_interval = size;
1379
1380    _elm_recache();
1381 }
1382
1383 EAPI void
1384 elm_cache_flush_interval_all_set(int size)
1385 {
1386    elm_cache_flush_interval_set(size);
1387    _elm_config_all_update();
1388 }
1389
1390 EAPI Eina_Bool
1391 elm_cache_flush_enabled_get(void)
1392 {
1393    return _elm_config->cache_flush_enable;
1394 }
1395
1396 EAPI void
1397 elm_cache_flush_enabled_set(Eina_Bool enabled)
1398 {
1399    enabled = !!enabled;
1400    if (_elm_config->cache_flush_enable == enabled) return;
1401    _elm_config->cache_flush_enable = enabled;
1402
1403    _elm_recache();
1404 }
1405
1406 EAPI void
1407 elm_cache_flush_enabled_all_set(Eina_Bool enabled)
1408 {
1409    elm_cache_flush_enabled_set(enabled);
1410    _elm_config_all_update();
1411 }
1412
1413 EAPI int
1414 elm_font_cache_get(void)
1415 {
1416    return _elm_config->font_cache;
1417 }
1418
1419 EAPI void
1420 elm_font_cache_set(int size)
1421 {
1422    if (_elm_config->font_cache == size) return;
1423    _elm_config->font_cache = size;
1424
1425    _elm_recache();
1426 }
1427
1428 EAPI void
1429 elm_font_cache_all_set(int size)
1430 {
1431    elm_font_cache_set(size);
1432    _elm_config_all_update();
1433 }
1434
1435 EAPI int
1436 elm_image_cache_get(void)
1437 {
1438    return _elm_config->image_cache;
1439 }
1440
1441 EAPI void
1442 elm_image_cache_set(int size)
1443 {
1444    if (_elm_config->image_cache == size) return;
1445    _elm_config->image_cache = size;
1446
1447    _elm_recache();
1448 }
1449
1450 EAPI void
1451 elm_image_cache_all_set(int size)
1452 {
1453    elm_image_cache_set(size);
1454    _elm_config_all_update();
1455 }
1456
1457 EAPI int
1458 elm_edje_file_cache_get(void)
1459 {
1460    return _elm_config->edje_cache;
1461 }
1462
1463 EAPI void
1464 elm_edje_file_cache_set(int size)
1465 {
1466    if (_elm_config->edje_cache == size) return;
1467    _elm_config->edje_cache = size;
1468
1469    _elm_recache();
1470 }
1471
1472 EAPI void
1473 elm_edje_file_cache_all_set(int size)
1474 {
1475    elm_edje_file_cache_set(size);
1476    _elm_config_all_update();
1477 }
1478
1479 EAPI int
1480 elm_edje_collection_cache_get(void)
1481 {
1482    return _elm_config->edje_collection_cache;
1483 }
1484
1485 EAPI void
1486 elm_edje_collection_cache_set(int size)
1487 {
1488    if (_elm_config->edje_collection_cache == size) return;
1489    _elm_config->edje_collection_cache = size;
1490
1491    _elm_recache();
1492 }
1493
1494 EAPI void
1495 elm_edje_collection_cache_all_set(int size)
1496 {
1497    elm_edje_collection_cache_set(size);
1498    _elm_config_all_update();
1499 =======
1500 EINA_DEPRECATED EAPI void
1501 elm_all_flush(void)
1502 {
1503    elm_cache_all_flush();
1504 >>>>>>> remotes/origin/upstream
1505 }
1506
1507 EAPI Eina_Bool
1508 elm_object_focus_get(const Evas_Object *obj)
1509 {
1510    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1511    return elm_widget_focus_get(obj);
1512 }
1513
1514 EAPI void
1515 elm_object_focus_set(Evas_Object *obj,
1516                      Eina_Bool    focus)
1517 {
1518    EINA_SAFETY_ON_NULL_RETURN(obj);
1519 <<<<<<< HEAD
1520    if (focus)
1521      {
1522         if (elm_widget_focus_get(obj)) return;
1523         elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
1524      }
1525    else
1526      {
1527         if (!elm_widget_can_focus_get(obj)) return;
1528         elm_widget_focused_object_clear(obj);
1529      }
1530 }
1531
1532 EAPI void
1533 elm_object_focus(Evas_Object *obj)
1534 {
1535    EINA_SAFETY_ON_NULL_RETURN(obj);
1536    elm_object_focus_set(obj, EINA_TRUE);
1537 }
1538
1539 EAPI void
1540 elm_object_unfocus(Evas_Object *obj)
1541 {
1542    EINA_SAFETY_ON_NULL_RETURN(obj);
1543    elm_object_focus_set(obj, EINA_FALSE);
1544 =======
1545
1546    if (focus == elm_widget_focus_get(obj)) return;
1547
1548    if (focus)
1549      elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
1550    else
1551      elm_widget_focused_object_clear(obj);
1552 >>>>>>> remotes/origin/upstream
1553 }
1554
1555 EAPI void
1556 elm_object_focus_allow_set(Evas_Object *obj,
1557                            Eina_Bool    enable)
1558 {
1559    EINA_SAFETY_ON_NULL_RETURN(obj);
1560    elm_widget_can_focus_set(obj, enable);
1561 <<<<<<< HEAD
1562 =======
1563 /*FIXME: According to the elm_object_focus_allow_get(), child_can_focus field
1564 of the parent should be updated. Otherwise, the checking of it's child focus allow states should not be in elm_object_focus_allow_get() */
1565 >>>>>>> remotes/origin/upstream
1566 }
1567
1568 EAPI Eina_Bool
1569 elm_object_focus_allow_get(const Evas_Object *obj)
1570 {
1571    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1572    return (elm_widget_can_focus_get(obj)) || (elm_widget_child_can_focus_get(obj));
1573 }
1574
1575 EAPI void
1576 elm_object_focus_custom_chain_set(Evas_Object *obj,
1577                                   Eina_List   *objs)
1578 {
1579    EINA_SAFETY_ON_NULL_RETURN(obj);
1580    elm_widget_focus_custom_chain_set(obj, objs);
1581 }
1582
1583 EAPI void
1584 elm_object_focus_custom_chain_unset(Evas_Object *obj)
1585 {
1586    EINA_SAFETY_ON_NULL_RETURN(obj);
1587    elm_widget_focus_custom_chain_unset(obj);
1588 }
1589
1590 EAPI const Eina_List *
1591 elm_object_focus_custom_chain_get(const Evas_Object *obj)
1592 {
1593    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1594    return elm_widget_focus_custom_chain_get(obj);
1595 }
1596
1597 EAPI void
1598 elm_object_focus_custom_chain_append(Evas_Object *obj,
1599                                      Evas_Object *child,
1600                                      Evas_Object *relative_child)
1601 {
1602    EINA_SAFETY_ON_NULL_RETURN(obj);
1603 <<<<<<< HEAD
1604    EINA_SAFETY_ON_NULL_RETURN(child);
1605 =======
1606 >>>>>>> remotes/origin/upstream
1607    elm_widget_focus_custom_chain_append(obj, child, relative_child);
1608 }
1609
1610 EAPI void
1611 elm_object_focus_custom_chain_prepend(Evas_Object *obj,
1612                                       Evas_Object *child,
1613                                       Evas_Object *relative_child)
1614 {
1615    EINA_SAFETY_ON_NULL_RETURN(obj);
1616 <<<<<<< HEAD
1617    EINA_SAFETY_ON_NULL_RETURN(child);
1618    elm_widget_focus_custom_chain_prepend(obj, child, relative_child);
1619 }
1620
1621 EAPI void
1622 elm_object_focus_cycle(Evas_Object        *obj,
1623                        Elm_Focus_Direction dir)
1624 {
1625    EINA_SAFETY_ON_NULL_RETURN(obj);
1626    elm_widget_focus_cycle(obj, dir);
1627 }
1628
1629 EAPI void
1630 elm_object_focus_direction_go(Evas_Object *obj,
1631                               int          x,
1632                               int          y)
1633 {
1634    EINA_SAFETY_ON_NULL_RETURN(obj);
1635    elm_widget_focus_direction_go(obj, x, y);
1636 }
1637
1638 EAPI void
1639 elm_object_tree_unfocusable_set(Evas_Object *obj,
1640                                 Eina_Bool    tree_unfocusable)
1641 {
1642    EINA_SAFETY_ON_NULL_RETURN(obj);
1643    elm_widget_tree_unfocusable_set(obj, tree_unfocusable);
1644 }
1645
1646 EAPI Eina_Bool
1647 elm_object_tree_unfocusable_get(const Evas_Object *obj)
1648 {
1649    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1650    return elm_widget_tree_unfocusable_get(obj);
1651 }
1652
1653 EAPI Eina_Bool
1654 elm_focus_highlight_enabled_get(void)
1655 {
1656    return _elm_config->focus_highlight_enable;
1657 }
1658
1659 EAPI void
1660 elm_focus_highlight_enabled_set(Eina_Bool enable)
1661 {
1662    _elm_config->focus_highlight_enable = !!enable;
1663 }
1664
1665 EAPI Eina_Bool
1666 elm_focus_highlight_animate_get(void)
1667 {
1668    return _elm_config->focus_highlight_animate;
1669 }
1670
1671 EAPI void
1672 elm_focus_highlight_animate_set(Eina_Bool animate)
1673 {
1674    _elm_config->focus_highlight_animate = !!animate;
1675 }
1676
1677 EAPI Eina_Bool
1678 elm_scroll_bounce_enabled_get(void)
1679 {
1680    return _elm_config->thumbscroll_bounce_enable;
1681 }
1682
1683 EAPI void
1684 elm_scroll_bounce_enabled_set(Eina_Bool enabled)
1685 {
1686    _elm_config->thumbscroll_bounce_enable = enabled;
1687 }
1688
1689 EAPI void
1690 elm_scroll_bounce_enabled_all_set(Eina_Bool enabled)
1691 {
1692    elm_scroll_bounce_enabled_set(enabled);
1693    _elm_config_all_update();
1694 }
1695
1696 EAPI double
1697 elm_scroll_bounce_friction_get(void)
1698 {
1699    return _elm_config->thumbscroll_bounce_friction;
1700 }
1701
1702 EAPI void
1703 elm_scroll_bounce_friction_set(double friction)
1704 {
1705    _elm_config->thumbscroll_bounce_friction = friction;
1706 }
1707
1708 EAPI void
1709 elm_scroll_bounce_friction_all_set(double friction)
1710 {
1711    elm_scroll_bounce_friction_set(friction);
1712    _elm_config_all_update();
1713 }
1714
1715 EAPI double
1716 elm_scroll_page_scroll_friction_get(void)
1717 {
1718    return _elm_config->page_scroll_friction;
1719 }
1720
1721 EAPI void
1722 elm_scroll_page_scroll_friction_set(double friction)
1723 {
1724    _elm_config->page_scroll_friction = friction;
1725 }
1726
1727 EAPI void
1728 elm_scroll_page_scroll_friction_all_set(double friction)
1729 {
1730    elm_scroll_page_scroll_friction_set(friction);
1731    _elm_config_all_update();
1732 }
1733
1734 EAPI double
1735 elm_scroll_bring_in_scroll_friction_get(void)
1736 {
1737    return _elm_config->bring_in_scroll_friction;
1738 }
1739
1740 EAPI void
1741 elm_scroll_bring_in_scroll_friction_set(double friction)
1742 {
1743    _elm_config->bring_in_scroll_friction = friction;
1744 }
1745
1746 EAPI void
1747 elm_scroll_bring_in_scroll_friction_all_set(double friction)
1748 {
1749    elm_scroll_bring_in_scroll_friction_set(friction);
1750    _elm_config_all_update();
1751 }
1752
1753 EAPI double
1754 elm_scroll_zoom_friction_get(void)
1755 {
1756    return _elm_config->zoom_friction;
1757 }
1758
1759 EAPI void
1760 elm_scroll_zoom_friction_set(double friction)
1761 {
1762    _elm_config->zoom_friction = friction;
1763 }
1764
1765 EAPI void
1766 elm_scroll_zoom_friction_all_set(double friction)
1767 {
1768    elm_scroll_zoom_friction_set(friction);
1769    _elm_config_all_update();
1770 }
1771
1772 EAPI Eina_Bool
1773 elm_scroll_thumbscroll_enabled_get(void)
1774 {
1775    return _elm_config->thumbscroll_enable;
1776 }
1777
1778 EAPI void
1779 elm_scroll_thumbscroll_enabled_set(Eina_Bool enabled)
1780 {
1781    _elm_config->thumbscroll_enable = enabled;
1782 }
1783
1784 EAPI void
1785 elm_scroll_thumbscroll_enabled_all_set(Eina_Bool enabled)
1786 {
1787    elm_scroll_thumbscroll_enabled_set(enabled);
1788    _elm_config_all_update();
1789 }
1790
1791 EAPI unsigned int
1792 elm_scroll_thumbscroll_threshold_get(void)
1793 {
1794    return _elm_config->thumbscroll_threshold;
1795 }
1796
1797 EAPI void
1798 elm_scroll_thumbscroll_threshold_set(unsigned int threshold)
1799 {
1800    _elm_config->thumbscroll_threshold = threshold;
1801 }
1802
1803 EAPI void
1804 elm_scroll_thumbscroll_threshold_all_set(unsigned int threshold)
1805 {
1806    elm_scroll_thumbscroll_threshold_set(threshold);
1807    _elm_config_all_update();
1808 }
1809
1810 EAPI double
1811 elm_scroll_thumbscroll_momentum_threshold_get(void)
1812 {
1813    return _elm_config->thumbscroll_momentum_threshold;
1814 }
1815
1816 EAPI void
1817 elm_scroll_thumbscroll_momentum_threshold_set(double threshold)
1818 {
1819    _elm_config->thumbscroll_momentum_threshold = threshold;
1820 }
1821
1822 EAPI void
1823 elm_scroll_thumbscroll_momentum_threshold_all_set(double threshold)
1824 {
1825    elm_scroll_thumbscroll_momentum_threshold_set(threshold);
1826    _elm_config_all_update();
1827 }
1828
1829 EAPI double
1830 elm_scroll_thumbscroll_friction_get(void)
1831 {
1832    return _elm_config->thumbscroll_friction;
1833 }
1834
1835 EAPI void
1836 elm_scroll_thumbscroll_friction_set(double friction)
1837 {
1838    _elm_config->thumbscroll_friction = friction;
1839 }
1840
1841 EAPI void
1842 elm_scroll_thumbscroll_friction_all_set(double friction)
1843 {
1844    elm_scroll_thumbscroll_friction_set(friction);
1845    _elm_config_all_update();
1846 }
1847
1848 EAPI double
1849 elm_scroll_thumbscroll_border_friction_get(void)
1850 {
1851    return _elm_config->thumbscroll_border_friction;
1852 }
1853
1854 EAPI void
1855 elm_scroll_thumbscroll_border_friction_set(double friction)
1856 {
1857    if (friction < 0.0) friction = 0.0;
1858    if (friction > 1.0) friction = 1.0;
1859    _elm_config->thumbscroll_friction = friction;
1860 }
1861
1862 EAPI void
1863 elm_scroll_thumbscroll_border_friction_all_set(double friction)
1864 {
1865    elm_scroll_thumbscroll_border_friction_set(friction);
1866    _elm_config_all_update();
1867 }
1868
1869 EAPI double
1870 elm_scroll_thumbscroll_sensitivity_friction_get(void)
1871 {
1872    return _elm_config->thumbscroll_sensitivity_friction;
1873 }
1874
1875 EAPI void
1876 elm_scroll_thumbscroll_sensitivity_friction_set(double friction)
1877 {
1878    if (friction < 0.1) friction = 0.1;
1879    if (friction > 1.0) friction = 1.0;
1880    _elm_config->thumbscroll_friction = friction;
1881 }
1882
1883 EAPI void
1884 elm_scroll_thumbscroll_sensitivity_friction_all_set(double friction)
1885 {
1886    elm_scroll_thumbscroll_sensitivity_friction_set(friction);
1887    _elm_config_all_update();
1888 =======
1889    elm_widget_focus_custom_chain_prepend(obj, child, relative_child);
1890 }
1891
1892 EINA_DEPRECATED EAPI void
1893 elm_object_focus_cycle(Evas_Object        *obj,
1894                        Elm_Focus_Direction dir)
1895 {
1896    elm_object_focus_next(obj, dir);
1897 }
1898
1899 EAPI void
1900 elm_object_focus_next(Evas_Object        *obj,
1901                       Elm_Focus_Direction dir)
1902 {
1903    EINA_SAFETY_ON_NULL_RETURN(obj);
1904    elm_widget_focus_cycle(obj, dir);
1905 }
1906
1907 EINA_DEPRECATED EAPI void
1908 elm_object_tree_unfocusable_set(Evas_Object *obj,
1909                                 Eina_Bool    unfocusable)
1910 {
1911    elm_object_tree_focus_allow_set(obj, unfocusable);
1912 }
1913
1914 EINA_DEPRECATED EAPI Eina_Bool
1915 elm_object_tree_unfocusable_get(const Evas_Object *obj)
1916 {
1917    return elm_object_tree_focus_allow_get(obj);
1918 }
1919
1920 EAPI void
1921 elm_object_tree_focus_allow_set(Evas_Object *obj,
1922                                 Eina_Bool    tree_focusable)
1923 {
1924    EINA_SAFETY_ON_NULL_RETURN(obj);
1925    elm_widget_tree_unfocusable_set(obj, !tree_focusable);
1926 }
1927
1928 EAPI Eina_Bool
1929 elm_object_tree_focus_allow_get(const Evas_Object *obj)
1930 {
1931    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1932    return elm_widget_tree_unfocusable_get(obj);
1933 >>>>>>> remotes/origin/upstream
1934 }
1935
1936 EAPI void
1937 elm_object_scroll_hold_push(Evas_Object *obj)
1938 {
1939    EINA_SAFETY_ON_NULL_RETURN(obj);
1940    elm_widget_scroll_hold_push(obj);
1941 }
1942
1943 EAPI void
1944 elm_object_scroll_hold_pop(Evas_Object *obj)
1945 {
1946    EINA_SAFETY_ON_NULL_RETURN(obj);
1947    elm_widget_scroll_hold_pop(obj);
1948 }
1949
1950 EAPI void
1951 elm_object_scroll_freeze_push(Evas_Object *obj)
1952 {
1953    EINA_SAFETY_ON_NULL_RETURN(obj);
1954    elm_widget_scroll_freeze_push(obj);
1955 }
1956
1957 EAPI void
1958 elm_object_scroll_lock_x_set(Evas_Object *obj,
1959                              Eina_Bool    lock)
1960 {
1961    EINA_SAFETY_ON_NULL_RETURN(obj);
1962    elm_widget_drag_lock_x_set(obj, lock);
1963 }
1964
1965 EAPI void
1966 elm_object_scroll_lock_y_set(Evas_Object *obj,
1967                              Eina_Bool    lock)
1968 {
1969    EINA_SAFETY_ON_NULL_RETURN(obj);
1970    elm_widget_drag_lock_y_set(obj, lock);
1971 }
1972
1973 EAPI Eina_Bool
1974 elm_object_scroll_lock_x_get(const Evas_Object *obj)
1975 {
1976    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1977    return elm_widget_drag_lock_x_get(obj);
1978 }
1979
1980 EAPI Eina_Bool
1981 elm_object_scroll_lock_y_get(const Evas_Object *obj)
1982 {
1983    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1984    return elm_widget_drag_lock_y_get(obj);
1985 }
1986
1987 EAPI void
1988 elm_object_scroll_freeze_pop(Evas_Object *obj)
1989 {
1990    EINA_SAFETY_ON_NULL_RETURN(obj);
1991    elm_widget_scroll_freeze_pop(obj);
1992 }
1993
1994 EAPI Eina_Bool
1995 elm_object_widget_check(const Evas_Object *obj)
1996 {
1997    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1998    return elm_widget_is(obj);
1999 }
2000
2001 EAPI Evas_Object *
2002 elm_object_parent_widget_get(const Evas_Object *obj)
2003 {
2004    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
2005    return elm_widget_parent_widget_get(obj);
2006 }
2007
2008 EAPI Evas_Object *
2009 elm_object_top_widget_get(const Evas_Object *obj)
2010 {
2011    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
2012    return elm_widget_top_get(obj);
2013 }
2014
2015 EAPI const char *
2016 elm_object_widget_type_get(const Evas_Object *obj)
2017 {
2018    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
2019    return elm_widget_type_get(obj);
2020 }
2021
2022 EAPI void
2023 elm_object_signal_emit(Evas_Object *obj,
2024                        const char  *emission,
2025                        const char  *source)
2026 {
2027    EINA_SAFETY_ON_NULL_RETURN(obj);
2028    elm_widget_signal_emit(obj, emission, source);
2029 }
2030
2031 EAPI void
2032 elm_object_signal_callback_add(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data)
2033 {
2034     EINA_SAFETY_ON_NULL_RETURN(obj);
2035     EINA_SAFETY_ON_NULL_RETURN(func);
2036     elm_widget_signal_callback_add(obj, emission, source, func, data);
2037 }
2038
2039 EAPI void *
2040 elm_object_signal_callback_del(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func)
2041 {
2042     EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
2043     EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
2044     return elm_widget_signal_callback_del(obj, emission, source, func);
2045 }
2046
2047 EAPI void
2048 elm_object_event_callback_add(Evas_Object *obj, Elm_Event_Cb func, const void *data)
2049 {
2050    EINA_SAFETY_ON_NULL_RETURN(obj);
2051    EINA_SAFETY_ON_NULL_RETURN(func);
2052    elm_widget_event_callback_add(obj, func, data);
2053 }
2054
2055 EAPI void *
2056 elm_object_event_callback_del(Evas_Object *obj, Elm_Event_Cb func, const void *data)
2057 {
2058    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
2059    EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
2060    return elm_widget_event_callback_del(obj, func, data);
2061 }
2062
2063 EAPI void
2064 elm_object_tree_dump(const Evas_Object *top)
2065 {
2066 #ifdef ELM_DEBUG
2067    elm_widget_tree_dump(top);
2068 #else
2069    return;
2070    (void)top;
2071 #endif
2072 }
2073
2074 EAPI void
2075 elm_object_tree_dot_dump(const Evas_Object *top,
2076                          const char        *file)
2077 {
2078 #ifdef ELM_DEBUG
2079    FILE *f = fopen(file, "wb");
2080    elm_widget_tree_dot_dump(top, f);
2081    fclose(f);
2082 #else
2083    return;
2084    (void)top;
2085    (void)file;
2086 #endif
2087 }
2088
2089 EAPI void
2090 <<<<<<< HEAD
2091 elm_longpress_timeout_set(double longpress_timeout)
2092 {
2093    _elm_config->longpress_timeout = longpress_timeout;
2094 }
2095
2096 EAPI double
2097 elm_longpress_timeout_get(void)
2098 {
2099    return _elm_config->longpress_timeout;
2100 =======
2101 elm_coords_finger_size_adjust(int         times_w,
2102                               Evas_Coord *w,
2103                               int         times_h,
2104                               Evas_Coord *h)
2105 {
2106    if ((w) && (*w < (_elm_config->finger_size * times_w)))
2107      *w = _elm_config->finger_size * times_w;
2108    if ((h) && (*h < (_elm_config->finger_size * times_h)))
2109      *h = _elm_config->finger_size * times_h;
2110 >>>>>>> remotes/origin/upstream
2111 }
2112
2113 EAPI Evas_Object *
2114 elm_object_item_widget_get(const Elm_Object_Item *it)
2115 {
2116    return WIDGET(it);
2117 }
2118
2119 EAPI void
2120 elm_object_item_content_part_set(Elm_Object_Item *it,
2121                                  const char *part,
2122                                  Evas_Object *content)
2123 {
2124 <<<<<<< HEAD
2125    _elm_widget_item_content_part_set((Elm_Widget_Item *) it, part, content);
2126 =======
2127    _elm_widget_item_content_part_set((Elm_Widget_Item *)it, part, content);
2128 >>>>>>> remotes/origin/upstream
2129 }
2130
2131 EAPI void
2132 elm_object_item_part_content_set(Elm_Object_Item *it,
2133                                  const char *part,
2134                                  Evas_Object *content)
2135 {
2136 <<<<<<< HEAD
2137    _elm_widget_item_content_part_set((Elm_Widget_Item *) it, part, content);
2138 =======
2139    _elm_widget_item_content_part_set((Elm_Widget_Item *)it, part, content);
2140 >>>>>>> remotes/origin/upstream
2141 }
2142
2143 EAPI Evas_Object *
2144 elm_object_item_content_part_get(const Elm_Object_Item *it,
2145                                  const char *part)
2146 {
2147 <<<<<<< HEAD
2148    return _elm_widget_item_content_part_get((Elm_Widget_Item *) it, part);
2149 =======
2150    return _elm_widget_item_content_part_get((Elm_Widget_Item *)it, part);
2151 >>>>>>> remotes/origin/upstream
2152 }
2153
2154 EAPI Evas_Object *
2155 elm_object_item_part_content_get(const Elm_Object_Item *it,
2156                                  const char *part)
2157 {
2158 <<<<<<< HEAD
2159    return _elm_widget_item_content_part_get((Elm_Widget_Item *) it, part);
2160 =======
2161    return _elm_widget_item_content_part_get((Elm_Widget_Item *)it, part);
2162 >>>>>>> remotes/origin/upstream
2163 }
2164
2165 EAPI Evas_Object *
2166 elm_object_item_content_part_unset(Elm_Object_Item *it, const char *part)
2167 {
2168 <<<<<<< HEAD
2169    return _elm_widget_item_content_part_unset((Elm_Widget_Item *) it, part);
2170 =======
2171    return _elm_widget_item_content_part_unset((Elm_Widget_Item *)it, part);
2172 >>>>>>> remotes/origin/upstream
2173 }
2174
2175 EAPI Evas_Object *
2176 elm_object_item_part_content_unset(Elm_Object_Item *it, const char *part)
2177 {
2178 <<<<<<< HEAD
2179    return _elm_widget_item_content_part_unset((Elm_Widget_Item *) it, part);
2180 =======
2181    return _elm_widget_item_content_part_unset((Elm_Widget_Item *)it, part);
2182 >>>>>>> remotes/origin/upstream
2183 }
2184
2185 EAPI void
2186 elm_object_item_text_part_set(Elm_Object_Item *it,
2187                               const char *part,
2188                               const char *label)
2189 {
2190 <<<<<<< HEAD
2191    _elm_widget_item_text_part_set((Elm_Widget_Item *) it, part, label);
2192 =======
2193    _elm_widget_item_text_part_set((Elm_Widget_Item *)it, part, label);
2194 >>>>>>> remotes/origin/upstream
2195 }
2196
2197 EAPI void
2198 elm_object_item_part_text_set(Elm_Object_Item *it,
2199                               const char *part,
2200                               const char *label)
2201 {
2202 <<<<<<< HEAD
2203    _elm_widget_item_text_part_set((Elm_Widget_Item *) it, part, label);
2204 =======
2205    _elm_widget_item_text_part_set((Elm_Widget_Item *)it, part, label);
2206 >>>>>>> remotes/origin/upstream
2207 }
2208
2209 EAPI const char *
2210 elm_object_item_text_part_get(const Elm_Object_Item *it, const char *part)
2211 {
2212 <<<<<<< HEAD
2213    return _elm_widget_item_text_part_get((Elm_Widget_Item *) it, part);
2214 =======
2215    return _elm_widget_item_text_part_get((Elm_Widget_Item *)it, part);
2216 >>>>>>> remotes/origin/upstream
2217 }
2218
2219 EAPI const char *
2220 elm_object_item_part_text_get(const Elm_Object_Item *it, const char *part)
2221 {
2222 <<<<<<< HEAD
2223    return _elm_widget_item_text_part_get((Elm_Widget_Item *) it, part);
2224 =======
2225    return _elm_widget_item_text_part_get((Elm_Widget_Item *)it, part);
2226 >>>>>>> remotes/origin/upstream
2227 }
2228
2229 EAPI void
2230 elm_object_access_info_set(Evas_Object *obj, const char *txt)
2231 {
2232    elm_widget_access_info_set(obj, txt);
2233 }
2234
2235 EAPI Evas_Object *
2236 elm_object_name_find(const Evas_Object *obj, const char *name, int recurse)
2237 {
2238    return elm_widget_name_find(obj, name, recurse);
2239 }
2240
2241 EAPI void
2242 elm_object_item_access_info_set(Elm_Object_Item *it, const char *txt)
2243 {
2244 <<<<<<< HEAD
2245    _elm_widget_item_access_info_set((Elm_Widget_Item *) it, txt);
2246 =======
2247    _elm_widget_item_access_info_set((Elm_Widget_Item *)it, txt);
2248 >>>>>>> remotes/origin/upstream
2249 }
2250
2251 EAPI void *
2252 elm_object_item_data_get(const Elm_Object_Item *it)
2253 {
2254    return elm_widget_item_data_get(it);
2255 }
2256
2257 EAPI void
2258 elm_object_item_data_set(Elm_Object_Item *it, void *data)
2259 {
2260    elm_widget_item_data_set(it, data);
2261 }
2262
2263 EAPI void
2264 elm_object_item_signal_emit(Elm_Object_Item *it, const char *emission, const char *source)
2265 {
2266 <<<<<<< HEAD
2267    _elm_widget_item_signal_emit((Elm_Widget_Item *) it, emission, source);
2268 =======
2269    _elm_widget_item_signal_emit((Elm_Widget_Item *)it, emission, source);
2270 >>>>>>> remotes/origin/upstream
2271 }
2272
2273 EAPI void elm_object_item_disabled_set(Elm_Object_Item *it, Eina_Bool disabled)
2274 {
2275 <<<<<<< HEAD
2276    _elm_widget_item_disabled_set((Elm_Widget_Item *) it, disabled);
2277 =======
2278    _elm_widget_item_disabled_set((Elm_Widget_Item *)it, disabled);
2279 >>>>>>> remotes/origin/upstream
2280 }
2281
2282 EAPI Eina_Bool elm_object_item_disabled_get(const Elm_Object_Item *it)
2283 {
2284 <<<<<<< HEAD
2285    return _elm_widget_item_disabled_get((Elm_Widget_Item *) it);
2286 =======
2287    return _elm_widget_item_disabled_get((Elm_Widget_Item *)it);
2288 >>>>>>> remotes/origin/upstream
2289 }
2290
2291 EAPI void elm_object_item_del_cb_set(Elm_Object_Item *it, Evas_Smart_Cb del_cb)
2292 {
2293 <<<<<<< HEAD
2294    _elm_widget_item_del_cb_set((Elm_Widget_Item *) it, del_cb);
2295 =======
2296    _elm_widget_item_del_cb_set((Elm_Widget_Item *)it, del_cb);
2297 >>>>>>> remotes/origin/upstream
2298 }
2299
2300 EAPI void elm_object_item_del(Elm_Object_Item *it)
2301 {
2302 <<<<<<< HEAD
2303    _elm_widget_item_del((Elm_Widget_Item *) it);
2304 }
2305
2306 EAPI void
2307 elm_object_item_tooltip_text_set(Elm_Object_Item *item, const char *text)
2308 {
2309    elm_widget_item_tooltip_text_set(item, text);
2310 }
2311
2312 EAPI void
2313 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)
2314 {
2315    elm_widget_item_tooltip_content_cb_set(item, func, data, del_cb);
2316 }
2317
2318 EAPI void
2319 elm_object_item_tooltip_unset(Elm_Object_Item *item)
2320 {
2321    elm_widget_item_tooltip_unset(item);
2322 }
2323
2324 EAPI Eina_Bool
2325 elm_object_item_tooltip_window_mode_set(Elm_Object_Item *item, Eina_Bool disable)
2326 {
2327    return elm_widget_item_tooltip_window_mode_set(item, disable);
2328 }
2329
2330 EAPI Eina_Bool
2331 elm_object_item_tooltip_window_mode_get(const Elm_Object_Item *item)
2332 {
2333    return elm_widget_item_tooltip_window_mode_get(item);
2334 }
2335
2336 EAPI void
2337 elm_object_item_tooltip_style_set(Elm_Object_Item *item, const char *style)
2338 {
2339    elm_widget_item_tooltip_style_set(item, style);
2340 }
2341
2342 EAPI const char *
2343 elm_object_item_tooltip_style_get(const Elm_Object_Item *item)
2344 {
2345    return elm_widget_item_tooltip_style_get(item);
2346 }
2347
2348 EINA_DEPRECATED EAPI Evas_Object *
2349 elm_object_item_object_get(const Elm_Object_Item *it)
2350 {
2351    return elm_object_item_widget_get(it);
2352 }
2353
2354 EAPI void
2355 elm_object_item_cursor_set(Elm_Object_Item *item, const char *cursor)
2356 {
2357    elm_widget_item_tooltip_style_set(item, cursor);
2358 }
2359
2360 EAPI const char *
2361 elm_object_item_cursor_get(const Elm_Object_Item *item)
2362 {
2363    return elm_widget_item_cursor_get(item);
2364 }
2365
2366 EAPI void
2367 elm_object_item_cursor_unset(Elm_Object_Item *item)
2368 {
2369    elm_widget_item_cursor_unset(item);
2370 }
2371
2372 EAPI void
2373 elm_object_item_cursor_style_set(Elm_Object_Item *item, const char *style)
2374 {
2375    elm_widget_item_cursor_style_set(item, style);
2376 }
2377
2378 EAPI const char *
2379 elm_object_item_cursor_style_get(const Elm_Object_Item *item)
2380 {
2381    return elm_widget_item_cursor_style_get(item);
2382 }
2383
2384 EAPI void
2385 elm_object_item_cursor_engine_only_set(Elm_Object_Item *item, Eina_Bool engine_only)
2386 {
2387    elm_widget_item_cursor_engine_only_set(item, engine_only);
2388 }
2389
2390 EAPI Eina_Bool
2391 elm_object_item_cursor_engine_only_get(const Elm_Object_Item *item)
2392 {
2393    return elm_widget_item_cursor_engine_only_get(item);
2394 =======
2395    _elm_widget_item_del((Elm_Widget_Item *)it);
2396 }
2397
2398 EAPI void
2399 elm_object_item_tooltip_text_set(Elm_Object_Item *it, const char *text)
2400 {
2401    elm_widget_item_tooltip_text_set(it, text);
2402 }
2403
2404 EAPI void
2405 elm_object_item_tooltip_content_cb_set(Elm_Object_Item *it, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb)
2406 {
2407    elm_widget_item_tooltip_content_cb_set(it, func, data, del_cb);
2408 }
2409
2410 EAPI void
2411 elm_object_item_tooltip_unset(Elm_Object_Item *it)
2412 {
2413    elm_widget_item_tooltip_unset(it);
2414 }
2415
2416 EAPI Eina_Bool
2417 elm_object_item_tooltip_window_mode_set(Elm_Object_Item *it, Eina_Bool disable)
2418 {
2419    return elm_widget_item_tooltip_window_mode_set(it, disable);
2420 }
2421
2422 EAPI Eina_Bool
2423 elm_object_item_tooltip_window_mode_get(const Elm_Object_Item *it)
2424 {
2425    return elm_widget_item_tooltip_window_mode_get(it);
2426 }
2427
2428 EAPI void
2429 elm_object_item_tooltip_style_set(Elm_Object_Item *it, const char *style)
2430 {
2431    elm_widget_item_tooltip_style_set(it, style);
2432 }
2433
2434 EAPI const char *
2435 elm_object_item_tooltip_style_get(const Elm_Object_Item *it)
2436 {
2437    return elm_widget_item_tooltip_style_get(it);
2438 }
2439
2440 EAPI void
2441 elm_object_item_cursor_set(Elm_Object_Item *it, const char *cursor)
2442 {
2443    elm_widget_item_cursor_set(it, cursor);
2444 }
2445
2446 EAPI const char *
2447 elm_object_item_cursor_get(const Elm_Object_Item *it)
2448 {
2449    return elm_widget_item_cursor_get(it);
2450 }
2451
2452 EAPI void
2453 elm_object_item_cursor_unset(Elm_Object_Item *it)
2454 {
2455    elm_widget_item_cursor_unset(it);
2456 }
2457
2458 EAPI void
2459 elm_object_item_cursor_style_set(Elm_Object_Item *it, const char *style)
2460 {
2461    elm_widget_item_cursor_style_set(it, style);
2462 }
2463
2464 EAPI const char *
2465 elm_object_item_cursor_style_get(const Elm_Object_Item *it)
2466 {
2467    return elm_widget_item_cursor_style_get(it);
2468 }
2469
2470 EAPI void
2471 elm_object_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only)
2472 {
2473    elm_widget_item_cursor_engine_only_set(it, engine_only);
2474 }
2475
2476 EAPI Eina_Bool
2477 elm_object_item_cursor_engine_only_get(const Elm_Object_Item *it)
2478 {
2479    return elm_widget_item_cursor_engine_only_get(it);
2480 }
2481
2482 EAPI void
2483 elm_object_item_smart_callback_add(Elm_Object_Item *it, const char *event, Elm_Object_Item_Smart_Cb func, const void *data)
2484 {
2485    elm_widget_item_smart_callback_add((Elm_Widget_Item *)it, event, func, data);
2486 }
2487
2488 EAPI void *
2489 elm_object_item_smart_callback_del(Elm_Object_Item *it, const char *event, Elm_Object_Item_Smart_Cb func)
2490 {
2491    return elm_widget_item_smart_callback_del((Elm_Widget_Item *)it, event,
2492                                              func);
2493 >>>>>>> remotes/origin/upstream
2494 }