HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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,
26  int poll, short xres, short yres);
27 
28 
29 #define MAX_KEYS 47
30 
31 typedef enum
32 {
81 
82 } UT_Key;
83 
85 
86 public:
87 
89  short mx;
90  short my;
91 
92 
93  unsigned alt_state : 1,
94  ctl_state : 1,
95  key_state : 1;
96 };
97 
99 
100 public:
101 
102  UT_Intercept();
103  ~UT_Intercept();
104 
105  int numListeners(void) const
106  { return myListeners.entries(); }
107 
108  int addListener(UT_InterceptCallback func, void *data);
109  void removeListener(int idx);
110 
111  int distributeEvent(UT_InterceptEvent *event);
112 
113  void setPollMode(int mode)
114  { myPollMode = mode; }
115 
116  int getPollMode() const
117  { return myPollMode; }
118 
119  void setModeNotifier(void *data)
120  { myModeNotifier = data; }
121 
122  void *getModeNotifier() const
123  { return myModeNotifier; }
124 
125  void setResolution(short x, short y)
126  { myResolutionX = x; myResolutionY = y;}
127 
128 private:
129 
131  UT_ValArray<void *> myData;
132  int myPollMode;
133  short myResolutionX;
134  short myResolutionY;
135  void *myModeNotifier;
136 };
137 
138 UT_API extern UT_Intercept *UTgetIntercept(); // Get the app intercept ptr
139 
140 #endif
141 
UT_Key
Definition: UT_Intercept.h:31
void setModeNotifier(void *data)
Definition: UT_Intercept.h:119
#define UT_API
Definition: UT_API.h:12
GLint y
Definition: glcorearb.h:102
struct _cl_event * event
Definition: glcorearb.h:2960
void setResolution(short x, short y)
Definition: UT_Intercept.h:125
int getPollMode() const
Definition: UT_Intercept.h:116
GLboolean * data
Definition: glcorearb.h:130
void setPollMode(int mode)
Definition: UT_Intercept.h:113
GLenum mode
Definition: glcorearb.h:98
GLenum func
Definition: glcorearb.h:782
UT_API UT_Intercept * UTgetIntercept()
typedef int
Definition: png.h:1175
GLint GLenum GLint x
Definition: glcorearb.h:408
int numListeners(void) const
Definition: UT_Intercept.h:105
void * getModeNotifier() const
Definition: UT_Intercept.h:122
int(* UT_InterceptCallback)(int handle_idx, void *data, UT_InterceptEvent *event, int poll, short xres, short yres)
Definition: UT_Intercept.h:24