[Bf-blender-cvs] [c23733d] master: Cleanup: Event defines -> enums.

Bastien Montagne noreply at git.blender.org
Mon Sep 1 17:21:11 CEST 2014


Commit: c23733d290c095ab77310b55c75293465891d5b8
Author: Bastien Montagne
Date:   Mon Sep 1 17:08:33 2014 +0200
Branches: master
https://developer.blender.org/rBc23733d290c095ab77310b55c75293465891d5b8

Cleanup: Event defines -> enums.

Also made all event type values as hexadecimal (mixing decimal, hexa and char values
is a nice way to make mistakes)!

===================================================================

M	source/blender/windowmanager/wm_event_types.h

===================================================================

diff --git a/source/blender/windowmanager/wm_event_types.h b/source/blender/windowmanager/wm_event_types.h
index 6d3cdf6..d7335cc 100644
--- a/source/blender/windowmanager/wm_event_types.h
+++ b/source/blender/windowmanager/wm_event_types.h
@@ -36,92 +36,226 @@
 #define __WM_EVENT_TYPES_H__
 
 /* customdata type */
-#define EVT_DATA_GESTURE        1
-#define EVT_DATA_TIMER          2
-#define EVT_DATA_DRAGDROP       3
-#define EVT_DATA_NDOF_MOTION    4
+enum {
+	EVT_DATA_GESTURE     = 1,
+	EVT_DATA_TIMER       = 2,
+	EVT_DATA_DRAGDROP    = 3,
+	EVT_DATA_NDOF_MOTION = 4,
+};
 
 /* tablet active, matches GHOST_TTabletMode */
-#define EVT_TABLET_NONE		0
-#define EVT_TABLET_STYLUS	1
-#define EVT_TABLET_ERASER	2
-
-
-/* *** wmEvent.type *** */
-
-/* non-event, for example disabled timer */
-#define EVENT_NONE		0
-/* MOUSE : 0x00x */
-#define LEFTMOUSE		1
-#define MIDDLEMOUSE		2
-#define RIGHTMOUSE		3
-#define MOUSEMOVE		4
-		/* only use if you want user option switch possible */
-#define ACTIONMOUSE		5
-#define SELECTMOUSE		6
-		/* Extra mouse buttons */
-#define BUTTON4MOUSE	7
-#define BUTTON5MOUSE	8
-		/* More mouse buttons - can't use 9 and 10 here (wheel) */
-#define BUTTON6MOUSE	18
-#define BUTTON7MOUSE	19
-		/* Extra trackpad gestures */
-#define MOUSEPAN		14
-#define MOUSEZOOM		15
-#define MOUSEROTATE		16
-		/* defaults from ghost */
-#define WHEELUPMOUSE	10
-#define WHEELDOWNMOUSE	11
-		/* mapped with userdef */
-#define WHEELINMOUSE	12
-#define WHEELOUTMOUSE	13
-		/* Successive MOUSEMOVE's are converted to this, so we can easily
-		 * ignore all but the most recent MOUSEMOVE (for better performance),
-		 * paint and drawing tools however will want to handle these. */
-#define INBETWEEN_MOUSEMOVE	17
-
-
-/* NDOF (from SpaceNavigator & friends)
- * These should be kept in sync with GHOST_NDOFManager.h
- * Ordering matters, exact values do not. */
-
-#define NDOF_MOTION 400
+enum {
+	EVT_TABLET_NONE   = 0,
+	EVT_TABLET_STYLUS = 1,
+	EVT_TABLET_ERASER = 2,
+};
 
