Eo: Fix and use the abstract class .eo file.
authorTom Hacohen <tom@stosb.com>
Mon, 2 Jun 2014 12:09:21 +0000 (13:09 +0100)
committerTom Hacohen <tom@stosb.com>
Tue, 3 Jun 2014 08:19:19 +0000 (09:19 +0100)
Until now it was just there, but never generated or used.

src/Makefile_Eo.am
src/lib/eo/Eo.h
src/lib/eo/eo.c
src/lib/eo/eo_abstract_class.eo
src/lib/eo/eo_class_class.c
src/tests/eo/suite/eo_test_general.c

index cd5e6b6..ca0c444 100644 (file)
@@ -1,11 +1,18 @@
 
 ### Library
 
+BUILT_SOURCES += \
+                 lib/eo/eo_abstract_class.eo.c \
+                 lib/eo/eo_abstract_class.eo.h
+
 lib_LTLIBRARIES += lib/eo/libeo.la
 
 installed_eomainheadersdir = $(includedir)/eo-@VMAJ@
 dist_installed_eomainheaders_DATA = lib/eo/Eo.h
 
+nodist_installed_eomainheaders_DATA = \
+                                      lib/eo/eo_abstract_class.eo.h
+
 lib_eo_libeo_la_SOURCES = \
 lib/eo/eo.c \
 lib/eo/eo_ptr_indirection.c \
index 5d92687..23150a6 100644 (file)
@@ -913,16 +913,7 @@ EAPI Eina_Bool eo_composite_is(const Eo *comp_obj);
  * @{
  */
 
-/**
- * @def EO_CLASS_CLASS
- * The class type for the Eo Class class.
- */
-#define EO_CLASS_CLASS eo_class_class_get()
-/**
- * @brief Use #EO_CLASS_CLASS
- * @internal
- * */
-EAPI const Eo_Class *eo_class_class_get(void);
+#include "eo_abstract_class.eo.h"
 
 /**
  * @}
index 9b8d6d7..8a14021 100644 (file)
@@ -979,7 +979,7 @@ eo_class_get(const Eo *eo_id)
    if (_eo_is_a_class(eo_id))
      {
         EO_CLASS_POINTER_RETURN_VAL(eo_id, _klass, NULL);
-        return eo_class_class_get();
+        return EO_ABSTRACT_CLASS_CLASS;
      }
 
    EO_OBJ_POINTER_RETURN_VAL(eo_id, obj, NULL);
@@ -1802,7 +1802,7 @@ eo_init(void)
                    EINA_LOG_STATE_INIT);
 
    /* bootstrap EO_CLASS_CLASS */
-   (void) eo_class_class_get();
+   (void) EO_ABSTRACT_CLASS_CLASS;
 
    if (_eo_call_stack_key != 0)
      WRN("_eo_call_stack_key already set, this should not happen.");
index 82ab905..27a52e3 100644 (file)
@@ -1,3 +1,4 @@
 abstract Eo_Abstract_Class ()
 {
+    data: null;
 }
index 43c2ffe..d356755 100644 (file)
@@ -4,15 +4,5 @@
 
 #include "Eo.h"
 
-static const Eo_Class_Description class_desc = {
-     EO_VERSION,
-     "Eo_Abstract_Class",
-     EO_CLASS_TYPE_REGULAR_NO_INSTANT,
-     EO_CLASS_DESCRIPTION_NOOPS(),
-     NULL,
-     0,
-     NULL,
-     NULL
-};
+#include "eo_abstract_class.eo.c"
 
-EO_DEFINE_CLASS(eo_class_class_get, &class_desc, NULL, NULL)
index c4e0725..78561e8 100644 (file)
@@ -641,7 +641,7 @@ START_TEST(eo_magic_checks)
         fail_if(eo_class_get((Eo *) buf));
         fail_if(eo_class_name_get((Eo_Class*) buf));
         fail_if(eo_class_get(obj) != SIMPLE_CLASS);
-        fail_if(eo_class_get(SIMPLE_CLASS) != EO_CLASS_CLASS);
+        fail_if(eo_class_get(SIMPLE_CLASS) != EO_ABSTRACT_CLASS_CLASS);
         eo_do((Eo_Class *) buf,(void) NULL);
         eo_do_super((Eo_Class *) buf, SIMPLE_CLASS, simple_a_set(++i));
         eo_do_super(SIMPLE_CLASS, (Eo_Class *) buf, simple_a_set(++i));