gui: Include only <gtk/gtk.h> to use GTK+.
[pspp-builds.git] / src / ui / gui / psppire-acr.h
index 9983a9efb55aed0fd6c22ca6b2f8d7023f6c681f..b58385524a6308001e3e9f2036631c222e8024b7 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,20 +58,33 @@ 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;
 
-  /* <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;
 };
 
 
@@ -82,11 +94,20 @@ struct _PsppireAcrClass
 };
 
 
-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