/*
- * $Id: rb_ecore_x.c 39 2004-07-25 13:13:57Z tilman $
+ * $Id: rb_ecore_x.c 101 2004-08-27 23:56:26Z tilman $
*
- * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
+ * Copyright (C) 2004 ruby-ecore team (see AUTHORS)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#include <ruby.h>
+#include <Ecore.h>
#include <Ecore_X.h>
+#include <X11/Xlib.h>
#include "../ecore/rb_ecore.h"
+#include "../ecore/rb_event_handler.h"
#include "rb_ecore_x.h"
#include "rb_window.h"
+#include "rb_cursor.h"
-#ifdef DEBUG
-static VALUE m_init (VALUE self)
+static VALUE default_root;
+
+static void at_exit ()
+{
+ ecore_x_shutdown ();
+ ecore_shutdown ();
+}
+
+static VALUE m_default_root_window_get (VALUE self)
+{
+ return default_root;
+}
+
+static VALUE c_ev_key_down_init (VALUE self, VALUE event)
+{
+ VALUE c = CLASS_OF (self);
+ Ecore_X_Event_Key_Down *e = (void *) event;
+
+ rb_define_attr (c, "keyname", 1, 0);
+ rb_define_attr (c, "keysymbol", 1, 0);
+ rb_define_attr (c, "key_compose", 1, 0);
+ rb_define_attr (c, "modifiers", 1, 0);
+ rb_define_attr (c, "window", 1, 0);
+ rb_define_attr (c, "event_window", 1, 0);
+ rb_define_attr (c, "time", 1, 0);
+
+ rb_iv_set (self, "@keyname",
+ e->keyname ? rb_str_new2 (e->keyname) : Qnil);
+ rb_iv_set (self, "@keysymbol",
+ e->keysymbol ? rb_str_new2 (e->keysymbol) : Qnil);
+ rb_iv_set (self, "@key_compose",
+ e->key_compose ? rb_str_new2 (e->key_compose) : Qnil);
+ rb_iv_set (self, "@modifiers", INT2FIX (e->modifiers));
+ rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
+ rb_iv_set (self, "@event_window",
+ TO_ECORE_X_WINDOW (Qnil, e->event_win));
+ rb_iv_set (self, "@time", UINT2NUM (e->time));
+
+ return self;
+}
+
+static VALUE c_ev_mouse_button_down_init (VALUE self, VALUE event)
+{
+ VALUE c = CLASS_OF (self);
+ Ecore_X_Event_Mouse_Button_Down *e = (void *) event;
+
+ rb_define_attr (c, "button", 1, 0);
+ rb_define_attr (c, "modifiers", 1, 0);
+ rb_define_attr (c, "x", 1, 0);
+ rb_define_attr (c, "y", 1, 0);
+ rb_define_attr (c, "root", 1, 0);
+ rb_define_attr (c, "window", 1, 0);
+ rb_define_attr (c, "event_window", 1, 0);
+ rb_define_attr (c, "time", 1, 0);
+ rb_define_attr (c, "double_click", 1, 0);
+ rb_define_attr (c, "triple_click", 1, 0);
+
+ rb_iv_set (self, "@button", INT2FIX (e->button));
+ rb_iv_set (self, "@modifiers", INT2FIX (e->modifiers));
+ rb_iv_set (self, "@x", INT2FIX (e->x));
+ rb_iv_set (self, "@y", INT2FIX (e->x));
+ rb_iv_set (self, "@root", rb_ary_new3 (2, INT2FIX (e->root.x),
+ INT2FIX (e->root.y)));
+ rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
+ rb_iv_set (self, "@event_window",
+ TO_ECORE_X_WINDOW (Qnil, e->event_win));
+ rb_iv_set (self, "@time", UINT2NUM (e->time));
+ rb_iv_set (self, "@double_click",
+ e->double_click ? Qtrue : Qfalse);
+ rb_iv_set (self, "@triple_click",
+ e->triple_click ? Qtrue : Qfalse);
+
+ return self;
+}
+
+static VALUE c_ev_mouse_button_up_init (VALUE self, VALUE event)
+{
+ VALUE c = CLASS_OF (self);
+ Ecore_X_Event_Mouse_Button_Up *e = (void *) event;
+
+ rb_define_attr (c, "button", 1, 0);
+ rb_define_attr (c, "modifiers", 1, 0);
+ rb_define_attr (c, "x", 1, 0);
+ rb_define_attr (c, "y", 1, 0);
+ rb_define_attr (c, "root", 1, 0);
+ rb_define_attr (c, "window", 1, 0);
+ rb_define_attr (c, "event_window", 1, 0);
+ rb_define_attr (c, "time", 1, 0);
+
+ rb_iv_set (self, "@button", INT2FIX (e->button));
+ rb_iv_set (self, "@modifiers", INT2FIX (e->modifiers));
+ rb_iv_set (self, "@x", INT2FIX (e->x));
+ rb_iv_set (self, "@y", INT2FIX (e->x));
+ rb_iv_set (self, "@root", rb_ary_new3 (2, INT2FIX (e->root.x),
+ INT2FIX (e->root.y)));
+ rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
+ rb_iv_set (self, "@event_window",
+ TO_ECORE_X_WINDOW (Qnil, e->event_win));
+ rb_iv_set (self, "@time", UINT2NUM (e->time));
+
+ return self;
+}
+
+static VALUE c_ev_mouse_move_init (VALUE self, VALUE event)
+{
+ VALUE c = CLASS_OF (self);
+ Ecore_X_Event_Mouse_Move *e = (void *) event;
+
+ rb_define_attr (c, "modifiers", 1, 0);
+ rb_define_attr (c, "x", 1, 0);
+ rb_define_attr (c, "y", 1, 0);
+ rb_define_attr (c, "root", 1, 0);
+ rb_define_attr (c, "window", 1, 0);
+ rb_define_attr (c, "event_window", 1, 0);
+ rb_define_attr (c, "time", 1, 0);
+
+ rb_iv_set (self, "@modifiers", INT2FIX (e->modifiers));
+ rb_iv_set (self, "@x", INT2FIX (e->x));
+ rb_iv_set (self, "@y", INT2FIX (e->y));
+ rb_iv_set (self, "@root", rb_ary_new3 (2, INT2FIX (e->root.x),
+ INT2FIX (e->root.y)));
+ rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
+ rb_iv_set (self, "@event_window",
+ TO_ECORE_X_WINDOW (Qnil, e->event_win));
+ rb_iv_set (self, "@time", UINT2NUM (e->time));
+
+ return self;
+}
+
+static VALUE c_ev_mouse_in_init (VALUE self, VALUE event)
{
- return INT2FIX (ecore_x_init ());
+ VALUE c = CLASS_OF (self);
+ Ecore_X_Event_Mouse_In *e = (void *) event;
+
+ rb_define_attr (c, "modifiers", 1, 0);
+ rb_define_attr (c, "x", 1, 0);
+ rb_define_attr (c, "y", 1, 0);
+ rb_define_attr (c, "root", 1, 0);
+ rb_define_attr (c, "window", 1, 0);
+ rb_define_attr (c, "event_window", 1, 0);
+ rb_define_attr (c, "mode", 1, 0);
+ rb_define_attr (c, "detail", 1, 0);
+ rb_define_attr (c, "time", 1, 0);
+
+ rb_iv_set (self, "@modifiers", INT2FIX (e->modifiers));
+ rb_iv_set (self, "@x", INT2FIX (e->x));
+ rb_iv_set (self, "@y", INT2FIX (e->y));
+ rb_iv_set (self, "@root", rb_ary_new3 (2, INT2FIX (e->root.x),
+ INT2FIX (e->root.y)));
+ rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
+ rb_iv_set (self, "@event_window",
+ TO_ECORE_X_WINDOW (Qnil, e->event_win));
+ rb_iv_set (self, "@mode", INT2FIX (e->mode));
+ rb_iv_set (self, "@detail", INT2FIX (e->detail));
+ rb_iv_set (self, "@time", UINT2NUM (e->time));
+
+ return self;
}
-static VALUE m_shutdown (VALUE self)
+static VALUE c_ev_win_focus_change_init (VALUE self, VALUE event)
{
- return INT2FIX (ecore_x_shutdown ());
+ VALUE c = CLASS_OF (self);
+ Ecore_X_Event_Window_Focus_In *e = (void *) event;
+
+ rb_define_attr (c, "window", 1, 0);
+ rb_define_attr (c, "mode", 1, 0);
+ rb_define_attr (c, "detail", 1, 0);
+ rb_define_attr (c, "time", 1, 0);
+
+ rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
+ rb_iv_set (self, "@mode", INT2FIX (e->mode));
+ rb_iv_set (self, "@detail", INT2FIX (e->detail));
+ rb_iv_set (self, "@time", UINT2NUM (e->time));
+
+ return self;
+}
+
+static VALUE c_ev_win_delete_request_init (VALUE self, VALUE event)
+{
+ VALUE c = CLASS_OF (self);
+ Ecore_X_Event_Window_Delete_Request *e = (void *) event;
+
+ rb_define_attr (c, "window", 1, 0);
+ rb_define_attr (c, "time", 1, 0);
+
+ rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
+ rb_iv_set (self, "@time", UINT2NUM (e->time));
+
+ return self;
+}
+
+static VALUE c_ev_win_configure_request_init (VALUE self, VALUE event)
+{
+ VALUE c = CLASS_OF (self);
+ Ecore_X_Event_Window_Configure_Request *e = (void *) event;
+
+ rb_define_attr (c, "window", 1, 0);
+ rb_define_attr (c, "window_above", 1, 0);
+ rb_define_attr (c, "x", 1, 0);
+ rb_define_attr (c, "y", 1, 0);
+ rb_define_attr (c, "w", 1, 0);
+ rb_define_attr (c, "h", 1, 0);
+ rb_define_attr (c, "border", 1, 0);
+ rb_define_attr (c, "detail", 1, 0);
+ rb_define_attr (c, "value_mask", 1, 0);
+ rb_define_attr (c, "time", 1, 0);
+
+ rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
+ rb_iv_set (self, "@window_above", TO_ECORE_X_WINDOW (Qnil,
+ e->abovewin));
+ rb_iv_set (self, "@x", INT2FIX (e->x));
+ rb_iv_set (self, "@y", INT2FIX (e->y));
+ rb_iv_set (self, "@w", INT2FIX (e->w));
+ rb_iv_set (self, "@h", INT2FIX (e->h));
+ rb_iv_set (self, "@border", INT2FIX (e->border));
+ rb_iv_set (self, "@detail", INT2FIX (e->detail));
+ rb_iv_set (self, "@value_mask", INT2FIX (e->value_mask));
+ rb_iv_set (self, "@time", UINT2NUM (e->time));
+
+ return self;
+}
+
+static VALUE c_ev_win_configure_init (VALUE self, VALUE event)
+{
+ VALUE c = CLASS_OF (self);
+ Ecore_X_Event_Window_Configure *e = (void *) event;
+
+ rb_define_attr (c, "window", 1, 0);
+ rb_define_attr (c, "window_above", 1, 0);
+ rb_define_attr (c, "x", 1, 0);
+ rb_define_attr (c, "y", 1, 0);
+ rb_define_attr (c, "w", 1, 0);
+ rb_define_attr (c, "h", 1, 0);
+ rb_define_attr (c, "border", 1, 0);
+ rb_define_attr (c, "override", 1, 0);
+ rb_define_attr (c, "from_wm", 1, 0);
+ rb_define_attr (c, "time", 1, 0);
+
+ rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
+ rb_iv_set (self, "@window_above", TO_ECORE_X_WINDOW (Qnil,
+ e->abovewin));
+ rb_iv_set (self, "@x", INT2FIX (e->x));
+ rb_iv_set (self, "@y", INT2FIX (e->y));
+ rb_iv_set (self, "@w", INT2FIX (e->w));
+ rb_iv_set (self, "@h", INT2FIX (e->h));
+ rb_iv_set (self, "@border", INT2FIX (e->border));
+ rb_iv_set (self, "@override", e->override ? Qtrue : Qfalse);
+ rb_iv_set (self, "@from_wm", e->from_wm ? Qtrue : Qfalse);
+ rb_iv_set (self, "@time", UINT2NUM (e->time));
+
+ return self;
+}
+
+static VALUE c_ev_win_resize_request_init (VALUE self, VALUE event)
+{
+ VALUE c = CLASS_OF (self);
+ Ecore_X_Event_Window_Resize_Request *e = (void *) event;
+
+ rb_define_attr (c, "window", 1, 0);
+ rb_define_attr (c, "w", 1, 0);
+ rb_define_attr (c, "h", 1, 0);
+ rb_define_attr (c, "time", 1, 0);
+
+ rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
+ rb_iv_set (self, "@w", INT2FIX (e->w));
+ rb_iv_set (self, "@h", INT2FIX (e->h));
+ rb_iv_set (self, "@time", UINT2NUM (e->time));
+
+ return self;
+}
+
+static VALUE c_ev_win_damage_init (VALUE self, VALUE event)
+{
+ VALUE c = CLASS_OF (self);
+ Ecore_X_Event_Window_Damage *e = (void *) event;
+
+ rb_define_attr (c, "window", 1, 0);
+ rb_define_attr (c, "x", 1, 0);
+ rb_define_attr (c, "y", 1, 0);
+ rb_define_attr (c, "w", 1, 0);
+ rb_define_attr (c, "h", 1, 0);
+ rb_define_attr (c, "time", 1, 0);
+
+ rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
+ rb_iv_set (self, "@x", INT2FIX (e->x));
+ rb_iv_set (self, "@y", INT2FIX (e->y));
+ rb_iv_set (self, "@w", INT2FIX (e->w));
+ rb_iv_set (self, "@h", INT2FIX (e->h));
+ rb_iv_set (self, "@time", UINT2NUM (e->time));
+
+ return self;
+}
+
+static VALUE c_ev_win_visibility_change_init (VALUE self, VALUE event)
+{
+ VALUE c = CLASS_OF (self);
+ Ecore_X_Event_Window_Visibility_Change *e = (void *) event;
+
+ rb_define_attr (c, "window", 1, 0);
+ rb_define_attr (c, "fully_obscured", 1, 0);
+ rb_define_attr (c, "time", 1, 0);
+
+ rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
+ rb_iv_set (self, "@fully_obscured", e->fully_obscured ? Qtrue : Qfalse);
+ rb_iv_set (self, "@time", UINT2NUM (e->time));
+
+ return self;
+}
+
+static VALUE c_ev_win_create_init (VALUE self, VALUE event)
+{
+ VALUE c = CLASS_OF (self);
+ Ecore_X_Event_Window_Create *e = (void *) event;
+
+ rb_define_attr (c, "window", 1, 0);
+ rb_define_attr (c, "override", 1, 0);
+ rb_define_attr (c, "time", 1, 0);
+
+ rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
+ rb_iv_set (self, "@override", e->override ? Qtrue : Qfalse);
+ rb_iv_set (self, "@time", UINT2NUM (e->time));
+
+ return self;
+}
+
+static VALUE c_ev_win_show_request_init (VALUE self, VALUE event)
+{
+ VALUE c = CLASS_OF (self);
+ Ecore_X_Event_Window_Show_Request *e = (void *) event;
+
+ rb_define_attr (c, "window", 1, 0);
+ rb_define_attr (c, "parent", 1, 0);
+ rb_define_attr (c, "time", 1, 0);
+
+ rb_iv_set (self, "@window", TO_ECORE_X_WINDOW (Qnil, e->win));
+ rb_iv_set (self, "@parent", TO_ECORE_X_WINDOW (Qnil, e->parent));
+ rb_iv_set (self, "@time", UINT2NUM (e->time));
+
+ return self;
}
-#endif
void Init_ecore_x (void)
{
+ VALUE c;
+ Ecore_X_Window w;
+
rb_require ("ecore");
- mX = rb_define_module_under (mEcore, "X");
+ /* we need to call ecore_x_init () here, to make sure the
+ * event ids are set properly
+ */
+ ecore_init ();
+ ecore_x_init (getenv ("DISPLAY"));
+ atexit (at_exit);
-#ifdef DEBUG
- rb_define_module_function (mx, "init", m_init, 0);
- rb_define_module_function (mx, "shutdown", m_shutdown, 0);
-#endif
+ mX = rb_define_module_under (mEcore, "X");
+ rb_define_module_function (mX, "default_root_window",
+ m_default_root_window_get, 0);
Init_Window ();
-}
+ Init_Cursor ();
+
+ /* now create the default root window object */
+ w = DefaultRootWindow (ecore_x_display_get ());
+ default_root = TO_ECORE_X_WINDOW (Qnil, w);
+ rb_global_variable (&default_root);
+
+ /* event mask values */
+ c = rb_define_class_under (mX, "EventMask", rb_cObject);
+ rb_define_private_method (rb_singleton_class (c), "new", NULL, 0);
+ DEF_CONST (c, ECORE_X_EVENT_MASK_, KEY_DOWN);
+ DEF_CONST (c, ECORE_X_EVENT_MASK_, KEY_UP);
+ DEF_CONST (c, ECORE_X_EVENT_MASK_, MOUSE_DOWN);
+ DEF_CONST (c, ECORE_X_EVENT_MASK_, MOUSE_UP);
+ DEF_CONST (c, ECORE_X_EVENT_MASK_, MOUSE_IN);
+ DEF_CONST (c, ECORE_X_EVENT_MASK_, MOUSE_OUT);
+ DEF_CONST (c, ECORE_X_EVENT_MASK_, MOUSE_MOVE);
+ DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_DAMAGE);
+ DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_VISIBILITY);
+ DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_CONFIGURE);
+ DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_RESIZE_MANAGE);
+ DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_MANAGE);
+ DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_CHILD_CONFIGURE);
+ DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_FOCUS_CHANGE);
+ DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_PROPERTY);
+ DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_COLORMAP);
+ DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_GRAB);
+ DEF_CONST (c, ECORE_X_EVENT_MASK_, MOUSE_WHEEL);
+ DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_FOCUS_IN);
+ DEF_CONST (c, ECORE_X_EVENT_MASK_, WINDOW_FOCUS_OUT);
+
+ /* wm protocols */
+ c = rb_define_class_under (mX, "WmProtocol", rb_cObject);
+ rb_define_private_method (rb_singleton_class (c), "new", NULL, 0);
+ DEF_CONST (c, ECORE_X_WM_PROTOCOL_, DELETE_REQUEST);
+ DEF_CONST (c, ECORE_X_WM_PROTOCOL_, TAKE_FOCUS);
+
+ /* event modes */
+ c = rb_define_class_under (mX, "EventMode", rb_cObject);
+ rb_define_private_method (rb_singleton_class (c), "new", NULL, 0);
+ DEF_CONST (c, ECORE_X_EVENT_MODE_, NORMAL);
+ DEF_CONST (c, ECORE_X_EVENT_MODE_, WHILE_GRABBED);
+ DEF_CONST (c, ECORE_X_EVENT_MODE_, GRAB);
+ DEF_CONST (c, ECORE_X_EVENT_MODE_, UNGRAB);
+
+ /* event details */
+ c = rb_define_class_under (mX, "EventDetail", rb_cObject);
+ rb_define_private_method (rb_singleton_class (c), "new", NULL, 0);
+ DEF_CONST (c, ECORE_X_EVENT_DETAIL_, ANCESTOR);
+ DEF_CONST (c, ECORE_X_EVENT_DETAIL_, VIRTUAL);
+ DEF_CONST (c, ECORE_X_EVENT_DETAIL_, INFERIOR);
+ DEF_CONST (c, ECORE_X_EVENT_DETAIL_, NON_LINEAR);
+ DEF_CONST (c, ECORE_X_EVENT_DETAIL_, NON_LINEAR_VIRTUAL);
+ DEF_CONST (c, ECORE_X_EVENT_DETAIL_, POINTER);
+ DEF_CONST (c, ECORE_X_EVENT_DETAIL_, POINTER_ROOT);
+ DEF_CONST (c, ECORE_X_EVENT_DETAIL_, DETAIL_NONE);
+
+ /* key modifiers */
+ c = rb_define_class_under (mX, "Modifier", rb_cObject);
+ rb_define_private_method (rb_singleton_class (c), "new", NULL, 0);
+ DEF_CONST (c, ECORE_X_MODIFIER_, SHIFT);
+ DEF_CONST (c, ECORE_X_MODIFIER_, CTRL);
+ DEF_CONST (c, ECORE_X_MODIFIER_, ALT);
+ DEF_CONST (c, ECORE_X_MODIFIER_, WIN);
+
+ /* events */
+ ADD_EVENT (mX, ECORE_X_EVENT_, KEY_DOWN, "KeyDown", c);
+ rb_define_private_method (c, "initialize",
+ c_ev_key_down_init, 1);
+
+ ADD_EVENT (mX, ECORE_X_EVENT_, KEY_UP, "KeyUp", c);
+ rb_define_private_method (c, "initialize",
+ c_ev_key_down_init, 1);
+
+ ADD_EVENT (mX, ECORE_X_EVENT_, MOUSE_BUTTON_DOWN,
+ "MouseButtonDown", c);
+ rb_define_private_method (c, "initialize",
+ c_ev_mouse_button_down_init, 1);
+
+ ADD_EVENT (mX, ECORE_X_EVENT_, MOUSE_BUTTON_UP,
+ "MouseButtonUp", c);
+ rb_define_private_method (c, "initialize",
+ c_ev_mouse_button_up_init, 1);
+
+ ADD_EVENT (mX, ECORE_X_EVENT_, MOUSE_MOVE, "MouseMove", c);
+ rb_define_private_method (c, "initialize",
+ c_ev_mouse_move_init, 1);
+
+ ADD_EVENT (mX, ECORE_X_EVENT_, MOUSE_IN, "MouseIn", c);
+ rb_define_private_method (c, "initialize",
+ c_ev_mouse_in_init, 1);
+ ADD_EVENT (mX, ECORE_X_EVENT_, MOUSE_OUT, "MouseOut", c);
+ rb_define_private_method (c, "initialize",
+ c_ev_mouse_in_init, 1);
+
+ ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_FOCUS_IN,
+ "WindowFocusIn", c);
+ rb_define_private_method (c, "initialize",
+ c_ev_win_focus_change_init, 1);
+
+ ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_FOCUS_OUT,
+ "WindowFocusOut", c);
+ rb_define_private_method (c, "initialize",
+ c_ev_win_focus_change_init, 1);
+
+ ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_DELETE_REQUEST,
+ "WindowDeleteRequest", c);
+ rb_define_private_method (c, "initialize",
+ c_ev_win_delete_request_init, 1);
+
+ ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_CONFIGURE_REQUEST,
+ "WindowConfigureRequest", c);
+ rb_define_private_method (c, "initialize",
+ c_ev_win_configure_request_init, 1);
+
+ ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_CONFIGURE,
+ "WindowConfigure", c);
+ rb_define_private_method (c, "initialize",
+ c_ev_win_configure_init, 1);
+
+ ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_RESIZE_REQUEST,
+ "WindowResizeRequest", c);
+ rb_define_private_method (c, "initialize",
+ c_ev_win_resize_request_init, 1);
+
+ ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_DAMAGE, "WindowDamage", c);
+ rb_define_private_method (c, "initialize",
+ c_ev_win_damage_init, 1);
+
+ ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_VISIBILITY_CHANGE,
+ "WindowVisibilityChange", c);
+ rb_define_private_method (c, "initialize",
+ c_ev_win_visibility_change_init, 1);
+
+ ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_CREATE, "WindowCreate", c);
+ rb_define_private_method (c, "initialize",
+ c_ev_win_create_init, 1);
+
+ ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_DESTROY, "WindowDestroy", c);
+ rb_define_private_method (c, "initialize",
+ c_ev_win_delete_request_init, 1);
+
+ ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_SHOW, "WindowShow", c);
+ rb_define_private_method (c, "initialize",
+ c_ev_win_delete_request_init, 1);
+
+ ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_HIDE, "WindowHide", c);
+ rb_define_private_method (c, "initialize",
+ c_ev_win_delete_request_init, 1);
+
+ ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_SHOW_REQUEST,
+ "WindowShowRequest", c);
+ rb_define_private_method (c, "initialize",
+ c_ev_win_show_request_init, 1);
+}