From 4150485fdc679e6ab0bb15925fabfa67cd001026 Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Sun, 22 Aug 2004 23:07:16 +0000 Subject: [PATCH] Implemented get_protocol and the 'sticky' property. --- src/ecore_x/rb_window.c | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/src/ecore_x/rb_window.c b/src/ecore_x/rb_window.c index 80aeda6..5ac66c0 100644 --- a/src/ecore_x/rb_window.c +++ b/src/ecore_x/rb_window.c @@ -1,5 +1,5 @@ /* - * $Id: rb_window.c 87 2004-08-22 14:52:05Z tilman $ + * $Id: rb_window.c 92 2004-08-22 23:07:16Z tilman $ * * Copyright (C) 2004 ruby-ecore team (see AUTHORS) * @@ -317,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); @@ -390,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); -- 2.30.2