Implemented Container#elements.
authorTilman Sauerbeck <tilman@code-monkey.de>
Mon, 16 Aug 2004 15:43:51 +0000 (15:43 +0000)
committerTilman Sauerbeck <tilman@code-monkey.de>
Mon, 16 Aug 2004 15:43:51 +0000 (15:43 +0000)
src/esmart_container/rb_esmart_container.c

index 4b6c5ce818dd3739344c6bff844fc38a85c56007..9bc6432383482ee4f28c98e80d2e6c7123fd25cb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rb_esmart_container.c 57 2004-08-10 13:33:49Z tilman $
+ * $Id: rb_esmart_container.c 70 2004-08-16 15:43:51Z tilman $
  *
  * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
  *
@@ -85,6 +85,22 @@ static VALUE c_remove_element (VALUE self, VALUE element)
        return Qnil;
 }
 
+static VALUE c_elements_get (VALUE self)
+{
+       VALUE ary;
+       Evas_List *list, *l;
+
+       GET_OBJ (self, RbEvasObject, e);
+
+       list = esmart_container_elements_get (e->real);
+       ary = rb_ary_new ();
+
+       for (l = list; l; l = l->next)
+               rb_ary_push (ary, TO_EVAS_OBJECT (l->data));
+
+       return ary;
+}
+
 static VALUE c_direction_get (VALUE self)
 {
        GET_OBJ (self, RbEvasObject, e);
@@ -198,6 +214,7 @@ void Init_esmart_container (void)
        rb_define_method (c, "append_element", c_append_element, 1);
        rb_define_method (c, "prepend_element", c_prepend_element, 1);
        rb_define_method (c, "remove_element", c_remove_element, 1);
+       rb_define_method (c, "elements", c_elements_get, 0);
        rb_define_method (c, "scroll", c_scroll, 1);
 
        rb_define_const (c, "HORIZONTAL",