1 #ifndef __ECORE_XCB_PRIVATE_H__
2 #define __ECORE_XCB_PRIVATE_H__
9 # define MAXHOSTNAMELEN 256
13 # define XK_MISCELLANY 1
14 #endif /* XK_MISCELLANY */
17 #include <xcb/xcb_icccm.h>
18 #include <xcb/xcb_keysyms.h>
19 #include <xcb/bigreq.h>
20 #ifdef ECORE_XCB_CURSOR
21 # include <xcb/cursor.h>
22 #endif /* ECORE_XCB_CURSOR */
23 #ifdef ECORE_XCB_DAMAGE
24 # include <xcb/damage.h>
25 #endif /* ECORE_XCB_DAMAGE */
26 #ifdef ECORE_XCB_COMPOSITE
27 # include <xcb/composite.h>
28 #endif /* ECORE_XCB_COMPOSITE */
30 # include <xcb/dpms.h>
31 #endif /* ECORE_XCB_DPMS */
32 #ifdef ECORE_XCB_RANDR
33 # include <xcb/randr.h>
34 #endif /* ECORE_XCB_RANDR */
35 #ifdef ECORE_XCB_RENDER
36 # include <xcb/render.h>
37 #endif /* ECORE_XCB_RENDER */
38 #ifdef ECORE_XCB_SCREENSAVER
39 # include <xcb/screensaver.h>
40 #endif /* ECORE_XCB_SCREENSAVER */
41 #ifdef ECORE_XCB_SHAPE
42 # include <xcb/shape.h>
43 #endif /* ECORE_XCB_SHAPE */
45 # include <xcb/sync.h>
46 #endif /* ECORE_XCB_SYNC */
47 #ifdef ECORE_XCB_XFIXES
48 # include <xcb/xfixes.h>
49 #endif /* ECORE_XCB_XFIXES */
50 #ifdef ECORE_XCB_XINERAMA
51 # include <xcb/xinerama.h>
52 #endif /* ECORE_XCB_XINERAMA */
53 #ifdef ECORE_XCB_XPRINT
54 # include <xcb/xprint.h>
55 #endif /* ECORE_XCB_XPRINT */
57 #include "ecore_private.h"
60 /* FIXME: this is for simulation only */
61 #include "Ecore_Txt.h"
63 typedef struct _Ecore_X_Selection_Intern Ecore_X_Selection_Intern;
65 struct _Ecore_X_Selection_Intern
68 Ecore_X_Atom selection;
74 typedef struct _Ecore_X_Selection_Converter Ecore_X_Selection_Converter;
76 struct _Ecore_X_Selection_Converter
79 int (*convert)(char *target, void *data, int size,
80 void **data_ret, int *size_ret);
81 Ecore_X_Selection_Converter *next;
84 typedef struct _Ecore_X_Selection_Parser Ecore_X_Selection_Parser;
86 struct _Ecore_X_Selection_Parser
89 void *(*parse)(const char *target, void *data, int size, int format);
90 Ecore_X_Selection_Parser *next;
93 typedef struct _Ecore_X_DND_Source
96 Ecore_X_Window win, dest;
99 ECORE_X_DND_SOURCE_IDLE,
100 ECORE_X_DND_SOURCE_DRAGGING,
101 ECORE_X_DND_SOURCE_DROPPED,
102 ECORE_X_DND_SOURCE_CONVERTING
107 unsigned short width, height;
112 Ecore_X_Atom action, accepted_action;
118 } Ecore_X_DND_Source;
120 typedef struct _Ecore_X_DND_Target
123 Ecore_X_Window win, source;
126 ECORE_X_DND_TARGET_IDLE,
127 ECORE_X_DND_TARGET_ENTERED
136 Ecore_X_Atom action, accepted_action;
139 } Ecore_X_DND_Target;
142 extern Ecore_X_Connection *_ecore_xcb_conn;
143 extern Ecore_X_Screen *_ecore_xcb_screen;
144 extern double _ecore_xcb_double_click_time;
145 extern Ecore_X_Time _ecore_xcb_event_last_time;
146 extern Ecore_X_Window _ecore_xcb_event_last_window;
147 extern int16_t _ecore_xcb_event_last_root_x;
148 extern int16_t _ecore_xcb_event_last_root_y;
149 extern int _ecore_xcb_xcursor;
151 extern Ecore_X_Atom _ecore_xcb_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_NUM];
153 extern int _ecore_window_grabs_num;
154 extern Ecore_X_Window *_ecore_window_grabs;
155 extern int (*_ecore_window_grab_replay_func) (void *data, int event_type, void *event);
156 extern void *_ecore_window_grab_replay_data;
158 extern Ecore_X_Window _ecore_xcb_private_window;
161 void _ecore_x_error_handler_init(void);
163 void _ecore_x_event_handle_key_press (xcb_generic_event_t *event);
164 void _ecore_x_event_handle_key_release (xcb_generic_event_t *event);
165 void _ecore_x_event_handle_button_press (xcb_generic_event_t *event);
166 void _ecore_x_event_handle_button_release (xcb_generic_event_t *event);
167 void _ecore_x_event_handle_motion_notify (xcb_generic_event_t *event);
168 void _ecore_x_event_handle_enter_notify (xcb_generic_event_t *event);
169 void _ecore_x_event_handle_leave_notify (xcb_generic_event_t *event);
170 void _ecore_x_event_handle_focus_in (xcb_generic_event_t *event);
171 void _ecore_x_event_handle_focus_out (xcb_generic_event_t *event);
172 void _ecore_x_event_handle_keymap_notify (xcb_generic_event_t *event);
173 void _ecore_x_event_handle_expose (xcb_generic_event_t *event);
174 void _ecore_x_event_handle_graphics_expose (xcb_generic_event_t *event);
175 void _ecore_x_event_handle_visibility_notify (xcb_generic_event_t *event);
176 void _ecore_x_event_handle_create_notify (xcb_generic_event_t *event);
177 void _ecore_x_event_handle_destroy_notify (xcb_generic_event_t *event);
178 void _ecore_x_event_handle_unmap_notify (xcb_generic_event_t *event);
179 void _ecore_x_event_handle_map_notify (xcb_generic_event_t *event);
180 void _ecore_x_event_handle_map_request (xcb_generic_event_t *event);
181 void _ecore_x_event_handle_reparent_notify (xcb_generic_event_t *event);
182 void _ecore_x_event_handle_configure_notify (xcb_generic_event_t *event);
183 void _ecore_x_event_handle_configure_request (xcb_generic_event_t *event);
184 void _ecore_x_event_handle_gravity_notify (xcb_generic_event_t *event);
185 void _ecore_x_event_handle_resize_request (xcb_generic_event_t *event);
186 void _ecore_x_event_handle_circulate_notify (xcb_generic_event_t *event);
187 void _ecore_x_event_handle_circulate_request (xcb_generic_event_t *event);
188 void _ecore_x_event_handle_property_notify (xcb_generic_event_t *event);
189 void _ecore_x_event_handle_selection_clear (xcb_generic_event_t *event);
190 void _ecore_x_event_handle_selection_request (xcb_generic_event_t *event);
191 void _ecore_x_event_handle_selection_notify (xcb_generic_event_t *event);
192 void _ecore_x_event_handle_colormap_notify (xcb_generic_event_t *event);
193 void _ecore_x_event_handle_client_message (xcb_generic_event_t *event);
194 void _ecore_x_event_handle_mapping_notify (xcb_generic_event_t *event);
195 #ifdef ECORE_XCB_DAMAGE
196 void _ecore_x_event_handle_damage_notify (xcb_generic_event_t *event);
197 #endif /* ECORE_XCB_DAMAGE */
198 #ifdef ECORE_XCB_RANDR
199 void _ecore_x_event_handle_randr_change (xcb_generic_event_t *event);
200 #endif /* ECORE_XCB_RANDR */
201 #ifdef ECORE_XCB_SCREENSAVER
202 void _ecore_x_event_handle_screensaver_notify (xcb_generic_event_t *event);
203 #endif /* ECORE_XCB_SCREENSAVER */
204 #ifdef ECORE_XCB_SHAPE
205 void _ecore_x_event_handle_shape_change (xcb_generic_event_t *event);
206 #endif /* ECORE_XCB_SHAPE */
207 #ifdef ECORE_XCB_SYNC
208 void _ecore_x_event_handle_sync_counter (xcb_generic_event_t *event);
209 void _ecore_x_event_handle_sync_alarm (xcb_generic_event_t *event);
210 #endif /* ECORE_XCB_SYNC */
211 #ifdef ECORE_XCB_FIXES
212 void _ecore_x_event_handle_fixes_selection_notify(xcb_generic_event_t *event);
213 #endif /* ECORE_XCB_FIXES */
216 /* requests / replies */
217 int _ecore_x_reply_init ();
218 void _ecore_x_reply_shutdown ();
219 void _ecore_xcb_cookie_cache (unsigned int cookie);
220 unsigned int _ecore_xcb_cookie_get (void);
221 void _ecore_xcb_reply_cache (void *reply);
222 void *_ecore_xcb_reply_get (void);
226 extern Ecore_X_Atom ECORE_X_ATOM_ATOM;
227 extern Ecore_X_Atom ECORE_X_ATOM_CARDINAL;
228 extern Ecore_X_Atom ECORE_X_ATOM_STRING;
229 extern Ecore_X_Atom ECORE_X_ATOM_WINDOW;
230 extern Ecore_X_Atom ECORE_X_ATOM_E_FRAME_SIZE;
231 extern Ecore_X_Atom ECORE_X_ATOM_WM_SIZE_HINTS;
233 #define ECORE_X_ATOMS_COUNT 115
235 void _ecore_x_atom_init (xcb_intern_atom_cookie_t *);
236 void _ecore_x_atom_init_finalize (xcb_intern_atom_cookie_t *);
240 void _ecore_x_damage_init (const xcb_query_extension_reply_t *reply);
241 void _ecore_x_damage_init_finalize (void);
244 void _ecore_x_composite_init (const xcb_query_extension_reply_t *reply);
245 void _ecore_x_composite_init_finalize (void);
248 void _ecore_x_dnd_init (void);
249 void _ecore_x_dnd_shutdown (void);
250 Ecore_X_DND_Source *_ecore_x_dnd_source_get (void);
251 Ecore_X_DND_Target *_ecore_x_dnd_target_get (void);
252 void _ecore_x_dnd_drag (Ecore_X_Window root,
258 void _ecore_x_dpms_init (const xcb_query_extension_reply_t *reply);
259 void _ecore_x_dpms_init_finalize (void);
263 Ecore_X_Window_State _ecore_x_netwm_state_get(Ecore_X_Atom a);
264 int _ecore_x_netwm_startup_info_begin(Ecore_X_Window win, char *data);
265 int _ecore_x_netwm_startup_info(Ecore_X_Window win, char *data);
269 void _ecore_x_randr_init (const xcb_query_extension_reply_t *reply);
270 void _ecore_x_randr_init_finalize (void);
274 void _ecore_x_selection_init(void);
275 void _ecore_x_selection_shutdown(void);
276 Ecore_X_Atom _ecore_x_selection_target_atom_get(const char *target);
277 char *_ecore_x_selection_target_get(Ecore_X_Atom target);
278 Ecore_X_Selection_Intern *_ecore_x_selection_get(Ecore_X_Atom selection);
279 int _ecore_x_selection_set(Ecore_X_Window w, const void *data, int len, Ecore_X_Atom selection);
280 int _ecore_x_selection_convert(Ecore_X_Atom selection, Ecore_X_Atom target, void **data_ret);
281 void *_ecore_x_selection_parse(const char *target, void *data, int size, int format);
285 void _ecore_x_screensaver_init (const xcb_query_extension_reply_t *reply);
286 void _ecore_x_screensaver_init_finalize (void);
290 void _ecore_x_shape_init (const xcb_query_extension_reply_t *reply);
291 void _ecore_x_shape_init_finalize (void);
295 void _ecore_x_sync_init (const xcb_query_extension_reply_t *reply);
296 void _ecore_x_sync_init_finalize (void);
300 void _ecore_x_xfixes_init (const xcb_query_extension_reply_t *reply);
301 void _ecore_x_xfixes_init_finalize (void);
305 void _ecore_x_xinerama_init (const xcb_query_extension_reply_t *reply);
306 void _ecore_x_xinerama_init_finalize (void);
310 void _ecore_x_xprint_init (const xcb_query_extension_reply_t *reply);
311 void _ecore_x_xprint_init_finalize (void);
314 void _ecore_x_sync_magic_send(int val, Ecore_X_Window swin);
315 void _ecore_x_window_grab_remove(Ecore_X_Window win);
316 void _ecore_x_key_grab_remove(Ecore_X_Window win);
319 #endif /* __ECORE_XCB_PRIVATE_H__*/