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
15 * #GtkClutterZoomable is available since Clutter-GTK 1.0
19 gtk_clutter_zoomable_base_init (gpointer g_iface)
21 static gboolean is_initialized = FALSE;
23 if (G_UNLIKELY (!is_initialized))
28 * GtkClutterZoomable:zadjustment:
30 * The #GtkAdjustment that determines the value of
31 * the zoom factor for this zoomable actor
35 pspec = g_param_spec_object ("zadjustment",
37 "The GtkAdjustment that determines "
42 g_object_interface_install_property (g_iface, pspec);
44 is_initialized = TRUE;
49 gtk_clutter_zoomable_get_type (void)
51 static GType zoomable_type = 0;
53 if (G_UNLIKELY (!zoomable_type))
55 const GTypeInfo zoomable_info =
57 sizeof (GtkClutterZoomableIface),
58 (GBaseInitFunc) gtk_clutter_zoomable_base_init,
59 (GBaseFinalizeFunc) NULL,
62 zoomable_type = g_type_register_static (G_TYPE_INTERFACE,
63 I_("GtkClutterZoomable"),
71 * gtk_clutter_zoomable_set_adjustment:
72 * @zoomable: a #GtkClutterZoomable
73 * @z_adjust: (null-ok): a #GtkAdjustment, or %NULL
75 * Sets the adjustment used to determine the zoom factor of
81 gtk_clutter_zoomable_set_adjustment (GtkClutterZoomable *zoomable,
82 GtkAdjustment *z_adjust)
84 GtkClutterZoomableIface *iface;
86 g_return_if_fail (GTK_CLUTTER_IS_ZOOMABLE (zoomable));
87 g_return_if_fail (z_adjust == NULL || GTK_IS_ADJUSTMENT (z_adjust));
89 iface = GTK_CLUTTER_ZOOMABLE_GET_IFACE (zoomable);
90 if (iface->set_adjustment)
91 iface->set_adjustment (zoomable, z_adjust);
95 * gtk_clutter_zoomable_get_adjustment:
96 * @zoomable: a #GtkClutterZoomable
98 * Retrieves the adjustment used to determine the zoom factor of
101 * Return value: (transfer none): a #GtkAdjustment
106 gtk_clutter_zoomable_get_adjustment (GtkClutterZoomable *zoomable)
108 GtkClutterZoomableIface *iface;
110 g_return_val_if_fail (GTK_CLUTTER_IS_ZOOMABLE (zoomable), NULL);
112 iface = GTK_CLUTTER_ZOOMABLE_GET_IFACE (zoomable);
113 if (iface->get_adjustment)
114 return iface->get_adjustment (zoomable);