1 /*
2 ** d_gui.h
3 **
4 **---------------------------------------------------------------------------
5 ** Copyright 1998-2006 Randy Heit
6 ** All rights reserved.
7 **
8 ** Redistribution and use in source and binary forms, with or without
9 ** modification, are permitted provided that the following conditions
10 ** are met:
11 **
12 ** 1. Redistributions of source code must retain the above copyright
13 **    notice, this list of conditions and the following disclaimer.
14 ** 2. Redistributions in binary form must reproduce the above copyright
15 **    notice, this list of conditions and the following disclaimer in the
16 **    documentation and/or other materials provided with the distribution.
17 ** 3. The name of the author may not be used to endorse or promote products
18 **    derived from this software without specific prior written permission.
19 **
20 ** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 ** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 **---------------------------------------------------------------------------
31 **
32 ** So when do I get a real UT-like windowing system?
33 */
34 
35 #ifndef __D_GUI_H__
36 #define __D_GUI_H__
37 
38 // For a GUIEvent, x and y specify absolute location of mouse pointer
39 enum EGUIEvent
40 {
41 	EV_GUI_None,
42 	EV_GUI_KeyDown,			// data1: unshifted ASCII, data2: shifted ASCII, data3: modifiers
43 	EV_GUI_KeyRepeat,		// same
44 	EV_GUI_KeyUp,			// same
45 	EV_GUI_Char,			// data1: translated character (for user text input), data2: alt down?
46 	EV_GUI_FirstMouseEvent,
47 		EV_GUI_MouseMove,
48 		EV_GUI_LButtonDown,
49 		EV_GUI_LButtonUp,
50 		EV_GUI_LButtonDblClick,
51 		EV_GUI_MButtonDown,
52 		EV_GUI_MButtonUp,
53 		EV_GUI_MButtonDblClick,
54 		EV_GUI_RButtonDown,
55 		EV_GUI_RButtonUp,
56 		EV_GUI_RButtonDblClick,
57 		EV_GUI_WheelUp,			// data3: shift/ctrl/alt
58 		EV_GUI_WheelDown,		// "
59 		EV_GUI_WheelRight,		// "
60 		EV_GUI_WheelLeft,		// "
61 		EV_GUI_BackButtonDown,
62 		EV_GUI_BackButtonUp,
63 		EV_GUI_FwdButtonDown,
64 		EV_GUI_FwdButtonUp,
65 	EV_GUI_LastMouseEvent,
66 };
67 
68 enum GUIKeyModifiers
69 {
70 	GKM_SHIFT	= 1,
71 	GKM_CTRL	= 2,
72 	GKM_ALT		= 4,
73 	GKM_META	= 8,
74 	GKM_LBUTTON = 16
75 };
76 
77 // Special codes for some GUI keys, including a few real ASCII codes.
78 enum ESpecialGUIKeys
79 {
80 	GK_PGDN		= 1,
81 	GK_PGUP		= 2,
82 	GK_HOME		= 3,
83 	GK_END		= 4,
84 	GK_LEFT		= 5,
85 	GK_RIGHT	= 6,
86 	GK_ALERT	= 7,		// ASCII bell
87 	GK_BACKSPACE= 8,		// ASCII
88 	GK_TAB		= 9,		// ASCII
89 	GK_LINEFEED	= 10,		// ASCII
90 	GK_DOWN		= 10,
91 	GK_VTAB		= 11,		// ASCII
92 	GK_UP		= 11,
93 	GK_FORMFEED	= 12,		// ASCII
94 	GK_RETURN	= 13,		// ASCII
95 	GK_F1		= 14,
96 	GK_F2		= 15,
97 	GK_F3		= 16,
98 	GK_F4		= 17,
99 	GK_F5		= 18,
100 	GK_F6		= 19,
101 	GK_F7		= 20,
102 	GK_F8		= 21,
103 	GK_F9		= 22,
104 	GK_F10		= 23,
105 	GK_F11		= 24,
106 	GK_F12		= 25,
107 	GK_DEL		= 26,
108 	GK_ESCAPE	= 27,		// ASCII
109 	GK_FREE1	= 28,
110 	GK_FREE2	= 29,
111 	GK_BACK		= 30,		// browser back key
112 	GK_CESCAPE	= 31		// color escape
113 };
114 
115 #endif //__D_GUI_H__
116