Files | |
| file | duifield-gtk.h |
| : Implement the gtk-specific fields. | |
Modules | |
| SQL type fields. | |
| Field Iterator support | |
| Mapping Fields | |
| Gtk Fields. | |
Data Structures | |
| struct | DuiField_s |
| void | dui_field_set_widget (DuiField *fs, const char *widname, int colnum) |
| void | dui_field_set_wid_where (DuiField *fs, const char *widname, int colnum, const char *compareop) |
| void | dui_field_set_wid_data (DuiField *fs, const char *widname, int colnum, const char *datakey) |
| void | dui_field_set_wid_arg (DuiField *fs, const char *widname, int colnum, const char *arg) |
| void | dui_field_resolve_widget (DuiField *, gpointer) |
Defines | |
| #define | DUI_FIELD_NONE "DUI_FIELD_NONE" |
| #define | DUI_FIELD_CONST "DUI_FIELD_CONST" |
| #define | DUI_FIELD_WIDGET "DUI_FIELD_WIDGET" |
| #define | DUI_FIELD_WID_DATA "DUI_FIELD_WID_DATA" |
| #define | DUI_FIELD_WID_ARG "DUI_FIELD_WID_ARG" |
| #define | DUI_FIELD_WID_WHERE "DUI_FIELD_WID_WHERE" |
| #define | DUI_FIELD_HASH_KEY "DUI_FIELD_HASH_KEY" |
| #define | DUI_FIELD_SQL "DUI_FIELD_SQL" |
| #define | DUI_FIELD_WHERE "DUI_FIELD_WHERE" |
| #define | DUI_FIELD_GOBJ "DUI_FIELD_GOBJ" |
| #define | DUI_FIELD_QOF "DUI_FIELD_QOF" |
| #define | DUI_FIELD_QOF_MATCH "DUI_FIELD_QOF_MATCH" |
| #define | DUI_FIELD_IS_TYPE(fld, typ) (0==strcmp((fld)->type,typ)) |
Typedefs | |
| typedef struct DuiField_s | DuiField |
| typedef const char * | DuiFieldType |
Functions | |
| const char * | dui_field_get_fieldname (DuiField *fs) |
| void | dui_field_clear (DuiField *s) |
| void | dui_field_set_const (DuiField *fs, const char *value) |
| #define DUI_FIELD_CONST "DUI_FIELD_CONST" |
Field with const value
Definition at line 46 of file duifield.h.
| #define DUI_FIELD_GOBJ "DUI_FIELD_GOBJ" |
glib-2.0 gobject
Definition at line 54 of file duifield.h.
| #define DUI_FIELD_HASH_KEY "DUI_FIELD_HASH_KEY" |
Global hash table key
Definition at line 51 of file duifield.h.
| #define DUI_FIELD_QOF "DUI_FIELD_QOF" |
QOF Object
Definition at line 55 of file duifield.h.
| #define DUI_FIELD_QOF_MATCH "DUI_FIELD_QOF_MATCH" |
Match to a particular QOF Instance
Definition at line 56 of file duifield.h.
| #define DUI_FIELD_SQL "DUI_FIELD_SQL" |
Database table column
Definition at line 52 of file duifield.h.
| #define DUI_FIELD_WHERE "DUI_FIELD_WHERE" |
match to database column
Definition at line 53 of file duifield.h.
| #define DUI_FIELD_WID_ARG "DUI_FIELD_WID_ARG" |
Value from gtk-1.2 widget GtkArg
Definition at line 49 of file duifield.h.
| #define DUI_FIELD_WID_DATA "DUI_FIELD_WID_DATA" |
Value from gtk-1.2 widget data
Definition at line 48 of file duifield.h.
| #define DUI_FIELD_WID_WHERE "DUI_FIELD_WID_WHERE" |
Match to a particular gtk widget
Definition at line 50 of file duifield.h.
| #define DUI_FIELD_WIDGET "DUI_FIELD_WIDGET" |
Value in gtk widget itself
Definition at line 47 of file duifield.h.
| void dui_field_clear | ( | DuiField * | s | ) |
Erase the value stored in teh field.
Definition at line 43 of file duifield.c.
00044 { 00045 if (DUI_FIELD_IS_TYPE(f,DUI_FIELD_NONE)) return; 00046 if (f->clear_field) { f->clear_field (f); } 00047 f->clear_field = NULL; 00048 f->type = DUI_FIELD_NONE; 00049 }
| const char* dui_field_get_fieldname | ( | DuiField * | fs | ) |
| void dui_field_resolve_widget | ( | DuiField * | , | |
| gpointer | ||||
| ) |
Convert named widget into actual pointer to widget
Definition at line 1224 of file duifield-gtk.c.
01225 { 01226 GtkWidget *w; 01227 const char * widgetname; 01228 DuiWindow *win = ud; 01229 01230 if (!DUI_FIELD_IS_TYPE (fld, DUI_FIELD_WIDGET) && 01231 !DUI_FIELD_IS_TYPE (fld, DUI_FIELD_WID_DATA) && 01232 !DUI_FIELD_IS_TYPE (fld, DUI_FIELD_WID_ARG) && 01233 !DUI_FIELD_IS_TYPE (fld, DUI_FIELD_WID_WHERE) ) return; 01234 01235 widgetname = fld->fieldname; 01236 if (!widgetname) return; 01237 if (0 == widgetname[0]) return; 01238 01239 w = dui_window_get_widget (win, widgetname); 01240 PINFO ("%s:\"%s\" is at %p", fld->type,widgetname, w); 01241 resolve_widget (fld, w); 01242 add_watcher (fld, w); 01243 add_sorter (fld, w); 01244 }
| void dui_field_set_const | ( | DuiField * | fs, | |
| const char * | value | |||
| ) |
data will be a constant unchanging value
| void dui_field_set_wid_arg | ( | DuiField * | fs, | |
| const char * | widname, | |||
| int | colnum, | |||
| const char * | arg | |||
| ) |
Data is linked to a GTK-1.2 GtkArg on the indicated widget (or widget column if this is a columned widget).
Definition at line 989 of file duifield-gtk.c.
00992 { 00993 struct gtk_widarg_s *gw; 00994 00995 if (!fs || !DUI_FIELD_IS_TYPE(fs,DUI_FIELD_NONE)) return; 00996 fs->type = DUI_FIELD_WID_ARG; 00997 fs->fieldname = g_strdup (widname), 00998 00999 fs->get_field_value = NULL; 01000 // fs->set_field_value = widget_set_arg; XXX currently broken 01001 fs->set_field_value = NULL; 01002 fs->clear_field = widarg_field_clear; 01003 01004 fs->iter_pre = NULL; 01005 fs->iter_next = NULL; 01006 fs->iter_column = resolve_target; 01007 fs->iter_post = NULL; 01008 01009 gw = (struct gtk_widarg_s *)get_gobj_field(fs); 01010 gw->widget = NULL, 01011 gw->column = colnum; 01012 gw->arg = g_strdup (arg); 01013 }
| void dui_field_set_wid_data | ( | DuiField * | fs, | |
| const char * | widname, | |||
| int | colnum, | |||
| const char * | datakey | |||
| ) |
Data is linked to a private hash table stored with the widget. The 'key' identifies the hash table entry. If this is a columned widget, there will be a distinct hash table for each column.
Definition at line 961 of file duifield-gtk.c.
00964 { 00965 struct gtk_widata_s *gw; 00966 00967 if (!fs || !DUI_FIELD_IS_TYPE(fs,DUI_FIELD_NONE)) return; 00968 fs->type = DUI_FIELD_WID_DATA; 00969 fs->fieldname = g_strdup (widname), 00970 00971 fs->get_field_value = widget_get_data; 00972 fs->set_field_value = widget_set_data; 00973 fs->clear_field = widata_field_clear; 00974 00975 fs->iter_pre = NULL; 00976 fs->iter_next = NULL; 00977 fs->iter_column = resolve_target; 00978 fs->iter_post = NULL; 00979 00980 gw = (struct gtk_widata_s *)get_gobj_field(fs); 00981 gw->widget = NULL, 00982 gw->column = colnum; 00983 gw->row = -1; 00984 gw->ctn = NULL; 00985 gw->datakey = g_strdup (datakey); 00986 }
| void dui_field_set_wid_where | ( | DuiField * | fs, | |
| const char * | widname, | |||
| int | colnum, | |||
| const char * | compareop | |||
| ) |
Data is linked to the contents of a GTK widget. If its a columned widget, the column number identifies which column to work with. This widget will be matched as to value, serving as the 'where' clause in an sql query. That is, 'change value X where/when Y .compareop. Z'
Definition at line 1016 of file duifield-gtk.c.
01018 { 01019 struct gtk_widwhere_s *gw; 01020 01021 if (!fs || !DUI_FIELD_IS_TYPE(fs,DUI_FIELD_NONE)) return; 01022 fs->type = DUI_FIELD_WID_WHERE; 01023 fs->fieldname = g_strdup (widname); 01024 01025 fs->get_field_value = NULL; 01026 fs->set_field_value = set_match_value; 01027 fs->clear_field = where_field_clear; 01028 01029 fs->iter_pre = NULL; 01030 fs->iter_next = NULL; 01031 fs->iter_column = NULL; 01032 fs->iter_post = NULL; 01033 01034 gw = (struct gtk_widwhere_s *)get_gobj_field(fs); 01035 gw->match_value = NULL; 01036 gw->widget = NULL; 01037 gw->column = colnum; 01038 gw->row = -1; 01039 gw->blank_row = NULL; 01040 gw->compareop = g_strdup(compareop); 01041 gw->ctn = NULL; 01042 }
| void dui_field_set_widget | ( | DuiField * | fs, | |
| const char * | widname, | |||
| int | colnum | |||
| ) |
XXX should probably convert these to work with named columns instead of numbered columns Data is linked to the contents of a GTK widget. If its a columned widget, the column number identifies which column to work with.
Definition at line 936 of file duifield-gtk.c.
00937 { 00938 struct gtk_widget_s *gw; 00939 00940 if (!fs || !DUI_FIELD_IS_TYPE(fs,DUI_FIELD_NONE)) return; 00941 fs->type = DUI_FIELD_WIDGET; 00942 fs->fieldname = g_strdup (widname), 00943 00944 fs->get_field_value = widget_get_value; 00945 fs->set_field_value = widget_set_value; 00946 fs->clear_field = widget_field_clear; 00947 00948 fs->iter_pre = NULL; 00949 fs->iter_next = NULL; 00950 fs->iter_column = resolve_target; 00951 fs->iter_post = NULL; 00952 00953 gw = (struct gtk_widget_s *)get_gobj_field(fs); 00954 gw->widget = NULL, 00955 gw->column = colnum; 00956 gw->row = -1; 00957 gw->ctn = NULL; 00958 }
1.5.5