+/* ********** wmEvent.type ********** */
 enum {
-	// used internally, never sent
+	/* non-event, for example disabled timer */
+	EVENT_NONE = 0x0000,
+
+	/* ********** Start of Input devices. ********** */
+
+	/* MOUSE : 0x000x, 0x001x */
+	LEFTMOUSE           = 0x0001,
+	MIDDLEMOUSE         = 0x0002,
+	RIGHTMOUSE          = 0x0003,
+	MOUSEMOVE           = 0x0004,
+	/* only use if you want user option switch possible */
+	ACTIONMOUSE         = 0x0005,
+	SELECTMOUSE         = 0x0006,
+	/* Extra mouse buttons */
+	BUTTON4MOUSE        = 0x0007,
+	BUTTON5MOUSE        = 0x0008,
+	/* More mouse buttons - can't use 9 and 10 here (wheel) */
+	BUTTON6MOUSE        = 0x0012,
+	BUTTON7MOUSE        = 0x0013,
+	/* Extra trackpad gestures */
+	MOUSEPAN            = 0x000e,
+	MOUSEZOOM           = 0x000f,
+	MOUSEROTATE         = 0x0010,
+	/* defaults from ghost */
+	WHEELUPMOUSE        = 0x000a,
+	WHEELDOWNMOUSE      = 0x000b,
+	/* mapped with userdef */
+	WHEELINMOUSE        = 0x000c,
+	WHEELOUTMOUSE       = 0x000d,
+	/* Successive MOUSEMOVE's are converted to this, so we can easily
+	 * ignore all but the most recent MOUSEMOVE (for better performance),
+	 * paint and drawing tools however will want to handle these. */
+	INBETWEEN_MOUSEMOVE = 0x0011,
+
+	/* *** Start of keyboard codes. *** */
+
+	/* standard keyboard.
+	 * XXX from 0x0020 to 0x00ff, and 0x012c to 0x0140 for function keys! */
+	AKEY            = 0x0061,  /* 'a' */
+	BKEY            = 0x0062,  /* 'b' */
+	CKEY            = 0x0063,  /* 'c' */
+	DKEY            = 0x0064,  /* 'd' */
+	EKEY            = 0x0065,  /* 'e' */
+	FKEY            = 0x0066,  /* 'f' */
+	GKEY            = 0x0067,  /* 'g' */
+	HKEY            = 0x0068,  /* 'h' */
+	IKEY            = 0x0069,  /* 'i' */
+	JKEY            = 0x006a,  /* 'j' */
+	KKEY            = 0x006b,  /* 'k' */
+	LKEY            = 0x006c,  /* 'l' */
+	MKEY            = 0x006d,  /* 'm' */
+	NKEY            = 0x006e,  /* 'n' */
+	OKEY            = 0x006f,  /* 'o' */
+	PKEY            = 0x0070,  /* 'p' */
+	QKEY            = 0x0071,  /* 'q' */
+	RKEY            = 0x0072,  /* 'r' */
+	SKEY            = 0x0073,  /* 's' */
+	TKEY            = 0x0074,  /* 't' */
+	UKEY            = 0x0075,  /* 'u' */
+	VKEY            = 0x0076,  /* 'v' */
+	WKEY            = 0x0077,  /* 'w' */
+	XKEY            = 0x0078,  /* 'x' */
+	YKEY            = 0x0079,  /* 'y' */
+	ZKEY            = 0x007a,  /* 'z' */
+
+	ZEROKEY         = 0x0030,  /* '0' */
+	ONEKEY          = 0x0031,  /* '1' */
+	TWOKEY          = 0x0032,  /* '2' */
+	THREEKEY        = 0x0033,  /* '3' */
+	FOURKEY         = 0x0034,  /* '4' */
+	FIVEKEY         = 0x0035,  /* '5' */
+	SIXKEY          = 0x0036,  /* '6' */
+	SEVENKEY        = 0x0037,  /* '7' */
+	EIGHTKEY        = 0x0038,  /* '8' */
+	NINEKEY         = 0x0039,  /* '9' */
+
+	CAPSLOCKKEY     = 0x00d3,  /* 211 */
+
+	LEFTCTRLKEY     = 0x00d4,  /* 212 */
+	LEFTALTKEY      = 0x00d5,  /* 213 */
+	RIGHTALTKEY     = 0x00d6,  /* 214 */
+	RIGHTCTRLKEY    = 0x00d7,  /* 215 */
+	RIGHTSHIFTKEY   = 0x00d8,  /* 216 */
+	LEFTSHIFTKEY    = 0x00d9,  /* 217 */
+
+	ESCKEY          = 0x00da,  /* 218 */
+	TABKEY          = 0x00db,  /* 219 */
+	RETKEY          = 0x00dc,  /* 220 */
+	SPACEKEY        = 0x00dd,  /* 221 */
+	LINEFEEDKEY     = 0x00de,  /* 222 */
+	BACKSPACEKEY    = 0x00df,  /* 223 */
+	DELKEY          = 0x00e0,  /* 224 */
+	SEMICOLONKEY    = 0x00e1,  /* 225 */
+	PERIODKEY       = 0x00e2,  /* 226 */
+	COMMAKEY        = 0x00e3,  /* 227 */
+	QUOTEKEY        = 0x00e4,  /* 228 */
+	ACCENTGRAVEKEY  = 0x00e5,  /* 229 */
+	MINUSKEY        = 0x00e6,  /* 230 */
+	SLASHKEY        = 0x00e8,  /* 232 */
+	BACKSLASHKEY    = 0x00e9,  /* 233 */
+	EQUALKEY        = 0x00ea,  /* 234 */
+	LEFTBRACKETKEY  = 0x00eb,  /* 235 */
+	RIGHTBRACKETKEY = 0x00ec,  /* 236 */
+
+	LEFTARROWKEY    = 0x0089,  /* 137 */
+	DOWNARROWKEY    = 0x008a,  /* 138 */
+	RIGHTARROWKEY   = 0x008b,  /* 139 */
+	UPARROWKEY      = 0x008c,  /* 140 */
+
+	PAD0            = 0x0096,  /* 150 */
+	PAD1            = 0x0097,  /* 151 */
+	PAD2            = 0x0098,  /* 152 */
+	PAD3            = 0x0099,  /* 153 */
+	PAD4            = 0x009a,  /* 154 */
+	PAD5            = 0x009b,  /* 155 */
+	PAD6            = 0x009c,  /* 156 */
+	PAD7            = 0x009d,  /* 157 */
+	PAD8            = 0x009e,  /* 158 */
+	PAD9            = 0x009f,  /* 159 */
+
+	PADPERIOD       = 0x00c7,  /* 199 */
+	PADASTERKEY     = 0x00a0,  /* 160 */
+	PADSLASHKEY     = 0x00a1,  /* 161 */
+	PADMINUS        = 0x00a2,  /* 162 */
+	PADENTER        = 0x00a3,  /* 163 */
+	PADPLUSKEY      = 0x00a4,  /* 164 */
+
+	PAUSEKEY        = 0x00a5,  /* 165 */
+	INSERTKEY       = 0x00a6,  /* 166 */
+	HOMEKEY         = 0x00a7,  /* 167 */
+	PAGEUPKEY       = 0x00a8,  /* 168 */
+	PAGEDOWNKEY     = 0x00a9,  /* 169 */
+	ENDKEY          = 0x00aa,  /* 170 */
+
+	UNKNOWNKEY      = 0x00ab,  /* 171 */
+	OSKEY           = 0x00ac,  /* 172 */
+	GRLESSKEY       = 0x00ad,  /* 173 */
+
+	/* XXX: are these codes ok? */
+	MEDIAPLAY       = 0x00ae,  /* 174 */
+	MEDIASTOP       = 0x00af,  /* 175 */
+	MEDIAFIRST      = 0x00b0,  /* 176 */
+	MEDIALAST       = 0x00b1,  /* 177 */
+
+	F1KEY           = 0x012c,  /* 300 */
+	F2KEY           = 0x012d,  /* 301 */
+	F3KEY           = 0x012e,  /* 302 */
+	F4KEY           = 0x012f,  /* 303 */
+	F5KEY           = 0x0130,  /* 304 */
+	F6KEY           = 0x0131,  /* 305 */
+	F7KEY           = 0x0132,  /* 306 */
+	F8KEY           = 0x0133,  /* 307 */
+	F9KEY           = 0x0134,  /* 308 */
+	F10KEY          = 0x0135,  /* 309 */
+	F11KEY          = 0x0136,  /* 310 */
+	F12KEY          = 0x0137,  /* 311 */
+	F13KEY          = 0x0138,  /* 312 */
+	F14KEY          = 0x0139,  /* 313 */
+	F15KEY          = 0x013a,  /* 314 */
+	F16KEY          = 0x013b,  /* 315 */
+	F17KEY          = 0x013c,  /* 316 */
+	F18KEY          = 0x013d,  /* 317 */
+	F19KEY          = 0x013e,  /* 318 */
+
+	/* *** End of keyboard codes. *** */
+
+	/* NDOF (from SpaceNavigator & friends)
+	 * These should be kept in sync with GHOST_NDOFManager.h
+	 * Ordering matters, exact values do not. */
+	NDOF_MOTION = 0x0190,
+	/* used internally, never sent */
 	NDOF_BUTTON_NONE = NDOF_MOTION,
-	// these two are available from any 3Dconnexion device
+	/* these two are available from any 3Dconnexion device */
 	NDOF_BUTTON_MENU,
 	NDOF_BUTTON_FIT,
-	// standard views
+	/* standard views */
 	NDOF_BUTTON_TOP,
 	NDOF_BUTTON_BOTTOM,
 	NDOF_BUTTON_LEFT,
 	NDOF_BUTTON_RIGHT,
 	NDOF_BUTTON_FRONT,
 	NDOF_BUTTON_BACK,
-	// more views
+	/* more views */
 	NDOF_BUTTON_ISO1,
 	NDOF_BUTTON_ISO2,
-	// 90 degree rotations
+	/* 90 degree rotations */
 	NDOF_BUTTON_ROLL_CW,
 	NDOF_BUTTON_ROLL_CCW,
 	NDOF_BUTTON_SPIN_CW,
 	NDOF_BUTTON_SPIN_CCW,
 	NDOF_BUTTON_TILT_CW,
 	NDOF_BUTTON_TILT_CCW,
-	// device control
+	/* device control */
 	NDOF_BUTTON_ROTATE,
 	NDOF_BUTTON_PANZOOM,
 	NDOF_BUTTON_DOMINANT,
 	NDOF_BUTTON_PLUS,
 	NDOF_BUTTON_MINUS,
-	// keyboard emulation
+	/* keyboard emulation */
 	NDOF_BUTTON_ESC,
 	NDOF_BUTTON_ALT,
 	NDOF_BUTTON_SHIFT,
 	NDOF_BUTTON_CTRL,
-	// general-purpose buttons
+	/* general-purpose buttons */
 	NDOF_BUTTON_1,
 	NDOF_BUTTON_2,
 	NDOF_BUTTON_3,
@@ -132,180 +266,79 @@ enum {
 	NDOF_BUTTON_8,
 	NDOF_BUTTON_9,
 	NDOF_BUTTON_10,
-	// more general-purpose buttons
+	/* more general-purpose buttons */
 	NDOF_BUTTON_A,
 	NDOF_BUTTON_B,
 	NDOF_BUTTON_C,
-	// the end
-	NDOF_LAST
+	/* the end */
+	NDOF_LAST,
+
+	/* ********** End of Input devices. ********** */
+
+	/* ********** Start of Blender internal events. ********** */
+
+	/* XXX Those are mixed inside keyboard 'area'! */
+	/* System: 0x010x */
+	INPUTCHANGE           = 0x0103,  /* input connected or disconnected */
+	WINDEACTIVATE         = 0x0104,  /* window is deactivated, focus lost */
+	/* Timer: 0x011x */
+	TIMER                 = 0x0110,  /* timer event, passed on to all queues */
+	TIMER0                = 0x0111,  /* timer event, slot for internal use */
+	TIMER1                = 0x0112,  /* timer event, slot for internal use */
+	TIMER2                = 0x0113,  /* timer event, slot for internal use */
+	TIMERJOBS             = 0x0114,  /* timer event, jobs system */
+	TIMERAUTOSAVE         = 0x0115,  /* timer event, autosave */
+	TIMERREPORT           = 0x0116,  /* timer even

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list