2 * Copyright (C) 2004 ruby-ecore team (see AUTHORS)
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.
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.
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
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"
32 static VALUE default_root;
35 static void at_exit ()
42 static VALUE m_default_root_window_get (VALUE self)
48 static VALUE c_ev_key_down_init (VALUE self, VALUE event)
50 VALUE c = CLASS_OF (self);
51 Ecore_X_Event_Key_Down *e = (void *) event;
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);
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));
76 static VALUE c_ev_mouse_button_down_init (VALUE self, VALUE event)
78 VALUE c = CLASS_OF (self);
79 Ecore_X_Event_Mouse_Button_Down *e = (void *) event;
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);
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);
110 static VALUE c_ev_mouse_button_up_init (VALUE self, VALUE event)
112 VALUE c = CLASS_OF (self);
113 Ecore_X_Event_Mouse_Button_Up *e = (void *) event;
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);
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));
138 static VALUE c_ev_mouse_move_init (VALUE self, VALUE event)
140 VALUE c = CLASS_OF (self);
141 Ecore_X_Event_Mouse_Move *e = (void *) event;
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);
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));
164 static VALUE c_ev_mouse_in_init (VALUE self, VALUE event)
166 VALUE c = CLASS_OF (self);
167 Ecore_X_Event_Mouse_In *e = (void *) event;
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);
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));
194 static VALUE c_ev_win_focus_change_init (VALUE self, VALUE event)
196 VALUE c = CLASS_OF (self);
197 Ecore_X_Event_Window_Focus_In *e = (void *) event;
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);
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));
212 static VALUE c_ev_win_delete_request_init (VALUE self, VALUE event)
214 VALUE c = CLASS_OF (self);
215 Ecore_X_Event_Window_Delete_Request *e = (void *) event;
217 rb_define_attr (c, "window", 1, 0);
218 rb_define_attr (c, "time", 1, 0);
220 rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
221 rb_iv_set (self, "@time", UINT2NUM (e->time));
226 static VALUE c_ev_win_configure_request_init (VALUE self, VALUE event)
228 VALUE c = CLASS_OF (self);
229 Ecore_X_Event_Window_Configure_Request *e = (void *) event;
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);
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,
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));
257 static VALUE c_ev_win_configure_init (VALUE self, VALUE event)
259 VALUE c = CLASS_OF (self);
260 Ecore_X_Event_Window_Configure *e = (void *) event;
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);
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,
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));
288 static VALUE c_ev_win_resize_request_init (VALUE self, VALUE event)
290 VALUE c = CLASS_OF (self);
291 Ecore_X_Event_Window_Resize_Request *e = (void *) event;
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);
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));
306 static VALUE c_ev_win_damage_init (VALUE self, VALUE event)
308 VALUE c = CLASS_OF (self);
309 Ecore_X_Event_Window_Damage *e = (void *) event;
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);
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));
328 static VALUE c_ev_win_visibility_change_init (VALUE self, VALUE event)
330 VALUE c = CLASS_OF (self);
331 Ecore_X_Event_Window_Visibility_Change *e = (void *) event;
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);
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));
344 static VALUE c_ev_win_create_init (VALUE self, VALUE event)
346 VALUE c = CLASS_OF (self);
347 Ecore_X_Event_Window_Create *e = (void *) event;
349 rb_define_attr (c, "window", 1, 0);
350 rb_define_attr (c, "override", 1, 0);
351 rb_define_attr (c, "time", 1, 0);
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));
360 static VALUE c_ev_win_show_request_init (VALUE self, VALUE event)
362 VALUE c = CLASS_OF (self);
363 Ecore_X_Event_Window_Show_Request *e = (void *) event;
365 rb_define_attr (c, "window", 1, 0);
366 rb_define_attr (c, "parent", 1, 0);
367 rb_define_attr (c, "time", 1, 0);
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));
376 void Init_ecore_x (void)
381 rb_require ("ecore");
383 /* we need to call ecore_x_init () here, to make sure the
384 * event ids are set properly
387 ecore_x_init (getenv ("DISPLAY"));
390 mX = rb_define_module_under (mEcore, "X");
393 rb_define_module_function (mX, "default_root_window",
394 m_default_root_window_get, 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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);