[gtk+/composite-templates] Removed GtkParamSpecComposite Added GtkContainerClassPrivate Added gtk_container_class_declare_inter



commit 054021b869f19a900d29e572bb882b06bd0a63d1
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Tue Jun 26 18:20:03 2012 -0300

    Removed GtkParamSpecComposite
    Added GtkContainerClassPrivate
    Added gtk_container_class_declare_internal_child() funtion to make internal children declaration explicit
    Added GtkContainerTemplateType type parameter to gtk_container_class_set_template()

 gtk/gtkcontainer.c |  455 ++++++++++++++++++++++++----------------------------
 gtk/gtkcontainer.h |   81 ++--------
 2 files changed, 228 insertions(+), 308 deletions(-)
---
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index bfb88a2..70ed465 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -230,6 +230,29 @@
  * </refsect2>
  */
 
+typedef struct
+{
+  gchar *name;
+  GType type;
+  guint offset;
+  gboolean private;
+} InternalChildData;
+
+typedef struct
+{
+  gchar *name;
+  GtkWidget *object;
+} InternalChild;
+
+struct _GtkContainerClassPrivate
+{
+  GSList *tmpl_classes;
+
+  const gchar *tmpl;
+  GtkContainerTemplateType tmpl_type;
+  GtkBuilderConnectFunc connect_func;
+  GList *internal_children; /* InternalChildData list */
+};
 
 struct _GtkContainerPrivate
 {
@@ -243,6 +266,8 @@ struct _GtkContainerPrivate
   guint restyle_pending    : 1;
   guint resize_mode        : 2;
   guint request_mode       : 2;
+
+  GArray *internal_children; /* InternalChild array */
 };
 
 enum {
@@ -392,6 +417,8 @@ gtk_container_get_type (void)
                                    GTK_TYPE_BUILDABLE,
                                    &buildable_info);
 
+      g_type_add_class_private (container_type, sizeof (GtkContainerClassPrivate));
+
     }
 
   return container_type;
@@ -400,17 +427,26 @@ gtk_container_get_type (void)
 static void
 gtk_container_base_class_init (GtkContainerClass *class)
 {
+  GtkContainerClassPrivate *priv;
+
   /* reset instance specifc class fields that don't get inherited */
+  class->priv = priv =  G_TYPE_CLASS_GET_PRIVATE (class,
+                                                  GTK_TYPE_CONTAINER,
+                                                  GtkContainerClassPrivate);
+
+  priv->tmpl = NULL;
+  priv->tmpl_classes = NULL;
+  priv->connect_func = NULL;
+  priv->internal_children = NULL;
+  
   class->set_child_property = NULL;
   class->get_child_property = NULL;
-  class->tmpl               = NULL;
-  class->tmpl_file          = NULL;
-  class->connect_func       = NULL;
 }
 
 static void
 gtk_container_base_class_finalize (GtkContainerClass *class)
 {
+  GtkContainerClassPrivate *priv = class->priv;
   GList *list, *node;
 
   list = g_param_spec_pool_list_owned (_gtk_widget_child_property_pool, G_OBJECT_CLASS_TYPE (class));
@@ -424,8 +460,7 @@ gtk_container_base_class_finalize (GtkContainerClass *class)
     }
   g_list_free (list);
 
-  g_free (class->tmpl);
-  g_free (class->tmpl_file);
+  g_slist_free (priv->tmpl_classes);
 }
 
 static void
