Implemented the WindowResizeRequest and WindowDamage events.
authorTilman Sauerbeck <tilman@code-monkey.de>
Fri, 27 Aug 2004 23:56:26 +0000 (23:56 +0000)
committerTilman Sauerbeck <tilman@code-monkey.de>
Fri, 27 Aug 2004 23:56:26 +0000 (23:56 +0000)
Fixed the WindowConfigureRequest event.

src/ecore_x/rb_ecore_x.c

index 83405b02bd30160e3fb726eb8b0dd363efe536e6..766b39a112fcbf81c204752769ba9d215d4a2413 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rb_ecore_x.c 98 2004-08-26 13:12:55Z tilman $
+ * $Id: rb_ecore_x.c 101 2004-08-27 23:56:26Z tilman $
  *
  * Copyright (C) 2004 ruby-ecore team (see AUTHORS)
  *
@@ -221,6 +221,37 @@ static VALUE c_ev_win_delete_request_init (VALUE self, VALUE event)
        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);
@@ -252,6 +283,46 @@ static VALUE c_ev_win_configure_init (VALUE self, VALUE event)
        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);
@@ -433,13 +504,22 @@ void Init_ecore_x (void)
        ADD_EVENT (mX, ECORE_X_EVENT_, WINDOW_CONFIGURE_REQUEST,
                   "WindowConfigureRequest", c);
        rb_define_private_method (c, "initialize",
-                                 c_ev_win_delete_request_init, 1);
+                                 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",