Replace gsheet-column interface by psppire-axis
[pspp-builds.git] / lib / gtksheet / gsheetmodel.c
index 0d1a3f560a60c8edee89d9e7f8d0ff0553aa660a..7e9752379c8c11f2b615008a32f5e2538f509d41 100644 (file)
@@ -377,9 +377,9 @@ g_sheet_model_is_visible (const GSheetModel *model,
  * @column: The column
  *
  * Returns the foreground colour of the cell at @row, @column
- * Returns: the foreground colour, or NULL on error.
+ * The color is unallocated.  It will be allocated by the viewing object.
  **/
-const GdkColor *
+GdkColor *
 g_sheet_model_get_foreground (const GSheetModel *model,
                                glong row, glong column)
 {
@@ -399,9 +399,9 @@ g_sheet_model_get_foreground (const GSheetModel *model,
  * @column: The column
  *
  * Returns the background colour of the cell at @row, @column
- * Returns: the background colour, or NULL on error.
+ * The color is unallocated.  It will be allocated by the viewing object.
  **/
-const GdkColor *
+GdkColor *
 g_sheet_model_get_background (const GSheetModel *model,
                                glong row, glong column)
 {
@@ -508,3 +508,54 @@ g_sheet_model_get_row_count(const GSheetModel *model)
 
   return G_SHEET_MODEL_GET_IFACE (model)->get_row_count (model);
 }
+
+\f
+
+/* New functions since AXIS_TRANSITION */
+gboolean
+g_sheet_model_get_column_sensitivity (const GSheetModel *model, gint col)
+{
+  if ( NULL == G_SHEET_MODEL_GET_IFACE (model)->get_column_sensitivity)
+    return TRUE;
+
+  return G_SHEET_MODEL_GET_IFACE (model)->get_column_sensitivity (model, col);
+}
+
+
+gchar *
+g_sheet_model_get_column_subtitle (const GSheetModel *model,
+                                  gint col)
+{
+  g_return_val_if_fail (G_IS_SHEET_MODEL (model), NULL);
+
+  if ( NULL == G_SHEET_MODEL_GET_IFACE (model)->get_column_subtitle)
+    return NULL;
+
+  return G_SHEET_MODEL_GET_IFACE (model)->get_column_subtitle (model, col);
+}
+
+
+GtkSheetButton *
+g_sheet_model_get_column_button (const GSheetModel *model,
+                                gint col)
+{
+  GtkSheetButton *button = gtk_sheet_button_new ();
+
+  g_return_val_if_fail (G_IS_SHEET_MODEL (model), NULL);
+
+  if ( G_SHEET_MODEL_GET_IFACE (model)->get_column_title)
+    button->label = G_SHEET_MODEL_GET_IFACE (model)->get_column_title (model, col);
+
+  return button;
+}
+
+GtkJustification
+g_sheet_model_get_column_justification (const GSheetModel *model,
+                                       gint col)
+{
+  if ( G_SHEET_MODEL_GET_IFACE (model)->get_column_justification)
+    return G_SHEET_MODEL_GET_IFACE (model)->get_column_justification (model, col);
+
+  return GTK_JUSTIFY_LEFT;
+}
+