@@ -1347,9 +1382,9 @@ gtk_container_class_list_child_properties (GObjectClass *cclass,
 /**
  * gtk_container_get_composite_child:
  * @container: a #GtkContainer
- * @composite_name: the name of a composite child as defined by installation of a #GtkParamSpecComposite property
+ * @composite_name: the name of a composite child as defined in the XML template
  *
- * Retrieves a composite child by name by checking installed composite typed properties.
+ * Retrieves a composite child by name by checking composite children created from the template
  * 
  * Returns: the composite child of @container with the name @composite_name
  */
@@ -1357,45 +1392,31 @@ GtkWidget *
 gtk_container_get_composite_child (GtkContainer *container,
 				   const gchar  *composite_name)
 {
-  GParamSpec   **pspecs;
-  guint          n_pspecs = 0, i;
-  GtkWidget     *composite_child = NULL;
-  gchar *name;
-
+  GArray *internal_children;
+  gint i;
+  
   g_return_val_if_fail (GTK_IS_CONTAINER (container), NULL);
   g_return_val_if_fail (composite_name && composite_name[0], NULL);
 
-  name = g_strdelimit (g_strdup (composite_name), "_", '-');
+  internal_children = container->priv->internal_children;
+
+  if (!internal_children) return NULL;
   
-  pspecs = g_object_class_list_properties (G_OBJECT_GET_CLASS (container), &n_pspecs);
-  for (i = 0; i < n_pspecs; i++)
+  for (i = 0; i < internal_children->len; i++)
     {
-      if (strcmp (pspecs[i]->name, name) == 0)
-	{
-	  if (GTK_IS_PARAM_SPEC_COMPOSITE (pspecs[i]) &&
-	      (pspecs[i]->flags & G_PARAM_WRITABLE) != 0)
-	    {
-	      g_object_get (G_OBJECT (container), name, &composite_child, NULL);
-	      
-	      if (composite_child)
-		g_object_unref (composite_child);
-	      else
-		g_warning ("Failed to get composite child named %s for type %s",
-			   composite_name, G_OBJECT_TYPE_NAME (container));
-	    }
-	  break;
-	}
+      InternalChild *data = &g_array_index (internal_children, InternalChild, i);
+
+      if (g_strcmp0 (data->name, composite_name) == 0) return data->object;
     }
-  g_free (pspecs);
-  g_free (name);
 
-  return composite_child;
+  return NULL;
 }
 
 /**
  * gtk_container_class_set_template:
  * @container_class: a #GtkContainerClass
  * @tmpl: the #GtkBuilder xml fragment used to build children
+ * @type: the type of @tmpl
  *
  * This is used when implementing new composite widget types
  * to setup a UI template for instances of this type.
@@ -1418,40 +1439,30 @@ gtk_container_get_composite_child (GtkContainer *container,
  */
 void
 gtk_container_class_set_template (GtkContainerClass *container_class,
-				  const gchar       *tmpl)
+				  const gchar       *tmpl,
+                                  GtkContainerTemplateType type)
 {
+  GtkContainerClassPrivate *priv;
+  GObjectClass  *oclass;
+  
   g_return_if_fail (GTK_IS_CONTAINER_CLASS(container_class));
   g_return_if_fail (tmpl && tmpl[0]);
 
-  g_free (container_class->tmpl);
-  g_free (container_class->tmpl_file);
-
-  container_class->tmpl      = g_strdup (tmpl);
-  container_class->tmpl_file = NULL;
-}
-
-
-/**
- * gtk_container_class_set_template_file:
- * @container_class: a #GtkContainerClass
- * @tmpl_file: the #GtkBuilder xml file used to build children
- *
- * Sets a file to be used as this class's template; see gtk_container_class_set_template().
- * 
- */
-void
-gtk_container_class_set_template_file (GtkContainerClass *container_class,
-				       const gchar       *tmpl_file)
-{
-  g_return_if_fail (GTK_IS_CONTAINER_CLASS(container_class));
-  g_return_if_fail (tmpl_file && tmpl_file[0]);
+  priv = container_class->priv;
 
+  priv->tmpl = tmpl;
+  priv->tmpl_type = type;
 
-  g_free (container_class->tmpl);
-  g_free (container_class->tmpl_file);
+  /* Collect an ordered list of class which have templates to build */
+  for (oclass = G_OBJECT_CLASS (container_class);
+       GTK_IS_CONTAINER_CLASS (oclass);
+       oclass = g_type_class_peek_parent (oclass))
+    {
+      GtkContainerClassPrivate *cpriv = GTK_CONTAINER_CLASS (oclass)->priv;
 
-  container_class->tmpl      = NULL;
-  container_class->tmpl_file = g_strdup (tmpl_file);
+      if (cpriv->tmpl)
+        priv->tmpl_classes = g_slist_prepend (priv->tmpl_classes, oclass);
+    }
 }
 
 /**
@@ -1469,7 +1480,41 @@ gtk_container_class_set_connect_func    (GtkContainerClass *container_class,
   g_return_if_fail (GTK_IS_CONTAINER_CLASS(container_class));
   g_return_if_fail (connect_func != NULL);
 
-  container_class->connect_func = connect_func;
+  container_class->priv->connect_func = connect_func;
+}
+
+/**
+ * gtk_container_class_declare_internal_child:
+ * @container_class: a #GtkContainerClass
+ * @use_private: True if struct_offset refers to the instance private struct
+ * @struct_offset: offset where to save composite children pointer
+ * @name: the name of the composite children to declare
+ *
+ * Declare a child defined in the template as an internal children.
+ * Use #G_STRUCT_OFFSET to pass in the struct_offset of the pointer that will be set automatically on construction.
+ * If you do not need to keep a pointer set use_private to FALSE and struct_offset to 0.
+ */
+void
+gtk_container_class_declare_internal_child (GtkContainerClass *container_class,
+                                            gboolean use_private,
+                                            guint struct_offset,
+                                            const gchar *name)
+{
+  GtkContainerClassPrivate *priv;
+  InternalChildData *child;
+
+  g_return_if_fail (GTK_IS_CONTAINER_CLASS (container_class));
+  g_return_if_fail (name);
+
+  priv = container_class->priv;
+
+  child = g_new0 (InternalChildData, 1);
+  child->name = g_strdup (name);
+  child->private = use_private;
+  child->type = G_TYPE_FROM_CLASS (container_class);
+  child->offset = struct_offset;
+
+  priv->internal_children = g_list_prepend (priv->internal_children, child);
 }
 
 static void
