Implemented get_protocol and the 'sticky' property.
authorTilman Sauerbeck <tilman@code-monkey.de>
Sun, 22 Aug 2004 23:07:16 +0000 (23:07 +0000)
committerTilman Sauerbeck <tilman@code-monkey.de>
Sun, 22 Aug 2004 23:07:16 +0000 (23:07 +0000)
src/ecore_x/rb_window.c

index 80aeda60f33ce61e5e579d49ce709c70d683427f..5ac66c0126107a0ac737211045226c05629db3b7 100644 (file)
@@ -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);