1 #ifndef _ECORE_X_PRIVATE_H
2 #define _ECORE_X_PRIVATE_H
6 #define MAXHOSTNAMELEN 256
9 #define XK_MISCELLANY 1
11 #include <X11/Xproto.h>
12 #include <X11/Xutil.h>
13 #include <X11/Xatom.h>
14 #include <X11/Xresource.h>
15 #include <X11/keysymdef.h>
16 #include <X11/extensions/XShm.h>
17 #include <X11/extensions/shape.h>
18 #include <X11/extensions/sync.h>
19 #include <X11/extensions/dpms.h>
21 #include <X11/Xcursor/Xcursor.h>
24 #include <X11/extensions/Print.h>
27 #include <X11/extensions/Xinerama.h>
30 #include <X11/extensions/Xrandr.h>
33 #include <X11/extensions/scrnsaver.h>
36 #include <X11/extensions/Xrender.h>
39 #include <X11/extensions/Xfixes.h>
41 #ifdef ECORE_XCOMPOSITE
42 #include <X11/extensions/Xcomposite.h>
45 #include <X11/extensions/Xdamage.h>
48 #include <X11/extensions/dpms.h>
51 #include <X11/XKBlib.h>
55 #include "ecore_private.h"
58 /* FIXME: this is for simulation only */
59 #include "Ecore_Txt.h"
61 extern int _ecore_xlib_log_dom;
62 #ifdef ECORE_XLIB_DEFAULT_LOG_COLOR
63 # undef ECORE_XLIB_DEFAULT_LOG_COLOR
65 #define ECORE_XLIB_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
70 #define ERR(...) EINA_LOG_DOM_ERR(_ecore_xlib_log_dom, __VA_ARGS__)
75 #define DBG(...) EINA_LOG_DOM_DBG(_ecore_xlib_log_dom, __VA_ARGS__)
80 #define INF(...) EINA_LOG_DOM_INFO(_ecore_xlib_log_dom, __VA_ARGS__)
85 #define WRN(...) EINA_LOG_DOM_WARN(_ecore_xlib_log_dom, __VA_ARGS__)
90 #define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_xlib_log_dom, __VA_ARGS__)
92 typedef struct _Ecore_X_Selection_Intern Ecore_X_Selection_Intern;
94 struct _Ecore_X_Selection_Intern
97 Ecore_X_Atom selection;
103 typedef struct _Ecore_X_Selection_Converter Ecore_X_Selection_Converter;
105 struct _Ecore_X_Selection_Converter
108 int (*convert)(char *target, void *data, int size,
109 void **data_ret, int *size_ret);
110 Ecore_X_Selection_Converter *next;
113 typedef struct _Ecore_X_Selection_Parser Ecore_X_Selection_Parser;
115 struct _Ecore_X_Selection_Parser
118 void *(*parse)(const char *target, void *data, int size, int format);
119 Ecore_X_Selection_Parser *next;
122 typedef struct _Ecore_X_DND_Source
125 Ecore_X_Window win, dest;
128 ECORE_X_DND_SOURCE_IDLE,
129 ECORE_X_DND_SOURCE_DRAGGING,
130 ECORE_X_DND_SOURCE_DROPPED,
131 ECORE_X_DND_SOURCE_CONVERTING
136 unsigned short width, height;
140 Ecore_X_Window window;
146 Ecore_X_Atom action, accepted_action;
152 } Ecore_X_DND_Source;
154 typedef struct _Ecore_X_DND_Target
157 Ecore_X_Window win, source;
160 ECORE_X_DND_TARGET_IDLE,
161 ECORE_X_DND_TARGET_ENTERED
170 Ecore_X_Atom action, accepted_action;
173 } Ecore_X_DND_Target;
176 extern int ECORE_X_MODIFIER_SHIFT;
177 extern int ECORE_X_MODIFIER_CTRL;
178 extern int ECORE_X_MODIFIER_ALT;
179 extern int ECORE_X_MODIFIER_WIN;
181 extern int ECORE_X_LOCK_SCROLL;
182 extern int ECORE_X_LOCK_NUM;
183 extern int ECORE_X_LOCK_CAPS;
185 extern Display *_ecore_x_disp;
186 extern double _ecore_x_double_click_time;
187 extern Time _ecore_x_event_last_time;
188 extern Window _ecore_x_event_last_win;
189 extern int _ecore_x_event_last_root_x;
190 extern int _ecore_x_event_last_root_y;
191 extern int _ecore_x_xcursor;
192 extern XIC _ecore_x_ic;
194 extern Ecore_X_Atom _ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_NUM];
196 extern int _ecore_window_grabs_num;
197 extern Window *_ecore_window_grabs;
198 extern int (*_ecore_window_grab_replay_func) (void *data, int event_type, void *event);
199 extern void *_ecore_window_grab_replay_data;
201 extern Ecore_X_Window _ecore_x_private_win;
203 void _ecore_x_error_handler_init(void);
204 void _ecore_x_event_handle_any_event(XEvent *xevent);
205 void _ecore_x_event_handle_key_press(XEvent *xevent);
206 void _ecore_x_event_handle_key_release(XEvent *xevent);
207 void _ecore_x_event_handle_button_press(XEvent *xevent);
208 void _ecore_x_event_handle_button_release(XEvent *xevent);
209 void _ecore_x_event_handle_motion_notify(XEvent *xevent);
210 void _ecore_x_event_handle_enter_notify(XEvent *xevent);
211 void _ecore_x_event_handle_leave_notify(XEvent *xevent);
212 void _ecore_x_event_handle_focus_in(XEvent *xevent);
213 void _ecore_x_event_handle_focus_out(XEvent *xevent);
214 void _ecore_x_event_handle_keymap_notify(XEvent *xevent);
215 void _ecore_x_event_handle_expose(XEvent *xevent);
216 void _ecore_x_event_handle_graphics_expose(XEvent *xevent);
217 void _ecore_x_event_handle_visibility_notify(XEvent *xevent);
218 void _ecore_x_event_handle_create_notify(XEvent *xevent);
219 void _ecore_x_event_handle_destroy_notify(XEvent *xevent);
220 void _ecore_x_event_handle_unmap_notify(XEvent *xevent);
221 void _ecore_x_event_handle_map_notify(XEvent *xevent);
222 void _ecore_x_event_handle_map_request(XEvent *xevent);
223 void _ecore_x_event_handle_reparent_notify(XEvent *xevent);
224 void _ecore_x_event_handle_configure_notify(XEvent *xevent);
225 void _ecore_x_event_handle_configure_request(XEvent *xevent);
226 void _ecore_x_event_handle_gravity_notify(XEvent *xevent);
227 void _ecore_x_event_handle_resize_request(XEvent *xevent);
228 void _ecore_x_event_handle_circulate_notify(XEvent *xevent);
229 void _ecore_x_event_handle_circulate_request(XEvent *xevent);
230 void _ecore_x_event_handle_property_notify(XEvent *xevent);
231 void _ecore_x_event_handle_selection_clear(XEvent *xevent);
232 void _ecore_x_event_handle_selection_request(XEvent *xevent);
233 void _ecore_x_event_handle_selection_notify(XEvent *xevent);
234 void _ecore_x_event_handle_colormap_notify(XEvent *xevent);
235 void _ecore_x_event_handle_client_message(XEvent *xevent);
236 void _ecore_x_event_handle_mapping_notify(XEvent *xevent);
237 void _ecore_x_event_handle_shape_change(XEvent *xevent);
238 void _ecore_x_event_handle_screensaver_notify(XEvent *xevent);
239 void _ecore_x_event_handle_sync_counter(XEvent *xevent);
240 void _ecore_x_event_handle_sync_alarm(XEvent *xevent);
242 void _ecore_x_event_handle_randr_change(XEvent *xevent);
243 void _ecore_x_event_handle_randr_notify(XEvent *xevent);
246 void _ecore_x_event_handle_fixes_selection_notify(XEvent *xevent);
249 void _ecore_x_event_handle_damage_notify(XEvent *xevent);
252 void _ecore_x_selection_data_init(void);
253 void _ecore_x_selection_shutdown(void);
255 _ecore_x_selection_target_atom_get(const char *target);
256 char *_ecore_x_selection_target_get(Ecore_X_Atom target);
257 Ecore_X_Selection_Intern *
258 _ecore_x_selection_get(Ecore_X_Atom selection);
259 int _ecore_x_selection_set(Window w, const void *data, int len, Ecore_X_Atom selection);
260 int _ecore_x_selection_convert(Ecore_X_Atom selection, Ecore_X_Atom target, void **data_ret);
261 void *_ecore_x_selection_parse(const char *target, void *data, int size, int format);
263 void _ecore_x_sync_magic_send(int val, Ecore_X_Window swin);
264 void _ecore_x_window_grab_remove(Ecore_X_Window win);
265 void _ecore_x_key_grab_remove(Ecore_X_Window win);
268 void _ecore_x_dnd_init(void);
269 Ecore_X_DND_Source *_ecore_x_dnd_source_get(void);
270 Ecore_X_DND_Target *_ecore_x_dnd_target_get(void);
271 void _ecore_x_dnd_drag(Ecore_X_Window root, int x, int y);
272 void _ecore_x_dnd_shutdown(void);
275 Ecore_X_Window_State _ecore_x_netwm_state_get(Ecore_X_Atom a);
276 int _ecore_x_netwm_startup_info_begin(Ecore_X_Window win, char *data);
277 int _ecore_x_netwm_startup_info(Ecore_X_Window win, char *data);
279 /* Fixes * Damage * Composite * DPMS */
280 void _ecore_x_fixes_init(void);
281 void _ecore_x_damage_init(void);
282 void _ecore_x_composite_init(void);
283 void _ecore_x_dpms_init(void);
284 void _ecore_x_randr_init(void);
286 void _ecore_x_atoms_init(void);