@@ -1500,6 +1545,7 @@ gtk_container_init (GtkContainer *container)
   priv->border_width = 0;
   priv->resize_mode = GTK_RESIZE_PARENT;
   priv->reallocate_redraws = FALSE;
+  priv->internal_children = NULL;
 }
 
 static void
@@ -1528,97 +1574,135 @@ gtk_container_destroy (GtkWidget *widget)
   if (priv->has_focus_chain)
     gtk_container_unset_focus_chain (container);
 
+  if (priv->internal_children)
+    g_array_unref (priv->internal_children);
+
   gtk_container_foreach (container, (GtkCallback) gtk_widget_destroy, NULL);
 
   GTK_WIDGET_CLASS (parent_class)->destroy (widget);
 }
 
+static gboolean
+gtk_container_child_is_internal (GtkContainer *container, GtkWidget *child)
+{
+  GArray *internal_children = container->priv->internal_children;
+  gint i;
+
+  if (!internal_children) return FALSE;
+
+  for (i = 0; i < internal_children->len; i++)
+    {
+      InternalChild *data = &g_array_index (internal_children, InternalChild, i);
+
+      if (data->object == child) return TRUE;
+    }
+
+  return FALSE;
+}
+
+static void
+gtk_container_child_set_internal (GtkContainer *container, GtkWidget *child, gchar *name)
+{
+  GtkContainerPrivate *priv = container->priv;
+  InternalChild data;
+
+  if (!priv->internal_children)
+    priv->internal_children = g_array_new (FALSE, FALSE, sizeof (InternalChild));
+  
+  gtk_widget_set_composite_name (child, name);
+
+  data.name = name;
+  data.object = child;
+  g_array_append_val (priv->internal_children, data);
+}
+
 static GObject *
 gtk_container_constructor (GType                  type,
 			   guint                  n_construct_properties,
 			   GObjectConstructParam *construct_properties)
 {
-  GtkBuilder    *builder;
-  GParamSpec   **pspecs;
-  GError        *error = NULL;
-  guint          ret = 0, n_pspecs = 0, i;
-  GObject       *ret_obj;
-  GtkContainer  *container;
-  GObjectClass  *oclass;
-  GSList        *classes = NULL, *l;
-  
-  ret_obj = G_OBJECT_CLASS (parent_class)->constructor
-    (type, n_construct_properties, construct_properties);
-  
-  container = GTK_CONTAINER (ret_obj);
+  GtkContainerClassPrivate *priv;
+  GtkContainer *container;
+  GError *error = NULL;
+  GtkBuilder *builder;
+  GObject *object;
+  GSList *l;
 
-  /* Collect an ordered list of class which have templates to build */
-  for (oclass = G_OBJECT_GET_CLASS (container);
-       GTK_IS_CONTAINER_CLASS (oclass);
-       oclass = g_type_class_peek_parent (oclass))
-    {
+  object = G_OBJECT_CLASS (parent_class)->constructor (type,
+                                                       n_construct_properties,
+                                                       construct_properties);
 
-      if (GTK_CONTAINER_CLASS (oclass)->tmpl ||
-	  GTK_CONTAINER_CLASS (oclass)->tmpl_file)
-	classes = g_slist_prepend (classes, oclass);
-    }
+  priv = GTK_CONTAINER_CLASS (G_OBJECT_GET_CLASS (object))->priv;
+  container = GTK_CONTAINER (object);
+
+  gtk_widget_push_composite_child ();
 
   /* Build the templates for each class starting with the superclass descending */
-  for (l = classes; l; l = l->next)
+  for (l = priv->tmpl_classes; l; l = g_slist_next (l))
     {
-      GtkContainerClass *cclass = l->data;
-
+      GtkContainerClassPrivate *cpriv = GTK_CONTAINER_CLASS (l->data)->priv;
+      GList *children;
+      guint ret = 0;
+        
       builder = gtk_builder_new ();
-      gtk_builder_expose_object (builder, "container", ret_obj);
-      
-      if (cclass->tmpl)
-	ret = gtk_builder_add_to_parent_from_string (builder, ret_obj, 
-						     cclass->tmpl, -1, &error);
+      gtk_builder_expose_object (builder, "container", object);
+
+      switch (cpriv->tmpl_type)
+        {
+          case GTK_CONTAINER_TEMPLATE_STRING:
+            ret = gtk_builder_add_to_parent_from_string (builder, object, cpriv->tmpl, -1, &error);
+          break;
+          case GTK_CONTAINER_TEMPLATE_FILE:
+            ret = gtk_builder_add_to_parent_from_file (builder, object, cpriv->tmpl, &error);
+          break;
+          case GTK_CONTAINER_TEMPLATE_RESOURCE:
+            ret = gtk_builder_add_to_parent_from_resource (builder, object, cpriv->tmpl, &error);
+          break;
+        }
+
+      if (ret)
+        {
+          if (cpriv->connect_func)
+            gtk_builder_connect_signals_full (builder, cpriv->connect_func, container);
+          else
+            gtk_builder_connect_signals (builder, container);
+
+          /* Setup internal children */
+          for (children = cpriv->internal_children; children; children = g_list_next (children))
+            {
+              InternalChildData *child = children->data;
+              GtkContainer *parent;
+              GtkWidget *widget;
+              gpointer structure;
+              GObject **retval;
+              gchar *name;
+
+              name = child->name;
+              structure = (child->private) ? G_TYPE_INSTANCE_GET_PRIVATE (object, child->type, gpointer) : (gpointer) object;
+              retval = G_STRUCT_MEMBER_P (structure, child->offset);
+              *retval = gtk_builder_get_object (builder, name);
+              widget = GTK_WIDGET (*retval);
+
+              parent = GTK_CONTAINER (gtk_widget_get_parent (widget));
+              if (container != parent && gtk_container_child_is_internal (parent, widget))
+                gtk_container_child_set_internal (parent, widget, name);
+
+              gtk_container_child_set_internal (container, widget, name);
+            }
+        }
       else
-	ret = gtk_builder_add_to_parent_from_file (builder, ret_obj, 
-						   cclass->tmpl_file, &error);
-      
-      if (!ret)
 	{
 	  g_critical ("Unable to build GtkContainer class %s from template: %s", 
-		      G_OBJECT_TYPE_NAME (container),
-		      error->message);
+		      G_OBJECT_TYPE_NAME (container), error->message);
 	  g_error_free (error);
-	  g_object_unref (builder);
-	  
-	  return ret_obj;
 	}
-      
-      pspecs = g_object_class_list_properties (G_OBJECT_CLASS (cclass), &n_pspecs);
-      for (i = 0; i < n_pspecs; i++)
-	{
-	  if (GTK_IS_PARAM_SPEC_COMPOSITE (pspecs[i]) &&
-	      pspecs[i]->owner_type == G_OBJECT_CLASS_TYPE (cclass))
-	    {
-	      GObject *composite_child;
-
-	      composite_child = gtk_builder_get_object (builder, (pspecs[i])->name);
-
-	      if (composite_child)
-		/* Let GObject fire a warning if there is an object type mismatch */
-		g_object_set (container, (pspecs[i])->name, composite_child, NULL);
-	      else
-		g_critical ("Expected internal child %s not found for container class %s",
-			    (pspecs[i])->name, G_OBJECT_TYPE_NAME (container));
-	    }
-	}
-      g_free (pspecs);
-      
-      if (cclass->connect_func)
-	gtk_builder_connect_signals_full (builder, GTK_CONTAINER_GET_CLASS (container)->connect_func, container);
-      else
-	gtk_builder_connect_signals (builder, container);
-      
+
       g_object_unref (builder);
     }
