2 A candidate replacement for Pspp's sheet
3 Copyright (C) 2016 John Darrington
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "psppire-var-sheet-header.h"
24 #include "efficient-sheet/jmd-axis-model.h"
25 #include "efficient-sheet/jmd-datum.h"
30 static guint signals [n_SIGNALS];
33 gni (GListModel *list)
39 git (GListModel *list)
41 return JMD_TYPE_DATUM;
45 gi (GListModel *list, guint position)
47 JmdDatum *gd = JMD_DATUM (g_object_new (JMD_TYPE_DATUM, NULL));
52 gd->text = g_strdup ("Name");
55 gd->text = g_strdup ("Type");
58 gd->text = g_strdup ("Width");
61 gd->text = g_strdup ("Decimal");
64 gd->text = g_strdup ("Label");
67 gd->text = g_strdup ("Value Labels");
70 gd->text = g_strdup ("Missing Values");
73 gd->text = g_strdup ("Columns");
76 gd->text = g_strdup ("Align");
79 gd->text = g_strdup ("Measure");
82 gd->text = g_strdup ("Role");
85 // g_assert_not_reached ();
86 g_print ("Bug: Request for item %d\n", position);
95 psppire_init_iface (GListModelInterface *iface)
97 iface->get_n_items = gni;
99 iface->get_item_type = git;
103 G_DEFINE_TYPE_WITH_CODE (PsppireVarSheetHeader, psppire_var_sheet_header,
105 G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, psppire_init_iface));
108 psppire_var_sheet_header_init (PsppireVarSheetHeader *d)
115 psppire_var_sheet_header_class_init (PsppireVarSheetHeaderClass *dc)
117 GObjectClass *object_class = G_OBJECT_CLASS (dc);
119 /* This signal is never emitted. It is just to satisfy the interface. */
121 g_signal_new ("changed",
122 G_TYPE_FROM_CLASS (object_class),
126 g_cclosure_marshal_VOID__VOID,