We now use real structs to wrap objects.
[ruby-esmart.git] / src / esmart_draggies / rb_esmart_draggies.c
index c67dd7b76745d8e16eca5fe3fd42adfd45237e65..681e1958bc8b4dbfc27935f3eca2f5812589ee53 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rb_esmart_draggies.c 36 2004-07-25 10:45:47Z tilman $
+ * $Id: rb_esmart_draggies.c 52 2004-08-01 10:19:14Z tilman $
  *
  * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
  *
 #include <ruby.h>
 
 #include <Esmart/Esmart_Draggies.h>
-#include <rb_evas.h>
-#include <rb_evas_object.h>
-#include <rb_ecore_evas.h>
+#include <evas/rb_evas.h>
+#include <evas/rb_evas_object.h>
+#include <ecore/rb_ecore_evas.h>
 
 #include "../rb_esmart.h"
 
+static void c_free (RbEvasObject *e)
+{
+       c_evas_object_free (e, true);
+}
+
 static VALUE c_new (VALUE klass, VALUE ecore_evas)
 {
        VALUE self, argv[1];
        static ID evas;
-       Evas_Object **draggies;
+       RbEvasObject *draggies;
 
        CHECK_CLASS (ecore_evas, cEcoreEvas);
-       GET_OBJ (ecore_evas, Ecore_Evas *, ee);
+       GET_OBJ (ecore_evas, RbEcoreEvas, ee);
 
-       self = Data_Make_Struct (klass, Evas_Object *, c_evas_object_mark,
-                                c_evas_object_free, draggies);
-       *draggies = esmart_draggies_new (*ee);
+       self = Data_Make_Struct (klass, RbEvasObject, c_evas_object_mark,
+                                c_free, draggies);
+       draggies->real = esmart_draggies_new (ee->real);
 
        if (!evas)
                evas = rb_intern ("evas");
@@ -51,11 +56,11 @@ static VALUE c_new (VALUE klass, VALUE ecore_evas)
 
 static VALUE c_button_set (VALUE self, VALUE val)
 {
-       GET_OBJ (self, Evas_Object *, e);
+       GET_OBJ (self, RbEvasObject, e);
 
        Check_Type (val, T_FIXNUM);
 
-       esmart_draggies_button_set (*e, FIX2INT (val));
+       esmart_draggies_button_set (e->real, FIX2INT (val));
 
        return Qnil;
 }