-  g_slist_free (classes);
 
-  return ret_obj;
+  gtk_widget_pop_composite_child ();
+  
+  return object;
 }
 
 static void
@@ -3667,118 +3751,3 @@ gtk_container_get_path_for_child (GtkContainer *container,
 
   return path;
 }
-
-/*    ---------- Declaration of GtkParamSpecComposite
- */
-static void
-param_composite_init (GParamSpec *pspec)
-{
-  /* GtkParamSpecComposite *ospec = GTK_PARAM_SPEC_COMPOSITE (pspec); */
-}
-
-static void
-param_composite_set_default (GParamSpec *pspec,
-			  GValue     *value)
-{
-  value->data[0].v_pointer = NULL;
-}
-
-static gboolean
-param_composite_validate (GParamSpec *pspec,
-			  GValue     *value)
-{
-  GtkParamSpecComposite *ospec = GTK_PARAM_SPEC_COMPOSITE (pspec);
-  GObject               *object = value->data[0].v_pointer;
-  guint changed = 0;
-  
-  if (object && !g_value_type_compatible (G_OBJECT_TYPE (object), G_PARAM_SPEC_VALUE_TYPE (ospec)))
-    {
-      g_object_unref (object);
-      value->data[0].v_pointer = NULL;
-      changed++;
-    }
-  
-  return changed;
-}
-
-static gint
-param_composite_values_cmp (GParamSpec   *pspec,
-			    const GValue *value1,
-			    const GValue *value2)
-{
-  guint8 *p1 = value1->data[0].v_pointer;
-  guint8 *p2 = value2->data[0].v_pointer;
-
-  /* not much to compare here, try to at least provide stable lesser/greater result */
-
-  return p1 < p2 ? -1 : p1 > p2;
-}
-
-GType 
-gtk_param_composite_get_type (void)
-{
-  static GType composite_type = 0;
-
-  if (composite_type == 0)
-    {
-      static const GParamSpecTypeInfo pspec_info = {
-	sizeof (GtkParamSpecComposite),  /* instance_size */
-	0,                               /* n_preallocs */
-	param_composite_init,            /* instance_init */
-	G_TYPE_OBJECT,	                 /* value_type */
-	NULL,                            /* finalize */
-	param_composite_set_default,	 /* value_set_default */
-	param_composite_validate,	 /* value_validate */
-	param_composite_values_cmp,	 /* values_cmp */
-      };
-      composite_type = 
-	g_param_type_register_static (g_intern_static_string ("GtkParamComposite"), &pspec_info);
-    }      
-  return composite_type;
-}
-
-/**
- * gtk_param_spec_composite:
- * @name: canonical name of the property specified
- * @nick: nick name for the property specified
- * @blurb: description of the property specified
- * @object_type: %G_TYPE_OBJECT derived type of this property
- *
- * Creates a new #GtkParamSpecComposite instance specifying a %G_TYPE_OBJECT
- * derived property, these work exactly the same as #GParamSpecObject properties
- * except that #GtkContainer will automatically assign all properties defined
- * as composite object properties to instances built from the composite derived
- * class's #GtkBuilder UI template.
- *
- * See g_param_spec_internal() for details on property names.
- *
- * <note><para>Composite child properties must all be writable a rule. 
- * Dynamic widget contents should generally not be advertized as a composite children,
- * although at times they can be writable for the purpose of being overridden by a
- * third party. Such dynamic composite children should not be refferred to by child
- * UIs that extend a widget, but can be mentioned in templates which include a widget
- * and override it's child</para></note>
- *
- * Returns: a newly created parameter specification
- */
-GParamSpec*
-gtk_param_spec_composite (const gchar *name,
-			  const gchar *nick,
-			  const gchar *blurb,
-			  GType	  object_type,
-			  GParamFlags  flags)
-{
-  GParamSpecObject *ospec;
-  
-  g_return_val_if_fail (g_type_is_a (object_type, G_TYPE_OBJECT), NULL);
-  
-  ospec = g_param_spec_internal (GTK_TYPE_PARAM_COMPOSITE,
-				 name,
-				 nick,
-				 blurb,
-				 flags | G_PARAM_WRITABLE);
-
-  G_PARAM_SPEC (ospec)->value_type = object_type;
-  
-  return G_PARAM_SPEC (ospec);
-}
diff --git a/gtk/gtkcontainer.h b/gtk/gtkcontainer.h
index 1cdc82f..6790e3f 100644
--- a/gtk/gtkcontainer.h
+++ b/gtk/gtkcontainer.h
@@ -37,39 +37,6 @@
 
 G_BEGIN_DECLS
 
