Removed the visibility predicate from the row/column models.
[pspp-builds.git] / lib / gtksheet / gsheet-uniform-row.c
index 2fc5a87a3cf433b4075c43c897bf7ca299695c00..847916c56d863a54edd5c6f79a6cf838a7355714 100644 (file)
@@ -1,8 +1,8 @@
 /* gsheet-uniform-row.c
- * 
+ *
  *  PSPPIRE --- A Graphical User Interface for PSPP
  * Copyright (C) 2006  Free Software Foundation
- * 
+ *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
@@ -12,7 +12,7 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
@@ -60,7 +60,7 @@ g_sheet_uniform_row_get_type (void)
        NULL
       };
 
-      uniform_row_type = 
+      uniform_row_type =
        g_type_register_static (G_TYPE_OBJECT, "g_sheet_uniform_row",
                                &uniform_row_info, 0);
 
@@ -90,49 +90,39 @@ g_sheet_uniform_row_new (gint height, gint n_rows)
   ug = G_SHEET_UNIFORM_ROW(retval);
   ug->n_rows = n_rows;
   ug->height = height;
-  ug->is_visible = TRUE;
 
   return retval;
 }
 
-static gint 
-g_sheet_uniform_row_get_height(const GSheetRow *geom, gint u, gpointer data)
+static gint
+g_sheet_uniform_row_get_height (const GSheetRow *geom, glong u)
 {
   GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW(geom);
-  
+
   return ug->height;
 }
 
 static gboolean
-g_sheet_uniform_row_get_sensitivity(const GSheetRow *geom, gint u, gpointer data)
+g_sheet_uniform_row_get_sensitivity (const GSheetRow *geom, glong u)
 {
   GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW(geom);
-  
-  return (u < ug->n_rows);
-}
 
-
-static gboolean
-g_sheet_uniform_row_get_visibility(const GSheetRow *geom, gint u, gpointer data)
-{
-  GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW(geom);
-  
-  return ug->is_visible;
+  return (u < ug->n_rows);
 }
 
 
 static gchar *
-g_sheet_uniform_row_get_button_label(const GSheetRow *geom, gint u, gpointer data)
+g_sheet_uniform_row_get_button_label (const GSheetRow *geom, glong u)
 {
-  gchar *label = g_strdup_printf("%d", u);
+  gchar *label = g_strdup_printf("%ld", u);
 
   return label;
 }
 
 
 
-static gint 
-g_sheet_uniform_row_get_row_count(const GSheetRow *geom, gpointer data)
+static glong
+g_sheet_uniform_row_get_row_count (const GSheetRow *geom)
 {
   GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW(geom);
 
@@ -158,30 +148,29 @@ g_sheet_uniform_row_init (GSheetUniformRow *o)
 {
 }
 
-static void         
-g_sheet_uniform_row_finalize (GObject           *object)
+static void
+g_sheet_uniform_row_finalize (GObject *object)
 {
 }
 
 
 static guint
-g_sheet_uniform_row_top_ypixel(const GSheetRow *geo, gint row, gpointer data)
+g_sheet_uniform_row_top_ypixel (const GSheetRow *geo, glong row)
 {
   GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW(geo);
 
   return row * ug->height;
 }
 
-static gint
-g_sheet_uniform_row_pixel_to_row(const GSheetRow *geo, guint pixel, 
-                                gpointer data)
+static glong
+g_sheet_uniform_row_pixel_to_row (const GSheetRow *geo, guint pixel)
 {
   GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW(geo);
 
   gint row = pixel / ug->height;
 
-  if (row >= g_sheet_uniform_row_get_row_count(geo, data))
-    row = g_sheet_uniform_row_get_row_count(geo, data) -1;
+  if (row >= g_sheet_uniform_row_get_row_count(geo))
+    row = g_sheet_uniform_row_get_row_count(geo) - 1;
 
   return row;
 }
@@ -193,7 +182,6 @@ g_sheet_row_init (GSheetRowIface *iface)
 {
   iface->get_height = g_sheet_uniform_row_get_height;
   iface->get_sensitivity = g_sheet_uniform_row_get_sensitivity ;
-  iface->get_visibility = g_sheet_uniform_row_get_visibility;
   iface->get_row_count = g_sheet_uniform_row_get_row_count;
   iface->get_button_label = g_sheet_uniform_row_get_button_label;
   iface->top_ypixel = g_sheet_uniform_row_top_ypixel;