5 #include "gtk-clutter-zoomable.h"
7 #define I_(str) (g_intern_static_string ((str)))
10 * SECTION:gtk-clutter-zoomable
11 * @short_description: Interface for zoomable actors
13 * #GtkClutterZoomable is an interface for zoomable actors, using, like
14 * #GtkClutterScrollable, the #GtkAdjustment objects from GTK+ to drive
17 * #GtkClutterZoomable is available since Clutter-GTK 1.0
21 gtk_clutter_zoomable_base_init (gpointer g_iface)
23 static gboolean is_initialized = FALSE;
25 if (G_UNLIKELY (!is_initialized))
30 * GtkClutterZoomable:zadjustment:
32 * The #GtkAdjustment that determines the value of
33 * the zoom factor for this zoomable actor
37 pspec = g_param_spec_object ("zadjustment",
39 "The GtkAdjustment that determines "
44 g_object_interface_install_property (g_iface, pspec);
46 is_initialized = TRUE;
51 gtk_clutter_zoomable_get_type (void)
53 static GType zoomable_type = 0;
55 if (G_UNLIKELY (!zoomable_type))
57 const GTypeInfo zoomable_info =
59 sizeof (GtkClutterZoomableIface),
60 (GBaseInitFunc) gtk_clutter_zoomable_base_init,
61 (GBaseFinalizeFunc) NULL,
64 zoomable_type = g_type_register_static (G_TYPE_INTERFACE,
65 I_("GtkClutterZoomable"),
73 * gtk_clutter_zoomable_set_adjustment:
74 * @zoomable: a #GtkClutterZoomable
75 * @z_adjust: (null-ok): a #GtkAdjustment, or %NULL
77 * Sets the adjustment used to determine the zoom factor of
83 gtk_clutter_zoomable_set_adjustment (GtkClutterZoomable *zoomable,
84 GtkAdjustment *z_adjust)
86 GtkClutterZoomableIface *iface;
88 g_return_if_fail (GTK_CLUTTER_IS_ZOOMABLE (zoomable));
89 g_return_if_fail (z_adjust == NULL || GTK_IS_ADJUSTMENT (z_adjust));
91 iface = GTK_CLUTTER_ZOOMABLE_GET_IFACE (zoomable);
92 if (iface->set_adjustment)
93 iface->set_adjustment (zoomable, z_adjust);
97 * gtk_clutter_zoomable_get_adjustment:
98 * @zoomable: a #GtkClutterZoomable
100 * Retrieves the adjustment used to determine the zoom factor of
103 * Return value: (transfer none): a #GtkAdjustment
108 gtk_clutter_zoomable_get_adjustment (GtkClutterZoomable *zoomable)
110 GtkClutterZoomableIface *iface;
112 g_return_val_if_fail (GTK_CLUTTER_IS_ZOOMABLE (zoomable), NULL);
114 iface = GTK_CLUTTER_ZOOMABLE_GET_IFACE (zoomable);
115 if (iface->get_adjustment)
116 return iface->get_adjustment (zoomable);