-/**
- * GTK_TYPE_PARAM_COMPOSITE:
- * 
- * The #GType of #GtkParamSpecComposite.
- * 
- * Since: 3.0
- */
-#define	GTK_TYPE_PARAM_COMPOSITE   (gtk_param_composite_get_type())
-
-/**
- * GTK_IS_PARAM_SPEC_COMPOSITE:
- * @pspec: a valid #GParamSpec instance
- * 
- * Checks whether the given #GParamSpec is of type %GTK_TYPE_PARAM_COMPOSITE.
- * 
- * Returns: %TRUE on success.
- * 
- * Since: 3.0
- */
-#define GTK_IS_PARAM_SPEC_COMPOSITE(pspec)				\
-  (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GTK_TYPE_PARAM_COMPOSITE))
-
-/**
- * GTK_PARAM_SPEC_COMPOSITE:
- * @pspec: a valid #GParamSpec instance
- * 
- * Casts a #GParamSpec instance into a #GtkParamSpecComposite.
- * 
- * Since: 3.0
- */
-#define GTK_PARAM_SPEC_COMPOSITE(pspec)					\
-  (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GTK_TYPE_PARAM_COMPOSITE, GtkParamSpecComposite))
-
 #define GTK_TYPE_CONTAINER              (gtk_container_get_type ())
 #define GTK_CONTAINER(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CONTAINER, GtkContainer))
 #define GTK_CONTAINER_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CONTAINER, GtkContainerClass))
