1 #ifndef _ECORE_X_PRIVATE_H
2 #define _ECORE_X_PRIVATE_H
6 #define MAXHOSTNAMELEN 256
7 #endif /* ifndef MAXHOSTNAMELEN */
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>
20 #include <X11/Xcursor/Xcursor.h>
21 #endif /* ifdef ECORE_XCURSOR */
23 #include <X11/extensions/Print.h>
24 #endif /* ifdef ECORE_XPRINT */
26 #include <X11/extensions/Xinerama.h>
27 #endif /* ifdef ECORE_XINERAMA */
29 #include <X11/extensions/Xrandr.h>
30 #endif /* ifdef ECORE_XRANDR */
32 #include <X11/extensions/scrnsaver.h>
33 #endif /* ifdef ECORE_XSS */
35 #include <X11/extensions/Xrender.h>
36 #endif /* ifdef ECORE_XRENDER */
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 */
44 #include <X11/extensions/Xdamage.h>
45 #endif /* ifdef ECORE_XDAMAGE */
47 #include <X11/extensions/dpms.h>
48 #endif /* ifdef ECORE_XDPMS */
50 #include <X11/XKBlib.h>
51 #endif /* ifdef ECORE_XKB */
53 #include <X11/extensions/XInput2.h>
54 #endif /* ifdef ECORE_XI2 */
57 # define XK_MISCELLANY 1
61 #include "ecore_private.h"
63 #include "Ecore_Input.h"
65 extern int _ecore_xlib_log_dom;
66 #ifdef ECORE_XLIB_DEFAULT_LOG_COLOR
67 # undef ECORE_XLIB_DEFAULT_LOG_COLOR
68 #endif /* ifdef ECORE_XLIB_DEFAULT_LOG_COLOR */
69 #define ECORE_XLIB_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
73 #endif /* ifdef ERR */
74 #define ERR(...) EINA_LOG_DOM_ERR(_ecore_xlib_log_dom, __VA_ARGS__)
78 #endif /* ifdef DBG */
79 #define DBG(...) EINA_LOG_DOM_DBG(_ecore_xlib_log_dom, __VA_ARGS__)
83 #endif /* ifdef INF */
84 #define INF(...) EINA_LOG_DOM_INFO(_ecore_xlib_log_dom, __VA_ARGS__)
88 #endif /* ifdef WRN */
89 #define WRN(...) EINA_LOG_DOM_WARN(_ecore_xlib_log_dom, __VA_ARGS__)
93 #endif /* ifdef CRIT */
94 #define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_xlib_log_dom, __VA_ARGS__)
96 typedef struct _Ecore_X_Selection_Intern Ecore_X_Selection_Intern;
98 struct _Ecore_X_Selection_Intern
101 Ecore_X_Atom selection;
107 typedef struct _Ecore_X_Selection_Converter Ecore_X_Selection_Converter;
109 struct _Ecore_X_Selection_Converter
112 Eina_Bool (*convert)(char *target, void *data, int size,
113 void **data_ret, int *size_ret,
114 Ecore_X_Atom *type, int *typeseize);
115 Ecore_X_Selection_Converter *next;
118 typedef struct _Ecore_X_Selection_Parser Ecore_X_Selection_Parser;
120 struct _Ecore_X_Selection_Parser
123 void *(*parse)(const char *target, void *data, int size, int format);
124 Ecore_X_Selection_Parser *next;
127 typedef struct _Ecore_X_DND_Source
130 Ecore_X_Window win, dest;
133 ECORE_X_DND_SOURCE_IDLE,
134 ECORE_X_DND_SOURCE_DRAGGING,
135 ECORE_X_DND_SOURCE_DROPPED,
136 ECORE_X_DND_SOURCE_CONVERTING
142 unsigned short width, height;
147 Ecore_X_Window window;
153 Ecore_X_Atom action, accepted_action;
159 } Ecore_X_DND_Source;
161 typedef struct _Ecore_X_DND_Target
164 Ecore_X_Window win, source;
167 ECORE_X_DND_TARGET_IDLE,
168 ECORE_X_DND_TARGET_ENTERED
178 Ecore_X_Atom action, accepted_action;
181 } Ecore_X_DND_Target;
183 extern int ECORE_X_MODIFIER_SHIFT;
184 extern int ECORE_X_MODIFIER_CTRL;
185 extern int ECORE_X_MODIFIER_ALT;
186 extern int ECORE_X_MODIFIER_WIN;
188 extern int ECORE_X_LOCK_SCROLL;
189 extern int ECORE_X_LOCK_NUM;
190 extern int ECORE_X_LOCK_CAPS;
192 extern Display *_ecore_x_disp;
193 extern double _ecore_x_double_click_time;
194 extern Time _ecore_x_event_last_time;
195 extern Window _ecore_x_event_last_win;
196 extern int _ecore_x_event_last_root_x;
197 extern int _ecore_x_event_last_root_y;
198 extern Eina_Bool _ecore_x_xcursor;
199 extern XIC _ecore_x_ic;
201 extern Ecore_X_Atom _ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_NUM];
203 extern int _ecore_window_grabs_num;
204 extern Window *_ecore_window_grabs;
205 extern Eina_Bool (*_ecore_window_grab_replay_func)(void *data, int event_type,
207 extern void *_ecore_window_grab_replay_data;
209 extern Ecore_X_Window _ecore_x_private_win;
211 void _ecore_x_error_handler_init(void);
212 void _ecore_x_event_handle_any_event(XEvent *xevent);
213 void _ecore_x_event_handle_key_press(XEvent *xevent);
214 void _ecore_x_event_handle_key_release(XEvent *xevent);
215 void _ecore_x_event_handle_button_press(XEvent *xevent);
216 void _ecore_x_event_handle_button_release(XEvent *xevent);
217 void _ecore_x_event_handle_motion_notify(XEvent *xevent);
218 void _ecore_x_event_handle_enter_notify(XEvent *xevent);
219 void _ecore_x_event_handle_leave_notify(XEvent *xevent);
220 void _ecore_x_event_handle_focus_in(XEvent *xevent);
221 void _ecore_x_event_handle_focus_out(XEvent *xevent);
222 void _ecore_x_event_handle_keymap_notify(XEvent *xevent);
223 void _ecore_x_event_handle_expose(XEvent *xevent);
224 void _ecore_x_event_handle_graphics_expose(XEvent *xevent);
225 void _ecore_x_event_handle_visibility_notify(
227 void _ecore_x_event_handle_create_notify(XEvent *xevent);
228 void _ecore_x_event_handle_destroy_notify(XEvent *xevent);
229 void _ecore_x_event_handle_unmap_notify(XEvent *xevent);
230 void _ecore_x_event_handle_map_notify(XEvent *xevent);
231 void _ecore_x_event_handle_map_request(XEvent *xevent);
232 void _ecore_x_event_handle_reparent_notify(XEvent *xevent);
233 void _ecore_x_event_handle_configure_notify(XEvent *xevent);
234 void _ecore_x_event_handle_configure_request(
236 void _ecore_x_event_handle_gravity_notify(XEvent *xevent);
237 void _ecore_x_event_handle_resize_request(XEvent *xevent);
238 void _ecore_x_event_handle_circulate_notify(XEvent *xevent);
239 void _ecore_x_event_handle_circulate_request(
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(
245 void _ecore_x_event_handle_selection_notify(XEvent *xevent);
246 void _ecore_x_event_handle_colormap_notify(XEvent *xevent);
247 void _ecore_x_event_handle_client_message(XEvent *xevent);
248 void _ecore_x_event_handle_mapping_notify(XEvent *xevent);
249 void _ecore_x_event_handle_shape_change(XEvent *xevent);
250 void _ecore_x_event_handle_screensaver_notify(
252 void _ecore_x_event_handle_sync_counter(XEvent *xevent);
253 void _ecore_x_event_handle_sync_alarm(XEvent *xevent);
255 void _ecore_x_event_handle_randr_change(XEvent *xevent);
256 void _ecore_x_event_handle_randr_notify(XEvent *xevent);
257 #endif /* ifdef ECORE_XRANDR */
259 void _ecore_x_event_handle_fixes_selection_notify(
261 #endif /* ifdef ECORE_XFIXES */
263 void _ecore_x_event_handle_damage_notify(XEvent *xevent);
264 #endif /* ifdef ECORE_XDAMAGE */
265 void _ecore_x_event_handle_generic_event(XEvent *xevent);
267 void _ecore_x_selection_data_init(void);
268 void _ecore_x_selection_shutdown(void);
270 _ecore_x_selection_target_atom_get(const char *target);
271 char * _ecore_x_selection_target_get(Ecore_X_Atom target);
272 Ecore_X_Selection_Intern *
273 _ecore_x_selection_get(Ecore_X_Atom selection);
274 Eina_Bool _ecore_x_selection_set(Window w,
277 Ecore_X_Atom selection);
278 int _ecore_x_selection_convert(Ecore_X_Atom selection,
281 Ecore_X_Atom *targettype,
283 void * _ecore_x_selection_parse(const char *target,
288 void _ecore_x_sync_magic_send(int val, Ecore_X_Window swin);
289 void _ecore_x_window_grab_remove(Ecore_X_Window win);
290 void _ecore_x_key_grab_remove(Ecore_X_Window win);
293 void _ecore_x_dnd_init(void);
294 Ecore_X_DND_Source * _ecore_x_dnd_source_get(void);
295 Ecore_X_DND_Target * _ecore_x_dnd_target_get(void);
296 void _ecore_x_dnd_drag(Ecore_X_Window root, int x, int y);
297 void _ecore_x_dnd_shutdown(void);
300 Ecore_X_Window_State _ecore_x_netwm_state_get(Ecore_X_Atom a);
301 int _ecore_x_netwm_startup_info_begin(Ecore_X_Window win,
303 int _ecore_x_netwm_startup_info(Ecore_X_Window win,
306 /* Fixes * Damage * Composite * DPMS */
307 void _ecore_x_fixes_init(void);
308 void _ecore_x_damage_init(void);
309 void _ecore_x_composite_init(void);
310 void _ecore_x_dpms_init(void);
311 void _ecore_x_randr_init(void);
313 void _ecore_x_atoms_init(void);
315 extern int _ecore_x_xi2_opcode;
317 void _ecore_x_input_init(void);
318 void _ecore_x_input_shutdown(void);
319 void _ecore_x_input_handler(XEvent *xevent);
322 void _ecore_mouse_move(unsigned int timestamp,
323 unsigned int xmodifiers,
328 unsigned int event_window,
330 unsigned int root_win,
341 Ecore_Event_Mouse_Button * _ecore_mouse_button(int event,
342 unsigned int timestamp,
343 unsigned int xmodifiers,
344 unsigned int buttons,
349 unsigned int event_window,
351 unsigned int root_win,
367 #define LOGFN(fl, ln, fn) printf("-ECORE-X: %25s: %5i - %s\n", fl, ln, fn);
368 #else /* ifdef LOGFNS */
369 #define LOGFN(fl, ln, fn)
370 #endif /* ifdef LOGFNS */
372 #endif /* ifndef _ECORE_X_PRIVATE_H */