gCAD3D 2.40
gui_base.c File Reference

GraficalUserInterface internal functions, common for gtk2,gtk3. More...

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "../ut/ut_umem.h"
#include "../ut/ut_umb.h"
#include "../gui/gui_types.h"
#include "../gui/gui_base.h"

Macros

#define Typ_Error   0
 U0 = undefined. More...
 
#define TMPSPC_SIZ   15000
 
#define TMPSPC_INC   15000
 

Functions

char * GUI_Win_tit (void *gtkWin)
 
MemspcGUI_obj__ ()
 
void GUI_obj_destroy (void *wo)
 
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)
 
int GUI_obj_reload (MemObj *o_par)
 
int GUI_obj_reset (void *oPos)
 
int GUI_obj_init ()
 
int GUI_obj_save ()
 
void GUI_obj_clear ()
 
MemObj GUI_obj_tmp (void **oPos, int siz)
 
MemObj GUI_obj_spc (void **oPos, int siz)
 
void GUI_obj_dump__ ()
 
void GUI_obj_dump_mo (MemObj *mo)
 
void GUI_obj_dump_o (void *go)
 
int GUI_obj_src (MemObj *mo)
 
void * GUI_obj_pos (MemObj *mo)
 
char GUI_opts_get1 (char **s1, char *opts)
 
int GUI_obj_free (MemObj *mo)
 

Variables

int UI_fontsizX
 
int UI_fontsizY
 
void * UI_MainWin
 
void * UI_act_wi
 
static Memspc UI_tmpSpc =UME_NEW
 
static void * UI_tmpPos = NULL
 
static int UI_umbId
 
static int UI_srcId
 
int GUI_FuncInit = UI_FuncInit
 
int GUI_FuncUCB1 = UI_FuncUCB1
 
int GUI_FuncUCB2 = UI_FuncUCB2
 
int GUI_FuncUCB3 = UI_FuncUCB3
 
int GUI_FuncUCB4 = UI_FuncUCB4
 
int GUI_FuncUCB5 = UI_FuncUCB5
 
int GUI_FuncUCB6 = UI_FuncUCB6
 
int GUI_FuncUCB7 = UI_FuncUCB7
 
int GUI_FuncUCB8 = UI_FuncUCB8
 
int GUI_FuncUCB9 = UI_FuncUCB9
 
int GUI_FuncUCB10 = UI_FuncUCB10
 
int GUI_FuncUCB11 = UI_FuncUCB11
 
int GUI_FuncUCB12 = UI_FuncUCB12
 
int GUI_FuncUCB13 = UI_FuncUCB13
 
int GUI_FuncWork = UI_FuncWork
 
int GUI_FuncExit = UI_FuncExit
 
int GUI_FuncKill = UI_FuncKill
 

Detailed Description

GraficalUserInterface internal functions, common for gtk2,gtk3.

