Add casegrouper, to allow cases read from a given casereader to be
[pspp-builds.git] / lib / gtksheet / gsheet-uniform-row.c
index 6ab1c8ff11f196824d4a3feb4392024b43d2463b..2fc5a87a3cf433b4075c43c897bf7ca299695c00 100644 (file)
@@ -2,7 +2,6 @@
  * 
  *  PSPPIRE --- A Graphical User Interface for PSPP
  * Copyright (C) 2006  Free Software Foundation
- * Written by John Darrington
  * 
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -19,6 +18,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <config.h>
+
 #include "gsheet-row-iface.h"
 #include "gsheet-uniform-row.h"
 
@@ -95,7 +96,7 @@ g_sheet_uniform_row_new (gint height, gint n_rows)
 }
 
 static gint 
-g_sheet_uniform_row_get_height(const GSheetRow *geom, gint u)
+g_sheet_uniform_row_get_height(const GSheetRow *geom, gint u, gpointer data)
 {
   GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW(geom);
   
@@ -103,7 +104,7 @@ g_sheet_uniform_row_get_height(const GSheetRow *geom, gint u)
 }
 
 static gboolean
-g_sheet_uniform_row_get_sensitivity(const GSheetRow *geom, gint u)
+g_sheet_uniform_row_get_sensitivity(const GSheetRow *geom, gint u, gpointer data)
 {
   GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW(geom);
   
@@ -112,7 +113,7 @@ g_sheet_uniform_row_get_sensitivity(const GSheetRow *geom, gint u)
 
 
 static gboolean
-g_sheet_uniform_row_get_visibility(const GSheetRow *geom, gint u)
+g_sheet_uniform_row_get_visibility(const GSheetRow *geom, gint u, gpointer data)
 {
   GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW(geom);
   
@@ -120,12 +121,10 @@ g_sheet_uniform_row_get_visibility(const GSheetRow *geom, gint u)
 }
 
 
-static const gchar *
-g_sheet_uniform_row_get_button_label(const GSheetRow *geom, gint u)
+static gchar *
+g_sheet_uniform_row_get_button_label(const GSheetRow *geom, gint u, gpointer data)
 {
-  static gchar *label; 
-  g_free(label);
-  label = g_strdup_printf("%d", u);
+  gchar *label = g_strdup_printf("%d", u);
 
   return label;
 }
@@ -133,7 +132,7 @@ g_sheet_uniform_row_get_button_label(const GSheetRow *geom, gint u)
 
 
 static gint 
-g_sheet_uniform_row_get_row_count(const GSheetRow *geom)
+g_sheet_uniform_row_get_row_count(const GSheetRow *geom, gpointer data)
 {
   GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW(geom);
 
@@ -166,23 +165,23 @@ g_sheet_uniform_row_finalize (GObject           *object)
 
 
 static guint
-g_sheet_uniform_row_top_ypixel(GSheetRow *geo, gint row, const GtkSheet *sheet)
+g_sheet_uniform_row_top_ypixel(const GSheetRow *geo, gint row, gpointer data)
 {
   GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW(geo);
 
   return row * ug->height;
 }
 
-static guint
-g_sheet_uniform_row_pixel_to_row(GSheetRow *geo
-                                gint pixel, const GtkSheet *sheet)
+static gint
+g_sheet_uniform_row_pixel_to_row(const GSheetRow *geo, guint pixel
+                                gpointer data)
 {
   GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW(geo);
 
   gint row = pixel / ug->height;
 
-  if (row >= g_sheet_uniform_row_get_row_count(geo))
-    row = g_sheet_uniform_row_get_row_count(geo) -1;
+  if (row >= g_sheet_uniform_row_get_row_count(geo, data))
+    row = g_sheet_uniform_row_get_row_count(geo, data) -1;
 
   return row;
 }