aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_private.h
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-04 18:41:13 +1000
committerDavid Walter Seikel2012-01-04 18:41:13 +1000
commitdd7595a3475407a7fa96a97393bae8c5220e8762 (patch)
treee341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_private.h
parentAdd the skeleton. (diff)
downloadSledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz
Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje.
Note that embryo wont be used, but I'm not sure yet if you can build edje without it.
Diffstat (limited to 'libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_private.h')
-rw-r--r--libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_private.h451
1 files changed, 451 insertions, 0 deletions
diff --git a/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_private.h b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_private.h
new file mode 100644
index 0000000..cf8f3e5
--- /dev/null
+++ b/libraries/ecore/src/lib/ecore_x/xcb/ecore_xcb_private.h
@@ -0,0 +1,451 @@
1#ifndef __ECORE_XCB_PRIVATE_H__
2# define __ECORE_XCB_PRIVATE_H__
3
4//# define LOGFNS 1
5
6# ifdef HAVE_CONFIG_H
7# include "config.h"
8# endif
9
10# include <unistd.h> // included for close & gethostname functions
11
12/* generic xcb includes */
13# include <xcb/xcb.h>
14# include <xcb/bigreq.h>
15# include <xcb/shm.h>
16# include <xcb/xcb_image.h>
17
18/* EFL includes */
19# include "Ecore.h"
20# include "Ecore_Input.h"
21# include "Ecore_X.h"
22
23/* logging */
24extern int _ecore_xcb_log_dom;
25
26# ifdef ECORE_XCB_DEFAULT_LOG_COLOR
27# undef ECORE_XCB_DEFAULT_LOG_COLOR
28# endif
29# define ECORE_XCB_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
30
31# ifdef ERR
32# undef ERR
33# endif
34# define ERR(...) EINA_LOG_DOM_ERR(_ecore_xcb_log_dom, __VA_ARGS__)
35
36# ifdef DBG
37# undef DBG
38# endif
39# define DBG(...) EINA_LOG_DOM_DBG(_ecore_xcb_log_dom, __VA_ARGS__)
40
41# ifdef INF
42# undef INF
43# endif
44# define INF(...) EINA_LOG_DOM_INFO(_ecore_xcb_log_dom, __VA_ARGS__)
45
46# ifdef WRN
47# undef WRN
48# endif
49# define WRN(...) EINA_LOG_DOM_WARN(_ecore_xcb_log_dom, __VA_ARGS__)
50
51# ifdef CRIT
52# undef CRIT
53# endif
54# define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_xcb_log_dom, __VA_ARGS__)
55
56# ifdef LOGFNS
57# include <stdio.h>
58# define LOGFN(fl, ln, fn) printf("-ECORE-XCB: %25s: %5i - %s\n", fl, ln, fn);
59# else
60# define LOGFN(fl, ln, fn)
61# endif
62
63# ifndef MAXHOSTNAMELEN
64# define MAXHOSTNAMELEN 256
65# endif
66
67# ifndef MIN
68# define MIN(x, y) (((x) > (y)) ? (y) : (x))
69# endif
70
71# ifndef MAX
72# define MAX(a, b) ((a < b) ? b : a)
73# endif
74
75#define CHECK_XCB_CONN \
76 { \
77 if (xcb_connection_has_error(_ecore_xcb_conn)) \
78 { \
79 DBG("XCB Connection Has Error !!"); \
80 _ecore_xcb_io_error_handle(NULL); \
81 } \
82 }
83
84/* enums */
85typedef enum _Ecore_Xcb_Encoding_Style Ecore_Xcb_Encoding_Style;
86
87enum _Ecore_Xcb_Encoding_Style
88{
89 XcbStringStyle,
90 XcbCompoundTextStyle,
91 XcbTextStyle,
92 XcbStdICCTextStyle,
93 XcbUTF8StringStyle
94};
95
96/* structures */
97typedef struct _Ecore_X_DND_Source Ecore_X_DND_Source;
98typedef struct _Ecore_X_DND_Target Ecore_X_DND_Target;
99typedef struct _Ecore_X_Selection_Intern Ecore_X_Selection_Intern;
100typedef struct _Ecore_X_Selection_Converter Ecore_X_Selection_Converter;
101typedef struct _Ecore_X_Selection_Parser Ecore_X_Selection_Parser;
102typedef struct _Ecore_Xcb_Textproperty Ecore_Xcb_Textproperty;
103
104struct _Ecore_X_DND_Source
105{
106 int version;
107 Ecore_X_Window win, dest;
108
109 enum
110 {
111 ECORE_X_DND_SOURCE_IDLE,
112 ECORE_X_DND_SOURCE_DRAGGING,
113 ECORE_X_DND_SOURCE_DROPPED,
114 ECORE_X_DND_SOURCE_CONVERTING
115 } state;
116
117 struct
118 {
119 short x, y;
120 unsigned short width, height;
121 } rectangle;
122
123 struct
124 {
125 Ecore_X_Window window;
126 int x, y;
127 } prev;
128
129 Ecore_X_Time time;
130
131 Ecore_X_Atom action, accepted_action;
132
133 int will_accept, suppress;
134 int await_status;
135};
136
137struct _Ecore_X_DND_Target
138{
139 int version;
140 Ecore_X_Window win, source;
141
142 enum
143 {
144 ECORE_X_DND_TARGET_IDLE,
145 ECORE_X_DND_TARGET_ENTERED
146 } state;
147
148 struct
149 {
150 int x, y;
151 } pos;
152
153 Ecore_X_Time time;
154
155 Ecore_X_Atom action, accepted_action;
156 int will_accept;
157};
158
159struct _Ecore_X_Selection_Intern
160{
161 Ecore_X_Window win;
162 Ecore_X_Atom selection;
163 unsigned char *data;
164 int length;
165 Ecore_X_Time time;
166};
167
168struct _Ecore_X_Selection_Converter
169{
170 Ecore_X_Atom target;
171 Eina_Bool (*convert)(char *target,
172 void *data,
173 int size,
174 void **data_ret,
175 int *size_ret,
176 Ecore_X_Atom *type,
177 int *size_type);
178 Ecore_X_Selection_Converter *next;
179};
180
181struct _Ecore_X_Selection_Parser
182{
183 char *target;
184 void *(*parse)(const char *target, void *data, int size, int format);
185 Ecore_X_Selection_Parser *next;
186};
187
188struct _Ecore_Xcb_Textproperty
189{
190 char *value;
191 Ecore_X_Atom encoding;
192 unsigned int format, nitems;
193};
194
195/* external variables */
196extern Ecore_X_Connection *_ecore_xcb_conn;
197extern Ecore_X_Screen *_ecore_xcb_screen;
198extern double _ecore_xcb_double_click_time;
199extern int16_t _ecore_xcb_event_last_root_x;
200extern int16_t _ecore_xcb_event_last_root_y;
201
202/* external variables for extension events */
203extern int _ecore_xcb_event_damage;
204extern int _ecore_xcb_event_randr;
205extern int _ecore_xcb_event_screensaver;
206extern int _ecore_xcb_event_shape;
207extern int _ecore_xcb_event_sync;
208extern int _ecore_xcb_event_xfixes;
209extern int _ecore_xcb_event_input;
210extern int _ecore_xcb_event_gesture;
211
212extern int ECORE_X_MODIFIER_SHIFT;
213extern int ECORE_X_MODIFIER_CTRL;
214extern int ECORE_X_MODIFIER_ALT;
215extern int ECORE_X_MODIFIER_WIN;
216extern int ECORE_X_LOCK_SCROLL;
217extern int ECORE_X_LOCK_NUM;
218extern int ECORE_X_LOCK_CAPS;
219extern int ECORE_X_LOCK_SHIFT;
220
221extern Ecore_X_Atom _ecore_xcb_atoms_wm_protocol[ECORE_X_WM_PROTOCOL_NUM];
222
223extern int _ecore_xcb_button_grabs_num;
224extern int _ecore_xcb_key_grabs_num;
225extern Ecore_X_Window *_ecore_xcb_button_grabs;
226extern Ecore_X_Window *_ecore_xcb_key_grabs;
227extern Eina_Bool (*_ecore_xcb_window_grab_replay_func)(void *data,
228 int type,
229 void *event);
230extern void *_ecore_xcb_window_grab_replay_data;
231
232/* private function prototypes */
233void _ecore_xcb_error_handler_init(void);
234void _ecore_xcb_error_handler_shutdown(void);
235
236void _ecore_xcb_atoms_init(void);
237void _ecore_xcb_atoms_finalize(void);
238
239void _ecore_xcb_extensions_init(void);
240void _ecore_xcb_extensions_finalize(void);
241
242void _ecore_xcb_shape_init(void);
243void _ecore_xcb_shape_finalize(void);
244
245void _ecore_xcb_screensaver_init(void);
246void _ecore_xcb_screensaver_finalize(void);
247
248void _ecore_xcb_sync_init(void);
249void _ecore_xcb_sync_finalize(void);
250void _ecore_xcb_sync_magic_send(int val,
251 Ecore_X_Window win);
252
253void _ecore_xcb_render_init(void);
254void _ecore_xcb_render_finalize(void);
255Eina_Bool _ecore_xcb_render_argb_get(void);
256Eina_Bool _ecore_xcb_render_anim_get(void);
257Eina_Bool _ecore_xcb_render_avail_get(void);
258
259Eina_Bool _ecore_xcb_render_visual_supports_alpha(Ecore_X_Visual visual);
260uint32_t _ecore_xcb_render_find_visual_id(int type,
261 Eina_Bool check_alpha);
262Ecore_X_Visual *_ecore_xcb_render_visual_get(int visual_id);
263
264void _ecore_xcb_randr_init(void);
265void _ecore_xcb_randr_finalize(void);
266
267void _ecore_xcb_gesture_init(void);
268void _ecore_xcb_gesture_finalize(void);
269void _ecore_xcb_gesture_shutdown(void);
270
271void _ecore_xcb_xfixes_init(void);
272void _ecore_xcb_xfixes_finalize(void);
273Eina_Bool _ecore_xcb_xfixes_avail_get(void);
274
275void _ecore_xcb_damage_init(void);
276void _ecore_xcb_damage_finalize(void);
277
278void _ecore_xcb_composite_init(void);
279void _ecore_xcb_composite_finalize(void);
280
281void _ecore_xcb_dpms_init(void);
282void _ecore_xcb_dpms_finalize(void);
283
284void _ecore_xcb_cursor_init(void);
285void _ecore_xcb_cursor_finalize(void);
286
287void _ecore_xcb_xinerama_init(void);
288void _ecore_xcb_xinerama_finalize(void);
289
290void _ecore_xcb_dnd_init(void);
291void _ecore_xcb_dnd_shutdown(void);
292Ecore_X_DND_Source *_ecore_xcb_dnd_source_get(void);
293Ecore_X_DND_Target *_ecore_xcb_dnd_target_get(void);
294void _ecore_xcb_dnd_drag(Ecore_X_Window root,
295 int x,
296 int y);
297
298void _ecore_xcb_selection_init(void);
299void _ecore_xcb_selection_shutdown(void);
300void *_ecore_xcb_selection_parse(const char *target,
301 void *data,
302 int size,
303 int format);
304char *_ecore_xcb_selection_target_get(Ecore_X_Atom target);
305Ecore_X_Selection_Intern *_ecore_xcb_selection_get(Ecore_X_Atom selection);
306
307# ifdef HAVE_ICONV
308Eina_Bool _ecore_xcb_utf8_textlist_to_textproperty(char **list,
309 int count,
310 Ecore_Xcb_Encoding_Style style,
311 Ecore_Xcb_Textproperty *ret);
312# endif
313Eina_Bool _ecore_xcb_mb_textlist_to_textproperty(char **list,
314 int count,
315 Ecore_Xcb_Encoding_Style style,
316 Ecore_Xcb_Textproperty *ret);
317Eina_Bool _ecore_xcb_textlist_to_textproperty(const char *type,
318 char **list,
319 int count,
320 Ecore_Xcb_Encoding_Style style,
321 Ecore_Xcb_Textproperty *ret);
322
323# ifdef HAVE_ICONV
324Eina_Bool _ecore_xcb_utf8_textproperty_to_textlist(const Ecore_Xcb_Textproperty *text_prop,
325 char ***list_ret,
326 int *count_ret);
327# endif
328Eina_Bool _ecore_xcb_mb_textproperty_to_textlist(const Ecore_Xcb_Textproperty *text_prop,
329 char ***list_ret,
330 int *count_ret);
331Eina_Bool _ecore_xcb_textproperty_to_textlist(const Ecore_Xcb_Textproperty *text_prop,
332 const char *type,
333 char ***list_ret,
334 int *count_ret);
335
336void _ecore_xcb_events_init(void);
337void _ecore_xcb_events_shutdown(void);
338void _ecore_xcb_events_handle(xcb_generic_event_t *ev);
339Ecore_X_Time _ecore_xcb_events_last_time_get(void);
340unsigned int _ecore_xcb_events_modifiers_get(unsigned int state);
341void _ecore_xcb_event_mouse_move(uint16_t timestamp,
342 uint16_t modifiers,
343 int16_t x,
344 int16_t y,
345 int16_t root_x,
346 int16_t root_y,
347 xcb_window_t event_win,
348 xcb_window_t win,
349 xcb_window_t root_win,
350 uint8_t same_screen,
351 int dev,
352 double radx,
353 double rady,
354 double pressure,
355 double angle,
356 int16_t mx,
357 int16_t my,
358 int16_t mrx,
359 int16_t mry);
360Ecore_Event_Mouse_Button *_ecore_xcb_event_mouse_button(int event,
361 uint16_t timestamp,
362 uint16_t modifiers,
363 xcb_button_t buttons,
364 int16_t x,
365 int16_t y,
366 int16_t root_x,
367 int16_t root_y,
368 xcb_window_t event_win,
369 xcb_window_t win,
370 xcb_window_t root_win,
371 uint8_t same_screen,
372 int dev,
373 double radx,
374 double rady,
375 double pressure,
376 double angle,
377 int16_t mx,
378 int16_t my,
379 int16_t mrx,
380 int16_t mry);
381
382void _ecore_xcb_keymap_init(void);
383void _ecore_xcb_keymap_finalize(void);
384void _ecore_xcb_keymap_shutdown(void);
385void _ecore_xcb_keymap_refresh(xcb_mapping_notify_event_t *event);
386xcb_keysym_t _ecore_xcb_keymap_keycode_to_keysym(xcb_keycode_t keycode,
387 int col);
388xcb_keycode_t *_ecore_xcb_keymap_keysym_to_keycode(xcb_keysym_t keysym);
389char *_ecore_xcb_keymap_keysym_to_string(xcb_keysym_t keysym);
390xcb_keycode_t _ecore_xcb_keymap_string_to_keycode(const char *key);
391int _ecore_xcb_keymap_lookup_string(xcb_keycode_t keycode,
392 int state,
393 char *buffer,
394 int bytes,
395 xcb_keysym_t *sym);
396
397void _ecore_xcb_input_init(void);
398void _ecore_xcb_input_finalize(void);
399void _ecore_xcb_input_shutdown(void);
400# ifdef ECORE_XCB_XINPUT
401void _ecore_xcb_input_handle_event(xcb_generic_event_t *event);
402# else
403void _ecore_xcb_input_handle_event(xcb_generic_event_t *event __UNUSED__);
404# endif
405
406void _ecore_xcb_dri_init(void);
407void _ecore_xcb_dri_finalize(void);
408
409void _ecore_xcb_xtest_init(void);
410void _ecore_xcb_xtest_finalize(void);
411
412Ecore_X_Window _ecore_xcb_window_root_of_screen_get(int screen);
413void _ecore_xcb_window_prop_string_utf8_set(Ecore_X_Window win,
414 Ecore_X_Atom atom,
415 const char *str);
416Ecore_X_Visual _ecore_xcb_window_visual_get(Ecore_X_Window win);
417void _ecore_xcb_window_button_grab_remove(Ecore_X_Window win);
418void _ecore_xcb_window_key_grab_remove(Ecore_X_Window win);
419void _ecore_xcb_window_grab_allow_events(Ecore_X_Window event_win,
420 Ecore_X_Window child_win,
421 int type,
422 void *event,
423 Ecore_X_Time timestamp);
424
425int _ecore_xcb_netwm_startup_info_begin(Ecore_X_Window win __UNUSED__,
426 uint8_t data __UNUSED__);
427int _ecore_xcb_netwm_startup_info(Ecore_X_Window win __UNUSED__,
428 uint8_t data __UNUSED__);
429Ecore_X_Window_State _ecore_xcb_netwm_window_state_get(Ecore_X_Atom atom);
430
431int _ecore_xcb_error_handle(xcb_generic_error_t *err);
432int _ecore_xcb_io_error_handle(xcb_generic_error_t *err);
433
434xcb_image_t *_ecore_xcb_image_create_native(int w,
435 int h,
436 xcb_image_format_t format,
437 uint8_t depth,
438 void *base,
439 uint32_t bytes,
440 uint8_t *data);
441
442void _ecore_xcb_xdefaults_init(void);
443void _ecore_xcb_xdefaults_shutdown(void);
444char *_ecore_xcb_xdefaults_string_get(const char *prog,
445 const char *param);
446int _ecore_xcb_xdefaults_int_get(const char *prog,
447 const char *param);
448
449void _ecore_xcb_modifiers_get(void);
450
451#endif