Added EvasObject#clip and EvasObject#clip=.
[ruby-evas.git] / src / rb_evas_object.c
index 63cf9ba9cc3ff82af58d2648df7651cf2a4d3e90..22b03153f88988d5006940df84fd99239b16f914 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rb_evas_object.c 344 2005-05-08 14:37:30Z tilman $
+ * $Id: rb_evas_object.c 350 2006-02-08 21:13:34Z tilman $
  *
  * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
  *
@@ -375,6 +375,23 @@ static VALUE c_set_color (VALUE self, VALUE r, VALUE g, VALUE b,
        return Qnil;
 }
 
+static VALUE c_get_clip (VALUE self)
+{
+       GET_OBJ (self, RbEvasObject, e);
+
+       return TO_EVAS_OBJECT (evas_object_clip_get (e->real));
+}
+
+static VALUE c_set_clip (VALUE self, VALUE clip)
+{
+       GET_OBJ (self, RbEvasObject, e);
+       GET_OBJ (clip, RbEvasObject, e2);
+
+       evas_object_clip_set (e->real, e2->real);
+
+       return Qnil;
+}
+
 /*
  * call-seq:
  *  e.pass_events? => true or false
@@ -569,6 +586,8 @@ void Init_EvasObject (void)
        rb_define_method (cEvasObject, "layer=", c_layer_set, 1);
        rb_define_method (cEvasObject, "get_color", c_get_color, 0);
        rb_define_method (cEvasObject, "set_color", c_set_color, 4);
+       rb_define_method (cEvasObject, "clip", c_get_clip, 0);
+       rb_define_method (cEvasObject, "clip=", c_set_clip, 1);
        rb_define_method (cEvasObject, "pass_events?",
                          c_pass_events_get, 0);
        rb_define_method (cEvasObject, "pass_events=",