221996ecb7297ad0297c2c6c7137f108048b826d
[framework/uifw/elementary.git] / src / lib / elm_priv.h
1 #ifndef ELM_PRIV_H
2 #define ELM_PRIV_H
3 #ifdef HAVE_CONFIG_H
4 # include "elementary_config.h"
5 #endif
6 #ifdef HAVE_ELEMENTARY_X
7 # include <Ecore_X.h>
8 #endif
9 #ifdef HAVE_ELEMENTARY_FB
10 # include <Ecore_Fb.h>
11 #endif
12 #ifdef HAVE_ELEMENTARY_WINCE
13 # include <Ecore_WinCE.h>
14 #endif
15
16 #include "elm_widget.h"
17
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__)
23
24 #ifdef ENABLE_NLS
25 # include <libintl.h>
26 # define E_(string) dgettext(PACKAGE, string)
27 #else
28 # define bindtextdomain(domain,dir)
29 # define E_(string) (string)
30 #endif
31 #define N_(string) (string)
32
33 typedef struct _Elm_Config    Elm_Config;
34 typedef struct _Elm_Module    Elm_Module;
35
36 struct _Elm_Theme
37 {
38    Eina_List  *overlay;
39    Eina_List  *themes;
40    Eina_List  *extension;
41    Eina_Hash  *cache;
42    Eina_Hash  *cache_data;
43    Elm_Theme  *ref_theme;
44    Eina_List  *referrers;
45    const char *theme;
46    int         ref;
47 };
48
49 /* increment this whenever we change config enough that you need new
50  * defaults for elm to work.
51  */
52 #define ELM_CONFIG_EPOCH           0x0001
53 /* increment this whenever a new set of config values are added but the users
54  * config doesn't need to be wiped - simply new values need to be put in
55  */
56 #define ELM_CONFIG_FILE_GENERATION 0x0003
57 #define ELM_CONFIG_VERSION         ((ELM_CONFIG_EPOCH << 16) | ELM_CONFIG_FILE_GENERATION)
58 /* NB: profile configuration files (.src) must have their
59  * "config_version" entry's value up-to-date with ELM_CONFIG_VERSION
60  * (in decimal)!! */
61
62 /* note: always remember to sync it with elm_config.c */
63 extern const char *_elm_engines[];
64
65 #define ELM_SOFTWARE_X11      (_elm_engines[0])
66 #define ELM_SOFTWARE_FB       (_elm_engines[1])
67 #define ELM_SOFTWARE_DIRECTFB (_elm_engines[2])
68 #define ELM_SOFTWARE_16_X11   (_elm_engines[3])
69 #define ELM_SOFTWARE_8_X11    (_elm_engines[4])
70 #define ELM_XRENDER_X11       (_elm_engines[5])
71 #define ELM_OPENGL_X11        (_elm_engines[6])
72 #define ELM_SOFTWARE_WIN32    (_elm_engines[7])
73 #define ELM_SOFTWARE_16_WINCE (_elm_engines[8])
74 #define ELM_SOFTWARE_SDL      (_elm_engines[9])
75 #define ELM_SOFTWARE_16_SDL   (_elm_engines[10])
76 #define ELM_OPENGL_SDL        (_elm_engines[11])
77 #define ELM_BUFFER            (_elm_engines[12])
78 #define ELM_EWS               (_elm_engines[13])
79 #define ELM_OPENGL_COCOA      (_elm_engines[14])
80 #define ELM_SOFTWARE_PSL1GHT  (_elm_engines[15])
81
82 #define ELM_FONT_TOKEN_STYLE ":style="
83
84 #define ELM_ACCESS_MODE_OFF 0
85 #define ELM_ACCESS_MODE_ON 1
86
87 struct _Elm_Config
88 {
89    int            config_version;
90    const char    *engine;
91    unsigned char  vsync;
92    unsigned char  thumbscroll_enable;
93    int            thumbscroll_threshold;
94    double         thumbscroll_momentum_threshold;
95    double         thumbscroll_friction;
96    double         thumbscroll_bounce_friction;
97    double         page_scroll_friction;
98    double         bring_in_scroll_friction;
99    double         zoom_friction;
100    unsigned char  thumbscroll_bounce_enable;
101    double         thumbscroll_border_friction;
102    double         thumbscroll_sensitivity_friction;
103    double         scroll_smooth_time_interval;
104    double         scroll_smooth_amount;
105    double         scroll_smooth_history_weight;
106    double         scroll_smooth_future_time;
107    double         scroll_smooth_time_window;
108    double         scale;
109    int            bgpixmap;
110    int            compositing;
111    Eina_List     *font_dirs;
112    Eina_List     *font_overlays;
113    int            font_hinting;
114    int            cache_flush_poll_interval;
115    unsigned char  cache_flush_enable;
116    int            image_cache;
117    int            font_cache;
118    int            edje_cache;
119    int            edje_collection_cache;
120    int            finger_size;
121    double         fps;
122    const char    *theme;
123    const char    *modules;
124    double         tooltip_delay;
125    unsigned char  cursor_engine_only;
126    unsigned char  focus_highlight_enable;
127    unsigned char  focus_highlight_animate;
128    int            toolbar_shrink_mode;
129    unsigned char  fileselector_expand_enable;
130    unsigned char  inwin_dialogs_enable;
131    int            icon_size;
132    double         longpress_timeout;
133    unsigned char  effect_enable;
134    unsigned char  desktop_entry;
135    Eina_Bool      is_mirrored : 1;
136    Eina_Bool      password_show_last;
137    double         password_show_last_timeout;
138    Eina_Bool      glayer_zoom_finger_enable;
139    double         glayer_zoom_finger_factor;
140    double         glayer_zoom_wheel_factor;
141    double         glayer_zoom_distance_tolerance;
142    double         glayer_rotate_angular_tolerance;
143    double         glayer_line_min_length;
144    double         glayer_line_distance_tolerance;
145    double         glayer_line_angular_tolerance;
146    unsigned int   glayer_flick_time_limit_ms;
147    double         glayer_long_tap_start_timeout;
148    int            access_mode;
149    Eina_Bool      glayer_continues_enable;
150 };
151
152 struct _Elm_Module
153 {
154    int          version;
155    const char  *name;
156    const char  *as;
157    const char  *so_path;
158    const char  *data_dir;
159    const char  *bin_dir;
160    void        *handle;
161    void        *data;
162    void        *api;
163    int        (*init_func) (Elm_Module *m);
164    int        (*shutdown_func) (Elm_Module *m);
165    int          references;
166 };
167
168 void                _elm_win_shutdown(void);
169 void                _elm_win_rescale(Elm_Theme *th, Eina_Bool use_theme);
170 void                _elm_win_translate(void);
171
172 Eina_Bool           _elm_theme_object_set(Evas_Object *parent, Evas_Object *o, const char *clas, const char *group, const char *style);
173 Eina_Bool           _elm_theme_object_icon_set(Evas_Object *parent, Evas_Object *o, const char *group, const char *style);
174 Eina_Bool           _elm_theme_set(Elm_Theme *th, Evas_Object *o, const char *clas, const char *group, const char *style);
175 Eina_Bool           _elm_theme_icon_set(Elm_Theme *th, Evas_Object *o, const char *group, const char *style);
176 Eina_Bool           _elm_theme_parse(Elm_Theme *th, const char *theme);
177 void                _elm_theme_shutdown(void);
178
179 void                _elm_module_init(void);
180 void                _elm_module_shutdown(void);
181 void                _elm_module_parse(const char *s);
182 Elm_Module         *_elm_module_find_as(const char *as);
183 Elm_Module         *_elm_module_add(const char *name, const char *as);
184 void                _elm_module_del(Elm_Module *m);
185 Eina_Bool           _elm_module_load(Elm_Module *m);
186 void                _elm_module_unload(Elm_Module *m);
187 const void         *_elm_module_symbol_get(Elm_Module *m, const char *name);
188
189 void                _elm_widget_type_clear(void);
190 void                _elm_widget_focus_region_show(const Evas_Object *obj);
191 void                _elm_widget_top_win_focused_set(Evas_Object *obj, Eina_Bool top_win_focused);
192 Eina_Bool           _elm_widget_top_win_focused_get(const Evas_Object *obj);
193
194 void                _elm_unneed_ethumb(void);
195 void                _elm_unneed_web(void);
196
197 void                _elm_rescale(void);
198 void                _elm_widget_mirrored_reload(Evas_Object *obj);
199
200 void                _elm_config_init(void);
201 void                _elm_config_sub_init(void);
202 void                _elm_config_shutdown(void);
203 Eina_Bool           _elm_config_save(void);
204 void                _elm_config_reload(void);
205
206 void                _elm_recache(void);
207
208 const char         *_elm_config_current_profile_get(void);
209 const char         *_elm_config_profile_dir_get(const char *prof, Eina_Bool is_user);
210 Eina_List          *_elm_config_profiles_list(void);
211 void                _elm_config_profile_set(const char *profile);
212
213 void                _elm_config_engine_set(const char *engine);
214
215 Eina_List          *_elm_config_font_overlays_list(void);
216 void                _elm_config_font_overlay_set(const char *text_class, const char *font, Evas_Font_Size size);
217 void                _elm_config_font_overlay_remove(const char *text_class);
218 void                _elm_config_font_overlay_apply(void);
219 Eina_List          *_elm_config_text_classes_get(void);
220 void                _elm_config_text_classes_free(Eina_List *l);
221
222 Elm_Font_Properties *_elm_font_properties_get(Eina_Hash **font_hash, const char *font);
223 Eina_Hash           *_elm_font_available_hash_add(Eina_Hash *font_hash, const char *full_name);
224 void                 _elm_font_available_hash_del(Eina_Hash *hash);
225
226 void                _els_box_layout(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, int homogeneous, int rtl);
227 void                 elm_tooltip_theme(Elm_Tooltip *tt);
228 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);
229 void                 elm_cursor_theme(Elm_Cursor *cur);
230 void                 elm_object_sub_cursor_set(Evas_Object *eventarea, Evas_Object *owner, const char *cursor);
231
232 void                 elm_menu_clone(Evas_Object *from_menu, Evas_Object *to_menu, Elm_Menu_Item *parent);
233
234 Eina_Bool           _elm_dangerous_call_check(const char *call);
235
236 Evas_Object        *_elm_scroller_edje_object_get(Evas_Object *obj);
237
238 char               *_elm_util_mkup_to_text(const char *mkup);
239 char               *_elm_util_text_to_mkup(const char *text);
240 /* do not use except clipboard history module */
241 EAPI Eina_Bool    elm_cbhm_helper_init(Evas_Object *self);
242 EAPI void         elm_cbhm_send_raw_data(char *cmd);
243
244 Eina_Bool           _elm_video_check(Evas_Object *video);
245
246
247 extern char        *_elm_appname;
248 extern Elm_Config  *_elm_config;
249 extern const char  *_elm_data_dir;
250 extern const char  *_elm_lib_dir;
251 extern int          _elm_log_dom;
252 extern Eina_List   *_elm_win_list;
253 extern int          _elm_win_deferred_free;
254
255 #endif