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