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