From: John Darrington Date: Sun, 8 Jul 2007 10:49:29 +0000 (+0000) Subject: Used type casenumber in GUI code where appropriate. Also, generally X-Git-Tag: v0.6.0~402 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad10aed69efec78ddbfcdbe4774bf9a0435fcfd6;p=pspp-builds.git Used type casenumber in GUI code where appropriate. Also, generally stricter type allocations. --- diff --git a/lib/gtksheet/gsheet-column-iface.c b/lib/gtksheet/gsheet-column-iface.c index 0ad462f9..36fb5e21 100644 --- a/lib/gtksheet/gsheet-column-iface.c +++ b/lib/gtksheet/gsheet-column-iface.c @@ -101,7 +101,7 @@ g_sheet_column_base_init (gpointer g_class) inline void -g_sheet_column_set_width (GSheetColumn *column, gint col, gint size) +g_sheet_column_set_width (GSheetColumn *column, glong col, gint size) { g_return_if_fail (G_IS_SHEET_COLUMN (column)); @@ -111,7 +111,7 @@ g_sheet_column_set_width (GSheetColumn *column, gint col, gint size) inline gint -g_sheet_column_get_width (const GSheetColumn *column, gint col) +g_sheet_column_get_width (const GSheetColumn *column, glong col) { g_return_val_if_fail (G_IS_SHEET_COLUMN (column), -1); @@ -124,7 +124,7 @@ g_sheet_column_get_width (const GSheetColumn *column, gint col) inline gboolean g_sheet_column_get_visibility(const GSheetColumn *column, - gint col) + glong col) { g_return_val_if_fail (G_IS_SHEET_COLUMN (column), FALSE); @@ -137,7 +137,7 @@ g_sheet_column_get_visibility(const GSheetColumn *column, inline gboolean g_sheet_column_get_sensitivity(const GSheetColumn *column, - gint col) + glong col) { g_return_val_if_fail (G_IS_SHEET_COLUMN (column), FALSE); @@ -151,7 +151,7 @@ g_sheet_column_get_sensitivity(const GSheetColumn *column, inline GtkSheetButton * g_sheet_column_get_button(const GSheetColumn *column, - gint col) + glong col) { GtkSheetButton *button = gtk_sheet_button_new(); @@ -167,7 +167,7 @@ g_sheet_column_get_button(const GSheetColumn *column, inline GtkJustification g_sheet_column_get_justification(const GSheetColumn *column, - gint col) + glong col) { g_return_val_if_fail (G_IS_SHEET_COLUMN (column), FALSE); @@ -177,7 +177,7 @@ g_sheet_column_get_justification(const GSheetColumn *column, } inline gchar * -g_sheet_column_get_subtitle (const GSheetColumn *column, gint col) +g_sheet_column_get_subtitle (const GSheetColumn *column, glong col) { g_return_val_if_fail (G_IS_SHEET_COLUMN (column), NULL); @@ -191,7 +191,7 @@ g_sheet_column_get_subtitle (const GSheetColumn *column, gint col) inline gint g_sheet_column_get_left_text_column (const GSheetColumn *column, - gint col) + glong col) { g_return_val_if_fail (G_IS_SHEET_COLUMN (column), -1); @@ -204,7 +204,7 @@ g_sheet_column_get_left_text_column (const GSheetColumn *column, inline gint g_sheet_column_get_right_text_column (const GSheetColumn *column, - gint col) + glong col) { g_return_val_if_fail (G_IS_SHEET_COLUMN (column), -1); @@ -217,7 +217,7 @@ g_sheet_column_get_right_text_column (const GSheetColumn *column, inline void g_sheet_column_set_left_text_column (const GSheetColumn *column, - gint col, gint i) + glong col, gint i) { g_return_if_fail (G_IS_SHEET_COLUMN (column)); @@ -229,7 +229,7 @@ g_sheet_column_set_left_text_column (const GSheetColumn *column, inline void g_sheet_column_set_right_text_column (const GSheetColumn *column, - gint col, gint i) + glong col, gint i) { g_return_if_fail (G_IS_SHEET_COLUMN (column)); @@ -237,7 +237,7 @@ g_sheet_column_set_right_text_column (const GSheetColumn *column, (G_SHEET_COLUMN_GET_IFACE (column)->set_right_text_column) (column, col, i); } -inline gint +inline glong g_sheet_column_get_column_count(const GSheetColumn *geo) { g_return_val_if_fail (G_IS_SHEET_COLUMN (geo), -1); @@ -248,7 +248,7 @@ g_sheet_column_get_column_count(const GSheetColumn *geo) } inline gint -g_sheet_column_start_pixel(const GSheetColumn *geo, gint col) +g_sheet_column_start_pixel(const GSheetColumn *geo, glong col) { gint i; gint start_pixel = 0; @@ -271,7 +271,7 @@ g_sheet_column_start_pixel(const GSheetColumn *geo, gint col) inline void g_sheet_column_columns_changed(GSheetColumn *geo, - gint first, gint n_columns) + glong first, glong n_columns) { g_return_if_fail (G_IS_SHEET_COLUMN (geo)); diff --git a/lib/gtksheet/gsheet-column-iface.h b/lib/gtksheet/gsheet-column-iface.h index 6526cdff..5503393a 100644 --- a/lib/gtksheet/gsheet-column-iface.h +++ b/lib/gtksheet/gsheet-column-iface.h @@ -44,42 +44,42 @@ struct _GSheetColumnIface /* Signals */ void (* columns_changed) (GSheetColumn *geo, - gint col, gint n_columns); + glong col, glong n_columns); /* Virtual Table */ - gint (* get_width) (const GSheetColumn *gcolumn, gint col); - void (* set_width) (GSheetColumn *gcolumn, gint col, gint width); + gint (* get_width) (const GSheetColumn *gcolumn, glong col); + void (* set_width) (GSheetColumn *gcolumn, glong col, gint width); - gboolean (* get_visibility) (const GSheetColumn *gcolumn, gint col); - gboolean (* get_sensitivity) (const GSheetColumn *gcolumn, gint col); - const GtkSheetButton * (* get_button) (const GSheetColumn *gcolumn, gint col); - GtkJustification (* get_justification) (const GSheetColumn *gcolumn, gint col); + gboolean (* get_visibility) (const GSheetColumn *gcolumn, glong col); + gboolean (* get_sensitivity) (const GSheetColumn *gcolumn, glong col); + const GtkSheetButton * (* get_button) (const GSheetColumn *gcolumn, glong col); + GtkJustification (* get_justification) (const GSheetColumn *gcolumn, glong col); gint (*get_left_text_column) (const GSheetColumn *gcolumn, - gint col); + glong col); gint (*get_right_text_column) (const GSheetColumn *gcolumn, - gint col); + glong col); void (* set_left_text_column) (const GSheetColumn *gcolumn, - gint col, gint i); + glong col, gint i); void (* set_right_text_column) (const GSheetColumn *gcolumn, - gint col, gint i); + glong col, gint i); - gint (* get_column_count) (const GSheetColumn *geo); + glong (* get_column_count) (const GSheetColumn *geo); - GtkStateType (*get_button_state)(const GSheetColumn *geo, gint col); - gchar * (*get_button_label)(const GSheetColumn *geo, gint col); - gchar * (*get_subtitle)(const GSheetColumn *geo, gint col); + GtkStateType (*get_button_state)(const GSheetColumn *geo, glong col); + gchar * (*get_button_label)(const GSheetColumn *geo, glong col); + gchar * (*get_subtitle)(const GSheetColumn *geo, glong col); gboolean (*get_button_visibility)(const GSheetColumn *geo, - gint col); + glong col); const GtkSheetChild * (*get_button_child)(const GSheetColumn *geo, - gint col); + glong col); GtkJustification * (*get_button_justification)(const GSheetColumn *geo, - gint col); + glong col); }; @@ -87,48 +87,48 @@ inline GType g_sheet_column_get_type (void) G_GNUC_CONST; inline gint g_sheet_column_get_width (const GSheetColumn *gcolumn, - gint col); + glong col); inline void g_sheet_column_set_width (GSheetColumn *gcolumn, - gint col, gint size); + glong col, gint size); -inline gboolean g_sheet_column_get_visibility(const GSheetColumn *gcolumn, - gint col); +inline gboolean g_sheet_column_get_visibility (const GSheetColumn *gcolumn, + glong col); -inline gboolean g_sheet_column_get_sensitivity(const GSheetColumn *gcolumn, - gint col); +inline gboolean g_sheet_column_get_sensitivity (const GSheetColumn *gcolumn, + glong col); -inline GtkSheetButton *g_sheet_column_get_button(const GSheetColumn *gcolumn, - gint col); +inline GtkSheetButton *g_sheet_column_get_button (const GSheetColumn *gcolumn, + glong col); -gchar *g_sheet_column_get_subtitle (const GSheetColumn *, gint); +gchar *g_sheet_column_get_subtitle (const GSheetColumn *, glong); -inline GtkJustification g_sheet_column_get_justification(const GSheetColumn *gcolumn, gint col); +inline GtkJustification g_sheet_column_get_justification (const GSheetColumn *gcolumn, glong col); inline gint g_sheet_column_get_left_text_column (const GSheetColumn *gcolumn, - gint col); + glong col); inline gint g_sheet_column_get_right_text_column (const GSheetColumn *gcolumn, - gint col); + glong col); inline void g_sheet_column_set_left_text_column (const GSheetColumn *gcolumn, - gint col, gint i); + glong col, gint i); inline void g_sheet_column_set_right_text_column (const GSheetColumn *gcolumn, - gint col, gint i); + glong col, gint i); -inline gint g_sheet_column_get_column_count(const GSheetColumn *geo); +inline glong g_sheet_column_get_column_count (const GSheetColumn *geo); -inline gint g_sheet_column_start_pixel(const GSheetColumn *geo, gint col); +inline gint g_sheet_column_start_pixel (const GSheetColumn *geo, glong col); -inline void g_sheet_column_columns_changed(GSheetColumn *geo, - gint first, gint n_columns); +inline void g_sheet_column_columns_changed (GSheetColumn *geo, + glong first, glong n_columns); G_END_DECLS diff --git a/lib/gtksheet/gsheet-hetero-column.c b/lib/gtksheet/gsheet-hetero-column.c index ca439371..0cda0cf3 100644 --- a/lib/gtksheet/gsheet-hetero-column.c +++ b/lib/gtksheet/gsheet-hetero-column.c @@ -91,10 +91,10 @@ g_sheet_hetero_column_new (gint default_width, gint n_columns) retval = g_object_new (G_TYPE_SHEET_HETERO_COLUMN, NULL); - hg = G_SHEET_HETERO_COLUMN(retval); + hg = G_SHEET_HETERO_COLUMN (retval); hg->n_columns = n_columns; hg->default_width = default_width; - hg->col = g_new0(struct GSheetHeteroColumnUnit, n_columns); + hg->col = g_new0 (struct GSheetHeteroColumnUnit, n_columns); for (i = 0 ; i < hg->n_columns; ++i ) { @@ -105,24 +105,24 @@ g_sheet_hetero_column_new (gint default_width, gint n_columns) } static gint -g_sheet_hetero_column_get_width(const GSheetColumn *geom, gint i) +g_sheet_hetero_column_get_width (const GSheetColumn *geom, glong i) { - GSheetHeteroColumn *hg = G_SHEET_HETERO_COLUMN(geom); + GSheetHeteroColumn *hg = G_SHEET_HETERO_COLUMN (geom); - g_return_val_if_fail(i < hg->n_columns, -1); + g_return_val_if_fail (i < hg->n_columns, -1); return hg->col[i].width; } -static gint -g_sheet_hetero_column_get_sensitivity(const GSheetColumn *geom, gint u) +static gboolean +g_sheet_hetero_column_get_sensitivity (const GSheetColumn *geom, glong u) { return TRUE; } -static gint -g_sheet_hetero_column_get_visibility(const GSheetColumn *geom, gint u) +static gboolean +g_sheet_hetero_column_get_visibility (const GSheetColumn *geom, glong u) { return TRUE; } @@ -130,26 +130,26 @@ g_sheet_hetero_column_get_visibility(const GSheetColumn *geom, gint u) static gchar * -g_sheet_hetero_column_get_button_label(const GSheetColumn *geom, gint u) +g_sheet_hetero_column_get_button_label (const GSheetColumn *geom, glong u) { - GSheetHeteroColumn *hg = G_SHEET_HETERO_COLUMN(geom); + GSheetHeteroColumn *hg = G_SHEET_HETERO_COLUMN (geom); - return g_locale_to_utf8(hg->col[u].button.label, -1, 0, 0, 0); + return g_locale_to_utf8 (hg->col[u].button.label, -1, 0, 0, 0); } static GtkJustification -g_sheet_hetero_column_get_justification(const GSheetColumn *geom, gint u) +g_sheet_hetero_column_get_justification (const GSheetColumn *geom, glong u) { return GTK_JUSTIFY_FILL; } -static gint -g_sheet_hetero_column_get_column_count(const GSheetColumn *geom) +static glong +g_sheet_hetero_column_get_column_count (const GSheetColumn *geom) { - GSheetHeteroColumn *hg = G_SHEET_HETERO_COLUMN(geom); + GSheetHeteroColumn *hg = G_SHEET_HETERO_COLUMN (geom); return hg->n_columns; } @@ -180,17 +180,17 @@ g_sheet_hetero_column_init (GSheetHeteroColumn *o) static void g_sheet_hetero_column_finalize (GObject *object) { - GSheetHeteroColumn *hg = G_SHEET_HETERO_COLUMN(object); + GSheetHeteroColumn *hg = G_SHEET_HETERO_COLUMN (object); - g_free(hg->col); + g_free (hg->col); } static void -hetero_column_set_width(GSheetColumn *geo, gint i, gint size) +hetero_column_set_width (GSheetColumn *geo, glong i, gint size) { - GSheetHeteroColumn *hg = G_SHEET_HETERO_COLUMN(geo); + GSheetHeteroColumn *hg = G_SHEET_HETERO_COLUMN (geo); - g_return_if_fail(i < hg->n_columns); + g_return_if_fail (i < hg->n_columns); hg->col[i].width = size; } @@ -212,26 +212,26 @@ g_sheet_column_init (GSheetColumnIface *iface) void -g_sheet_hetero_column_set_button_label(GSheetHeteroColumn *geo, - gint i, const gchar *label) +g_sheet_hetero_column_set_button_label (GSheetHeteroColumn *geo, + glong i, const gchar *label) { - g_return_if_fail(i < geo->n_columns); + g_return_if_fail (i < geo->n_columns); - g_free(geo->col[i].button.label); - geo->col[i].button.label = g_malloc(strlen(label) + 1); + g_free (geo->col[i].button.label); + geo->col[i].button.label = g_malloc (strlen (label) + 1); - g_stpcpy(geo->col[i].button.label, label); + g_stpcpy (geo->col[i].button.label, label); } inline void -g_sheet_hetero_column_set_width(GSheetHeteroColumn *geo, gint i, gint size) +g_sheet_hetero_column_set_width (GSheetHeteroColumn *geo, glong i, gint size) { - GSheetColumn *iface = G_SHEET_COLUMN(geo); + GSheetColumn *iface = G_SHEET_COLUMN (geo); - hetero_column_set_width(iface, i, size); + hetero_column_set_width (iface, i, size); } diff --git a/lib/gtksheet/gsheet-hetero-column.h b/lib/gtksheet/gsheet-hetero-column.h index 2c4fc1d7..507bc20a 100644 --- a/lib/gtksheet/gsheet-hetero-column.h +++ b/lib/gtksheet/gsheet-hetero-column.h @@ -73,11 +73,11 @@ extern "C" { typedef struct _GSheetHeteroColumnClass GSheetHeteroColumnClass; - void g_sheet_hetero_column_set_button_label(GSheetHeteroColumn *geo, - gint i, const gchar *label); + void g_sheet_hetero_column_set_button_label (GSheetHeteroColumn *geo, + glong i, const gchar *label); - void g_sheet_hetero_column_set_width(GSheetHeteroColumn *geo, - gint i, gint size); + void g_sheet_hetero_column_set_width (GSheetHeteroColumn *geo, + glong i, gint size); #ifdef __cplusplus } diff --git a/lib/gtksheet/gsheet-row-iface.c b/lib/gtksheet/gsheet-row-iface.c index bc365223..44afc0aa 100644 --- a/lib/gtksheet/gsheet-row-iface.c +++ b/lib/gtksheet/gsheet-row-iface.c @@ -105,7 +105,7 @@ g_sheet_row_base_init (gpointer g_class) void g_sheet_row_set_height (GSheetRow *row_geo, - gint row, gint size, gpointer data) + glong row, gint size, gpointer data) { g_return_if_fail (G_IS_SHEET_ROW (row_geo)); @@ -117,7 +117,7 @@ g_sheet_row_set_height (GSheetRow *row_geo, gint g_sheet_row_get_height (const GSheetRow *row_geo, - gint row, gpointer data) + glong row, gpointer data) { g_return_val_if_fail (G_IS_SHEET_ROW (row_geo), -1); @@ -131,7 +131,7 @@ g_sheet_row_get_height (const GSheetRow *row_geo, gboolean g_sheet_row_get_visibility(const GSheetRow *row_geo, - gint row, gpointer data) + glong row, gpointer data) { g_return_val_if_fail (G_IS_SHEET_ROW (row_geo), FALSE); @@ -144,7 +144,7 @@ g_sheet_row_get_visibility(const GSheetRow *row_geo, gboolean g_sheet_row_get_sensitivity(const GSheetRow *row_geo, - gint row, gpointer data) + glong row, gpointer data) { g_return_val_if_fail (G_IS_SHEET_ROW (row_geo), FALSE); @@ -158,7 +158,7 @@ g_sheet_row_get_sensitivity(const GSheetRow *row_geo, GtkSheetButton * g_sheet_row_get_button(const GSheetRow *row_geo, - gint row, gpointer data) + glong row, gpointer data) { GtkSheetButton *button = gtk_sheet_button_new(); @@ -173,7 +173,7 @@ g_sheet_row_get_button(const GSheetRow *row_geo, } inline gchar * -g_sheet_row_get_subtitle (const GSheetRow *row_geo, gint row) +g_sheet_row_get_subtitle (const GSheetRow *row_geo, glong row) { g_return_val_if_fail (G_IS_SHEET_ROW (row_geo), NULL); @@ -186,8 +186,8 @@ g_sheet_row_get_subtitle (const GSheetRow *row_geo, gint row) -gint -g_sheet_row_get_row_count(const GSheetRow *geo, gpointer data) +glong +g_sheet_row_get_row_count (const GSheetRow *geo, gpointer data) { g_return_val_if_fail (G_IS_SHEET_ROW (geo), -1); @@ -210,7 +210,7 @@ g_sheet_row_get_row_count(const GSheetRow *geo, gpointer data) */ gint -g_sheet_row_start_pixel(const GSheetRow *geo, gint row, gpointer data) +g_sheet_row_start_pixel(const GSheetRow *geo, glong row, gpointer data) { gint i; gint start_pixel = 0; @@ -233,8 +233,8 @@ g_sheet_row_start_pixel(const GSheetRow *geo, gint row, gpointer data) } -gint -g_sheet_row_pixel_to_row(const GSheetRow *geo, gint pixel, +glong +g_sheet_row_pixel_to_row (const GSheetRow *geo, gint pixel, gpointer data) { gint i, cy; @@ -263,8 +263,8 @@ g_sheet_row_pixel_to_row(const GSheetRow *geo, gint pixel, void -g_sheet_row_rows_deleted(GSheetRow *geo, - gint first, gint n_rows) +g_sheet_row_rows_deleted (GSheetRow *geo, + glong first, glong n_rows) { g_return_if_fail (G_IS_SHEET_ROW (geo)); diff --git a/lib/gtksheet/gsheet-row-iface.h b/lib/gtksheet/gsheet-row-iface.h index 3917b031..ea08d540 100644 --- a/lib/gtksheet/gsheet-row-iface.h +++ b/lib/gtksheet/gsheet-row-iface.h @@ -47,41 +47,41 @@ struct _GSheetRowIface /* Signals */ void (* rows_changed) (GSheetRow *geo, - gint row, gint n_rows); + glong row, glong n_rows); /* Virtual Table */ - gint (* get_height) (const GSheetRow *grow, gint row, gpointer); - void (* set_height) (GSheetRow *grow, gint row, gint height, + gint (* get_height) (const GSheetRow *grow, glong row, gpointer); + void (* set_height) (GSheetRow *grow, glong row, gint height, gpointer); - gboolean (* get_visibility) (const GSheetRow *grow, gint row, + gboolean (* get_visibility) (const GSheetRow *grow, glong row, gpointer); - gboolean (* get_sensitivity) (const GSheetRow *grow, gint row, + gboolean (* get_sensitivity) (const GSheetRow *grow, glong row, gpointer); - const GtkSheetButton * (* get_button) (const GSheetRow *grow, gint row, + const GtkSheetButton * (* get_button) (const GSheetRow *grow, glong row, gpointer); - gint (* get_row_count) (const GSheetRow *geo, gpointer); + glong (* get_row_count) (const GSheetRow *geo, gpointer); - GtkStateType (*get_button_state)(const GSheetRow *geo, gint row, + GtkStateType (*get_button_state) (const GSheetRow *geo, glong row, gpointer); - gchar * (*get_button_label)(const GSheetRow *geo, gint row, + gchar * (*get_button_label) (const GSheetRow *geo, glong row, gpointer); - gchar * (*get_subtitle) (const GSheetRow *geo, gint row); + gchar * (*get_subtitle) (const GSheetRow *geo, glong row); - gboolean (*get_button_visibility)(const GSheetRow *geo, - gint row, gpointer); + gboolean (*get_button_visibility) (const GSheetRow *geo, + glong row, gpointer); - const GtkSheetChild * (*get_button_child)(const GSheetRow *geo, - gint row, gpointer); + const GtkSheetChild * (*get_button_child) (const GSheetRow *geo, + glong row, gpointer); - guint (*top_ypixel)(const GSheetRow *geo, gint row, gpointer); - gint (*pixel_to_row)(const GSheetRow *geo, guint pixel, gpointer); + guint (*top_ypixel) (const GSheetRow *geo, glong row, gpointer); + glong (*pixel_to_row) (const GSheetRow *geo, guint pixel, gpointer); }; @@ -89,40 +89,40 @@ GType g_sheet_row_get_type (void) G_GNUC_CONST; gint g_sheet_row_get_height (const GSheetRow *grow, - gint row, gpointer); + glong row, gpointer); void g_sheet_row_set_height (GSheetRow *grow, - gint row, gint size, gpointer); + glong row, gint size, gpointer); -gboolean g_sheet_row_get_visibility(const GSheetRow *grow, - gint row, gpointer); +gboolean g_sheet_row_get_visibility (const GSheetRow *grow, + glong row, gpointer); -gboolean g_sheet_row_get_sensitivity(const GSheetRow *grow, - gint row, gpointer); +gboolean g_sheet_row_get_sensitivity (const GSheetRow *grow, + glong row, gpointer); -GtkSheetButton *g_sheet_row_get_button(const GSheetRow *grow, - gint row, gpointer); +GtkSheetButton *g_sheet_row_get_button (const GSheetRow *grow, + glong row, gpointer); -gint g_sheet_row_get_row_count(const GSheetRow *geo, gpointer); +glong g_sheet_row_get_row_count (const GSheetRow *geo, gpointer); /* Return the top pixel of row ROW */ -gint g_sheet_row_start_pixel(const GSheetRow *geo, gint row, +gint g_sheet_row_start_pixel (const GSheetRow *geo, glong row, gpointer); /* Return the row contained by pixel PIXEL */ -gint g_sheet_row_pixel_to_row(const GSheetRow *geo, gint pixel, +glong g_sheet_row_pixel_to_row (const GSheetRow *geo, gint pixel, gpointer); -void g_sheet_row_rows_deleted(GSheetRow *geo, - gint first, gint n_rows); +void g_sheet_row_rows_deleted (GSheetRow *geo, + glong first, glong n_rows); -gchar *g_sheet_row_get_subtitle (const GSheetRow *row_geo, gint row); +gchar *g_sheet_row_get_subtitle (const GSheetRow *row_geo, glong row); G_END_DECLS diff --git a/lib/gtksheet/gsheet-uniform-column.c b/lib/gtksheet/gsheet-uniform-column.c index 797382b7..5093da2f 100644 --- a/lib/gtksheet/gsheet-uniform-column.c +++ b/lib/gtksheet/gsheet-uniform-column.c @@ -97,52 +97,52 @@ g_sheet_uniform_column_new (gint width, gint n_columns) } static gint -g_sheet_uniform_column_get_width(const GSheetColumn *geom, gint u) +g_sheet_uniform_column_get_width (const GSheetColumn *geom, glong u) { - GSheetUniformColumn *ug = G_SHEET_UNIFORM_COLUMN(geom); + GSheetUniformColumn *ug = G_SHEET_UNIFORM_COLUMN (geom); return ug->width; } -static gint -g_sheet_uniform_column_get_sensitivity(const GSheetColumn *geom, gint u) +static gboolean +g_sheet_uniform_column_get_sensitivity (const GSheetColumn *geom, glong u) { - GSheetUniformColumn *ug = G_SHEET_UNIFORM_COLUMN(geom); + GSheetUniformColumn *ug = G_SHEET_UNIFORM_COLUMN (geom); return ug->is_sensitive; } -static gint -g_sheet_uniform_column_get_visibility(const GSheetColumn *geom, gint u) +static gboolean +g_sheet_uniform_column_get_visibility (const GSheetColumn *geom, glong u) { - GSheetUniformColumn *ug = G_SHEET_UNIFORM_COLUMN(geom); + GSheetUniformColumn *ug = G_SHEET_UNIFORM_COLUMN (geom); return ug->is_visible; } static gchar * -g_sheet_uniform_column_get_button_label(const GSheetColumn *geom, gint u) +g_sheet_uniform_column_get_button_label (const GSheetColumn *geom, glong u) { - gchar *label = g_strdup_printf("%d", u); + gchar *label = g_strdup_printf ("%ld", u); return label; } static GtkJustification -g_sheet_uniform_column_get_justification(const GSheetColumn *geom, gint u) +g_sheet_uniform_column_get_justification (const GSheetColumn *geom, glong u) { return GTK_JUSTIFY_FILL; } -static gint -g_sheet_uniform_column_get_column_count(const GSheetColumn *geom) +static glong +g_sheet_uniform_column_get_column_count (const GSheetColumn *geom) { - GSheetUniformColumn *ug = G_SHEET_UNIFORM_COLUMN(geom); + GSheetUniformColumn *ug = G_SHEET_UNIFORM_COLUMN (geom); return ug->n_columns; } @@ -166,7 +166,7 @@ g_sheet_uniform_column_init (GSheetUniformColumn *o) } static void -g_sheet_uniform_column_finalize (GObject *object) +g_sheet_uniform_column_finalize (GObject *object) { } diff --git a/lib/gtksheet/gsheet-uniform-row.c b/lib/gtksheet/gsheet-uniform-row.c index 83791ada..755ce258 100644 --- a/lib/gtksheet/gsheet-uniform-row.c +++ b/lib/gtksheet/gsheet-uniform-row.c @@ -96,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, gpointer data) +g_sheet_uniform_row_get_height (const GSheetRow *geom, glong u, gpointer data) { GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW(geom); @@ -104,7 +104,8 @@ g_sheet_uniform_row_get_height(const GSheetRow *geom, gint u, gpointer data) } 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, + gpointer data) { GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW(geom); @@ -113,26 +114,27 @@ g_sheet_uniform_row_get_sensitivity(const GSheetRow *geom, gint u, gpointer data static gboolean -g_sheet_uniform_row_get_visibility(const GSheetRow *geom, gint u, gpointer data) +g_sheet_uniform_row_get_visibility (const GSheetRow *geom, glong u, + gpointer data) { - GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW(geom); + GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW (geom); return ug->is_visible; } 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, gpointer data) { - 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, gpointer data) { GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW(geom); @@ -159,21 +161,21 @@ g_sheet_uniform_row_init (GSheetUniformRow *o) } static void -g_sheet_uniform_row_finalize (GObject *object) +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, gpointer data) { 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, +static glong +g_sheet_uniform_row_pixel_to_row (const GSheetRow *geo, guint pixel, gpointer data) { GSheetUniformRow *ug = G_SHEET_UNIFORM_ROW(geo); diff --git a/lib/gtksheet/gsheetmodel.c b/lib/gtksheet/gsheetmodel.c index 22e3af2e..3fa8f0af 100644 --- a/lib/gtksheet/gsheetmodel.c +++ b/lib/gtksheet/gsheetmodel.c @@ -168,7 +168,7 @@ g_sheet_model_free_strings (const GSheetModel *sheet_model) **/ inline gchar * g_sheet_model_get_string (const GSheetModel *sheet_model, - gint row, gint column) + glong row, glong column) { g_return_val_if_fail (G_IS_SHEET_MODEL (sheet_model), 0); @@ -190,7 +190,7 @@ g_sheet_model_get_string (const GSheetModel *sheet_model, gboolean g_sheet_model_set_string (GSheetModel *sheet_model, const gchar *text, - gint row, gint column) + glong row, glong column) { g_return_val_if_fail (G_IS_SHEET_MODEL (sheet_model), FALSE); @@ -213,7 +213,7 @@ g_sheet_model_set_string (GSheetModel *sheet_model, **/ gboolean g_sheet_model_datum_clear (GSheetModel *sheet_model, - gint row, gint column) + glong row, glong column) { g_return_val_if_fail (G_IS_SHEET_MODEL (sheet_model), FALSE); @@ -233,8 +233,8 @@ g_sheet_model_datum_clear (GSheetModel *sheet_model, **/ void g_sheet_model_range_changed (GSheetModel *sheet_model, - gint row0, gint col0, - gint rowi, gint coli) + glong row0, glong col0, + glong rowi, glong coli) { g_return_if_fail (G_IS_SHEET_MODEL (sheet_model)); @@ -255,7 +255,7 @@ g_sheet_model_range_changed (GSheetModel *sheet_model, **/ void g_sheet_model_rows_inserted (GSheetModel *sheet_model, - gint row, gint n_rows) + glong row, glong n_rows) { g_return_if_fail (G_IS_SHEET_MODEL (sheet_model)); @@ -274,7 +274,7 @@ g_sheet_model_rows_inserted (GSheetModel *sheet_model, **/ void g_sheet_model_columns_inserted (GSheetModel *sheet_model, - gint column, gint n_columns) + glong column, glong n_columns) { g_return_if_fail (G_IS_SHEET_MODEL (sheet_model)); @@ -295,7 +295,7 @@ g_sheet_model_columns_inserted (GSheetModel *sheet_model, **/ void g_sheet_model_rows_deleted (GSheetModel *sheet_model, - gint row, gint n_rows) + glong row, glong n_rows) { g_return_if_fail (G_IS_SHEET_MODEL (sheet_model)); @@ -315,7 +315,7 @@ g_sheet_model_rows_deleted (GSheetModel *sheet_model, **/ void g_sheet_model_columns_deleted (GSheetModel *sheet_model, - gint column, gint n_columns) + glong column, glong n_columns) { g_return_if_fail (G_IS_SHEET_MODEL (sheet_model)); @@ -337,7 +337,7 @@ g_sheet_model_columns_deleted (GSheetModel *sheet_model, **/ inline gboolean g_sheet_model_is_editable (const GSheetModel *model, - gint row, gint column) + glong row, glong column) { g_return_val_if_fail (G_IS_SHEET_MODEL (model), TRUE); @@ -358,7 +358,7 @@ g_sheet_model_is_editable (const GSheetModel *model, **/ inline gboolean g_sheet_model_is_visible (const GSheetModel *model, - gint row, gint column) + glong row, glong column) { g_return_val_if_fail (G_IS_SHEET_MODEL (model), TRUE); @@ -381,7 +381,7 @@ g_sheet_model_is_visible (const GSheetModel *model, **/ inline const GdkColor * g_sheet_model_get_foreground (const GSheetModel *model, - gint row, gint column) + glong row, glong column) { g_return_val_if_fail (G_IS_SHEET_MODEL (model), NULL); @@ -403,7 +403,7 @@ g_sheet_model_get_foreground (const GSheetModel *model, **/ inline const GdkColor * g_sheet_model_get_background (const GSheetModel *model, - gint row, gint column) + glong row, glong column) { g_return_val_if_fail (G_IS_SHEET_MODEL (model), NULL); @@ -425,7 +425,7 @@ g_sheet_model_get_background (const GSheetModel *model, **/ inline const GtkJustification * g_sheet_model_get_justification (const GSheetModel *model, - gint row, gint column) + glong row, glong column) { g_return_val_if_fail (G_IS_SHEET_MODEL (model), NULL); @@ -447,7 +447,7 @@ g_sheet_model_get_justification (const GSheetModel *model, **/ inline const PangoFontDescription * g_sheet_model_get_font_desc(const GSheetModel *model, - gint row, gint column) + glong row, glong column) { g_return_val_if_fail (G_IS_SHEET_MODEL (model), NULL); if ( ! G_SHEET_MODEL_GET_IFACE (model)->get_font_desc) @@ -468,7 +468,7 @@ g_sheet_model_get_font_desc(const GSheetModel *model, **/ inline const GtkSheetCellBorder * g_sheet_model_get_cell_border (const GSheetModel *model, - gint row, gint column) + glong row, glong column) { g_return_val_if_fail (G_IS_SHEET_MODEL (model), NULL); if ( ! G_SHEET_MODEL_GET_IFACE (model)->get_cell_border) @@ -486,8 +486,8 @@ g_sheet_model_get_cell_border (const GSheetModel *model, * * Returns the total number of columns represented by the model **/ -inline gint -g_sheet_model_get_column_count(const GSheetModel *model) +inline glong +g_sheet_model_get_column_count (const GSheetModel *model) { g_return_val_if_fail (G_IS_SHEET_MODEL (model), -1); diff --git a/lib/gtksheet/gsheetmodel.h b/lib/gtksheet/gsheetmodel.h index 97db2d1b..6d60e032 100644 --- a/lib/gtksheet/gsheetmodel.h +++ b/lib/gtksheet/gsheetmodel.h @@ -51,8 +51,8 @@ typedef struct _GtkSheetCellBorder GtkSheetCellBorder; struct _GtkSheetRange { - gint row0,col0; /* upper-left cell */ - gint rowi,coli; /* lower-right cell */ + glong row0,col0; /* upper-left cell */ + glong rowi,coli; /* lower-right cell */ }; struct _GtkSheetCellBorder @@ -75,20 +75,20 @@ struct _GSheetModelIface /* Signals */ void (* range_changed) (GSheetModel *sheet_model, - gint row0, gint col0, - gint rowi, gint coli); + glong row0, glong col0, + glong rowi, glong coli); void (* rows_inserted) (GSheetModel *sheet_model, - gint row, gint n_rows); + glong row, glong n_rows); void (* rows_deleted) (GSheetModel *sheet_model, - gint row, gint n_rows); + glong row, glong n_rows); void (* columns_inserted) (GSheetModel *sheet_model, - gint column, gint n_columns); + glong column, glong n_columns); void (* columns_deleted) (GSheetModel *sheet_model, - gint column, gint n_columns); + glong column, glong n_columns); @@ -96,36 +96,36 @@ struct _GSheetModelIface /* Virtual Table */ gchar * (* get_string) (const GSheetModel *sheet_model, - gint row, gint column); + glong row, glong column); gboolean (* set_string) (GSheetModel *sheet_model, - const gchar *s, gint row, gint column); + const gchar *s, glong row, glong column); gboolean (* clear_datum) (GSheetModel *sheet_model, - gint row, gint column); + glong row, glong column); - gboolean (* is_visible) (const GSheetModel *sheet_model, gint row, gint column); - gboolean (* is_editable) (const GSheetModel *sheet_model, gint row, gint column); + gboolean (* is_visible) (const GSheetModel *sheet_model, glong row, glong column); + gboolean (* is_editable) (const GSheetModel *sheet_model, glong row, glong column); const GdkColor * (* get_foreground) (const GSheetModel *sheet_model, - gint row, gint column); + glong row, glong column); const GdkColor * (* get_background) (const GSheetModel *sheet_model, - gint row, gint column); + glong row, glong column); const GtkJustification * (* get_justification) (const GSheetModel *sheet_model, - gint row, gint column); + glong row, glong column); const PangoFontDescription * (* get_font_desc) (const GSheetModel *sheet_model, - gint row, gint column); + glong row, glong column); const GtkSheetCellBorder * (* get_cell_border) (const GSheetModel *sheet_model, - gint row, gint column); + glong row, glong column); - gint (*get_column_count) (const GSheetModel *model); + glong (*get_column_count) (const GSheetModel *model); - gint (*get_row_count) (const GSheetModel *model); + glong (*get_row_count) (const GSheetModel *model); }; @@ -135,62 +135,62 @@ GType g_sheet_model_get_type (void) G_GNUC_CONST; inline gchar * g_sheet_model_get_string (const GSheetModel *sheet_model, - gint row, gint column); + glong row, glong column); inline gboolean g_sheet_model_set_string (GSheetModel *sheet_model, const gchar *s, - gint row, gint column); + glong row, glong column); inline gboolean g_sheet_model_datum_clear (GSheetModel *sheet_model, - gint row, gint column); + glong row, glong column); inline void g_sheet_model_range_changed (GSheetModel *sheet_model, - gint row0, gint col0, - gint rowi, gint coli); + glong row0, glong col0, + glong rowi, glong coli); inline void g_sheet_model_rows_deleted (GSheetModel *sheet_model, - gint row, gint n_rows); + glong row, glong n_rows); inline void g_sheet_model_rows_inserted (GSheetModel *sheet_model, - gint row, gint n_rows); + glong row, glong n_rows); inline void g_sheet_model_columns_inserted (GSheetModel *sheet_model, - gint column, gint n_columns); + glong column, glong n_columns); inline void g_sheet_model_columns_deleted (GSheetModel *sheet_model, - gint column, gint n_columns); + glong column, glong n_columns); inline gboolean g_sheet_model_is_editable (const GSheetModel *model, - gint row, gint column); + glong row, glong column); inline gboolean g_sheet_model_is_visible - (const GSheetModel *model, gint row, gint column); + (const GSheetModel *model, glong row, glong column); inline const GdkColor *g_sheet_model_get_foreground - (const GSheetModel *model, gint row, gint column); + (const GSheetModel *model, glong row, glong column); inline const GdkColor *g_sheet_model_get_background - (const GSheetModel *model, gint row, gint column); + (const GSheetModel *model, glong row, glong column); inline const GtkJustification *g_sheet_model_get_justification - (const GSheetModel *model, gint row, gint column); + (const GSheetModel *model, glong row, glong column); inline const PangoFontDescription *g_sheet_model_get_font_desc - (const GSheetModel *model, gint row, gint column); + (const GSheetModel *model, glong row, glong column); inline const GtkSheetCellBorder * g_sheet_model_get_cell_border - (const GSheetModel *model, gint row, gint column); + (const GSheetModel *model, glong row, glong column); inline gboolean g_sheet_model_free_strings (const GSheetModel *sheet_model); -inline gint g_sheet_model_get_column_count(const GSheetModel *sheet_model); +inline glong g_sheet_model_get_column_count (const GSheetModel *sheet_model); -inline gint g_sheet_model_get_row_count(const GSheetModel *sheet_model); +inline gint g_sheet_model_get_row_count (const GSheetModel *sheet_model); G_END_DECLS diff --git a/src/ui/gui/psppire-case-file.c b/src/ui/gui/psppire-case-file.c index 32b3cb40..7de97f5c 100644 --- a/src/ui/gui/psppire-case-file.c +++ b/src/ui/gui/psppire-case-file.c @@ -164,7 +164,7 @@ psppire_case_file_new (const struct casereader *reader) gboolean -psppire_case_file_delete_cases (PsppireCaseFile *cf, gint n_cases, gint first) +psppire_case_file_delete_cases (PsppireCaseFile *cf, casenumber n_cases, casenumber first) { g_return_val_if_fail (cf, FALSE); g_return_val_if_fail (cf->datasheet, FALSE); @@ -179,8 +179,8 @@ psppire_case_file_delete_cases (PsppireCaseFile *cf, gint n_cases, gint first) /* Insert case CC into the case file before POSN */ gboolean psppire_case_file_insert_case (PsppireCaseFile *cf, - struct ccase *cc, - gint posn) + struct ccase *cc, + casenumber posn) { struct ccase tmp; bool result ; @@ -194,7 +194,7 @@ psppire_case_file_insert_case (PsppireCaseFile *cf, if ( result ) g_signal_emit (cf, signals [CASE_INSERTED], 0, posn); else - g_warning ("Cannot insert case at position %d\n", posn); + g_warning ("Cannot insert case at position %ld\n", posn); return result; } @@ -277,7 +277,7 @@ psppire_case_file_clear (PsppireCaseFile *cf) /* Set the IDXth value of case C to V. Returns true if successful, false on I/O error. */ gboolean -psppire_case_file_set_value (PsppireCaseFile *cf, gint casenum, gint idx, +psppire_case_file_set_value (PsppireCaseFile *cf, casenumber casenum, gint idx, union value *v, gint width) { bool ok; @@ -297,7 +297,7 @@ psppire_case_file_set_value (PsppireCaseFile *cf, gint casenum, gint idx, /* Set the IDXth value of case C using D_IN */ gboolean -psppire_case_file_data_in (PsppireCaseFile *cf, gint casenum, gint idx, +psppire_case_file_data_in (PsppireCaseFile *cf, casenumber casenum, gint idx, struct substring input, const struct fmt_spec *fmt) { union value *value; @@ -364,7 +364,7 @@ psppire_case_file_insert_values (PsppireCaseFile *cf, Returns true on success, false otherwise. */ gboolean -psppire_case_file_get_case (const PsppireCaseFile *cf, gint casenum, +psppire_case_file_get_case (const PsppireCaseFile *cf, casenumber casenum, struct ccase *c) { g_return_val_if_fail (cf, FALSE); diff --git a/src/ui/gui/psppire-case-file.h b/src/ui/gui/psppire-case-file.h index e11a4db4..7ef3daa2 100644 --- a/src/ui/gui/psppire-case-file.h +++ b/src/ui/gui/psppire-case-file.h @@ -69,7 +69,7 @@ GType psppire_case_file_get_type (void); PsppireCaseFile *psppire_case_file_new (const struct casereader *); -gboolean psppire_case_file_insert_case (PsppireCaseFile *cf, struct ccase *c, gint row); +gboolean psppire_case_file_insert_case (PsppireCaseFile *cf, struct ccase *c, casenumber row); casenumber psppire_case_file_get_case_count (const PsppireCaseFile *cf); @@ -80,18 +80,18 @@ union value * psppire_case_file_get_value (const PsppireCaseFile *cf, struct fmt_spec; -gboolean psppire_case_file_data_in (PsppireCaseFile *cf, gint c, gint idx, +gboolean psppire_case_file_data_in (PsppireCaseFile *cf, casenumber c, gint idx, struct substring input, const struct fmt_spec *); -gboolean psppire_case_file_set_value (PsppireCaseFile *cf, gint casenum, +gboolean psppire_case_file_set_value (PsppireCaseFile *cf, casenumber casenum, gint idx, union value *v, gint width); void psppire_case_file_clear (PsppireCaseFile *cf); -gboolean psppire_case_file_delete_cases (PsppireCaseFile *cf, gint n_rows, - gint first); +gboolean psppire_case_file_delete_cases (PsppireCaseFile *cf, casenumber n_rows, + casenumber first); gboolean psppire_case_file_insert_values (PsppireCaseFile *cf, gint n_values, gint before); @@ -99,8 +99,9 @@ struct case_ordering; void psppire_case_file_sort (PsppireCaseFile *cf, struct case_ordering *); -gboolean psppire_case_file_get_case (const PsppireCaseFile *cf, gint casenum, - struct ccase *c); +gboolean psppire_case_file_get_case (const PsppireCaseFile *cf, + casenumber casenum, + struct ccase *c); struct casereader * psppire_case_file_make_reader (PsppireCaseFile *cf); diff --git a/src/ui/gui/psppire-data-store.c b/src/ui/gui/psppire-data-store.c index 22bc10ee..61fee9bc 100644 --- a/src/ui/gui/psppire-data-store.c +++ b/src/ui/gui/psppire-data-store.c @@ -50,7 +50,7 @@ static void psppire_data_store_sheet_row_init (GSheetRowIface *iface); static void psppire_data_store_finalize (GObject *object); static gboolean psppire_data_store_clear_datum (GSheetModel *model, - gint row, gint column); + glong row, glong column); #define MIN_COLUMNS 10 @@ -151,7 +151,7 @@ psppire_data_store_class_init (PsppireDataStoreClass *class) -static gint +static glong psppire_data_store_get_var_count (const GSheetModel *model) { const PsppireDataStore *store = PSPPIRE_DATA_STORE (model); @@ -165,7 +165,7 @@ psppire_data_store_get_case_count (PsppireDataStore *store) return psppire_case_file_get_case_count (store->case_file); } -static gint +static glong psppire_data_store_get_case_count_from_model (const GSheetModel *model) { const PsppireDataStore *store = PSPPIRE_DATA_STORE (model); @@ -173,9 +173,6 @@ psppire_data_store_get_case_count_from_model (const GSheetModel *model) return psppire_case_file_get_case_count (store->case_file); } - - - static void psppire_data_store_init (PsppireDataStore *data_store) { @@ -186,7 +183,7 @@ psppire_data_store_init (PsppireDataStore *data_store) const PangoFontDescription * psppire_data_store_get_font_desc (const GSheetModel *model, - gint row, gint column) + glong row, glong column) { PsppireDataStore *store = PSPPIRE_DATA_STORE (model); @@ -194,8 +191,8 @@ psppire_data_store_get_font_desc (const GSheetModel *model, } static inline gchar * -psppire_data_store_get_string_wrapper (const GSheetModel *model, gint row, - gint column) +psppire_data_store_get_string_wrapper (const GSheetModel *model, glong row, + glong column) { return psppire_data_store_get_string (PSPPIRE_DATA_STORE (model), row, column); } @@ -204,7 +201,7 @@ psppire_data_store_get_string_wrapper (const GSheetModel *model, gint row, static inline gboolean psppire_data_store_set_string_wrapper (GSheetModel *model, const gchar *text, - gint row, gint column) + glong row, glong column) { return psppire_data_store_set_string (PSPPIRE_DATA_STORE (model), text, row, column); @@ -238,7 +235,8 @@ gboolean always_true () static void -delete_cases_callback (GtkWidget *w, gint first, gint n_cases, gpointer data) +delete_cases_callback (GtkWidget *w, + casenumber first, casenumber n_cases, gpointer data) { PsppireDataStore *store ; @@ -253,7 +251,7 @@ delete_cases_callback (GtkWidget *w, gint first, gint n_cases, gpointer data) static void -insert_case_callback (GtkWidget *w, gint casenum, gpointer data) +insert_case_callback (GtkWidget *w, casenumber casenum, gpointer data) { PsppireDataStore *store ; @@ -461,7 +459,7 @@ psppire_data_store_finalize (GObject *object) /* Insert a blank case before POSN */ gboolean -psppire_data_store_insert_new_case (PsppireDataStore *ds, gint posn) +psppire_data_store_insert_new_case (PsppireDataStore *ds, casenumber posn) { gboolean result; gint val_cnt, v; @@ -494,7 +492,7 @@ psppire_data_store_insert_new_case (PsppireDataStore *ds, gint posn) gchar * -psppire_data_store_get_string (PsppireDataStore *store, gint row, gint column) +psppire_data_store_get_string (PsppireDataStore *store, glong row, glong column) { gint idx; char *text; @@ -561,8 +559,7 @@ psppire_data_store_get_string (PsppireDataStore *store, gint row, gint column) static gboolean psppire_data_store_clear_datum (GSheetModel *model, - gint row, gint col) - + glong row, glong col) { PsppireDataStore *store = PSPPIRE_DATA_STORE (model); @@ -589,7 +586,7 @@ psppire_data_store_clear_datum (GSheetModel *model, */ gboolean psppire_data_store_set_string (PsppireDataStore *store, - const gchar *text, gint row, gint col) + const gchar *text, glong row, glong col) { const struct variable *pv = psppire_dict_get_variable (store->dict, col); g_return_val_if_fail (pv, FALSE); @@ -674,7 +671,7 @@ psppire_data_store_get_reader (PsppireDataStore *ds) /* Column related funcs */ -static gint +static glong geometry_get_column_count (const GSheetColumn *geom) { PsppireDataStore *ds = PSPPIRE_DATA_STORE (geom); @@ -685,7 +682,7 @@ geometry_get_column_count (const GSheetColumn *geom) static gint -geometry_get_width (const GSheetColumn *geom, gint unit) +geometry_get_width (const GSheetColumn *geom, glong unit) { const struct variable *pv ; PsppireDataStore *ds = PSPPIRE_DATA_STORE (geom); @@ -702,7 +699,7 @@ geometry_get_width (const GSheetColumn *geom, gint unit) } static void -geometry_set_width (GSheetColumn *geom, gint unit, gint width) +geometry_set_width (GSheetColumn *geom, glong unit, gint width) { PsppireDataStore *ds = PSPPIRE_DATA_STORE (geom); @@ -714,7 +711,7 @@ geometry_set_width (GSheetColumn *geom, gint unit, gint width) static GtkJustification -geometry_get_justification (const GSheetColumn *geom, gint unit) +geometry_get_justification (const GSheetColumn *geom, glong unit) { PsppireDataStore *ds = PSPPIRE_DATA_STORE (geom); const struct variable *pv ; @@ -734,7 +731,7 @@ geometry_get_justification (const GSheetColumn *geom, gint unit) static const gchar null_var_name[]=N_("var"); static gchar * -geometry_get_column_button_label (const GSheetColumn *geom, gint unit) +geometry_get_column_button_label (const GSheetColumn *geom, glong unit) { gchar *text; struct variable *pv ; @@ -752,7 +749,7 @@ geometry_get_column_button_label (const GSheetColumn *geom, gint unit) static gchar * -geometry_get_column_subtitle (const GSheetColumn *geom, gint unit) +geometry_get_column_subtitle (const GSheetColumn *geom, glong unit) { gchar *text; const struct variable *v ; @@ -773,7 +770,7 @@ geometry_get_column_subtitle (const GSheetColumn *geom, gint unit) static gboolean -geometry_get_sensitivity (const GSheetColumn *geom, gint unit) +geometry_get_sensitivity (const GSheetColumn *geom, glong unit) { PsppireDataStore *ds = PSPPIRE_DATA_STORE (geom); @@ -797,7 +794,7 @@ psppire_data_store_sheet_column_init (GSheetColumnIface *iface) /* Row related funcs */ -static gint +static glong geometry_get_row_count (const GSheetRow *geom, gpointer data) { PsppireDataStore *ds = PSPPIRE_DATA_STORE (geom); @@ -807,14 +804,14 @@ geometry_get_row_count (const GSheetRow *geom, gpointer data) static gint -geometry_get_height (const GSheetRow *geom, gint unit, gpointer data) +geometry_get_height (const GSheetRow *geom, glong unit, gpointer data) { return 25; } static gboolean -geometry_get_row_sensitivity (const GSheetRow *geom, gint unit, gpointer data) +geometry_get_row_sensitivity (const GSheetRow *geom, glong unit, gpointer data) { PsppireDataStore *ds = PSPPIRE_DATA_STORE (geom); @@ -824,7 +821,7 @@ geometry_get_row_sensitivity (const GSheetRow *geom, gint unit, gpointer data) static gchar * -geometry_get_row_button_label (const GSheetRow *geom, gint unit, gpointer data) +geometry_get_row_button_label (const GSheetRow *geom, glong unit, gpointer data) { gchar *text; gchar *s; @@ -834,7 +831,7 @@ geometry_get_row_button_label (const GSheetRow *geom, gint unit, gpointer data) TRAILING_ROWS + psppire_case_file_get_case_count (ds->case_file)) return 0; - s = g_strdup_printf (_("%d"), unit + FIRST_CASE_NUMBER); + s = g_strdup_printf (_("%ld"), unit + FIRST_CASE_NUMBER); text = pspp_locale_to_utf8 (s, -1, 0); @@ -856,6 +853,3 @@ psppire_data_store_sheet_row_init (GSheetRowIface *iface) iface->get_button_label = geometry_get_row_button_label; } - - - diff --git a/src/ui/gui/psppire-data-store.h b/src/ui/gui/psppire-data-store.h index 9857a7b1..d305ad84 100644 --- a/src/ui/gui/psppire-data-store.h +++ b/src/ui/gui/psppire-data-store.h @@ -97,16 +97,16 @@ void psppire_data_store_show_labels (PsppireDataStore *store, void psppire_data_store_clear (PsppireDataStore *data_store); -gboolean psppire_data_store_insert_new_case (PsppireDataStore *ds, gint posn); +gboolean psppire_data_store_insert_new_case (PsppireDataStore *ds, casenumber posn); struct casereader * psppire_data_store_get_reader (PsppireDataStore *ds); gchar * psppire_data_store_get_string (PsppireDataStore *ds, - gint row, gint column); + casenumber row, glong column); gboolean psppire_data_store_set_string (PsppireDataStore *ds, const gchar *text, - gint row, gint column); + glong row, glong column); casenumber psppire_data_store_get_case_count (PsppireDataStore *store); diff --git a/src/ui/gui/psppire-dialog.c b/src/ui/gui/psppire-dialog.c index b7255521..d961c7dc 100644 --- a/src/ui/gui/psppire-dialog.c +++ b/src/ui/gui/psppire-dialog.c @@ -242,6 +242,9 @@ psppire_dialog_init (PsppireDialog *dialog) G_CALLBACK (delete_event_callback), dialog); + gtk_window_set_type_hint (GTK_WINDOW (dialog), + GDK_WINDOW_TYPE_HINT_DIALOG); + gtk_widget_show_all (dialog->box); } diff --git a/src/ui/gui/psppire-var-store.c b/src/ui/gui/psppire-var-store.c index 8cbba37d..3ba2da2a 100644 --- a/src/ui/gui/psppire-var-store.c +++ b/src/ui/gui/psppire-var-store.c @@ -52,15 +52,15 @@ static void psppire_var_store_finalize (GObject *object gchar * missing_values_to_string (const struct variable *pv, GError **err); -static gchar *psppire_var_store_get_string (const GSheetModel *sheet_model, gint row, gint column); +static gchar *psppire_var_store_get_string (const GSheetModel *sheet_model, glong row, glong column); -static gboolean psppire_var_store_clear (GSheetModel *model, gint row, gint col); +static gboolean psppire_var_store_clear (GSheetModel *model, glong row, glong col); static gboolean psppire_var_store_set_string (GSheetModel *model, - const gchar *text, gint row, gint column); + const gchar *text, glong row, glong column); -static gint psppire_var_store_get_row_count (const GSheetModel * model); +static glong psppire_var_store_get_row_count (const GSheetModel * model); static gchar *text_for_column (const struct variable *pv, gint c, GError **err); @@ -146,7 +146,7 @@ psppire_var_store_init (PsppireVarStore *var_store) } static gboolean -psppire_var_store_item_editable (PsppireVarStore *var_store, gint row, gint column) +psppire_var_store_item_editable (PsppireVarStore *var_store, glong row, glong column) { const struct fmt_spec *write_spec ; @@ -187,13 +187,13 @@ psppire_var_store_item_editable (PsppireVarStore *var_store, gint row, gint colu struct variable * -psppire_var_store_get_var (PsppireVarStore *store, gint row) +psppire_var_store_get_var (PsppireVarStore *store, glong row) { return psppire_dict_get_variable (store->dict, row); } static gboolean -psppire_var_store_is_editable (const GSheetModel *model, gint row, gint column) +psppire_var_store_is_editable (const GSheetModel *model, glong row, glong column) { PsppireVarStore *store = PSPPIRE_VAR_STORE (model); return psppire_var_store_item_editable (store, row, column); @@ -201,7 +201,7 @@ psppire_var_store_is_editable (const GSheetModel *model, gint row, gint column) static const GdkColor * -psppire_var_store_get_foreground (const GSheetModel *model, gint row, gint column) +psppire_var_store_get_foreground (const GSheetModel *model, glong row, glong column) { PsppireVarStore *store = PSPPIRE_VAR_STORE (model); @@ -214,7 +214,7 @@ psppire_var_store_get_foreground (const GSheetModel *model, gint row, gint colum const PangoFontDescription * psppire_var_store_get_font_desc (const GSheetModel *model, - gint row, gint column) + glong row, glong column) { PsppireVarStore *store = PSPPIRE_VAR_STORE (model); @@ -281,7 +281,7 @@ var_delete_callback (GtkWidget *w, gint first, gint n, gpointer data) static void -var_insert_callback (GtkWidget *w, gint row, gpointer data) +var_insert_callback (GtkWidget *w, glong row, gpointer data) { GSheetModel *model = G_SHEET_MODEL (data); @@ -327,7 +327,7 @@ psppire_var_store_finalize (GObject *object) } static gchar * -psppire_var_store_get_string (const GSheetModel *model, gint row, gint column) +psppire_var_store_get_string (const GSheetModel *model, glong row, glong column) { PsppireVarStore *store = PSPPIRE_VAR_STORE (model); @@ -347,7 +347,7 @@ psppire_var_store_get_string (const GSheetModel *model, gint row, gint column) Returns true if anything was updated, false otherwise. */ static gboolean -psppire_var_store_clear (GSheetModel *model, gint row, gint col) +psppire_var_store_clear (GSheetModel *model, glong row, glong col) { struct variable *pv ; @@ -378,7 +378,7 @@ psppire_var_store_clear (GSheetModel *model, gint row, gint col) */ static gboolean psppire_var_store_set_string (GSheetModel *model, - const gchar *text, gint row, gint col) + const gchar *text, glong row, glong col) { struct variable *pv ; @@ -652,7 +652,7 @@ psppire_var_store_set_font (PsppireVarStore *store, const PangoFontDescription * } -static gint +static glong psppire_var_store_get_row_count (const GSheetModel * model) { gint rows = 0; @@ -666,7 +666,7 @@ psppire_var_store_get_row_count (const GSheetModel * model) /* Row related funcs */ -static gint +static glong geometry_get_row_count (const GSheetRow *geom, gpointer data) { gint rows = 0; @@ -680,14 +680,14 @@ geometry_get_row_count (const GSheetRow *geom, gpointer data) static gint -geometry_get_height (const GSheetRow *geom, gint row, gpointer data) +geometry_get_height (const GSheetRow *geom, glong row, gpointer data) { return 25; } static gboolean -geometry_is_sensitive (const GSheetRow *geom, gint row, gpointer data) +geometry_is_sensitive (const GSheetRow *geom, glong row, gpointer data) { PsppireVarStore *vs = PSPPIRE_VAR_STORE (geom); @@ -705,14 +705,13 @@ gboolean always_true () static gchar * -geometry_get_button_label (const GSheetRow *geom, gint unit, gpointer data) +geometry_get_button_label (const GSheetRow *geom, glong unit, gpointer data) { - gchar *label = g_strdup_printf (_("%d"), unit); + gchar *label = g_strdup_printf (_("%ld"), unit); return label; } - static void psppire_var_store_sheet_row_init (GSheetRowIface *iface) { diff --git a/src/ui/gui/psppire-var-store.h b/src/ui/gui/psppire-var-store.h index 31543225..ff81dd90 100644 --- a/src/ui/gui/psppire-var-store.h +++ b/src/ui/gui/psppire-var-store.h @@ -69,7 +69,7 @@ struct _PsppireVarStoreClass GType psppire_var_store_get_type (void) G_GNUC_CONST; PsppireVarStore *psppire_var_store_new (PsppireDict *dict); -struct variable * psppire_var_store_get_var (PsppireVarStore *store, gint row); +struct variable * psppire_var_store_get_var (PsppireVarStore *store, glong row); void psppire_var_store_set_dictionary (PsppireVarStore *var_store, PsppireDict *dict);