elm_need_efret() - improve error handling according to coverity
[platform/upstream/elementary.git] / src / lib / elm_main.c
1 #ifdef HAVE_CONFIG_H
2 # include "elementary_config.h"
3 #endif
4
5 #ifndef _WIN32
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 <Emotion.h>
18
19 #include <Elementary.h>
20 #include "elm_priv.h"
21
22 #define SEMI_BROKEN_QUICKLAUNCH 1
23
24 #ifdef __CYGWIN__
25 # define LIBEXT ".dll"
26 #else
27 # define LIBEXT ".so"
28 #endif
29
30 static Elm_Version _version = { VMAJ, VMIN, VMIC, VREV };
31 static void * _accessibility_currently_highlighted_obj = NULL;
32 EAPI Elm_Version *elm_version = &_version;
33
34 Eina_Bool
35 _elm_dangerous_call_check(const char *call)
36 {
37    char buf[256];
38    const char *eval;
39
40    snprintf(buf, sizeof(buf), "%i.%i.%i.%i", VMAJ, VMIN, VMIC, VREV);
41    eval = getenv("ELM_NO_FINGER_WAGGLING");
42    if ((eval) && (!strcmp(eval, buf)))
43      return 0;
44    ERR("ELEMENTARY FINGER WAGGLE!!!!!!!!!!\n"
45        "\n"
46        "  %s() used.\n"
47        "PLEASE see the API documentation for this function. This call\n"
48        "should almost never be used. Only in very special cases.\n"
49        "\n"
50        "To remove this warning please set the environment variable:\n"
51        "  ELM_NO_FINGER_WAGGLING\n"
52        "To the value of the Elementary version + revision number. e.g.:\n"
53        "  1.2.5.40295\n"
54        "\n"
55        ,
56        call);
57    return 1;
58 }
59
60 static Eina_Bool _elm_signal_exit(void *data,
61                                   int   ev_type,
62                                   void *ev);
63
64 static Eina_Prefix *pfx = NULL;
65 char *_elm_appname = NULL;
66 const char *_elm_data_dir = NULL;
67 const char *_elm_lib_dir = NULL;
68 int _elm_log_dom = -1;
69
70 EAPI int ELM_EVENT_POLICY_CHANGED = 0;
71 EAPI int ELM_EVENT_PROCESS_BACKGROUND = 0;
72 EAPI int ELM_EVENT_PROCESS_FOREGROUND = 0;
73
74 static int _elm_init_count = 0;
75 static int _elm_sub_init_count = 0;
76 static int _elm_ql_init_count = 0;
77 static int _elm_policies[ELM_POLICY_LAST];
78 static Ecore_Event_Handler *_elm_exit_handler = NULL;
79 static Eina_Bool quicklaunch_on = 0;
80
81 static Eina_Bool
82 _elm_signal_exit(void *data  EINA_UNUSED,
83                  int ev_type EINA_UNUSED,
84                  void *ev    EINA_UNUSED)
85 {
86    elm_exit();
87    return ECORE_CALLBACK_PASS_ON;
88 }
89
90 void
91 _elm_rescale(void)
92 {
93    edje_scale_set(_elm_config->scale);
94    _elm_win_rescale(NULL, EINA_FALSE);
95    _elm_ews_wm_rescale(NULL, EINA_FALSE);
96 }
97
98 static Eina_Bool _emotion_inited = EINA_FALSE;
99
100 void
101 _elm_emotion_init(void)
102 {
103    if (_emotion_inited) return ;
104
105    emotion_init();
106    _emotion_inited = EINA_TRUE;
107 }
108
109 void
110 _elm_emotion_shutdown(void)
111 {
112    if (!_emotion_inited) return ;
113
114    emotion_shutdown();
115    _emotion_inited = EINA_FALSE;
116 }
117
118 static void *app_mainfunc = NULL;
119 static const char *app_name = NULL;
120 static const char *app_desktop_entry = NULL;
121 static const char *app_domain = NULL;
122 static const char *app_checkfile = NULL;
123
124 static const char *app_compile_bin_dir = NULL;
125 static const char *app_compile_lib_dir = NULL;
126 static const char *app_compile_data_dir = NULL;
127 static const char *app_compile_locale_dir = NULL;
128 static const char *app_prefix_dir = NULL;
129 static const char *app_bin_dir = NULL;
130 static const char *app_lib_dir = NULL;
131 static const char *app_data_dir = NULL;
132 static const char *app_locale_dir = NULL;
133 static double app_base_scale = 1.0;
134
135 static Eina_Prefix *app_pfx = NULL;
136
137 static Ecore_Event_Handler *system_handlers[2] = { NULL, NULL };
138
139 static void
140 _prefix_check(void)
141 {
142    int argc = 0;
143    char **argv = NULL;
144    const char *dirs[4] = { NULL, NULL, NULL, NULL };
145    char *caps = NULL, *p1, *p2;
146    char buf[PATH_MAX];
147
148    if (app_pfx) return;
149    if (!app_domain) return;
150
151    ecore_app_args_get(&argc, &argv);
152    if (argc < 1) return;
153
154    dirs[0] = app_compile_bin_dir;
155    dirs[1] = app_compile_lib_dir;
156    dirs[2] = app_compile_data_dir;
157    dirs[3] = app_compile_locale_dir;
158
159    if (!dirs[0]) dirs[0] = "/usr/local/bin";
160    if (!dirs[1]) dirs[1] = "/usr/local/lib";
161    if (!dirs[2])
162      {
163         snprintf(buf, sizeof(buf), "/usr/local/share/%s", app_domain);
164         dirs[2] = buf;
165      }
166    if (!dirs[3]) dirs[3] = dirs[2];
167
168    if (app_domain)
169      {
170         caps = alloca(eina_stringshare_strlen(app_domain) + 1);
171         for (p1 = (char *)app_domain, p2 = caps; *p1; p1++, p2++)
172            *p2 = toupper(*p1);
173         *p2 = 0;
174      }
175    app_pfx = eina_prefix_new(argv[0], app_mainfunc, caps, app_domain,
176                              app_checkfile, dirs[0], dirs[1], dirs[2], dirs[3]);
177 }
178
179 static void
180 _prefix_shutdown(void)
181 {
182    if (app_pfx) eina_prefix_free(app_pfx);
183    ELM_SAFE_FREE(app_domain, eina_stringshare_del);
184    ELM_SAFE_FREE(app_checkfile, eina_stringshare_del);
185    ELM_SAFE_FREE(app_compile_bin_dir, eina_stringshare_del);
186    ELM_SAFE_FREE(app_compile_lib_dir, eina_stringshare_del);
187    ELM_SAFE_FREE(app_compile_data_dir, eina_stringshare_del);
188    ELM_SAFE_FREE(app_compile_locale_dir, eina_stringshare_del);
189    app_mainfunc = NULL;
190    app_prefix_dir = NULL;
191    app_bin_dir = NULL;
192    app_lib_dir = NULL;
193    app_data_dir = NULL;
194    app_locale_dir = NULL;
195    app_pfx = NULL;
196 }
197
198 static struct {
199      Eina_Module *handle;
200      void (*init)(void);
201      void (*shutdown)(void);
202      Eina_Bool (*app_connect)(const char *appname);
203      Eina_Bool is_init;
204 } _clouseau_info;
205
206 #define _CLOUSEAU_LOAD_SYMBOL(cls_struct, sym) \
207    do \
208      { \
209         (cls_struct).sym = eina_module_symbol_get((cls_struct).handle, "clouseau_" #sym); \
210         if (!(cls_struct).sym) \
211           { \
212              WRN("Failed loading symbol '%s' from the clouseau library.", "clouseau_" #sym); \
213              eina_module_free((cls_struct).handle); \
214              (cls_struct).handle = NULL; \
215              return EINA_FALSE; \
216           } \
217      } \
218    while (0)
219
220 static void
221 _elm_clouseau_unload()
222 {
223    if (!_clouseau_info.is_init)
224       return;
225
226    if (_clouseau_info.shutdown)
227      {
228         _clouseau_info.shutdown();
229      }
230
231    if (_clouseau_info.handle)
232      {
233         eina_module_free(_clouseau_info.handle);
234         _clouseau_info.handle = NULL;
235      }
236
237    _clouseau_info.is_init = EINA_FALSE;
238 }
239
240 Eina_Bool
241 _elm_clouseau_reload()
242 {
243    if (!_elm_config->clouseau_enable)
244      {
245         _elm_clouseau_unload();
246         return EINA_TRUE;
247      }
248
249    if (_clouseau_info.is_init)
250       return EINA_TRUE;
251
252    _clouseau_info.handle = eina_module_new(
253          PACKAGE_LIB_DIR "/libclouseau" LIBEXT);
254    if (!eina_module_load(_clouseau_info.handle))
255      {
256         WRN("Failed loading the clouseau library.");
257         eina_module_free(_clouseau_info.handle);
258         _clouseau_info.handle = NULL;
259         return EINA_FALSE;
260      }
261
262    _CLOUSEAU_LOAD_SYMBOL(_clouseau_info, init);
263    _CLOUSEAU_LOAD_SYMBOL(_clouseau_info, shutdown);
264    _CLOUSEAU_LOAD_SYMBOL(_clouseau_info, app_connect);
265
266    _clouseau_info.init();
267    if (!_clouseau_info.app_connect(elm_app_name_get()))
268      {
269         ERR("Failed connecting to the clouseau server.");
270      }
271
272    _clouseau_info.is_init = EINA_TRUE;
273
274    return EINA_TRUE;
275 }
276
277 Eina_Bool _sys_memory_changed(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
278 {
279    Ecore_Memory_State state = ecore_memory_state_get();
280
281    if (state != ECORE_MEMORY_STATE_LOW)
282      return ECORE_CALLBACK_PASS_ON;
283
284    elm_cache_all_flush();
285    return ECORE_CALLBACK_PASS_ON;
286 }
287
288 Eina_Bool _sys_lang_changed(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
289 {
290    char *lang;
291
292    lang = getenv("LANG");
293    if (!lang)
294      lang = getenv("LC_MESSAGES");
295    if (!lang)
296      lang = getenv("LC_ALL");
297
298    if (lang)
299      elm_language_set(lang);
300    else
301      ERR("Language not set in environment");
302
303    return ECORE_CALLBACK_PASS_ON;
304 }
305
306 EAPI int
307 elm_init(int    argc,
308          char **argv)
309 {
310
311 //TIZEN_ONLY(20160628):  Add Performance log for cold booting
312 #ifdef ENABLE_TTRACE
313    traceBegin(TTRACE_TAG_EFL, "elm_init");
314 #endif
315 //
316
317    _elm_init_count++;
318    if (_elm_init_count > 1)
319      {
320 //TIZEN_ONLY(20160628):  Add Performance log for cold booting
321 #ifdef ENABLE_TTRACE
322       traceEnd(TTRACE_TAG_EFL);
323 #endif
324 //
325        return _elm_init_count;
326      }
327    elm_quicklaunch_init(argc, argv);
328    elm_quicklaunch_sub_init(argc, argv);
329    _prefix_shutdown();
330
331    system_handlers[0] = ecore_event_handler_add(ECORE_EVENT_MEMORY_STATE, _sys_memory_changed, NULL);
332    system_handlers[1] = ecore_event_handler_add(ECORE_EVENT_LOCALE_CHANGED, _sys_lang_changed, NULL);
333    _accessibility_currently_highlighted_obj = NULL;
334
335 //TIZEN_ONLY(20160628):  Add Performance log for cold booting
336 #ifdef ENABLE_TTRACE
337    traceEnd(TTRACE_TAG_EFL);
338 #endif
339 //
340
341    return _elm_init_count;
342 }
343
344 EAPI int
345 elm_shutdown(void)
346 {
347    if (_elm_init_count <= 0)
348      {
349         return 0;
350      }
351    _elm_init_count--;
352    if (_elm_init_count > 0) return _elm_init_count;
353
354    //TIZEN_ONLY(20170413) Handle exception calling elm_shutdown without elm_exit
355    if (_elm_config->atspi_mode != ELM_ATSPI_MODE_OFF)
356      _elm_atspi_bridge_shutdown();
357    //
358
359    ecore_event_handler_del(system_handlers[0]);
360    ecore_event_handler_del(system_handlers[1]);
361
362    _elm_win_shutdown();
363
364    while (_elm_win_deferred_free) ecore_main_loop_iterate();
365
366    _elm_clouseau_unload();
367 // wrningz :(
368 //   _prefix_shutdown();
369    ELM_SAFE_FREE(app_name, eina_stringshare_del);
370    ELM_SAFE_FREE(app_desktop_entry, eina_stringshare_del);
371
372    elm_quicklaunch_sub_shutdown();
373    elm_quicklaunch_shutdown();
374    return _elm_init_count;
375 }
376
377 EAPI void
378 elm_app_info_set(void *mainfunc, const char *dom, const char *checkfile)
379 {
380    app_mainfunc = mainfunc;
381    eina_stringshare_replace(&app_domain, dom);
382    eina_stringshare_replace(&app_checkfile, checkfile);
383 }
384
385 EAPI void
386 elm_app_name_set(const char *name)
387 {
388    eina_stringshare_replace(&app_name, name);
389 }
390
391 EAPI void
392 elm_app_desktop_entry_set(const char *path)
393 {
394    eina_stringshare_replace(&app_desktop_entry, path);
395 }
396
397 EAPI void
398 elm_app_compile_bin_dir_set(const char *dir)
399 {
400    eina_stringshare_replace(&app_compile_bin_dir, dir);
401 }
402
403 EAPI void
404 elm_app_compile_lib_dir_set(const char *dir)
405 {
406    eina_stringshare_replace(&app_compile_lib_dir, dir);
407 }
408
409 EAPI void
410 elm_app_compile_data_dir_set(const char *dir)
411 {
412    eina_stringshare_replace(&app_compile_data_dir, dir);
413 }
414
415 EAPI void
416 elm_app_compile_locale_set(const char *dir)
417 {
418    eina_stringshare_replace(&app_compile_locale_dir, dir);
419 }
420
421 EAPI const char *
422 elm_app_name_get(void)
423 {
424    if (app_name) return app_name;
425
426    return "";
427 }
428
429 EAPI const char *
430 elm_app_desktop_entry_get(void)
431 {
432    if (app_desktop_entry) return app_desktop_entry;
433
434    return "";
435 }
436
437 EAPI const char *
438 elm_app_prefix_dir_get(void)
439 {
440    if (app_prefix_dir) return app_prefix_dir;
441    _prefix_check();
442   if (!app_pfx) return "";
443    app_prefix_dir = eina_prefix_get(app_pfx);
444    return app_prefix_dir;
445 }
446
447 EAPI const char *
448 elm_app_bin_dir_get(void)
449 {
450    if (app_bin_dir) return app_bin_dir;
451    _prefix_check();
452    if (!app_pfx) return "";
453    app_bin_dir = eina_prefix_bin_get(app_pfx);
454    return app_bin_dir;
455 }
456
457 EAPI const char *
458 elm_app_lib_dir_get(void)
459 {
460    if (app_lib_dir) return app_lib_dir;
461    _prefix_check();
462    if (!app_pfx) return "";
463    app_lib_dir = eina_prefix_lib_get(app_pfx);
464    return app_lib_dir;
465 }
466
467 EAPI const char *
468 elm_app_data_dir_get(void)
469 {
470    if (app_data_dir) return app_data_dir;
471    _prefix_check();
472    if (!app_pfx) return "";
473    app_data_dir = eina_prefix_data_get(app_pfx);
474    return app_data_dir;
475 }
476
477 EAPI const char *
478 elm_app_locale_dir_get(void)
479 {
480    if (app_locale_dir) return app_locale_dir;
481    _prefix_check();
482    if (!app_pfx) return "";
483    app_locale_dir = eina_prefix_locale_get(app_pfx);
484    return app_locale_dir;
485 }
486
487 EAPI void
488 elm_app_base_scale_set(double base_scale)
489 {
490    if (base_scale < 0.0) return;
491    if (fabs(base_scale) < DBL_EPSILON) return;
492    app_base_scale = base_scale;
493 }
494
495 EAPI double
496 elm_app_base_scale_get(void)
497 {
498    if (app_base_scale > 0.0) return app_base_scale;
499    return 1.0;
500 }
501
502 static Eina_Bool _elm_need_e_dbus = EINA_FALSE;
503 static void *e_dbus_handle = NULL;
504
505 EAPI Eina_Bool
506 elm_need_e_dbus(void)
507 {
508    int (*init_func)(void) = NULL;
509
510    if (_elm_need_e_dbus) return EINA_TRUE;
511    /* We use RTLD_NOLOAD when available, so we are sure to use the 'libeldbus' that was linked to the binary */
512 #ifndef RTLD_NOLOAD
513 # define RTLD_NOLOAD RTLD_GLOBAL
514 #endif
515    if (!e_dbus_handle) e_dbus_handle = dlopen("libedbus.so", RTLD_LAZY | RTLD_NOLOAD);
516    if (!e_dbus_handle) e_dbus_handle = dlopen("libedbus.so.1", RTLD_LAZY | RTLD_NOLOAD);
517    if (!e_dbus_handle) return EINA_FALSE;
518    init_func = dlsym(e_dbus_handle, "e_dbus_init");
519    if (!init_func) return EINA_FALSE;
520    _elm_need_e_dbus = EINA_TRUE;
521    init_func();
522    return EINA_TRUE;
523 }
524
525 static void
526 _elm_unneed_e_dbus(void)
527 {
528    int (*shutdown_func)(void) = NULL;
529
530    if (!_elm_need_e_dbus) return;
531    shutdown_func = dlsym(e_dbus_handle, "e_dbus_shutdown");
532    if (!shutdown_func) return;
533    _elm_need_e_dbus = EINA_FALSE;
534    shutdown_func();
535
536    dlclose(e_dbus_handle);
537    e_dbus_handle = NULL;
538 }
539
540 static Eina_Bool _elm_need_eldbus = EINA_FALSE;
541 EAPI Eina_Bool
542 elm_need_eldbus(void)
543 {
544    if (_elm_need_eldbus) return EINA_TRUE;
545    _elm_need_eldbus = EINA_TRUE;
546    eldbus_init();
547    return EINA_TRUE;
548 }
549
550 static void
551 _elm_unneed_eldbus(void)
552 {
553    if (!_elm_need_eldbus) return;
554    _elm_need_eldbus = EINA_FALSE;
555    eldbus_shutdown();
556 }
557
558 #ifdef ELM_ELOCATION
559 static Eina_Bool _elm_need_elocation = EINA_FALSE;
560 #endif
561 EAPI Eina_Bool
562 elm_need_elocation(void)
563 {
564 #ifdef ELM_ELOCATION
565    if (_elm_need_elocation) return EINA_TRUE;
566    _elm_need_elocation = EINA_TRUE;
567    elocation_init();
568    return EINA_TRUE;
569 #else
570    return EINA_FALSE;
571 #endif
572 }
573
574 static void
575 _elm_unneed_elocation(void)
576 {
577 #ifdef ELM_ELOCATION
578    if (!_elm_need_elocation) return;
579    _elm_need_elocation = EINA_FALSE;
580    eldbus_shutdown();
581 #endif
582 }
583
584 static Eina_Bool _elm_need_efreet = EINA_FALSE;
585
586 EAPI Eina_Bool
587 elm_need_efreet(void)
588 {
589    if (_elm_need_efreet) return EINA_TRUE;
590    if (!efreet_init()) return EINA_FALSE;
591    if (!efreet_mime_init())
592      {
593         efreet_shutdown();
594         return EINA_FALSE;
595      }
596    if (!efreet_trash_init())
597      {
598         efreet_mime_shutdown();
599         efreet_shutdown();
600         return EINA_FALSE;
601      }
602    _elm_need_efreet = EINA_TRUE;
603    /*
604      {
605         Eina_List **list;
606
607         list = efreet_icon_extra_list_get();
608         if (list)
609           {
610              e_user_dir_concat_static(buf, "icons");
611              *list = eina_list_prepend(*list, (void *)eina_stringshare_add(buf));
612              e_prefix_data_concat_static(buf, "data/icons");
613              *list = eina_list_prepend(*list, (void *)eina_stringshare_add(buf));
614           }
615      }
616     */
617    return EINA_TRUE;
618 }
619
620 static void
621 _elm_unneed_efreet(void)
622 {
623    if (!_elm_need_efreet) return;
624    _elm_need_efreet = EINA_FALSE;
625    efreet_trash_shutdown();
626    efreet_mime_shutdown();
627    efreet_shutdown();
628 }
629
630 EAPI void
631 elm_quicklaunch_mode_set(Eina_Bool ql_on)
632 {
633    quicklaunch_on = ql_on;
634 }
635
636 EAPI Eina_Bool
637 elm_quicklaunch_mode_get(void)
638 {
639    return quicklaunch_on;
640 }
641
642 EAPI int
643 elm_quicklaunch_init(int    argc,
644                      char **argv)
645 {
646    _elm_ql_init_count++;
647    if (_elm_ql_init_count > 1) return _elm_ql_init_count;
648    eina_init();
649    _elm_log_dom = eina_log_domain_register("elementary", EINA_COLOR_LIGHTBLUE);
650    if (!_elm_log_dom)
651      {
652         EINA_LOG_ERR("could not register elementary log domain.");
653         _elm_log_dom = EINA_LOG_DOMAIN_GLOBAL;
654      }
655
656    eet_init();
657    ecore_init();
658    edje_init();
659
660 #ifdef HAVE_ELEMENTARY_EMAP
661    emap_init();
662 #endif
663    ecore_app_args_set(argc, (const char **)argv);
664
665    memset(_elm_policies, 0, sizeof(_elm_policies));
666    if (!ELM_EVENT_POLICY_CHANGED)
667      ELM_EVENT_POLICY_CHANGED = ecore_event_type_new();
668    if (!ELM_EVENT_PROCESS_BACKGROUND)
669      ELM_EVENT_PROCESS_BACKGROUND = ecore_event_type_new();
670    if (!ELM_EVENT_PROCESS_FOREGROUND)
671      ELM_EVENT_PROCESS_FOREGROUND = ecore_event_type_new();
672
673    if (!ecore_file_init())
674      ERR("Elementary cannot init ecore_file");
675    eio_init();
676
677    _elm_exit_handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _elm_signal_exit, NULL);
678
679    if (argv)
680      {
681         _elm_appname = strdup(ecore_file_file_get(argv[0]));
682         elm_app_name_set(_elm_appname);
683      }
684
685    pfx = eina_prefix_new(argv ? argv[0] : NULL, elm_quicklaunch_init,
686                          "ELM", "elementary", "config/profile.cfg",
687                          PACKAGE_LIB_DIR, /* don't have a bin dir currently */
688                          PACKAGE_LIB_DIR,
689                          PACKAGE_DATA_DIR,
690                          LOCALE_DIR);
691    if (pfx)
692      {
693         _elm_data_dir = eina_stringshare_add(eina_prefix_data_get(pfx));
694         _elm_lib_dir = eina_stringshare_add(eina_prefix_lib_get(pfx));
695      }
696    if (!_elm_data_dir) _elm_data_dir = eina_stringshare_add("/");
697    if (!_elm_lib_dir) _elm_lib_dir = eina_stringshare_add("/");
698
699    eina_log_timing(_elm_log_dom,
700                    EINA_LOG_STATE_STOP,
701                    EINA_LOG_STATE_INIT);
702
703    if (quicklaunch_on)
704      _elm_init_count++;
705    return _elm_ql_init_count;
706 }
707
708 EAPI int
709 elm_quicklaunch_sub_init(int    argc,
710                          char **argv)
711 {
712    _elm_sub_init_count++;
713    if (_elm_sub_init_count > 1) return _elm_sub_init_count;
714    if (quicklaunch_on)
715      {
716         _elm_config_init();
717 #ifdef SEMI_BROKEN_QUICKLAUNCH
718         return _elm_sub_init_count;
719 #endif
720      }
721
722    if (!quicklaunch_on)
723      {
724         ecore_app_args_set(argc, (const char **)argv);
725         evas_init();
726         _elm_module_init();
727         _elm_config_init();
728         _elm_config_sub_init();
729         ecore_evas_init(); // FIXME: check errors
730         ecore_imf_init();
731         ecore_con_init();
732         ecore_con_url_init();
733         _elm_prefs_init();
734         _elm_ews_wm_init();
735         elm_color_class_init();
736      }
737    return _elm_sub_init_count;
738 }
739
740 EAPI int
741 elm_quicklaunch_sub_shutdown(void)
742 {
743    _elm_sub_init_count--;
744    if (_elm_sub_init_count > 0) return _elm_sub_init_count;
745    if (quicklaunch_on)
746      {
747 #ifdef SEMI_BROKEN_QUICKLAUNCH
748         return _elm_sub_init_count;
749 #endif
750      }
751    if (!quicklaunch_on)
752      {
753         _elm_win_shutdown();
754         _elm_module_shutdown();
755         _elm_prefs_shutdown();
756         _elm_ews_wm_shutdown();
757         ecore_con_url_shutdown();
758         ecore_con_shutdown();
759         ecore_imf_shutdown();
760         ecore_evas_shutdown();
761         _elm_config_sub_shutdown();
762         evas_shutdown();
763      }
764    return _elm_sub_init_count;
765 }
766
767 EAPI int
768 elm_quicklaunch_shutdown(void)
769 {
770    _elm_ql_init_count--;
771    if (_elm_ql_init_count > 0) return _elm_ql_init_count;
772
773    eina_log_timing(_elm_log_dom,
774                    EINA_LOG_STATE_STOP,
775                    EINA_LOG_STATE_SHUTDOWN);
776
777    if (pfx) eina_prefix_free(pfx);
778    pfx = NULL;
779    ELM_SAFE_FREE(_elm_data_dir, eina_stringshare_del);
780    ELM_SAFE_FREE(_elm_lib_dir, eina_stringshare_del);
781    ELM_SAFE_FREE(_elm_appname, free);
782
783    _elm_config_shutdown();
784    elm_color_class_shutdown();
785
786    ELM_SAFE_FREE(_elm_exit_handler, ecore_event_handler_del);
787
788    _elm_theme_shutdown();
789    _elm_unneed_systray();
790    _elm_unneed_sys_notify();
791    _elm_unneed_efreet();
792    _elm_unneed_e_dbus();
793    _elm_unneed_eldbus();
794    _elm_unneed_elocation();
795    _elm_unneed_ethumb();
796    // TIZEN ONLY(20160811) : elm_web is not supported in tizen
797    //_elm_unneed_web();
798    eio_shutdown();
799    ecore_file_shutdown();
800
801 #ifdef HAVE_ELEMENTARY_EMAP
802    emap_shutdown();
803 #endif
804    _elm_emotion_shutdown();
805
806    edje_shutdown();
807    ecore_shutdown();
808    eet_shutdown();
809
810    if ((_elm_log_dom > -1) && (_elm_log_dom != EINA_LOG_DOMAIN_GLOBAL))
811      {
812         eina_log_domain_unregister(_elm_log_dom);
813         _elm_log_dom = -1;
814      }
815
816    eina_shutdown();
817    return _elm_ql_init_count;
818 }
819
820 EAPI void
821 elm_quicklaunch_seed(void)
822 {
823 #ifndef SEMI_BROKEN_QUICKLAUNCH
824    if (quicklaunch_on)
825      {
826         Evas_Object *win, *bg, *bt;
827
828         win = elm_win_add(NULL, "seed", ELM_WIN_BASIC);
829         bg = elm_bg_add(win);
830         elm_win_resize_object_add(win, bg);
831         evas_object_show(bg);
832         bt = elm_button_add(win);
833         elm_object_text_set(bt, " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~-_=+\\|]}[{;:'\",<.>/?");
834         elm_win_resize_object_add(win, bt);
835         ecore_main_loop_iterate();
836         evas_object_del(win);
837         ecore_main_loop_iterate();
838 # ifdef HAVE_ELEMENTARY_X
839         if (ecore_x_display_get()) ecore_x_sync();
840 # endif
841         ecore_main_loop_iterate();
842      }
843 #endif
844 }
845
846 #ifdef HAVE_FORK
847 static void *qr_handle = NULL;
848 #endif
849 static int (*qr_main)(int    argc,
850                       char **argv) = NULL;
851
852 EAPI Eina_Bool
853 elm_quicklaunch_prepare(int    argc,
854                         char **argv,
855                         const char *cwd)
856 {
857 #ifdef HAVE_FORK
858    char *exe, *exe2, *p;
859    char *exename;
860
861    if (argc <= 0 || argv == NULL) return EINA_FALSE;
862
863    exe = elm_quicklaunch_exe_path_get(argv[0], cwd);
864    if (!exe)
865      {
866         ERR("requested quicklaunch binary '%s' does not exist\n", argv[0]);
867         return EINA_FALSE;
868      }
869
870    exe2 = malloc(strlen(exe) + 1 + 7 + strlen(LIBEXT));
871    strcpy(exe2, exe);
872    p = strrchr(exe2, '/');
873    if (p) p++;
874    else p = exe2;
875    exename = alloca(strlen(p) + 1);
876    strcpy(exename, p);
877    *p = 0;
878    strcat(p, "../lib/");
879    strcat(p, exename);
880    strcat(p, LIBEXT);
881    if (access(exe2, R_OK | X_OK) != 0)
882      ELM_SAFE_FREE(exe2, free);
883
884    /* Try linking to executable first. Works with PIE files. */
885    qr_handle = dlopen(exe, RTLD_NOW | RTLD_GLOBAL);
886    if (qr_handle)
887      {
888         INF("dlopen('%s') = %p", exe, qr_handle);
889         qr_main = dlsym(qr_handle, "elm_main");
890         if (qr_main)
891           {
892              INF("dlsym(%p, 'elm_main') = %p", qr_handle, qr_main);
893              free(exe2);
894              free(exe);
895              return EINA_TRUE;
896           }
897         dlclose(qr_handle);
898         qr_handle = NULL;
899      }
900
901    if (!exe2)
902      {
903         WRN("not quicklauncher capable: '%s'", exe);
904         free(exe);
905         return EINA_FALSE;
906      }
907    free(exe);
908
909    /* Open companion .so file.
910     * Support for legacy quicklaunch apps with separate library.
911     */
912    qr_handle = dlopen(exe2, RTLD_NOW | RTLD_GLOBAL);
913    if (!qr_handle)
914      {
915         fprintf(stderr, "dlerr: %s\n", dlerror());
916         WRN("dlopen('%s') failed: %s", exe2, dlerror());
917         free(exe2);
918         return EINA_FALSE;
919      }
920    INF("dlopen('%s') = %p", exe2, qr_handle);
921    qr_main = dlsym(qr_handle, "elm_main");
922    INF("dlsym(%p, 'elm_main') = %p", qr_handle, qr_main);
923    if (!qr_main)
924      {
925         WRN("not quicklauncher capable: no elm_main in '%s'", exe2);
926         dlclose(qr_handle);
927         qr_handle = NULL;
928         free(exe2);
929         return EINA_FALSE;
930      }
931    free(exe2);
932    return EINA_TRUE;
933 #else
934    (void)argc;
935    (void)argv;
936    (void)cwd;
937    return EINA_FALSE;
938 #endif
939 }
940
941 EAPI Eina_Bool
942 elm_quicklaunch_fork(int    argc,
943                      char **argv,
944                      char  *cwd,
945                      void (*postfork_func) (void *data),
946                      void  *postfork_data)
947 {
948 #ifdef HAVE_FORK
949    pid_t child;
950    int ret;
951
952    if (!qr_main)
953      {
954         int i;
955         char **args;
956
957         child = fork();
958         if (child > 0) return EINA_TRUE;
959         else if (child < 0)
960           {
961              perror("could not fork");
962              return EINA_FALSE;
963           }
964         setsid();
965         if (chdir(cwd) != 0) perror("could not chdir");
966         args = alloca((argc + 1) * sizeof(char *));
967         for (i = 0; i < argc; i++) args[i] = argv[i];
968         args[argc] = NULL;
969         WRN("%s not quicklaunch capable, fallback...", argv[0]);
970         execvp(argv[0], args);
971         ERR("failed to execute '%s': %s", argv[0], strerror(errno));
972         exit(-1);
973      }
974    child = fork();
975    if (child > 0) return EINA_TRUE;
976    else if (child < 0)
977      {
978         perror("could not fork");
979         return EINA_FALSE;
980      }
981    if (postfork_func) postfork_func(postfork_data);
982
983    ecore_fork_reset();
984    eina_main_loop_define();
985
986    if (quicklaunch_on)
987      {
988         ELM_SAFE_FREE(_elm_appname, free);
989         if ((argv) && (argv[0]))
990           _elm_appname = strdup(ecore_file_file_get(argv[0]));
991
992 #ifdef SEMI_BROKEN_QUICKLAUNCH
993         ecore_app_args_set(argc, (const char **)argv);
994         evas_init();
995         _elm_module_init();
996         _elm_config_sub_init();
997 # ifdef HAVE_ELEMENTARY_X
998           {
999              Eina_Bool init_x;
1000              const char *ev = getenv("ELM_DISPLAY");
1001              Eina_Bool have_display = !!getenv("DISPLAY");
1002
1003              if (ev) /* If ELM_DISPLAY is specified */
1004                {
1005                   if (!strcmp(ev, "x11")) /* and it is X11 */
1006                     {
1007                        if (!have_display) /* if there is no $DISPLAY */
1008                          {
1009                             ERR("$ELM_DISPLAY is set to x11 but $DISPLAY"
1010                                 " is not set");
1011                             init_x = EINA_FALSE;
1012                          }
1013                        else /* if there is */
1014                          init_x = EINA_TRUE;
1015                     }
1016                   else /* not X11 */
1017                     init_x = EINA_FALSE;
1018                }
1019              else /* ELM_DISPLAY not specified */
1020                {
1021                   if (have_display) /* If there is a $DISPLAY */
1022                     init_x = EINA_TRUE;
1023                   else /* No $DISPLAY */
1024                     init_x = EINA_FALSE;
1025                }
1026              if (init_x)
1027                ecore_x_init(NULL);
1028           }
1029 # endif
1030         ecore_evas_init(); // FIXME: check errors
1031         ecore_imf_init();
1032 #endif
1033      }
1034
1035    setsid();
1036    if (chdir(cwd) != 0) perror("could not chdir");
1037    ecore_app_args_set(argc, (const char **)argv);
1038    if (_elm_config->atspi_mode != ELM_ATSPI_MODE_OFF)
1039      _elm_atspi_bridge_init();
1040    ret = qr_main(argc, argv);
1041    exit(ret);
1042    return EINA_TRUE;
1043 #else
1044    return EINA_FALSE;
1045    (void)argc;
1046    (void)argv;
1047    (void)cwd;
1048    (void)postfork_func;
1049    (void)postfork_data;
1050 #endif
1051 }
1052
1053 EAPI void
1054 elm_quicklaunch_cleanup(void)
1055 {
1056 #ifdef HAVE_FORK
1057    if (qr_handle)
1058      {
1059         dlclose(qr_handle);
1060         qr_handle = NULL;
1061         qr_main = NULL;
1062      }
1063 #endif
1064 }
1065
1066 EAPI int
1067 elm_quicklaunch_fallback(int    argc,
1068                          char **argv)
1069 {
1070    int ret;
1071    char cwd[PATH_MAX];
1072    elm_quicklaunch_init(argc, argv);
1073    elm_quicklaunch_sub_init(argc, argv);
1074    elm_quicklaunch_prepare(argc, argv, getcwd(cwd, sizeof(cwd)));
1075    ret = qr_main(argc, argv);
1076    exit(ret);
1077    return ret;
1078 }
1079
1080 EAPI char *
1081 elm_quicklaunch_exe_path_get(const char *exe, const char *cwd)
1082 {
1083    static char *path = NULL;
1084    static Eina_List *pathlist = NULL;
1085    const char *pathitr;
1086    const Eina_List *l;
1087    char buf[PATH_MAX];
1088    if (exe[0] == '/') return strdup(exe);
1089    if (cwd)
1090      pathlist = eina_list_append(pathlist, eina_stringshare_add(cwd));
1091    else
1092      {
1093         if ((exe[0] == '.') && (exe[1] == '/')) return strdup(exe);
1094         if ((exe[0] == '.') && (exe[1] == '.') && (exe[2] == '/')) return strdup(exe);
1095      }
1096    if (!path)
1097      {
1098         const char *p, *pp;
1099         char *buf2;
1100         path = getenv("PATH");
1101         buf2 = alloca(strlen(path) + 1);
1102         p = path;
1103         pp = p;
1104         for (;; )
1105           {
1106              if ((*p == ':') || (!*p))
1107                {
1108                   int len;
1109
1110                   len = p - pp;
1111                   strncpy(buf2, pp, len);
1112                   buf2[len] = 0;
1113                   pathlist = eina_list_append(pathlist, eina_stringshare_add(buf2));
1114                   if (!*p) break;
1115                   p++;
1116                   pp = p;
1117                }
1118              else
1119                {
1120                   if (!*p) break;
1121                   p++;
1122                }
1123           }
1124      }
1125    EINA_LIST_FOREACH(pathlist, l, pathitr)
1126      {
1127         snprintf(buf, sizeof(buf), "%s/%s", pathitr, exe);
1128         if (!access(buf, R_OK | X_OK)) return strdup(buf);
1129      }
1130    return NULL;
1131 }
1132
1133 EAPI void
1134 elm_run(void)
1135 {
1136    if (_elm_config->atspi_mode != ELM_ATSPI_MODE_OFF)
1137      _elm_atspi_bridge_init();
1138    ecore_main_loop_begin();
1139 }
1140
1141 EAPI void
1142 elm_exit(void)
1143 {
1144    if (_elm_config->atspi_mode != ELM_ATSPI_MODE_OFF)
1145      _elm_atspi_bridge_shutdown();
1146
1147    ecore_main_loop_quit();
1148
1149    if (elm_policy_get(ELM_POLICY_EXIT) == ELM_POLICY_EXIT_WINDOWS_DEL)
1150      {
1151         Eina_List *l, *l_next;
1152         Evas_Object *win;
1153
1154         EINA_LIST_FOREACH_SAFE(_elm_win_list, l, l_next, win)
1155           evas_object_del(win);
1156      }
1157 }
1158
1159 //FIXME: Use Elm_Policy Parameter when 2.0 is released.
1160 EAPI Eina_Bool
1161 elm_policy_set(unsigned int policy,
1162                int          value)
1163 {
1164    Elm_Event_Policy_Changed *ev;
1165
1166    if (policy >= ELM_POLICY_LAST)
1167      return EINA_FALSE;
1168
1169    if (value == _elm_policies[policy])
1170      return EINA_TRUE;
1171
1172    /* TODO: validate policy? */
1173
1174    ev = malloc(sizeof(*ev));
1175    ev->policy = policy;
1176    ev->new_value = value;
1177    ev->old_value = _elm_policies[policy];
1178
1179    _elm_policies[policy] = value;
1180
1181    ecore_event_add(ELM_EVENT_POLICY_CHANGED, ev, NULL, NULL);
1182
1183    return EINA_TRUE;
1184 }
1185
1186 //FIXME: Use Elm_Policy Parameter when 2.0 is released.
1187 EAPI int
1188 elm_policy_get(unsigned int policy)
1189 {
1190    if (policy >= ELM_POLICY_LAST)
1191      return 0;
1192    return _elm_policies[policy];
1193 }
1194
1195 EAPI void
1196 elm_language_set(const char *lang)
1197 {
1198    setlocale(LC_ALL, lang);
1199    evas_language_reinit();
1200    _elm_win_translate();
1201 }
1202
1203 EAPI Eina_Bool
1204 elm_object_mirrored_get(const Evas_Object *obj)
1205 {
1206    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1207    return elm_widget_mirrored_get(obj);
1208 }
1209
1210 EAPI void
1211 elm_object_mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
1212 {
1213    EINA_SAFETY_ON_NULL_RETURN(obj);
1214    elm_widget_mirrored_set(obj, mirrored);
1215 }
1216
1217 EAPI Eina_Bool
1218 elm_object_mirrored_automatic_get(const Evas_Object *obj)
1219 {
1220    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1221    return elm_widget_mirrored_automatic_get(obj);
1222 }
1223
1224 EAPI void
1225 elm_object_mirrored_automatic_set(Evas_Object *obj, Eina_Bool automatic)
1226 {
1227    EINA_SAFETY_ON_NULL_RETURN(obj);
1228    elm_widget_mirrored_automatic_set(obj, automatic);
1229 }
1230
1231 /**
1232  * @}
1233  */
1234
1235 EAPI void
1236 elm_object_scale_set(Evas_Object *obj,
1237                      double       scale)
1238 {
1239    EINA_SAFETY_ON_NULL_RETURN(obj);
1240    elm_widget_scale_set(obj, scale);
1241 }
1242
1243 EAPI double
1244 elm_object_scale_get(const Evas_Object *obj)
1245 {
1246    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, 0.0);
1247    return elm_widget_scale_get(obj);
1248 }
1249
1250 EAPI void
1251 elm_object_part_text_set(Evas_Object *obj, const char *part, const char *label)
1252 {
1253    EINA_SAFETY_ON_NULL_RETURN(obj);
1254    elm_widget_part_text_set(obj, part, label);
1255 }
1256
1257 EAPI const char *
1258 elm_object_part_text_get(const Evas_Object *obj, const char *part)
1259 {
1260    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1261    return elm_widget_part_text_get(obj, part);
1262 }
1263
1264 EAPI void
1265 elm_object_domain_translatable_part_text_set(Evas_Object *obj, const char *part, const char *domain, const char *text)
1266 {
1267    EINA_SAFETY_ON_NULL_RETURN(obj);
1268    elm_widget_domain_translatable_part_text_set(obj, part, domain, text);
1269 }
1270
1271 EAPI const char *
1272 elm_object_translatable_part_text_get(const Evas_Object *obj, const char *part)
1273 {
1274    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1275    return elm_widget_translatable_part_text_get(obj, part);
1276 }
1277
1278 EAPI void
1279 elm_object_domain_part_text_translatable_set(Evas_Object *obj, const char *part, const char *domain, Eina_Bool translatable)
1280 {
1281    EINA_SAFETY_ON_NULL_RETURN(obj);
1282    elm_widget_domain_part_text_translatable_set(obj, part, domain, translatable);
1283 }
1284
1285 EINA_DEPRECATED EAPI void
1286 elm_object_domain_translatable_text_part_set(Evas_Object *obj, const char *part, const char *domain, const char *text)
1287 {
1288    elm_object_domain_translatable_part_text_set(obj, part, domain, text);
1289 }
1290
1291 EINA_DEPRECATED EAPI const char *
1292 elm_object_translatable_text_part_get(const Evas_Object *obj, const char *part)
1293 {
1294    return elm_object_translatable_part_text_get(obj, part);
1295 }
1296
1297 EAPI void
1298 elm_object_part_content_set(Evas_Object *obj, const char *part, Evas_Object *content)
1299 {
1300    EINA_SAFETY_ON_NULL_RETURN(obj);
1301    elm_widget_content_part_set(obj, part, content);
1302 }
1303
1304 EAPI Evas_Object *
1305 elm_object_part_content_get(const Evas_Object *obj, const char *part)
1306 {
1307    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1308    return elm_widget_content_part_get(obj, part);
1309 }
1310
1311 EAPI Evas_Object *
1312 elm_object_part_content_unset(Evas_Object *obj, const char *part)
1313 {
1314    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1315    return elm_widget_content_part_unset(obj, part);
1316 }
1317
1318 EAPI Eina_Bool
1319 elm_object_style_set(Evas_Object *obj,
1320                      const char  *style)
1321 {
1322    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1323    if (elm_widget_style_set(obj, style))
1324      return EINA_TRUE;
1325    return EINA_FALSE;
1326 }
1327
1328 EAPI Eina_Bool
1329 elm_object_focus_highlight_style_set(Evas_Object *obj,
1330                                      const char  *style)
1331 {
1332    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1333    return elm_widget_focus_highlight_style_set(obj, style);
1334 }
1335
1336 EAPI const char *
1337 elm_object_focus_highlight_style_get(const Evas_Object *obj)
1338 {
1339    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1340    return elm_widget_focus_highlight_style_get(obj);
1341 }
1342
1343 EAPI const char *
1344 elm_object_style_get(const Evas_Object *obj)
1345 {
1346    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1347    return elm_widget_style_get(obj);
1348 }
1349
1350 EAPI void
1351 elm_object_disabled_set(Evas_Object *obj,
1352                         Eina_Bool    disabled)
1353 {
1354    EINA_SAFETY_ON_NULL_RETURN(obj);
1355    elm_widget_disabled_set(obj, disabled);
1356 }
1357
1358 EAPI Eina_Bool
1359 elm_object_disabled_get(const Evas_Object *obj)
1360 {
1361    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1362    return elm_widget_disabled_get(obj);
1363 }
1364
1365 EAPI void
1366 elm_cache_all_flush(void)
1367 {
1368    const Eina_List *l;
1369    Evas_Object *obj;
1370
1371    edje_file_cache_flush();
1372    edje_collection_cache_flush();
1373    eet_clearcache();
1374    EINA_LIST_FOREACH(_elm_win_list, l, obj)
1375      {
1376         Evas *e = evas_object_evas_get(obj);
1377         evas_image_cache_flush(e);
1378         evas_font_cache_flush(e);
1379         evas_render_dump(e);
1380      }
1381 }
1382
1383 EAPI Eina_Bool
1384 elm_object_focus_get(const Evas_Object *obj)
1385 {
1386    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1387    return elm_widget_focus_get(obj);
1388 }
1389
1390 EAPI void
1391 elm_object_focus_set(Evas_Object *obj,
1392                      Eina_Bool    focus)
1393 {
1394    EINA_SAFETY_ON_NULL_RETURN(obj);
1395
1396    if (elm_widget_is(obj))
1397      {
1398         if (focus == elm_widget_focus_get(obj)) return;
1399
1400         // ugly, but, special case for inlined windows
1401         if (eo_isa(obj, ELM_WIN_CLASS))
1402           {
1403              Evas_Object *inlined = elm_win_inlined_image_object_get(obj);
1404
1405              if (inlined)
1406                {
1407                   evas_object_focus_set(inlined, focus);
1408                   return;
1409                }
1410           }
1411         if (focus)
1412           elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
1413         else
1414           elm_widget_focused_object_clear(obj);
1415      }
1416    else
1417      {
1418         evas_object_focus_set(obj, focus);
1419      }
1420 }
1421
1422 EAPI void
1423 elm_object_focus_allow_set(Evas_Object *obj,
1424                            Eina_Bool    enable)
1425 {
1426    EINA_SAFETY_ON_NULL_RETURN(obj);
1427    elm_widget_can_focus_set(obj, enable);
1428 }
1429
1430 EAPI Eina_Bool
1431 elm_object_focus_allow_get(const Evas_Object *obj)
1432 {
1433    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1434    return (elm_widget_can_focus_get(obj)) || (elm_widget_child_can_focus_get(obj));
1435 }
1436
1437 EAPI void
1438 elm_object_focus_custom_chain_set(Evas_Object *obj,
1439                                   Eina_List   *objs)
1440 {
1441    EINA_SAFETY_ON_NULL_RETURN(obj);
1442    elm_widget_focus_custom_chain_set(obj, objs);
1443 }
1444
1445 EAPI void
1446 elm_object_focus_custom_chain_unset(Evas_Object *obj)
1447 {
1448    EINA_SAFETY_ON_NULL_RETURN(obj);
1449    elm_widget_focus_custom_chain_unset(obj);
1450 }
1451
1452 EAPI const Eina_List *
1453 elm_object_focus_custom_chain_get(const Evas_Object *obj)
1454 {
1455    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1456    return elm_widget_focus_custom_chain_get(obj);
1457 }
1458
1459 EAPI void
1460 elm_object_focus_custom_chain_append(Evas_Object *obj,
1461                                      Evas_Object *child,
1462                                      Evas_Object *relative_child)
1463 {
1464    EINA_SAFETY_ON_NULL_RETURN(obj);
1465    elm_widget_focus_custom_chain_append(obj, child, relative_child);
1466 }
1467
1468 EAPI void
1469 elm_object_focus_custom_chain_prepend(Evas_Object *obj,
1470                                       Evas_Object *child,
1471                                       Evas_Object *relative_child)
1472 {
1473    EINA_SAFETY_ON_NULL_RETURN(obj);
1474    elm_widget_focus_custom_chain_prepend(obj, child, relative_child);
1475 }
1476
1477 EINA_DEPRECATED EAPI void
1478 elm_object_focus_cycle(Evas_Object        *obj,
1479                        Elm_Focus_Direction dir)
1480 {
1481    elm_object_focus_next(obj, dir);
1482 }
1483
1484 EAPI void
1485 elm_object_focus_next(Evas_Object        *obj,
1486                       Elm_Focus_Direction dir)
1487 {
1488    EINA_SAFETY_ON_NULL_RETURN(obj);
1489    elm_widget_focus_cycle(obj, dir);
1490 }
1491
1492 EAPI Evas_Object *
1493 elm_object_focus_next_object_get(const Evas_Object  *obj,
1494                                  Elm_Focus_Direction dir)
1495 {
1496    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1497    return elm_widget_focus_next_object_get(obj, dir);
1498 }
1499
1500 EAPI void
1501 elm_object_focus_next_object_set(Evas_Object        *obj,
1502                                  Evas_Object        *next,
1503                                  Elm_Focus_Direction dir)
1504 {
1505    EINA_SAFETY_ON_NULL_RETURN(obj);
1506    elm_widget_focus_next_object_set(obj, next, dir);
1507 }
1508
1509 EAPI Elm_Object_Item *
1510 elm_object_focus_next_item_get(const Evas_Object  *obj,
1511                                Elm_Focus_Direction dir)
1512 {
1513    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1514    return elm_widget_focus_next_item_get(obj, dir);
1515 }
1516
1517 EAPI void
1518 elm_object_focus_next_item_set(Evas_Object     *obj,
1519                                Elm_Object_Item *next_item,
1520                                Elm_Focus_Direction dir)
1521 {
1522    EINA_SAFETY_ON_NULL_RETURN(obj);
1523    elm_widget_focus_next_item_set(obj, next_item, dir);
1524 }
1525
1526 EAPI Evas_Object *
1527 elm_object_focused_object_get(const Evas_Object *obj)
1528 {
1529    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1530    return elm_widget_focused_object_get(obj);
1531 }
1532
1533 EAPI void
1534 elm_object_tree_focus_allow_set(Evas_Object *obj,
1535                                 Eina_Bool    tree_focusable)
1536 {
1537    EINA_SAFETY_ON_NULL_RETURN(obj);
1538    elm_widget_tree_unfocusable_set(obj, !tree_focusable);
1539 }
1540
1541 EAPI Eina_Bool
1542 elm_object_tree_focus_allow_get(const Evas_Object *obj)
1543 {
1544    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1545    return !elm_widget_tree_unfocusable_get(obj);
1546 }
1547
1548 EAPI void
1549 elm_object_focus_move_policy_set(Evas_Object *obj,
1550                                  Elm_Focus_Move_Policy policy)
1551 {
1552    EINA_SAFETY_ON_NULL_RETURN(obj);
1553    elm_widget_focus_move_policy_set(obj, policy);
1554 }
1555
1556 EAPI Elm_Focus_Move_Policy
1557 elm_object_focus_move_policy_get(const Evas_Object *obj)
1558 {
1559    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1560    return elm_widget_focus_move_policy_get(obj);
1561 }
1562
1563 EAPI Eina_Bool
1564 elm_object_focus_move_policy_automatic_get(const Evas_Object *obj)
1565 {
1566    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1567    return elm_widget_focus_move_policy_automatic_get(obj);
1568 }
1569
1570 EAPI void
1571 elm_object_focus_move_policy_automatic_set(Evas_Object *obj, Eina_Bool automatic)
1572 {
1573    EINA_SAFETY_ON_NULL_RETURN(obj);
1574    elm_widget_focus_move_policy_automatic_set(obj, automatic);
1575 }
1576
1577 EAPI void
1578 elm_object_scroll_hold_push(Evas_Object *obj)
1579 {
1580    EINA_SAFETY_ON_NULL_RETURN(obj);
1581    elm_widget_scroll_hold_push(obj);
1582 }
1583
1584 EAPI void
1585 elm_object_scroll_hold_pop(Evas_Object *obj)
1586 {
1587    EINA_SAFETY_ON_NULL_RETURN(obj);
1588    elm_widget_scroll_hold_pop(obj);
1589 }
1590
1591 EAPI int
1592 elm_object_scroll_hold_get(const Evas_Object *obj)
1593 {
1594    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, 0);
1595    return elm_widget_scroll_hold_get(obj);
1596 }
1597
1598 EAPI void
1599 elm_object_scroll_freeze_push(Evas_Object *obj)
1600 {
1601    EINA_SAFETY_ON_NULL_RETURN(obj);
1602    elm_widget_scroll_freeze_push(obj);
1603 }
1604
1605 EAPI void
1606 elm_object_scroll_freeze_pop(Evas_Object *obj)
1607 {
1608    EINA_SAFETY_ON_NULL_RETURN(obj);
1609    elm_widget_scroll_freeze_pop(obj);
1610 }
1611
1612 EAPI int
1613 elm_object_scroll_freeze_get(const Evas_Object *obj)
1614 {
1615    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, 0);
1616    return elm_widget_scroll_freeze_get(obj);
1617 }
1618
1619 EAPI void
1620 elm_object_scroll_lock_x_set(Evas_Object *obj,
1621                              Eina_Bool    lock)
1622 {
1623    EINA_SAFETY_ON_NULL_RETURN(obj);
1624    elm_widget_drag_lock_x_set(obj, lock);
1625 }
1626
1627 EAPI void
1628 elm_object_scroll_lock_y_set(Evas_Object *obj,
1629                              Eina_Bool    lock)
1630 {
1631    EINA_SAFETY_ON_NULL_RETURN(obj);
1632    elm_widget_drag_lock_y_set(obj, lock);
1633 }
1634
1635 EAPI Eina_Bool
1636 elm_object_scroll_lock_x_get(const Evas_Object *obj)
1637 {
1638    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1639    return elm_widget_drag_lock_x_get(obj);
1640 }
1641
1642 EAPI Eina_Bool
1643 elm_object_scroll_lock_y_get(const Evas_Object *obj)
1644 {
1645    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1646    return elm_widget_drag_lock_y_get(obj);
1647 }
1648
1649 EAPI void
1650 elm_object_scroll_item_loop_enabled_set(Evas_Object *obj,
1651                                         Eina_Bool   enable)
1652 {
1653    EINA_SAFETY_ON_NULL_RETURN(obj);
1654    elm_widget_item_loop_enabled_set(obj, enable);
1655 }
1656
1657 EAPI Eina_Bool
1658 elm_object_scroll_item_loop_enabled_get(const Evas_Object *obj)
1659 {
1660    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1661    return elm_widget_item_loop_enabled_get(obj);
1662 }
1663
1664 // TIZEN_ONLY(20150705): Genlist item align feature
1665 EAPI void
1666 elm_object_scroll_item_align_enabled_set(Evas_Object *obj,
1667                                          Eina_Bool scroll_item_align_enable)
1668 {
1669    EINA_SAFETY_ON_NULL_RETURN(obj);
1670    elm_widget_scroll_item_align_enabled_set(obj, scroll_item_align_enable);
1671 }
1672
1673 EAPI Eina_Bool
1674 elm_object_scroll_item_align_enabled_get(const Evas_Object *obj)
1675 {
1676    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1677    return elm_widget_scroll_item_align_enabled_get(obj);
1678 }
1679
1680 EAPI void
1681 elm_object_scroll_item_valign_set(Evas_Object *obj,
1682                                   const char *scroll_item_valign)
1683 {
1684    EINA_SAFETY_ON_NULL_RETURN(obj);
1685    elm_widget_scroll_item_valign_set(obj, scroll_item_valign);
1686 }
1687
1688 EAPI const char*
1689 elm_object_scroll_item_valign_get(const Evas_Object *obj)
1690 {
1691    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1692    return  elm_widget_scroll_item_valign_get(obj);
1693 }
1694 //
1695
1696 EAPI Eina_Bool
1697 elm_object_widget_check(const Evas_Object *obj)
1698 {
1699    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
1700    return elm_widget_is(obj);
1701 }
1702
1703 EAPI Evas_Object *
1704 elm_object_parent_widget_get(const Evas_Object *obj)
1705 {
1706    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1707    return elm_widget_parent_widget_get(obj);
1708 }
1709
1710 EAPI Evas_Object *
1711 elm_object_top_widget_get(const Evas_Object *obj)
1712 {
1713    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1714    return elm_widget_top_get(obj);
1715 }
1716
1717 EAPI const char *
1718 elm_object_widget_type_get(const Evas_Object *obj)
1719 {
1720    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1721    return elm_widget_type_get(obj);
1722 }
1723
1724 EAPI void
1725 elm_object_signal_emit(Evas_Object *obj,
1726                        const char  *emission,
1727                        const char  *source)
1728 {
1729    EINA_SAFETY_ON_NULL_RETURN(obj);
1730    elm_widget_signal_emit(obj, emission, source);
1731 }
1732
1733 EAPI void
1734 elm_object_signal_callback_add(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data)
1735 {
1736     EINA_SAFETY_ON_NULL_RETURN(obj);
1737     EINA_SAFETY_ON_NULL_RETURN(func);
1738     elm_widget_signal_callback_add(obj, emission, source, func, data);
1739 }
1740
1741 EAPI void *
1742 elm_object_signal_callback_del(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func)
1743 {
1744     EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1745     EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
1746     return elm_widget_signal_callback_del(obj, emission, source, func);
1747 }
1748
1749 EAPI void
1750 elm_object_event_callback_add(Evas_Object *obj, Elm_Event_Cb func, const void *data)
1751 {
1752    EINA_SAFETY_ON_NULL_RETURN(obj);
1753    EINA_SAFETY_ON_NULL_RETURN(func);
1754    elm_widget_event_callback_add(obj, func, data);
1755 }
1756
1757 EAPI void *
1758 elm_object_event_callback_del(Evas_Object *obj, Elm_Event_Cb func, const void *data)
1759 {
1760    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1761    EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
1762    return elm_widget_event_callback_del(obj, func, data);
1763 }
1764
1765 EAPI void
1766 elm_object_tree_dump(const Evas_Object *top)
1767 {
1768 #ifdef ELM_DEBUG
1769    elm_widget_tree_dump(top);
1770 #else
1771    (void)top;
1772    return;
1773 #endif
1774 }
1775
1776 EAPI void
1777 elm_object_tree_dot_dump(const Evas_Object *top,
1778                          const char        *file)
1779 {
1780 #ifdef ELM_DEBUG
1781    FILE *f = fopen(file, "wb");
1782    elm_widget_tree_dot_dump(top, f);
1783    fclose(f);
1784 #else
1785    (void)top;
1786    (void)file;
1787    return;
1788 #endif
1789 }
1790
1791 EAPI void
1792 elm_coords_finger_size_adjust(int times_w,
1793                               Evas_Coord *w,
1794                               int times_h,
1795                               Evas_Coord *h)
1796 {
1797    if ((w) && (*w < (elm_config_finger_size_get() * times_w)))
1798      *w = elm_config_finger_size_get() * times_w;
1799    if ((h) && (*h < (elm_config_finger_size_get() * times_h)))
1800      *h = elm_config_finger_size_get() * times_h;
1801 }
1802
1803
1804 // Object item Eo migration defines, will be removed later
1805 #define IF_EO_DO(obj, func)                            \
1806        if (eo_isa(obj, ELM_WIDGET_ITEM_CLASS))   \
1807          {                                             \
1808             eo_do (obj, func);                   \
1809             return;                                    \
1810          }
1811
1812 #define IF_EO_RETURN(obj, type, func)                  \
1813        if (eo_isa(obj, ELM_WIDGET_ITEM_CLASS))   \
1814          {                                             \
1815             type ret;                                  \
1816             eo_do (obj, ret = func);             \
1817             return ret;                                \
1818          }
1819
1820 EAPI void
1821 elm_object_access_info_set(Evas_Object *obj, const char *txt)
1822 {
1823    elm_widget_access_info_set(obj, txt);
1824 }
1825
1826 EAPI const char *
1827 elm_object_access_info_get(Evas_Object *obj)
1828 {
1829    return elm_widget_access_info_get(obj);
1830 }
1831
1832 EAPI Evas_Object *
1833 elm_object_name_find(const Evas_Object *obj, const char *name, int recurse)
1834 {
1835    return elm_widget_name_find(obj, name, recurse);
1836 }
1837
1838 EAPI void
1839 elm_object_orientation_mode_disabled_set(Evas_Object *obj, Eina_Bool disabled)
1840 {
1841    elm_widget_orientation_mode_disabled_set(obj, disabled);
1842 }
1843
1844 EAPI Eina_Bool
1845 elm_object_orientation_mode_disabled_get(const Evas_Object *obj)
1846 {
1847    return elm_widget_orientation_mode_disabled_get(obj);
1848 }
1849
1850 EAPI Elm_Object_Item *
1851 elm_object_focused_item_get(const Evas_Object *obj)
1852 {
1853    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1854    return elm_widget_focused_item_get(obj);
1855 }
1856
1857 EAPI void
1858 elm_object_focus_region_show_mode_set(Evas_Object *obj, Elm_Focus_Region_Show_Mode mode)
1859 {
1860    elm_widget_focus_region_show_mode_set(obj, mode);
1861 }
1862
1863 EAPI Elm_Focus_Region_Show_Mode
1864 elm_object_focus_region_show_mode_get(const Evas_Object *obj)
1865 {
1866    return elm_widget_focus_region_show_mode_get(obj);
1867 }
1868
1869 EAPI Evas_Object *
1870 elm_object_part_access_register(Evas_Object *obj, const char *part)
1871 {
1872    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1873    EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
1874    if (!evas_object_smart_type_check(obj, "elm_layout"))
1875      {
1876         ERR("Only for parts of a layout, access object can be registered");
1877         return NULL;
1878      }
1879
1880    Evas_Object *edj = elm_layout_edje_get(obj);
1881    return _elm_access_edje_object_part_object_register(obj, edj, part);
1882 }
1883
1884 //TIZEN_ONLY(20160726): add API elm_object_part_access_object_get
1885 EAPI Evas_Object *elm_object_part_access_object_get(const Evas_Object *obj, const char *part)
1886 {
1887    EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
1888    return elm_widget_part_access_object_get(obj, part);
1889 }
1890 //
1891
1892 void *
1893 _elm_object_accessibility_currently_highlighted_get(void)
1894 {
1895    return _accessibility_currently_highlighted_obj;
1896 }
1897
1898 //TIZEN_ONLY(20160329): win: add accessibility highlight (d4753268ad02d0c25c16f815003c70b158879ca7)
1899 void
1900 elm_object_accessibility_highlight_set(void *obj, Eina_Bool visible)
1901 {
1902    EINA_SAFETY_ON_NULL_RETURN(obj);
1903    Evas_Object *win = NULL;
1904    Evas_Object *target = NULL;
1905
1906    if (eo_isa(obj, ELM_WIDGET_ITEM_CLASS))
1907      {
1908         Elm_Widget_Item_Data *id = eo_data_scope_get(obj, ELM_WIDGET_ITEM_CLASS);
1909         target = id->view;
1910      }
1911    else
1912      target = obj;
1913
1914    if (elm_object_widget_check(target))
1915       win = elm_object_top_widget_get(target);
1916    else
1917       win = elm_object_top_widget_get(elm_object_parent_widget_get(target));
1918    EINA_SAFETY_ON_NULL_RETURN(win);
1919
1920    if (_accessibility_currently_highlighted_obj == (void*)obj)
1921      {
1922         if (!visible)
1923           _accessibility_currently_highlighted_obj = NULL;
1924      }
1925    else
1926      {
1927         if (visible)
1928           _accessibility_currently_highlighted_obj = obj;
1929      }
1930
1931    if (eo_isa(target, ELM_LAYOUT_CLASS) && elm_widget_access_highlight_in_theme_get(target))
1932      {
1933        if (visible)
1934          {
1935            elm_widget_signal_emit(target, "elm,action,access_highlight,show", "elm");
1936          }
1937        else
1938          {
1939            elm_widget_signal_emit(target, "elm,action,access_highlight,hide", "elm");
1940          }
1941      }
1942    else
1943      {
1944         _elm_win_object_set_accessibility_highlight(win, target, visible);
1945      }
1946 }
1947 //
1948
1949 //TIZEN_ONLY(20161013): clean up elm color class feature
1950 EAPI Eina_Bool
1951 elm_color_class_color_set(const char *color_class, int r, int g, int b, int a)
1952 {
1953    Eina_Bool int_ret = EINA_FALSE;
1954    int r2 = 0, g2 = 0, b2 = 0, a2 = 0, r3 = 0, g3 = 0, b3 = 0, a3 = 0;
1955
1956    _elm_color_unpremul(a, &r, &g, &b);
1957
1958    edje_color_class_get(color_class, NULL, NULL, NULL, NULL, &r2, &g2, &b2, &a2, &r3, &g3, &b3, &a3);
1959    int_ret = edje_color_class_set(color_class, r, g, b, a, r2, g2, b2, a2, r3, g3, b3, a3);
1960
1961    return int_ret;
1962 }
1963
1964 EAPI Eina_Bool
1965 elm_color_class_color_get(const char *color_class, int *r, int *g, int *b, int *a)
1966 {
1967    Eina_Bool int_ret = EINA_FALSE;
1968    int alpha = 0;
1969
1970    int_ret = edje_color_class_get(color_class, r, g, b, &alpha, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
1971    if (a) *a = alpha;
1972
1973    _elm_color_premul(alpha, r, g, b);
1974
1975    return int_ret;
1976 }
1977
1978 EAPI Eina_Bool
1979 elm_color_class_color2_set(const char *color_class, int r, int g, int b, int a)
1980 {
1981    Eina_Bool int_ret = EINA_FALSE;
1982    int r2 = 0, g2 = 0, b2 = 0, a2 = 0, r3 = 0, g3 = 0, b3 = 0, a3 = 0;
1983
1984    _elm_color_unpremul(a, &r, &g, &b);
1985
1986    edje_color_class_get(color_class, &r2, &g2, &b2, &a2, NULL, NULL, NULL, NULL, &r3, &g3, &b3, &a3);
1987    int_ret = edje_color_class_set(color_class, r2, g2, b2, a2, r, g, b, a, r3, g3, b3, a3);
1988
1989    return int_ret;
1990 }
1991
1992 EAPI Eina_Bool
1993 elm_color_class_color2_get(const char *color_class, int *r, int *g, int *b, int *a)
1994 {
1995    Eina_Bool int_ret = EINA_FALSE;
1996    int alpha = 0;
1997
1998    int_ret = edje_color_class_get(color_class, NULL, NULL, NULL, NULL, r, g, b, &alpha, NULL, NULL, NULL, NULL);
1999    if (a) *a = alpha;
2000
2001    _elm_color_premul(alpha, r, g, b);
2002
2003    return int_ret;
2004 }
2005
2006 EAPI Eina_Bool
2007 elm_color_class_color3_set(const char *color_class, int r, int g, int b, int a)
2008 {
2009    Eina_Bool int_ret = EINA_FALSE;
2010    int r2 = 0, g2 = 0, b2 = 0, a2 = 0, r3 = 0, g3 = 0, b3 = 0, a3 = 0;
2011
2012    _elm_color_unpremul(a, &r, &g, &b);
2013
2014    edje_color_class_get(color_class, &r2, &g2, &b2, &a2, &r3, &g3, &b3, &a3, NULL, NULL, NULL, NULL);
2015    int_ret = edje_color_class_set(color_class, r2, g2, b2, a2, r3, g3, b3, a3, r, g, b, a);
2016
2017    return int_ret;
2018 }
2019
2020 EAPI Eina_Bool
2021 elm_color_class_color3_get(const char *color_class, int *r, int *g, int *b, int *a)
2022 {
2023    Eina_Bool int_ret = EINA_FALSE;
2024    int alpha = 0;
2025
2026    int_ret = edje_color_class_get(color_class, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, r, g, b, &alpha);
2027    if (a) *a = alpha;
2028
2029    _elm_color_premul(alpha, r, g, b);
2030
2031    return int_ret;
2032 }
2033
2034 EAPI void
2035 elm_color_class_del(const char *color_class)
2036 {
2037    edje_color_class_del(color_class);
2038 }
2039
2040 EAPI Eina_Bool
2041 elm_object_color_class_color_set(Evas_Object *obj, const char *color_class, int r, int g, int b, int a)
2042 {
2043    Eina_Bool int_ret = EINA_FALSE;
2044
2045    return eo_do_ret(obj, int_ret, elm_obj_widget_class_color_set(color_class, r, g, b, a));
2046 }
2047
2048 EAPI Eina_Bool
2049 elm_object_color_class_color_get(Evas_Object *obj, const char *color_class, int *r, int *g, int *b, int *a)
2050 {
2051    Eina_Bool int_ret = EINA_FALSE;
2052
2053    return eo_do_ret(obj, int_ret, elm_obj_widget_class_color_get(color_class, r, g, b, a));
2054 }
2055
2056 EAPI Eina_Bool
2057 elm_object_color_class_color2_set(Evas_Object *obj, const char *color_class, int r, int g, int b, int a)
2058 {
2059    Eina_Bool int_ret = EINA_FALSE;
2060
2061    return eo_do_ret(obj, int_ret, elm_obj_widget_class_color2_set(color_class, r, g, b, a));
2062 }
2063
2064 EAPI Eina_Bool
2065 elm_object_color_class_color2_get(Evas_Object *obj, const char *color_class, int *r, int *g, int *b, int *a)
2066 {
2067    Eina_Bool int_ret = EINA_FALSE;
2068
2069    return eo_do_ret(obj, int_ret, elm_obj_widget_class_color2_get(color_class, r, g, b, a));
2070 }
2071
2072 EAPI Eina_Bool
2073 elm_object_color_class_color3_set(Evas_Object *obj, const char *color_class, int r, int g, int b, int a)
2074 {
2075    Eina_Bool int_ret = EINA_FALSE;
2076
2077    return eo_do_ret(obj, int_ret, elm_obj_widget_class_color3_set(color_class, r, g, b, a));
2078 }
2079
2080 EAPI Eina_Bool
2081 elm_object_color_class_color3_get(Evas_Object *obj, const char *color_class, int *r, int *g, int *b, int *a)
2082 {
2083    Eina_Bool int_ret = EINA_FALSE;
2084
2085    return eo_do_ret(obj, int_ret, elm_obj_widget_class_color3_get(color_class, r, g, b, a));
2086 }
2087
2088 EAPI void
2089 elm_object_color_class_del(Evas_Object *obj, const char *color_class)
2090 {
2091    eo_do(obj, elm_obj_widget_class_color_del(color_class));
2092 }
2093
2094 EAPI void
2095 elm_object_color_class_clear(Evas_Object *obj)
2096 {
2097    eo_do(obj, elm_obj_widget_class_color_clear());
2098 }
2099 //