+static VALUE c_init (int argc, VALUE *argv, VALUE self)
+{
+ rb_iv_set (self, "@cursor", Qnil);
+
+ return self;
+}
+
+static VALUE c_inspect (VALUE self)
+{
+ char buf[128];
+
+ GET_OBJ (self, RbWindow, win);
+
+ snprintf (buf, sizeof (buf),
+ "#<%s:%p id=%u>", rb_obj_classname (self),
+ (void *) self, win->real);
+
+ return rb_str_new2 (buf);
+}
+
+static VALUE c_equal_value (VALUE self, VALUE other)
+{
+ GET_OBJ (self, RbWindow, w1);
+
+ CHECK_CLASS (other, cWindow);
+ GET_OBJ (other, RbWindow, w2);
+
+ return w1->real == w2->real ? Qtrue : Qfalse;
+}
+
+static VALUE c_show (VALUE self)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ ecore_x_window_show (win->real);
+
+ return Qnil;
+}
+
+static VALUE c_hide (VALUE self)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ ecore_x_window_hide (win->real);
+
+ return Qnil;
+}
+
+static VALUE c_visible_get (VALUE self)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ return ecore_x_window_visible_get (win->real) ? Qtrue : Qfalse;
+}
+
+static VALUE c_delete (VALUE self)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ ecore_x_window_del (win->real);
+
+ return Qnil;
+}
+
+static VALUE c_send_delete_request (VALUE self)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ ecore_x_window_delete_request_send (win->real);
+
+ return Qnil;
+}
+
+static VALUE c_raise (VALUE self)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ ecore_x_window_raise (win->real);
+
+ return Qnil;
+}
+
+static VALUE c_lower (VALUE self)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ ecore_x_window_lower (win->real);
+
+ return Qnil;
+}
+
+static VALUE c_reparent (VALUE self, VALUE other, VALUE x, VALUE y)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ CHECK_CLASS (other, cWindow);
+ GET_OBJ (other, RbWindow, o);
+
+ Check_Type (x, T_FIXNUM);
+ Check_Type (y, T_FIXNUM);
+
+ ecore_x_window_reparent (win->real, o->real,
+ FIX2INT (x), FIX2INT (y));
+
+ return Qnil;
+}
+
+static VALUE c_focus (VALUE self)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ ecore_x_window_focus (win->real);
+
+ return Qnil;
+}
+
+static VALUE c_move (VALUE self, VALUE x, VALUE y)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ Check_Type (x, T_FIXNUM);
+ Check_Type (y, T_FIXNUM);
+
+ ecore_x_window_move (win->real, FIX2INT (x), FIX2INT (y));
+
+ return Qnil;
+}
+
+static VALUE c_resize (VALUE self, VALUE w, VALUE h)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ Check_Type (w, T_FIXNUM);
+ Check_Type (h, T_FIXNUM);
+
+ ecore_x_window_move (win->real, FIX2INT (w), FIX2INT (h));
+
+ return Qnil;
+}
+
+static VALUE c_size_get (VALUE self)
+{
+ int w = 0, h = 0;
+
+ GET_OBJ (self, RbWindow, win);
+
+ ecore_x_window_size_get (win->real, &w, &h);
+
+ return rb_ary_new3 (2, INT2FIX (w), INT2FIX (h));
+}
+
+static VALUE c_geometry_get (VALUE self)
+{
+ int x = 0, y = 0, w = 0, h = 0;
+
+ GET_OBJ (self, RbWindow, win);
+
+ ecore_x_window_geometry_get (win->real, &x, &y, &w, &h);
+
+ return rb_ary_new3 (4, INT2FIX (x), INT2FIX (y),
+ INT2FIX (w), INT2FIX (h));
+}
+
+static VALUE c_border_width_get (VALUE self)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ return INT2FIX (ecore_x_window_border_width_get (win->real));
+}
+
+static VALUE c_border_width_set (VALUE self, VALUE val)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ Check_Type (val, T_FIXNUM);
+
+ ecore_x_window_border_width_set (win->real, FIX2INT (val));
+
+ return Qnil;
+}
+
+static VALUE c_depth_get (VALUE self)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ return INT2FIX (ecore_x_window_depth_get (win->real));
+}
+
+static VALUE c_parent_get (VALUE self)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ return TO_ECORE_X_WINDOW (Qnil,
+ ecore_x_window_parent_get (win->real));
+}
+
+static VALUE c_title_get (VALUE self)
+{
+ char *s;
+
+ GET_OBJ (self, RbWindow, win);
+
+ s = ecore_x_window_prop_title_get (win->real);
+
+ return s ? rb_str_new2 (s) : Qnil;
+}
+
+static VALUE c_title_set (VALUE self, VALUE val)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ Check_Type (val, T_STRING);
+
+ ecore_x_window_prop_title_set (win->real, StringValuePtr (val));
+
+ return Qnil;
+}
+
+static VALUE c_set_event_mask (VALUE self, VALUE val)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ Check_Type (val, T_FIXNUM);
+
+ ecore_x_event_mask_set (win->real, FIX2INT (val));
+
+ return Qnil;
+}
+
+static VALUE c_unset_event_mask (VALUE self, VALUE val)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ Check_Type (val, T_FIXNUM);
+
+ ecore_x_event_mask_unset (win->real, FIX2INT (val));
+
+ return Qnil;
+}
+
+static VALUE c_set_protocol (VALUE self, VALUE proto, VALUE on)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ Check_Type (proto, T_FIXNUM);
+ CHECK_BOOL (on);
+
+ ecore_x_window_prop_protocol_set (win->real, FIX2INT (proto),
+ on == Qtrue);
+
+ return Qnil;
+}
+
+static VALUE c_get_protocol (VALUE self, VALUE proto)
+{
+ int s;
+
+ GET_OBJ (self, RbWindow, win);
+
+ s = ecore_x_window_prop_protocol_isset (win->real, FIX2INT (proto));
+
+ return s ? Qtrue : Qfalse;
+}
+
+static VALUE c_sticky_get (VALUE self)
+{
+ int s;
+
+ GET_OBJ (self, RbWindow, win);
+
+ s = ecore_x_window_prop_state_isset (win->real,
+ ECORE_X_WINDOW_STATE_STICKY);
+
+ return s ? Qtrue : Qfalse;
+}
+
+static VALUE c_sticky_set (VALUE self, VALUE val)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ CHECK_BOOL (val);
+
+ ecore_x_window_prop_sticky_set (win->real, val == Qtrue);
+
+ return Qnil;
+}
+
+static VALUE c_cursor_set (VALUE self, VALUE val)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ CHECK_CLASS (val, cCursor);
+ GET_OBJ (val, RbCursor, c);
+
+ ecore_x_window_cursor_set (win->real, c->real);
+ rb_iv_set (self, "@cursor", val);
+
+ return Qnil;
+}
+
+static VALUE c_manage (VALUE self)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ ecore_x_window_manage (win->real);
+
+ return Qnil;
+}
+
+static VALUE c_manage_container (VALUE self)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ ecore_x_window_container_manage (win->real);
+
+ return Qnil;
+}
+
+static VALUE c_manage_client (VALUE self)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ ecore_x_window_client_manage (win->real);
+
+ return Qnil;
+}
+
+static VALUE c_sniff (VALUE self)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ ecore_x_window_sniff (win->real);
+
+ return Qnil;
+}
+
+static VALUE c_sniff_client (VALUE self)
+{
+ GET_OBJ (self, RbWindow, win);
+
+ ecore_x_window_client_sniff (win->real);
+
+ return Qnil;
+}
+