X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fecore_x%2Frb_window.c;h=5ac66c0126107a0ac737211045226c05629db3b7;hb=4150485fdc679e6ab0bb15925fabfa67cd001026;hp=d17817afdf06b21a3e2bc118a506cc340639e038;hpb=eff32695c76de903b9d9e52c609d6c627f27ca76;p=ruby-ecore.git diff --git a/src/ecore_x/rb_window.c b/src/ecore_x/rb_window.c index d17817a..5ac66c0 100644 --- a/src/ecore_x/rb_window.c +++ b/src/ecore_x/rb_window.c @@ -1,5 +1,5 @@ /* - * $Id: rb_window.c 85 2004-08-22 11:53:57Z tilman $ + * $Id: rb_window.c 92 2004-08-22 23:07:16Z tilman $ * * Copyright (C) 2004 ruby-ecore team (see AUTHORS) * @@ -186,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); @@ -308,6 +317,40 @@ static VALUE c_set_protocol (VALUE self, VALUE proto, VALUE on) 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_manage (VALUE self) { GET_OBJ (self, RbWindow, win); @@ -367,6 +410,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); @@ -380,6 +424,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, "get_protocol", c_get_protocol, 1); + rb_define_method (cWindow, "sticky?", c_sticky_get, 0); + rb_define_method (cWindow, "sticky=", c_sticky_set, 1); 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);