[cogl/wip/lionel/introspection: 3/6] cogl-gtype: get rid of special gtype defs



commit 492aa710754d20706e107893d644facb44b93b2a
Author: Lionel Landwerlin <llandwerlin gmail com>
Date:   Sun Feb 23 17:24:11 2014 +0000

    cogl-gtype: get rid of special gtype defs

 cogl/cogl-buffer-private.h  |    2 +-
 cogl/cogl-object-private.h  |   21 ++-------------------
 cogl/cogl-texture-private.h |    2 +-
 3 files changed, 4 insertions(+), 21 deletions(-)
---
diff --git a/cogl/cogl-buffer-private.h b/cogl/cogl-buffer-private.h
index a634fe1..5170748 100644
--- a/cogl/cogl-buffer-private.h
+++ b/cogl/cogl-buffer-private.h
@@ -119,7 +119,7 @@ void
 _cogl_buffer_register_buffer_type (const CoglObjectClass *klass);
 
 #define COGL_BUFFER_DEFINE(TypeName, type_name)                         \
-  COGL_OBJECT_DEFINE_WITH_CODE_GTYPE                                    \
+  COGL_OBJECT_DEFINE_WITH_CODE                                          \
   (TypeName, type_name,                                                 \
    _cogl_buffer_register_buffer_type (&_cogl_##type_name##_class))
 
diff --git a/cogl/cogl-object-private.h b/cogl/cogl-object-private.h
index 355e6ff..ed15e92 100644
--- a/cogl/cogl-object-private.h
+++ b/cogl/cogl-object-private.h
@@ -197,7 +197,7 @@ _cogl_##type_name##_object_new (Cogl##TypeName *new_obj)                \
   return new_obj;                                                       \
 }
 
-#define COGL_OBJECT_DEFINE_WITH_CODE_GTYPE(TypeName, type_name, code)   \
+#define COGL_OBJECT_DEFINE_WITH_CODE(TypeName, type_name, code)         \
                                                                         \
 COGL_OBJECT_COMMON_DEFINE_WITH_CODE(TypeName,                           \
                                     type_name,                          \
@@ -215,23 +215,6 @@ cogl_is_##type_name (void *object)                                      \
   return obj->klass == &_cogl_##type_name##_class;                      \
 }
 
-#define COGL_OBJECT_DEFINE_WITH_CODE(TypeName, type_name, code)         \
-                                                                        \
-COGL_OBJECT_COMMON_DEFINE_WITH_CODE(TypeName,                           \
-                                    type_name,                          \
-                                    do { code; } while (0);)            \
-                                                                        \
-CoglBool                                                                \
-cogl_is_##type_name (void *object)                                      \
-{                                                                       \
-  CoglObject *obj = object;                                             \
-                                                                        \
-  if (object == NULL)                                                   \
-    return FALSE;                                                       \
-                                                                        \
-  return obj->klass == &_cogl_##type_name##_class;                      \
-}
-
 #define COGL_OBJECT_INTERNAL_DEFINE_WITH_CODE(TypeName, type_name, code) \
                                                                         \
 COGL_OBJECT_COMMON_DEFINE_WITH_CODE(TypeName, type_name, code)          \
@@ -248,7 +231,7 @@ _cogl_is_##type_name (void *object)                                     \
 }
 
 #define COGL_OBJECT_DEFINE(TypeName, type_name)                 \
-  COGL_OBJECT_DEFINE_WITH_CODE_GTYPE (TypeName, type_name, (void) 0)
+  COGL_OBJECT_DEFINE_WITH_CODE (TypeName, type_name, (void) 0)
 
 #define COGL_OBJECT_INTERNAL_DEFINE(TypeName, type_name)         \
   COGL_OBJECT_INTERNAL_DEFINE_WITH_CODE (TypeName, type_name, (void) 0)
diff --git a/cogl/cogl-texture-private.h b/cogl/cogl-texture-private.h
index 2099537..878fb5f 100644
--- a/cogl/cogl-texture-private.h
+++ b/cogl/cogl-texture-private.h
@@ -252,7 +252,7 @@ void
 _cogl_texture_register_texture_type (const CoglObjectClass *klass);
 
 #define COGL_TEXTURE_DEFINE(TypeName, type_name)                        \
-  COGL_OBJECT_DEFINE_WITH_CODE_GTYPE                                    \
+  COGL_OBJECT_DEFINE_WITH_CODE                                          \
   (TypeName, type_name,                                                 \
    _cogl_texture_register_texture_type (&_cogl_##type_name##_class))
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]