3 * ***** BEGIN GPL LICENSE BLOCK *****
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
20 * All rights reserved.
22 * The Original Code is: all of this file.
24 * Contributor(s): none yet.
26 * ***** END GPL LICENSE BLOCK *****
29 #ifndef _GHOST_TYPES_H_
30 #define _GHOST_TYPES_H_
32 typedef char GHOST_TInt8;
33 typedef unsigned char GHOST_TUns8;
34 typedef short GHOST_TInt16;
35 typedef unsigned short GHOST_TUns16;
36 typedef int GHOST_TInt32;
37 typedef unsigned int GHOST_TUns32;
40 #define WM_BLND_NDOF_AXIS WM_USER + 1
41 #define WM_BLND_NDOF_BTN WM_USER + 2
44 #if defined(WIN32) && !defined(FREE_WINDOWS)
45 typedef __int64 GHOST_TInt64;
46 typedef unsigned __int64 GHOST_TUns64;
48 typedef long long GHOST_TInt64;
49 typedef unsigned long long GHOST_TUns64;
52 typedef void* GHOST_TUserDataPtr;
60 /* Xtilt and Ytilt represent how much the pen is tilted away from
61 * vertically upright in either the X or Y direction, with X and Y the
62 * axes of the tablet surface.
63 * In other words, Xtilt and Ytilt are components of a vector created by projecting
64 * the pen's angle in 3D space vertically downwards on to the XY plane
67 typedef struct GHOST_TabletData {
68 char Active; /* 0=None, 1=Stylus, 2=Eraser */
69 float Pressure; /* range 0.0 (not touching) to 1.0 (full pressure) */
70 float Xtilt; /* range 0.0 (upright) to 1.0 (tilted fully against the tablet surface) */
71 float Ytilt; /* as above */
76 GHOST_kNotVisible = 0,
77 GHOST_kPartiallyVisible,
83 GHOST_kFireTimeNever = 0xFFFFFFFF
84 } GHOST_TFireTimeConstant;
87 GHOST_kModifierKeyLeftShift = 0,
88 GHOST_kModifierKeyRightShift,
89 GHOST_kModifierKeyLeftAlt,
90 GHOST_kModifierKeyRightAlt,
91 GHOST_kModifierKeyLeftControl,
92 GHOST_kModifierKeyRightControl,
93 GHOST_kModifierKeyCommand, // APPLE only
94 GHOST_kModifierKeyNumMasks
95 } GHOST_TModifierKeyMask;
99 GHOST_kWindowStateNormal = 0,
100 GHOST_kWindowStateMaximized,
101 GHOST_kWindowStateMinimized,
102 GHOST_kWindowStateFullScreen,
103 GHOST_kWindowStateEmbedded,
104 GHOST_kWindowState8Normal = 8,
105 GHOST_kWindowState8Maximized,
106 GHOST_kWindowState8Minimized,
107 GHOST_kWindowState8FullScreen,
108 GHOST_kWindowStateModified,
109 GHOST_kWindowStateUnModified
110 } GHOST_TWindowState;
114 GHOST_kWindowOrderTop = 0,
115 GHOST_kWindowOrderBottom
116 } GHOST_TWindowOrder;
120 GHOST_kDrawingContextTypeNone = 0,
121 GHOST_kDrawingContextTypeOpenGL
122 } GHOST_TDrawingContextType;
126 GHOST_kButtonMaskLeft = 0,
127 GHOST_kButtonMaskMiddle,
128 GHOST_kButtonMaskRight,
129 GHOST_kButtonNumMasks
134 GHOST_kEventUnknown = 0,
136 GHOST_kEventCursorMove, /// Mouse move event
137 GHOST_kEventButtonDown, /// Mouse button event
138 GHOST_kEventButtonUp, /// Mouse button event
139 GHOST_kEventWheel, /// Mouse wheel event
141 GHOST_kEventNDOFMotion, /// N degree of freedom device motion event
142 GHOST_kEventNDOFButton, /// N degree of freedom device button event
146 // GHOST_kEventKeyAuto,
150 GHOST_kEventWindowClose,
151 GHOST_kEventWindowActivate,
152 GHOST_kEventWindowDeactivate,
153 GHOST_kEventWindowUpdate,
154 GHOST_kEventWindowSize,
155 GHOST_kEventWindowMove,
164 GHOST_kStandardCursorFirstCursor = 0,
165 GHOST_kStandardCursorDefault = 0,
166 GHOST_kStandardCursorRightArrow,
167 GHOST_kStandardCursorLeftArrow,
168 GHOST_kStandardCursorInfo,
169 GHOST_kStandardCursorDestroy,
170 GHOST_kStandardCursorHelp,
171 GHOST_kStandardCursorCycle,
172 GHOST_kStandardCursorSpray,
173 GHOST_kStandardCursorWait,
174 GHOST_kStandardCursorText,
175 GHOST_kStandardCursorCrosshair,
176 GHOST_kStandardCursorUpDown,
177 GHOST_kStandardCursorLeftRight,
178 GHOST_kStandardCursorTopSide,
179 GHOST_kStandardCursorBottomSide,
180 GHOST_kStandardCursorLeftSide,
181 GHOST_kStandardCursorRightSide,
182 GHOST_kStandardCursorTopLeftCorner,
183 GHOST_kStandardCursorTopRightCorner,
184 GHOST_kStandardCursorBottomRightCorner,
185 GHOST_kStandardCursorBottomLeftCorner,
186 GHOST_kStandardCursorCustom,
187 GHOST_kStandardCursorNumCursors,
188 GHOST_kStandardCursorPencil
189 } GHOST_TStandardCursor;
193 GHOST_kKeyUnknown = -1,
198 GHOST_kKeyEnter = 0x0D,
200 GHOST_kKeyEsc = 0x1B,
201 GHOST_kKeySpace = ' ',
202 GHOST_kKeyQuote = 0x27,
203 GHOST_kKeyComma = ',',
204 GHOST_kKeyMinus = '-',
205 GHOST_kKeyPeriod = '.',
206 GHOST_kKeySlash = '/',
220 GHOST_kKeySemicolon = ';',
221 GHOST_kKeyEqual = '=',
251 GHOST_kKeyLeftBracket = '[',
252 GHOST_kKeyRightBracket = ']',
253 GHOST_kKeyBackslash = 0x5C,
254 GHOST_kKeyAccentGrave = '`',
257 GHOST_kKeyLeftShift = 0x100,
258 GHOST_kKeyRightShift,
259 GHOST_kKeyLeftControl,
260 GHOST_kKeyRightControl,
263 GHOST_kKeyCommand, // APPLE only!
264 GHOST_kKeyGrLess , // German PC only!
268 GHOST_kKeyScrollLock,
271 GHOST_kKeyRightArrow,
275 GHOST_kKeyPrintScreen,
296 GHOST_kKeyNumpadPeriod,
297 GHOST_kKeyNumpadEnter,
298 GHOST_kKeyNumpadPlus,
299 GHOST_kKeyNumpadMinus,
300 GHOST_kKeyNumpadAsterisk,
301 GHOST_kKeyNumpadSlash,
331 typedef void* GHOST_TEventDataPtr;
334 /** The x-coordinate of the cursor position. */
336 /** The y-coordinate of the cursor position. */
338 } GHOST_TEventCursorData;
341 /** The mask of the mouse button. */
342 GHOST_TButtonMask button;
343 } GHOST_TEventButtonData;
346 /** Displacement of a mouse wheel. */
348 } GHOST_TEventWheelData;
351 /* original patch used floats, but the driver return ints and uns. We will calibrate in view, no sense on doing conversions twice */
352 /* as all USB device controls are likely to use ints, this is also more future proof */
354 // /** N-degree of freedom device data */
355 // float tx, ty, tz; /** -x left, +y up, +z forward */
358 //} GHOST_TEventNDOFData;
361 /** N-degree of freedom device data v2*/
364 GHOST_TUns64 address;
365 GHOST_TInt16 tx, ty, tz; /** -x left, +y up, +z forward */
366 GHOST_TInt16 rx, ry, rz;
367 GHOST_TInt16 buttons;
370 } GHOST_TEventNDOFData;
372 typedef int (*GHOST_NDOFLibraryInit_fp)();
373 typedef void (*GHOST_NDOFLibraryShutdown_fp)(void* deviceHandle);
374 typedef void* (*GHOST_NDOFDeviceOpen_fp)(void* platformData);
376 // original patch windows callback. In mac os X version the callback is internal to the plug-in and post an event to main thead.
377 // not necessary faster, but better integration with other events.
379 //typedef int (*GHOST_NDOFEventHandler_fp)(float* result7, void* deviceHandle, unsigned int message, unsigned int* wParam, unsigned long* lParam);
380 //typedef void (*GHOST_NDOFCallBack_fp)(GHOST_TEventNDOFDataV2 *VolDatas);
385 /** The ascii code for the key event ('\0' if none). */
387 } GHOST_TEventKeyData;
390 /** Number of pixels on a line. */
391 GHOST_TUns32 xPixels;
392 /** Number of lines. */
393 GHOST_TUns32 yPixels;
394 /** Numberof bits per pixel. */
396 /** Refresh rate (in Hertz). */
397 GHOST_TUns32 frequency;
398 } GHOST_DisplaySetting;
402 typedef long GHOST_TEmbedderWindowID;
406 // I can't use "Window" from "<X11/Xlib.h>" because it conflits with Window defined in winlay.h
407 typedef int GHOST_TEmbedderWindowID;
411 * A timer task callback routine.
412 * @param task The timer task object.
413 * @param time The current time.
416 class GHOST_ITimerTask;
417 typedef void (*GHOST_TimerProcPtr)(GHOST_ITimerTask* task, GHOST_TUns64 time);
419 struct GHOST_TimerTaskHandle__;
420 typedef void (*GHOST_TimerProcPtr)(struct GHOST_TimerTaskHandle__* task, GHOST_TUns64 time);
423 #endif // _GHOST_TYPES_H_