FreeWRL / FreeX3D
4.3.0
common.h
1
/*
2
3
FreeWRL support library.
4
5
Purpose:
6
Common UI for all platforms.
7
8
Data:
9
Handle internal FreeWRL library variables related to UI.
10
11
Functions:
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
28
void
fwl_setTrap(
int
);
29
int
fwl_getTrap();
30
31
/* Status update functions */
32
33
void
setMenuFps(
float
fps);
34
void
setMenuStatus(
char
*stat);
35
void
setMenuStatusVP(
char
*stat);
36
char
* getMenuStatus();
37
void
setMessageBar();
38
39
/* Generic (virtual) update functions */
40
int
getJsEngine();
41
int
getJsEngineVariant();
42
void
loadCursors();
43
void
setCursor();
44
void
setArrowCursor();
45
void
setSensorCursor();
46
void
setLookatCursor();
47
void
setWindowTitle0();
48
void
setWindowTitle();
49
char
*getMessageBar();
50
char
*getFpsBar();
51
char
*getWindowTitle();
52
void
updateCursorStyle();
53
int
getCursorStyle();
54
void
update_status(
char
* msg);
55
void
kill_status();
56
char
*get_status();
57
char
*getMenuStatus();
58
void
showConsoleText(
int
on);
59
int
getShowConsoleText();
60
void
fwl_setDrawBoundingBoxes(
int
drawbb);
61
int
fwl_getDrawBoundingBoxes();
62
void
fwl_set_depth_slices(
int
nslices);
63
int
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
70
This needs to be included where the platform-specific key event handler is, so a
71
platform-specific int platform2web3dActionKeyPLATFORM_NAME(int platformKey)
72
function can refer to them, to send in web3d key equivalents, or at least FW neutral keys.
73
If a platform key, after lookup, is in this list, then call:
74
fwl_do_rawKeypress(actionKey,updown+10);
75
section 21.4.1
76
Key Value
77
Home 13
78
End 14
79
PGUP 15
80
PGDN 16
81
UP 17
82
DOWN 18
83
LEFT 19
84
RIGHT 20
85
F1-F12 1 to 12
86
ALT,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__ */
src
lib
ui
common.h
Generated by
1.11.0