X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fgtksheet%2Fgsheet-uniform-row.c;h=7ab9b600a148ec4effc607193e11386d59b7cdb1;hb=c129378e5d3e3d00e8351fc04a52271824143fdd;hp=6ab1c8ff11f196824d4a3feb4392024b43d2463b;hpb=09f985912144ac86ec48edcce42da390ce2b85b9;p=pspp-builds.git diff --git a/lib/gtksheet/gsheet-uniform-row.c b/lib/gtksheet/gsheet-uniform-row.c index 6ab1c8ff..7ab9b600 100644 --- a/lib/gtksheet/gsheet-uniform-row.c +++ b/lib/gtksheet/gsheet-uniform-row.c @@ -1,9 +1,8 @@ /* gsheet-uniform-row.c - * + * * 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 * License as published by the Free Software Foundation; either @@ -13,12 +12,14 @@ * 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 */ +#include + #include "gsheet-row-iface.h" #include "gsheet-uniform-row.h" @@ -59,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); @@ -94,46 +95,44 @@ g_sheet_uniform_row_new (gint height, gint n_rows) return retval; } -static gint -g_sheet_uniform_row_get_height(const GSheetRow *geom, gint u) +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) +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) +g_sheet_uniform_row_get_visibility (const GSheetRow *geom, glong u) { - GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW(geom); - + GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW (geom); + return ug->is_visible; } -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, glong u) { - static gchar *label; - g_free(label); - 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) +static glong +g_sheet_uniform_row_get_row_count (const GSheetRow *geom) { GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW(geom); @@ -159,30 +158,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(GSheetRow *geo, gint row, const GtkSheet *sheet) +g_sheet_uniform_row_top_ypixel (const GSheetRow *geo, glong row) { 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 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)) - row = g_sheet_uniform_row_get_row_count(geo) -1; + row = g_sheet_uniform_row_get_row_count(geo) - 1; return row; }