#include "../gui/gui__.h" // includefile for all GUI-functions
------ Links to Gtk ---------------
../gui_gtk3/gtk_base.c Window Box
../gui_gtk3/gtk_label.c Label
../gui_gtk3/gtk_button.c Button (with image) Checkbox
../gui_gtk3/gtk_menu.c Menu
../gui_gtk3/gtk_entry.c Entry
../gui_gtk3/gtk_image.c Image ScreenCast
../gui_gtk3/gtk_dlg_std.c Messagebox Dialogbox Slider Colorselect
../gui_gtk3/gtk_dlg_files.c File open / save
../gui_gtk3/gtk_msgWin.c Messagewindow
../gui_gtk3/gtk_lists.c List
../gui_gtk3/gtk_container.c Frame Toolbar Notebook Paned
../gui_gtk3/gtk_multichoice.c Radiobuttons Popup-menu Option-menu
../gui_gtk3/gtk_tree_it.c Treeview with icon + text
../gui_gtk3/gtk_ed1.c TextEditor
../gui_gtk3/gtk_opengl.c OpenGL-window
../gui_gtk3/gtk_gl_x11.c Gtk-binding OpenGL
------ macros for callback-data ---------
GUI_DATA_EVENT *(int*)data[0] callbackEventType
GUI_DATA_I1 *(int*)data[1]
GUI_DATA_D1 *(double*)data[1]
GUI_DATA_S1 (char*)data[1]
GUI_DATA_PTR_I1 (int*)(data[1]) a pointer to integer 1
GUI_OBJ_TYP(*mo) returns widgetType
GUI_OBJ_SRC(*mo) returns gui-widget-nr
GUI_obj_cmp(*mo,*mo) compare 2 MemObj's
GUI_OBJ_IS_VALID test if GUI-object is valid; 1 is OK; 0 is invalid obj.
GUI_SETDAT_E() create GUI_DATA-block ../gui_gtk/gtk_base.c
GUI_SETDAT_EI() create GUI_DATA-block ../gui_gtk/gtk_base.c
GUI_SETDAT_ES() create GUI_DATA-block ../gui_gtk/gtk_base.c
------ constants ---------
../gui/gui_types.h events, devices, keys, funcs, data-macros
../gui/gui_base.h objects; from ../gui/gui__.h
=====================================================
List_functions_start:
GUI_obj_init get a new memBlockId <UI_umbId>
GUI_obj_save save UI_tmpSpc -> memoryblock <UI_umbId>
GUI_obj_reset reset UI_tmpSpc to a previous position
GUI_obj_spc get address & memspc for new widget (in UI_tmpSpc)
GUI_obj_tmp get temporary object; only one possible.
GUI_obj_pos get widget-data-position from MemObj
GUI_obj_src get widget-nr from MemObj
GUI_obj_cmp compare 2 MemObj's INLINE
GUI_obj_free free the memBlock
GUI_obj_parentBox get widget-type & data data from MemObj; check for Box.
GUI_obj_typ get widget-type & widget-data from MemObj
GUI_obj__ get temporary block UI_tmpSpc
GUI_obj_destroy free memBlock from MemObj
GUI_obj_dump_mo dump MemObj
GUI_opts_get1 get 1-char-parameter from opts-string
List_functions_end:
=====================================================

Macro Definition Documentation

#define Typ_Error   0

U0 = undefined.

#define TMPSPC_SIZ   15000
#define TMPSPC_INC   15000

Function Documentation

char * GUI_Win_tit ( void *  gtkWin)
Memspc* GUI_obj__ ( )

GUI_obj__ get temporary block UI_tmpSpc

void GUI_obj_destroy ( void *  wo)

free memBlock from MemObj

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

int GUI_obj_reload ( MemObj o_par)
* reload the block <o_par->mbID> into UI_tmpSpc
*
int GUI_obj_reset ( void *  oPos)

GUI_obj_reset reset UI_tmpSpc to a previous position

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_tmp ( void **  oPos,
int  siz 
)

get temporary object; only one possible.

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
*
void GUI_obj_dump__ ( )
void GUI_obj_dump_mo ( MemObj mo)

dump MemObj

void GUI_obj_dump_o ( void *  go)

dump gui-object

int GUI_obj_src ( MemObj mo)

GUI_obj_src get widget-nr from MemObj

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);
*
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).
*
int GUI_obj_free ( MemObj mo)

free the memBlock

Variable Documentation

int UI_fontsizX
int UI_fontsizY
void* UI_MainWin
void* UI_act_wi
Memspc UI_tmpSpc =UME_NEW
static
void* UI_tmpPos = NULL
static
int UI_umbId
static
int UI_srcId
static
int GUI_FuncInit = UI_FuncInit
int GUI_FuncUCB1 = UI_FuncUCB1
int GUI_FuncUCB2 = UI_FuncUCB2
int GUI_FuncUCB3 = UI_FuncUCB3
int GUI_FuncUCB4 = UI_FuncUCB4
int GUI_FuncUCB5 = UI_FuncUCB5
int GUI_FuncUCB6 = UI_FuncUCB6
int GUI_FuncUCB7 = UI_FuncUCB7
int GUI_FuncUCB8 = UI_FuncUCB8
int GUI_FuncUCB9 = UI_FuncUCB9
int GUI_FuncUCB10 = UI_FuncUCB10
int GUI_FuncUCB11 = UI_FuncUCB11
int GUI_FuncUCB12 = UI_FuncUCB12
int GUI_FuncUCB13 = UI_FuncUCB13
int GUI_FuncWork = UI_FuncWork
int GUI_FuncExit = UI_FuncExit
int GUI_FuncKill = UI_FuncKill