]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkscrolledwindow.c
Fix build by adding include
[~andy/gtk] / gtk / gtkscrolledwindow.c
index 972d99671a9c3dfed316670209167541260d70e4..12fa27d0d3868a41252c444dffb5a39c96d66491 100644 (file)
 #include "gtkbindings.h"
 #include "gtkmarshalers.h"
 #include "gtkscrollable.h"
+#include "gtkscrollbar.h"
 #include "gtkscrolledwindow.h"
 #include "gtkwindow.h"
+#include "gtkviewport.h"
 #include "gtkprivate.h"
 #include "gtktypebuiltins.h"
 #include "gtkintl.h"
-
+#include "a11y/gtkscrolledwindowaccessible.h"
 
 /**
  * SECTION:gtkscrolledwindow
@@ -57,7 +59,7 @@
  * For widgets that lack native scrolling support, the #GtkViewport
  * widget acts as an adaptor class, implementing scrollability for child
  * widgets that lack their own scrolling capabilities. Use #GtkViewport
- * to scroll child widgets such as #GtkTable, #GtkBox, and so on.
+ * to scroll child widgets such as #GtkGrid, #GtkBox, and so on.
  *
  * If a widget has native scrolling abilities, it can be added to the
  * #GtkScrolledWindow with gtk_container_add(). If a widget does not, you
@@ -78,7 +80,7 @@
  *
  * If a #GtkScrolledWindow doesn't behave quite as you would like, or
  * doesn't have exactly the right layout, it's very possible to set up
- * your own scrolling with #GtkScrollbar and for example a #GtkTable.
+ * your own scrolling with #GtkScrollbar and for example a #GtkGrid.
  */
 
 
 
 struct _GtkScrolledWindowPrivate
 {
-  GtkCornerType  real_window_placement;
   GtkWidget     *hscrollbar;
   GtkWidget     *vscrollbar;
 
-  gboolean window_placement_set;
-
+  GtkCornerType  real_window_placement;
   guint16  shadow_type;
 
+  guint    window_placement_set   : 1;
   guint    hscrollbar_policy      : 2;
   guint    vscrollbar_policy      : 2;
   guint    hscrollbar_visible     : 1;
   guint    vscrollbar_visible     : 1;
   guint    window_placement       : 2;
-  guint    focus_out              : 1;   /* Flag used by ::move-focus-out implementation */
+  guint    focus_out              : 1; /* Flag used by ::move-focus-out implementation */
 
   gint     min_content_width;
   gint     min_content_height;
@@ -378,6 +379,13 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
                                                             DEFAULT_SCROLLBAR_SPACING,
                                                             GTK_PARAM_READABLE));
 
+  /**
+   * GtkScrolledWindow:min-content-width:
+   *
+   * The minimum content width of @scrolled_window, or -1 if not set.
+   *
+   * Since: 3.0
+   */
   g_object_class_install_property (gobject_class,
                                    PROP_MIN_CONTENT_WIDTH,
                                    g_param_spec_int ("min-content-width",
@@ -385,6 +393,14 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
                                                      P_("The minimum width that the scrolled window will allocate to its content"),
                                                      -1, G_MAXINT, -1,
                                                      GTK_PARAM_READWRITE));
+
+  /**
+   * GtkScrolledWindow:min-content-height:
+   *
+   * The minimum content height of @scrolled_window, or -1 if not set.
+   *
+   * Since: 3.0
+   */
   g_object_class_install_property (gobject_class,
                                    PROP_MIN_CONTENT_HEIGHT,
                                    g_param_spec_int ("min-content-height",
@@ -464,6 +480,8 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
   add_tab_bindings (binding_set, GDK_CONTROL_MASK | GDK_SHIFT_MASK, GTK_DIR_TAB_BACKWARD);
 
   g_type_class_add_private (class, sizeof (GtkScrolledWindowPrivate));
+
+  gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_SCROLLED_WINDOW_ACCESSIBLE);
 }
 
 static void
@@ -781,10 +799,10 @@ gtk_scrolled_window_set_policy (GtkScrolledWindow *scrolled_window,
 /**
  * gtk_scrolled_window_get_policy:
  * @scrolled_window: a #GtkScrolledWindow
- * @hscrollbar_policy: location to store the policy for the horizontal 
- *     scrollbar, or %NULL.
- * @vscrollbar_policy: location to store the policy for the vertical
- *     scrollbar, or %NULL.
+ * @hscrollbar_policy: (out) (allow-none): location to store the policy 
+ *     for the horizontal scrollbar, or %NULL.
+ * @vscrollbar_policy: (out) (allow-none): location to store the policy
+ *     for the vertical scrollbar, or %NULL.
  * 
  * Retrieves the current policy values for the horizontal and vertical
  * scrollbars. See gtk_scrolled_window_set_policy().
@@ -1941,7 +1959,7 @@ gtk_scrolled_window_adjustment_changed (GtkAdjustment *adjustment,
 
 static void
 gtk_scrolled_window_add (GtkContainer *container,
-                        GtkWidget    *child)
+                         GtkWidget    *child)
 {
   GtkScrolledWindowPrivate *priv;
   GtkScrolledWindow *scrolled_window;
@@ -1959,8 +1977,8 @@ gtk_scrolled_window_add (GtkContainer *container,
   _gtk_bin_set_child (bin, child);
   gtk_widget_set_parent (child, GTK_WIDGET (bin));
 
-  hadj = gtk_range_get_adjustment (GTK_RANGE (scrolled_window->priv->hscrollbar));
-  vadj = gtk_range_get_adjustment (GTK_RANGE (scrolled_window->priv->vscrollbar));
+  hadj = gtk_range_get_adjustment (GTK_RANGE (priv->hscrollbar));
+  vadj = gtk_range_get_adjustment (GTK_RANGE (priv->vscrollbar));
 
   if (GTK_IS_SCROLLABLE (child))
     g_object_set (child, "hadjustment", hadj, "vadjustment", vadj, NULL);