3 #ifdef HAVE_ELEMENTARY_X
6 #ifdef HAVE_ELEMENTARY_FB
9 #ifdef HAVE_ELEMENTARY_WAYLAND
10 #include <Ecore_Wayland.h>
12 #ifdef HAVE_ELEMENTARY_DRM
13 #include <Ecore_Drm.h>
23 # ifdef ELEMENTARY_BUILD
25 # define EAPI __declspec(dllexport)
28 # endif /* ! DLL_EXPORT */
30 # define EAPI __declspec(dllimport)
31 # endif /* ! EFL_EVAS_BUILD */
35 # define EAPI __attribute__ ((visibility("default")))
44 #include "elm_widget.h"
46 #ifdef HAVE_LANGINFO_H
47 # include <langinfo.h>
50 #define CRI(...) EINA_LOG_DOM_CRIT(_elm_log_dom, __VA_ARGS__)
51 #define ERR(...) EINA_LOG_DOM_ERR(_elm_log_dom, __VA_ARGS__)
52 #define WRN(...) EINA_LOG_DOM_WARN(_elm_log_dom, __VA_ARGS__)
53 #define INF(...) EINA_LOG_DOM_INFO(_elm_log_dom, __VA_ARGS__)
54 #define DBG(...) EINA_LOG_DOM_DBG(_elm_log_dom, __VA_ARGS__)
58 # define E_(string) _elm_dgettext(string)
61 # define setlocale(c, l)
63 # ifndef libintl_setlocale
64 # define libintl_setlocale(c, l)
66 # ifndef bindtextdomain
67 # define bindtextdomain(domain, dir)
69 # ifndef libintl_bindtextdomain
70 # define libintl_bindtextdomain(domain, dir)
72 # define E_(string) (string)
74 #define N_(string) (string)
76 typedef struct _Elm_Theme_Files Elm_Theme_Files;
77 typedef struct _Edje_Signal_Data Edje_Signal_Data;
78 typedef struct _Elm_Config Elm_Config;
79 typedef struct _Elm_Config_Bindings_Widget Elm_Config_Bindings_Widget;
80 typedef struct _Elm_Config_Binding_Key Elm_Config_Binding_Key;
81 typedef struct _Elm_Config_Binding_Modifier Elm_Config_Binding_Modifier;
82 typedef struct _Elm_Module Elm_Module;
84 struct _Edje_Signal_Data
93 struct _Elm_Theme_Files
96 * We are conserving a list of path even if that's duplicated
97 * because we expose those directly to the outside world :'(
105 Elm_Theme_Files overlay;
106 Elm_Theme_Files themes;
107 Elm_Theme_Files extension;
110 Eina_Hash *cache_data;
111 Elm_Theme *ref_theme;
112 Eina_List *referrers;
115 Eina_Hash *cache_style_load_failed;
118 /* increment this whenever we change config enough that you need new
119 * defaults for elm to work.
121 #define ELM_CONFIG_EPOCH 0x0002
122 /* increment this whenever a new set of config values are added but
123 * the users config doesn't need to be wiped - simply new values need
126 #define ELM_CONFIG_FILE_GENERATION 0x0001
127 #define ELM_CONFIG_VERSION_EPOCH_OFFSET 16
128 #define ELM_CONFIG_VERSION ((ELM_CONFIG_EPOCH << ELM_CONFIG_VERSION_EPOCH_OFFSET) | \
129 ELM_CONFIG_FILE_GENERATION)
130 /* NB: profile configuration files (.src) must have their
131 * "config_version" entry's value up-to-date with ELM_CONFIG_VERSION
134 /* note: always remember to sync it with elm_config.c */
135 extern const char *_elm_engines[];
137 #define ELM_SOFTWARE_X11 (_elm_engines[0])
138 #define ELM_SOFTWARE_FB (_elm_engines[1])
139 #define ELM_OPENGL_X11 (_elm_engines[2])
140 #define ELM_SOFTWARE_WIN32 (_elm_engines[3])
141 #define ELM_SOFTWARE_SDL (_elm_engines[4])
142 #define ELM_OPENGL_SDL (_elm_engines[5])
143 #define ELM_BUFFER (_elm_engines[6])
144 #define ELM_EWS (_elm_engines[7])
145 #define ELM_OPENGL_COCOA (_elm_engines[8])
146 #define ELM_SOFTWARE_PSL1GHT (_elm_engines[9])
147 #define ELM_WAYLAND_SHM (_elm_engines[10])
148 #define ELM_WAYLAND_EGL (_elm_engines[11])
149 #define ELM_DRM (_elm_engines[12])
150 #define ELM_SOFTWARE_DDRAW (_elm_engines[13])
152 #define ELM_FONT_TOKEN_STYLE ":style="
154 #define ELM_ACCESS_MODE_OFF EINA_FALSE
155 #define ELM_ACCESS_MODE_ON EINA_TRUE
157 #define ELM_ATSPI_MODE_OFF EINA_FALSE
158 #define ELM_ATSPI_MODE_ON EINA_TRUE
160 /* convenience macro to compress code and avoid typos */
162 #define MIN(x, y) (((x) < (y)) ? (x) : (y))
164 #define MAX(x, y) (((x) > (y)) ? (x) : (y))
166 #define CEIL(a) (((a) % 2 != 0) ? ((a) / 2 + 1) : ((a) / 2))
169 #define ELM_SAFE_FREE(_h, _fn) do { _fn((void*)_h); _h = NULL; } while (0)
171 #define ELM_PRIV_STATIC_VARIABLE_DECLARE(name, signal, type) \
172 static const char name[] = signal;
174 #define ELM_PRIV_SMART_CALLBACKS_DESC(name, signal, type) \
182 unsigned char accel_override;
184 unsigned char thumbscroll_enable;
185 int thumbscroll_threshold;
186 int thumbscroll_hold_threshold;
187 double thumbscroll_momentum_threshold;
188 int thumbscroll_flick_distance_tolerance;
189 double thumbscroll_friction;
190 double thumbscroll_min_friction;
191 double thumbscroll_friction_standard;
192 double thumbscroll_bounce_friction;
193 double thumbscroll_acceleration_threshold;
194 double thumbscroll_acceleration_time_limit;
195 double thumbscroll_acceleration_weight;
196 double page_scroll_friction;
197 double bring_in_scroll_friction;
198 double zoom_friction;
199 unsigned char thumbscroll_bounce_enable;
200 double thumbscroll_border_friction;
201 double thumbscroll_sensitivity_friction;
202 unsigned char scroll_smooth_start_enable;
203 double scroll_smooth_time_interval;
204 double scroll_smooth_amount;
205 double scroll_smooth_history_weight;
206 double scroll_smooth_future_time;
207 double scroll_smooth_time_window;
211 Eina_List *font_dirs;
212 Eina_List *font_overlays;
214 int cache_flush_poll_interval;
215 unsigned char cache_flush_enable;
219 int edje_collection_cache;
224 double tooltip_delay;
225 unsigned char cursor_engine_only;
226 unsigned char focus_highlight_enable;
227 unsigned char focus_highlight_animate;
228 unsigned char focus_highlight_clip_disable; /**< This shows disabled status of focus highlight clip feature. This value is false by default so the focus highlight is clipped. */
229 unsigned char focus_move_policy; /**< This show how the elementary focus is moved to another object. Focus can be moved by click or mouse_in. */
230 unsigned char item_select_on_focus_disable; /**< This shows the disabled status of select on focus feature. This value is false by default so that select on focus feature is enabled by default.*/
231 unsigned char first_item_focus_on_first_focus_in; /**< This sets the first item focus on first focus in feature*/
232 Elm_Focus_Autoscroll_Mode focus_autoscroll_mode; /**< This shows the focus auto scroll mode. By default, @c ELM_FOCUS_AUTOSCROLL_MODE_SHOW is set. */
233 Elm_Slider_Indicator_Visible_Mode slider_indicator_visible_mode; /**< this sets the slider indicator visible mode */
234 //TIZEN_ONLY(20150723) add popup default align
235 double popup_horizontal_align;
236 double popup_vertical_align;
238 int toolbar_shrink_mode;
239 unsigned char fileselector_expand_enable;
240 unsigned char fileselector_double_tap_navigation_enable;
241 unsigned char inwin_dialogs_enable;
243 double longpress_timeout;
244 unsigned char effect_enable;
245 unsigned char desktop_entry;
246 unsigned char password_show_last;
247 double password_show_last_timeout;
248 unsigned char glayer_zoom_finger_enable;
249 double glayer_zoom_finger_factor;
250 double glayer_zoom_wheel_factor;
251 double glayer_zoom_distance_tolerance;
252 double glayer_rotate_finger_enable;
253 double glayer_rotate_angular_tolerance;
254 double glayer_line_min_length;
255 double glayer_line_distance_tolerance;
256 double glayer_line_angular_tolerance;
257 unsigned int glayer_flick_time_limit_ms;
258 double glayer_long_tap_start_timeout;
259 double glayer_double_tap_timeout;
260 Eina_Bool access_mode;
261 unsigned char glayer_continues_enable;
267 Eina_List *color_overlays;
268 Eina_List *color_palette;
269 unsigned char softcursor_mode;
270 unsigned char auto_norender_withdrawn;
271 unsigned char auto_norender_iconified_same_as_withdrawn;
272 unsigned char auto_flush_withdrawn;
273 unsigned char auto_dump_withdrawn;
274 unsigned char auto_throttle;
275 double auto_throttle_amount;
276 const char *indicator_service_0;
277 const char *indicator_service_90;
278 const char *indicator_service_180;
279 const char *indicator_service_270;
280 unsigned char selection_clear_enable;
281 unsigned char disable_external_menu;
282 unsigned char clouseau_enable;
283 unsigned char magnifier_enable;
284 double magnifier_scale;
285 unsigned char audio_mute_effect;
286 unsigned char audio_mute_background;
287 unsigned char audio_mute_music;
288 unsigned char audio_mute_foreground;
289 unsigned char audio_mute_interface;
290 unsigned char audio_mute_input;
291 unsigned char audio_mute_alert;
292 unsigned char audio_mute_all;
293 double transition_duration_factor;
294 unsigned char naviframe_prev_btn_auto_pushed;
296 Eina_Bool atspi_mode;
300 // TIZEN_ONLY(20150705): Genlist item align feature
301 Eina_Bool scroll_item_align_enable;
302 const char *scroll_item_valign;
305 /* Not part of the EET file */
306 Eina_Bool is_mirrored : 1;
307 Eina_Bool translate : 1;
310 struct _Elm_Config_Bindings_Widget
313 Eina_List *key_bindings;
316 struct _Elm_Config_Binding_Key
322 Eina_List *modifiers;
325 struct _Elm_Config_Binding_Modifier
337 const char *data_dir;
342 int (*init_func)(Elm_Module *m);
343 int (*shutdown_func)(Elm_Module *m);
347 Eo *_elm_atspi_bridge_get(void);
348 void _elm_atspi_bridge_init(void);
349 void _elm_atspi_bridge_shutdown(void);
351 void _elm_prefs_init(void);
352 void _elm_prefs_shutdown(void);
354 /* these already issued by the two above, respectively */
355 void _elm_prefs_data_init(void);
356 void _elm_prefs_data_shutdown(void);
358 void _elm_emotion_init(void);
359 void _elm_emotion_shutdown(void);
361 int _elm_ews_wm_init(void);
362 void _elm_ews_wm_shutdown(void);
363 void _elm_ews_wm_rescale(Elm_Theme *th,
364 Eina_Bool use_theme);
366 void _elm_win_shutdown(void);
367 void _elm_win_rescale(Elm_Theme *th,
368 Eina_Bool use_theme);
369 void _elm_win_access(Eina_Bool is_access);
370 void _elm_win_translate(void);
372 Ecore_X_Window _elm_ee_xwin_get(const Ecore_Evas *ee);
374 Eina_Bool _elm_theme_object_set(Evas_Object *parent,
379 Eina_Bool _elm_theme_object_icon_set(Evas_Object *o,
382 Eina_Bool _elm_theme_set(Elm_Theme *th,
387 Eina_Bool _elm_theme_icon_set(Elm_Theme *th,
391 Eina_Bool _elm_theme_parse(Elm_Theme *th,
393 void _elm_theme_shutdown(void);
395 void _elm_module_init(void);
396 void _elm_module_shutdown(void);
397 void _elm_module_parse(const char *s);
398 Elm_Module *_elm_module_find_as(const char *as);
399 Elm_Module *_elm_module_add(const char *name,
401 void _elm_module_del(Elm_Module *m);
402 Eina_Bool _elm_module_load(Elm_Module *m);
403 void _elm_module_unload(Elm_Module *m);
404 const void *_elm_module_symbol_get(Elm_Module *m,
407 void _elm_widget_top_win_focused_set(Evas_Object *obj,
408 Eina_Bool top_win_focused);
409 Eina_Bool _elm_widget_top_win_focused_get(const Evas_Object *obj);
411 void _elm_unneed_systray(void);
412 void _elm_unneed_sys_notify(void);
413 void _elm_unneed_ethumb(void);
414 // Tizen Only (20150619) : elm_web is not used in Tizen 2.4
415 //void _elm_unneed_web(void);
417 void _elm_rescale(void);
418 Eina_Bool _elm_clouseau_reload(void);
420 void _elm_config_init(void);
421 void _elm_config_sub_init(void);
422 void _elm_config_shutdown(void);
423 void _elm_config_sub_shutdown(void);
424 Eina_Bool _elm_config_save(void);
425 void _elm_config_reload(void);
426 size_t _elm_config_user_dir_snprintf(char *dst, size_t size,
427 const char *fmt, ...)
430 void _elm_recache(void);
432 const char *_elm_config_current_profile_get(void);
433 const char *_elm_config_profile_dir_get(const char *prof,
435 Eina_List *_elm_config_profiles_list(void);
436 void _elm_config_all_update(void);
437 void _elm_config_profile_set(const char *profile);
438 Eina_Bool _elm_config_profile_exists(const char *profile);
440 void _elm_config_engine_set(const char *engine);
442 Eina_List *_elm_config_font_overlays_list(void);
443 void _elm_config_font_overlay_set(const char *text_class,
445 Evas_Font_Size size);
446 void _elm_config_font_overlay_remove(const char *text_class);
447 void _elm_config_font_overlay_apply(void);
448 Eina_List *_elm_config_text_classes_get(void);
449 void _elm_config_text_classes_free(Eina_List *l);
451 Eina_List *_elm_config_color_classes_get(void);
452 void _elm_config_color_classes_free(Eina_List *l);
453 Eina_List *_elm_config_color_overlays_list(void);
454 void _elm_config_color_overlay_set(const char *color_class,
455 int r, int g, int b, int a,
456 int r2, int g2, int b2, int a2,
457 int r3, int g3, int b3, int a3);
458 void _elm_config_color_overlay_remove(const char *color_class);
459 void _elm_config_color_overlay_apply(void);
461 Eina_Bool _elm_config_access_get(void);
462 void _elm_config_access_set(Eina_Bool is_access);
464 Eina_Bool _elm_config_key_binding_call(Evas_Object *obj,
465 const Evas_Event_Key_Down *ev,
466 const Elm_Action *actions);
468 Elm_Font_Properties *_elm_font_properties_get(Eina_Hash **font_hash,
470 Eina_Hash *_elm_font_available_hash_add(Eina_Hash *font_hash,
471 const char *full_name);
472 void _elm_font_available_hash_del(Eina_Hash *hash);
474 void elm_tooltip_theme(Elm_Tooltip *tt);
475 void elm_object_sub_tooltip_content_cb_set(Evas_Object *eventarea,
477 Elm_Tooltip_Content_Cb func,
479 Evas_Smart_Cb del_cb);
480 void elm_cursor_theme(Elm_Cursor *cur);
481 void elm_object_sub_cursor_set(Evas_Object *eventarea,
485 void elm_menu_clone(Evas_Object *from_menu,
486 Evas_Object *to_menu,
487 Elm_Object_Item *parent);
489 char *_elm_util_mkup_to_text(const char *mkup);
490 char *_elm_util_text_to_mkup(const char *text);
491 // TIZEN_ONLY: Apply elm_genlist widget from Tizen 2.3
492 Eina_Bool _elm_util_freeze_events_get(const Evas_Object *obj);
495 Eina_Bool _elm_video_check(Evas_Object *video);
497 Eina_List *_elm_config_color_list_get(const char *palette_name);
498 void _elm_config_color_set(const char *palette_name,
503 void _elm_config_colors_free(const char *palette_name);
505 typedef struct _Elm_DBus_Menu Elm_DBus_Menu;
507 const char *_elm_dbus_menu_register(Eo *obj);
508 void _elm_dbus_menu_unregister(Eo *obj);
509 int _elm_dbus_menu_item_add(Elm_DBus_Menu *dbus_menu,
510 Elm_Object_Item *item);
511 void _elm_dbus_menu_update(Elm_DBus_Menu *dbus_menu);
512 void _elm_dbus_menu_item_delete(Elm_DBus_Menu *dbus_menu,
515 void _elm_dbus_menu_app_menu_register(Ecore_X_Window xid, Eo *obj,
516 void (*result_cb)(Eina_Bool, void *),
518 void _elm_dbus_menu_app_menu_unregister(Eo *obj);
519 void _elm_dbus_menu_item_select_cb(Elm_Object_Item *obj_item);
521 void _elm_menu_menu_bar_set(Eo *obj, Eina_Bool menu_bar);
522 void _elm_menu_menu_bar_hide(Eo *obj);
524 /* DEPRECATED, will be removed on next release */
525 void _elm_icon_signal_emit(Evas_Object *obj,
526 const char *emission,
528 void _elm_icon_signal_callback_add(Evas_Object *obj,
529 const char *emission,
531 Edje_Signal_Cb func_cb,
533 void *_elm_icon_signal_callback_del(Evas_Object *obj,
534 const char *emission,
536 Edje_Signal_Cb func_cb);
537 void elm_atspi_bridge_utils_proxy_listen(Eo *proxy);
538 void elm_atspi_bridge_utils_proxy_connect(Eo *proxy);
539 Eina_Bool _elm_atspi_bridge_plug_id_split(const char *plug_id, char **bus, char **path);
540 void _elm_atspi_bridge_connected_cb_set(void (*cb)(void));
541 /* end of DEPRECATED */
544 /* Elm helper to download content */
545 typedef struct _Elm_Url Elm_Url;
547 typedef void (*Elm_Url_Done)(void *data, Elm_Url *url, Eina_Binbuf *download);
548 typedef void (*Elm_Url_Cancel)(void *data, Elm_Url *url, int error);
549 typedef void (*Elm_Url_Progress)(void *data, Elm_Url *url, double now, double total);
551 Elm_Url *_elm_url_download(const char *url, Elm_Url_Done done_cb, Elm_Url_Cancel cancel_cb, Elm_Url_Progress progress_cb, const void *data);
552 void _elm_url_cancel(Elm_Url *r);
553 const char *_elm_url_get(Elm_Url *r);
555 extern char *_elm_appname;
556 // TIZEN_ONLY(20150529): Make _elm_config to be visible to elementary modules.
557 //extern Elm_Config *_elm_config;
558 EAPI extern Elm_Config *_elm_config;
560 extern const char *_elm_data_dir;
561 extern const char *_elm_lib_dir;
562 extern int _elm_log_dom;
563 extern Eina_List *_elm_win_list;
564 extern int _elm_win_deferred_free;
565 extern const char *_elm_preferred_engine;
566 extern const char *_elm_accel_preference;
567 extern const char SIG_WIDGET_FOCUSED[];
568 extern const char SIG_WIDGET_UNFOCUSED[];
569 extern const char SIG_WIDGET_LANG_CHANGED[];
570 extern const char SIG_WIDGET_ACCESS_CHANGED[];
571 extern const char SIG_LAYOUT_FOCUSED[];
572 extern const char SIG_LAYOUT_UNFOCUSED[];
575 /* Our gettext wrapper, used to disable translation of elm if the app
576 * is not translated. */
577 static inline const char *
578 _elm_dgettext(const char *string)
580 if (EINA_UNLIKELY(_elm_config->translate == EINA_FALSE))
585 return dgettext(PACKAGE, string);
590 /* Used by the paste handler */
591 void _elm_entry_entry_paste(Evas_Object *obj, const char *entry);
593 double _elm_atof(const char *s);
595 #define TIZEN_VECTOR_UX 1
597 #ifdef TIZEN_VECTOR_UX
598 void tizen_vg_button_set(Elm_Button *obj);
599 void tizen_vg_check_set(Elm_Check *obj);
600 void tizen_vg_radio_set(Elm_Radio *obj);
601 void tizen_vg_radio_state_set(Elm_Radio *obj);
602 void tizen_vg_progressbar_set(Elm_Progressbar *obj);
603 void tizen_vg_slider_set(Elm_Slider *obj, Evas_Object *popup);
604 void tizen_vg_check_state_set(Elm_Check *obj);