]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtklayout.c
Deprecate widget flag: GTK_WIDGET_MAPPED
[~andy/gtk] / gtk / gtklayout.c
index 82cf4c61057b55557140aac3775258edd22a97ce..56c411822182b8cffe2efbe481f14e578266d701 100644 (file)
@@ -28,7 +28,7 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
-#include <config.h>
+#include "config.h"
 #include "gdkconfig.h"
 
 #include "gtklayout.h"
@@ -47,7 +47,6 @@ struct _GtkLayoutChild {
 
 enum {
    PROP_0,
-   PROP_BIN_WINDOW,
    PROP_HADJUSTMENT,
    PROP_VADJUSTMENT,
    PROP_WIDTH,
@@ -119,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
@@ -150,9 +149,11 @@ gtk_layout_new (GtkAdjustment *hadjustment,
  * Retrieve the bin window of the layout used for drawing operations.
  * 
  * Return value: a #GdkWindow
+ *
+ * Since: 2.14
  **/
 GdkWindow*
-gtk_layout_get_bin_window (GtkLayout     *layout)
+gtk_layout_get_bin_window (GtkLayout *layout)
 {
   g_return_val_if_fail (GTK_IS_LAYOUT (layout), NULL);
 
@@ -246,7 +247,7 @@ gtk_layout_set_adjustments (GtkLayout     *layout,
       g_object_ref_sink (layout->hadjustment);
       gtk_layout_set_adjustment_upper (layout->hadjustment, layout->width, FALSE);
       
-      g_signal_connect (layout->hadjustment, "value_changed",
+      g_signal_connect (layout->hadjustment, "value-changed",
                        G_CALLBACK (gtk_layout_adjustment_changed),
                        layout);
       need_adjust = TRUE;
@@ -258,7 +259,7 @@ gtk_layout_set_adjustments (GtkLayout     *layout,
       g_object_ref_sink (layout->vadjustment);
       gtk_layout_set_adjustment_upper (layout->vadjustment, layout->height, FALSE);
       
-      g_signal_connect (layout->vadjustment, "value_changed",
+      g_signal_connect (layout->vadjustment, "value-changed",
                        G_CALLBACK (gtk_layout_adjustment_changed),
                        layout);
       need_adjust = TRUE;
@@ -284,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.
  *
@@ -304,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.
  *
@@ -408,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);
 }
 
 /**
@@ -512,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
@@ -657,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),
@@ -880,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))
     {
@@ -905,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);
        }
     }
@@ -925,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     
@@ -1003,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;
 }