gCAD3D 2.35
gui_base.h
Go to the documentation of this file.
1 // Prerequisites:
2 // #include <string.h> // memcmp
3 // #include "../ut/ut_umem.h" // MemObj
4 // #include "../gui/gui_types.h" // TYP_GUI_*
5 
6 
7 
8 // gio_src obj-nr; first=window=0; next widget=1 ..
9 
10 // TODO: replace Obj_Entry, Obj_Button with Obj_gui2
11 
12 
13 // all / Obj_Box Obj_Label
14 typedef struct { MemObj mem_obj; // memory-block: nr, offset
15  short gio_typ; // gui-widget-typ
16  short gio_src; // gui-widget-nr
17  void *widget; // gtk-widget-pointer
18  } Obj_Unknown;
19 
20 // TYP_GUI_Notebook
21 typedef struct { MemObj mem_obj;
22  short gio_typ;
23  short gio_src;
24  void *widget;
25  void (*uFunc)();
26  } Obj_gui1;
27 
28 
29 // Obj_Button Obj_Entry TYP_GUI_MenuEntry
30 typedef struct { MemObj mem_obj;
31  short gio_typ;
32  short gio_src;
33  void *widget;
34  void (*uFunc)();
35  void *data;
36  } Obj_gui2;
37 
38 
39 typedef struct { MemObj mem_obj;
40  short gio_typ;
41  short gio_src;
42  void *win;
43  void (*uFunc)();
44  } Obj_Win;
45 
46 typedef struct { MemObj mem_obj;
47  short gio_typ;
48  short gio_src;
49  void *box;
50  } Obj_Box;
51 
52 typedef struct { MemObj mem_obj;
53  short gio_typ;
54  short gio_src;
55  void *button;
56  void (*uFunc)();
57  void *data;
58  } Obj_Button;
59 
60 typedef struct { MemObj mem_obj;
61  short gio_typ;
62  short gio_src;
63  void *label;
64  } Obj_Label;
65 
66 // TYP_GUI_Slider
67 typedef struct { MemObj mem_obj;
68  short gio_typ;
69  short gio_src;
70  void *slider;
71  void (*uFunc)();
72  } Obj_Slider;
73 
74 // TYP_GUI_Entry
75 typedef struct { MemObj mem_obj;
76  short gio_typ;
77  short gio_src;
78  void *entry;
79  void (*uFunc)();
80  void *data;
81  } Obj_Entry;
82 
83 // TYP_GUI_GLwin
84 typedef struct { MemObj mem_obj;
85  short gio_typ;
86  short gio_src;
87  void *widget;
88  void (*uFuDraw)();
89  void (*uFuMove)();
90  void (*uFuButt)();
91  int (*uFuKey)();
92  } Obj_GLwin;
93 
94 
95 
96 #define GUI_OBJ_NEW {0, 0}
97 
103 #define GUI_OBJ_INVALID() UME_obj_invalid_set (-4)
104 
108 #define GUI_OBJ_IS_VALID(mo1) ((mo1)->ioff >= 4)
109 
113 #define GUI_obj_cmp(mo1,mo2) memcmp(mo1,mo2,sizeof(MemObj))
114 
115 // make MemObj from GUI-obj (Obj_Unknown)
116 #define MEMOBJ_GUIOBJ(GO) ((Obj_Unknown*)GO)->mem_obj
117 
118 // copy pointer -> MemObj
119 // void *vp1; MemObj mo;
120 // GUI_MO_PTR (&mo, &vp1)
121 #define GUI_MO_PTR(mo,vp1) memcpy (mo, vp1, sizeof(void*))
122 
123 
124  int GUI_obj_init ();
125  int GUI_obj_save ();
126  void GUI_obj_clear ();
127  MemObj GUI_obj_spc (void **oPos, int siz);
128  MemObj GUI_obj_tmp (void **oPos, int siz);
129  void* GUI_obj_pos (MemObj *mo);
130  Memspc* GUI_obj__ ();
131  int GUI_obj_src (MemObj *mo);
132  int GUI_obj_free (MemObj *gObj);
133 
134  void* GUI_obj_parent__ (int *pTyp, MemObj *mObj);
135  void* GUI_obj_parentBox (void *o_par);
136  void GUI_obj_typ (int *pTyp, void **g_par, MemObj *o_par);
137 
138  void GUI_obj_dump_mo (MemObj *mo);
139 
140  char GUI_opts_get1 (char **s1, char *opts);
141 
142 
143 // EOF
short gio_typ
Definition: gui_base.h:61
void * data
Definition: gui_base.h:80
short gio_src
Definition: gui_base.h:62
short gio_src
Definition: gui_base.h:16
void * win
Definition: gui_base.h:42
MemObj mem_obj
Definition: gui_base.h:14
Definition: ut_umem.h:122
short gio_src
Definition: gui_base.h:54
void * widget
Definition: gui_base.h:87
MemObj mem_obj
Definition: gui_base.h:84
Definition: gui_base.h:52
Definition: gui_base.h:39
void * widget
Definition: gui_base.h:33
short gio_src
Definition: gui_base.h:23
short gio_src
Definition: gui_base.h:86
void GUI_obj_typ(int *pTyp, void **g_par, MemObj *o_par)
Definition: gui_base.c:318
void * entry
Definition: gui_base.h:78
Definition: gui_base.h:21
MemObj mem_obj
Definition: gui_base.h:21
MemObj mem_obj
Definition: gui_base.h:39
short gio_typ
Definition: gui_base.h:85
void * box
Definition: gui_base.h:49
int GUI_obj_init()
Definition: gui_base.c:409
Definition: gui_base.h:14
void * GUI_obj_parentBox(void *o_par)
Definition: gui_base.c:287
int GUI_obj_save()
Definition: gui_base.c:477
Memspc * GUI_obj__()
Definition: gui_base.c:218
Definition: gui_base.h:60
void * widget
Definition: gui_base.h:24
void * slider
Definition: gui_base.h:70
void * label
Definition: gui_base.h:63
short gio_typ
Definition: gui_base.h:47
Definition: gui_base.h:84
void * data
Definition: gui_base.h:57
short gio_typ
Definition: gui_base.h:40
short gio_typ
Definition: gui_base.h:68
int GUI_obj_src(MemObj *mo)
Definition: gui_base.c:654
MemObj mem_obj
Definition: gui_base.h:75
short gio_typ
Definition: gui_base.h:53
MemObj GUI_obj_spc(void **oPos, int siz)
Definition: gui_base.c:551
MemObj mem_obj
Definition: gui_base.h:60
Definition: gui_base.h:67
MemObj GUI_obj_tmp(void **oPos, int siz)
Definition: gui_base.c:520
short gio_typ
Definition: gui_base.h:76
short gio_typ
Definition: gui_base.h:22
MemObj mem_obj
Definition: gui_base.h:30
Definition: gui_base.h:75
void * button
Definition: gui_base.h:55
short gio_src
Definition: gui_base.h:77
int GUI_obj_free(MemObj *gObj)
Definition: gui_base.c:748
Definition: gui_base.h:30
MemObj mem_obj
Definition: gui_base.h:52
static int s1
Definition: ckint_fac.c:58
void GUI_obj_clear()
Definition: gui_base.c:506
void * data
Definition: gui_base.h:35
char GUI_opts_get1(char **s1, char *opts)
Definition: gui_base.c:713
void * GUI_obj_parent__(int *pTyp, MemObj *mObj)
Definition: gui_base.c:252
MemObj mem_obj
Definition: gui_base.h:46
short gio_typ
Definition: gui_base.h:15
void * widget
Definition: gui_base.h:17
short gio_src
Definition: gui_base.h:69
short gio_src
Definition: gui_base.h:41
short gio_src
Definition: gui_base.h:32
MemObj mem_obj
Definition: gui_base.h:67
void GUI_obj_dump_mo(MemObj *mo)
Definition: gui_base.c:604
Definition: gui_base.h:46
void * GUI_obj_pos(MemObj *mo)
Definition: gui_base.c:670
Typ_Memspc (a class for variable-length-records in memory)
Definition: ut_umem.h:33
short gio_typ
Definition: gui_base.h:31
short gio_src
Definition: gui_base.h:48