gwenhywfar  4.99.15beta
widget.c
Go to the documentation of this file.
1 /***************************************************************************
2  begin : Wed Jan 20 2010
3  copyright : (C) 2010 by Martin Preuss
4  email : martin@libchipcard.de
5 
6  ***************************************************************************
7  * *
8  * This library is free software; you can redistribute it and/or *
9  * modify it under the terms of the GNU Lesser General Public *
10  * License as published by the Free Software Foundation; either *
11  * version 2.1 of the License, or (at your option) any later version. *
12  * *
13  * This library is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16  * Lesser General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU Lesser General Public *
19  * License along with this library; if not, write to the Free Software *
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21  * MA 02111-1307 USA *
22  * *
23  ***************************************************************************/
24 
25 
26 #ifdef HAVE_CONFIG_H
27 # include <config.h>
28 #endif
29 
30 #define DISABLE_DEBUGLOG
31 
32 
33 #include "widget_p.h"
34 
35 #include <gwenhywfar/text.h>
36 #include <gwenhywfar/debug.h>
37 #include <gwenhywfar/dialog_be.h>
38 
39 #include <assert.h>
40 #include <ctype.h>
41 
42 
43 
44 GWEN_TREE_FUNCTIONS(GWEN_WIDGET, GWEN_Widget)
46 
47 
48 
49 
51 {
52  GWEN_WIDGET *w;
53 
55  w->refCount=1;
58 
59  w->dialog=dlg;
60 
61  return w;
62 }
63 
64 
65 
67 {
68  if (w) {
69  assert(w->refCount);
70  if (w->refCount>1) {
71  w->refCount--;
72  }
73  else {
74  int i;
75 
78  free(w->name);
79  for (i=0; i<GWEN_WIDGET_TEXTCOUNT; i++)
80  free(w->text[i]);
81  free(w->iconFile);
82  free(w->imageFile);
83  w->refCount=0;
85  }
86  }
87 }
88 
89 
90 
91 
93 {
94  assert(w);
95  assert(w->refCount);
96 
97  return w->dialog;
98 }
99 
100 
101 
103 {
104  GWEN_DIALOG *dlg;
105  GWEN_DIALOG *pdlg;
106 
107  assert(w);
108  assert(w->refCount);
109 
110  dlg=w->dialog;
111  if (dlg) {
112  while ((pdlg=GWEN_Dialog_GetParentDialog(dlg)))
113  dlg=pdlg;
114 
115  return w->dialog;
116  }
117  return NULL;
118 }
119 
120 
121 
122 void *GWEN_Widget_GetImplData(const GWEN_WIDGET *w, int index)
123 {
124  assert(w);
125  assert(w->refCount);
126  if (index<GWEN_WIDGET_IMPLDATACOUNT)
127  return w->impl_data[index];
128  else {
129  DBG_ERROR(GWEN_LOGDOMAIN, "Index out of range");
130  return NULL;
131  }
132 }
133 
134 
135 
136 void GWEN_Widget_SetImplData(GWEN_WIDGET *w, int index, void *ptr)
137 {
138  assert(w);
139  assert(w->refCount);
140  if (index<GWEN_WIDGET_IMPLDATACOUNT)
141  w->impl_data[index]=ptr;
142  else {
143  DBG_ERROR(GWEN_LOGDOMAIN, "Index out of range");
144  }
145 }
146 
147 
148 
150 {
151  assert(w);
152  assert(w->refCount);
153  return w->flags;
154 }
155 
156 
157 
158 void GWEN_Widget_SetFlags(GWEN_WIDGET *w, uint32_t fl)
159 {
160  assert(w);
161  assert(w->refCount);
162  w->flags=fl;
163 }
164 
165 
166 
167 void GWEN_Widget_AddFlags(GWEN_WIDGET *w, uint32_t fl)
168 {
169  assert(w);
170  assert(w->refCount);
171  w->flags|=fl;
172 }
173 
174 
175 
176 void GWEN_Widget_SubFlags(GWEN_WIDGET *w, uint32_t fl)
177 {
178  assert(w);
179  assert(w->refCount);
180  w->flags&=~fl;
181 }
182 
183 
184 
186 {
187  assert(w);
188  assert(w->refCount);
189  return w->wtype;
190 }
191 
192 
193 
195 {
196  assert(w);
197  assert(w->refCount);
198  w->wtype=t;
199 }
200 
201 
202 
204 {
205  assert(w);
206  assert(w->refCount);
207  return w->columns;
208 }
209 
210 
211 
213 {
214  assert(w);
215  assert(w->refCount);
216  w->columns=i;
217 }
218 
219 
220 
222 {
223  assert(w);
224  assert(w->refCount);
225  return w->rows;
226 }
227 
228 
229 
231 {
232  assert(w);
233  assert(w->refCount);
234  w->rows=i;
235 }
236 
237 
238 
240 {
241  assert(w);
242  assert(w->refCount);
243  return w->groupId;
244 }
245 
246 
247 
249 {
250  assert(w);
251  assert(w->refCount);
252  w->groupId=i;
253 }
254 
255 
256 
258 {
259  assert(w);
260  assert(w->refCount);
261  return w->width;
262 }
263 
264 
265 
267 {
268  assert(w);
269  assert(w->refCount);
270  w->width=i;
271 }
272 
273 
274 
276 {
277  assert(w);
278  assert(w->refCount);
279  return w->height;
280 }
281 
282 
283 
285 {
286  assert(w);
287  assert(w->refCount);
288  w->height=i;
289 }
290 
291 
292 
293 const char *GWEN_Widget_GetText(const GWEN_WIDGET *w, int idx)
294 {
295  assert(w);
296  assert(w->refCount);
297  if (idx<0 || idx>=GWEN_WIDGET_TEXTCOUNT)
298  return NULL;
299  return w->text[idx];
300 }
301 
302 
303 
304 void GWEN_Widget_SetText(GWEN_WIDGET *w, int idx, const char *s)
305 {
306  assert(w);
307  assert(w->refCount);
308 
309  if (idx>=0 && idx<GWEN_WIDGET_TEXTCOUNT) {
310  free(w->text[idx]);
311  if (s)
312  w->text[idx]=strdup(s);
313  else
314  w->text[idx]=NULL;
315  }
316 }
317 
318 
319 
320 const char *GWEN_Widget_GetName(const GWEN_WIDGET *w)
321 {
322  assert(w);
323  assert(w->refCount);
324  return w->name;
325 }
326 
327 
328 
329 void GWEN_Widget_SetName(GWEN_WIDGET *w, const char *s)
330 {
331  assert(w);
332  assert(w->refCount);
333  free(w->name);
334  if (s)
335  w->name=strdup(s);
336  else
337  w->name=NULL;
338 }
339 
340 
341 
343 {
344  assert(w);
345  assert(w->refCount);
346  return w->iconFile;
347 }
348 
349 
350 
352 {
353  assert(w);
354  assert(w->refCount);
355  free(w->iconFile);
356  if (s)
357  w->iconFile=strdup(s);
358  else
359  w->iconFile=NULL;
360 }
361 
362 
363 
365 {
366  assert(w);
367  assert(w->refCount);
368  return w->imageFile;
369 }
370 
371 
372 
374 {
375  assert(w);
376  assert(w->refCount);
377  free(w->imageFile);
378  if (s)
379  w->imageFile=strdup(s);
380  else
381  w->imageFile=NULL;
382 }
383 
384 
385 
386 
387 
389 {
390  if (s && *s) {
391  if (strcasecmp(s, "unknown")==0)
393  else if (strcasecmp(s, "none")==0)
394  return GWEN_Widget_TypeNone;
395  else if (strcasecmp(s, "label")==0)
396  return GWEN_Widget_TypeLabel;
397  else if (strcasecmp(s, "pushButton")==0)
399  else if (strcasecmp(s, "lineEdit")==0)
401  else if (strcasecmp(s, "textEdit")==0)
403  else if (strcasecmp(s, "comboBox")==0)
405  else if (strcasecmp(s, "radioButton")==0)
407  else if (strcasecmp(s, "progressBar")==0)
409  else if (strcasecmp(s, "groupBox")==0)
411  else if (strcasecmp(s, "hSpacer")==0)
413  else if (strcasecmp(s, "vSpacer")==0)
415  else if (strcasecmp(s, "hLayout")==0)
417  else if (strcasecmp(s, "vLayout")==0)
419  else if (strcasecmp(s, "gridLayout")==0)
421  else if (strcasecmp(s, "listBox")==0)
423  else if (strcasecmp(s, "dialog")==0)
424  return GWEN_Widget_TypeDialog;
425  else if (strcasecmp(s, "tabBook")==0)
427  else if (strcasecmp(s, "tabPage")==0)
429  else if (strcasecmp(s, "widgetStack")==0)
431  else if (strcasecmp(s, "checkBox")==0)
433  else if (strcasecmp(s, "scrollArea")==0)
435  else if (strcasecmp(s, "hLine")==0)
436  return GWEN_Widget_TypeHLine;
437  else if (strcasecmp(s, "vLine")==0)
438  return GWEN_Widget_TypeVLine;
439  else if (strcasecmp(s, "textBrowser")==0)
441  else if (strcasecmp(s, "spinBox")==0)
443  else {
444  DBG_ERROR(GWEN_LOGDOMAIN, "Unknown widget type [%s]", s);
445  }
446  }
448 }
449 
450 
451 
453 {
454  switch (t) {
456  return "none";
458  return "label";
460  return "pushButton";
462  return "lineEdit";
464  return "textEdit";
466  return "comboBox";
468  return "radioButton";
470  return "progressBar";
472  return "groupBox";
474  return "hSpacer";
476  return "vSpacer";
478  return "hLayout";
480  return "vLayout";
482  return "gridLayout";
484  return "listBox";
486  return "dialog";
488  return "tabBook";
490  return "tabPage";
492  return "widgetStack";
494  return "checkBox";
496  return "scrollArea";
498  return "hLine";
500  return "vLine";
502  return "textBrowser";
504  return "spinBox";
506  return "unknown";
507  }
508 
509  return "unknown";
510 }
511 
512 
513 
514 uint32_t GWEN_Widget_Flags_fromString(const char *s)
515 {
516  uint32_t fl=0;
517 
518  if (s && *s) {
519  char *copy;
520  char *p;
521 
522  copy=strdup(s);
523  p=copy;
524 
525  while (*p) {
526  char *wstart;
527 
528  /* skip blanks */
529  while (*p && isspace(*p))
530  p++;
531  /* save start of word */
532  wstart=p;
533 
534  /* find end of word */
535  while (*p && !(isspace(*p) || *p==','))
536  p++;
537  if (*p)
538  /* set blank or comma to 0, advance pointer */
539  *(p++)=0;
540 
541  /* parse flags */
542  if (strcasecmp(wstart, "fillX")==0)
544  else if (strcasecmp(wstart, "fillY")==0)
546  else if (strcasecmp(wstart, "readOnly")==0)
548  else if (strcasecmp(wstart, "password")==0)
550  else if (strcasecmp(wstart, "default")==0)
552  else if (strcasecmp(wstart, "decorShrinkable")==0)
554  else if (strcasecmp(wstart, "decorStretchable")==0)
556  else if (strcasecmp(wstart, "decorMinimize")==0)
558  else if (strcasecmp(wstart, "decorMaximize")==0)
560  else if (strcasecmp(wstart, "decorClose")==0)
562  else if (strcasecmp(wstart, "decorMenu")==0)
564  else if (strcasecmp(wstart, "fixedWidth")==0)
566  else if (strcasecmp(wstart, "fixedHeight")==0)
568  else if (strcasecmp(wstart, "equalWidth")==0)
570  else if (strcasecmp(wstart, "equalHeight")==0)
572  else if (strcasecmp(wstart, "justifyLeft")==0)
574  else if (strcasecmp(wstart, "justifyRight")==0)
576  else if (strcasecmp(wstart, "justifyTop")==0)
578  else if (strcasecmp(wstart, "justifyBottom")==0)
580  else if (strcasecmp(wstart, "justifyCenterX")==0)
582  else if (strcasecmp(wstart, "justifyCenterY")==0)
584  else if (strcasecmp(wstart, "noWordWrap")==0)
586  }
587  }
588 
589  return fl;
590 }
591 
592 
593 
595 {
596  const char *s;
597 
598  s=GWEN_XMLNode_GetProperty(node, "name", NULL);
599  if (s && *s)
600  GWEN_Widget_SetName(w, s);
601 
602  s=GWEN_XMLNode_GetProperty(node, "type", "unknown");
603  if (s && *s) {
604  w->wtype=GWEN_Widget_Type_fromString(s);
605  if (w->wtype==GWEN_Widget_TypeUnknown) {
606  DBG_ERROR(GWEN_LOGDOMAIN, "unknown type in node");
607  GWEN_XMLNode_Dump(node, 2);
608  return GWEN_ERROR_BAD_DATA;
609  }
610  }
611  else {
612  DBG_ERROR(GWEN_LOGDOMAIN, "type property missing in node");
613  return GWEN_ERROR_BAD_DATA;
614  }
615 
616  s=GWEN_XMLNode_GetProperty(node, "flags", NULL);
617  if (s && *s)
618  w->flags=GWEN_Widget_Flags_fromString(s);
619 
620  s=GWEN_XMLNode_GetProperty(node, "columns", NULL);
621  if (s && *s) {
622  if (1!=sscanf(s, "%d", &(w->columns))) {
623  DBG_ERROR(GWEN_LOGDOMAIN, "Value [%s] is not an integer", s);
624  return GWEN_ERROR_BAD_DATA;
625  }
626  }
627 
628  s=GWEN_XMLNode_GetProperty(node, "rows", NULL);
629  if (s && *s) {
630  if (1!=sscanf(s, "%d", &(w->rows))) {
631  DBG_ERROR(GWEN_LOGDOMAIN, "Value [%s] is not an integer", s);
632  return GWEN_ERROR_BAD_DATA;
633  }
634  }
635 
636  s=GWEN_XMLNode_GetProperty(node, "width", NULL);
637  if (s && *s) {
638  if (1!=sscanf(s, "%d", &(w->width))) {
639  DBG_ERROR(GWEN_LOGDOMAIN, "Value [%s] is not an integer", s);
640  return GWEN_ERROR_BAD_DATA;
641  }
642  }
643 
644  s=GWEN_XMLNode_GetProperty(node, "height", NULL);
645  if (s && *s) {
646  if (1!=sscanf(s, "%d", &(w->height))) {
647  DBG_ERROR(GWEN_LOGDOMAIN, "Value [%s] is not an integer", s);
648  return GWEN_ERROR_BAD_DATA;
649  }
650  }
651 
652  s=GWEN_XMLNode_GetProperty(node, "text", NULL);
653  if (s && *s)
655 
656  s=GWEN_XMLNode_GetProperty(node, "icon", NULL);
657  if (s && *s)
659 
660  s=GWEN_XMLNode_GetProperty(node, "image", NULL);
661  if (s && *s)
663 
664  s=GWEN_XMLNode_GetProperty(node, "groupId", NULL);
665  if (s && *s) {
666  if (1!=sscanf(s, "%d", &(w->groupId))) {
667  DBG_ERROR(GWEN_LOGDOMAIN, "Value [%s] is not an integer", s);
668  return GWEN_ERROR_BAD_DATA;
669  }
670  }
671 
672  return 0;
673 }
674 
675 
676 
679 {
681 
682  assert(w);
683  assert(w->refCount);
684 
685  of=w->setIntPropertyFn;
686  w->setIntPropertyFn=fn;
687  return of;
688 }
689 
690 
691 
694 {
696 
697  assert(w);
698  assert(w->refCount);
699 
700  of=w->getIntPropertyFn;
701  w->getIntPropertyFn=fn;
702  return of;
703 }
704 
705 
706 
709 {
711 
712  assert(w);
713  assert(w->refCount);
714 
715  of=w->setCharPropertyFn;
716  w->setCharPropertyFn=fn;
717  return of;
718 }
719 
720 
721 
724 {
726 
727  assert(w);
728  assert(w->refCount);
729 
730  of=w->getCharPropertyFn;
731  w->getCharPropertyFn=fn;
732  return of;
733 }
734 
735 
736 
739 {
741 
742  assert(w);
743  assert(w->refCount);
744 
745  of=w->addChildGuiWidgetFn;
746  w->addChildGuiWidgetFn=fn;
747  return of;
748 }
749 
750 
751 
754  int index,
755  int value,
756  int doSignal)
757 {
758  assert(w);
759  assert(w->refCount);
760 
761  if (w->setIntPropertyFn)
762  return w->setIntPropertyFn(w, prop, index, value, doSignal);
763  else
765 }
766 
767 
768 
771  int index,
772  int defaultValue)
773 {
774  assert(w);
775  assert(w->refCount);
776 
777  if (w->getIntPropertyFn)
778  return w->getIntPropertyFn(w, prop, index, defaultValue);
779  else
780  return defaultValue;
781 }
782 
783 
784 
787  int index,
788  const char *value,
789  int doSignal)
790 {
791  assert(w);
792  assert(w->refCount);
793 
794  if (w->setCharPropertyFn)
795  return w->setCharPropertyFn(w, prop, index, value, doSignal);
796  else
798 }
799 
800 
801 
804  int index,
805  const char *defaultValue)
806 {
807  assert(w);
808  assert(w->refCount);
809 
810  if (w->getCharPropertyFn)
811  return w->getCharPropertyFn(w, prop, index, defaultValue);
812  else
813  return defaultValue;
814 }
815 
816 
817 
819 {
820  assert(w);
821  assert(w->refCount);
822 
823  if (w->addChildGuiWidgetFn)
824  return w->addChildGuiWidgetFn(w, wChild);
825  else
827 }
828 
829 
830 
831 
832 
GWEN_WIDGET_TYPE GWEN_Widget_GetType(const GWEN_WIDGET *w)
Definition: widget.c:185
#define GWEN_WIDGET_FLAGS_DECOR_MENU
Definition: dialog.h:72
void GWEN_Widget_SetWidth(GWEN_WIDGET *w, int i)
Definition: widget.c:266
const char * GWEN_Widget_GetCharProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *defaultValue)
Definition: widget.c:802
#define GWEN_WIDGET_FLAGS_DECOR_STRETCHABLE
Definition: dialog.h:68
void GWEN_Widget_SetText(GWEN_WIDGET *w, int idx, const char *s)
Definition: widget.c:304
#define GWEN_WIDGET_FLAGS_JUSTIFY_TOP
Definition: dialog.h:81
#define GWEN_INHERIT_FINI(t, element)
Definition: inherit.h:238
int GWEN_Widget_SetCharProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *value, int doSignal)
Definition: widget.c:785
const char * GWEN_XMLNode_GetProperty(const GWEN_XMLNODE *n, const char *name, const char *defaultValue)
Definition: xml.c:239
#define GWEN_WIDGET_FLAGS_EQUAL_WIDTH
Definition: dialog.h:76
#define GWEN_WIDGET_FLAGS_DECOR_MAXIMIZE
Definition: dialog.h:70
const char * GWEN_Widget_GetName(const GWEN_WIDGET *w)
Definition: widget.c:320
#define GWEN_WIDGET_FLAGS_FIXED_WIDTH
Definition: dialog.h:74
GWEN_WIDGET_SETCHARPROPERTY_FN GWEN_Widget_SetSetCharPropertyFn(GWEN_WIDGET *w, GWEN_WIDGET_SETCHARPROPERTY_FN fn)
Definition: widget.c:707
GWEN_WIDGET_GETCHARPROPERTY_FN GWEN_Widget_SetGetCharPropertyFn(GWEN_WIDGET *w, GWEN_WIDGET_GETCHARPROPERTY_FN fn)
Definition: widget.c:722
#define GWEN_WIDGET_FLAGS_JUSTIFY_CENTERY
Definition: dialog.h:84
GWEN_DIALOG_PROPERTY
Definition: dialog.h:215
#define GWEN_FREE_OBJECT(varname)
Definition: memory.h:92
#define NULL
Definition: binreloc.c:297
#define GWEN_WIDGET_IMPLDATACOUNT
Definition: widget_be.h:46
void GWEN_Widget_SetIconFileName(GWEN_WIDGET *w, const char *s)
Definition: widget.c:351
int GWENHYWFAR_CB(* GWEN_WIDGET_ADDCHILDGUIWIDGET_FN)(GWEN_WIDGET *w, GWEN_WIDGET *wChild)
Definition: widget_be.h:119
void GWEN_Widget_SetFlags(GWEN_WIDGET *w, uint32_t fl)
Definition: widget.c:158
void GWEN_Widget_free(GWEN_WIDGET *w)
Definition: widget.c:66
void GWEN_Widget_SubFlags(GWEN_WIDGET *w, uint32_t fl)
Definition: widget.c:176
uint32_t GWEN_Widget_GetFlags(const GWEN_WIDGET *w)
Definition: widget.c:149
void GWEN_XMLNode_Dump(const GWEN_XMLNODE *n, int ind)
Definition: xml.c:472
const char * GWEN_Dialog_TranslateString(const GWEN_DIALOG *dlg, const char *s)
Definition: dialog.c:188
int GWEN_Widget_GetRows(const GWEN_WIDGET *w)
Definition: widget.c:221
#define GWEN_LOGDOMAIN
Definition: logger.h:35
int GWEN_Widget_GetHeight(const GWEN_WIDGET *w)
Definition: widget.c:275
#define GWEN_WIDGET_FLAGS_READONLY
Definition: dialog.h:63
void GWEN_Widget_SetImplData(GWEN_WIDGET *w, int index, void *ptr)
Store a pointer with the widget.
Definition: widget.c:136
struct GWEN_DIALOG GWEN_DIALOG
Definition: dialog.h:54
#define GWEN_WIDGET_FLAGS_JUSTIFY_RIGHT
Definition: dialog.h:80
GWEN_WIDGET_GETINTPROPERTY_FN GWEN_Widget_SetGetIntPropertyFn(GWEN_WIDGET *w, GWEN_WIDGET_GETINTPROPERTY_FN fn)
Definition: widget.c:692
#define GWEN_WIDGET_FLAGS_EQUAL_HEIGHT
Definition: dialog.h:77
#define GWEN_WIDGET_FLAGS_DEFAULT_WIDGET
Definition: dialog.h:65
#define GWEN_ERROR_BAD_DATA
Definition: error.h:121
#define GWEN_NEW_OBJECT(typ, varname)
Definition: memory.h:86
void * GWEN_Widget_GetImplData(const GWEN_WIDGET *w, int index)
Definition: widget.c:122
GWEN_DIALOG * GWEN_Widget_GetDialog(const GWEN_WIDGET *w)
Definition: widget.c:92
int GWEN_Widget_GetColumns(const GWEN_WIDGET *w)
Definition: widget.c:203
void GWEN_Widget_SetHeight(GWEN_WIDGET *w, int i)
Definition: widget.c:284
uint32_t GWEN_Widget_Flags_fromString(const char *s)
Definition: widget.c:514
GWEN_WIDGET_ADDCHILDGUIWIDGET_FN GWEN_Widget_SetAddChildGuiWidgetFn(GWEN_WIDGET *w, GWEN_WIDGET_ADDCHILDGUIWIDGET_FN fn)
Definition: widget.c:737
#define GWEN_WIDGET_FLAGS_PASSWORD
Definition: dialog.h:64
GWEN_WIDGET_SETINTPROPERTY_FN GWEN_Widget_SetSetIntPropertyFn(GWEN_WIDGET *w, GWEN_WIDGET_SETINTPROPERTY_FN fn)
Definition: widget.c:677
#define GWEN_WIDGET_TEXTCOUNT
Definition: widget_be.h:45
GWEN_DIALOG * GWEN_Widget_GetTopDialog(const GWEN_WIDGET *w)
Definition: widget.c:102
#define GWEN_WIDGET_FLAGS_DECOR_CLOSE
Definition: dialog.h:71
#define GWEN_TREE_FINI(t, element)
Definition: tree.h:571
const char * GWEN_Widget_GetIconFileName(const GWEN_WIDGET *w)
Definition: widget.c:342
void GWEN_Widget_SetRows(GWEN_WIDGET *w, int i)
Definition: widget.c:230
#define GWEN_WIDGET_FLAGS_JUSTIFY_BOTTOM
Definition: dialog.h:82
#define GWEN_WIDGET_FLAGS_NO_WORDWRAP
Definition: dialog.h:86
#define GWEN_INHERIT_INIT(t, element)
Definition: inherit.h:223
struct GWEN_WIDGET GWEN_WIDGET
Definition: widget_be.h:34
void GWEN_Widget_SetColumns(GWEN_WIDGET *w, int i)
Definition: widget.c:212
int GWEN_Widget_AddChildGuiWidget(GWEN_WIDGET *w, GWEN_WIDGET *wChild)
Definition: widget.c:818
#define GWEN_WIDGET_FLAGS_FILLY
Definition: dialog.h:62
int GWENHYWFAR_CB(* GWEN_WIDGET_SETINTPROPERTY_FN)(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int value, int doSignal)
Definition: widget_be.h:97
#define GWEN_WIDGET_FLAGS_FILLX
Definition: dialog.h:61
void GWEN_Widget_SetName(GWEN_WIDGET *w, const char *s)
Definition: widget.c:329
int GWENHYWFAR_CB(* GWEN_WIDGET_GETINTPROPERTY_FN)(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int defaultValue)
Definition: widget_be.h:103
int GWEN_Widget_GetGroupId(const GWEN_WIDGET *w)
Definition: widget.c:239
int GWEN_Widget_GetWidth(const GWEN_WIDGET *w)
Definition: widget.c:257
GWEN_WIDGET_TYPE
Definition: widget_be.h:49
#define DBG_ERROR(dbg_logger, format, args...)
Definition: debug.h:97
void GWEN_Widget_SetType(GWEN_WIDGET *w, GWEN_WIDGET_TYPE t)
Definition: widget.c:194
int GWEN_Widget_ReadXml(GWEN_WIDGET *w, GWEN_XMLNODE *node)
Definition: widget.c:594
GWEN_WIDGET * GWEN_Widget_new(GWEN_DIALOG *dlg)
Definition: widget.c:50
#define GWEN_WIDGET_FLAGS_FIXED_HEIGHT
Definition: dialog.h:75
void GWEN_Widget_AddFlags(GWEN_WIDGET *w, uint32_t fl)
Definition: widget.c:167
int GWEN_Widget_SetIntProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int value, int doSignal)
Definition: widget.c:752
GWEN_DIALOG * GWEN_Dialog_GetParentDialog(const GWEN_DIALOG *dlg)
Definition: dialog.c:124
void GWEN_Widget_SetImageFileName(GWEN_WIDGET *w, const char *s)
Definition: widget.c:373
int GWEN_Widget_GetIntProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int defaultValue)
Definition: widget.c:769
int GWENHYWFAR_CB(* GWEN_WIDGET_SETCHARPROPERTY_FN)(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *value, int doSignal)
Definition: widget_be.h:108
#define GWEN_TREE_INIT(t, element)
Definition: tree.h:562
#define GWEN_WIDGET_FLAGS_JUSTIFY_LEFT
Definition: dialog.h:79
GWEN_WIDGET_TYPE GWEN_Widget_Type_fromString(const char *s)
Definition: widget.c:388
const char * GWEN_Widget_GetImageFileName(const GWEN_WIDGET *w)
Definition: widget.c:364
#define GWEN_WIDGET_FLAGS_JUSTIFY_CENTERX
Definition: dialog.h:83
const char * GWEN_Widget_Type_toString(GWEN_WIDGET_TYPE t)
Definition: widget.c:452
#define GWEN_WIDGET_FLAGS_DECOR_SHRINKABLE
Definition: dialog.h:67
#define GWEN_WIDGET_FLAGS_DECOR_MINIMIZE
Definition: dialog.h:69
const char * GWEN_Widget_GetText(const GWEN_WIDGET *w, int idx)
Definition: widget.c:293
#define GWEN_INHERIT_FUNCTIONS(t)
Definition: inherit.h:163
struct GWEN__XMLNODE GWEN_XMLNODE
Definition: xml.h:148
const char *GWENHYWFAR_CB(* GWEN_WIDGET_GETCHARPROPERTY_FN)(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *defaultValue)
Definition: widget_be.h:114
#define GWEN_TREE_FUNCTIONS(t, pr)
Definition: tree.h:402
void GWEN_Widget_SetGroupId(GWEN_WIDGET *w, int i)
Definition: widget.c:248
#define GWEN_ERROR_NOT_IMPLEMENTED
Definition: error.h:108