Disabled Ecore::X.default_root_window.
[ruby-ecore.git] / src / ecore_x / rb_ecore_x.c
1 /*
2  * Copyright (C) 2004 ruby-ecore team (see AUTHORS)
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #include <ruby.h>
20
21 #include <Ecore.h>
22 #include <Ecore_X.h>
23 #include <X11/Xlib.h>
24
25 #include "../ecore/rb_ecore.h"
26 #include "../ecore/rb_event_handler.h"
27 #include "rb_ecore_x.h"
28 #include "rb_window.h"
29 #include "rb_cursor.h"
30
31 #if 0
32 static VALUE default_root;
33 #endif
34
35 static void at_exit ()
36 {
37         ecore_x_shutdown ();
38         ecore_shutdown ();
39 }
40
41 #if 0
42 static VALUE m_default_root_window_get (VALUE self)
43 {
44         return default_root;
45 }
46 #endif
47
48 static VALUE c_ev_key_down_init (VALUE self, VALUE event)
49 {
50         VALUE c = CLASS_OF (self);
51         Ecore_X_Event_Key_Down *e = (void *) event;
52
53         rb_define_attr (c, "keyname", 1, 0);
54         rb_define_attr (c, "keysymbol", 1, 0);
55         rb_define_attr (c, "key_compose", 1, 0);
56         rb_define_attr (c, "modifiers", 1, 0);
57         rb_define_attr (c, "window", 1, 0);
58         rb_define_attr (c, "event_window", 1, 0);
59         rb_define_attr (c, "time", 1, 0);
60
61         rb_iv_set (self, "@keyname",
62                    e->keyname ?  rb_str_new2 (e->keyname) : Qnil);
63         rb_iv_set (self, "@keysymbol",
64                    e->keysymbol ? rb_str_new2 (e->keysymbol) : Qnil);
65         rb_iv_set (self, "@key_compose",
66                    e->key_compose ? rb_str_new2 (e->key_compose) : Qnil);
67         rb_iv_set (self, "@modifiers", INT2FIX (e->modifiers));
68         rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
69         rb_iv_set (self, "@event_window",
70                    TO_ECORE_X_WINDOW (Qnil, e->event_win));
71         rb_iv_set (self, "@time", UINT2NUM (e->time));
72
73         return self;
74 }
75
76 static VALUE c_ev_mouse_button_down_init (VALUE self, VALUE event)
77 {
78         VALUE c = CLASS_OF (self);
79         Ecore_X_Event_Mouse_Button_Down *e = (void *) event;
80
81         rb_define_attr (c, "button", 1, 0);
82         rb_define_attr (c, "modifiers", 1, 0);
83         rb_define_attr (c, "x", 1, 0);
84         rb_define_attr (c, "y", 1, 0);
85         rb_define_attr (c, "root", 1, 0);
86         rb_define_attr (c, "window", 1, 0);
87         rb_define_attr (c, "event_window", 1, 0);
88         rb_define_attr (c, "time", 1, 0);
89         rb_define_attr (c, "double_click", 1, 0);
90         rb_define_attr (c, "triple_click", 1, 0);
91
92         rb_iv_set (self, "@button", INT2FIX (e->button));
93         rb_iv_set (self, "@modifiers", INT2FIX (e->modifiers));
94         rb_iv_set (self, "@x", INT2FIX (e->x));
95         rb_iv_set (self, "@y", INT2FIX (e->x));
96         rb_iv_set (self, "@root", rb_ary_new3 (2, INT2FIX (e->root.x),
97                                                INT2FIX (e->root.y)));
98         rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
99         rb_iv_set (self, "@event_window",
100                    TO_ECORE_X_WINDOW (Qnil, e->event_win));
101         rb_iv_set (self, "@time", UINT2NUM (e->time));
102         rb_iv_set (self, "@double_click",
103                    e->double_click ? Qtrue : Qfalse);
104         rb_iv_set (self, "@triple_click",
105                    e->triple_click ? Qtrue : Qfalse);
106
107         return self;
108 }
109
110 static VALUE c_ev_mouse_button_up_init (VALUE self, VALUE event)
111 {
112         VALUE c = CLASS_OF (self);
113         Ecore_X_Event_Mouse_Button_Up *e = (void *) event;
114
115         rb_define_attr (c, "button", 1, 0);
116         rb_define_attr (c, "modifiers", 1, 0);
117         rb_define_attr (c, "x", 1, 0);
118         rb_define_attr (c, "y", 1, 0);
119         rb_define_attr (c, "root", 1, 0);
120         rb_define_attr (c, "window", 1, 0);
121         rb_define_attr (c, "event_window", 1, 0);
122         rb_define_attr (c, "time", 1, 0);
123
124         rb_iv_set (self, "@button", INT2FIX (e->button));
125         rb_iv_set (self, "@modifiers", INT2FIX (e->modifiers));
126         rb_iv_set (self, "@x", INT2FIX (e->x));
127         rb_iv_set (self, "@y", INT2FIX (e->x));
128         rb_iv_set (self, "@root", rb_ary_new3 (2, INT2FIX (e->root.x),
129                                                INT2FIX (e->root.y)));
130         rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
131         rb_iv_set (self, "@event_window",
132                    TO_ECORE_X_WINDOW (Qnil, e->event_win));
133         rb_iv_set (self, "@time", UINT2NUM (e->time));
134
135         return self;
136 }
137
138 static VALUE c_ev_mouse_move_init (VALUE self, VALUE event)
139 {
140         VALUE c = CLASS_OF (self);
141         Ecore_X_Event_Mouse_Move *e = (void *) event;
142
143         rb_define_attr (c, "modifiers", 1, 0);
144         rb_define_attr (c, "x", 1, 0);
145         rb_define_attr (c, "y", 1, 0);
146         rb_define_attr (c, "root", 1, 0);
147         rb_define_attr (c, "window", 1, 0);
148         rb_define_attr (c, "event_window", 1, 0);
149         rb_define_attr (c, "time", 1, 0);
150
151         rb_iv_set (self, "@modifiers", INT2FIX (e->modifiers));
152         rb_iv_set (self, "@x", INT2FIX (e->x));
153         rb_iv_set (self, "@y", INT2FIX (e->y));
154         rb_iv_set (self, "@root", rb_ary_new3 (2, INT2FIX (e->root.x),
155                                                INT2FIX (e->root.y)));
156         rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
157         rb_iv_set (self, "@event_window",
158                    TO_ECORE_X_WINDOW (Qnil, e->event_win));
159         rb_iv_set (self, "@time", UINT2NUM (e->time));
160
161         return self;
162 }
163
164 static VALUE c_ev_mouse_in_init (VALUE self, VALUE event)
165 {
166         VALUE c = CLASS_OF (self);
167         Ecore_X_Event_Mouse_In *e = (void *) event;
168
169         rb_define_attr (c, "modifiers", 1, 0);
170         rb_define_attr (c, "x", 1, 0);
171         rb_define_attr (c, "y", 1, 0);
172         rb_define_attr (c, "root", 1, 0);
173         rb_define_attr (c, "window", 1, 0);
174         rb_define_attr (c, "event_window", 1, 0);
175         rb_define_attr (c, "mode", 1, 0);
176         rb_define_attr (c, "detail", 1, 0);
177         rb_define_attr (c, "time", 1, 0);
178
179         rb_iv_set (self, "@modifiers", INT2FIX (e->modifiers));
180         rb_iv_set (self, "@x", INT2FIX (e->x));
181         rb_iv_set (self, "@y", INT2FIX (e->y));
182         rb_iv_set (self, "@root", rb_ary_new3 (2, INT2FIX (e->root.x),
183                                                INT2FIX (e->root.y)));
184         rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
185         rb_iv_set (self, "@event_window",
186                    TO_ECORE_X_WINDOW (Qnil, e->event_win));
187         rb_iv_set (self, "@mode", INT2FIX (e->mode));
188         rb_iv_set (self, "@detail", INT2FIX (e->detail));
189         rb_iv_set (self, "@time", UINT2NUM (e->time));
190
191         return self;
192 }
193
194 static VALUE c_ev_win_focus_change_init (VALUE self, VALUE event)
195 {
196         VALUE c = CLASS_OF (self);
197         Ecore_X_Event_Window_Focus_In *e = (void *) event;
198
199         rb_define_attr (c, "window", 1, 0);
200         rb_define_attr (c, "mode", 1, 0);
201         rb_define_attr (c, "detail", 1, 0);
202         rb_define_attr (c, "time", 1, 0);
203
204         rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
205         rb_iv_set (self, "@mode", INT2FIX (e->mode));
206         rb_iv_set (self, "@detail", INT2FIX (e->detail));
207         rb_iv_set (self, "@time", UINT2NUM (e->time));
208
209         return self;
210 }
211
212 static VALUE c_ev_win_delete_request_init (VALUE self, VALUE event)
213 {
214         VALUE c = CLASS_OF (self);
215         Ecore_X_Event_Window_Delete_Request *e = (void *) event;
216
217         rb_define_attr (c, "window", 1, 0);
218         rb_define_attr (c, "time", 1, 0);
219
220         rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
221         rb_iv_set (self, "@time", UINT2NUM (e->time));
222
223         return self;
224 }
225
226 static VALUE c_ev_win_configure_request_init (VALUE self, VALUE event)
227 {
228         VALUE c = CLASS_OF (self);
229         Ecore_X_Event_Window_Configure_Request *e = (void *) event;
230
231         rb_define_attr (c, "window", 1, 0);
232         rb_define_attr (c, "window_above", 1, 0);
233         rb_define_attr (c, "x", 1, 0);
234         rb_define_attr (c, "y", 1, 0);
235         rb_define_attr (c, "w", 1, 0);
236         rb_define_attr (c, "h", 1, 0);
237         rb_define_attr (c, "border", 1, 0);
238         rb_define_attr (c, "detail", 1, 0);
239         rb_define_attr (c, "value_mask", 1, 0);
240         rb_define_attr (c, "time", 1, 0);
241
242         rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
243         rb_iv_set (self, "@window_above", TO_ECORE_X_WINDOW (Qnil,
244                                                              e->abovewin));
245         rb_iv_set (self, "@x", INT2FIX (e->x));
246         rb_iv_set (self, "@y", INT2FIX (e->y));
247         rb_iv_set (self, "@w", INT2FIX (e->w));
248         rb_iv_set (self, "@h", INT2FIX (e->h));
249         rb_iv_set (self, "@border", INT2FIX (e->border));
250         rb_iv_set (self, "@detail", INT2FIX (e->detail));
251         rb_iv_set (self, "@value_mask", INT2FIX (e->value_mask));
252         rb_iv_set (self, "@time", UINT2NUM (e->time));
253
254         return self;
255 }
256
257 static VALUE c_ev_win_configure_init (VALUE self, VALUE event)
258 {
259         VALUE c = CLASS_OF (self);
260         Ecore_X_Event_Window_Configure *e = (void *) event;
261
262         rb_define_attr (c, "window", 1, 0);
263         rb_define_attr (c, "window_above", 1, 0);
264         rb_define_attr (c, "x", 1, 0);
265         rb_define_attr (c, "y", 1, 0);
266         rb_define_attr (c, "w", 1, 0);
267         rb_define_attr (c, "h", 1, 0);
268         rb_define_attr (c, "border", 1, 0);
269         rb_define_attr (c, "override", 1, 0);
270         rb_define_attr (c, "from_wm", 1, 0);
271         rb_define_attr (c, "time", 1, 0);
272
273         rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
274         rb_iv_set (self, "@window_above", TO_ECORE_X_WINDOW (Qnil,
275                                                              e->abovewin));
276         rb_iv_set (self, "@x", INT2FIX (e->x));
277         rb_iv_set (self, "@y", INT2FIX (e->y));
278         rb_iv_set (self, "@w", INT2FIX (e->w));
279         rb_iv_set (self, "@h", INT2FIX (e->h));
280         rb_iv_set (self, "@border", INT2FIX (e->border));
281         rb_iv_set (self, "@override", e->override ? Qtrue : Qfalse);
282         rb_iv_set (self, "@from_wm", e->from_wm ? Qtrue : Qfalse);
283         rb_iv_set (self, "@time", UINT2NUM (e->time));
284
285         return self;
286 }
287
288 static VALUE c_ev_win_resize_request_init (VALUE self, VALUE event)
289 {
290         VALUE c = CLASS_OF (self);
291         Ecore_X_Event_Window_Resize_Request *e = (void *) event;
292
293         rb_define_attr (c, "window", 1, 0);
294         rb_define_attr (c, "w", 1, 0);
295         rb_define_attr (c, "h", 1, 0);
296         rb_define_attr (c, "time", 1, 0);
297
298         rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
299         rb_iv_set (self, "@w", INT2FIX (e->w));
300         rb_iv_set (self, "@h", INT2FIX (e->h));
301         rb_iv_set (self, "@time", UINT2NUM (e->time));
302
303         return self;
304 }
305
306 static VALUE c_ev_win_damage_init (VALUE self, VALUE event)
307 {
308         VALUE c = CLASS_OF (self);
309         Ecore_X_Event_Window_Damage *e = (void *) event;
310
311         rb_define_attr (c, "window", 1, 0);
312         rb_define_attr (c, "x", 1, 0);
313         rb_define_attr (c, "y", 1, 0);
314         rb_define_attr (c, "w", 1, 0);
315         rb_define_attr (c, "h", 1, 0);
316         rb_define_attr (c, "time", 1, 0);
317
318         rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
319         rb_iv_set (self, "@x", INT2FIX (e->x));
320         rb_iv_set (self, "@y", INT2FIX (e->y));
321         rb_iv_set (self, "@w", INT2FIX (e->w));
322         rb_iv_set (self, "@h", INT2FIX (e->h));
323         rb_iv_set (self, "@time", UINT2NUM (e->time));
324
325         return self;
326 }
327
328 static VALUE c_ev_win_visibility_change_init (VALUE self, VALUE event)
329 {
330         VALUE c = CLASS_OF (self);
331         Ecore_X_Event_Window_Visibility_Change *e = (void *) event;
332
333         rb_define_attr (c, "window", 1, 0);
334         rb_define_attr (c, "fully_obscured", 1, 0);
335         rb_define_attr (c, "time", 1, 0);
336
337         rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
338         rb_iv_set (self, "@fully_obscured", e->fully_obscured ? Qtrue : Qfalse);
339         rb_iv_set (self, "@time", UINT2NUM (e->time));
340
341         return self;
342 }
343
344 static VALUE c_ev_win_create_init (VALUE self, VALUE event)
345 {
346         VALUE c = CLASS_OF (self);
347         Ecore_X_Event_Window_Create *e = (void *) event;
348
349         rb_define_attr (c, "window", 1, 0);
350         rb_define_attr (c, "override", 1, 0);
351         rb_define_attr (c, "time", 1, 0);
352
353         rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
354         rb_iv_set (self, "@override", e->override ? Qtrue : Qfalse);
355         rb_iv_set (self, "@time", UINT2NUM (e->time));
356
357         return self;
358 }
359
360 static VALUE c_ev_win_show_request_init (VALUE self, VALUE event)
361 {
362         VALUE c = CLASS_OF (self);
363         Ecore_X_Event_Window_Show_Request *e = (void *) event;
364
365         rb_define_attr (c, "window", 1, 0);
366         rb_define_attr (c, "parent", 1, 0);
367         rb_define_attr (c, "time", 1, 0);
368
369         rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
370         rb_iv_set (self, "@parent", TO_ECORE_X_WINDOW (Qnil, e->parent));
371         rb_iv_set (self, "@time", UINT2NUM (e->time));
372
373         return self;
374 }
375
376 void Init_ecore_x (void)
377 {
378         VALUE c;
379         Ecore_X_Window w;
380
381         rb_require ("ecore");
382
383         /* we need to call ecore_x_init () here, to make sure the
384          * event ids are set properly
385          */
386         ecore_init ();
387         ecore_x_init (getenv ("DISPLAY"));
388         atexit (at_exit);
389
390         mX = rb_define_module_under (mEcore, "X");
391
392 #if 0
393         rb_define_module_function (mX, "default_root_window",
394                                    m_default_root_window_get, 0);
395 #endif
396
397         Init_Window ();
398         Init_Cursor ();
399
400 #if 0
401         /* now create the default root window object */
402         w = DefaultRootWindow (ecore_x_display_get ());
403         default_root = TO_ECORE_X_WINDOW (Qnil, w);
404         rb_global_variable (&default_root);
405 #endif
406
407         /* event mask values */
408         c = rb_define_class_under (mX, "EventMask", rb_cObject);
409         rb_define_private_method (rb_singleton_class (c), "new", NULL, 0);
410         DEF_CONST (c, ECORE_X_EVENT_MASK_, KEY_DOWN);
411         DEF_CONST (c, ECORE_X_EVENT_MASK_, KEY_UP);
412         DEF_CONST (c, ECORE_X_EVENT_MASK_, MOUSE_DOWN);
413         DEF_CONST (c, ECORE_X_EVENT_MASK_, MOUSE_UP);
414         DEF_CONST (c, ECORE_X_EVENT_MASK_, MOUSE_IN);
415         DEF_CONST (c, ECORE_X_EVENT_MASK_, MOUSE_OUT);
416         DEF_CONST (c, ECORE_X_EVENT_MASK_, MOUSE_MOVE);
417         DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_DAMAGE);
418         DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_VISIBILITY);
419         DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_CONFIGURE);
420         DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_RESIZE_MANAGE);
421         DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_MANAGE);
422         DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_CHILD_CONFIGURE);
423         DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_FOCUS_CHANGE);
424         DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_PROPERTY);
425         DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_COLORMAP);
426         DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_GRAB);
427         DEF_CONST (c, ECORE_X_EVENT_MASK_, MOUSE_WHEEL);
428         DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_FOCUS_IN);
429         DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_FOCUS_OUT);
430
431         /* wm protocols */
432         c = rb_define_class_under (mX, "WmProtocol", rb_cObject);
433         rb_define_private_method (rb_singleton_class (c), "new", NULL, 0);
434         DEF_CONST (c, ECORE_X_WM_PROTOCOL_, DELETE_REQUEST);
435         DEF_CONST (c, ECORE_X_WM_PROTOCOL_, TAKE_FOCUS);
436
437         /* event modes */
438         c = rb_define_class_under (mX, "EventMode", rb_cObject);
439         rb_define_private_method (rb_singleton_class (c), "new", NULL, 0);
440         DEF_CONST (c, ECORE_X_EVENT_MODE_, NORMAL);
441         DEF_CONST (c, ECORE_X_EVENT_MODE_, WHILE_GRABBED);
442         DEF_CONST (c, ECORE_X_EVENT_MODE_, GRAB);
443         DEF_CONST (c, ECORE_X_EVENT_MODE_, UNGRAB);
444
445         /* event details */
446         c = rb_define_class_under (mX, "EventDetail", rb_cObject);
447         rb_define_private_method (rb_singleton_class (c), "new", NULL, 0);
448         DEF_CONST (c, ECORE_X_EVENT_DETAIL_, ANCESTOR);
449         DEF_CONST (c, ECORE_X_EVENT_DETAIL_, VIRTUAL);
450         DEF_CONST (c, ECORE_X_EVENT_DETAIL_, INFERIOR);
451         DEF_CONST (c, ECORE_X_EVENT_DETAIL_, NON_LINEAR);
452         DEF_CONST (c, ECORE_X_EVENT_DETAIL_, NON_LINEAR_VIRTUAL);
453         DEF_CONST (c, ECORE_X_EVENT_DETAIL_, POINTER);
454         DEF_CONST (c, ECORE_X_EVENT_DETAIL_, POINTER_ROOT);
455         DEF_CONST (c, ECORE_X_EVENT_DETAIL_, DETAIL_NONE);
456
457         /* key modifiers */
458         c = rb_define_class_under (mX, "Modifier", rb_cObject);
459         rb_define_private_method (rb_singleton_class (c), "new", NULL, 0);
460         DEF_CONST (c, ECORE_X_MODIFIER_, SHIFT);
461         DEF_CONST (c, ECORE_X_MODIFIER_, CTRL);
462         DEF_CONST (c, ECORE_X_MODIFIER_, ALT);
463         DEF_CONST (c, ECORE_X_MODIFIER_, WIN);
464
465         /* events */
466         ADD_EVENT (mX, ECORE_X_EVENT_KEY_DOWN, "KeyDownEvent", c);
467         rb_define_private_method (c, "initialize",
468                                   c_ev_key_down_init, 1);
469
470         ADD_EVENT (mX, ECORE_X_EVENT_KEY_UP, "KeyUpEvent", c);
471         rb_define_private_method (c, "initialize",
472                                   c_ev_key_down_init, 1);
473
474         ADD_EVENT (mX, ECORE_X_EVENT_MOUSE_BUTTON_DOWN,
475                    "MouseButtonDownEvent", c);
476         rb_define_private_method (c, "initialize",
477                                   c_ev_mouse_button_down_init, 1);
478
479         ADD_EVENT (mX, ECORE_X_EVENT_MOUSE_BUTTON_UP,
480                    "MouseButtonUpEvent", c);
481         rb_define_private_method (c, "initialize",
482                                   c_ev_mouse_button_up_init, 1);
483
484         ADD_EVENT (mX, ECORE_X_EVENT_MOUSE_MOVE, "MouseMoveEvent", c);
485         rb_define_private_method (c, "initialize",
486                                   c_ev_mouse_move_init, 1);
487
488         ADD_EVENT (mX, ECORE_X_EVENT_MOUSE_IN, "MouseInEvent", c);
489         rb_define_private_method (c, "initialize",
490                                   c_ev_mouse_in_init, 1);
491
492         ADD_EVENT (mX, ECORE_X_EVENT_MOUSE_OUT, "MouseOutEvent", c);
493         rb_define_private_method (c, "initialize",
494                                   c_ev_mouse_in_init, 1);
495
496         ADD_EVENT (mX, ECORE_X_EVENT_WINDOW_FOCUS_IN,
497                    "WindowFocusInEvent", c);
498         rb_define_private_method (c, "initialize",
499                                   c_ev_win_focus_change_init, 1);
500
501         ADD_EVENT (mX, ECORE_X_EVENT_WINDOW_FOCUS_OUT,
502                    "WindowFocusOutEvent", c);
503         rb_define_private_method (c, "initialize",
504                                   c_ev_win_focus_change_init, 1);
505
506         ADD_EVENT (mX, ECORE_X_EVENT_WINDOW_DELETE_REQUEST,
507                    "WindowDeleteRequestEvent", c);
508         rb_define_private_method (c, "initialize",
509                                   c_ev_win_delete_request_init, 1);
510
511         ADD_EVENT (mX, ECORE_X_EVENT_WINDOW_CONFIGURE_REQUEST,
512                    "WindowConfigureRequestEvent", c);
513         rb_define_private_method (c, "initialize",
514                                   c_ev_win_configure_request_init, 1);
515
516         ADD_EVENT (mX, ECORE_X_EVENT_WINDOW_CONFIGURE,
517                    "WindowConfigureEvent", c);
518         rb_define_private_method (c, "initialize",
519                                   c_ev_win_configure_init, 1);
520
521         ADD_EVENT (mX, ECORE_X_EVENT_WINDOW_RESIZE_REQUEST,
522                    "WindowResizeRequestEvent", c);
523         rb_define_private_method (c, "initialize",
524                                   c_ev_win_resize_request_init, 1);
525
526         ADD_EVENT (mX, ECORE_X_EVENT_WINDOW_DAMAGE, "WindowDamageEvent", c);
527         rb_define_private_method (c, "initialize",
528                                   c_ev_win_damage_init, 1);
529
530         ADD_EVENT (mX, ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE,
531                    "WindowVisibilityChangeEvent", c);
532         rb_define_private_method (c, "initialize",
533                                   c_ev_win_visibility_change_init, 1);
534
535         ADD_EVENT (mX, ECORE_X_EVENT_WINDOW_CREATE, "WindowCreateEvent", c);
536         rb_define_private_method (c, "initialize",
537                                   c_ev_win_create_init, 1);
538
539         ADD_EVENT (mX, ECORE_X_EVENT_WINDOW_DESTROY, "WindowDestroyEvent", c);
540         rb_define_private_method (c, "initialize",
541                                   c_ev_win_delete_request_init, 1);
542
543         ADD_EVENT (mX, ECORE_X_EVENT_WINDOW_SHOW, "WindowShowEvent", c);
544         rb_define_private_method (c, "initialize",
545                                   c_ev_win_delete_request_init, 1);
546
547         ADD_EVENT (mX, ECORE_X_EVENT_WINDOW_HIDE, "WindowHideEvent", c);
548         rb_define_private_method (c, "initialize",
549                                   c_ev_win_delete_request_init, 1);
550
551         ADD_EVENT (mX, ECORE_X_EVENT_WINDOW_SHOW_REQUEST,
552                    "WindowShowRequestEvent", c);
553         rb_define_private_method (c, "initialize",
554                                   c_ev_win_show_request_init, 1);
555 }