]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtklayout.c
Deprecate widget flag: GTK_WIDGET_MAPPED
[~andy/gtk] / gtk / gtklayout.c
index 79d11e436071a2209b1e7884d6e3f648ee4933ef..56c411822182b8cffe2efbe481f14e578266d701 100644 (file)
@@ -118,8 +118,8 @@ G_DEFINE_TYPE (GtkLayout, gtk_layout, GTK_TYPE_CONTAINER)
  */
 /**
  * gtk_layout_new:
- * @hadjustment: horizontal scroll adjustment, or %NULL
- * @vadjustment: vertical scroll adjustment, or %NULL
+ * @hadjustment: (allow-none): horizontal scroll adjustment, or %NULL
+ * @vadjustment: (allow-none): vertical scroll adjustment, or %NULL
  * 
  * Creates a new #GtkLayout. Unless you have a specific adjustment
  * you'd like the layout to use for scrolling, pass %NULL for
@@ -285,7 +285,7 @@ gtk_layout_finalize (GObject *object)
 /**
  * gtk_layout_set_hadjustment:
  * @layout: a #GtkLayout
- * @adjustment: new scroll adjustment
+ * @adjustment: (allow-none): new scroll adjustment
  *
  * Sets the horizontal scroll adjustment for the layout.
  *
@@ -305,7 +305,7 @@ gtk_layout_set_hadjustment (GtkLayout     *layout,
 /**
  * gtk_layout_set_vadjustment:
  * @layout: a #GtkLayout
- * @adjustment: new scroll adjustment
+ * @adjustment: (allow-none): new scroll adjustment
  *
  * Sets the vertical scroll adjustment for the layout.
  *
@@ -409,8 +409,9 @@ gtk_layout_move_internal (GtkLayout       *layout,
 
   gtk_widget_thaw_child_notify (widget);
   
-  if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (layout))
-    gtk_widget_queue_resize (GTK_WIDGET (widget));
+  if (gtk_widget_get_visible (widget) &&
+      gtk_widget_get_visible (GTK_WIDGET (layout)))
+    gtk_widget_queue_resize (widget);
 }
 
 /**
@@ -513,8 +514,8 @@ gtk_layout_set_size (GtkLayout     *layout,
 /**
  * gtk_layout_get_size:
  * @layout: a #GtkLayout
- * @width: location to store the width set on @layout, or %NULL
- * @height: location to store the height set on @layout, or %NULL
+ * @width: (allow-none): location to store the width set on @layout, or %NULL
+ * @height: (allow-none): location to store the height set on @layout, or %NULL
  *
  * Gets the size that has been set on the layout, and that determines
  * the total extents of the layout's scrollbar area. See
@@ -658,8 +659,17 @@ gtk_layout_class_init (GtkLayoutClass *class)
 
   class->set_scroll_adjustments = gtk_layout_set_adjustments;
 
+  /**
+   * GtkLayout::set-scroll-adjustments
+   * @horizontal: the horizontal #GtkAdjustment
+   * @vertical: the vertical #GtkAdjustment
+   *
+   * Set the scroll adjustments for the layout. Usually scrolled containers
+   * like #GtkScrolledWindow will emit this signal to connect two instances
+   * of #GtkScrollbar to the scroll directions of the #GtkLayout.
+   */
   widget_class->set_scroll_adjustments_signal =
-    g_signal_new (I_("set_scroll_adjustments"),
+    g_signal_new (I_("set-scroll-adjustments"),
                  G_OBJECT_CLASS_TYPE (gobject_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                  G_STRUCT_OFFSET (GtkLayoutClass, set_scroll_adjustments),
@@ -881,10 +891,10 @@ gtk_layout_realize (GtkWidget *widget)
 }
 
 static void
-gtk_layout_style_set (GtkWidget *widget, GtkStyle *old_style)
+gtk_layout_style_set (GtkWidget *widget,
+                      GtkStyle  *old_style)
 {
-  if (GTK_WIDGET_CLASS (gtk_layout_parent_class)->style_set)
-    (* GTK_WIDGET_CLASS (gtk_layout_parent_class)->style_set) (widget, old_style);
+  GTK_WIDGET_CLASS (gtk_layout_parent_class)->style_set (widget, old_style);
 
   if (GTK_WIDGET_REALIZED (widget))
     {
@@ -906,9 +916,9 @@ gtk_layout_map (GtkWidget *widget)
       GtkLayoutChild *child = tmp_list->data;
       tmp_list = tmp_list->next;
 
-      if (GTK_WIDGET_VISIBLE (child->widget))
+      if (gtk_widget_get_visible (child->widget))
        {
-         if (!GTK_WIDGET_MAPPED (child->widget))
+         if (!gtk_widget_get_mapped (child->widget))
            gtk_widget_map (child->widget);
        }
     }
@@ -926,8 +936,7 @@ gtk_layout_unrealize (GtkWidget *widget)
   gdk_window_destroy (layout->bin_window);
   layout->bin_window = NULL;
 
-  if (GTK_WIDGET_CLASS (gtk_layout_parent_class)->unrealize)
-    (* GTK_WIDGET_CLASS (gtk_layout_parent_class)->unrealize) (widget);
+  GTK_WIDGET_CLASS (gtk_layout_parent_class)->unrealize (widget);
 }
 
 static void     
@@ -1004,8 +1013,8 @@ gtk_layout_expose (GtkWidget      *widget,
 
   if (event->window != layout->bin_window)
     return FALSE;
-  
-  (* GTK_WIDGET_CLASS (gtk_layout_parent_class)->expose_event) (widget, event);
+
+  GTK_WIDGET_CLASS (gtk_layout_parent_class)->expose_event (widget, event);
 
   return FALSE;
 }