X-Git-Url: http://git.code-monkey.de/?p=ruby-edje.git;a=blobdiff_plain;f=src%2Frb_part.c;h=e20259c48411daf307442a1d2bdcc88159162080;hp=563be555b6430020945c92e24248e5d9ad7b6959;hb=30fb3b8341f1f9ee89d0fc2a699401c98b4c9201;hpb=3a9c35673bdd0dc885f7474865be23d6d0061789 diff --git a/src/rb_part.c b/src/rb_part.c index 563be55..e20259c 100644 --- a/src/rb_part.c +++ b/src/rb_part.c @@ -1,5 +1,5 @@ /* - * $Id: rb_part.c 51 2004-08-01 10:19:02Z tilman $ + * $Id: rb_part.c 59 2004-08-10 14:10:31Z tilman $ * * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de) * @@ -67,7 +67,13 @@ VALUE TO_PART (VALUE edje, VALUE name) return self; } -static VALUE c_get_geometry (VALUE self) +/* + * call-seq: + * part.geometry => array + * + * Returns an array containing the geometry of part. + */ +static VALUE c_geometry_get (VALUE self) { int x = 0, y = 0, w = 0, h = 0; @@ -83,6 +89,12 @@ static VALUE c_get_geometry (VALUE self) INT2FIX (y), INT2FIX (h)); } +/* + * call-seq: + * part.swallow(evasobject) => nil + * + * Swallows an Evas::EvasObject into part. + */ static VALUE c_swallow (VALUE self, VALUE target) { GET_OBJ (GET_EDJE (self), RbEdje, e); @@ -95,6 +107,13 @@ static VALUE c_swallow (VALUE self, VALUE target) return Qnil; } +/* + * call-seq: + * part.unswallow => nil + * + * Unswallows the Evas::EvasObject swallowed by + * part. + */ static VALUE c_unswallow (VALUE self) { Evas_Object *o; @@ -112,6 +131,14 @@ static VALUE c_unswallow (VALUE self) return Qnil; } +/* + * call-seq: + * part.swallowed_object => evasobject or nil + * + * Returns the Evas::EvasObject swallowed by + * part or nil if part didn't swallow an + * Evas::EvasObject. + */ static VALUE c_swallowed_object_get (VALUE self) { Evas_Object *o; @@ -131,6 +158,12 @@ static VALUE c_swallowed_object_get (VALUE self) return (VALUE) obj; } +/* + * call-seq: + * part.text => string + * + * Returns the text of part. + */ static VALUE c_text_get (VALUE self) { const char *s; @@ -142,6 +175,12 @@ static VALUE c_text_get (VALUE self) return s ? rb_str_new2 (s) : Qnil; } +/* + * call-seq: + * part.text(string) + * + * Sets the text of part. + */ static VALUE c_text_set (VALUE self, VALUE text) { GET_OBJ (GET_EDJE (self), RbEdje, e); @@ -154,6 +193,15 @@ static VALUE c_text_set (VALUE self, VALUE text) return Qnil; } +/* + * call-seq: + * part.get_drag_value => array + * + * Returns the drag value of part. + * + * part.set_drag_value(1.5, 2.5) #=> nil + * part.get_drag_value #=> [1.5, 2.5] + */ static VALUE c_get_drag_value (VALUE self) { double dx = 0, dy = 0; @@ -165,6 +213,14 @@ static VALUE c_get_drag_value (VALUE self) return rb_ary_new3 (2, rb_float_new (dx), rb_float_new (dy)); } +/* + * call-seq: + * part.set_drag_value(dx, dy) => nil + * + * Sets the drag value of part. + * + * part.set_drag_value(1.5, 2.5) #=> nil + */ static VALUE c_set_drag_value (VALUE self, VALUE dx, VALUE dy) { GET_OBJ (GET_EDJE (self), RbEdje, e); @@ -191,7 +247,7 @@ void Init_Part (void) /* not publically instantiable yet */ rb_define_private_method (rb_singleton_class (cPart), "new", NULL, 0); - rb_define_method (cPart, "get_geometry", c_get_geometry, 0); + rb_define_method (cPart, "geometry", c_geometry_get, 0); rb_define_method (cPart, "swallow", c_swallow, 1); rb_define_method (cPart, "unswallow", c_unswallow, 1); rb_define_method (cPart, "swallowed_object",