Macro updates.
[ruby-evas.git] / src / rb_evas_object.c
index 79dc66f7cc5f56d4f0b69bf3252ac5db5eaf52e8..abba08355fc1d507c61d0c291efac686ffd01a08 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rb_evas_object.c 29 2004-07-08 18:47:44Z tilman $
+ * $Id: rb_evas_object.c 32 2004-07-10 14:07:49Z tilman $
  *
  * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
  *
@@ -50,7 +50,7 @@ void c_evas_object_mark (Evas_Object **e)
 
 static VALUE c_init (VALUE self, VALUE parent)
 {
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        evas_object_data_set (*e, RUBY_EVAS_OBJECT_KEY, (void *) self);
 
@@ -61,19 +61,12 @@ static VALUE c_init (VALUE self, VALUE parent)
 
 static VALUE c_inspect (VALUE self)
 {
-       char buf[128];
-
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
-
-       snprintf (buf, sizeof (buf), "#<Evas::EvasObject:%p ptr=%p>",
-                 (void *) self, *e);
-
-       return rb_str_new2 (buf);
+       INSPECT (self, Evas_Object);
 }
 
 static VALUE c_delete (VALUE self)
 {
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        evas_object_del (*e);
        *e = NULL;
@@ -83,7 +76,7 @@ static VALUE c_delete (VALUE self)
 
 static VALUE c_resize (VALUE self, VALUE w, VALUE h)
 {
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        Check_Type (w, T_FIXNUM);
        Check_Type (h, T_FIXNUM);
@@ -96,7 +89,7 @@ static VALUE c_resize (VALUE self, VALUE w, VALUE h)
 
 static VALUE c_move (VALUE self, VALUE x, VALUE y)
 {
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        Check_Type (x, T_FIXNUM);
        Check_Type (y, T_FIXNUM);
@@ -111,7 +104,7 @@ static VALUE c_geometry_get (VALUE self)
 {
        int x = 0, y = 0, w = 0, h = 0;
 
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        evas_object_geometry_get (*e, (Evas_Coord *) &x, (Evas_Coord *) &y,
                                  (Evas_Coord *) & w, (Evas_Coord *) &h);
@@ -122,7 +115,7 @@ static VALUE c_geometry_get (VALUE self)
 
 static VALUE c_show (VALUE self)
 {
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        evas_object_show (*e);
 
@@ -131,7 +124,7 @@ static VALUE c_show (VALUE self)
 
 static VALUE c_hide (VALUE self)
 {
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        evas_object_hide (*e);
 
@@ -140,14 +133,14 @@ static VALUE c_hide (VALUE self)
 
 static VALUE c_visible_get (VALUE self)
 {
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        return evas_object_visible_get (*e) ? Qtrue : Qfalse;
 }
 
 static VALUE c_evas_get (VALUE self)
 {
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        return rb_hash_aref (parents, INT2NUM ((long) (e)));
 }
@@ -156,7 +149,7 @@ static VALUE c_name_get (VALUE self)
 {
        const char *name;
 
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        if (!(name = evas_object_name_get (*e)))
                return Qnil;
@@ -166,7 +159,7 @@ static VALUE c_name_get (VALUE self)
 
 static VALUE c_name_set (VALUE self, VALUE val)
 {
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        Check_Type (val, T_STRING);
 
@@ -177,14 +170,14 @@ static VALUE c_name_set (VALUE self, VALUE val)
 
 static VALUE c_layer_get (VALUE self)
 {
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        return INT2FIX (evas_object_layer_get (*e));
 }
 
 static VALUE c_layer_set (VALUE self, VALUE val)
 {
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        Check_Type (val, T_FIXNUM);
 
@@ -197,7 +190,7 @@ static VALUE c_get_color (VALUE self)
 {
        int r = 0, g = 0, b = 0, a = 0;
 
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        evas_object_color_get (*e, &r, &g, &b, &a);
 
@@ -208,7 +201,7 @@ static VALUE c_get_color (VALUE self)
 static VALUE c_set_color (VALUE self, VALUE r, VALUE g, VALUE b,
                           VALUE a)
 {
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        Check_Type (r, T_FIXNUM);
        Check_Type (g, T_FIXNUM);
@@ -223,14 +216,14 @@ static VALUE c_set_color (VALUE self, VALUE r, VALUE g, VALUE b,
 
 static VALUE c_pass_events_get (VALUE self)
 {
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        return evas_object_pass_events_get (*e) ? Qtrue : Qfalse;
 }
 
 static VALUE c_pass_events_set (VALUE self, VALUE val)
 {
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        CHECK_BOOL (val);
 
@@ -241,7 +234,7 @@ static VALUE c_pass_events_set (VALUE self, VALUE val)
 
 static VALUE c_raise (VALUE self)
 {
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        evas_object_raise (*e);
 
@@ -250,7 +243,7 @@ static VALUE c_raise (VALUE self)
 
 static VALUE c_lower (VALUE self)
 {
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        evas_object_lower (*e);
 
@@ -259,7 +252,7 @@ static VALUE c_lower (VALUE self)
 
 static VALUE c_stack_above (VALUE self, VALUE target)
 {
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        if (!rb_obj_is_kind_of (target, cEvasObject)) {
                rb_raise (rb_eTypeError,
@@ -268,7 +261,7 @@ static VALUE c_stack_above (VALUE self, VALUE target)
                return Qnil;
        }
 
-       GET_OBJ (target, Evas_Object, target2, "EvasObject");
+       GET_OBJ (target, Evas_Object, target2);
 
        evas_object_stack_above (*e, *target2);
 
@@ -277,7 +270,7 @@ static VALUE c_stack_above (VALUE self, VALUE target)
 
 static VALUE c_stack_below (VALUE self, VALUE target)
 {
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        if (!rb_obj_is_kind_of (target, cEvasObject)) {
                rb_raise (rb_eTypeError,
@@ -286,7 +279,7 @@ static VALUE c_stack_below (VALUE self, VALUE target)
                return Qnil;
        }
 
-       GET_OBJ (target, Evas_Object, target2, "EvasObject");
+       GET_OBJ (target, Evas_Object, target2);
 
        evas_object_stack_below (*e, *target2);
 
@@ -298,7 +291,7 @@ static VALUE c_above_get (VALUE self)
        Evas_Object *o;
        void *obj;
 
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        if (!(evas_object_above_get (*e)))
                return Qnil;
@@ -316,7 +309,7 @@ static VALUE c_below_get (VALUE self)
        Evas_Object *o;
        void *obj;
 
-       GET_OBJ (self, Evas_Object, e, "EvasObject");
+       GET_OBJ (self, Evas_Object, e);
 
        if (!(evas_object_below_get (*e)))
                return Qnil;