PsppireDataStore (myreversefunc): Insert variables if attempting to access variable...
[pspp] / src / ui / gui / psppire-acr.h
index 9983a9efb55aed0fd6c22ca6b2f8d7023f6c681f..73873df356ef2502dcfbdd07481d0b1609fa9a71 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
   |+------------+  +----------+        |
   +-----------------------------+
 
-  It interacts with a GtkEntry, which  allows items to be added to its internal list.
+  It interacts with an external widget, such as a GtkEntry.
+  It maintains a list of items controlled by the three buttons.
   This implementation deals only with g_double values.
  */
 
 
 #include <glib.h>
 #include <glib-object.h>
-#include <gtk/gtkhbox.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtktreeselection.h>
+#include <gtk/gtk.h>
 
 
 G_BEGIN_DECLS
@@ -59,34 +58,56 @@ G_BEGIN_DECLS
 typedef struct _PsppireAcr       PsppireAcr;
 typedef struct _PsppireAcrClass  PsppireAcrClass;
 
-/* All members are private. */
+typedef gboolean (*GetValueFunc) (gint, GValue *, gpointer);
+typedef gboolean (*EnabledFunc) (gpointer);
+typedef void (*UpdateCallbackFunc) (gpointer);
+
 struct _PsppireAcr
 {
-  GtkHBox parent;
+  GtkBox parent;
+
 
-  /* <private> */
-  GtkEntry *entry;
   GtkListStore *list_store;
 
   GtkTreeView *tv;
   GtkTreeSelection *selection;
+
+  /* The buttons */
   GtkWidget *add_button;
   GtkWidget *change_button;
   GtkWidget *remove_button;
+
+  GetValueFunc get_value;
+  gpointer get_value_data;
+
+  EnabledFunc enabled;
+  gpointer enabled_data;
+
+  UpdateCallbackFunc update;
+  gpointer update_data;
 };
 
 
 struct _PsppireAcrClass
 {
-  GtkHBoxClass parent_class;
+  GtkBoxClass parent_class;
 };
 
 
-GType          psppire_acr_get_type        (void);
-GtkWidget*     psppire_acr_new             (void);
 
-void           psppire_acr_set_entry       (PsppireAcr *, GtkEntry *);
-void           psppire_acr_set_model       (PsppireAcr *, GtkListStore *);
+GType       psppire_acr_get_type        (void);
+GtkWidget*  psppire_acr_new             (void);
+
+void        psppire_acr_set_model       (PsppireAcr *, GtkListStore *);
+void        psppire_acr_set_get_value_func (PsppireAcr *, GetValueFunc,
+                                           gpointer);
+
+void        psppire_acr_set_enable_func (PsppireAcr *, EnabledFunc, gpointer);
+
+void        psppire_acr_set_enabled (PsppireAcr *, gboolean);
+void        psppire_acr_set_entry  (PsppireAcr *, GtkEntry *);
+
+
 
 G_END_DECLS