HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
UT_Intercept.h
Go to the documentation of this file.
1
/*
2
* PROPRIETARY INFORMATION. This software is proprietary to
3
* Side Effects Software Inc., and is not to be reproduced,
4
* transmitted, or disclosed in any way without written permission.
5
*
6
* NAME: UT_Intercept.h ( UT Library, C++)
7
*
8
* COMMENTS:
9
*
10
* This class is used to intercept and reroute
11
* input events to interested listeners.
12
*
13
*/
14
15
#ifndef __UT_Intercept__
16
#define __UT_Intercept__
17
18
#include "
UT_API.h
"
19
#include "
UT_ValArray.h
"
20
21
22
class
UT_InterceptEvent
;
23
24
typedef
int
(*
UT_InterceptCallback
)(
int
handle_idx,
void
*
data
,
25
UT_InterceptEvent
*
event
,
26
int
poll,
short
xres,
short
yres);
27
28
29
enum
UT_Key
:
int
30
{
31
UT_KEY_INVALID
= 0,
32
// Values of 0x00000001 through 0x0010FFFF represent unicode code points.
33
//
34
// We provide enumerators for a very small subset of these here. Which
35
// values in this range are actually used will depend on the keyboard
36
// layout. We generally use the upper-case code point for any code point
37
// that is considered lower-case.
38
//
39
// Some of the keys representing control characters have special values
40
// that differ from their unicode code point.
41
42
UT_KEY_ZERO
= 0x30,
43
UT_KEY_ONE
= 0x31,
44
UT_KEY_TWO
= 0x32,
45
UT_KEY_THREE
= 0x33,
46
UT_KEY_FOUR
= 0x34,
47
UT_KEY_FIVE
= 0x35,
48
UT_KEY_SIX
= 0x36,
49
UT_KEY_SEVEN
= 0x37,
50
UT_KEY_EIGHT
= 0x38,
51
UT_KEY_NINE
= 0x39,
52
UT_KEY_A
= 0x41,
53
UT_KEY_B
= 0x42,
54
UT_KEY_C
= 0x43,
55
UT_KEY_D
= 0x44,
56
UT_KEY_E
= 0x45,
57
UT_KEY_F
= 0x46,
58
UT_KEY_G
= 0x47,
59
UT_KEY_H
= 0x48,
60
UT_KEY_I
= 0x49,
61
UT_KEY_J
= 0x4A,
62
UT_KEY_K
= 0x4B,
63
UT_KEY_L
= 0x4C,
64
UT_KEY_M
= 0x4D,
65
UT_KEY_N
= 0x4E,
66
UT_KEY_O
= 0x4F,
67
UT_KEY_P
= 0x50,
68
UT_KEY_Q
= 0x51,
69
UT_KEY_R
= 0x52,
70
UT_KEY_S
= 0x53,
71
UT_KEY_T
= 0x54,
72
UT_KEY_U
= 0x55,
73
UT_KEY_V
= 0x56,
74
UT_KEY_W
= 0x57,
75
UT_KEY_X
= 0x58,
76
UT_KEY_Y
= 0x59,
77
UT_KEY_Z
= 0x5A,
78
79
UT_KEY_SEMICOLON
= 0x3B,
80
UT_KEY_COMMA
= 0x2C,
81
UT_KEY_PERIOD
= 0x2E,
82
UT_KEY_QUOTE
= 0x27,
83
UT_KEY_LEFTBRACKET
= 0x5B,
84
UT_KEY_RIGHTBRACKET
= 0x5D,
85
UT_KEY_MINUS
= 0x2D,
86
UT_KEY_EQUAL
= 0x3D,
87
UT_KEY_SLASH
= 0x2F,
88
UT_KEY_BACKSLASH
= 0x5C,
89
90
// Values for special keys not represented by a unicode code point start
91
// at 0x00110000.
92
93
UT_KEY_PAD0
= 0x00110000,
94
UT_KEY_PAD1
= 0x00110001,
95
UT_KEY_PAD2
= 0x00110002,
96
UT_KEY_PAD3
= 0x00110003,
97
UT_KEY_PAD4
= 0x00110004,
98
UT_KEY_PAD5
= 0x00110005,
99
UT_KEY_PAD6
= 0x00110006,
100
UT_KEY_PAD7
= 0x00110007,
101
UT_KEY_PAD8
= 0x00110008,
102
UT_KEY_PAD9
= 0x00110009,
103
UT_KEY_ESC
= 0x0011000A,
104
UT_KEY_SPACE
= 0x0011000B,
105
106
};
107
108
// The following sentinel should only be used for validity checks, not for
109
// allocating fixed size arrays.
110
#define UT_KEY_MAX UT_KEY_SPACE;
111
112
class
UT_API
UT_InterceptEvent
{
113
114
public
:
115
116
UT_Key
key
;
117
short
mx
;
118
short
my
;
119
120
121
unsigned
alt_state : 1,
122
ctl_state : 1,
123
key_state : 1;
124
};
125
126
class
UT_API
UT_Intercept
127
{
128
public
:
129
130
UT_Intercept
();
131
132
int
numListeners
()
const
133
{
return
myListeners.entries(); }
134
135
int
addListener(
UT_InterceptCallback
func
,
void
*
data
);
136
void
removeListener(
int
idx);
137
138
int
distributeEvent(
UT_InterceptEvent
*
event
);
139
140
void
setPollMode
(
int
mode
)
141
{ myPollMode =
mode
; }
142
143
int
getPollMode
()
const
144
{
return
myPollMode; }
145
146
void
setModeNotifier
(
void
*
data
)
147
{ myModeNotifier =
data
; }
148
149
void
*
getModeNotifier
()
const
150
{
return
myModeNotifier; }
151
152
void
setResolution
(
short
x
,
short
y
)
153
{ myResolutionX =
x
; myResolutionY =
y
;}
154
155
private
:
156
157
UT_ValArray<UT_InterceptCallback>
myListeners;
158
UT_ValArray<void *>
myData;
159
int
myPollMode;
160
short
myResolutionX;
161
short
myResolutionY;
162
void
*myModeNotifier;
163
};
164
165
UT_API
extern
UT_Intercept
*
UTgetIntercept
();
// Get the app intercept ptr
166
167
#endif
168
UT_Intercept
Definition:
UT_Intercept.h:126
UT_KEY_PERIOD
Definition:
UT_Intercept.h:81
UT_KEY_Q
Definition:
UT_Intercept.h:68
int
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
UT_InterceptEvent
Definition:
UT_Intercept.h:112
UT_KEY_E
Definition:
UT_Intercept.h:56
UT_KEY_D
Definition:
UT_Intercept.h:55
UT_KEY_SEVEN
Definition:
UT_Intercept.h:49
UT_KEY_FOUR
Definition:
UT_Intercept.h:46
UT_KEY_BACKSLASH
Definition:
UT_Intercept.h:88
UT_KEY_PAD1
Definition:
UT_Intercept.h:94
UT_KEY_SPACE
Definition:
UT_Intercept.h:104
UT_KEY_F
Definition:
UT_Intercept.h:57
UT_KEY_K
Definition:
UT_Intercept.h:62
UT_KEY_S
Definition:
UT_Intercept.h:70
data
GLboolean * data
Definition:
glcorearb.h:131
UT_KEY_PAD3
Definition:
UT_Intercept.h:96
UT_KEY_X
Definition:
UT_Intercept.h:75
UT_KEY_ZERO
Definition:
UT_Intercept.h:42
UT_API.h
UT_InterceptEvent::my
short my
Definition:
UT_Intercept.h:118
UT_KEY_NINE
Definition:
UT_Intercept.h:51
UT_Intercept::setModeNotifier
void setModeNotifier(void *data)
Definition:
UT_Intercept.h:146
UT_API
#define UT_API
Definition:
UT_API.h:14
y
GLint y
Definition:
glcorearb.h:103
UT_KEY_R
Definition:
UT_Intercept.h:69
UT_KEY_J
Definition:
UT_Intercept.h:61
UT_ValArray< UT_InterceptCallback >
UT_KEY_PAD2
Definition:
UT_Intercept.h:95
UT_KEY_B
Definition:
UT_Intercept.h:53
UT_KEY_EQUAL
Definition:
UT_Intercept.h:86
UT_KEY_M
Definition:
UT_Intercept.h:64
event
struct _cl_event * event
Definition:
glcorearb.h:2961
UT_KEY_W
Definition:
UT_Intercept.h:74
UT_KEY_COMMA
Definition:
UT_Intercept.h:80
UT_KEY_ESC
Definition:
UT_Intercept.h:103
UT_KEY_PAD8
Definition:
UT_Intercept.h:101
UT_KEY_P
Definition:
UT_Intercept.h:67
UT_Intercept::setResolution
void setResolution(short x, short y)
Definition:
UT_Intercept.h:152
UT_KEY_TWO
Definition:
UT_Intercept.h:44
UT_KEY_SEMICOLON
Definition:
UT_Intercept.h:79
UT_ValArray.h
UT_KEY_LEFTBRACKET
Definition:
UT_Intercept.h:83
UT_KEY_A
Definition:
UT_Intercept.h:52
UT_KEY_THREE
Definition:
UT_Intercept.h:45
UT_Intercept::getPollMode
int getPollMode() const
Definition:
UT_Intercept.h:143
UT_KEY_I
Definition:
UT_Intercept.h:60
UT_KEY_Z
Definition:
UT_Intercept.h:77
UT_KEY_SLASH
Definition:
UT_Intercept.h:87
UT_InterceptEvent::key
UT_Key key
Definition:
UT_Intercept.h:116
UT_KEY_PAD9
Definition:
UT_Intercept.h:102
UT_KEY_G
Definition:
UT_Intercept.h:58
UT_KEY_ONE
Definition:
UT_Intercept.h:43
UT_KEY_PAD5
Definition:
UT_Intercept.h:98
UT_KEY_N
Definition:
UT_Intercept.h:65
x
GLint GLenum GLint x
Definition:
glcorearb.h:409
UT_Intercept::setPollMode
void setPollMode(int mode)
Definition:
UT_Intercept.h:140
UT_KEY_V
Definition:
UT_Intercept.h:73
UT_KEY_Y
Definition:
UT_Intercept.h:76
UT_KEY_C
Definition:
UT_Intercept.h:54
mode
GLenum mode
Definition:
glcorearb.h:99
UT_KEY_FIVE
Definition:
UT_Intercept.h:47
UT_InterceptEvent::mx
short mx
Definition:
UT_Intercept.h:117
UT_KEY_RIGHTBRACKET
Definition:
UT_Intercept.h:84
UT_KEY_PAD0
Definition:
UT_Intercept.h:93
func
GLenum func
Definition:
glcorearb.h:783
UTgetIntercept
UT_API UT_Intercept * UTgetIntercept()
UT_KEY_PAD6
Definition:
UT_Intercept.h:99
UT_KEY_EIGHT
Definition:
UT_Intercept.h:50
UT_KEY_L
Definition:
UT_Intercept.h:63
UT_KEY_INVALID
Definition:
UT_Intercept.h:31
UT_KEY_T
Definition:
UT_Intercept.h:71
UT_Key
UT_Key
Definition:
UT_Intercept.h:29
UT_KEY_U
Definition:
UT_Intercept.h:72
UT_Intercept::getModeNotifier
void * getModeNotifier() const
Definition:
UT_Intercept.h:149
UT_InterceptCallback
int(* UT_InterceptCallback)(int handle_idx, void *data, UT_InterceptEvent *event, int poll, short xres, short yres)
Definition:
UT_Intercept.h:24
UT_KEY_MINUS
Definition:
UT_Intercept.h:85
UT_KEY_PAD7
Definition:
UT_Intercept.h:100
UT_Intercept::numListeners
int numListeners() const
Definition:
UT_Intercept.h:132
UT_KEY_QUOTE
Definition:
UT_Intercept.h:82
UT_KEY_H
Definition:
UT_Intercept.h:59
UT_KEY_SIX
Definition:
UT_Intercept.h:48
data
Definition:
format.h:895
UT_KEY_O
Definition:
UT_Intercept.h:66
UT_KEY_PAD4
Definition:
UT_Intercept.h:97
UT
UT_Intercept.h
Generated on Tue Dec 17 2024 03:42:09 for HDK by
1.8.6