Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Molenkamp <github@lazydodo.com>2020-03-18 19:38:37 +0300
committerRay Molenkamp <github@lazydodo.com>2020-03-18 19:38:37 +0300
commitb88ca3e6d113d161dd119bf1cec959c73b797af7 (patch)
tree6a8b73ca95f8a21742cba1e764d1e24cc5ae8db5 /source/blender/editors/gpencil/annotate_paint.c
parent9e382dd2a3d8569201a3e5c1a8478166c77e9029 (diff)
Cleanup: Resolve HKEY conflict
Both the MS headers and blender headers define the HKEY which gives all kind of inclusion order issues. This diff renames all *KEY constants to EVT_*KEY to resolve this conflict. Reviewed By: brecht , dfelinto Differential Revision: http://developer.blender.org/D7164
Diffstat (limited to 'source/blender/editors/gpencil/annotate_paint.c')
-rw-r--r--source/blender/editors/gpencil/annotate_paint.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c
index 3e33f811225..5629e29f257 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -2050,20 +2050,35 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* We don't pass on key events, GP is used with key-modifiers -
* prevents Dkey to insert drivers. */
if (ISKEYBOARD(event->type)) {
- if (ELEM(event->type, LEFTARROWKEY, DOWNARROWKEY, RIGHTARROWKEY, UPARROWKEY, ZKEY)) {
+ if (ELEM(event->type,
+ EVT_LEFTARROWKEY,
+ EVT_DOWNARROWKEY,
+ EVT_RIGHTARROWKEY,
+ EVT_UPARROWKEY,
+ EVT_ZKEY)) {
/* allow some keys:
* - for frame changing [#33412]
* - for undo (during sketching sessions)
*/
}
- else if (ELEM(event->type, PAD0, PAD1, PAD2, PAD3, PAD4, PAD5, PAD6, PAD7, PAD8, PAD9)) {
+ else if (ELEM(event->type,
+ EVT_PAD0,
+ EVT_PAD1,
+ EVT_PAD2,
+ EVT_PAD3,
+ EVT_PAD4,
+ EVT_PAD5,
+ EVT_PAD6,
+ EVT_PAD7,
+ EVT_PAD8,
+ EVT_PAD9)) {
/* allow numpad keys so that camera/view manipulations can still take place
* - PAD0 in particular is really important for Grease Pencil drawing,
* as animators may be working "to camera", so having this working
* is essential for ensuring that they can quickly return to that view
*/
}
- else if ((event->type == BKEY) && (event->val == KM_RELEASE)) {
+ else if ((event->type == EVT_BKEY) && (event->val == KM_RELEASE)) {
/* Add Blank Frame
* - Since this operator is non-modal, we can just call it here, and keep going...
* - This operator is especially useful when animating
@@ -2083,7 +2098,8 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
* NOTE: cannot do RIGHTMOUSE (as is standard for canceling)
* as that would break polyline T32647.
*/
- if (event->val == KM_PRESS && ELEM(event->type, RETKEY, PADENTER, ESCKEY, SPACEKEY, EKEY)) {
+ if (event->val == KM_PRESS &&
+ ELEM(event->type, EVT_RETKEY, EVT_PADENTER, EVT_ESCKEY, EVT_SPACEKEY, EVT_EKEY)) {
/* exit() ends the current stroke before cleaning up */
/* printf("\t\tGP - end of paint op + end of stroke\n"); */
p->status = GP_STATUS_DONE;
@@ -2261,19 +2277,19 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
/* eraser size */
else if ((p->paintmode == GP_PAINTMODE_ERASER) &&
- ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE, PADPLUSKEY, PADMINUS)) {
+ ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE, EVT_PADPLUSKEY, EVT_PADMINUS)) {
/* just resize the brush (local version)
* TODO: fix the hardcoded size jumps (set to make a visible difference) and hardcoded keys
*/
/* printf("\t\tGP - resize eraser\n"); */
switch (event->type) {
case WHEELDOWNMOUSE: /* larger */
- case PADPLUSKEY:
+ case EVT_PADPLUSKEY:
p->radius += 5;
break;
case WHEELUPMOUSE: /* smaller */
- case PADMINUS:
+ case EVT_PADMINUS:
p->radius -= 5;
if (p->radius <= 0) {