4 #include "elementary_config.h"
6 #ifdef HAVE_ELEMENTARY_X
9 #ifdef HAVE_ELEMENTARY_FB
12 #ifdef HAVE_ELEMENTARY_WINCE
13 #include <Ecore_WinCE.h>
15 #ifdef HAVE_ELEMENTARY_WAYLAND
16 #include <Ecore_Wayland.h>
28 # ifdef ELEMENTARY_BUILD
30 # define EAPI __declspec(dllexport)
33 # endif /* ! DLL_EXPORT */
35 # define EAPI __declspec(dllimport)
36 # endif /* ! EFL_EVAS_BUILD */
40 # define EAPI __attribute__ ((visibility("default")))
49 #include "elm_widget.h"
51 #ifdef HAVE_LANGINFO_H
52 # include <langinfo.h>
55 #define CRITICAL(...) EINA_LOG_DOM_CRIT(_elm_log_dom, __VA_ARGS__)
56 #define ERR(...) EINA_LOG_DOM_ERR(_elm_log_dom, __VA_ARGS__)
57 #define WRN(...) EINA_LOG_DOM_WARN(_elm_log_dom, __VA_ARGS__)
58 #define INF(...) EINA_LOG_DOM_INFO(_elm_log_dom, __VA_ARGS__)
59 #define DBG(...) EINA_LOG_DOM_DBG(_elm_log_dom, __VA_ARGS__)
63 # define E_(string) _elm_dgettext(string)
66 # define setlocale(c, l)
68 # ifndef libintl_setlocale
69 # define libintl_setlocale(c, l)
71 # ifndef bindtextdomain
72 # define bindtextdomain(domain, dir)
74 # ifndef libintl_bindtextdomain
75 # define libintl_bindtextdomain(domain, dir)
77 # define E_(string) (string)
79 #define N_(string) (string)
81 typedef struct _Edje_Signal_Data Edje_Signal_Data;
82 typedef struct _Elm_Config Elm_Config;
83 typedef struct _Elm_Module Elm_Module;
84 typedef struct _Elm_Datetime_Module_Data Elm_Datetime_Module_Data;
86 struct _Edje_Signal_Data
101 Eina_Hash *cache_data;
102 Elm_Theme *ref_theme;
103 Eina_List *referrers;
108 /* increment this whenever we change config enough that you need new
109 * defaults for elm to work.
111 #define ELM_CONFIG_EPOCH 0x0001
112 /* increment this whenever a new set of config values are added but
113 * the users config doesn't need to be wiped - simply new values need
116 #define ELM_CONFIG_FILE_GENERATION 0x0003
117 #define ELM_CONFIG_VERSION ((ELM_CONFIG_EPOCH << 16) | \
118 ELM_CONFIG_FILE_GENERATION)
119 /* NB: profile configuration files (.src) must have their
120 * "config_version" entry's value up-to-date with ELM_CONFIG_VERSION
123 /* note: always remember to sync it with elm_config.c */
124 extern const char *_elm_engines[];
126 #define ELM_SOFTWARE_X11 (_elm_engines[0])
127 #define ELM_SOFTWARE_FB (_elm_engines[1])
128 #define ELM_SOFTWARE_DIRECTFB (_elm_engines[2])
129 #define ELM_SOFTWARE_16_X11 (_elm_engines[3])
130 #define ELM_SOFTWARE_8_X11 (_elm_engines[4])
131 #define ELM_XRENDER_X11 (_elm_engines[5])
132 #define ELM_OPENGL_X11 (_elm_engines[6])
133 #define ELM_SOFTWARE_WIN32 (_elm_engines[7])
134 #define ELM_SOFTWARE_16_WINCE (_elm_engines[8])
135 #define ELM_SOFTWARE_SDL (_elm_engines[9])
136 #define ELM_SOFTWARE_16_SDL (_elm_engines[10])
137 #define ELM_OPENGL_SDL (_elm_engines[11])
138 #define ELM_BUFFER (_elm_engines[12])
139 #define ELM_EWS (_elm_engines[13])
140 #define ELM_OPENGL_COCOA (_elm_engines[14])
141 #define ELM_SOFTWARE_PSL1GHT (_elm_engines[15])
142 #define ELM_WAYLAND_SHM (_elm_engines[16])
143 #define ELM_WAYLAND_EGL (_elm_engines[17])
145 #define ELM_FONT_TOKEN_STYLE ":style="
147 #define ELM_ACCESS_MODE_OFF EINA_FALSE
148 #define ELM_ACCESS_MODE_ON EINA_TRUE
151 #define MIN(x, y) (((x) < (y)) ? (x) : (y))
153 #define MAX(x, y) (((x) > (y)) ? (x) : (y))
160 unsigned char thumbscroll_enable;
161 int thumbscroll_threshold;
162 int thumbscroll_hold_threshold;
163 double thumbscroll_momentum_threshold;
164 double thumbscroll_friction;
165 double thumbscroll_bounce_friction;
166 double page_scroll_friction;
167 double bring_in_scroll_friction;
168 double zoom_friction;
169 unsigned char thumbscroll_bounce_enable;
170 double thumbscroll_border_friction;
171 double thumbscroll_sensitivity_friction;
172 double scroll_smooth_time_interval;
173 double scroll_smooth_amount;
174 double scroll_smooth_history_weight;
175 double scroll_smooth_future_time;
176 double scroll_smooth_time_window;
180 Eina_List *font_dirs;
181 Eina_List *font_overlays;
183 int cache_flush_poll_interval;
184 unsigned char cache_flush_enable;
188 int edje_collection_cache;
193 double tooltip_delay;
194 unsigned char cursor_engine_only;
195 unsigned char focus_highlight_enable;
196 unsigned char focus_highlight_animate;
197 int toolbar_shrink_mode;
198 unsigned char fileselector_expand_enable;
199 unsigned char inwin_dialogs_enable;
201 double longpress_timeout;
202 unsigned char effect_enable;
203 unsigned char desktop_entry;
204 unsigned char password_show_last;
205 double password_show_last_timeout;
206 unsigned char glayer_zoom_finger_enable;
207 double glayer_zoom_finger_factor;
208 double glayer_zoom_wheel_factor;
209 double glayer_zoom_distance_tolerance;
210 double glayer_rotate_finger_enable;
211 double glayer_rotate_angular_tolerance;
212 double glayer_line_min_length;
213 double glayer_line_distance_tolerance;
214 double glayer_line_angular_tolerance;
215 unsigned int glayer_flick_time_limit_ms;
216 double glayer_long_tap_start_timeout;
217 double glayer_double_tap_timeout;
218 Eina_Bool access_mode;
219 unsigned char glayer_continues_enable;
225 Eina_List *color_palette;
226 unsigned char softcursor_mode;
227 unsigned char auto_norender_withdrawn;
228 unsigned char auto_norender_iconified_same_as_withdrawn;
229 unsigned char auto_flush_withdrawn;
230 unsigned char auto_dump_withdrawn;
231 unsigned char auto_throttle;
232 double auto_throttle_amount;
233 const char *indicator_service_0;
234 const char *indicator_service_90;
235 const char *indicator_service_180;
236 const char *indicator_service_270;
237 unsigned char selection_clear_enable;
239 /* Not part of the EET file */
240 Eina_Bool is_mirrored : 1;
241 Eina_Bool translate : 1;
250 const char *data_dir;
255 int (*init_func)(Elm_Module *m);
256 int (*shutdown_func)(Elm_Module *m);
260 struct _Elm_Datetime_Module_Data
263 void (*field_limit_get)(Evas_Object *obj,
264 Elm_Datetime_Field_Type field_type,
267 const char *(*field_format_get)(Evas_Object * obj,
268 Elm_Datetime_Field_Type field_type);
271 void _elm_emotion_init(void);
272 void _elm_emotion_shutdown(void);
274 int _elm_ews_wm_init(void);
275 void _elm_ews_wm_shutdown(void);
276 void _elm_ews_wm_rescale(Elm_Theme *th,
277 Eina_Bool use_theme);
279 void _elm_win_shutdown(void);
280 void _elm_win_rescale(Elm_Theme *th,
281 Eina_Bool use_theme);
282 void _elm_win_access(Eina_Bool is_access);
283 void _elm_win_translate(void);
285 Ecore_X_Window _elm_ee_xwin_get(const Ecore_Evas *ee);
287 Eina_Bool _elm_theme_object_set(Evas_Object *parent,
292 Eina_Bool _elm_theme_object_icon_set(Evas_Object *o,
295 Eina_Bool _elm_theme_set(Elm_Theme *th,
300 Eina_Bool _elm_theme_icon_set(Elm_Theme *th,
304 Eina_Bool _elm_theme_parse(Elm_Theme *th,
306 void _elm_theme_shutdown(void);
308 void _elm_module_init(void);
309 void _elm_module_shutdown(void);
310 void _elm_module_parse(const char *s);
311 Elm_Module *_elm_module_find_as(const char *as);
312 Elm_Module *_elm_module_add(const char *name,
314 void _elm_module_del(Elm_Module *m);
315 Eina_Bool _elm_module_load(Elm_Module *m);
316 void _elm_module_unload(Elm_Module *m);
317 const void *_elm_module_symbol_get(Elm_Module *m,
320 void _elm_widget_top_win_focused_set(Evas_Object *obj,
321 Eina_Bool top_win_focused);
322 Eina_Bool _elm_widget_top_win_focused_get(const Evas_Object *obj);
324 void _elm_unneed_ethumb(void);
325 void _elm_unneed_web(void);
327 void _elm_rescale(void);
329 void _elm_config_init(void);
330 void _elm_config_sub_init(void);
331 void _elm_config_shutdown(void);
332 void _elm_config_sub_shutdown(void);
333 Eina_Bool _elm_config_save(void);
334 void _elm_config_reload(void);
336 void _elm_recache(void);
338 const char *_elm_config_current_profile_get(void);
339 const char *_elm_config_profile_dir_get(const char *prof,
341 Eina_List *_elm_config_profiles_list(void);
342 void _elm_config_all_update(void);
343 void _elm_config_profile_set(const char *profile);
344 Eina_Bool _elm_config_profile_exists(const char *profile);
346 void _elm_config_engine_set(const char *engine);
348 Eina_List *_elm_config_font_overlays_list(void);
349 void _elm_config_font_overlay_set(const char *text_class,
351 Evas_Font_Size size);
352 void _elm_config_font_overlay_remove(const char *text_class);
353 void _elm_config_font_overlay_apply(void);
354 Eina_List *_elm_config_text_classes_get(void);
355 void _elm_config_text_classes_free(Eina_List *l);
357 Eina_Bool _elm_config_access_get(void);
358 void _elm_config_access_set(Eina_Bool is_access);
360 Elm_Font_Properties *_elm_font_properties_get(Eina_Hash **font_hash,
362 Eina_Hash *_elm_font_available_hash_add(Eina_Hash *font_hash,
363 const char *full_name);
364 void _elm_font_available_hash_del(Eina_Hash *hash);
366 void elm_tooltip_theme(Elm_Tooltip *tt);
367 void elm_object_sub_tooltip_content_cb_set(Evas_Object *eventarea,
369 Elm_Tooltip_Content_Cb func,
371 Evas_Smart_Cb del_cb);
372 void elm_cursor_theme(Elm_Cursor *cur);
373 void elm_object_sub_cursor_set(Evas_Object *eventarea,
377 void elm_menu_clone(Evas_Object *from_menu,
378 Evas_Object *to_menu,
379 Elm_Object_Item *parent);
381 char *_elm_util_mkup_to_text(const char *mkup);
382 char *_elm_util_text_to_mkup(const char *text);
384 Eina_Bool _elm_video_check(Evas_Object *video);
386 Eina_List *_elm_config_color_list_get(const char *palette_name);
387 void _elm_config_color_set(const char *palette_name,
392 void _elm_config_colors_free(const char *palette_name);
394 /* DEPRECATED, will be removed on next release */
395 void _elm_icon_signal_emit(Evas_Object *obj,
396 const char *emission,
398 void _elm_icon_signal_callback_add(Evas_Object *obj,
399 const char *emission,
401 Edje_Signal_Cb func_cb,
403 void *_elm_icon_signal_callback_del(Evas_Object *obj,
404 const char *emission,
406 Edje_Signal_Cb func_cb);
407 /* end of DEPRECATED */
409 extern char *_elm_appname;
410 extern Elm_Config *_elm_config;
411 extern const char *_elm_data_dir;
412 extern const char *_elm_lib_dir;
413 extern int _elm_log_dom;
414 extern Eina_List *_elm_win_list;
415 extern int _elm_win_deferred_free;
416 extern const char *_elm_preferred_engine;
419 /* Our gettext wrapper, used to disable translation of elm if the app
420 * is not translated. */
421 static inline const char *
422 _elm_dgettext(const char *string)
424 if (EINA_UNLIKELY(_elm_config->translate == EINA_FALSE))
429 return dgettext(PACKAGE, string);
434 /* Used by the paste handler */
435 void _elm_entry_entry_paste(Evas_Object *obj, const char *entry);
437 double _elm_atof(const char *s);