X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-acr.h;h=c38f3f5f3a64d0e479d8361bf93953037031c47f;hb=53241f59ac766997bf67870639f70afb82396640;hp=9983a9efb55aed0fd6c22ca6b2f8d7023f6c681f;hpb=7751519f5ca0b6106fe3d611010a70804677ab86;p=pspp diff --git a/src/ui/gui/psppire-acr.h b/src/ui/gui/psppire-acr.h index 9983a9efb5..c38f3f5f3a 100644 --- a/src/ui/gui/psppire-acr.h +++ b/src/ui/gui/psppire-acr.h @@ -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 @@ -35,16 +35,15 @@ |+------------+ +----------+ | +-----------------------------+ - 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 #include -#include -#include -#include +#include 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; - /* */ - GtkEntry *entry; + gboolean dispose_has_run; 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