gCAD3D 2.40
gui_gtk2/gtk_opengl.h File Reference

Go to the source code of this file.

Functions

MemObj GUI_gl__ (MemObj *o_par, void *fDraw, char *opts)
 
int GUI_gl_ev_move (MemObj *mo, void *fMove)
 
int GUI_gl_ev_button (MemObj *mo, void *fButton)
 
int GUI_gl_ev_key (MemObj *mo, void *fKey)
 
int GUI_gl_block (MemObj *mo, int mode)
 
int GUI_gl_draw (void *parent, void *event, MemObj mo)
 
int GUI_gl_move (void *parent, void *event, MemObj mo)
 
int GUI_gl_button (void *parent, void *event, MemObj mo)
 
int GUI_gl_key (void *parent, void *event, MemObj mo)
 
int GUI_gl_pending ()
 
int GUI_gl_size (int *x, int *y)
 
int GUI_gl_idle1 (void *data)
 

Function Documentation

MemObj GUI_gl__ ( MemObj o_par,
void *  fDraw,
char *  opts 
)
* GUI_gl__ get opengl-window; connect redraw- and resize-event
* Input:
* o_par parentBox
* fDraw callback-function redraw-, resize-event
* opts options; (HorSiz,VertSiz)
* HorSiz,VertSiz: size in characters; default is automatic size.
* negative values: size in pixels.
* 'e' = expand widget; default is fixed size.
* Examples: "" or "-500,-500" or "10e,e"
* "10e,e" horiz. size 10 chars, hor. and vert. expandable
*
* Prototypes:
* int fDraw (void *parent, void **data);
* // data=table of 3 pointers;
* GUI_DATA_EVENT=*(int*)data[0]=TYP_EventConfig|TYP_EventDraw|TYP_EventEnter
* parameters for TYP_EventConfig and TYP_EventDraw:
* GUI_DATA_I1 =*(int*)data[1]=window-width
* GUI_DATA_I2 =*(int*)data[2]=window-height
* parameters for TYP_EventEnter:
* GUI_DATA_I1 =*(int*)data[1]=keystate GUI_Modif_*
*
*
*
*
* GUI_gl__ get opengl-window; connect redraw- and resize-event
* Input:
* o_par parentBox
* fDraw callback-function redraw-, resize-event
* opts options; (HorSiz,VertSiz)
* HorSiz,VertSiz: size in characters; default is automatic size.
* negative values: size in pixels.
* 'e' = expand widget; default is fixed size.
* Examples: "" or "-500,-500" or "10e,e"
* "10e,e" horiz. size 10 chars, hor. and vert. expandable
*
* Prototypes:
* int fDraw (void *parent, void **data);
* // data=table of 3 pointers;
* GUI_DATA_EVENT=*(int*)data[0]=TYP_EventConfig|TYP_EventDraw|TYP_EventEnter
* parameters for TYP_EventConfig and TYP_EventDraw:
* GUI_DATA_I1 =*(int*)data[1]=window-width
* GUI_DATA_I2 =*(int*)data[2]=window-height
* parameters for TYP_EventEnter:
* GUI_DATA_I1 =*(int*)data[1]=keystate GUI_Modif_*
*
*
*
*
int GUI_gl_ev_move ( MemObj mo,
void *  fMove 
)
* add callback for mouse-move-events in OpenGL-window
* Input:
* mo OpenGL-window-obj
* fMove callback-function move-event
*
* prototype:
* int fMove (MemObj *mo, void **data);
* // data=table of 3 pointers;
* GUI_DATA_EVENT=*(int*)data[0]=TYP_EventMove
* GUI_DATA_I1 =*(int*)data[2]=x-val mousepos in screencoords
* GUI_DATA_I2 =*(int*)data[3]=y-val mousepos in screencoords
*
* printf(" x=%d y=%d\n",GUI_DATA_I1,GUI_DATA_I2);
*
*
* add callback for mouse-move-events in OpenGL-window
* Input:
* mo OpenGL-window-obj
* fMove callback-function move-event
*
* prototype:
* int fMove (MemObj *mo, void **data);
* // data=table of 3 pointers;
* GUI_DATA_EVENT=*(int*)data[0]=TYP_EventMove
* GUI_DATA_I1 =*(int*)data[2]=x-val mousepos in screencoords
* GUI_DATA_I2 =*(int*)data[3]=y-val mousepos in screencoords
*
* printf(" x=%d y=%d\n",GUI_DATA_I1,GUI_DATA_I2);
*
*
int GUI_gl_ev_button ( MemObj mo,
void *  fButton 
)
* add callback for the mouse-button event
* Input:
* mo OpenGL-window-obj
* fButton callback-function mouse-button event
*
* prototype:
* int fButton (MemObj *mo, void **data);
* // data=table of 2 pointers
* GUI_DATA_EVENT=*(int*)data[0]=TYP_EventPress|TYP_EventRelease
* GUI_DATA_I1 =*(int*)data[1]=TYP_DeviceMouse
* GUI_DATA_I2 =*(int*)data[2]=GUI_MouseL| left mousebutton
* GUI_MouseM| mid mousebutton
* GUI_MouseR| right mousebutton
* GUI_MouseScUp| mouse scroll up
* GUI_MouseScDown mouse scroll down
*
* printf(" button=%d\n",GUI_DATA_I1);
*
*
* add callback for the mouse-button event
* Input:
* mo OpenGL-window-obj
* fButton callback-function mouse-button event
*
* prototype:
* int fButton (MemObj *mo, void **data);
* // data=table of 2 pointers
* GUI_DATA_EVENT=*(int*)data[0]=TYP_EventPress|TYP_EventRelease
* GUI_DATA_I1 =*(int*)data[1]=TYP_DeviceMouse
* GUI_DATA_I2 =*(int*)data[2]=GUI_MouseL| left mousebutton
* GUI_MouseM| mid mousebutton
* GUI_MouseR| right mousebutton
* GUI_MouseScUp| mouse scroll up
* GUI_MouseScDown mouse scroll down
*
* printf(" button=%d\n",GUI_DATA_I1);
*
*
int GUI_gl_ev_key ( MemObj mo,
void *  fKey 
)
* add callback for the key-events
* Input:
* mo OpenGL-window-obj
* fKey callback-function key-events
*
* prototyp fKey:
* int fKey (MemObj *mo, void **data);
* // data=table of 3 pointers
* GUI_DATA_EVENT =*(int*)data[0]=TYP_EventPress|TYP_EventRelease
* GUI_DATA_I1 =*(int*)data[1]=TYP_DeviceKeyb
* GUI_DATA_I2 =*(int*)data[2]=keyvalue; eg 'a'
* GUI_DATA_I3 =*(int*)data[3]=state of modifierkeys;
* see ../gui/gui_types.h GUI_Modif_*
* &1=shift; &4=ctrl; &8=alt.
* Returncodes: 0=continue with defaultOperations for this key.
* 1=do no defaultOperations; skip handling this key
*
* printf(" key=%d\n",GUI_DATA_I1);
*
* Example see GUI_entry__
*
* add callback for the key-events
* Input:
* mo OpenGL-window-obj
* fKey callback-function key-events
*
* prototyp fKey:
* int fKey (MemObj *mo, void **data);
* // data=table of 3 pointers
* GUI_DATA_EVENT=*(int*)data[0]=TYP_EventPress|TYP_EventRelease
* GUI_DATA_I1 =*(int*)data[1]=TYP_DeviceKeyb
* GUI_DATA_I2 =*(int*)data[2]=keyvalue; eg 'a'
* GUI_DATA_I3 =*(int*)data[3]=state of modifierkeys;
* see ../gui/gui_types.h GUI_Modif_*
* &1=shift; &4=ctrl; &8=alt.
* Returncodes: 0=continue with defaultOperations for this key.
* 1=do no defaultOperations; skip handling this key
*
* printf(" key=%d\n",GUI_DATA_I1);
*
* Example see GUI_entry__
*
int GUI_gl_block ( MemObj mo,
int  mode 
)
* block (1) or unblock (0) input
* Blocks scroll-events, key-events, button-events and move-events.
* mo OpenGL-window-obj
*
* block (1) or unblock (0) input
* Blocks scroll-events, key-events, button-events and move-events.
* mo OpenGL-window-obj
*
int GUI_gl_draw ( void *  parent,
void *  event,
MemObj  mo 
)

INTERNAL draw / expose & config-callback

INTERNAL draw / expose & config-callback

int GUI_gl_move ( void *  parent,
void *  event,
MemObj  mo 
)

INTERNAL

INTERNAL

int GUI_gl_button ( void *  parent,
void *  event,
MemObj  mo 
)

INTERNAL

INTERNAL

int GUI_gl_key ( void *  parent,
void *  event,
MemObj  mo 
)

INTERNAL

INTERNAL

int GUI_gl_pending ( )
int GUI_gl_size ( int *  x,
int *  y 
)
int GUI_gl_idle1 ( void *  data)
* INTERNAL draw must be last call
* return 0; // removes idle-Call!
* return 1; // keep idle-Call; call AP_Idle_CB again.
*
* INTERNAL draw must be last call
* return 0; // removes idle-Call!
* return 1; // keep idle-Call; call AP_Idle_CB again.
*