gwenhywfar  4.99.8beta
gtk2/w_hlayout.c
Go to the documentation of this file.
1 /***************************************************************************
2  begin : Sun May 16 2010
3  copyright : (C) 2010 by Martin Preuss
4  email : martin@libchipcard.de
5 
6  ***************************************************************************
7  * Please see toplevel file COPYING for license details *
8  ***************************************************************************/
9 
10 
11 
12 
13 
14 static GWENHYWFAR_CB
17  int index,
18  int value,
19  int doSignal) {
20  GtkWidget *g;
21 
23  assert(g);
24 
25  switch(prop) {
27  gtk_widget_set_sensitive(GTK_WIDGET(g), (value==0)?FALSE:TRUE);
28  return 0;
29 
31  gtk_widget_grab_focus(GTK_WIDGET(g));
32  return 0;
33 
34  default:
35  break;
36  }
37 
39  "Function is not appropriate for this type of widget (%s)",
41  return GWEN_ERROR_INVALID;
42 }
43 
44 
45 
46 
47 static GWENHYWFAR_CB
50  int index,
51  int defaultValue) {
52  GtkWidget *g;
53 
55  assert(g);
56 
57  switch(prop) {
59  return (gtk_widget_get_sensitive(GTK_WIDGET(g))==TRUE)?1:0;
60 
62  return (gtk_widget_has_focus(GTK_WIDGET(g))==TRUE)?1:0;
63  return 0;
64 
65  default:
66  break;
67  }
68 
70  "Function is not appropriate for this type of widget (%s)",
72  return defaultValue;
73 }
74 
75 
76 
77 static GWENHYWFAR_CB
80  int index,
81  const char *value,
82  int doSignal) {
83  GtkWidget *g;
84 
86  assert(g);
87 
89  "Function is not appropriate for this type of widget (%s)",
91  return GWEN_ERROR_INVALID;
92 }
93 
94 
95 
96 static GWENHYWFAR_CB
99  int index,
100  const char *defaultValue) {
101  GtkWidget *g;
102 
104  assert(g);
105 
107  "Function is not appropriate for this type of widget (%s)",
109  return defaultValue;
110 }
111 
112 
113 
114 static GWENHYWFAR_CB
116  GtkWidget *g;
117  GtkWidget *gChild;
118  uint32_t cflags;
119 
121  assert(g);
122 
123  gChild=GTK_WIDGET(GWEN_Widget_GetImplData(wChild, GTK2_DIALOG_WIDGET_REAL));
124  assert(gChild);
125 
126  cflags=GWEN_Widget_GetFlags(wChild);
127 
128  gtk_box_pack_start(GTK_BOX(g), gChild,
129  (cflags & GWEN_WIDGET_FLAGS_FILLX)?TRUE:FALSE,
130  (cflags & GWEN_WIDGET_FLAGS_FILLX)?TRUE:FALSE,
131  0);
132 
133  return 0;
134 }
135 
136 
137 
139  GtkWidget *g;
140  uint32_t flags;
141  GWEN_WIDGET *wParent;
142 
143  flags=GWEN_Widget_GetFlags(w);
144  wParent=GWEN_Widget_Tree_GetParent(w);
145 
146 #if 0
147  /* using equal width here doesn't seem to be working as expected:
148  * I would expect al children be of equal width, but instead all children are
149  * equally distant to each other while still being of different width...
150  */
151  g=gtk_hbox_new((flags & GWEN_WIDGET_FLAGS_EQUAL_WIDTH)?TRUE:FALSE,
153 #else
154  g=gtk_hbox_new(FALSE, GTK2_GUI_DIALOG_DEFAULT_BOX_SPACING);
155 #endif
158 
164 
165  if (wParent)
166  GWEN_Widget_AddChildGuiWidget(wParent, w);
167 
168  return 0;
169 }
170 
171 
static GWENHYWFAR_CB int Gtk2Gui_WHLayout_GetIntProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int defaultValue)
GWEN_WIDGET_TYPE GWEN_Widget_GetType(const GWEN_WIDGET *w)
Definition: widget.c:175
#define GWEN_ERROR_INVALID
Definition: error.h:67
static GWENHYWFAR_CB const char * Gtk2Gui_WHLayout_GetCharProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *defaultValue)
#define GWEN_WIDGET_FLAGS_EQUAL_WIDTH
Definition: dialog.h:76
GWEN_WIDGET_SETCHARPROPERTY_FN GWEN_Widget_SetSetCharPropertyFn(GWEN_WIDGET *w, GWEN_WIDGET_SETCHARPROPERTY_FN fn)
Definition: widget.c:663
GWEN_WIDGET_GETCHARPROPERTY_FN GWEN_Widget_SetGetCharPropertyFn(GWEN_WIDGET *w, GWEN_WIDGET_GETCHARPROPERTY_FN fn)
Definition: widget.c:677
GWEN_DIALOG_PROPERTY
Definition: dialog.h:215
uint32_t GWEN_Widget_GetFlags(const GWEN_WIDGET *w)
Definition: widget.c:143
#define GTK2_GUI_DIALOG_DEFAULT_BOX_SPACING
#define DBG_WARN(dbg_logger, format, args...)
Definition: debug.h:118
#define GWEN_LOGDOMAIN
Definition: logger.h:35
void GWEN_Widget_SetImplData(GWEN_WIDGET *w, int index, void *ptr)
Store a pointer with the widget.
Definition: widget.c:131
GWEN_WIDGET_GETINTPROPERTY_FN GWEN_Widget_SetGetIntPropertyFn(GWEN_WIDGET *w, GWEN_WIDGET_GETINTPROPERTY_FN fn)
Definition: widget.c:649
void * GWEN_Widget_GetImplData(const GWEN_WIDGET *w, int index)
Definition: widget.c:118
#define GWENHYWFAR_CB
Definition: gwenhywfarapi.h:89
GWEN_WIDGET_ADDCHILDGUIWIDGET_FN GWEN_Widget_SetAddChildGuiWidgetFn(GWEN_WIDGET *w, GWEN_WIDGET_ADDCHILDGUIWIDGET_FN fn)
Definition: widget.c:691
static GWENHYWFAR_CB int Gtk2Gui_WHLayout_AddChildGuiWidget(GWEN_WIDGET *w, GWEN_WIDGET *wChild)
#define GTK2_DIALOG_WIDGET_REAL
GWEN_WIDGET_SETINTPROPERTY_FN GWEN_Widget_SetSetIntPropertyFn(GWEN_WIDGET *w, GWEN_WIDGET_SETINTPROPERTY_FN fn)
Definition: widget.c:635
struct GWEN_WIDGET GWEN_WIDGET
Definition: widget_be.h:34
int GWEN_Widget_AddChildGuiWidget(GWEN_WIDGET *w, GWEN_WIDGET *wChild)
Definition: widget.c:767
#define GWEN_WIDGET_FLAGS_FILLX
Definition: dialog.h:61
int Gtk2Gui_WHLayout_Setup(GWEN_WIDGET *w)
static GWENHYWFAR_CB int Gtk2Gui_WHLayout_SetCharProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *value, int doSignal)
#define GTK2_DIALOG_WIDGET_CONTENT
static GWENHYWFAR_CB int Gtk2Gui_WHLayout_SetIntProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int value, int doSignal)
const char * GWEN_Widget_Type_toString(GWEN_WIDGET_TYPE t)
Definition: widget.c:413