X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fgtksheet%2Fgsheet-hetero-column.c;h=8b9b9b9c3b1884e7e8dded596ed9d7f6174721a6;hb=e49bb94c97b852448da96c340802048011ee2ace;hp=575fdc8a3858c6ba080220166fe424052cb10e01;hpb=573068f2bdcd3f8796e9646668fed910a90f890b;p=pspp-builds.git diff --git a/lib/gtksheet/gsheet-hetero-column.c b/lib/gtksheet/gsheet-hetero-column.c index 575fdc8a..8b9b9b9c 100644 --- a/lib/gtksheet/gsheet-hetero-column.c +++ b/lib/gtksheet/gsheet-hetero-column.c @@ -1,7 +1,6 @@ /* gsheet-hetero-column.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 @@ -17,6 +16,8 @@ * 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-column-iface.h" #include "gsheet-hetero-column.h" #include @@ -116,8 +117,6 @@ g_sheet_hetero_column_get_width(const GSheetColumn *geom, gint i) static gint g_sheet_hetero_column_get_sensitivity(const GSheetColumn *geom, gint u) { - GSheetHeteroColumn *hg = G_SHEET_HETERO_COLUMN(geom); - return TRUE; } @@ -125,27 +124,23 @@ g_sheet_hetero_column_get_sensitivity(const GSheetColumn *geom, gint u) static gint g_sheet_hetero_column_get_visibility(const GSheetColumn *geom, gint u) { - GSheetHeteroColumn *hg = G_SHEET_HETERO_COLUMN(geom); - return TRUE; } -static const gchar * +static gchar * g_sheet_hetero_column_get_button_label(const GSheetColumn *geom, gint u) { GSheetHeteroColumn *hg = G_SHEET_HETERO_COLUMN(geom); - - return hg->col[u].button.label; + + 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) { - GSheetHeteroColumn *hg = G_SHEET_HETERO_COLUMN(geom); - return GTK_JUSTIFY_FILL; } @@ -190,12 +185,23 @@ g_sheet_hetero_column_finalize (GObject *object) g_free(hg->col); } +static void +hetero_column_set_width(GSheetColumn *geo, gint i, gint size) +{ + GSheetHeteroColumn *hg = G_SHEET_HETERO_COLUMN(geo); + + g_return_if_fail(i < hg->n_columns); + + hg->col[i].width = size; +} + + static void g_sheet_column_init (GSheetColumnIface *iface) { iface->get_width = g_sheet_hetero_column_get_width ; - iface->set_width = g_sheet_hetero_column_set_width ; + iface->set_width = hetero_column_set_width ; iface->get_sensitivity = g_sheet_hetero_column_get_sensitivity ; iface->get_visibility = g_sheet_hetero_column_get_visibility ; iface->get_justification = g_sheet_hetero_column_get_justification; @@ -219,13 +225,14 @@ g_sheet_hetero_column_set_button_label(GSheetHeteroColumn *geo, -void -g_sheet_hetero_column_set_width(GSheetHeteroColumn *geo, - gint i, gint size) + +inline void +g_sheet_hetero_column_set_width(GSheetHeteroColumn *geo, gint i, gint size) { - g_return_if_fail(i < geo->n_columns); + GSheetColumn *iface = G_SHEET_COLUMN(geo); - geo->col[i].width = size; + hetero_column_set_width(iface, i, size); } +