Cleanup: use WM_ prefix for cursor enum
This commit is contained in:
parent
e4ac8ab212
commit
916c2d0e7f
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 &&
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue