1 /* PSPPIRE - a graphical user interface for PSPP.
2 Copyright (C) 2007, 2010 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 #ifndef __PSPPIRE_ACR_H__
19 #define __PSPPIRE_ACR_H__
22 This widget is a GtkBox which looks roughly like:
24 +-----------------------------+
25 |+------------+ +----------+ |
35 |+------------+ +----------+ |
36 +-----------------------------+
38 It interacts with an external widget, such as a GtkEntry.
39 It maintains a list of items controlled by the three buttons.
40 This implementation deals only with g_double values.
45 #include <glib-object.h>
51 #define PSPPIRE_ACR_TYPE (psppire_acr_get_type ())
52 #define PSPPIRE_ACR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PSPPIRE_ACR_TYPE, PsppireAcr))
53 #define PSPPIRE_ACR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PSPPIRE_ACR_TYPE, PsppireAcrClass))
54 #define PSPPIRE_IS_ACR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_ACR_TYPE))
55 #define PSPPIRE_IS_ACR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PSPPIRE_ACR_TYPE))
58 typedef struct _PsppireAcr PsppireAcr;
59 typedef struct _PsppireAcrClass PsppireAcrClass;
61 typedef gboolean (*GetValueFunc) (gint, GValue *, gpointer);
62 typedef gboolean (*EnabledFunc) (gpointer);
63 typedef void (*UpdateCallbackFunc) (gpointer);
70 GtkListStore *list_store;
73 GtkTreeSelection *selection;
76 GtkWidget *add_button;
77 GtkWidget *change_button;
78 GtkWidget *remove_button;
80 GetValueFunc get_value;
81 gpointer get_value_data;
84 gpointer enabled_data;
86 UpdateCallbackFunc update;
91 struct _PsppireAcrClass
93 GtkHBoxClass parent_class;
98 GType psppire_acr_get_type (void);
99 GtkWidget* psppire_acr_new (void);
101 void psppire_acr_set_model (PsppireAcr *, GtkListStore *);
102 void psppire_acr_set_get_value_func (PsppireAcr *, GetValueFunc,
105 void psppire_acr_set_enable_func (PsppireAcr *, EnabledFunc, gpointer);
107 void psppire_acr_set_enabled (PsppireAcr *, gboolean);
108 void psppire_acr_set_entry (PsppireAcr *, GtkEntry *);
114 #endif /* __PSPPIRE_ACR_H__ */