gCAD3D 2.40
gui_base.h File Reference

Go to the source code of this file.

Data Structures

struct  Obj_Unknown
 
struct  Obj_gui1
 
struct  Obj_gui2
 
struct  Obj_Win
 
struct  Obj_Box
 
struct  Obj_Button
 
struct  Obj_Label
 
struct  Obj_Slider
 
struct  Obj_Entry
 
struct  Obj_GLwin
 

Macros

#define GUI_OBJ_NEW   {0, 0}
 
#define GUI_OBJ_INVALID()   UME_obj_invalid_set (-4)
 
#define GUI_OBJ_IS_VALID(mo1)   ((mo1)->ioff >= 4)
 
#define GUI_obj_cmp(mo1, mo2)   memcmp(mo1,mo2,sizeof(MemObj))
 
#define MEMOBJ_GUIOBJ(GO)   ((Obj_Unknown*)GO)->mem_obj
 
#define GUI_MO_PTR(mo, vp1)   memcpy (mo, vp1, sizeof(void*))
 

Functions

int GUI_obj_init ()
 
int GUI_obj_save ()
 
void GUI_obj_clear ()
 
MemObj GUI_obj_spc (void **oPos, int siz)
 
MemObj GUI_obj_tmp (void **oPos, int siz)
 
void * GUI_obj_pos (MemObj *mo)
 
MemspcGUI_obj__ ()
 
int GUI_obj_src (MemObj *mo)
 
int GUI_obj_free (MemObj *gObj)
 
void * GUI_obj_parent__ (int *pTyp, MemObj *mObj)
 
void * GUI_obj_parentBox (void *o_par)
 
void GUI_obj_typ (int *pTyp, void **g_par, MemObj *o_par)
 
void GUI_obj_dump_mo (MemObj *mo)
 
char GUI_opts_get1 (char **s1, char *opts)
 

Macro Definition Documentation

#define GUI_OBJ_NEW   {0, 0}
#define GUI_OBJ_INVALID ( )    UME_obj_invalid_set (-4)

set MemObj invalid Usage: in callBack from window-exit ((GUI_DATA_EVENT == TYP_EventExit) window = GUI_OBJ_INVALID (); test with if(GUI_OBJ_IS_VALID(&window)) window-is-valid

#define GUI_OBJ_IS_VALID (   mo1)    ((mo1)->ioff >= 4)

test if GUI-object is valid; returns: 1 is OK; 0 is invalid object. MemObj *mo; if(GUI_OBJ_IS_VALID(mo)) obj-is-valid . if(!GUI_OBJ_IS_VALID(mo)) obj-is-not-valid .

#define GUI_obj_cmp (   mo1,
  mo2 
)    memcmp(mo1,mo2,sizeof(MemObj))

compare GUI-objects; 0=identical; 1=different widgets. void GUI_obj_cmp (MemObj *mo1, MemObj *mo2); if(!GUI_obj_cmp (&mo1, &mo2)) objs-are-identical;

#define MEMOBJ_GUIOBJ (   GO)    ((Obj_Unknown*)GO)->mem_obj
#define GUI_MO_PTR (   mo,
  vp1 
)    memcpy (mo, vp1, sizeof(void*))

Function Documentation

int GUI_obj_init ( )
* get a new memBlockId <UI_umbId>
*
int GUI_obj_save ( )
* save UI_tmpSpc -> memoryblock <UI_umbId>
* & clear UI_tmpSpc
* & get new memBlockId
*
void GUI_obj_clear ( )

clear the local memSpc UI_tmpSpc

MemObj GUI_obj_spc ( void **  oPos,
int  siz 
)
* get address & memspc for new widget (in UI_tmpSpc)
* Input:
* siz size for new widget
* Output:
* *oPos free space for the new object (in UI_tmpSpc)
* RetCod memblockId (reserved) and dataOffset
*
MemObj GUI_obj_tmp ( void **  oPos,
int  siz 
)

get temporary object; only one possible.

void* GUI_obj_pos ( MemObj mo)
* get widget-data-position from MemObj
* MemObj contains window-nr and offset in the window-memoryblock.
* widget-data contains at least Obj_Unknown
*
* Example:
* go = GUI_obj_pos (mo);
* printf(" typ=%d src=%d\n", go->gio_typ, go->gio_src);
*
Memspc* GUI_obj__ ( )

GUI_obj__ get temporary block UI_tmpSpc

int GUI_obj_src ( MemObj mo)

GUI_obj_src get widget-nr from MemObj

int GUI_obj_free ( MemObj gObj)

free the memBlock

void* GUI_obj_parent__ ( int *  pTyp,
MemObj mObj 
)

get widget-type & data from MemObj; check for Box. Input: mObj parentObj Output: pTyp type of parent; eg TYP_GUI_BoxH RetCod the gtk-widget of the parent

void* GUI_obj_parentBox ( void *  o_par)

get widget-type & data from MemObj; check for Box.

void GUI_obj_typ ( int *  pTyp,
void **  g_par,
MemObj o_par 
)

get widget-type & widget-data from MemObj

void GUI_obj_dump_mo ( MemObj mo)

dump MemObj

char GUI_opts_get1 ( char **  s1,
char *  opts 
)
* GUI_opts_get1 get 1-char-parameter from opts-string
* Input:
* s1 the opts-string; paramters, delimited by ','.
* opts the characters of the parameter
* Output:
* s1 the next parameter (delimiter ',' is skipped)
* RetCod the paramter (one character of opts)
* or opts[0] (the first character is the default).
*