1 #ifndef ELM_PRIV_H
2 # define ELM_PRIV_H
3 # ifdef HAVE_ELEMENTARY_X
4 # include <Ecore_X.h>
5 # endif
6 # ifdef HAVE_ELEMENTARY_FB
7 # include <Ecore_Fb.h>
8 # endif
9 # ifdef HAVE_ELEMENTARY_WL2
10 # include <Ecore_Wl2.h>
11 # include "ecore_wl2_internal.h"
12 # endif
13 # ifdef HAVE_ELEMENTARY_DRM
14 # include <Ecore_Drm2.h>
15 # endif
16 # ifdef HAVE_ELEMENTARY_COCOA
17 # include <Ecore_Cocoa.h>
18 # endif
19 # ifdef HAVE_ELEMENTARY_WIN32
20 # include <Ecore_Win32.h>
21 # endif
22
23 # include <Eio.h>
24
25 // Evas internal EO APIs
26 # include "Evas.h"
27 #define EFL_INTERNAL_UNSTABLE
28 # include "Evas_Internal.h"
29 # include "Emotion.h"
30
31 #include "Elementary.h"
32 #include "Efl_Ui.h"
33 # ifdef EAPI
34 # undef EAPI
35 # endif
36 # ifdef EWAPI
37 # undef EWAPI
38 # endif
39
40 # ifdef _WIN32
41 # ifdef EFL_BUILD
42 # ifdef DLL_EXPORT
43 # define EAPI __declspec(dllexport)
44 # else
45 # error "no DLL_EXPORT"
46 # define EAPI
47 # endif
48 # else
49 # define EAPI __declspec(dllimport)
50 # endif
51 # define EAPI_WEAK
52 # else
53 # ifdef __GNUC__
54 # if __GNUC__ >= 4
55 # define EAPI __attribute__ ((visibility("default")))
56 # define EAPI_WEAK __attribute__ ((weak))
57 # else
58 # define EAPI
59 # define EAPI_WEAK
60 # endif
61 # else
62 # define EAPI
63 # define EAPI_WEAK
64 # endif
65 # endif
66
67 # define EWAPI EAPI EAPI_WEAK
68
69 # include "elm_widget.h"
70 # include "elm_code_private.h"
71 #include "elm_access_eo.h"
72 #include "elm_actionslider_eo.h"
73 #include "elm_atspi_app_object_eo.h"
74 #include "elm_atspi_bridge_eo.h"
75 #include "elm_box_eo.h"
76 #include "elm_bubble_eo.h"
77 #include "elm_calendar_eo.h"
78 #include "elm_calendar_item_eo.h"
79 #include "elm_clock_eo.h"
80 #include "elm_code_widget_legacy_eo.h"
81 #include "elm_color_item_eo.h"
82 #include "elm_colorselector_eo.h"
83 #include "elm_conformant_eo.h"
84 #include "elm_ctxpopup_eo.h"
85 #include "elm_ctxpopup_item_eo.h"
86 #include "elm_dayselector_eo.h"
87 #include "elm_dayselector_item_eo.h"
88 #include "elm_diskselector_eo.h"
89 #include "elm_diskselector_item_eo.h"
90 #include "elm_entry_eo.h"
91 #include "elm_fileselector_button_eo.h"
92 #include "elm_fileselector_entry_eo.h"
93 #include "elm_fileselector_eo.h"
94 #include "elm_flipselector_eo.h"
95 #include "elm_flipselector_item_eo.h"
96 #include "elm_gengrid_eo.h"
97 #include "elm_gengrid_item_eo.h"
98 #include "elm_gengrid_pan_eo.h"
99 #include "elm_genlist_eo.h"
100 #include "elm_genlist_item_eo.h"
101 #include "elm_genlist_pan_eo.h"
102 #include "elm_gesture_layer_eo.h"
103 #include "elm_glview_eo.h"
104 #include "elm_grid_eo.h"
105 #include "elm_hover_eo.h"
106 #include "elm_hoversel_eo.h"
107 #include "elm_hoversel_item_eo.h"
108 #include "elm_icon_eo.h"
109 #include "elm_image_eo.h"
110 #include "elm_index_eo.h"
111 #include "elm_index_item_eo.h"
112 #include "elm_interface_fileselector_eo.h"
113 #include "elm_inwin_eo.h"
114 #include "elm_label_eo.h"
115 #include "elm_list_eo.h"
116 #include "elm_list_item_eo.h"
117 #include "elm_mapbuf_eo.h"
118 #include "elm_map_eo.h"
119 #include "elm_map_pan_eo.h"
120 #include "elm_menu_eo.h"
121 #include "elm_menu_item_eo.h"
122 #include "elm_multibuttonentry_eo.h"
123 #include "elm_multibuttonentry_item_eo.h"
124 #include "elm_naviframe_eo.h"
125 #include "elm_naviframe_item_eo.h"
126 #include "elm_notify_eo.h"
127 #include "elm_panel_eo.h"
128 #include "elm_pan_eo.h"
129 #include "elm_photo_eo.h"
130 #include "elm_player_eo.h"
131 #include "elm_plug_eo.h"
132 #include "elm_popup_eo.h"
133 #include "elm_popup_item_eo.h"
134 #include "elm_prefs_eo.h"
135 #include "elm_route_eo.h"
136 #include "elm_scroller_eo.h"
137 #include "elm_segment_control_eo.h"
138 #include "elm_segment_control_item_eo.h"
139 #include "elm_separator_eo.h"
140 #include "elm_slider_eo.h"
141 #include "elm_slider_part_indicator_eo.h"
142 #include "elm_slideshow_eo.h"
143 #include "elm_slideshow_item_eo.h"
144 #include "elm_spinner_eo.h"
145 #include "elm_sys_notify_dbus_eo.h"
146 #include "elm_sys_notify_eo.h"
147 #include "elm_sys_notify_interface_eo.h"
148 #include "elm_systray_eo.h"
149 #include "elm_table_eo.h"
150 #include "elm_thumb_eo.h"
151 #include "elm_toolbar_eo.h"
152 #include "elm_toolbar_item_eo.h"
153 #include "elm_web_eo.h"
154 #include "elm_widget_item_container_eo.h"
155 #include "elm_widget_item_eo.h"
156 #include "elm_widget_item_static_focus_eo.h"
157 #include "elm_win_eo.h"
158
159
160 #include "efl_ui_layout_legacy_eo.h"
161 # include "efl_ui_size_model.eo.h"
162 # include "efl_ui_homogeneous_model.eo.h"
163 # include "efl_ui_exact_model.eo.h"
164 # include "efl_ui_average_model.eo.h"
165
166 # include "efl_ui_focus_parent_provider.eo.h"
167 # include "efl_ui_focus_parent_provider_standard.eo.h"
168 # include "efl_datetime_manager.eo.h"
169
170 extern const char *_efl_model_property_itemw;
171 extern const char *_efl_model_property_itemh;
172 extern const char *_efl_model_property_selfw;
173 extern const char *_efl_model_property_selfh;
174 extern const char *_efl_model_property_totalw;
175 extern const char *_efl_model_property_totalh;
176
177 # ifdef HAVE_LANGINFO_H
178 # include <langinfo.h>
179 # endif
180
181 # define CRI(...) EINA_LOG_DOM_CRIT(_elm_log_dom, __VA_ARGS__)
182 # define ERR(...) EINA_LOG_DOM_ERR(_elm_log_dom, __VA_ARGS__)
183 # define WRN(...) EINA_LOG_DOM_WARN(_elm_log_dom, __VA_ARGS__)
184 # define INF(...) EINA_LOG_DOM_INFO(_elm_log_dom, __VA_ARGS__)
185 # define DBG(...) EINA_LOG_DOM_DBG(_elm_log_dom, __VA_ARGS__)
186
187 # ifdef ENABLE_NLS
188 # include <libintl.h>
189 # define E_(string) _elm_dgettext(string)
190 # else
191 # ifndef setlocale
192 # define setlocale(c, l)
193 # endif
194 # ifndef libintl_setlocale
195 # define libintl_setlocale(c, l)
196 # endif
197 # ifndef bindtextdomain
198 # define bindtextdomain(domain, dir)
199 # endif
200 # ifndef libintl_bindtextdomain
201 # define libintl_bindtextdomain(domain, dir)
202 # endif
203 # define E_(string) (string)
204 # endif
205 # define N_(string) (string)
206
207 typedef struct _Elm_Theme_Files Elm_Theme_Files;
208 typedef struct _Edje_Signal_Data Edje_Signal_Data;
209 typedef struct _Elm_Config_Flags Elm_Config_Flags;
210 typedef struct _Elm_Config Elm_Config;
211 typedef struct _Elm_Config_Bindings_Widget Elm_Config_Bindings_Widget;
212 typedef struct _Elm_Config_Binding_Key Elm_Config_Binding_Key;
213 typedef struct _Elm_Config_Binding_Modifier Elm_Config_Binding_Modifier;
214 typedef struct _Elm_Module Elm_Module;
215 typedef struct _Efl_Ui_Theme_Data Efl_Ui_Theme_Data;
216
217 struct _Edje_Signal_Data
218 {
219 Evas_Object *obj;
220 Edje_Signal_Cb func;
221 const char *emission;
222 const char *source;
223 void *data;
224 };
225
226 typedef struct Elm_Theme_File
227 {
228 EINA_INLIST;
229 /*
230 * We are conserving a list of path even if that's duplicated
231 * because we expose those directly to the outside world :'(
232 */
233 Eina_Stringshare *item;
234 Eina_File *handle;
235 Eina_Stringshare *base_theme; // data.item: efl_theme_base name
236 Eina_Stringshare *match_theme; // data.item: efl_theme_match name
237 } Elm_Theme_File;
238
239 struct _Elm_Theme
240 {
241 Eina_Inlist *overlay;
242 Eina_Inlist *themes;
243 Eina_Inlist *extension;
244
245 Eina_Hash *cache;
246 Eina_Hash *cache_data;
247 Elm_Theme *ref_theme;
248 Eina_List *referrers;
249 const char *theme;
250 Eina_Hash *cache_style_load_failed;
251
252 /* these only exist to preserve compat with bad elm_theme_XYZ_list_get() api */
253 Eina_List *overlay_items;
254 Eina_List *theme_items;
255 Eina_List *extension_items;
256
257 Efl_Ui_Theme *eo_theme; //for accessing through the Eo interface
258 };
259
260 struct _Efl_Ui_Theme_Data
261 {
262 Elm_Theme *th;
263 };
264
265 /* increment this whenever we change config enough that you need new
266 * defaults for elm to work.
267 */
268 # define ELM_CONFIG_EPOCH 0x0002
269 /* increment this whenever a new set of config values are added but
270 * the users config doesn't need to be wiped - simply new values need
271 * to be put in
272 */
273 # define ELM_CONFIG_FILE_GENERATION 0x0018
274 # define ELM_CONFIG_VERSION_EPOCH_OFFSET 16
275 # define ELM_CONFIG_VERSION ((ELM_CONFIG_EPOCH << ELM_CONFIG_VERSION_EPOCH_OFFSET) | \
276 ELM_CONFIG_FILE_GENERATION)
277 /* NB: profile configuration files (.src) must have their
278 * "config_version" entry's value up-to-date with ELM_CONFIG_VERSION
279 * (in decimal)!! */
280
281 /* note: always remember to sync it with elm_config.c */
282 extern const char *_elm_engines[];
283
284 # define ELM_SOFTWARE_X11 (_elm_engines[0])
285 # define ELM_SOFTWARE_FB (_elm_engines[1])
286 # define ELM_OPENGL_X11 (_elm_engines[2])
287 # define ELM_SOFTWARE_WIN32 (_elm_engines[3])
288 # define ELM_SOFTWARE_SDL (_elm_engines[4])
289 # define ELM_OPENGL_SDL (_elm_engines[5])
290 # define ELM_BUFFER (_elm_engines[6])
291 # define ELM_EWS (_elm_engines[7])
292 # define ELM_OPENGL_COCOA (_elm_engines[8])
293 # define ELM_WAYLAND_SHM (_elm_engines[9])
294 # define ELM_WAYLAND_EGL (_elm_engines[10])
295 # define ELM_DRM (_elm_engines[11])
296 # define ELM_SOFTWARE_DDRAW (_elm_engines[12])
297 # define ELM_GL_DRM (_elm_engines[13])
298
299 # define ELM_FONT_TOKEN_STYLE ":style="
300
301 # define ELM_ACCESS_MODE_OFF EINA_FALSE
302 # define ELM_ACCESS_MODE_ON EINA_TRUE
303
304 # define ELM_ATSPI_MODE_OFF EINA_FALSE
305 # define ELM_ATSPI_MODE_ON EINA_TRUE
306
307 /* convenience macro to compress code and avoid typos */
308 # undef CEIL
309 # define CEIL(a) (((a) % 2 != 0) ? ((a) / 2 + 1) : ((a) / 2))
310 # undef IS_INSIDE
311 # define IS_INSIDE(x, y, xx, yy, ww, hh) \
312 (((x) < ((xx) + (ww))) && ((y) < ((yy) + (hh))) && \
313 ((x) >= (xx)) && ((y) >= (yy)))
314
315
316 # define ELM_SAFE_FREE(_h, _fn) do { _fn((void*)_h); _h = NULL; } while (0)
317 # define ELM_SAFE_DEL(_h) do { efl_del(_h); _h = NULL; } while (0)
318
319 # define ELM_PRIV_STATIC_VARIABLE_DECLARE(name, signal, type) \
320 static const char name[] = signal;
321
322 # define ELM_PRIV_SMART_CALLBACKS_DESC(name, signal, type) \
323 {name, type},
324
325 # define CLAMP(x, min, max) \
326 (((x) > (max)) ? (max) : (((x) < (min)) ? (min) : (x)))
327
328 struct _Elm_Config_Flags
329 {
330 Eina_Bool engine : 1;
331 Eina_Bool accel : 1;
332 Eina_Bool web_backend : 1;
333 Eina_Bool accel_override : 1;
334 Eina_Bool vsync : 1;
335 Eina_Bool thumbscroll_enable : 1;
336 Eina_Bool thumbscroll_threshold : 1;
337 Eina_Bool thumbscroll_hold_threshold : 1;
338 Eina_Bool thumbscroll_momentum_threshold : 1;
339 Eina_Bool thumbscroll_bounce_friction : 1;
340 Eina_Bool thumbscroll_acceleration_threshold : 1;
341 Eina_Bool thumbscroll_acceleration_time_limit : 1;
342 Eina_Bool thumbscroll_acceleration_weight : 1;
343 //new
344 Eina_Bool thumbscroll_momentum_friction : 1;
345 Eina_Bool thumbscroll_momentum_distance_max : 1;
346 Eina_Bool thumbscroll_momentum_animation_duration_min_limit : 1;
347 Eina_Bool thumbscroll_momentum_animation_duration_max_limit : 1;
348 //deprecated
349 Eina_Bool thumbscroll_flick_distance_tolerance : 1;
350 Eina_Bool thumbscroll_friction : 1;
351 Eina_Bool thumbscroll_min_friction : 1;
352 Eina_Bool thumbscroll_friction_standard : 1;
353 //
354 Eina_Bool page_scroll_friction : 1;
355 Eina_Bool bring_in_scroll_friction : 1;
356 Eina_Bool zoom_friction : 1;
357 Eina_Bool scroll_animation_disable : 1;
358 Eina_Bool scroll_accel_factor : 1;
359 Eina_Bool thumbscroll_bounce_enable : 1;
360 Eina_Bool thumbscroll_border_friction : 1;
361 Eina_Bool thumbscroll_sensitivity_friction : 1;
362 Eina_Bool scroll_smooth_start_enable : 1;
363 Eina_Bool scroll_smooth_amount : 1;
364 Eina_Bool scroll_smooth_time_window : 1;
365 Eina_Bool scale : 1;
366 Eina_Bool bgpixmap : 1; // unused
367 Eina_Bool compositing : 1; // unused
368 Eina_Bool font_dirs : 1; // unused
369 Eina_Bool font_overlays : 1;
370 Eina_Bool font_hinting : 1;
371 Eina_Bool cache_flush_poll_interval : 1;
372 Eina_Bool cache_flush_enable : 1;
373 Eina_Bool image_cache : 1;
374 Eina_Bool font_cache : 1;
375 Eina_Bool edje_cache : 1;
376 Eina_Bool edje_collection_cache : 1;
377 Eina_Bool finger_size : 1;
378 Eina_Bool fps : 1; // unused
379 Eina_Bool theme : 1; // unused
380 Eina_Bool modules : 1; // unused
381 Eina_Bool tooltip_delay : 1;
382 Eina_Bool cursor_engine_only : 1;
383 Eina_Bool focus_highlight_enable : 1;
384 Eina_Bool focus_highlight_animate : 1;
385 Eina_Bool focus_highlight_clip_disable : 1;
386 Eina_Bool focus_move_policy : 1;
387 Eina_Bool item_select_on_focus_disable : 1;
388 Eina_Bool first_item_focus_on_first_focus_in : 1;
389 Eina_Bool focus_autoscroll_mode : 1;
390 Eina_Bool slider_indicator_visible_mode : 1;
391 Eina_Bool popup_horizontal_align : 1; // unused
392 Eina_Bool popup_vertical_align : 1; // unused
393 Eina_Bool popup_scrollable : 1;
394 Eina_Bool toolbar_shrink_mode : 1; // unused
395 Eina_Bool fileselector_expand_enable : 1; // unused
396 Eina_Bool fileselector_double_tap_navigation_enable : 1; // unused
397 Eina_Bool inwin_dialogs_enable : 1; // unused
398 Eina_Bool icon_size : 1; // unused
399 Eina_Bool longpress_timeout : 1;
400 Eina_Bool effect_enable : 1; // unused
401 Eina_Bool desktop_entry : 1; // unused
402 Eina_Bool context_menu_disabled : 1;
403 Eina_Bool password_show_last : 1;
404 Eina_Bool password_show_last_timeout : 1;
405 Eina_Bool glayer_zoom_finger_enable : 1; // unused
406 Eina_Bool glayer_zoom_finger_factor : 1; // unused
407 Eina_Bool glayer_zoom_wheel_factor : 1; // unused
408 Eina_Bool glayer_zoom_distance_tolerance : 1; // unused
409 Eina_Bool glayer_rotate_finger_enable : 1; // unused
410 Eina_Bool glayer_rotate_angular_tolerance : 1; // unused
411 Eina_Bool glayer_line_min_length : 1; // unused
412 Eina_Bool glayer_line_distance_tolerance : 1; // unused
413 Eina_Bool glayer_line_angular_tolerance : 1; // unused
414 Eina_Bool glayer_flick_time_limit_ms : 1; // unused
415 Eina_Bool glayer_long_tap_start_timeout : 1;
416 Eina_Bool glayer_double_tap_timeout : 1;
417 Eina_Bool glayer_tap_finger_size : 1;
418 Eina_Bool access_mode : 1;
419 Eina_Bool glayer_continues_enable : 1; // unused
420 Eina_Bool week_start : 1; // unused
421 Eina_Bool weekend_start : 1; // unused
422 Eina_Bool weekend_len : 1; // unused
423 Eina_Bool year_min : 1; // unused
424 Eina_Bool year_max : 1; // unused
425 Eina_Bool color_overlays : 1;
426 Eina_Bool color_palette : 1; // unused
427 Eina_Bool softcursor_mode : 1;
428 Eina_Bool auto_norender_withdrawn : 1; // unused
429 Eina_Bool auto_norender_iconified_same_as_withdrawn : 1; // unused
430 Eina_Bool auto_flush_withdrawn : 1; // unused
431 Eina_Bool auto_dump_withdrawn : 1; // unused
432 Eina_Bool auto_throttle : 1; // unused
433 Eina_Bool auto_throttle_amount : 1; // unused
434 Eina_Bool indicator_service_0 : 1; // unused
435 Eina_Bool indicator_service_90 : 1; // unused
436 Eina_Bool indicator_service_180 : 1; // unused
437 Eina_Bool indicator_service_270 : 1; // unused
438 Eina_Bool selection_clear_enable : 1;
439 Eina_Bool disable_external_menu : 1;
440 Eina_Bool clouseau_enable : 1;
441 Eina_Bool magnifier_enable : 1;
442 Eina_Bool magnifier_scale : 1;
443 Eina_Bool audio_mute_effect : 1;
444 Eina_Bool audio_mute_background : 1;
445 Eina_Bool audio_mute_music : 1;
446 Eina_Bool audio_mute_foreground : 1;
447 Eina_Bool audio_mute_interface : 1;
448 Eina_Bool audio_mute_input : 1;
449 Eina_Bool audio_mute_alert : 1;
450 Eina_Bool audio_mute_all : 1;
451 Eina_Bool win_auto_focus_enable : 1;
452 Eina_Bool win_auto_focus_animate : 1;
453 Eina_Bool transition_duration_factor : 1;
454 Eina_Bool naviframe_prev_btn_auto_pushed : 1; // unused
455 Eina_Bool spinner_min_max_filter_enable : 1; // unused
456 Eina_Bool bindings : 1; // unused
457 Eina_Bool atspi_mode : 1;
458 Eina_Bool gl_depth : 1;
459 Eina_Bool gl_stencil : 1;
460 Eina_Bool gl_msaa : 1;
461 Eina_Bool icon_theme : 1;
462 Eina_Bool entry_select_allow : 1; // unused
463 Eina_Bool drag_anim_duration : 1;
464 Eina_Bool win_no_border : 1;
465 };
466
467 struct _Elm_Config
468 {
469 int config_version;
470
471 const char *engine;
472 const char *accel;
473 const char *web_backend;
474 unsigned char accel_override;
475 unsigned char vsync;
476 unsigned char thumbscroll_enable;
477 int thumbscroll_threshold;
478 int thumbscroll_hold_threshold;
479 double thumbscroll_momentum_threshold;
480 double thumbscroll_bounce_friction;
481 double thumbscroll_acceleration_threshold;
482 double thumbscroll_acceleration_time_limit;
483 double thumbscroll_acceleration_weight;
484 //
485 int thumbscroll_momentum_distance_max;
486 double thumbscroll_momentum_friction;
487 double thumbscroll_momentum_animation_duration_min_limit;
488 double thumbscroll_momentum_animation_duration_max_limit;
489 //deprecated
490 int thumbscroll_flick_distance_tolerance;
491 double thumbscroll_friction;
492 double thumbscroll_min_friction;
493 double thumbscroll_friction_standard;
494 //
495 double page_scroll_friction;
496 double bring_in_scroll_friction;
497 double zoom_friction;
498 Eina_Bool scroll_animation_disable;
499 double scroll_accel_factor;
500 unsigned char thumbscroll_bounce_enable;
501 double thumbscroll_border_friction;
502 double thumbscroll_sensitivity_friction;
503 unsigned char scroll_smooth_start_enable;
504 // double scroll_smooth_time_interval;; // not used anymore
505 double scroll_smooth_amount;
506 // double scroll_smooth_history_weight;; // not used anymore
507 // double scroll_smooth_future_time;; // not used anymore
508 double scroll_smooth_time_window;
509 double scale;
510 int bgpixmap;
511 int compositing;
512 Eina_List *font_dirs; // priv flags for Elm_Config_Flags -> up to here...
513 Eina_List *font_overlays;
514 int font_hinting;
515 int cache_flush_poll_interval;
516 unsigned char cache_flush_enable;
517 int image_cache;
518 int font_cache;
519 int edje_cache;
520 int edje_collection_cache;
521 int finger_size;
522 double fps;
523 const char *theme;
524 const char *modules;
525 double tooltip_delay;
526 unsigned char cursor_engine_only;
527 unsigned char focus_highlight_enable;
528 unsigned char focus_highlight_animate;
529 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. */
530 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. */
531 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.*/
532 unsigned char first_item_focus_on_first_focus_in; /**< This sets the first item focus on first focus in feature*/
533 Elm_Focus_Autoscroll_Mode focus_autoscroll_mode; /**< This shows the focus auto scroll mode. By default, @c ELM_FOCUS_AUTOSCROLL_MODE_SHOW is set. */
534 Elm_Slider_Indicator_Visible_Mode slider_indicator_visible_mode; /**< this sets the slider indicator visible mode */
535 double popup_horizontal_align;
536 double popup_vertical_align;
537 Eina_Bool popup_scrollable;
538 int toolbar_shrink_mode;
539 unsigned char fileselector_expand_enable;
540 unsigned char fileselector_double_tap_navigation_enable;
541 unsigned char inwin_dialogs_enable;
542 int icon_size;
543 double longpress_timeout;
544 unsigned char effect_enable;
545 unsigned char desktop_entry;
546 unsigned char context_menu_disabled;
547 unsigned char password_show_last;
548 double password_show_last_timeout;
549 unsigned char glayer_zoom_finger_enable;
550 double glayer_zoom_finger_factor;
551 double glayer_zoom_wheel_factor;
552 double glayer_zoom_distance_tolerance;
553 double glayer_rotate_finger_enable;
554 double glayer_rotate_angular_tolerance;
555 double glayer_line_min_length;
556 double glayer_line_distance_tolerance;
557 double glayer_line_angular_tolerance;
558 unsigned int glayer_flick_time_limit_ms;
559 double glayer_long_tap_start_timeout;
560 double glayer_double_tap_timeout;
561 int glayer_tap_finger_size;
562 Eina_Bool access_mode;
563 unsigned char glayer_continues_enable;
564 int week_start;
565 int weekend_start;
566 int weekend_len;
567 int year_min;
568 int year_max;
569 Eina_List *color_overlays;
570 Eina_List *color_palette;
571 unsigned char softcursor_mode;
572 unsigned char auto_norender_withdrawn;
573 unsigned char auto_norender_iconified_same_as_withdrawn;
574 unsigned char auto_flush_withdrawn;
575 unsigned char auto_dump_withdrawn;
576 unsigned char auto_throttle;
577 double auto_throttle_amount;
578 const char *indicator_service_0;
579 const char *indicator_service_90;
580 const char *indicator_service_180;
581 const char *indicator_service_270;
582 unsigned char selection_clear_enable;
583 unsigned char disable_external_menu;
584 unsigned char clouseau_enable;
585 unsigned char magnifier_enable;
586 double magnifier_scale;
587 unsigned char audio_mute_effect;
588 unsigned char audio_mute_background;
589 unsigned char audio_mute_music;
590 unsigned char audio_mute_foreground;
591 unsigned char audio_mute_interface;
592 unsigned char audio_mute_input;
593 unsigned char audio_mute_alert;
594 unsigned char audio_mute_all;
595 unsigned char win_auto_focus_enable;
596 unsigned char win_auto_focus_animate;
597 double transition_duration_factor;
598 unsigned char naviframe_prev_btn_auto_pushed;
599 unsigned char spinner_min_max_filter_enable;
600 Eina_List *bindings;
601 Eina_Bool atspi_mode;
602 int gl_depth;
603 int gl_stencil;
604 int gl_msaa;
605 const char *icon_theme;
606 unsigned char entry_select_allow;
607 Eina_Bool offline;
608 int powersave;
609 double drag_anim_duration;
610 unsigned char win_no_border;
611
612 /* Not part of the EET file */
613 Eina_Bool is_mirrored : 1;
614 Eina_Bool translate : 1;
615
616 Elm_Config_Flags priv;
617 };
618
619 struct _Elm_Config_Bindings_Widget
620 {
621 const char *name;
622 Eina_List *key_bindings;
623 };
624
625 struct _Elm_Config_Binding_Key
626 {
627 int context;
628 const char *key;
629 const char *action;
630 const char *params;
631 Eina_List *modifiers;
632 };
633
634 struct _Elm_Config_Binding_Modifier
635 {
636 const char *mod;
637 unsigned char flag;
638 };
639
640 struct _Elm_Module
641 {
642 int version;
643 const char *name;
644 const char *as;
645 const char *so_path;
646 const char *data_dir;
647 const char *bin_dir;
648 Eina_Module *module;
649 void *data;
650 void *api;
651 int (*init_func)(Elm_Module *m);
652 int (*shutdown_func)(Elm_Module *m);
653 int references;
654 };
655
656 Eina_Bool _elm_web_init(const char *engine);
657
658 Eo *_elm_atspi_bridge_get(void);
659 void _elm_atspi_bridge_init(void);
660 void _elm_atspi_bridge_shutdown(void);
661
662 Eina_Bool _elm_prefs_init(void);
663 void _elm_prefs_shutdown(void);
664
665 /* these already issued by the two above, respectively */
666 void _elm_prefs_data_init(void);
667 void _elm_prefs_data_shutdown(void);
668
669 /* init functions for dnd and cnp */
670 int _elm_ews_wm_init(void);
671 void _elm_ews_wm_shutdown(void);
672 void _elm_ews_wm_rescale(Elm_Theme *th,
673 Eina_Bool use_theme);
674
675 void _elm_win_shutdown(void);
676 void _elm_win_rescale(Elm_Theme *th,
677 Eina_Bool use_theme);
678 void _elm_win_access(Eina_Bool is_access);
679 void _elm_win_translate(void);
680 void _elm_win_focus_reconfigure(void);
681 void _elm_win_standard_init(Eo *win);
682
683 Ecore_X_Window _elm_ee_xwin_get(const Ecore_Evas *ee);
684
685 Eina_Error _elm_theme_object_set(Evas_Object *parent,
686 Evas_Object *o,
687 const char *clas,
688 const char *group,
689 const char *style);
690 Eina_Bool _elm_theme_object_icon_set(Evas_Object *o,
691 const char *group,
692 const char *style);
693 Eina_Error _elm_theme_set(Elm_Theme *th,
694 Evas_Object *o,
695 const char *clas,
696 const char *group,
697 const char *style,
698 Eina_Bool is_legacy);
699 Eina_Bool _elm_theme_icon_set(Elm_Theme *th,
700 Evas_Object *o,
701 const char *group,
702 const char *style);
703 Eina_File *_elm_theme_group_file_find(Elm_Theme *th,
704 const char *group);
705 void _elm_theme_parse(Elm_Theme *th,
706 const char *theme);
707 void _elm_theme_init(void);
708 void _elm_theme_shutdown(void);
709
710 void _elm_module_init(void);
711 void _elm_module_shutdown(void);
712 void _elm_module_parse(const char *s);
713 Elm_Module *_elm_module_find_as(const char *as);
714 Elm_Module *_elm_module_add(const char *name,
715 const char *as);
716 void _elm_module_del(Elm_Module *m);
717 Eina_Bool _elm_module_load(Elm_Module *m);
718 void _elm_module_unload(Elm_Module *m);
719 const void *_elm_module_symbol_get(Elm_Module *m,
720 const char *name);
721
722 void _elm_widget_focus_auto_show(Evas_Object *obj);
723 void _elm_widget_top_win_focused_set(Evas_Object *obj,
724 Eina_Bool top_win_focused);
725 Eina_Bool _elm_widget_top_win_focused_get(const Evas_Object *obj);
726
727 void _elm_unneed_systray(void);
728 void _elm_unneed_sys_notify(void);
729 void _elm_unneed_ethumb(void);
730 void _elm_unneed_web(void);
731
732 void _elm_rescale(void);
733 Eina_Bool _elm_old_clouseau_reload(void);
734
735 void _elm_config_init(void);
736 void _elm_config_sub_init(void);
737 void _elm_config_shutdown(void);
738 void _elm_config_sub_shutdown(void);
739 Eina_Bool _elm_config_save(Elm_Config *cfg, const char *profile);
740 void _elm_config_reload(void);
741 size_t _elm_config_user_dir_snprintf(char *dst, size_t size,
742 const char *fmt, ...)
743 EINA_PRINTF(3, 4);
744 void elm_color_class_init(void);
745 void elm_color_class_shutdown(void);
746 void _elm_recache(void);
747
748 const char *_elm_config_current_profile_get(void);
749 const char *_elm_config_profile_dir_get(const char *prof,
750 Eina_Bool is_user);
751 Eina_List *_elm_config_profiles_list(Eina_Bool hide_profiles);
752 void _elm_config_all_update(void);
753 void _elm_config_profile_set(const char *profile);
754
755 void _elm_config_engine_set(const char *engine);
756
757 Eina_List *_elm_config_font_overlays_list(void);
758 void _elm_config_font_overlay_set(const char *text_class,
759 const char *font,
760 Evas_Font_Size size);
761 void _elm_config_font_overlay_remove(const char *text_class);
762 void _elm_config_font_overlay_apply(void);
763 Eina_List *_elm_config_text_classes_get(void);
764 void _elm_config_text_classes_free(Eina_List *l);
765
766 Eina_List *_elm_config_color_classes_get(void);
767 void _elm_config_color_classes_free(Eina_List *l);
768 Eina_List *_elm_config_color_overlays_list(void);
769 void _elm_config_color_overlay_set(const char *color_class,
770 int r, int g, int b, int a,
771 int r2, int g2, int b2, int a2,
772 int r3, int g3, int b3, int a3);
773 void _elm_config_color_overlay_remove(const char *color_class);
774 void _elm_config_color_overlay_apply(void);
775
776 Eina_Bool _elm_config_access_get(void);
777 void _elm_config_access_set(Eina_Bool is_access);
778
779 Eina_Bool _elm_config_key_binding_call(Evas_Object *obj,
780 const char *name,
781 const Evas_Event_Key_Down *ev,
782 const Elm_Action *actions);
783
784 Elm_Font_Properties *_elm_font_properties_get(Eina_Hash **font_hash,
785 const char *font);
786 Eina_Hash *_elm_font_available_hash_add(Eina_Hash *font_hash,
787 const char *full_name);
788 void _elm_font_available_hash_del(Eina_Hash *hash);
789
790 void elm_tooltip_theme(Elm_Tooltip *tt);
791 void elm_object_sub_tooltip_content_cb_set(Evas_Object *eventarea,
792 Evas_Object *owner,
793 Elm_Tooltip_Content_Cb func,
794 const void *data,
795 Evas_Smart_Cb del_cb);
796 void elm_cursor_theme(Elm_Cursor *cur);
797 void elm_object_sub_cursor_set(Evas_Object *eventarea,
798 Evas_Object *owner,
799 const char *cursor);
800 const char * elm_object_sub_cursor_get(const Evas_Object *obj);
801 Eina_Bool elm_object_sub_cursor_style_set(Evas_Object *obj,
802 const char *style);
803 const char * elm_object_sub_cursor_style_get(const Evas_Object *obj);
804 Eina_Bool elm_object_sub_cursor_theme_search_enabled_set(Evas_Object *obj,
805 Eina_Bool theme_search);
806 Eina_Bool elm_object_sub_cursor_theme_search_enabled_get(const Evas_Object *obj);
807
808 void elm_menu_clone(Evas_Object *from_menu,
809 Evas_Object *to_menu,
810 Elm_Object_Item *parent);
811
812 char *_elm_util_mkup_to_text(const char *mkup);
813 char *_elm_util_text_to_mkup(const char *text);
814
815 Eina_Bool _elm_video_check(Evas_Object *video);
816
817 Eina_List *_elm_config_color_list_get(const char *palette_name);
818 void _elm_config_color_set(const char *palette_name,
819 int r,
820 int g,
821 int b,
822 int a);
823 void _elm_config_colors_free(const char *palette_name);
824
825 typedef struct _Elm_DBus_Menu Elm_DBus_Menu;
826
827 const char *_elm_dbus_menu_register(Eo *obj);
828 void _elm_dbus_menu_unregister(Eo *obj);
829 int _elm_dbus_menu_item_add(Elm_DBus_Menu *dbus_menu,
830 Elm_Object_Item *item);
831 void _elm_dbus_menu_update(Elm_DBus_Menu *dbus_menu);
832 void _elm_dbus_menu_item_delete(Elm_DBus_Menu *dbus_menu,
833 int id);
834
835 void _elm_dbus_menu_app_menu_register(Ecore_X_Window xid, Eo *obj,
836 void (*result_cb)(Eina_Bool, void *),
837 void *data);
838 void _elm_dbus_menu_app_menu_unregister(Eo *obj);
839 void _elm_dbus_menu_item_select_cb(Elm_Object_Item *obj_item);
840
841 void _elm_menu_menu_bar_set(Eo *obj, Eina_Bool menu_bar);
842 void _elm_menu_menu_bar_hide(Eo *obj);
843
844 # ifdef HAVE_ELEMENTARY_WL2
845 void _elm_win_wl_cursor_set(Evas_Object *obj, const char *cursor);
846 # endif
847
848 void _efl_ui_focus_manager_redirect_events_del(Efl_Ui_Focus_Manager *manager, Eo *obj);
849 void _efl_ui_focus_manager_redirect_events_add(Efl_Ui_Focus_Manager *manager, Eo *obj);
850
851 EOAPI Eina_Bool efl_ui_focus_manager_calc_update_children(Eo *obj, Efl_Ui_Focus_Object *parent, Eina_List *children EFL_TRANSFER_OWNERSHIP);
852 EOAPI void efl_ui_focus_manager_calc_update_order(Eo *obj, Efl_Ui_Focus_Object *parent, Eina_List *children EFL_TRANSFER_OWNERSHIP);
853
854
855 void _efl_access_shutdown(void);
856
857 /* Combobox: no proper support for Efl.Part API yet. */
858 void _elm_combobox_part_text_set(Eo *obj, const char * part, const char *label);
859 const char *_elm_combobox_part_text_get(const Eo *obj, const char *part);
860
861 /* DEPRECATED, will be removed on next release */
862 void _elm_icon_signal_emit(Evas_Object *obj,
863 const char *emission,
864 const char *source);
865 void _elm_icon_signal_callback_add(Evas_Object *obj,
866 const char *emission,
867 const char *source,
868 Edje_Signal_Cb func_cb,
869 void *data);
870 void *_elm_icon_signal_callback_del(Evas_Object *obj,
871 const char *emission,
872 const char *source,
873 Edje_Signal_Cb func_cb);
874 /* end of DEPRECATED */
875
876 /* DO NOT USE THIS this is only for performance optimization! */
877 void _elm_widget_full_eval(Eo *obj);
878 void _elm_widget_full_eval_children(Eo *obj, Elm_Widget_Smart_Data *pd);
879
880 Eina_Bool _elm_config_accel_preference_parse(const char *pref, Eina_Stringshare **accel, int *gl_depth, int *gl_stencil, int *gl_msaa);
881
882 extern char *_elm_appname;
883 extern Elm_Config *_elm_config;
884 extern Efl_Config *_efl_config_obj;
885 extern const char *_elm_data_dir;
886 extern const char *_elm_lib_dir;
887 extern int _elm_log_dom;
888 extern Eina_List *_elm_win_list;
889 extern int _elm_win_deferred_free;
890 extern const char *_elm_preferred_engine;
891 extern const char *_elm_accel_preference;
892 extern const char SIG_WIDGET_FOCUSED[];
893 extern const char SIG_WIDGET_UNFOCUSED[];
894 extern const char SIG_WIDGET_LANG_CHANGED[];
895 extern const char SIG_WIDGET_ACCESS_CHANGED[];
896 extern const char SIG_LAYOUT_FOCUSED[];
897 extern const char SIG_LAYOUT_UNFOCUSED[];
898
899 extern Eina_Stringshare *_property_style_ss;
900
901 Efl_Ui_Win *efl_ui_widget_factory_widget_get(Efl_Ui_Widget_Factory *factory);
902
903 extern Eina_Bool _config_profile_lock;
904
905 extern Eina_FreeQ *postponed_fq;
906
907 # ifdef ENABLE_NLS
908 /* Our gettext wrapper, used to disable translation of elm if the app
909 * is not translated. */
910 static inline const char *
_elm_dgettext(const char * string)911 _elm_dgettext(const char *string)
912 {
913 if (EINA_UNLIKELY(_elm_config->translate == EINA_FALSE))
914 {
915 return string;
916 }
917
918 return dgettext(PACKAGE, string);
919 }
920
921 # endif
922
923 extern Eina_Bool _running_in_tree;
924
925 /* Used by the paste handler */
926 void _elm_entry_entry_paste(Evas_Object *obj, const char *entry);
927
928 double _elm_atof(const char *s);
929
930 void _elm_layout_legacy_icon_signal_emit(Evas_Object *obj);
931 // elm_layout and elm_entry LEGACY signal API (returned the user data pointer)
932 void _elm_layout_signal_callback_add_legacy(Eo *obj, Eo *edje, Eina_List **p_edje_signals, const char *emission, const char *source, Edje_Signal_Cb func, void *data);
933 void *_elm_layout_signal_callback_del_legacy(Eo *obj, Eo *edje, Eina_List **p_edje_signals, const char *emission, const char *source, Edje_Signal_Cb func);
934 void _elm_entry_signal_callback_add_legacy(Eo *obj, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data);
935 void *_elm_entry_signal_callback_del_legacy(Eo *obj, const char *emission, const char *source, Edje_Signal_Cb func_cb);
936
937 void efl_ui_win_inlined_parent_set(Eo *obj, Efl_Canvas_Object *parent);
938
939 /* Internal EO APIs */
940 const Elm_Layout_Part_Alias_Description *efl_ui_layout_content_aliases_get(const Eo *obj);
941 const Elm_Layout_Part_Alias_Description *efl_ui_layout_text_aliases_get(const Eo *obj);
942 void efl_ui_slider_val_fetch(Evas_Object *obj, Eina_Bool user_event);
943 void efl_ui_slider_val_set(Evas_Object *obj);
944 void efl_ui_slider_down_knob(Evas_Object *obj, double button_x, double button_y);
945 void efl_ui_slider_move_knob(Evas_Object *obj, double button_x, double button_y);
946 //void elm_layout_sizing_eval_eoapi(Eo *obj);
947
948 # define _EFL_UI_LAYOUT_ALIASES_IMPLEMENT(_pfx, _typ) \
949 static const Elm_Layout_Part_Alias_Description * \
950 _##_pfx##_##_typ##_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED) \
951 { \
952 return _##_typ##_aliases; \
953 }
954
955 # define _EFL_UI_LAYOUT_ALIASES_OPS(_pfx, _typ) \
956 EFL_OBJECT_OP_FUNC(efl_ui_layout_##_typ##_aliases_get, _##_pfx##_##_typ##_aliases_get)
957
958 # define EFL_UI_LAYOUT_CONTENT_ALIASES_IMPLEMENT(_pfx) _EFL_UI_LAYOUT_ALIASES_IMPLEMENT(_pfx, content)
959 # define EFL_UI_LAYOUT_TEXT_ALIASES_IMPLEMENT(_pfx) _EFL_UI_LAYOUT_ALIASES_IMPLEMENT(_pfx, text)
960
961 # define EFL_UI_LAYOUT_CONTENT_ALIASES_OPS(_pfx) _EFL_UI_LAYOUT_ALIASES_OPS(_pfx, content)
962 # define EFL_UI_LAYOUT_TEXT_ALIASES_OPS(_pfx) _EFL_UI_LAYOUT_ALIASES_OPS(_pfx, text)
963
964 # define EFL_CANVAS_GROUP_CALC_OPS(_pfx) \
965 EFL_OBJECT_OP_FUNC(efl_canvas_group_calculate, _##_pfx##_efl_canvas_group_group_calculate)
966
967 # define ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(_pfx, _typ) \
968 EOLIAN static Eina_Bool \
969 _##_pfx##_efl_ui_widget_widget_input_event_handler(Eo *obj, _typ *_pd EINA_UNUSED, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED) \
970 { \
971 Evas_Event_Key_Down *ev; \
972 if (eo_event->desc != EFL_EVENT_KEY_DOWN) return EINA_FALSE; \
973 if (efl_input_processed_get(eo_event->info)) return EINA_FALSE; \
974 if (elm_widget_disabled_get(obj)) return EINA_FALSE; \
975 ev = efl_input_legacy_info_get(eo_event->info); \
976 if (!_elm_config_key_binding_call(obj, MY_CLASS_NAME, ev, key_actions)) return EINA_FALSE; \
977 efl_input_processed_set(eo_event->info, EINA_TRUE); \
978 return EINA_TRUE; \
979 }
980
981 static inline Efl_Ui_Layout_Orientation
efl_ui_layout_orientation_axis_get(Efl_Ui_Layout_Orientation orient)982 efl_ui_layout_orientation_axis_get(Efl_Ui_Layout_Orientation orient)
983 {
984 return orient & EFL_UI_LAYOUT_ORIENTATION_AXIS_BITMASK;
985 }
986
987 static inline Eina_Bool
efl_ui_layout_orientation_is_inverted(Efl_Ui_Layout_Orientation orient)988 efl_ui_layout_orientation_is_inverted(Efl_Ui_Layout_Orientation orient)
989 {
990 return ((orient & EFL_UI_LAYOUT_ORIENTATION_INVERTED) == EFL_UI_LAYOUT_ORIENTATION_INVERTED) ? EINA_TRUE : EINA_FALSE;
991 }
992
993 static inline Eina_Bool
efl_ui_layout_orientation_is_horizontal(Efl_Ui_Layout_Orientation orient,Eina_Bool def_val)994 efl_ui_layout_orientation_is_horizontal(Efl_Ui_Layout_Orientation orient, Eina_Bool def_val)
995 {
996 switch (orient & EFL_UI_LAYOUT_ORIENTATION_AXIS_BITMASK)
997 {
998 case EFL_UI_LAYOUT_ORIENTATION_DEFAULT: return !!def_val;
999 case EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL: return EINA_TRUE;
1000 case EFL_UI_LAYOUT_ORIENTATION_VERTICAL: return EINA_FALSE;
1001 default: return !!def_val;
1002 }
1003 }
1004
1005 /**
1006 * This function sets up handlers for emitting "unfocused" / "focused" events.
1007 * Once the passed manager object is active, "focused" is emitted, if it gets inactive "unfocused" is emitted
1008 */
1009 void legacy_efl_ui_focus_manager_widget_legacy_signals(Efl_Ui_Focus_Manager *manager, Efl_Ui_Focus_Manager *emittee);
1010
1011 /**
1012 * This function sets up handlers for emitting "unfocused" / "focused" events.
1013 * Once the children of the passed object are getting focus, "focused" will be emitted on the object, "unfocused" otherwise.
1014 */
1015 void legacy_child_focus_handle(Efl_Ui_Focus_Object *object);
1016
1017 /**
1018 * This function sets up handlers for emitting "unfocused" / "focused" events.
1019 * Once the passed object is getting focus, "focused" will be emitted on the object, "unfocused" otherwise.
1020 */
1021 void legacy_object_focus_handle(Efl_Ui_Focus_Object *object);
1022
1023 void _efl_ui_focus_event_redirector(Efl_Ui_Focus_Object *obj, Efl_Ui_Focus_Object *goal);
1024
1025 /**
1026 * With this flag you can indicate that this widget is used internally.
1027 * Indicating that a widget is internal, can be used by the implementing widget, that the parent property of the added sub-object should not be adjusted or altered.
1028 * There is no direct promise that any widget behaves like the above, every case should be handchecked.
1029 */
1030 void efl_ui_widget_internal_set(Eo *obj, Eina_Bool internal);
1031 Eina_Bool efl_ui_widget_internal_get(Eo *obj);
1032
1033 /**
1034 * Connect the default scrollable theme signals with the object events and vice versa
1035 *
1036 * @param obj The object where to listen for theme signals
1037 * @param manager The scroll manager object where to listen for events
1038 */
1039 void efl_ui_scroll_connector_bind(Eo *obj, Eo *manager);
1040
1041 /**
1042 * Connect the default scrollable theme signals with the object events and vice versa
1043 *
1044 * @param obj The object where we are listening for events
1045 */
1046 void efl_ui_scroll_connector_unbind(Eo *obj);
1047
1048 typedef struct
1049 {
1050 Eina_Bool custom_parent_provider;
1051 Eina_Bool legacy_focus_api_used;
1052 } Efl_Ui_Shared_Win_Data;
1053
1054 Efl_Ui_Shared_Win_Data* efl_ui_win_shared_data_get(Efl_Ui_Win *win);
1055
1056 void _selection_changed_event_register(Eo *obj);
1057 void _selection_changed_event_unregister(Eo *obj);
1058 void _drop_event_register(Eo *obj);
1059 void _drop_event_unregister(Eo *obj);
1060 void _register_selection_changed(Efl_Ui_Selection *selection);
1061 Efl_Ui_Win* efl_ui_win_get(Evas_Object *obj);
1062
1063 #endif
1064