FreeWRL / FreeX3D 4.3.0
common.h
1/*
2
3 FreeWRL support library.
4
5Purpose:
6 Common UI for all platforms.
7
8Data:
9 Handle internal FreeWRL library variables related to UI.
10
11Functions:
12 Update internal FreeWRL library variables related to UI.
13 NO PLATFORM SPECIFIC CODE HERE. ALL GENERIC CODE.
14
15*/
16
17#ifndef __LIBFREEWRL_UI_COMMON_H__
18#define __LIBFREEWRL_UI_COMMON_H__
19
20
21/* Generic declarations */
22
23#define SCURSE 1 //sensor hand
24#define ACURSE 0 //arrow
25#define NCURSE 2 //none
26
27//debugging functions
28void fwl_setTrap(int);
29int fwl_getTrap();
30
31/* Status update functions */
32
33void setMenuFps(float fps);
34void setMenuStatusVP(char *stat);
35char* getMenuStatus();
36void setMessageBar();
37
38/* Generic (virtual) update functions */
39int getJsEngine();
40int getJsEngineVariant();
41void loadCursors();
42void setCursor(int);
43void setArrowCursor();
44void setSensorCursor();
45void setLookatCursor();
46void setWindowTitle0();
47void setWindowTitle();
48char *getMessageBar();
49char *getFpsBar();
50char *getWindowTitle();
51void updateCursorStyle();
52int getCursorStyle();
53void update_status(char* msg);
54void kill_status();
55char *get_status();
56char *getMenuStatus();
57void setSensorStatus(char*);
58char* getSensorStatus();
59void showConsoleText(int on);
60int getShowConsoleText();
61void fwl_setDrawBoundingBoxes(int drawbb);
62int fwl_getDrawBoundingBoxes();
63void fwl_set_depth_slices(int nslices);
64int fwl_get_depth_slices();
65void fwl_setShowViewpoints(int show);
66void fwl_setDrawRig(int draw);
67int fwl_getDrawRig();
68int fwl_getShowViewpoints();
69#ifdef _MSC_VER
70#define snprintf _snprintf
71#endif
72
73
74/* from http://www.web3d.org/files/specifications/19775-1/V3.2/Part01/components/keyboard.html#KeySensor
75This needs to be included where the platform-specific key event handler is, so a
76platform-specific int platform2web3dActionKeyPLATFORM_NAME(int platformKey)
77function can refer to them, to send in web3d key equivalents, or at least FW neutral keys.
78If a platform key, after lookup, is in this list, then call:
79fwl_do_rawKeypress(actionKey,updown+10);
80section 21.4.1
81Key Value
82Home 13
83End 14
84PGUP 15
85PGDN 16
86UP 17
87DOWN 18
88LEFT 19
89RIGHT 20
90F1-F12 1 to 12
91ALT,CTRL,SHIFT true/false
92*/
93#define F1_KEY 1
94#define F2_KEY 2
95#define F3_KEY 3
96#define F4_KEY 4
97#define F5_KEY 5
98#define F6_KEY 6
99#define F7_KEY 7
100#define F8_KEY 8
101#define F9_KEY 9
102#define F10_KEY 10
103#define F11_KEY 11
104#define F12_KEY 12
105#define HOME_KEY 13
106#define END_KEY 14
107#define PGUP_KEY 15
108#define PGDN_KEY 16
109#define UP_KEY 17
110#define DOWN_KEY 18
111#define LEFT_KEY 19
112#define RIGHT_KEY 20
113#define ALT_KEY 30 /* not available on OSX */
114#define CTL_KEY 31 /* not available on OSX */
115#define SFT_KEY 32 /* not available on OSX */
116#define DEL_KEY 0XFFFF /* problem: I'm insterting this back into the translated char stream so 0XFFFF too high to clash with a latin? */
117#define RTN_KEY 13 //what about 10 newline?
118#define NUM0 40
119#define NUM1 41
120#define NUM2 42
121#define NUM3 43
122#define NUM4 44
123#define NUM5 45
124#define NUM6 46
125#define NUM7 47
126#define NUM8 48
127#define NUM9 49
128#define NUMDEC 50
129
130#define JSENGINE_STUB 0
131#define JSENGINE_DUK 1
132#define JSENGINE_SM 2
133
134#endif /* __LIBFREEWRL_UI_COMMON_H__ */