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>
16 #include "elm_widget.h"
18 #define CRITICAL(...) EINA_LOG_DOM_CRIT(_elm_log_dom, __VA_ARGS__)
19 #define ERR(...) EINA_LOG_DOM_ERR (_elm_log_dom, __VA_ARGS__)
20 #define WRN(...) EINA_LOG_DOM_WARN(_elm_log_dom, __VA_ARGS__)
21 #define INF(...) EINA_LOG_DOM_INFO(_elm_log_dom, __VA_ARGS__)
22 #define DBG(...) EINA_LOG_DOM_DBG (_elm_log_dom, __VA_ARGS__)
26 #define E_(string) _elm_dgettext(string)
29 #define setlocale(c, l)
31 #ifndef libintl_setlocale
32 #define libintl_setlocale(c, l)
34 #ifndef bindtextdomain
35 #define bindtextdomain(domain, dir)
37 #ifndef libintl_bindtextdomain
38 #define libintl_bindtextdomain(domain, dir)
40 #define E_(string) (string)
42 #define N_(string) (string)
44 typedef struct _Elm_Config Elm_Config;
45 typedef struct _Elm_Module Elm_Module;
46 typedef struct _Elm_Datetime_Module_Data Elm_Datetime_Module_Data;
54 Eina_Hash *cache_data;
61 /* increment this whenever we change config enough that you need new
62 * defaults for elm to work.
64 #define ELM_CONFIG_EPOCH 0x0001
65 /* increment this whenever a new set of config values are added but the users
66 * config doesn't need to be wiped - simply new values need to be put in
68 #define ELM_CONFIG_FILE_GENERATION 0x0003
69 #define ELM_CONFIG_VERSION ((ELM_CONFIG_EPOCH << 16) | ELM_CONFIG_FILE_GENERATION)
70 /* NB: profile configuration files (.src) must have their
71 * "config_version" entry's value up-to-date with ELM_CONFIG_VERSION
74 /* note: always remember to sync it with elm_config.c */
75 extern const char *_elm_engines[];
77 #define ELM_SOFTWARE_X11 (_elm_engines[0])
78 #define ELM_SOFTWARE_FB (_elm_engines[1])
79 #define ELM_SOFTWARE_DIRECTFB (_elm_engines[2])
80 #define ELM_SOFTWARE_16_X11 (_elm_engines[3])
81 #define ELM_SOFTWARE_8_X11 (_elm_engines[4])
82 #define ELM_XRENDER_X11 (_elm_engines[5])
83 #define ELM_OPENGL_X11 (_elm_engines[6])
84 #define ELM_SOFTWARE_WIN32 (_elm_engines[7])
85 #define ELM_SOFTWARE_16_WINCE (_elm_engines[8])
86 #define ELM_SOFTWARE_SDL (_elm_engines[9])
87 #define ELM_SOFTWARE_16_SDL (_elm_engines[10])
88 #define ELM_OPENGL_SDL (_elm_engines[11])
89 #define ELM_BUFFER (_elm_engines[12])
90 #define ELM_EWS (_elm_engines[13])
91 #define ELM_OPENGL_COCOA (_elm_engines[14])
92 #define ELM_SOFTWARE_PSL1GHT (_elm_engines[15])
93 #define ELM_WAYLAND_SHM (_elm_engines[16])
94 #define ELM_WAYLAND_EGL (_elm_engines[17])
96 #define ELM_FONT_TOKEN_STYLE ":style="
98 #define ELM_ACCESS_MODE_OFF 0
99 #define ELM_ACCESS_MODE_ON 1
102 #define MIN(x, y) (((x) < (y)) ? (x) : (y))
104 #define MAX(x, y) (((x) > (y)) ? (x) : (y))
111 unsigned char thumbscroll_enable;
112 int thumbscroll_threshold;
113 double thumbscroll_momentum_threshold;
114 double thumbscroll_friction;
115 double thumbscroll_bounce_friction;
116 double page_scroll_friction;
117 double bring_in_scroll_friction;
118 double zoom_friction;
119 unsigned char thumbscroll_bounce_enable;
120 double thumbscroll_border_friction;
121 double thumbscroll_sensitivity_friction;
122 double scroll_smooth_time_interval;
123 double scroll_smooth_amount;
124 double scroll_smooth_history_weight;
125 double scroll_smooth_future_time;
126 double scroll_smooth_time_window;
130 Eina_List *font_dirs;
131 Eina_List *font_overlays;
133 int cache_flush_poll_interval;
134 unsigned char cache_flush_enable;
138 int edje_collection_cache;
143 double tooltip_delay;
144 unsigned char cursor_engine_only;
145 unsigned char focus_highlight_enable;
146 unsigned char focus_highlight_animate;
147 int toolbar_shrink_mode;
148 unsigned char fileselector_expand_enable;
149 unsigned char inwin_dialogs_enable;
151 double longpress_timeout;
152 unsigned char effect_enable;
153 unsigned char desktop_entry;
154 Eina_Bool password_show_last;
155 double password_show_last_timeout;
156 Eina_Bool glayer_zoom_finger_enable;
157 double glayer_zoom_finger_factor;
158 double glayer_zoom_wheel_factor;
159 double glayer_zoom_distance_tolerance;
160 double glayer_rotate_finger_enable;
161 double glayer_rotate_angular_tolerance;
162 double glayer_line_min_length;
163 double glayer_line_distance_tolerance;
164 double glayer_line_angular_tolerance;
165 unsigned int glayer_flick_time_limit_ms;
166 double glayer_long_tap_start_timeout;
168 Eina_Bool glayer_continues_enable;
172 Eina_List *color_palette;
174 /* Not part of the EET file */
175 Eina_Bool is_mirrored : 1;
176 Eina_Bool translate : 1;
185 const char *data_dir;
190 int (*init_func)(Elm_Module *m);
191 int (*shutdown_func)(Elm_Module *m);
195 struct _Elm_Datetime_Module_Data
198 void (*field_limit_get)(Evas_Object *obj, Elm_Datetime_Field_Type field_type, int *range_min, int *range_max);
199 const char *(*field_format_get)(Evas_Object * obj, Elm_Datetime_Field_Type field_type);
202 int _elm_ews_wm_init(void);
203 void _elm_ews_wm_shutdown(void);
204 void _elm_ews_wm_rescale(Elm_Theme *th, Eina_Bool use_theme);
206 void _elm_win_shutdown(void);
207 void _elm_win_rescale(Elm_Theme *th, Eina_Bool use_theme);
208 void _elm_win_translate(void);
210 Eina_Bool _elm_theme_object_set(Evas_Object *parent, Evas_Object *o, const char *clas, const char *group, const char *style);
211 Eina_Bool _elm_theme_object_icon_set(Evas_Object *parent, Evas_Object *o, const char *group, const char *style);
212 Eina_Bool _elm_theme_set(Elm_Theme *th, Evas_Object *o, const char *clas, const char *group, const char *style);
213 Eina_Bool _elm_theme_icon_set(Elm_Theme *th, Evas_Object *o, const char *group, const char *style);
214 Eina_Bool _elm_theme_parse(Elm_Theme *th, const char *theme);
215 void _elm_theme_shutdown(void);
217 void _elm_module_init(void);
218 void _elm_module_shutdown(void);
219 void _elm_module_parse(const char *s);
220 Elm_Module *_elm_module_find_as(const char *as);
221 Elm_Module *_elm_module_add(const char *name, const char *as);
222 void _elm_module_del(Elm_Module *m);
223 Eina_Bool _elm_module_load(Elm_Module *m);
224 void _elm_module_unload(Elm_Module *m);
225 const void *_elm_module_symbol_get(Elm_Module *m, const char *name);
227 void _elm_widget_type_clear(void);
228 void _elm_widget_focus_region_show(const Evas_Object *obj);
229 void _elm_widget_top_win_focused_set(Evas_Object *obj, Eina_Bool top_win_focused);
230 Eina_Bool _elm_widget_top_win_focused_get(const Evas_Object *obj);
232 void _elm_unneed_ethumb(void);
233 void _elm_unneed_web(void);
235 void _elm_rescale(void);
236 void _elm_widget_mirrored_reload(Evas_Object *obj);
238 void _elm_config_init(void);
239 void _elm_config_sub_init(void);
240 void _elm_config_shutdown(void);
241 void _elm_config_sub_shutdown(void);
242 Eina_Bool _elm_config_save(void);
243 void _elm_config_reload(void);
245 void _elm_recache(void);
247 const char *_elm_config_current_profile_get(void);
248 const char *_elm_config_profile_dir_get(const char *prof, Eina_Bool is_user);
249 Eina_List *_elm_config_profiles_list(void);
250 void _elm_config_all_update(void);
251 void _elm_config_profile_set(const char *profile);
253 void _elm_config_engine_set(const char *engine);
255 Eina_List *_elm_config_font_overlays_list(void);
256 void _elm_config_font_overlay_set(const char *text_class, const char *font, Evas_Font_Size size);
257 void _elm_config_font_overlay_remove(const char *text_class);
258 void _elm_config_font_overlay_apply(void);
259 Eina_List *_elm_config_text_classes_get(void);
260 void _elm_config_text_classes_free(Eina_List *l);
262 Elm_Font_Properties *_elm_font_properties_get(Eina_Hash **font_hash, const char *font);
263 Eina_Hash *_elm_font_available_hash_add(Eina_Hash *font_hash, const char *full_name);
264 void _elm_font_available_hash_del(Eina_Hash *hash);
266 void elm_tooltip_theme(Elm_Tooltip *tt);
267 void elm_object_sub_tooltip_content_cb_set(Evas_Object *eventarea, Evas_Object *owner, Elm_Tooltip_Content_Cb func, const void *data, Evas_Smart_Cb del_cb);
268 void elm_cursor_theme(Elm_Cursor *cur);
269 void elm_object_sub_cursor_set(Evas_Object *eventarea, Evas_Object *owner, const char *cursor);
271 void elm_menu_clone(Evas_Object *from_menu, Evas_Object *to_menu, Elm_Object_Item *parent);
273 Eina_Bool _elm_dangerous_call_check(const char *call);
275 Evas_Object *_elm_scroller_edje_object_get(Evas_Object *obj);
277 char *_elm_util_mkup_to_text(const char *mkup);
278 char *_elm_util_text_to_mkup(const char *text);
280 Eina_Bool _elm_video_check(Evas_Object *video);
282 Eina_List *_elm_config_color_list_get(const char *palette_name);
283 void _elm_config_color_set(const char *palette_name, int r, int g, int b, int a);
284 void _elm_config_colors_free(const char *palette_name);
286 extern char *_elm_appname;
287 extern Elm_Config *_elm_config;
288 extern const char *_elm_data_dir;
289 extern const char *_elm_lib_dir;
290 extern int _elm_log_dom;
291 extern Eina_List *_elm_win_list;
292 extern int _elm_win_deferred_free;
293 extern const char *_elm_preferred_engine;
296 /* Our gettext wrapper, used to disable translation of elm if the app
297 * is not translated. */
298 static inline const char *
299 _elm_dgettext(const char *string)
301 if (EINA_UNLIKELY(_elm_config->translate == EINA_FALSE))
306 return dgettext(PACKAGE, string);
311 /* Used by the paste handler */
312 void _elm_entry_entry_paste(Evas_Object *obj, const char *entry);