]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkbox.c
Deprecate widget flag: GTK_WIDGET_VISIBLE
[~andy/gtk] / gtk / gtkbox.c
index cb25c8cae2b3717e7f009834b44cf2471c7e39fe..1e1f9dc9249998b9c942356c453dabf1997e7809 100644 (file)
@@ -61,45 +61,44 @@ struct _GtkBoxPrivate
 #define GTK_BOX_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_BOX, GtkBoxPrivate))
 
 
-static void gtk_box_set_property (GObject         *object,
-                                 guint            prop_id,
-                                 const GValue    *value,
-                                 GParamSpec      *pspec);
-static void gtk_box_get_property (GObject         *object,
-                                 guint            prop_id,
-                                 GValue          *value,
-                                 GParamSpec      *pspec);
-
-static void gtk_box_size_request  (GtkWidget      *widget,
-                                   GtkRequisition *requisition);
-static void gtk_box_size_allocate (GtkWidget      *widget,
-                                   GtkAllocation  *allocation);
-
-static void gtk_box_add        (GtkContainer   *container,
-                               GtkWidget      *widget);
-static void gtk_box_remove     (GtkContainer   *container,
-                               GtkWidget      *widget);
-static void gtk_box_forall     (GtkContainer   *container,
-                               gboolean        include_internals,
-                               GtkCallback     callback,
-                               gpointer        callback_data);
-static void gtk_box_set_child_property (GtkContainer    *container,
-                                       GtkWidget       *child,
-                                       guint            property_id,
-                                       const GValue    *value,
-                                       GParamSpec      *pspec);
-static void gtk_box_get_child_property (GtkContainer    *container,
-                                       GtkWidget       *child,
-                                       guint            property_id,
-                                       GValue          *value,
-                                       GParamSpec      *pspec);
-static GType gtk_box_child_type (GtkContainer   *container);
-
-
-G_DEFINE_TYPE_WITH_CODE (GtkBox, gtk_box, GTK_TYPE_CONTAINER,
-                         G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE,
-                                                NULL))
-
+static void gtk_box_set_property       (GObject        *object,
+                                        guint           prop_id,
+                                        const GValue   *value,
+                                        GParamSpec     *pspec);
+static void gtk_box_get_property       (GObject        *object,
+                                        guint           prop_id,
+                                        GValue         *value,
+                                        GParamSpec     *pspec);
+
+static void gtk_box_size_request       (GtkWidget      *widget,
+                                        GtkRequisition *requisition);
+static void gtk_box_size_allocate      (GtkWidget      *widget,
+                                        GtkAllocation  *allocation);
+
+static void gtk_box_add                (GtkContainer   *container,
+                                        GtkWidget      *widget);
+static void gtk_box_remove             (GtkContainer   *container,
+                                        GtkWidget      *widget);
+static void gtk_box_forall             (GtkContainer   *container,
+                                        gboolean        include_internals,
+                                        GtkCallback     callback,
+                                        gpointer        callback_data);
+static void gtk_box_set_child_property (GtkContainer   *container,
+                                        GtkWidget      *child,
+                                        guint           property_id,
+                                        const GValue   *value,
+                                        GParamSpec     *pspec);
+static void gtk_box_get_child_property (GtkContainer   *container,
+                                        GtkWidget      *child,
+                                        guint           property_id,
+                                        GValue         *value,
+                                        GParamSpec     *pspec);
+static GType gtk_box_child_type        (GtkContainer   *container);
+
+
+G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GtkBox, gtk_box, GTK_TYPE_CONTAINER,
+                                  G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE,
+                                                         NULL));
 
 static void
 gtk_box_class_init (GtkBoxClass *class)