@@ -77,24 +44,17 @@ G_BEGIN_DECLS
 #define GTK_IS_CONTAINER_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CONTAINER))
 #define GTK_CONTAINER_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CONTAINER, GtkContainerClass))
 
-
 typedef struct _GtkContainer              GtkContainer;
 typedef struct _GtkContainerPrivate       GtkContainerPrivate;
 typedef struct _GtkContainerClass         GtkContainerClass;
-typedef struct _GtkParamSpecComposite     GtkParamSpecComposite;
+typedef struct _GtkContainerClassPrivate  GtkContainerClassPrivate;
 
-/**
- * GtkParamSpecComposite:
- * @parent_instance: private #GParamSpec portion
- * 
- * A #GParamSpec derived structure that contains the meta data for composite child object properties.
- * 
- * Since: 3.0
- */
-struct _GtkParamSpecComposite
+typedef enum
 {
-  GParamSpec    parent_instance;
-};
+  GTK_CONTAINER_TEMPLATE_STRING = 0,
+  GTK_CONTAINER_TEMPLATE_FILE,
+  GTK_CONTAINER_TEMPLATE_RESOURCE
+} GtkContainerTemplateType;
 
 struct _GtkContainer
 {
@@ -137,32 +97,23 @@ struct _GtkContainerClass
 
 
   /*< private >*/
-
   unsigned int _handle_border_width : 1;
 
-  /* GtkBuilder templates for automated composite classes */
-  gchar *tmpl;
-  gchar *tmpl_file;
-  GtkBuilderConnectFunc connect_func;
-
+  GtkContainerClassPrivate *priv;
+  
   /* Padding for future expansion */
   void (*_gtk_reserved1) (void);
   void (*_gtk_reserved2) (void);
   void (*_gtk_reserved3) (void);
   void (*_gtk_reserved4) (void);
   void (*_gtk_reserved5) (void);
+  void (*_gtk_reserved6) (void);
+  void (*_gtk_reserved7) (void);
 };
 
 
 /* Application-level methods */
 
