+static guint
+geometry_get_top_ypixel (const GSheetRow *geo, glong row, gpointer data)
+{
+ return row * ROW_HEIGHT;
+}
+
+static glong
+geometry_pixel_to_row (const GSheetRow *geo, guint pixel, gpointer data)
+{
+ glong row = pixel / ROW_HEIGHT;
+
+ if (row >= geometry_get_row_count (geo, data))
+ row = geometry_get_row_count (geo, data) - 1;
+
+ return row;
+}
+
+
+static gboolean
+geometry_get_row_sensitivity (const GSheetRow *geom, glong unit, gpointer data)
+{
+ PsppireDataStore *ds = PSPPIRE_DATA_STORE (geom);
+
+
+ return (unit < psppire_case_file_get_case_count (ds->case_file));
+}
+
+
+static gchar *
+geometry_get_row_button_label (const GSheetRow *geom, glong unit, gpointer data)
+{
+ gchar *text;
+ gchar *s;
+ PsppireDataStore *ds = PSPPIRE_DATA_STORE (geom);
+
+ if ( unit >
+ TRAILING_ROWS + psppire_case_file_get_case_count (ds->case_file))
+ return 0;
+
+ s = g_strdup_printf (_("%ld"), unit + FIRST_CASE_NUMBER);
+
+ text = pspp_locale_to_utf8 (s, -1, 0);
+
+ g_free (s);
+
+ return text;
+}
+
+static void
+psppire_data_store_sheet_row_init (GSheetRowIface *iface)
+{
+ iface->get_row_count = geometry_get_row_count;
+
+ iface->get_height = geometry_get_height;
+ iface->set_height = 0;
+ iface->get_visibility = always_true;
+ iface->get_sensitivity = geometry_get_row_sensitivity;
+ iface->top_ypixel = geometry_get_top_ypixel;
+ iface->pixel_to_row = geometry_pixel_to_row;
+ iface->get_button_label = geometry_get_row_button_label;