[Bf-blender-cvs] [916c2d0e7f3] master: Cleanup: use WM_ prefix for cursor enum

Campbell Barton noreply at git.blender.org
Tue May 28 17:06:07 CEST 2019


Commit: 916c2d0e7f31c71082fdadbe35d809c0802b4063
Author: Campbell Barton
Date:   Wed May 29 01:03:26 2019 +1000
Branches: master
https://developer.blender.org/rB916c2d0e7f31c71082fdadbe35d809c0802b4063

Cleanup: use WM_ prefix for cursor enum

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

M	source/blender/editors/interface/interface_handlers.c
M	source/blender/windowmanager/WM_types.h
M	source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
M	source/blender/windowmanager/intern/wm_cursors.c
M	source/blender/windowmanager/intern/wm_event_system.c
M	source/blender/windowmanager/intern/wm_operator_type.c

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

diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 101703c4140..f17e6370d09 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -7320,7 +7320,7 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s
   /* number editing */
   if (state == BUTTON_STATE_NUM_EDITING) {
     if (ui_but_is_cursor_warp(but)) {
-      WM_cursor_grab_enable(CTX_wm_window(C), CURSOR_WRAP_XY, true, NULL);
+      WM_cursor_grab_enable(CTX_wm_window(C), WM_CURSOR_WRAP_XY, true, NULL);
     }
     ui_numedit_begin(but, data);
   }
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index 00c43450de7..e6e7b7d1577 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -162,12 +162,12 @@ enum {
       (1 << 11), /* Need evaluated data (i.e. a valid, up-to-date depsgraph for current context) */
 };
 
-/* Wrap Axis. */
+/** For #WM_cursor_grab_enable wrap axis. */
 enum {
-  CURSOR_WRAP_NONE = 0,
-  CURSOR_WRAP_X,
-  CURSOR_WRAP_Y,
-  CURSOR_WRAP_XY,
+  WM_CURSOR_WRAP_NONE = 0,
+  WM_CURSOR_WRAP_X,
+  WM_CURSOR_WRAP_Y,
+  WM_CURSOR_WRAP_XY,
 };
 
 /* context to call operator in for WM_operator_name_call */
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
index ba9d59e82d6..73fae5fd46a 100644
--- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
+++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
@@ -1038,7 +1038,7 @@ void wm_gizmomap_modal_set(
     gzmap->gzmap_context.modal = gz;
 
     if ((gz->flag & WM_GIZMO_MOVE_CURSOR) && (event->is_motion_absolute == false)) {
-      WM_cursor_grab_enable(win, CURSOR_WRAP_XY, true, NULL);
+      WM_cursor_grab_enable(win, WM_CURSOR_WRAP_XY, true, NULL);
       copy_v2_v2_int(gzmap->gzmap_context.event_xy, &event->x);
       gzmap->gzmap_context.event_grabcursor = win->grabcursor;
     }
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index eeea3bf498c..490a05a40d6 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -242,10 +242,10 @@ void WM_cursor_grab_enable(wmWindow *win, int wrap, bool hide, int bounds[4])
   else if (wrap) {
     mode = GHOST_kGrabWrap;
 
-    if (wrap == CURSOR_WRAP_X) {
+    if (wrap == WM_CURSOR_WRAP_X) {
       mode_axis = GHOST_kAxisX;
     }
-    if (wrap == CURSOR_WRAP_Y) {
+    if (wrap == WM_CURSOR_WRAP_Y) {
       mode_axis = GHOST_kGrabAxisY;
     }
   }
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index ac2bf1985d4..198e26aa465 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -1469,20 +1469,20 @@ static int wm_operator_invoke(bContext *C,
        */
       if (ot->flag & OPTYPE_BLOCKING || (op->opm && op->opm->type->flag & OPTYPE_BLOCKING)) {
         int bounds[4] = {-1, -1, -1, -1};
-        int wrap = CURSOR_WRAP_NONE;
+        int wrap = WM_CURSOR_WRAP_NONE;
 
         if (event && (U.uiflag & USER_CONTINUOUS_MOUSE)) {
           const wmOperator *op_test = op->opm ? op->opm : op;
           const wmOperatorType *ot_test = op_test->type;
           if ((ot_test->flag & OPTYPE_GRAB_CURSOR_XY) ||
               (op_test->flag & OP_IS_MODAL_GRAB_CURSOR)) {
-            wrap = CURSOR_WRAP_XY;
+            wrap = WM_CURSOR_WRAP_XY;
           }
           else if (ot_test->flag & OPTYPE_GRAB_CURSOR_X) {
-            wrap = CURSOR_WRAP_X;
+            wrap = WM_CURSOR_WRAP_X;
           }
           else if (ot_test->flag & OPTYPE_GRAB_CURSOR_Y) {
-            wrap = CURSOR_WRAP_Y;
+            wrap = WM_CURSOR_WRAP_Y;
           }
         }
 
@@ -1493,7 +1493,7 @@ static int wm_operator_invoke(bContext *C,
 
           /* Wrap only in X for header. */
           if (ar && ELEM(ar->regiontype, RGN_TYPE_HEADER, RGN_TYPE_TOOL_HEADER, RGN_TYPE_FOOTER)) {
-            wrap = CURSOR_WRAP_X;
+            wrap = WM_CURSOR_WRAP_X;
           }
 
           if (ar && ar->regiontype == RGN_TYPE_WINDOW &&
diff --git a/source/blender/windowmanager/intern/wm_operator_type.c b/source/blender/windowmanager/intern/wm_operator_type.c
index 7ae28f3f448..69f09162c74 100644
--- a/source/blender/windowmanager/intern/wm_operator_type.c
+++ b/source/blender/windowmanager/intern/wm_operator_type.c
@@ -430,17 +430,17 @@ static int wm_macro_modal(bContext *C, wmOperator *op, const wmEvent *event)
          * */
         if (op->opm->type->flag & OPTYPE_BLOCKING) {
           int bounds[4] = {-1, -1, -1, -1};
-          int wrap = CURSOR_WRAP_NONE;
+          int wrap = WM_CURSOR_WRAP_NONE;
 
           if ((op->opm->flag & OP_IS_MODAL_GRAB_CURSOR) ||
               (op->opm->type->flag & OPTYPE_GRAB_CURSOR_XY)) {
-            wrap = CURSOR_WRAP_XY;
+            wrap = WM_CURSOR_WRAP_XY;
           }
           else if (op->opm->type->flag & OPTYPE_GRAB_CURSOR_X) {
-            wrap = CURSOR_WRAP_X;
+            wrap = WM_CURSOR_WRAP_X;
           }
           else if (op->opm->type->flag & OPTYPE_GRAB_CURSOR_Y) {
-            wrap = CURSOR_WRAP_Y;
+            wrap = WM_CURSOR_WRAP_Y;
           }
 
           if (wrap) {



More information about the Bf-blender-cvs mailing list