-GType       gtk_param_composite_get_type     (void) G_GNUC_CONST;
-GParamSpec *gtk_param_spec_composite         (const gchar	 *name,
-					      const gchar	 *nick,
-					      const gchar	 *blurb,
-					      GType		  object_type,
-					      GParamFlags	  flags);
-
 GType   gtk_container_get_type		 (void) G_GNUC_CONST;
 void    gtk_container_set_border_width	 (GtkContainer	   *container,
 					  guint		    border_width);
@@ -282,17 +233,17 @@ GtkWidget *gtk_container_get_composite_child     (GtkContainer *container,
 
 /* Class-level functions */
 void     gtk_container_class_set_template        (GtkContainerClass *container_class,
-						  const gchar       *tmpl);
-void     gtk_container_class_set_template_file   (GtkContainerClass *container_class,
-						  const gchar       *tmpl_file);
+						  const gchar       *tmpl,
+                                                  GtkContainerTemplateType type);
 void     gtk_container_class_set_connect_func    (GtkContainerClass *container_class,
 						  GtkBuilderConnectFunc connect_func);
-
+void     gtk_container_class_declare_internal_child (GtkContainerClass *container_class,
+                                                     gboolean use_private,
+                                                     guint struct_offset,
+                                                     const gchar *name);
 /* Non-public methods */
 void	_gtk_container_queue_resize	     (GtkContainer *container);
 void    _gtk_container_clear_resize_widgets   (GtkContainer *container);
-gchar*	_gtk_container_child_composite_name   (GtkContainer *container,
-					      GtkWidget	   *child);
 void   _gtk_container_dequeue_resize_handler (GtkContainer *container);
 GList *_gtk_container_focus_sort             (GtkContainer     *container,
 					      GList            *children,



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