diff options
Diffstat (limited to 'source/blender')
129 files changed, 584 insertions, 573 deletions
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index d218cc537da..96dc1010e2c 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -2260,7 +2260,7 @@ static void rename_anim_channels(bAnimContext *ac, int channel_index) ED_region_tag_redraw(ac->ar); } -static int animchannels_rename_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *evt) +static int animchannels_rename_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { bAnimContext ac; ARegion *ar; @@ -2281,7 +2281,7 @@ static int animchannels_rename_invoke(bContext *C, wmOperator *UNUSED(op), wmEve * so that the tops of channels get caught ok. Since ACHANNEL_FIRST is really ACHANNEL_HEIGHT, we simply use * ACHANNEL_HEIGHT_HALF. */ - UI_view2d_region_to_view(v2d, evt->mval[0], evt->mval[1], &x, &y); + UI_view2d_region_to_view(v2d, event->mval[0], event->mval[1], &x, &y); if (ac.datatype == ANIMCONT_NLA) { SpaceNla *snla = (SpaceNla *)ac.sl; @@ -2594,7 +2594,7 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in /* ------------------- */ /* handle clicking */ -static int animchannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int animchannels_mouseclick_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bAnimContext ac; ARegion *ar; diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 5cb458d36e5..7a3fc3a8d9b 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -514,8 +514,8 @@ static int ed_markers_poll_markers_exist(bContext *C) * that operator would otherwise have used. If NULL, the operator's standard * exec() callback will be called instead in the appropriate places. */ -static int ed_markers_opwrap_invoke_custom(bContext *C, wmOperator *op, wmEvent *evt, - int (*invoke_func)(bContext *, wmOperator *, wmEvent *)) +static int ed_markers_opwrap_invoke_custom(bContext *C, wmOperator *op, const wmEvent *event, + int (*invoke_func)(bContext *, wmOperator *, const wmEvent *)) { ScrArea *sa = CTX_wm_area(C); int retval = OPERATOR_PASS_THROUGH; @@ -524,7 +524,7 @@ static int ed_markers_opwrap_invoke_custom(bContext *C, wmOperator *op, wmEvent /* allow operator to run now */ if (invoke_func) - retval = invoke_func(C, op, evt); + retval = invoke_func(C, op, event); else if (op->type->exec) retval = op->type->exec(C, op); else @@ -545,9 +545,9 @@ static int ed_markers_opwrap_invoke_custom(bContext *C, wmOperator *op, wmEvent * though will need to implement their own wrapper which calls the second-tier callback themselves * (passing through the custom invoke function they use) */ -static int ed_markers_opwrap_invoke(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_markers_opwrap_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - return ed_markers_opwrap_invoke_custom(C, op, evt, NULL); + return ed_markers_opwrap_invoke_custom(C, op, event, NULL); } /* ************************** add markers *************************** */ @@ -685,14 +685,14 @@ static void ed_marker_move_exit(bContext *C, wmOperator *op) ED_area_headerprint(CTX_wm_area(C), NULL); } -static int ed_marker_move_invoke(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_move_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (ed_marker_move_init(C, op)) { MarkerMove *mm = op->customdata; - mm->evtx = evt->x; - mm->firstx = evt->x; - mm->event_type = evt->type; + mm->evtx = event->x; + mm->firstx = event->x; + mm->event_type = event->type; /* add temp handler */ WM_event_add_modal_handler(C, op); @@ -706,9 +706,9 @@ static int ed_marker_move_invoke(bContext *C, wmOperator *op, wmEvent *evt) return OPERATOR_CANCELLED; } -static int ed_marker_move_invoke_wrapper(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_move_invoke_wrapper(bContext *C, wmOperator *op, const wmEvent *event) { - return ed_markers_opwrap_invoke_custom(C, op, evt, ed_marker_move_invoke); + return ed_markers_opwrap_invoke_custom(C, op, event, ed_marker_move_invoke); } /* note, init has to be called succesfully */ @@ -757,7 +757,7 @@ static int ed_marker_move_cancel(bContext *C, wmOperator *op) -static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_move_modal(bContext *C, wmOperator *op, const wmEvent *event) { Scene *scene = CTX_data_scene(C); MarkerMove *mm = op->customdata; @@ -766,14 +766,14 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt) float dx, fac; char str[256]; - switch (evt->type) { + switch (event->type) { case ESCKEY: ed_marker_move_cancel(C, op); return OPERATOR_CANCELLED; case RIGHTMOUSE: /* press = user manually demands transform to be canceled */ - if (evt->val == KM_PRESS) { + if (event->val == KM_PRESS) { ed_marker_move_cancel(C, op); return OPERATOR_CANCELLED; } @@ -783,7 +783,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt) case PADENTER: case LEFTMOUSE: case MIDDLEMOUSE: - if (WM_modal_tweak_exit(evt, mm->event_type)) { + if (WM_modal_tweak_exit(event, mm->event_type)) { ed_marker_move_exit(C, op); WM_event_add_notifier(C, NC_SCENE | ND_MARKERS, NULL); WM_event_add_notifier(C, NC_ANIMATION | ND_MARKERS, NULL); @@ -796,17 +796,17 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt) dx = BLI_rctf_size_x(&v2d->cur) / BLI_rcti_size_x(&v2d->mask); - if (evt->x != mm->evtx) { /* XXX maybe init for first time */ + if (event->x != mm->evtx) { /* XXX maybe init for first time */ int a, offs, totmark = 0; - mm->evtx = evt->x; + mm->evtx = event->x; - fac = ((float)(evt->x - mm->firstx) * dx); + fac = ((float)(event->x - mm->firstx) * dx); if (mm->slink->spacetype == SPACE_TIME) - apply_keyb_grid(evt->shift, evt->ctrl, &fac, 0.0, FPS, 0.1 * FPS, 0); + apply_keyb_grid(event->shift, event->ctrl, &fac, 0.0, FPS, 0.1 * FPS, 0); else - apply_keyb_grid(evt->shift, evt->ctrl, &fac, 0.0, 1.0, 0.1, 0 /*was: U.flag & USER_AUTOGRABGRID*/); + apply_keyb_grid(event->shift, event->ctrl, &fac, 0.0, 1.0, 0.1, 0 /*was: U.flag & USER_AUTOGRABGRID*/); offs = (int)fac; RNA_int_set(op->ptr, "frames", offs); @@ -865,8 +865,8 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt) } } - if (evt->val == KM_PRESS) { - if (handleNumInput(&mm->num, evt)) { + if (event->val == KM_PRESS) { + if (handleNumInput(&mm->num, event)) { char str_tx[NUM_STR_REP_LEN]; float value = RNA_int_get(op->ptr, "frames"); applyNumInput(&mm->num, &value); @@ -982,15 +982,15 @@ static int ed_marker_duplicate_exec(bContext *C, wmOperator *op) } -static int ed_marker_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_duplicate_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ed_marker_duplicate_apply(C); - return ed_marker_move_invoke(C, op, evt); + return ed_marker_move_invoke(C, op, event); } -static int ed_marker_duplicate_invoke_wrapper(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_duplicate_invoke_wrapper(bContext *C, wmOperator *op, const wmEvent *event) { - return ed_markers_opwrap_invoke_custom(C, op, evt, ed_marker_duplicate_invoke); + return ed_markers_opwrap_invoke_custom(C, op, event, ed_marker_duplicate_invoke); } static void MARKER_OT_duplicate(wmOperatorType *ot) @@ -1037,7 +1037,7 @@ static void select_timeline_marker_frame(ListBase *markers, int frame, unsigned } } -static int ed_marker_select(bContext *C, wmEvent *evt, int extend, int camera) +static int ed_marker_select(bContext *C, const wmEvent *event, int extend, int camera) { ListBase *markers = ED_context_get_markers(C); ARegion *ar = CTX_wm_region(C); @@ -1048,8 +1048,8 @@ static int ed_marker_select(bContext *C, wmEvent *evt, int extend, int camera) if (markers == NULL) return OPERATOR_PASS_THROUGH; - x = evt->x - ar->winrct.xmin; - y = evt->y - ar->winrct.ymin; + x = event->x - ar->winrct.xmin; + y = event->y - ar->winrct.ymin; UI_view2d_region_to_view(v2d, x, y, &viewx, NULL); @@ -1104,19 +1104,19 @@ static int ed_marker_select(bContext *C, wmEvent *evt, int extend, int camera) return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH; } -static int ed_marker_select_invoke(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { short extend = RNA_boolean_get(op->ptr, "extend"); short camera = 0; #ifdef DURIAN_CAMERA_SWITCH camera = RNA_boolean_get(op->ptr, "camera"); #endif - return ed_marker_select(C, evt, extend, camera); + return ed_marker_select(C, event, extend, camera); } -static int ed_marker_select_invoke_wrapper(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_select_invoke_wrapper(bContext *C, wmOperator *op, const wmEvent *event) { - return ed_markers_opwrap_invoke_custom(C, op, evt, ed_marker_select_invoke); + return ed_markers_opwrap_invoke_custom(C, op, event, ed_marker_select_invoke); } static void MARKER_OT_select(wmOperatorType *ot) @@ -1201,9 +1201,9 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op) return 1; } -static int ed_marker_select_border_invoke_wrapper(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_select_border_invoke_wrapper(bContext *C, wmOperator *op, const wmEvent *event) { - return ed_markers_opwrap_invoke_custom(C, op, evt, WM_border_select_invoke); + return ed_markers_opwrap_invoke_custom(C, op, event, WM_border_select_invoke); } static void MARKER_OT_select_border(wmOperatorType *ot) @@ -1310,10 +1310,10 @@ static int ed_marker_delete_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -static int ed_marker_delete_invoke_wrapper(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_delete_invoke_wrapper(bContext *C, wmOperator *op, const wmEvent *event) { // XXX: must we keep these confirmations? - return ed_markers_opwrap_invoke_custom(C, op, evt, WM_operator_confirm); + return ed_markers_opwrap_invoke_custom(C, op, event, WM_operator_confirm); } static void MARKER_OT_delete(wmOperatorType *ot) @@ -1353,7 +1353,7 @@ static int ed_marker_rename_exec(bContext *C, wmOperator *op) } } -static int ed_marker_rename_invoke_wrapper(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_rename_invoke_wrapper(bContext *C, wmOperator *op, const wmEvent *event) { /* must initialize the marker name first if there is a marker selected */ TimeMarker *marker = ED_markers_get_first_selected(ED_context_get_markers(C)); @@ -1361,7 +1361,7 @@ static int ed_marker_rename_invoke_wrapper(bContext *C, wmOperator *op, wmEvent RNA_string_set(op->ptr, "name", marker->name); /* now see if the operator is usable */ - return ed_markers_opwrap_invoke_custom(C, op, evt, WM_operator_props_popup); + return ed_markers_opwrap_invoke_custom(C, op, event, WM_operator_props_popup); } static void MARKER_OT_rename(wmOperatorType *ot) @@ -1415,9 +1415,9 @@ static int ed_marker_make_links_scene_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int ed_marker_make_links_scene_invoke_wrapper(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_make_links_scene_invoke_wrapper(bContext *C, wmOperator *op, const wmEvent *event) { - return ed_markers_opwrap_invoke_custom(C, op, evt, WM_menu_invoke); + return ed_markers_opwrap_invoke_custom(C, op, event, WM_menu_invoke); } static void MARKER_OT_make_links_scene(wmOperatorType *ot) diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index 6687cce88cd..b9a3daa4e51 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -115,7 +115,7 @@ static int change_frame_exec(bContext *C, wmOperator *op) /* ---- */ /* Get frame from mouse coordinates */ -static int frame_from_event(bContext *C, wmEvent *event) +static int frame_from_event(bContext *C, const wmEvent *event) { ARegion *region = CTX_wm_region(C); float viewx; @@ -128,7 +128,7 @@ static int frame_from_event(bContext *C, wmEvent *event) } /* Modal Operator init */ -static int change_frame_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int change_frame_invoke(bContext *C, wmOperator *op, const wmEvent *event) { /* Change to frame that mouse is over before adding modal handler, * as user could click on a single frame (jump to frame) as well as @@ -145,7 +145,7 @@ static int change_frame_invoke(bContext *C, wmOperator *op, wmEvent *event) } /* Modal event handling of frame changing */ -static int change_frame_modal(bContext *C, wmOperator *op, wmEvent *event) +static int change_frame_modal(bContext *C, wmOperator *op, const wmEvent *event) { /* execute the events */ switch (event->type) { diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 0867f7f76ff..ed8398b7c8b 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -1297,7 +1297,7 @@ void ANIM_OT_keyframe_insert(wmOperatorType *ot) * then calls the menu if necessary before */ -static int insert_key_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int insert_key_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 24b1ade7599..ad09fcb5966 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -468,7 +468,7 @@ void ANIM_OT_keyingset_button_remove(wmOperatorType *ot) /* Change Active KeyingSet Operator ------------------------ */ /* This operator checks if a menu should be shown for choosing the KeyingSet to make the active one */ -static int keyingset_active_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int keyingset_active_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { uiPopupMenu *pup; uiLayout *layout; diff --git a/source/blender/editors/armature/armature_add.c b/source/blender/editors/armature/armature_add.c index 86ec0777ddc..28fb74f0cdd 100644 --- a/source/blender/editors/armature/armature_add.c +++ b/source/blender/editors/armature/armature_add.c @@ -214,7 +214,7 @@ static int armature_click_extrude_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -static int armature_click_extrude_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int armature_click_extrude_invoke(bContext *C, wmOperator *op, const wmEvent *event) { /* TODO most of this code is copied from set3dcursor_invoke, * it would be better to reuse code in set3dcursor_invoke */ diff --git a/source/blender/editors/armature/armature_relations.c b/source/blender/editors/armature/armature_relations.c index c64bb5c4683..3a4dc31c82d 100644 --- a/source/blender/editors/armature/armature_relations.c +++ b/source/blender/editors/armature/armature_relations.c @@ -671,7 +671,7 @@ static int armature_parent_set_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int armature_parent_set_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) +static int armature_parent_set_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) { EditBone *actbone = CTX_data_active_bone(C); uiPopupMenu *pup = uiPupMenuBegin(C, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Make Parent"), ICON_NONE); diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c index 07706d3d0d1..7ff318bb6b6 100644 --- a/source/blender/editors/armature/armature_select.c +++ b/source/blender/editors/armature/armature_select.c @@ -166,7 +166,7 @@ void *get_nearest_bone(bContext *C, short findunsel, int x, int y) /* called in space.c */ /* previously "selectconnected_armature" */ -static int armature_select_linked_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int armature_select_linked_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bArmature *arm; EditBone *bone, *curBone, *next; diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index cd20b7feb5b..a84827bfe0f 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -2232,7 +2232,7 @@ void BDR_drawSketch(const bContext *C) } } -static int sketch_delete(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) +static int sketch_delete(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) { SK_Sketch *sketch = contextSketch(C, 0); if (sketch) { @@ -2329,7 +2329,7 @@ SK_Sketch *viewcontextSketch(ViewContext *vc, int create) return sketch; } -static int sketch_convert(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) +static int sketch_convert(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) { SK_Sketch *sketch = contextSketch(C, 0); if (sketch != NULL) { @@ -2339,7 +2339,7 @@ static int sketch_convert(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(e return OPERATOR_FINISHED; } -static int sketch_cancel(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) +static int sketch_cancel(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) { SK_Sketch *sketch = contextSketch(C, 0); if (sketch != NULL) { @@ -2350,7 +2350,7 @@ static int sketch_cancel(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(ev return OPERATOR_PASS_THROUGH; } -static int sketch_finish(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) +static int sketch_finish(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) { SK_Sketch *sketch = contextSketch(C, 0); if (sketch != NULL) { @@ -2362,7 +2362,7 @@ static int sketch_finish(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(ev return OPERATOR_PASS_THROUGH; } -static int sketch_select(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int sketch_select(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { SK_Sketch *sketch = contextSketch(C, 0); if (sketch) { @@ -2382,7 +2382,7 @@ static int sketch_draw_stroke_cancel(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int sketch_draw_stroke(bContext *C, wmOperator *op, wmEvent *event) +static int sketch_draw_stroke(bContext *C, wmOperator *op, const wmEvent *event) { short snap = RNA_boolean_get(op->ptr, "snap"); SK_DrawData *dd; @@ -2408,7 +2408,7 @@ static int sketch_draw_gesture_cancel(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int sketch_draw_gesture(bContext *C, wmOperator *op, wmEvent *event) +static int sketch_draw_gesture(bContext *C, wmOperator *op, const wmEvent *event) { short snap = RNA_boolean_get(op->ptr, "snap"); SK_DrawData *dd; @@ -2426,7 +2426,7 @@ static int sketch_draw_gesture(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int sketch_draw_modal(bContext *C, wmOperator *op, wmEvent *event, short gesture, SK_Stroke *stk) +static int sketch_draw_modal(bContext *C, wmOperator *op, const wmEvent *event, short gesture, SK_Stroke *stk) { short snap = RNA_boolean_get(op->ptr, "snap"); SK_DrawData *dd = op->customdata; @@ -2484,19 +2484,19 @@ static int sketch_draw_modal(bContext *C, wmOperator *op, wmEvent *event, short return retval; } -static int sketch_draw_stroke_modal(bContext *C, wmOperator *op, wmEvent *event) +static int sketch_draw_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event) { SK_Sketch *sketch = contextSketch(C, 1); /* create just to be sure */ return sketch_draw_modal(C, op, event, 0, sketch->active_stroke); } -static int sketch_draw_gesture_modal(bContext *C, wmOperator *op, wmEvent *event) +static int sketch_draw_gesture_modal(bContext *C, wmOperator *op, const wmEvent *event) { SK_Sketch *sketch = contextSketch(C, 1); /* create just to be sure */ return sketch_draw_modal(C, op, event, 1, sketch->gesture); } -static int sketch_draw_preview(bContext *C, wmOperator *op, wmEvent *event) +static int sketch_draw_preview(bContext *C, wmOperator *op, const wmEvent *event) { short snap = RNA_boolean_get(op->ptr, "snap"); SK_Sketch *sketch = contextSketch(C, 0); diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c index 3d1d5d2f6ba..40b96132699 100644 --- a/source/blender/editors/armature/pose_edit.c +++ b/source/blender/editors/armature/pose_edit.c @@ -201,7 +201,7 @@ void ED_pose_recalculate_paths(Scene *scene, Object *ob) /* show popup to determine settings */ -static int pose_calculate_paths_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int pose_calculate_paths_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); @@ -793,7 +793,7 @@ void ARMATURE_OT_layers_show_all(wmOperatorType *ot) /* ------------------- */ /* Present a popup to get the layers that should be used */ -static int pose_armature_layers_invoke(bContext *C, wmOperator *op, wmEvent *evt) +static int pose_armature_layers_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); bArmature *arm = (ob) ? ob->data : NULL; @@ -810,7 +810,7 @@ static int pose_armature_layers_invoke(bContext *C, wmOperator *op, wmEvent *evt RNA_boolean_set_array(op->ptr, "layers", layers); /* part to sync with other similar operators... */ - return WM_operator_props_popup(C, op, evt); + return WM_operator_props_popup(C, op, event); } /* Set the visible layers for the active armature (edit and pose modes) */ @@ -879,7 +879,7 @@ void ARMATURE_OT_armature_layers(wmOperatorType *ot) /* ------------------- */ /* Present a popup to get the layers that should be used */ -static int pose_bone_layers_invoke(bContext *C, wmOperator *op, wmEvent *evt) +static int pose_bone_layers_invoke(bContext *C, wmOperator *op, const wmEvent *event) { int layers[32] = {0}; /* hardcoded for now - we can only have 32 armature layers, so this should be fine... */ @@ -900,7 +900,7 @@ static int pose_bone_layers_invoke(bContext *C, wmOperator *op, wmEvent *evt) RNA_boolean_set_array(op->ptr, "layers", layers); /* part to sync with other similar operators... */ - return WM_operator_props_popup(C, op, evt); + return WM_operator_props_popup(C, op, event); } /* Set the visible layers for the active armature (edit and pose modes) */ @@ -954,7 +954,7 @@ void POSE_OT_bone_layers(wmOperatorType *ot) /* ------------------- */ /* Present a popup to get the layers that should be used */ -static int armature_bone_layers_invoke(bContext *C, wmOperator *op, wmEvent *evt) +static int armature_bone_layers_invoke(bContext *C, wmOperator *op, const wmEvent *event) { int layers[32] = {0}; /* hardcoded for now - we can only have 32 armature layers, so this should be fine... */ @@ -975,7 +975,7 @@ static int armature_bone_layers_invoke(bContext *C, wmOperator *op, wmEvent *evt RNA_boolean_set_array(op->ptr, "layers", layers); /* part to sync with other similar operators... */ - return WM_operator_props_popup(C, op, evt); + return WM_operator_props_popup(C, op, event); } /* Set the visible layers for the active armature (edit and pose modes) */ diff --git a/source/blender/editors/armature/pose_group.c b/source/blender/editors/armature/pose_group.c index 06a88f013d7..99f54de134a 100644 --- a/source/blender/editors/armature/pose_group.c +++ b/source/blender/editors/armature/pose_group.c @@ -126,7 +126,7 @@ void POSE_OT_group_remove(wmOperatorType *ot) /* ------------ */ /* invoke callback which presents a list of bone-groups for the user to choose from */ -static int pose_groups_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(evt)) +static int pose_groups_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Object *ob = ED_pose_object_from_context(C); bPose *pose; diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c index 457874c7ae6..09c0f7e9647 100644 --- a/source/blender/editors/armature/pose_lib.c +++ b/source/blender/editors/armature/pose_lib.c @@ -389,7 +389,7 @@ static void poselib_add_menu_invoke__replacemenu(bContext *C, uiLayout *layout, } } -static int poselib_add_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(evt)) +static int poselib_add_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Scene *scene = CTX_data_scene(C); Object *ob = get_poselib_object(C); @@ -613,7 +613,7 @@ void POSELIB_OT_pose_remove(wmOperatorType *ot) ot->prop = prop; } -static int poselib_rename_invoke(bContext *C, wmOperator *op, wmEvent *evt) +static int poselib_rename_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Object *ob = get_poselib_object(C); bAction *act = (ob) ? ob->poselib : NULL; @@ -638,7 +638,7 @@ static int poselib_rename_invoke(bContext *C, wmOperator *op, wmEvent *evt) } /* part to sync with other similar operators... */ - return WM_operator_props_popup(C, op, evt); + return WM_operator_props_popup(C, op, event); } static int poselib_rename_exec(bContext *C, wmOperator *op) @@ -1185,7 +1185,7 @@ static void poselib_preview_handle_search(tPoseLib_PreviewData *pld, unsigned sh } /* handle events for poselib_preview_poses */ -static int poselib_preview_handle_event(bContext *UNUSED(C), wmOperator *op, wmEvent *event) +static int poselib_preview_handle_event(bContext *UNUSED(C), wmOperator *op, const wmEvent *event) { tPoseLib_PreviewData *pld = op->customdata; int ret = OPERATOR_RUNNING_MODAL; @@ -1539,7 +1539,7 @@ static int poselib_preview_cancel(bContext *C, wmOperator *op) } /* main modal status check */ -static int poselib_preview_modal(bContext *C, wmOperator *op, wmEvent *event) +static int poselib_preview_modal(bContext *C, wmOperator *op, const wmEvent *event) { tPoseLib_PreviewData *pld = op->customdata; int ret; @@ -1559,7 +1559,7 @@ static int poselib_preview_modal(bContext *C, wmOperator *op, wmEvent *event) } /* Modal Operator init */ -static int poselib_preview_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int poselib_preview_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { tPoseLib_PreviewData *pld; diff --git a/source/blender/editors/armature/pose_select.c b/source/blender/editors/armature/pose_select.c index 186c7a1fe89..4fa1389426d 100644 --- a/source/blender/editors/armature/pose_select.c +++ b/source/blender/editors/armature/pose_select.c @@ -208,7 +208,7 @@ static void selectconnected_posebonechildren(Object *ob, Bone *bone, int extend) /* within active object context */ /* previously known as "selectconnected_posearmature" */ -static int pose_select_connected_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int pose_select_connected_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); bArmature *arm = (bArmature *)ob->data; diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c index fee37a9c0fb..4d6f8f520f5 100644 --- a/source/blender/editors/armature/pose_slide.c +++ b/source/blender/editors/armature/pose_slide.c @@ -614,12 +614,12 @@ static int pose_slide_invoke_common(bContext *C, wmOperator *op, tPoseSlideOp *p } /* common code for modal() */ -static int pose_slide_modal(bContext *C, wmOperator *op, wmEvent *evt) +static int pose_slide_modal(bContext *C, wmOperator *op, const wmEvent *event) { tPoseSlideOp *pso = op->customdata; wmWindow *win = CTX_wm_window(C); - switch (evt->type) { + switch (event->type) { case LEFTMOUSE: /* confirm */ case RETKEY: { @@ -660,7 +660,7 @@ static int pose_slide_modal(bContext *C, wmOperator *op, wmEvent *evt) /* calculate percentage based on position of mouse (we only use x-axis for now. * since this is more convenient for users to do), and store new percentage value */ - pso->percentage = (evt->x - pso->ar->winrct.xmin) / ((float)pso->ar->winx); + pso->percentage = (event->x - pso->ar->winrct.xmin) / ((float)pso->ar->winx); RNA_float_set(op->ptr, "percentage", pso->percentage); /* update percentage indicator in header */ @@ -717,7 +717,7 @@ static void pose_slide_opdef_properties(wmOperatorType *ot) /* ------------------------------------ */ /* invoke() - for 'push' mode */ -static int pose_slide_push_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(evt)) +static int pose_slide_push_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { tPoseSlideOp *pso; @@ -774,7 +774,7 @@ void POSE_OT_push(wmOperatorType *ot) /* ........................ */ /* invoke() - for 'relax' mode */ -static int pose_slide_relax_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(evt)) +static int pose_slide_relax_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { tPoseSlideOp *pso; @@ -831,7 +831,7 @@ void POSE_OT_relax(wmOperatorType *ot) /* ........................ */ /* invoke() - for 'breakdown' mode */ -static int pose_slide_breakdown_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(evt)) +static int pose_slide_breakdown_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { tPoseSlideOp *pso; diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 31a3eb5ca5d..e134507600e 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -4437,7 +4437,7 @@ static int spin_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int spin_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int spin_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); @@ -4756,7 +4756,7 @@ static int add_vertex_exec(bContext *C, wmOperator *op) return addvert_Nurb(C, 0, location); } -static int add_vertex_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int add_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event) { RegionView3D *rv3d = CTX_wm_region_view3d(C); @@ -4939,7 +4939,7 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int toggle_cyclic_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int toggle_cyclic_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Object *obedit = CTX_data_edit_object(C); ListBase *editnurb = object_editcurve_get(obedit); @@ -5042,7 +5042,7 @@ static int select_linked_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -static int select_linked_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int select_linked_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { return select_linked_exec(C, op); } @@ -5068,7 +5068,7 @@ void CURVE_OT_select_linked(wmOperatorType *ot) /***************** select linked pick operator ******************/ -static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Object *obedit = CTX_data_edit_object(C); ViewContext vc; @@ -6097,7 +6097,7 @@ static int delete_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int delete_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int delete_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Object *obedit = CTX_data_edit_object(C); uiPopupMenu *pup; diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index af6b90a9958..63444c5c17e 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -405,7 +405,7 @@ static int paste_file_exec(bContext *C, wmOperator *op) return retval; } -static int paste_file_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int paste_file_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (RNA_struct_property_is_set(op->ptr, "filepath")) return paste_file_exec(C, op); @@ -1221,16 +1221,16 @@ static int insert_text_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int insert_text_invoke(bContext *C, wmOperator *op, wmEvent *evt) +static int insert_text_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Scene *scene = CTX_data_scene(C); Object *obedit = CTX_data_edit_object(C); Curve *cu = obedit->data; EditFont *ef = cu->editfont; static int accentcode = 0; - uintptr_t ascii = evt->ascii; - int alt = evt->alt, shift = evt->shift, ctrl = evt->ctrl; - int event = evt->type, val = evt->val; + uintptr_t ascii = event->ascii; + int alt = event->alt, shift = event->shift, ctrl = event->ctrl; + int event_type = event->type, event_val = event->val; wchar_t inserted_text[2] = {0}; if (RNA_struct_property_is_set(op->ptr, "text")) @@ -1243,26 +1243,26 @@ static int insert_text_invoke(bContext *C, wmOperator *op, wmEvent *evt) } /* tab should exit editmode, but we allow it to be typed using modifier keys */ - if (event == TABKEY) { + if (event_type == TABKEY) { if ((alt || ctrl || shift) == 0) return OPERATOR_PASS_THROUGH; else ascii = 9; } - if (event == BACKSPACEKEY) { + if (event_type == BACKSPACEKEY) { if (alt && cu->len != 0 && cu->pos > 0) accentcode = 1; return OPERATOR_PASS_THROUGH; } - if (val && (ascii || evt->utf8_buf[0])) { + if (event_val && (ascii || event->utf8_buf[0])) { /* handle case like TAB (== 9) */ if ( (ascii > 31 && ascii < 254 && ascii != 127) || (ascii == 13) || (ascii == 10) || (ascii == 8) || - (evt->utf8_buf[0])) + (event->utf8_buf[0])) { if (accentcode) { @@ -1272,8 +1272,8 @@ static int insert_text_invoke(bContext *C, wmOperator *op, wmEvent *evt) } accentcode = 0; } - else if (evt->utf8_buf[0]) { - BLI_strncpy_wchar_from_utf8(inserted_text, evt->utf8_buf, 1); + else if (event->utf8_buf[0]) { + BLI_strncpy_wchar_from_utf8(inserted_text, event->utf8_buf, 1); ascii = inserted_text[0]; insert_into_textbuf(obedit, ascii); accentcode = 0; @@ -1307,7 +1307,7 @@ static int insert_text_invoke(bContext *C, wmOperator *op, wmEvent *evt) } /* reset property? */ - if (val == 0) + if (event_val == 0) accentcode = 0; return OPERATOR_FINISHED; @@ -1643,7 +1643,7 @@ static int font_open_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int open_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { VFont *vfont = NULL; char *path; diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 3d8ab174f5d..bc68ad8869a 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1546,7 +1546,7 @@ static void gpencil_draw_apply(wmOperator *op, tGPsdata *p) } /* handle draw event */ -static void gpencil_draw_apply_event(wmOperator *op, wmEvent *event) +static void gpencil_draw_apply_event(wmOperator *op, const wmEvent *event) { tGPsdata *p = op->customdata; PointerRNA itemptr; @@ -1684,7 +1684,7 @@ static int gpencil_draw_exec(bContext *C, wmOperator *op) /* ------------------------------- */ /* start of interactive drawing part of operator */ -static int gpencil_draw_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int gpencil_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event) { tGPsdata *p = NULL; wmWindow *win = CTX_wm_window(C); @@ -1795,7 +1795,7 @@ static void gpencil_stroke_end(wmOperator *op) } /* events handling during interactive drawing part of operator */ -static int gpencil_draw_modal(bContext *C, wmOperator *op, wmEvent *event) +static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) { tGPsdata *p = op->customdata; int estate = OPERATOR_PASS_THROUGH; /* default exit state - pass through to support MMB view nav, etc. */ diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index dd5bf45f557..75c66779d6d 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -186,7 +186,7 @@ void paintface_flush_flags(struct Object *ob); int paintface_mouse_select(struct bContext *C, struct Object *ob, const int mval[2], int extend, int deselect, int toggle); int do_paintface_box_select(struct ViewContext *vc, struct rcti *rect, int select, int extend); void paintface_deselect_all_visible(struct Object *ob, int action, short flush_flags); -void paintface_select_linked(struct bContext *C, struct Object *ob, int mval[2], int mode); +void paintface_select_linked(struct bContext *C, struct Object *ob, const int mval[2], int mode); int paintface_minmax(struct Object *ob, float r_min[3], float r_max[3]); void paintface_hide(struct Object *ob, const int unselected); diff --git a/source/blender/editors/include/ED_numinput.h b/source/blender/editors/include/ED_numinput.h index 126ea13f0b2..e7d80d96f89 100644 --- a/source/blender/editors/include/ED_numinput.h +++ b/source/blender/editors/include/ED_numinput.h @@ -61,7 +61,7 @@ void initNumInput(NumInput *n); void outputNumInput(NumInput *n, char *str); short hasNumInput(NumInput *n); void applyNumInput(NumInput *n, float *vec); -char handleNumInput(NumInput *n, struct wmEvent *event); +char handleNumInput(NumInput *n, const struct wmEvent *event); #define NUM_MODAL_INCREMENT_UP 18 #define NUM_MODAL_INCREMENT_DOWN 19 diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h index 8d87c216174..6101d03b946 100644 --- a/source/blender/editors/include/ED_transform.h +++ b/source/blender/editors/include/ED_transform.h @@ -151,7 +151,7 @@ void Transform_Properties(struct wmOperatorType *ot, int flags); /* view3d manipulators */ -int BIF_do_manipulator(struct bContext *C, struct wmEvent *event, struct wmOperator *op); +int BIF_do_manipulator(struct bContext *C, const struct wmEvent *event, struct wmOperator *op); void BIF_draw_manipulator(const struct bContext *C); /* Snapping */ diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index 64221a12cb9..145deb35667 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -239,7 +239,7 @@ static void eyedropper_color_sample_accum(bContext *C, Eyedropper *eye, int mx, } /* main modal status check */ -static int eyedropper_modal(bContext *C, wmOperator *op, wmEvent *event) +static int eyedropper_modal(bContext *C, wmOperator *op, const wmEvent *event) { Eyedropper *eye = (Eyedropper *)op->customdata; @@ -285,7 +285,7 @@ static int eyedropper_modal(bContext *C, wmOperator *op, wmEvent *event) } /* Modal Operator init */ -static int eyedropper_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int eyedropper_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { /* init */ if (eyedropper_init(C, op)) { diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index daa78957231..e283bd1351a 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -187,7 +187,7 @@ static int view_pan_exec(bContext *C, wmOperator *op) } /* set up modal operator and relevant settings */ -static int view_pan_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int view_pan_invoke(bContext *C, wmOperator *op, const wmEvent *event) { wmWindow *window = CTX_wm_window(C); v2dViewPanData *vpd; @@ -231,7 +231,7 @@ static int view_pan_invoke(bContext *C, wmOperator *op, wmEvent *event) } /* handle user input - calculations of mouse-movement need to be done here, not in the apply callback! */ -static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event) +static int view_pan_modal(bContext *C, wmOperator *op, const wmEvent *event) { v2dViewPanData *vpd = op->customdata; @@ -700,7 +700,7 @@ static int view_zoomin_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int view_zoomin_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int view_zoomin_invoke(bContext *C, wmOperator *op, const wmEvent *event) { v2dViewZoomData *vzd; @@ -769,7 +769,7 @@ static int view_zoomout_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int view_zoomout_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int view_zoomout_invoke(bContext *C, wmOperator *op, const wmEvent *event) { v2dViewZoomData *vzd; @@ -924,7 +924,7 @@ static int view_zoomdrag_exec(bContext *C, wmOperator *op) } /* set up modal operator and relevant settings */ -static int view_zoomdrag_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int view_zoomdrag_invoke(bContext *C, wmOperator *op, const wmEvent *event) { wmWindow *window = CTX_wm_window(C); v2dViewZoomData *vzd; @@ -1005,7 +1005,7 @@ static int view_zoomdrag_invoke(bContext *C, wmOperator *op, wmEvent *event) } /* handle user input - calculations of mouse-movement need to be done here, not in the apply callback! */ -static int view_zoomdrag_modal(bContext *C, wmOperator *op, wmEvent *event) +static int view_zoomdrag_modal(bContext *C, wmOperator *op, const wmEvent *event) { v2dViewZoomData *vzd = op->customdata; View2D *v2d = vzd->v2d; @@ -1328,7 +1328,7 @@ void UI_view2d_smooth_view(bContext *C, ARegion *ar, } /* only meant for timer usage */ -static int view2d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int view2d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { ARegion *ar = CTX_wm_region(C); View2D *v2d = &ar->v2d; @@ -1488,7 +1488,7 @@ static short mouse_in_scroller_handle(int mouse, int sc_min, int sc_max, int sh_ } /* initialize customdata for scroller manipulation operator */ -static void scroller_activate_init(bContext *C, wmOperator *op, wmEvent *event, short in_scroller) +static void scroller_activate_init(bContext *C, wmOperator *op, const wmEvent *event, short in_scroller) { v2dScrollerMove *vsm; View2DScrollers *scrollers; @@ -1637,7 +1637,7 @@ static void scroller_activate_apply(bContext *C, wmOperator *op) } /* handle user input for scrollers - calculations of mouse-movement need to be done here, not in the apply callback! */ -static int scroller_activate_modal(bContext *C, wmOperator *op, wmEvent *event) +static int scroller_activate_modal(bContext *C, wmOperator *op, const wmEvent *event) { v2dScrollerMove *vsm = op->customdata; @@ -1707,7 +1707,7 @@ static int scroller_activate_modal(bContext *C, wmOperator *op, wmEvent *event) /* a click (or click drag in progress) should have occurred, so check if it happened in scrollbar */ -static int scroller_activate_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int scroller_activate_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); View2D *v2d = &ar->v2d; diff --git a/source/blender/editors/io/io_collada.c b/source/blender/editors/io/io_collada.c index fcb07249cd7..c673e0fb2b0 100644 --- a/source/blender/editors/io/io_collada.c +++ b/source/blender/editors/io/io_collada.c @@ -56,7 +56,7 @@ #include "io_collada.h" -static int wm_collada_export_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int wm_collada_export_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (!RNA_struct_property_is_set(op->ptr, "filepath")) { char filepath[FILE_MAX]; diff --git a/source/blender/editors/mask/mask_add.c b/source/blender/editors/mask/mask_add.c index 77abe43bba7..33a6aa2d43d 100644 --- a/source/blender/editors/mask/mask_add.c +++ b/source/blender/editors/mask/mask_add.c @@ -629,7 +629,7 @@ static int add_vertex_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int add_vertex_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int add_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ScrArea *sa = CTX_wm_area(C); ARegion *ar = CTX_wm_region(C); @@ -703,7 +703,7 @@ static int add_feather_vertex_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int add_feather_vertex_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int add_feather_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ScrArea *sa = CTX_wm_area(C); ARegion *ar = CTX_wm_region(C); diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c index 0a996c11f14..ff8e27ac264 100644 --- a/source/blender/editors/mask/mask_ops.c +++ b/source/blender/editors/mask/mask_ops.c @@ -438,7 +438,7 @@ static int slide_point_check_initial_feather(MaskSpline *spline) return TRUE; } -static void *slide_point_customdata(bContext *C, wmOperator *op, wmEvent *event) +static void *slide_point_customdata(bContext *C, wmOperator *op, const wmEvent *event) { ScrArea *sa = CTX_wm_area(C); ARegion *ar = CTX_wm_region(C); @@ -525,7 +525,7 @@ static void *slide_point_customdata(bContext *C, wmOperator *op, wmEvent *event) return customdata; } -static int slide_point_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int slide_point_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SlidePointData *slidedata = slide_point_customdata(C, op, event); @@ -634,7 +634,7 @@ static void free_slide_point_data(SlidePointData *data) MEM_freeN(data); } -static int slide_point_modal(bContext *C, wmOperator *op, wmEvent *event) +static int slide_point_modal(bContext *C, wmOperator *op, const wmEvent *event) { SlidePointData *data = (SlidePointData *)op->customdata; BezTriple *bezt = &data->point->bezt; diff --git a/source/blender/editors/mask/mask_select.c b/source/blender/editors/mask/mask_select.c index cd1a47754f8..ccc2fad5f52 100644 --- a/source/blender/editors/mask/mask_select.c +++ b/source/blender/editors/mask/mask_select.c @@ -361,7 +361,7 @@ static int select_exec(bContext *C, wmOperator *op) return OPERATOR_PASS_THROUGH; } -static int select_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ScrArea *sa = CTX_wm_area(C); ARegion *ar = CTX_wm_region(C); @@ -689,7 +689,7 @@ void MASK_OT_select_circle(wmOperatorType *ot) RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, "Gesture Mode", "", INT_MIN, INT_MAX); } -static int mask_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int mask_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ScrArea *sa = CTX_wm_area(C); ARegion *ar = CTX_wm_region(C); diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c index 8d2e428b02c..9b26959ea28 100644 --- a/source/blender/editors/mesh/editface.c +++ b/source/blender/editors/mesh/editface.c @@ -294,7 +294,7 @@ static void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int ind MEM_freeN(linkflag); } -void paintface_select_linked(bContext *UNUSED(C), Object *ob, int UNUSED(mval[2]), int mode) +void paintface_select_linked(bContext *UNUSED(C), Object *ob, const int UNUSED(mval[2]), int mode) { Mesh *me; unsigned int index = 0; diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 96d90a8c0a5..af793c1e0a2 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -2944,7 +2944,7 @@ static void cage_mapped_verts_callback(void *userData, int index, const float co } } -static void knifetool_update_mval(KnifeTool_OpData *kcd, int mval_i[2]) +static void knifetool_update_mval(KnifeTool_OpData *kcd, const int mval_i[2]) { knife_recalc_projmat(kcd); kcd->vc.mval[0] = mval_i[0]; @@ -3034,7 +3034,7 @@ static int knifetool_cancel(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int knifetool_invoke(bContext *C, wmOperator *op, wmEvent *evt) +static int knifetool_invoke(bContext *C, wmOperator *op, const wmEvent *event) { KnifeTool_OpData *kcd; @@ -3048,7 +3048,7 @@ static int knifetool_invoke(bContext *C, wmOperator *op, wmEvent *evt) WM_event_add_modal_handler(C, op); kcd = op->customdata; - knifetool_update_mval(kcd, evt->mval); + knifetool_update_mval(kcd, event->mval); knife_update_header(C, kcd); @@ -3119,7 +3119,7 @@ wmKeyMap *knifetool_modal_keymap(wmKeyConfig *keyconf) return keymap; } -static int knifetool_modal(bContext *C, wmOperator *op, wmEvent *event) +static int knifetool_modal(bContext *C, wmOperator *op, const wmEvent *event) { Object *obedit = CTX_data_edit_object(C); KnifeTool_OpData *kcd = op->customdata; diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c index 83542915ec2..5b9864ca239 100644 --- a/source/blender/editors/mesh/editmesh_loopcut.c +++ b/source/blender/editors/mesh/editmesh_loopcut.c @@ -385,7 +385,7 @@ static int ringcut_cancel(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int ringcut_invoke(bContext *C, wmOperator *op, wmEvent *evt) +static int ringcut_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ScrArea *sa = CTX_wm_area(C); Object *obedit = CTX_data_edit_object(C); @@ -405,8 +405,7 @@ static int ringcut_invoke(bContext *C, wmOperator *op, wmEvent *evt) WM_event_add_modal_handler(C, op); lcd = op->customdata; - lcd->vc.mval[0] = evt->mval[0]; - lcd->vc.mval[1] = evt->mval[1]; + copy_v2_v2_int(lcd->vc.mval, event->mval); edge = EDBM_edge_find_nearest(&lcd->vc, &dist); if (edge != lcd->eed) { @@ -419,7 +418,7 @@ static int ringcut_invoke(bContext *C, wmOperator *op, wmEvent *evt) return OPERATOR_RUNNING_MODAL; } -static int loopcut_modal(bContext *C, wmOperator *op, wmEvent *event) +static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event) { float smoothness = RNA_float_get(op->ptr, "smoothness"); int cuts = RNA_int_get(op->ptr, "number_cuts"); diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c index 0ceec68f446..533ae26cfac 100644 --- a/source/blender/editors/mesh/editmesh_rip.c +++ b/source/blender/editors/mesh/editmesh_rip.c @@ -538,7 +538,7 @@ static int edbm_rip_call_edgesplit(BMEditMesh *em, wmOperator *op) /** * This is the main vert ripping function (rip when one vertex is selected) */ -static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, wmEvent *event) +static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *event) { const int do_fill = RNA_boolean_get(op->ptr, "use_fill"); UnorderedLoopPair *fill_uloop_pairs = NULL; @@ -860,7 +860,7 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, wmEvent *event) /** * This is the main edge ripping function */ -static int edbm_rip_invoke__edge(bContext *C, wmOperator *op, wmEvent *event) +static int edbm_rip_invoke__edge(bContext *C, wmOperator *op, const wmEvent *event) { const int do_fill = RNA_boolean_get(op->ptr, "use_fill"); UnorderedLoopPair *fill_uloop_pairs = NULL; @@ -988,7 +988,7 @@ static int edbm_rip_invoke__edge(bContext *C, wmOperator *op, wmEvent *event) } /* based on mouse cursor position, it defines how is being ripped */ -static int edbm_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int edbm_rip_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Object *obedit = CTX_data_edit_object(C); BMEditMesh *em = BMEdit_FromObject(obedit); diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index a1f836ad037..ccf77b70ea0 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -923,7 +923,7 @@ static int edbm_select_mode_exec(bContext *C, wmOperator *op) } } -static int edbm_select_mode_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int edbm_select_mode_invoke(bContext *C, wmOperator *op, const wmEvent *event) { /* detecting these options based on shift/ctrl here is weak, but it's done * to make this work when clicking buttons or menus */ @@ -1075,7 +1075,7 @@ void MESH_OT_loop_multi_select(wmOperatorType *ot) /* ***************** loop select (non modal) ************** */ -static void mouse_mesh_loop(bContext *C, int mval[2], short extend, short deselect, short toggle, short ring) +static void mouse_mesh_loop(bContext *C, const int mval[2], short extend, short deselect, short toggle, short ring) { ViewContext vc; BMEditMesh *em; @@ -1194,7 +1194,7 @@ static void mouse_mesh_loop(bContext *C, int mval[2], short extend, short desele } } -static int edbm_select_loop_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int edbm_select_loop_invoke(bContext *C, wmOperator *op, const wmEvent *event) { view3d_operator_needs_opengl(C); @@ -1715,7 +1715,7 @@ static int mouse_mesh_shortest_path_face(ViewContext *vc) /* ******************* operator for edge and face tag ****************** */ -static int edbm_shortest_path_select_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int edbm_shortest_path_select_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { ViewContext vc; BMEditMesh *em; @@ -2213,7 +2213,7 @@ static void linked_limit_default(bContext *C, wmOperator *op) } } -static int edbm_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int edbm_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Object *obedit = CTX_data_edit_object(C); ViewContext vc; diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index b862860c747..eb5e66cbfba 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -777,7 +777,7 @@ void MESH_OT_select_interior_faces(wmOperatorType *ot) } /* *************** add-click-mesh (extrude) operator ************** */ -static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ViewContext vc; BMVert *v1; @@ -1509,7 +1509,7 @@ static int edbm_duplicate_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int edbm_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int edbm_duplicate_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { WM_cursor_wait(1); edbm_duplicate_exec(C, op); @@ -3847,7 +3847,7 @@ static int edbm_spin_exec(bContext *C, wmOperator *op) } /* get center and axis, in global coords */ -static int edbm_spin_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int edbm_spin_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); @@ -3971,7 +3971,7 @@ static int edbm_screw_exec(bContext *C, wmOperator *op) } /* get center and axis, in global coords */ -static int edbm_screw_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int edbm_screw_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); @@ -4963,7 +4963,7 @@ static int edbm_bevel_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int edbm_bevel_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int edbm_bevel_invoke(bContext *C, wmOperator *op, const wmEvent *event) { /* TODO make modal keymap (see fly mode) */ RegionView3D *rv3d = CTX_wm_region_view3d(C); @@ -5000,7 +5000,7 @@ static int edbm_bevel_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static float edbm_bevel_mval_factor(wmOperator *op, wmEvent *event) +static float edbm_bevel_mval_factor(wmOperator *op, const wmEvent *event) { BevelData *opdata = op->customdata; int use_dist = TRUE; @@ -5039,7 +5039,7 @@ static float edbm_bevel_mval_factor(wmOperator *op, wmEvent *event) return factor; } -static int edbm_bevel_modal(bContext *C, wmOperator *op, wmEvent *event) +static int edbm_bevel_modal(bContext *C, wmOperator *op, const wmEvent *event) { BevelData *opdata = op->customdata; int segments = RNA_int_get(op->ptr, "segments"); @@ -5345,7 +5345,7 @@ static int edbm_inset_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int edbm_inset_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int edbm_inset_invoke(bContext *C, wmOperator *op, const wmEvent *event) { RegionView3D *rv3d = CTX_wm_region_view3d(C); InsetData *opdata; @@ -5375,7 +5375,7 @@ static int edbm_inset_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int edbm_inset_modal(bContext *C, wmOperator *op, wmEvent *event) +static int edbm_inset_modal(bContext *C, wmOperator *op, const wmEvent *event) { InsetData *opdata = op->customdata; diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index 25560b3a33d..dbdce4c2f36 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -571,7 +571,7 @@ void MESH_OT_uv_texture_add(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int drop_named_image_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c index 6c056df5a38..6781624aec6 100644 --- a/source/blender/editors/metaball/mball_edit.c +++ b/source/blender/editors/metaball/mball_edit.c @@ -254,7 +254,7 @@ static int duplicate_metaelems_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -static int duplicate_metaelems_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int duplicate_metaelems_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { int retv = duplicate_metaelems_exec(C, op); diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 3016f627a81..98dd39a390f 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -740,7 +740,7 @@ void OBJECT_OT_empty_add(wmOperatorType *ot) ED_object_add_generic_props(ot, FALSE); } -static int empty_drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int empty_drop_named_image_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Base *base = NULL; Image *ima = NULL; diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index 1a23a599d7c..dc54207b4e6 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -698,7 +698,7 @@ static void bake_freejob(void *bkv) } /* catch esc */ -static int objects_bake_render_modal(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int objects_bake_render_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { /* no running blender, remove handler and pass through */ if (0 == WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C), WM_JOB_TYPE_OBJECT_BAKE_TEXTURE)) @@ -721,7 +721,7 @@ static int is_multires_bake(Scene *scene) return 0; } -static int objects_bake_render_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(_event)) +static int objects_bake_render_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(_event)) { Scene *scene = CTX_data_scene(C); int result = OPERATOR_CANCELLED; diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index e8b6b29c73f..8e2a87c7c64 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -647,7 +647,7 @@ static int stretchto_reset_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int stretchto_reset_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int stretchto_reset_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_constraint_invoke_properties(C, op)) return stretchto_reset_exec(C, op); @@ -693,7 +693,7 @@ static int limitdistance_reset_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int limitdistance_reset_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int limitdistance_reset_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_constraint_invoke_properties(C, op)) return limitdistance_reset_exec(C, op); @@ -829,7 +829,7 @@ static int childof_set_inverse_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int childof_set_inverse_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int childof_set_inverse_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_constraint_invoke_properties(C, op)) return childof_set_inverse_exec(C, op); @@ -876,7 +876,7 @@ static int childof_clear_inverse_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int childof_clear_inverse_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int childof_clear_inverse_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_constraint_invoke_properties(C, op)) return childof_clear_inverse_exec(C, op); @@ -993,7 +993,7 @@ static int followpath_path_animate_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int followpath_path_animate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int followpath_path_animate_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { /* hook up invoke properties for figuring out which constraint we're dealing with */ if (edit_constraint_invoke_properties(C, op)) { @@ -1051,7 +1051,7 @@ static int objectsolver_set_inverse_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int objectsolver_set_inverse_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int objectsolver_set_inverse_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_constraint_invoke_properties(C, op)) return objectsolver_set_inverse_exec(C, op); @@ -1097,7 +1097,7 @@ static int objectsolver_clear_inverse_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int objectsolver_clear_inverse_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int objectsolver_clear_inverse_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_constraint_invoke_properties(C, op)) return objectsolver_clear_inverse_exec(C, op); @@ -1233,7 +1233,7 @@ static int constraint_move_down_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int constraint_move_down_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int constraint_move_down_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_constraint_invoke_properties(C, op)) return constraint_move_down_exec(C, op); @@ -1282,7 +1282,7 @@ static int constraint_move_up_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int constraint_move_up_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int constraint_move_up_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_constraint_invoke_properties(C, op)) return constraint_move_up_exec(C, op); @@ -1850,7 +1850,7 @@ void POSE_OT_constraint_add_with_targets(wmOperatorType *ot) // TODO: should these be here, or back in editors/armature/poseobject.c again? /* present menu with options + validation for targets to use */ -static int pose_ik_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(evt)) +static int pose_ik_add_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); bPoseChannel *pchan = BKE_pose_channel_active(ob); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 77410c1727e..ca57ab76c57 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1132,7 +1132,7 @@ void ED_objects_recalculate_paths(bContext *C, Scene *scene) /* show popup to determine settings */ -static int object_calculate_paths_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int object_calculate_paths_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Object *ob = CTX_data_active_object(C); diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 8d29813e2ac..d66620c2ff6 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -892,7 +892,7 @@ static int modifier_remove_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_remove_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int modifier_remove_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return modifier_remove_exec(C, op); @@ -931,7 +931,7 @@ static int modifier_move_up_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_move_up_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int modifier_move_up_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return modifier_move_up_exec(C, op); @@ -970,7 +970,7 @@ static int modifier_move_down_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_move_down_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int modifier_move_down_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return modifier_move_down_exec(C, op); @@ -1012,7 +1012,7 @@ static int modifier_apply_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_apply_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int modifier_apply_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return modifier_apply_exec(C, op); @@ -1061,7 +1061,7 @@ static int modifier_convert_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_convert_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int modifier_convert_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return modifier_convert_exec(C, op); @@ -1100,7 +1100,7 @@ static int modifier_copy_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_copy_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int modifier_copy_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return modifier_copy_exec(C, op); @@ -1149,7 +1149,7 @@ static int multires_higher_levels_delete_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int multires_higher_levels_delete_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int multires_higher_levels_delete_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return multires_higher_levels_delete_exec(C, op); @@ -1199,7 +1199,7 @@ static int multires_subdivide_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int multires_subdivide_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int multires_subdivide_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return multires_subdivide_exec(C, op); @@ -1263,7 +1263,7 @@ static int multires_reshape_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int multires_reshape_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int multires_reshape_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return multires_reshape_exec(C, op); @@ -1314,7 +1314,7 @@ static int multires_external_save_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int multires_external_save_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int multires_external_save_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Object *ob = ED_object_active_context(C); MultiresModifierData *mmd; @@ -1410,7 +1410,7 @@ static int multires_base_apply_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int multires_base_apply_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int multires_base_apply_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return multires_base_apply_exec(C, op); @@ -1834,7 +1834,7 @@ static int skin_armature_create_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int skin_armature_create_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int skin_armature_create_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return skin_armature_create_exec(C, op); @@ -1927,7 +1927,7 @@ static int meshdeform_bind_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int meshdeform_bind_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int meshdeform_bind_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return meshdeform_bind_exec(C, op); @@ -1975,7 +1975,7 @@ static int explode_refresh_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int explode_refresh_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int explode_refresh_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return explode_refresh_exec(C, op); @@ -2191,7 +2191,7 @@ static int ocean_bake_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int ocean_bake_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int ocean_bake_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_modifier_invoke_properties(C, op)) return ocean_bake_exec(C, op); diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 4ae9790e007..6039ff6d34b 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -286,7 +286,7 @@ void OBJECT_OT_vertex_parent_set(wmOperatorType *ot) /********************** Make Proxy Operator *************************/ /* set the object to proxify */ -static int make_proxy_invoke(bContext *C, wmOperator *op, wmEvent *evt) +static int make_proxy_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Scene *scene = CTX_data_scene(C); Object *ob = ED_object_active_context(C); @@ -299,7 +299,7 @@ static int make_proxy_invoke(bContext *C, wmOperator *op, wmEvent *evt) if (ob->dup_group && ob->dup_group->id.lib) { /* gives menu with list of objects in group */ //proxy_group_objects_menu(C, op, ob, ob->dup_group); - WM_enum_search_invoke(C, op, evt); + WM_enum_search_invoke(C, op, event); return OPERATOR_CANCELLED; } @@ -799,7 +799,7 @@ static int parent_set_exec(bContext *C, wmOperator *op) } -static int parent_set_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) +static int parent_set_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) { Object *ob = ED_object_active_context(C); uiPopupMenu *pup = uiPupMenuBegin(C, IFACE_("Set Parent To"), ICON_NONE); @@ -1229,7 +1229,7 @@ static unsigned int move_to_layer_init(bContext *C, wmOperator *op) return lay; } -static int move_to_layer_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int move_to_layer_invoke(bContext *C, wmOperator *op, const wmEvent *event) { View3D *v3d = CTX_wm_view3d(C); if (v3d && v3d->localvd) { @@ -2133,7 +2133,7 @@ void OBJECT_OT_make_single_user(wmOperatorType *ot) RNA_def_boolean(ot->srna, "animation", 0, "Object Animation", "Make animation data local to each object"); } -static int drop_named_material_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int drop_named_material_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Base *base = ED_view3d_give_base_under_cursor(C, event->mval); Material *ma; diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 111f3a0cb10..6c80f9377df 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -1555,7 +1555,7 @@ static int select_linked_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int select_linked_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int select_linked_invoke(bContext *C, wmOperator *op, const wmEvent *event) { RNA_int_set_array(op->ptr, "location", event->mval); return select_linked_exec(C, op); @@ -3759,7 +3759,7 @@ static int brush_edit_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static void brush_edit_apply_event(bContext *C, wmOperator *op, wmEvent *event) +static void brush_edit_apply_event(bContext *C, wmOperator *op, const wmEvent *event) { PointerRNA itemptr; float mouse[2]; @@ -3776,7 +3776,7 @@ static void brush_edit_apply_event(bContext *C, wmOperator *op, wmEvent *event) brush_edit_apply(C, op, &itemptr); } -static int brush_edit_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int brush_edit_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (!brush_edit_init(C, op)) return OPERATOR_CANCELLED; @@ -3788,7 +3788,7 @@ static int brush_edit_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int brush_edit_modal(bContext *C, wmOperator *op, wmEvent *event) +static int brush_edit_modal(bContext *C, wmOperator *op, const wmEvent *event) { switch (event->type) { case LEFTMOUSE: diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index bf81db3f3a0..df723b06259 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -1127,7 +1127,7 @@ static int fluidsimBake(bContext *UNUSED(C), ReportList *UNUSED(reports), Object /***************************** Operators ******************************/ -static int fluid_bake_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int fluid_bake_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { /* only one bake job at a time */ if (WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C), WM_JOB_TYPE_OBJECT_SIM_FLUID)) diff --git a/source/blender/editors/physics/rigidbody_world.c b/source/blender/editors/physics/rigidbody_world.c index babe32c74b2..b7430cb8a95 100644 --- a/source/blender/editors/physics/rigidbody_world.c +++ b/source/blender/editors/physics/rigidbody_world.c @@ -175,7 +175,7 @@ static int rigidbody_world_export_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int rigidbody_world_export_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(evt)) +static int rigidbody_world_export_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (!RNA_struct_property_is_set(op->ptr, "relative_path")) RNA_boolean_set(op->ptr, "relative_path", (U.flag & USER_RELPATHS)); diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 7d6043c45c0..b138bc63a68 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -465,7 +465,7 @@ static void render_drawlock(void *UNUSED(rjv), int lock) } /* catch esc */ -static int screen_render_modal(bContext *C, wmOperator *op, wmEvent *event) +static int screen_render_modal(bContext *C, wmOperator *op, const wmEvent *event) { Scene *scene = (Scene *) op->customdata; @@ -484,7 +484,7 @@ static int screen_render_modal(bContext *C, wmOperator *op, wmEvent *event) } /* using context, starts job */ -static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *event) { /* new render clears all callbacks */ Main *mainp; diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index ea18f2c8fbb..f47d737beca 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -638,7 +638,7 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op) } -static int screen_opengl_render_modal(bContext *C, wmOperator *op, wmEvent *event) +static int screen_opengl_render_modal(bContext *C, wmOperator *op, const wmEvent *event) { OGLRender *oglrender = op->customdata; int anim = RNA_boolean_get(op->ptr, "animation"); @@ -677,7 +677,7 @@ static int screen_opengl_render_modal(bContext *C, wmOperator *op, wmEvent *even return OPERATOR_RUNNING_MODAL; } -static int screen_opengl_render_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int screen_opengl_render_invoke(bContext *C, wmOperator *op, const wmEvent *event) { OGLRender *oglrender; int anim = RNA_boolean_get(op->ptr, "animation"); diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index e00db9b5850..c33b7442e41 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -705,7 +705,7 @@ static int envmap_save_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int envmap_save_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int envmap_save_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { //Scene *scene= CTX_data_scene(C); diff --git a/source/blender/editors/render/render_view.c b/source/blender/editors/render/render_view.c index 8b2ac740e47..186d0d20623 100644 --- a/source/blender/editors/render/render_view.c +++ b/source/blender/editors/render/render_view.c @@ -275,7 +275,7 @@ void RENDER_OT_view_cancel(struct wmOperatorType *ot) /************************* show render viewer *****************/ -static int render_view_show_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int render_view_show_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { wmWindow *wincur = CTX_wm_window(C); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index fcd0968d52f..1906a3259a9 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -644,7 +644,7 @@ static void actionzone_apply(bContext *C, wmOperator *op, int type) wm_event_add(win, &event); } -static int actionzone_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int actionzone_invoke(bContext *C, wmOperator *op, const wmEvent *event) { AZone *az = is_in_area_actionzone(CTX_wm_area(C), &event->x); sActionzoneData *sad; @@ -674,7 +674,7 @@ static int actionzone_invoke(bContext *C, wmOperator *op, wmEvent *event) } -static int actionzone_modal(bContext *C, wmOperator *op, wmEvent *event) +static int actionzone_modal(bContext *C, wmOperator *op, const wmEvent *event) { sActionzoneData *sad = op->customdata; int deltax, deltay; @@ -769,7 +769,7 @@ typedef struct sAreaSwapData { ScrArea *sa1, *sa2; } sAreaSwapData; -static int area_swap_init(wmOperator *op, wmEvent *event) +static int area_swap_init(wmOperator *op, const wmEvent *event) { sAreaSwapData *sd = NULL; sActionzoneData *sad = event->customdata; @@ -800,7 +800,7 @@ static int area_swap_cancel(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int area_swap_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int area_swap_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (!area_swap_init(op, event)) @@ -814,7 +814,7 @@ static int area_swap_invoke(bContext *C, wmOperator *op, wmEvent *event) } -static int area_swap_modal(bContext *C, wmOperator *op, wmEvent *event) +static int area_swap_modal(bContext *C, wmOperator *op, const wmEvent *event) { sActionzoneData *sad = op->customdata; @@ -866,7 +866,7 @@ static void SCREEN_OT_area_swap(wmOperatorType *ot) /* *********** Duplicate area as new window operator ****************** */ /* operator callback */ -static int area_dupli_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int area_dupli_invoke(bContext *C, wmOperator *op, const wmEvent *event) { wmWindow *newwin, *win; bScreen *newsc, *sc; @@ -1100,7 +1100,7 @@ static int area_move_exec(bContext *C, wmOperator *op) } /* interaction callback */ -static int area_move_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int area_move_invoke(bContext *C, wmOperator *op, const wmEvent *event) { RNA_int_set(op->ptr, "x", event->x); RNA_int_set(op->ptr, "y", event->y); @@ -1125,7 +1125,7 @@ static int area_move_cancel(bContext *C, wmOperator *op) } /* modal callback for while moving edges */ -static int area_move_modal(bContext *C, wmOperator *op, wmEvent *event) +static int area_move_modal(bContext *C, wmOperator *op, const wmEvent *event) { sAreaMoveData *md = op->customdata; int delta, x, y; @@ -1382,7 +1382,7 @@ static void area_split_exit(bContext *C, wmOperator *op) /* UI callback, adds new handler */ -static int area_split_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int area_split_invoke(bContext *C, wmOperator *op, const wmEvent *event) { sAreaSplitData *sd; int dir; @@ -1514,7 +1514,7 @@ static int area_split_cancel(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int area_split_modal(bContext *C, wmOperator *op, wmEvent *event) +static int area_split_modal(bContext *C, wmOperator *op, const wmEvent *event) { sAreaSplitData *sd = (sAreaSplitData *)op->customdata; float fac; @@ -1697,7 +1697,7 @@ static int area_max_regionsize(ScrArea *sa, ARegion *scalear, AZEdge edge) return dist; } -static int region_scale_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int region_scale_invoke(bContext *C, wmOperator *op, const wmEvent *event) { sActionzoneData *sad = event->customdata; AZone *az; @@ -1795,7 +1795,7 @@ static void region_scale_toggle_hidden(bContext *C, RegionMoveData *rmd) region_scale_validate_size(rmd); } -static int region_scale_modal(bContext *C, wmOperator *op, wmEvent *event) +static int region_scale_modal(bContext *C, wmOperator *op, const wmEvent *event) { RegionMoveData *rmd = op->customdata; int delta; @@ -2318,7 +2318,7 @@ static int area_join_exec(bContext *C, wmOperator *op) } /* interaction callback */ -static int area_join_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int area_join_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (event->type == EVT_ACTIONZONE_AREA) { @@ -2374,7 +2374,7 @@ static int area_join_cancel(bContext *C, wmOperator *op) } /* modal callback while selecting area (space) that will be removed */ -static int area_join_modal(bContext *C, wmOperator *op, wmEvent *event) +static int area_join_modal(bContext *C, wmOperator *op, const wmEvent *event) { bScreen *sc = CTX_wm_screen(C); sAreaJoinData *jd = (sAreaJoinData *)op->customdata; @@ -2490,7 +2490,7 @@ static void SCREEN_OT_area_join(wmOperatorType *ot) /* ******************************* */ -static int screen_area_options_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int screen_area_options_invoke(bContext *C, wmOperator *op, const wmEvent *event) { uiPopupMenu *pup; uiLayout *layout; @@ -2604,7 +2604,7 @@ static void SCREEN_OT_repeat_last(wmOperatorType *ot) } -static int repeat_history_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int repeat_history_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { wmWindowManager *wm = CTX_wm_manager(C); wmOperator *lastop; @@ -2661,7 +2661,7 @@ static void SCREEN_OT_repeat_history(wmOperatorType *ot) /* ********************** redo operator ***************************** */ -static int redo_last_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) +static int redo_last_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) { wmOperator *lastop = WM_operator_last_redo(C); @@ -2958,7 +2958,7 @@ void ED_screens_header_tools_menu_create(bContext *C, uiLayout *layout, void *UN } } -static int header_toolbox_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) +static int header_toolbox_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) { uiPopupMenu *pup; uiLayout *layout; @@ -3071,7 +3071,7 @@ static int match_region_with_redraws(int spacetype, int regiontype, int redraws) return 0; } -static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { bScreen *screen = CTX_wm_screen(C); @@ -3421,7 +3421,7 @@ static void SCREEN_OT_back_to_previous(struct wmOperatorType *ot) /* *********** show user pref window ****** */ -static int userpref_show_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int userpref_show_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { wmWindow *win = CTX_wm_window(C); rcti rect; @@ -3696,7 +3696,7 @@ void region_blend_start(bContext *C, ScrArea *sa, ARegion *ar) } /* timer runs in win->handlers, so it cannot use context to find area/region */ -static int region_blend_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int region_blend_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { RegionAlphaInfo *rgi; wmTimer *timer = event->customdata; @@ -3820,7 +3820,7 @@ static void keymap_modal_set(wmKeyConfig *keyconf) } -static int open_file_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) +static int open_file_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) { if (drag->type == WM_DRAG_PATH) { if (drag->icon == ICON_FILE_BLEND) diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index 9cde62e8302..0fbb4c25e78 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -204,7 +204,7 @@ static int screenshot_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int screenshot_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int screenshot_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (screenshot_data_create(C, op)) { if (RNA_struct_property_is_set(op->ptr, "filepath")) diff --git a/source/blender/editors/sculpt_paint/paint_hide.c b/source/blender/editors/sculpt_paint/paint_hide.c index d50261a3b98..14eb358f20f 100644 --- a/source/blender/editors/sculpt_paint/paint_hide.c +++ b/source/blender/editors/sculpt_paint/paint_hide.c @@ -424,7 +424,7 @@ static int hide_show_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int hide_show_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int hide_show_invoke(bContext *C, wmOperator *op, const wmEvent *event) { PartialVisArea area = RNA_enum_get(op->ptr, "area"); diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index f68848452d3..983cf085e7c 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -445,7 +445,7 @@ static void paint_redraw(const bContext *C, PaintOperation *pop, int final) } } -static PaintOperation * texture_paint_init(bContext *C, wmOperator *op, wmEvent *event) +static PaintOperation * texture_paint_init(bContext *C, wmOperator *op, const wmEvent *event) { Scene *scene = CTX_data_scene(C); ToolSettings *settings = scene->toolsettings; @@ -572,7 +572,7 @@ static int paint_stroke_test_start(bContext *UNUSED(C), wmOperator *UNUSED(op), } -static int paint_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int paint_invoke(bContext *C, wmOperator *op, const wmEvent *event) { PaintOperation *pop; struct PaintStroke *stroke; @@ -774,7 +774,7 @@ static int grab_clone_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int grab_clone_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int grab_clone_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Brush *brush = image_paint_brush(C); GrabClone *cmv; @@ -790,7 +790,7 @@ static int grab_clone_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int grab_clone_modal(bContext *C, wmOperator *op, wmEvent *event) +static int grab_clone_modal(bContext *C, wmOperator *op, const wmEvent *event) { Brush *brush = image_paint_brush(C); ARegion *ar = CTX_wm_region(C); @@ -865,7 +865,7 @@ static int sample_color_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sample_color_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int sample_color_invoke(bContext *C, wmOperator *op, const wmEvent *event) { RNA_int_set_array(op->ptr, "location", event->mval); sample_color_exec(C, op); @@ -875,7 +875,7 @@ static int sample_color_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int sample_color_modal(bContext *C, wmOperator *op, wmEvent *event) +static int sample_color_modal(bContext *C, wmOperator *op, const wmEvent *event) { switch (event->type) { case LEFTMOUSE: @@ -945,7 +945,7 @@ static int set_clone_cursor_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int set_clone_cursor_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int set_clone_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h index 5371f644bcb..b5b0ec162e2 100644 --- a/source/blender/editors/sculpt_paint/paint_intern.h +++ b/source/blender/editors/sculpt_paint/paint_intern.h @@ -70,7 +70,7 @@ bool paint_supports_moving_texture(struct Brush *br, enum PaintMode mode); bool paint_supports_jitter(enum PaintMode mode); struct wmKeyMap *paint_stroke_modal_keymap(struct wmKeyConfig *keyconf); -int paint_stroke_modal(struct bContext *C, struct wmOperator *op, struct wmEvent *event); +int paint_stroke_modal(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); int paint_stroke_exec(struct bContext *C, struct wmOperator *op); int paint_stroke_cancel(struct bContext *C, struct wmOperator *op); struct ViewContext *paint_stroke_view_context(struct PaintStroke *stroke); diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 61ec0257833..8c2949101bd 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -123,7 +123,7 @@ static void paint_draw_smooth_stroke(bContext *C, int x, int y, void *customdata /* if this is a tablet event, return tablet pressure and set *pen_flip * to 1 if the eraser tool is being used, 0 otherwise */ -static float event_tablet_data(wmEvent *event, int *pen_flip) +static float event_tablet_data(const wmEvent *event, int *pen_flip) { int erasor = 0; float pressure = 1; @@ -235,7 +235,7 @@ static void paint_brush_update(bContext *C, Brush *brush, PaintMode mode, #endif /* Put the location of the next stroke dot into the stroke RNA and apply it to the mesh */ -static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *event, const float mouse_in[2]) +static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const wmEvent *event, const float mouse_in[2]) { Scene *scene = CTX_data_scene(C); Paint *paint = paint_get_active_from_context(C); @@ -344,7 +344,7 @@ static int paint_smooth_stroke(PaintStroke *stroke, float output[2], /* For brushes with stroke spacing enabled, moves mouse in steps * towards the final mouse location. */ -static int paint_space_stroke(bContext *C, wmOperator *op, wmEvent *event, const float final_mouse[2]) +static int paint_space_stroke(bContext *C, wmOperator *op, const wmEvent *event, const float final_mouse[2]) { PaintStroke *stroke = op->customdata; PaintMode mode = paintmode_get_active_from_context(C); @@ -563,7 +563,7 @@ static void paint_stroke_sample_average(const PaintStroke *stroke, /*printf("avg=(%f, %f), num=%d\n", average->mouse[0], average->mouse[1], stroke->num_samples);*/ } -int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event) +int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event) { Paint *p = paint_get_active_from_context(C); PaintMode mode = paintmode_get_active_from_context(C); diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index 6fb2361022d..19c061996e7 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -414,7 +414,7 @@ void PAINT_OT_face_select_linked(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int paint_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int paint_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) { int mode = RNA_boolean_get(op->ptr, "extend") ? 1 : 0; paintface_select_linked(C, CTX_data_active_object(C), event->mval, mode); diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 777a9ff92ae..2705ea3b4f8 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1015,7 +1015,7 @@ static float wpaint_blend(VPaint *wp, float weight, float weight_prev, /* sets wp->weight to the closest weight value to vertex */ /* note: we cant sample frontbuf, weight colors are interpolated too unpredictable */ -static int weight_sample_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int weight_sample_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ViewContext vc; Mesh *me; @@ -2475,7 +2475,7 @@ static void wpaint_stroke_done(const bContext *C, struct PaintStroke *stroke) } -static int wpaint_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int wpaint_invoke(bContext *C, wmOperator *op, const wmEvent *event) { int retval; @@ -2950,7 +2950,7 @@ static void vpaint_stroke_done(const bContext *C, struct PaintStroke *stroke) MEM_freeN(vpd); } -static int vpaint_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int vpaint_invoke(bContext *C, wmOperator *op, const wmEvent *event) { int retval; @@ -3156,7 +3156,7 @@ static void gradientVert__mapFunc(void *userData, int index, const float co[3], } } -static int paint_weight_gradient_modal(bContext *C, wmOperator *op, wmEvent *event) +static int paint_weight_gradient_modal(bContext *C, wmOperator *op, const wmEvent *event) { int ret = WM_gesture_straightline_modal(C, op, event); @@ -3264,7 +3264,7 @@ static int paint_weight_gradient_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int paint_weight_gradient_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int paint_weight_gradient_invoke(bContext *C, wmOperator *op, const wmEvent *event) { int ret; diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index c8544e0495d..21e83918d38 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -4311,7 +4311,7 @@ static void sculpt_stroke_done(const bContext *C, struct PaintStroke *UNUSED(str sculpt_brush_exit_tex(sd); } -static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, const wmEvent *event) { struct PaintStroke *stroke; int ignore_background_click; @@ -4584,7 +4584,7 @@ static int sculpt_dynamic_topology_toggle_exec(bContext *C, wmOperator *UNUSED(o return OPERATOR_FINISHED; } -static int sculpt_dynamic_topology_toggle_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int sculpt_dynamic_topology_toggle_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Object *ob = CTX_data_active_object(C); Mesh *me = ob->data; diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c index b40933c50cb..7cdfb6d22b2 100644 --- a/source/blender/editors/sculpt_paint/sculpt_uv.c +++ b/source/blender/editors/sculpt_paint/sculpt_uv.c @@ -357,7 +357,7 @@ static void laplacian_relaxation_iteration_uv(BMEditMesh *em, UvSculptData *scul } -static void uv_sculpt_stroke_apply(bContext *C, wmOperator *op, wmEvent *event, Object *obedit) +static void uv_sculpt_stroke_apply(bContext *C, wmOperator *op, const wmEvent *event, Object *obedit) { float co[2], radius, radius_root; Scene *scene = CTX_data_scene(C); @@ -527,7 +527,7 @@ static int uv_edge_compare(const void *a, const void *b) } -static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent *event) +static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, const wmEvent *event) { Scene *scene = CTX_data_scene(C); Object *obedit = CTX_data_edit_object(C); @@ -794,7 +794,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, wmEvent return op->customdata; } -static int uv_sculpt_stroke_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int uv_sculpt_stroke_invoke(bContext *C, wmOperator *op, const wmEvent *event) { UvSculptData *data; Object *obedit = CTX_data_edit_object(C); @@ -817,7 +817,7 @@ static int uv_sculpt_stroke_invoke(bContext *C, wmOperator *op, wmEvent *event) } -static int uv_sculpt_stroke_modal(bContext *C, wmOperator *op, wmEvent *event) +static int uv_sculpt_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event) { UvSculptData *data = (UvSculptData *)op->customdata; Object *obedit = CTX_data_edit_object(C); diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index eb138bfeeef..d25fd00514c 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -160,7 +160,7 @@ static int sound_open_exec(bContext *UNUSED(C), wmOperator *op) #endif -static int sound_open_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int sound_open_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (RNA_struct_property_is_set(op->ptr, "filepath")) return sound_open_exec(C, op); @@ -439,7 +439,7 @@ static int sound_mixdown_check(bContext *UNUSED(C), wmOperator *op) #endif // WITH_AUDASPACE -static int sound_mixdown_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int sound_mixdown_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (RNA_struct_property_is_set(op->ptr, "filepath")) return sound_mixdown_exec(C, op); @@ -747,7 +747,7 @@ static int sound_unpack_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sound_unpack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int sound_unpack_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Editing *ed = CTX_data_scene(C)->ed; bSound *sound; diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 7e99e6c065d..803e7b71c77 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -742,7 +742,7 @@ static int actkeys_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -static int actkeys_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int actkeys_duplicate_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { actkeys_duplicate_exec(C, op); diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index 964a6a20c37..c814c0b4d8c 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -872,7 +872,7 @@ static int actkeys_select_leftright_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int actkeys_select_leftright_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int actkeys_select_leftright_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bAnimContext ac; short leftright = RNA_enum_get(op->ptr, "mode"); @@ -1223,7 +1223,7 @@ static void mouse_action_keys(bAnimContext *ac, const int mval[2], short select_ } /* handle clicking */ -static int actkeys_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int actkeys_clickselect_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bAnimContext ac; /* ARegion *ar; */ /* UNUSED */ diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index bd53a8e41c5..dcc61cfa544 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -62,7 +62,7 @@ /********************** toolbox operator *********************/ -static int toolbox_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) +static int toolbox_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) { bScreen *sc = CTX_wm_screen(C); SpaceButs *sbuts = CTX_wm_space_buts(C); @@ -165,7 +165,7 @@ static int file_browse_cancel(bContext *UNUSED(C), wmOperator *op) return OPERATOR_CANCELLED; } -static int file_browse_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int file_browse_invoke(bContext *C, wmOperator *op, const wmEvent *event) { PointerRNA ptr; PropertyRNA *prop; diff --git a/source/blender/editors/space_clip/clip_dopesheet_ops.c b/source/blender/editors/space_clip/clip_dopesheet_ops.c index d914cd2e04f..e5cd7247c43 100644 --- a/source/blender/editors/space_clip/clip_dopesheet_ops.c +++ b/source/blender/editors/space_clip/clip_dopesheet_ops.c @@ -127,7 +127,7 @@ static int dopesheet_select_channel_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int dopesheet_select_channel_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int dopesheet_select_channel_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); float location[2]; diff --git a/source/blender/editors/space_clip/clip_graph_ops.c b/source/blender/editors/space_clip/clip_graph_ops.c index fa235bd2997..edc6ac1ecf7 100644 --- a/source/blender/editors/space_clip/clip_graph_ops.c +++ b/source/blender/editors/space_clip/clip_graph_ops.c @@ -276,7 +276,7 @@ static int select_exec(bContext *C, wmOperator *op) return mouse_select(C, co, extend); } -static int select_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); float co[2]; diff --git a/source/blender/editors/space_clip/clip_intern.h b/source/blender/editors/space_clip/clip_intern.h index 9d5e2e97bd6..cd7da4229d2 100644 --- a/source/blender/editors/space_clip/clip_intern.h +++ b/source/blender/editors/space_clip/clip_intern.h @@ -134,7 +134,7 @@ void clip_draw_cfra(struct SpaceClip *sc, struct ARegion *ar, struct Scene *scen void clip_draw_sfra_efra(struct View2D *v2d, struct Scene *scene); /* tracking_ops.c */ -struct MovieTrackingTrack *tracking_marker_check_slide(struct bContext *C, struct wmEvent *event, +struct MovieTrackingTrack *tracking_marker_check_slide(struct bContext *C, const struct wmEvent *event, int *area_r, int *action_r, int *corner_r); void CLIP_OT_add_marker(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index 6d1cc335a26..b53cf027c78 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -113,7 +113,7 @@ static void sclip_zoom_set_factor(const bContext *C, float zoomfac, float locati sclip_zoom_set(C, sc->zoom * zoomfac, location); } -static void sclip_zoom_set_factor_exec(bContext *C, wmEvent *event, float factor) +static void sclip_zoom_set_factor_exec(bContext *C, const wmEvent *event, float factor) { ARegion *ar = CTX_wm_region(C); @@ -230,7 +230,7 @@ static int open_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int open_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { SpaceClip *sc = CTX_wm_space_clip(C); char path[FILE_MAX]; @@ -318,7 +318,7 @@ typedef struct ViewPanData { float *vec; } ViewPanData; -static void view_pan_init(bContext *C, wmOperator *op, wmEvent *event) +static void view_pan_init(bContext *C, wmOperator *op, const wmEvent *event) { SpaceClip *sc = CTX_wm_space_clip(C); ViewPanData *vpd; @@ -377,7 +377,7 @@ static int view_pan_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int view_pan_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int view_pan_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (event->type == MOUSEPAN) { SpaceClip *sc = CTX_wm_space_clip(C); @@ -399,7 +399,7 @@ static int view_pan_invoke(bContext *C, wmOperator *op, wmEvent *event) } } -static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event) +static int view_pan_modal(bContext *C, wmOperator *op, const wmEvent *event) { SpaceClip *sc = CTX_wm_space_clip(C); ViewPanData *vpd = op->customdata; @@ -471,7 +471,7 @@ typedef struct ViewZoomData { float location[2]; } ViewZoomData; -static void view_zoom_init(bContext *C, wmOperator *op, wmEvent *event) +static void view_zoom_init(bContext *C, wmOperator *op, const wmEvent *event) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *ar = CTX_wm_region(C); @@ -514,7 +514,7 @@ static int view_zoom_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int view_zoom_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int view_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (event->type == MOUSEZOOM || event->type == MOUSEPAN) { float delta, factor; @@ -538,7 +538,7 @@ static int view_zoom_invoke(bContext *C, wmOperator *op, wmEvent *event) } } -static int view_zoom_modal(bContext *C, wmOperator *op, wmEvent *event) +static int view_zoom_modal(bContext *C, wmOperator *op, const wmEvent *event) { ViewZoomData *vpd = op->customdata; float delta, factor; @@ -611,7 +611,7 @@ static int view_zoom_in_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int view_zoom_in_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int view_zoom_in_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *ar = CTX_wm_region(C); @@ -654,7 +654,7 @@ static int view_zoom_out_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int view_zoom_out_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int view_zoom_out_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *ar = CTX_wm_region(C); @@ -844,7 +844,7 @@ static int change_frame_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int frame_from_event(bContext *C, wmEvent *event) +static int frame_from_event(bContext *C, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); Scene *scene = CTX_data_scene(C); @@ -866,7 +866,7 @@ static int frame_from_event(bContext *C, wmEvent *event) return framenr; } -static int change_frame_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int change_frame_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); @@ -885,7 +885,7 @@ static int change_frame_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int change_frame_modal(bContext *C, wmOperator *op, wmEvent *event) +static int change_frame_modal(bContext *C, wmOperator *op, const wmEvent *event) { switch (event->type) { case ESCKEY: @@ -1134,7 +1134,7 @@ void CLIP_OT_mode_set(wmOperatorType *ot) * that explains the negative signs in the code below */ -static int clip_view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int clip_view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { if (event->type != NDOF_MOTION) return OPERATOR_CANCELLED; diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index cec220abf13..4f9757a6640 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -799,7 +799,7 @@ static int clip_context(const bContext *C, const char *member, bContextDataResul } /* dropboxes */ -static int clip_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) +static int clip_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) { if (drag->type == WM_DRAG_PATH) if (ELEM3(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_BLANK)) /* rule might not work? */ diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index ac7ebd9ddac..817d3807269 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -124,7 +124,7 @@ static int add_marker_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int add_marker_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int add_marker_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *ar = CTX_wm_region(C); @@ -282,7 +282,7 @@ static void slide_marker_tilt_slider(MovieTrackingMarker *marker, float slider[2 } static SlideMarkerData *create_slide_marker_data(SpaceClip *sc, MovieTrackingTrack *track, - MovieTrackingMarker *marker, wmEvent *event, + MovieTrackingMarker *marker, const wmEvent *event, int area, int corner, int action, int width, int height) { SlideMarkerData *data = MEM_callocN(sizeof(SlideMarkerData), "slide marker data"); @@ -524,7 +524,7 @@ static void show_cursor(bContext *C) WM_cursor_set(win, CURSOR_STD); } -MovieTrackingTrack *tracking_marker_check_slide(bContext *C, wmEvent *event, int *area_r, int *action_r, int *corner_r) +MovieTrackingTrack *tracking_marker_check_slide(bContext *C, const wmEvent *event, int *area_r, int *action_r, int *corner_r) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *ar = CTX_wm_region(C); @@ -623,7 +623,7 @@ MovieTrackingTrack *tracking_marker_check_slide(bContext *C, wmEvent *event, int return NULL; } -static void *slide_marker_customdata(bContext *C, wmEvent *event) +static void *slide_marker_customdata(bContext *C, const wmEvent *event) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *ar = CTX_wm_region(C); @@ -652,7 +652,7 @@ static void *slide_marker_customdata(bContext *C, wmEvent *event) return customdata; } -static int slide_marker_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int slide_marker_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SlideMarkerData *slidedata = slide_marker_customdata(C, event); @@ -703,7 +703,7 @@ static void free_slide_data(SlideMarkerData *data) MEM_freeN(data); } -static int slide_marker_modal(bContext *C, wmOperator *op, wmEvent *event) +static int slide_marker_modal(bContext *C, wmOperator *op, const wmEvent *event) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *ar = CTX_wm_region(C); @@ -1228,7 +1228,7 @@ static int track_markers_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int track_markers_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int track_markers_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { TrackMarkersJob *tmj; ScrArea *sa = CTX_wm_area(C); @@ -1286,7 +1286,7 @@ static int track_markers_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(eve return OPERATOR_RUNNING_MODAL; } -static int track_markers_modal(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int track_markers_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { /* no running tracking, remove handler and pass through */ if (0 == WM_jobs_test(CTX_wm_manager(C), CTX_wm_area(C), WM_JOB_TYPE_ANY)) @@ -1457,7 +1457,7 @@ static int solve_camera_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int solve_camera_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int solve_camera_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { SolveCameraJob *scj; ScrArea *sa = CTX_wm_area(C); @@ -1507,7 +1507,7 @@ static int solve_camera_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even return OPERATOR_RUNNING_MODAL; } -static int solve_camera_modal(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int solve_camera_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { /* no running solver, remove handler and pass through */ if (0 == WM_jobs_test(CTX_wm_manager(C), CTX_wm_area(C), WM_JOB_TYPE_ANY)) @@ -2334,7 +2334,7 @@ static int set_scale_exec(bContext *C, wmOperator *op) return do_set_scale(C, op, 0); } -static int set_scale_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int set_scale_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -2390,7 +2390,7 @@ static int set_solution_scale_exec(bContext *C, wmOperator *op) return do_set_scale(C, op, 1); } -static int set_solution_scale_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int set_solution_scale_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -3295,7 +3295,7 @@ static int clean_tracks_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int clean_tracks_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int clean_tracks_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); diff --git a/source/blender/editors/space_clip/tracking_select.c b/source/blender/editors/space_clip/tracking_select.c index d320d41dcd1..b03209173d8 100644 --- a/source/blender/editors/space_clip/tracking_select.c +++ b/source/blender/editors/space_clip/tracking_select.c @@ -290,7 +290,7 @@ static int select_exec(bContext *C, wmOperator *op) return mouse_select(C, co, extend); } -static int select_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *ar = CTX_wm_region(C); diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index 1242d123a41..b735dee5bdf 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -390,7 +390,7 @@ static int console_insert_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int console_insert_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int console_insert_invoke(bContext *C, wmOperator *op, const wmEvent *event) { // if (!RNA_struct_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */ if (!RNA_string_length(op->ptr, "text")) { @@ -1042,7 +1042,7 @@ static void console_cursor_set_to_pos(SpaceConsole *sc, ARegion *ar, SetConsoleC } } -static void console_modal_select_apply(bContext *C, wmOperator *op, wmEvent *event) +static void console_modal_select_apply(bContext *C, wmOperator *op, const wmEvent *event) { SpaceConsole *sc = CTX_wm_space_console(C); ARegion *ar = CTX_wm_region(C); @@ -1080,7 +1080,7 @@ static void console_cursor_set_exit(bContext *UNUSED(C), wmOperator *op) MEM_freeN(scu); } -static int console_modal_select_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int console_modal_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceConsole *sc = CTX_wm_space_console(C); // ARegion *ar = CTX_wm_region(C); @@ -1101,7 +1101,7 @@ static int console_modal_select_invoke(bContext *C, wmOperator *op, wmEvent *eve return OPERATOR_RUNNING_MODAL; } -static int console_modal_select(bContext *C, wmOperator *op, wmEvent *event) +static int console_modal_select(bContext *C, wmOperator *op, const wmEvent *event) { switch (event->type) { case LEFTMOUSE: diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c index eed269ff70f..4243ae4e2df 100644 --- a/source/blender/editors/space_console/space_console.c +++ b/source/blender/editors/space_console/space_console.c @@ -160,7 +160,7 @@ static void console_main_area_init(wmWindowManager *wm, ARegion *ar) /* ************* dropboxes ************* */ -static int id_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) +static int id_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) { // SpaceConsole *sc = CTX_wm_space_console(C); if (drag->type == WM_DRAG_ID) @@ -179,7 +179,7 @@ static void id_drop_copy(wmDrag *drag, wmDropBox *drop) MEM_freeN(text); } -static int path_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) +static int path_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) { // SpaceConsole *sc = CTX_wm_space_console(C); if (drag->type == WM_DRAG_PATH) diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 2f2ae78f60b..2cbafa2f3a9 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -228,7 +228,7 @@ static FileSelect file_select(bContext *C, const rcti *rect, FileSelType select, return retval; } -static int file_border_select_modal(bContext *C, wmOperator *op, wmEvent *event) +static int file_border_select_modal(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -311,7 +311,7 @@ void FILE_OT_select_border(wmOperatorType *ot) WM_operator_properties_gesture_border(ot, 1); } -static int file_select_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int file_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -585,7 +585,7 @@ int file_highlight_set(SpaceFile *sfile, ARegion *ar, int mx, int my) return (params->active_file != origfile); } -static int file_highlight_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int file_highlight_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { ARegion *ar = CTX_wm_region(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -950,7 +950,7 @@ int file_next_exec(bContext *C, wmOperator *UNUSED(unused)) /* only meant for timer usage */ -static int file_smoothscroll_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int file_smoothscroll_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { ScrArea *sa = CTX_wm_area(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -1190,7 +1190,7 @@ static void file_expand_directory(bContext *C) } } -static int file_directory_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int file_directory_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { SpaceFile *sfile = CTX_wm_space_file(C); diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index e4d1ec73d67..a51fef6c692 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -609,7 +609,7 @@ static int graphkeys_click_insert_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int graphkeys_click_insert_invoke(bContext *C, wmOperator *op, wmEvent *evt) +static int graphkeys_click_insert_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bAnimContext ac; ARegion *ar; @@ -625,8 +625,8 @@ static int graphkeys_click_insert_invoke(bContext *C, wmOperator *op, wmEvent *e ar = ac.ar; v2d = &ar->v2d; - mval[0] = (evt->x - ar->winrct.xmin); - mval[1] = (evt->y - ar->winrct.ymin); + mval[0] = (event->x - ar->winrct.xmin); + mval[1] = (event->y - ar->winrct.ymin); UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y); @@ -835,7 +835,7 @@ static int graphkeys_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -static int graphkeys_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int graphkeys_duplicate_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { graphkeys_duplicate_exec(C, op); @@ -1190,7 +1190,7 @@ static int graphkeys_sound_bake_exec(bContext *UNUSED(C), wmOperator *op) #endif //WITH_AUDASPACE -static int graphkeys_sound_bake_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int graphkeys_sound_bake_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bAnimContext ac; @@ -2132,7 +2132,7 @@ void GRAPH_OT_smooth(wmOperatorType *ot) /* ******************** Add F-Modifier Operator *********************** */ /* present a special customised popup menu for this, with some filtering */ -static int graph_fmodifier_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int graph_fmodifier_add_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { wmOperatorType *ot = WM_operatortype_find("GRAPH_OT_fmodifier_add", 1); uiPopupMenu *pup; diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index 54b417e740a..acb9e42d91b 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -109,7 +109,7 @@ static int graphview_cursor_exec(bContext *C, wmOperator *op) /* ... */ /* set the operator properties from the initial event */ -static void graphview_cursor_setprops(bContext *C, wmOperator *op, wmEvent *event) +static void graphview_cursor_setprops(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); float viewx, viewy; @@ -128,7 +128,7 @@ static void graphview_cursor_setprops(bContext *C, wmOperator *op, wmEvent *even } /* Modal Operator init */ -static int graphview_cursor_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int graphview_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event) { /* Change to frame that mouse is over before adding modal handler, * as user could click on a single frame (jump to frame) as well as @@ -145,7 +145,7 @@ static int graphview_cursor_invoke(bContext *C, wmOperator *op, wmEvent *event) } /* Modal event handling of cursor changing */ -static int graphview_cursor_modal(bContext *C, wmOperator *op, wmEvent *event) +static int graphview_cursor_modal(bContext *C, wmOperator *op, const wmEvent *event) { /* execute the events */ switch (event->type) { diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 978b3224850..6f4820caaed 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -815,7 +815,7 @@ static int graphkeys_select_leftright_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int graphkeys_select_leftright_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int graphkeys_select_leftright_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bAnimContext ac; short leftright = RNA_enum_get(op->ptr, "mode"); @@ -1297,7 +1297,7 @@ static void graphkeys_mselect_column(bAnimContext *ac, const int mval[2], short /* ------------------- */ /* handle clicking */ -static int graphkeys_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int graphkeys_clickselect_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bAnimContext ac; short selectmode; diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 46acd2519c2..54230d35312 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -238,7 +238,7 @@ typedef struct ViewPanData { int event_type; } ViewPanData; -static void image_view_pan_init(bContext *C, wmOperator *op, wmEvent *event) +static void image_view_pan_init(bContext *C, wmOperator *op, const wmEvent *event) { SpaceImage *sima = CTX_wm_space_image(C); ViewPanData *vpd; @@ -293,7 +293,7 @@ static int image_view_pan_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int image_view_pan_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int image_view_pan_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (event->type == MOUSEPAN) { SpaceImage *sima = CTX_wm_space_image(C); @@ -312,7 +312,7 @@ static int image_view_pan_invoke(bContext *C, wmOperator *op, wmEvent *event) } } -static int image_view_pan_modal(bContext *C, wmOperator *op, wmEvent *event) +static int image_view_pan_modal(bContext *C, wmOperator *op, const wmEvent *event) { SpaceImage *sima = CTX_wm_space_image(C); ViewPanData *vpd = op->customdata; @@ -383,7 +383,7 @@ typedef struct ViewZoomData { ARegion *ar; } ViewZoomData; -static void image_view_zoom_init(bContext *C, wmOperator *op, wmEvent *event) +static void image_view_zoom_init(bContext *C, wmOperator *op, const wmEvent *event) { SpaceImage *sima = CTX_wm_space_image(C); ARegion *ar = CTX_wm_region(C); @@ -455,7 +455,7 @@ enum { VIEW_CONFIRM }; -static int image_view_zoom_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int image_view_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (event->type == MOUSEZOOM || event->type == MOUSEPAN) { SpaceImage *sima = CTX_wm_space_image(C); @@ -525,7 +525,7 @@ static void image_zoom_apply(ViewZoomData *vpd, wmOperator *op, const int x, con ED_region_tag_redraw(vpd->ar); } -static int image_view_zoom_modal(bContext *C, wmOperator *op, wmEvent *event) +static int image_view_zoom_modal(bContext *C, wmOperator *op, const wmEvent *event) { ViewZoomData *vpd = op->customdata; short event_code = VIEW_PASS; @@ -589,7 +589,7 @@ void IMAGE_OT_view_zoom(wmOperatorType *ot) * that explains the negative signs in the code below */ -static int image_view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int image_view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { if (event->type != NDOF_MOTION) return OPERATOR_CANCELLED; @@ -773,7 +773,7 @@ static int image_view_zoom_in_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int image_view_zoom_in_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int image_view_zoom_in_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); float location[2]; @@ -815,7 +815,7 @@ static int image_view_zoom_out_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int image_view_zoom_out_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int image_view_zoom_out_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); float location[2]; @@ -978,7 +978,7 @@ static int image_open_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int image_open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int image_open_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { SpaceImage *sima = CTX_wm_space_image(C); /* XXX other space types can call */ char *path = U.textudir; @@ -1128,7 +1128,7 @@ static int image_replace_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int image_replace_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int image_replace_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { SpaceImage *sima = CTX_wm_space_image(C); @@ -1442,7 +1442,7 @@ static int image_save_as_check(bContext *UNUSED(C), wmOperator *op) return WM_operator_filesel_ensure_ext_imtype(op, imf); } -static int image_save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int image_save_as_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { SpaceImage *sima = CTX_wm_space_image(C); Image *ima = ED_space_image(sima); @@ -1773,7 +1773,7 @@ static int image_new_exec(bContext *C, wmOperator *op) /* XXX, Ton is not a fan of OK buttons but using this function to avoid undo/redo bug while in mesh-editmode, - campbell */ /* XXX Note: the WM_operator_props_dialog_popup() doesn't work for uiIDContextProperty(), image is not being that way */ -static int image_new_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int image_new_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { return WM_operator_props_dialog_popup(C, op, 15 * UI_UNIT_X, 5 * UI_UNIT_Y); @@ -1943,7 +1943,7 @@ static int image_pack_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int image_pack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int image_pack_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Image *ima = CTX_data_edit_image(C); ImBuf *ibuf; @@ -2027,7 +2027,7 @@ static int image_unpack_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int image_unpack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int image_unpack_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Image *ima = CTX_data_edit_image(C); @@ -2143,7 +2143,7 @@ int ED_space_image_color_sample(SpaceImage *sima, ARegion *ar, int mval[2], floa return ret; } -static void image_sample_apply(bContext *C, wmOperator *op, wmEvent *event) +static void image_sample_apply(bContext *C, wmOperator *op, const wmEvent *event) { SpaceImage *sima = CTX_wm_space_image(C); ARegion *ar = CTX_wm_region(C); @@ -2269,7 +2269,7 @@ static void image_sample_exit(bContext *C, wmOperator *op) MEM_freeN(info); } -static int image_sample_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int image_sample_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceImage *sima = CTX_wm_space_image(C); ARegion *ar = CTX_wm_region(C); @@ -2290,7 +2290,7 @@ static int image_sample_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int image_sample_modal(bContext *C, wmOperator *op, wmEvent *event) +static int image_sample_modal(bContext *C, wmOperator *op, const wmEvent *event) { switch (event->type) { case LEFTMOUSE: @@ -2376,7 +2376,7 @@ static int image_sample_line_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int image_sample_line_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int image_sample_line_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceImage *sima = CTX_wm_space_image(C); @@ -2531,7 +2531,7 @@ static int image_record_composite_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int image_record_composite_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int image_record_composite_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { RecordCompositeData *rcd; @@ -2548,7 +2548,7 @@ static int image_record_composite_invoke(bContext *C, wmOperator *op, wmEvent *U return OPERATOR_RUNNING_MODAL; } -static int image_record_composite_modal(bContext *C, wmOperator *op, wmEvent *event) +static int image_record_composite_modal(bContext *C, wmOperator *op, const wmEvent *event) { RecordCompositeData *rcd = op->customdata; diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index d82a46e9578..761becdbf8e 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -337,7 +337,7 @@ static void image_keymap(struct wmKeyConfig *keyconf) } /* dropboxes */ -static int image_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) +static int image_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) { if (drag->type == WM_DRAG_PATH) if (ELEM3(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_BLANK)) /* rule might not work? */ diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c index 04f6a5152e6..c68473820e3 100644 --- a/source/blender/editors/space_info/info_ops.c +++ b/source/blender/editors/space_info/info_ops.c @@ -104,7 +104,7 @@ static int unpack_libraries_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int unpack_libraries_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int unpack_libraries_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { return WM_operator_confirm_message(C, op, "Unpack Blender Libraries - creates directories, all new paths should work"); } @@ -137,7 +137,7 @@ static int pack_all_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int pack_all_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int pack_all_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Main *bmain = CTX_data_main(C); Image *ima; @@ -203,7 +203,7 @@ static int unpack_all_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int unpack_all_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int unpack_all_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Main *bmain = CTX_data_main(C); uiPopupMenu *pup; @@ -288,7 +288,7 @@ static int unpack_item_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int unpack_item_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int unpack_item_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { uiPopupMenu *pup; uiLayout *layout; @@ -429,7 +429,7 @@ static int find_missing_files_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int find_missing_files_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int find_missing_files_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { /* XXX file open button text "Find Missing Files" */ WM_event_add_fileselect(C, op); @@ -469,7 +469,7 @@ void FILE_OT_find_missing_files(wmOperatorType *ot) #define ERROR_TIMEOUT 10.0f #define ERROR_COLOR_TIMEOUT 6.0f #define COLLAPSE_TIMEOUT 0.25f -static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { wmWindowManager *wm = CTX_wm_manager(C); ReportList *reports = CTX_wm_reports(C); diff --git a/source/blender/editors/space_info/info_report.c b/source/blender/editors/space_info/info_report.c index 3050563e538..b096b8f3e2b 100644 --- a/source/blender/editors/space_info/info_report.c +++ b/source/blender/editors/space_info/info_report.c @@ -127,7 +127,7 @@ static int select_report_pick_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int select_report_pick_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int select_report_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceInfo *sinfo = CTX_wm_space_info(C); ARegion *ar = CTX_wm_region(C); diff --git a/source/blender/editors/space_logic/logic_ops.c b/source/blender/editors/space_logic/logic_ops.c index 2313885dbaf..51be5262a57 100644 --- a/source/blender/editors/space_logic/logic_ops.c +++ b/source/blender/editors/space_logic/logic_ops.c @@ -250,7 +250,7 @@ static int sensor_remove_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sensor_remove_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int sensor_remove_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_sensor_invoke_properties(C, op)) return sensor_remove_exec(C, op); @@ -355,7 +355,7 @@ static int controller_remove_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int controller_remove_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int controller_remove_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_controller_invoke_properties(C, op)) return controller_remove_exec(C, op); @@ -473,7 +473,7 @@ static int actuator_remove_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int actuator_remove_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int actuator_remove_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_actuator_invoke_properties(C, op)) return actuator_remove_exec(C, op); @@ -583,7 +583,7 @@ static int sensor_move_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sensor_move_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int sensor_move_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_sensor_invoke_properties(C, op)) { return sensor_move_exec(C, op); @@ -628,7 +628,7 @@ static int controller_move_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int controller_move_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int controller_move_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_controller_invoke_properties(C, op)) { return controller_move_exec(C, op); @@ -673,7 +673,7 @@ static int actuator_move_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int actuator_move_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int actuator_move_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (edit_actuator_invoke_properties(C, op)) { return actuator_move_exec(C, op); @@ -711,7 +711,7 @@ static int texface_convert_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -static int texface_convert_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int texface_convert_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { return texface_convert_exec(C, op); } diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index 95e75d0e4fc..bfe2a3484b8 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -298,7 +298,7 @@ static int mouse_nla_channels(bAnimContext *ac, float x, int channel_index, shor /* ------------------- */ /* handle clicking */ -static int nlachannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int nlachannels_mouseclick_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bAnimContext ac; SpaceNla *snla; diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index c95f46d0e7c..16bc1c00f55 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -891,7 +891,7 @@ static int nlaedit_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_CANCELLED; } -static int nlaedit_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int nlaedit_duplicate_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { nlaedit_duplicate_exec(C, op); @@ -1947,7 +1947,7 @@ void NLA_OT_snap(wmOperatorType *ot) /* ******************** Add F-Modifier Operator *********************** */ /* present a special customised popup menu for this, with some filtering */ -static int nla_fmodifier_add_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) +static int nla_fmodifier_add_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) { uiPopupMenu *pup; uiLayout *layout; diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index 97553b7aa56..3d436bb565b 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -451,7 +451,7 @@ static int nlaedit_select_leftright_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int nlaedit_select_leftright_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int nlaedit_select_leftright_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bAnimContext ac; short leftright = RNA_enum_get(op->ptr, "mode"); @@ -613,7 +613,7 @@ static void mouse_nla_strips(bContext *C, bAnimContext *ac, const int mval[2], s /* ------------------- */ /* handle clicking */ -static int nlaedit_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int nlaedit_clickselect_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bAnimContext ac; /* Scene *scene; */ /* UNUSED */ diff --git a/source/blender/editors/space_node/node_add.c b/source/blender/editors/space_node/node_add.c index 4943bb45113..235d91ecd92 100644 --- a/source/blender/editors/space_node/node_add.c +++ b/source/blender/editors/space_node/node_add.c @@ -400,7 +400,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int node_add_file_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int node_add_file_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); SpaceNode *snode = CTX_wm_space_node(C); diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 2b4ce1d8154..941bd783c39 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -837,7 +837,7 @@ typedef struct NodeSizeWidget { int directions; } NodeSizeWidget; -static void node_resize_init(bContext *C, wmOperator *op, wmEvent *UNUSED(event), bNode *node, int dir) +static void node_resize_init(bContext *C, wmOperator *op, const wmEvent *UNUSED(event), bNode *node, int dir) { SpaceNode *snode = CTX_wm_space_node(C); @@ -870,7 +870,7 @@ static void node_resize_exit(bContext *C, wmOperator *op, int UNUSED(cancel)) op->customdata = NULL; } -static int node_resize_modal(bContext *C, wmOperator *op, wmEvent *event) +static int node_resize_modal(bContext *C, wmOperator *op, const wmEvent *event) { SpaceNode *snode = CTX_wm_space_node(C); ARegion *ar = CTX_wm_region(C); @@ -973,7 +973,7 @@ static int node_resize_modal(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int node_resize_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int node_resize_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceNode *snode = CTX_wm_space_node(C); ARegion *ar = CTX_wm_region(C); @@ -2140,7 +2140,7 @@ static int node_clipboard_paste_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int node_clipboard_paste_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int node_clipboard_paste_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); SpaceNode *snode = CTX_wm_space_node(C); diff --git a/source/blender/editors/space_node/node_group.c b/source/blender/editors/space_node/node_group.c index 7b7b98f132c..6696284b169 100644 --- a/source/blender/editors/space_node/node_group.c +++ b/source/blender/editors/space_node/node_group.c @@ -133,7 +133,7 @@ static int node_group_edit_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -static int node_group_edit_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int node_group_edit_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { SpaceNode *snode = CTX_wm_space_node(C); bNode *gnode; @@ -789,7 +789,7 @@ static int node_group_separate_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int node_group_separate_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) +static int node_group_separate_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) { uiPopupMenu *pup = uiPupMenuBegin(C, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Separate"), ICON_NONE); uiLayout *layout = uiPupMenuLayout(pup); @@ -1146,7 +1146,7 @@ static int node_group_make_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int node_group_make_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) +static int node_group_make_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) { SpaceNode *snode = CTX_wm_space_node(C); bNode *act = nodeGetActive(snode->edittree); diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c index fd934ddfbdb..097e4f418e0 100644 --- a/source/blender/editors/space_node/node_relationships.c +++ b/source/blender/editors/space_node/node_relationships.c @@ -448,7 +448,7 @@ static int outside_group_rect(SpaceNode *snode) /* loop that adds a nodelink, called by function below */ /* in_out = starting socket */ -static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event) +static int node_link_modal(bContext *C, wmOperator *op, const wmEvent *event) { SpaceNode *snode = CTX_wm_space_node(C); ARegion *ar = CTX_wm_region(C); @@ -702,7 +702,7 @@ static bNodeLinkDrag *node_link_init(SpaceNode *snode, int detach) return nldrag; } -static int node_link_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int node_link_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceNode *snode = CTX_wm_space_node(C); ARegion *ar = CTX_wm_region(C); @@ -1183,7 +1183,7 @@ static int node_attach_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -static int node_attach_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int node_attach_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); SpaceNode *snode = CTX_wm_space_node(C); diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c index 7d2b80d50ba..c917b8ee756 100644 --- a/source/blender/editors/space_node/node_select.c +++ b/source/blender/editors/space_node/node_select.c @@ -429,7 +429,7 @@ static int node_select_exec(bContext *C, wmOperator *op) } } -static int node_select_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int node_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { RNA_int_set(op->ptr, "mouse_x", event->mval[0]); RNA_int_set(op->ptr, "mouse_y", event->mval[1]); @@ -494,7 +494,7 @@ static int node_borderselect_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int node_border_select_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int node_border_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { int tweak = RNA_boolean_get(op->ptr, "tweak"); diff --git a/source/blender/editors/space_node/node_view.c b/source/blender/editors/space_node/node_view.c index a69e73c1489..a8e84e0a0e5 100644 --- a/source/blender/editors/space_node/node_view.c +++ b/source/blender/editors/space_node/node_view.c @@ -196,7 +196,7 @@ typedef struct NodeViewMove { int xmin, ymin, xmax, ymax; } NodeViewMove; -static int snode_bg_viewmove_modal(bContext *C, wmOperator *op, wmEvent *event) +static int snode_bg_viewmove_modal(bContext *C, wmOperator *op, const wmEvent *event) { SpaceNode *snode = CTX_wm_space_node(C); ARegion *ar = CTX_wm_region(C); @@ -231,7 +231,7 @@ static int snode_bg_viewmove_modal(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int snode_bg_viewmove_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int snode_bg_viewmove_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceNode *snode = CTX_wm_space_node(C); ARegion *ar = CTX_wm_region(C); @@ -413,7 +413,7 @@ int ED_space_node_color_sample(SpaceNode *snode, ARegion *ar, int mval[2], float return ret; } -static void sample_apply(bContext *C, wmOperator *op, wmEvent *event) +static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event) { SpaceNode *snode = CTX_wm_space_node(C); ARegion *ar = CTX_wm_region(C); @@ -513,7 +513,7 @@ static void sample_exit(bContext *C, wmOperator *op) MEM_freeN(info); } -static int sample_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int sample_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceNode *snode = CTX_wm_space_node(C); ARegion *ar = CTX_wm_region(C); @@ -534,7 +534,7 @@ static int sample_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int sample_modal(bContext *C, wmOperator *op, wmEvent *event) +static int sample_modal(bContext *C, wmOperator *op, const wmEvent *event) { switch (event->type) { case LEFTMOUSE: diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 264bea5f871..75f28baf558 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -423,7 +423,7 @@ static void node_main_area_draw(const bContext *C, ARegion *ar) /* ************* dropboxes ************* */ -static int node_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) +static int node_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) { if (drag->type == WM_DRAG_ID) { ID *id = (ID *)drag->poin; diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 7c16c8620de..1e67e099508 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -146,7 +146,7 @@ static int do_outliner_item_openclose(bContext *C, SpaceOops *soops, TreeElement } /* event can enterkey, then it opens/closes */ -static int outliner_item_openclose(bContext *C, wmOperator *op, wmEvent *event) +static int outliner_item_openclose(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); SpaceOops *soops = CTX_wm_space_outliner(C); @@ -236,7 +236,7 @@ static int do_outliner_item_rename(bContext *C, ARegion *ar, SpaceOops *soops, T return 0; } -static int outliner_item_rename(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int outliner_item_rename(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { ARegion *ar = CTX_wm_region(C); SpaceOops *soops = CTX_wm_space_outliner(C); @@ -1448,7 +1448,7 @@ static int parent_drop_exec(bContext *C, wmOperator *op) } /* Used for drag and drop parenting */ -TreeElement *outliner_dropzone_parent(bContext *C, wmEvent *event, TreeElement *te, float *fmval) +TreeElement *outliner_dropzone_parent(bContext *C, const wmEvent *event, TreeElement *te, const float fmval[2]) { SpaceOops *soops = CTX_wm_space_outliner(C); TreeStoreElem *tselem = TREESTORE(te); @@ -1477,7 +1477,7 @@ TreeElement *outliner_dropzone_parent(bContext *C, wmEvent *event, TreeElement * return NULL; } -static int parent_drop_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int parent_drop_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Object *par = NULL; Object *ob = NULL; @@ -1651,7 +1651,7 @@ void OUTLINER_OT_parent_drop(wmOperatorType *ot) RNA_def_enum(ot->srna, "type", prop_make_parent_types, 0, "Type", ""); } -int outliner_dropzone_parent_clear(bContext *C, wmEvent *event, TreeElement *te, float *fmval) +int outliner_dropzone_parent_clear(bContext *C, const wmEvent *event, TreeElement *te, const float fmval[2]) { SpaceOops *soops = CTX_wm_space_outliner(C); TreeStoreElem *tselem = TREESTORE(te); @@ -1689,7 +1689,7 @@ int outliner_dropzone_parent_clear(bContext *C, wmEvent *event, TreeElement *te, return 0; } -static int parent_clear_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int parent_clear_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Main *bmain = CTX_data_main(C); Scene *scene = NULL; @@ -1738,7 +1738,7 @@ void OUTLINER_OT_parent_clear(wmOperatorType *ot) RNA_def_enum(ot->srna, "type", prop_clear_parent_types, 0, "Type", ""); } -TreeElement *outliner_dropzone_scene(bContext *C, wmEvent *UNUSED(event), TreeElement *te, float *fmval) +TreeElement *outliner_dropzone_scene(bContext *C, const wmEvent *UNUSED(event), TreeElement *te, const float fmval[2]) { SpaceOops *soops = CTX_wm_space_outliner(C); TreeStoreElem *tselem = TREESTORE(te); @@ -1754,7 +1754,7 @@ TreeElement *outliner_dropzone_scene(bContext *C, wmEvent *UNUSED(event), TreeEl return NULL; } -static int scene_drop_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int scene_drop_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Scene *scene = NULL; Object *ob = NULL; @@ -1830,7 +1830,7 @@ void OUTLINER_OT_scene_drop(wmOperatorType *ot) RNA_def_string(ot->srna, "scene", "Scene", MAX_ID_NAME, "Scene", "Target Scene"); } -static int material_drop_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int material_drop_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Material *ma = NULL; Object *ob = NULL; diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index 2ca0f1382ef..a918357ced2 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -190,9 +190,9 @@ void group_toggle_renderability_cb(struct bContext *C, struct Scene *scene, Tree void item_rename_cb(struct bContext *C, struct Scene *scene, TreeElement *te, struct TreeStoreElem *tsep, struct TreeStoreElem *tselem); -TreeElement *outliner_dropzone_parent(struct bContext *C, struct wmEvent *event, struct TreeElement *te, float *fmval); -int outliner_dropzone_parent_clear(struct bContext *C, struct wmEvent *event, struct TreeElement *te, float *fmval); -TreeElement *outliner_dropzone_scene(struct bContext *C, struct wmEvent *event, struct TreeElement *te, float *fmval); +TreeElement *outliner_dropzone_parent(struct bContext *C, const struct wmEvent *event, struct TreeElement *te, const float fmval[2]); +int outliner_dropzone_parent_clear(struct bContext *C, const struct wmEvent *event, struct TreeElement *te, const float fmval[2]); +TreeElement *outliner_dropzone_scene(struct bContext *C, const struct wmEvent *event, struct TreeElement *te, const float fmval[2]); /* ...................................................... */ void OUTLINER_OT_item_activate(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 21bd9bd298e..29c5b97a7f7 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -932,7 +932,7 @@ int outliner_item_do_activate(bContext *C, int x, int y, bool extend, bool recur } /* event can enterkey, then it opens/closes */ -static int outliner_item_activate(bContext *C, wmOperator *op, wmEvent *event) +static int outliner_item_activate(bContext *C, wmOperator *op, const wmEvent *event) { bool extend = RNA_boolean_get(op->ptr, "extend"); bool recursive = RNA_boolean_get(op->ptr, "recursive"); diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index c681597666d..258f0338d1e 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -1266,7 +1266,7 @@ void OUTLINER_OT_data_operation(wmOperatorType *ot) static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, SpaceOops *soops, - TreeElement *te, wmEvent *event, const float mval[2]) + TreeElement *te, const wmEvent *event, const float mval[2]) { ReportList *reports = CTX_wm_reports(C); // XXX... @@ -1336,7 +1336,7 @@ static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, S } -static int outliner_operation(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int outliner_operation(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { Scene *scene = CTX_data_scene(C); ARegion *ar = CTX_wm_region(C); diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index be404e48898..3849aaf78c1 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -90,7 +90,7 @@ static void outliner_main_area_init(wmWindowManager *wm, ARegion *ar) WM_event_add_dropbox_handler(&ar->handlers, lb); } -static int outliner_parent_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int outliner_parent_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); SpaceOops *soops = CTX_wm_space_outliner(C); @@ -135,7 +135,7 @@ static void outliner_parent_drop_copy(wmDrag *drag, wmDropBox *drop) RNA_string_set(drop->ptr, "child", id->name + 2); } -static int outliner_parent_clear_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int outliner_parent_clear_poll(bContext *C, wmDrag *drag, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); SpaceOops *soops = CTX_wm_space_outliner(C); @@ -176,7 +176,7 @@ static void outliner_parent_clear_copy(wmDrag *drag, wmDropBox *drop) RNA_enum_set(drop->ptr, "type", 0); } -static int outliner_scene_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int outliner_scene_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); SpaceOops *soops = CTX_wm_space_outliner(C); @@ -205,7 +205,7 @@ static void outliner_scene_drop_copy(wmDrag *drag, wmDropBox *drop) RNA_string_set(drop->ptr, "object", id->name + 2); } -static int outliner_material_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int outliner_material_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); SpaceOops *soops = CTX_wm_space_outliner(C); diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 78a76532487..571779a7524 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -294,7 +294,7 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op) } -static int sequencer_add_scene_strip_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int sequencer_add_scene_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (!ED_operator_sequencer_active(C)) { BKE_report(op->reports, RPT_ERROR, "Sequencer area not active"); @@ -392,7 +392,7 @@ static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sequencer_add_movieclip_strip_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int sequencer_add_movieclip_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (!ED_operator_sequencer_active(C)) { BKE_report(op->reports, RPT_ERROR, "Sequencer area not active"); @@ -489,7 +489,7 @@ static int sequencer_add_mask_strip_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sequencer_add_mask_strip_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int sequencer_add_mask_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (!ED_operator_sequencer_active(C)) { BKE_report(op->reports, RPT_ERROR, "Sequencer area not active"); @@ -602,7 +602,7 @@ static int sequencer_add_movie_strip_exec(bContext *C, wmOperator *op) } -static int sequencer_add_movie_strip_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int sequencer_add_movie_strip_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (!ED_operator_sequencer_active(C)) { @@ -657,7 +657,7 @@ static int sequencer_add_sound_strip_exec(bContext *C, wmOperator *op) return sequencer_add_generic_strip_exec(C, op, BKE_sequencer_add_sound_strip); } -static int sequencer_add_sound_strip_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int sequencer_add_sound_strip_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (!ED_operator_sequencer_active(C)) { @@ -769,7 +769,7 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sequencer_add_image_strip_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int sequencer_add_image_strip_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (!ED_operator_sequencer_active(C)) { @@ -921,7 +921,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) /* add color */ -static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { short is_type_set = RNA_struct_property_is_set(op->ptr, "type"); int type = -1; diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index e6d053ceb37..f0ed8d4107d 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -1121,7 +1121,7 @@ static int sequencer_snap_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sequencer_snap_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int sequencer_snap_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Scene *scene = CTX_data_scene(C); @@ -1546,7 +1546,7 @@ static int sequencer_cut_exec(bContext *C, wmOperator *op) } -static int sequencer_cut_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int sequencer_cut_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Scene *scene = CTX_data_scene(C); View2D *v2d = UI_view2d_fromcontext(C); @@ -1695,7 +1695,7 @@ static int sequencer_delete_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -static int sequencer_delete_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int sequencer_delete_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); @@ -3105,7 +3105,7 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sequencer_change_path_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int sequencer_change_path_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Scene *scene = CTX_data_scene(C); Sequence *seq = BKE_sequencer_active_get(scene); diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index 60032b0d333..3269e772be6 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -315,7 +315,7 @@ void SEQUENCER_OT_select_inverse(struct wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { View2D *v2d = UI_view2d_fromcontext(C); Scene *scene = CTX_data_scene(C); @@ -668,7 +668,7 @@ void SEQUENCER_OT_select_less(wmOperatorType *ot) /* select pick linked operator (uses the mouse) */ -static int sequencer_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int sequencer_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Scene *scene = CTX_data_scene(C); View2D *v2d = UI_view2d_fromcontext(C); diff --git a/source/blender/editors/space_sequencer/sequencer_view.c b/source/blender/editors/space_sequencer/sequencer_view.c index 92b17393114..7dcd3a70870 100644 --- a/source/blender/editors/space_sequencer/sequencer_view.c +++ b/source/blender/editors/space_sequencer/sequencer_view.c @@ -85,7 +85,7 @@ static void sample_draw(const bContext *C, ARegion *ar, void *arg_info) } } -static void sample_apply(bContext *C, wmOperator *op, wmEvent *event) +static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -168,7 +168,7 @@ static void sample_exit(bContext *C, wmOperator *op) MEM_freeN(info); } -static int sample_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int sample_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); SpaceSeq *sseq = CTX_wm_space_seq(C); @@ -189,7 +189,7 @@ static int sample_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int sample_modal(bContext *C, wmOperator *op, wmEvent *event) +static int sample_modal(bContext *C, wmOperator *op, const wmEvent *event) { switch (event->type) { case LEFTMOUSE: diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index 4c6b909882c..ffe89407715 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -373,7 +373,7 @@ static void sequencer_main_area_draw(const bContext *C, ARegion *ar) /* ************* dropboxes ************* */ -static int image_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int image_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); Scene *scene = CTX_data_scene(C); @@ -387,7 +387,7 @@ static int image_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) return 0; } -static int movie_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int movie_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); Scene *scene = CTX_data_scene(C); @@ -400,7 +400,7 @@ static int movie_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) return 0; } -static int sound_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int sound_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index ff9d1329721..110e0ab5bc4 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -458,7 +458,7 @@ static void text_cursor(wmWindow *win, ScrArea *UNUSED(sa), ARegion *UNUSED(ar)) /* ************* dropboxes ************* */ -static int text_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) +static int text_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) { if (drag->type == WM_DRAG_PATH) if (ELEM(drag->icon, ICON_FILE_SCRIPT, ICON_FILE_BLANK)) /* rule might not work? */ diff --git a/source/blender/editors/space_text/text_autocomplete.c b/source/blender/editors/space_text/text_autocomplete.c index 106093d2531..838ffb948b1 100644 --- a/source/blender/editors/space_text/text_autocomplete.c +++ b/source/blender/editors/space_text/text_autocomplete.c @@ -282,7 +282,7 @@ static void confirm_suggestion(Text *text) /* -- */ -static int text_autocomplete_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int text_autocomplete_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { SpaceText *st = CTX_wm_space_text(C); Text *text = CTX_data_edit_text(C); @@ -313,7 +313,7 @@ static int text_autocomplete_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED static int doc_scroll = 0; -static int text_autocomplete_modal(bContext *C, wmOperator *op, wmEvent *event) +static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *event) { SpaceText *st = CTX_wm_space_text(C); ScrArea *sa = CTX_wm_area(C); diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 3a7070e1a7a..7918b19fbbf 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -278,7 +278,7 @@ static int text_open_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int text_open_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int text_open_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Text *text = CTX_data_edit_text(C); char *path = (text && text->name) ? text->name : G.main->name; @@ -539,7 +539,7 @@ static int text_save_as_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int text_save_as_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int text_save_as_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Text *text = CTX_data_edit_text(C); char *str; @@ -1949,7 +1949,7 @@ static int text_jump_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int text_jump_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int text_jump_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { return WM_operator_props_dialog_popup(C, op, 10 * UI_UNIT_X, 5 * UI_UNIT_Y); @@ -2107,7 +2107,7 @@ static int text_scroll_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static void text_scroll_apply(bContext *C, wmOperator *op, wmEvent *event) +static void text_scroll_apply(bContext *C, wmOperator *op, const wmEvent *event) { SpaceText *st = CTX_wm_space_text(C); ARegion *ar = CTX_wm_region(C); @@ -2164,7 +2164,7 @@ static void scroll_exit(bContext *C, wmOperator *op) MEM_freeN(op->customdata); } -static int text_scroll_modal(bContext *C, wmOperator *op, wmEvent *event) +static int text_scroll_modal(bContext *C, wmOperator *op, const wmEvent *event) { TextScroll *tsc = op->customdata; SpaceText *st = CTX_wm_space_text(C); @@ -2204,7 +2204,7 @@ static int text_scroll_cancel(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int text_scroll_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int text_scroll_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceText *st = CTX_wm_space_text(C); TextScroll *tsc; @@ -2281,7 +2281,7 @@ static int text_region_scroll_poll(bContext *C) return 1; } -static int text_scroll_bar_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int text_scroll_bar_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceText *st = CTX_wm_space_text(C); ARegion *ar = CTX_wm_region(C); @@ -2576,7 +2576,7 @@ static void text_cursor_set_to_pos(SpaceText *st, ARegion *ar, int x, int y, int if (!sel) txt_pop_sel(text); } -static void text_cursor_set_apply(bContext *C, wmOperator *op, wmEvent *event) +static void text_cursor_set_apply(bContext *C, wmOperator *op, const wmEvent *event) { SpaceText *st = CTX_wm_space_text(C); ARegion *ar = CTX_wm_region(C); @@ -2631,7 +2631,7 @@ static void text_cursor_set_exit(bContext *C, wmOperator *op) MEM_freeN(ssel); } -static int text_set_selection_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int text_set_selection_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceText *st = CTX_wm_space_text(C); SetSelection *ssel; @@ -2656,7 +2656,7 @@ static int text_set_selection_invoke(bContext *C, wmOperator *op, wmEvent *event return OPERATOR_RUNNING_MODAL; } -static int text_set_selection_modal(bContext *C, wmOperator *op, wmEvent *event) +static int text_set_selection_modal(bContext *C, wmOperator *op, const wmEvent *event) { switch (event->type) { case LEFTMOUSE: @@ -2712,7 +2712,7 @@ static int text_cursor_set_exec(bContext *C, wmOperator *op) return OPERATOR_PASS_THROUGH; } -static int text_cursor_set_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int text_cursor_set_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceText *st = CTX_wm_space_text(C); @@ -2744,7 +2744,7 @@ void TEXT_OT_cursor_set(wmOperatorType *ot) /******************* line number operator **********************/ -static int text_line_number_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int text_line_number_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { SpaceText *st = CTX_wm_space_text(C); Text *text = CTX_data_edit_text(C); @@ -2834,7 +2834,7 @@ static int text_insert_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int text_insert_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int text_insert_invoke(bContext *C, wmOperator *op, const wmEvent *event) { int ret; @@ -3137,7 +3137,7 @@ static int text_resolve_conflict_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int text_resolve_conflict_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int text_resolve_conflict_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Text *text = CTX_data_edit_text(C); uiPopupMenu *pup; diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 57755231240..0958e53df16 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -469,7 +469,7 @@ static void view3d_main_area_init(wmWindowManager *wm, ARegion *ar) } -static int view3d_ob_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) +static int view3d_ob_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) { if (drag->type == WM_DRAG_ID) { ID *id = (ID *)drag->poin; @@ -479,7 +479,7 @@ static int view3d_ob_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSE return 0; } -static int view3d_group_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) +static int view3d_group_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) { if (drag->type == WM_DRAG_ID) { ID *id = (ID *)drag->poin; @@ -489,7 +489,7 @@ static int view3d_group_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UN return 0; } -static int view3d_mat_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) +static int view3d_mat_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) { if (drag->type == WM_DRAG_ID) { ID *id = (ID *)drag->poin; @@ -499,7 +499,7 @@ static int view3d_mat_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUS return 0; } -static int view3d_ima_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) +static int view3d_ima_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) { if (drag->type == WM_DRAG_ID) { ID *id = (ID *)drag->poin; @@ -513,7 +513,7 @@ static int view3d_ima_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUS return 0; } -static int view3d_ima_bg_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int view3d_ima_bg_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) { if (event->ctrl) return false; @@ -524,7 +524,7 @@ static int view3d_ima_bg_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) return 0; } -static int view3d_ima_empty_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int view3d_ima_empty_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) { Base *base = ED_view3d_give_base_under_cursor(C, event->mval); @@ -535,7 +535,7 @@ static int view3d_ima_empty_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) return 0; } -static int view3d_ima_mesh_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) +static int view3d_ima_mesh_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) { Base *base = ED_view3d_give_base_under_cursor(C, event->mval); diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 1cb9ce759b8..8c8332075a2 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -408,7 +408,7 @@ static void calctrackballvec(const rcti *rect, int mx, int my, float vec[3]) } -static void viewops_data_create(bContext *C, wmOperator *op, wmEvent *event) +static void viewops_data_create(bContext *C, wmOperator *op, const wmEvent *event) { static float lastofs[3] = {0, 0, 0}; RegionView3D *rv3d; @@ -841,7 +841,7 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y) ED_region_tag_redraw(vod->ar); } -static int viewrotate_modal(bContext *C, wmOperator *op, wmEvent *event) +static int viewrotate_modal(bContext *C, wmOperator *op, const wmEvent *event) { ViewOpsData *vod = op->customdata; short event_code = VIEW_PASS; @@ -890,7 +890,7 @@ static int viewrotate_modal(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int viewrotate_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int viewrotate_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ViewOpsData *vod; RegionView3D *rv3d; @@ -1097,7 +1097,7 @@ static void view3d_ndof_orbit(const struct wmNDOFMotionData *ndof, RegionView3D * -- zooming * -- panning in rotationally-locked views */ -static int ndof_orbit_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int ndof_orbit_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (event->type != NDOF_MOTION) @@ -1179,7 +1179,7 @@ void VIEW3D_OT_ndof_orbit(struct wmOperatorType *ot) } -static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (event->type != NDOF_MOTION) @@ -1277,7 +1277,7 @@ void VIEW3D_OT_ndof_orbit_zoom(struct wmOperatorType *ot) /* -- "pan" navigation * -- zoom or dolly? */ -static int ndof_pan_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int ndof_pan_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { if (event->type != NDOF_MOTION) return OPERATOR_CANCELLED; @@ -1371,7 +1371,7 @@ void VIEW3D_OT_ndof_pan(struct wmOperatorType *ot) /* * this is basically just the pan only code + the rotate only code crammed into one function that does both */ -static int ndof_all_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int ndof_all_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (event->type != NDOF_MOTION) { return OPERATOR_CANCELLED; @@ -1530,7 +1530,7 @@ static void viewmove_apply(ViewOpsData *vod, int x, int y) } -static int viewmove_modal(bContext *C, wmOperator *op, wmEvent *event) +static int viewmove_modal(bContext *C, wmOperator *op, const wmEvent *event) { ViewOpsData *vod = op->customdata; @@ -1573,7 +1573,7 @@ static int viewmove_modal(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int viewmove_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int viewmove_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ViewOpsData *vod; @@ -1794,7 +1794,7 @@ static void viewzoom_apply(ViewOpsData *vod, const int x, const int y, const sho } -static int viewzoom_modal(bContext *C, wmOperator *op, wmEvent *event) +static int viewzoom_modal(bContext *C, wmOperator *op, const wmEvent *event) { ViewOpsData *vod = op->customdata; short event_code = VIEW_PASS; @@ -1939,7 +1939,7 @@ void viewdolly_modal_keymap(wmKeyConfig *keyconf) } /* viewdolly_invoke() copied this function, changes here may apply there */ -static int viewzoom_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int viewzoom_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ViewOpsData *vod; @@ -2059,7 +2059,7 @@ static void viewdolly_apply(ViewOpsData *vod, int x, int y, const short zoom_inv } -static int viewdolly_modal(bContext *C, wmOperator *op, wmEvent *event) +static int viewdolly_modal(bContext *C, wmOperator *op, const wmEvent *event) { ViewOpsData *vod = op->customdata; short event_code = VIEW_PASS; @@ -2151,7 +2151,7 @@ static int viewdolly_exec(bContext *C, wmOperator *op) } /* copied from viewzoom_invoke(), changes here may apply there */ -static int viewdolly_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int viewdolly_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ViewOpsData *vod; @@ -3009,7 +3009,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int view3d_zoom_border_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int view3d_zoom_border_invoke(bContext *C, wmOperator *op, const wmEvent *event) { View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d = CTX_wm_region_view3d(C); @@ -3521,7 +3521,7 @@ static int background_image_add_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -static int background_image_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int background_image_add_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { View3D *v3d = CTX_wm_view3d(C); Image *ima = NULL; @@ -3676,7 +3676,7 @@ static int view3d_clipping_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int view3d_clipping_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int view3d_clipping_invoke(bContext *C, wmOperator *op, const wmEvent *event) { RegionView3D *rv3d = CTX_wm_region_view3d(C); ARegion *ar = CTX_wm_region(C); @@ -3771,7 +3771,7 @@ void ED_view3d_cursor3d_position(bContext *C, float fp[3], const int mval[2]) } -static int view3d_cursor3d_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int view3d_cursor3d_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); @@ -3810,7 +3810,7 @@ void VIEW3D_OT_cursor3d(wmOperatorType *ot) /* ***************** manipulator op ******************* */ -static int manipulator_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int manipulator_invoke(bContext *C, wmOperator *op, const wmEvent *event) { View3D *v3d = CTX_wm_view3d(C); @@ -3846,7 +3846,7 @@ void VIEW3D_OT_manipulator(wmOperatorType *ot) Transform_Properties(ot, P_CONSTRAINT); } -static int enable_manipulator_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int enable_manipulator_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { View3D *v3d = CTX_wm_view3d(C); diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index c2e75a1c5d9..700027d62a2 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -272,7 +272,7 @@ static void drawFlyPixel(const struct bContext *UNUSED(C), ARegion *UNUSED(ar), #define FLY_CANCEL 1 #define FLY_CONFIRM 2 -static int initFlyInfo(bContext *C, FlyInfo *fly, wmOperator *op, wmEvent *event) +static int initFlyInfo(bContext *C, FlyInfo *fly, wmOperator *op, const wmEvent *event) { wmWindow *win = CTX_wm_window(C); float upvec[3]; /* tmp */ @@ -486,7 +486,7 @@ static int flyEnd(bContext *C, FlyInfo *fly) return OPERATOR_CANCELLED; } -static void flyEvent(FlyInfo *fly, wmEvent *event) +static void flyEvent(FlyInfo *fly, const wmEvent *event) { if (event->type == TIMER && event->customdata == fly->timer) { fly->redraw = 1; @@ -1179,7 +1179,7 @@ static int flyApply_ndof(bContext *C, FlyInfo *fly) return OPERATOR_FINISHED; } -static int fly_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int fly_invoke(bContext *C, wmOperator *op, const wmEvent *event) { RegionView3D *rv3d = CTX_wm_region_view3d(C); FlyInfo *fly; @@ -1214,7 +1214,7 @@ static int fly_cancel(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int fly_modal(bContext *C, wmOperator *op, wmEvent *event) +static int fly_modal(bContext *C, wmOperator *op, const wmEvent *event) { int exit_code; short do_draw = FALSE; diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index f7af6d10e10..430ed8698d7 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -207,7 +207,7 @@ static int view3d_layers_exec(bContext *C, wmOperator *op) /* applies shift and alt, lazy coding or ok? :) */ /* the local per-keymap-entry keymap will solve it */ -static int view3d_layers_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int view3d_layers_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (event->ctrl || event->oskey) return OPERATOR_PASS_THROUGH; diff --git a/source/blender/editors/space_view3d/view3d_ruler.c b/source/blender/editors/space_view3d/view3d_ruler.c index e263d0347bc..81d0b2d5fc9 100644 --- a/source/blender/editors/space_view3d/view3d_ruler.c +++ b/source/blender/editors/space_view3d/view3d_ruler.c @@ -691,7 +691,7 @@ static void view3d_ruler_header_update(ScrArea *sa) /* -------------------------------------------------------------------- */ /* Operator callbacks */ -static int view3d_ruler_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int view3d_ruler_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { wmWindow *win = CTX_wm_window(C); ScrArea *sa = CTX_wm_area(C); @@ -729,7 +729,7 @@ static int view3d_ruler_cancel(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int view3d_ruler_modal(bContext *C, wmOperator *op, wmEvent *event) +static int view3d_ruler_modal(bContext *C, wmOperator *op, const wmEvent *event) { bool do_draw = false; int exit_code = OPERATOR_RUNNING_MODAL; diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 8a680d86078..7cf9a31a2f4 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -2229,7 +2229,7 @@ static int mouse_weight_paint_vertex_select(bContext *C, const int mval[2], shor /* ****** Mouse Select ****** */ -static int view3d_select_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int view3d_select_invoke(bContext *C, wmOperator *op, const const wmEvent *event) { Object *obedit = CTX_data_edit_object(C); Object *obact = CTX_data_active_object(C); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index d5fce1ba313..acd8a50f81c 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -294,7 +294,7 @@ void view3d_smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera } /* only meant for timer usage */ -static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event) +static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), const const wmEvent *event) { View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d = CTX_wm_region_view3d(C); diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 77c032b4f25..7c9fae28c42 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -866,7 +866,7 @@ static void transform_event_xyz_constraint(TransInfo *t, short key_type, char cm } } -int transformEvent(TransInfo *t, wmEvent *event) +int transformEvent(TransInfo *t, const wmEvent *event) { float mati[3][3] = MAT3_UNITY; char cmode = constraintModeToChar(t); @@ -1860,7 +1860,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) } /* note: caller needs to free 't' on a 0 return */ -int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int mode) +int initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *event, int mode) { int options = 0; PropertyRNA *prop; @@ -2665,7 +2665,7 @@ void initWarp(TransInfo *t) t->val = (max[0] - min[0]) / 2.0f; /* t->val is X dimension projected boundbox */ } -int handleEventWarp(TransInfo *t, wmEvent *event) +int handleEventWarp(TransInfo *t, const wmEvent *event) { int status = 0; @@ -2806,7 +2806,7 @@ void initShear(TransInfo *t) t->flag |= T_NO_CONSTRAINT; } -int handleEventShear(TransInfo *t, wmEvent *event) +int handleEventShear(TransInfo *t, const wmEvent *event) { int status = 0; @@ -4511,7 +4511,7 @@ void initBevel(TransInfo *t) } } -int handleEventBevel(TransInfo *t, wmEvent *event) +int handleEventBevel(TransInfo *t, const wmEvent *event) { if (event->val == KM_PRESS) { if (!G.editBMesh) return 0; @@ -5764,7 +5764,7 @@ void initEdgeSlide(TransInfo *t) t->flag |= T_NO_CONSTRAINT | T_NO_PROJECT; } -int handleEventEdgeSlide(struct TransInfo *t, struct wmEvent *event) +int handleEventEdgeSlide(struct TransInfo *t, const struct wmEvent *event) { if (t->mode == TFM_EDGE_SLIDE) { EdgeSlideData *sld = t->customData; @@ -6271,7 +6271,7 @@ void initVertSlide(TransInfo *t) t->flag |= T_NO_CONSTRAINT | T_NO_PROJECT; } -int handleEventVertSlide(struct TransInfo *t, struct wmEvent *event) +int handleEventVertSlide(struct TransInfo *t, const struct wmEvent *event) { if (t->mode == TFM_VERT_SLIDE) { VertSlideData *sld = t->customData; diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index f8c2498425a..a551ef5008e 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -288,7 +288,7 @@ typedef struct TransInfo { float fac; /* factor for distance based transform */ int (*transform)(struct TransInfo *, const int *); /* transform function pointer */ - int (*handleEvent)(struct TransInfo *, struct wmEvent *); + int (*handleEvent)(struct TransInfo *, const struct wmEvent *); /* event handler function pointer RETURN 1 if redraw is needed */ int total; /* total number of transformed data */ TransData *data; /* transformed data (array) */ @@ -475,9 +475,9 @@ typedef struct TransInfo { #define POINT_INIT 4 #define MULTI_POINTS 8 -int initTransform(struct bContext *C, struct TransInfo *t, struct wmOperator *op, struct wmEvent *event, int mode); +int initTransform(struct bContext *C, struct TransInfo *t, struct wmOperator *op, const struct wmEvent *event, int mode); void saveTransform(struct bContext *C, struct TransInfo *t, struct wmOperator *op); -int transformEvent(TransInfo *t, struct wmEvent *event); +int transformEvent(TransInfo *t, const struct wmEvent *event); void transformApply(struct bContext *C, TransInfo *t); int transformEnd(struct bContext *C, TransInfo *t); @@ -492,11 +492,11 @@ void applyAspectRatio(TransInfo *t, float *vec); void removeAspectRatio(TransInfo *t, float *vec); void initWarp(TransInfo *t); -int handleEventWarp(TransInfo *t, struct wmEvent *event); +int handleEventWarp(TransInfo *t, const struct wmEvent *event); int Warp(TransInfo *t, const int mval[2]); void initShear(TransInfo *t); -int handleEventShear(TransInfo *t, struct wmEvent *event); +int handleEventShear(TransInfo *t, const struct wmEvent *event); int Shear(TransInfo *t, const int mval[2]); void initResize(TransInfo *t); @@ -533,7 +533,7 @@ void initPushPull(TransInfo *t); int PushPull(TransInfo *t, const int mval[2]); void initBevel(TransInfo *t); -int handleEventBevel(TransInfo *t, struct wmEvent *event); +int handleEventBevel(TransInfo *t, const struct wmEvent *event); int Bevel(TransInfo *t, const int mval[2]); void initBevelWeight(TransInfo *t); @@ -552,11 +552,11 @@ void initBoneRoll(TransInfo *t); int BoneRoll(TransInfo *t, const int mval[2]); void initEdgeSlide(TransInfo *t); -int handleEventEdgeSlide(TransInfo *t, struct wmEvent *event); +int handleEventEdgeSlide(TransInfo *t, const struct wmEvent *event); int EdgeSlide(TransInfo *t, const int mval[2]); void initVertSlide(TransInfo *t); -int handleEventVertSlide(TransInfo *t, struct wmEvent *event); +int handleEventVertSlide(TransInfo *t, const struct wmEvent *event); int VertSlide(TransInfo *t, const int mval[2]); void initTimeTranslate(TransInfo *t); @@ -659,7 +659,7 @@ void initSnapping(struct TransInfo *t, struct wmOperator *op); void applyProject(TransInfo *t); void applySnapping(TransInfo *t, float *vec); void resetSnapping(TransInfo *t); -int handleSnapping(TransInfo *t, struct wmEvent *event); +int handleSnapping(TransInfo *t, const struct wmEvent *event); void drawSnapping(const struct bContext *C, TransInfo *t); int usingSnappingNormal(TransInfo *t); int validSnappingNormal(TransInfo *t); @@ -688,7 +688,7 @@ typedef enum { void initMouseInput(TransInfo *t, MouseInput *mi, const int center[2], const int mval[2]); void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode); -int handleMouseInput(struct TransInfo *t, struct MouseInput *mi, struct wmEvent *event); +int handleMouseInput(struct TransInfo *t, struct MouseInput *mi, const struct wmEvent *event); void applyMouseInput(struct TransInfo *t, struct MouseInput *mi, const int mval[2], float output[3]); void setCustomPoints(TransInfo *t, MouseInput *mi, const int start[2], const int end[2]); @@ -696,7 +696,7 @@ void setInputPostFct(MouseInput *mi, void (*post)(struct TransInfo *t, float val /*********************** Generics ********************************/ -int initTransInfo(struct bContext *C, TransInfo *t, struct wmOperator *op, struct wmEvent *event); +int initTransInfo(struct bContext *C, TransInfo *t, struct wmOperator *op, const struct wmEvent *event); void postTrans (struct bContext *C, TransInfo *t); void resetTransRestrictions(TransInfo *t); diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index ca49147084d..2a3b0bc8726 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1012,7 +1012,7 @@ void resetTransRestrictions(TransInfo *t) } /* the *op can be NULL */ -int initTransInfo(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) +int initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *event) { Scene *sce = CTX_data_scene(C); ToolSettings *ts = CTX_data_tool_settings(C); diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index 4e9a54692a5..4943a3a2fe7 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -393,7 +393,7 @@ void applyMouseInput(TransInfo *t, MouseInput *mi, const int mval[2], float outp } } -int handleMouseInput(TransInfo *t, MouseInput *mi, wmEvent *event) +int handleMouseInput(TransInfo *t, MouseInput *mi, const wmEvent *event) { int redraw = TREDRAW_NOTHING; diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 290ab68712a..968e1ec94d0 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -1773,7 +1773,7 @@ static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, const int mval[2], fl /* return 0; nothing happened */ -int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op) +int BIF_do_manipulator(bContext *C, const struct wmEvent *event, wmOperator *op) { ScrArea *sa = CTX_wm_area(C); View3D *v3d = sa->spacedata.first; diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 82e3f3f9b3a..6ac270f6f73 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -165,7 +165,7 @@ static int select_orientation_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int select_orientation_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) +static int select_orientation_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) { uiPopupMenu *pup; uiLayout *layout; @@ -212,7 +212,7 @@ static int delete_orientation_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -static int delete_orientation_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int delete_orientation_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { return delete_orientation_exec(C, op); } @@ -268,7 +268,7 @@ static int create_orientation_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int create_orientation_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int create_orientation_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { return create_orientation_exec(C, op); } @@ -300,7 +300,7 @@ static void transformops_exit(bContext *C, wmOperator *op) G.moving = 0; } -static int transformops_data(bContext *C, wmOperator *op, wmEvent *event) +static int transformops_data(bContext *C, wmOperator *op, const wmEvent *event) { int retval = 1; if (op->customdata == NULL) { @@ -334,7 +334,7 @@ static int transformops_data(bContext *C, wmOperator *op, wmEvent *event) return retval; /* return 0 on error */ } -static int transform_modal(bContext *C, wmOperator *op, wmEvent *event) +static int transform_modal(bContext *C, wmOperator *op, const wmEvent *event) { int exit_code; @@ -401,7 +401,7 @@ static int transform_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int transform_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int transform_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (!transformops_data(C, op, event)) { G.moving = 0; diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 5721d4b6ee3..c92cd77449e 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -260,7 +260,7 @@ void drawSnapping(const struct bContext *C, TransInfo *t) } } -int handleSnapping(TransInfo *t, wmEvent *event) +int handleSnapping(TransInfo *t, const wmEvent *event) { int status = 0; diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c index 0ec16ead35d..98a1b54c452 100644 --- a/source/blender/editors/util/numinput.c +++ b/source/blender/editors/util/numinput.c @@ -163,7 +163,7 @@ void applyNumInput(NumInput *n, float *vec) } } -char handleNumInput(NumInput *n, wmEvent *event) +char handleNumInput(NumInput *n, const wmEvent *event) { float Val = 0; short idx = n->idx, idx_max = n->idx_max; diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index ac2ee21d09d..fc603f7a593 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -475,7 +475,7 @@ static EnumPropertyItem *rna_undo_itemf(bContext *C, int undosys, int *totitem) } -static int undo_history_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int undo_history_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { int undosys, totitem = 0; diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index fbb6250c05b..85375bcaf83 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -2236,7 +2236,7 @@ static int select_exec(bContext *C, wmOperator *op) return mouse_select(C, co, extend, loop); } -static int select_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); float co[2]; @@ -2281,7 +2281,7 @@ static int select_loop_exec(bContext *C, wmOperator *op) return mouse_select(C, co, extend, loop); } -static int select_loop_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int select_loop_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); float co[2]; @@ -2314,7 +2314,7 @@ static void UV_OT_select_loop(wmOperatorType *ot) /* ******************** linked select operator **************** */ -static int select_linked_internal(bContext *C, wmOperator *op, wmEvent *event, int pick) +static int select_linked_internal(bContext *C, wmOperator *op, const wmEvent *event, int pick) { SpaceImage *sima = CTX_wm_space_image(C); Scene *scene = CTX_data_scene(C); @@ -2384,7 +2384,7 @@ static void UV_OT_select_linked(wmOperatorType *ot) "Extend", "Extend selection rather than clearing the existing selection"); } -static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) { return select_linked_internal(C, op, event, 1); } @@ -3748,7 +3748,7 @@ static int set_2d_cursor_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int set_2d_cursor_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int set_2d_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *ar = CTX_wm_region(C); float location[2]; @@ -3799,7 +3799,7 @@ static int set_tile_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int set_tile_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int set_tile_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceImage *sima = CTX_wm_space_image(C); Image *ima = CTX_data_edit_image(C); diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index e4599b2c30a..4c56a016176 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -1911,7 +1911,7 @@ static int stitch_init(bContext *C, wmOperator *op) return 1; } -static int stitch_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int stitch_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Object *obedit = CTX_data_edit_object(C); if (!stitch_init(C, op)) @@ -2001,7 +2001,7 @@ static int stitch_exec(bContext *C, wmOperator *op) } } -static void stitch_select(bContext *C, Scene *scene, wmEvent *event, StitchState *state) +static void stitch_select(bContext *C, Scene *scene, const wmEvent *event, StitchState *state) { /* add uv under mouse to processed uv's */ float co[2]; @@ -2035,7 +2035,7 @@ static void stitch_select(bContext *C, Scene *scene, wmEvent *event, StitchState } } -static int stitch_modal(bContext *C, wmOperator *op, wmEvent *event) +static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event) { StitchState *state; Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 4ddf4bd6a5c..9de43fc9d6b 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -654,7 +654,7 @@ static int minimize_stretch_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int minimize_stretch_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int minimize_stretch_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { MinStretch *ms; @@ -670,7 +670,7 @@ static int minimize_stretch_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED( return OPERATOR_RUNNING_MODAL; } -static int minimize_stretch_modal(bContext *C, wmOperator *op, wmEvent *event) +static int minimize_stretch_modal(bContext *C, wmOperator *op, const wmEvent *event) { MinStretch *ms = op->customdata; diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 85059755b1b..9a160d8bb1e 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -947,7 +947,7 @@ static int operator_check(bContext *C, wmOperator *op) return result; } -static int operator_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int operator_invoke(bContext *C, wmOperator *op, const wmEvent *event) { extern FunctionRNA rna_Operator_invoke_func; @@ -974,7 +974,7 @@ static int operator_invoke(bContext *C, wmOperator *op, wmEvent *event) } /* same as invoke */ -static int operator_modal(bContext *C, wmOperator *op, wmEvent *event) +static int operator_modal(bContext *C, wmOperator *op, const wmEvent *event) { extern FunctionRNA rna_Operator_modal_func; diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c index b7895cc0e2d..64c5f7ae220 100644 --- a/source/blender/makesrna/intern/rna_wm_api.c +++ b/source/blender/makesrna/intern/rna_wm_api.c @@ -86,6 +86,16 @@ static void rna_event_timer_remove(struct wmWindowManager *wm, wmTimer *timer) WM_event_remove_timer(wm, timer->win, timer); } +/* wrap these because of 'const wmEvent *' */ +static int rna_Operator_confirm(bContext *C, wmOperator *op, wmEvent *event) +{ + return WM_operator_confirm(C, op, event); +} +static int rna_Operator_props_popup(bContext *C, wmOperator *op, wmEvent *event) +{ + return WM_operator_props_popup(C, op, event); +} + static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, const char *idname, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier, int head) { @@ -266,7 +276,7 @@ void RNA_api_wm(StructRNA *srna) /* invoke functions, for use with python */ - func = RNA_def_function(srna, "invoke_props_popup", "WM_operator_props_popup"); + func = RNA_def_function(srna, "invoke_props_popup", "rna_Operator_props_popup"); RNA_def_function_ui_description(func, "Operator popup invoke"); rna_generic_op_invoke(func, WM_GEN_INVOKE_EVENT | WM_GEN_INVOKE_RETURN); @@ -284,7 +294,7 @@ void RNA_api_wm(StructRNA *srna) RNA_def_function_ui_description(func, "Operator popup invoke"); rna_generic_op_invoke(func, WM_GEN_INVOKE_SIZE | WM_GEN_INVOKE_RETURN); - func = RNA_def_function(srna, "invoke_confirm", "WM_operator_confirm"); + func = RNA_def_function(srna, "invoke_confirm", "rna_Operator_confirm"); RNA_def_function_ui_description(func, "Operator confirmation"); rna_generic_op_invoke(func, WM_GEN_INVOKE_EVENT | WM_GEN_INVOKE_RETURN); diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 57fe518dd46..6db310e44d1 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -165,7 +165,7 @@ struct wmEventHandler *WM_event_add_dropbox_handler(ListBase *handlers, ListBase /* mouse */ void WM_event_add_mousemove(struct bContext *C); void WM_event_add_mousemove_window(struct wmWindow *window); -int WM_modal_tweak_exit(struct wmEvent *evt, int tweak_event); +int WM_modal_tweak_exit(const struct wmEvent *event, int tweak_event); /* notifiers */ void WM_event_add_notifier(const struct bContext *C, unsigned int type, void *reference); @@ -180,19 +180,19 @@ void WM_event_timer_sleep(struct wmWindowManager *wm, struct wmWindow *win, str /* operator api, default callbacks */ /* invoke callback, uses enum property named "type" */ -int WM_operator_view3d_distance_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event); -int WM_menu_invoke (struct bContext *C, struct wmOperator *op, struct wmEvent *event); -int WM_enum_search_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event); +int WM_operator_view3d_distance_invoke(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); +int WM_menu_invoke (struct bContext *C, struct wmOperator *op, const struct wmEvent *event); +int WM_enum_search_invoke(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); /* invoke callback, confirm menu + exec */ -int WM_operator_confirm (struct bContext *C, struct wmOperator *op, struct wmEvent *event); +int WM_operator_confirm (struct bContext *C, struct wmOperator *op, const struct wmEvent *event); /* invoke callback, file selector "filepath" unset + exec */ -int WM_operator_filesel (struct bContext *C, struct wmOperator *op, struct wmEvent *event); +int WM_operator_filesel (struct bContext *C, struct wmOperator *op, const struct wmEvent *event); int WM_operator_filesel_ensure_ext_imtype(wmOperator *op, const struct ImageFormatData *im_format); /* poll callback, context checks */ int WM_operator_winactive (struct bContext *C); /* invoke callback, exec + redo popup */ -int WM_operator_props_popup_call(struct bContext *C, struct wmOperator *op, struct wmEvent *event); -int WM_operator_props_popup (struct bContext *C, struct wmOperator *op, struct wmEvent *event); +int WM_operator_props_popup_call(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); +int WM_operator_props_popup (struct bContext *C, struct wmOperator *op, const struct wmEvent *event); int WM_operator_props_dialog_popup (struct bContext *C, struct wmOperator *op, int width, int height); int WM_operator_redo_popup (struct bContext *C, struct wmOperator *op); int WM_operator_ui_popup (struct bContext *C, struct wmOperator *op, int width, int height); @@ -282,25 +282,25 @@ void WM_menutype_freelink(struct MenuType *mt); void WM_menutype_free(void); /* default operator callbacks for border/circle/lasso */ -int WM_border_select_invoke (struct bContext *C, struct wmOperator *op, struct wmEvent *event); -int WM_border_select_modal (struct bContext *C, struct wmOperator *op, struct wmEvent *event); +int WM_border_select_invoke (struct bContext *C, struct wmOperator *op, const struct wmEvent *event); +int WM_border_select_modal (struct bContext *C, struct wmOperator *op, const struct wmEvent *event); int WM_border_select_cancel(struct bContext *C, struct wmOperator *op); -int WM_gesture_circle_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event); -int WM_gesture_circle_modal(struct bContext *C, struct wmOperator *op, struct wmEvent *event); +int WM_gesture_circle_invoke(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); +int WM_gesture_circle_modal(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); int WM_gesture_circle_cancel(struct bContext *C, struct wmOperator *op); -int WM_gesture_lines_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event); -int WM_gesture_lines_modal(struct bContext *C, struct wmOperator *op, struct wmEvent *event); +int WM_gesture_lines_invoke(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); +int WM_gesture_lines_modal(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); int WM_gesture_lines_cancel(struct bContext *C, struct wmOperator *op); -int WM_gesture_lasso_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event); -int WM_gesture_lasso_modal(struct bContext *C, struct wmOperator *op, struct wmEvent *event); +int WM_gesture_lasso_invoke(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); +int WM_gesture_lasso_modal(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); int WM_gesture_lasso_cancel(struct bContext *C, struct wmOperator *op); const int (*WM_gesture_lasso_path_to_array(struct bContext *C, struct wmOperator *op, int *mcords_tot))[2]; -int WM_gesture_straightline_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event); -int WM_gesture_straightline_modal(struct bContext *C, struct wmOperator *op, struct wmEvent *event); +int WM_gesture_straightline_invoke(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); +int WM_gesture_straightline_modal(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); int WM_gesture_straightline_cancel(struct bContext *C, struct wmOperator *op); /* Gesture manager API */ -struct wmGesture *WM_gesture_new(struct bContext *C, struct wmEvent *event, int type); +struct wmGesture *WM_gesture_new(struct bContext *C, const struct wmEvent *event, int type); void WM_gesture_end(struct bContext *C, struct wmGesture *gesture); void WM_gestures_remove(struct bContext *C); @@ -317,7 +317,7 @@ void WM_operator_region_active_win_set(struct bContext *C); struct wmDrag *WM_event_start_drag(struct bContext *C, int icon, int type, void *poin, double value); void WM_event_drag_image(struct wmDrag *, struct ImBuf *, float scale, int sx, int sy); -struct wmDropBox *WM_dropbox_add(ListBase *lb, const char *idname, int (*poll)(struct bContext *, struct wmDrag *, struct wmEvent *event), +struct wmDropBox *WM_dropbox_add(ListBase *lb, const char *idname, int (*poll)(struct bContext *, struct wmDrag *, const struct wmEvent *event), void (*copy)(struct wmDrag *, struct wmDropBox *)); ListBase *WM_dropboxmap_find(const char *idname, int spaceid, int regionid); diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index bbaa655025b..f2750aa6d99 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -534,13 +534,13 @@ typedef struct wmOperatorType { * any further events are handled in modal. if the operation is * canceled due to some external reason, cancel is called * - see defines below for return values */ - int (*invoke)(struct bContext *, struct wmOperator *, struct wmEvent *) + int (*invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) #ifdef __GNUC__ __attribute__((warn_unused_result)) #endif ; int (*cancel)(struct bContext *, struct wmOperator *); - int (*modal)(struct bContext *, struct wmOperator *, struct wmEvent *) + int (*modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) #ifdef __GNUC__ __attribute__((warn_unused_result)) #endif @@ -645,7 +645,7 @@ typedef struct wmDropBox { struct wmDropBox *next, *prev; /* test if the dropbox is active, then can print optype name */ - int (*poll)(struct bContext *, struct wmDrag *, wmEvent *); + int (*poll)(struct bContext *, struct wmDrag *, const wmEvent *); /* before exec, this copies drag info to wmDrop properties */ void (*copy)(struct wmDrag *, struct wmDropBox *); diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c index 0581000e07c..00ccfedafa8 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.c +++ b/source/blender/windowmanager/intern/wm_dragdrop.c @@ -103,7 +103,7 @@ ListBase *WM_dropboxmap_find(const char *idname, int spaceid, int regionid) -wmDropBox *WM_dropbox_add(ListBase *lb, const char *idname, int (*poll)(bContext *, wmDrag *, wmEvent *), +wmDropBox *WM_dropbox_add(ListBase *lb, const char *idname, int (*poll)(bContext *, wmDrag *, const wmEvent *), void (*copy)(wmDrag *, wmDropBox *)) { wmDropBox *drop = MEM_callocN(sizeof(wmDropBox), "wmDropBox"); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 4e181ec930b..5a24b371a98 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2487,14 +2487,14 @@ void WM_event_add_mousemove_window(wmWindow *window) } /* for modal callbacks, check configuration for how to interpret exit with tweaks */ -int WM_modal_tweak_exit(wmEvent *evt, int tweak_event) +int WM_modal_tweak_exit(const wmEvent *event, int tweak_event) { /* if the release-confirm userpref setting is enabled, * tweak events can be canceled when mouse is released */ if (U.flag & USER_RELEASECONFIRM) { /* option on, so can exit with km-release */ - if (evt->val == KM_RELEASE) { + if (event->val == KM_RELEASE) { switch (tweak_event) { case EVT_TWEAK_L: case EVT_TWEAK_M: @@ -2515,7 +2515,7 @@ int WM_modal_tweak_exit(wmEvent *evt, int tweak_event) * some items (i.e. markers) being tweaked may end up getting * dropped all over */ - if (evt->val != KM_RELEASE) + if (event->val != KM_RELEASE) return 1; } @@ -2745,9 +2745,9 @@ static void attach_ndof_data(wmEvent *event, const GHOST_TEventNDOFMotionData *g } /* imperfect but probably usable... draw/enable drags to other windows */ -static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *win, wmEvent *evt) +static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *win, wmEvent *event) { - int mx = evt->x, my = evt->y; + int mx = event->x, my = event->y; if (wm->windows.first == wm->windows.last) return NULL; @@ -2779,8 +2779,8 @@ static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *wi if (mx - posx >= 0 && owin->posy >= 0 && mx - posx <= WM_window_pixels_x(owin) && my - posy <= WM_window_pixels_y(owin)) { - evt->x = mx - (int)(U.pixelsize * owin->posx); - evt->y = my - (int)(U.pixelsize * owin->posy); + event->x = mx - (int)(U.pixelsize * owin->posx); + event->y = my - (int)(U.pixelsize * owin->posy); return owin; } diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index 302bf61756a..adf159bcfee 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -58,7 +58,7 @@ /* context checked on having screen, window and area */ -wmGesture *WM_gesture_new(bContext *C, wmEvent *event, int type) +wmGesture *WM_gesture_new(bContext *C, const wmEvent *event, int type) { wmGesture *gesture = MEM_callocN(sizeof(wmGesture), "new gesture"); wmWindow *window = CTX_wm_window(C); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 3e639755fbb..cb2caa52d15 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -248,7 +248,7 @@ static int wm_macro_exec(bContext *C, wmOperator *op) return wm_macro_end(op, retval); } -static int wm_macro_invoke_internal(bContext *C, wmOperator *op, wmEvent *event, wmOperator *opm) +static int wm_macro_invoke_internal(bContext *C, wmOperator *op, const wmEvent *event, wmOperator *opm) { int retval = OPERATOR_FINISHED; @@ -275,13 +275,13 @@ static int wm_macro_invoke_internal(bContext *C, wmOperator *op, wmEvent *event, return wm_macro_end(op, retval); } -static int wm_macro_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int wm_macro_invoke(bContext *C, wmOperator *op, const wmEvent *event) { wm_macro_start(op); return wm_macro_invoke_internal(C, op, event, op->macro.first); } -static int wm_macro_modal(bContext *C, wmOperator *op, wmEvent *event) +static int wm_macro_modal(bContext *C, wmOperator *op, const wmEvent *event) { wmOperator *opm = op->opm; int retval = OPERATOR_FINISHED; @@ -875,7 +875,7 @@ void WM_operator_properties_free(PointerRNA *ptr) /* ************ default op callbacks, exported *********** */ -int WM_operator_view3d_distance_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *UNUSED(event)) +int WM_operator_view3d_distance_invoke(struct bContext *C, struct wmOperator *op, const struct wmEvent *UNUSED(event)) { Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); @@ -905,7 +905,7 @@ int WM_operator_view3d_distance_invoke(struct bContext *C, struct wmOperator *op } /* invoke callback, uses enum property named "type" */ -int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { PropertyRNA *prop = op->type->prop; uiPopupMenu *pup; @@ -1024,7 +1024,7 @@ static uiBlock *wm_enum_search_menu(bContext *C, ARegion *ar, void *arg_op) } -int WM_enum_search_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +int WM_enum_search_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { uiPupBlock(C, wm_enum_search_menu, op); return OPERATOR_CANCELLED; @@ -1051,13 +1051,13 @@ int WM_operator_confirm_message(bContext *C, wmOperator *op, const char *message } -int WM_operator_confirm(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +int WM_operator_confirm(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { return WM_operator_confirm_message(C, op, NULL); } /* op->invoke, opens fileselect if path property not set, otherwise executes */ -int WM_operator_filesel(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +int WM_operator_filesel(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (RNA_struct_property_is_set(op->ptr, "filepath")) { return WM_operator_call_notest(C, op); /* call exec direct */ @@ -1475,12 +1475,12 @@ static int wm_operator_props_popup_ex(bContext *C, wmOperator *op, const int do_ * This way - the button values correspond to the result of the operator. * Without this, first access to a button will make the result jump, * see [#32452] */ -int WM_operator_props_popup_call(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +int WM_operator_props_popup_call(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { return wm_operator_props_popup_ex(C, op, TRUE); } -int WM_operator_props_popup(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +int WM_operator_props_popup(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { return wm_operator_props_popup_ex(C, op, FALSE); } @@ -1529,7 +1529,7 @@ static int wm_debug_menu_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int wm_debug_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int wm_debug_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { RNA_int_set(op->ptr, "debug_value", G.debug_value); return WM_operator_props_dialog_popup(C, op, 9 * UI_UNIT_X, UI_UNIT_Y); @@ -1742,7 +1742,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar return block; } -static int wm_splash_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event)) +static int wm_splash_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) { uiPupBlock(C, wm_block_create_splash, NULL); @@ -1796,7 +1796,7 @@ static int wm_search_menu_exec(bContext *UNUSED(C), wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -static int wm_search_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int wm_search_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { uiPupBlock(C, wm_block_search_menu, op); @@ -1944,7 +1944,7 @@ static void open_set_use_scripts(wmOperator *op) } } -static int wm_open_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int wm_open_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { const char *openname = G.main->name; @@ -2034,7 +2034,7 @@ static int wm_link_append_poll(bContext *C) return 0; } -static int wm_link_append_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int wm_link_append_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { if (RNA_struct_property_is_set(op->ptr, "filepath")) { return WM_operator_call_notest(C, op); @@ -2289,7 +2289,7 @@ static int wm_recover_auto_save_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int wm_recover_auto_save_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int wm_recover_auto_save_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { char filename[FILE_MAX]; @@ -2338,7 +2338,7 @@ static void save_set_compress(wmOperator *op) } } -static int wm_save_as_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int wm_save_as_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { char name[FILE_MAX]; @@ -2444,7 +2444,7 @@ static void WM_OT_save_as_mainfile(wmOperatorType *ot) /* *************** save file directly ******** */ -static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { char name[FILE_MAX]; int ret; @@ -2650,7 +2650,7 @@ static void wm_gesture_end(bContext *C, wmOperator *op) WM_cursor_restore(CTX_wm_window(C)); } -int WM_border_select_invoke(bContext *C, wmOperator *op, wmEvent *event) +int WM_border_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (ISTWEAK(event->type)) op->customdata = WM_gesture_new(C, event, WM_GESTURE_RECT); @@ -2665,7 +2665,7 @@ int WM_border_select_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -int WM_border_select_modal(bContext *C, wmOperator *op, wmEvent *event) +int WM_border_select_modal(bContext *C, wmOperator *op, const wmEvent *event) { wmGesture *gesture = op->customdata; rcti *rect = gesture->customdata; @@ -2734,7 +2734,7 @@ int WM_border_select_cancel(bContext *C, wmOperator *op) int circle_select_size = 25; /* XXX - need some operator memory thing! */ #endif -int WM_gesture_circle_invoke(bContext *C, wmOperator *op, wmEvent *event) +int WM_gesture_circle_invoke(bContext *C, wmOperator *op, const wmEvent *event) { op->customdata = WM_gesture_new(C, event, WM_GESTURE_CIRCLE); @@ -2769,7 +2769,7 @@ static void gesture_circle_apply(bContext *C, wmOperator *op) #endif } -int WM_gesture_circle_modal(bContext *C, wmOperator *op, wmEvent *event) +int WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event) { wmGesture *gesture = op->customdata; rcti *rect = gesture->customdata; @@ -2865,7 +2865,7 @@ void WM_OT_circle_gesture(wmOperatorType *ot) /* **************** Tweak gesture *************** */ -static void tweak_gesture_modal(bContext *C, wmEvent *event) +static void tweak_gesture_modal(bContext *C, const wmEvent *event) { wmWindow *window = CTX_wm_window(C); wmGesture *gesture = window->tweak; @@ -2907,7 +2907,9 @@ static void tweak_gesture_modal(bContext *C, wmEvent *event) WM_gesture_end(C, gesture); /* when tweak fails we should give the other keymap entries a chance */ - event->val = KM_RELEASE; + + /* XXX, assigning to readonly, BAD JUJU! */ + ((wmEvent *)event)->val = KM_RELEASE; } break; default: @@ -2943,7 +2945,7 @@ void wm_tweakevent_test(bContext *C, wmEvent *event, int action) /* *********************** lasso gesture ****************** */ -int WM_gesture_lasso_invoke(bContext *C, wmOperator *op, wmEvent *event) +int WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event) { op->customdata = WM_gesture_new(C, event, WM_GESTURE_LASSO); @@ -2958,7 +2960,7 @@ int WM_gesture_lasso_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -int WM_gesture_lines_invoke(bContext *C, wmOperator *op, wmEvent *event) +int WM_gesture_lines_invoke(bContext *C, wmOperator *op, const wmEvent *event) { op->customdata = WM_gesture_new(C, event, WM_GESTURE_LINES); @@ -3000,7 +3002,7 @@ static void gesture_lasso_apply(bContext *C, wmOperator *op) } } -int WM_gesture_lasso_modal(bContext *C, wmOperator *op, wmEvent *event) +int WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event) { wmGesture *gesture = op->customdata; int sx, sy; @@ -3056,7 +3058,7 @@ int WM_gesture_lasso_modal(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -int WM_gesture_lines_modal(bContext *C, wmOperator *op, wmEvent *event) +int WM_gesture_lines_modal(bContext *C, wmOperator *op, const wmEvent *event) { return WM_gesture_lasso_modal(C, op, event); } @@ -3175,7 +3177,7 @@ static int straightline_apply(bContext *C, wmOperator *op) } -int WM_gesture_straightline_invoke(bContext *C, wmOperator *op, wmEvent *event) +int WM_gesture_straightline_invoke(bContext *C, wmOperator *op, const wmEvent *event) { op->customdata = WM_gesture_new(C, event, WM_GESTURE_STRAIGHTLINE); @@ -3190,7 +3192,7 @@ int WM_gesture_straightline_invoke(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -int WM_gesture_straightline_modal(bContext *C, wmOperator *op, wmEvent *event) +int WM_gesture_straightline_modal(bContext *C, wmOperator *op, const wmEvent *event) { wmGesture *gesture = op->customdata; rcti *rect = gesture->customdata; @@ -3282,7 +3284,7 @@ typedef struct { void *cursor; } RadialControl; -static void radial_control_set_initial_mouse(RadialControl *rc, wmEvent *event) +static void radial_control_set_initial_mouse(RadialControl *rc, const wmEvent *event) { float d[2] = {0, 0}; float zoom[2] = {1, 1}; @@ -3598,7 +3600,7 @@ static int radial_control_get_properties(bContext *C, wmOperator *op) return 1; } -static int radial_control_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int radial_control_invoke(bContext *C, wmOperator *op, const wmEvent *event) { wmWindowManager *wm; RadialControl *rc; @@ -3695,7 +3697,7 @@ static int radial_control_cancel(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int radial_control_modal(bContext *C, wmOperator *op, wmEvent *event) +static int radial_control_modal(bContext *C, wmOperator *op, const wmEvent *event) { RadialControl *rc = op->customdata; float new_value, dist, zoom[2]; |