summaryrefslogtreecommitdiff
path: root/src/bin/e_config.h
blob: 35311fd90c84a0fbcc989ea3b52c934d82656e9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/*
 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
 */
#ifdef E_TYPEDEFS

#define E_CONFIG_DD_NEW(str, typ) \
   eet_data_descriptor_new(str, sizeof(typ), \
			      (void *(*) (void *))evas_list_next, \
			      (void *(*) (void *, void *))evas_list_append, \
			      (void *(*) (void *))evas_list_data, \
			      (void *(*) (void *))evas_list_free, \
			      (void  (*) (void *, int (*) (void *, const char *, void *, void *), void *))evas_hash_foreach, \
			      (void *(*) (void *, const char *, void *))evas_hash_add, \
			      (void  (*) (void *))evas_hash_free)
#define E_CONFIG_DD_FREE(eed) if (eed) { eet_data_descriptor_free((eed)); (eed) = NULL; }
#define E_CONFIG_VAL(edd, type, member, dtype) EET_DATA_DESCRIPTOR_ADD_BASIC(edd, type, #member, member, dtype)
#define E_CONFIG_SUB(edd, type, member, eddtype) EET_DATA_DESCRIPTOR_ADD_SUB(edd, type, #member, member, eddtype)
#define E_CONFIG_LIST(edd, type, member, eddtype) EET_DATA_DESCRIPTOR_ADD_LIST(edd, type, #member, member, eddtype)

#define CHAR   EET_T_CHAR
#define SHORT  EET_T_SHORT
#define INT    EET_T_INT
#define LL     EET_T_LONG_LONG
#define FLOAT  EET_T_FLOAT
#define DOUBLE EET_T_DOUBLE
#define UCHAR  EET_T_UCHAR
#define USHORT EET_T_USHORT
#define UINT   EET_T_UINT
#define ULL    EET_T_ULONG_LONG
#define STR    EET_T_STRING

#define E_CONFIG_LIMIT(v, min, max) {if (v > max) v = max; else if (v < min) v = min;}

typedef struct _E_Config                E_Config;
typedef struct _E_Config_Module         E_Config_Module;
typedef struct _E_Config_Theme          E_Config_Theme;
typedef struct _E_Config_Binding_Mouse  E_Config_Binding_Mouse;
typedef struct _E_Config_Binding_Key    E_Config_Binding_Key;
typedef Eet_Data_Descriptor             E_Config_DD;

#else
#ifndef E_CONFIG_H
#define E_CONFIG_H

/* increment this whenever we change config enough that you need new 
 * defaults for e to work - started at 100 when we introduced this config
 * versioning feature
 */
#define E_CONFIG_FILE_VERSION 115

#define E_EVAS_ENGINE_DEFAULT      0
#define E_EVAS_ENGINE_SOFTWARE_X11 1
#define E_EVAS_ENGINE_GL_X11       2

struct _E_Config
{
   int         config_version;
   int         show_splash;
   char       *desktop_default_background;
   double      menus_scroll_speed;
   double      menus_fast_mouse_move_threshhold;
   double      menus_click_drag_timeout;
   int         border_shade_animate;
   int         border_shade_transition;
   double      border_shade_speed;
   double      framerate;
   int         image_cache;
   int         font_cache;
   int         zone_desks_x_count;
   int         zone_desks_y_count;
   int         use_virtual_roots;
   int         use_edge_flip;
   double      edge_flip_timeout;
   int         evas_engine_default;
   int         evas_engine_container;
   int         evas_engine_init;
   int         evas_engine_menus;
   int         evas_engine_borders;
   int         evas_engine_errors;
   int         evas_engine_popups;
   int         evas_engine_drag;
   char       *language;
   Evas_List  *modules;
   Evas_List  *font_fallbacks;
   Evas_List  *font_defaults;
   Evas_List  *themes;
   Evas_List  *mouse_bindings;
   Evas_List  *key_bindings;
   Evas_List  *path_append_data;
   Evas_List  *path_append_images;
   Evas_List  *path_append_fonts;
   Evas_List  *path_append_themes;
   Evas_List  *path_append_init;
   Evas_List  *path_append_icons;
   Evas_List  *path_append_modules;
   Evas_List  *path_append_backgrounds;
   int         focus_policy;
   int         focus_setting;
   int         pass_click_on;
   int         always_click_to_raise;
   int         use_auto_raise;
   double      auto_raise_delay;
   int         use_resist;
   int         drag_resist;
   int         desk_resist;
   int         window_resist;
   int         gadget_resist;
   int         winlist_warp_while_selecting;
   int         winlist_warp_at_end;
   double      winlist_warp_speed;
   int         winlist_scroll_animate;
   double      winlist_scroll_speed;
   int         winlist_list_show_iconified;
   int         winlist_list_show_other_desk_windows;
   int         winlist_list_show_other_screen_windows;
   int         winlist_list_uncover_while_selecting;
   int         winlist_list_jump_desk_while_selecting;
   double      winlist_pos_align_x;
   double      winlist_pos_align_y;
   double      winlist_pos_size_w;
   double      winlist_pos_size_h;
   int         winlist_pos_min_w;
   int         winlist_pos_min_h;
   int         winlist_pos_max_w;
   int         winlist_pos_max_h;
   int         maximize_policy;
   int         kill_if_close_not_possible;
   int         kill_process;
   double      kill_timer_wait;
   int         ping_clients;
   double      ping_clients_wait;
};

/* FIXME: all of thsie needs to become eet lumps for enmcode/decode */
struct _E_Config_Module
{
   char          *name;
   unsigned char  enabled;
};

struct _E_Config_Theme
{
   char          *category;
   char          *file;
};

struct _E_Config_Binding_Mouse
{
   int            context;
   int            modifiers;
   char          *action;
   char          *params;
   unsigned char  button;
   unsigned char  any_mod;
};

struct _E_Config_Binding_Key
{
   int            context;
   int            modifiers;
   char          *key;
   char          *action;
   char          *params;
   unsigned char  any_mod;
};

EAPI int e_config_init(void);
EAPI int e_config_shutdown(void);

EAPI void *e_config_domain_load(char *domain, E_Config_DD *edd);
EAPI int   e_config_domain_save(char *domain, E_Config_DD *edd, void *data);

EAPI int e_config_save(void);
EAPI void e_config_save_flush(void);
EAPI void e_config_save_queue(void);

EAPI E_Config_Binding_Mouse *e_config_binding_mouse_match(E_Config_Binding_Mouse *eb_in);
EAPI E_Config_Binding_Key *e_config_binding_key_match(E_Config_Binding_Key *eb_in);
    
extern EAPI E_Config *e_config;

#endif
#endif