X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fecore_x%2Frb_window.c;h=80aeda60f33ce61e5e579d49ce709c70d683427f;hb=9cad8c4bcefd9714c6f43ec6046bc5dea4d0a0f7;hp=58c3d6b2625501a5d62a495861a69b0c53e2e2c2;hpb=aaf65fd2a802aa98b8fb2001bf711fac0f5c74e3;p=ruby-ecore.git diff --git a/src/ecore_x/rb_window.c b/src/ecore_x/rb_window.c index 58c3d6b..80aeda6 100644 --- a/src/ecore_x/rb_window.c +++ b/src/ecore_x/rb_window.c @@ -1,5 +1,5 @@ /* - * $Id: rb_window.c 81 2004-08-21 09:43:23Z tilman $ + * $Id: rb_window.c 87 2004-08-22 14:52:05Z tilman $ * * Copyright (C) 2004 ruby-ecore team (see AUTHORS) * @@ -92,6 +92,19 @@ static VALUE c_new (int argc, VALUE *argv, VALUE klass) 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); @@ -173,6 +186,15 @@ static VALUE c_reparent (VALUE self, VALUE other, VALUE x, VALUE 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); @@ -295,11 +317,57 @@ static VALUE c_set_protocol (VALUE self, VALUE proto, VALUE on) 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; +} + void Init_Window (void) { cWindow = rb_define_class_under (mX, "Window", rb_cObject); rb_define_singleton_method (cWindow, "new", c_new, -1); + rb_define_method (cWindow, "inspect", c_inspect, 0); rb_define_method (cWindow, "==", c_equal_value, 1); rb_define_method (cWindow, "show", c_show, 0); rb_define_method (cWindow, "hide", c_hide, 0); @@ -308,6 +376,7 @@ void Init_Window (void) rb_define_method (cWindow, "raise", c_raise, 0); rb_define_method (cWindow, "lower", c_lower, 0); rb_define_method (cWindow, "reparent", c_reparent, 3); + rb_define_method (cWindow, "focus", c_focus, 0); rb_define_method (cWindow, "move", c_move, 2); rb_define_method (cWindow, "resize", c_resize, 2); rb_define_method (cWindow, "size", c_size_get, 0); @@ -321,4 +390,9 @@ void Init_Window (void) rb_define_method (cWindow, "unset_event_mask", c_unset_event_mask, 1); rb_define_method (cWindow, "set_protocol", c_set_protocol, 2); + rb_define_method (cWindow, "manage", c_manage, 0); + rb_define_method (cWindow, "manage_container", c_manage_container, 0); + rb_define_method (cWindow, "manage_client", c_manage_client, 0); + rb_define_method (cWindow, "sniff", c_sniff, 0); + rb_define_method (cWindow, "sniff_client", c_sniff_client, 0); }