#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
* 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
*
* 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;
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",
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",
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
/**
* 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().
static void
gtk_scrolled_window_add (GtkContainer *container,
- GtkWidget *child)
+ GtkWidget *child)
{
GtkScrolledWindowPrivate *priv;
GtkScrolledWindow *scrolled_window;
_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);