5 #include "gtk-clutter-scrollable.h"
7 #define I_(str) (g_intern_static_string ((str)))
10 * SECTION:gtk-clutter-scrollable
11 * @short_description: Interface for scrollable actors
15 * #GtkClutterScrollable is available since Clutter-GTK 1.0
19 gtk_clutter_scrollable_base_init (gpointer g_iface)
21 static gboolean is_initialized = FALSE;
23 if (G_UNLIKELY (!is_initialized))
28 * GtkClutterScrollable:hadjustment:
30 * The #GtkAdjustment that determines the value of the
31 * horizontal position for this scrollable actor.
35 pspec = g_param_spec_object ("hadjustment",
36 "Horizontal adjustment",
37 "The GtkAdjustment that determines "
38 "the value of the horizontal position "
39 "for this scrollable actor",
41 G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
42 g_object_interface_install_property (g_iface, pspec);
45 * GtkClutterScrollable:vadjustment:
47 * The #GtkAdjustment that determines the value of the
48 * vertical position for this scrollable actor.
52 pspec = g_param_spec_object ("vadjustment",
53 "Vertical adjustment",
54 "The GtkAdjustment that determines "
55 "the value of the vertical position "
56 "for this scrollable actor",
58 G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
59 g_object_interface_install_property (g_iface, pspec);
61 is_initialized = TRUE;
66 gtk_clutter_scrollable_get_type (void)
68 static GType scrollable_type = 0;
70 if (G_UNLIKELY (!scrollable_type))
72 const GTypeInfo scrollable_info =
74 sizeof (GtkClutterScrollableIface),
75 (GBaseInitFunc) gtk_clutter_scrollable_base_init,
76 (GBaseFinalizeFunc) NULL,
79 scrollable_type = g_type_register_static (G_TYPE_INTERFACE,
80 I_("GtkClutterScrollable"),
84 return scrollable_type;
88 * gtk_clutter_scrollable_set_adjustments:
89 * @scrollable: a #GtkClutterScrollable
90 * @h_adjust: a #GtkAdjustment, or %NULL
91 * @v_adjust: a #GtkAdjustment, or %NULL
93 * Sets the horizontal and vertical adjustments used to determine
94 * the position of the scrollable actor.
99 gtk_clutter_scrollable_set_adjustments (GtkClutterScrollable *scrollable,
100 GtkAdjustment *h_adjust,
101 GtkAdjustment *v_adjust)
103 GtkClutterScrollableIface *iface;
105 g_return_if_fail (GTK_CLUTTER_IS_SCROLLABLE (scrollable));
106 g_return_if_fail (h_adjust == NULL || GTK_IS_ADJUSTMENT (h_adjust));
108 iface = GTK_CLUTTER_SCROLLABLE_GET_IFACE (scrollable);
109 if (iface->set_adjustments)
110 iface->set_adjustments (scrollable, h_adjust, v_adjust);
114 * gtk_clutter_scrollable_get_adjustments:
115 * @scrollable: a #GtkClutterScrollable
116 * @h_adjust: return location for a #GtkAdjustment, or %NULL
117 * @v_adjust: return location for a #GtkAdjustment, or %NULL
119 * Retrieves the horizontal and vertical adjustments used to
120 * determine the position of the scrollable actor.
125 gtk_clutter_scrollable_get_adjustments (GtkClutterScrollable *scrollable,
126 GtkAdjustment **h_adjust,
127 GtkAdjustment **v_adjust)
129 GtkClutterScrollableIface *iface;
131 g_return_if_fail (GTK_CLUTTER_IS_SCROLLABLE (scrollable));
133 iface = GTK_CLUTTER_SCROLLABLE_GET_IFACE (scrollable);
134 if (iface->get_adjustments)
135 iface->get_adjustments (scrollable, h_adjust, v_adjust);