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;
212 Eina_List *font_dirs;
213 Eina_List *font_overlays;
215 int cache_flush_poll_interval;
216 unsigned char cache_flush_enable;
220 int edje_collection_cache;
225 double tooltip_delay;
226 unsigned char cursor_engine_only;
227 unsigned char focus_highlight_enable;
228 unsigned char focus_highlight_animate;
229 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. */
230 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. */
231 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.*/
232 unsigned char first_item_focus_on_first_focus_in; /**< This sets the first item focus on first focus in feature*/
233 Elm_Focus_Autoscroll_Mode focus_autoscroll_mode; /**< This shows the focus auto scroll mode. By default, @c ELM_FOCUS_AUTOSCROLL_MODE_SHOW is set. */
234 Elm_Slider_Indicator_Visible_Mode slider_indicator_visible_mode; /**< this sets the slider indicator visible mode */
235 int toolbar_shrink_mode;
236 unsigned char fileselector_expand_enable;
237 unsigned char fileselector_double_tap_navigation_enable;
238 unsigned char inwin_dialogs_enable;
240 double longpress_timeout;
241 unsigned char effect_enable;
242 unsigned char desktop_entry;
243 unsigned char password_show_last;
244 double password_show_last_timeout;
245 unsigned char glayer_zoom_finger_enable;
246 double glayer_zoom_finger_factor;
247 double glayer_zoom_wheel_factor;
248 double glayer_zoom_distance_tolerance;
249 double glayer_rotate_finger_enable;
250 double glayer_rotate_angular_tolerance;
251 double glayer_line_min_length;
252 double glayer_line_distance_tolerance;
253 double glayer_line_angular_tolerance;
254 unsigned int glayer_flick_time_limit_ms;
255 double glayer_long_tap_start_timeout;
256 double glayer_double_tap_timeout;
257 Eina_Bool access_mode;
258 unsigned char glayer_continues_enable;
264 Eina_List *color_overlays;
265 Eina_List *color_palette;
266 unsigned char softcursor_mode;
267 unsigned char auto_norender_withdrawn;
268 unsigned char auto_norender_iconified_same_as_withdrawn;
269 unsigned char auto_flush_withdrawn;
270 unsigned char auto_dump_withdrawn;
271 unsigned char auto_throttle;
272 double auto_throttle_amount;
273 const char *indicator_service_0;
274 const char *indicator_service_90;
275 const char *indicator_service_180;
276 const char *indicator_service_270;
277 unsigned char selection_clear_enable;
278 unsigned char disable_external_menu;
279 unsigned char clouseau_enable;
280 unsigned char magnifier_enable;
281 double magnifier_scale;
282 unsigned char audio_mute_effect;
283 unsigned char audio_mute_background;
284 unsigned char audio_mute_music;
285 unsigned char audio_mute_foreground;
286 unsigned char audio_mute_interface;
287 unsigned char audio_mute_input;
288 unsigned char audio_mute_alert;
289 unsigned char audio_mute_all;
291 Eina_Bool atspi_mode;
293 /* Not part of the EET file */
294 Eina_Bool is_mirrored : 1;
295 Eina_Bool translate : 1;
298 struct _Elm_Config_Bindings_Widget
301 Eina_List *key_bindings;
304 struct _Elm_Config_Binding_Key
310 Eina_List *modifiers;
313 struct _Elm_Config_Binding_Modifier
325 const char *data_dir;
330 int (*init_func)(Elm_Module *m);
331 int (*shutdown_func)(Elm_Module *m);
335 Eo *_elm_atspi_bridge_root_get(void);
336 void _elm_atspi_bridge_init(void);
337 void _elm_atspi_bridge_shutdown(void);
339 void _elm_prefs_init(void);
340 void _elm_prefs_shutdown(void);
342 /* these already issued by the two above, respectively */
343 void _elm_prefs_data_init(void);
344 void _elm_prefs_data_shutdown(void);
346 void _elm_emotion_init(void);
347 void _elm_emotion_shutdown(void);
349 int _elm_ews_wm_init(void);
350 void _elm_ews_wm_shutdown(void);
351 void _elm_ews_wm_rescale(Elm_Theme *th,
352 Eina_Bool use_theme);
354 void _elm_win_shutdown(void);
355 void _elm_win_rescale(Elm_Theme *th,
356 Eina_Bool use_theme);
357 void _elm_win_access(Eina_Bool is_access);
358 void _elm_win_translate(void);
360 Ecore_X_Window _elm_ee_xwin_get(const Ecore_Evas *ee);
362 Eina_Bool _elm_theme_object_set(Evas_Object *parent,
367 Eina_Bool _elm_theme_object_icon_set(Evas_Object *o,
370 Eina_Bool _elm_theme_set(Elm_Theme *th,
375 Eina_Bool _elm_theme_icon_set(Elm_Theme *th,
379 Eina_Bool _elm_theme_parse(Elm_Theme *th,
381 void _elm_theme_shutdown(void);
383 void _elm_module_init(void);
384 void _elm_module_shutdown(void);
385 void _elm_module_parse(const char *s);
386 Elm_Module *_elm_module_find_as(const char *as);
387 Elm_Module *_elm_module_add(const char *name,
389 void _elm_module_del(Elm_Module *m);
390 Eina_Bool _elm_module_load(Elm_Module *m);
391 void _elm_module_unload(Elm_Module *m);
392 const void *_elm_module_symbol_get(Elm_Module *m,
395 void _elm_widget_top_win_focused_set(Evas_Object *obj,
396 Eina_Bool top_win_focused);
397 Eina_Bool _elm_widget_top_win_focused_get(const Evas_Object *obj);
399 void _elm_unneed_systray(void);
400 void _elm_unneed_sys_notify(void);
401 void _elm_unneed_ethumb(void);
402 void _elm_unneed_web(void);
404 void _elm_rescale(void);
405 Eina_Bool _elm_clouseau_reload(void);
407 void _elm_config_init(void);
408 void _elm_config_sub_init(void);
409 void _elm_config_shutdown(void);
410 void _elm_config_sub_shutdown(void);
411 Eina_Bool _elm_config_save(void);
412 void _elm_config_reload(void);
413 size_t _elm_config_user_dir_snprintf(char *dst, size_t size,
414 const char *fmt, ...)
417 void _elm_recache(void);
419 const char *_elm_config_current_profile_get(void);
420 const char *_elm_config_profile_dir_get(const char *prof,
422 Eina_List *_elm_config_profiles_list(void);
423 void _elm_config_all_update(void);
424 void _elm_config_profile_set(const char *profile);
426 void _elm_config_engine_set(const char *engine);
428 Eina_List *_elm_config_font_overlays_list(void);
429 void _elm_config_font_overlay_set(const char *text_class,
431 Evas_Font_Size size);
432 void _elm_config_font_overlay_remove(const char *text_class);
433 void _elm_config_font_overlay_apply(void);
434 Eina_List *_elm_config_text_classes_get(void);
435 void _elm_config_text_classes_free(Eina_List *l);
437 Eina_List *_elm_config_color_classes_get(void);
438 void _elm_config_color_classes_free(Eina_List *l);
439 Eina_List *_elm_config_color_overlays_list(void);
440 void _elm_config_color_overlay_set(const char *color_class,
441 int r, int g, int b, int a,
442 int r2, int g2, int b2, int a2,
443 int r3, int g3, int b3, int a3);
444 void _elm_config_color_overlay_remove(const char *color_class);
445 void _elm_config_color_overlay_apply(void);
447 Eina_Bool _elm_config_access_get(void);
448 void _elm_config_access_set(Eina_Bool is_access);
450 Eina_Bool _elm_config_key_binding_call(Evas_Object *obj,
451 const Evas_Event_Key_Down *ev,
452 const Elm_Action *actions);
454 Elm_Font_Properties *_elm_font_properties_get(Eina_Hash **font_hash,
456 Eina_Hash *_elm_font_available_hash_add(Eina_Hash *font_hash,
457 const char *full_name);
458 void _elm_font_available_hash_del(Eina_Hash *hash);
460 void elm_tooltip_theme(Elm_Tooltip *tt);
461 void elm_object_sub_tooltip_content_cb_set(Evas_Object *eventarea,
463 Elm_Tooltip_Content_Cb func,
465 Evas_Smart_Cb del_cb);
466 void elm_cursor_theme(Elm_Cursor *cur);
467 void elm_object_sub_cursor_set(Evas_Object *eventarea,
471 void elm_menu_clone(Evas_Object *from_menu,
472 Evas_Object *to_menu,
473 Elm_Object_Item *parent);
475 char *_elm_util_mkup_to_text(const char *mkup);
476 char *_elm_util_text_to_mkup(const char *text);
478 Eina_Bool _elm_video_check(Evas_Object *video);
480 Eina_List *_elm_config_color_list_get(const char *palette_name);
481 void _elm_config_color_set(const char *palette_name,
486 void _elm_config_colors_free(const char *palette_name);
488 typedef struct _Elm_DBus_Menu Elm_DBus_Menu;
490 const char *_elm_dbus_menu_register(Eo *obj);
491 void _elm_dbus_menu_unregister(Eo *obj);
492 int _elm_dbus_menu_item_add(Elm_DBus_Menu *dbus_menu,
493 Elm_Object_Item *item);
494 void _elm_dbus_menu_update(Elm_DBus_Menu *dbus_menu);
495 void _elm_dbus_menu_item_delete(Elm_DBus_Menu *dbus_menu,
498 void _elm_dbus_menu_app_menu_register(Ecore_X_Window xid, Eo *obj,
499 void (*result_cb)(Eina_Bool, void *),
501 void _elm_dbus_menu_app_menu_unregister(Eo *obj);
502 void _elm_dbus_menu_item_select_cb(Elm_Object_Item *obj_item);
504 void _elm_menu_menu_bar_set(Eo *obj, Eina_Bool menu_bar);
505 void _elm_menu_menu_bar_hide(Eo *obj);
507 /* DEPRECATED, will be removed on next release */
508 void _elm_icon_signal_emit(Evas_Object *obj,
509 const char *emission,
511 void _elm_icon_signal_callback_add(Evas_Object *obj,
512 const char *emission,
514 Edje_Signal_Cb func_cb,
516 void *_elm_icon_signal_callback_del(Evas_Object *obj,
517 const char *emission,
519 Edje_Signal_Cb func_cb);
520 /* end of DEPRECATED */
523 /* Elm helper to download content */
524 typedef struct _Elm_Url Elm_Url;
526 typedef void (*Elm_Url_Done)(void *data, Elm_Url *url, Eina_Binbuf *download);
527 typedef void (*Elm_Url_Cancel)(void *data, Elm_Url *url, int error);
528 typedef void (*Elm_Url_Progress)(void *data, Elm_Url *url, double now, double total);
530 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);
531 void _elm_url_cancel(Elm_Url *r);
532 const char *_elm_url_get(Elm_Url *r);
534 extern char *_elm_appname;
535 extern Elm_Config *_elm_config;
536 extern const char *_elm_data_dir;
537 extern const char *_elm_lib_dir;
538 extern int _elm_log_dom;
539 extern Eina_List *_elm_win_list;
540 extern int _elm_win_deferred_free;
541 extern const char *_elm_preferred_engine;
542 extern const char *_elm_accel_preference;
543 extern const char SIG_WIDGET_FOCUSED[];
544 extern const char SIG_WIDGET_UNFOCUSED[];
545 extern const char SIG_WIDGET_LANG_CHANGED[];
546 extern const char SIG_WIDGET_ACCESS_CHANGED[];
547 extern const char SIG_LAYOUT_FOCUSED[];
548 extern const char SIG_LAYOUT_UNFOCUSED[];
551 /* Our gettext wrapper, used to disable translation of elm if the app
552 * is not translated. */
553 static inline const char *
554 _elm_dgettext(const char *string)
556 if (EINA_UNLIKELY(_elm_config->translate == EINA_FALSE))
561 return dgettext(PACKAGE, string);
566 /* Used by the paste handler */
567 void _elm_entry_entry_paste(Evas_Object *obj, const char *entry);
569 double _elm_atof(const char *s);
571 #define TIZEN_VECTOR_UX 1
573 #ifdef TIZEN_VECTOR_UX
574 void tizen_vg_button_set(Elm_Button *obj);
575 void tizen_vg_check_set(Elm_Check *obj);
576 void tizen_vg_radio_set(Elm_Radio *obj);
577 void tizen_vg_progressbar_set(Elm_Progressbar *obj);
578 void tizen_vg_slider_set(Elm_Slider *obj, Evas_Object *popup);
579 void tizen_vg_check_state_set(Elm_Check *obj);