gtk_sheet_column_size_request (sheet, column, &min_width);
if (width < min_width) return;
- psppire_axis_impl_resize (sheet->haxis, column, width);
+ psppire_axis_resize (sheet->haxis, column, width);
if (GTK_WIDGET_REALIZED (GTK_WIDGET (sheet)))
{
gtk_sheet_row_size_request (sheet, row, &min_height);
if (height < min_height) return;
- psppire_axis_impl_resize (sheet->vaxis, row, height);
+ psppire_axis_resize (sheet->vaxis, row, height);
if (GTK_WIDGET_REALIZED (GTK_WIDGET (sheet)) )
{
}
+static void resize (PsppireAxis *axis, gint posn, glong size);
+
static void
iface->start_pixel = start_pixel;
iface->unit_at_pixel = unit_at_pixel;
iface->total_size = total_size;
+ iface->resize = resize;
}
/* --- functions --- */
return tower_data (n, struct axis_node, unit_node);
}
-void
-psppire_axis_impl_resize (PsppireAxisImpl *a, gint posn, gint size)
+static void
+resize (PsppireAxis *axis, gint posn, glong size)
{
+ PsppireAxisImpl *a = PSPPIRE_AXIS_IMPL (axis);
+
struct axis_node *an;
g_return_if_fail (posn >= 0);
}
+void
+psppire_axis_impl_resize (PsppireAxisImpl *a, gint posn, gint size)
+{
+ resize (PSPPIRE_AXIS (a), posn, size);
+}
+
+
+
void
psppire_axis_impl_clear (PsppireAxisImpl *a)
return PSPPIRE_AXIS_GET_IFACE (a)->unit_at_pixel (a, pixel);
}
+
+
+/* Set UNIT to size SIZE */
+void
+psppire_axis_resize (PsppireAxis *a, gint unit, glong size)
+{
+ g_return_if_fail (PSPPIRE_IS_AXIS (a));
+
+ g_return_if_fail (PSPPIRE_AXIS_GET_IFACE (a));
+
+ if (PSPPIRE_AXIS_GET_IFACE (a)->resize)
+ PSPPIRE_AXIS_GET_IFACE (a)->resize (a, unit, size);
+}
+
+
gint (*unit_at_pixel) (const PsppireAxis *a, glong pixel);
- glong (*total_size ) (const PsppireAxis *a);
+ glong (*total_size) (const PsppireAxis *a);
+
+
+ void (*resize) (PsppireAxis *a, gint unit, glong pixels);
};
gint psppire_axis_unit_at_pixel (const PsppireAxis *a, glong pixel);
+void psppire_axis_resize (PsppireAxis *a, gint unit, glong size);
+
G_END_DECLS
#endif /* PSPPIRE_AXIS_H__ */