@@ -274,7 +273,7 @@ gtk_box_size_request (GtkWidget      *widget,
       child = children->data;
       children = children->next;
 
-      if (GTK_WIDGET_VISIBLE (child->widget))
+      if (gtk_widget_get_visible (child->widget))
        {
          GtkRequisition child_requisition;
 
@@ -355,7 +354,7 @@ gtk_box_size_allocate (GtkWidget     *widget,
     {
       child = children->data;
 
-      if (GTK_WIDGET_VISIBLE (child->widget))
+      if (gtk_widget_get_visible (child->widget))
        {
          nvis_children += 1;
          if (child->expand)
@@ -415,7 +414,7 @@ gtk_box_size_allocate (GtkWidget     *widget,
          child = children->data;
          children = children->next;
 
-         if ((child->pack == GTK_PACK_START) && GTK_WIDGET_VISIBLE (child->widget))
+         if ((child->pack == GTK_PACK_START) && gtk_widget_get_visible (child->widget))
            {
              if (box->homogeneous)
                {
@@ -514,7 +513,7 @@ gtk_box_size_allocate (GtkWidget     *widget,
          child = children->data;
          children = children->next;
 
-         if ((child->pack == GTK_PACK_END) && GTK_WIDGET_VISIBLE (child->widget))
+         if ((child->pack == GTK_PACK_END) && gtk_widget_get_visible (child->widget))
            {
              GtkRequisition child_requisition;
 
@@ -610,11 +609,11 @@ gtk_box_child_type (GtkContainer   *container)
 }
 
 static void
-gtk_box_set_child_property (GtkContainer    *container,
-                           GtkWidget       *child,
-                           guint            property_id,
-                           const GValue    *value,
-                           GParamSpec      *pspec)
+gtk_box_set_child_property (GtkContainer *container,
+                            GtkWidget    *child,
+                            guint         property_id,
+                            const GValue *value,
+                            GParamSpec   *pspec)
 {
   gboolean expand = 0;
   gboolean fill = 0;
@@ -775,10 +774,10 @@ gtk_box_pack (GtkBox      *box,
  *
  * Since: 2.16
  **/
-GtkWidget *
-gtk_box_new (GtkOrientation orientation,
-             gboolean       homogeneous,
-             gint           spacing)
+GtkWidget*
+_gtk_box_new (GtkOrientation orientation,
+              gboolean       homogeneous,
+              gint           spacing)
 {
   return g_object_new (GTK_TYPE_BOX,
                        "orientation", orientation,
@@ -1061,7 +1060,8 @@ gtk_box_reorder_child (GtkBox    *box,
   box->children = g_list_insert_before (box->children, new_link, child_info);
 
   gtk_widget_child_notify (child, "position");
-  if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (box))
+  if (gtk_widget_get_visible (child)
+      && gtk_widget_get_visible (GTK_WIDGET (box)))
     gtk_widget_queue_resize (child);
 }
 
@@ -1163,14 +1163,15 @@ gtk_box_set_child_packing (GtkBox      *box,
        child_info->pack = GTK_PACK_START;
       gtk_widget_child_notify (child, "pack-type");
 
-      if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (box))
+      if (gtk_widget_get_visible (child)
+          && gtk_widget_get_visible (GTK_WIDGET (box)))
        gtk_widget_queue_resize (child);
     }
   gtk_widget_thaw_child_notify (child);
 }
 
 void
-_gtk_box_set_default_expand (GtkBox *box)
+_gtk_box_set_old_defaults (GtkBox *box)
 {
   GtkBoxPrivate *private;
 
@@ -1210,14 +1211,14 @@ gtk_box_remove (GtkContainer *container,
        {
          gboolean was_visible;
 
-         was_visible = GTK_WIDGET_VISIBLE (widget);
+         was_visible = gtk_widget_get_visible (widget);
          gtk_widget_unparent (widget);
 
          box->children = g_list_remove_link (box->children, children);
          g_list_free (children);
          g_free (child);
 
-         /* queue resize regardless of GTK_WIDGET_VISIBLE (container),
+         /* queue resize regardless of gtk_widget_get_visible (container),
           * since that's what is needed by toplevels.
           */
          if (was_visible)