[glib/gobject-performance: 5/12] Add GObjectClass flag CLASS_HAS_PROPS_FLAG



commit fdc0dde6688656046eaa811699b1113853c986f5
Author: Alexander Larsson <alexl redhat com>
Date:   Wed Aug 19 17:21:18 2009 +0200

    Add GObjectClass flag CLASS_HAS_PROPS_FLAG
    
    This is set if a class or any of its parents have installed any
    properties.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=557100

 gobject/gobject.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gobject/gobject.c b/gobject/gobject.c
index 454d8c2..d7d5d56 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -113,6 +113,9 @@
     ((G_DATALIST_GET_FLAGS (&(object)->qdata) & OBJECT_HAS_TOGGLE_REF_FLAG) != 0)
 #define OBJECT_FLOATING_FLAG 0x2
 
+#define CLASS_HAS_PROPS_FLAG 0x1
+#define CLASS_HAS_PROPS(class) \
+    ((class)->flags & CLASS_HAS_PROPS_FLAG)
 
 /* --- signals --- */
 enum {
@@ -409,6 +412,9 @@ g_object_class_install_property (GObjectClass *class,
 {
   g_return_if_fail (G_IS_OBJECT_CLASS (class));
   g_return_if_fail (G_IS_PARAM_SPEC (pspec));
+
+  class->flags |= CLASS_HAS_PROPS_FLAG;
+
   if (pspec->flags & G_PARAM_WRITABLE)
     g_return_if_fail (class->set_property != NULL);
   if (pspec->flags & G_PARAM_READABLE)



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