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
68 GHOST_kTabletModeNone = 0,
69 GHOST_kTabletModeStylus,
70 GHOST_kTabletModeEraser
73 typedef struct GHOST_TabletData {
74 GHOST_TTabletMode Active; /* 0=None, 1=Stylus, 2=Eraser */
75 float Pressure; /* range 0.0 (not touching) to 1.0 (full pressure) */
76 float Xtilt; /* range 0.0 (upright) to 1.0 (tilted fully against the tablet surface) */
77 float Ytilt; /* as above */
82 GHOST_kNotVisible = 0,
83 GHOST_kPartiallyVisible,
89 GHOST_kFireTimeNever = 0xFFFFFFFF
90 } GHOST_TFireTimeConstant;
93 GHOST_kModifierKeyLeftShift = 0,
94 GHOST_kModifierKeyRightShift,
95 GHOST_kModifierKeyLeftAlt,
96 GHOST_kModifierKeyRightAlt,
97 GHOST_kModifierKeyLeftControl,
98 GHOST_kModifierKeyRightControl,
99 GHOST_kModifierKeyCommand, // APPLE only
100 GHOST_kModifierKeyNumMasks
101 } GHOST_TModifierKeyMask;
105 GHOST_kWindowStateNormal = 0,
106 GHOST_kWindowStateMaximized,
107 GHOST_kWindowStateMinimized,
108 GHOST_kWindowStateFullScreen,
109 GHOST_kWindowStateEmbedded,
110 GHOST_kWindowState8Normal = 8,
111 GHOST_kWindowState8Maximized,
112 GHOST_kWindowState8Minimized,
113 GHOST_kWindowState8FullScreen,
114 GHOST_kWindowStateModified,
115 GHOST_kWindowStateUnModified
116 } GHOST_TWindowState;
119 /** Constants for the answer to the blender exit request */
121 GHOST_kExitCancel = 0,
123 } GHOST_TExitRequestResponse;
126 GHOST_kWindowOrderTop = 0,
127 GHOST_kWindowOrderBottom
128 } GHOST_TWindowOrder;
132 GHOST_kDrawingContextTypeNone = 0,
133 GHOST_kDrawingContextTypeOpenGL
134 } GHOST_TDrawingContextType;
138 GHOST_kButtonMaskLeft = 0,
139 GHOST_kButtonMaskMiddle,
140 GHOST_kButtonMaskRight,
141 GHOST_kButtonMaskButton4,
142 GHOST_kButtonMaskButton5,
143 GHOST_kButtonNumMasks
148 GHOST_kEventUnknown = 0,
150 GHOST_kEventCursorMove, /// Mouse move event
151 GHOST_kEventButtonDown, /// Mouse button event
152 GHOST_kEventButtonUp, /// Mouse button event
153 GHOST_kEventWheel, /// Mouse wheel event
155 GHOST_kEventNDOFMotion, /// N degree of freedom device motion event
156 GHOST_kEventNDOFButton, /// N degree of freedom device button event
160 // GHOST_kEventKeyAuto,
164 GHOST_kEventWindowClose,
165 GHOST_kEventWindowActivate,
166 GHOST_kEventWindowDeactivate,
167 GHOST_kEventWindowUpdate,
168 GHOST_kEventWindowSize,
169 GHOST_kEventWindowMove,
178 GHOST_kStandardCursorFirstCursor = 0,
179 GHOST_kStandardCursorDefault = 0,
180 GHOST_kStandardCursorRightArrow,
181 GHOST_kStandardCursorLeftArrow,
182 GHOST_kStandardCursorInfo,
183 GHOST_kStandardCursorDestroy,
184 GHOST_kStandardCursorHelp,
185 GHOST_kStandardCursorCycle,
186 GHOST_kStandardCursorSpray,
187 GHOST_kStandardCursorWait,
188 GHOST_kStandardCursorText,
189 GHOST_kStandardCursorCrosshair,
190 GHOST_kStandardCursorUpDown,
191 GHOST_kStandardCursorLeftRight,
192 GHOST_kStandardCursorTopSide,
193 GHOST_kStandardCursorBottomSide,
194 GHOST_kStandardCursorLeftSide,
195 GHOST_kStandardCursorRightSide,
196 GHOST_kStandardCursorTopLeftCorner,
197 GHOST_kStandardCursorTopRightCorner,
198 GHOST_kStandardCursorBottomRightCorner,
199 GHOST_kStandardCursorBottomLeftCorner,
200 GHOST_kStandardCursorCustom,
201 GHOST_kStandardCursorNumCursors,
202 GHOST_kStandardCursorPencil
203 } GHOST_TStandardCursor;
207 GHOST_kKeyUnknown = -1,
212 GHOST_kKeyEnter = 0x0D,
214 GHOST_kKeyEsc = 0x1B,
215 GHOST_kKeySpace = ' ',
216 GHOST_kKeyQuote = 0x27,
217 GHOST_kKeyComma = ',',
218 GHOST_kKeyMinus = '-',
219 GHOST_kKeyPeriod = '.',
220 GHOST_kKeySlash = '/',
234 GHOST_kKeySemicolon = ';',
235 GHOST_kKeyEqual = '=',
265 GHOST_kKeyLeftBracket = '[',
266 GHOST_kKeyRightBracket = ']',
267 GHOST_kKeyBackslash = 0x5C,
268 GHOST_kKeyAccentGrave = '`',
271 GHOST_kKeyLeftShift = 0x100,
272 GHOST_kKeyRightShift,
273 GHOST_kKeyLeftControl,
274 GHOST_kKeyRightControl,
277 GHOST_kKeyCommand, // APPLE only!
278 GHOST_kKeyGrLess , // German PC only!
282 GHOST_kKeyScrollLock,
285 GHOST_kKeyRightArrow,
289 GHOST_kKeyPrintScreen,
310 GHOST_kKeyNumpadPeriod,
311 GHOST_kKeyNumpadEnter,
312 GHOST_kKeyNumpadPlus,
313 GHOST_kKeyNumpadMinus,
314 GHOST_kKeyNumpadAsterisk,
315 GHOST_kKeyNumpadSlash,
345 typedef void* GHOST_TEventDataPtr;
348 /** The x-coordinate of the cursor position. */
350 /** The y-coordinate of the cursor position. */
352 } GHOST_TEventCursorData;
355 /** The mask of the mouse button. */
356 GHOST_TButtonMask button;
357 } GHOST_TEventButtonData;
360 /** Displacement of a mouse wheel. */
362 } GHOST_TEventWheelData;
365 /* original patch used floats, but the driver return ints and uns. We will calibrate in view, no sense on doing conversions twice */
366 /* as all USB device controls are likely to use ints, this is also more future proof */
368 // /** N-degree of freedom device data */
369 // float tx, ty, tz; /** -x left, +y up, +z forward */
372 //} GHOST_TEventNDOFData;
375 /** N-degree of freedom device data v2*/
378 GHOST_TUns64 address;
379 GHOST_TInt16 tx, ty, tz; /** -x left, +y up, +z forward */
380 GHOST_TInt16 rx, ry, rz;
381 GHOST_TInt16 buttons;
384 } GHOST_TEventNDOFData;
386 typedef int (*GHOST_NDOFLibraryInit_fp)();
387 typedef void (*GHOST_NDOFLibraryShutdown_fp)(void* deviceHandle);
388 typedef void* (*GHOST_NDOFDeviceOpen_fp)(void* platformData);
390 // original patch windows callback. In mac os X version the callback is internal to the plug-in and post an event to main thead.
391 // not necessary faster, but better integration with other events.
393 //typedef int (*GHOST_NDOFEventHandler_fp)(float* result7, void* deviceHandle, unsigned int message, unsigned int* wParam, unsigned long* lParam);
394 //typedef void (*GHOST_NDOFCallBack_fp)(GHOST_TEventNDOFDataV2 *VolDatas);
399 /** The ascii code for the key event ('\0' if none). */
401 } GHOST_TEventKeyData;
404 /** Number of pixels on a line. */
405 GHOST_TUns32 xPixels;
406 /** Number of lines. */
407 GHOST_TUns32 yPixels;
408 /** Numberof bits per pixel. */
410 /** Refresh rate (in Hertz). */
411 GHOST_TUns32 frequency;
412 } GHOST_DisplaySetting;
416 typedef long GHOST_TEmbedderWindowID;
420 // I can't use "Window" from "<X11/Xlib.h>" because it conflits with Window defined in winlay.h
421 typedef int GHOST_TEmbedderWindowID;
425 * A timer task callback routine.
426 * @param task The timer task object.
427 * @param time The current time.
430 class GHOST_ITimerTask;
431 typedef void (*GHOST_TimerProcPtr)(GHOST_ITimerTask* task, GHOST_TUns64 time);
433 struct GHOST_TimerTaskHandle__;
434 typedef void (*GHOST_TimerProcPtr)(struct GHOST_TimerTaskHandle__* task, GHOST_TUns64 time);
437 #endif // _GHOST_TYPES_H_