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