diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/ecore/src/lib/ecore_x/xlib/ecore_x_private.h | 385 |
1 files changed, 385 insertions, 0 deletions
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_private.h b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_private.h new file mode 100644 index 0000000..02a01f7 --- /dev/null +++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_private.h | |||
@@ -0,0 +1,385 @@ | |||
1 | #ifndef _ECORE_X_PRIVATE_H | ||
2 | #define _ECORE_X_PRIVATE_H | ||
3 | |||
4 | #include <sys/param.h> | ||
5 | #ifndef MAXHOSTNAMELEN | ||
6 | #define MAXHOSTNAMELEN 256 | ||
7 | #endif /* ifndef MAXHOSTNAMELEN */ | ||
8 | |||
9 | #include <X11/Xlib.h> | ||
10 | #include <X11/Xproto.h> | ||
11 | #include <X11/Xutil.h> | ||
12 | #include <X11/Xatom.h> | ||
13 | #include <X11/Xresource.h> | ||
14 | #include <X11/keysymdef.h> | ||
15 | #include <X11/extensions/XShm.h> | ||
16 | #include <X11/extensions/shape.h> | ||
17 | #include <X11/extensions/sync.h> | ||
18 | #include <X11/extensions/dpms.h> | ||
19 | #ifdef ECORE_XCURSOR | ||
20 | #include <X11/Xcursor/Xcursor.h> | ||
21 | #endif /* ifdef ECORE_XCURSOR */ | ||
22 | #ifdef ECORE_XPRINT | ||
23 | #include <X11/extensions/Print.h> | ||
24 | #endif /* ifdef ECORE_XPRINT */ | ||
25 | #ifdef ECORE_XINERAMA | ||
26 | #include <X11/extensions/Xinerama.h> | ||
27 | #endif /* ifdef ECORE_XINERAMA */ | ||
28 | #ifdef ECORE_XRANDR | ||
29 | #include <X11/extensions/Xrandr.h> | ||
30 | #endif /* ifdef ECORE_XRANDR */ | ||
31 | #ifdef ECORE_XSS | ||
32 | #include <X11/extensions/scrnsaver.h> | ||
33 | #endif /* ifdef ECORE_XSS */ | ||
34 | #ifdef ECORE_XRENDER | ||
35 | #include <X11/extensions/Xrender.h> | ||
36 | #endif /* ifdef ECORE_XRENDER */ | ||
37 | #ifdef ECORE_XFIXES | ||
38 | #include <X11/extensions/Xfixes.h> | ||
39 | #endif /* ifdef ECORE_XFIXES */ | ||
40 | #ifdef ECORE_XCOMPOSITE | ||
41 | #include <X11/extensions/Xcomposite.h> | ||
42 | #endif /* ifdef ECORE_XCOMPOSITE */ | ||
43 | #ifdef ECORE_XDAMAGE | ||
44 | #include <X11/extensions/Xdamage.h> | ||
45 | #endif /* ifdef ECORE_XDAMAGE */ | ||
46 | #ifdef ECORE_XGESTURE | ||
47 | #include <X11/extensions/gesture.h> | ||
48 | #include <X11/extensions/gestureproto.h> | ||
49 | #endif /* ifdef ECORE_XGESTURE */ | ||
50 | #ifdef ECORE_XDPMS | ||
51 | #include <X11/extensions/dpms.h> | ||
52 | #endif /* ifdef ECORE_XDPMS */ | ||
53 | #ifdef ECORE_XKB | ||
54 | #include <X11/XKBlib.h> | ||
55 | #endif /* ifdef ECORE_XKB */ | ||
56 | #ifdef ECORE_XI2 | ||
57 | #include <X11/extensions/XInput2.h> | ||
58 | #endif /* ifdef ECORE_XI2 */ | ||
59 | |||
60 | #ifndef XK_MISCELLANY | ||
61 | # define XK_MISCELLANY 1 | ||
62 | #endif | ||
63 | |||
64 | #include "Ecore.h" | ||
65 | #include "ecore_private.h" | ||
66 | #include "Ecore_X.h" | ||
67 | #include "Ecore_Input.h" | ||
68 | |||
69 | extern int _ecore_xlib_log_dom; | ||
70 | #ifdef ECORE_XLIB_DEFAULT_LOG_COLOR | ||
71 | # undef ECORE_XLIB_DEFAULT_LOG_COLOR | ||
72 | #endif /* ifdef ECORE_XLIB_DEFAULT_LOG_COLOR */ | ||
73 | #define ECORE_XLIB_DEFAULT_LOG_COLOR EINA_COLOR_BLUE | ||
74 | |||
75 | #ifdef ERR | ||
76 | # undef ERR | ||
77 | #endif /* ifdef ERR */ | ||
78 | #define ERR(...) EINA_LOG_DOM_ERR(_ecore_xlib_log_dom, __VA_ARGS__) | ||
79 | |||
80 | #ifdef DBG | ||
81 | # undef DBG | ||
82 | #endif /* ifdef DBG */ | ||
83 | #define DBG(...) EINA_LOG_DOM_DBG(_ecore_xlib_log_dom, __VA_ARGS__) | ||
84 | |||
85 | #ifdef INF | ||
86 | # undef INF | ||
87 | #endif /* ifdef INF */ | ||
88 | #define INF(...) EINA_LOG_DOM_INFO(_ecore_xlib_log_dom, __VA_ARGS__) | ||
89 | |||
90 | #ifdef WRN | ||
91 | # undef WRN | ||
92 | #endif /* ifdef WRN */ | ||
93 | #define WRN(...) EINA_LOG_DOM_WARN(_ecore_xlib_log_dom, __VA_ARGS__) | ||
94 | |||
95 | #ifdef CRIT | ||
96 | # undef CRIT | ||
97 | #endif /* ifdef CRIT */ | ||
98 | #define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_xlib_log_dom, __VA_ARGS__) | ||
99 | |||
100 | typedef struct _Ecore_X_Selection_Intern Ecore_X_Selection_Intern; | ||
101 | |||
102 | struct _Ecore_X_Selection_Intern | ||
103 | { | ||
104 | Ecore_X_Window win; | ||
105 | Ecore_X_Atom selection; | ||
106 | unsigned char *data; | ||
107 | int length; | ||
108 | Time time; | ||
109 | }; | ||
110 | |||
111 | typedef struct _Ecore_X_Selection_Converter Ecore_X_Selection_Converter; | ||
112 | |||
113 | struct _Ecore_X_Selection_Converter | ||
114 | { | ||
115 | Ecore_X_Atom target; | ||
116 | Eina_Bool (*convert)(char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *type, int *typeseize); | ||
117 | Ecore_X_Selection_Converter *next; | ||
118 | }; | ||
119 | |||
120 | typedef struct _Ecore_X_Selection_Parser Ecore_X_Selection_Parser; | ||
121 | |||
122 | struct _Ecore_X_Selection_Parser | ||
123 | { | ||
124 | char *target; | ||
125 | void *(*parse)(const char *target, void *data, int size, int format); | ||
126 | Ecore_X_Selection_Parser *next; | ||
127 | }; | ||
128 | |||
129 | typedef struct _Ecore_X_DND_Source | ||
130 | { | ||
131 | int version; | ||
132 | Ecore_X_Window win, dest; | ||
133 | |||
134 | enum { | ||
135 | ECORE_X_DND_SOURCE_IDLE, | ||
136 | ECORE_X_DND_SOURCE_DRAGGING, | ||
137 | ECORE_X_DND_SOURCE_DROPPED, | ||
138 | ECORE_X_DND_SOURCE_CONVERTING | ||
139 | } state; | ||
140 | |||
141 | struct | ||
142 | { | ||
143 | short x, y; | ||
144 | unsigned short width, height; | ||
145 | } rectangle; | ||
146 | |||
147 | struct | ||
148 | { | ||
149 | Ecore_X_Window window; | ||
150 | int x, y; | ||
151 | } prev; | ||
152 | |||
153 | Time time; | ||
154 | |||
155 | Ecore_X_Atom action, accepted_action; | ||
156 | |||
157 | int will_accept; | ||
158 | int suppress; | ||
159 | |||
160 | int await_status; | ||
161 | } Ecore_X_DND_Source; | ||
162 | |||
163 | typedef struct _Ecore_X_DND_Target | ||
164 | { | ||
165 | int version; | ||
166 | Ecore_X_Window win, source; | ||
167 | |||
168 | enum { | ||
169 | ECORE_X_DND_TARGET_IDLE, | ||
170 | ECORE_X_DND_TARGET_ENTERED | ||
171 | } state; | ||
172 | |||
173 | struct | ||
174 | { | ||
175 | int x, y; | ||
176 | } pos; | ||
177 | |||
178 | Time time; | ||
179 | |||
180 | Ecore_X_Atom action, accepted_action; | ||
181 | |||
182 | int will_accept; | ||
183 | } Ecore_X_DND_Target; | ||
184 | |||
185 | extern int ECORE_X_MODIFIER_SHIFT; | ||
186 | extern int ECORE_X_MODIFIER_CTRL; | ||
187 | extern int ECORE_X_MODIFIER_ALT; | ||
188 | extern int ECORE_X_MODIFIER_WIN; | ||
189 | |||
190 | extern int ECORE_X_LOCK_SCROLL; | ||
191 | extern int ECORE_X_LOCK_NUM; | ||
192 | extern int ECORE_X_LOCK_CAPS; | ||
193 | extern int ECORE_X_LOCK_SHIFT; | ||
194 | |||
195 | extern Display *_ecore_x_disp; | ||
196 | extern double _ecore_x_double_click_time; | ||
197 | extern Time _ecore_x_event_last_time; | ||
198 | extern Window _ecore_x_event_last_win; | ||
199 | extern int _ecore_x_event_last_root_x; | ||
200 | extern int _ecore_x_event_last_root_y; | ||
201 | extern Eina_Bool _ecore_x_xcursor; | ||
202 | |||
203 | extern Ecore_X_Atom _ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_NUM]; | ||
204 | |||
205 | extern int _ecore_window_grabs_num; | ||
206 | extern Window *_ecore_window_grabs; | ||
207 | extern Eina_Bool (*_ecore_window_grab_replay_func)(void *data, | ||
208 | int event_type, | ||
209 | void *event); | ||
210 | extern void *_ecore_window_grab_replay_data; | ||
211 | |||
212 | extern Ecore_X_Window _ecore_x_private_win; | ||
213 | |||
214 | void _ecore_x_error_handler_init(void); | ||
215 | void _ecore_x_event_handle_any_event(XEvent *xevent); | ||
216 | void _ecore_x_event_handle_key_press(XEvent *xevent); | ||
217 | void _ecore_x_event_handle_key_release(XEvent *xevent); | ||
218 | void _ecore_x_event_handle_button_press(XEvent *xevent); | ||
219 | void _ecore_x_event_handle_button_release(XEvent *xevent); | ||
220 | void _ecore_x_event_handle_motion_notify(XEvent *xevent); | ||
221 | void _ecore_x_event_handle_enter_notify(XEvent *xevent); | ||
222 | void _ecore_x_event_handle_leave_notify(XEvent *xevent); | ||
223 | void _ecore_x_event_handle_focus_in(XEvent *xevent); | ||
224 | void _ecore_x_event_handle_focus_out(XEvent *xevent); | ||
225 | void _ecore_x_event_handle_keymap_notify(XEvent *xevent); | ||
226 | void _ecore_x_event_handle_expose(XEvent *xevent); | ||
227 | void _ecore_x_event_handle_graphics_expose(XEvent *xevent); | ||
228 | void _ecore_x_event_handle_visibility_notify(XEvent *xevent); | ||
229 | void _ecore_x_event_handle_create_notify(XEvent *xevent); | ||
230 | void _ecore_x_event_handle_destroy_notify(XEvent *xevent); | ||
231 | void _ecore_x_event_handle_unmap_notify(XEvent *xevent); | ||
232 | void _ecore_x_event_handle_map_notify(XEvent *xevent); | ||
233 | void _ecore_x_event_handle_map_request(XEvent *xevent); | ||
234 | void _ecore_x_event_handle_reparent_notify(XEvent *xevent); | ||
235 | void _ecore_x_event_handle_configure_notify(XEvent *xevent); | ||
236 | void _ecore_x_event_handle_configure_request(XEvent *xevent); | ||
237 | void _ecore_x_event_handle_gravity_notify(XEvent *xevent); | ||
238 | void _ecore_x_event_handle_resize_request(XEvent *xevent); | ||
239 | void _ecore_x_event_handle_circulate_notify(XEvent *xevent); | ||
240 | void _ecore_x_event_handle_circulate_request(XEvent *xevent); | ||
241 | void _ecore_x_event_handle_property_notify(XEvent *xevent); | ||
242 | void _ecore_x_event_handle_selection_clear(XEvent *xevent); | ||
243 | void _ecore_x_event_handle_selection_request(XEvent *xevent); | ||
244 | void _ecore_x_event_handle_selection_notify(XEvent *xevent); | ||
245 | void _ecore_x_event_handle_colormap_notify(XEvent *xevent); | ||
246 | void _ecore_x_event_handle_client_message(XEvent *xevent); | ||
247 | void _ecore_x_event_handle_mapping_notify(XEvent *xevent); | ||
248 | void _ecore_x_event_handle_shape_change(XEvent *xevent); | ||
249 | void _ecore_x_event_handle_screensaver_notify(XEvent *xevent); | ||
250 | #ifdef ECORE_XGESTURE | ||
251 | void _ecore_x_event_handle_gesture_notify_flick(XEvent *xevent); | ||
252 | void _ecore_x_event_handle_gesture_notify_pan(XEvent *xevent); | ||
253 | void _ecore_x_event_handle_gesture_notify_pinchrotation(XEvent *xevent); | ||
254 | void _ecore_x_event_handle_gesture_notify_tap(XEvent *xevent); | ||
255 | void _ecore_x_event_handle_gesture_notify_tapnhold(XEvent *xevent); | ||
256 | void _ecore_x_event_handle_gesture_notify_hold(XEvent *xevent); | ||
257 | void _ecore_x_event_handle_gesture_notify_group(XEvent *xevent); | ||
258 | #endif /* ifdef ECORE_XGESTURE */ | ||
259 | void _ecore_x_event_handle_sync_counter(XEvent *xevent); | ||
260 | void _ecore_x_event_handle_sync_alarm(XEvent *xevent); | ||
261 | #ifdef ECORE_XRANDR | ||
262 | void _ecore_x_event_handle_randr_change(XEvent *xevent); | ||
263 | void _ecore_x_event_handle_randr_notify(XEvent *xevent); | ||
264 | #endif /* ifdef ECORE_XRANDR */ | ||
265 | #ifdef ECORE_XFIXES | ||
266 | void _ecore_x_event_handle_fixes_selection_notify(XEvent *xevent); | ||
267 | #endif /* ifdef ECORE_XFIXES */ | ||
268 | #ifdef ECORE_XDAMAGE | ||
269 | void _ecore_x_event_handle_damage_notify(XEvent *xevent); | ||
270 | #endif /* ifdef ECORE_XDAMAGE */ | ||
271 | void _ecore_x_event_handle_generic_event(XEvent *xevent); | ||
272 | |||
273 | void _ecore_x_selection_data_init(void); | ||
274 | void _ecore_x_selection_shutdown(void); | ||
275 | Ecore_X_Atom _ecore_x_selection_target_atom_get(const char *target); | ||
276 | char *_ecore_x_selection_target_get(Ecore_X_Atom target); | ||
277 | Ecore_X_Selection_Intern *_ecore_x_selection_get(Ecore_X_Atom selection); | ||
278 | Eina_Bool _ecore_x_selection_set(Window w, | ||
279 | const void *data, | ||
280 | int len, | ||
281 | Ecore_X_Atom selection); | ||
282 | int _ecore_x_selection_convert(Ecore_X_Atom selection, | ||
283 | Ecore_X_Atom target, | ||
284 | void **data_ret, | ||
285 | Ecore_X_Atom *targettype, | ||
286 | int *targetsize); | ||
287 | void *_ecore_x_selection_parse(const char *target, | ||
288 | void *data, | ||
289 | int size, | ||
290 | int format); | ||
291 | |||
292 | void _ecore_x_sync_magic_send(int val, | ||
293 | Ecore_X_Window swin); | ||
294 | void _ecore_x_window_grab_remove(Ecore_X_Window win); | ||
295 | void _ecore_x_key_grab_remove(Ecore_X_Window win); | ||
296 | |||
297 | /* from dnd */ | ||
298 | void _ecore_x_dnd_init(void); | ||
299 | Ecore_X_DND_Source *_ecore_x_dnd_source_get(void); | ||
300 | Ecore_X_DND_Target *_ecore_x_dnd_target_get(void); | ||
301 | void _ecore_x_dnd_drag(Ecore_X_Window root, | ||
302 | int x, | ||
303 | int y); | ||
304 | void _ecore_x_dnd_shutdown(void); | ||
305 | |||
306 | /* from netwm */ | ||
307 | Ecore_X_Window_State _ecore_x_netwm_state_get(Ecore_X_Atom a); | ||
308 | int _ecore_x_netwm_startup_info_begin(Ecore_X_Window win, | ||
309 | char *data); | ||
310 | int _ecore_x_netwm_startup_info(Ecore_X_Window win, | ||
311 | char *data); | ||
312 | |||
313 | /* Fixes * Damage * Composite * DPMS */ | ||
314 | void _ecore_x_fixes_init(void); | ||
315 | void _ecore_x_damage_init(void); | ||
316 | void _ecore_x_composite_init(void); | ||
317 | void _ecore_x_dpms_init(void); | ||
318 | void _ecore_x_randr_init(void); | ||
319 | void _ecore_x_gesture_init(void); | ||
320 | |||
321 | void _ecore_x_atoms_init(void); | ||
322 | |||
323 | extern int _ecore_x_xi2_opcode; | ||
324 | |||
325 | void _ecore_x_events_init(void); | ||
326 | void _ecore_x_events_shutdown(void); | ||
327 | |||
328 | void _ecore_x_input_init(void); | ||
329 | void _ecore_x_input_shutdown(void); | ||
330 | void _ecore_x_input_handler(XEvent *xevent); | ||
331 | /* from sync */ | ||
332 | |||
333 | void _ecore_mouse_move(unsigned int timestamp, | ||
334 | unsigned int xmodifiers, | ||
335 | int x, | ||
336 | int y, | ||
337 | int x_root, | ||
338 | int y_root, | ||
339 | unsigned int event_window, | ||
340 | unsigned int window, | ||
341 | unsigned int root_win, | ||
342 | int same_screen, | ||
343 | int dev, | ||
344 | double radx, | ||
345 | double rady, | ||
346 | double pressure, | ||
347 | double angle, | ||
348 | double mx, | ||
349 | double my, | ||
350 | double mrx, | ||
351 | double mry); | ||
352 | Ecore_Event_Mouse_Button *_ecore_mouse_button(int event, | ||
353 | unsigned int timestamp, | ||
354 | unsigned int xmodifiers, | ||
355 | unsigned int buttons, | ||
356 | int x, | ||
357 | int y, | ||
358 | int x_root, | ||
359 | int y_root, | ||
360 | unsigned int event_window, | ||
361 | unsigned int window, | ||
362 | unsigned int root_win, | ||
363 | int same_screen, | ||
364 | int dev, | ||
365 | double radx, | ||
366 | double rady, | ||
367 | double pressure, | ||
368 | double angle, | ||
369 | double mx, | ||
370 | double my, | ||
371 | double mrx, | ||
372 | double mry); | ||
373 | |||
374 | void _ecore_x_modifiers_get(void); | ||
375 | |||
376 | //#define LOGFNS 1 | ||
377 | |||
378 | #ifdef LOGFNS | ||
379 | #include <stdio.h> | ||
380 | #define LOGFN(fl, ln, fn) printf("-ECORE-X: %25s: %5i - %s\n", fl, ln, fn); | ||
381 | #else /* ifdef LOGFNS */ | ||
382 | #define LOGFN(fl, ln, fn) | ||
383 | #endif /* ifdef LOGFNS */ | ||
384 | |||
385 | #endif /* ifndef _ECORE_X_PRIVATE_H */ | ||