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:
authorCampbell Barton <ideasman42@gmail.com>2017-06-06 15:14:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-06-06 15:16:12 +0300
commitd220e54f281ebf4b851059f96b1190252489e103 (patch)
treeabb8cd73e84051ce95459abf489cbbb2a5f4eaef /source/blender
parentd267d76540d0adecee75346d6cfe2fa6a69478c8 (diff)
WM: manipulator callback arg order
Use same arg order for C & RNA
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/transform/transform_manipulator.c3
-rw-r--r--source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c6
-rw-r--r--source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c5
-rw-r--r--source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c8
-rw-r--r--source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c3
-rw-r--r--source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c2
-rw-r--r--source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h2
-rw-r--r--source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c4
-rw-r--r--source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c6
-rw-r--r--source/blender/windowmanager/manipulators/wm_manipulator_fn.h7
10 files changed, 27 insertions, 19 deletions
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index c652e2e0324..14a1a6b8cfe 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -1117,7 +1117,8 @@ static ManipulatorGroup *manipulatorgroup_init(wmManipulatorGroup *wgroup)
/**
* Custom handler for manipulator widgets
*/
-static int manipulator_handler(bContext *C, const wmEvent *UNUSED(event), wmManipulator *widget, const int UNUSED(flag))
+static int manipulator_handler(
+ bContext *C, wmManipulator *widget, const wmEvent *UNUSED(event), const int UNUSED(flag))
{
const ScrArea *sa = CTX_wm_area(C);
ARegion *ar = CTX_wm_region(C);
diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c
index 842e66656a2..b3287ce8735 100644
--- a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c
+++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c
@@ -127,7 +127,8 @@ static void manipulator_arrow2d_draw(const bContext *UNUSED(C), struct wmManipul
}
}
-static int manipulator_arrow2d_invoke(bContext *UNUSED(C), const wmEvent *UNUSED(event), struct wmManipulator *manipulator)
+static int manipulator_arrow2d_invoke(
+ bContext *UNUSED(C), struct wmManipulator *manipulator, const wmEvent *UNUSED(event))
{
ManipulatorInteraction *inter = MEM_callocN(sizeof(ManipulatorInteraction), __func__);
@@ -137,7 +138,8 @@ static int manipulator_arrow2d_invoke(bContext *UNUSED(C), const wmEvent *UNUSED
return OPERATOR_RUNNING_MODAL;
}
-static int manipulator_arrow2d_intersect(bContext *UNUSED(C), const wmEvent *event, struct wmManipulator *manipulator)
+static int manipulator_arrow2d_intersect(
+ bContext *UNUSED(C), struct wmManipulator *manipulator, const wmEvent *event)
{
ArrowManipulator2D *arrow = (ArrowManipulator2D *)manipulator;
const float mval[2] = {event->mval[0], event->mval[1]};
diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
index 6e9abb9137e..02060db736a 100644
--- a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
+++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
@@ -256,7 +256,7 @@ static void manipulator_arrow_draw(const bContext *UNUSED(C), wmManipulator *man
* Calculate arrow offset independent from prop min value,
* meaning the range will not be offset by min value first.
*/
-static int manipulator_arrow_handler(bContext *C, const wmEvent *event, wmManipulator *manipulator, const int flag)
+static int manipulator_arrow_handler(bContext *C, wmManipulator *manipulator, const wmEvent *event, const int flag)
{
ArrowManipulator *arrow = (ArrowManipulator *)manipulator;
ManipulatorInteraction *inter = manipulator->interaction_data;
@@ -371,7 +371,8 @@ static int manipulator_arrow_handler(bContext *C, const wmEvent *event, wmManipu
}
-static int manipulator_arrow_invoke(bContext *UNUSED(C), const wmEvent *event, wmManipulator *manipulator)
+static int manipulator_arrow_invoke(
+ bContext *UNUSED(C), wmManipulator *manipulator, const wmEvent *event)
{
ArrowManipulator *arrow = (ArrowManipulator *)manipulator;
ManipulatorInteraction *inter = MEM_callocN(sizeof(ManipulatorInteraction), __func__);
diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c
index 0ce430383ea..e4bc80bb791 100644
--- a/source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c
+++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c
@@ -265,7 +265,8 @@ static int manipulator_rect_transform_get_cursor(wmManipulator *manipulator)
}
}
-static int manipulator_rect_transform_intersect(bContext *UNUSED(C), const wmEvent *event, wmManipulator *manipulator)
+static int manipulator_rect_transform_intersect(
+ bContext *UNUSED(C), wmManipulator *manipulator, const wmEvent *event)
{
RectTransformManipulator *cage = (RectTransformManipulator *)manipulator;
const float mouse[2] = {event->mval[0], event->mval[1]};
@@ -397,7 +398,8 @@ static bool manipulator_rect_transform_get_prop_value(wmManipulator *manipulator
return true;
}
-static int manipulator_rect_transform_invoke(bContext *UNUSED(C), const wmEvent *event, wmManipulator *manipulator)
+static int manipulator_rect_transform_invoke(
+ bContext *UNUSED(C), wmManipulator *manipulator, const wmEvent *event)
{
RectTransformManipulator *cage = (RectTransformManipulator *)manipulator;
RectTransformInteraction *data = MEM_callocN(sizeof(RectTransformInteraction), "cage_interaction");
@@ -414,7 +416,7 @@ static int manipulator_rect_transform_invoke(bContext *UNUSED(C), const wmEvent
}
static int manipulator_rect_transform_handler(
- bContext *C, const wmEvent *event, wmManipulator *manipulator,
+ bContext *C, wmManipulator *manipulator, const wmEvent *event,
const int UNUSED(flag))
{
RectTransformManipulator *cage = (RectTransformManipulator *)manipulator;
diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c
index 1069684dab6..58391b374f5 100644
--- a/source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c
+++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c
@@ -315,7 +315,8 @@ static void manipulator_dial_draw(const bContext *C, wmManipulator *manipulator)
}
}
-static int manipulator_dial_invoke(bContext *UNUSED(C), const wmEvent *event, wmManipulator *manipulator)
+static int manipulator_dial_invoke(
+ bContext *UNUSED(C), wmManipulator *manipulator, const wmEvent *event)
{
DialInteraction *inter = MEM_callocN(sizeof(DialInteraction), __func__);
diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c
index 38fb10c3059..e27cdf1c3bf 100644
--- a/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c
+++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c
@@ -175,7 +175,7 @@ static void manipulator_primitive_draw(const bContext *UNUSED(C), wmManipulator
}
static int manipulator_primitive_invoke(
- bContext *UNUSED(C), const wmEvent *UNUSED(event), wmManipulator *manipulator)
+ bContext *UNUSED(C), wmManipulator *manipulator, const wmEvent *UNUSED(event))
{
ManipulatorInteraction *inter = MEM_callocN(sizeof(ManipulatorInteraction), __func__);
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h b/source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
index 9a5cf6c1f01..e0c3fdda181 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
@@ -32,6 +32,8 @@ struct wmKeyConfig;
struct wmManipulatorMap;
struct ManipulatorGeomInfo;
+#include "wm_manipulator_fn.h"
+
/* -------------------------------------------------------------------- */
/* wmManipulator */
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c b/source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c
index 0097b3210b2..d805d730651 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c
@@ -160,7 +160,7 @@ wmManipulator *wm_manipulatorgroup_find_intersected_mainpulator(
{
for (wmManipulator *manipulator = mgroup->manipulators.first; manipulator; manipulator = manipulator->next) {
if (manipulator->type.intersect && (manipulator->flag & WM_MANIPULATOR_HIDDEN) == 0) {
- if ((*part = manipulator->type.intersect(C, event, manipulator))) {
+ if ((*part = manipulator->type.intersect(C, manipulator, event))) {
return manipulator;
}
}
@@ -339,7 +339,7 @@ static int manipulator_tweak_modal(bContext *C, wmOperator *op, const wmEvent *e
/* handle manipulator */
if (manipulator->type.handler) {
- manipulator->type.handler(C, event, manipulator, mtweak->flag);
+ manipulator->type.handler(C, manipulator, event, mtweak->flag);
}
/* Ugly hack to send manipulator events */
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c b/source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
index f1655fcef1b..a2549589929 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
@@ -426,7 +426,7 @@ void wm_manipulatormaps_handled_modal_update(
if (manipulator && manipulator->type.handler && manipulator->opname &&
STREQ(manipulator->opname, handler->op->idname))
{
- manipulator->type.handler(C, event, manipulator, 0);
+ manipulator->type.handler(C, manipulator, event, 0);
}
}
/* operator not running anymore */
@@ -641,7 +641,7 @@ void wm_manipulatormap_set_active_manipulator(
if (ot) {
/* first activate the manipulator itself */
if (manipulator->type.invoke && manipulator->type.handler) {
- manipulator->type.invoke(C, event, manipulator);
+ manipulator->type.invoke(C, manipulator, event);
}
WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &manipulator->opptr);
@@ -665,7 +665,7 @@ void wm_manipulatormap_set_active_manipulator(
}
else {
if (manipulator->type.invoke && manipulator->type.handler) {
- manipulator->type.invoke(C, event, manipulator);
+ manipulator->type.invoke(C, manipulator, event);
}
}
WM_cursor_grab_enable(CTX_wm_window(C), true, true, NULL);
diff --git a/source/blender/windowmanager/manipulators/wm_manipulator_fn.h b/source/blender/windowmanager/manipulators/wm_manipulator_fn.h
index 99ef75d21ea..b2676d79646 100644
--- a/source/blender/windowmanager/manipulators/wm_manipulator_fn.h
+++ b/source/blender/windowmanager/manipulators/wm_manipulator_fn.h
@@ -24,7 +24,6 @@
* Callback function definitions, needed for both Types & API headers.
*/
-
#ifndef __WM_MANIPULATOR_FN_H__
#define __WM_MANIPULATOR_FN_H__
@@ -39,11 +38,11 @@ typedef void (*wmManipulatorGroupFnDrawPrepare)(const struct bContext *, struct
/* wmManipulator */
typedef void (*wmManipulatorFnDraw)(const struct bContext *, struct wmManipulator *);
typedef void (*wmManipulatorFnDrawSelect)(const struct bContext *, struct wmManipulator *, int);
-typedef int (*wmManipulatorFnIntersect)(struct bContext *, const struct wmEvent *, struct wmManipulator *);
-typedef int (*wmManipulatorFnHandler)(struct bContext *, const struct wmEvent *, struct wmManipulator *, const int);
+typedef int (*wmManipulatorFnIntersect)(struct bContext *, struct wmManipulator *, const struct wmEvent *);
+typedef int (*wmManipulatorFnHandler)(struct bContext *, struct wmManipulator *, const struct wmEvent *, const int);
typedef void (*wmManipulatorFnPropDataUpdate)(struct wmManipulator *, int);
typedef void (*wmManipulatorFnFinalPositionGet)(struct wmManipulator *, float[]);
-typedef int (*wmManipulatorFnInvoke)(struct bContext *, const struct wmEvent *, struct wmManipulator *);
+typedef int (*wmManipulatorFnInvoke)(struct bContext *, struct wmManipulator *, const struct wmEvent *);
typedef void (*wmManipulatorFnExit)(struct bContext *, struct wmManipulator *, const bool);
typedef int (*wmManipulatorFnCursorGet)(struct wmManipulator *);
typedef void (*wmManipulatorFnSelect)(struct bContext *, struct wmManipulator *, const int);