diff options
author | Julian Eisel <julian@blender.org> | 2021-11-05 16:56:22 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-11-05 16:57:26 +0300 |
commit | 4e09fd76bcabb602f1bd31c2bbd5dd2b09e4b64a (patch) | |
tree | cc62d791b8a8e50c4460cb567d52e399a7781e5d /source/blender/windowmanager/intern/wm_dragdrop.c | |
parent | 35198606d514a0cdedaa906cf86258f8c45448af (diff) |
Cleanup (UI): Add/use type for operator context enum
Adds a `wmOperatorCallContext` typedef for the existing `WM_OP_XXX`
operator context enum. This adds type safety, allows the compiler to
produce better warnings and helps understanding what a variable is for.
Differential Revision: https://developer.blender.org/D13113
Reviewed by: Campbell Barton
Diffstat (limited to 'source/blender/windowmanager/intern/wm_dragdrop.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_dragdrop.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c index 648ad2bb8fe..29ba346c2f6 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.c +++ b/source/blender/windowmanager/intern/wm_dragdrop.c @@ -323,7 +323,7 @@ static wmDropBox *dropbox_active(bContext *C, continue; } - const int opcontext = wm_drop_operator_context_get(drop); + const wmOperatorCallContext opcontext = wm_drop_operator_context_get(drop); if (WM_operator_poll_context(C, drop->ot, opcontext)) { return drop; } @@ -392,7 +392,7 @@ static void wm_drop_update_active(bContext *C, wmDrag *drag, const wmEvent *even void wm_drop_prepare(bContext *C, wmDrag *drag, wmDropBox *drop) { - const int opcontext = wm_drop_operator_context_get(drop); + const wmOperatorCallContext opcontext = wm_drop_operator_context_get(drop); /* Optionally copy drag information to operator properties. Don't call it if the * operator fails anyway, it might do more than just set properties (e.g. * typically import an asset). */ @@ -429,7 +429,7 @@ void wm_drags_check_ops(bContext *C, const wmEvent *event) * coordinates. The dropbox poll should check the context area and region as needed. * So this always returns #WM_OP_INVOKE_DEFAULT. */ -int wm_drop_operator_context_get(const wmDropBox *UNUSED(drop)) +wmOperatorCallContext wm_drop_operator_context_get(const wmDropBox *UNUSED(drop)) { return WM_OP_INVOKE_DEFAULT; } |