2 * $Id: rb_ecore_x.c 101 2004-08-27 23:56:26Z tilman $
4 * Copyright (C) 2004 ruby-ecore team (see AUTHORS)
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include "../ecore/rb_ecore.h"
28 #include "../ecore/rb_event_handler.h"
29 #include "rb_ecore_x.h"
30 #include "rb_window.h"
31 #include "rb_cursor.h"
33 static VALUE default_root;
35 static void at_exit ()
41 static VALUE m_default_root_window_get (VALUE self)
46 static VALUE c_ev_key_down_init (VALUE self, VALUE event)
48 VALUE c = CLASS_OF (self);
49 Ecore_X_Event_Key_Down *e = (void *) event;
51 rb_define_attr (c, "keyname", 1, 0);
52 rb_define_attr (c, "keysymbol", 1, 0);
53 rb_define_attr (c, "key_compose", 1, 0);
54 rb_define_attr (c, "modifiers", 1, 0);
55 rb_define_attr (c, "window", 1, 0);
56 rb_define_attr (c, "event_window", 1, 0);
57 rb_define_attr (c, "time", 1, 0);
59 rb_iv_set (self, "@keyname",
60 e->keyname ? rb_str_new2 (e->keyname) : Qnil);
61 rb_iv_set (self, "@keysymbol",
62 e->keysymbol ? rb_str_new2 (e->keysymbol) : Qnil);
63 rb_iv_set (self, "@key_compose",
64 e->key_compose ? rb_str_new2 (e->key_compose) : Qnil);
65 rb_iv_set (self, "@modifiers", INT2FIX (e->modifiers));
66 rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
67 rb_iv_set (self, "@event_window",
68 TO_ECORE_X_WINDOW (Qnil, e->event_win));
69 rb_iv_set (self, "@time", UINT2NUM (e->time));
74 static VALUE c_ev_mouse_button_down_init (VALUE self, VALUE event)
76 VALUE c = CLASS_OF (self);
77 Ecore_X_Event_Mouse_Button_Down *e = (void *) event;
79 rb_define_attr (c, "button", 1, 0);
80 rb_define_attr (c, "modifiers", 1, 0);
81 rb_define_attr (c, "x", 1, 0);
82 rb_define_attr (c, "y", 1, 0);
83 rb_define_attr (c, "root", 1, 0);
84 rb_define_attr (c, "window", 1, 0);
85 rb_define_attr (c, "event_window", 1, 0);
86 rb_define_attr (c, "time", 1, 0);
87 rb_define_attr (c, "double_click", 1, 0);
88 rb_define_attr (c, "triple_click", 1, 0);
90 rb_iv_set (self, "@button", INT2FIX (e->button));
91 rb_iv_set (self, "@modifiers", INT2FIX (e->modifiers));
92 rb_iv_set (self, "@x", INT2FIX (e->x));
93 rb_iv_set (self, "@y", INT2FIX (e->x));
94 rb_iv_set (self, "@root", rb_ary_new3 (2, INT2FIX (e->root.x),
95 INT2FIX (e->root.y)));
96 rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
97 rb_iv_set (self, "@event_window",
98 TO_ECORE_X_WINDOW (Qnil, e->event_win));
99 rb_iv_set (self, "@time", UINT2NUM (e->time));
100 rb_iv_set (self, "@double_click",
101 e->double_click ? Qtrue : Qfalse);
102 rb_iv_set (self, "@triple_click",
103 e->triple_click ? Qtrue : Qfalse);
108 static VALUE c_ev_mouse_button_up_init (VALUE self, VALUE event)
110 VALUE c = CLASS_OF (self);
111 Ecore_X_Event_Mouse_Button_Up *e = (void *) event;
113 rb_define_attr (c, "button", 1, 0);
114 rb_define_attr (c, "modifiers", 1, 0);
115 rb_define_attr (c, "x", 1, 0);
116 rb_define_attr (c, "y", 1, 0);
117 rb_define_attr (c, "root", 1, 0);
118 rb_define_attr (c, "window", 1, 0);
119 rb_define_attr (c, "event_window", 1, 0);
120 rb_define_attr (c, "time", 1, 0);
122 rb_iv_set (self, "@button", INT2FIX (e->button));
123 rb_iv_set (self, "@modifiers", INT2FIX (e->modifiers));
124 rb_iv_set (self, "@x", INT2FIX (e->x));
125 rb_iv_set (self, "@y", INT2FIX (e->x));
126 rb_iv_set (self, "@root", rb_ary_new3 (2, INT2FIX (e->root.x),
127 INT2FIX (e->root.y)));
128 rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
129 rb_iv_set (self, "@event_window",
130 TO_ECORE_X_WINDOW (Qnil, e->event_win));
131 rb_iv_set (self, "@time", UINT2NUM (e->time));
136 static VALUE c_ev_mouse_move_init (VALUE self, VALUE event)
138 VALUE c = CLASS_OF (self);
139 Ecore_X_Event_Mouse_Move *e = (void *) event;
141 rb_define_attr (c, "modifiers", 1, 0);
142 rb_define_attr (c, "x", 1, 0);
143 rb_define_attr (c, "y", 1, 0);
144 rb_define_attr (c, "root", 1, 0);
145 rb_define_attr (c, "window", 1, 0);
146 rb_define_attr (c, "event_window", 1, 0);
147 rb_define_attr (c, "time", 1, 0);
149 rb_iv_set (self, "@modifiers", INT2FIX (e->modifiers));
150 rb_iv_set (self, "@x", INT2FIX (e->x));
151 rb_iv_set (self, "@y", INT2FIX (e->y));
152 rb_iv_set (self, "@root", rb_ary_new3 (2, INT2FIX (e->root.x),
153 INT2FIX (e->root.y)));
154 rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
155 rb_iv_set (self, "@event_window",
156 TO_ECORE_X_WINDOW (Qnil, e->event_win));
157 rb_iv_set (self, "@time", UINT2NUM (e->time));
162 static VALUE c_ev_mouse_in_init (VALUE self, VALUE event)
164 VALUE c = CLASS_OF (self);
165 Ecore_X_Event_Mouse_In *e = (void *) event;
167 rb_define_attr (c, "modifiers", 1, 0);
168 rb_define_attr (c, "x", 1, 0);
169 rb_define_attr (c, "y", 1, 0);
170 rb_define_attr (c, "root", 1, 0);
171 rb_define_attr (c, "window", 1, 0);
172 rb_define_attr (c, "event_window", 1, 0);
173 rb_define_attr (c, "mode", 1, 0);
174 rb_define_attr (c, "detail", 1, 0);
175 rb_define_attr (c, "time", 1, 0);
177 rb_iv_set (self, "@modifiers", INT2FIX (e->modifiers));
178 rb_iv_set (self, "@x", INT2FIX (e->x));
179 rb_iv_set (self, "@y", INT2FIX (e->y));
180 rb_iv_set (self, "@root", rb_ary_new3 (2, INT2FIX (e->root.x),
181 INT2FIX (e->root.y)));
182 rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
183 rb_iv_set (self, "@event_window",
184 TO_ECORE_X_WINDOW (Qnil, e->event_win));
185 rb_iv_set (self, "@mode", INT2FIX (e->mode));
186 rb_iv_set (self, "@detail", INT2FIX (e->detail));
187 rb_iv_set (self, "@time", UINT2NUM (e->time));
192 static VALUE c_ev_win_focus_change_init (VALUE self, VALUE event)
194 VALUE c = CLASS_OF (self);
195 Ecore_X_Event_Window_Focus_In *e = (void *) event;
197 rb_define_attr (c, "window", 1, 0);
198 rb_define_attr (c, "mode", 1, 0);
199 rb_define_attr (c, "detail", 1, 0);
200 rb_define_attr (c, "time", 1, 0);
202 rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
203 rb_iv_set (self, "@mode", INT2FIX (e->mode));
204 rb_iv_set (self, "@detail", INT2FIX (e->detail));
205 rb_iv_set (self, "@time", UINT2NUM (e->time));
210 static VALUE c_ev_win_delete_request_init (VALUE self, VALUE event)
212 VALUE c = CLASS_OF (self);
213 Ecore_X_Event_Window_Delete_Request *e = (void *) event;
215 rb_define_attr (c, "window", 1, 0);
216 rb_define_attr (c, "time", 1, 0);
218 rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
219 rb_iv_set (self, "@time", UINT2NUM (e->time));
224 static VALUE c_ev_win_configure_request_init (VALUE self, VALUE event)
226 VALUE c = CLASS_OF (self);
227 Ecore_X_Event_Window_Configure_Request *e = (void *) event;
229 rb_define_attr (c, "window", 1, 0);
230 rb_define_attr (c, "window_above", 1, 0);
231 rb_define_attr (c, "x", 1, 0);
232 rb_define_attr (c, "y", 1, 0);
233 rb_define_attr (c, "w", 1, 0);
234 rb_define_attr (c, "h", 1, 0);
235 rb_define_attr (c, "border", 1, 0);
236 rb_define_attr (c, "detail", 1, 0);
237 rb_define_attr (c, "value_mask", 1, 0);
238 rb_define_attr (c, "time", 1, 0);
240 rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
241 rb_iv_set (self, "@window_above", TO_ECORE_X_WINDOW (Qnil,
243 rb_iv_set (self, "@x", INT2FIX (e->x));
244 rb_iv_set (self, "@y", INT2FIX (e->y));
245 rb_iv_set (self, "@w", INT2FIX (e->w));
246 rb_iv_set (self, "@h", INT2FIX (e->h));
247 rb_iv_set (self, "@border", INT2FIX (e->border));
248 rb_iv_set (self, "@detail", INT2FIX (e->detail));
249 rb_iv_set (self, "@value_mask", INT2FIX (e->value_mask));
250 rb_iv_set (self, "@time", UINT2NUM (e->time));
255 static VALUE c_ev_win_configure_init (VALUE self, VALUE event)
257 VALUE c = CLASS_OF (self);
258 Ecore_X_Event_Window_Configure *e = (void *) event;
260 rb_define_attr (c, "window", 1, 0);
261 rb_define_attr (c, "window_above", 1, 0);
262 rb_define_attr (c, "x", 1, 0);
263 rb_define_attr (c, "y", 1, 0);
264 rb_define_attr (c, "w", 1, 0);
265 rb_define_attr (c, "h", 1, 0);
266 rb_define_attr (c, "border", 1, 0);
267 rb_define_attr (c, "override", 1, 0);
268 rb_define_attr (c, "from_wm", 1, 0);
269 rb_define_attr (c, "time", 1, 0);
271 rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
272 rb_iv_set (self, "@window_above", TO_ECORE_X_WINDOW (Qnil,
274 rb_iv_set (self, "@x", INT2FIX (e->x));
275 rb_iv_set (self, "@y", INT2FIX (e->y));
276 rb_iv_set (self, "@w", INT2FIX (e->w));
277 rb_iv_set (self, "@h", INT2FIX (e->h));
278 rb_iv_set (self, "@border", INT2FIX (e->border));
279 rb_iv_set (self, "@override", e->override ? Qtrue : Qfalse);
280 rb_iv_set (self, "@from_wm", e->from_wm ? Qtrue : Qfalse);
281 rb_iv_set (self, "@time", UINT2NUM (e->time));
286 static VALUE c_ev_win_resize_request_init (VALUE self, VALUE event)
288 VALUE c = CLASS_OF (self);
289 Ecore_X_Event_Window_Resize_Request *e = (void *) event;
291 rb_define_attr (c, "window", 1, 0);
292 rb_define_attr (c, "w", 1, 0);
293 rb_define_attr (c, "h", 1, 0);
294 rb_define_attr (c, "time", 1, 0);
296 rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
297 rb_iv_set (self, "@w", INT2FIX (e->w));
298 rb_iv_set (self, "@h", INT2FIX (e->h));
299 rb_iv_set (self, "@time", UINT2NUM (e->time));
304 static VALUE c_ev_win_damage_init (VALUE self, VALUE event)
306 VALUE c = CLASS_OF (self);
307 Ecore_X_Event_Window_Damage *e = (void *) event;
309 rb_define_attr (c, "window", 1, 0);
310 rb_define_attr (c, "x", 1, 0);
311 rb_define_attr (c, "y", 1, 0);
312 rb_define_attr (c, "w", 1, 0);
313 rb_define_attr (c, "h", 1, 0);
314 rb_define_attr (c, "time", 1, 0);
316 rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
317 rb_iv_set (self, "@x", INT2FIX (e->x));
318 rb_iv_set (self, "@y", INT2FIX (e->y));
319 rb_iv_set (self, "@w", INT2FIX (e->w));
320 rb_iv_set (self, "@h", INT2FIX (e->h));
321 rb_iv_set (self, "@time", UINT2NUM (e->time));
326 static VALUE c_ev_win_visibility_change_init (VALUE self, VALUE event)
328 VALUE c = CLASS_OF (self);
329 Ecore_X_Event_Window_Visibility_Change *e = (void *) event;
331 rb_define_attr (c, "window", 1, 0);
332 rb_define_attr (c, "fully_obscured", 1, 0);
333 rb_define_attr (c, "time", 1, 0);
335 rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
336 rb_iv_set (self, "@fully_obscured", e->fully_obscured ? Qtrue : Qfalse);
337 rb_iv_set (self, "@time", UINT2NUM (e->time));
342 static VALUE c_ev_win_create_init (VALUE self, VALUE event)
344 VALUE c = CLASS_OF (self);
345 Ecore_X_Event_Window_Create *e = (void *) event;
347 rb_define_attr (c, "window", 1, 0);
348 rb_define_attr (c, "override", 1, 0);
349 rb_define_attr (c, "time", 1, 0);
351 rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
352 rb_iv_set (self, "@override", e->override ? Qtrue : Qfalse);
353 rb_iv_set (self, "@time", UINT2NUM (e->time));
358 static VALUE c_ev_win_show_request_init (VALUE self, VALUE event)
360 VALUE c = CLASS_OF (self);
361 Ecore_X_Event_Window_Show_Request *e = (void *) event;
363 rb_define_attr (c, "window", 1, 0);
364 rb_define_attr (c, "parent", 1, 0);
365 rb_define_attr (c, "time", 1, 0);
367 rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
368 rb_iv_set (self, "@parent", TO_ECORE_X_WINDOW (Qnil, e->parent));
369 rb_iv_set (self, "@time", UINT2NUM (e->time));
374 void Init_ecore_x (void)
379 rb_require ("ecore");
381 /* we need to call ecore_x_init () here, to make sure the
382 * event ids are set properly
385 ecore_x_init (getenv ("DISPLAY"));
388 mX = rb_define_module_under (mEcore, "X");
389 rb_define_module_function (mX, "default_root_window",
390 m_default_root_window_get, 0);
395 /* now create the default root window object */
396 w = DefaultRootWindow (ecore_x_display_get ());
397 default_root = TO_ECORE_X_WINDOW (Qnil, w);
398 rb_global_variable (&default_root);
400 /* event mask values */
401 c = rb_define_class_under (mX, "EventMask", rb_cObject);
402 rb_define_private_method (rb_singleton_class (c), "new", NULL, 0);
403 DEF_CONST (c, ECORE_X_EVENT_MASK_, KEY_DOWN);
404 DEF_CONST (c, ECORE_X_EVENT_MASK_, KEY_UP);
405 DEF_CONST (c, ECORE_X_EVENT_MASK_, MOUSE_DOWN);
406 DEF_CONST (c, ECORE_X_EVENT_MASK_, MOUSE_UP);
407 DEF_CONST (c, ECORE_X_EVENT_MASK_, MOUSE_IN);
408 DEF_CONST (c, ECORE_X_EVENT_MASK_, MOUSE_OUT);
409 DEF_CONST (c, ECORE_X_EVENT_MASK_, MOUSE_MOVE);
410 DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_DAMAGE);
411 DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_VISIBILITY);
412 DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_CONFIGURE);
413 DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_RESIZE_MANAGE);
414 DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_MANAGE);
415 DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_CHILD_CONFIGURE);
416 DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_FOCUS_CHANGE);
417 DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_PROPERTY);
418 DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_COLORMAP);
419 DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_GRAB);
420 DEF_CONST (c, ECORE_X_EVENT_MASK_, MOUSE_WHEEL);
421 DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_FOCUS_IN);
422 DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_FOCUS_OUT);
425 c = rb_define_class_under (mX, "WmProtocol", rb_cObject);
426 rb_define_private_method (rb_singleton_class (c), "new", NULL, 0);
427 DEF_CONST (c, ECORE_X_WM_PROTOCOL_, DELETE_REQUEST);
428 DEF_CONST (c, ECORE_X_WM_PROTOCOL_, TAKE_FOCUS);
431 c = rb_define_class_under (mX, "EventMode", rb_cObject);
432 rb_define_private_method (rb_singleton_class (c), "new", NULL, 0);
433 DEF_CONST (c, ECORE_X_EVENT_MODE_, NORMAL);
434 DEF_CONST (c, ECORE_X_EVENT_MODE_, WHILE_GRABBED);
435 DEF_CONST (c, ECORE_X_EVENT_MODE_, GRAB);
436 DEF_CONST (c, ECORE_X_EVENT_MODE_, UNGRAB);
439 c = rb_define_class_under (mX, "EventDetail", rb_cObject);
440 rb_define_private_method (rb_singleton_class (c), "new", NULL, 0);
441 DEF_CONST (c, ECORE_X_EVENT_DETAIL_, ANCESTOR);
442 DEF_CONST (c, ECORE_X_EVENT_DETAIL_, VIRTUAL);
443 DEF_CONST (c, ECORE_X_EVENT_DETAIL_, INFERIOR);
444 DEF_CONST (c, ECORE_X_EVENT_DETAIL_, NON_LINEAR);
445 DEF_CONST (c, ECORE_X_EVENT_DETAIL_, NON_LINEAR_VIRTUAL);
446 DEF_CONST (c, ECORE_X_EVENT_DETAIL_, POINTER);
447 DEF_CONST (c, ECORE_X_EVENT_DETAIL_, POINTER_ROOT);
448 DEF_CONST (c, ECORE_X_EVENT_DETAIL_, DETAIL_NONE);
451 c = rb_define_class_under (mX, "Modifier", rb_cObject);
452 rb_define_private_method (rb_singleton_class (c), "new", NULL, 0);
453 DEF_CONST (c, ECORE_X_MODIFIER_, SHIFT);
454 DEF_CONST (c, ECORE_X_MODIFIER_, CTRL);
455 DEF_CONST (c, ECORE_X_MODIFIER_, ALT);
456 DEF_CONST (c, ECORE_X_MODIFIER_, WIN);
459 ADD_EVENT (mX, ECORE_X_EVENT_, KEY_DOWN, "KeyDown", c);
460 rb_define_private_method (c, "initialize",
461 c_ev_key_down_init, 1);
463 ADD_EVENT (mX, ECORE_X_EVENT_, KEY_UP, "KeyUp", c);
464 rb_define_private_method (c, "initialize",
465 c_ev_key_down_init, 1);
467 ADD_EVENT (mX, ECORE_X_EVENT_, MOUSE_BUTTON_DOWN,
468 "MouseButtonDown", c);
469 rb_define_private_method (c, "initialize",
470 c_ev_mouse_button_down_init, 1);
472 ADD_EVENT (mX, ECORE_X_EVENT_, MOUSE_BUTTON_UP,
474 rb_define_private_method (c, "initialize",
475 c_ev_mouse_button_up_init, 1);
477 ADD_EVENT (mX, ECORE_X_EVENT_, MOUSE_MOVE, "MouseMove", c);
478 rb_define_private_method (c, "initialize",
479 c_ev_mouse_move_init, 1);
481 ADD_EVENT (mX, ECORE_X_EVENT_, MOUSE_IN, "MouseIn", c);
482 rb_define_private_method (c, "initialize",
483 c_ev_mouse_in_init, 1);
485 ADD_EVENT (mX, ECORE_X_EVENT_, MOUSE_OUT, "MouseOut", c);
486 rb_define_private_method (c, "initialize",
487 c_ev_mouse_in_init, 1);
489 ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_FOCUS_IN,
491 rb_define_private_method (c, "initialize",
492 c_ev_win_focus_change_init, 1);
494 ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_FOCUS_OUT,
495 "WindowFocusOut", c);
496 rb_define_private_method (c, "initialize",
497 c_ev_win_focus_change_init, 1);
499 ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_DELETE_REQUEST,
500 "WindowDeleteRequest", c);
501 rb_define_private_method (c, "initialize",
502 c_ev_win_delete_request_init, 1);
504 ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_CONFIGURE_REQUEST,
505 "WindowConfigureRequest", c);
506 rb_define_private_method (c, "initialize",
507 c_ev_win_configure_request_init, 1);
509 ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_CONFIGURE,
510 "WindowConfigure", c);
511 rb_define_private_method (c, "initialize",
512 c_ev_win_configure_init, 1);
514 ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_RESIZE_REQUEST,
515 "WindowResizeRequest", c);
516 rb_define_private_method (c, "initialize",
517 c_ev_win_resize_request_init, 1);
519 ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_DAMAGE, "WindowDamage", c);
520 rb_define_private_method (c, "initialize",
521 c_ev_win_damage_init, 1);
523 ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_VISIBILITY_CHANGE,
524 "WindowVisibilityChange", c);
525 rb_define_private_method (c, "initialize",
526 c_ev_win_visibility_change_init, 1);
528 ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_CREATE, "WindowCreate", c);
529 rb_define_private_method (c, "initialize",
530 c_ev_win_create_init, 1);
532 ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_DESTROY, "WindowDestroy", c);
533 rb_define_private_method (c, "initialize",
534 c_ev_win_delete_request_init, 1);
536 ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_SHOW, "WindowShow", c);
537 rb_define_private_method (c, "initialize",
538 c_ev_win_delete_request_init, 1);
540 ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_HIDE, "WindowHide", c);
541 rb_define_private_method (c, "initialize",
542 c_ev_win_delete_request_init, 1);
544 ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_SHOW_REQUEST,
545 "WindowShowRequest", c);
546 rb_define_private_method (c, "initialize",
547 c_ev_win_show_request_init, 1);