gwenhywfar  5.10.1
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  GWEN_UNUSED int index,
18  int value,
19  GWEN_UNUSED int doSignal)
20 {
21  GtkWidget *g;
22 
24  assert(g);
25 
26  switch (prop) {
28  gtk_widget_set_sensitive(GTK_WIDGET(g), (value==0)?FALSE:TRUE);
29  return 0;
30 
32  gtk_widget_grab_focus(GTK_WIDGET(g));
33  return 0;
34 
35  default:
36  break;
37  }
38 
40  "Function is not appropriate for this type of widget (%s)",
42  return GWEN_ERROR_INVALID;
43 }
44 
45 
46 
47 
48 static GWENHYWFAR_CB
51  GWEN_UNUSED int index,
52  int defaultValue)
53 {
54  GtkWidget *g;
55 
57  assert(g);
58 
59  switch (prop) {
61  return (gtk_widget_get_sensitive(GTK_WIDGET(g))==TRUE)?1:0;
62 
64  return (gtk_widget_has_focus(GTK_WIDGET(g))==TRUE)?1:0;
65  return 0;
66 
67  default:
68  break;
69  }
70 
72  "Function is not appropriate for this type of widget (%s)",
74  return defaultValue;
75 }
76 
77 
78 
79 static GWENHYWFAR_CB
82  GWEN_UNUSED int index,
83  GWEN_UNUSED const char *value,
84  GWEN_UNUSED int doSignal)
85 {
86  GtkWidget *g;
87 
89  assert(g);
90 
92  "Function is not appropriate for this type of widget (%s)",
94  return GWEN_ERROR_INVALID;
95 }
96 
97 
98 
99 static GWENHYWFAR_CB
102  GWEN_UNUSED int index,
103  const char *defaultValue)
104 {
105  GtkWidget *g;
106 
108  assert(g);
109 
111  "Function is not appropriate for this type of widget (%s)",
113  return defaultValue;
114 }
115 
116 
117 
118 static GWENHYWFAR_CB
120 {
121  GtkWidget *g;
122  GtkWidget *gChild;
123  uint32_t cflags;
124 
126  assert(g);
127 
128  gChild=GTK_WIDGET(GWEN_Widget_GetImplData(wChild, GTK2_DIALOG_WIDGET_REAL));
129  assert(gChild);
130 
131  cflags=GWEN_Widget_GetFlags(wChild);
132 
133  gtk_box_pack_start(GTK_BOX(g), gChild,
134  (cflags & GWEN_WIDGET_FLAGS_FILLX)?TRUE:FALSE,
135  (cflags & GWEN_WIDGET_FLAGS_FILLX)?TRUE:FALSE,
136  0);
137 
138  return 0;
139 }
140 
141 
142 
144 {
145  GtkWidget *g;
146  /*uint32_t flags;*/
147  GWEN_WIDGET *wParent;
148 
149  /*flags=GWEN_Widget_GetFlags(w);*/
150  wParent=GWEN_Widget_Tree_GetParent(w);
151 
152 #if 0
153  /* using equal width here doesn't seem to be working as expected:
154  * I would expect al children be of equal width, but instead all children are
155  * equally distant to each other while still being of different width...
156  */
157  g=gtk_hbox_new((flags & GWEN_WIDGET_FLAGS_EQUAL_WIDTH)?TRUE:FALSE,
159 #else
160  g=gtk_hbox_new(FALSE, GTK2_GUI_DIALOG_DEFAULT_BOX_SPACING);
161 #endif
164 
170 
171  if (wParent)
172  GWEN_Widget_AddChildGuiWidget(wParent, w);
173 
174  return 0;
175 }
176 
177 
GWEN_WIDGET_TYPE GWEN_Widget_GetType(const GWEN_WIDGET *w)
Definition: widget.c:185
static GWENHYWFAR_CB int Gtk2Gui_WHLayout_GetIntProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, GWEN_UNUSED int index, int defaultValue)
#define GWEN_ERROR_INVALID
Definition: error.h:67
#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:717
GWEN_WIDGET_GETCHARPROPERTY_FN GWEN_Widget_SetGetCharPropertyFn(GWEN_WIDGET *w, GWEN_WIDGET_GETCHARPROPERTY_FN fn)
Definition: widget.c:732
GWEN_DIALOG_PROPERTY
Definition: dialog.h:260
static GWENHYWFAR_CB int Gtk2Gui_WHLayout_SetCharProperty(GWEN_WIDGET *w, GWEN_UNUSED GWEN_DIALOG_PROPERTY prop, GWEN_UNUSED int index, GWEN_UNUSED const char *value, GWEN_UNUSED int doSignal)
uint32_t GWEN_Widget_GetFlags(const GWEN_WIDGET *w)
Definition: widget.c:149
#define GTK2_GUI_DIALOG_DEFAULT_BOX_SPACING
#define DBG_WARN(dbg_logger, format, args...)
Definition: debug.h:125
#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:136
static GWENHYWFAR_CB const char * Gtk2Gui_WHLayout_GetCharProperty(GWEN_WIDGET *w, GWEN_UNUSED GWEN_DIALOG_PROPERTY prop, GWEN_UNUSED int index, const char *defaultValue)
GWEN_WIDGET_GETINTPROPERTY_FN GWEN_Widget_SetGetIntPropertyFn(GWEN_WIDGET *w, GWEN_WIDGET_GETINTPROPERTY_FN fn)
Definition: widget.c:702
void * GWEN_Widget_GetImplData(const GWEN_WIDGET *w, int index)
Definition: widget.c:122
#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:747
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:687
struct GWEN_WIDGET GWEN_WIDGET
Definition: widget_be.h:34
int GWEN_Widget_AddChildGuiWidget(GWEN_WIDGET *w, GWEN_WIDGET *wChild)
Definition: widget.c:828
static GWENHYWFAR_CB int Gtk2Gui_WHLayout_SetIntProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, GWEN_UNUSED int index, int value, GWEN_UNUSED int doSignal)
#define GWEN_WIDGET_FLAGS_FILLX
Definition: dialog.h:61
int Gtk2Gui_WHLayout_Setup(GWEN_WIDGET *w)
#define GTK2_DIALOG_WIDGET_CONTENT
const char * GWEN_Widget_Type_toString(GWEN_WIDGET_TYPE t)
Definition: widget.c:452
#define GWEN_UNUSED