From 10233e95dd9733fe4a6ea956e72743130c8a1bc6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 20 Mar 2025 21:11:06 +0000 Subject: [PATCH] Cleanup: use a typed enum for operator & gizmo callbacks Callbacks: exec invoke & modal now use a typed enum wmOperatorStatus. This helps avoid mistakes returning incompatible booleans or other values which don't make sense for operators to return. It also makes it more obvious functions in the WM API are intended to be used to calculate return values for operator callbacks. Operator enums have been moved into DNA_windowmanager_enums.h so this can be used in other headers without loading other includes indirectly. No functional changes expected. Ref !136227 --- .../editors/animation/anim_asset_ops.cc | 30 +-- .../editors/animation/anim_channels_edit.cc | 64 ++++--- .../blender/editors/animation/anim_markers.cc | 57 +++--- source/blender/editors/animation/anim_ops.cc | 24 +-- source/blender/editors/animation/drivers.cc | 20 +- .../blender/editors/animation/keyframing.cc | 40 ++-- .../blender/editors/animation/keyingsets.cc | 18 +- .../blender/editors/armature/armature_add.cc | 18 +- .../blender/editors/armature/armature_edit.cc | 24 +-- .../editors/armature/armature_naming.cc | 4 +- .../editors/armature/armature_relations.cc | 18 +- .../editors/armature/armature_select.cc | 22 ++- .../editors/armature/bone_collections.cc | 38 ++-- source/blender/editors/armature/pose_edit.cc | 24 +-- source/blender/editors/armature/pose_lib_2.cc | 14 +- .../blender/editors/armature/pose_select.cc | 18 +- source/blender/editors/armature/pose_slide.cc | 34 ++-- .../editors/armature/pose_transform.cc | 27 +-- .../blender/editors/asset/intern/asset_ops.cc | 38 ++-- source/blender/editors/curve/editcurve.cc | 70 +++---- source/blender/editors/curve/editcurve_add.cc | 28 +-- .../blender/editors/curve/editcurve_paint.cc | 8 +- source/blender/editors/curve/editcurve_pen.cc | 6 +- .../blender/editors/curve/editcurve_select.cc | 36 ++-- source/blender/editors/curve/editfont.cc | 76 ++++---- .../curves/intern/curves_attribute_set.cc | 4 +- .../editors/curves/intern/curves_draw.cc | 8 +- .../editors/curves/intern/curves_extrude.cc | 2 +- .../editors/curves/intern/curves_ops.cc | 44 ++--- source/blender/editors/curves/intern/join.cc | 2 +- .../curves/intern/select_linked_pick.cc | 4 +- .../blender/editors/curves/intern/separate.cc | 2 +- .../editors/geometry/geometry_attributes.cc | 36 ++-- .../geometry/geometry_randomization.cc | 6 +- .../editors/geometry/node_group_operator.cc | 4 +- .../gizmo_types/arrow3d_gizmo.cc | 10 +- .../gizmo_types/blank3d_gizmo.cc | 4 +- .../gizmo_library/gizmo_types/cage2d_gizmo.cc | 10 +- .../gizmo_library/gizmo_types/cage3d_gizmo.cc | 10 +- .../gizmo_library/gizmo_types/dial3d_gizmo.cc | 10 +- .../gizmo_library/gizmo_types/move3d_gizmo.cc | 18 +- .../gizmo_types/primitive3d_gizmo.cc | 4 +- .../gizmo_library/gizmo_types/snap3d_gizmo.cc | 12 +- .../editors/gpencil_legacy/annotate_paint.cc | 14 +- .../editors/gpencil_legacy/gpencil_data.cc | 10 +- .../editors/gpencil_legacy/gpencil_edit.cc | 2 +- .../intern/grease_pencil_bake_animation.cc | 8 +- .../intern/grease_pencil_edit.cc | 91 +++++---- .../intern/grease_pencil_frames.cc | 11 +- .../intern/grease_pencil_join_selection.cc | 2 +- .../intern/grease_pencil_layers.cc | 38 ++-- .../intern/grease_pencil_lineart.cc | 22 ++- .../intern/grease_pencil_material.cc | 17 +- .../intern/grease_pencil_modes.cc | 8 +- .../intern/grease_pencil_primitive.cc | 26 ++- .../intern/grease_pencil_select.cc | 20 +- .../intern/grease_pencil_trim.cc | 4 +- .../intern/grease_pencil_utils.cc | 6 +- .../intern/grease_pencil_vertex_paint.cc | 13 +- .../intern/grease_pencil_weight_paint.cc | 14 +- source/blender/editors/include/ED_armature.hh | 4 +- source/blender/editors/include/ED_curve.hh | 4 +- source/blender/editors/include/ED_curves.hh | 3 +- .../editors/include/ED_grease_pencil.hh | 8 +- source/blender/editors/include/ED_mesh.hh | 6 +- .../blender/editors/include/ED_pointcloud.hh | 3 +- source/blender/editors/include/ED_screen.hh | 2 +- .../blender/editors/include/ED_util_imbuf.hh | 4 +- .../blender/editors/include/UI_interface_c.hh | 10 +- .../interface/eyedroppers/eyedropper_bone.cc | 6 +- .../interface/eyedroppers/eyedropper_color.cc | 6 +- .../eyedroppers/eyedropper_colorband.cc | 14 +- .../eyedroppers/eyedropper_datablock.cc | 6 +- .../interface/eyedroppers/eyedropper_depth.cc | 6 +- .../eyedroppers/eyedropper_driver.cc | 8 +- .../eyedropper_grease_pencil_color.cc | 10 +- .../editors/interface/interface_ops.cc | 85 +++++---- .../regions/interface_region_menu_pie.cc | 2 +- .../regions/interface_region_menu_popup.cc | 2 +- .../regions/interface_region_popover.cc | 5 +- .../editors/interface/view2d/view2d_ops.cc | 48 ++--- source/blender/editors/io/io_alembic.cc | 10 +- source/blender/editors/io/io_cache.cc | 18 +- source/blender/editors/io/io_collada.cc | 8 +- .../blender/editors/io/io_drop_import_file.cc | 6 +- source/blender/editors/io/io_grease_pencil.cc | 14 +- source/blender/editors/io/io_obj.cc | 8 +- source/blender/editors/io/io_ply_ops.cc | 8 +- source/blender/editors/io/io_stl_ops.cc | 8 +- source/blender/editors/io/io_usd.cc | 10 +- source/blender/editors/io/io_utils.cc | 2 +- source/blender/editors/io/io_utils.hh | 2 +- .../editors/lattice/editlattice_select.cc | 14 +- .../editors/lattice/editlattice_tools.cc | 4 +- source/blender/editors/mask/mask_add.cc | 35 ++-- source/blender/editors/mask/mask_ops.cc | 44 +++-- .../editors/mask/mask_relationships.cc | 4 +- source/blender/editors/mask/mask_select.cc | 26 +-- source/blender/editors/mask/mask_shapekey.cc | 8 +- source/blender/editors/mesh/editmesh_add.cc | 18 +- .../editors/mesh/editmesh_add_gizmo.cc | 8 +- .../editors/mesh/editmesh_attribute.cc | 6 +- source/blender/editors/mesh/editmesh_bevel.cc | 6 +- .../blender/editors/mesh/editmesh_bisect.cc | 14 +- .../blender/editors/mesh/editmesh_extrude.cc | 18 +- .../editors/mesh/editmesh_extrude_screw.cc | 4 +- .../editors/mesh/editmesh_extrude_spin.cc | 6 +- source/blender/editors/mesh/editmesh_inset.cc | 6 +- .../editors/mesh/editmesh_intersect.cc | 6 +- source/blender/editors/mesh/editmesh_knife.cc | 4 +- .../editors/mesh/editmesh_knife_project.cc | 2 +- .../blender/editors/mesh/editmesh_loopcut.cc | 10 +- .../editors/mesh/editmesh_mask_extract.cc | 16 +- source/blender/editors/mesh/editmesh_path.cc | 10 +- .../editors/mesh/editmesh_polybuild.cc | 28 +-- source/blender/editors/mesh/editmesh_rip.cc | 2 +- .../blender/editors/mesh/editmesh_rip_edge.cc | 4 +- .../blender/editors/mesh/editmesh_select.cc | 56 +++--- .../editors/mesh/editmesh_select_similar.cc | 8 +- .../mesh/editmesh_set_sharpness_by_angle.cc | 2 +- source/blender/editors/mesh/editmesh_tools.cc | 154 +++++++-------- source/blender/editors/mesh/mesh_data.cc | 22 ++- source/blender/editors/mesh/meshtools.cc | 4 +- source/blender/editors/metaball/mball_edit.cc | 18 +- .../editors/object/add_modifier_assets.cc | 6 +- source/blender/editors/object/object_add.cc | 68 ++++--- source/blender/editors/object/object_bake.cc | 18 +- .../blender/editors/object/object_bake_api.cc | 18 +- .../editors/object/object_bake_simulation.cc | 48 +++-- .../editors/object/object_collection.cc | 59 +++--- .../editors/object/object_constraint.cc | 116 +++++++----- .../editors/object/object_data_transfer.cc | 8 +- source/blender/editors/object/object_edit.cc | 40 ++-- source/blender/editors/object/object_hook.cc | 14 +- .../object/object_light_linking_ops.cc | 8 +- source/blender/editors/object/object_modes.cc | 4 +- .../blender/editors/object/object_modifier.cc | 179 ++++++++++-------- .../object/object_multires_modifier.cc | 46 +++-- .../blender/editors/object/object_random.cc | 2 +- .../editors/object/object_relations.cc | 46 +++-- .../blender/editors/object/object_remesh.cc | 10 +- .../blender/editors/object/object_select.cc | 18 +- .../editors/object/object_shader_fx.cc | 38 ++-- .../blender/editors/object/object_shapekey.cc | 14 +- .../editors/object/object_transform.cc | 51 ++--- .../blender/editors/object/object_vgroup.cc | 61 +++--- .../object_visual_geometry_to_objects.cc | 2 +- .../blender/editors/object/object_volume.cc | 8 +- source/blender/editors/object/object_warp.cc | 2 +- .../editors/physics/dynamicpaint_ops.cc | 10 +- .../blender/editors/physics/particle_boids.cc | 16 +- .../blender/editors/physics/particle_edit.cc | 50 ++--- .../editors/physics/particle_object.cc | 32 ++-- .../blender/editors/physics/physics_fluid.cc | 10 +- .../editors/physics/physics_pointcache.cc | 16 +- .../editors/physics/rigidbody_constraint.cc | 4 +- .../editors/physics/rigidbody_object.cc | 12 +- .../editors/physics/rigidbody_world.cc | 10 +- .../pointcloud/intern/attribute_set.cc | 4 +- .../editors/pointcloud/intern/duplicate.cc | 2 +- .../blender/editors/pointcloud/intern/join.cc | 2 +- .../editors/pointcloud/intern/operators.cc | 6 +- .../editors/pointcloud/intern/separate.cc | 2 +- .../blender/editors/render/render_internal.cc | 8 +- .../blender/editors/render/render_opengl.cc | 10 +- .../blender/editors/render/render_shading.cc | 100 +++++----- source/blender/editors/render/render_view.cc | 4 +- source/blender/editors/scene/scene_edit.cc | 6 +- source/blender/editors/screen/screen_ops.cc | 114 ++++++----- source/blender/editors/screen/screendump.cc | 4 +- .../blender/editors/screen/workspace_edit.cc | 16 +- .../editors/sculpt_paint/brush_asset_ops.cc | 30 +-- .../editors/sculpt_paint/curves_sculpt_ops.cc | 22 ++- .../sculpt_paint/grease_pencil_draw_ops.cc | 58 +++--- .../sculpt_paint/grease_pencil_interpolate.cc | 10 +- .../sculpt_paint/grease_pencil_trace.cc | 6 +- .../editors/sculpt_paint/paint_curve.cc | 26 ++- .../editors/sculpt_paint/paint_hide.cc | 16 +- .../editors/sculpt_paint/paint_image.cc | 16 +- .../sculpt_paint/paint_image_ops_paint.cc | 6 +- .../editors/sculpt_paint/paint_image_proj.cc | 14 +- .../editors/sculpt_paint/paint_intern.hh | 8 +- .../editors/sculpt_paint/paint_mask.cc | 10 +- .../blender/editors/sculpt_paint/paint_ops.cc | 24 +-- .../editors/sculpt_paint/paint_stroke.cc | 7 +- .../editors/sculpt_paint/paint_utils.cc | 40 ++-- .../editors/sculpt_paint/paint_vertex.cc | 10 +- .../sculpt_paint/paint_vertex_color_ops.cc | 12 +- .../sculpt_paint/paint_vertex_weight_ops.cc | 24 ++- .../editors/sculpt_paint/paint_weight.cc | 8 +- source/blender/editors/sculpt_paint/sculpt.cc | 10 +- .../editors/sculpt_paint/sculpt_cloth.cc | 8 +- .../editors/sculpt_paint/sculpt_detail.cc | 24 ++- .../editors/sculpt_paint/sculpt_dyntopo.cc | 10 +- .../editors/sculpt_paint/sculpt_expand.cc | 4 +- .../editors/sculpt_paint/sculpt_face_set.cc | 30 +-- .../sculpt_paint/sculpt_filter_color.cc | 10 +- .../sculpt_paint/sculpt_filter_mask.cc | 2 +- .../sculpt_paint/sculpt_filter_mesh.cc | 22 ++- .../editors/sculpt_paint/sculpt_mask_init.cc | 2 +- .../editors/sculpt_paint/sculpt_ops.cc | 20 +- .../editors/sculpt_paint/sculpt_project.cc | 4 +- .../editors/sculpt_paint/sculpt_transform.cc | 6 +- .../editors/sculpt_paint/sculpt_trim.cc | 16 +- .../blender/editors/sculpt_paint/sculpt_uv.cc | 4 +- source/blender/editors/sound/sound_ops.cc | 20 +- .../editors/space_action/action_data.cc | 16 +- .../editors/space_action/action_edit.cc | 46 ++--- .../editors/space_action/action_select.cc | 46 +++-- .../editors/space_buttons/buttons_ops.cc | 14 +- .../editors/space_clip/clip_dopesheet_ops.cc | 8 +- .../editors/space_clip/clip_graph_ops.cc | 22 +-- source/blender/editors/space_clip/clip_ops.cc | 64 ++++--- .../editors/space_clip/tracking_ops.cc | 70 ++++--- .../editors/space_clip/tracking_ops_detect.cc | 2 +- .../editors/space_clip/tracking_ops_orient.cc | 27 ++- .../editors/space_clip/tracking_ops_plane.cc | 8 +- .../editors/space_clip/tracking_ops_solve.cc | 8 +- .../space_clip/tracking_ops_stabilize.cc | 12 +- .../editors/space_clip/tracking_ops_track.cc | 12 +- .../editors/space_clip/tracking_select.cc | 14 +- .../editors/space_console/console_ops.cc | 58 +++--- source/blender/editors/space_file/file_ops.cc | 84 ++++---- .../blender/editors/space_graph/graph_edit.cc | 78 ++++---- .../blender/editors/space_graph/graph_ops.cc | 10 +- .../editors/space_graph/graph_select.cc | 52 ++--- .../editors/space_graph/graph_slider_ops.cc | 104 +++++----- .../blender/editors/space_graph/graph_view.cc | 20 +- .../blender/editors/space_image/image_ops.cc | 132 +++++++------ source/blender/editors/space_info/info_ops.cc | 38 ++-- .../blender/editors/space_info/info_report.cc | 16 +- source/blender/editors/space_nla/nla_edit.cc | 66 ++++--- .../blender/editors/space_nla/nla_select.cc | 32 ++-- .../blender/editors/space_nla/nla_tracks.cc | 16 +- .../blender/editors/space_node/clipboard.cc | 8 +- source/blender/editors/space_node/node_add.cc | 44 +++-- .../blender/editors/space_node/node_edit.cc | 47 ++--- .../blender/editors/space_node/node_group.cc | 16 +- .../blender/editors/space_node/node_intern.hh | 2 +- .../editors/space_node/node_relationships.cc | 28 +-- .../blender/editors/space_node/node_select.cc | 30 +-- .../blender/editors/space_node/node_view.cc | 16 +- .../space_outliner/outliner_collections.cc | 30 +-- .../space_outliner/outliner_dragdrop.cc | 20 +- .../editors/space_outliner/outliner_edit.cc | 84 ++++---- .../editors/space_outliner/outliner_select.cc | 26 ++- .../editors/space_outliner/outliner_tools.cc | 36 ++-- .../editors/space_script/script_edit.cc | 4 +- .../editors/space_sequencer/sequencer_add.cc | 52 +++-- .../sequencer_channels_edit.cc | 4 +- .../space_sequencer/sequencer_clipboard.cc | 4 +- .../editors/space_sequencer/sequencer_edit.cc | 108 ++++++----- .../space_sequencer/sequencer_intern.hh | 26 +-- .../space_sequencer/sequencer_modifier.cc | 10 +- .../space_sequencer/sequencer_proxy.cc | 12 +- .../space_sequencer/sequencer_retiming.cc | 68 +++---- .../space_sequencer/sequencer_select.cc | 40 ++-- .../space_sequencer/sequencer_text_edit.cc | 32 ++-- .../editors/space_sequencer/sequencer_view.cc | 12 +- .../space_spreadsheet/spreadsheet_ops.cc | 8 +- .../editors/space_text/text_autocomplete.cc | 8 +- .../blender/editors/space_text/text_header.cc | 2 +- source/blender/editors/space_text/text_ops.cc | 122 ++++++------ .../editors/space_userpref/userpref_ops.cc | 40 ++-- .../editors/space_view3d/view3d_buttons.cc | 2 +- .../editors/space_view3d/view3d_edit.cc | 36 ++-- .../view3d_gizmo_preselect_type.cc | 12 +- .../space_view3d/view3d_gizmo_ruler.cc | 18 +- .../editors/space_view3d/view3d_header.cc | 2 +- .../editors/space_view3d/view3d_navigate.cc | 27 +-- .../editors/space_view3d/view3d_navigate.hh | 22 ++- .../space_view3d/view3d_navigate_fly.cc | 8 +- .../view3d_navigate_smoothview.cc | 4 +- .../space_view3d/view3d_navigate_view_all.cc | 4 +- .../space_view3d/view3d_navigate_view_axis.cc | 2 +- .../view3d_navigate_view_camera.cc | 2 +- .../view3d_navigate_view_center_cursor.cc | 2 +- .../view3d_navigate_view_center_pick.cc | 2 +- .../view3d_navigate_view_dolly.cc | 8 +- .../space_view3d/view3d_navigate_view_move.cc | 20 +- .../space_view3d/view3d_navigate_view_ndof.cc | 49 ++--- .../view3d_navigate_view_orbit.cc | 2 +- .../space_view3d/view3d_navigate_view_pan.cc | 10 +- .../space_view3d/view3d_navigate_view_roll.cc | 8 +- .../view3d_navigate_view_rotate.cc | 20 +- .../space_view3d/view3d_navigate_view_zoom.cc | 22 +-- .../space_view3d/view3d_navigate_walk.cc | 8 +- .../view3d_navigate_zoom_border.cc | 2 +- .../editors/space_view3d/view3d_ops.cc | 4 +- .../editors/space_view3d/view3d_placement.cc | 8 +- .../editors/space_view3d/view3d_select.cc | 22 ++- .../editors/space_view3d/view3d_snap.cc | 14 +- .../editors/space_view3d/view3d_view.cc | 10 +- source/blender/editors/transform/transform.cc | 8 +- source/blender/editors/transform/transform.hh | 5 +- .../editors/transform/transform_gizmo_2d.cc | 8 +- .../editors/transform/transform_gizmo_3d.cc | 8 +- .../editors/transform/transform_ops.cc | 26 ++- source/blender/editors/undo/ed_undo.cc | 23 ++- source/blender/editors/util/ed_util_imbuf.cc | 4 +- source/blender/editors/util/ed_util_ops.cc | 20 +- .../editors/uvedit/uvedit_clipboard.cc | 4 +- source/blender/editors/uvedit/uvedit_ops.cc | 32 ++-- source/blender/editors/uvedit/uvedit_path.cc | 10 +- source/blender/editors/uvedit/uvedit_rip.cc | 4 +- .../blender/editors/uvedit/uvedit_select.cc | 91 +++++---- .../editors/uvedit/uvedit_smart_stitch.cc | 6 +- .../editors/uvedit/uvedit_unwrap_ops.cc | 34 ++-- .../makesdna/DNA_windowmanager_enums.h | 67 +++++++ .../makesdna/DNA_windowmanager_types.h | 56 +----- source/blender/makesrna/intern/rna_wm.cc | 18 +- source/blender/makesrna/intern/rna_wm_api.cc | 7 +- .../blender/makesrna/intern/rna_wm_gizmo.cc | 18 +- source/blender/nodes/NOD_socket_items_ops.hh | 8 +- source/blender/windowmanager/WM_api.hh | 157 +++++++-------- source/blender/windowmanager/WM_types.hh | 10 +- .../windowmanager/gizmo/WM_gizmo_api.hh | 5 +- .../windowmanager/gizmo/intern/wm_gizmo.cc | 5 +- .../gizmo/intern/wm_gizmo_group.cc | 8 +- .../windowmanager/gizmo/wm_gizmo_fn.hh | 9 +- .../windowmanager/intern/wm_event_system.cc | 111 +++++------ .../blender/windowmanager/intern/wm_files.cc | 88 +++++---- .../windowmanager/intern/wm_files_link.cc | 16 +- .../windowmanager/intern/wm_gesture_ops.cc | 46 +++-- .../windowmanager/intern/wm_operator_type.cc | 22 +-- .../windowmanager/intern/wm_operator_utils.cc | 7 +- .../windowmanager/intern/wm_operators.cc | 158 +++++++++------- .../windowmanager/intern/wm_splash_screen.cc | 8 +- .../blender/windowmanager/intern/wm_stereo.cc | 4 +- .../blender/windowmanager/intern/wm_window.cc | 8 +- source/blender/windowmanager/wm.hh | 4 +- source/blender/windowmanager/wm_window.hh | 8 +- .../xr/intern/wm_xr_operators.cc | 36 ++-- 333 files changed, 4175 insertions(+), 3372 deletions(-) create mode 100644 source/blender/makesdna/DNA_windowmanager_enums.h diff --git a/source/blender/editors/animation/anim_asset_ops.cc b/source/blender/editors/animation/anim_asset_ops.cc index 8901739ee61..b904233e529 100644 --- a/source/blender/editors/animation/anim_asset_ops.cc +++ b/source/blender/editors/animation/anim_asset_ops.cc @@ -223,10 +223,10 @@ static blender::Vector get_selected_pose_objects(bContext *C) return selected_pose_objects; } -static int create_pose_asset_local(bContext *C, - wmOperator *op, - const StringRefNull name, - const AssetLibraryReference lib_ref) +static wmOperatorStatus create_pose_asset_local(bContext *C, + wmOperator *op, + const StringRefNull name, + const AssetLibraryReference lib_ref) { blender::Vector selected_pose_objects = get_selected_pose_objects(C); @@ -268,10 +268,10 @@ static int create_pose_asset_local(bContext *C, return OPERATOR_FINISHED; } -static int create_pose_asset_user_library(bContext *C, - wmOperator *op, - const char name[MAX_NAME], - const AssetLibraryReference lib_ref) +static wmOperatorStatus create_pose_asset_user_library(bContext *C, + wmOperator *op, + const char name[MAX_NAME], + const AssetLibraryReference lib_ref) { BLI_assert(lib_ref.type == ASSET_LIBRARY_CUSTOM); Main *bmain = CTX_data_main(C); @@ -330,7 +330,7 @@ static int create_pose_asset_user_library(bContext *C, return OPERATOR_FINISHED; } -static int pose_asset_create_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_asset_create_exec(bContext *C, wmOperator *op) { char name[MAX_NAME] = ""; PropertyRNA *name_prop = RNA_struct_find_property(op->ptr, "pose_name"); @@ -363,7 +363,9 @@ static int pose_asset_create_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int pose_asset_create_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus pose_asset_create_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { /* If the library isn't saved from the operator's last execution, use the first library. */ if (!RNA_struct_property_is_set_ex(op->ptr, "asset_library_reference", false)) { @@ -630,7 +632,7 @@ static void update_pose_action_from_scene(Main *bmain, } } -static int pose_asset_modify_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_asset_modify_exec(bContext *C, wmOperator *op) { bAction *action = get_action_of_selected_asset(C); BLI_assert_msg(action, "Poll should have checked action exists"); @@ -741,7 +743,7 @@ static bool pose_asset_delete_poll(bContext *C) return true; } -static int pose_asset_delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_asset_delete_exec(bContext *C, wmOperator *op) { bAction *action = get_action_of_selected_asset(C); if (!action) { @@ -766,7 +768,9 @@ static int pose_asset_delete_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int pose_asset_delete_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus pose_asset_delete_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { bAction *action = get_action_of_selected_asset(C); diff --git a/source/blender/editors/animation/anim_channels_edit.cc b/source/blender/editors/animation/anim_channels_edit.cc index 9c8b36e465b..1d5e9508685 100644 --- a/source/blender/editors/animation/anim_channels_edit.cc +++ b/source/blender/editors/animation/anim_channels_edit.cc @@ -2276,7 +2276,7 @@ static void rearrange_gpencil_channels(bAnimContext *ac, eRearrangeAnimChan_Mode /* ------------------- */ -static int animchannels_rearrange_exec(bContext *C, wmOperator *op) +static wmOperatorStatus animchannels_rearrange_exec(bContext *C, wmOperator *op) { bAnimContext ac; eRearrangeAnimChan_Mode mode; @@ -2530,7 +2530,7 @@ static void animchannels_group_channels(bAnimContext *ac, ANIM_animdata_freelist(&anim_data); } -static int animchannels_group_exec(bContext *C, wmOperator *op) +static wmOperatorStatus animchannels_group_exec(bContext *C, wmOperator *op) { bAnimContext ac; char name[MAX_NAME]; @@ -2600,7 +2600,7 @@ static void ANIM_OT_channels_group(wmOperatorType *ot) /** \name Ungroup Channels Operator * \{ */ -static int animchannels_ungroup_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus animchannels_ungroup_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -2864,7 +2864,7 @@ static bool animchannels_delete_containers(const bContext *C, bAnimContext *ac) return has_skipped_group; } -static int animchannels_delete_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus animchannels_delete_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; ListBase anim_data = {nullptr, nullptr}; @@ -3157,7 +3157,7 @@ static void setflag_anim_channels(bAnimContext *ac, /* ------------------- */ -static int animchannels_setflag_exec(bContext *C, wmOperator *op) +static wmOperatorStatus animchannels_setflag_exec(bContext *C, wmOperator *op) { bAnimContext ac; eAnimChannel_Settings setting; @@ -3300,7 +3300,7 @@ static void ANIM_OT_channels_editable_toggle(wmOperatorType *ot) /** \name Expand Channels Operator * \{ */ -static int animchannels_expand_exec(bContext *C, wmOperator *op) +static wmOperatorStatus animchannels_expand_exec(bContext *C, wmOperator *op) { bAnimContext ac; bool onlysel = true; @@ -3349,7 +3349,7 @@ static void ANIM_OT_channels_expand(wmOperatorType *ot) /** \name Collapse Channels Operator * \{ */ -static int animchannels_collapse_exec(bContext *C, wmOperator *op) +static wmOperatorStatus animchannels_collapse_exec(bContext *C, wmOperator *op) { bAnimContext ac; bool onlysel = true; @@ -3409,7 +3409,7 @@ static void ANIM_OT_channels_collapse(wmOperatorType *ot) * 3) No drivers * \{ */ -static int animchannels_clean_empty_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus animchannels_clean_empty_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -3533,7 +3533,7 @@ static bool animchannels_enable_poll(bContext *C) return true; } -static int animchannels_enable_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus animchannels_enable_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -3609,9 +3609,9 @@ static bool animchannels_select_filter_poll(bContext *C) return ELEM(area->spacetype, SPACE_ACTION, SPACE_GRAPH, SPACE_NLA); } -static int animchannels_select_filter_invoke(bContext *C, - wmOperator *op, - const wmEvent * /*event*/) +static wmOperatorStatus animchannels_select_filter_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { ScrArea *area = CTX_wm_area(C); ARegion *region_ctx = CTX_wm_region(C); @@ -3634,9 +3634,9 @@ static int animchannels_select_filter_invoke(bContext *C, return OPERATOR_RUNNING_MODAL; } -static int animchannels_select_filter_modal(bContext *C, - wmOperator * /*op*/, - const wmEvent * /*event*/) +static wmOperatorStatus animchannels_select_filter_modal(bContext *C, + wmOperator * /*op*/, + const wmEvent * /*event*/) { bAnimContext ac; if (ANIM_animdata_get_context(C, &ac) == 0) { @@ -3673,7 +3673,7 @@ static void ANIM_OT_channels_select_filter(wmOperatorType *ot) /** \name Select All Operator * \{ */ -static int animchannels_selectall_exec(bContext *C, wmOperator *op) +static wmOperatorStatus animchannels_selectall_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -3855,7 +3855,7 @@ static void box_select_anim_channels(bAnimContext *ac, const rcti &rect, short s ANIM_animdata_freelist(&anim_data); } -static int animchannels_box_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus animchannels_box_select_exec(bContext *C, wmOperator *op) { bAnimContext ac; rcti rect; @@ -4047,7 +4047,9 @@ static int animchannels_channel_get(bAnimContext *ac, const int mval[2]) return channel_index; } -static int animchannels_rename_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus animchannels_rename_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { bAnimContext ac; int channel_index; @@ -4755,7 +4757,9 @@ static int mouse_anim_channels(bContext *C, * \{ */ /** Handle picking logic. */ -static int animchannels_mouseclick_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus animchannels_mouseclick_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { bAnimContext ac; ARegion *region; @@ -4917,9 +4921,9 @@ static bool select_anim_channel_keys(bAnimContext *ac, int channel_index, bool e return success; } -static int animchannels_channel_select_keys_invoke(bContext *C, - wmOperator *op, - const wmEvent *event) +static wmOperatorStatus animchannels_channel_select_keys_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { bAnimContext ac; int channel_index; @@ -4979,7 +4983,7 @@ static void get_view_range(Scene *scene, const bool use_preview_range, float r_r } } -static int graphkeys_view_selected_channels_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_view_selected_channels_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -5079,7 +5083,9 @@ static void ANIM_OT_channels_view_selected(wmOperatorType *ot) "Ignore frames outside of the preview range"); } -static int graphkeys_channel_view_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus graphkeys_channel_view_pick_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { bAnimContext ac; @@ -5170,7 +5176,7 @@ static const EnumPropertyItem channel_bake_key_options[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int channels_bake_exec(bContext *C, wmOperator *op) +static wmOperatorStatus channels_bake_exec(bContext *C, wmOperator *op) { using namespace blender::animrig; bAnimContext ac; @@ -5329,7 +5335,7 @@ static void ANIM_OT_channels_bake(wmOperatorType *ot) "Bake Modifiers into keyframes and delete them after"); } -static int slot_channels_move_to_new_action_exec(bContext *C, wmOperator * /* op */) +static wmOperatorStatus slot_channels_move_to_new_action_exec(bContext *C, wmOperator * /* op */) { using namespace blender::animrig; bAnimContext ac; @@ -5424,7 +5430,7 @@ static void ANIM_OT_slot_channels_move_to_new_action(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int separate_slots_exec(bContext *C, wmOperator *op) +static wmOperatorStatus separate_slots_exec(bContext *C, wmOperator *op) { using namespace blender::animrig; Object *active_object = CTX_data_active_object(C); @@ -5692,7 +5698,7 @@ static rctf calculate_selection_fcurve_bounds(bAnimContext *ac, return bounds; } -static int view_curve_in_graph_editor_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_curve_in_graph_editor_exec(bContext *C, wmOperator *op) { PointerRNA button_ptr = {}; PropertyRNA *button_prop = nullptr; @@ -5704,7 +5710,7 @@ static int view_curve_in_graph_editor_exec(bContext *C, wmOperator *op) return (OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH); } - int retval = OPERATOR_FINISHED; + wmOperatorStatus retval = OPERATOR_FINISHED; blender::Vector selection; diff --git a/source/blender/editors/animation/anim_markers.cc b/source/blender/editors/animation/anim_markers.cc index 98af99b5c96..8765b67b511 100644 --- a/source/blender/editors/animation/anim_markers.cc +++ b/source/blender/editors/animation/anim_markers.cc @@ -740,7 +740,7 @@ static bool ed_markers_poll_markers_exist(bContext *C) * \{ */ /* add TimeMarker at current frame */ -static int ed_marker_add_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus ed_marker_add_exec(bContext *C, wmOperator * /*op*/) { ListBase *markers = ED_context_get_markers(C); TimeMarker *marker; @@ -951,7 +951,7 @@ static void ed_marker_move_exit(bContext *C, wmOperator *op) ED_area_status_text(CTX_wm_area(C), nullptr); } -static int ed_marker_move_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus ed_marker_move_invoke(bContext *C, wmOperator *op, const wmEvent *event) { const bool tweak = RNA_struct_find_property(op->ptr, "tweak") && RNA_boolean_get(op->ptr, "tweak"); @@ -1031,7 +1031,7 @@ static void ed_marker_move_cancel(bContext *C, wmOperator *op) ed_marker_move_exit(C, op); } -static int ed_marker_move_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus ed_marker_move_modal(bContext *C, wmOperator *op, const wmEvent *event) { Scene *scene = CTX_data_scene(C); MarkerMove *mm = static_cast(op->customdata); @@ -1123,7 +1123,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, const wmEvent *even return OPERATOR_RUNNING_MODAL; } -static int ed_marker_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus ed_marker_move_exec(bContext *C, wmOperator *op) { if (ed_marker_move_init(C, op)) { ed_marker_move_apply(C, op); @@ -1217,7 +1217,7 @@ static void ed_marker_duplicate_apply(bContext *C) } } -static int ed_marker_duplicate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus ed_marker_duplicate_exec(bContext *C, wmOperator *op) { ed_marker_duplicate_apply(C); ed_marker_move_exec(C, op); /* Assumes frame delta set. */ @@ -1225,7 +1225,9 @@ static int ed_marker_duplicate_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int ed_marker_duplicate_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus ed_marker_duplicate_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { ed_marker_duplicate_apply(C); return ed_marker_move_invoke(C, op, event); @@ -1313,12 +1315,12 @@ static void select_marker_camera_switch( #endif } -static int ed_marker_select(bContext *C, - const int mval[2], - bool extend, - bool deselect_all, - bool camera, - bool wait_to_deselect_others) +static wmOperatorStatus ed_marker_select(bContext *C, + const int mval[2], + bool extend, + bool deselect_all, + bool camera, + bool wait_to_deselect_others) { /* NOTE: keep this functionality in sync with #ACTION_OT_clickselect. * The logic here closely matches its internals. @@ -1330,7 +1332,7 @@ static int ed_marker_select(bContext *C, ListBase *markers = ED_context_get_markers(C); const View2D *v2d = UI_view2d_fromcontext(C); - int ret_val = OPERATOR_FINISHED; + wmOperatorStatus ret_val = OPERATOR_FINISHED; TimeMarker *nearest_marker = region_position_is_over_marker(v2d, markers, mval[0]); const float frame_at_mouse_position = UI_view2d_region_to_view_x(v2d, mval[0]); const int cfra = ED_markers_find_nearest_marker_time(markers, frame_at_mouse_position); @@ -1397,7 +1399,7 @@ static int ed_marker_select(bContext *C, return ret_val; } -static int ed_marker_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus ed_marker_select_exec(bContext *C, wmOperator *op) { const bool extend = RNA_boolean_get(op->ptr, "extend"); const bool wait_to_deselect_others = RNA_boolean_get(op->ptr, "wait_to_deselect_others"); @@ -1419,7 +1421,8 @@ static int ed_marker_select_exec(bContext *C, wmOperator *op) mval[1] = RNA_int_get(op->ptr, "mouse_y"); bool deselect_all = true; - int ret_value = ed_marker_select(C, mval, extend, deselect_all, camera, wait_to_deselect_others); + wmOperatorStatus ret_value = ed_marker_select( + C, mval, extend, deselect_all, camera, wait_to_deselect_others); return ret_value | OPERATOR_PASS_THROUGH; } @@ -1476,7 +1479,9 @@ static void MARKER_OT_select(wmOperatorType *ot) * poll() has to be filled in by user for context */ -static int ed_marker_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus ed_marker_box_select_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); View2D *v2d = ®ion->v2d; @@ -1493,7 +1498,7 @@ static int ed_marker_box_select_invoke(bContext *C, wmOperator *op, const wmEven return WM_gesture_box_invoke(C, op, event); } -static int ed_marker_box_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus ed_marker_box_select_exec(bContext *C, wmOperator *op) { View2D *v2d = UI_view2d_fromcontext(C); ListBase *markers = ED_context_get_markers(C); @@ -1557,7 +1562,7 @@ static void MARKER_OT_select_box(wmOperatorType *ot) /** \name (de)select all * \{ */ -static int ed_marker_select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus ed_marker_select_all_exec(bContext *C, wmOperator *op) { ListBase *markers = ED_context_get_markers(C); if (markers == nullptr) { @@ -1632,7 +1637,7 @@ static void ED_markers_select_leftright(bAnimContext *ac, } } -static int ed_marker_select_leftright_exec(bContext *C, wmOperator *op) +static wmOperatorStatus ed_marker_select_leftright_exec(bContext *C, wmOperator *op) { const eMarkers_LeftRightSelect_Mode mode = eMarkers_LeftRightSelect_Mode( RNA_enum_get(op->ptr, "mode")); @@ -1678,7 +1683,7 @@ static void MARKER_OT_select_leftright(wmOperatorType *ot) * Remove selected time-markers. * \{ */ -static int ed_marker_delete_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus ed_marker_delete_exec(bContext *C, wmOperator * /*op*/) { ListBase *markers = ED_context_get_markers(C); @@ -1709,7 +1714,9 @@ static int ed_marker_delete_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -static int ed_marker_delete_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus ed_marker_delete_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (RNA_boolean_get(op->ptr, "confirm")) { return WM_operator_confirm_ex(C, @@ -1748,7 +1755,7 @@ static void MARKER_OT_delete(wmOperatorType *ot) * Rename first selected time-marker. * \{ */ -static int ed_marker_rename_exec(bContext *C, wmOperator *op) +static wmOperatorStatus ed_marker_rename_exec(bContext *C, wmOperator *op) { TimeMarker *marker = ED_markers_get_first_selected(ED_context_get_markers(C)); @@ -1764,7 +1771,7 @@ static int ed_marker_rename_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int ed_marker_rename_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus ed_marker_rename_invoke(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)); @@ -1809,7 +1816,7 @@ static void MARKER_OT_rename(wmOperatorType *ot) /** \name Make Links to Scene * \{ */ -static int ed_marker_make_links_scene_exec(bContext *C, wmOperator *op) +static wmOperatorStatus ed_marker_make_links_scene_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); ListBase *markers = ED_context_get_markers(C); @@ -1877,7 +1884,7 @@ static void MARKER_OT_make_links_scene(wmOperatorType *ot) #ifdef DURIAN_CAMERA_SWITCH -static int ed_marker_camera_bind_exec(bContext *C, wmOperator *op) +static wmOperatorStatus ed_marker_camera_bind_exec(bContext *C, wmOperator *op) { bScreen *screen = CTX_wm_screen(C); Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/animation/anim_ops.cc b/source/blender/editors/animation/anim_ops.cc index 5186fe548d1..a03d5b620f4 100644 --- a/source/blender/editors/animation/anim_ops.cc +++ b/source/blender/editors/animation/anim_ops.cc @@ -179,7 +179,7 @@ static void change_frame_apply(bContext *C, wmOperator *op, const bool always_up /* ---- */ /* Non-modal callback for running operator without user input */ -static int change_frame_exec(bContext *C, wmOperator *op) +static wmOperatorStatus change_frame_exec(bContext *C, wmOperator *op) { change_frame_apply(C, op, true); @@ -259,7 +259,7 @@ static bool sequencer_skip_for_handle_tweak(const bContext *C, const wmEvent *ev } /* Modal Operator init */ -static int change_frame_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus change_frame_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bScreen *screen = CTX_wm_screen(C); @@ -330,9 +330,9 @@ static void change_frame_cancel(bContext *C, wmOperator *op) } /* Modal event handling of frame changing */ -static int change_frame_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus change_frame_modal(bContext *C, wmOperator *op, const wmEvent *event) { - int ret = OPERATOR_RUNNING_MODAL; + wmOperatorStatus ret = OPERATOR_RUNNING_MODAL; /* execute the events */ switch (event->type) { case EVT_ESCKEY: @@ -461,7 +461,7 @@ static bool anim_set_end_frames_poll(bContext *C) return false; } -static int anim_set_sfra_exec(bContext *C, wmOperator *op) +static wmOperatorStatus anim_set_sfra_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); int frame; @@ -516,7 +516,7 @@ static void ANIM_OT_start_frame_set(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int anim_set_efra_exec(bContext *C, wmOperator *op) +static wmOperatorStatus anim_set_efra_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); int frame; @@ -577,7 +577,7 @@ static void ANIM_OT_end_frame_set(wmOperatorType *ot) /** \name Set Preview Range Operator * \{ */ -static int previewrange_define_exec(bContext *C, wmOperator *op) +static wmOperatorStatus previewrange_define_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ARegion *region = CTX_wm_region(C); @@ -641,7 +641,7 @@ static void ANIM_OT_previewrange_set(wmOperatorType *ot) /** \name Clear Preview Range Operator * \{ */ -static int previewrange_clear_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus previewrange_clear_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ScrArea *curarea = CTX_wm_area(C); @@ -687,7 +687,7 @@ static void ANIM_OT_previewrange_clear(wmOperatorType *ot) * \{ */ #ifndef NDEBUG -static int debug_channel_list_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus debug_channel_list_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; if (ANIM_animdata_get_context(C, &ac) == 0) { @@ -736,7 +736,7 @@ static void ANIM_OT_debug_channel_list(wmOperatorType *ot) /** \name Frame Scene/Preview Range Operator * \{ */ -static int scene_range_frame_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus scene_range_frame_exec(bContext *C, wmOperator * /*op*/) { ARegion *region = CTX_wm_region(C); const Scene *scene = CTX_data_scene(C); @@ -775,7 +775,7 @@ static void ANIM_OT_scene_range_frame(wmOperatorType *ot) /** \name Conversion * \{ */ -static int convert_action_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus convert_action_exec(bContext *C, wmOperator * /*op*/) { using namespace blender; @@ -863,7 +863,7 @@ static bool merge_actions_selection_poll(bContext *C) return true; } -static int merge_actions_selection_exec(bContext *C, wmOperator *op) +static wmOperatorStatus merge_actions_selection_exec(bContext *C, wmOperator *op) { using namespace blender::animrig; Object *active_object = CTX_data_active_object(C); diff --git a/source/blender/editors/animation/drivers.cc b/source/blender/editors/animation/drivers.cc index 00405df5994..953a1a58a4a 100644 --- a/source/blender/editors/animation/drivers.cc +++ b/source/blender/editors/animation/drivers.cc @@ -926,7 +926,7 @@ static bool add_driver_button_poll(bContext *C) /* Wrapper for creating a driver without knowing what the targets will be yet * (i.e. "manual/add later"). */ -static int add_driver_button_none(bContext *C, wmOperator *op, short mapping_type) +static wmOperatorStatus add_driver_button_none(bContext *C, wmOperator *op, short mapping_type) { PointerRNA ptr = {}; PropertyRNA *prop = nullptr; @@ -959,7 +959,7 @@ static int add_driver_button_none(bContext *C, wmOperator *op, short mapping_typ return OPERATOR_CANCELLED; } -static int add_driver_button_menu_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_driver_button_menu_exec(bContext *C, wmOperator *op) { short mapping_type = RNA_enum_get(op->ptr, "mapping_type"); if (ELEM(mapping_type, CREATEDRIVER_MAPPING_NONE, CREATEDRIVER_MAPPING_NONE_ALL)) { @@ -978,7 +978,9 @@ static int add_driver_button_menu_exec(bContext *C, wmOperator *op) } /* Show menu or create drivers */ -static int add_driver_button_menu_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus add_driver_button_menu_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { PropertyRNA *prop; @@ -1022,7 +1024,9 @@ static void UNUSED_FUNCTION(ANIM_OT_driver_button_add_menu)(wmOperatorType *ot) /* Add Driver Button Operator ------------------------ */ -static int add_driver_button_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus add_driver_button_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { PointerRNA ptr = {}; PropertyRNA *prop = nullptr; @@ -1075,7 +1079,7 @@ void ANIM_OT_driver_button_add(wmOperatorType *ot) /* Remove Driver Button Operator ------------------------ */ -static int remove_driver_button_exec(bContext *C, wmOperator *op) +static wmOperatorStatus remove_driver_button_exec(bContext *C, wmOperator *op) { PointerRNA ptr = {}; PropertyRNA *prop = nullptr; @@ -1126,7 +1130,7 @@ void ANIM_OT_driver_button_remove(wmOperatorType *ot) /* Edit Driver Button Operator ------------------------ */ -static int edit_driver_button_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edit_driver_button_exec(bContext *C, wmOperator *op) { PointerRNA ptr = {}; PropertyRNA *prop = nullptr; @@ -1159,7 +1163,7 @@ void ANIM_OT_driver_button_edit(wmOperatorType *ot) /* Copy Driver Button Operator ------------------------ */ -static int copy_driver_button_exec(bContext *C, wmOperator *op) +static wmOperatorStatus copy_driver_button_exec(bContext *C, wmOperator *op) { PointerRNA ptr = {}; PropertyRNA *prop = nullptr; @@ -1198,7 +1202,7 @@ void ANIM_OT_copy_driver_button(wmOperatorType *ot) /* Paste Driver Button Operator ------------------------ */ -static int paste_driver_button_exec(bContext *C, wmOperator *op) +static wmOperatorStatus paste_driver_button_exec(bContext *C, wmOperator *op) { PointerRNA ptr = {}; PropertyRNA *prop = nullptr; diff --git a/source/blender/editors/animation/keyframing.cc b/source/blender/editors/animation/keyframing.cc index d57e579e351..e4cd1ac3ce0 100644 --- a/source/blender/editors/animation/keyframing.cc +++ b/source/blender/editors/animation/keyframing.cc @@ -69,7 +69,7 @@ static KeyingSet *keyingset_get_from_op_with_error(wmOperator *op, PropertyRNA *prop, Scene *scene); -static int delete_key_using_keying_set(bContext *C, wmOperator *op, KeyingSet *ks); +static wmOperatorStatus delete_key_using_keying_set(bContext *C, wmOperator *op, KeyingSet *ks); /* ******************************************* */ /* Animation Data Validation */ @@ -164,7 +164,7 @@ static bool modify_key_op_poll(bContext *C) /* Insert Key Operator ------------------------ */ -static int insert_key_with_keyingset(bContext *C, wmOperator *op, KeyingSet *ks) +static wmOperatorStatus insert_key_with_keyingset(bContext *C, wmOperator *op, KeyingSet *ks) { Scene *scene = CTX_data_scene(C); Object *obedit = CTX_data_edit_object(C); @@ -299,7 +299,7 @@ static bool get_selection(bContext *C, blender::Vector *r_selection) return true; } -static int insert_key(bContext *C, wmOperator *op) +static wmOperatorStatus insert_key(bContext *C, wmOperator *op) { using namespace blender; @@ -368,7 +368,7 @@ static int insert_key(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int insert_key_exec(bContext *C, wmOperator *op) +static wmOperatorStatus insert_key_exec(bContext *C, wmOperator *op) { ANIM_deselect_keys_in_animation_editors(C); @@ -382,7 +382,7 @@ static int insert_key_exec(bContext *C, wmOperator *op) return insert_key(C, op); } -static int insert_key_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus insert_key_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { /* The depsgraph needs to be in an evaluated state to ensure the values we get from the * properties are actually the values of the current frame. However we cannot do that in the exec @@ -417,7 +417,7 @@ void ANIM_OT_keyframe_insert(wmOperatorType *ot) ot->prop = prop; } -static int keyframe_insert_with_keyingset_exec(bContext *C, wmOperator *op) +static wmOperatorStatus keyframe_insert_with_keyingset_exec(bContext *C, wmOperator *op) { ANIM_deselect_keys_in_animation_editors(C); @@ -459,7 +459,9 @@ void ANIM_OT_keyframe_insert_by_name(wmOperatorType *ot) * then calls the menu if necessary before */ -static int insert_key_menu_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus insert_key_menu_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Scene *scene = CTX_data_scene(C); @@ -552,7 +554,7 @@ void ANIM_OT_keyframe_insert_menu(wmOperatorType *ot) /* Delete Key Operator ------------------------ */ -static int delete_key_exec(bContext *C, wmOperator *op) +static wmOperatorStatus delete_key_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); KeyingSet *ks = keyingset_get_from_op_with_error(op, op->type->prop, scene); @@ -563,7 +565,7 @@ static int delete_key_exec(bContext *C, wmOperator *op) return delete_key_using_keying_set(C, op, ks); } -static int delete_key_using_keying_set(bContext *C, wmOperator *op, KeyingSet *ks) +static wmOperatorStatus delete_key_using_keying_set(bContext *C, wmOperator *op, KeyingSet *ks) { Scene *scene = CTX_data_scene(C); float cfra = BKE_scene_frame_get(scene); @@ -689,7 +691,7 @@ static bool can_delete_fcurve(FCurve *fcu, Object *ob) return can_delete; } -static int clear_anim_v3d_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus clear_anim_v3d_exec(bContext *C, wmOperator * /*op*/) { using namespace blender::animrig; bool changed = false; @@ -743,7 +745,9 @@ static int clear_anim_v3d_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -static int clear_anim_v3d_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus clear_anim_v3d_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (RNA_boolean_get(op->ptr, "confirm")) { return WM_operator_confirm_ex(C, @@ -827,7 +831,7 @@ static bool can_delete_key(FCurve *fcu, Object *ob, ReportList *reports) return true; } -static int delete_key_v3d_without_keying_set(bContext *C, wmOperator *op) +static wmOperatorStatus delete_key_v3d_without_keying_set(bContext *C, wmOperator *op) { using namespace blender::animrig; Scene *scene = CTX_data_scene(C); @@ -922,7 +926,7 @@ static int delete_key_v3d_without_keying_set(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int delete_key_v3d_exec(bContext *C, wmOperator *op) +static wmOperatorStatus delete_key_v3d_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); KeyingSet *ks = blender::animrig::scene_get_active_keyingset(scene); @@ -934,7 +938,9 @@ static int delete_key_v3d_exec(bContext *C, wmOperator *op) return delete_key_using_keying_set(C, op, ks); } -static int delete_key_v3d_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus delete_key_v3d_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (RNA_boolean_get(op->ptr, "confirm")) { return WM_operator_confirm_ex(C, @@ -968,7 +974,7 @@ void ANIM_OT_keyframe_delete_v3d(wmOperatorType *ot) /* Insert Key Button Operator ------------------------ */ -static int insert_key_button_exec(bContext *C, wmOperator *op) +static wmOperatorStatus insert_key_button_exec(bContext *C, wmOperator *op) { using namespace blender::animrig; Main *bmain = CTX_data_main(C); @@ -1126,7 +1132,7 @@ void ANIM_OT_keyframe_insert_button(wmOperatorType *ot) /* Delete Key Button Operator ------------------------ */ -static int delete_key_button_exec(bContext *C, wmOperator *op) +static wmOperatorStatus delete_key_button_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); PointerRNA ptr = {}; @@ -1233,7 +1239,7 @@ void ANIM_OT_keyframe_delete_button(wmOperatorType *ot) /* Clear Key Button Operator ------------------------ */ -static int clear_key_button_exec(bContext *C, wmOperator *op) +static wmOperatorStatus clear_key_button_exec(bContext *C, wmOperator *op) { PointerRNA ptr = {}; PropertyRNA *prop = nullptr; diff --git a/source/blender/editors/animation/keyingsets.cc b/source/blender/editors/animation/keyingsets.cc index 86d93fcc3f8..c9473f051b5 100644 --- a/source/blender/editors/animation/keyingsets.cc +++ b/source/blender/editors/animation/keyingsets.cc @@ -87,7 +87,7 @@ static bool keyingset_poll_activePath_edit(bContext *C) /* Add a Default (Empty) Keying Set ------------------------- */ -static int add_default_keyingset_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus add_default_keyingset_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); @@ -122,7 +122,7 @@ void ANIM_OT_keying_set_add(wmOperatorType *ot) /* Remove 'Active' Keying Set ------------------------- */ -static int remove_active_keyingset_exec(bContext *C, wmOperator *op) +static wmOperatorStatus remove_active_keyingset_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); @@ -169,7 +169,7 @@ void ANIM_OT_keying_set_remove(wmOperatorType *ot) /* Add Empty Keying Set Path ------------------------- */ -static int add_empty_ks_path_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_empty_ks_path_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); @@ -212,7 +212,7 @@ void ANIM_OT_keying_set_path_add(wmOperatorType *ot) /* Remove Active Keying Set Path ------------------------- */ -static int remove_active_ks_path_exec(bContext *C, wmOperator *op) +static wmOperatorStatus remove_active_ks_path_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); KeyingSet *keyingset = static_cast( @@ -257,7 +257,7 @@ void ANIM_OT_keying_set_path_remove(wmOperatorType *ot) /* Add to KeyingSet Button Operator ------------------------ */ -static int add_keyingset_button_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_keyingset_button_exec(bContext *C, wmOperator *op) { PropertyRNA *prop = nullptr; PointerRNA ptr = {}; @@ -350,7 +350,7 @@ void ANIM_OT_keyingset_button_add(wmOperatorType *ot) /* Remove from KeyingSet Button Operator ------------------------ */ -static int remove_keyingset_button_exec(bContext *C, wmOperator *op) +static wmOperatorStatus remove_keyingset_button_exec(bContext *C, wmOperator *op) { PropertyRNA *prop = nullptr; PointerRNA ptr = {}; @@ -424,7 +424,9 @@ void ANIM_OT_keyingset_button_remove(wmOperatorType *ot) /* 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, const wmEvent * /*event*/) +static wmOperatorStatus keyingset_active_menu_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { uiPopupMenu *pup; uiLayout *layout; @@ -438,7 +440,7 @@ static int keyingset_active_menu_invoke(bContext *C, wmOperator *op, const wmEve return OPERATOR_INTERFACE; } -static int keyingset_active_menu_exec(bContext *C, wmOperator *op) +static wmOperatorStatus keyingset_active_menu_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); const int type = RNA_enum_get(op->ptr, "type"); diff --git a/source/blender/editors/armature/armature_add.cc b/source/blender/editors/armature/armature_add.cc index 3e7a69d5ec4..39400bc0b2c 100644 --- a/source/blender/editors/armature/armature_add.cc +++ b/source/blender/editors/armature/armature_add.cc @@ -132,7 +132,7 @@ EditBone *ED_armature_ebone_add_primitive(Object *obedit_arm, * If we want the support to be expanded we should something like the * offset we do for mesh click extrude. */ -static int armature_click_extrude_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus armature_click_extrude_exec(bContext *C, wmOperator * /*op*/) { bArmature *arm; EditBone *ebone, *newbone, *flipbone; @@ -228,7 +228,9 @@ static int armature_click_extrude_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -static int armature_click_extrude_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus 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 */ @@ -252,7 +254,7 @@ static int armature_click_extrude_invoke(bContext *C, wmOperator *op, const wmEv copy_v3_v3(cursor->location, tvec); /* extrude to the where new cursor is and store the operation result */ - int retval = armature_click_extrude_exec(C, op); + wmOperatorStatus retval = armature_click_extrude_exec(C, op); /* restore previous 3d cursor position */ copy_v3_v3(cursor->location, oldcurs); @@ -1098,7 +1100,7 @@ EditBone *duplicateEditBone(EditBone *cur_bone, const char *name, ListBase *edit return duplicateEditBoneObjects(cur_bone, name, editbones, ob, ob); } -static int armature_duplicate_selected_exec(bContext *C, wmOperator *op) +static wmOperatorStatus armature_duplicate_selected_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1272,7 +1274,7 @@ static EditBone *get_symmetrized_bone(bArmature *arm, EditBone *bone) * near duplicate of #armature_duplicate_selected_exec, * except for parenting part (keep in sync) */ -static int armature_symmetrize_exec(bContext *C, wmOperator *op) +static wmOperatorStatus armature_symmetrize_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1543,7 +1545,7 @@ void ARMATURE_OT_symmetrize(wmOperatorType *ot) /* previously extrude_armature */ /* context; editmode armature */ /* if forked && mirror-edit: makes two bones with flipped names */ -static int armature_extrude_exec(bContext *C, wmOperator *op) +static wmOperatorStatus armature_extrude_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1757,7 +1759,7 @@ void ARMATURE_OT_extrude(wmOperatorType *ot) /* Op makes a new bone and returns it with its tip selected. */ -static int armature_bone_primitive_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus armature_bone_primitive_add_exec(bContext *C, wmOperator *op) { RegionView3D *rv3d = CTX_wm_region_view3d(C); Object *obedit = CTX_data_edit_object(C); @@ -1843,7 +1845,7 @@ void ARMATURE_OT_bone_primitive_add(wmOperatorType *ot) * appropriate ways), and two separate ones. */ -static int armature_subdivide_exec(bContext *C, wmOperator *op) +static wmOperatorStatus armature_subdivide_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); EditBone *newbone; diff --git a/source/blender/editors/armature/armature_edit.cc b/source/blender/editors/armature/armature_edit.cc index 2841c2623cb..9b7513fe3a3 100644 --- a/source/blender/editors/armature/armature_edit.cc +++ b/source/blender/editors/armature/armature_edit.cc @@ -276,7 +276,7 @@ static const EnumPropertyItem prop_calc_roll_types[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int armature_calc_roll_exec(bContext *C, wmOperator *op) +static wmOperatorStatus armature_calc_roll_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -482,7 +482,7 @@ void ARMATURE_OT_calculate_roll(wmOperatorType *ot) "Ignore the axis direction, use the shortest rotation to align"); } -static int armature_roll_clear_exec(bContext *C, wmOperator *op) +static wmOperatorStatus armature_roll_clear_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -679,7 +679,7 @@ static void fill_add_joint(EditBone *ebo, short eb_tail, ListBase *points) } /* bone adding between selected joints */ -static int armature_fill_bones_exec(bContext *C, wmOperator *op) +static wmOperatorStatus armature_fill_bones_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); @@ -899,7 +899,7 @@ static void armature_clear_swap_done_flags(bArmature *arm) } } -static int armature_switch_direction_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus armature_switch_direction_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1068,7 +1068,7 @@ static void bone_align_to_bone(ListBase *edbo, EditBone *selbone, EditBone *actb fix_editbone_connected_children(edbo, selbone); } -static int armature_align_bones_exec(bContext *C, wmOperator *op) +static wmOperatorStatus armature_align_bones_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_edit_object(C); bArmature *arm = static_cast(ob->data); @@ -1168,7 +1168,7 @@ void ARMATURE_OT_align(wmOperatorType *ot) /** \name Split Operator * \{ */ -static int armature_split_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus armature_split_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1227,7 +1227,7 @@ static bool armature_delete_ebone_cb(const char *bone_name, void *arm_p) /* previously delete_armature */ /* only editmode! */ -static int armature_delete_selected_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus armature_delete_selected_exec(bContext *C, wmOperator * /*op*/) { EditBone *curBone, *ebone_next; bool changed_multi = false; @@ -1280,7 +1280,9 @@ static int armature_delete_selected_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -static int armature_delete_selected_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus armature_delete_selected_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (RNA_boolean_get(op->ptr, "confirm")) { return WM_operator_confirm_ex(C, @@ -1320,7 +1322,7 @@ static bool armature_dissolve_ebone_cb(const char *bone_name, void *arm_p) return (ebone && (ebone->flag & BONE_DONE)); } -static int armature_dissolve_selected_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus armature_dissolve_selected_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1491,7 +1493,7 @@ void ARMATURE_OT_dissolve(wmOperatorType *ot) /** \name Hide Operator * \{ */ -static int armature_hide_exec(bContext *C, wmOperator *op) +static wmOperatorStatus armature_hide_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1554,7 +1556,7 @@ void ARMATURE_OT_hide(wmOperatorType *ot) /** \name Reveal Operator * \{ */ -static int armature_reveal_exec(bContext *C, wmOperator *op) +static wmOperatorStatus armature_reveal_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); diff --git a/source/blender/editors/armature/armature_naming.cc b/source/blender/editors/armature/armature_naming.cc index 760ebcf68c7..98436f4a31b 100644 --- a/source/blender/editors/armature/armature_naming.cc +++ b/source/blender/editors/armature/armature_naming.cc @@ -432,7 +432,7 @@ void ED_armature_bones_flip_names(Main *bmain, /** \name Flip Bone Names (Edit Mode Operator) * \{ */ -static int armature_flip_names_exec(bContext *C, wmOperator *op) +static wmOperatorStatus armature_flip_names_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); const Scene *scene = CTX_data_scene(C); @@ -518,7 +518,7 @@ void ARMATURE_OT_flip_names(wmOperatorType *ot) /** \name Bone Auto Side Names (Edit Mode Operator) * \{ */ -static int armature_autoside_names_exec(bContext *C, wmOperator *op) +static wmOperatorStatus armature_autoside_names_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); diff --git a/source/blender/editors/armature/armature_relations.cc b/source/blender/editors/armature/armature_relations.cc index ffa07af98ae..28949cb4781 100644 --- a/source/blender/editors/armature/armature_relations.cc +++ b/source/blender/editors/armature/armature_relations.cc @@ -295,7 +295,7 @@ static BoneCollection *join_armature_remap_collection( return new_bcoll; } -int ED_armature_join_objects_exec(bContext *C, wmOperator *op) +wmOperatorStatus ED_armature_join_objects_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -663,7 +663,7 @@ static void separate_armature_bones(Main *bmain, Object *ob, const bool is_selec } /* separate selected bones into their armature */ -static int separate_armature_exec(bContext *C, wmOperator *op) +static wmOperatorStatus separate_armature_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -858,7 +858,7 @@ static const EnumPropertyItem prop_editarm_make_parent_types[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int armature_parent_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus armature_parent_set_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_edit_object(C); bArmature *arm = static_cast(ob->data); @@ -947,7 +947,9 @@ static int armature_parent_set_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int armature_parent_set_invoke(bContext *C, wmOperator * /*op*/, const wmEvent * /*event*/) +static wmOperatorStatus armature_parent_set_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent * /*event*/) { /* False when all selected bones are parented to the active bone. */ bool enable_offset = false; @@ -1033,7 +1035,7 @@ static void editbone_clear_parent(EditBone *ebone, int mode) ebone->flag &= ~BONE_CONNECTED; } -static int armature_parent_clear_exec(bContext *C, wmOperator *op) +static wmOperatorStatus armature_parent_clear_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1069,9 +1071,9 @@ static int armature_parent_clear_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int armature_parent_clear_invoke(bContext *C, - wmOperator * /*op*/, - const wmEvent * /*event*/) +static wmOperatorStatus armature_parent_clear_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent * /*event*/) { /* False when no selected bones are connected to the active bone. */ bool enable_disconnect = false; diff --git a/source/blender/editors/armature/armature_select.cc b/source/blender/editors/armature/armature_select.cc index fbb1e8a62cc..6d351e6cb75 100644 --- a/source/blender/editors/armature/armature_select.cc +++ b/source/blender/editors/armature/armature_select.cc @@ -490,7 +490,7 @@ static bool armature_select_linked_impl(Object *ob, const bool select, const boo /** \name Select Linked Operator * \{ */ -static int armature_select_linked_exec(bContext *C, wmOperator *op) +static wmOperatorStatus armature_select_linked_exec(bContext *C, wmOperator *op) { const bool all_forks = RNA_boolean_get(op->ptr, "all_forks"); @@ -552,7 +552,9 @@ void ARMATURE_OT_select_linked(wmOperatorType *ot) /** \name Select Linked (Cursor Pick) Operator * \{ */ -static int armature_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus armature_select_linked_pick_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { const bool select = !RNA_boolean_get(op->ptr, "deselect"); const bool all_forks = RNA_boolean_get(op->ptr, "all_forks"); @@ -1321,7 +1323,7 @@ bool ED_armature_edit_select_op_from_tagged(bArmature *arm, const int sel_op) /** \name (De)Select All Operator * \{ */ -static int armature_de_select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus armature_de_select_all_exec(bContext *C, wmOperator *op) { int action = RNA_enum_get(op->ptr, "action"); @@ -1494,7 +1496,7 @@ static void armature_select_more_less(Object *ob, bool more) /** \name Select More Operator * \{ */ -static int armature_de_select_more_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus armature_de_select_more_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1531,7 +1533,7 @@ void ARMATURE_OT_select_more(wmOperatorType *ot) /** \name Select Less Operator * \{ */ -static int armature_de_select_less_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus armature_de_select_less_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1945,7 +1947,7 @@ static void select_similar_siblings(bContext *C) DEG_id_tag_update(&obedit->id, ID_RECALC_SYNC_TO_EVAL); } -static int armature_select_similar_exec(bContext *C, wmOperator *op) +static wmOperatorStatus armature_select_similar_exec(bContext *C, wmOperator *op) { /* Get props */ int type = RNA_enum_get(op->ptr, "type"); @@ -2028,7 +2030,7 @@ void ARMATURE_OT_select_similar(wmOperatorType *ot) /* No need to convert to multi-objects. Just like we keep the non-active bones * selected we then keep the non-active objects untouched (selected/unselected). */ -static int armature_select_hierarchy_exec(bContext *C, wmOperator *op) +static wmOperatorStatus armature_select_hierarchy_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_edit_object(C); EditBone *ebone_active; @@ -2139,7 +2141,7 @@ void ARMATURE_OT_select_hierarchy(wmOperatorType *ot) /** * \note clone of #pose_select_mirror_exec keep in sync */ -static int armature_select_mirror_exec(bContext *C, wmOperator *op) +static wmOperatorStatus armature_select_mirror_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -2252,7 +2254,9 @@ static bool armature_shortest_path_select( return true; } -static int armature_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus armature_shortest_path_pick_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Object *obedit = CTX_data_edit_object(C); bArmature *arm = static_cast(obedit->data); diff --git a/source/blender/editors/armature/bone_collections.cc b/source/blender/editors/armature/bone_collections.cc index e9a2f7d32af..2c3096d0e36 100644 --- a/source/blender/editors/armature/bone_collections.cc +++ b/source/blender/editors/armature/bone_collections.cc @@ -99,7 +99,7 @@ static bool active_bone_collection_poll(bContext *C) return true; } -static int bone_collection_add_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus bone_collection_add_exec(bContext *C, wmOperator * /*op*/) { using namespace blender::animrig; @@ -139,7 +139,7 @@ void ARMATURE_OT_collection_add(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int bone_collection_remove_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus bone_collection_remove_exec(bContext *C, wmOperator * /*op*/) { /* The poll function ensures armature->active_collection is not NULL. */ bArmature *armature = ED_armature_context(C); @@ -167,7 +167,7 @@ void ARMATURE_OT_collection_remove(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int bone_collection_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus bone_collection_move_exec(bContext *C, wmOperator *op) { const int direction = RNA_enum_get(op->ptr, "direction"); @@ -401,7 +401,7 @@ static bool bone_collection_assign_poll(bContext *C) } /* Assign selected pchans to the bone collection that the user selects */ -static int bone_collection_assign_exec(bContext *C, wmOperator *op) +static wmOperatorStatus bone_collection_assign_exec(bContext *C, wmOperator *op) { Object *ob = blender::ed::object::context_object(C); if (ob == nullptr) { @@ -500,7 +500,7 @@ static bool bone_collection_create_and_assign_poll(bContext *C) } /* Assign selected pchans to the bone collection that the user selects */ -static int bone_collection_create_and_assign_exec(bContext *C, wmOperator *op) +static wmOperatorStatus bone_collection_create_and_assign_exec(bContext *C, wmOperator *op) { Object *ob = blender::ed::object::context_object(C); if (ob == nullptr) { @@ -567,7 +567,7 @@ void ARMATURE_OT_collection_create_and_assign(wmOperatorType *ot) "Name of the bone collection to create"); } -static int bone_collection_unassign_exec(bContext *C, wmOperator *op) +static wmOperatorStatus bone_collection_unassign_exec(bContext *C, wmOperator *op) { Object *ob = blender::ed::object::context_object(C); if (ob == nullptr) { @@ -628,7 +628,7 @@ void ARMATURE_OT_collection_unassign(wmOperatorType *ot) "the active bone collection"); } -static int bone_collection_unassign_named_exec(bContext *C, wmOperator *op) +static wmOperatorStatus bone_collection_unassign_named_exec(bContext *C, wmOperator *op) { Object *ob = blender::ed::object::context_object(C); if (ob == nullptr) { @@ -786,7 +786,7 @@ static void bone_collection_select(bContext *C, } } -static int bone_collection_select_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus bone_collection_select_exec(bContext *C, wmOperator * /*op*/) { Object *ob = blender::ed::object::context_object(C); if (ob == nullptr) { @@ -818,7 +818,7 @@ void ARMATURE_OT_collection_select(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int bone_collection_deselect_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus bone_collection_deselect_exec(bContext *C, wmOperator * /*op*/) { Object *ob = blender::ed::object::context_object(C); if (ob == nullptr) { @@ -894,10 +894,10 @@ static BoneCollection *add_or_move_to_collection_bcoll(wmOperator *op, bArmature return target_bcoll; } -static int add_or_move_to_collection_exec(bContext *C, - wmOperator *op, - const assign_bone_func assign_func_bone, - const assign_ebone_func assign_func_ebone) +static wmOperatorStatus add_or_move_to_collection_exec(bContext *C, + wmOperator *op, + const assign_bone_func assign_func_bone, + const assign_ebone_func assign_func_ebone) { Object *ob = blender::ed::object::context_object(C); if (ob->mode == OB_MODE_POSE) { @@ -945,7 +945,7 @@ static int add_or_move_to_collection_exec(bContext *C, return OPERATOR_FINISHED; } -static int move_to_collection_exec(bContext *C, wmOperator *op) +static wmOperatorStatus move_to_collection_exec(bContext *C, wmOperator *op) { return add_or_move_to_collection_exec(C, op, @@ -953,7 +953,7 @@ static int move_to_collection_exec(bContext *C, wmOperator *op) ANIM_armature_bonecoll_assign_and_move_editbone); } -static int assign_to_collection_exec(bContext *C, wmOperator *op) +static wmOperatorStatus assign_to_collection_exec(bContext *C, wmOperator *op) { return add_or_move_to_collection_exec( C, op, ANIM_armature_bonecoll_assign, ANIM_armature_bonecoll_assign_editbone); @@ -1135,7 +1135,7 @@ static void move_to_collection_menu_create(bContext *C, uiLayout *layout, void * } } -static int move_to_collection_regular_invoke(bContext *C, wmOperator *op) +static wmOperatorStatus move_to_collection_regular_invoke(bContext *C, wmOperator *op) { const char *title = CTX_IFACE_(op->type->translation_context, op->type->name); uiPopupMenu *pup = UI_popup_menu_begin(C, title, ICON_NONE); @@ -1149,14 +1149,16 @@ static int move_to_collection_regular_invoke(bContext *C, wmOperator *op) return OPERATOR_INTERFACE; } -static int move_to_new_collection_invoke(bContext *C, wmOperator *op) +static wmOperatorStatus move_to_new_collection_invoke(bContext *C, wmOperator *op) { RNA_string_set(op->ptr, "new_collection_name", IFACE_("Bones")); return WM_operator_props_dialog_popup( C, op, 200, IFACE_("Move to New Bone Collection"), IFACE_("Create")); } -static int move_to_collection_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus move_to_collection_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { /* Invoking with `collection_index` set has a special meaning: show the menu to create a new bone * collection as the child of this one. */ diff --git a/source/blender/editors/armature/pose_edit.cc b/source/blender/editors/armature/pose_edit.cc index 6572546ac9a..55a3f82e31d 100644 --- a/source/blender/editors/armature/pose_edit.cc +++ b/source/blender/editors/armature/pose_edit.cc @@ -205,7 +205,9 @@ void ED_pose_recalculate_paths(bContext *C, Scene *scene, Object *ob, ePosePathC } /* show popup to determine settings */ -static int pose_calculate_paths_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus pose_calculate_paths_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); @@ -233,7 +235,7 @@ static int pose_calculate_paths_invoke(bContext *C, wmOperator *op, const wmEven * For the object with pose/action: create path curves for selected bones * This recalculates the WHOLE path within the `pchan->pathsf` and `pchan->pathef` range. */ -static int pose_calculate_paths_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_calculate_paths_exec(bContext *C, wmOperator *op) { Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); Scene *scene = CTX_data_scene(C); @@ -328,7 +330,7 @@ static bool pose_update_paths_poll(bContext *C) return false; } -static int pose_update_paths_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_update_paths_exec(bContext *C, wmOperator *op) { Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); Scene *scene = CTX_data_scene(C); @@ -403,7 +405,7 @@ static void ED_pose_clear_paths(Object *ob, bool only_selected) } /* Operator callback - wrapper for the back-end function. */ -static int pose_clear_paths_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_clear_paths_exec(bContext *C, wmOperator *op) { Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); bool only_selected = RNA_boolean_get(op->ptr, "only_selected"); @@ -458,7 +460,7 @@ void POSE_OT_paths_clear(wmOperatorType *ot) /* --------- */ -static int pose_update_paths_range_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus pose_update_paths_range_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); @@ -495,7 +497,7 @@ void POSE_OT_paths_range_update(wmOperatorType *ot) /* ********************************************** */ -static int pose_flip_names_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_flip_names_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); const Scene *scene = CTX_data_scene(C); @@ -551,7 +553,7 @@ void POSE_OT_flip_names(wmOperatorType *ot) /* ------------------ */ -static int pose_autoside_names_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_autoside_names_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); char newname[MAXBONENAME]; @@ -610,7 +612,7 @@ void POSE_OT_autoside_names(wmOperatorType *ot) /* ********************************************** */ -static int pose_bone_rotmode_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_bone_rotmode_exec(bContext *C, wmOperator *op) { const int mode = RNA_enum_get(op->ptr, "type"); Object *prev_ob = nullptr; @@ -677,7 +679,7 @@ static int hide_pose_bone_fn(Object *ob, Bone *bone, void *ptr) } /* active object is armature in posemode, poll checked */ -static int pose_hide_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_hide_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -742,7 +744,7 @@ static int show_pose_bone_cb(Object *ob, Bone *bone, void *data) } /* active object is armature in posemode, poll checked */ -static int pose_reveal_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_reveal_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -787,7 +789,7 @@ void POSE_OT_reveal(wmOperatorType *ot) /** \name Flip Quaternions * \{ */ -static int pose_flip_quats_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus pose_flip_quats_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/armature/pose_lib_2.cc b/source/blender/editors/armature/pose_lib_2.cc index 6c9672eaad3..027da469d3b 100644 --- a/source/blender/editors/armature/pose_lib_2.cc +++ b/source/blender/editors/armature/pose_lib_2.cc @@ -228,7 +228,9 @@ static void poselib_toggle_flipped(PoseBlendData *pbd) } /* Return operator return value. */ -static int poselib_blend_handle_event(bContext * /*C*/, wmOperator *op, const wmEvent *event) +static wmOperatorStatus poselib_blend_handle_event(bContext * /*C*/, + wmOperator *op, + const wmEvent *event) { PoseBlendData *pbd = static_cast(op->customdata); @@ -500,7 +502,7 @@ static void poselib_blend_free(wmOperator *op) MEM_delete(pbd); } -static int poselib_blend_exit(bContext *C, wmOperator *op) +static wmOperatorStatus poselib_blend_exit(bContext *C, wmOperator *op) { PoseBlendData *pbd = static_cast(op->customdata); const ePoseBlendState exit_state = pbd->state; @@ -526,9 +528,9 @@ static void poselib_blend_cancel(bContext *C, wmOperator *op) } /* Main modal status check. */ -static int poselib_blend_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus poselib_blend_modal(bContext *C, wmOperator *op, const wmEvent *event) { - const int operator_result = poselib_blend_handle_event(C, op, event); + const wmOperatorStatus operator_result = poselib_blend_handle_event(C, op, event); const PoseBlendData *pbd = static_cast(op->customdata); if (ELEM(pbd->state, POSE_BLEND_CONFIRM, POSE_BLEND_CANCEL)) { @@ -557,7 +559,7 @@ static int poselib_blend_modal(bContext *C, wmOperator *op, const wmEvent *event } /* Modal Operator init. */ -static int poselib_blend_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus poselib_blend_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (!poselib_blend_init_data(C, op, event)) { poselib_blend_free(op); @@ -575,7 +577,7 @@ static int poselib_blend_invoke(bContext *C, wmOperator *op, const wmEvent *even } /* Single-shot apply. */ -static int poselib_blend_exec(bContext *C, wmOperator *op) +static wmOperatorStatus poselib_blend_exec(bContext *C, wmOperator *op) { if (!poselib_blend_init_data(C, op, nullptr)) { poselib_blend_free(op); diff --git a/source/blender/editors/armature/pose_select.cc b/source/blender/editors/armature/pose_select.cc index 3d3655b738b..c1b2a8f8f71 100644 --- a/source/blender/editors/armature/pose_select.cc +++ b/source/blender/editors/armature/pose_select.cc @@ -420,7 +420,9 @@ 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, const wmEvent *event) +static wmOperatorStatus pose_select_connected_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Bone *bone, *curBone, *next = nullptr; const bool extend = RNA_boolean_get(op->ptr, "extend"); @@ -500,7 +502,7 @@ void POSE_OT_select_linked_pick(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } -static int pose_select_linked_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus pose_select_linked_exec(bContext *C, wmOperator * /*op*/) { Bone *curBone, *next = nullptr; @@ -558,7 +560,7 @@ void POSE_OT_select_linked(wmOperatorType *ot) /* -------------------------------------- */ -static int pose_de_select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_de_select_all_exec(bContext *C, wmOperator *op) { int action = RNA_enum_get(op->ptr, "action"); @@ -614,7 +616,7 @@ void POSE_OT_select_all(wmOperatorType *ot) /* -------------------------------------- */ -static int pose_select_parent_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus pose_select_parent_exec(bContext *C, wmOperator * /*op*/) { Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); bArmature *arm = static_cast(ob->data); @@ -659,7 +661,7 @@ void POSE_OT_select_parent(wmOperatorType *ot) /* -------------------------------------- */ -static int pose_select_constraint_target_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus pose_select_constraint_target_exec(bContext *C, wmOperator * /*op*/) { int found = 0; @@ -719,7 +721,7 @@ void POSE_OT_select_constraint_target(wmOperatorType *ot) /* No need to convert to multi-objects. Just like we keep the non-active bones * selected we then keep the non-active objects untouched (selected/unselected). */ -static int pose_select_hierarchy_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_select_hierarchy_exec(bContext *C, wmOperator *op) { Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); bArmature *arm = static_cast(ob->data); @@ -1023,7 +1025,7 @@ static bool pose_select_same_keyingset(bContext *C, ReportList *reports, bool ex return changed_multi; } -static int pose_select_grouped_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_select_grouped_exec(bContext *C, wmOperator *op) { Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); const ePose_SelectSame_Mode type = ePose_SelectSame_Mode(RNA_enum_get(op->ptr, "type")); @@ -1107,7 +1109,7 @@ void POSE_OT_select_grouped(wmOperatorType *ot) /** * \note clone of #armature_select_mirror_exec keep in sync */ -static int pose_select_mirror_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_select_mirror_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); diff --git a/source/blender/editors/armature/pose_slide.cc b/source/blender/editors/armature/pose_slide.cc index 8a05273466a..7ab1212c582 100644 --- a/source/blender/editors/armature/pose_slide.cc +++ b/source/blender/editors/armature/pose_slide.cc @@ -970,7 +970,7 @@ static void pose_slide_draw_status(bContext *C, tPoseSlideOp *pso) /** * Common code for invoke() methods. */ -static int pose_slide_invoke_common(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus pose_slide_invoke_common(bContext *C, wmOperator *op, const wmEvent *event) { wmWindow *win = CTX_wm_window(C); @@ -1113,7 +1113,7 @@ static bool pose_slide_toggle_axis_locks(wmOperator *op, /** * Operator `modal()` callback. */ -static int pose_slide_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus pose_slide_modal(bContext *C, wmOperator *op, const wmEvent *event) { tPoseSlideOp *pso = static_cast(op->customdata); wmWindow *win = CTX_wm_window(C); @@ -1311,7 +1311,7 @@ static void pose_slide_cancel(bContext *C, wmOperator *op) /** * Common code for exec() methods. */ -static int pose_slide_exec_common(bContext *C, wmOperator *op, tPoseSlideOp *pso) +static wmOperatorStatus pose_slide_exec_common(bContext *C, wmOperator *op, tPoseSlideOp *pso) { /* Settings should have been set up ok for applying, so just apply! */ if (!ELEM(pso->mode, POSESLIDE_BLEND_REST)) { @@ -1391,7 +1391,7 @@ static void pose_slide_opdef_properties(wmOperatorType *ot) /** * Operator `invoke()` callback for 'push from breakdown' mode. */ -static int pose_slide_push_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus pose_slide_push_invoke(bContext *C, wmOperator *op, const wmEvent *event) { /* Initialize data. */ if (pose_slide_init(C, op, POSESLIDE_PUSH) == 0) { @@ -1406,7 +1406,7 @@ static int pose_slide_push_invoke(bContext *C, wmOperator *op, const wmEvent *ev /** * Operator `exec()` callback - for push. */ -static int pose_slide_push_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_slide_push_exec(bContext *C, wmOperator *op) { tPoseSlideOp *pso; @@ -1448,7 +1448,7 @@ void POSE_OT_push(wmOperatorType *ot) /** * Invoke callback - for 'relax to breakdown' mode. */ -static int pose_slide_relax_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus pose_slide_relax_invoke(bContext *C, wmOperator *op, const wmEvent *event) { /* Initialize data. */ if (pose_slide_init(C, op, POSESLIDE_RELAX) == 0) { @@ -1463,7 +1463,7 @@ static int pose_slide_relax_invoke(bContext *C, wmOperator *op, const wmEvent *e /** * Operator exec() - for relax. */ -static int pose_slide_relax_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_slide_relax_exec(bContext *C, wmOperator *op) { tPoseSlideOp *pso; @@ -1504,7 +1504,9 @@ void POSE_OT_relax(wmOperatorType *ot) /** * Operator `invoke()` - for 'blend with rest pose' mode. */ -static int pose_slide_blend_rest_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus pose_slide_blend_rest_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { /* Initialize data. */ if (pose_slide_init(C, op, POSESLIDE_BLEND_REST) == 0) { @@ -1523,7 +1525,7 @@ static int pose_slide_blend_rest_invoke(bContext *C, wmOperator *op, const wmEve /** * Operator `exec()` - for push. */ -static int pose_slide_blend_rest_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_slide_blend_rest_exec(bContext *C, wmOperator *op) { tPoseSlideOp *pso; @@ -1565,7 +1567,9 @@ void POSE_OT_blend_with_rest(wmOperatorType *ot) /** * Operator `invoke()` - for 'breakdown' mode. */ -static int pose_slide_breakdown_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus pose_slide_breakdown_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { /* Initialize data. */ if (pose_slide_init(C, op, POSESLIDE_BREAKDOWN) == 0) { @@ -1580,7 +1584,7 @@ static int pose_slide_breakdown_invoke(bContext *C, wmOperator *op, const wmEven /** * Operator exec() - for breakdown. */ -static int pose_slide_breakdown_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_slide_breakdown_exec(bContext *C, wmOperator *op) { tPoseSlideOp *pso; @@ -1618,7 +1622,9 @@ void POSE_OT_breakdown(wmOperatorType *ot) } /* ........................ */ -static int pose_slide_blend_to_neighbors_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus pose_slide_blend_to_neighbors_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { /* Initialize data. */ if (pose_slide_init(C, op, POSESLIDE_BLEND) == 0) { @@ -1630,7 +1636,7 @@ static int pose_slide_blend_to_neighbors_invoke(bContext *C, wmOperator *op, con return pose_slide_invoke_common(C, op, event); } -static int pose_slide_blend_to_neighbors_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_slide_blend_to_neighbors_exec(bContext *C, wmOperator *op) { tPoseSlideOp *pso; @@ -1814,7 +1820,7 @@ static void get_selected_frames(ListBase *pflinks, ListBase /*FrameLink*/ *targe /* --------------------------------- */ -static int pose_propagate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_propagate_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); diff --git a/source/blender/editors/armature/pose_transform.cc b/source/blender/editors/armature/pose_transform.cc index d740a25f075..eacb8ac53aa 100644 --- a/source/blender/editors/armature/pose_transform.cc +++ b/source/blender/editors/armature/pose_transform.cc @@ -386,7 +386,7 @@ static void applyarmature_reset_constraints(bPose *pose, const bool use_selected } /* Set the current pose as the rest-pose. */ -static int apply_armature_pose2bones_exec(bContext *C, wmOperator *op) +static wmOperatorStatus apply_armature_pose2bones_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -511,7 +511,7 @@ void POSE_OT_armature_apply(wmOperatorType *ot) * Set the current pose as the rest-pose. * \{ */ -static int pose_visual_transform_apply_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus pose_visual_transform_apply_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -775,7 +775,7 @@ static bPoseChannel *pose_bone_do_paste(Object *ob, /** \name Copy Pose Operator * \{ */ -static int pose_copy_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_copy_exec(bContext *C, wmOperator *op) { using namespace blender::bke::blendfile; @@ -837,7 +837,7 @@ void POSE_OT_copy(wmOperatorType *ot) /** \name Paste Pose Operator * \{ */ -static int pose_paste_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_paste_exec(bContext *C, wmOperator *op) { Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); Scene *scene = CTX_data_scene(C); @@ -1165,10 +1165,11 @@ static void pchan_clear_transforms(const bPose *pose, bPoseChannel *pchan) /* --------------- */ /* generic exec for clear-pose operators */ -static int pose_clear_transform_generic_exec(bContext *C, - wmOperator *op, - void (*clear_func)(const bPose *, bPoseChannel *), - const char default_ksName[]) +static wmOperatorStatus pose_clear_transform_generic_exec(bContext *C, + wmOperator *op, + void (*clear_func)(const bPose *, + bPoseChannel *), + const char default_ksName[]) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Scene *scene = CTX_data_scene(C); @@ -1245,7 +1246,7 @@ static int pose_clear_transform_generic_exec(bContext *C, /** \name Clear Pose Scale Operator * \{ */ -static int pose_clear_scale_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_clear_scale_exec(bContext *C, wmOperator *op) { return pose_clear_transform_generic_exec( C, op, pchan_clear_scale_with_mirrored, ANIM_KS_SCALING_ID); @@ -1272,7 +1273,7 @@ void POSE_OT_scale_clear(wmOperatorType *ot) /** \name Clear Pose Rotation Operator * \{ */ -static int pose_clear_rot_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_clear_rot_exec(bContext *C, wmOperator *op) { return pose_clear_transform_generic_exec( C, op, pchan_clear_rot_with_mirrored, ANIM_KS_ROTATION_ID); @@ -1299,7 +1300,7 @@ void POSE_OT_rot_clear(wmOperatorType *ot) /** \name Clear Pose Location Operator * \{ */ -static int pose_clear_loc_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_clear_loc_exec(bContext *C, wmOperator *op) { return pose_clear_transform_generic_exec( C, op, pchan_clear_loc_with_mirrored, ANIM_KS_LOCATION_ID); @@ -1326,7 +1327,7 @@ void POSE_OT_loc_clear(wmOperatorType *ot) /** \name Clear Pose Transforms Operator * \{ */ -static int pose_clear_transforms_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_clear_transforms_exec(bContext *C, wmOperator *op) { return pose_clear_transform_generic_exec( C, op, pchan_clear_transforms, ANIM_KS_LOC_ROT_SCALE_ID); @@ -1354,7 +1355,7 @@ void POSE_OT_transforms_clear(wmOperatorType *ot) /** \name Clear User Transforms Operator * \{ */ -static int pose_clear_user_transforms_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_clear_user_transforms_exec(bContext *C, wmOperator *op) { ViewLayer *view_layer = CTX_data_view_layer(C); View3D *v3d = CTX_wm_view3d(C); diff --git a/source/blender/editors/asset/intern/asset_ops.cc b/source/blender/editors/asset/intern/asset_ops.cc index 008de5968c7..31cc66f96d7 100644 --- a/source/blender/editors/asset/intern/asset_ops.cc +++ b/source/blender/editors/asset/intern/asset_ops.cc @@ -154,7 +154,9 @@ void AssetMarkHelper::reportResults(ReportList &reports) const } } -static int asset_mark_exec(const bContext *C, const wmOperator *op, const Span ids) +static wmOperatorStatus asset_mark_exec(const bContext *C, + const wmOperator *op, + const Span ids) { AssetMarkHelper mark_helper; mark_helper(*C, ids); @@ -190,7 +192,7 @@ static void ASSET_OT_mark(wmOperatorType *ot) "customizable metadata (like previews, descriptions and tags)"; ot->idname = "ASSET_OT_mark"; - ot->exec = [](bContext *C, wmOperator *op) -> int { + ot->exec = [](bContext *C, wmOperator *op) -> wmOperatorStatus { return asset_mark_exec(C, op, ED_operator_get_ids_from_context_as_vec(C)); }; ot->poll = [](bContext *C) -> bool { @@ -211,7 +213,7 @@ static void ASSET_OT_mark_single(wmOperatorType *ot) "customizable metadata (like previews, descriptions and tags)"; ot->idname = "ASSET_OT_mark_single"; - ot->exec = [](bContext *C, wmOperator *op) -> int { + ot->exec = [](bContext *C, wmOperator *op) -> wmOperatorStatus { return asset_mark_exec(C, op, ED_operator_single_id_from_context_as_vec(C)); }; ot->poll = [](bContext *C) -> bool { @@ -296,7 +298,9 @@ bool AssetClearHelper::wasSuccessful() const return stats.tot_cleared > 0; } -static int asset_clear_exec(const bContext *C, const wmOperator *op, const Span ids) +static wmOperatorStatus asset_clear_exec(const bContext *C, + const wmOperator *op, + const Span ids) { const bool set_fake_user = RNA_boolean_get(op->ptr, "set_fake_user"); AssetClearHelper clear_helper(set_fake_user); @@ -356,7 +360,7 @@ static void ASSET_OT_clear(wmOperatorType *ot) ot->get_description = asset_clear_get_description; ot->idname = "ASSET_OT_clear"; - ot->exec = [](bContext *C, wmOperator *op) -> int { + ot->exec = [](bContext *C, wmOperator *op) -> wmOperatorStatus { return asset_clear_exec(C, op, ED_operator_get_ids_from_context_as_vec(C)); }; ot->poll = [](bContext *C) -> bool { @@ -380,7 +384,7 @@ static void ASSET_OT_clear_single(wmOperatorType *ot) ot->get_description = asset_clear_get_description; ot->idname = "ASSET_OT_clear_single"; - ot->exec = [](bContext *C, wmOperator *op) -> int { + ot->exec = [](bContext *C, wmOperator *op) -> wmOperatorStatus { return asset_clear_exec(C, op, ED_operator_single_id_from_context_as_vec(C)); }; ot->poll = [](bContext *C) -> bool { @@ -415,7 +419,7 @@ static bool asset_library_refresh_poll(bContext *C) list::has_asset_browser_storage_for_library(library, C); } -static int asset_library_refresh_exec(bContext *C, wmOperator * /*unused*/) +static wmOperatorStatus asset_library_refresh_exec(bContext *C, wmOperator * /*unused*/) { const AssetLibraryReference *library = CTX_wm_asset_library_ref(C); /* Handles both global asset list storage and asset browsers. */ @@ -456,7 +460,7 @@ static bool asset_catalog_operator_poll(bContext *C) return true; } -static int asset_catalog_new_exec(bContext *C, wmOperator *op) +static wmOperatorStatus asset_catalog_new_exec(bContext *C, wmOperator *op) { SpaceFile *sfile = CTX_wm_space_file(C); asset_system::AssetLibrary *asset_library = ED_fileselect_active_asset_library_get(sfile); @@ -496,7 +500,7 @@ static void ASSET_OT_catalog_new(wmOperatorType *ot) "Optional path defining the location to put the new catalog under"); } -static int asset_catalog_delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus asset_catalog_delete_exec(bContext *C, wmOperator *op) { SpaceFile *sfile = CTX_wm_space_file(C); asset_system::AssetLibrary *asset_library = ED_fileselect_active_asset_library_get(sfile); @@ -547,7 +551,7 @@ static asset_system::AssetCatalogService *get_catalog_service(bContext *C) return nullptr; } -static int asset_catalog_undo_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus asset_catalog_undo_exec(bContext *C, wmOperator * /*op*/) { asset_system::AssetCatalogService *catalog_service = get_catalog_service(C); if (!catalog_service) { @@ -577,7 +581,7 @@ static void ASSET_OT_catalog_undo(wmOperatorType *ot) ot->poll = asset_catalog_undo_poll; } -static int asset_catalog_redo_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus asset_catalog_redo_exec(bContext *C, wmOperator * /*op*/) { asset_system::AssetCatalogService *catalog_service = get_catalog_service(C); if (!catalog_service) { @@ -607,7 +611,7 @@ static void ASSET_OT_catalog_redo(wmOperatorType *ot) ot->poll = asset_catalog_redo_poll; } -static int asset_catalog_undo_push_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus asset_catalog_undo_push_exec(bContext *C, wmOperator * /*op*/) { asset_system::AssetCatalogService *catalog_service = get_catalog_service(C); if (!catalog_service) { @@ -660,7 +664,7 @@ static bool asset_catalogs_save_poll(bContext *C) return true; } -static int asset_catalogs_save_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus asset_catalogs_save_exec(bContext *C, wmOperator * /*op*/) { const SpaceFile *sfile = CTX_wm_space_file(C); asset_system::AssetLibrary *asset_library = ED_fileselect_active_asset_library_get(sfile); @@ -721,7 +725,9 @@ static bool asset_bundle_install_poll(bContext *C) return true; } -static int asset_bundle_install_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus asset_bundle_install_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Main *bmain = CTX_data_main(C); if (has_external_files(bmain, op->reports)) { @@ -738,7 +744,7 @@ static int asset_bundle_install_invoke(bContext *C, wmOperator *op, const wmEven return OPERATOR_RUNNING_MODAL; } -static int asset_bundle_install_exec(bContext *C, wmOperator *op) +static wmOperatorStatus asset_bundle_install_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); if (has_external_files(bmain, op->reports)) { @@ -773,7 +779,7 @@ static int asset_bundle_install_exec(bContext *C, wmOperator *op) cat_service->undo_push(); cat_service->prepare_to_merge_on_write(); - const int operator_result = WM_operator_name_call( + const wmOperatorStatus operator_result = WM_operator_name_call( C, "WM_OT_save_mainfile", WM_OP_EXEC_DEFAULT, op->ptr, nullptr); WM_cursor_wait(false); diff --git a/source/blender/editors/curve/editcurve.cc b/source/blender/editors/curve/editcurve.cc index 69f5b83bd23..5db0f919e23 100644 --- a/source/blender/editors/curve/editcurve.cc +++ b/source/blender/editors/curve/editcurve.cc @@ -1386,7 +1386,7 @@ void ED_curve_editnurb_free(Object *obedit) /** \name Separate Operator * \{ */ -static int separate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus separate_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1522,7 +1522,7 @@ void CURVE_OT_separate(wmOperatorType *ot) /** \name Split Operator * \{ */ -static int curve_split_exec(bContext *C, wmOperator *op) +static wmOperatorStatus curve_split_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); const Scene *scene = CTX_data_scene(C); @@ -2606,7 +2606,7 @@ static void adduplicateflagNurb( /** \name Switch Direction Operator * \{ */ -static int switch_direction_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus switch_direction_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); const Scene *scene = CTX_data_scene(C); @@ -2666,7 +2666,7 @@ void CURVE_OT_switch_direction(wmOperatorType *ot) /** \name Set Weight Operator * \{ */ -static int set_goal_weight_exec(bContext *C, wmOperator *op) +static wmOperatorStatus set_goal_weight_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -2729,7 +2729,7 @@ void CURVE_OT_spline_weight_set(wmOperatorType *ot) /** \name Set Radius Operator * \{ */ -static int set_radius_exec(bContext *C, wmOperator *op) +static wmOperatorStatus set_radius_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -2845,7 +2845,7 @@ static void smooth_single_bp(BPoint *bp, } } -static int smooth_exec(bContext *C, wmOperator *op) +static wmOperatorStatus smooth_exec(bContext *C, wmOperator *op) { const float factor = 1.0f / 6.0f; const Scene *scene = CTX_data_scene(C); @@ -3147,7 +3147,7 @@ static void curve_smooth_value(ListBase *editnurb, const int bezt_offsetof, cons /** \name Smooth Weight Operator * \{ */ -static int curve_smooth_weight_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus curve_smooth_weight_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -3187,7 +3187,7 @@ void CURVE_OT_smooth_weight(wmOperatorType *ot) /** \name Smooth Radius Operator * \{ */ -static int curve_smooth_radius_exec(bContext *C, wmOperator *op) +static wmOperatorStatus curve_smooth_radius_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -3237,7 +3237,7 @@ void CURVE_OT_smooth_radius(wmOperatorType *ot) /** \name Smooth Tilt Operator * \{ */ -static int curve_smooth_tilt_exec(bContext *C, wmOperator *op) +static wmOperatorStatus curve_smooth_tilt_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -3286,7 +3286,7 @@ void CURVE_OT_smooth_tilt(wmOperatorType *ot) /** \name Hide Operator * \{ */ -static int hide_exec(bContext *C, wmOperator *op) +static wmOperatorStatus hide_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -3387,7 +3387,7 @@ void CURVE_OT_hide(wmOperatorType *ot) /** \name Reveal Operator * \{ */ -static int reveal_exec(bContext *C, wmOperator *op) +static wmOperatorStatus reveal_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -3860,7 +3860,7 @@ static void subdividenurb(Object *obedit, View3D *v3d, int number_cuts) } } -static int subdivide_exec(bContext *C, wmOperator *op) +static wmOperatorStatus subdivide_exec(bContext *C, wmOperator *op) { const int number_cuts = RNA_int_get(op->ptr, "number_cuts"); @@ -3919,13 +3919,13 @@ void CURVE_OT_subdivide(wmOperatorType *ot) /** \name Set Spline Type Operator * \{ */ -static int set_spline_type_exec(bContext *C, wmOperator *op) +static wmOperatorStatus set_spline_type_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); Vector objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data( scene, view_layer, CTX_wm_view3d(C)); - int ret_value = OPERATOR_CANCELLED; + wmOperatorStatus ret_value = OPERATOR_CANCELLED; for (Object *obedit : objects) { Main *bmain = CTX_data_main(C); @@ -4009,7 +4009,7 @@ void CURVE_OT_spline_type_set(wmOperatorType *ot) /** \name Set Handle Type Operator * \{ */ -static int set_handle_type_exec(bContext *C, wmOperator *op) +static wmOperatorStatus set_handle_type_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -4072,7 +4072,7 @@ void CURVE_OT_handle_type_set(wmOperatorType *ot) /** \name Recalculate Handles Operator * \{ */ -static int curve_normals_make_consistent_exec(bContext *C, wmOperator *op) +static wmOperatorStatus curve_normals_make_consistent_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -4519,7 +4519,7 @@ static int merge_nurb(View3D *v3d, Object *obedit) return ok ? CURVE_MERGE_OK : CURVE_MERGE_ERR_RESOLUTION_SOME; } -static int make_segment_exec(bContext *C, wmOperator *op) +static wmOperatorStatus make_segment_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); const Scene *scene = CTX_data_scene(C); @@ -5119,7 +5119,7 @@ bool ed_editnurb_spin( return changed; } -static int spin_exec(bContext *C, wmOperator *op) +static wmOperatorStatus spin_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); const Scene *scene = CTX_data_scene(C); @@ -5175,7 +5175,7 @@ static int spin_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int spin_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus spin_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { Scene *scene = CTX_data_scene(C); RegionView3D *rv3d = ED_view3d_context_rv3d(C); @@ -5616,7 +5616,7 @@ int ed_editcurve_addvert(Curve *cu, EditNurb *editnurb, View3D *v3d, const float return changed; } -static int add_vertex_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_vertex_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *obedit = CTX_data_edit_object(C); @@ -5646,7 +5646,7 @@ static int add_vertex_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int add_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus add_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); ViewContext vc = ED_view3d_viewcontext_init(C, depsgraph); @@ -5739,7 +5739,7 @@ static int add_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event) } /* Support dragging to move after extrude, see: #114282. */ - int retval = add_vertex_exec(C, op); + wmOperatorStatus retval = add_vertex_exec(C, op); if (retval & OPERATOR_FINISHED) { retval |= OPERATOR_PASS_THROUGH; } @@ -5780,7 +5780,7 @@ void CURVE_OT_vertex_add(wmOperatorType *ot) /** \name Extrude Operator * \{ */ -static int curve_extrude_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus curve_extrude_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); const Scene *scene = CTX_data_scene(C); @@ -5924,7 +5924,7 @@ bool curve_toggle_cyclic(View3D *v3d, ListBase *editnurb, int direction) return changed; } -static int toggle_cyclic_exec(bContext *C, wmOperator *op) +static wmOperatorStatus toggle_cyclic_exec(bContext *C, wmOperator *op) { const int direction = RNA_enum_get(op->ptr, "direction"); View3D *v3d = CTX_wm_view3d(C); @@ -5952,7 +5952,9 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op) return changed_multi ? OPERATOR_FINISHED : OPERATOR_CANCELLED; } -static int toggle_cyclic_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus toggle_cyclic_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Object *obedit = CTX_data_edit_object(C); ListBase *editnurb = object_editcurve_get(obedit); @@ -6012,7 +6014,7 @@ void CURVE_OT_cyclic_toggle(wmOperatorType *ot) /** \name Add Duplicate Operator * \{ */ -static int duplicate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus duplicate_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -6517,7 +6519,7 @@ static bool curve_delete_segments(Object *obedit, View3D *v3d, const bool split) return true; } -static int curve_delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus curve_delete_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); View3D *v3d = CTX_wm_view3d(C); @@ -6694,7 +6696,7 @@ void ed_dissolve_bez_segment(BezTriple *bezt_prev, MEM_freeN(points); } -static int curve_dissolve_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus curve_dissolve_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); const Scene *scene = CTX_data_scene(C); @@ -6783,7 +6785,7 @@ static bool nurb_bezt_flag_any(const Nurb *nu, const char flag_test) return false; } -static int curve_decimate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus curve_decimate_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); const float error_sq_max = FLT_MAX; @@ -6864,7 +6866,7 @@ void CURVE_OT_decimate(wmOperatorType *ot) /** \name Shade Smooth/Flat Operator * \{ */ -static int shade_smooth_exec(bContext *C, wmOperator *op) +static wmOperatorStatus shade_smooth_exec(bContext *C, wmOperator *op) { View3D *v3d = CTX_wm_view3d(C); const Scene *scene = CTX_data_scene(C); @@ -6872,7 +6874,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op) int clear = STREQ(op->idname, "CURVE_OT_shade_flat"); Vector objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data( scene, view_layer, CTX_wm_view3d(C)); - int ret_value = OPERATOR_CANCELLED; + wmOperatorStatus ret_value = OPERATOR_CANCELLED; for (Object *obedit : objects) { ListBase *editnurb = object_editcurve_get(obedit); @@ -6936,7 +6938,7 @@ void CURVE_OT_shade_flat(wmOperatorType *ot) /** \name Join Operator * \{ */ -int ED_curve_join_objects_exec(bContext *C, wmOperator *op) +wmOperatorStatus ED_curve_join_objects_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -7056,7 +7058,7 @@ int ED_curve_join_objects_exec(bContext *C, wmOperator *op) /** \name Clear Tilt Operator * \{ */ -static int clear_tilt_exec(bContext *C, wmOperator *op) +static wmOperatorStatus clear_tilt_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -7154,7 +7156,7 @@ static bool match_texture_space_poll(bContext *C) return object && ELEM(object->type, OB_CURVES_LEGACY, OB_SURF, OB_FONT); } -static int match_texture_space_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus match_texture_space_exec(bContext *C, wmOperator * /*op*/) { /* Need to ensure the dependency graph is fully evaluated, so the display list is at a correct * state. */ diff --git a/source/blender/editors/curve/editcurve_add.cc b/source/blender/editors/curve/editcurve_add.cc index 9011429773e..bd010bf7943 100644 --- a/source/blender/editors/curve/editcurve_add.cc +++ b/source/blender/editors/curve/editcurve_add.cc @@ -493,7 +493,7 @@ Nurb *ED_curve_add_nurbs_primitive( return nu; } -static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf) +static wmOperatorStatus curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -562,19 +562,19 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf) return OPERATOR_FINISHED; } -static int curve_prim_add(bContext *C, wmOperator *op, int type) +static wmOperatorStatus curve_prim_add(bContext *C, wmOperator *op, int type) { return curvesurf_prim_add(C, op, type, 0); } -static int surf_prim_add(bContext *C, wmOperator *op, int type) +static wmOperatorStatus surf_prim_add(bContext *C, wmOperator *op, int type) { return curvesurf_prim_add(C, op, type, 1); } /* ******************** Curves ******************* */ -static int add_primitive_bezier_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_bezier_exec(bContext *C, wmOperator *op) { return curve_prim_add(C, op, CU_BEZIER | CU_PRIM_CURVE); } @@ -597,7 +597,7 @@ void CURVE_OT_primitive_bezier_curve_add(wmOperatorType *ot) blender::ed::object::add_generic_props(ot, true); } -static int add_primitive_bezier_circle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_bezier_circle_exec(bContext *C, wmOperator *op) { return curve_prim_add(C, op, CU_BEZIER | CU_PRIM_CIRCLE); } @@ -620,7 +620,7 @@ void CURVE_OT_primitive_bezier_circle_add(wmOperatorType *ot) blender::ed::object::add_generic_props(ot, true); } -static int add_primitive_nurbs_curve_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_nurbs_curve_exec(bContext *C, wmOperator *op) { return curve_prim_add(C, op, CU_NURBS | CU_PRIM_CURVE); } @@ -643,7 +643,7 @@ void CURVE_OT_primitive_nurbs_curve_add(wmOperatorType *ot) blender::ed::object::add_generic_props(ot, true); } -static int add_primitive_nurbs_circle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_nurbs_circle_exec(bContext *C, wmOperator *op) { return curve_prim_add(C, op, CU_NURBS | CU_PRIM_CIRCLE); } @@ -666,7 +666,7 @@ void CURVE_OT_primitive_nurbs_circle_add(wmOperatorType *ot) blender::ed::object::add_generic_props(ot, true); } -static int add_primitive_curve_path_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_curve_path_exec(bContext *C, wmOperator *op) { return curve_prim_add(C, op, CU_NURBS | CU_PRIM_PATH); } @@ -690,7 +690,7 @@ void CURVE_OT_primitive_nurbs_path_add(wmOperatorType *ot) } /* **************** NURBS surfaces ********************** */ -static int add_primitive_nurbs_surface_curve_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_nurbs_surface_curve_exec(bContext *C, wmOperator *op) { return surf_prim_add(C, op, CU_PRIM_CURVE | CU_NURBS); } @@ -713,7 +713,7 @@ void SURFACE_OT_primitive_nurbs_surface_curve_add(wmOperatorType *ot) blender::ed::object::add_generic_props(ot, true); } -static int add_primitive_nurbs_surface_circle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_nurbs_surface_circle_exec(bContext *C, wmOperator *op) { return surf_prim_add(C, op, CU_PRIM_CIRCLE | CU_NURBS); } @@ -736,7 +736,7 @@ void SURFACE_OT_primitive_nurbs_surface_circle_add(wmOperatorType *ot) blender::ed::object::add_generic_props(ot, true); } -static int add_primitive_nurbs_surface_surface_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_nurbs_surface_surface_exec(bContext *C, wmOperator *op) { return surf_prim_add(C, op, CU_PRIM_PATCH | CU_NURBS); } @@ -759,7 +759,7 @@ void SURFACE_OT_primitive_nurbs_surface_surface_add(wmOperatorType *ot) blender::ed::object::add_generic_props(ot, true); } -static int add_primitive_nurbs_surface_cylinder_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_nurbs_surface_cylinder_exec(bContext *C, wmOperator *op) { return surf_prim_add(C, op, CU_PRIM_TUBE | CU_NURBS); } @@ -782,7 +782,7 @@ void SURFACE_OT_primitive_nurbs_surface_cylinder_add(wmOperatorType *ot) blender::ed::object::add_generic_props(ot, true); } -static int add_primitive_nurbs_surface_sphere_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_nurbs_surface_sphere_exec(bContext *C, wmOperator *op) { return surf_prim_add(C, op, CU_PRIM_SPHERE | CU_NURBS); } @@ -805,7 +805,7 @@ void SURFACE_OT_primitive_nurbs_surface_sphere_add(wmOperatorType *ot) blender::ed::object::add_generic_props(ot, true); } -static int add_primitive_nurbs_surface_torus_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_nurbs_surface_torus_exec(bContext *C, wmOperator *op) { return surf_prim_add(C, op, CU_PRIM_DONUT | CU_NURBS); } diff --git a/source/blender/editors/curve/editcurve_paint.cc b/source/blender/editors/curve/editcurve_paint.cc index cd899e04e05..190bb2103a3 100644 --- a/source/blender/editors/curve/editcurve_paint.cc +++ b/source/blender/editors/curve/editcurve_paint.cc @@ -766,7 +766,7 @@ static void curve_draw_exec_precalc(wmOperator *op) } } -static int curve_draw_exec(bContext *C, wmOperator *op) +static wmOperatorStatus curve_draw_exec(bContext *C, wmOperator *op) { if (op->customdata == nullptr) { if (!curve_draw_init(C, op, false)) { @@ -1063,7 +1063,7 @@ static int curve_draw_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int curve_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus curve_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (RNA_struct_property_is_set(op->ptr, "stroke")) { return curve_draw_exec(C, op); @@ -1168,9 +1168,9 @@ static void curve_draw_cancel(bContext * /*C*/, wmOperator *op) } /* Modal event handling of frame changing */ -static int curve_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus curve_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) { - int ret = OPERATOR_RUNNING_MODAL; + wmOperatorStatus ret = OPERATOR_RUNNING_MODAL; CurveDrawData *cdd = static_cast(op->customdata); UNUSED_VARS(C, op); diff --git a/source/blender/editors/curve/editcurve_pen.cc b/source/blender/editors/curve/editcurve_pen.cc index b46d442f802..b66f3bf5a8c 100644 --- a/source/blender/editors/curve/editcurve_pen.cc +++ b/source/blender/editors/curve/editcurve_pen.cc @@ -1553,7 +1553,7 @@ wmKeyMap *curve_pen_modal_keymap(wmKeyConfig *keyconf) return keymap; } -static int curve_pen_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus curve_pen_modal(bContext *C, wmOperator *op, const wmEvent *event) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Object *obedit = CTX_data_edit_object(C); @@ -1571,7 +1571,7 @@ static int curve_pen_modal(bContext *C, wmOperator *op, const wmEvent *event) params.sel_op = SEL_OP_SET; params.deselect_all = false; - int ret = OPERATOR_RUNNING_MODAL; + wmOperatorStatus ret = OPERATOR_RUNNING_MODAL; /* Distance threshold for mouse clicks to affect the spline or its points */ const float mval_fl[2] = {float(event->mval[0]), float(event->mval[1])}; @@ -1743,7 +1743,7 @@ static int curve_pen_modal(bContext *C, wmOperator *op, const wmEvent *event) return ret; } -static int curve_pen_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus curve_pen_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); ViewContext vc = ED_view3d_viewcontext_init(C, depsgraph); diff --git a/source/blender/editors/curve/editcurve_select.cc b/source/blender/editors/curve/editcurve_select.cc index ea81ebd0f1f..8a102bc0397 100644 --- a/source/blender/editors/curve/editcurve_select.cc +++ b/source/blender/editors/curve/editcurve_select.cc @@ -487,7 +487,7 @@ static void selectend_nurb(Object *obedit, eEndPoint_Types selfirst, bool doswap } } -static int de_select_first_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus de_select_first_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -518,7 +518,7 @@ void CURVE_OT_de_select_first(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int de_select_last_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus de_select_last_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -556,7 +556,7 @@ void CURVE_OT_de_select_last(wmOperatorType *ot) /** \name Select All Operator * \{ */ -static int de_select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus de_select_all_exec(bContext *C, wmOperator *op) { int action = RNA_enum_get(op->ptr, "action"); @@ -628,7 +628,7 @@ void CURVE_OT_select_all(wmOperatorType *ot) /** \name Select Linked Operator * \{ */ -static int select_linked_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus select_linked_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -657,7 +657,9 @@ static int select_linked_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -static int select_linked_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus select_linked_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { return select_linked_exec(C, op); } @@ -686,7 +688,9 @@ void CURVE_OT_select_linked(wmOperatorType *ot) /** \name Select Linked Pick Operator * \{ */ -static int select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus select_linked_pick_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Nurb *nu; @@ -761,7 +765,7 @@ void CURVE_OT_select_linked_pick(wmOperatorType *ot) /** \name Select Row Operator * \{ */ -static int select_row_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus select_row_exec(bContext *C, wmOperator * /*op*/) { Object *obedit = CTX_data_edit_object(C); Curve *cu = static_cast(obedit->data); @@ -829,7 +833,7 @@ void CURVE_OT_select_row(wmOperatorType *ot) /** \name Select Next Operator * \{ */ -static int select_next_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus select_next_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -868,7 +872,7 @@ void CURVE_OT_select_next(wmOperatorType *ot) /** \name Select Previous Operator * \{ */ -static int select_previous_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus select_previous_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -982,7 +986,7 @@ static void curve_select_more(Object *obedit) } } -static int curve_select_more_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus curve_select_more_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1199,7 +1203,7 @@ static void curve_select_less(Object *obedit) } } -static int curve_select_less_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus curve_select_less_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1234,7 +1238,7 @@ void CURVE_OT_select_less(wmOperatorType *ot) /** \name Select Random Operator * \{ */ -static int curve_select_random_exec(bContext *C, wmOperator *op) +static wmOperatorStatus curve_select_random_exec(bContext *C, wmOperator *op) { const bool select = (RNA_enum_get(op->ptr, "action") == SEL_SELECT); const float randfac = RNA_float_get(op->ptr, "ratio"); @@ -1417,7 +1421,7 @@ static bool ed_curve_select_nth(Curve *cu, const CheckerIntervalParams *params) return true; } -static int select_nth_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_nth_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1708,7 +1712,7 @@ static bool curve_nurb_select_similar_type(Object *ob, return changed; } -static int curve_select_similar_exec(bContext *C, wmOperator *op) +static wmOperatorStatus curve_select_similar_exec(bContext *C, wmOperator *op) { /* Get props. */ const int optype = RNA_enum_get(op->ptr, "type"); @@ -1995,7 +1999,9 @@ static void curve_select_shortest_path_surf(Nurb *nu, int vert_src, int vert_dst MEM_freeN(data); } -static int edcu_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus edcu_shortest_path_pick_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Nurb *nu_dst; diff --git a/source/blender/editors/curve/editfont.cc b/source/blender/editors/curve/editfont.cc index d3875cd10d3..a6891adc0aa 100644 --- a/source/blender/editors/curve/editfont.cc +++ b/source/blender/editors/curve/editfont.cc @@ -575,12 +575,12 @@ static char *font_select_to_buffer(Object *obedit) /** \name Paste From File Operator * \{ */ -static int paste_from_file(bContext *C, ReportList *reports, const char *filepath) +static wmOperatorStatus paste_from_file(bContext *C, ReportList *reports, const char *filepath) { Object *obedit = CTX_data_edit_object(C); char *strp; size_t filelen; - int retval; + wmOperatorStatus retval; strp = static_cast(BLI_file_read_text_as_mem(filepath, 1, &filelen)); if (strp == nullptr) { @@ -603,10 +603,10 @@ static int paste_from_file(bContext *C, ReportList *reports, const char *filepat return retval; } -static int paste_from_file_exec(bContext *C, wmOperator *op) +static wmOperatorStatus paste_from_file_exec(bContext *C, wmOperator *op) { char *filepath; - int retval; + wmOperatorStatus retval; filepath = RNA_string_get_alloc(op->ptr, "filepath", nullptr, 0, nullptr); retval = paste_from_file(C, op->reports, filepath); @@ -615,7 +615,9 @@ static int paste_from_file_exec(bContext *C, wmOperator *op) return retval; } -static int paste_from_file_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus paste_from_file_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (RNA_struct_property_is_set(op->ptr, "filepath")) { return paste_from_file_exec(C, op); @@ -765,7 +767,9 @@ static uiBlock *wm_block_insert_unicode_create(bContext *C, ARegion *region, voi return block; } -static int text_insert_unicode_invoke(bContext *C, wmOperator * /*op*/, const wmEvent * /*event*/) +static wmOperatorStatus text_insert_unicode_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent * /*event*/) { char *edit_string = static_cast(MEM_mallocN(24, __func__)); edit_string[0] = 0; @@ -934,7 +938,7 @@ static const EnumPropertyItem style_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int set_style(bContext *C, const int style, const bool clear) +static wmOperatorStatus set_style(bContext *C, const int style, const bool clear) { Object *obedit = CTX_data_edit_object(C); Curve *cu = static_cast(obedit->data); @@ -960,7 +964,7 @@ static int set_style(bContext *C, const int style, const bool clear) return OPERATOR_FINISHED; } -static int set_style_exec(bContext *C, wmOperator *op) +static wmOperatorStatus set_style_exec(bContext *C, wmOperator *op) { const int style = RNA_enum_get(op->ptr, "style"); const bool clear = RNA_boolean_get(op->ptr, "clear"); @@ -994,7 +998,7 @@ void FONT_OT_style_set(wmOperatorType *ot) /** \name Toggle Style Operator * \{ */ -static int toggle_style_exec(bContext *C, wmOperator *op) +static wmOperatorStatus toggle_style_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); Curve *cu = static_cast(obedit->data); @@ -1034,7 +1038,7 @@ void FONT_OT_style_toggle(wmOperatorType *ot) /** \name Select All Operator * \{ */ -static int font_select_all_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus font_select_all_exec(bContext *C, wmOperator * /*op*/) { Object *obedit = CTX_data_edit_object(C); Curve *cu = static_cast(obedit->data); @@ -1100,7 +1104,7 @@ static void copy_selection(Object *obedit) } } -static int copy_text_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus copy_text_exec(bContext *C, wmOperator * /*op*/) { Object *obedit = CTX_data_edit_object(C); @@ -1127,7 +1131,7 @@ void FONT_OT_text_copy(wmOperatorType *ot) /** \name Cut Text Operator * \{ */ -static int cut_text_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus cut_text_exec(bContext *C, wmOperator * /*op*/) { Object *obedit = CTX_data_edit_object(C); int selstart, selend; @@ -1181,11 +1185,11 @@ static bool paste_selection(Object *obedit, ReportList *reports) return false; } -static int paste_text_exec(bContext *C, wmOperator *op) +static wmOperatorStatus paste_text_exec(bContext *C, wmOperator *op) { const bool selection = RNA_boolean_get(op->ptr, "selection"); Object *obedit = CTX_data_edit_object(C); - int retval; + wmOperatorStatus retval; size_t len_utf8; char32_t *text_buf; @@ -1324,7 +1328,7 @@ static bool move_cursor_drop_select(Object *obedit, int dir) return true; } -static int move_cursor(bContext *C, int type, const bool select) +static wmOperatorStatus move_cursor(bContext *C, int type, const bool select) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Object *obedit = CTX_data_edit_object(C); @@ -1479,7 +1483,7 @@ static int move_cursor(bContext *C, int type, const bool select) return OPERATOR_FINISHED; } -static int move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus move_exec(bContext *C, wmOperator *op) { int type = RNA_enum_get(op->ptr, "type"); @@ -1510,7 +1514,7 @@ void FONT_OT_move(wmOperatorType *ot) /** \name Move Select Operator * \{ */ -static int move_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus move_select_exec(bContext *C, wmOperator *op) { int type = RNA_enum_get(op->ptr, "type"); @@ -1546,7 +1550,7 @@ void FONT_OT_move_select(wmOperatorType *ot) /** \name Change Spacing * \{ */ -static int change_spacing_exec(bContext *C, wmOperator *op) +static wmOperatorStatus change_spacing_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); Curve *cu = static_cast(obedit->data); @@ -1613,7 +1617,7 @@ void FONT_OT_change_spacing(wmOperatorType *ot) /** \name Change Character * \{ */ -static int change_character_exec(bContext *C, wmOperator *op) +static wmOperatorStatus change_character_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); Curve *cu = static_cast(obedit->data); @@ -1671,7 +1675,7 @@ void FONT_OT_change_character(wmOperatorType *ot) /** \name Line Break Operator * \{ */ -static int line_break_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus line_break_exec(bContext *C, wmOperator * /*op*/) { Object *obedit = CTX_data_edit_object(C); Curve *cu = static_cast(obedit->data); @@ -1718,7 +1722,7 @@ static const EnumPropertyItem delete_type_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus delete_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); Curve *cu = static_cast(obedit->data); @@ -1861,7 +1865,7 @@ void FONT_OT_delete(wmOperatorType *ot) /** \name Insert Text Operator * \{ */ -static int insert_text_exec(bContext *C, wmOperator *op) +static wmOperatorStatus insert_text_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); char *inserted_utf8; @@ -1892,7 +1896,7 @@ static int insert_text_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int insert_text_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus insert_text_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Object *obedit = CTX_data_edit_object(C); Curve *cu = static_cast(obedit->data); @@ -2061,7 +2065,9 @@ static void font_cursor_set_apply(bContext *C, const wmEvent *event) WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); } -static int font_selection_set_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus font_selection_set_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Object *obedit = CTX_data_active_object(C); Curve *cu = static_cast(obedit->data); @@ -2075,7 +2081,9 @@ static int font_selection_set_invoke(bContext *C, wmOperator *op, const wmEvent return OPERATOR_RUNNING_MODAL; } -static int font_selection_set_modal(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus font_selection_set_modal(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { switch (event->type) { case LEFTMOUSE: @@ -2113,7 +2121,7 @@ void FONT_OT_selection_set(wmOperatorType *ot) /** \name Select Word Operator * \{ */ -static int font_select_word_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus font_select_word_exec(bContext *C, wmOperator * /*op*/) { Object *obedit = CTX_data_edit_object(C); Curve *cu = static_cast(obedit->data); @@ -2149,7 +2157,7 @@ void FONT_OT_select_word(wmOperatorType *ot) /** \name Text-Box Add Operator * \{ */ -static int textbox_add_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus textbox_add_exec(bContext *C, wmOperator * /*op*/) { Object *obedit = CTX_data_active_object(C); Curve *cu = static_cast(obedit->data); @@ -2190,7 +2198,7 @@ void FONT_OT_textbox_add(wmOperatorType *ot) /** \name Text-Box Remove Operator * \{ */ -static int textbox_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus textbox_remove_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_active_object(C); Curve *cu = static_cast(obedit->data); @@ -2323,7 +2331,7 @@ static const EnumPropertyItem case_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int set_case(bContext *C, int ccase) +static wmOperatorStatus set_case(bContext *C, int ccase) { Object *obedit = CTX_data_edit_object(C); int selstart, selend; @@ -2344,7 +2352,7 @@ static int set_case(bContext *C, int ccase) return OPERATOR_FINISHED; } -static int set_case_exec(bContext *C, wmOperator *op) +static wmOperatorStatus set_case_exec(bContext *C, wmOperator *op) { return set_case(C, RNA_enum_get(op->ptr, "case")); } @@ -2376,7 +2384,7 @@ void FONT_OT_case_set(wmOperatorType *ot) /** \name Toggle Case Operator * \{ */ -static int toggle_case_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus toggle_case_exec(bContext *C, wmOperator * /*op*/) { Object *obedit = CTX_data_edit_object(C); Curve *cu = static_cast(obedit->data); @@ -2428,7 +2436,7 @@ static void font_open_cancel(bContext * /*C*/, wmOperator *op) op->customdata = nullptr; } -static int font_open_exec(bContext *C, wmOperator *op) +static wmOperatorStatus font_open_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); VFont *font; @@ -2467,7 +2475,7 @@ static int font_open_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int open_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus open_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { VFont *vfont = nullptr; char filepath[FILE_MAX]; @@ -2536,7 +2544,7 @@ void FONT_OT_open(wmOperatorType *ot) /** \name Delete Operator * \{ */ -static int font_unlink_exec(bContext *C, wmOperator *op) +static wmOperatorStatus font_unlink_exec(bContext *C, wmOperator *op) { VFont *builtin_font; diff --git a/source/blender/editors/curves/intern/curves_attribute_set.cc b/source/blender/editors/curves/intern/curves_attribute_set.cc index 226a68528c7..d31d31b5ee5 100644 --- a/source/blender/editors/curves/intern/curves_attribute_set.cc +++ b/source/blender/editors/curves/intern/curves_attribute_set.cc @@ -88,7 +88,7 @@ static void validate_value(const bke::AttributeAccessor attributes, type.copy_assign(validated_buffer, buffer); } -static int set_attribute_exec(bContext *C, wmOperator *op) +static wmOperatorStatus set_attribute_exec(bContext *C, wmOperator *op) { Object *active_object = CTX_data_active_object(C); Curves &active_curves_id = *static_cast(active_object->data); @@ -143,7 +143,7 @@ static int set_attribute_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int set_attribute_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus set_attribute_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Object *active_object = CTX_data_active_object(C); Curves &active_curves_id = *static_cast(active_object->data); diff --git a/source/blender/editors/curves/intern/curves_draw.cc b/source/blender/editors/curves/intern/curves_draw.cc index eb60f4bc27f..1d78702246d 100644 --- a/source/blender/editors/curves/intern/curves_draw.cc +++ b/source/blender/editors/curves/intern/curves_draw.cc @@ -734,7 +734,7 @@ static void create_NURBS(bke::CurvesGeometry &curves, radii.finish(); } -static int curves_draw_exec(bContext *C, wmOperator *op) +static wmOperatorStatus curves_draw_exec(bContext *C, wmOperator *op) { if (op->customdata == nullptr) { if (!curve_draw_init(C, op, false)) { @@ -1046,7 +1046,7 @@ static int curves_draw_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int curves_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus curves_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (RNA_struct_property_is_set(op->ptr, "stroke")) { return curves_draw_exec(C, op); @@ -1272,9 +1272,9 @@ static void curve_draw_exec_precalc(wmOperator *op) } } -static int curves_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus curves_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) { - int ret = OPERATOR_RUNNING_MODAL; + wmOperatorStatus ret = OPERATOR_RUNNING_MODAL; CurveDrawData *cdd = static_cast(op->customdata); UNUSED_VARS(C, op); diff --git a/source/blender/editors/curves/intern/curves_extrude.cc b/source/blender/editors/curves/intern/curves_extrude.cc index cefa2526e47..d4a70639c9c 100644 --- a/source/blender/editors/curves/intern/curves_extrude.cc +++ b/source/blender/editors/curves/intern/curves_extrude.cc @@ -231,7 +231,7 @@ static bke::CurvesGeometry extrude_curves(const bke::CurvesGeometry &curves, return new_curves; } -static int curves_extrude_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus curves_extrude_exec(bContext *C, wmOperator * /*op*/) { bool extruded = false; for (Curves *curves_id : get_unique_editable_curves(*C)) { diff --git a/source/blender/editors/curves/intern/curves_ops.cc b/source/blender/editors/curves/intern/curves_ops.cc index dc84cea3943..8fe64ebb7c5 100644 --- a/source/blender/editors/curves/intern/curves_ops.cc +++ b/source/blender/editors/curves/intern/curves_ops.cc @@ -396,7 +396,7 @@ static void try_convert_single_object(Object &curves_ob, DEG_id_tag_update(&settings.id, ID_RECALC_SYNC_TO_EVAL); } -static int curves_convert_to_particle_system_exec(bContext *C, wmOperator *op) +static wmOperatorStatus curves_convert_to_particle_system_exec(bContext *C, wmOperator *op) { Main &bmain = *CTX_data_main(C); Scene &scene = *CTX_data_scene(C); @@ -515,7 +515,7 @@ static bke::CurvesGeometry particles_to_curves(Object &object, ParticleSystem &p return curves; } -static int curves_convert_from_particle_system_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus curves_convert_from_particle_system_exec(bContext *C, wmOperator * /*op*/) { Main &bmain = *CTX_data_main(C); Scene &scene = *CTX_data_scene(C); @@ -699,7 +699,7 @@ static void snap_curves_to_surface_exec_object(Object &curves_ob, DEG_id_tag_update(&curves_id.id, ID_RECALC_GEOMETRY); } -static int snap_curves_to_surface_exec(bContext *C, wmOperator *op) +static wmOperatorStatus snap_curves_to_surface_exec(bContext *C, wmOperator *op) { const AttachMode attach_mode = static_cast(RNA_enum_get(op->ptr, "attach_mode")); @@ -778,7 +778,7 @@ static void CURVES_OT_snap_curves_to_surface(wmOperatorType *ot) namespace set_selection_domain { -static int curves_set_selection_domain_exec(bContext *C, wmOperator *op) +static wmOperatorStatus curves_set_selection_domain_exec(bContext *C, wmOperator *op) { const bke::AttrDomain domain = bke::AttrDomain(RNA_enum_get(op->ptr, "domain")); @@ -864,7 +864,7 @@ static bool has_anything_selected(const Span curves_ids) }); } -static int select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_all_exec(bContext *C, wmOperator *op) { int action = RNA_enum_get(op->ptr, "action"); @@ -901,7 +901,7 @@ static void CURVES_OT_select_all(wmOperatorType *ot) WM_operator_properties_select_all(ot); } -static int select_random_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_random_exec(bContext *C, wmOperator *op) { VectorSet unique_curves = curves::get_unique_editable_curves(*C); @@ -975,7 +975,7 @@ static void CURVES_OT_select_random(wmOperatorType *ot) 1.0f); } -static int select_ends_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_ends_exec(bContext *C, wmOperator *op) { VectorSet unique_curves = curves::get_unique_editable_curves(*C); const int amount_start = RNA_int_get(op->ptr, "amount_start"); @@ -1056,7 +1056,7 @@ static void CURVES_OT_select_ends(wmOperatorType *ot) INT32_MAX); } -static int select_linked_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus select_linked_exec(bContext *C, wmOperator * /*op*/) { VectorSet unique_curves = get_unique_editable_curves(*C); for (Curves *curves_id : unique_curves) { @@ -1083,7 +1083,7 @@ static void CURVES_OT_select_linked(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int select_more_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus select_more_exec(bContext *C, wmOperator * /*op*/) { VectorSet unique_curves = get_unique_editable_curves(*C); for (Curves *curves_id : unique_curves) { @@ -1110,7 +1110,7 @@ static void CURVES_OT_select_more(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int select_less_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus select_less_exec(bContext *C, wmOperator * /*op*/) { VectorSet unique_curves = get_unique_editable_curves(*C); for (Curves *curves_id : unique_curves) { @@ -1139,7 +1139,7 @@ static void CURVES_OT_select_less(wmOperatorType *ot) namespace split { -static int split_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus split_exec(bContext *C, wmOperator * /*op*/) { VectorSet unique_curves = get_unique_editable_curves(*C); for (Curves *curves_id : unique_curves) { @@ -1188,7 +1188,7 @@ static bool surface_set_poll(bContext *C) return true; } -static int surface_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus surface_set_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1266,7 +1266,7 @@ static void CURVES_OT_surface_set(wmOperatorType *ot) namespace curves_delete { -static int delete_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus delete_exec(bContext *C, wmOperator * /*op*/) { for (Curves *curves_id : get_unique_editable_curves(*C)) { bke::CurvesGeometry &curves = curves_id->geometry.wrap(); @@ -1295,7 +1295,7 @@ static void CURVES_OT_delete(wmOperatorType *ot) namespace curves_duplicate { -static int duplicate_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus duplicate_exec(bContext *C, wmOperator * /*op*/) { for (Curves *curves_id : get_unique_editable_curves(*C)) { bke::CurvesGeometry &curves = curves_id->geometry.wrap(); @@ -1333,7 +1333,7 @@ static void CURVES_OT_duplicate(wmOperatorType *ot) namespace clear_tilt { -static int exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus exec(bContext *C, wmOperator * /*op*/) { for (Curves *curves_id : get_unique_editable_curves(*C)) { bke::CurvesGeometry &curves = curves_id->geometry.wrap(); @@ -1373,7 +1373,7 @@ static void CURVES_OT_tilt_clear(wmOperatorType *ot) namespace cyclic_toggle { -static int exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus exec(bContext *C, wmOperator * /*op*/) { for (Curves *curves_id : get_unique_editable_curves(*C)) { bke::CurvesGeometry &curves = curves_id->geometry.wrap(); @@ -1419,7 +1419,7 @@ static void CURVES_OT_cyclic_toggle(wmOperatorType *ot) namespace curve_type_set { -static int exec(bContext *C, wmOperator *op) +static wmOperatorStatus exec(bContext *C, wmOperator *op) { const CurveType dst_type = CurveType(RNA_enum_get(op->ptr, "type")); const bool use_handles = RNA_boolean_get(op->ptr, "use_handles"); @@ -1471,7 +1471,7 @@ static void CURVES_OT_curve_type_set(wmOperatorType *ot) namespace switch_direction { -static int exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus exec(bContext *C, wmOperator * /*op*/) { for (Curves *curves_id : get_unique_editable_curves(*C)) { bke::CurvesGeometry &curves = curves_id->geometry.wrap(); @@ -1505,7 +1505,7 @@ static void CURVES_OT_switch_direction(wmOperatorType *ot) namespace subdivide { -static int exec(bContext *C, wmOperator *op) +static wmOperatorStatus exec(bContext *C, wmOperator *op) { const int number_cuts = RNA_int_get(op->ptr, "number_cuts"); @@ -1643,7 +1643,7 @@ static CurvesGeometry generate_circle_primitive(const float radius) return curves; } -static int exec(bContext *C, wmOperator *op) +static wmOperatorStatus exec(bContext *C, wmOperator *op) { Object *object = CTX_data_edit_object(C); Curves *active_curves_id = static_cast(object->data); @@ -1703,7 +1703,7 @@ static CurvesGeometry generate_bezier_primitive(const float radius) return curves; } -static int exec(bContext *C, wmOperator *op) +static wmOperatorStatus exec(bContext *C, wmOperator *op) { Object *object = CTX_data_edit_object(C); Curves *active_curves_id = static_cast(object->data); @@ -1735,7 +1735,7 @@ static void CURVES_OT_add_bezier(wmOperatorType *ot) namespace set_handle_type { -static int exec(bContext *C, wmOperator *op) +static wmOperatorStatus exec(bContext *C, wmOperator *op) { const HandleType dst_handle_type = HandleType(RNA_enum_get(op->ptr, "type")); diff --git a/source/blender/editors/curves/intern/join.cc b/source/blender/editors/curves/intern/join.cc index 5211fdc5d35..7b99e3cf71e 100644 --- a/source/blender/editors/curves/intern/join.cc +++ b/source/blender/editors/curves/intern/join.cc @@ -21,7 +21,7 @@ namespace blender::ed::curves { -int join_objects_exec(bContext *C, wmOperator *op) +wmOperatorStatus join_objects_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/curves/intern/select_linked_pick.cc b/source/blender/editors/curves/intern/select_linked_pick.cc index faa5b3c3661..2e7c5287314 100644 --- a/source/blender/editors/curves/intern/select_linked_pick.cc +++ b/source/blender/editors/curves/intern/select_linked_pick.cc @@ -108,7 +108,9 @@ static bool select_linked_pick(bContext &C, const int2 &mval, const SelectPick_P return true; } -static int select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus select_linked_pick_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { SelectPick_Params params{}; params.sel_op = RNA_boolean_get(op->ptr, "deselect") ? SEL_OP_SUB : SEL_OP_ADD; diff --git a/source/blender/editors/curves/intern/separate.cc b/source/blender/editors/curves/intern/separate.cc index b042d78e672..66cfac3fe99 100644 --- a/source/blender/editors/curves/intern/separate.cc +++ b/source/blender/editors/curves/intern/separate.cc @@ -26,7 +26,7 @@ namespace blender::ed::curves { -static int separate_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus separate_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/geometry/geometry_attributes.cc b/source/blender/editors/geometry/geometry_attributes.cc index a75b49c8dce..7c7d29a48cc 100644 --- a/source/blender/editors/geometry/geometry_attributes.cc +++ b/source/blender/editors/geometry/geometry_attributes.cc @@ -269,7 +269,7 @@ static const EnumPropertyItem *geometry_attribute_domain_itemf(bContext *C, return rna_enum_attribute_domain_itemf(owner, false, r_free); } -static int geometry_attribute_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus geometry_attribute_add_exec(bContext *C, wmOperator *op) { Object *ob = object::context_object(C); ID *id = static_cast(ob->data); @@ -293,7 +293,9 @@ static int geometry_attribute_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int geometry_attribute_add_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus geometry_attribute_add_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { PropertyRNA *prop; prop = RNA_struct_find_property(op->ptr, "name"); @@ -361,7 +363,7 @@ void GEOMETRY_OT_attribute_add(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } -static int geometry_attribute_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus geometry_attribute_remove_exec(bContext *C, wmOperator *op) { Object *ob = object::context_object(C); ID *id = static_cast(ob->data); @@ -398,7 +400,7 @@ void GEOMETRY_OT_attribute_remove(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int geometry_color_attribute_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus geometry_color_attribute_add_exec(bContext *C, wmOperator *op) { Object *ob = object::context_object(C); ID *id = static_cast(ob->data); @@ -431,7 +433,9 @@ static int geometry_color_attribute_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int geometry_color_attribute_add_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus geometry_color_attribute_add_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { PropertyRNA *prop; prop = RNA_struct_find_property(op->ptr, "name"); @@ -499,7 +503,7 @@ bool convert_attribute(bke::MutableAttributeAccessor attributes, return true; } -static int geometry_attribute_convert_exec(bContext *C, wmOperator *op) +static wmOperatorStatus geometry_attribute_convert_exec(bContext *C, wmOperator *op) { Object *ob = object::context_object(C); ID *ob_data = static_cast(ob->data); @@ -645,7 +649,7 @@ void GEOMETRY_OT_color_attribute_add(wmOperatorType *ot) RNA_def_property_float_array_default(prop, default_color); } -static int geometry_color_attribute_set_render_exec(bContext *C, wmOperator *op) +static wmOperatorStatus geometry_color_attribute_set_render_exec(bContext *C, wmOperator *op) { Object *ob = object::context_object(C); ID *id = static_cast(ob->data); @@ -686,7 +690,7 @@ void GEOMETRY_OT_color_attribute_render_set(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } -static int geometry_color_attribute_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus geometry_color_attribute_remove_exec(bContext *C, wmOperator *op) { Object *ob = object::context_object(C); ID *id = static_cast(ob->data); @@ -736,7 +740,7 @@ void GEOMETRY_OT_color_attribute_remove(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int geometry_color_attribute_duplicate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus geometry_color_attribute_duplicate_exec(bContext *C, wmOperator *op) { Object *ob = object::context_object(C); ID *id = static_cast(ob->data); @@ -794,9 +798,9 @@ void GEOMETRY_OT_color_attribute_duplicate(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int geometry_attribute_convert_invoke(bContext *C, - wmOperator *op, - const wmEvent * /*event*/) +static wmOperatorStatus geometry_attribute_convert_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Object *ob = object::context_object(C); ID *id = static_cast(ob->data); @@ -910,7 +914,7 @@ static bool geometry_color_attribute_convert_poll(bContext *C) return true; } -static int geometry_color_attribute_convert_exec(bContext *C, wmOperator *op) +static wmOperatorStatus geometry_color_attribute_convert_exec(bContext *C, wmOperator *op) { Object *ob = object::context_object(C); Mesh *mesh = static_cast(ob->data); @@ -924,9 +928,9 @@ static int geometry_color_attribute_convert_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int geometry_color_attribute_convert_invoke(bContext *C, - wmOperator *op, - const wmEvent * /*event*/) +static wmOperatorStatus geometry_color_attribute_convert_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Object *ob = object::context_object(C); Mesh *mesh = static_cast(ob->data); diff --git a/source/blender/editors/geometry/geometry_randomization.cc b/source/blender/editors/geometry/geometry_randomization.cc index 9c665f7a1cf..d42f186064c 100644 --- a/source/blender/editors/geometry/geometry_randomization.cc +++ b/source/blender/editors/geometry/geometry_randomization.cc @@ -19,13 +19,15 @@ namespace blender::ed::geometry { -static int geometry_randomization_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus geometry_randomization_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { RNA_boolean_set(op->ptr, "value", G.randomize_geometry_element_order); return WM_operator_props_popup(C, op, event); } -static int geometry_randomization_exec(bContext *C, wmOperator *op) +static wmOperatorStatus geometry_randomization_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); diff --git a/source/blender/editors/geometry/node_group_operator.cc b/source/blender/editors/geometry/node_group_operator.cc index ffd41638cfc..7b33bd4cd89 100644 --- a/source/blender/editors/geometry/node_group_operator.cc +++ b/source/blender/editors/geometry/node_group_operator.cc @@ -518,7 +518,7 @@ static Vector gather_supported_objects(const bContext &C, return objects; } -static int run_node_group_exec(bContext *C, wmOperator *op) +static wmOperatorStatus run_node_group_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -688,7 +688,7 @@ static void store_input_node_values_rna_props(const bContext &C, RNA_boolean_set(op.ptr, "viewport_is_perspective", rv3d ? bool(rv3d->is_persp) : true); } -static int run_node_group_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus run_node_group_invoke(bContext *C, wmOperator *op, const wmEvent *event) { const bNodeTree *node_tree = get_node_group(*C, *op->ptr, op->reports); if (!node_tree) { diff --git a/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.cc b/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.cc index 89076472bb5..c6ef025225b 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.cc +++ b/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.cc @@ -320,10 +320,10 @@ static int gizmo_arrow_test_select(bContext * /*C*/, wmGizmo *gz, const int mval * Calculate arrow offset independent from prop min value, * meaning the range will not be offset by min value first. */ -static int gizmo_arrow_modal(bContext *C, - wmGizmo *gz, - const wmEvent *event, - eWM_GizmoFlagTweak tweak_flag) +static wmOperatorStatus gizmo_arrow_modal(bContext *C, + wmGizmo *gz, + const wmEvent *event, + eWM_GizmoFlagTweak tweak_flag) { if (event->type != MOUSEMOVE) { return OPERATOR_RUNNING_MODAL; @@ -421,7 +421,7 @@ static void gizmo_arrow_setup(wmGizmo *gz) arrow->data.range_fac = 1.0f; } -static int gizmo_arrow_invoke(bContext * /*C*/, wmGizmo *gz, const wmEvent *event) +static wmOperatorStatus gizmo_arrow_invoke(bContext * /*C*/, wmGizmo *gz, const wmEvent *event) { ArrowGizmo3D *arrow = (ArrowGizmo3D *)gz; GizmoInteraction *inter = static_cast( diff --git a/source/blender/editors/gizmo_library/gizmo_types/blank3d_gizmo.cc b/source/blender/editors/gizmo_library/gizmo_types/blank3d_gizmo.cc index 284a253cc4c..64d259685c2 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/blank3d_gizmo.cc +++ b/source/blender/editors/gizmo_library/gizmo_types/blank3d_gizmo.cc @@ -22,7 +22,9 @@ static void gizmo_blank_draw(const bContext * /*C*/, wmGizmo * /*gz*/) /* pass */ } -static int gizmo_blank_invoke(bContext * /*C*/, wmGizmo * /*gz*/, const wmEvent * /*event*/) +static wmOperatorStatus gizmo_blank_invoke(bContext * /*C*/, + wmGizmo * /*gz*/, + const wmEvent * /*event*/) { return OPERATOR_RUNNING_MODAL; } diff --git a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.cc b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.cc index da01e34fd31..1dfeb665cfa 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.cc +++ b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.cc @@ -1017,7 +1017,7 @@ static void gizmo_cage2d_setup(wmGizmo *gz) gz->flag |= WM_GIZMO_DRAW_MODAL | WM_GIZMO_DRAW_NO_SCALE; } -static int gizmo_cage2d_invoke(bContext *C, wmGizmo *gz, const wmEvent *event) +static wmOperatorStatus gizmo_cage2d_invoke(bContext *C, wmGizmo *gz, const wmEvent *event) { RectTransformInteraction *data = static_cast( MEM_callocN(sizeof(RectTransformInteraction), "cage_interaction")); @@ -1092,10 +1092,10 @@ static void gizmo_pivot_from_scale_part(int part, float r_pt[2]) } } -static int gizmo_cage2d_modal(bContext *C, - wmGizmo *gz, - const wmEvent *event, - eWM_GizmoFlagTweak /*tweak_flag*/) +static wmOperatorStatus gizmo_cage2d_modal(bContext *C, + wmGizmo *gz, + const wmEvent *event, + eWM_GizmoFlagTweak /*tweak_flag*/) { RectTransformInteraction *data = static_cast(gz->interaction_data); int transform_flag = RNA_enum_get(gz->ptr, "transform"); diff --git a/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.cc b/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.cc index 55b5f18d906..0637cc0a53c 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.cc +++ b/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.cc @@ -441,7 +441,7 @@ static void gizmo_cage3d_setup(wmGizmo *gz) WM_GIZMO_DRAW_NO_SCALE; } -static int gizmo_cage3d_invoke(bContext *C, wmGizmo *gz, const wmEvent *event) +static wmOperatorStatus gizmo_cage3d_invoke(bContext *C, wmGizmo *gz, const wmEvent *event) { RectTransformInteraction *data = static_cast( MEM_callocN(sizeof(RectTransformInteraction), "cage_interaction")); @@ -460,10 +460,10 @@ static int gizmo_cage3d_invoke(bContext *C, wmGizmo *gz, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int gizmo_cage3d_modal(bContext *C, - wmGizmo *gz, - const wmEvent *event, - eWM_GizmoFlagTweak /*tweak_flag*/) +static wmOperatorStatus gizmo_cage3d_modal(bContext *C, + wmGizmo *gz, + const wmEvent *event, + eWM_GizmoFlagTweak /*tweak_flag*/) { if (event->type != MOUSEMOVE) { return OPERATOR_RUNNING_MODAL; diff --git a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.cc b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.cc index b09022113ca..9d918bacb3f 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.cc +++ b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.cc @@ -500,10 +500,10 @@ static void gizmo_dial_draw(const bContext *C, wmGizmo *gz) GPU_blend(GPU_BLEND_NONE); } -static int gizmo_dial_modal(bContext *C, - wmGizmo *gz, - const wmEvent *event, - eWM_GizmoFlagTweak tweak_flag) +static wmOperatorStatus gizmo_dial_modal(bContext *C, + wmGizmo *gz, + const wmEvent *event, + eWM_GizmoFlagTweak tweak_flag) { DialInteraction *inter = static_cast(gz->interaction_data); if (!inter) { @@ -596,7 +596,7 @@ static void gizmo_dial_setup(wmGizmo *gz) copy_v3_v3(gz->matrix_basis[2], dir_default); } -static int gizmo_dial_invoke(bContext * /*C*/, wmGizmo *gz, const wmEvent *event) +static wmOperatorStatus gizmo_dial_invoke(bContext * /*C*/, wmGizmo *gz, const wmEvent *event) { if (gz->custom_modal) { /* #DialInteraction is only used for the inner modal. */ diff --git a/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.cc b/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.cc index 1f0b532bb87..e9538bdc6ff 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.cc +++ b/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.cc @@ -61,10 +61,10 @@ static void gizmo_move_matrix_basis_get(const wmGizmo *gz, float r_matrix[4][4]) add_v3_v3(r_matrix[3], move->prop_co); } -static int gizmo_move_modal(bContext *C, - wmGizmo *gz, - const wmEvent *event, - eWM_GizmoFlagTweak tweak_flag); +static wmOperatorStatus gizmo_move_modal(bContext *C, + wmGizmo *gz, + const wmEvent *event, + eWM_GizmoFlagTweak tweak_flag); struct MoveInteraction { struct { @@ -233,10 +233,10 @@ static void gizmo_move_draw(const bContext *C, wmGizmo *gz) GPU_blend(GPU_BLEND_NONE); } -static int gizmo_move_modal(bContext *C, - wmGizmo *gz, - const wmEvent *event, - eWM_GizmoFlagTweak tweak_flag) +static wmOperatorStatus gizmo_move_modal(bContext *C, + wmGizmo *gz, + const wmEvent *event, + eWM_GizmoFlagTweak tweak_flag) { using namespace blender::ed; MoveInteraction *inter = static_cast(gz->interaction_data); @@ -352,7 +352,7 @@ static void gizmo_move_exit(bContext *C, wmGizmo *gz, const bool cancel) } } -static int gizmo_move_invoke(bContext *C, wmGizmo *gz, const wmEvent *event) +static wmOperatorStatus gizmo_move_invoke(bContext *C, wmGizmo *gz, const wmEvent *event) { const bool use_snap = RNA_boolean_get(gz->ptr, "use_snap"); diff --git a/source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.cc b/source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.cc index ff70eb1dfd7..e3eabed58c6 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.cc +++ b/source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.cc @@ -229,7 +229,9 @@ static void gizmo_primitive_setup(wmGizmo *gz) gz_prim->draw_inner = true; } -static int gizmo_primitive_invoke(bContext * /*C*/, wmGizmo *gz, const wmEvent * /*event*/) +static wmOperatorStatus gizmo_primitive_invoke(bContext * /*C*/, + wmGizmo *gz, + const wmEvent * /*event*/) { GizmoInteraction *inter = static_cast( MEM_callocN(sizeof(GizmoInteraction), __func__)); diff --git a/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.cc b/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.cc index 9f33c5a4a6d..fcaf9bd93fe 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.cc +++ b/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.cc @@ -278,15 +278,17 @@ static int snap_gizmo_test_select(bContext *C, wmGizmo *gz, const int mval[2]) return -1; } -static int snap_gizmo_modal(bContext * /*C*/, - wmGizmo * /*gz*/, - const wmEvent * /*event*/, - eWM_GizmoFlagTweak /*tweak_flag*/) +static wmOperatorStatus snap_gizmo_modal(bContext * /*C*/, + wmGizmo * /*gz*/, + const wmEvent * /*event*/, + eWM_GizmoFlagTweak /*tweak_flag*/) { return OPERATOR_RUNNING_MODAL; } -static int snap_gizmo_invoke(bContext * /*C*/, wmGizmo * /*gz*/, const wmEvent * /*event*/) +static wmOperatorStatus snap_gizmo_invoke(bContext * /*C*/, + wmGizmo * /*gz*/, + const wmEvent * /*event*/) { return OPERATOR_RUNNING_MODAL; } diff --git a/source/blender/editors/gpencil_legacy/annotate_paint.cc b/source/blender/editors/gpencil_legacy/annotate_paint.cc index e1751036c1a..36b41922438 100644 --- a/source/blender/editors/gpencil_legacy/annotate_paint.cc +++ b/source/blender/editors/gpencil_legacy/annotate_paint.cc @@ -2185,7 +2185,7 @@ static void annotation_draw_apply_event( /* ------------------------------- */ /* operator 'redo' (i.e. after changing some properties, but also for repeat last) */ -static int annotation_draw_exec(bContext *C, wmOperator *op) +static wmOperatorStatus annotation_draw_exec(bContext *C, wmOperator *op) { tGPsdata *p = nullptr; Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -2252,7 +2252,7 @@ static int annotation_draw_exec(bContext *C, wmOperator *op) /* ------------------------------- */ /* start of interactive drawing part of operator */ -static int annotation_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus annotation_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event) { tGPsdata *p = nullptr; @@ -2419,11 +2419,11 @@ static void annotation_add_missing_events(bContext *C, } /* events handling during interactive drawing part of operator */ -static int annotation_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus annotation_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) { tGPsdata *p = static_cast(op->customdata); /* Default exit state - pass through to support MMB view navigation, etc. */ - int estate = OPERATOR_PASS_THROUGH; + wmOperatorStatus estate = OPERATOR_PASS_THROUGH; /* NOTE(mike erwin): Not quite what I was looking for, but a good start! * grease-pencil continues to draw on the screen while the 3D mouse moves the viewpoint. @@ -2708,8 +2708,10 @@ static int annotation_draw_modal(bContext *C, wmOperator *op, const wmEvent *eve annotation_draw_exit(C, op); break; - case OPERATOR_RUNNING_MODAL | OPERATOR_PASS_THROUGH: - /* event doesn't need to be handled */ + /* Event doesn't need to be handled. */ + /* `OPERATOR_RUNNING_MODAL | OPERATOR_PASS_THROUGH` */ + default: + /* Quiet warnings. */ break; } diff --git a/source/blender/editors/gpencil_legacy/gpencil_data.cc b/source/blender/editors/gpencil_legacy/gpencil_data.cc index c06385e43d2..0e3dce2e955 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_data.cc +++ b/source/blender/editors/gpencil_legacy/gpencil_data.cc @@ -61,7 +61,7 @@ static bool gpencil_data_add_poll(bContext *C) } /* add new datablock - wrapper around API */ -static int gpencil_data_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gpencil_data_add_exec(bContext *C, wmOperator *op) { PointerRNA gpd_owner = {}; bGPdata **gpd_ptr = ED_annotation_data_get_pointers(C, &gpd_owner); @@ -131,7 +131,7 @@ static bool gpencil_data_unlink_poll(bContext *C) } /* unlink datablock - wrapper around API */ -static int gpencil_data_unlink_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gpencil_data_unlink_exec(bContext *C, wmOperator *op) { bGPdata **gpd_ptr = ED_annotation_data_get_pointers(C, nullptr); @@ -170,7 +170,7 @@ void GPENCIL_OT_data_unlink(wmOperatorType *ot) /* ******************* Add New Layer ************************ */ /* add new layer - wrapper around API */ -static int gpencil_layer_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gpencil_layer_add_exec(bContext *C, wmOperator *op) { PointerRNA gpd_owner = {}; Main *bmain = CTX_data_main(C); @@ -222,7 +222,7 @@ void GPENCIL_OT_layer_annotation_add(wmOperatorType *ot) } /* ******************* Remove Active Layer ************************* */ -static int gpencil_layer_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gpencil_layer_remove_exec(bContext *C, wmOperator *op) { bGPdata *gpd = ED_annotation_data_get_active(C); bGPDlayer *gpl = BKE_gpencil_layer_active_get(gpd); @@ -305,7 +305,7 @@ enum { GP_LAYER_MOVE_DOWN = 1, }; -static int gpencil_layer_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gpencil_layer_move_exec(bContext *C, wmOperator *op) { bGPdata *gpd = ED_annotation_data_get_active(C); bGPDlayer *gpl = BKE_gpencil_layer_active_get(gpd); diff --git a/source/blender/editors/gpencil_legacy/gpencil_edit.cc b/source/blender/editors/gpencil_legacy/gpencil_edit.cc index 84a48f78145..62d4ac68c20 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_edit.cc +++ b/source/blender/editors/gpencil_legacy/gpencil_edit.cc @@ -116,7 +116,7 @@ static bool annotation_actframe_delete_poll(bContext *C) } /* delete active frame - wrapper around API calls */ -static int gpencil_actframe_delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gpencil_actframe_delete_exec(bContext *C, wmOperator *op) { bGPdata *gpd = ED_annotation_data_get_active(C); bGPDlayer *gpl = BKE_gpencil_layer_active_get(gpd); diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_bake_animation.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_bake_animation.cc index 8d8ee53838c..0a8f80c7852 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_bake_animation.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_bake_animation.cc @@ -46,9 +46,9 @@ static void ensure_valid_frame_end(Main * /*main*/, Scene * /*scene*/, PointerRN } } -static int bake_grease_pencil_animation_invoke(bContext *C, - wmOperator *op, - const wmEvent * /*event*/) +static wmOperatorStatus bake_grease_pencil_animation_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { const Scene *scene = CTX_data_scene(C); @@ -134,7 +134,7 @@ static Set get_selected_object_keyframes(Span bake_targets) return keyframes; } -static int bake_grease_pencil_animation_exec(bContext *C, wmOperator *op) +static wmOperatorStatus bake_grease_pencil_animation_exec(bContext *C, wmOperator *op) { using namespace bke::greasepencil; diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_edit.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_edit.cc index f5f6598213e..dd016bf0ce9 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_edit.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_edit.cc @@ -83,7 +83,7 @@ namespace blender::ed::greasepencil { /** \name Smooth Stroke Operator * \{ */ -static int grease_pencil_stroke_smooth_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_stroke_smooth_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -265,7 +265,7 @@ static IndexMask simplify_fixed(const bke::CurvesGeometry &curves, {selected_to_keep, selected_points.complement(curves.points_range(), memory)}, memory); } -static int grease_pencil_stroke_simplify_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_stroke_simplify_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -430,7 +430,7 @@ static void GREASE_PENCIL_OT_stroke_simplify(wmOperatorType *ot) /** \name Delete Operator * \{ */ -static int grease_pencil_delete_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus grease_pencil_delete_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -571,7 +571,7 @@ static Array get_points_to_dissolve(bke::CurvesGeometry &curves, return points_to_dissolve; } -static int grease_pencil_dissolve_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_dissolve_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -660,7 +660,7 @@ static const EnumPropertyItem prop_greasepencil_deleteframe_types[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int grease_pencil_delete_frame_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_delete_frame_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -721,7 +721,7 @@ static void GREASE_PENCIL_OT_delete_frame(wmOperatorType *ot) /** \name Stroke Material Set Operator * \{ */ -static int grease_pencil_stroke_material_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_stroke_material_set_exec(bContext *C, wmOperator *op) { using namespace blender; Main *bmain = CTX_data_main(C); @@ -840,7 +840,7 @@ static bke::CurvesGeometry subdivide_last_segement(const bke::CurvesGeometry &cu return geometry::subdivide_curves(curves, strokes, cuts); } -static int grease_pencil_cyclical_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_cyclical_set_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -932,7 +932,7 @@ static void GREASE_PENCIL_OT_cyclical_set(wmOperatorType *ot) /** \name Set Active Material Operator * \{ */ -static int grease_pencil_set_active_material_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus grease_pencil_set_active_material_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -980,7 +980,7 @@ static void GREASE_PENCIL_OT_set_active_material(wmOperatorType *ot) /** \name Set Uniform Thickness Operator * \{ */ -static int grease_pencil_set_uniform_thickness_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_set_uniform_thickness_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -1034,7 +1034,7 @@ static void GREASE_PENCIL_OT_set_uniform_thickness(wmOperatorType *ot) /** \name Set Uniform Opacity Operator * \{ */ -static int grease_pencil_set_uniform_opacity_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_set_uniform_opacity_exec(bContext *C, wmOperator *op) { using namespace blender::bke; @@ -1103,7 +1103,8 @@ static void GREASE_PENCIL_OT_set_uniform_opacity(wmOperatorType *ot) /** \name Switch Direction Operator * \{ */ -static int grease_pencil_stroke_switch_direction_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus grease_pencil_stroke_switch_direction_exec(bContext *C, + wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -1217,7 +1218,7 @@ static bke::CurvesGeometry set_start_point(const bke::CurvesGeometry &curves, return dst_curves; } -static int grease_pencil_set_start_point_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus grease_pencil_set_start_point_exec(bContext *C, wmOperator * /*op*/) { using namespace bke::greasepencil; const Scene *scene = CTX_data_scene(C); @@ -1288,7 +1289,7 @@ static void toggle_caps(MutableSpan caps, const IndexMask &strokes) }); } -static int grease_pencil_caps_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_caps_set_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -1425,7 +1426,7 @@ static const EnumPropertyItem *material_enum_itemf(bContext *C, return item; } -static int grease_pencil_set_material_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_set_material_exec(bContext *C, wmOperator *op) { Object *object = CTX_data_active_object(C); GreasePencil &grease_pencil = *static_cast(object->data); @@ -1465,7 +1466,7 @@ static void GREASE_PENCIL_OT_set_material(wmOperatorType *ot) /** \name Duplicate Operator * \{ */ -static int grease_pencil_duplicate_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus grease_pencil_duplicate_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -1514,7 +1515,7 @@ static void GREASE_PENCIL_OT_duplicate(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int grease_pencil_clean_loose_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_clean_loose_exec(bContext *C, wmOperator *op) { Object *object = CTX_data_active_object(C); Scene &scene = *CTX_data_scene(C); @@ -1545,7 +1546,9 @@ static int grease_pencil_clean_loose_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int grease_pencil_clean_loose_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus grease_pencil_clean_loose_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { return WM_operator_props_popup_confirm_ex( C, op, event, IFACE_("Remove Loose Points"), IFACE_("Delete")); @@ -1580,7 +1583,7 @@ static void GREASE_PENCIL_OT_clean_loose(wmOperatorType *ot) /** \name Stroke Subdivide Operator * \{ */ -static int gpencil_stroke_subdivide_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gpencil_stroke_subdivide_exec(bContext *C, wmOperator *op) { const int cuts = RNA_int_get(op->ptr, "number_cuts"); const bool only_selected = RNA_boolean_get(op->ptr, "only_selected"); @@ -1777,7 +1780,7 @@ static Array get_reordered_indices(const IndexRange universe, return indices; } -static int grease_pencil_stroke_reorder_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_stroke_reorder_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -1846,7 +1849,7 @@ static void GREASE_PENCIL_OT_stroke_reorder(wmOperatorType *ot) /** \name Move To Layer Operator * \{ */ -static int grease_pencil_move_to_layer_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_move_to_layer_exec(bContext *C, wmOperator *op) { using namespace bke::greasepencil; const Scene *scene = CTX_data_scene(C); @@ -1930,7 +1933,9 @@ static int grease_pencil_move_to_layer_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int grease_pencil_move_to_layer_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus grease_pencil_move_to_layer_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { const bool add_new_layer = RNA_boolean_get(op->ptr, "add_new_layer"); if (add_new_layer) { @@ -2293,7 +2298,7 @@ static bool grease_pencil_separate_material(bContext &C, return changed; } -static int grease_pencil_separate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_separate_exec(bContext *C, wmOperator *op) { using namespace bke::greasepencil; Main *bmain = CTX_data_main(C); @@ -2481,7 +2486,7 @@ static bke::GeometrySet join_geometries_with_transform(Span ge geometries, VArray::ForSingle(transform, geometries.size())); } -static int grease_pencil_copy_strokes_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_copy_strokes_exec(bContext *C, wmOperator *op) { using bke::greasepencil::Layer; @@ -2656,7 +2661,7 @@ enum class PasteType { ByLayer = 1, }; -static int grease_pencil_paste_strokes_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_paste_strokes_exec(bContext *C, wmOperator *op) { using namespace bke::greasepencil; Main *bmain = CTX_data_main(C); @@ -2881,7 +2886,7 @@ IndexRange paste_all_strokes_from_clipboard(Main &bmain, /* -------------------------------------------------------------------- */ /** \name Merge Stroke Operator * \{ */ -static int grease_pencil_stroke_merge_by_distance_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_stroke_merge_by_distance_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -3060,7 +3065,7 @@ static bke::CurvesGeometry extrude_grease_pencil_curves(const bke::CurvesGeometr return dst; } -static int grease_pencil_extrude_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus grease_pencil_extrude_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -3109,7 +3114,7 @@ static void GREASE_PENCIL_OT_extrude(wmOperatorType *ot) /** \name Reproject Strokes Operator * \{ */ -static int grease_pencil_reproject_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_reproject_exec(bContext *C, wmOperator *op) { Scene &scene = *CTX_data_scene(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -3358,7 +3363,7 @@ static bool grease_pencil_snap_poll(bContext *C) return (area != nullptr) && (area->spacetype == SPACE_VIEW3D); } -static int grease_pencil_snap_to_grid_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus grease_pencil_snap_to_grid_exec(bContext *C, wmOperator * /*op*/) { using bke::greasepencil::Layer; @@ -3421,7 +3426,7 @@ static void GREASE_PENCIL_OT_snap_to_grid(wmOperatorType *ot) /** \name Snapping Selection to Cursor Operator * \{ */ -static int grease_pencil_snap_to_cursor_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_snap_to_cursor_exec(bContext *C, wmOperator *op) { using bke::greasepencil::Layer; @@ -3560,7 +3565,7 @@ static bool grease_pencil_snap_compute_centroid(const Scene &scene, return true; } -static int grease_pencil_snap_cursor_to_sel_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus grease_pencil_snap_cursor_to_sel_exec(bContext *C, wmOperator * /*op*/) { Scene &scene = *CTX_data_scene(C); const Object &object = *CTX_data_active_object(C); @@ -3629,7 +3634,7 @@ static float4x3 expand_4x2_mat(float4x2 strokemat) return strokemat4x3; } -static int grease_pencil_texture_gradient_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_texture_gradient_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -3738,9 +3743,11 @@ static int grease_pencil_texture_gradient_exec(bContext *C, wmOperator *op) return OPERATOR_RUNNING_MODAL; } -static int grease_pencil_texture_gradient_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus grease_pencil_texture_gradient_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { - int ret = WM_gesture_straightline_modal(C, op, event); + wmOperatorStatus ret = WM_gesture_straightline_modal(C, op, event); /* Check for mouse release. */ if ((ret & OPERATOR_RUNNING_MODAL) != 0 && event->type == LEFTMOUSE && event->val == KM_RELEASE) @@ -3753,10 +3760,12 @@ static int grease_pencil_texture_gradient_modal(bContext *C, wmOperator *op, con return ret; } -static int grease_pencil_texture_gradient_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus grease_pencil_texture_gradient_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { /* Invoke interactive line drawing (representing the gradient) in viewport. */ - const int ret = WM_gesture_straightline_invoke(C, op, event); + const wmOperatorStatus ret = WM_gesture_straightline_invoke(C, op, event); if ((ret & OPERATOR_RUNNING_MODAL) != 0) { ARegion *region = CTX_wm_region(C); @@ -3797,7 +3806,7 @@ static void GREASE_PENCIL_OT_texture_gradient(wmOperatorType *ot) /** \name Set Curve Type Operator * \{ */ -static int grease_pencil_set_curve_type_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_set_curve_type_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -3865,7 +3874,7 @@ static void GREASE_PENCIL_OT_set_curve_type(wmOperatorType *ot) /** \name Set Handle Type Operator * \{ */ -static int grease_pencil_set_handle_type_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_set_handle_type_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -3946,7 +3955,7 @@ static void GREASE_PENCIL_OT_set_handle_type(wmOperatorType *ot) /** \name Set Curve Resolution Operator * \{ */ -static int grease_pencil_set_curve_resolution_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_set_curve_resolution_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -4010,7 +4019,7 @@ static void GREASE_PENCIL_OT_set_curve_resolution(wmOperatorType *ot) /** \name Set Curve Resolution Operator * \{ */ -static int grease_pencil_reset_uvs_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus grease_pencil_reset_uvs_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -4102,7 +4111,7 @@ static void GREASE_PENCIL_OT_reset_uvs(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int grease_pencil_stroke_split_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus grease_pencil_stroke_split_exec(bContext *C, wmOperator * /*op*/) { const Scene &scene = *CTX_data_scene(C); Object &object = *CTX_data_active_object(C); @@ -4501,7 +4510,7 @@ static void join_object_with_active(Main &bmain, } // namespace blender::ed::greasepencil -int ED_grease_pencil_join_objects_exec(bContext *C, wmOperator *op) +wmOperatorStatus ED_grease_pencil_join_objects_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_frames.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_frames.cc index b02a2157ee2..d07c66b0b32 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_frames.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_frames.cc @@ -375,7 +375,7 @@ bool ensure_active_keyframe(const Scene &scene, return true; } -static int insert_blank_frame_exec(bContext *C, wmOperator *op) +static wmOperatorStatus insert_blank_frame_exec(bContext *C, wmOperator *op) { using namespace blender::bke::greasepencil; Scene *scene = CTX_data_scene(C); @@ -505,7 +505,7 @@ static bool curves_geometry_is_equal(const bke::CurvesGeometry &curves_a, return true; } -static int frame_clean_duplicate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus frame_clean_duplicate_exec(bContext *C, wmOperator *op) { using namespace blender::bke::greasepencil; Object *object = CTX_data_active_object(C); @@ -796,7 +796,7 @@ bool grease_pencil_paste_keyframes(bAnimContext *ac, return true; } -static int grease_pencil_frame_duplicate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_frame_duplicate_exec(bContext *C, wmOperator *op) { using namespace blender::bke::greasepencil; Scene *scene = CTX_data_scene(C); @@ -857,7 +857,7 @@ static void GREASE_PENCIL_OT_frame_duplicate(wmOperatorType *ot) ot->srna, "all", false, "Duplicate all", "Duplicate active keyframes of all layer"); } -static int grease_pencil_active_frame_delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_active_frame_delete_exec(bContext *C, wmOperator *op) { using namespace blender::bke::greasepencil; Scene *scene = CTX_data_scene(C); @@ -933,7 +933,8 @@ static bool grease_pencil_active_breakdown_frame_poll(bContext *C) return false; } -static int grease_pencil_delete_breakdown_frames_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus grease_pencil_delete_breakdown_frames_exec(bContext *C, + wmOperator * /*op*/) { const Object &ob = *CTX_data_active_object(C); const Scene &scene = *CTX_data_scene(C); diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_join_selection.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_join_selection.cc index 1e802c12d2e..1a626d04ac9 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_join_selection.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_join_selection.cc @@ -423,7 +423,7 @@ void append_strokes_from(bke::CurvesGeometry &&other, bke::CurvesGeometry &dst) * This operator builds a new stroke from the points/curves selected. It makes a copy of all the * selected points and joins them in a single stroke, which is added to the active layer. */ -int grease_pencil_join_selection_exec(bContext *C, wmOperator *op) +wmOperatorStatus grease_pencil_join_selection_exec(bContext *C, wmOperator *op) { using namespace bke::greasepencil; diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_layers.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_layers.cc index c364eb7b533..f2cc24c4ed2 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_layers.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_layers.cc @@ -114,7 +114,7 @@ void select_layer_channel(GreasePencil &grease_pencil, bke::greasepencil::Layer } } -static int grease_pencil_layer_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_layer_add_exec(bContext *C, wmOperator *op) { using namespace blender::bke::greasepencil; Scene *scene = CTX_data_scene(C); @@ -153,7 +153,9 @@ static int grease_pencil_layer_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int grease_pencil_layer_add_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus grease_pencil_layer_add_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { return WM_operator_props_popup_confirm_ex(C, op, @@ -182,7 +184,7 @@ static void GREASE_PENCIL_OT_layer_add(wmOperatorType *ot) ot->prop = prop; } -static int grease_pencil_layer_remove_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus grease_pencil_layer_remove_exec(bContext *C, wmOperator * /*op*/) { using namespace blender::bke::greasepencil; GreasePencil &grease_pencil = *blender::ed::greasepencil::from_context(*C); @@ -249,7 +251,7 @@ static bool grease_pencil_layer_move_poll(bContext *C) return true; } -static int grease_pencil_layer_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_layer_move_exec(bContext *C, wmOperator *op) { using namespace blender::bke::greasepencil; GreasePencil &grease_pencil = *blender::ed::greasepencil::from_context(*C); @@ -290,7 +292,7 @@ static void GREASE_PENCIL_OT_layer_move(wmOperatorType *ot) ot->prop = RNA_def_enum(ot->srna, "direction", enum_layer_move_direction, 0, "Direction", ""); } -static int grease_pencil_layer_active_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_layer_active_exec(bContext *C, wmOperator *op) { using namespace blender::bke::greasepencil; Object *object = CTX_data_active_object(C); @@ -341,7 +343,7 @@ static void GREASE_PENCIL_OT_layer_active(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); } -static int grease_pencil_layer_group_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_layer_group_add_exec(bContext *C, wmOperator *op) { using namespace blender::bke::greasepencil; GreasePencil &grease_pencil = *blender::ed::greasepencil::from_context(*C); @@ -401,7 +403,7 @@ static void GREASE_PENCIL_OT_layer_group_add(wmOperatorType *ot) ot->prop = prop; } -static int grease_pencil_layer_group_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_layer_group_remove_exec(bContext *C, wmOperator *op) { using namespace blender::bke::greasepencil; const bool keep_children = RNA_boolean_get(op->ptr, "keep_children"); @@ -444,7 +446,7 @@ static void GREASE_PENCIL_OT_layer_group_remove(wmOperatorType *ot) "Keep the children nodes of the group and only delete the group itself"); } -static int grease_pencil_layer_hide_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_layer_hide_exec(bContext *C, wmOperator *op) { using namespace blender::bke::greasepencil; GreasePencil &grease_pencil = *blender::ed::greasepencil::from_context(*C); @@ -511,7 +513,7 @@ static void GREASE_PENCIL_OT_layer_hide(wmOperatorType *ot) ot->prop = prop; } -static int grease_pencil_layer_reveal_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus grease_pencil_layer_reveal_exec(bContext *C, wmOperator * /*op*/) { using namespace blender::bke::greasepencil; GreasePencil &grease_pencil = *blender::ed::greasepencil::from_context(*C); @@ -547,7 +549,7 @@ static void GREASE_PENCIL_OT_layer_reveal(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int grease_pencil_layer_isolate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_layer_isolate_exec(bContext *C, wmOperator *op) { using namespace blender::bke::greasepencil; GreasePencil &grease_pencil = *blender::ed::greasepencil::from_context(*C); @@ -605,7 +607,7 @@ static void GREASE_PENCIL_OT_layer_isolate(wmOperatorType *ot) ot->srna, "affect_visibility", false, "Affect Visibility", "Also affect the visibility"); } -static int grease_pencil_layer_lock_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_layer_lock_all_exec(bContext *C, wmOperator *op) { using namespace blender::bke::greasepencil; GreasePencil &grease_pencil = *blender::ed::greasepencil::from_context(*C); @@ -645,7 +647,7 @@ static void GREASE_PENCIL_OT_layer_lock_all(wmOperatorType *ot) RNA_def_boolean(ot->srna, "lock", true, "Lock Value", "Lock/Unlock all layers"); } -static int grease_pencil_layer_duplicate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_layer_duplicate_exec(bContext *C, wmOperator *op) { using namespace blender::bke::greasepencil; GreasePencil &grease_pencil = *blender::ed::greasepencil::from_context(*C); @@ -715,7 +717,7 @@ enum class MergeMode : int8_t { All = 2, }; -static int grease_pencil_merge_layer_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_merge_layer_exec(bContext *C, wmOperator *op) { using namespace blender::bke::greasepencil; Main *bmain = CTX_data_main(C); @@ -876,7 +878,7 @@ static void GREASE_PENCIL_OT_layer_merge(wmOperatorType *ot) ot->prop = RNA_def_enum(ot->srna, "mode", merge_modes, int(MergeMode::Down), "Mode", ""); } -static int grease_pencil_layer_mask_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_layer_mask_add_exec(bContext *C, wmOperator *op) { using namespace blender::bke::greasepencil; GreasePencil &grease_pencil = *blender::ed::greasepencil::from_context(*C); @@ -950,7 +952,7 @@ static bool grease_pencil_layer_mask_poll(bContext *C) return !BLI_listbase_is_empty(&active_layer.masks); } -static int grease_pencil_layer_mask_remove_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus grease_pencil_layer_mask_remove_exec(bContext *C, wmOperator * /*op*/) { using namespace blender::bke::greasepencil; GreasePencil &grease_pencil = *blender::ed::greasepencil::from_context(*C); @@ -1004,7 +1006,7 @@ static bool grease_pencil_layer_mask_reorder_poll(bContext *C) return BLI_listbase_count(&active_layer.masks) > 1; } -static int grease_pencil_layer_mask_reorder_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_layer_mask_reorder_exec(bContext *C, wmOperator *op) { using namespace blender::bke::greasepencil; GreasePencil &grease_pencil = *blender::ed::greasepencil::from_context(*C); @@ -1066,7 +1068,7 @@ const EnumPropertyItem enum_layergroup_color_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int grease_pencil_layer_group_color_tag_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_layer_group_color_tag_exec(bContext *C, wmOperator *op) { using namespace blender::bke::greasepencil; GreasePencil &grease_pencil = *blender::ed::greasepencil::from_context(*C); @@ -1170,7 +1172,7 @@ static void duplicate_layer_and_frames(GreasePencil &dst_grease_pencil, } } -static int grease_pencil_layer_duplicate_object_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_layer_duplicate_object_exec(bContext *C, wmOperator *op) { using namespace blender::bke::greasepencil; Object *src_object = CTX_data_active_object(C); diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_lineart.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_lineart.cc index 99eccde2f21..1e31e7694a9 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_lineart.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_lineart.cc @@ -345,10 +345,10 @@ static void lineart_bake_job_free(void *customdata) MEM_delete(bj); } -static int lineart_bake_common(bContext *C, - wmOperator *op, - bool bake_all_targets, - bool do_background) +static wmOperatorStatus lineart_bake_common(bContext *C, + wmOperator *op, + bool bake_all_targets, + bool do_background) { LineartBakeJob *bj = MEM_new(__func__); @@ -412,19 +412,21 @@ static int lineart_bake_common(bContext *C, return OPERATOR_FINISHED; } -static int lineart_bake_strokes_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus lineart_bake_strokes_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { bool bake_all = RNA_boolean_get(op->ptr, "bake_all"); return lineart_bake_common(C, op, bake_all, true); } -static int lineart_bake_strokes_exec(bContext *C, wmOperator *op) +static wmOperatorStatus lineart_bake_strokes_exec(bContext *C, wmOperator *op) { bool bake_all = RNA_boolean_get(op->ptr, "bake_all"); return lineart_bake_common(C, op, bake_all, false); } -static int lineart_bake_strokes_common_modal(bContext *C, - wmOperator *op, - const wmEvent * /*event*/) +static wmOperatorStatus lineart_bake_strokes_common_modal(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Scene *scene = static_cast(op->customdata); @@ -463,7 +465,7 @@ static void lineart_gpencil_clear_strokes_exec_common(Object *ob) DEG_id_tag_update(static_cast(ob->data), ID_RECALC_GEOMETRY); } -static int lineart_gpencil_clear_strokes_exec(bContext *C, wmOperator *op) +static wmOperatorStatus lineart_gpencil_clear_strokes_exec(bContext *C, wmOperator *op) { bool clear_all = RNA_boolean_get(op->ptr, "clear_all"); diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_material.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_material.cc index b5a63cbe9d9..410cbc90a43 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_material.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_material.cc @@ -31,7 +31,7 @@ namespace blender::ed::greasepencil { /** \name Show All Materials Operator * \{ */ -static int grease_pencil_material_reveal_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus grease_pencil_material_reveal_exec(bContext *C, wmOperator * /*op*/) { Object *object = CTX_data_active_object(C); GreasePencil &grease_pencil = *static_cast(object->data); @@ -74,7 +74,7 @@ static void GREASE_PENCIL_OT_material_reveal(wmOperatorType *ot) /** \name Hide Others Materials Operator * \{ */ -static int grease_pencil_material_hide_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_material_hide_exec(bContext *C, wmOperator *op) { Object *object = CTX_data_active_object(C); GreasePencil &grease_pencil = *static_cast(object->data); @@ -130,7 +130,7 @@ static void GREASE_PENCIL_OT_material_hide(wmOperatorType *ot) /** \name Lock All Materials Operator * \{ */ -static int grease_pencil_material_lock_all_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus grease_pencil_material_lock_all_exec(bContext *C, wmOperator * /*op*/) { Object *object = CTX_data_active_object(C); GreasePencil &grease_pencil = *static_cast(object->data); @@ -174,7 +174,7 @@ static void GREASE_PENCIL_OT_material_lock_all(wmOperatorType *ot) /** \name Unlock All Materials Operator * \{ */ -static int grease_pencil_material_unlock_all_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus grease_pencil_material_unlock_all_exec(bContext *C, wmOperator * /*op*/) { Object *object = CTX_data_active_object(C); GreasePencil &grease_pencil = *static_cast(object->data); @@ -217,7 +217,7 @@ static void GREASE_PENCIL_OT_material_unlock_all(wmOperatorType *ot) /** \name Lock Unused Materials Operator * \{ */ -static int grease_pencil_material_lock_unused_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus grease_pencil_material_lock_unused_exec(bContext *C, wmOperator * /*op*/) { Object *object = CTX_data_active_object(C); GreasePencil &grease_pencil = *static_cast(object->data); @@ -261,7 +261,8 @@ static void GREASE_PENCIL_OT_material_lock_unused(wmOperatorType *ot) /** \name Lock Unselected Materials Operator * \{ */ -static int grease_pencil_material_lock_unselected_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus grease_pencil_material_lock_unselected_exec(bContext *C, + wmOperator * /*op*/) { using namespace blender; using namespace blender::bke; @@ -337,7 +338,7 @@ static void GREASE_PENCIL_OT_material_lock_unselected(wmOperatorType *ot) /** \name Copy Materials to Selected Objects * \{ */ -static int grease_pencil_material_copy_to_object_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_material_copy_to_object_exec(bContext *C, wmOperator *op) { using namespace blender; using namespace blender::bke; @@ -401,7 +402,7 @@ static void GREASE_PENCIL_OT_material_copy_to_object(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); } -static int material_isolate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus material_isolate_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); GreasePencil &grease_pencil = *static_cast(ob->data); diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_modes.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_modes.cc index 0c2d61479f8..46524c55a80 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_modes.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_modes.cc @@ -50,7 +50,7 @@ static bool paintmode_toggle_poll(bContext *C) return false; } -static int paintmode_toggle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus paintmode_toggle_exec(bContext *C, wmOperator *op) { const bool back = RNA_boolean_get(op->ptr, "back"); @@ -162,7 +162,7 @@ static bool sculpt_poll_view3d(bContext *C) return true; } -static int sculptmode_toggle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sculptmode_toggle_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); ToolSettings *ts = CTX_data_tool_settings(C); @@ -252,7 +252,7 @@ static bool weightmode_toggle_poll(bContext *C) return false; } -static int weightmode_toggle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus weightmode_toggle_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -347,7 +347,7 @@ static bool vertexmode_toggle_poll(bContext *C) return false; } -static int vertexmode_toggle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertexmode_toggle_exec(bContext *C, wmOperator *op) { const bool back = RNA_boolean_get(op->ptr, "back"); diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_primitive.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_primitive.cc index 92378912e75..291d098e8f6 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_primitive.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_primitive.cc @@ -698,9 +698,12 @@ static void grease_pencil_primitive_update_view(bContext *C, PrimitiveToolOperat } /* Invoke handler: Initialize the operator. */ -static int grease_pencil_primitive_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus grease_pencil_primitive_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { - int return_value = ed::greasepencil::grease_pencil_draw_operator_invoke(C, op, false); + wmOperatorStatus return_value = ed::greasepencil::grease_pencil_draw_operator_invoke( + C, op, false); if (return_value != OPERATOR_RUNNING_MODAL) { return return_value; } @@ -1188,10 +1191,10 @@ static void grease_pencil_primitive_cursor_update(bContext *C, WM_cursor_modal_set(win, WM_CURSOR_NSEW_SCROLL); } -static int grease_pencil_primitive_event_modal_map(bContext *C, - wmOperator *op, - PrimitiveToolOperation &ptd, - const wmEvent *event) +static wmOperatorStatus grease_pencil_primitive_event_modal_map(bContext *C, + wmOperator *op, + PrimitiveToolOperation &ptd, + const wmEvent *event) { switch (event->val) { case int(ModalKeyMode::Cancel): { @@ -1316,7 +1319,8 @@ static int grease_pencil_primitive_event_modal_map(bContext *C, return OPERATOR_RUNNING_MODAL; } -static int grease_pencil_primitive_mouse_event(PrimitiveToolOperation &ptd, const wmEvent *event) +static wmOperatorStatus grease_pencil_primitive_mouse_event(PrimitiveToolOperation &ptd, + const wmEvent *event) { if (event->val == KM_RELEASE && ELEM(ptd.mode, OperatorMode::Grab, @@ -1434,7 +1438,9 @@ static void grease_pencil_primitive_operator_update(PrimitiveToolOperation &ptd, } /* Modal handler: Events handling during interactive part. */ -static int grease_pencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus grease_pencil_primitive_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { PrimitiveToolOperation &ptd = *reinterpret_cast(op->customdata); @@ -1463,7 +1469,7 @@ static int grease_pencil_primitive_modal(bContext *C, wmOperator *op, const wmEv grease_pencil_primitive_cursor_update(C, ptd, event); if (event->type == EVT_MODAL_MAP) { - const int return_val = grease_pencil_primitive_event_modal_map(C, op, ptd, event); + const wmOperatorStatus return_val = grease_pencil_primitive_event_modal_map(C, op, ptd, event); if (return_val != OPERATOR_RUNNING_MODAL) { return return_val; } @@ -1471,7 +1477,7 @@ static int grease_pencil_primitive_modal(bContext *C, wmOperator *op, const wmEv switch (event->type) { case LEFTMOUSE: { - const int return_val = grease_pencil_primitive_mouse_event(ptd, event); + const wmOperatorStatus return_val = grease_pencil_primitive_mouse_event(ptd, event); if (return_val != OPERATOR_RUNNING_MODAL) { return return_val; } diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_select.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_select.cc index 0cb802e5731..23f3bdbdccd 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_select.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_select.cc @@ -315,7 +315,7 @@ bool selection_update(const ViewContext *vc, /** \} */ -static int select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_all_exec(bContext *C, wmOperator *op) { int action = RNA_enum_get(op->ptr, "action"); Scene *scene = CTX_data_scene(C); @@ -364,7 +364,7 @@ static void GREASE_PENCIL_OT_select_all(wmOperatorType *ot) WM_operator_properties_select_all(ot); } -static int select_more_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus select_more_exec(bContext *C, wmOperator * /*op*/) { Object *object = CTX_data_active_object(C); GreasePencil &grease_pencil = *static_cast(object->data); @@ -400,7 +400,7 @@ static void GREASE_PENCIL_OT_select_more(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int select_less_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus select_less_exec(bContext *C, wmOperator * /*op*/) { Object *object = CTX_data_active_object(C); GreasePencil &grease_pencil = *static_cast(object->data); @@ -436,7 +436,7 @@ static void GREASE_PENCIL_OT_select_less(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int select_linked_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus select_linked_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -473,7 +473,7 @@ static void GREASE_PENCIL_OT_select_linked(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int select_random_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_random_exec(bContext *C, wmOperator *op) { using namespace blender; const float ratio = RNA_float_get(op->ptr, "ratio"); @@ -532,7 +532,7 @@ static void GREASE_PENCIL_OT_select_random(wmOperatorType *ot) WM_operator_properties_select_random(ot); } -static int select_alternate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_alternate_exec(bContext *C, wmOperator *op) { const bool deselect_ends = RNA_boolean_get(op->ptr, "deselect_ends"); Scene *scene = CTX_data_scene(C); @@ -707,7 +707,7 @@ static void select_similar_by_layer(Scene *scene, }); } -static int select_similar_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_similar_exec(bContext *C, wmOperator *op) { const SelectSimilarMode mode = SelectSimilarMode(RNA_enum_get(op->ptr, "mode")); const float threshold = RNA_float_get(op->ptr, "threshold"); @@ -789,7 +789,7 @@ static void GREASE_PENCIL_OT_select_similar(wmOperatorType *ot) RNA_def_float(ot->srna, "threshold", 0.1f, 0.0f, FLT_MAX, "Threshold", "", 0.0f, 10.0f); } -static int select_ends_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_ends_exec(bContext *C, wmOperator *op) { const int amount_start = RNA_int_get(op->ptr, "amount_start"); const int amount_end = RNA_int_get(op->ptr, "amount_end"); @@ -910,7 +910,7 @@ bool ensure_selection_domain(ToolSettings *ts, Object *object) return changed; } -static int select_set_mode_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_set_mode_exec(bContext *C, wmOperator *op) { using namespace blender::bke::greasepencil; @@ -966,7 +966,7 @@ static void GREASE_PENCIL_OT_set_selection_mode(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); } -static int grease_pencil_material_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_material_select_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); Object *object = CTX_data_active_object(C); diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_trim.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_trim.cc index b695918481b..487c140a168 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_trim.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_trim.cc @@ -142,7 +142,7 @@ static bool execute_trim_on_drawing(const int layer_index, /** * Apply the stroke trim to all layers. */ -static int stroke_trim_execute(const bContext *C, const Span mcoords) +static wmOperatorStatus stroke_trim_execute(const bContext *C, const Span mcoords) { const Scene *scene = CTX_data_scene(C); const ARegion *region = CTX_wm_region(C); @@ -235,7 +235,7 @@ static int stroke_trim_execute(const bContext *C, const Span mcoords) return OPERATOR_FINISHED; } -static int grease_pencil_stroke_trim_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_stroke_trim_exec(bContext *C, wmOperator *op) { const Array mcoords = WM_gesture_lasso_path_to_array(C, op); diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_utils.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_utils.cc index d881bb9325e..f4bc507a906 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_utils.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_utils.cc @@ -1536,9 +1536,9 @@ float opacity_from_input_sample(const float pressure, return opacity; } -int grease_pencil_draw_operator_invoke(bContext *C, - wmOperator *op, - const bool use_duplicate_previous_key) +wmOperatorStatus grease_pencil_draw_operator_invoke(bContext *C, + wmOperator *op, + const bool use_duplicate_previous_key) { const Scene *scene = CTX_data_scene(C); const Object *object = CTX_data_active_object(C); diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_vertex_paint.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_vertex_paint.cc index 8f95adcf750..c190a310c21 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_vertex_paint.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_vertex_paint.cc @@ -88,7 +88,8 @@ static bool apply_color_operation_for_mode(const VertexColorMode mode, return changed; } -static int grease_pencil_vertex_paint_brightness_contrast_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_vertex_paint_brightness_contrast_exec(bContext *C, + wmOperator *op) { const Scene &scene = *CTX_data_scene(C); Object &object = *CTX_data_active_object(C); @@ -165,7 +166,7 @@ static void GREASE_PENCIL_OT_vertex_color_brightness_contrast(wmOperatorType *ot RNA_def_float(ot->srna, "contrast", 0.0f, -1.0f, 1.0f, "Contrast", "", -1.0f, 1.0f); } -static int grease_pencil_vertex_paint_hsv_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_vertex_paint_hsv_exec(bContext *C, wmOperator *op) { const Scene &scene = *CTX_data_scene(C); Object &object = *CTX_data_active_object(C); @@ -239,7 +240,7 @@ static void GREASE_PENCIL_OT_vertex_color_hsv(wmOperatorType *ot) RNA_def_float(ot->srna, "v", 1.0f, 0.0f, 2.0f, "Value", "", 0.0f, 2.0f); } -static int grease_pencil_vertex_paint_invert_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_vertex_paint_invert_exec(bContext *C, wmOperator *op) { const Scene &scene = *CTX_data_scene(C); Object &object = *CTX_data_active_object(C); @@ -293,7 +294,7 @@ static void GREASE_PENCIL_OT_vertex_color_invert(wmOperatorType *ot) ot->srna, "mode", prop_grease_pencil_vertex_mode, int(VertexColorMode::Both), "Mode", ""); } -static int grease_pencil_vertex_paint_levels_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_vertex_paint_levels_exec(bContext *C, wmOperator *op) { const Scene &scene = *CTX_data_scene(C); Object &object = *CTX_data_active_object(C); @@ -354,7 +355,7 @@ static void GREASE_PENCIL_OT_vertex_color_levels(wmOperatorType *ot) ot->srna, "gain", 1.0f, 0.0f, FLT_MAX, "Gain", "Value to multiply colors by", 0.0f, 10.0f); } -static int grease_pencil_vertex_paint_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_vertex_paint_set_exec(bContext *C, wmOperator *op) { const Scene &scene = *CTX_data_scene(C); Object &object = *CTX_data_active_object(C); @@ -425,7 +426,7 @@ static void GREASE_PENCIL_OT_vertex_color_set(wmOperatorType *ot) RNA_def_float(ot->srna, "factor", 1.0f, 0.0f, 1.0f, "Factor", "Mix Factor", 0.0f, 1.0f); } -static int grease_pencil_vertex_paint_reset_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_vertex_paint_reset_exec(bContext *C, wmOperator *op) { const Scene &scene = *CTX_data_scene(C); Object &object = *CTX_data_active_object(C); diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_weight_paint.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_weight_paint.cc index 7488852c87d..9db504fa47b 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_weight_paint.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_weight_paint.cc @@ -452,7 +452,9 @@ struct ClosestGreasePencilDrawing { ed::curves::FindClosestData elem; }; -static int weight_sample_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus weight_sample_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); ViewContext vc = ED_view3d_viewcontext_init(C, depsgraph); @@ -560,7 +562,7 @@ static void GREASE_PENCIL_OT_weight_sample(wmOperatorType *ot) ot->flag = OPTYPE_UNDO | OPTYPE_DEPENDS_ON_CURSOR; } -static int toggle_weight_tool_direction_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus toggle_weight_tool_direction_exec(bContext *C, wmOperator * /*op*/) { Paint *paint = BKE_paint_get_active_from_context(C); Brush *brush = BKE_paint_brush(paint); @@ -607,7 +609,7 @@ static void GREASE_PENCIL_OT_weight_toggle_direction(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int grease_pencil_weight_invert_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_weight_invert_exec(bContext *C, wmOperator *op) { const Scene &scene = *CTX_data_scene(C); Object *object = CTX_data_active_object(C); @@ -684,7 +686,7 @@ static void GREASE_PENCIL_OT_weight_invert(wmOperatorType *ot) ot->flag = OPTYPE_UNDO | OPTYPE_REGISTER; } -static int vertex_group_smooth_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_group_smooth_exec(bContext *C, wmOperator *op) { /* Get the active vertex group in the Grease Pencil object. */ Object *object = CTX_data_active_object(C); @@ -757,7 +759,7 @@ static void GREASE_PENCIL_OT_vertex_group_smooth(wmOperatorType *ot) RNA_def_int(ot->srna, "repeat", 1, 1, 10000, "Iterations", "", 1, 200); } -static int vertex_group_normalize_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_group_normalize_exec(bContext *C, wmOperator *op) { /* Get the active vertex group in the Grease Pencil object. */ Object *object = CTX_data_active_object(C); @@ -872,7 +874,7 @@ static void GREASE_PENCIL_OT_vertex_group_normalize(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int vertex_group_normalize_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_group_normalize_all_exec(bContext *C, wmOperator *op) { /* Get the active vertex group in the Grease Pencil object. */ Object *object = CTX_data_active_object(C); diff --git a/source/blender/editors/include/ED_armature.hh b/source/blender/editors/include/ED_armature.hh index 6c1ac05bd43..23c95d15da5 100644 --- a/source/blender/editors/include/ED_armature.hh +++ b/source/blender/editors/include/ED_armature.hh @@ -11,6 +11,8 @@ #include "BLI_compiler_attrs.h" #include "BLI_span.hh" +#include "DNA_windowmanager_enums.h" + struct Base; struct Bone; struct Depsgraph; @@ -132,7 +134,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf); /** * Join armature exec is exported for use in object->join objects operator. */ -int ED_armature_join_objects_exec(bContext *C, wmOperator *op); +wmOperatorStatus ED_armature_join_objects_exec(bContext *C, wmOperator *op); /* `armature_select.cc` */ diff --git a/source/blender/editors/include/ED_curve.hh b/source/blender/editors/include/ED_curve.hh index 917fee7f0d5..8a69e1a1f35 100644 --- a/source/blender/editors/include/ED_curve.hh +++ b/source/blender/editors/include/ED_curve.hh @@ -10,6 +10,8 @@ #include "BLI_span.hh" +#include "DNA_windowmanager_enums.h" + struct BPoint; struct Base; struct BezTriple; @@ -70,7 +72,7 @@ bool ED_curve_nurb_deselect_all(const Nurb *nu); * This is used externally, by #OBJECT_OT_join. * TODO: shape keys - as with meshes. */ -int ED_curve_join_objects_exec(bContext *C, wmOperator *op); +wmOperatorStatus ED_curve_join_objects_exec(bContext *C, wmOperator *op); /* `editcurve_select.cc` */ diff --git a/source/blender/editors/include/ED_curves.hh b/source/blender/editors/include/ED_curves.hh index 9e39d7ef5ad..2d394658586 100644 --- a/source/blender/editors/include/ED_curves.hh +++ b/source/blender/editors/include/ED_curves.hh @@ -16,6 +16,7 @@ #include "BLI_vector_set.hh" #include "DNA_view3d_types.h" +#include "DNA_windowmanager_enums.h" #include "ED_select_utils.hh" @@ -453,7 +454,7 @@ void resize_curves(bke::CurvesGeometry &curves, */ void reorder_curves(bke::CurvesGeometry &curves, Span old_by_new_indices_map); -int join_objects_exec(bContext *C, wmOperator *op); +wmOperatorStatus join_objects_exec(bContext *C, wmOperator *op); /** \} */ diff --git a/source/blender/editors/include/ED_grease_pencil.hh b/source/blender/editors/include/ED_grease_pencil.hh index dfa33bc0df7..cf5a51fb2ad 100644 --- a/source/blender/editors/include/ED_grease_pencil.hh +++ b/source/blender/editors/include/ED_grease_pencil.hh @@ -60,7 +60,7 @@ enum { /** * Join selected objects. Called from #OBJECT_OT_join. */ -int ED_grease_pencil_join_objects_exec(bContext *C, wmOperator *op); +wmOperatorStatus ED_grease_pencil_join_objects_exec(bContext *C, wmOperator *op); void ED_operatortypes_grease_pencil(); void ED_operatortypes_grease_pencil_draw(); @@ -338,9 +338,9 @@ float radius_from_input_sample(const RegionView3D *rv3d, float3 location, float4x4 to_world, const BrushGpencilSettings *settings); -int grease_pencil_draw_operator_invoke(bContext *C, - wmOperator *op, - bool use_duplicate_previous_key); +wmOperatorStatus grease_pencil_draw_operator_invoke(bContext *C, + wmOperator *op, + bool use_duplicate_previous_key); float4x2 calculate_texture_space(const Scene *scene, const ARegion *region, const float2 &mouse, diff --git a/source/blender/editors/include/ED_mesh.hh b/source/blender/editors/include/ED_mesh.hh index 97b5f37d6c6..36ae4d98c51 100644 --- a/source/blender/editors/include/ED_mesh.hh +++ b/source/blender/editors/include/ED_mesh.hh @@ -12,6 +12,8 @@ #include "BLI_math_vector_types.hh" #include "BLI_span.hh" +#include "DNA_windowmanager_enums.h" + struct ARegion; struct BMBVHTree; struct BMEdge; @@ -515,8 +517,8 @@ void EDBM_redo_state_free(BMBackup *backup) ATTR_NONNULL(1); /* `meshtools.cc` */ -int ED_mesh_join_objects_exec(bContext *C, wmOperator *op); -int ED_mesh_shapes_join_objects_exec(bContext *C, wmOperator *op); +wmOperatorStatus ED_mesh_join_objects_exec(bContext *C, wmOperator *op); +wmOperatorStatus ED_mesh_shapes_join_objects_exec(bContext *C, wmOperator *op); /* mirror lookup api */ diff --git a/source/blender/editors/include/ED_pointcloud.hh b/source/blender/editors/include/ED_pointcloud.hh index 96b33dbabd4..5087630be2b 100644 --- a/source/blender/editors/include/ED_pointcloud.hh +++ b/source/blender/editors/include/ED_pointcloud.hh @@ -17,6 +17,7 @@ #include "BLI_vector_set.hh" #include "DNA_customdata_types.h" +#include "DNA_windowmanager_enums.h" struct ARegion; struct bContext; @@ -145,7 +146,7 @@ void POINTCLOUD_OT_attribute_set(wmOperatorType *ot); void POINTCLOUD_OT_duplicate(wmOperatorType *ot); void POINTCLOUD_OT_separate(wmOperatorType *ot); -int join_objects_exec(bContext *C, wmOperator *op); +wmOperatorStatus join_objects_exec(bContext *C, wmOperator *op); /** \} */ diff --git a/source/blender/editors/include/ED_screen.hh b/source/blender/editors/include/ED_screen.hh index 3ddff5395ff..e23003ee45c 100644 --- a/source/blender/editors/include/ED_screen.hh +++ b/source/blender/editors/include/ED_screen.hh @@ -509,7 +509,7 @@ void ED_update_for_newframe(Main *bmain, Depsgraph *depsgraph); * Toggle operator. */ void ED_reset_audio_device(bContext *C); -int ED_screen_animation_play(bContext *C, int sync, int mode); +wmOperatorStatus ED_screen_animation_play(bContext *C, int sync, int mode); /** * Find window that owns the animation timer. */ diff --git a/source/blender/editors/include/ED_util_imbuf.hh b/source/blender/editors/include/ED_util_imbuf.hh index e1953b7bd5c..4b5d9b46326 100644 --- a/source/blender/editors/include/ED_util_imbuf.hh +++ b/source/blender/editors/include/ED_util_imbuf.hh @@ -17,7 +17,7 @@ struct wmOperator; void ED_imbuf_sample_draw(const bContext *C, ARegion *region, void *arg_info); void ED_imbuf_sample_exit(bContext *C, wmOperator *op); -int ED_imbuf_sample_invoke(bContext *C, wmOperator *op, const wmEvent *event); -int ED_imbuf_sample_modal(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus ED_imbuf_sample_invoke(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus ED_imbuf_sample_modal(bContext *C, wmOperator *op, const wmEvent *event); void ED_imbuf_sample_cancel(bContext *C, wmOperator *op); bool ED_imbuf_sample_poll(bContext *C); diff --git a/source/blender/editors/include/UI_interface_c.hh b/source/blender/editors/include/UI_interface_c.hh index 51ad24ca13c..3d8a2e9d039 100644 --- a/source/blender/editors/include/UI_interface_c.hh +++ b/source/blender/editors/include/UI_interface_c.hh @@ -737,7 +737,8 @@ bool UI_popup_menu_end_or_cancel(bContext *C, uiPopupMenu *pup); uiLayout *UI_popup_menu_layout(uiPopupMenu *pup); void UI_popup_menu_reports(bContext *C, ReportList *reports) ATTR_NONNULL(); -int UI_popup_menu_invoke(bContext *C, const char *idname, ReportList *reports) ATTR_NONNULL(1, 2); +wmOperatorStatus UI_popup_menu_invoke(bContext *C, const char *idname, ReportList *reports) + ATTR_NONNULL(1, 2); /** * If \a block is displayed in a popup menu, tag it for closing. @@ -770,7 +771,10 @@ void UI_popup_menu_but_set(uiPopupMenu *pup, ARegion *butregion, uiBut *but); struct uiPopover; -int UI_popover_panel_invoke(bContext *C, const char *idname, bool keep_open, ReportList *reports); +wmOperatorStatus UI_popover_panel_invoke(bContext *C, + const char *idname, + bool keep_open, + ReportList *reports); /** * Only return handler, and set optional title. @@ -792,7 +796,7 @@ void UI_popover_once_clear(uiPopover *pup); /* Pie menus */ struct uiPieMenu; -int UI_pie_menu_invoke(bContext *C, const char *idname, const wmEvent *event); +wmOperatorStatus UI_pie_menu_invoke(bContext *C, const char *idname, const wmEvent *event); int UI_pie_menu_invoke_from_operator_enum(bContext *C, blender::StringRefNull title, blender::StringRefNull opname, diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_bone.cc b/source/blender/editors/interface/eyedroppers/eyedropper_bone.cc index 9eb462b8182..cc1d919682d 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_bone.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_bone.cc @@ -428,7 +428,7 @@ static void generate_sample_warning(SampleResult result, wmOperator *op) } } -static int bonedropper_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus bonedropper_modal(bContext *C, wmOperator *op, const wmEvent *event) { BoneDropper *bdr = (BoneDropper *)op->customdata; if (!bdr) { @@ -468,7 +468,7 @@ static int bonedropper_modal(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int bonedropper_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus bonedropper_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { /* This is needed to ensure viewport picking works. */ BKE_object_update_select_id(CTX_data_main(C)); @@ -485,7 +485,7 @@ static int bonedropper_invoke(bContext *C, wmOperator *op, const wmEvent * /*eve return OPERATOR_CANCELLED; } -static int bonedropper_exec(bContext *C, wmOperator *op) +static wmOperatorStatus bonedropper_exec(bContext *C, wmOperator *op) { if (bonedropper_init(C, op)) { bonedropper_exit(C, op); diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_color.cc b/source/blender/editors/interface/eyedroppers/eyedropper_color.cc index 6b29e84f203..a231dbd668b 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_color.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_color.cc @@ -594,7 +594,7 @@ static void eyedropper_cancel(bContext *C, wmOperator *op) } /* main modal status check */ -static int eyedropper_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus eyedropper_modal(bContext *C, wmOperator *op, const wmEvent *event) { Eyedropper *eye = (Eyedropper *)op->customdata; @@ -650,7 +650,7 @@ static int eyedropper_modal(bContext *C, wmOperator *op, const wmEvent *event) } /* Modal Operator init */ -static int eyedropper_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus eyedropper_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { /* init */ if (eyedropper_init(C, op)) { @@ -668,7 +668,7 @@ static int eyedropper_invoke(bContext *C, wmOperator *op, const wmEvent * /*even } /* Repeat operator */ -static int eyedropper_exec(bContext *C, wmOperator *op) +static wmOperatorStatus eyedropper_exec(bContext *C, wmOperator *op) { /* init */ if (eyedropper_init(C, op)) { diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_colorband.cc b/source/blender/editors/interface/eyedroppers/eyedropper_colorband.cc index 5ab4617568b..b84dd23e780 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_colorband.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_colorband.cc @@ -191,7 +191,9 @@ static void eyedropper_colorband_cancel(bContext *C, wmOperator *op) } /* main modal status check */ -static int eyedropper_colorband_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus eyedropper_colorband_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { EyedropperColorband *eye = static_cast(op->customdata); /* handle modal keymap */ @@ -228,7 +230,9 @@ static int eyedropper_colorband_modal(bContext *C, wmOperator *op, const wmEvent return OPERATOR_RUNNING_MODAL; } -static int eyedropper_colorband_point_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus eyedropper_colorband_point_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { EyedropperColorband *eye = static_cast(op->customdata); /* handle modal keymap */ @@ -268,7 +272,9 @@ static int eyedropper_colorband_point_modal(bContext *C, wmOperator *op, const w } /* Modal Operator init */ -static int eyedropper_colorband_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus eyedropper_colorband_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { /* init */ if (eyedropper_colorband_init(C, op)) { @@ -286,7 +292,7 @@ static int eyedropper_colorband_invoke(bContext *C, wmOperator *op, const wmEven } /* Repeat operator */ -static int eyedropper_colorband_exec(bContext *C, wmOperator *op) +static wmOperatorStatus eyedropper_colorband_exec(bContext *C, wmOperator *op) { /* init */ if (eyedropper_colorband_init(C, op)) { diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_datablock.cc b/source/blender/editors/interface/eyedroppers/eyedropper_datablock.cc index 4de2b48ac86..9d5db237dad 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_datablock.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_datablock.cc @@ -257,7 +257,7 @@ static void datadropper_set_draw_callback_region(ScrArea *area, DataDropper *ddr } /* main modal status check */ -static int datadropper_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus datadropper_modal(bContext *C, wmOperator *op, const wmEvent *event) { DataDropper *ddr = (DataDropper *)op->customdata; @@ -298,7 +298,7 @@ static int datadropper_modal(bContext *C, wmOperator *op, const wmEvent *event) } /* Modal Operator init */ -static int datadropper_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus datadropper_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { /* init */ if (datadropper_init(C, op)) { @@ -316,7 +316,7 @@ static int datadropper_invoke(bContext *C, wmOperator *op, const wmEvent * /*eve } /* Repeat operator */ -static int datadropper_exec(bContext *C, wmOperator *op) +static wmOperatorStatus datadropper_exec(bContext *C, wmOperator *op) { /* init */ if (datadropper_init(C, op)) { diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_depth.cc b/source/blender/editors/interface/eyedroppers/eyedropper_depth.cc index dd365e460c3..0c71484224e 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_depth.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_depth.cc @@ -348,7 +348,7 @@ static void depthdropper_cancel(bContext *C, wmOperator *op) } /* main modal status check */ -static int depthdropper_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus depthdropper_modal(bContext *C, wmOperator *op, const wmEvent *event) { DepthDropper *ddr = static_cast(op->customdata); @@ -395,7 +395,7 @@ static int depthdropper_modal(bContext *C, wmOperator *op, const wmEvent *event) } /* Modal Operator init */ -static int depthdropper_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus depthdropper_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { if (!depthdropper_test(C, op)) { /* If the operator can't be executed, make sure to not consume the event. */ @@ -417,7 +417,7 @@ static int depthdropper_invoke(bContext *C, wmOperator *op, const wmEvent * /*ev } /* Repeat operator */ -static int depthdropper_exec(bContext *C, wmOperator *op) +static wmOperatorStatus depthdropper_exec(bContext *C, wmOperator *op) { /* init */ if (depthdropper_init(C, op)) { diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_driver.cc b/source/blender/editors/interface/eyedroppers/eyedropper_driver.cc index 931a8458b48..fc2ddc1d61f 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_driver.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_driver.cc @@ -127,7 +127,7 @@ static void driverdropper_cancel(bContext *C, wmOperator *op) } /* main modal status check */ -static int driverdropper_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus driverdropper_modal(bContext *C, wmOperator *op, const wmEvent *event) { DriverDropper *ddr = static_cast(op->customdata); @@ -152,7 +152,9 @@ static int driverdropper_modal(bContext *C, wmOperator *op, const wmEvent *event } /* Modal Operator init */ -static int driverdropper_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus driverdropper_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { /* init */ if (driverdropper_init(C, op)) { @@ -170,7 +172,7 @@ static int driverdropper_invoke(bContext *C, wmOperator *op, const wmEvent * /*e } /* Repeat operator */ -static int driverdropper_exec(bContext *C, wmOperator *op) +static wmOperatorStatus driverdropper_exec(bContext *C, wmOperator *op) { /* init */ if (driverdropper_init(C, op)) { diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_grease_pencil_color.cc b/source/blender/editors/interface/eyedroppers/eyedropper_grease_pencil_color.cc index 93deb10f43f..6f751d554c5 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_grease_pencil_color.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_grease_pencil_color.cc @@ -359,7 +359,9 @@ static void eyedropper_grease_pencil_cancel(bContext *C, wmOperator *op) } /* Main modal status check. */ -static int eyedropper_grease_pencil_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus eyedropper_grease_pencil_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { eyedropper_grease_pencil_status_indicators(C, op, event); EyedropperGreasePencil *eye = static_cast(op->customdata); @@ -414,7 +416,9 @@ static int eyedropper_grease_pencil_modal(bContext *C, wmOperator *op, const wmE return OPERATOR_RUNNING_MODAL; } -static int eyedropper_grease_pencil_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus eyedropper_grease_pencil_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { if (eyedropper_grease_pencil_init(C, op)) { /* Add modal temp handler. */ @@ -428,7 +432,7 @@ static int eyedropper_grease_pencil_invoke(bContext *C, wmOperator *op, const wm } /* Repeat operator */ -static int eyedropper_grease_pencil_exec(bContext *C, wmOperator *op) +static wmOperatorStatus eyedropper_grease_pencil_exec(bContext *C, wmOperator *op) { if (eyedropper_grease_pencil_init(C, op)) { diff --git a/source/blender/editors/interface/interface_ops.cc b/source/blender/editors/interface/interface_ops.cc index 00954417804..838d51d092c 100644 --- a/source/blender/editors/interface/interface_ops.cc +++ b/source/blender/editors/interface/interface_ops.cc @@ -120,7 +120,7 @@ static bool copy_data_path_button_poll(bContext *C) return false; } -static int copy_data_path_button_exec(bContext *C, wmOperator *op) +static wmOperatorStatus copy_data_path_button_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); PointerRNA ptr; @@ -209,7 +209,7 @@ static bool copy_as_driver_button_poll(bContext *C) return false; } -static int copy_as_driver_button_exec(bContext *C, wmOperator *op) +static wmOperatorStatus copy_as_driver_button_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); PointerRNA ptr; @@ -271,7 +271,7 @@ static bool copy_python_command_button_poll(bContext *C) return false; } -static int copy_python_command_button_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus copy_python_command_button_exec(bContext *C, wmOperator * /*op*/) { uiBut *but = UI_context_active_but_get(C); @@ -310,7 +310,9 @@ static void UI_OT_copy_python_command_button(wmOperatorType *ot) /** \name Reset to Default Values Button Operator * \{ */ -static int operator_button_property_finish(bContext *C, PointerRNA *ptr, PropertyRNA *prop) +static wmOperatorStatus operator_button_property_finish(bContext *C, + PointerRNA *ptr, + PropertyRNA *prop) { /* Assign before executing logic in the unlikely event the ID is freed. */ const bool is_undo = ptr->owner_id && ID_CHECK_UNDO(ptr->owner_id); @@ -331,9 +333,9 @@ static int operator_button_property_finish(bContext *C, PointerRNA *ptr, Propert return OPERATOR_CANCELLED; } -static int operator_button_property_finish_with_undo(bContext *C, - PointerRNA *ptr, - PropertyRNA *prop) +static wmOperatorStatus operator_button_property_finish_with_undo(bContext *C, + PointerRNA *ptr, + PropertyRNA *prop) { /* Perform updates required for this property. */ RNA_property_update(C, ptr, prop); @@ -355,7 +357,7 @@ static bool reset_default_button_poll(bContext *C) return (ptr.data && prop && RNA_property_editable(&ptr, prop)); } -static int reset_default_button_exec(bContext *C, wmOperator *op) +static wmOperatorStatus reset_default_button_exec(bContext *C, wmOperator *op) { PointerRNA ptr; PropertyRNA *prop; @@ -420,7 +422,7 @@ static bool assign_default_button_poll(bContext *C) return false; } -static int assign_default_button_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus assign_default_button_exec(bContext *C, wmOperator * /*op*/) { PointerRNA ptr; PropertyRNA *prop; @@ -460,7 +462,7 @@ static void UI_OT_assign_default_button(wmOperatorType *ot) /** \name Unset Property Button Operator * \{ */ -static int unset_property_button_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus unset_property_button_exec(bContext *C, wmOperator * /*op*/) { PointerRNA ptr; PropertyRNA *prop; @@ -550,7 +552,7 @@ static bool override_type_set_button_poll(bContext *C) return (ptr.data && prop && (override_status & RNA_OVERRIDE_STATUS_OVERRIDABLE)); } -static int override_type_set_button_exec(bContext *C, wmOperator *op) +static wmOperatorStatus override_type_set_button_exec(bContext *C, wmOperator *op) { PointerRNA ptr; PropertyRNA *prop; @@ -609,7 +611,9 @@ static int override_type_set_button_exec(bContext *C, wmOperator *op) return operator_button_property_finish(C, &ptr, prop); } -static int override_type_set_button_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus override_type_set_button_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { #if 0 /* Disabled for now */ return WM_menu_invoke_ex(C, op, WM_OP_INVOKE_DEFAULT); @@ -660,7 +664,7 @@ static bool override_remove_button_poll(bContext *C) return (ptr.data && ptr.owner_id && prop && (override_status & RNA_OVERRIDE_STATUS_OVERRIDDEN)); } -static int override_remove_button_exec(bContext *C, wmOperator *op) +static wmOperatorStatus override_remove_button_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); PointerRNA ptr, src; @@ -795,7 +799,7 @@ static bool override_idtemplate_make_poll(bContext *C) return override_idtemplate_poll(C, true); } -static int override_idtemplate_make_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus override_idtemplate_make_exec(bContext *C, wmOperator * /*op*/) { ID *owner_id, *id; PointerRNA owner_ptr; @@ -857,7 +861,7 @@ static bool override_idtemplate_reset_poll(bContext *C) return override_idtemplate_poll(C, false); } -static int override_idtemplate_reset_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus override_idtemplate_reset_exec(bContext *C, wmOperator * /*op*/) { ID *owner_id, *id; PointerRNA owner_ptr; @@ -904,7 +908,7 @@ static bool override_idtemplate_clear_poll(bContext *C) return override_idtemplate_poll(C, false); } -static int override_idtemplate_clear_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus override_idtemplate_clear_exec(bContext *C, wmOperator * /*op*/) { ID *owner_id, *id; PointerRNA owner_ptr; @@ -1538,7 +1542,7 @@ static bool copy_to_selected_button_poll(bContext *C) return copy_to_selected_button(C, false, true); } -static int copy_to_selected_button_exec(bContext *C, wmOperator *op) +static wmOperatorStatus copy_to_selected_button_exec(bContext *C, wmOperator *op) { bool success; @@ -1807,7 +1811,7 @@ static bool copy_driver_to_selected_button_poll(bContext *C) return copy_driver_to_selected_button(C, false, true); } -static int copy_driver_to_selected_button_exec(bContext *C, wmOperator *op) +static wmOperatorStatus copy_driver_to_selected_button_exec(bContext *C, wmOperator *op) { const bool all = RNA_boolean_get(op->ptr, "all"); @@ -1973,7 +1977,7 @@ bool ui_jump_to_target_button_poll(bContext *C) return jump_to_target_button(C, true); } -static int jump_to_target_button_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus jump_to_target_button_exec(bContext *C, wmOperator * /*op*/) { const bool success = jump_to_target_button(C, false); @@ -2098,10 +2102,10 @@ void UI_editsource_but_replace(const uiBut *old_but, uiBut *new_but) } } -static int editsource_text_edit(bContext *C, - wmOperator * /*op*/, - const char filepath[FILE_MAX], - const int line) +static wmOperatorStatus editsource_text_edit(bContext *C, + wmOperator * /*op*/, + const char filepath[FILE_MAX], + const int line) { wmOperatorType *ot = WM_operatortype_find("TEXT_OT_jump_to_file_at_point", true); PointerRNA op_props; @@ -2111,12 +2115,13 @@ static int editsource_text_edit(bContext *C, RNA_int_set(&op_props, "line", line - 1); RNA_int_set(&op_props, "column", 0); - int result = WM_operator_name_call_ptr(C, ot, WM_OP_EXEC_DEFAULT, &op_props, nullptr); + wmOperatorStatus result = WM_operator_name_call_ptr( + C, ot, WM_OP_EXEC_DEFAULT, &op_props, nullptr); WM_operator_properties_free(&op_props); return result; } -static int editsource_exec(bContext *C, wmOperator *op) +static wmOperatorStatus editsource_exec(bContext *C, wmOperator *op) { uiBut *but = UI_context_active_but_get(C); @@ -2125,7 +2130,7 @@ static int editsource_exec(bContext *C, wmOperator *op) uiEditSourceButStore *but_store = nullptr; ARegion *region = CTX_wm_region(C); - int ret; + wmOperatorStatus ret; /* needed else the active button does not get tested */ UI_screen_free_active_but_highlight(C, CTX_wm_screen(C)); @@ -2194,7 +2199,7 @@ static void UI_OT_editsource(wmOperatorType *ot) /** \name Reload Translation Operator * \{ */ -static int reloadtranslation_exec(bContext * /*C*/, wmOperator * /*op*/) +static wmOperatorStatus reloadtranslation_exec(bContext * /*C*/, wmOperator * /*op*/) { BLT_lang_init(); BLF_cache_clear(); @@ -2220,7 +2225,7 @@ static void UI_OT_reloadtranslation(wmOperatorType *ot) /** \name Press Button Operator * \{ */ -static int ui_button_press_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus ui_button_press_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bScreen *screen = CTX_wm_screen(C); const bool skip_depressed = RNA_boolean_get(op->ptr, "skip_depressed"); @@ -2277,7 +2282,7 @@ static void UI_OT_button_execute(wmOperatorType *ot) /** \name Text Button Clear Operator * \{ */ -static int button_string_clear_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus button_string_clear_exec(bContext *C, wmOperator * /*op*/) { uiBut *but = UI_context_active_but_get_respect_popup(C); @@ -2336,7 +2341,7 @@ void UI_drop_color_copy(bContext * /*C*/, wmDrag *drag, wmDropBox *drop) RNA_boolean_set(drop->ptr, "has_alpha", drag_info->has_alpha); } -static int drop_color_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus drop_color_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); uiBut *but = nullptr; @@ -2431,7 +2436,7 @@ static bool drop_name_poll(bContext *C) return true; } -static int drop_name_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus drop_name_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { uiBut *but = UI_but_active_drop_name_button(C); char *str = RNA_string_get_alloc(op->ptr, "string", nullptr, 0, nullptr); @@ -2491,7 +2496,9 @@ static bool ui_list_unhide_filter_options(uiList *list) return true; } -static int ui_list_start_filter_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus ui_list_start_filter_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); uiList *list = UI_list_find_mouse_over(region, event); @@ -2545,7 +2552,9 @@ static bool ui_view_focused_poll(bContext *C) return view != nullptr; } -static int ui_view_start_filter_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus ui_view_start_filter_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { const ARegion *region = CTX_wm_region(C); const blender::ui::AbstractView *hovered_view = UI_region_view_find_at(region, event->xy, 0); @@ -2588,7 +2597,7 @@ static bool ui_view_drop_poll(bContext *C) return region_views_find_drop_target_at(region, win->eventstate->xy) != nullptr; } -static int ui_view_drop_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus ui_view_drop_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) { if (event->custom != EVT_DATA_DRAGDROP) { return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH; @@ -2636,7 +2645,9 @@ static bool ui_view_scroll_poll(bContext *C) return view->supports_scrolling(); } -static int ui_view_scroll_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus ui_view_scroll_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); int type = event->type; @@ -2707,7 +2718,7 @@ static bool ui_view_item_rename_poll(bContext *C) return active_item != nullptr && UI_view_item_can_rename(*active_item); } -static int ui_view_item_rename_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus ui_view_item_rename_exec(bContext *C, wmOperator * /*op*/) { ARegion *region = CTX_wm_region(C); blender::ui::AbstractViewItem *active_item = UI_region_views_find_active_item(region); @@ -2754,7 +2765,7 @@ static bool ui_drop_material_poll(bContext *C) return true; } -static int ui_drop_material_exec(bContext *C, wmOperator *op) +static wmOperatorStatus ui_drop_material_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); diff --git a/source/blender/editors/interface/regions/interface_region_menu_pie.cc b/source/blender/editors/interface/regions/interface_region_menu_pie.cc index 0c5be368dca..610cc549688 100644 --- a/source/blender/editors/interface/regions/interface_region_menu_pie.cc +++ b/source/blender/editors/interface/regions/interface_region_menu_pie.cc @@ -194,7 +194,7 @@ uiLayout *UI_pie_menu_layout(uiPieMenu *pie) return pie->layout; } -int UI_pie_menu_invoke(bContext *C, const char *idname, const wmEvent *event) +wmOperatorStatus UI_pie_menu_invoke(bContext *C, const char *idname, const wmEvent *event) { uiPieMenu *pie; uiLayout *layout; diff --git a/source/blender/editors/interface/regions/interface_region_menu_popup.cc b/source/blender/editors/interface/regions/interface_region_menu_popup.cc index 50382560196..e354256959e 100644 --- a/source/blender/editors/interface/regions/interface_region_menu_popup.cc +++ b/source/blender/editors/interface/regions/interface_region_menu_popup.cc @@ -629,7 +629,7 @@ static void ui_popup_menu_create_from_menutype(bContext *C, } } -int UI_popup_menu_invoke(bContext *C, const char *idname, ReportList *reports) +wmOperatorStatus UI_popup_menu_invoke(bContext *C, const char *idname, ReportList *reports) { MenuType *mt = WM_menutype_find(idname, true); diff --git a/source/blender/editors/interface/regions/interface_region_popover.cc b/source/blender/editors/interface/regions/interface_region_popover.cc index 04723cd9a4d..245d7d4de51 100644 --- a/source/blender/editors/interface/regions/interface_region_popover.cc +++ b/source/blender/editors/interface/regions/interface_region_popover.cc @@ -302,7 +302,10 @@ uiPopupBlockHandle *ui_popover_panel_create(bContext *C, /** \name Standard Popover Panels * \{ */ -int UI_popover_panel_invoke(bContext *C, const char *idname, bool keep_open, ReportList *reports) +wmOperatorStatus UI_popover_panel_invoke(bContext *C, + const char *idname, + bool keep_open, + ReportList *reports) { uiLayout *layout; PanelType *pt = WM_paneltype_find(idname, true); diff --git a/source/blender/editors/interface/view2d/view2d_ops.cc b/source/blender/editors/interface/view2d/view2d_ops.cc index d1f0fba09a6..b2ad6361557 100644 --- a/source/blender/editors/interface/view2d/view2d_ops.cc +++ b/source/blender/editors/interface/view2d/view2d_ops.cc @@ -218,7 +218,7 @@ static void view_pan_exit(wmOperator *op) * \{ */ /* for 'redo' only, with no user input */ -static int view_pan_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_pan_exec(bContext *C, wmOperator *op) { view_pan_init(C, op); view_pan_apply(C, op); @@ -227,7 +227,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, const wmEvent *event) +static wmOperatorStatus view_pan_invoke(bContext *C, wmOperator *op, const wmEvent *event) { wmWindow *window = CTX_wm_window(C); @@ -276,7 +276,7 @@ static int view_pan_invoke(bContext *C, wmOperator *op, const 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, const wmEvent *event) +static wmOperatorStatus view_pan_modal(bContext *C, wmOperator *op, const wmEvent *event) { v2dViewPanData *vpd = static_cast(op->customdata); View2D *v2d = vpd->v2d; @@ -378,7 +378,9 @@ static void VIEW2D_OT_pan(wmOperatorType *ot) * \{ */ /* set up modal operator and relevant settings */ -static int view_edge_pan_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus view_edge_pan_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { op->customdata = MEM_callocN(sizeof(View2DEdgePanData), "View2DEdgePanData"); View2DEdgePanData *vpd = static_cast(op->customdata); @@ -389,7 +391,7 @@ static int view_edge_pan_invoke(bContext *C, wmOperator *op, const wmEvent * /*e return (OPERATOR_RUNNING_MODAL | OPERATOR_PASS_THROUGH); } -static int view_edge_pan_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus view_edge_pan_modal(bContext *C, wmOperator *op, const wmEvent *event) { View2DEdgePanData *vpd = static_cast(op->customdata); @@ -443,7 +445,7 @@ static void VIEW2D_OT_edge_pan(wmOperatorType *ot) * \{ */ /* this operator only needs this single callback, where it calls the view_pan_*() methods */ -static int view_scrollright_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_scrollright_exec(bContext *C, wmOperator *op) { /* initialize default settings (and validate if ok to run) */ view_pan_init(C, op); @@ -483,7 +485,7 @@ static void VIEW2D_OT_scroll_right(wmOperatorType *ot) } /* this operator only needs this single callback, where it calls the view_pan_*() methods */ -static int view_scrollleft_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_scrollleft_exec(bContext *C, wmOperator *op) { /* initialize default settings (and validate if ok to run) */ view_pan_init(C, op); @@ -523,7 +525,7 @@ static void VIEW2D_OT_scroll_left(wmOperatorType *ot) } /* this operator only needs this single callback, where it calls the view_pan_*() methods */ -static int view_scrolldown_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_scrolldown_exec(bContext *C, wmOperator *op) { /* initialize default settings (and validate if ok to run) */ view_pan_init(C, op); @@ -578,7 +580,7 @@ static void VIEW2D_OT_scroll_down(wmOperatorType *ot) } /* this operator only needs this single callback, where it calls the view_pan_*() methods */ -static int view_scrollup_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_scrollup_exec(bContext *C, wmOperator *op) { /* initialize default settings (and validate if ok to run) */ view_pan_init(C, op); @@ -876,7 +878,7 @@ static void view_zoomstep_exit(bContext *C, wmOperator *op) } /* this operator only needs this single callback, where it calls the view_zoom_*() methods */ -static int view_zoomin_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_zoomin_exec(bContext *C, wmOperator *op) { if (op->customdata == nullptr) { /* Might have been setup in _invoke() already. */ view_zoomdrag_init(C, op); @@ -897,7 +899,7 @@ static int view_zoomin_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int view_zoomin_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus view_zoomin_invoke(bContext *C, wmOperator *op, const wmEvent *event) { view_zoomdrag_init(C, op); @@ -939,7 +941,7 @@ static void VIEW2D_OT_zoom_in(wmOperatorType *ot) } /* this operator only needs this single callback, where it calls the view_zoom_*() methods */ -static int view_zoomout_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_zoomout_exec(bContext *C, wmOperator *op) { bool do_zoom_xy[2]; @@ -961,7 +963,7 @@ static int view_zoomout_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int view_zoomout_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus view_zoomout_invoke(bContext *C, wmOperator *op, const wmEvent *event) { view_zoomdrag_init(C, op); @@ -1120,7 +1122,7 @@ static void view_zoomdrag_cancel(bContext *C, wmOperator *op) } /* for 'redo' only, with no user input */ -static int view_zoomdrag_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_zoomdrag_exec(bContext *C, wmOperator *op) { view_zoomdrag_init(C, op); view_zoomdrag_apply(C, op); @@ -1129,7 +1131,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, const wmEvent *event) +static wmOperatorStatus view_zoomdrag_invoke(bContext *C, wmOperator *op, const wmEvent *event) { wmWindow *window = CTX_wm_window(C); @@ -1243,7 +1245,7 @@ static int view_zoomdrag_invoke(bContext *C, wmOperator *op, const wmEvent *even /* 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, const wmEvent *event) +static wmOperatorStatus view_zoomdrag_modal(bContext *C, wmOperator *op, const wmEvent *event) { v2dViewZoomData *vzd = static_cast(op->customdata); View2D *v2d = vzd->v2d; @@ -1419,7 +1421,7 @@ static void VIEW2D_OT_zoom(wmOperatorType *ot) * have custom key-mappings for this. * \{ */ -static int view_borderzoom_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_borderzoom_exec(bContext *C, wmOperator *op) { ARegion *region = CTX_wm_region(C); View2D *v2d = ®ion->v2d; @@ -1508,7 +1510,7 @@ static void VIEW2D_OT_zoom_border(wmOperatorType *ot) * \{ */ #ifdef WITH_INPUT_NDOF -static int view2d_ndof_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus view2d_ndof_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (event->type != NDOF_MOTION) { return OPERATOR_CANCELLED; @@ -1692,7 +1694,9 @@ void UI_view2d_smooth_view(const bContext *C, } /* only meant for timer usage */ -static int view2d_smoothview_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus view2d_smoothview_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { wmWindow *win = CTX_wm_window(C); ARegion *region = CTX_wm_region(C); @@ -2059,7 +2063,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, const wmEvent *event) +static wmOperatorStatus scroller_activate_modal(bContext *C, wmOperator *op, const wmEvent *event) { v2dScrollerMove *vsm = static_cast(op->customdata); const bool use_page_size_y = vsm->v2d->flag & V2D_SNAP_TO_PAGESIZE_Y; @@ -2145,7 +2149,7 @@ static int scroller_activate_modal(bContext *C, wmOperator *op, const wmEvent *e /* 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, const wmEvent *event) +static wmOperatorStatus scroller_activate_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); View2D *v2d = ®ion->v2d; @@ -2256,7 +2260,7 @@ static void VIEW2D_OT_scroller_activate(wmOperatorType *ot) /** \name View Reset Operator * \{ */ -static int reset_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus reset_exec(bContext *C, wmOperator * /*op*/) { const uiStyle *style = UI_style_get(); ARegion *region = CTX_wm_region(C); diff --git a/source/blender/editors/io/io_alembic.cc b/source/blender/editors/io/io_alembic.cc index 762e47e968c..77c0929fa11 100644 --- a/source/blender/editors/io/io_alembic.cc +++ b/source/blender/editors/io/io_alembic.cc @@ -69,7 +69,9 @@ const EnumPropertyItem rna_enum_abc_export_evaluation_mode_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int wm_alembic_export_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus wm_alembic_export_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (!RNA_struct_property_is_set(op->ptr, "as_background_job")) { RNA_boolean_set(op->ptr, "as_background_job", true); @@ -84,7 +86,7 @@ static int wm_alembic_export_invoke(bContext *C, wmOperator *op, const wmEvent * return OPERATOR_RUNNING_MODAL; } -static int wm_alembic_export_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_alembic_export_exec(bContext *C, wmOperator *op) { if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) { BKE_report(op->reports, RPT_ERROR, "No filepath given"); @@ -588,7 +590,7 @@ static void wm_alembic_import_draw(bContext *C, wmOperator *op) } /* op->invoke, opens fileselect if path property not set, otherwise executes */ -static int wm_alembic_import_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus wm_alembic_import_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (!RNA_struct_property_is_set(op->ptr, "as_background_job")) { RNA_boolean_set(op->ptr, "as_background_job", true); @@ -596,7 +598,7 @@ static int wm_alembic_import_invoke(bContext *C, wmOperator *op, const wmEvent * return blender::ed::io::filesel_drop_import_invoke(C, op, event); } -static int wm_alembic_import_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_alembic_import_exec(bContext *C, wmOperator *op) { blender::Vector paths = blender::ed::io::paths_from_operator_properties(op->ptr); if (paths.is_empty()) { diff --git a/source/blender/editors/io/io_cache.cc b/source/blender/editors/io/io_cache.cc index af2d4075ff1..25c26436ecc 100644 --- a/source/blender/editors/io/io_cache.cc +++ b/source/blender/editors/io/io_cache.cc @@ -47,7 +47,9 @@ static void cachefile_init(bContext *C, wmOperator *op) UI_context_active_but_prop_get_templateID(C, &pprop->ptr, &pprop->prop); } -static int cachefile_open_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus cachefile_open_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (!RNA_struct_property_is_set(op->ptr, "filepath")) { char filepath[FILE_MAX]; @@ -74,7 +76,7 @@ static void open_cancel(bContext * /*C*/, wmOperator *op) } } -static int cachefile_open_exec(bContext *C, wmOperator *op) +static wmOperatorStatus cachefile_open_exec(bContext *C, wmOperator *op) { if (!RNA_struct_property_is_set(op->ptr, "filepath")) { BKE_report(op->reports, RPT_ERROR, "No filepath given"); @@ -133,7 +135,7 @@ void CACHEFILE_OT_open(wmOperatorType *ot) /* ***************************** Reload Operator **************************** */ -static int cachefile_reload_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus cachefile_reload_exec(bContext *C, wmOperator * /*op*/) { CacheFile *cache_file = CTX_data_edit_cachefile(C); @@ -161,7 +163,9 @@ void CACHEFILE_OT_reload(wmOperatorType *ot) /* ***************************** Add Layer Operator **************************** */ -static int cachefile_layer_open_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus cachefile_layer_open_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (!RNA_struct_property_is_set(op->ptr, "filepath")) { char filepath[FILE_MAX]; @@ -180,7 +184,7 @@ static int cachefile_layer_open_invoke(bContext *C, wmOperator *op, const wmEven return OPERATOR_RUNNING_MODAL; } -static int cachefile_layer_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus cachefile_layer_add_exec(bContext *C, wmOperator *op) { if (!RNA_struct_property_is_set(op->ptr, "filepath")) { BKE_report(op->reports, RPT_ERROR, "No filepath given"); @@ -229,7 +233,7 @@ void CACHEFILE_OT_layer_add(wmOperatorType *ot) /* ***************************** Remove Layer Operator **************************** */ -static int cachefile_layer_remove_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus cachefile_layer_remove_exec(bContext *C, wmOperator * /*op*/) { CacheFile *cache_file = CTX_data_edit_cachefile(C); @@ -260,7 +264,7 @@ void CACHEFILE_OT_layer_remove(wmOperatorType *ot) /* ***************************** Move Layer Operator **************************** */ -static int cachefile_layer_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus cachefile_layer_move_exec(bContext *C, wmOperator *op) { CacheFile *cache_file = CTX_data_edit_cachefile(C); diff --git a/source/blender/editors/io/io_collada.cc b/source/blender/editors/io/io_collada.cc index a484bfc19c5..e9e980e2325 100644 --- a/source/blender/editors/io/io_collada.cc +++ b/source/blender/editors/io/io_collada.cc @@ -38,7 +38,9 @@ # include "io_collada.hh" # include "io_utils.hh" -static int wm_collada_export_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus wm_collada_export_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { ED_fileselect_ensure_default_filepath(C, op, ".dae"); @@ -47,7 +49,7 @@ static int wm_collada_export_invoke(bContext *C, wmOperator *op, const wmEvent * return OPERATOR_RUNNING_MODAL; } -static int wm_collada_export_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_collada_export_exec(bContext *C, wmOperator *op) { char filepath[FILE_MAX]; int apply_modifiers; @@ -711,7 +713,7 @@ void WM_OT_collada_export(wmOperatorType *ot) "Store Bindpose information in custom bone properties for later use during Collada export"); } -static int wm_collada_import_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_collada_import_exec(bContext *C, wmOperator *op) { char filepath[FILE_MAX]; int import_units; diff --git a/source/blender/editors/io/io_drop_import_file.cc b/source/blender/editors/io/io_drop_import_file.cc index 3f65a92ac19..010e5ee3338 100644 --- a/source/blender/editors/io/io_drop_import_file.cc +++ b/source/blender/editors/io/io_drop_import_file.cc @@ -97,7 +97,7 @@ static PointerRNA file_handler_import_operator_create_ptr( return props; } -static int wm_drop_import_file_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_drop_import_file_exec(bContext *C, wmOperator *op) { const auto paths = blender::ed::io::paths_from_operator_properties(op->ptr); if (paths.is_empty()) { @@ -117,7 +117,9 @@ static int wm_drop_import_file_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int wm_drop_import_file_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus wm_drop_import_file_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { const auto paths = blender::ed::io::paths_from_operator_properties(op->ptr); if (paths.is_empty()) { diff --git a/source/blender/editors/io/io_grease_pencil.cc b/source/blender/editors/io/io_grease_pencil.cc index 71b576d4474..1cdcf33ec13 100644 --- a/source/blender/editors/io/io_grease_pencil.cc +++ b/source/blender/editors/io/io_grease_pencil.cc @@ -124,7 +124,7 @@ static bool grease_pencil_import_svg_check(bContext * /*C*/, wmOperator *op) return false; } -static int grease_pencil_import_svg_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_import_svg_exec(bContext *C, wmOperator *op) { using blender::io::grease_pencil::ImportParams; using blender::io::grease_pencil::IOContext; @@ -265,7 +265,9 @@ static bool grease_pencil_export_svg_check(bContext * /*C*/, wmOperator *op) return false; } -static int grease_pencil_export_svg_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus grease_pencil_export_svg_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { ED_fileselect_ensure_default_filepath(C, op, ".svg"); @@ -274,7 +276,7 @@ static int grease_pencil_export_svg_invoke(bContext *C, wmOperator *op, const wm return OPERATOR_RUNNING_MODAL; } -static int grease_pencil_export_svg_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_export_svg_exec(bContext *C, wmOperator *op) { using blender::io::grease_pencil::ExportParams; using blender::io::grease_pencil::IOContext; @@ -422,7 +424,9 @@ static bool grease_pencil_export_pdf_check(bContext * /*C*/, wmOperator *op) return false; } -static int grease_pencil_export_pdf_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus grease_pencil_export_pdf_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { ED_fileselect_ensure_default_filepath(C, op, ".pdf"); @@ -431,7 +435,7 @@ static int grease_pencil_export_pdf_invoke(bContext *C, wmOperator *op, const wm return OPERATOR_RUNNING_MODAL; } -static int grease_pencil_export_pdf_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_export_pdf_exec(bContext *C, wmOperator *op) { using blender::io::grease_pencil::ExportParams; using blender::io::grease_pencil::IOContext; diff --git a/source/blender/editors/io/io_obj.cc b/source/blender/editors/io/io_obj.cc index 5e3914d7ec0..34e0bc395ec 100644 --- a/source/blender/editors/io/io_obj.cc +++ b/source/blender/editors/io/io_obj.cc @@ -59,7 +59,9 @@ static const EnumPropertyItem io_obj_path_mode[] = { {PATH_REFERENCE_COPY, "COPY", 0, "Copy", "Copy the file to the destination path"}, {0, nullptr, 0, nullptr, nullptr}}; -static int wm_obj_export_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus wm_obj_export_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { ED_fileselect_ensure_default_filepath(C, op, ".obj"); @@ -67,7 +69,7 @@ static int wm_obj_export_invoke(bContext *C, wmOperator *op, const wmEvent * /*e return OPERATOR_RUNNING_MODAL; } -static int wm_obj_export_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_obj_export_exec(bContext *C, wmOperator *op) { if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) { BKE_report(op->reports, RPT_ERROR, "No filepath given"); @@ -409,7 +411,7 @@ void WM_OT_obj_export(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_HIDDEN); } -static int wm_obj_import_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_obj_import_exec(bContext *C, wmOperator *op) { OBJImportParams import_params; import_params.global_scale = RNA_float_get(op->ptr, "global_scale"); diff --git a/source/blender/editors/io/io_ply_ops.cc b/source/blender/editors/io/io_ply_ops.cc index ca5ac11b3e5..66f29fa6cac 100644 --- a/source/blender/editors/io/io_ply_ops.cc +++ b/source/blender/editors/io/io_ply_ops.cc @@ -51,7 +51,9 @@ static const EnumPropertyItem ply_vertex_colors_mode[] = { "Vertex colors in the file are in linear color space"}, {0, nullptr, 0, nullptr, nullptr}}; -static int wm_ply_export_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus wm_ply_export_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { ED_fileselect_ensure_default_filepath(C, op, ".ply"); @@ -59,7 +61,7 @@ static int wm_ply_export_invoke(bContext *C, wmOperator *op, const wmEvent * /*e return OPERATOR_RUNNING_MODAL; } -static int wm_ply_export_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_ply_export_exec(bContext *C, wmOperator *op) { if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) { BKE_report(op->reports, RPT_ERROR, "No filepath given"); @@ -250,7 +252,7 @@ void WM_OT_ply_export(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_HIDDEN); } -static int wm_ply_import_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_ply_import_exec(bContext *C, wmOperator *op) { PLYImportParams params; params.forward_axis = eIOAxis(RNA_enum_get(op->ptr, "forward_axis")); diff --git a/source/blender/editors/io/io_stl_ops.cc b/source/blender/editors/io/io_stl_ops.cc index abb55db9e3c..90a6a349b88 100644 --- a/source/blender/editors/io/io_stl_ops.cc +++ b/source/blender/editors/io/io_stl_ops.cc @@ -34,7 +34,9 @@ # include "io_stl_ops.hh" # include "io_utils.hh" -static int wm_stl_export_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus wm_stl_export_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { ED_fileselect_ensure_default_filepath(C, op, ".stl"); @@ -42,7 +44,7 @@ static int wm_stl_export_invoke(bContext *C, wmOperator *op, const wmEvent * /*e return OPERATOR_RUNNING_MODAL; } -static int wm_stl_export_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_stl_export_exec(bContext *C, wmOperator *op) { if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) { BKE_report(op->reports, RPT_ERROR, "No filename given"); @@ -195,7 +197,7 @@ void WM_OT_stl_export(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_HIDDEN); } -static int wm_stl_import_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_stl_import_exec(bContext *C, wmOperator *op) { STLImportParams params; params.forward_axis = eIOAxis(RNA_enum_get(op->ptr, "forward_axis")); diff --git a/source/blender/editors/io/io_usd.cc b/source/blender/editors/io/io_usd.cc index ede3057910a..f7e9c9562c2 100644 --- a/source/blender/editors/io/io_usd.cc +++ b/source/blender/editors/io/io_usd.cc @@ -244,7 +244,9 @@ static void process_prim_path(char *prim_path) } } -static int wm_usd_export_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus wm_usd_export_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { USDOperatorOptions *options = MEM_callocN("USDOperatorOptions"); options->as_background_job = true; @@ -257,7 +259,7 @@ static int wm_usd_export_invoke(bContext *C, wmOperator *op, const wmEvent * /*e return OPERATOR_RUNNING_MODAL; } -static int wm_usd_export_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_usd_export_exec(bContext *C, wmOperator *op) { if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) { BKE_report(op->reports, RPT_ERROR, "No filepath given"); @@ -911,7 +913,7 @@ void WM_OT_usd_export(wmOperatorType *ot) /* ====== USD Import ====== */ -static int wm_usd_import_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus wm_usd_import_invoke(bContext *C, wmOperator *op, const wmEvent *event) { USDOperatorOptions *options = MEM_callocN("USDOperatorOptions"); options->as_background_job = true; @@ -920,7 +922,7 @@ static int wm_usd_import_invoke(bContext *C, wmOperator *op, const wmEvent *even return blender::ed::io::filesel_drop_import_invoke(C, op, event); } -static int wm_usd_import_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_usd_import_exec(bContext *C, wmOperator *op) { if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) { BKE_report(op->reports, RPT_ERROR, "No filepath given"); diff --git a/source/blender/editors/io/io_utils.cc b/source/blender/editors/io/io_utils.cc index 40812c0eacb..47b7d8eab04 100644 --- a/source/blender/editors/io/io_utils.cc +++ b/source/blender/editors/io/io_utils.cc @@ -22,7 +22,7 @@ namespace blender::ed::io { -int filesel_drop_import_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +wmOperatorStatus filesel_drop_import_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { PropertyRNA *filepath_prop = RNA_struct_find_property(op->ptr, "filepath"); diff --git a/source/blender/editors/io/io_utils.hh b/source/blender/editors/io/io_utils.hh index b4f029ddd97..d69ab769a79 100644 --- a/source/blender/editors/io/io_utils.hh +++ b/source/blender/editors/io/io_utils.hh @@ -18,7 +18,7 @@ namespace blender::ed::io { * Shows a import dialog if the operator was invoked with filepath properties set, * otherwise invokes the file-select window. */ -int filesel_drop_import_invoke(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus filesel_drop_import_invoke(bContext *C, wmOperator *op, const wmEvent *event); bool poll_file_object_drop(const bContext *C, blender::bke::FileHandlerType *fh); diff --git a/source/blender/editors/lattice/editlattice_select.cc b/source/blender/editors/lattice/editlattice_select.cc index 0d27df6622f..8a5e443c6ac 100644 --- a/source/blender/editors/lattice/editlattice_select.cc +++ b/source/blender/editors/lattice/editlattice_select.cc @@ -89,7 +89,7 @@ bool ED_lattice_deselect_all_multi(bContext *C) /** \name Select Random Operator * \{ */ -static int lattice_select_random_exec(bContext *C, wmOperator *op) +static wmOperatorStatus lattice_select_random_exec(bContext *C, wmOperator *op) { const bool select = (RNA_enum_get(op->ptr, "action") == SEL_SELECT); const float randfac = RNA_float_get(op->ptr, "ratio"); @@ -198,7 +198,7 @@ static void ed_lattice_select_mirrored(Lattice *lt, const int axis, const bool e MEM_freeN(selpoints); } -static int lattice_select_mirror_exec(bContext *C, wmOperator *op) +static wmOperatorStatus lattice_select_mirror_exec(bContext *C, wmOperator *op) { const int axis_flag = RNA_enum_get(op->ptr, "axis"); const bool extend = RNA_boolean_get(op->ptr, "extend"); @@ -265,7 +265,7 @@ static bool lattice_test_bitmap_uvw( return false; } -static int lattice_select_more_less(bContext *C, const bool select) +static wmOperatorStatus lattice_select_more_less(bContext *C, const bool select) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -315,12 +315,12 @@ static int lattice_select_more_less(bContext *C, const bool select) return changed ? OPERATOR_FINISHED : OPERATOR_CANCELLED; } -static int lattice_select_more_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus lattice_select_more_exec(bContext *C, wmOperator * /*op*/) { return lattice_select_more_less(C, true); } -static int lattice_select_less_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus lattice_select_less_exec(bContext *C, wmOperator * /*op*/) { return lattice_select_more_less(C, false); } @@ -389,7 +389,7 @@ bool ED_lattice_flags_set(Object *obedit, int flag) return changed; } -static int lattice_select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus lattice_select_all_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -474,7 +474,7 @@ void LATTICE_OT_select_all(wmOperatorType *ot) /** \name Select Ungrouped Verts Operator * \{ */ -static int lattice_select_ungrouped_exec(bContext *C, wmOperator *op) +static wmOperatorStatus lattice_select_ungrouped_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); diff --git a/source/blender/editors/lattice/editlattice_tools.cc b/source/blender/editors/lattice/editlattice_tools.cc index 23a53da47af..4ad70188d54 100644 --- a/source/blender/editors/lattice/editlattice_tools.cc +++ b/source/blender/editors/lattice/editlattice_tools.cc @@ -48,7 +48,7 @@ static bool make_regular_poll(bContext *C) return (ob && ob->type == OB_LATTICE); } -static int make_regular_exec(bContext *C, wmOperator *op) +static wmOperatorStatus make_regular_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -196,7 +196,7 @@ static void lattice_swap_point_pairs( lattice_flip_point_value(lt, u1, v1, w1, mid, axis); } -static int lattice_flip_exec(bContext *C, wmOperator *op) +static wmOperatorStatus lattice_flip_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); diff --git a/source/blender/editors/mask/mask_add.cc b/source/blender/editors/mask/mask_add.cc index a6525c2837c..aba8c8af951 100644 --- a/source/blender/editors/mask/mask_add.cc +++ b/source/blender/editors/mask/mask_add.cc @@ -452,12 +452,12 @@ static void mask_point_make_pixel_space(bContext *C, point_pixel[1] = point_normalized[1] * scaley; } -static int add_vertex_handle_cyclic_at_point(bContext *C, - Mask *mask, - MaskSpline *spline, - MaskSplinePoint *active_point, - MaskSplinePoint *other_point, - float co[2]) +static wmOperatorStatus add_vertex_handle_cyclic_at_point(bContext *C, + Mask *mask, + MaskSpline *spline, + MaskSplinePoint *active_point, + MaskSplinePoint *other_point, + float co[2]) { const float tolerance_in_pixels_squared = 4 * 4; @@ -492,7 +492,7 @@ static int add_vertex_handle_cyclic_at_point(bContext *C, return OPERATOR_FINISHED; } -static int add_vertex_handle_cyclic( +static wmOperatorStatus add_vertex_handle_cyclic( bContext *C, Mask *mask, MaskSpline *spline, MaskSplinePoint *active_point, float co[2]) { MaskSplinePoint *first_point = &spline->points[0]; @@ -514,7 +514,7 @@ static int add_vertex_handle_cyclic( /** \name Add Vertex Operator * \{ */ -static int add_vertex_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_vertex_exec(bContext *C, wmOperator *op) { MaskViewLockState lock_state; ED_mask_view_lock_state_store(C, &lock_state); @@ -540,7 +540,8 @@ static int add_vertex_exec(bContext *C, wmOperator *op) { MaskSpline *spline = mask_layer->act_spline; MaskSplinePoint *active_point = mask_layer->act_point; - const int cyclic_result = add_vertex_handle_cyclic(C, mask, spline, active_point, co); + const wmOperatorStatus cyclic_result = add_vertex_handle_cyclic( + C, mask, spline, active_point, co); if (cyclic_result != OPERATOR_PASS_THROUGH) { return cyclic_result; } @@ -566,7 +567,7 @@ static int add_vertex_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int add_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus add_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); @@ -614,7 +615,7 @@ void MASK_OT_add_vertex(wmOperatorType *ot) /** \name Add Feather Vertex Operator * \{ */ -static int add_feather_vertex_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_feather_vertex_exec(bContext *C, wmOperator *op) { Mask *mask = CTX_data_edit_mask(C); MaskLayer *mask_layer; @@ -663,7 +664,9 @@ static int add_feather_vertex_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int add_feather_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus add_feather_vertex_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); @@ -812,7 +815,9 @@ static int create_primitive_from_points( return OPERATOR_FINISHED; } -static int primitive_add_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus primitive_add_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { ScrArea *area = CTX_wm_area(C); float cursor[2]; @@ -851,7 +856,7 @@ static void define_primitive_add_properties(wmOperatorType *ot) /** \name Primitive Add Circle Operator * \{ */ -static int primitive_circle_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus primitive_circle_add_exec(bContext *C, wmOperator *op) { const float points[4][2] = {{0.0f, 0.5f}, {0.5f, 1.0f}, {1.0f, 0.5f}, {0.5f, 0.0f}}; int num_points = ARRAY_SIZE(points); @@ -886,7 +891,7 @@ void MASK_OT_primitive_circle_add(wmOperatorType *ot) /** \name Primitive Add Square Operator * \{ */ -static int primitive_square_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus primitive_square_add_exec(bContext *C, wmOperator *op) { const float points[4][2] = {{0.0f, 0.0f}, {0.0f, 1.0f}, {1.0f, 1.0f}, {1.0f, 0.0f}}; int num_points = ARRAY_SIZE(points); diff --git a/source/blender/editors/mask/mask_ops.cc b/source/blender/editors/mask/mask_ops.cc index 994a4f58bbb..700ebf0baf7 100644 --- a/source/blender/editors/mask/mask_ops.cc +++ b/source/blender/editors/mask/mask_ops.cc @@ -95,7 +95,7 @@ MaskLayer *ED_mask_layer_ensure(bContext *C, bool *r_added_mask) return mask_layer; } -static int mask_new_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mask_new_exec(bContext *C, wmOperator *op) { char name[MAX_ID_NAME - 2]; @@ -128,7 +128,7 @@ void MASK_OT_new(wmOperatorType *ot) /******************** create new mask layer *********************/ -static int mask_layer_new_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mask_layer_new_exec(bContext *C, wmOperator *op) { Mask *mask = CTX_data_edit_mask(C); char name[MAX_ID_NAME - 2]; @@ -164,7 +164,7 @@ void MASK_OT_layer_new(wmOperatorType *ot) /******************** remove mask layer *********************/ -static int mask_layer_remove_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus mask_layer_remove_exec(bContext *C, wmOperator * /*op*/) { Mask *mask = CTX_data_edit_mask(C); MaskLayer *mask_layer = BKE_mask_layer_active(mask); @@ -558,7 +558,7 @@ static SlidePointData *slide_point_customdata(bContext *C, wmOperator *op, const return customdata; } -static int slide_point_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus slide_point_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Mask *mask = CTX_data_edit_mask(C); SlidePointData *slidedata; @@ -643,7 +643,7 @@ static void free_slide_point_data(SlidePointData *data) MEM_freeN(data); } -static int slide_point_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus slide_point_modal(bContext *C, wmOperator *op, const wmEvent *event) { SlidePointData *data = (SlidePointData *)op->customdata; BezTriple *bezt = &data->point->bezt; @@ -1096,7 +1096,9 @@ static SlideSplineCurvatureData *slide_spline_curvature_customdata(bContext *C, return slide_data; } -static int slide_spline_curvature_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus slide_spline_curvature_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Mask *mask = CTX_data_edit_mask(C); SlideSplineCurvatureData *slide_data; @@ -1153,7 +1155,9 @@ static void slide_spline_solve_P2(const float u, solution[1] = -(v3 * P0[1] + t * P1[1] + u3 * P3[1] - B[1]) * inv_divider; } -static int slide_spline_curvature_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus slide_spline_curvature_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { Scene *scene = CTX_data_scene(C); const float margin = 0.2f; @@ -1324,7 +1328,7 @@ void MASK_OT_slide_spline_curvature(wmOperatorType *ot) /******************** toggle cyclic *********************/ -static int cyclic_toggle_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus cyclic_toggle_exec(bContext *C, wmOperator * /*op*/) { Mask *mask = CTX_data_edit_mask(C); @@ -1401,7 +1405,7 @@ static void delete_feather_points(MaskSplinePoint *point) } } -static int delete_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus delete_exec(bContext *C, wmOperator * /*op*/) { Mask *mask = CTX_data_edit_mask(C); bool changed = false; @@ -1508,7 +1512,7 @@ static int delete_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -static int delete_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus delete_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { if (RNA_boolean_get(op->ptr, "confirm")) { return WM_operator_confirm_ex(C, @@ -1540,7 +1544,7 @@ void MASK_OT_delete(wmOperatorType *ot) } /* *** switch direction *** */ -static int mask_switch_direction_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus mask_switch_direction_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); Mask *mask = CTX_data_edit_mask(C); @@ -1598,7 +1602,7 @@ void MASK_OT_switch_direction(wmOperatorType *ot) } /* *** recalc normals *** */ -static int mask_normals_make_consistent_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus mask_normals_make_consistent_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); Mask *mask = CTX_data_edit_mask(C); @@ -1661,7 +1665,7 @@ void MASK_OT_normals_make_consistent(wmOperatorType *ot) /******************** set handle type *********************/ -static int set_handle_type_exec(bContext *C, wmOperator *op) +static wmOperatorStatus set_handle_type_exec(bContext *C, wmOperator *op) { Mask *mask = CTX_data_edit_mask(C); int handle_type = RNA_enum_get(op->ptr, "type"); @@ -1743,7 +1747,7 @@ void MASK_OT_handle_type_set(wmOperatorType *ot) } /* ********* clear/set restrict view *********/ -static int mask_hide_view_clear_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mask_hide_view_clear_exec(bContext *C, wmOperator *op) { Mask *mask = CTX_data_edit_mask(C); bool changed = false; @@ -1785,7 +1789,7 @@ void MASK_OT_hide_view_clear(wmOperatorType *ot) RNA_def_boolean(ot->srna, "select", true, "Select", ""); } -static int mask_hide_view_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mask_hide_view_set_exec(bContext *C, wmOperator *op) { Mask *mask = CTX_data_edit_mask(C); const bool unselected = RNA_boolean_get(op->ptr, "unselected"); @@ -1846,7 +1850,7 @@ void MASK_OT_hide_view_set(wmOperatorType *ot) ot->srna, "unselected", false, "Unselected", "Hide unselected rather than selected layers"); } -static int mask_feather_weight_clear_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus mask_feather_weight_clear_exec(bContext *C, wmOperator * /*op*/) { Mask *mask = CTX_data_edit_mask(C); bool changed = false; @@ -1908,7 +1912,7 @@ static bool mask_layer_move_poll(bContext *C) return false; } -static int mask_layer_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mask_layer_move_exec(bContext *C, wmOperator *op) { Mask *mask = CTX_data_edit_mask(C); MaskLayer *mask_layer = static_cast( @@ -1980,7 +1984,7 @@ void MASK_OT_layer_move(wmOperatorType *ot) /******************** duplicate *********************/ -static int mask_duplicate_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus mask_duplicate_exec(bContext *C, wmOperator * /*op*/) { Mask *mask = CTX_data_edit_mask(C); @@ -2115,7 +2119,7 @@ void MASK_OT_duplicate(wmOperatorType *ot) /********************** copy splines to clipboard operator *********************/ -static int copy_splines_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus copy_splines_exec(bContext *C, wmOperator * /*op*/) { Mask *mask = CTX_data_edit_mask(C); MaskLayer *mask_layer = BKE_mask_layer_active(mask); @@ -2155,7 +2159,7 @@ static bool paste_splines_poll(bContext *C) return false; } -static int paste_splines_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus paste_splines_exec(bContext *C, wmOperator * /*op*/) { Mask *mask = CTX_data_edit_mask(C); MaskLayer *mask_layer = BKE_mask_layer_active(mask); diff --git a/source/blender/editors/mask/mask_relationships.cc b/source/blender/editors/mask/mask_relationships.cc index a8c0b04b72b..6db19b23bbc 100644 --- a/source/blender/editors/mask/mask_relationships.cc +++ b/source/blender/editors/mask/mask_relationships.cc @@ -27,7 +27,7 @@ #include "mask_intern.hh" /* own include */ -static int mask_parent_clear_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus mask_parent_clear_exec(bContext *C, wmOperator * /*op*/) { Mask *mask = CTX_data_edit_mask(C); @@ -69,7 +69,7 @@ void MASK_OT_parent_clear(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int mask_parent_set_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus mask_parent_set_exec(bContext *C, wmOperator * /*op*/) { Mask *mask = CTX_data_edit_mask(C); diff --git a/source/blender/editors/mask/mask_select.cc b/source/blender/editors/mask/mask_select.cc index 0e63cdb44c7..bfad98be0cb 100644 --- a/source/blender/editors/mask/mask_select.cc +++ b/source/blender/editors/mask/mask_select.cc @@ -195,7 +195,7 @@ void ED_mask_deselect_all(const bContext *C) /** \name (De)select All Operator * \{ */ -static int select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_all_exec(bContext *C, wmOperator *op) { Mask *mask = CTX_data_edit_mask(C); int action = RNA_enum_get(op->ptr, "action"); @@ -238,7 +238,7 @@ void MASK_OT_select_all(wmOperatorType *ot) /** \name Select (Cursor Pick) Operator * \{ */ -static int select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_exec(bContext *C, wmOperator *op) { Mask *mask = CTX_data_edit_mask(C); MaskLayer *mask_layer; @@ -374,7 +374,7 @@ static int select_exec(bContext *C, wmOperator *op) return OPERATOR_PASS_THROUGH; } -static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); @@ -385,7 +385,7 @@ static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event) RNA_float_set_array(op->ptr, "location", co); - const int retval = select_exec(C, op); + const wmOperatorStatus retval = select_exec(C, op); return WM_operator_flag_only_pass_through_on_press(retval, event); } @@ -427,7 +427,7 @@ void MASK_OT_select(wmOperatorType *ot) /** \name Box Select Operator * \{ */ -static int box_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus box_select_exec(bContext *C, wmOperator *op) { ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); @@ -604,7 +604,7 @@ static bool do_lasso_select_mask(bContext *C, const Span mcoords, const eS return changed; } -static int clip_lasso_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus clip_lasso_select_exec(bContext *C, wmOperator *op) { const Array mcoords = WM_gesture_lasso_path_to_array(C, op); if (mcoords.is_empty()) { @@ -658,7 +658,7 @@ static int mask_spline_point_inside_ellipse(BezTriple *bezt, return x * x + y * y < 1.0f; } -static int circle_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus circle_select_exec(bContext *C, wmOperator *op) { ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); @@ -766,7 +766,9 @@ void MASK_OT_select_circle(wmOperatorType *ot) /** \name Select Linked (Cursor Pick) Operator * \{ */ -static int mask_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus mask_select_linked_pick_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); @@ -828,7 +830,7 @@ void MASK_OT_select_linked_pick(wmOperatorType *ot) /** \name Select Linked Operator * \{ */ -static int mask_select_linked_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus mask_select_linked_exec(bContext *C, wmOperator * /*op*/) { Mask *mask = CTX_data_edit_mask(C); @@ -881,7 +883,7 @@ void MASK_OT_select_linked(wmOperatorType *ot) /** \name Select More/Less Operators * \{ */ -static int mask_select_more_less(bContext *C, bool more) +static wmOperatorStatus mask_select_more_less(bContext *C, bool more) { Mask *mask = CTX_data_edit_mask(C); @@ -954,7 +956,7 @@ static int mask_select_more_less(bContext *C, bool more) return OPERATOR_FINISHED; } -static int mask_select_more_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus mask_select_more_exec(bContext *C, wmOperator * /*op*/) { return mask_select_more_less(C, true); } @@ -974,7 +976,7 @@ void MASK_OT_select_more(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int mask_select_less_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus mask_select_less_exec(bContext *C, wmOperator * /*op*/) { return mask_select_more_less(C, false); } diff --git a/source/blender/editors/mask/mask_shapekey.cc b/source/blender/editors/mask/mask_shapekey.cc index 62b2cc7726c..af01bea8aea 100644 --- a/source/blender/editors/mask/mask_shapekey.cc +++ b/source/blender/editors/mask/mask_shapekey.cc @@ -28,7 +28,7 @@ #include "mask_intern.hh" /* own include */ -static int mask_shape_key_insert_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus mask_shape_key_insert_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); const int frame = scene->r.cfra; @@ -71,7 +71,7 @@ void MASK_OT_shape_key_insert(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int mask_shape_key_clear_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus mask_shape_key_clear_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); const int frame = scene->r.cfra; @@ -117,7 +117,7 @@ void MASK_OT_shape_key_clear(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int mask_shape_key_feather_reset_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus mask_shape_key_feather_reset_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); const int frame = scene->r.cfra; @@ -207,7 +207,7 @@ void MASK_OT_shape_key_feather_reset(wmOperatorType *ot) * - copy unselected values back from the original. * - free the original. */ -static int mask_shape_key_rekey_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mask_shape_key_rekey_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); const int frame = scene->r.cfra; diff --git a/source/blender/editors/mesh/editmesh_add.cc b/source/blender/editors/mesh/editmesh_add.cc index c79b5ffbab8..1d74572a25b 100644 --- a/source/blender/editors/mesh/editmesh_add.cc +++ b/source/blender/editors/mesh/editmesh_add.cc @@ -90,7 +90,7 @@ static void make_prim_finish(bContext *C, WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, obedit); } -static int add_primitive_plane_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_plane_exec(bContext *C, wmOperator *op) { MakePrimitiveData creation_data; Object *obedit; @@ -156,7 +156,7 @@ void MESH_OT_primitive_plane_add(wmOperatorType *ot) blender::ed::object::add_generic_props(ot, true); } -static int add_primitive_cube_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_cube_exec(bContext *C, wmOperator *op) { MakePrimitiveData creation_data; Object *obedit; @@ -227,7 +227,7 @@ static const EnumPropertyItem fill_type_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int add_primitive_circle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_circle_exec(bContext *C, wmOperator *op) { MakePrimitiveData creation_data; Object *obedit; @@ -302,7 +302,7 @@ void MESH_OT_primitive_circle_add(wmOperatorType *ot) blender::ed::object::add_generic_props(ot, true); } -static int add_primitive_cylinder_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_cylinder_exec(bContext *C, wmOperator *op) { MakePrimitiveData creation_data; Object *obedit; @@ -379,7 +379,7 @@ void MESH_OT_primitive_cylinder_add(wmOperatorType *ot) blender::ed::object::add_generic_props(ot, true); } -static int add_primitive_cone_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_cone_exec(bContext *C, wmOperator *op) { MakePrimitiveData creation_data; Object *obedit; @@ -459,7 +459,7 @@ void MESH_OT_primitive_cone_add(wmOperatorType *ot) blender::ed::object::add_generic_props(ot, true); } -static int add_primitive_grid_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_grid_exec(bContext *C, wmOperator *op) { MakePrimitiveData creation_data; Object *obedit; @@ -532,7 +532,7 @@ void MESH_OT_primitive_grid_add(wmOperatorType *ot) blender::ed::object::add_generic_props(ot, true); } -static int add_primitive_monkey_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_monkey_exec(bContext *C, wmOperator *op) { MakePrimitiveData creation_data; Object *obedit; @@ -599,7 +599,7 @@ void MESH_OT_primitive_monkey_add(wmOperatorType *ot) blender::ed::object::add_generic_props(ot, true); } -static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_uvsphere_exec(bContext *C, wmOperator *op) { MakePrimitiveData creation_data; Object *obedit; @@ -670,7 +670,7 @@ void MESH_OT_primitive_uv_sphere_add(wmOperatorType *ot) blender::ed::object::add_generic_props(ot, true); } -static int add_primitive_icosphere_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_icosphere_exec(bContext *C, wmOperator *op) { MakePrimitiveData creation_data; Object *obedit; diff --git a/source/blender/editors/mesh/editmesh_add_gizmo.cc b/source/blender/editors/mesh/editmesh_add_gizmo.cc index d77948d18b6..8d4796f6b9e 100644 --- a/source/blender/editors/mesh/editmesh_add_gizmo.cc +++ b/source/blender/editors/mesh/editmesh_add_gizmo.cc @@ -305,7 +305,7 @@ static void MESH_GGT_add_bounds(wmGizmoGroupType *gzgt) * and share the same BMesh creation code. * \{ */ -static int add_primitive_cube_gizmo_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_primitive_cube_gizmo_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); BMEditMesh *em = BKE_editmesh_from_object(obedit); @@ -353,11 +353,13 @@ static int add_primitive_cube_gizmo_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int add_primitive_cube_gizmo_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus add_primitive_cube_gizmo_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { View3D *v3d = CTX_wm_view3d(C); - int ret = add_primitive_cube_gizmo_exec(C, op); + wmOperatorStatus ret = add_primitive_cube_gizmo_exec(C, op); if (ret & OPERATOR_FINISHED) { /* Setup gizmos */ if (v3d && ((v3d->gizmo_flag & V3D_GIZMO_HIDE) == 0)) { diff --git a/source/blender/editors/mesh/editmesh_attribute.cc b/source/blender/editors/mesh/editmesh_attribute.cc index 94912088f10..82c437e6fe1 100644 --- a/source/blender/editors/mesh/editmesh_attribute.cc +++ b/source/blender/editors/mesh/editmesh_attribute.cc @@ -129,7 +129,7 @@ static void bmesh_loop_layer_selected_values_set(BMEditMesh &em, } } -static int mesh_set_attribute_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mesh_set_attribute_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -205,7 +205,9 @@ static int mesh_set_attribute_exec(bContext *C, wmOperator *op) return changed ? OPERATOR_FINISHED : OPERATOR_CANCELLED; } -static int mesh_set_attribute_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus mesh_set_attribute_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Mesh *mesh = ED_mesh_context(C); BMesh *bm = mesh->runtime->edit_mesh->bm; diff --git a/source/blender/editors/mesh/editmesh_bevel.cc b/source/blender/editors/mesh/editmesh_bevel.cc index 4cd39a874f5..8ff7f314015 100644 --- a/source/blender/editors/mesh/editmesh_bevel.cc +++ b/source/blender/editors/mesh/editmesh_bevel.cc @@ -439,7 +439,7 @@ static void edbm_bevel_cancel(bContext *C, wmOperator *op) } /* bevel! yay!! */ -static int edbm_bevel_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_bevel_exec(bContext *C, wmOperator *op) { if (!edbm_bevel_init(C, op, false)) { return OPERATOR_CANCELLED; @@ -479,7 +479,7 @@ static void edbm_bevel_calc_initial_length(wmOperator *op, const wmEvent *event, opdata->initial_length[opdata->value_mode] = len; } -static int edbm_bevel_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus edbm_bevel_invoke(bContext *C, wmOperator *op, const wmEvent *event) { RegionView3D *rv3d = CTX_wm_region_view3d(C); @@ -652,7 +652,7 @@ wmKeyMap *bevel_modal_keymap(wmKeyConfig *keyconf) return keymap; } -static int edbm_bevel_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus edbm_bevel_modal(bContext *C, wmOperator *op, const wmEvent *event) { BevelData *opdata = static_cast(op->customdata); const bool has_numinput = hasNumInput(&opdata->num_input[opdata->value_mode]); diff --git a/source/blender/editors/mesh/editmesh_bisect.cc b/source/blender/editors/mesh/editmesh_bisect.cc index 61d8ead0a23..432e5f45e1c 100644 --- a/source/blender/editors/mesh/editmesh_bisect.cc +++ b/source/blender/editors/mesh/editmesh_bisect.cc @@ -48,7 +48,7 @@ using blender::Vector; -static int mesh_bisect_exec(bContext *C, wmOperator *op); +static wmOperatorStatus mesh_bisect_exec(bContext *C, wmOperator *op); /* -------------------------------------------------------------------- */ /* Model Helpers */ @@ -106,7 +106,7 @@ static void mesh_bisect_interactive_calc(bContext *C, ED_view3d_win_to_3d(v3d, region, co_ref, co_a_ss, plane_co); } -static int mesh_bisect_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus mesh_bisect_invoke(bContext *C, wmOperator *op, const wmEvent *event) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -136,7 +136,7 @@ static int mesh_bisect_invoke(bContext *C, wmOperator *op, const wmEvent *event) } /* Support flipping if side matters. */ - int ret; + wmOperatorStatus ret; const bool clear_inner = RNA_boolean_get(op->ptr, "clear_inner"); const bool clear_outer = RNA_boolean_get(op->ptr, "clear_outer"); const bool use_fill = RNA_boolean_get(op->ptr, "use_fill"); @@ -192,12 +192,12 @@ static void edbm_bisect_exit(BisectData *opdata) MEM_freeN(opdata->backup); } -static int mesh_bisect_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus mesh_bisect_modal(bContext *C, wmOperator *op, const wmEvent *event) { wmGesture *gesture = static_cast(op->customdata); BisectData *opdata = static_cast(gesture->user_data.data); BisectData opdata_back = *opdata; /* annoyance, WM_gesture_straightline_modal, frees */ - int ret; + wmOperatorStatus ret; ret = WM_gesture_straightline_modal(C, op, event); @@ -228,14 +228,14 @@ static int mesh_bisect_modal(bContext *C, wmOperator *op, const wmEvent *event) /* End Model Helpers */ /* -------------------------------------------------------------------- */ -static int mesh_bisect_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mesh_bisect_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); /* both can be nullptr, fallbacks values are used */ RegionView3D *rv3d = ED_view3d_context_rv3d(C); - int ret = OPERATOR_CANCELLED; + wmOperatorStatus ret = OPERATOR_CANCELLED; float plane_co[3]; float plane_no[3]; diff --git a/source/blender/editors/mesh/editmesh_extrude.cc b/source/blender/editors/mesh/editmesh_extrude.cc index a624d4a9aa5..4a1c7f063e0 100644 --- a/source/blender/editors/mesh/editmesh_extrude.cc +++ b/source/blender/editors/mesh/editmesh_extrude.cc @@ -261,7 +261,7 @@ static bool edbm_extrude_ex(Object *obedit, /** \name Extrude Repeat Operator * \{ */ -static int edbm_extrude_repeat_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_extrude_repeat_exec(bContext *C, wmOperator *op) { PropertyRNA *prop = RNA_struct_find_property(op->ptr, "offset"); @@ -425,7 +425,7 @@ static bool edbm_extrude_mesh(Object *obedit, BMEditMesh *em, wmOperator *op) } /* extrude without transform */ -static int edbm_extrude_region_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_extrude_region_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -481,7 +481,7 @@ void MESH_OT_extrude_region(wmOperatorType *ot) * \{ */ /* extrude without transform */ -static int edbm_extrude_context_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_extrude_context_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -532,7 +532,7 @@ void MESH_OT_extrude_context(wmOperatorType *ot) /** \name Extrude Verts Operator * \{ */ -static int edbm_extrude_verts_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_extrude_verts_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -581,7 +581,7 @@ void MESH_OT_extrude_verts_indiv(wmOperatorType *ot) /** \name Extrude Edges Operator * \{ */ -static int edbm_extrude_edges_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_extrude_edges_exec(bContext *C, wmOperator *op) { const bool use_normal_flip = RNA_boolean_get(op->ptr, "use_normal_flip"); const Scene *scene = CTX_data_scene(C); @@ -632,7 +632,7 @@ void MESH_OT_extrude_edges_indiv(wmOperatorType *ot) /** \name Extrude Faces Operator * \{ */ -static int edbm_extrude_faces_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_extrude_faces_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -682,7 +682,9 @@ void MESH_OT_extrude_faces_indiv(wmOperatorType *ot) * Add-click-mesh (extrude) operator. * \{ */ -static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus edbm_dupli_extrude_cursor_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); BMVert *v1; @@ -893,7 +895,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const w } /* Support dragging to move after extrude, see: #114282. */ - const int retval = OPERATOR_FINISHED | OPERATOR_PASS_THROUGH; + const wmOperatorStatus retval = OPERATOR_FINISHED | OPERATOR_PASS_THROUGH; return WM_operator_flag_only_pass_through_on_press(retval, event); } diff --git a/source/blender/editors/mesh/editmesh_extrude_screw.cc b/source/blender/editors/mesh/editmesh_extrude_screw.cc index 05ffeb92c82..7106887b208 100644 --- a/source/blender/editors/mesh/editmesh_extrude_screw.cc +++ b/source/blender/editors/mesh/editmesh_extrude_screw.cc @@ -34,7 +34,7 @@ using blender::Vector; /** \name Screw Operator * \{ */ -static int edbm_screw_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_screw_exec(bContext *C, wmOperator *op) { BMEdge *eed; BMVert *eve, *v1, *v2; @@ -160,7 +160,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, const wmEvent * /*event*/) +static wmOperatorStatus edbm_screw_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { Scene *scene = CTX_data_scene(C); RegionView3D *rv3d = ED_view3d_context_rv3d(C); diff --git a/source/blender/editors/mesh/editmesh_extrude_spin.cc b/source/blender/editors/mesh/editmesh_extrude_spin.cc index 81a569a8bd7..4a6864ab3cc 100644 --- a/source/blender/editors/mesh/editmesh_extrude_spin.cc +++ b/source/blender/editors/mesh/editmesh_extrude_spin.cc @@ -36,7 +36,7 @@ using blender::Vector; /** \name Spin Operator * \{ */ -static int edbm_spin_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_spin_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -105,7 +105,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, const wmEvent * /*event*/) +static wmOperatorStatus edbm_spin_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); @@ -131,7 +131,7 @@ static int edbm_spin_invoke(bContext *C, wmOperator *op, const wmEvent * /*event } #endif - int ret = edbm_spin_exec(C, op); + wmOperatorStatus ret = edbm_spin_exec(C, op); #ifdef USE_GIZMO if (ret & OPERATOR_FINISHED) { diff --git a/source/blender/editors/mesh/editmesh_inset.cc b/source/blender/editors/mesh/editmesh_inset.cc index 3c0a5669d07..c5819bb3443 100644 --- a/source/blender/editors/mesh/editmesh_inset.cc +++ b/source/blender/editors/mesh/editmesh_inset.cc @@ -318,7 +318,7 @@ static bool edbm_inset_calc(wmOperator *op) return changed; } -static int edbm_inset_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_inset_exec(bContext *C, wmOperator *op) { if (!edbm_inset_init(C, op, false)) { return OPERATOR_CANCELLED; @@ -333,7 +333,7 @@ static int edbm_inset_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int edbm_inset_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus edbm_inset_invoke(bContext *C, wmOperator *op, const wmEvent *event) { RegionView3D *rv3d = CTX_wm_region_view3d(C); InsetData *opdata; @@ -369,7 +369,7 @@ static int edbm_inset_invoke(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int edbm_inset_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus edbm_inset_modal(bContext *C, wmOperator *op, const wmEvent *event) { InsetData *opdata = static_cast(op->customdata); const bool has_numinput = hasNumInput(&opdata->num_input); diff --git a/source/blender/editors/mesh/editmesh_intersect.cc b/source/blender/editors/mesh/editmesh_intersect.cc index 8cf54273dc8..8679c42bd2a 100644 --- a/source/blender/editors/mesh/editmesh_intersect.cc +++ b/source/blender/editors/mesh/editmesh_intersect.cc @@ -134,7 +134,7 @@ enum { ISECT_SOLVER_EXACT = 1, }; -static int edbm_intersect_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_intersect_exec(bContext *C, wmOperator *op) { const int mode = RNA_enum_get(op->ptr, "mode"); int (*test_fn)(BMFace *, void *); @@ -329,7 +329,7 @@ void MESH_OT_intersect(wmOperatorType *ot) * however from a user perspective they are quite different, so expose as different tools. * \{ */ -static int edbm_intersect_boolean_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_intersect_boolean_exec(bContext *C, wmOperator *op) { const int boolean_operation = RNA_enum_get(op->ptr, "operation"); bool use_swap = RNA_boolean_get(op->ptr, "use_swap"); @@ -786,7 +786,7 @@ static BMEdge *bm_face_split_edge_find(BMEdge *e_a, #endif /* USE_NET_ISLAND_CONNECT */ -static int edbm_face_split_by_edges_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus edbm_face_split_by_edges_exec(bContext *C, wmOperator * /*op*/) { const char hflag = BM_ELEM_TAG; diff --git a/source/blender/editors/mesh/editmesh_knife.cc b/source/blender/editors/mesh/editmesh_knife.cc index ccfff24f5f2..8d724ecdc18 100644 --- a/source/blender/editors/mesh/editmesh_knife.cc +++ b/source/blender/editors/mesh/editmesh_knife.cc @@ -4145,7 +4145,7 @@ static void knifetool_disable_orientation_locking(KnifeTool_OpData *kcd) kcd->axis_constrained = false; } -static int knifetool_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus knifetool_modal(bContext *C, wmOperator *op, const wmEvent *event) { KnifeTool_OpData *kcd = static_cast(op->customdata); bool do_refresh = false; @@ -4496,7 +4496,7 @@ static int knifetool_modal(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int knifetool_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus knifetool_invoke(bContext *C, wmOperator *op, const wmEvent *event) { const bool only_select = RNA_boolean_get(op->ptr, "only_selected"); const bool cut_through = !RNA_boolean_get(op->ptr, "use_occlude_geometry"); diff --git a/source/blender/editors/mesh/editmesh_knife_project.cc b/source/blender/editors/mesh/editmesh_knife_project.cc index 724ca30f4f3..fea6e9c3023 100644 --- a/source/blender/editors/mesh/editmesh_knife_project.cc +++ b/source/blender/editors/mesh/editmesh_knife_project.cc @@ -101,7 +101,7 @@ static LinkNode *knifeproject_poly_from_object(const bContext *C, Object *ob, Li return polys; } -static int knifeproject_exec(bContext *C, wmOperator *op) +static wmOperatorStatus knifeproject_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); const bool cut_through = RNA_boolean_get(op->ptr, "cut_through"); diff --git a/source/blender/editors/mesh/editmesh_loopcut.cc b/source/blender/editors/mesh/editmesh_loopcut.cc index 3f2b29ba853..7f2c0ea9ec6 100644 --- a/source/blender/editors/mesh/editmesh_loopcut.cc +++ b/source/blender/editors/mesh/editmesh_loopcut.cc @@ -358,7 +358,7 @@ static void loopcut_mouse_move(RingSelOpData *lcd, const int previewlines) } /* called by both init() and exec() */ -static int loopcut_init(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus loopcut_init(bContext *C, wmOperator *op, const wmEvent *event) { /* Check whether both `rv3d` and `event` is present, this way we allow the loopcut operator to * run non-interactively no matter whether the graphical UI is present or not (e.g. from scripts @@ -484,7 +484,7 @@ static int loopcut_init(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_FINISHED; } -static int ringcut_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus ringcut_invoke(bContext *C, wmOperator *op, const wmEvent *event) { /* When accessed as a tool, get the active edge from the pre-selection gizmo. */ { @@ -510,12 +510,12 @@ static int ringcut_invoke(bContext *C, wmOperator *op, const wmEvent *event) return loopcut_init(C, op, event); } -static int loopcut_exec(bContext *C, wmOperator *op) +static wmOperatorStatus loopcut_exec(bContext *C, wmOperator *op) { return loopcut_init(C, op, nullptr); } -static int loopcut_finish(RingSelOpData *lcd, bContext *C, wmOperator *op) +static wmOperatorStatus loopcut_finish(RingSelOpData *lcd, bContext *C, wmOperator *op) { /* finish */ ED_region_tag_redraw(lcd->region); @@ -540,7 +540,7 @@ static int loopcut_finish(RingSelOpData *lcd, bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event) { if (event->type == NDOF_MOTION) { return OPERATOR_PASS_THROUGH; diff --git a/source/blender/editors/mesh/editmesh_mask_extract.cc b/source/blender/editors/mesh/editmesh_mask_extract.cc index afcd5da35c0..6b4fcdaffb0 100644 --- a/source/blender/editors/mesh/editmesh_mask_extract.cc +++ b/source/blender/editors/mesh/editmesh_mask_extract.cc @@ -74,10 +74,10 @@ struct GeometryExtractParams { /* Function that tags in BMesh the faces that should be deleted in the extracted object. */ using GeometryExtractTagMeshFunc = void(BMesh *, GeometryExtractParams *); -static int geometry_extract_apply(bContext *C, - wmOperator *op, - GeometryExtractTagMeshFunc *tag_fn, - GeometryExtractParams *params) +static wmOperatorStatus geometry_extract_apply(bContext *C, + wmOperator *op, + GeometryExtractTagMeshFunc *tag_fn, + GeometryExtractParams *params) { Main *bmain = CTX_data_main(C); Object *ob = CTX_data_active_object(C); @@ -275,7 +275,7 @@ static void geometry_extract_tag_face_set(BMesh *bm, GeometryExtractParams *para } } -static int paint_mask_extract_exec(bContext *C, wmOperator *op) +static wmOperatorStatus paint_mask_extract_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); Mesh *mesh = static_cast(ob->data); @@ -302,7 +302,7 @@ static int paint_mask_extract_exec(bContext *C, wmOperator *op) return geometry_extract_apply(C, op, geometry_extract_tag_masked_faces, ¶ms); } -static int paint_mask_extract_invoke(bContext *C, wmOperator *op, const wmEvent *e) +static wmOperatorStatus paint_mask_extract_invoke(bContext *C, wmOperator *op, const wmEvent *e) { return WM_operator_props_popup_confirm_ex( C, op, e, IFACE_("Create Mesh From Paint Mask"), IFACE_("Extract")); @@ -363,7 +363,7 @@ void MESH_OT_paint_mask_extract(wmOperatorType *ot) geometry_extract_props(ot->srna); } -static int face_set_extract_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus face_set_extract_invoke(bContext *C, wmOperator *op, const wmEvent *event) { using namespace blender::ed; if (!CTX_wm_region_view3d(C)) { @@ -458,7 +458,7 @@ static void slice_paint_mask(BMesh *bm, bool invert, bool fill_holes, float mask } } -static int paint_mask_slice_exec(bContext *C, wmOperator *op) +static wmOperatorStatus paint_mask_slice_exec(bContext *C, wmOperator *op) { using namespace blender; using namespace blender::ed; diff --git a/source/blender/editors/mesh/editmesh_path.cc b/source/blender/editors/mesh/editmesh_path.cc index 5136f0c6b32..830efffe2e0 100644 --- a/source/blender/editors/mesh/editmesh_path.cc +++ b/source/blender/editors/mesh/editmesh_path.cc @@ -678,7 +678,7 @@ static bool edbm_shortest_path_pick_ex(Scene *scene, return ok; } -static int edbm_shortest_path_pick_exec(bContext *C, wmOperator *op); +static wmOperatorStatus edbm_shortest_path_pick_exec(bContext *C, wmOperator *op); static BMElem *edbm_elem_find_nearest(ViewContext *vc, const char htype) { @@ -709,7 +709,9 @@ static BMElem *edbm_elem_active_elem_or_face_get(BMesh *bm) return ele; } -static int edbm_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus edbm_shortest_path_pick_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { if (RNA_struct_property_is_set(op->ptr, "index")) { return edbm_shortest_path_pick_exec(C, op); @@ -791,7 +793,7 @@ static int edbm_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmE return OPERATOR_FINISHED; } -static int edbm_shortest_path_pick_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_shortest_path_pick_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Object *obedit = CTX_data_edit_object(C); @@ -853,7 +855,7 @@ void MESH_OT_shortest_path_pick(wmOperatorType *ot) /** \name Select Path Between Existing Selection * \{ */ -static int edbm_shortest_path_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_shortest_path_select_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); bool found_valid_elements = false; diff --git a/source/blender/editors/mesh/editmesh_polybuild.cc b/source/blender/editors/mesh/editmesh_polybuild.cc index 54a6cb42fe0..e8898d591ef 100644 --- a/source/blender/editors/mesh/editmesh_polybuild.cc +++ b/source/blender/editors/mesh/editmesh_polybuild.cc @@ -113,9 +113,9 @@ static ViewContext edbm_preselect_or_active_init_viewcontext(bContext *C, return vc; } -static int edbm_polybuild_transform_at_cursor_invoke(bContext *C, - wmOperator * /*op*/, - const wmEvent * /*event*/) +static wmOperatorStatus edbm_polybuild_transform_at_cursor_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent * /*event*/) { Base *basact = nullptr; BMElem *ele_act = nullptr; @@ -177,9 +177,9 @@ void MESH_OT_polybuild_transform_at_cursor(wmOperatorType *ot) blender::ed::transform::properties_register(ot, P_PROPORTIONAL | P_MIRROR_DUMMY); } -static int edbm_polybuild_delete_at_cursor_invoke(bContext *C, - wmOperator *op, - const wmEvent * /*event*/) +static wmOperatorStatus edbm_polybuild_delete_at_cursor_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { bool changed = false; Base *basact = nullptr; @@ -270,7 +270,9 @@ void MESH_OT_polybuild_delete_at_cursor(wmOperatorType *ot) /** \name Face at Cursor * \{ */ -static int edbm_polybuild_face_at_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus edbm_polybuild_face_at_cursor_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { float center[3]; bool changed = false; @@ -445,9 +447,9 @@ void MESH_OT_polybuild_face_at_cursor(wmOperatorType *ot) /** \name Split at Cursor * \{ */ -static int edbm_polybuild_split_at_cursor_invoke(bContext *C, - wmOperator * /*op*/, - const wmEvent *event) +static wmOperatorStatus edbm_polybuild_split_at_cursor_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { float center[3]; bool changed = false; @@ -529,9 +531,9 @@ void MESH_OT_polybuild_split_at_cursor(wmOperatorType *ot) /** \name Dissolve at Cursor * \{ */ -static int edbm_polybuild_dissolve_at_cursor_invoke(bContext *C, - wmOperator *op, - const wmEvent * /*event*/) +static wmOperatorStatus edbm_polybuild_dissolve_at_cursor_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { bool changed = false; diff --git a/source/blender/editors/mesh/editmesh_rip.cc b/source/blender/editors/mesh/editmesh_rip.cc index 84f4dead2d4..efbdf8e2af2 100644 --- a/source/blender/editors/mesh/editmesh_rip.cc +++ b/source/blender/editors/mesh/editmesh_rip.cc @@ -1020,7 +1020,7 @@ static int edbm_rip_invoke__edge(bContext *C, const wmEvent *event, Object *obed * \{ */ /* based on mouse cursor position, it defines how is being ripped */ -static int edbm_rip_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus edbm_rip_invoke(bContext *C, wmOperator *op, const wmEvent *event) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); diff --git a/source/blender/editors/mesh/editmesh_rip_edge.cc b/source/blender/editors/mesh/editmesh_rip_edge.cc index 0e9a0e46562..5bf42f9a0b8 100644 --- a/source/blender/editors/mesh/editmesh_rip_edge.cc +++ b/source/blender/editors/mesh/editmesh_rip_edge.cc @@ -34,7 +34,9 @@ using blender::Vector; /* uses total number of selected edges around a vertex to choose how to extend */ #define USE_TRICKY_EXTEND -static int edbm_rip_edge_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus edbm_rip_edge_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); RegionView3D *rv3d = CTX_wm_region_view3d(C); diff --git a/source/blender/editors/mesh/editmesh_select.cc b/source/blender/editors/mesh/editmesh_select.cc index fd6ea22b685..52b4aa3a862 100644 --- a/source/blender/editors/mesh/editmesh_select.cc +++ b/source/blender/editors/mesh/editmesh_select.cc @@ -1354,7 +1354,7 @@ bool EDBM_unified_findnearest_from_raycast(ViewContext *vc, /** \name Select Similar Region Operator * \{ */ -static int edbm_select_similar_region_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_select_similar_region_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); BMEditMesh *em = BKE_editmesh_from_object(obedit); @@ -1444,7 +1444,7 @@ void MESH_OT_select_similar_region(wmOperatorType *ot) /** \name Select Mode Vert/Edge/Face Operator * \{ */ -static int edbm_select_mode_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_select_mode_exec(bContext *C, wmOperator *op) { const int type = RNA_enum_get(op->ptr, "type"); const int action = RNA_enum_get(op->ptr, "action"); @@ -1457,7 +1457,7 @@ static int edbm_select_mode_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int edbm_select_mode_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus edbm_select_mode_invoke(bContext *C, wmOperator *op, const wmEvent *event) { /* Bypass when in UV non sync-select mode, fall through to keymap that edits. */ if (CTX_wm_space_image(C)) { @@ -1621,7 +1621,7 @@ static bool walker_select(BMEditMesh *em, int walkercode, void *start, const boo return changed; } -static int edbm_loop_multiselect_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_loop_multiselect_exec(bContext *C, wmOperator *op) { const bool is_ring = RNA_boolean_get(op->ptr, "ring"); const Scene *scene = CTX_data_scene(C); @@ -1940,7 +1940,7 @@ static bool mouse_mesh_loop( return true; } -static int edbm_select_loop_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus edbm_select_loop_invoke(bContext *C, wmOperator *op, const wmEvent *event) { view3d_operator_needs_gpu(C); @@ -2016,7 +2016,7 @@ void MESH_OT_edgering_select(wmOperatorType *ot) /** \name (De)Select All Operator * \{ */ -static int edbm_select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_select_all_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -2080,7 +2080,7 @@ void MESH_OT_select_all(wmOperatorType *ot) /** \name Select Interior Faces Operator * \{ */ -static int edbm_faces_select_interior_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus edbm_faces_select_interior_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -3341,7 +3341,7 @@ static void select_linked_delimit_end(BMEditMesh *em) BM_mesh_elem_toolflags_clear(bm); } -static int edbm_select_linked_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_select_linked_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -3580,7 +3580,7 @@ void MESH_OT_select_linked(wmOperatorType *ot) /** \name Select Linked (Cursor Pick) Operator * \{ */ -static int edbm_select_linked_pick_exec(bContext *C, wmOperator *op); +static wmOperatorStatus edbm_select_linked_pick_exec(bContext *C, wmOperator *op); static void edbm_select_linked_pick_ex(BMEditMesh *em, BMElem *ele, bool sel, int delimit) { @@ -3697,7 +3697,9 @@ static void edbm_select_linked_pick_ex(BMEditMesh *em, BMElem *ele, bool sel, in } } -static int edbm_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus edbm_select_linked_pick_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Base *basact = nullptr; BMVert *eve; @@ -3778,7 +3780,7 @@ static int edbm_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmE return OPERATOR_FINISHED; } -static int edbm_select_linked_pick_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_select_linked_pick_exec(bContext *C, wmOperator *op) { Object *obedit = nullptr; BMElem *ele; @@ -3854,7 +3856,7 @@ void MESH_OT_select_linked_pick(wmOperatorType *ot) /** \name Select by Pole Count Operator * \{ */ -static int edbm_select_by_pole_count_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_select_by_pole_count_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -3982,7 +3984,7 @@ void MESH_OT_select_by_pole_count(wmOperatorType *ot) /** \name Select Face by Sides Operator * \{ */ -static int edbm_select_face_by_sides_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_select_face_by_sides_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -4057,7 +4059,7 @@ void MESH_OT_select_face_by_sides(wmOperatorType *ot) /** \name Select Loose Operator * \{ */ -static int edbm_select_loose_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_select_loose_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -4161,7 +4163,7 @@ void MESH_OT_select_loose(wmOperatorType *ot) /** \name Select Mirror Operator * \{ */ -static int edbm_select_mirror_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_select_mirror_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -4238,7 +4240,7 @@ void MESH_OT_select_mirror(wmOperatorType *ot) /** \name Select More Operator * \{ */ -static int edbm_select_more_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_select_more_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -4286,7 +4288,7 @@ void MESH_OT_select_more(wmOperatorType *ot) /** \name Select More Operator * \{ */ -static int edbm_select_less_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_select_less_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -4524,7 +4526,7 @@ static bool edbm_deselect_nth(BMEditMesh *em, const CheckerIntervalParams *op_pa return false; } -static int edbm_select_nth_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_select_nth_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -4594,7 +4596,7 @@ ViewContext em_setup_viewcontext(bContext *C) /** \name Select Sharp Edges Operator * \{ */ -static int edbm_select_sharp_edges_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_select_sharp_edges_exec(bContext *C, wmOperator *op) { /* Find edges that have exactly two neighboring faces, * check the angle between those faces, and if angle is @@ -4677,7 +4679,7 @@ void MESH_OT_edges_select_sharp(wmOperatorType *ot) /** \name Select Linked Flat Faces Operator * \{ */ -static int edbm_select_linked_flat_faces_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_select_linked_flat_faces_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -4777,7 +4779,7 @@ void MESH_OT_faces_select_linked_flat(wmOperatorType *ot) /** \name Select Non-Manifold Operator * \{ */ -static int edbm_select_non_manifold_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_select_non_manifold_exec(bContext *C, wmOperator *op) { const bool use_extend = RNA_boolean_get(op->ptr, "extend"); const bool use_wire = RNA_boolean_get(op->ptr, "use_wire"); @@ -4886,7 +4888,7 @@ void MESH_OT_select_non_manifold(wmOperatorType *ot) /** \name Select Random Operator * \{ */ -static int edbm_select_random_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_select_random_exec(bContext *C, wmOperator *op) { const bool select = (RNA_enum_get(op->ptr, "action") == SEL_SELECT); const float randfac = RNA_float_get(op->ptr, "ratio"); @@ -5021,7 +5023,7 @@ static bool edbm_select_ungrouped_poll(bContext *C) return false; } -static int edbm_select_ungrouped_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_select_ungrouped_exec(bContext *C, wmOperator *op) { const bool extend = RNA_boolean_get(op->ptr, "extend"); const Scene *scene = CTX_data_scene(C); @@ -5100,7 +5102,7 @@ enum { SELECT_AXIS_ALIGN = 2, }; -static int edbm_select_axis_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_select_axis_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -5243,7 +5245,7 @@ void MESH_OT_select_axis(wmOperatorType *ot) /** \name Select Region to Loop Operator * \{ */ -static int edbm_region_to_loop_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus edbm_region_to_loop_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -5469,7 +5471,7 @@ static int loop_find_regions(BMEditMesh *em, const bool selbigger) return count; } -static int edbm_loop_to_region_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_loop_to_region_exec(bContext *C, wmOperator *op) { const bool select_bigger = RNA_boolean_get(op->ptr, "select_bigger"); @@ -5581,7 +5583,7 @@ static std::optional domain_to_iter_type(const blender::bke::AttrDom } } -static int edbm_select_by_attribute_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus edbm_select_by_attribute_exec(bContext *C, wmOperator * /*op*/) { using namespace blender; const Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/mesh/editmesh_select_similar.cc b/source/blender/editors/mesh/editmesh_select_similar.cc index 3dfef658114..da624cbcfc9 100644 --- a/source/blender/editors/mesh/editmesh_select_similar.cc +++ b/source/blender/editors/mesh/editmesh_select_similar.cc @@ -149,7 +149,7 @@ static void face_to_plane(const Object *ob, BMFace *face, float r_plane[4]) * -SIMFACE_AREA * -SIMFACE_PERIMETER */ -static int similar_face_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus similar_face_select_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -556,7 +556,7 @@ static bool edge_data_value_set(BMEdge *edge, const int hflag, int *r_value) /* TODO(dfelinto): `types` that should technically be compared in world space but are not: * -SIMEDGE_FACE_ANGLE */ -static int similar_edge_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus similar_edge_select_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -943,7 +943,7 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op) /** \name Select Similar Vert * \{ */ -static int similar_vert_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus similar_vert_select_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1261,7 +1261,7 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op) /** \name Select Similar Operator * \{ */ -static int edbm_select_similar_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_select_similar_exec(bContext *C, wmOperator *op) { ToolSettings *ts = CTX_data_tool_settings(C); PropertyRNA *prop = RNA_struct_find_property(op->ptr, "threshold"); diff --git a/source/blender/editors/mesh/editmesh_set_sharpness_by_angle.cc b/source/blender/editors/mesh/editmesh_set_sharpness_by_angle.cc index 5c723e2f066..d1ee68c7e58 100644 --- a/source/blender/editors/mesh/editmesh_set_sharpness_by_angle.cc +++ b/source/blender/editors/mesh/editmesh_set_sharpness_by_angle.cc @@ -29,7 +29,7 @@ namespace blender::ed::mesh { -static int set_sharpness_by_angle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus set_sharpness_by_angle_exec(bContext *C, wmOperator *op) { const float angle_limit_cos = std::cos(RNA_float_get(op->ptr, "angle")); const bool extend = RNA_boolean_get(op->ptr, "extend"); diff --git a/source/blender/editors/mesh/editmesh_tools.cc b/source/blender/editors/mesh/editmesh_tools.cc index ee40db27806..432a60b8d76 100644 --- a/source/blender/editors/mesh/editmesh_tools.cc +++ b/source/blender/editors/mesh/editmesh_tools.cc @@ -84,7 +84,7 @@ using blender::Vector; /** \name Subdivide Operator * \{ */ -static int edbm_subdivide_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_subdivide_exec(bContext *C, wmOperator *op) { const int cuts = RNA_int_get(op->ptr, "number_cuts"); const float smooth = RNA_float_get(op->ptr, "smoothness"); @@ -288,7 +288,7 @@ static void mesh_operator_edgering_props_get(wmOperator *op, EdgeRingOpSubdProps op_props->profile_shape_factor = RNA_float_get(op->ptr, "profile_shape_factor"); } -static int edbm_subdivide_edge_ring_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_subdivide_edge_ring_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -353,7 +353,7 @@ void MESH_OT_subdivide_edgering(wmOperatorType *ot) /** \name Un-Subdivide Operator * \{ */ -static int edbm_unsubdivide_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_unsubdivide_exec(bContext *C, wmOperator *op) { const int iterations = RNA_int_get(op->ptr, "iterations"); const Scene *scene = CTX_data_scene(C); @@ -437,7 +437,7 @@ static void edbm_report_delete_info(ReportList *reports, totelem_old[2] - totelem_new[2]); } -static int edbm_delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_delete_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -576,7 +576,7 @@ static bool bm_face_is_loose(BMFace *f) return true; } -static int edbm_delete_loose_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_delete_loose_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -680,7 +680,7 @@ void MESH_OT_delete_loose(wmOperatorType *ot) /** \name Collapse Edge Operator * \{ */ -static int edbm_collapse_edge_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_collapse_edge_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -910,7 +910,7 @@ static void edbm_add_edge_face_exec__tricky_finalize_sel(BMesh *bm, BMElem *ele_ } #endif /* USE_FACE_CREATE_SEL_EXTEND */ -static int edbm_add_edge_face_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_add_edge_face_exec(bContext *C, wmOperator *op) { /* When this is used to dissolve we could avoid this, but checking isn't too slow. */ bool changed_multi = false; @@ -1025,7 +1025,7 @@ void MESH_OT_edge_face_add(wmOperatorType *ot) /** \name Mark Edge (Seam) Operator * \{ */ -static int edbm_mark_seam_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_mark_seam_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1103,7 +1103,7 @@ void MESH_OT_mark_seam(wmOperatorType *ot) /** \name Mark Edge (Sharp) Operator * \{ */ -static int edbm_mark_sharp_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_mark_sharp_exec(bContext *C, wmOperator *op) { BMEdge *eed; BMIter iter; @@ -1288,7 +1288,7 @@ static bool edbm_connect_vert_pair(BMEditMesh *em, Mesh *mesh, wmOperator *op) return len; } -static int edbm_vert_connect_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_vert_connect_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1535,7 +1535,7 @@ static bool bm_vert_connect_select_history_edge_to_vert_path(BMesh *bm, ListBase return true; } -static int edbm_vert_connect_path_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_vert_connect_path_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1627,7 +1627,7 @@ void MESH_OT_vert_connect_path(wmOperatorType *ot) /** \name Connect Concave Operator * \{ */ -static int edbm_vert_connect_concave_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_vert_connect_concave_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1676,7 +1676,7 @@ void MESH_OT_vert_connect_concave(wmOperatorType *ot) /** \name Split Non-Planar Faces Operator * \{ */ -static int edbm_vert_connect_nonplaner_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_vert_connect_nonplaner_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1748,7 +1748,7 @@ void MESH_OT_vert_connect_nonplanar(wmOperatorType *ot) /** \name Make Planar Faces Operator * \{ */ -static int edbm_face_make_planar_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_face_make_planar_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1916,7 +1916,7 @@ static bool edbm_edge_split_selected_verts(wmOperator *op, Object *obedit, BMEdi return true; } -static int edbm_edge_split_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_edge_split_exec(bContext *C, wmOperator *op) { const int type = RNA_enum_get(op->ptr, "type"); @@ -1981,7 +1981,7 @@ void MESH_OT_edge_split(wmOperatorType *ot) /** \name Duplicate Operator * \{ */ -static int edbm_duplicate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_duplicate_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -2033,10 +2033,12 @@ static int edbm_duplicate_exec(bContext *C, wmOperator *op) return (changed) ? OPERATOR_FINISHED : OPERATOR_CANCELLED; } -static int edbm_duplicate_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus edbm_duplicate_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { WM_cursor_wait(true); - const int retval = edbm_duplicate_exec(C, op); + const wmOperatorStatus retval = edbm_duplicate_exec(C, op); WM_cursor_wait(false); return retval; @@ -2224,7 +2226,7 @@ static void edbm_flip_normals_face_winding(wmOperator *op, Object *obedit, BMEdi } } -static int edbm_flip_quad_tessellation_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_flip_quad_tessellation_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -2242,7 +2244,7 @@ static int edbm_flip_quad_tessellation_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int edbm_flip_normals_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_flip_normals_exec(bContext *C, wmOperator *op) { const bool only_clnors = RNA_boolean_get(op->ptr, "only_clnors"); @@ -2301,7 +2303,7 @@ void MESH_OT_flip_normals(wmOperatorType *ot) /** * Rotate the edges between selected faces, otherwise rotate the selected edges. */ -static int edbm_edge_rotate_selected_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_edge_rotate_selected_exec(bContext *C, wmOperator *op) { BMEdge *eed; BMIter iter; @@ -2430,7 +2432,7 @@ void MESH_OT_edge_rotate(wmOperatorType *ot) /** \name Hide Operator * \{ */ -static int edbm_hide_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_hide_exec(bContext *C, wmOperator *op) { const bool unselected = RNA_boolean_get(op->ptr, "unselected"); const Scene *scene = CTX_data_scene(C); @@ -2508,7 +2510,7 @@ void MESH_OT_hide(wmOperatorType *ot) /** \name Reveal Operator * \{ */ -static int edbm_reveal_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_reveal_exec(bContext *C, wmOperator *op) { const bool select = RNA_boolean_get(op->ptr, "select"); const Scene *scene = CTX_data_scene(C); @@ -2554,7 +2556,7 @@ void MESH_OT_reveal(wmOperatorType *ot) /** \name Recalculate Normals Operator * \{ */ -static int edbm_normals_make_consistent_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_normals_make_consistent_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -2621,7 +2623,7 @@ void MESH_OT_normals_make_consistent(wmOperatorType *ot) /** \name Smooth Vertices Operator * \{ */ -static int edbm_do_smooth_vertex_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_do_smooth_vertex_exec(bContext *C, wmOperator *op) { const float fac = RNA_float_get(op->ptr, "factor"); @@ -2764,7 +2766,7 @@ void MESH_OT_vertices_smooth(wmOperatorType *ot) /** \name Laplacian Smooth Vertices Operator * \{ */ -static int edbm_do_smooth_laplacian_vertex_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_do_smooth_laplacian_vertex_exec(bContext *C, wmOperator *op) { int tot_selected = 0, tot_locked = 0; const Scene *scene = CTX_data_scene(C); @@ -2913,7 +2915,7 @@ static void mesh_set_smooth_faces(BMEditMesh *em, short smooth) } } -static int edbm_faces_shade_smooth_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus edbm_faces_shade_smooth_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -2958,7 +2960,7 @@ void MESH_OT_faces_shade_smooth(wmOperatorType *ot) /** \name Set Faces Flat Shading Operator * \{ */ -static int edbm_faces_shade_flat_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus edbm_faces_shade_flat_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -3003,7 +3005,7 @@ void MESH_OT_faces_shade_flat(wmOperatorType *ot) /** \name UV/Color Rotate/Reverse Operator * \{ */ -static int edbm_rotate_uvs_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_rotate_uvs_exec(bContext *C, wmOperator *op) { /* get the direction from RNA */ const bool use_ccw = RNA_boolean_get(op->ptr, "use_ccw"); @@ -3039,7 +3041,7 @@ static int edbm_rotate_uvs_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int edbm_reverse_uvs_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_reverse_uvs_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -3071,7 +3073,7 @@ static int edbm_reverse_uvs_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int edbm_rotate_colors_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_rotate_colors_exec(bContext *C, wmOperator *op) { /* get the direction from RNA */ const bool use_ccw = RNA_boolean_get(op->ptr, "use_ccw"); @@ -3125,7 +3127,7 @@ static int edbm_rotate_colors_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int edbm_reverse_colors_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_reverse_colors_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -3365,7 +3367,7 @@ static bool merge_target(BMEditMesh *em, return true; } -static int edbm_merge_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_merge_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -3525,7 +3527,7 @@ void MESH_OT_merge(wmOperatorType *ot) /** \name Merge By Distance Operator * \{ */ -static int edbm_remove_doubles_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_remove_doubles_exec(bContext *C, wmOperator *op) { const float threshold = RNA_float_get(op->ptr, "threshold"); const bool use_unselected = RNA_boolean_get(op->ptr, "use_unselected"); @@ -3684,7 +3686,7 @@ static bool shape_propagate(BMEditMesh *em, bool use_symmetry) return true; } -static int edbm_shape_propagate_to_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_shape_propagate_to_all_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -3769,7 +3771,7 @@ void MESH_OT_shape_propagate_to_all(wmOperatorType *ot) * \{ */ /* BMESH_TODO this should be properly encapsulated in a bmop. but later. */ -static int edbm_blend_from_shape_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_blend_from_shape_exec(bContext *C, wmOperator *op) { Object *obedit_ref = CTX_data_edit_object(C); Mesh *me_ref = static_cast(obedit_ref->data); @@ -3971,7 +3973,7 @@ void MESH_OT_blend_from_shape(wmOperatorType *ot) /** \name Solidify Mesh Operator * \{ */ -static int edbm_solidify_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_solidify_exec(bContext *C, wmOperator *op) { const float thickness = RNA_float_get(op->ptr, "thickness"); @@ -4360,7 +4362,7 @@ static bool mesh_separate_loose( return result; } -static int edbm_separate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_separate_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -4510,7 +4512,7 @@ void MESH_OT_separate(wmOperatorType *ot) /** \name Triangle Fill Operator * \{ */ -static int edbm_fill_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_fill_exec(bContext *C, wmOperator *op) { const bool use_beauty = RNA_boolean_get(op->ptr, "use_beauty"); @@ -4895,7 +4897,7 @@ static void edbm_fill_grid_split_join_finish(BMEditMesh *em, MEM_freeN(split_join); } -static int edbm_fill_grid_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_fill_grid_exec(bContext *C, wmOperator *op) { const bool use_interp_simple = RNA_boolean_get(op->ptr, "use_interp_simple"); @@ -5037,7 +5039,7 @@ void MESH_OT_fill_grid(wmOperatorType *ot) /** \name Hole Fill Operator * \{ */ -static int edbm_fill_holes_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_fill_holes_exec(bContext *C, wmOperator *op) { const int sides = RNA_int_get(op->ptr, "sides"); @@ -5100,7 +5102,7 @@ void MESH_OT_fill_holes(wmOperatorType *ot) /** \name Beauty Fill Operator * \{ */ -static int edbm_beautify_fill_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_beautify_fill_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -5186,7 +5188,7 @@ void MESH_OT_beautify_fill(wmOperatorType *ot) /** \name Poke Face Operator * \{ */ -static int edbm_poke_face_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_poke_face_exec(bContext *C, wmOperator *op) { const float offset = RNA_float_get(op->ptr, "offset"); const bool use_relative_offset = RNA_boolean_get(op->ptr, "use_relative_offset"); @@ -5281,7 +5283,7 @@ void MESH_OT_poke(wmOperatorType *ot) /** \name Triangulate Face Operator * \{ */ -static int edbm_quads_convert_to_tris_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_quads_convert_to_tris_exec(bContext *C, wmOperator *op) { const int quad_method = RNA_enum_get(op->ptr, "quad_method"); const int ngon_method = RNA_enum_get(op->ptr, "ngon_method"); @@ -5377,7 +5379,7 @@ void MESH_OT_quads_convert_to_tris(wmOperatorType *ot) # define USE_JOIN_TRIANGLE_TESTING_API #endif -static int edbm_tris_convert_to_quads_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_tris_convert_to_quads_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -5598,7 +5600,7 @@ void MESH_OT_tris_convert_to_quads(wmOperatorType *ot) * * \{ */ -static int edbm_decimate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_decimate_exec(bContext *C, wmOperator *op) { const float ratio = RNA_float_get(op->ptr, "ratio"); bool use_vertex_group = RNA_boolean_get(op->ptr, "use_vertex_group"); @@ -5823,7 +5825,7 @@ static void edbm_dissolve_prop__use_boundary_tear(wmOperatorType *ot) "Split off face corners instead of merging faces"); } -static int edbm_dissolve_verts_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_dissolve_verts_exec(bContext *C, wmOperator *op) { const bool use_face_split = RNA_boolean_get(op->ptr, "use_face_split"); const bool use_boundary_tear = RNA_boolean_get(op->ptr, "use_boundary_tear"); @@ -5888,7 +5890,7 @@ void MESH_OT_dissolve_verts(wmOperatorType *ot) /** \name Dissolve Edges Operator * \{ */ -static int edbm_dissolve_edges_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_dissolve_edges_exec(bContext *C, wmOperator *op) { const bool use_verts = RNA_boolean_get(op->ptr, "use_verts"); const bool use_face_split = RNA_boolean_get(op->ptr, "use_face_split"); @@ -5952,7 +5954,7 @@ void MESH_OT_dissolve_edges(wmOperatorType *ot) /** \name Dissolve Faces Operator * \{ */ -static int edbm_dissolve_faces_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_dissolve_faces_exec(bContext *C, wmOperator *op) { const bool use_verts = RNA_boolean_get(op->ptr, "use_verts"); const Scene *scene = CTX_data_scene(C); @@ -6014,7 +6016,7 @@ void MESH_OT_dissolve_faces(wmOperatorType *ot) /** \name Dissolve (Context Sensitive) Operator * \{ */ -static int edbm_dissolve_mode_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_dissolve_mode_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); BMEditMesh *em = BKE_editmesh_from_object(obedit); @@ -6062,7 +6064,7 @@ void MESH_OT_dissolve_mode(wmOperatorType *ot) /** \name Limited Dissolve Operator * \{ */ -static int edbm_dissolve_limited_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_dissolve_limited_exec(bContext *C, wmOperator *op) { const float angle_limit = RNA_float_get(op->ptr, "angle_limit"); const bool use_dissolve_boundaries = RNA_boolean_get(op->ptr, "use_dissolve_boundaries"); @@ -6185,7 +6187,7 @@ void MESH_OT_dissolve_limited(wmOperatorType *ot) /** \name Degenerate Dissolve Operator * \{ */ -static int edbm_dissolve_degenerate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_dissolve_degenerate_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -6264,7 +6266,7 @@ void MESH_OT_dissolve_degenerate(wmOperatorType *ot) * \{ */ /* internally uses dissolve */ -static int edbm_delete_edgeloop_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_delete_edgeloop_exec(bContext *C, wmOperator *op) { const bool use_face_split = RNA_boolean_get(op->ptr, "use_face_split"); const Scene *scene = CTX_data_scene(C); @@ -6347,7 +6349,7 @@ void MESH_OT_delete_edgeloop(wmOperatorType *ot) /** \name Split Geometry Operator * \{ */ -static int edbm_split_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_split_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -6911,7 +6913,7 @@ static void sort_bmelem_flag(bContext *C, } } -static int edbm_sort_elements_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_sort_elements_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -7267,7 +7269,7 @@ static int edbm_bridge_edge_loops_for_single_editmesh(wmOperator *op, return OPERATOR_FINISHED; } -static int edbm_bridge_edge_loops_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_bridge_edge_loops_exec(bContext *C, wmOperator *op) { const int type = RNA_enum_get(op->ptr, "type"); const bool use_pairs = (type == MESH_BRIDGELOOP_PAIRS); @@ -7348,7 +7350,7 @@ void MESH_OT_bridge_edge_loops(wmOperatorType *ot) /** \name Wire-Frame Operator * \{ */ -static int edbm_wireframe_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_wireframe_exec(bContext *C, wmOperator *op) { const bool use_boundary = RNA_boolean_get(op->ptr, "use_boundary"); const bool use_even_offset = RNA_boolean_get(op->ptr, "use_even_offset"); @@ -7458,7 +7460,7 @@ void MESH_OT_wireframe(wmOperatorType *ot) /** \name Offset Edge-Loop Operator * \{ */ -static int edbm_offset_edgeloop_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_offset_edgeloop_exec(bContext *C, wmOperator *op) { const bool use_cap_endpoint = RNA_boolean_get(op->ptr, "use_cap_endpoint"); bool changed_multi = false; @@ -7541,7 +7543,7 @@ void MESH_OT_offset_edge_loops(wmOperatorType *ot) * \{ */ #ifdef WITH_BULLET -static int edbm_convex_hull_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_convex_hull_exec(bContext *C, wmOperator *op) { const bool use_existing_faces = RNA_boolean_get(op->ptr, "use_existing_faces"); const bool delete_unused = RNA_boolean_get(op->ptr, "delete_unused"); @@ -7681,7 +7683,7 @@ void MESH_OT_convex_hull(wmOperatorType *ot) /** \name Symmetrize Operator * \{ */ -static int mesh_symmetrize_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mesh_symmetrize_exec(bContext *C, wmOperator *op) { const float thresh = RNA_float_get(op->ptr, "threshold"); const Scene *scene = CTX_data_scene(C); @@ -7762,7 +7764,7 @@ void MESH_OT_symmetrize(wmOperatorType *ot) /** \name Snap to Symmetry Operator * \{ */ -static int mesh_symmetry_snap_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mesh_symmetry_snap_exec(bContext *C, wmOperator *op) { const float eps = 0.00001f; const float eps_sq = eps * eps; @@ -7944,7 +7946,7 @@ void MESH_OT_symmetry_snap(wmOperatorType *ot) /** \name Mark Edge (Freestyle) Operator * \{ */ -static int edbm_mark_freestyle_edge_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_mark_freestyle_edge_exec(bContext *C, wmOperator *op) { BMEdge *eed; BMIter iter; @@ -8024,7 +8026,7 @@ void MESH_OT_mark_freestyle_edge(wmOperatorType *ot) /** \name Mark Face (Freestyle) Operator * \{ */ -static int edbm_mark_freestyle_face_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_mark_freestyle_face_exec(bContext *C, wmOperator *op) { BMFace *efa; BMIter iter; @@ -8354,7 +8356,7 @@ static void point_normals_apply(bContext *C, wmOperator *op, float target[3], co } } -static int edbm_point_normals_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus edbm_point_normals_modal(bContext *C, wmOperator *op, const wmEvent *event) { /* As this operator passes events through, we can't be sure the user didn't exit edit-mode. * or performed some other operation. */ @@ -8371,7 +8373,7 @@ static int edbm_point_normals_modal(bContext *C, wmOperator *op, const wmEvent * float target[3]; - int ret = OPERATOR_PASS_THROUGH; + wmOperatorStatus ret = OPERATOR_PASS_THROUGH; int mode = RNA_enum_get(op->ptr, "mode"); int new_mode = mode; bool force_mousemove = false; @@ -8569,7 +8571,9 @@ static int edbm_point_normals_modal(bContext *C, wmOperator *op, const wmEvent * return ret; } -static int edbm_point_normals_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus edbm_point_normals_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (!point_normals_init(C, op)) { point_normals_cancel(C, op); @@ -8585,7 +8589,7 @@ static int edbm_point_normals_invoke(bContext *C, wmOperator *op, const wmEvent } /* TODO: make this work on multiple objects at once */ -static int edbm_point_normals_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_point_normals_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); @@ -8825,7 +8829,7 @@ static void normals_split(BMesh *bm) } } -static int normals_split_merge(bContext *C, const bool do_merge) +static wmOperatorStatus normals_split_merge(bContext *C, const bool do_merge) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -8879,7 +8883,7 @@ static int normals_split_merge(bContext *C, const bool do_merge) return OPERATOR_FINISHED; } -static int edbm_merge_normals_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus edbm_merge_normals_exec(bContext *C, wmOperator * /*op*/) { return normals_split_merge(C, true); } @@ -8899,7 +8903,7 @@ void MESH_OT_merge_normals(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int edbm_split_normals_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus edbm_split_normals_exec(bContext *C, wmOperator * /*op*/) { return normals_split_merge(C, false); } @@ -8950,7 +8954,7 @@ static EnumPropertyItem average_method_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int edbm_average_normals_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_average_normals_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -9206,7 +9210,7 @@ static EnumPropertyItem normal_vector_tool_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int edbm_normals_tools_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_normals_tools_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -9424,7 +9428,7 @@ void MESH_OT_normals_tools(wmOperatorType *ot) /** \name Set Normals from Faces Operator * \{ */ -static int edbm_set_normals_from_faces_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_set_normals_from_faces_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -9539,7 +9543,7 @@ void MESH_OT_set_normals_from_faces(wmOperatorType *ot) /** \name Smooth Normal Vectors Operator * \{ */ -static int edbm_smooth_normals_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_smooth_normals_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -9657,7 +9661,7 @@ void MESH_OT_smooth_normals(wmOperatorType *ot) /** \name Weighted Normal Modifier Face Strength * \{ */ -static int edbm_mod_weighted_strength_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edbm_mod_weighted_strength_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); diff --git a/source/blender/editors/mesh/mesh_data.cc b/source/blender/editors/mesh/mesh_data.cc index 259ccc8b9f5..fda1702488a 100644 --- a/source/blender/editors/mesh/mesh_data.cc +++ b/source/blender/editors/mesh/mesh_data.cc @@ -476,7 +476,7 @@ static bool uv_texture_remove_poll(bContext *C) return false; } -static int mesh_uv_texture_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mesh_uv_texture_add_exec(bContext *C, wmOperator *op) { Object *ob = blender::ed::object::context_object(C); Mesh *mesh = static_cast(ob->data); @@ -509,7 +509,7 @@ void MESH_OT_uv_texture_add(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int mesh_uv_texture_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mesh_uv_texture_remove_exec(bContext *C, wmOperator *op) { Object *ob = blender::ed::object::context_object(C); Mesh *mesh = static_cast(ob->data); @@ -550,9 +550,9 @@ void MESH_OT_uv_texture_remove(wmOperatorType *ot) /* *** CustomData clear functions, we need an operator for each *** */ -static int mesh_customdata_clear_exec__internal(bContext *C, - char htype, - const eCustomDataType type) +static wmOperatorStatus mesh_customdata_clear_exec__internal(bContext *C, + char htype, + const eCustomDataType type) { Mesh *mesh = ED_mesh_context(C); @@ -601,7 +601,7 @@ static bool mesh_customdata_mask_clear_poll(bContext *C) } return false; } -static int mesh_customdata_mask_clear_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mesh_customdata_mask_clear_exec(bContext *C, wmOperator *op) { Object *object = blender::ed::object::context_object(C); Mesh *mesh = static_cast(object->data); @@ -655,7 +655,7 @@ static bool mesh_customdata_skin_add_poll(bContext *C) return (mesh_customdata_skin_state(C) == 0); } -static int mesh_customdata_skin_add_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus mesh_customdata_skin_add_exec(bContext *C, wmOperator * /*op*/) { Object *ob = blender::ed::object::context_object(C); Mesh *mesh = static_cast(ob->data); @@ -688,7 +688,7 @@ static bool mesh_customdata_skin_clear_poll(bContext *C) return (mesh_customdata_skin_state(C) == 1); } -static int mesh_customdata_skin_clear_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus mesh_customdata_skin_clear_exec(bContext *C, wmOperator * /*op*/) { return mesh_customdata_clear_exec__internal(C, BM_VERT, CD_MVERT_SKIN); } @@ -709,7 +709,8 @@ void MESH_OT_customdata_skin_clear(wmOperatorType *ot) } /* Clear custom loop normals */ -static int mesh_customdata_custom_splitnormals_add_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus mesh_customdata_custom_splitnormals_add_exec(bContext *C, + wmOperator * /*op*/) { using namespace blender; Mesh *mesh = ED_mesh_context(C); @@ -750,7 +751,8 @@ void MESH_OT_customdata_custom_splitnormals_add(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int mesh_customdata_custom_splitnormals_clear_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus mesh_customdata_custom_splitnormals_clear_exec(bContext *C, + wmOperator * /*op*/) { Mesh *mesh = ED_mesh_context(C); diff --git a/source/blender/editors/mesh/meshtools.cc b/source/blender/editors/mesh/meshtools.cc index a94c245cbd5..c9ff9ba4614 100644 --- a/source/blender/editors/mesh/meshtools.cc +++ b/source/blender/editors/mesh/meshtools.cc @@ -336,7 +336,7 @@ static void mesh_join_offset_face_sets_ID(Mesh *mesh, int *face_set_offset) face_sets.finish(); } -int ED_mesh_join_objects_exec(bContext *C, wmOperator *op) +wmOperatorStatus ED_mesh_join_objects_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -720,7 +720,7 @@ int ED_mesh_join_objects_exec(bContext *C, wmOperator *op) * Append selected meshes vertex locations as shapes of the active mesh. * \{ */ -int ED_mesh_shapes_join_objects_exec(bContext *C, wmOperator *op) +wmOperatorStatus ED_mesh_shapes_join_objects_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/metaball/mball_edit.cc b/source/blender/editors/metaball/mball_edit.cc index 79c434a3de0..93e0447e48e 100644 --- a/source/blender/editors/metaball/mball_edit.cc +++ b/source/blender/editors/metaball/mball_edit.cc @@ -146,7 +146,7 @@ MetaElem *ED_mball_add_primitive( * \{ */ /* Select or deselect all MetaElements */ -static int mball_select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mball_select_all_exec(bContext *C, wmOperator *op) { int action = RNA_enum_get(op->ptr, "action"); @@ -325,7 +325,7 @@ static bool mball_select_similar_type(Object *obedit, return changed; } -static int mball_select_similar_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mball_select_similar_exec(bContext *C, wmOperator *op) { const int type = RNA_enum_get(op->ptr, "type"); const float thresh = RNA_float_get(op->ptr, "threshold"); @@ -455,7 +455,7 @@ void MBALL_OT_select_similar(wmOperatorType *ot) /** \name Select Random Operator * \{ */ -static int select_random_metaelems_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_random_metaelems_exec(bContext *C, wmOperator *op) { const bool select = (RNA_enum_get(op->ptr, "action") == SEL_SELECT); const float randfac = RNA_float_get(op->ptr, "ratio"); @@ -524,7 +524,7 @@ void MBALL_OT_select_random_metaelems(wmOperatorType *ot) * \{ */ /* Duplicate selected MetaElements */ -static int duplicate_metaelems_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus duplicate_metaelems_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -579,7 +579,7 @@ void MBALL_OT_duplicate_metaelems(wmOperatorType *ot) * Delete all selected MetaElems (not MetaBall). * \{ */ -static int delete_metaelems_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus delete_metaelems_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -613,7 +613,9 @@ static int delete_metaelems_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -static int delete_metaelems_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus delete_metaelems_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (RNA_boolean_get(op->ptr, "confirm")) { return WM_operator_confirm_ex(C, @@ -650,7 +652,7 @@ void MBALL_OT_delete_metaelems(wmOperatorType *ot) /** \name Hide Meta-Elements Operator * \{ */ -static int hide_metaelems_exec(bContext *C, wmOperator *op) +static wmOperatorStatus hide_metaelems_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); MetaBall *mb = (MetaBall *)obedit->data; @@ -698,7 +700,7 @@ void MBALL_OT_hide_metaelems(wmOperatorType *ot) /** \name Un-Hide Meta-Elements Operator * \{ */ -static int reveal_metaelems_exec(bContext *C, wmOperator *op) +static wmOperatorStatus reveal_metaelems_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); MetaBall *mb = (MetaBall *)obedit->data; diff --git a/source/blender/editors/object/add_modifier_assets.cc b/source/blender/editors/object/add_modifier_assets.cc index ac71bc6ca3e..3f95e69fc40 100644 --- a/source/blender/editors/object/add_modifier_assets.cc +++ b/source/blender/editors/object/add_modifier_assets.cc @@ -278,7 +278,7 @@ static bNodeTree *get_node_group(const bContext &C, PointerRNA &ptr, ReportList return node_group; } -static int modifier_add_asset_exec(bContext *C, wmOperator *op) +static wmOperatorStatus modifier_add_asset_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -322,7 +322,9 @@ static int modifier_add_asset_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_add_asset_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus modifier_add_asset_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { if (event->modifier & KM_ALT || CTX_wm_view3d(C)) { RNA_boolean_set(op->ptr, "use_selected_objects", true); diff --git a/source/blender/editors/object/object_add.cc b/source/blender/editors/object/object_add.cc index 92ebc9520d8..9256db57884 100644 --- a/source/blender/editors/object/object_add.cc +++ b/source/blender/editors/object/object_add.cc @@ -268,7 +268,9 @@ static bool object_add_drop_xy_get(bContext *C, wmOperator *op, int (*r_mval)[2] * Set the drop coordinate to the mouse position (if not already set) and call the operator's * `exec()` callback. */ -static int object_add_drop_xy_generic_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus object_add_drop_xy_generic_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { if (!object_add_drop_xy_is_set(op)) { RNA_int_set(op->ptr, "drop_x", event->xy[0]); @@ -691,7 +693,7 @@ Object *add_type(bContext *C, } /* for object add operator */ -static int object_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_add_exec(bContext *C, wmOperator *op) { ushort local_view_bits; bool enter_editmode; @@ -758,7 +760,7 @@ static const char *get_lightprobe_defname(int type) } } -static int lightprobe_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus lightprobe_add_exec(bContext *C, wmOperator *op) { bool enter_editmode; ushort local_view_bits; @@ -848,7 +850,7 @@ static const char *get_effector_defname(ePFieldType type) return CTX_DATA_(BLT_I18NCONTEXT_ID_OBJECT, "Field"); } -static int effector_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus effector_add_exec(bContext *C, wmOperator *op) { bool enter_editmode; ushort local_view_bits; @@ -919,7 +921,7 @@ void OBJECT_OT_effector_add(wmOperatorType *ot) /** \name Add Camera Operator * \{ */ -static int object_camera_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_camera_add_exec(bContext *C, wmOperator *op) { View3D *v3d = CTX_wm_view3d(C); Scene *scene = CTX_data_scene(C); @@ -979,7 +981,7 @@ void OBJECT_OT_camera_add(wmOperatorType *ot) /** \name Add Metaball Operator * \{ */ -static int object_metaball_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_metaball_add_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1050,7 +1052,7 @@ void OBJECT_OT_metaball_add(wmOperatorType *ot) /** \name Add Text Operator * \{ */ -static int object_add_text_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_add_text_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); bool enter_editmode; @@ -1095,7 +1097,7 @@ void OBJECT_OT_text_add(wmOperatorType *ot) /** \name Add Armature Operator * \{ */ -static int object_armature_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_armature_add_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1168,7 +1170,7 @@ void OBJECT_OT_armature_add(wmOperatorType *ot) /** \name Add Empty Operator * \{ */ -static int object_empty_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_empty_add_exec(bContext *C, wmOperator *op) { Object *ob; int type = RNA_enum_get(op->ptr, "type"); @@ -1208,7 +1210,7 @@ void OBJECT_OT_empty_add(wmOperatorType *ot) add_generic_props(ot, false); } -static int object_image_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_image_add_exec(bContext *C, wmOperator *op) { Image *ima = nullptr; @@ -1249,7 +1251,7 @@ static int object_image_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int object_image_add_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus object_image_add_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (!RNA_struct_property_is_set(op->ptr, "align")) { /* Default to Aligned unless something else was explicitly passed. */ @@ -1367,7 +1369,7 @@ static EnumPropertyItem rna_enum_gpencil_add_stroke_depth_order_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int object_grease_pencil_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_grease_pencil_add_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1566,7 +1568,7 @@ static const char *get_light_defname(int type) } } -static int object_light_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_light_add_exec(bContext *C, wmOperator *op) { Object *ob; Light *la; @@ -1700,7 +1702,7 @@ static std::optional collection_add_info_get_from_op(bContext return add_info; } -static int collection_instance_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus collection_instance_add_exec(bContext *C, wmOperator *op) { std::optional add_info = collection_add_info_get_from_op(C, op); if (!add_info) { @@ -1724,7 +1726,9 @@ static int collection_instance_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int object_instance_add_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus object_instance_add_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { if (!object_add_drop_xy_is_set(op)) { RNA_int_set(op->ptr, "drop_x", event->xy[0]); @@ -1789,7 +1793,7 @@ void OBJECT_OT_collection_instance_add(wmOperatorType *ot) * * \{ */ -static int collection_drop_exec(bContext *C, wmOperator *op) +static wmOperatorStatus collection_drop_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); LayerCollection *active_collection = CTX_data_layer_collection(C); @@ -1884,7 +1888,7 @@ void OBJECT_OT_collection_external_asset_drop(wmOperatorType *ot) * Use for dropping ID's from the outliner. * \{ */ -static int object_data_instance_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_data_instance_add_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); ID *id = nullptr; @@ -1950,7 +1954,7 @@ void OBJECT_OT_data_instance_add(wmOperatorType *ot) /** \name Add Speaker Operator * \{ */ -static int object_speaker_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_speaker_add_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -2009,7 +2013,7 @@ void OBJECT_OT_speaker_add(wmOperatorType *ot) /** \name Add Curves Operator * \{ */ -static int object_curves_random_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_curves_random_add_exec(bContext *C, wmOperator *op) { ushort local_view_bits; float loc[3], rot[3]; @@ -2040,7 +2044,7 @@ void OBJECT_OT_curves_random_add(wmOperatorType *ot) add_generic_props(ot, false); } -static int object_curves_empty_hair_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_curves_empty_hair_add_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); @@ -2119,7 +2123,7 @@ static bool object_pointcloud_add_poll(bContext *C) return ED_operator_objectmode(C); } -static int object_pointcloud_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_pointcloud_add_exec(bContext *C, wmOperator *op) { ushort local_view_bits; float loc[3], rot[3]; @@ -2183,7 +2187,7 @@ void base_free_and_unlink_no_indirect_check(Main *bmain, Scene *scene, Object *o BKE_scene_collections_object_remove(bmain, scene, ob, true); } -static int object_delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_delete_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -2273,7 +2277,9 @@ static int object_delete_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int object_delete_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus object_delete_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (RNA_boolean_get(op->ptr, "confirm")) { return WM_operator_confirm_ex(C, @@ -2652,7 +2658,7 @@ static void make_object_duplilist_real(bContext *C, DEG_id_tag_update(&base->object->id, ID_RECALC_SYNC_TO_EVAL); } -static int object_duplicates_make_real_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_duplicates_make_real_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -3920,7 +3926,7 @@ static Object *convert_pointcloud(Base &base, } } -static int object_convert_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_convert_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -4346,7 +4352,7 @@ Base *add_duplicate( } /* contextual operator dupli */ -static int duplicate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus duplicate_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -4477,7 +4483,7 @@ void OBJECT_OT_duplicate(wmOperatorType *ot) * Use for drag & drop. * \{ */ -static int object_add_named_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_add_named_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -4596,7 +4602,7 @@ void OBJECT_OT_add_named(wmOperatorType *ot) /** * Alternate behavior for dropping an asset that positions the appended object(s). */ -static int object_transform_to_mouse_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_transform_to_mouse_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); const Scene *scene = CTX_data_scene(C); @@ -4739,7 +4745,7 @@ static bool object_join_poll(bContext *C) return false; } -static int object_join_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_join_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *ob = CTX_data_active_object(C); @@ -4760,7 +4766,7 @@ static int object_join_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - int ret = OPERATOR_CANCELLED; + wmOperatorStatus ret = OPERATOR_CANCELLED; if (ob->type == OB_MESH) { ret = ED_mesh_join_objects_exec(C, op); } @@ -4845,7 +4851,7 @@ static bool join_shapes_poll(bContext *C) return false; } -static int join_shapes_exec(bContext *C, wmOperator *op) +static wmOperatorStatus join_shapes_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *ob = CTX_data_active_object(C); diff --git a/source/blender/editors/object/object_bake.cc b/source/blender/editors/object/object_bake.cc index b5f70feb124..02c4dd7ba09 100644 --- a/source/blender/editors/object/object_bake.cc +++ b/source/blender/editors/object/object_bake.cc @@ -327,7 +327,7 @@ static void clear_images_poly(Image **ob_image_array, int ob_image_array_len, Cl } } -static int multiresbake_image_exec_locked(bContext *C, wmOperator *op) +static wmOperatorStatus multiresbake_image_exec_locked(bContext *C, wmOperator *op) { Object *ob; Scene *scene = CTX_data_scene(C); @@ -549,7 +549,7 @@ static void multiresbake_freejob(void *bkv) MEM_freeN(bkj); } -static int multiresbake_image_exec(bContext *C, wmOperator *op) +static wmOperatorStatus multiresbake_image_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); @@ -591,7 +591,9 @@ static int multiresbake_image_exec(bContext *C, wmOperator *op) /* ****************** render BAKING ********************** */ /** Catch escape key to cancel. */ -static int objects_bake_render_modal(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus objects_bake_render_modal(bContext *C, + wmOperator * /*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)) { @@ -615,10 +617,12 @@ static bool is_multires_bake(Scene *scene) return false; } -static int objects_bake_render_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus objects_bake_render_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Scene *scene = CTX_data_scene(C); - int result = OPERATOR_CANCELLED; + wmOperatorStatus result = OPERATOR_CANCELLED; result = multiresbake_image_exec(C, op); @@ -627,10 +631,10 @@ static int objects_bake_render_invoke(bContext *C, wmOperator *op, const wmEvent return result; } -static int bake_image_exec(bContext *C, wmOperator *op) +static wmOperatorStatus bake_image_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - int result = OPERATOR_CANCELLED; + wmOperatorStatus result = OPERATOR_CANCELLED; if (!is_multires_bake(scene)) { BLI_assert(0); diff --git a/source/blender/editors/object/object_bake_api.cc b/source/blender/editors/object/object_bake_api.cc index d3f9ba1092b..2e688675f62 100644 --- a/source/blender/editors/object/object_bake_api.cc +++ b/source/blender/editors/object/object_bake_api.cc @@ -136,7 +136,7 @@ static void bake_progress_update(void *bjv, float progress) } /** Catch escape key to cancel. */ -static int bake_modal(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus bake_modal(bContext *C, wmOperator * /*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)) { @@ -1393,10 +1393,10 @@ static void bake_targets_free(BakeTargets *targets) /* Main Bake Logic */ -static int bake(const BakeAPIRender *bkr, - Object *ob_low, - const Span selected_objects, - ReportList *reports) +static wmOperatorStatus bake(const BakeAPIRender *bkr, + Object *ob_low, + const Span selected_objects, + ReportList *reports) { Render *re = bkr->render; Main *bmain = bkr->main; @@ -1412,7 +1412,7 @@ static int bake(const BakeAPIRender *bkr, DEG_graph_build_from_view_layer(depsgraph); - int op_result = OPERATOR_CANCELLED; + wmOperatorStatus op_result = OPERATOR_CANCELLED; bool ok = false; Object *ob_cage = nullptr; @@ -1924,10 +1924,10 @@ static void bake_init_api_data(wmOperator *op, bContext *C, BakeAPIRender *bkr) } } -static int bake_exec(bContext *C, wmOperator *op) +static wmOperatorStatus bake_exec(bContext *C, wmOperator *op) { Render *re; - int result = OPERATOR_CANCELLED; + wmOperatorStatus result = OPERATOR_CANCELLED; BakeAPIRender bkr = {nullptr}; Scene *scene = CTX_data_scene(C); @@ -2164,7 +2164,7 @@ static void bake_set_props(wmOperator *op, Scene *scene) } } -static int bake_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus bake_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { wmJob *wm_job; Render *re; diff --git a/source/blender/editors/object/object_bake_simulation.cc b/source/blender/editors/object/object_bake_simulation.cc index 73cd58ffb8e..b64b15f3672 100644 --- a/source/blender/editors/object/object_bake_simulation.cc +++ b/source/blender/editors/object/object_bake_simulation.cc @@ -137,7 +137,9 @@ static void simulate_to_frame_endjob(void *customdata) WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, nullptr); } -static int simulate_to_frame_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus simulate_to_frame_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { wmWindowManager *wm = CTX_wm_manager(C); Scene *scene = CTX_data_scene(C); @@ -182,7 +184,9 @@ static int simulate_to_frame_invoke(bContext *C, wmOperator *op, const wmEvent * return OPERATOR_RUNNING_MODAL; } -static int simulate_to_frame_modal(bContext *C, wmOperator * /*op*/, const wmEvent * /*event*/) +static wmOperatorStatus simulate_to_frame_modal(bContext *C, + wmOperator * /*op*/, + const wmEvent * /*event*/) { if (!WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C), WM_JOB_TYPE_CALCULATE_SIMULATION_NODES)) { @@ -541,10 +545,10 @@ enum class BakeRequestsMode { Async }; -static int start_bake_job(bContext *C, - Vector requests, - wmOperator *op, - const BakeRequestsMode mode) +static wmOperatorStatus start_bake_job(bContext *C, + Vector requests, + wmOperator *op, + const BakeRequestsMode mode) { for (NodeBakeRequest &request : requests) { reset_old_bake_cache(request); @@ -662,7 +666,7 @@ static Vector bake_simulation_gather_requests(bContext *C, wmOp return collect_simulations_to_bake(*bmain, *scene, objects); } -static int bake_simulation_exec(bContext *C, wmOperator *op) +static wmOperatorStatus bake_simulation_exec(bContext *C, wmOperator *op) { Vector requests = bake_simulation_gather_requests(C, op); return start_bake_job(C, std::move(requests), op, BakeRequestsMode::Sync); @@ -802,7 +806,9 @@ static PathUsersMap bake_simulation_get_path_users(bContext *C, const Span objects; if (RNA_boolean_get(op->ptr, "selected")) { @@ -857,7 +863,9 @@ static int bake_simulation_invoke(bContext *C, wmOperator *op, const wmEvent * / return start_bake_job(C, std::move(requests), op, BakeRequestsMode::Async); } -static int bake_simulation_modal(bContext *C, wmOperator * /*op*/, const wmEvent * /*event*/) +static wmOperatorStatus bake_simulation_modal(bContext *C, + wmOperator * /*op*/, + const wmEvent * /*event*/) { if (!WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C), WM_JOB_TYPE_BAKE_GEOMETRY_NODES)) { return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH; @@ -865,7 +873,7 @@ static int bake_simulation_modal(bContext *C, wmOperator * /*op*/, const wmEvent return OPERATOR_PASS_THROUGH; } -static int delete_baked_simulation_exec(bContext *C, wmOperator *op) +static wmOperatorStatus delete_baked_simulation_exec(bContext *C, wmOperator *op) { Vector objects; if (RNA_boolean_get(op->ptr, "selected")) { @@ -987,7 +995,9 @@ static Vector bake_single_node_gather_bake_request(bContext *C, return requests; } -static int bake_single_node_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus bake_single_node_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Vector requests = bake_single_node_gather_bake_request(C, op); if (requests.is_empty()) { @@ -996,7 +1006,7 @@ static int bake_single_node_invoke(bContext *C, wmOperator *op, const wmEvent * return start_bake_job(C, std::move(requests), op, BakeRequestsMode::Async); } -static int bake_single_node_exec(bContext *C, wmOperator *op) +static wmOperatorStatus bake_single_node_exec(bContext *C, wmOperator *op) { Vector requests = bake_single_node_gather_bake_request(C, op); if (requests.is_empty()) { @@ -1005,7 +1015,9 @@ static int bake_single_node_exec(bContext *C, wmOperator *op) return start_bake_job(C, std::move(requests), op, BakeRequestsMode::Sync); } -static int bake_single_node_modal(bContext *C, wmOperator * /*op*/, const wmEvent * /*event*/) +static wmOperatorStatus bake_single_node_modal(bContext *C, + wmOperator * /*op*/, + const wmEvent * /*event*/) { if (!WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C), WM_JOB_TYPE_BAKE_GEOMETRY_NODES)) { return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH; @@ -1013,7 +1025,7 @@ static int bake_single_node_modal(bContext *C, wmOperator * /*op*/, const wmEven return OPERATOR_PASS_THROUGH; } -static int delete_single_bake_exec(bContext *C, wmOperator *op) +static wmOperatorStatus delete_single_bake_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *object = reinterpret_cast( @@ -1042,7 +1054,7 @@ static int delete_single_bake_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int pack_single_bake_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pack_single_bake_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *object = reinterpret_cast( @@ -1080,7 +1092,9 @@ static int pack_single_bake_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int unpack_single_bake_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus unpack_single_bake_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { uiPopupMenu *pup; uiLayout *layout; @@ -1101,7 +1115,7 @@ static int unpack_single_bake_invoke(bContext *C, wmOperator *op, const wmEvent return OPERATOR_INTERFACE; } -static int unpack_single_bake_exec(bContext *C, wmOperator *op) +static wmOperatorStatus unpack_single_bake_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *object = reinterpret_cast( diff --git a/source/blender/editors/object/object_collection.cc b/source/blender/editors/object/object_collection.cc index 5931716b27c..b3495184b7a 100644 --- a/source/blender/editors/object/object_collection.cc +++ b/source/blender/editors/object/object_collection.cc @@ -125,7 +125,7 @@ static Collection *collection_object_active_find_index(Main *bmain, return collection; } -static int objects_add_active_exec(bContext *C, wmOperator *op) +static wmOperatorStatus objects_add_active_exec(bContext *C, wmOperator *op) { Object *ob = context_object(C); Main *bmain = CTX_data_main(C); @@ -218,7 +218,7 @@ void COLLECTION_OT_objects_add_active(wmOperatorType *ot) ot->prop = prop; } -static int objects_remove_active_exec(bContext *C, wmOperator *op) +static wmOperatorStatus objects_remove_active_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -297,7 +297,7 @@ void COLLECTION_OT_objects_remove_active(wmOperatorType *ot) ot->prop = prop; } -static int collection_objects_remove_all_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus collection_objects_remove_all_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -328,7 +328,7 @@ void COLLECTION_OT_objects_remove_all(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int collection_objects_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus collection_objects_remove_exec(bContext *C, wmOperator *op) { Object *ob = context_object(C); Main *bmain = CTX_data_main(C); @@ -404,7 +404,7 @@ void COLLECTION_OT_objects_remove(wmOperatorType *ot) ot->prop = prop; } -static int collection_create_exec(bContext *C, wmOperator *op) +static wmOperatorStatus collection_create_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); char name[MAX_ID_NAME - 2]; /* id name */ @@ -473,7 +473,7 @@ static bool collection_export_all_poll(bContext *C) return CTX_data_view_layer(C) != nullptr; } -static int collection_exporter_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus collection_exporter_add_exec(bContext *C, wmOperator *op) { using namespace blender; Collection *collection = CTX_data_collection(C); @@ -534,7 +534,7 @@ static void COLLECTION_OT_exporter_add(wmOperatorType *ot) RNA_def_string(ot->srna, "name", nullptr, MAX_ID_NAME - 2, "Name", "FileHandler idname"); } -static int collection_exporter_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus collection_exporter_remove_exec(bContext *C, wmOperator *op) { Collection *collection = CTX_data_collection(C); ListBase *exporters = &collection->exporters; @@ -563,9 +563,9 @@ static int collection_exporter_remove_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int collection_exporter_remove_invoke(bContext *C, - wmOperator *op, - const wmEvent * /*event*/) +static wmOperatorStatus collection_exporter_remove_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { return WM_operator_confirm_ex( C, op, IFACE_("Remove exporter?"), nullptr, IFACE_("Delete"), ALERT_ICON_NONE, false); @@ -589,11 +589,11 @@ static void COLLECTION_OT_exporter_remove(wmOperatorType *ot) RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "Exporter index", 0, INT_MAX); } -static int collection_exporter_export(bContext *C, - wmOperator *op, - CollectionExport *data, - Collection *collection, - const bool report_success) +static wmOperatorStatus collection_exporter_export(bContext *C, + wmOperator *op, + CollectionExport *data, + Collection *collection, + const bool report_success) { using namespace blender; bke::FileHandlerType *fh = bke::file_handler_find(data->fh_idname); @@ -643,7 +643,8 @@ static int collection_exporter_export(bContext *C, RNA_string_set(&properties, "filepath", filepath); RNA_string_set(&properties, "collection", collection_name); - int op_result = WM_operator_name_call_ptr(C, ot, WM_OP_EXEC_DEFAULT, &properties, nullptr); + wmOperatorStatus op_result = WM_operator_name_call_ptr( + C, ot, WM_OP_EXEC_DEFAULT, &properties, nullptr); /* Free the "last used" properties that were just set from the collection export and restore the * original "last used" properties. */ @@ -661,7 +662,7 @@ static int collection_exporter_export(bContext *C, return op_result; } -static int collection_exporter_export_exec(bContext *C, wmOperator *op) +static wmOperatorStatus collection_exporter_export_exec(bContext *C, wmOperator *op) { Collection *collection = CTX_data_collection(C); ListBase *exporters = &collection->exporters; @@ -697,10 +698,10 @@ struct CollectionExportStats { int collections_num = 0; }; -static int collection_export(bContext *C, - wmOperator *op, - Collection *collection, - CollectionExportStats &stats) +static wmOperatorStatus collection_export(bContext *C, + wmOperator *op, + Collection *collection, + CollectionExportStats &stats) { ListBase *exporters = &collection->exporters; int files_num = 0; @@ -720,11 +721,11 @@ static int collection_export(bContext *C, return OPERATOR_FINISHED; } -static int collection_io_export_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus collection_io_export_all_exec(bContext *C, wmOperator *op) { Collection *collection = CTX_data_collection(C); CollectionExportStats stats; - int result = collection_export(C, op, collection, stats); + wmOperatorStatus result = collection_export(C, op, collection, stats); /* Only report if nothing was cancelled along the way. We don't want this UI report to happen * over-top any reports from the actual failures. */ @@ -781,7 +782,7 @@ static int collection_export_recursive(bContext *C, return OPERATOR_FINISHED; } -static int wm_collection_export_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_collection_export_all_exec(bContext *C, wmOperator *op) { ViewLayer *view_layer = CTX_data_view_layer(C); @@ -857,7 +858,7 @@ void collection_exporter_register() /****************** properties window operators *********************/ -static int collection_add_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus collection_add_exec(bContext *C, wmOperator * /*op*/) { Object *ob = context_object(C); Main *bmain = CTX_data_main(C); @@ -893,7 +894,7 @@ void OBJECT_OT_collection_add(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int collection_link_exec(bContext *C, wmOperator *op) +static wmOperatorStatus collection_link_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *ob = context_object(C); @@ -970,7 +971,7 @@ void OBJECT_OT_collection_link(wmOperatorType *ot) ot->prop = prop; } -static int collection_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus collection_remove_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *ob = context_object(C); @@ -1012,7 +1013,7 @@ void OBJECT_OT_collection_remove(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int collection_unlink_exec(bContext *C, wmOperator *op) +static wmOperatorStatus collection_unlink_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Collection *collection = CTX_data_collection(C); @@ -1079,7 +1080,7 @@ void OBJECT_OT_collection_unlink(wmOperatorType *ot) } /* Select objects in the same collection as the active */ -static int select_grouped_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus select_grouped_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); Collection *collection = static_cast( diff --git a/source/blender/editors/object/object_constraint.cc b/source/blender/editors/object/object_constraint.cc index c2e12d49957..1a716a84cb9 100644 --- a/source/blender/editors/object/object_constraint.cc +++ b/source/blender/editors/object/object_constraint.cc @@ -730,7 +730,7 @@ static void edit_constraint_report_property(wmOperatorType *ot) static bool edit_constraint_invoke_properties(bContext *C, wmOperator *op, const wmEvent *event, - int *r_retval) + wmOperatorStatus *r_retval) { PointerRNA ptr = CTX_data_pointer_get_type(C, "constraint", &RNA_Constraint); Object *ob = (ptr.owner_id) ? (Object *)ptr.owner_id : context_active_object(C); @@ -831,7 +831,7 @@ static bConstraint *edit_constraint_property_get(bContext *C, wmOperator *op, Ob * For Stretch-To & Limit-Distance constraints. * \{ */ -static int stretchto_reset_exec(bContext *C, wmOperator *op) +static wmOperatorStatus stretchto_reset_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *ob = context_active_object(C); @@ -851,7 +851,9 @@ static int stretchto_reset_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int stretchto_reset_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus stretchto_reset_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_constraint_invoke_properties(C, op, nullptr, nullptr)) { return stretchto_reset_exec(C, op); @@ -886,7 +888,7 @@ void CONSTRAINT_OT_stretchto_reset(wmOperatorType *ot) * For Limit-Distance constraint. * \{ */ -static int limitdistance_reset_exec(bContext *C, wmOperator *op) +static wmOperatorStatus limitdistance_reset_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *ob = context_active_object(C); @@ -906,7 +908,9 @@ static int limitdistance_reset_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int limitdistance_reset_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus limitdistance_reset_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_constraint_invoke_properties(C, op, nullptr, nullptr)) { return limitdistance_reset_exec(C, op); @@ -958,7 +962,7 @@ static void force_evaluation_if_constraint_disabled(bContext *C, Object *ob, bCo } /* ChildOf Constraint - set inverse callback */ -static int childof_set_inverse_exec(bContext *C, wmOperator *op) +static wmOperatorStatus childof_set_inverse_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *ob = context_active_object(C); @@ -984,7 +988,9 @@ static int childof_set_inverse_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int childof_set_inverse_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus childof_set_inverse_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_constraint_invoke_properties(C, op, nullptr, nullptr)) { return childof_set_inverse_exec(C, op); @@ -1012,7 +1018,7 @@ void CONSTRAINT_OT_childof_set_inverse(wmOperatorType *ot) } /* ChildOf Constraint - clear inverse callback */ -static int childof_clear_inverse_exec(bContext *C, wmOperator *op) +static wmOperatorStatus childof_clear_inverse_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *ob = context_active_object(C); @@ -1033,7 +1039,9 @@ static int childof_clear_inverse_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int childof_clear_inverse_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus childof_clear_inverse_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_constraint_invoke_properties(C, op, nullptr, nullptr)) { return childof_clear_inverse_exec(C, op); @@ -1066,7 +1074,7 @@ void CONSTRAINT_OT_childof_clear_inverse(wmOperatorType *ot) /** \name Follow Path Constraint (Auto Animate Path Operator) * \{ */ -static int followpath_path_animate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus followpath_path_animate_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *ob = context_active_object(C); @@ -1152,7 +1160,9 @@ static int followpath_path_animate_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int followpath_path_animate_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus followpath_path_animate_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { /* hook up invoke properties for figuring out which constraint we're dealing with */ if (edit_constraint_invoke_properties(C, op, nullptr, nullptr)) { @@ -1205,7 +1215,7 @@ void CONSTRAINT_OT_followpath_path_animate(wmOperatorType *ot) /** \name Object Solver Constraint (Set Inverse Operator) * \{ */ -static int objectsolver_set_inverse_exec(bContext *C, wmOperator *op) +static wmOperatorStatus objectsolver_set_inverse_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *ob = context_active_object(C); @@ -1232,7 +1242,9 @@ static int objectsolver_set_inverse_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int objectsolver_set_inverse_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus objectsolver_set_inverse_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_constraint_invoke_properties(C, op, nullptr, nullptr)) { return objectsolver_set_inverse_exec(C, op); @@ -1265,7 +1277,7 @@ void CONSTRAINT_OT_objectsolver_set_inverse(wmOperatorType *ot) /** \name Object Solver Constraint (Clear Inverse Operator) * \{ */ -static int objectsolver_clear_inverse_exec(bContext *C, wmOperator *op) +static wmOperatorStatus objectsolver_clear_inverse_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *ob = context_active_object(C); @@ -1286,9 +1298,9 @@ static int objectsolver_clear_inverse_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int objectsolver_clear_inverse_invoke(bContext *C, - wmOperator *op, - const wmEvent * /*event*/) +static wmOperatorStatus objectsolver_clear_inverse_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_constraint_invoke_properties(C, op, nullptr, nullptr)) { return objectsolver_clear_inverse_exec(C, op); @@ -1448,7 +1460,7 @@ void constraint_copy_for_pose(Main *bmain, Object *ob_dst, bPoseChannel *pchan, /** \name Delete Constraint Operator * \{ */ -static int constraint_delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus constraint_delete_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *ob = context_active_object(C); @@ -1485,9 +1497,9 @@ static int constraint_delete_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int constraint_delete_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus constraint_delete_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (!edit_constraint_invoke_properties(C, op, event, &retval)) { return OPERATOR_CANCELLED; } @@ -1518,7 +1530,7 @@ void CONSTRAINT_OT_delete(wmOperatorType *ot) /** \name Apply Constraint Operator * \{ */ -static int constraint_apply_exec(bContext *C, wmOperator *op) +static wmOperatorStatus constraint_apply_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -1584,9 +1596,9 @@ static int constraint_apply_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int constraint_apply_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus constraint_apply_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (!edit_constraint_invoke_properties(C, op, event, &retval)) { return OPERATOR_CANCELLED; } @@ -1617,7 +1629,7 @@ void CONSTRAINT_OT_apply(wmOperatorType *ot) /** \name Copy Constraint Operator * \{ */ -static int constraint_copy_exec(bContext *C, wmOperator *op) +static wmOperatorStatus constraint_copy_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *ob = context_active_object(C); @@ -1669,9 +1681,9 @@ static int constraint_copy_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int constraint_copy_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus constraint_copy_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (!edit_constraint_invoke_properties(C, op, event, &retval)) { return OPERATOR_CANCELLED; } @@ -1702,7 +1714,7 @@ void CONSTRAINT_OT_copy(wmOperatorType *ot) /** \name Copy Constraint To Selected Operator * \{ */ -static int constraint_copy_to_selected_exec(bContext *C, wmOperator *op) +static wmOperatorStatus constraint_copy_to_selected_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *obact = context_active_object(C); @@ -1771,9 +1783,11 @@ static int constraint_copy_to_selected_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int constraint_copy_to_selected_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus constraint_copy_to_selected_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (!edit_constraint_invoke_properties(C, op, event, &retval)) { return retval; } @@ -1854,7 +1868,7 @@ void CONSTRAINT_OT_copy_to_selected(wmOperatorType *ot) /** \name Move Down Constraint Operator * \{ */ -static int constraint_move_down_exec(bContext *C, wmOperator *op) +static wmOperatorStatus constraint_move_down_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); bConstraint *con = edit_constraint_property_get(C, op, ob, 0); @@ -1876,9 +1890,11 @@ static int constraint_move_down_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int constraint_move_down_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus constraint_move_down_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (edit_constraint_invoke_properties(C, op, event, &retval)) { return constraint_move_down_exec(C, op); } @@ -1910,7 +1926,7 @@ void CONSTRAINT_OT_move_down(wmOperatorType *ot) /** \name Move Up Constraint Operator * \{ */ -static int constraint_move_up_exec(bContext *C, wmOperator *op) +static wmOperatorStatus constraint_move_up_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); bConstraint *con = edit_constraint_property_get(C, op, ob, 0); @@ -1932,9 +1948,11 @@ static int constraint_move_up_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int constraint_move_up_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus constraint_move_up_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (edit_constraint_invoke_properties(C, op, event, &retval)) { return constraint_move_up_exec(C, op); } @@ -1964,7 +1982,7 @@ void CONSTRAINT_OT_move_up(wmOperatorType *ot) /** \name Move Constraint To Index Operator * \{ */ -static int constraint_move_to_index_exec(bContext *C, wmOperator *op) +static wmOperatorStatus constraint_move_to_index_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); bConstraint *con = edit_constraint_property_get(C, op, ob, 0); @@ -1983,9 +2001,11 @@ static int constraint_move_to_index_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int constraint_move_to_index_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus constraint_move_to_index_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (edit_constraint_invoke_properties(C, op, event, &retval)) { return constraint_move_to_index_exec(C, op); } @@ -2026,7 +2046,7 @@ void CONSTRAINT_OT_move_to_index(wmOperatorType *ot) /** \name Clear Pose Constraints Operator * \{ */ -static int pose_constraints_clear_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus pose_constraints_clear_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Object *prev_ob = nullptr; @@ -2065,7 +2085,7 @@ void POSE_OT_constraints_clear(wmOperatorType *ot) ot->poll = ED_operator_object_active_local_editable_posemode_exclusive; } -static int object_constraints_clear_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus object_constraints_clear_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); @@ -2109,7 +2129,7 @@ void OBJECT_OT_constraints_clear(wmOperatorType *ot) /** \name Copy Pose Constraints Operator * \{ */ -static int pose_constraint_copy_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_constraint_copy_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); bPoseChannel *pchan = CTX_data_active_pose_bone(C); @@ -2168,7 +2188,7 @@ void POSE_OT_constraints_copy(wmOperatorType *ot) /** \name Copy Object Constraints Operator * \{ */ -static int object_constraint_copy_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus object_constraint_copy_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Object *obact = context_active_object(C); @@ -2366,7 +2386,7 @@ static bool get_new_constraint_target( } /* used by add constraint operators to add the constraint required */ -static int constraint_add_exec( +static wmOperatorStatus constraint_add_exec( bContext *C, wmOperator *op, Object *ob, ListBase *list, int type, const bool setTarget) { Main *bmain = CTX_data_main(C); @@ -2475,7 +2495,7 @@ static int constraint_add_exec( /* ------------------ */ /* dummy operator callback */ -static int object_constraint_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_constraint_add_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); int type = RNA_enum_get(op->ptr, "type"); @@ -2497,7 +2517,7 @@ static int object_constraint_add_exec(bContext *C, wmOperator *op) } /* dummy operator callback */ -static int pose_constraint_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_constraint_add_exec(bContext *C, wmOperator *op) { Object *ob = BKE_object_pose_armature_get(context_active_object(C)); int type = RNA_enum_get(op->ptr, "type"); @@ -2648,7 +2668,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, const wmEvent * /*event*/) +static wmOperatorStatus pose_ik_add_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); bPoseChannel *pchan = BKE_pose_channel_active_if_bonecoll_visible(ob); @@ -2709,7 +2729,7 @@ static int pose_ik_add_invoke(bContext *C, wmOperator *op, const wmEvent * /*eve } /* call constraint_add_exec() to add the IK constraint */ -static int pose_ik_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pose_ik_add_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); const bool with_targets = RNA_boolean_get(op->ptr, "with_targets"); @@ -2751,7 +2771,7 @@ void POSE_OT_ik_add(wmOperatorType *ot) * Remove IK constraints from selected bones. * \{ */ -static int pose_ik_clear_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus pose_ik_clear_exec(bContext *C, wmOperator * /*op*/) { Object *prev_ob = nullptr; diff --git a/source/blender/editors/object/object_data_transfer.cc b/source/blender/editors/object/object_data_transfer.cc index 7984e5bda56..bf518d8a8ad 100644 --- a/source/blender/editors/object/object_data_transfer.cc +++ b/source/blender/editors/object/object_data_transfer.cc @@ -419,7 +419,7 @@ static bool data_transfer_exec_is_object_valid(wmOperator *op, return false; } -static int data_transfer_exec(bContext *C, wmOperator *op) +static wmOperatorStatus data_transfer_exec(bContext *C, wmOperator *op) { Object *ob_src = context_active_object(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -819,7 +819,7 @@ static bool datalayout_transfer_poll(bContext *C) data_transfer_poll(C)); } -static int datalayout_transfer_exec(bContext *C, wmOperator *op) +static wmOperatorStatus datalayout_transfer_exec(bContext *C, wmOperator *op) { Object *ob_act = context_active_object(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -897,7 +897,9 @@ static int datalayout_transfer_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int datalayout_transfer_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus datalayout_transfer_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { if (edit_modifier_invoke_properties(C, op)) { return datalayout_transfer_exec(C, op); diff --git a/source/blender/editors/object/object_edit.cc b/source/blender/editors/object/object_edit.cc index 8859cd5ca16..0ab5d2f4340 100644 --- a/source/blender/editors/object/object_edit.cc +++ b/source/blender/editors/object/object_edit.cc @@ -272,7 +272,7 @@ static bool object_hide_poll(bContext *C) return ED_operator_view3d_active(C); } -static int object_hide_view_clear_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_hide_view_clear_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -323,7 +323,7 @@ void OBJECT_OT_hide_view_clear(wmOperatorType *ot) RNA_def_boolean(ot->srna, "select", true, "Select", "Select revealed objects"); } -static int object_hide_view_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_hide_view_set_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -392,7 +392,7 @@ void OBJECT_OT_hide_view_set(wmOperatorType *ot) RNA_def_property_flag(prop, PropertyFlag(PROP_SKIP_SAVE | PROP_HIDDEN)); } -static int object_hide_collection_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_hide_collection_exec(bContext *C, wmOperator *op) { View3D *v3d = CTX_wm_view3d(C); @@ -470,7 +470,9 @@ void collection_hide_menu_draw(const bContext *C, uiLayout *layout) } } -static int object_hide_collection_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus object_hide_collection_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { /* Immediately execute if collection index was specified. */ int index = RNA_int_get(op->ptr, "collection_index"); @@ -924,7 +926,7 @@ bool editmode_enter(bContext *C, int flag) return editmode_enter_ex(bmain, scene, ob, flag); } -static int editmode_toggle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus editmode_toggle_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1017,7 +1019,7 @@ void OBJECT_OT_editmode_toggle(wmOperatorType *ot) /** \name Toggle Pose-Mode Operator * \{ */ -static int posemode_exec(bContext *C, wmOperator *op) +static wmOperatorStatus posemode_exec(bContext *C, wmOperator *op) { wmMsgBus *mbus = CTX_wm_message_bus(C); Main *bmain = CTX_data_main(C); @@ -1133,7 +1135,7 @@ void check_force_modifiers(Main *bmain, Scene *scene, Object *object) } } -static int forcefield_toggle_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus forcefield_toggle_exec(bContext *C, wmOperator * /*op*/) { Object *ob = CTX_data_active_object(C); @@ -1296,7 +1298,9 @@ void motion_paths_recalc(bContext *C, } /* show popup to determine settings */ -static int object_calculate_paths_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus object_calculate_paths_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Object *ob = CTX_data_active_object(C); @@ -1318,7 +1322,7 @@ static int object_calculate_paths_invoke(bContext *C, wmOperator *op, const wmEv } /* Calculate/recalculate whole paths (avs.path_sf to avs.path_ef) */ -static int object_calculate_paths_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_calculate_paths_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); short path_type = RNA_enum_get(op->ptr, "display_type"); @@ -1395,7 +1399,7 @@ static bool object_update_paths_poll(bContext *C) return false; } -static int object_update_paths_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_update_paths_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); @@ -1447,7 +1451,7 @@ static bool object_update_all_paths_poll(bContext * /*C*/) return true; } -static int object_update_all_paths_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus object_update_all_paths_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); @@ -1515,7 +1519,7 @@ void motion_paths_clear(bContext *C, bool only_selected) } /* operator callback for this */ -static int object_clear_paths_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_clear_paths_exec(bContext *C, wmOperator *op) { bool only_selected = RNA_boolean_get(op->ptr, "only_selected"); @@ -1587,7 +1591,7 @@ static bool is_smooth_by_angle_modifier(const ModifierData &md) return true; } -static int shade_smooth_exec(bContext *C, wmOperator *op) +static wmOperatorStatus shade_smooth_exec(bContext *C, wmOperator *op) { const bool use_flat = STREQ(op->idname, "OBJECT_OT_shade_flat"); const bool use_smooth = STREQ(op->idname, "OBJECT_OT_shade_smooth"); @@ -1788,7 +1792,7 @@ static bool is_valid_smooth_by_angle_group(const bNodeTree &ntree) return true; } -static int shade_auto_smooth_exec(bContext *C, wmOperator *op) +static wmOperatorStatus shade_auto_smooth_exec(bContext *C, wmOperator *op) { Main &bmain = *CTX_data_main(C); Scene &scene = *CTX_data_scene(C); @@ -1981,7 +1985,7 @@ static bool object_mode_set_poll(bContext *C) return ED_operator_object_active_editable_ex(C, ob); } -static int object_mode_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_mode_set_exec(bContext *C, wmOperator *op) { const bool use_submode = STREQ(op->idname, "OBJECT_OT_mode_set_with_submode"); Object *ob = CTX_data_active_object(C); @@ -2148,7 +2152,7 @@ static bool move_to_collection_poll(bContext *C) return ED_operator_objectmode(C); } -static int move_to_collection_exec(bContext *C, wmOperator *op) +static wmOperatorStatus move_to_collection_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -2342,7 +2346,9 @@ static void move_to_collection_menus_items(uiLayout *layout, MoveToCollectionDat /* This is allocated statically because we need this available for the menus creation callback. */ static MoveToCollectionData *master_collection_menu = nullptr; -static int move_to_collection_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus move_to_collection_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/object/object_hook.cc b/source/blender/editors/object/object_hook.cc index d5fd3de4e24..82e44e4a366 100644 --- a/source/blender/editors/object/object_hook.cc +++ b/source/blender/editors/object/object_hook.cc @@ -612,7 +612,7 @@ static int add_hook_object(const bContext *C, return true; } -static int object_add_hook_selob_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_add_hook_selob_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -668,7 +668,7 @@ void OBJECT_OT_hook_add_selob(wmOperatorType *ot) "Assign the hook to the hook object's active bone"); } -static int object_add_hook_newob_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_add_hook_newob_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -702,7 +702,7 @@ void OBJECT_OT_hook_add_newob(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int object_hook_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_hook_remove_exec(bContext *C, wmOperator *op) { int num = RNA_enum_get(op->ptr, "modifier"); Object *ob = CTX_data_edit_object(C); @@ -784,7 +784,7 @@ void OBJECT_OT_hook_remove(wmOperatorType *ot) ot->prop = prop; } -static int object_hook_reset_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_hook_reset_exec(bContext *C, wmOperator *op) { PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_HookModifier); int num = RNA_enum_get(op->ptr, "modifier"); @@ -832,7 +832,7 @@ void OBJECT_OT_hook_reset(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); } -static int object_hook_recenter_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_hook_recenter_exec(bContext *C, wmOperator *op) { PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_HookModifier); int num = RNA_enum_get(op->ptr, "modifier"); @@ -887,7 +887,7 @@ void OBJECT_OT_hook_recenter(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); } -static int object_hook_assign_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_hook_assign_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -954,7 +954,7 @@ void OBJECT_OT_hook_assign(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); } -static int object_hook_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_hook_select_exec(bContext *C, wmOperator *op) { PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_HookModifier); int num = RNA_enum_get(op->ptr, "modifier"); diff --git a/source/blender/editors/object/object_light_linking_ops.cc b/source/blender/editors/object/object_light_linking_ops.cc index 2a51b700d47..1ac2334dee5 100644 --- a/source/blender/editors/object/object_light_linking_ops.cc +++ b/source/blender/editors/object/object_light_linking_ops.cc @@ -32,7 +32,7 @@ namespace blender::ed::object { * \{ */ template -static int light_linking_collection_new_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus light_linking_collection_new_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Object *object = context_active_object(C); @@ -79,7 +79,7 @@ void OBJECT_OT_light_linking_blocker_collection_new(wmOperatorType *ot) * \{ */ template -static int light_linking_select_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus light_linking_select_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -129,7 +129,7 @@ void OBJECT_OT_light_linking_blockers_select(wmOperatorType *ot) * \{ */ template -static int light_linking_link_exec(bContext *C, wmOperator *op) +static wmOperatorStatus light_linking_link_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -233,7 +233,7 @@ void OBJECT_OT_light_linking_blockers_link(wmOperatorType *ot) /** \name Unlink from the Light Linking Collection Operator * \{ */ -static int light_linking_unlink_from_collection_exec(bContext *C, wmOperator *op) +static wmOperatorStatus light_linking_unlink_from_collection_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); diff --git a/source/blender/editors/object/object_modes.cc b/source/blender/editors/object/object_modes.cc index 3f9c0455681..db59aab947e 100644 --- a/source/blender/editors/object/object_modes.cc +++ b/source/blender/editors/object/object_modes.cc @@ -456,7 +456,9 @@ static bool object_transfer_mode_to_base(bContext *C, return mode_transferred; } -static int object_transfer_mode_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus object_transfer_mode_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Scene *scene = CTX_data_scene(C); ARegion *region = CTX_wm_region(C); diff --git a/source/blender/editors/object/object_modifier.cc b/source/blender/editors/object/object_modifier.cc index 5b2628d96f8..532d9536366 100644 --- a/source/blender/editors/object/object_modifier.cc +++ b/source/blender/editors/object/object_modifier.cc @@ -1641,7 +1641,7 @@ void modifier_register_use_selected_objects_prop(wmOperatorType *ot) /** \name Add Modifier Operator * \{ */ -static int modifier_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus modifier_add_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1663,7 +1663,7 @@ static int modifier_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_add_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus modifier_add_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (event->modifier & KM_ALT || CTX_wm_view3d(C)) { RNA_boolean_set(op->ptr, "use_selected_objects", true); @@ -1852,7 +1852,7 @@ bool edit_modifier_invoke_properties(bContext *C, wmOperator *op) static bool edit_modifier_invoke_properties_with_hover(bContext *C, wmOperator *op, const wmEvent *event, - int *r_retval) + wmOperatorStatus *r_retval) { if (RNA_struct_find_property(op->ptr, "use_selected_objects")) { if (event->modifier & KM_ALT) { @@ -1911,7 +1911,7 @@ ModifierData *edit_modifier_property_get(wmOperator *op, Object *ob, int type) /** \name Remove Modifier Operator * \{ */ -static int modifier_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus modifier_remove_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1959,9 +1959,9 @@ static int modifier_remove_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_remove_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus modifier_remove_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (edit_modifier_invoke_properties_with_hover(C, op, event, &retval)) { return modifier_remove_exec(C, op); } @@ -1985,7 +1985,7 @@ void OBJECT_OT_modifier_remove(wmOperatorType *ot) modifier_register_use_selected_objects_prop(ot); } -static int modifiers_clear_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus modifiers_clear_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -2029,7 +2029,7 @@ void OBJECT_OT_modifiers_clear(wmOperatorType *ot) /** \name Move Up Modifier Operator * \{ */ -static int modifier_move_up_exec(bContext *C, wmOperator *op) +static wmOperatorStatus modifier_move_up_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); ModifierData *md = edit_modifier_property_get(op, ob, 0); @@ -2044,9 +2044,9 @@ static int modifier_move_up_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_move_up_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus modifier_move_up_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (edit_modifier_invoke_properties_with_hover(C, op, event, &retval)) { return modifier_move_up_exec(C, op); } @@ -2074,7 +2074,7 @@ void OBJECT_OT_modifier_move_up(wmOperatorType *ot) /** \name Move Down Modifier Operator * \{ */ -static int modifier_move_down_exec(bContext *C, wmOperator *op) +static wmOperatorStatus modifier_move_down_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); ModifierData *md = edit_modifier_property_get(op, ob, 0); @@ -2089,9 +2089,11 @@ static int modifier_move_down_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_move_down_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus modifier_move_down_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (edit_modifier_invoke_properties_with_hover(C, op, event, &retval)) { return modifier_move_down_exec(C, op); } @@ -2119,7 +2121,7 @@ void OBJECT_OT_modifier_move_down(wmOperatorType *ot) /** \name Move to Index Modifier Operator * \{ */ -static int modifier_move_to_index_exec(bContext *C, wmOperator *op) +static wmOperatorStatus modifier_move_to_index_exec(bContext *C, wmOperator *op) { char name[MAX_NAME]; RNA_string_get(op->ptr, "modifier", name); @@ -2147,9 +2149,11 @@ static int modifier_move_to_index_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_move_to_index_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus modifier_move_to_index_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (edit_modifier_invoke_properties_with_hover(C, op, event, &retval)) { return modifier_move_to_index_exec(C, op); } @@ -2208,7 +2212,10 @@ static bool modifier_apply_poll(bContext *C) return true; } -static int modifier_apply_exec_ex(bContext *C, wmOperator *op, int apply_as, bool keep_modifier) +static wmOperatorStatus modifier_apply_exec_ex(bContext *C, + wmOperator *op, + int apply_as, + bool keep_modifier) { Main *bmain = CTX_data_main(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -2288,14 +2295,14 @@ static int modifier_apply_exec_ex(bContext *C, wmOperator *op, int apply_as, boo return OPERATOR_FINISHED; } -static int modifier_apply_exec(bContext *C, wmOperator *op) +static wmOperatorStatus modifier_apply_exec(bContext *C, wmOperator *op) { return modifier_apply_exec_ex(C, op, MODIFIER_APPLY_DATA, false); } -static int modifier_apply_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus modifier_apply_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (edit_modifier_invoke_properties_with_hover(C, op, event, &retval)) { PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier); Object *ob = (ptr.owner_id != nullptr) ? (Object *)ptr.owner_id : context_active_object(C); @@ -2371,16 +2378,18 @@ static bool modifier_apply_as_shapekey_poll(bContext *C) return modifier_apply_poll(C); } -static int modifier_apply_as_shapekey_exec(bContext *C, wmOperator *op) +static wmOperatorStatus modifier_apply_as_shapekey_exec(bContext *C, wmOperator *op) { bool keep = RNA_boolean_get(op->ptr, "keep_modifier"); return modifier_apply_exec_ex(C, op, MODIFIER_APPLY_SHAPE, keep); } -static int modifier_apply_as_shapekey_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus modifier_apply_as_shapekey_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (edit_modifier_invoke_properties_with_hover(C, op, event, &retval)) { return modifier_apply_as_shapekey_exec(C, op); } @@ -2426,7 +2435,7 @@ void OBJECT_OT_modifier_apply_as_shapekey(wmOperatorType *ot) /** \name Convert Particle System Modifier to Mesh Operator * \{ */ -static int modifier_convert_exec(bContext *C, wmOperator *op) +static wmOperatorStatus modifier_convert_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -2445,7 +2454,9 @@ static int modifier_convert_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_convert_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus modifier_convert_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_modifier_invoke_properties(C, op)) { return modifier_convert_exec(C, op); @@ -2474,7 +2485,7 @@ void OBJECT_OT_modifier_convert(wmOperatorType *ot) /** \name Copy Modifier Operator * \{ */ -static int modifier_copy_exec(bContext *C, wmOperator *op) +static wmOperatorStatus modifier_copy_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -2505,9 +2516,9 @@ static int modifier_copy_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_copy_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus modifier_copy_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (edit_modifier_invoke_properties_with_hover(C, op, event, &retval)) { return modifier_copy_exec(C, op); } @@ -2536,7 +2547,7 @@ void OBJECT_OT_modifier_copy(wmOperatorType *ot) /** \name Set Active Modifier Operator * \{ */ -static int modifier_set_active_exec(bContext *C, wmOperator *op) +static wmOperatorStatus modifier_set_active_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); ModifierData *md = edit_modifier_property_get(op, ob, 0); @@ -2549,9 +2560,11 @@ static int modifier_set_active_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_set_active_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus modifier_set_active_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (edit_modifier_invoke_properties_with_hover(C, op, event, &retval)) { return modifier_set_active_exec(C, op); } @@ -2578,7 +2591,7 @@ void OBJECT_OT_modifier_set_active(wmOperatorType *ot) /** \name Copy Modifier To Selected Operator * \{ */ -static int modifier_copy_to_selected_exec(bContext *C, wmOperator *op) +static wmOperatorStatus modifier_copy_to_selected_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); const Scene *scene = CTX_data_scene(C); @@ -2617,9 +2630,11 @@ static int modifier_copy_to_selected_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int modifier_copy_to_selected_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus modifier_copy_to_selected_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (edit_modifier_invoke_properties_with_hover(C, op, event, &retval)) { return modifier_copy_to_selected_exec(C, op); } @@ -2694,7 +2709,7 @@ void OBJECT_OT_modifier_copy_to_selected(wmOperatorType *ot) edit_modifier_properties(ot); } -static int object_modifiers_copy_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_modifiers_copy_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); const Scene *scene = CTX_data_scene(C); @@ -2800,7 +2815,7 @@ static void skin_root_clear(BMVert *bm_vert, GSet *visited, const int cd_vert_sk } } -static int skin_root_mark_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus skin_root_mark_exec(bContext *C, wmOperator * /*op*/) { Object *ob = CTX_data_edit_object(C); BMEditMesh *em = BKE_editmesh_from_object(ob); @@ -2853,7 +2868,7 @@ enum SkinLooseAction { SKIN_LOOSE_CLEAR, }; -static int skin_loose_mark_clear_exec(bContext *C, wmOperator *op) +static wmOperatorStatus skin_loose_mark_clear_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_edit_object(C); BMEditMesh *em = BKE_editmesh_from_object(ob); @@ -2909,7 +2924,7 @@ void OBJECT_OT_skin_loose_mark_clear(wmOperatorType *ot) RNA_def_enum(ot->srna, "action", action_items, SKIN_LOOSE_MARK, "Action", nullptr); } -static int skin_radii_equalize_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus skin_radii_equalize_exec(bContext *C, wmOperator * /*op*/) { Object *ob = CTX_data_edit_object(C); BMEditMesh *em = BKE_editmesh_from_object(ob); @@ -3064,7 +3079,7 @@ static Object *modifier_skin_armature_create(Depsgraph *depsgraph, Main *bmain, return arm_ob; } -static int skin_armature_create_exec(bContext *C, wmOperator *op) +static wmOperatorStatus skin_armature_create_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -3098,7 +3113,9 @@ static int skin_armature_create_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int skin_armature_create_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus skin_armature_create_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_modifier_invoke_properties(C, op)) { return skin_armature_create_exec(C, op); @@ -3132,7 +3149,7 @@ static bool correctivesmooth_poll(bContext *C) return edit_modifier_poll_generic(C, &RNA_CorrectiveSmoothModifier, 0, true, false); } -static int correctivesmooth_bind_exec(bContext *C, wmOperator *op) +static wmOperatorStatus correctivesmooth_bind_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Scene *scene = CTX_data_scene(C); @@ -3175,7 +3192,9 @@ static int correctivesmooth_bind_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int correctivesmooth_bind_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus correctivesmooth_bind_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_modifier_invoke_properties(C, op)) { return correctivesmooth_bind_exec(C, op); @@ -3211,7 +3230,7 @@ static bool meshdeform_poll(bContext *C) return edit_modifier_poll_generic(C, &RNA_MeshDeformModifier, 0, true, false); } -static int meshdeform_bind_exec(bContext *C, wmOperator *op) +static wmOperatorStatus meshdeform_bind_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Object *ob = context_active_object(C); @@ -3250,7 +3269,9 @@ static int meshdeform_bind_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int meshdeform_bind_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus meshdeform_bind_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_modifier_invoke_properties(C, op)) { return meshdeform_bind_exec(C, op); @@ -3286,7 +3307,7 @@ static bool explode_poll(bContext *C) return edit_modifier_poll_generic(C, &RNA_ExplodeModifier, 0, true, false); } -static int explode_refresh_exec(bContext *C, wmOperator *op) +static wmOperatorStatus explode_refresh_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); ExplodeModifierData *emd = (ExplodeModifierData *)edit_modifier_property_get( @@ -3304,7 +3325,9 @@ static int explode_refresh_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int explode_refresh_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus explode_refresh_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_modifier_invoke_properties(C, op)) { return explode_refresh_exec(C, op); @@ -3412,7 +3435,7 @@ static void oceanbake_endjob(void *customdata) DEG_id_tag_update(&ob->id, ID_RECALC_SYNC_TO_EVAL); } -static int ocean_bake_exec(bContext *C, wmOperator *op) +static wmOperatorStatus ocean_bake_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *ob = context_active_object(C); @@ -3505,7 +3528,7 @@ static int ocean_bake_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int ocean_bake_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus ocean_bake_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { if (edit_modifier_invoke_properties(C, op)) { return ocean_bake_exec(C, op); @@ -3541,7 +3564,7 @@ static bool laplaciandeform_poll(bContext *C) return edit_modifier_poll_generic(C, &RNA_LaplacianDeformModifier, 0, false, false); } -static int laplaciandeform_bind_exec(bContext *C, wmOperator *op) +static wmOperatorStatus laplaciandeform_bind_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -3582,7 +3605,9 @@ static int laplaciandeform_bind_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int laplaciandeform_bind_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus laplaciandeform_bind_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_modifier_invoke_properties(C, op)) { return laplaciandeform_bind_exec(C, op); @@ -3618,7 +3643,7 @@ static bool surfacedeform_bind_poll(bContext *C) return edit_modifier_poll_generic(C, &RNA_SurfaceDeformModifier, 0, true, false); } -static int surfacedeform_bind_exec(bContext *C, wmOperator *op) +static wmOperatorStatus surfacedeform_bind_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -3649,7 +3674,9 @@ static int surfacedeform_bind_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int surfacedeform_bind_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus surfacedeform_bind_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_modifier_invoke_properties(C, op)) { return surfacedeform_bind_exec(C, op); @@ -3684,7 +3711,7 @@ void OBJECT_OT_surfacedeform_bind(wmOperatorType *ot) * "use_attribute" is on, which isn't expected. * \{ */ -static int geometry_nodes_input_attribute_toggle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus geometry_nodes_input_attribute_toggle_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); @@ -3741,7 +3768,7 @@ void OBJECT_OT_geometry_nodes_input_attribute_toggle(wmOperatorType *ot) /** \name Copy and Assign Geometry Node Group operator * \{ */ -static int geometry_node_tree_copy_assign_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus geometry_node_tree_copy_assign_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Object *ob = context_active_object(C); @@ -3798,7 +3825,7 @@ static bool dash_modifier_segment_poll(bContext *C) return edit_modifier_poll_generic(C, &RNA_GreasePencilDashModifierData, 0, false, false); } -static int dash_modifier_segment_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus dash_modifier_segment_add_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); auto *dmd = reinterpret_cast( @@ -3851,7 +3878,9 @@ static int dash_modifier_segment_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int dash_modifier_segment_add_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus dash_modifier_segment_add_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_modifier_invoke_properties(C, op)) { return dash_modifier_segment_add_exec(C, op); @@ -3878,7 +3907,7 @@ void OBJECT_OT_grease_pencil_dash_modifier_segment_add(wmOperatorType *ot) static void dash_modifier_segment_free(GreasePencilDashModifierSegment * /*ds*/) {} -static int dash_modifier_segment_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus dash_modifier_segment_remove_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); auto *dmd = reinterpret_cast( @@ -3904,9 +3933,9 @@ static int dash_modifier_segment_remove_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int dash_modifier_segment_remove_invoke(bContext *C, - wmOperator *op, - const wmEvent * /*event*/) +static wmOperatorStatus dash_modifier_segment_remove_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_modifier_invoke_properties(C, op)) { return dash_modifier_segment_remove_exec(C, op); @@ -3939,7 +3968,7 @@ enum class DashSegmentMoveDirection { Down = 1, }; -static int dash_modifier_segment_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus dash_modifier_segment_move_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); auto *dmd = reinterpret_cast( @@ -3986,9 +4015,9 @@ static int dash_modifier_segment_move_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int dash_modifier_segment_move_invoke(bContext *C, - wmOperator *op, - const wmEvent * /*event*/) +static wmOperatorStatus dash_modifier_segment_move_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_modifier_invoke_properties(C, op)) { return dash_modifier_segment_move_exec(C, op); @@ -4032,7 +4061,7 @@ static bool time_modifier_segment_poll(bContext *C) return edit_modifier_poll_generic(C, &RNA_GreasePencilTimeModifier, 0, false, false); } -static int time_modifier_segment_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus time_modifier_segment_add_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); auto *tmd = reinterpret_cast( @@ -4085,7 +4114,9 @@ static int time_modifier_segment_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int time_modifier_segment_add_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus time_modifier_segment_add_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_modifier_invoke_properties(C, op)) { return time_modifier_segment_add_exec(C, op); @@ -4112,7 +4143,7 @@ void OBJECT_OT_grease_pencil_time_modifier_segment_add(wmOperatorType *ot) static void time_modifier_segment_free(GreasePencilTimeModifierSegment * /*ds*/) {} -static int time_modifier_segment_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus time_modifier_segment_remove_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); auto *tmd = reinterpret_cast( @@ -4138,9 +4169,9 @@ static int time_modifier_segment_remove_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int time_modifier_segment_remove_invoke(bContext *C, - wmOperator *op, - const wmEvent * /*event*/) +static wmOperatorStatus time_modifier_segment_remove_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_modifier_invoke_properties(C, op)) { return time_modifier_segment_remove_exec(C, op); @@ -4173,7 +4204,7 @@ enum class TimeSegmentMoveDirection { Down = 1, }; -static int time_modifier_segment_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus time_modifier_segment_move_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); auto *tmd = reinterpret_cast( @@ -4220,9 +4251,9 @@ static int time_modifier_segment_move_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int time_modifier_segment_move_invoke(bContext *C, - wmOperator *op, - const wmEvent * /*event*/) +static wmOperatorStatus time_modifier_segment_move_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_modifier_invoke_properties(C, op)) { return time_modifier_segment_move_exec(C, op); diff --git a/source/blender/editors/object/object_multires_modifier.cc b/source/blender/editors/object/object_multires_modifier.cc index 9ffd6e2e3f5..61d2410c7d9 100644 --- a/source/blender/editors/object/object_multires_modifier.cc +++ b/source/blender/editors/object/object_multires_modifier.cc @@ -43,7 +43,7 @@ static bool multires_poll(bContext *C) return edit_modifier_poll_generic(C, &RNA_MultiresModifier, (1 << OB_MESH), true, false); } -static int multires_higher_levels_delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus multires_higher_levels_delete_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Object *ob = context_active_object(C); @@ -63,9 +63,9 @@ 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, - const wmEvent * /*event*/) +static wmOperatorStatus multires_higher_levels_delete_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_modifier_invoke_properties(C, op)) { return multires_higher_levels_delete_exec(C, op); @@ -113,7 +113,7 @@ static EnumPropertyItem prop_multires_subdivide_mode_type[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int multires_subdivide_exec(bContext *C, wmOperator *op) +static wmOperatorStatus multires_subdivide_exec(bContext *C, wmOperator *op) { Object *object = context_active_object(C); MultiresModifierData *mmd = (MultiresModifierData *)edit_modifier_property_get( @@ -141,7 +141,9 @@ static int multires_subdivide_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int multires_subdivide_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus multires_subdivide_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_modifier_invoke_properties(C, op)) { return multires_subdivide_exec(C, op); @@ -176,7 +178,7 @@ void OBJECT_OT_multires_subdivide(wmOperatorType *ot) /** \name Multires Reshape Operator * \{ */ -static int multires_reshape_exec(bContext *C, wmOperator *op) +static wmOperatorStatus multires_reshape_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Object *ob = context_active_object(C), *secondob = nullptr; @@ -216,7 +218,9 @@ static int multires_reshape_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int multires_reshape_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus multires_reshape_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_modifier_invoke_properties(C, op)) { return multires_reshape_exec(C, op); @@ -245,7 +249,7 @@ void OBJECT_OT_multires_reshape(wmOperatorType *ot) /** \name Multires Save External Operator * \{ */ -static int multires_external_save_exec(bContext *C, wmOperator *op) +static wmOperatorStatus multires_external_save_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *ob = context_active_object(C); @@ -274,7 +278,9 @@ static int multires_external_save_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int multires_external_save_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus multires_external_save_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Object *ob = context_active_object(C); Mesh *mesh = static_cast(ob->data); @@ -339,7 +345,7 @@ void OBJECT_OT_multires_external_save(wmOperatorType *ot) /** \name Multires Pack Operator * \{ */ -static int multires_external_pack_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus multires_external_pack_exec(bContext *C, wmOperator * /*op*/) { Object *ob = context_active_object(C); Mesh *mesh = static_cast(ob->data); @@ -373,7 +379,7 @@ void OBJECT_OT_multires_external_pack(wmOperatorType *ot) /** \name Multires Apply Base * \{ */ -static int multires_base_apply_exec(bContext *C, wmOperator *op) +static wmOperatorStatus multires_base_apply_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); Object *object = context_active_object(C); @@ -396,7 +402,9 @@ static int multires_base_apply_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int multires_base_apply_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus multires_base_apply_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_modifier_invoke_properties(C, op)) { return multires_base_apply_exec(C, op); @@ -425,7 +433,7 @@ void OBJECT_OT_multires_base_apply(wmOperatorType *ot) /** \name Multires Unsubdivide * \{ */ -static int multires_unsubdivide_exec(bContext *C, wmOperator *op) +static wmOperatorStatus multires_unsubdivide_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); Object *object = context_active_object(C); @@ -448,7 +456,9 @@ static int multires_unsubdivide_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int multires_unsubdivide_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus multires_unsubdivide_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_modifier_invoke_properties(C, op)) { return multires_unsubdivide_exec(C, op); @@ -477,7 +487,7 @@ void OBJECT_OT_multires_unsubdivide(wmOperatorType *ot) /** \name Multires Rebuild Subdivisions * \{ */ -static int multires_rebuild_subdiv_exec(bContext *C, wmOperator *op) +static wmOperatorStatus multires_rebuild_subdiv_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); Object *object = context_active_object(C); @@ -502,7 +512,9 @@ static int multires_rebuild_subdiv_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int multires_rebuild_subdiv_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus multires_rebuild_subdiv_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (edit_modifier_invoke_properties(C, op)) { return multires_rebuild_subdiv_exec(C, op); diff --git a/source/blender/editors/object/object_random.cc b/source/blender/editors/object/object_random.cc index 89d05dd1dd4..3f8f35b6ad2 100644 --- a/source/blender/editors/object/object_random.cc +++ b/source/blender/editors/object/object_random.cc @@ -73,7 +73,7 @@ static bool object_rand_transverts(TransVertStore *tvs, return true; } -static int object_rand_verts_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_rand_verts_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); diff --git a/source/blender/editors/object/object_relations.cc b/source/blender/editors/object/object_relations.cc index 7bab504f690..12fbf8c5271 100644 --- a/source/blender/editors/object/object_relations.cc +++ b/source/blender/editors/object/object_relations.cc @@ -107,7 +107,7 @@ static bool vertex_parent_set_poll(bContext *C) return ED_operator_editmesh(C) || ED_operator_editsurfcurve(C) || ED_operator_editlattice(C); } -static int vertex_parent_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_parent_set_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -414,7 +414,7 @@ void parent_clear(Object *ob, const int type) } /* NOTE: poll should check for editable scene. */ -static int parent_clear_exec(bContext *C, wmOperator *op) +static wmOperatorStatus parent_clear_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); /* Dependency graph must be evaluated for access to object's evaluated transform matrices. */ @@ -881,7 +881,7 @@ static bool parent_set_vertex_parent(bContext *C, ParentingContext *parenting_co return ok; } -static int parent_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus parent_set_exec(bContext *C, wmOperator *op) { const int partype = RNA_enum_get(op->ptr, "type"); ParentingContext parenting_context{}; @@ -912,7 +912,7 @@ static int parent_set_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int parent_set_invoke_menu(bContext *C, wmOperatorType *ot) +static wmOperatorStatus parent_set_invoke_menu(bContext *C, wmOperatorType *ot) { Object *parent = context_active_object(C); uiPopupMenu *pup = UI_popup_menu_begin(C, IFACE_("Set Parent To"), ICON_NONE); @@ -1027,7 +1027,7 @@ static int parent_set_invoke_menu(bContext *C, wmOperatorType *ot) return OPERATOR_INTERFACE; } -static int parent_set_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus parent_set_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { if (RNA_property_is_set(op->ptr, op->type->prop)) { return parent_set_exec(C, op); @@ -1089,7 +1089,7 @@ void OBJECT_OT_parent_set(wmOperatorType *ot) /** \name Make Parent Without Inverse Operator * \{ */ -static int parent_noinv_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus parent_noinv_set_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *par = context_active_object(C); @@ -1175,7 +1175,7 @@ static const EnumPropertyItem prop_clear_track_types[] = { }; /* NOTE: poll should check for editable scene. */ -static int object_track_clear_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_track_clear_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); const int type = RNA_enum_get(op->ptr, "type"); @@ -1253,7 +1253,7 @@ static const EnumPropertyItem prop_make_track_types[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int track_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus track_set_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *obact = context_active_object(C); @@ -1387,7 +1387,7 @@ static void link_to_scene(Main * /*bmain*/, ushort /*nr*/) } #endif -static int make_links_scene_exec(bContext *C, wmOperator *op) +static wmOperatorStatus make_links_scene_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene_to = static_cast( @@ -1484,7 +1484,7 @@ static bool allow_make_links_data(const int type, Object *ob_src, Object *ob_dst return false; } -static int make_links_data_exec(bContext *C, wmOperator *op) +static wmOperatorStatus make_links_data_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Main *bmain = CTX_data_main(C); @@ -2213,7 +2213,7 @@ static void make_local_material_tag(Material *ma) } } -static int make_local_exec(bContext *C, wmOperator *op) +static wmOperatorStatus make_local_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Material *ma, ***matarar; @@ -2343,7 +2343,7 @@ static bool make_override_library_object_overridable_check(Main *bmain, Object * return false; } -static int make_override_library_exec(bContext *C, wmOperator *op) +static wmOperatorStatus make_override_library_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -2542,7 +2542,9 @@ static int make_override_library_exec(bContext *C, wmOperator *op) } /* Set the object to override. */ -static int make_override_library_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus make_override_library_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -2706,7 +2708,7 @@ static bool reset_clear_override_library_poll(bContext *C) ID_IS_OVERRIDE_LIBRARY(obact)); } -static int reset_override_library_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus reset_override_library_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); @@ -2746,7 +2748,7 @@ void OBJECT_OT_reset_override_library(wmOperatorType *ot) /** \name Clear Library Override Operator * \{ */ -static int clear_override_library_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus clear_override_library_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -2828,7 +2830,7 @@ enum { MAKE_SINGLE_USER_SELECTED = 2, }; -static int make_single_user_exec(bContext *C, wmOperator *op) +static wmOperatorStatus make_single_user_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -2881,7 +2883,7 @@ static int make_single_user_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int make_single_user_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus make_single_user_invoke(bContext *C, wmOperator *op, const wmEvent *event) { return WM_operator_props_popup_confirm_ex( C, op, event, IFACE_("Make Selected Objects Single-User"), IFACE_("Make Single")); @@ -2958,7 +2960,9 @@ std::string drop_named_material_tooltip(bContext *C, const char *name, const int fmt::runtime(TIP_("Drop {} on {} (slot {})")), name, ob->id.name + 2, mat_slot); } -static int drop_named_material_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus drop_named_material_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Main *bmain = CTX_data_main(C); int mat_slot = 0; @@ -3043,7 +3047,9 @@ static bool check_geometry_node_group_sockets(wmOperator *op, const bNodeTree *t return true; } -static int drop_geometry_nodes_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus drop_geometry_nodes_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Object *ob = ED_view3d_give_object_under_cursor(C, event->mval); if (!ob) { @@ -3121,7 +3127,7 @@ void OBJECT_OT_drop_geometry_nodes(wmOperatorType *ot) /** \name Unlink Object Operator * \{ */ -static int object_unlink_data_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_unlink_data_exec(bContext *C, wmOperator *op) { ID *id; PropertyPointerRNA pprop; diff --git a/source/blender/editors/object/object_remesh.cc b/source/blender/editors/object/object_remesh.cc index 20e23802aac..b2ac37d0161 100644 --- a/source/blender/editors/object/object_remesh.cc +++ b/source/blender/editors/object/object_remesh.cc @@ -106,7 +106,7 @@ static bool object_remesh_poll(bContext *C) return ED_operator_object_active_editable_mesh(C); } -static int voxel_remesh_exec(bContext *C, wmOperator *op) +static wmOperatorStatus voxel_remesh_exec(bContext *C, wmOperator *op) { const Scene &scene = *CTX_data_scene(C); Object *ob = CTX_data_active_object(C); @@ -366,7 +366,7 @@ static void voxel_size_edit_update_header(wmOperator *op, bContext *C) status.item_bool(IFACE_("Precision Mode"), cd->slow_mode, ICON_EVENT_SHIFT); } -static int voxel_size_edit_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus voxel_size_edit_modal(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); VoxelSizeEditCustomData *cd = static_cast(op->customdata); @@ -432,7 +432,7 @@ static int voxel_size_edit_modal(bContext *C, wmOperator *op, const wmEvent *eve return OPERATOR_RUNNING_MODAL; } -static int voxel_size_edit_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus voxel_size_edit_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); Object *active_object = CTX_data_active_object(C); @@ -949,7 +949,7 @@ static void quadriflow_end_job(void *customdata) } } -static int quadriflow_remesh_exec(bContext *C, wmOperator *op) +static wmOperatorStatus quadriflow_remesh_exec(bContext *C, wmOperator *op) { QuadriFlowJob *job = (QuadriFlowJob *)MEM_mallocN(sizeof(QuadriFlowJob), "QuadriFlowJob"); @@ -1112,7 +1112,7 @@ static const EnumPropertyItem mode_type_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int quadriflow_remesh_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus quadriflow_remesh_invoke(bContext *C, wmOperator *op, const wmEvent *event) { return WM_operator_props_popup_confirm_ex( C, op, event, IFACE_("QuadriFlow Remesh the Selected Mesh"), IFACE_("Remesh")); diff --git a/source/blender/editors/object/object_select.cc b/source/blender/editors/object/object_select.cc index d249df6f1c7..92c243c6ce5 100644 --- a/source/blender/editors/object/object_select.cc +++ b/source/blender/editors/object/object_select.cc @@ -370,7 +370,7 @@ static bool objects_selectable_poll(bContext *C) /** \name Select by Type * \{ */ -static int object_select_by_type_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_select_by_type_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -599,7 +599,7 @@ void select_linked_by_id(bContext *C, ID *id) } } -static int object_select_linked_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_select_linked_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1001,7 +1001,7 @@ static bool select_grouped_keyingset(bContext *C, Object * /*ob*/, ReportList *r return changed; } -static int object_select_grouped_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_select_grouped_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1105,7 +1105,7 @@ void OBJECT_OT_select_grouped(wmOperatorType *ot) /** \name (De)select All * \{ */ -static int object_select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_select_all_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1155,7 +1155,7 @@ void OBJECT_OT_select_all(wmOperatorType *ot) /** \name Select In The Same Collection * \{ */ -static int object_select_same_collection_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_select_same_collection_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Collection *collection; @@ -1221,7 +1221,7 @@ void OBJECT_OT_select_same_collection(wmOperatorType *ot) /** \name Select Mirror * \{ */ -static int object_select_mirror_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_select_mirror_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1342,7 +1342,7 @@ static bool object_select_more_less(bContext *C, const bool select) return changed; } -static int object_select_more_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus object_select_more_exec(bContext *C, wmOperator * /*op*/) { bool changed = object_select_more_less(C, true); @@ -1373,7 +1373,7 @@ void OBJECT_OT_select_more(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int object_select_less_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus object_select_less_exec(bContext *C, wmOperator * /*op*/) { bool changed = object_select_more_less(C, false); @@ -1410,7 +1410,7 @@ void OBJECT_OT_select_less(wmOperatorType *ot) /** \name Select Random * \{ */ -static int object_select_random_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_select_random_exec(bContext *C, wmOperator *op) { const bool select = (RNA_enum_get(op->ptr, "action") == SEL_SELECT); const float randfac = RNA_float_get(op->ptr, "ratio"); diff --git a/source/blender/editors/object/object_shader_fx.cc b/source/blender/editors/object/object_shader_fx.cc index afc801f8ae2..e2aaba2c758 100644 --- a/source/blender/editors/object/object_shader_fx.cc +++ b/source/blender/editors/object/object_shader_fx.cc @@ -296,7 +296,7 @@ static bool edit_shaderfx_poll(bContext *C) /** \name Add Effect Operator * \{ */ -static int shaderfx_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus shaderfx_add_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -410,7 +410,7 @@ static void edit_shaderfx_report_property(wmOperatorType *ot) static bool edit_shaderfx_invoke_properties(bContext *C, wmOperator *op, const wmEvent *event, - int *r_retval) + wmOperatorStatus *r_retval) { if (RNA_struct_property_is_set(op->ptr, "shaderfx")) { return true; @@ -469,7 +469,7 @@ static ShaderFxData *edit_shaderfx_property_get(wmOperator *op, Object *ob, int /** \name Remove ShaderFX Operator * \{ */ -static int shaderfx_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus shaderfx_remove_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *ob = context_active_object(C); @@ -495,9 +495,9 @@ static int shaderfx_remove_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int shaderfx_remove_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus shaderfx_remove_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (edit_shaderfx_invoke_properties(C, op, event, &retval)) { return shaderfx_remove_exec(C, op); } @@ -526,7 +526,7 @@ void OBJECT_OT_shaderfx_remove(wmOperatorType *ot) /** \name Move up ShaderFX Operator * \{ */ -static int shaderfx_move_up_exec(bContext *C, wmOperator *op) +static wmOperatorStatus shaderfx_move_up_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); ShaderFxData *fx = edit_shaderfx_property_get(op, ob, 0); @@ -541,9 +541,9 @@ static int shaderfx_move_up_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int shaderfx_move_up_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus shaderfx_move_up_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (edit_shaderfx_invoke_properties(C, op, event, &retval)) { return shaderfx_move_up_exec(C, op); } @@ -571,7 +571,7 @@ void OBJECT_OT_shaderfx_move_up(wmOperatorType *ot) /** \name Move Down ShaderFX Operator * \{ */ -static int shaderfx_move_down_exec(bContext *C, wmOperator *op) +static wmOperatorStatus shaderfx_move_down_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); ShaderFxData *fx = edit_shaderfx_property_get(op, ob, 0); @@ -586,9 +586,11 @@ static int shaderfx_move_down_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int shaderfx_move_down_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus shaderfx_move_down_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (edit_shaderfx_invoke_properties(C, op, event, &retval)) { return shaderfx_move_down_exec(C, op); } @@ -616,7 +618,7 @@ void OBJECT_OT_shaderfx_move_down(wmOperatorType *ot) /** \name Move ShaderFX to Index Operator * \{ */ -static int shaderfx_move_to_index_exec(bContext *C, wmOperator *op) +static wmOperatorStatus shaderfx_move_to_index_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); ShaderFxData *fx = edit_shaderfx_property_get(op, ob, 0); @@ -629,9 +631,11 @@ static int shaderfx_move_to_index_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int shaderfx_move_to_index_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus shaderfx_move_to_index_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (edit_shaderfx_invoke_properties(C, op, event, &retval)) { return shaderfx_move_to_index_exec(C, op); } @@ -663,7 +667,7 @@ void OBJECT_OT_shaderfx_move_to_index(wmOperatorType *ot) /** \name Copy Shader Operator * \{ */ -static int shaderfx_copy_exec(bContext *C, wmOperator *op) +static wmOperatorStatus shaderfx_copy_exec(bContext *C, wmOperator *op) { Object *ob = context_active_object(C); ShaderFxData *fx = edit_shaderfx_property_get(op, ob, 0); @@ -688,9 +692,9 @@ static int shaderfx_copy_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int shaderfx_copy_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus shaderfx_copy_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - int retval; + wmOperatorStatus retval; if (edit_shaderfx_invoke_properties(C, op, event, &retval)) { return shaderfx_copy_exec(C, op); } diff --git a/source/blender/editors/object/object_shapekey.cc b/source/blender/editors/object/object_shapekey.cc index c78333e5693..c640b1b4399 100644 --- a/source/blender/editors/object/object_shapekey.cc +++ b/source/blender/editors/object/object_shapekey.cc @@ -339,7 +339,7 @@ static bool shape_key_move_poll(bContext *C) /** \name Shape Key Add Operator * \{ */ -static int shape_key_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus shape_key_add_exec(bContext *C, wmOperator *op) { Object *ob = context_object(C); const bool from_mix = RNA_boolean_get(op->ptr, "from_mix"); @@ -380,7 +380,7 @@ void OBJECT_OT_shape_key_add(wmOperatorType *ot) /** \name Shape Key Remove Operator * \{ */ -static int shape_key_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus shape_key_remove_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *ob = context_object(C); @@ -473,7 +473,7 @@ void OBJECT_OT_shape_key_remove(wmOperatorType *ot) /** \name Shape Key Clear Operator * \{ */ -static int shape_key_clear_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus shape_key_clear_exec(bContext *C, wmOperator * /*op*/) { Object *ob = context_object(C); Key *key = BKE_key_from_object(ob); @@ -509,7 +509,7 @@ void OBJECT_OT_shape_key_clear(wmOperatorType *ot) } /* starting point and step size could be optional */ -static int shape_key_retime_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus shape_key_retime_exec(bContext *C, wmOperator * /*op*/) { Object *ob = context_object(C); Key *key = BKE_key_from_object(ob); @@ -551,7 +551,7 @@ void OBJECT_OT_shape_key_retime(wmOperatorType *ot) /** \name Shape Key Mirror Operator * \{ */ -static int shape_key_mirror_exec(bContext *C, wmOperator *op) +static wmOperatorStatus shape_key_mirror_exec(bContext *C, wmOperator *op) { Object *ob = context_object(C); int totmirr = 0, totfail = 0; @@ -606,7 +606,7 @@ enum { KB_MOVE_BOTTOM = 2, }; -static int shape_key_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus shape_key_move_exec(bContext *C, wmOperator *op) { Object *ob = context_object(C); @@ -676,7 +676,7 @@ enum { SHAPE_KEY_UNLOCK, }; -static int shape_key_lock_exec(bContext *C, wmOperator *op) +static wmOperatorStatus shape_key_lock_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); const int action = RNA_enum_get(op->ptr, "action"); diff --git a/source/blender/editors/object/object_transform.cc b/source/blender/editors/object/object_transform.cc index 9dc93e5901f..ad7bb3de2d7 100644 --- a/source/blender/editors/object/object_transform.cc +++ b/source/blender/editors/object/object_transform.cc @@ -295,10 +295,11 @@ static void object_clear_scale(Object *ob, const bool clear_delta) } /* generic exec for clear-transform operators */ -static int object_clear_transform_generic_exec(bContext *C, - wmOperator *op, - void (*clear_func)(Object *, const bool), - const char default_ksName[]) +static wmOperatorStatus object_clear_transform_generic_exec(bContext *C, + wmOperator *op, + void (*clear_func)(Object *, + const bool), + const char default_ksName[]) { Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); Main *bmain = CTX_data_main(C); @@ -383,7 +384,7 @@ static int object_clear_transform_generic_exec(bContext *C, /** \name Clear Location Operator * \{ */ -static int object_location_clear_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_location_clear_exec(bContext *C, wmOperator *op) { return object_clear_transform_generic_exec(C, op, object_clear_loc, ANIM_KS_LOCATION_ID); } @@ -417,7 +418,7 @@ void OBJECT_OT_location_clear(wmOperatorType *ot) /** \name Clear Rotation Operator * \{ */ -static int object_rotation_clear_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_rotation_clear_exec(bContext *C, wmOperator *op) { return object_clear_transform_generic_exec(C, op, object_clear_rot, ANIM_KS_ROTATION_ID); } @@ -451,7 +452,7 @@ void OBJECT_OT_rotation_clear(wmOperatorType *ot) /** \name Clear Scale Operator * \{ */ -static int object_scale_clear_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_scale_clear_exec(bContext *C, wmOperator *op) { return object_clear_transform_generic_exec(C, op, object_clear_scale, ANIM_KS_SCALING_ID); } @@ -485,7 +486,7 @@ void OBJECT_OT_scale_clear(wmOperatorType *ot) /** \name Clear Origin Operator * \{ */ -static int object_origin_clear_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus object_origin_clear_exec(bContext *C, wmOperator * /*op*/) { float *v1, *v3; float mat[3][3]; @@ -661,13 +662,13 @@ static void transform_positions(MutableSpan positions, const float4x4 &m }); } -static int apply_objects_internal(bContext *C, - ReportList *reports, - bool apply_loc, - bool apply_rot, - bool apply_scale, - bool do_props, - bool do_single_user) +static wmOperatorStatus apply_objects_internal(bContext *C, + ReportList *reports, + bool apply_loc, + bool apply_rot, + bool apply_scale, + bool do_props, + bool do_single_user) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1088,7 +1089,7 @@ static int apply_objects_internal(bContext *C, return OPERATOR_FINISHED; } -static int visual_transform_apply_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus visual_transform_apply_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -1130,7 +1131,7 @@ void OBJECT_OT_visual_transform_apply(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int object_transform_apply_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_transform_apply_exec(bContext *C, wmOperator *op) { const bool loc = RNA_boolean_get(op->ptr, "location"); const bool rot = RNA_boolean_get(op->ptr, "rotation"); @@ -1145,7 +1146,9 @@ static int object_transform_apply_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int object_transform_apply_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus object_transform_apply_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Object *ob = context_active_object(C); @@ -1209,7 +1212,7 @@ void OBJECT_OT_transform_apply(wmOperatorType *ot) /** \name Apply Parent Inverse Operator * \{ */ -static int object_parent_inverse_apply_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus object_parent_inverse_apply_exec(bContext *C, wmOperator * /*op*/) { CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { if (ob->parent == nullptr) { @@ -1273,7 +1276,7 @@ static void translate_positions(MutableSpan positions, const float3 &tra }); } -static int object_origin_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_origin_set_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -2069,7 +2072,9 @@ static void object_transform_axis_target_cancel(bContext *C, wmOperator *op) object_transform_axis_target_free_data(op); } -static int object_transform_axis_target_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus object_transform_axis_target_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); ViewContext vc = ED_view3d_viewcontext_init(C, depsgraph); @@ -2141,7 +2146,9 @@ static int object_transform_axis_target_invoke(bContext *C, wmOperator *op, cons return OPERATOR_RUNNING_MODAL; } -static int object_transform_axis_target_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus object_transform_axis_target_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { XFormAxisData *xfd = static_cast(op->customdata); ARegion *region = xfd->vc.region; diff --git a/source/blender/editors/object/object_vgroup.cc b/source/blender/editors/object/object_vgroup.cc index ebc74da2aef..67972ed4b89 100644 --- a/source/blender/editors/object/object_vgroup.cc +++ b/source/blender/editors/object/object_vgroup.cc @@ -2563,7 +2563,7 @@ static bool vertex_group_vert_select_mesh_poll(bContext *C) /** \name Vertex Group Add Operator * \{ */ -static int vertex_group_add_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus vertex_group_add_exec(bContext *C, wmOperator * /*op*/) { Object *ob = context_object(C); @@ -2644,7 +2644,7 @@ static void grease_pencil_clear_from_all_vgroup(Scene &scene, } } -static int vertex_group_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_group_remove_exec(bContext *C, wmOperator *op) { Object *ob = context_object(C); Scene &scene = *CTX_data_scene(C); @@ -2714,7 +2714,7 @@ void OBJECT_OT_vertex_group_remove(wmOperatorType *ot) /** \name Vertex Group Assign Operator * \{ */ -static int vertex_group_assign_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus vertex_group_assign_exec(bContext *C, wmOperator * /*op*/) { ToolSettings *ts = CTX_data_tool_settings(C); Object *ob = context_object(C); @@ -2752,7 +2752,7 @@ void OBJECT_OT_vertex_group_assign(wmOperatorType *ot) * \{ */ /* NOTE: just a wrapper around vertex_group_assign_exec(), except we add these to a new group */ -static int vertex_group_assign_new_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_group_assign_new_exec(bContext *C, wmOperator *op) { /* create new group... */ Object *ob = context_object(C); @@ -2786,7 +2786,7 @@ void OBJECT_OT_vertex_group_assign_new(wmOperatorType *ot) /** \name Vertex Group Remove From Operator * \{ */ -static int vertex_group_remove_from_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_group_remove_from_exec(bContext *C, wmOperator *op) { const bool use_all_groups = RNA_boolean_get(op->ptr, "use_all_groups"); const bool use_all_verts = RNA_boolean_get(op->ptr, "use_all_verts"); @@ -2857,7 +2857,7 @@ void OBJECT_OT_vertex_group_remove_from(wmOperatorType *ot) /** \name Vertex Group Select Operator * \{ */ -static int vertex_group_select_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus vertex_group_select_exec(bContext *C, wmOperator * /*op*/) { const ToolSettings &tool_settings = *CTX_data_scene(C)->toolsettings; Object *ob = context_object(C); @@ -2895,7 +2895,7 @@ void OBJECT_OT_vertex_group_select(wmOperatorType *ot) /** \name Vertex Group Deselect Operator * \{ */ -static int vertex_group_deselect_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus vertex_group_deselect_exec(bContext *C, wmOperator * /*op*/) { const ToolSettings &tool_settings = *CTX_data_scene(C)->toolsettings; Object *ob = context_object(C); @@ -2929,7 +2929,7 @@ void OBJECT_OT_vertex_group_deselect(wmOperatorType *ot) /** \name Vertex Group Copy Operator * \{ */ -static int vertex_group_copy_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus vertex_group_copy_exec(bContext *C, wmOperator * /*op*/) { Object *ob = context_object(C); @@ -2963,7 +2963,7 @@ void OBJECT_OT_vertex_group_copy(wmOperatorType *ot) /** \name Vertex Group Levels Operator * \{ */ -static int vertex_group_levels_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_group_levels_exec(bContext *C, wmOperator *op) { Object *ob = context_object(C); @@ -3014,7 +3014,7 @@ void OBJECT_OT_vertex_group_levels(wmOperatorType *ot) /** \name Vertex Group Normalize Operator * \{ */ -static int vertex_group_normalize_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus vertex_group_normalize_exec(bContext *C, wmOperator * /*op*/) { Object *ob = context_object(C); bool changed; @@ -3080,7 +3080,7 @@ static eVGroupSelect normalize_vertex_group_target(Object *ob) return target_group; } -static int vertex_group_normalize_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_group_normalize_all_exec(bContext *C, wmOperator *op) { Object *ob = context_object(C); @@ -3142,7 +3142,7 @@ void OBJECT_OT_vertex_group_normalize_all(wmOperatorType *ot) /** \name Vertex Group Lock Operator * \{ */ -static int vertex_group_lock_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_group_lock_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); @@ -3256,7 +3256,7 @@ void OBJECT_OT_vertex_group_lock(wmOperatorType *ot) /** \name Vertex Group Invert Operator * \{ */ -static int vertex_group_invert_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_group_invert_exec(bContext *C, wmOperator *op) { Object *ob = context_object(C); bool auto_assign = RNA_boolean_get(op->ptr, "auto_assign"); @@ -3312,7 +3312,7 @@ void OBJECT_OT_vertex_group_invert(wmOperatorType *ot) /** \name Vertex Group Smooth Operator * \{ */ -static int vertex_group_smooth_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_group_smooth_exec(bContext *C, wmOperator *op) { const float fac = RNA_float_get(op->ptr, "factor"); const int repeat = RNA_int_get(op->ptr, "repeat"); @@ -3392,7 +3392,7 @@ void OBJECT_OT_vertex_group_smooth(wmOperatorType *ot) /** \name Vertex Group Clean Operator * \{ */ -static int vertex_group_clean_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_group_clean_exec(bContext *C, wmOperator *op) { const float limit = RNA_float_get(op->ptr, "limit"); const bool keep_single = RNA_boolean_get(op->ptr, "keep_single"); @@ -3454,7 +3454,7 @@ void OBJECT_OT_vertex_group_clean(wmOperatorType *ot) /** \name Vertex Group Quantize Operator * \{ */ -static int vertex_group_quantize_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_group_quantize_exec(bContext *C, wmOperator *op) { Object *ob = context_object(C); @@ -3500,7 +3500,7 @@ void OBJECT_OT_vertex_group_quantize(wmOperatorType *ot) /** \name Vertex Group Limit Total Operator * \{ */ -static int vertex_group_limit_total_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_group_limit_total_exec(bContext *C, wmOperator *op) { const int limit = RNA_int_get(op->ptr, "limit"); const eVGroupSelect subset_type = static_cast( @@ -3565,7 +3565,7 @@ void OBJECT_OT_vertex_group_limit_total(wmOperatorType *ot) /** \name Vertex Group Mirror Operator * \{ */ -static int vertex_group_mirror_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_group_mirror_exec(bContext *C, wmOperator *op) { Object *ob = context_object(C); int totmirr = 0, totfail = 0; @@ -3623,7 +3623,7 @@ void OBJECT_OT_vertex_group_mirror(wmOperatorType *ot) /** \name Vertex Group Copy to Selected Operator * \{ */ -static int vertex_group_copy_to_selected_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_group_copy_to_selected_exec(bContext *C, wmOperator *op) { Object *obact = context_object(C); int changed_tot = 0; @@ -3677,7 +3677,7 @@ void OBJECT_OT_vertex_group_copy_to_selected(wmOperatorType *ot) /** \name Vertex Group Set Active Operator * \{ */ -static int set_active_group_exec(bContext *C, wmOperator *op) +static wmOperatorStatus set_active_group_exec(bContext *C, wmOperator *op) { Object *ob = context_object(C); int nr = RNA_enum_get(op->ptr, "group"); @@ -3775,7 +3775,7 @@ static char *vgroup_init_remap(Object *ob) return name_array; } -static int vgroup_do_remap(Object *ob, const char *name_array, wmOperator *op) +static wmOperatorStatus vgroup_do_remap(Object *ob, const char *name_array, wmOperator *op) { MDeformVert *dvert = nullptr; const bDeformGroup *def; @@ -3899,11 +3899,11 @@ enum { SORT_TYPE_BONEHIERARCHY = 1, }; -static int vertex_group_sort_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_group_sort_exec(bContext *C, wmOperator *op) { Object *ob = context_object(C); char *name_array; - int ret; + wmOperatorStatus ret; int sort_type = RNA_enum_get(op->ptr, "sort_type"); /* Init remapping. */ @@ -3964,13 +3964,13 @@ void OBJECT_OT_vertex_group_sort(wmOperatorType *ot) /** \name Vertex Group Move Operator * \{ */ -static int vgroup_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vgroup_move_exec(bContext *C, wmOperator *op) { Object *ob = context_object(C); bDeformGroup *def; char *name_array; int dir = RNA_enum_get(op->ptr, "direction"); - int ret = OPERATOR_FINISHED; + wmOperatorStatus ret = OPERATOR_FINISHED; ListBase *defbase = BKE_object_defgroup_list_mutable(ob); @@ -4113,7 +4113,7 @@ static bool check_vertex_group_accessible(wmOperator *op, Object *ob, int def_nr return true; } -static int vertex_weight_paste_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_weight_paste_exec(bContext *C, wmOperator *op) { Object *ob = context_object(C); const int def_nr = RNA_int_get(op->ptr, "weight_group"); @@ -4164,7 +4164,7 @@ void OBJECT_OT_vertex_weight_paste(wmOperatorType *ot) /** \name Vertex Group Weight Delete Operator * \{ */ -static int vertex_weight_delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_weight_delete_exec(bContext *C, wmOperator *op) { Object *ob = context_object(C); const int def_nr = RNA_int_get(op->ptr, "weight_group"); @@ -4214,7 +4214,7 @@ void OBJECT_OT_vertex_weight_delete(wmOperatorType *ot) /** \name Vertex Group Set Active by Weight Operator * \{ */ -static int vertex_weight_set_active_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_weight_set_active_exec(bContext *C, wmOperator *op) { Object *ob = context_object(C); const int wg_index = RNA_int_get(op->ptr, "weight_group"); @@ -4261,7 +4261,8 @@ void OBJECT_OT_vertex_weight_set_active(wmOperatorType *ot) /** \name Vertex Group Normalize Active Vertex Operator * \{ */ -static int vertex_weight_normalize_active_vertex_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus vertex_weight_normalize_active_vertex_exec(bContext *C, + wmOperator * /*op*/) { Object *ob = context_object(C); ToolSettings *ts = CTX_data_tool_settings(C); @@ -4300,7 +4301,7 @@ void OBJECT_OT_vertex_weight_normalize_active_vertex(wmOperatorType *ot) /** \name Vertex Group Copy Weights from Active Operator * \{ */ -static int vertex_weight_copy_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus vertex_weight_copy_exec(bContext *C, wmOperator * /*op*/) { Object *ob = context_object(C); ToolSettings *ts = CTX_data_tool_settings(C); diff --git a/source/blender/editors/object/object_visual_geometry_to_objects.cc b/source/blender/editors/object/object_visual_geometry_to_objects.cc index ca9d8c7c3cf..4f4c5420bba 100644 --- a/source/blender/editors/object/object_visual_geometry_to_objects.cc +++ b/source/blender/editors/object/object_visual_geometry_to_objects.cc @@ -439,7 +439,7 @@ static Vector find_collections_containing_object(Main &bmain, return collections.extract_vector(); } -static int visual_geometry_to_objects_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus visual_geometry_to_objects_exec(bContext *C, wmOperator * /*op*/) { Main &bmain = *CTX_data_main(C); Scene &scene = *CTX_data_scene(C); diff --git a/source/blender/editors/object/object_volume.cc b/source/blender/editors/object/object_volume.cc index b871937847e..c9e210454f0 100644 --- a/source/blender/editors/object/object_volume.cc +++ b/source/blender/editors/object/object_volume.cc @@ -47,7 +47,7 @@ static Object *object_volume_add(bContext *C, wmOperator *op, const char *name) return add_type(C, OB_VOLUME, name, loc, rot, false, local_view_bits); } -static int object_volume_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_volume_add_exec(bContext *C, wmOperator *op) { return (object_volume_add(C, op, nullptr) != nullptr) ? OPERATOR_FINISHED : OPERATOR_CANCELLED; } @@ -71,7 +71,7 @@ void OBJECT_OT_volume_add(wmOperatorType *ot) /* Volume Import */ -static int volume_import_exec(bContext *C, wmOperator *op) +static wmOperatorStatus volume_import_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); const bool is_relative_path = RNA_boolean_get(op->ptr, "relative_path"); @@ -131,7 +131,9 @@ static int volume_import_exec(bContext *C, wmOperator *op) return (imported) ? OPERATOR_FINISHED : OPERATOR_CANCELLED; } -static int volume_import_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus volume_import_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (RNA_struct_property_is_set(op->ptr, "filepath")) { return volume_import_exec(C, op); diff --git a/source/blender/editors/object/object_warp.cc b/source/blender/editors/object/object_warp.cc index bf7332602ca..869dc616e8e 100644 --- a/source/blender/editors/object/object_warp.cc +++ b/source/blender/editors/object/object_warp.cc @@ -153,7 +153,7 @@ static void object_warp_transverts(TransVertStore *tvs, } } -static int object_warp_verts_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_warp_verts_exec(bContext *C, wmOperator *op) { const float warp_angle = RNA_float_get(op->ptr, "warp_angle"); const float offset_angle = RNA_float_get(op->ptr, "offset_angle"); diff --git a/source/blender/editors/physics/dynamicpaint_ops.cc b/source/blender/editors/physics/dynamicpaint_ops.cc index 29b10afcb69..1f7403ac416 100644 --- a/source/blender/editors/physics/dynamicpaint_ops.cc +++ b/source/blender/editors/physics/dynamicpaint_ops.cc @@ -49,7 +49,7 @@ #include "physics_intern.hh" /* own include */ -static int surface_slot_add_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus surface_slot_add_exec(bContext *C, wmOperator * /*op*/) { DynamicPaintModifierData *pmd = nullptr; Object *cObject = blender::ed::object::context_active_object(C); @@ -92,7 +92,7 @@ void DPAINT_OT_surface_slot_add(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int surface_slot_remove_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus surface_slot_remove_exec(bContext *C, wmOperator * /*op*/) { DynamicPaintModifierData *pmd = nullptr; Object *obj_ctx = blender::ed::object::context_active_object(C); @@ -140,7 +140,7 @@ void DPAINT_OT_surface_slot_remove(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int type_toggle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus type_toggle_exec(bContext *C, wmOperator *op) { Object *cObject = blender::ed::object::context_active_object(C); @@ -202,7 +202,7 @@ void DPAINT_OT_type_toggle(wmOperatorType *ot) ot->prop = prop; } -static int output_toggle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus output_toggle_exec(bContext *C, wmOperator *op) { Object *ob = blender::ed::object::context_active_object(C); DynamicPaintSurface *surface; @@ -456,7 +456,7 @@ static void dpaint_bake_startjob(void *customdata, wmJobWorkerStatus *worker_sta /* * Bake Dynamic Paint image sequence surface */ -static int dynamicpaint_bake_exec(bContext *C, wmOperator *op) +static wmOperatorStatus dynamicpaint_bake_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Object *ob_ = blender::ed::object::context_active_object(C); diff --git a/source/blender/editors/physics/particle_boids.cc b/source/blender/editors/physics/particle_boids.cc index 66fb5aa42c8..7510d37434d 100644 --- a/source/blender/editors/physics/particle_boids.cc +++ b/source/blender/editors/physics/particle_boids.cc @@ -31,7 +31,7 @@ #include "physics_intern.hh" /************************ add/del boid rule operators *********************/ -static int rule_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus rule_add_exec(bContext *C, wmOperator *op) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_settings", &RNA_ParticleSettings); ParticleSettings *part = static_cast(ptr.data); @@ -76,7 +76,7 @@ void BOID_OT_rule_add(wmOperatorType *ot) ot->prop = RNA_def_enum(ot->srna, "type", rna_enum_boidrule_type_items, 0, "Type", ""); } -static int rule_del_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus rule_del_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_settings", &RNA_ParticleSettings); @@ -124,7 +124,7 @@ void BOID_OT_rule_del(wmOperatorType *ot) } /************************ move up/down boid rule operators *********************/ -static int rule_move_up_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus rule_move_up_exec(bContext *C, wmOperator * /*op*/) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_settings", &RNA_ParticleSettings); ParticleSettings *part = static_cast(ptr.data); @@ -160,7 +160,7 @@ void BOID_OT_rule_move_up(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int rule_move_down_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus rule_move_down_exec(bContext *C, wmOperator * /*op*/) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_settings", &RNA_ParticleSettings); ParticleSettings *part = static_cast(ptr.data); @@ -197,7 +197,7 @@ void BOID_OT_rule_move_down(wmOperatorType *ot) } /************************ add/del boid state operators *********************/ -static int state_add_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus state_add_exec(bContext *C, wmOperator * /*op*/) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_settings", &RNA_ParticleSettings); ParticleSettings *part = static_cast(ptr.data); @@ -232,7 +232,7 @@ void BOID_OT_state_add(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int state_del_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus state_del_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_settings", &RNA_ParticleSettings); @@ -283,7 +283,7 @@ void BOID_OT_state_del(wmOperatorType *ot) } /************************ move up/down boid state operators *********************/ -static int state_move_up_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus state_move_up_exec(bContext *C, wmOperator * /*op*/) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_settings", &RNA_ParticleSettings); ParticleSettings *part = static_cast(ptr.data); @@ -318,7 +318,7 @@ void BOID_OT_state_move_up(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int state_move_down_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus state_move_down_exec(bContext *C, wmOperator * /*op*/) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_settings", &RNA_ParticleSettings); ParticleSettings *part = static_cast(ptr.data); diff --git a/source/blender/editors/physics/particle_edit.cc b/source/blender/editors/physics/particle_edit.cc index 20bc97fef5c..ef7412aa5ec 100644 --- a/source/blender/editors/physics/particle_edit.cc +++ b/source/blender/editors/physics/particle_edit.cc @@ -1773,7 +1773,7 @@ static bool select_action_apply(PTCacheEditPoint *point, PTCacheEditKey *key, in return changed; } -static int pe_select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pe_select_all_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -1971,7 +1971,7 @@ static void select_root(PEData *data, int point_index) } } -static int select_roots_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_roots_exec(bContext *C, wmOperator *op) { PEData data; int action = RNA_enum_get(op->ptr, "action"); @@ -2044,7 +2044,7 @@ static void select_tip(PEData *data, int point_index) } } -static int select_tips_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_tips_exec(bContext *C, wmOperator *op) { PEData data; int action = RNA_enum_get(op->ptr, "action"); @@ -2104,7 +2104,7 @@ static const EnumPropertyItem select_random_type_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int select_random_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_random_exec(bContext *C, wmOperator *op) { PEData data; int type; @@ -2187,7 +2187,7 @@ void PARTICLE_OT_select_random(wmOperatorType *ot) /** \name Select Linked operator * \{ */ -static int select_linked_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus select_linked_exec(bContext *C, wmOperator * /*op*/) { PEData data; PE_set_data(C, &data); @@ -2218,7 +2218,7 @@ void PARTICLE_OT_select_linked(wmOperatorType *ot) /* properties */ } -static int select_linked_pick_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_linked_pick_exec(bContext *C, wmOperator *op) { PEData data; int mval[2]; @@ -2241,7 +2241,9 @@ static int select_linked_pick_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus select_linked_pick_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { RNA_int_set_array(op->ptr, "location", event->mval); return select_linked_pick_exec(C, op); @@ -2504,7 +2506,7 @@ int PE_lasso_select(bContext *C, const int mcoords[][2], const int mcoords_len, /** \name Hide Operator * \{ */ -static int hide_exec(bContext *C, wmOperator *op) +static wmOperatorStatus hide_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); Scene *scene = CTX_data_scene(C); @@ -2566,7 +2568,7 @@ void PARTICLE_OT_hide(wmOperatorType *ot) /** \name Reveal Operator * \{ */ -static int reveal_exec(bContext *C, wmOperator *op) +static wmOperatorStatus reveal_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); Scene *scene = CTX_data_scene(C); @@ -2650,7 +2652,7 @@ static void select_less_keys(PEData *data, int point_index) } } -static int select_less_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus select_less_exec(bContext *C, wmOperator * /*op*/) { PEData data; @@ -2722,7 +2724,7 @@ static void select_more_keys(PEData *data, int point_index) } } -static int select_more_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus select_more_exec(bContext *C, wmOperator * /*op*/) { PEData data; @@ -2823,7 +2825,7 @@ static void rekey_particle(PEData *data, int pa_index) point->flag |= PEP_EDIT_RECALC; } -static int rekey_exec(bContext *C, wmOperator *op) +static wmOperatorStatus rekey_exec(bContext *C, wmOperator *op) { PEData data; @@ -3197,7 +3199,7 @@ static void subdivide_particle(PEData *data, int pa_index) pa->flag &= ~PARS_REKEY; } -static int subdivide_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus subdivide_exec(bContext *C, wmOperator * /*op*/) { PEData data; @@ -3234,7 +3236,7 @@ void PARTICLE_OT_subdivide(wmOperatorType *ot) /** \name Remove Doubles Operator * \{ */ -static int remove_doubles_exec(bContext *C, wmOperator *op) +static wmOperatorStatus remove_doubles_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); Scene *scene = CTX_data_scene(C); @@ -3337,7 +3339,7 @@ void PARTICLE_OT_remove_doubles(wmOperatorType *ot) 0.1f); } -static int weight_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus weight_set_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); Scene *scene = CTX_data_scene(C); @@ -3473,7 +3475,7 @@ static void set_delete_particle_key(PEData *data, int pa_index, int key_index, b edit->points[pa_index].keys[key_index].flag |= PEK_TAG; } -static int delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus delete_exec(bContext *C, wmOperator *op) { PEData data; int type = RNA_enum_get(op->ptr, "type"); @@ -3692,7 +3694,7 @@ static void PE_mirror_x(Depsgraph *depsgraph, Scene *scene, Object *ob, int tagg MEM_freeN(mirrorfaces); } -static int mirror_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus mirror_exec(bContext *C, wmOperator * /*op*/) { Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); Scene *scene = CTX_data_scene(C); @@ -4994,7 +4996,7 @@ static void brush_edit_exit(wmOperator *op) MEM_freeN(bedit); } -static int brush_edit_exec(bContext *C, wmOperator *op) +static wmOperatorStatus brush_edit_exec(bContext *C, wmOperator *op) { if (!brush_edit_init(C, op)) { return OPERATOR_CANCELLED; @@ -5026,7 +5028,7 @@ static void brush_edit_apply_event(bContext *C, wmOperator *op, const wmEvent *e brush_edit_apply(C, op, &itemptr); } -static int brush_edit_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus brush_edit_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (!brush_edit_init(C, op)) { return OPERATOR_CANCELLED; @@ -5041,7 +5043,7 @@ static int brush_edit_invoke(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int brush_edit_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus brush_edit_modal(bContext *C, wmOperator *op, const wmEvent *event) { switch (event->type) { case LEFTMOUSE: @@ -5224,7 +5226,7 @@ static void shape_cut(PEData *data, int pa_index) } } -static int shape_cut_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus shape_cut_exec(bContext *C, wmOperator * /*op*/) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Scene *scene = CTX_data_scene(C); @@ -5532,7 +5534,7 @@ void ED_object_particle_edit_mode_exit(bContext *C) ED_object_particle_edit_mode_exit_ex(scene, ob); } -static int particle_edit_toggle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus particle_edit_toggle_exec(bContext *C, wmOperator *op) { wmMsgBus *mbus = CTX_wm_message_bus(C); Scene *scene = CTX_data_scene(C); @@ -5582,7 +5584,7 @@ void PARTICLE_OT_particle_edit_toggle(wmOperatorType *ot) /** \name Set Editable Operator * \{ */ -static int clear_edited_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus clear_edited_exec(bContext *C, wmOperator * /*op*/) { Object *ob = CTX_data_active_object(C); ParticleSystem *psys = psys_get_current(ob); @@ -5706,7 +5708,7 @@ static void scale_points_to_length(PTCacheEdit *edit, float length) recalc_lengths(edit); } -static int unify_length_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus unify_length_exec(bContext *C, wmOperator * /*op*/) { Object *ob = CTX_data_active_object(C); Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/physics/particle_object.cc b/source/blender/editors/physics/particle_object.cc index d836906e446..c33c03cba06 100644 --- a/source/blender/editors/physics/particle_object.cc +++ b/source/blender/editors/physics/particle_object.cc @@ -66,7 +66,7 @@ static float I[4][4] = { /********************** particle system slot operators *********************/ -static int particle_system_add_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus particle_system_add_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Object *ob = blender::ed::object::context_object(C); @@ -99,7 +99,7 @@ void OBJECT_OT_particle_system_add(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int particle_system_remove_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus particle_system_remove_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Object *ob = blender::ed::object::context_object(C); @@ -156,7 +156,7 @@ static bool psys_poll(bContext *C) return (ptr.data != nullptr); } -static int new_particle_settings_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus new_particle_settings_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); ParticleSystem *psys; @@ -212,7 +212,7 @@ void PARTICLE_OT_new(wmOperatorType *ot) /********************** keyed particle target operators *********************/ -static int new_particle_target_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus new_particle_target_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); @@ -259,7 +259,7 @@ void PARTICLE_OT_new_target(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int remove_particle_target_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus remove_particle_target_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); @@ -310,7 +310,7 @@ void PARTICLE_OT_target_remove(wmOperatorType *ot) /************************ move up particle target operator *********************/ -static int target_move_up_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus target_move_up_exec(bContext *C, wmOperator * /*op*/) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys = static_cast(ptr.data); @@ -350,7 +350,7 @@ void PARTICLE_OT_target_move_up(wmOperatorType *ot) /************************ move down particle target operator *********************/ -static int target_move_down_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus target_move_down_exec(bContext *C, wmOperator * /*op*/) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys = static_cast(ptr.data); @@ -389,7 +389,7 @@ void PARTICLE_OT_target_move_down(wmOperatorType *ot) /************************ refresh dupli objects *********************/ -static int dupliob_refresh_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus dupliob_refresh_exec(bContext *C, wmOperator * /*op*/) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys = static_cast(ptr.data); @@ -419,7 +419,7 @@ void PARTICLE_OT_dupliob_refresh(wmOperatorType *ot) /************************ move up particle dupli-weight operator *********************/ -static int dupliob_move_up_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus dupliob_move_up_exec(bContext *C, wmOperator * /*op*/) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys = static_cast(ptr.data); @@ -458,7 +458,7 @@ void PARTICLE_OT_dupliob_move_up(wmOperatorType *ot) /********************** particle dupliweight operators *********************/ -static int copy_particle_dupliob_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus copy_particle_dupliob_exec(bContext *C, wmOperator * /*op*/) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys = static_cast(ptr.data); @@ -498,7 +498,7 @@ void PARTICLE_OT_dupliob_copy(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int remove_particle_dupliob_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus remove_particle_dupliob_exec(bContext *C, wmOperator * /*op*/) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys = static_cast(ptr.data); @@ -544,7 +544,7 @@ void PARTICLE_OT_dupliob_remove(wmOperatorType *ot) /************************ move down particle dupliweight operator *********************/ -static int dupliob_move_down_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus dupliob_move_down_exec(bContext *C, wmOperator * /*op*/) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys = static_cast(ptr.data); @@ -637,7 +637,7 @@ static void disconnect_hair(Depsgraph *depsgraph, Scene *scene, Object *ob, Part PE_update_object(depsgraph, scene, ob, 0); } -static int disconnect_hair_exec(bContext *C, wmOperator *op) +static wmOperatorStatus disconnect_hair_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Scene *scene = CTX_data_scene(C); @@ -933,7 +933,7 @@ static bool connect_hair(Depsgraph *depsgraph, Scene *scene, Object *ob, Particl return ok; } -static int connect_hair_exec(bContext *C, wmOperator *op) +static wmOperatorStatus connect_hair_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Scene *scene = CTX_data_scene(C); @@ -1232,7 +1232,7 @@ static bool copy_particle_systems_poll(bContext *C) return true; } -static int copy_particle_systems_exec(bContext *C, wmOperator *op) +static wmOperatorStatus copy_particle_systems_exec(bContext *C, wmOperator *op) { const int space = RNA_enum_get(op->ptr, "space"); const bool remove_target_particles = RNA_boolean_get(op->ptr, "remove_target_particles"); @@ -1341,7 +1341,7 @@ static bool duplicate_particle_systems_poll(bContext *C) return true; } -static int duplicate_particle_systems_exec(bContext *C, wmOperator *op) +static wmOperatorStatus duplicate_particle_systems_exec(bContext *C, wmOperator *op) { const bool duplicate_settings = RNA_boolean_get(op->ptr, "use_duplicate_settings"); Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/physics/physics_fluid.cc b/source/blender/editors/physics/physics_fluid.cc index c21a5ad939d..ea4d014c623 100644 --- a/source/blender/editors/physics/physics_fluid.cc +++ b/source/blender/editors/physics/physics_fluid.cc @@ -508,7 +508,7 @@ static void fluid_free_startjob(void *customdata, wmJobWorkerStatus *worker_stat /***************************** Operators ******************************/ -static int fluid_bake_exec(bContext *C, wmOperator *op) +static wmOperatorStatus fluid_bake_exec(bContext *C, wmOperator *op) { FluidJob *job = static_cast(MEM_mallocN(sizeof(FluidJob), "FluidJob")); char error_msg[256] = "\0"; @@ -534,7 +534,7 @@ static int fluid_bake_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int fluid_bake_invoke(bContext *C, wmOperator *op, const wmEvent * /*_event*/) +static wmOperatorStatus fluid_bake_invoke(bContext *C, wmOperator *op, const wmEvent * /*_event*/) { Scene *scene = CTX_data_scene(C); FluidJob *job = static_cast(MEM_mallocN(sizeof(FluidJob), "FluidJob")); @@ -575,7 +575,7 @@ static int fluid_bake_invoke(bContext *C, wmOperator *op, const wmEvent * /*_eve return OPERATOR_RUNNING_MODAL; } -static int fluid_bake_modal(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus fluid_bake_modal(bContext *C, wmOperator * /*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_SIM_FLUID)) { @@ -589,7 +589,7 @@ static int fluid_bake_modal(bContext *C, wmOperator * /*op*/, const wmEvent *eve return OPERATOR_PASS_THROUGH; } -static int fluid_free_exec(bContext *C, wmOperator *op) +static wmOperatorStatus fluid_free_exec(bContext *C, wmOperator *op) { FluidModifierData *fmd = nullptr; FluidDomainSettings *fds; @@ -654,7 +654,7 @@ static int fluid_free_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int fluid_pause_exec(bContext *C, wmOperator *op) +static wmOperatorStatus fluid_pause_exec(bContext *C, wmOperator *op) { FluidModifierData *fmd = nullptr; FluidDomainSettings *fds; diff --git a/source/blender/editors/physics/physics_pointcache.cc b/source/blender/editors/physics/physics_pointcache.cc index bdbf91262b9..0ec9576e440 100644 --- a/source/blender/editors/physics/physics_pointcache.cc +++ b/source/blender/editors/physics/physics_pointcache.cc @@ -199,7 +199,7 @@ static PTCacheBaker *ptcache_baker_create(bContext *C, wmOperator *op, bool all) return baker; } -static int ptcache_bake_exec(bContext *C, wmOperator *op) +static wmOperatorStatus ptcache_bake_exec(bContext *C, wmOperator *op) { bool all = STREQ(op->type->idname, "PTCACHE_OT_bake_all"); @@ -210,7 +210,7 @@ static int ptcache_bake_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int ptcache_bake_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus ptcache_bake_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { bool all = STREQ(op->type->idname, "PTCACHE_OT_bake_all"); @@ -244,7 +244,7 @@ static int ptcache_bake_invoke(bContext *C, wmOperator *op, const wmEvent * /*ev return OPERATOR_RUNNING_MODAL; } -static int ptcache_bake_modal(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus ptcache_bake_modal(bContext *C, wmOperator *op, const wmEvent * /*event*/) { Scene *scene = (Scene *)op->customdata; @@ -265,7 +265,7 @@ static void ptcache_bake_cancel(bContext *C, wmOperator *op) WM_jobs_kill_type(wm, scene, WM_JOB_TYPE_POINTCACHE); } -static int ptcache_free_bake_all_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus ptcache_free_bake_all_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ListBase pidlist; @@ -322,7 +322,7 @@ void PTCACHE_OT_free_bake_all(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int ptcache_free_bake_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus ptcache_free_bake_exec(bContext *C, wmOperator * /*op*/) { PointerRNA ptr = CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache); PointCache *cache = static_cast(ptr.data); @@ -334,7 +334,7 @@ static int ptcache_free_bake_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -static int ptcache_bake_from_cache_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus ptcache_bake_from_cache_exec(bContext *C, wmOperator * /*op*/) { PointerRNA ptr = CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache); PointCache *cache = static_cast(ptr.data); @@ -394,7 +394,7 @@ void PTCACHE_OT_bake_from_cache(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int ptcache_add_new_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus ptcache_add_new_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache); @@ -414,7 +414,7 @@ static int ptcache_add_new_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -static int ptcache_remove_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus ptcache_remove_exec(bContext *C, wmOperator * /*op*/) { PointerRNA ptr = CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache); Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/physics/rigidbody_constraint.cc b/source/blender/editors/physics/rigidbody_constraint.cc index 47d79e5c395..1ee85c135f3 100644 --- a/source/blender/editors/physics/rigidbody_constraint.cc +++ b/source/blender/editors/physics/rigidbody_constraint.cc @@ -119,7 +119,7 @@ void ED_rigidbody_constraint_remove(Main *bmain, Scene *scene, Object *ob) /* ************ Add Rigid Body Constraint ************** */ -static int rigidbody_con_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus rigidbody_con_add_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -173,7 +173,7 @@ void RIGIDBODY_OT_constraint_add(wmOperatorType *ot) /* ************ Remove Rigid Body Constraint ************** */ -static int rigidbody_con_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus rigidbody_con_remove_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/physics/rigidbody_object.cc b/source/blender/editors/physics/rigidbody_object.cc index 488d13885bf..3b0a2ae7e8d 100644 --- a/source/blender/editors/physics/rigidbody_object.cc +++ b/source/blender/editors/physics/rigidbody_object.cc @@ -101,7 +101,7 @@ void ED_rigidbody_object_remove(Main *bmain, Scene *scene, Object *ob) /* ************ Add Rigid Body ************** */ -static int rigidbody_object_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus rigidbody_object_add_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -148,7 +148,7 @@ void RIGIDBODY_OT_object_add(wmOperatorType *ot) /* ************ Remove Rigid Body ************** */ -static int rigidbody_object_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus rigidbody_object_remove_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -194,7 +194,7 @@ void RIGIDBODY_OT_object_remove(wmOperatorType *ot) /* ************ Add Rigid Bodies ************** */ -static int rigidbody_objects_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus rigidbody_objects_add_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -243,7 +243,7 @@ void RIGIDBODY_OT_objects_add(wmOperatorType *ot) /* ************ Remove Rigid Bodies ************** */ -static int rigidbody_objects_remove_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus rigidbody_objects_remove_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -289,7 +289,7 @@ void RIGIDBODY_OT_objects_remove(wmOperatorType *ot) /* ************ Change Collision Shapes ************** */ -static int rigidbody_objects_shape_change_exec(bContext *C, wmOperator *op) +static wmOperatorStatus rigidbody_objects_shape_change_exec(bContext *C, wmOperator *op) { int shape = RNA_enum_get(op->ptr, "type"); bool changed = false; @@ -449,7 +449,7 @@ static const EnumPropertyItem *rigidbody_materials_itemf(bContext * /*C*/, /* ------------------------------------------ */ -static int rigidbody_objects_calc_mass_exec(bContext *C, wmOperator *op) +static wmOperatorStatus rigidbody_objects_calc_mass_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); int material = RNA_enum_get(op->ptr, "material"); diff --git a/source/blender/editors/physics/rigidbody_world.cc b/source/blender/editors/physics/rigidbody_world.cc index e846677a9dc..dbd1a13f72f 100644 --- a/source/blender/editors/physics/rigidbody_world.cc +++ b/source/blender/editors/physics/rigidbody_world.cc @@ -53,7 +53,7 @@ static bool ED_rigidbody_world_add_poll(bContext *C) /* ********** Add RigidBody World **************** */ -static int rigidbody_world_add_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus rigidbody_world_add_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -87,7 +87,7 @@ void RIGIDBODY_OT_world_add(wmOperatorType *ot) /* ********** Remove RigidBody World ************* */ -static int rigidbody_world_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus rigidbody_world_remove_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -129,7 +129,7 @@ void RIGIDBODY_OT_world_remove(wmOperatorType *ot) /* ********** Export RigidBody World ************* */ -static int rigidbody_world_export_exec(bContext *C, wmOperator *op) +static wmOperatorStatus rigidbody_world_export_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); RigidBodyWorld *rbw = scene->rigidbody_world; @@ -154,7 +154,9 @@ static int rigidbody_world_export_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int rigidbody_world_export_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus rigidbody_world_export_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (!RNA_struct_property_is_set(op->ptr, "relative_path")) { RNA_boolean_set(op->ptr, "relative_path", (U.flag & USER_RELPATHS) != 0); diff --git a/source/blender/editors/pointcloud/intern/attribute_set.cc b/source/blender/editors/pointcloud/intern/attribute_set.cc index c188f26f5b8..d0385a5dfe5 100644 --- a/source/blender/editors/pointcloud/intern/attribute_set.cc +++ b/source/blender/editors/pointcloud/intern/attribute_set.cc @@ -76,7 +76,7 @@ static void validate_value(const bke::AttributeAccessor attributes, type.copy_assign(validated_buffer, buffer); } -static int set_attribute_exec(bContext *C, wmOperator *op) +static wmOperatorStatus set_attribute_exec(bContext *C, wmOperator *op) { Object *active_object = CTX_data_active_object(C); PointCloud &active_pointcloud = *static_cast(active_object->data); @@ -130,7 +130,7 @@ static int set_attribute_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int set_attribute_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus set_attribute_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Object *active_object = CTX_data_active_object(C); PointCloud &active_pointcloud = *static_cast(active_object->data); diff --git a/source/blender/editors/pointcloud/intern/duplicate.cc b/source/blender/editors/pointcloud/intern/duplicate.cc index ec2f164793e..80f6a7578a2 100644 --- a/source/blender/editors/pointcloud/intern/duplicate.cc +++ b/source/blender/editors/pointcloud/intern/duplicate.cc @@ -32,7 +32,7 @@ static void duplicate_points(PointCloud &pointcloud, const IndexMask &mask) BKE_pointcloud_nomain_to_pointcloud(new_pointcloud, &pointcloud); } -static int duplicate_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus duplicate_exec(bContext *C, wmOperator * /*op*/) { for (PointCloud *pointcloud : get_unique_editable_pointclouds(*C)) { IndexMaskMemory memory; diff --git a/source/blender/editors/pointcloud/intern/join.cc b/source/blender/editors/pointcloud/intern/join.cc index a7eba773245..179da6e05a0 100644 --- a/source/blender/editors/pointcloud/intern/join.cc +++ b/source/blender/editors/pointcloud/intern/join.cc @@ -24,7 +24,7 @@ namespace blender::ed::pointcloud { -int join_objects_exec(bContext *C, wmOperator *op) +wmOperatorStatus join_objects_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/pointcloud/intern/operators.cc b/source/blender/editors/pointcloud/intern/operators.cc index 1fcea6b725f..79cb6dd73d7 100644 --- a/source/blender/editors/pointcloud/intern/operators.cc +++ b/source/blender/editors/pointcloud/intern/operators.cc @@ -102,7 +102,7 @@ static bool has_anything_selected(const Span pointclouds) }); } -static int select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_all_exec(bContext *C, wmOperator *op) { int action = RNA_enum_get(op->ptr, "action"); @@ -139,7 +139,7 @@ static void POINTCLOUD_OT_select_all(wmOperatorType *ot) WM_operator_properties_select_all(ot); } -static int select_random_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_random_exec(bContext *C, wmOperator *op) { const int seed = RNA_int_get(op->ptr, "seed"); const float probability = RNA_float_get(op->ptr, "probability"); @@ -209,7 +209,7 @@ static void POINTCLOUD_OT_select_random(wmOperatorType *ot) namespace pointcloud_delete { -static int delete_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus delete_exec(bContext *C, wmOperator * /*op*/) { for (PointCloud *pointcloud : get_unique_editable_pointclouds(*C)) { if (remove_selection(*pointcloud)) { diff --git a/source/blender/editors/pointcloud/intern/separate.cc b/source/blender/editors/pointcloud/intern/separate.cc index a5d2d2963dc..965deeab3d4 100644 --- a/source/blender/editors/pointcloud/intern/separate.cc +++ b/source/blender/editors/pointcloud/intern/separate.cc @@ -25,7 +25,7 @@ namespace blender::ed::pointcloud { -static int separate_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus separate_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/render/render_internal.cc b/source/blender/editors/render/render_internal.cc index f142fb83454..d67dd6016de 100644 --- a/source/blender/editors/render/render_internal.cc +++ b/source/blender/editors/render/render_internal.cc @@ -295,7 +295,7 @@ static void screen_render_single_layer_set( } /* executes blocking render */ -static int screen_render_exec(bContext *C, wmOperator *op) +static wmOperatorStatus screen_render_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); RenderEngineType *re_type = RE_engines_find(scene->r.engine); @@ -890,7 +890,7 @@ static void render_drawlock(void *rjv, bool lock) } /** Catch escape key to cancel. */ -static int screen_render_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus screen_render_modal(bContext *C, wmOperator *op, const wmEvent *event) { Scene *scene = (Scene *)op->customdata; @@ -958,7 +958,7 @@ static void clean_viewport_memory(Main *bmain, Scene *scene) } /* using context, starts job */ -static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *event) { /* new render clears all callbacks */ Main *bmain = CTX_data_main(C); @@ -1224,7 +1224,7 @@ Scene *ED_render_job_get_current_scene(const bContext *C) /* Motion blur curve preset */ -static int render_shutter_curve_preset_exec(bContext *C, wmOperator *op) +static wmOperatorStatus render_shutter_curve_preset_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); CurveMapping *mblur_shutter_curve = &scene->r.mblur_shutter_curve; diff --git a/source/blender/editors/render/render_opengl.cc b/source/blender/editors/render/render_opengl.cc index a6b6b4f2a69..0bb380b1bce 100644 --- a/source/blender/editors/render/render_opengl.cc +++ b/source/blender/editors/render/render_opengl.cc @@ -1196,7 +1196,9 @@ finally: /* Step the frame and bail early if needed */ return true; } -static int screen_opengl_render_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus screen_opengl_render_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { OGLRender *oglrender = static_cast(op->customdata); @@ -1261,7 +1263,9 @@ static void opengl_render_freejob(void *customdata) screen_opengl_render_end(oglrender); } -static int screen_opengl_render_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus screen_opengl_render_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { const bool anim = RNA_boolean_get(op->ptr, "animation"); @@ -1305,7 +1309,7 @@ static int screen_opengl_render_invoke(bContext *C, wmOperator *op, const wmEven } /* executes blocking render */ -static int screen_opengl_render_exec(bContext *C, wmOperator *op) +static wmOperatorStatus screen_opengl_render_exec(bContext *C, wmOperator *op) { if (!screen_opengl_render_init(C, op)) { return OPERATOR_CANCELLED; diff --git a/source/blender/editors/render/render_shading.cc b/source/blender/editors/render/render_shading.cc index 110b66cdbcd..aca92a62a10 100644 --- a/source/blender/editors/render/render_shading.cc +++ b/source/blender/editors/render/render_shading.cc @@ -186,7 +186,7 @@ static bool object_materials_supported_poll(bContext *C) /** \name Material Slot Add Operator * \{ */ -static int material_slot_add_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus material_slot_add_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Object *ob = blender::ed::object::context_object(C); @@ -231,7 +231,7 @@ void OBJECT_OT_material_slot_add(wmOperatorType *ot) /** \name Material Slot Remove Operator * \{ */ -static int material_slot_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus material_slot_remove_exec(bContext *C, wmOperator *op) { Object *ob = blender::ed::object::context_object(C); @@ -282,7 +282,7 @@ void OBJECT_OT_material_slot_remove(wmOperatorType *ot) /** \name Material Slot Assign Operator * \{ */ -static int material_slot_assign_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus material_slot_assign_exec(bContext *C, wmOperator * /*op*/) { View3D *v3d = CTX_wm_view3d(C); bool changed_multi = false; @@ -387,7 +387,7 @@ void OBJECT_OT_material_slot_assign(wmOperatorType *ot) /** \name Material Slot (De)Select Operator * \{ */ -static int material_slot_de_select(bContext *C, bool select) +static wmOperatorStatus material_slot_de_select(bContext *C, bool select) { bool changed_multi = false; Object *obact = CTX_data_active_object(C); @@ -475,7 +475,7 @@ static int material_slot_de_select(bContext *C, bool select) return (changed_multi) ? OPERATOR_FINISHED : OPERATOR_CANCELLED; } -static int material_slot_select_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus material_slot_select_exec(bContext *C, wmOperator * /*op*/) { return material_slot_de_select(C, true); } @@ -494,7 +494,7 @@ void OBJECT_OT_material_slot_select(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL; } -static int material_slot_deselect_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus material_slot_deselect_exec(bContext *C, wmOperator * /*op*/) { return material_slot_de_select(C, false); } @@ -519,7 +519,7 @@ void OBJECT_OT_material_slot_deselect(wmOperatorType *ot) /** \name Material Slot Copy Operator * \{ */ -static int material_slot_copy_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus material_slot_copy_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Object *ob = blender::ed::object::context_object(C); @@ -592,7 +592,7 @@ void OBJECT_OT_material_slot_copy(wmOperatorType *ot) /** \name Material Slot Move Operator * \{ */ -static int material_slot_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus material_slot_move_exec(bContext *C, wmOperator *op) { Object *ob = blender::ed::object::context_object(C); @@ -673,7 +673,7 @@ void OBJECT_OT_material_slot_move(wmOperatorType *ot) /** \name Material Slot Remove Unused Operator * \{ */ -static int material_slot_remove_unused_exec(bContext *C, wmOperator *op) +static wmOperatorStatus material_slot_remove_unused_exec(bContext *C, wmOperator *op) { /* Removing material slots in edit mode screws things up, see bug #21822. */ Object *ob_active = CTX_data_active_object(C); @@ -745,7 +745,7 @@ void OBJECT_OT_material_slot_remove_unused(wmOperatorType *ot) /** \name New Material Operator * \{ */ -static int new_material_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus new_material_exec(bContext *C, wmOperator * /*op*/) { Material *ma = static_cast( CTX_data_pointer_get_type(C, "material", &RNA_Material).data); @@ -825,7 +825,7 @@ void MATERIAL_OT_new(wmOperatorType *ot) /** \name New Texture Operator * \{ */ -static int new_texture_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus new_texture_exec(bContext *C, wmOperator * /*op*/) { Tex *tex = static_cast(CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data); Main *bmain = CTX_data_main(C); @@ -882,7 +882,7 @@ void TEXTURE_OT_new(wmOperatorType *ot) /** \name new world operator * \{ */ -static int new_world_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus new_world_exec(bContext *C, wmOperator * /*op*/) { World *wo = static_cast(CTX_data_pointer_get_type(C, "world", &RNA_World).data); Main *bmain = CTX_data_main(C); @@ -943,7 +943,7 @@ void WORLD_OT_new(wmOperatorType *ot) /** \name Render Layer Add Operator * \{ */ -static int view_layer_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_layer_add_exec(bContext *C, wmOperator *op) { wmWindow *win = CTX_wm_window(C); Scene *scene = CTX_data_scene(C); @@ -1011,7 +1011,7 @@ static bool view_layer_remove_poll(bContext *C) return (scene->view_layers.first != scene->view_layers.last); } -static int view_layer_remove_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus view_layer_remove_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1047,7 +1047,7 @@ void SCENE_OT_view_layer_remove(wmOperatorType *ot) /** \name View Layer Add AOV Operator * \{ */ -static int view_layer_add_aov_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus view_layer_add_aov_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1095,7 +1095,7 @@ void SCENE_OT_view_layer_add_aov(wmOperatorType *ot) /** \name View Layer Remove AOV Operator * \{ */ -static int view_layer_remove_aov_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus view_layer_remove_aov_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1147,7 +1147,7 @@ void SCENE_OT_view_layer_remove_aov(wmOperatorType *ot) /** \name View Layer Add Lightgroup Operator * \{ */ -static int view_layer_add_lightgroup_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_layer_add_lightgroup_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1207,7 +1207,7 @@ void SCENE_OT_view_layer_add_lightgroup(wmOperatorType *ot) /** \name View Layer Remove Lightgroup Operator * \{ */ -static int view_layer_remove_lightgroup_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus view_layer_remove_lightgroup_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1267,7 +1267,7 @@ static blender::Set get_used_lightgroups(Scene *scene) return used_lightgroups; } -static int view_layer_add_used_lightgroups_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus view_layer_add_used_lightgroups_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1313,7 +1313,7 @@ void SCENE_OT_view_layer_add_used_lightgroups(wmOperatorType *ot) /** \name View Layer Remove Unused Lightgroups Operator * \{ */ -static int view_layer_remove_unused_lightgroups_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus view_layer_remove_unused_lightgroups_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1430,7 +1430,9 @@ struct BakeOperatorData { std::string report; }; -static int lightprobe_cache_bake_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus lightprobe_cache_bake_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { wmWindowManager *wm = CTX_wm_manager(C); wmWindow *win = CTX_wm_window(C); @@ -1467,7 +1469,9 @@ static int lightprobe_cache_bake_invoke(bContext *C, wmOperator *op, const wmEve return OPERATOR_RUNNING_MODAL; } -static int lightprobe_cache_bake_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus lightprobe_cache_bake_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { BakeOperatorData *data = static_cast(op->customdata); Scene *scene = data->scene; @@ -1504,7 +1508,7 @@ static void lightprobe_cache_bake_cancel(bContext *C, wmOperator *op) } /* Executes blocking bake. */ -static int lightprobe_cache_bake_exec(bContext *C, wmOperator *op) +static wmOperatorStatus lightprobe_cache_bake_exec(bContext *C, wmOperator *op) { ViewLayer *view_layer = CTX_data_view_layer(C); Main *bmain = CTX_data_main(C); @@ -1571,7 +1575,7 @@ void OBJECT_OT_lightprobe_cache_bake(wmOperatorType *ot) /** \name Light Cache Free Operator * \{ */ -static int lightprobe_cache_free_exec(bContext *C, wmOperator *op) +static wmOperatorStatus lightprobe_cache_free_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); @@ -1646,7 +1650,7 @@ static bool render_view_remove_poll(bContext *C) return scene->r.actview > 1; } -static int render_view_add_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus render_view_add_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1682,7 +1686,7 @@ void SCENE_OT_render_view_add(wmOperatorType *ot) /** \name Render View Add Operator * \{ */ -static int render_view_remove_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus render_view_remove_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1750,7 +1754,7 @@ static bool freestyle_active_module_poll(bContext *C) return module != nullptr; } -static int freestyle_module_add_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus freestyle_module_add_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1782,7 +1786,7 @@ void SCENE_OT_freestyle_module_add(wmOperatorType *ot) /** \name Free Style Module Remove Operator * \{ */ -static int freestyle_module_remove_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus freestyle_module_remove_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1812,7 +1816,7 @@ void SCENE_OT_freestyle_module_remove(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL; } -static int freestyle_module_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus freestyle_module_move_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1869,7 +1873,7 @@ void SCENE_OT_freestyle_module_move(wmOperatorType *ot) /** \name Free Style Line Set Add Operator * \{ */ -static int freestyle_lineset_add_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus freestyle_lineset_add_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1914,7 +1918,7 @@ static bool freestyle_active_lineset_poll(bContext *C) return BKE_freestyle_lineset_get_active(&view_layer->freestyle_config) != nullptr; } -static int freestyle_lineset_copy_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus freestyle_lineset_copy_exec(bContext *C, wmOperator * /*op*/) { ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1944,7 +1948,7 @@ void SCENE_OT_freestyle_lineset_copy(wmOperatorType *ot) /** \name Free Style Line Set Paste Operator * \{ */ -static int freestyle_lineset_paste_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus freestyle_lineset_paste_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1978,7 +1982,7 @@ void SCENE_OT_freestyle_lineset_paste(wmOperatorType *ot) /** \name Free Style Line Set Remove Operator * \{ */ -static int freestyle_lineset_remove_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus freestyle_lineset_remove_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -2012,7 +2016,7 @@ void SCENE_OT_freestyle_lineset_remove(wmOperatorType *ot) /** \name Free Style Line Set Move Operator * \{ */ -static int freestyle_lineset_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus freestyle_lineset_move_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -2061,7 +2065,7 @@ void SCENE_OT_freestyle_lineset_move(wmOperatorType *ot) /** \name Free Style Line Set New Operator * \{ */ -static int freestyle_linestyle_new_exec(bContext *C, wmOperator *op) +static wmOperatorStatus freestyle_linestyle_new_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -2105,7 +2109,7 @@ void SCENE_OT_freestyle_linestyle_new(wmOperatorType *ot) /** \name Free Style Modifier Add "Color" Operator * \{ */ -static int freestyle_color_modifier_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus freestyle_color_modifier_add_exec(bContext *C, wmOperator *op) { ViewLayer *view_layer = CTX_data_view_layer(C); FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&view_layer->freestyle_config); @@ -2152,7 +2156,7 @@ void SCENE_OT_freestyle_color_modifier_add(wmOperatorType *ot) /** \name Free Style Modifier Add "Alpha" Operator * \{ */ -static int freestyle_alpha_modifier_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus freestyle_alpha_modifier_add_exec(bContext *C, wmOperator *op) { ViewLayer *view_layer = CTX_data_view_layer(C); FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&view_layer->freestyle_config); @@ -2199,7 +2203,7 @@ void SCENE_OT_freestyle_alpha_modifier_add(wmOperatorType *ot) /** \name Free Style Modifier Add "Thickness" Operator * \{ */ -static int freestyle_thickness_modifier_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus freestyle_thickness_modifier_add_exec(bContext *C, wmOperator *op) { ViewLayer *view_layer = CTX_data_view_layer(C); FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&view_layer->freestyle_config); @@ -2246,7 +2250,7 @@ void SCENE_OT_freestyle_thickness_modifier_add(wmOperatorType *ot) /** \name Free Style Modifier Add "Geometry" Operator * \{ */ -static int freestyle_geometry_modifier_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus freestyle_geometry_modifier_add_exec(bContext *C, wmOperator *op) { ViewLayer *view_layer = CTX_data_view_layer(C); FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&view_layer->freestyle_config); @@ -2310,7 +2314,7 @@ static int freestyle_get_modifier_type(PointerRNA *ptr) return -1; } -static int freestyle_modifier_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus freestyle_modifier_remove_exec(bContext *C, wmOperator *op) { ViewLayer *view_layer = CTX_data_view_layer(C); FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&view_layer->freestyle_config); @@ -2366,7 +2370,7 @@ void SCENE_OT_freestyle_modifier_remove(wmOperatorType *ot) /** \name Free Style Modifier Copy Operator * \{ */ -static int freestyle_modifier_copy_exec(bContext *C, wmOperator *op) +static wmOperatorStatus freestyle_modifier_copy_exec(bContext *C, wmOperator *op) { ViewLayer *view_layer = CTX_data_view_layer(C); FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&view_layer->freestyle_config); @@ -2422,7 +2426,7 @@ void SCENE_OT_freestyle_modifier_copy(wmOperatorType *ot) /** \name Free Style Modifier Move Operator * \{ */ -static int freestyle_modifier_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus freestyle_modifier_move_exec(bContext *C, wmOperator *op) { ViewLayer *view_layer = CTX_data_view_layer(C); FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(&view_layer->freestyle_config); @@ -2497,7 +2501,7 @@ void SCENE_OT_freestyle_modifier_move(wmOperatorType *ot) /** \name Free Style Stroke Material Create Operator * \{ */ -static int freestyle_stroke_material_create_exec(bContext *C, wmOperator *op) +static wmOperatorStatus freestyle_stroke_material_create_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -2535,7 +2539,7 @@ void SCENE_OT_freestyle_stroke_material_create(wmOperatorType *ot) /** \name Texture Slot Move Operator * \{ */ -static int texture_slot_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus texture_slot_move_exec(bContext *C, wmOperator *op) { ID *id = CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).owner_id; @@ -2615,7 +2619,7 @@ void TEXTURE_OT_slot_move(wmOperatorType *ot) /** \name Material Copy Operator * \{ */ -static int copy_material_exec(bContext *C, wmOperator *op) +static wmOperatorStatus copy_material_exec(bContext *C, wmOperator *op) { using namespace blender::bke::blendfile; @@ -2706,7 +2710,7 @@ static int paste_material_nodetree_ids_relink_or_clear(LibraryIDLinkCallbackData return IDWALK_RET_NOP; } -static int paste_material_exec(bContext *C, wmOperator *op) +static wmOperatorStatus paste_material_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Material *ma = static_cast( @@ -2966,7 +2970,7 @@ static void paste_mtex_copybuf(ID *id) /** \name Texture Slot Copy Operator * \{ */ -static int copy_mtex_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus copy_mtex_exec(bContext *C, wmOperator * /*op*/) { ID *id = CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).owner_id; @@ -3010,7 +3014,7 @@ void TEXTURE_OT_slot_copy(wmOperatorType *ot) /** \name Texture Slot Paste Operator * \{ */ -static int paste_mtex_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus paste_mtex_exec(bContext *C, wmOperator * /*op*/) { ID *id = CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).owner_id; diff --git a/source/blender/editors/render/render_view.cc b/source/blender/editors/render/render_view.cc index 3635fdcc88f..13800dd110f 100644 --- a/source/blender/editors/render/render_view.cc +++ b/source/blender/editors/render/render_view.cc @@ -273,7 +273,7 @@ ScrArea *render_view_open(bContext *C, int mx, int my, ReportList *reports) /** \name Cancel Render Viewer Operator * \{ */ -static int render_view_cancel_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus render_view_cancel_exec(bContext *C, wmOperator * /*op*/) { wmWindow *win = CTX_wm_window(C); ScrArea *area = CTX_wm_area(C); @@ -329,7 +329,7 @@ void RENDER_OT_view_cancel(wmOperatorType *ot) /** \name Show Render Viewer Operator * \{ */ -static int render_view_show_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus render_view_show_invoke(bContext *C, wmOperator *op, const wmEvent *event) { wmWindow *wincur = CTX_wm_window(C); diff --git a/source/blender/editors/scene/scene_edit.cc b/source/blender/editors/scene/scene_edit.cc index 2a337101361..c7bedbd537f 100644 --- a/source/blender/editors/scene/scene_edit.cc +++ b/source/blender/editors/scene/scene_edit.cc @@ -242,7 +242,7 @@ bool ED_scene_view_layer_delete(Main *bmain, Scene *scene, ViewLayer *layer, Rep /** \name Scene New Operator * \{ */ -static int scene_new_exec(bContext *C, wmOperator *op) +static wmOperatorStatus scene_new_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); wmWindow *win = CTX_wm_window(C); @@ -295,7 +295,7 @@ static void SCENE_OT_new(wmOperatorType *ot) /** \name Scene New Sequencer Operator * \{ */ -static int scene_new_sequencer_exec(bContext *C, wmOperator *op) +static wmOperatorStatus scene_new_sequencer_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); int type = RNA_enum_get(op->ptr, "type"); @@ -387,7 +387,7 @@ static bool scene_delete_poll(bContext *C) return BKE_scene_can_be_removed(bmain, scene); } -static int scene_delete_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus scene_delete_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/screen/screen_ops.cc b/source/blender/editors/screen/screen_ops.cc index f1ab1f5e4a7..99e19927769 100644 --- a/source/blender/editors/screen/screen_ops.cc +++ b/source/blender/editors/screen/screen_ops.cc @@ -1087,7 +1087,7 @@ static void actionzone_apply(bContext *C, wmOperator *op, int type) WM_event_add(win, &event); } -static int actionzone_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus actionzone_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bScreen *screen = CTX_wm_screen(C); AZone *az = screen_actionzone_find_xy(screen, event->xy); @@ -1126,7 +1126,7 @@ static int actionzone_invoke(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int actionzone_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus actionzone_modal(bContext *C, wmOperator *op, const wmEvent *event) { bScreen *screen = CTX_wm_screen(C); sActionzoneData *sad = static_cast(op->customdata); @@ -1379,7 +1379,7 @@ static void area_swap_cancel(bContext *C, wmOperator *op) area_swap_exit(C, op); } -static int area_swap_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus area_swap_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (!area_swap_init(op, event)) { return OPERATOR_PASS_THROUGH; @@ -1392,7 +1392,7 @@ static int area_swap_invoke(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int area_swap_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus area_swap_modal(bContext *C, wmOperator *op, const wmEvent *event) { sActionzoneData *sad = static_cast(op->customdata); @@ -1433,7 +1433,7 @@ static int area_swap_modal(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int area_swap_exec(bContext *C, wmOperator *op) +static wmOperatorStatus area_swap_exec(bContext *C, wmOperator *op) { ScrArea *sa1, *sa2; int cursor[2]; @@ -1502,7 +1502,7 @@ static bool area_dupli_open(bContext *C, ScrArea *area, const blender::int2 posi return (newwin != nullptr); } -static int area_dupli_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus area_dupli_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ScrArea *area = CTX_wm_area(C); if (event && event->customdata) { @@ -1555,7 +1555,7 @@ static void SCREEN_OT_area_dupli(wmOperatorType *ot) * An exception is made for closing areas since it allows application templates * to customize the layout. */ -static int area_close_exec(bContext *C, wmOperator *op) +static wmOperatorStatus area_close_exec(bContext *C, wmOperator *op) { bScreen *screen = CTX_wm_screen(C); ScrArea *area = CTX_wm_area(C); @@ -2042,7 +2042,7 @@ static void area_move_exit(bContext *C, wmOperator *op) G.moving &= ~G_TRANSFORM_WM; } -static int area_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus area_move_exec(bContext *C, wmOperator *op) { if (!area_move_init(C, op)) { return OPERATOR_CANCELLED; @@ -2055,7 +2055,7 @@ static int area_move_exec(bContext *C, wmOperator *op) } /* interaction callback */ -static int area_move_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus area_move_invoke(bContext *C, wmOperator *op, const wmEvent *event) { RNA_int_set(op->ptr, "x", event->xy[0]); RNA_int_set(op->ptr, "y", event->xy[1]); @@ -2087,7 +2087,7 @@ static void area_move_cancel(bContext *C, wmOperator *op) } /* modal callback for while moving edges */ -static int area_move_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus area_move_modal(bContext *C, wmOperator *op, const wmEvent *event) { sAreaMoveData *md = static_cast(op->customdata); @@ -2413,7 +2413,7 @@ static void area_split_preview_update_cursor(bContext *C, wmOperator *op) } /* UI callback, adds new handler */ -static int area_split_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus area_split_invoke(bContext *C, wmOperator *op, const wmEvent *event) { wmWindow *win = CTX_wm_window(C); bScreen *screen = CTX_wm_screen(C); @@ -2552,7 +2552,7 @@ static int area_split_invoke(bContext *C, wmOperator *op, const wmEvent *event) } /* function to be called outside UI context, or for redo */ -static int area_split_exec(bContext *C, wmOperator *op) +static wmOperatorStatus area_split_exec(bContext *C, wmOperator *op) { if (!area_split_init(C, op)) { return OPERATOR_CANCELLED; @@ -2583,7 +2583,7 @@ static void area_split_cancel(bContext *C, wmOperator *op) area_split_exit(C, op); } -static int area_split_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus area_split_modal(bContext *C, wmOperator *op, const wmEvent *event) { sAreaSplitData *sd = (sAreaSplitData *)op->customdata; PropertyRNA *prop_dir = RNA_struct_find_property(op->ptr, "direction"); @@ -2842,7 +2842,7 @@ static void region_scale_exit(wmOperator *op) G.moving &= ~G_TRANSFORM_WM; } -static int region_scale_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus region_scale_invoke(bContext *C, wmOperator *op, const wmEvent *event) { sActionzoneData *sad = static_cast(event->customdata); @@ -2953,7 +2953,7 @@ static void region_scale_toggle_hidden(bContext *C, RegionMoveData *rmd) } } -static int region_scale_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus region_scale_modal(bContext *C, wmOperator *op, const wmEvent *event) { RegionMoveData *rmd = static_cast(op->customdata); int delta; @@ -3181,7 +3181,7 @@ void ED_areas_do_frame_follow(bContext *C, bool center_view) } /* function to be called outside UI context, or for redo */ -static int frame_offset_exec(bContext *C, wmOperator *op) +static wmOperatorStatus frame_offset_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); @@ -3228,7 +3228,7 @@ static void SCREEN_OT_frame_offset(wmOperatorType *ot) * \{ */ /* function to be called outside UI context, or for redo */ -static int frame_jump_exec(bContext *C, wmOperator *op) +static wmOperatorStatus frame_jump_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); wmTimer *animtimer = CTX_wm_screen(C)->animtimer; @@ -3291,7 +3291,7 @@ static void SCREEN_OT_frame_jump(wmOperatorType *ot) * \{ */ /* function to be called outside UI context, or for redo */ -static int keyframe_jump_exec(bContext *C, wmOperator *op) +static wmOperatorStatus keyframe_jump_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Object *ob = CTX_data_active_object(C); @@ -3414,7 +3414,7 @@ static void SCREEN_OT_keyframe_jump(wmOperatorType *ot) * \{ */ /* function to be called outside UI context, or for redo */ -static int marker_jump_exec(bContext *C, wmOperator *op) +static wmOperatorStatus marker_jump_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); int closest = scene->r.cfra; @@ -3478,7 +3478,7 @@ static void SCREEN_OT_marker_jump(wmOperatorType *ot) * \{ */ /* function to be called outside UI context, or for redo */ -static int screen_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus screen_set_exec(bContext *C, wmOperator *op) { WorkSpace *workspace = CTX_wm_workspace(C); int delta = RNA_int_get(op->ptr, "delta"); @@ -3510,7 +3510,7 @@ static void SCREEN_OT_screen_set(wmOperatorType *ot) * \{ */ /* function to be called outside UI context, or for redo */ -static int screen_maximize_area_exec(bContext *C, wmOperator *op) +static wmOperatorStatus screen_maximize_area_exec(bContext *C, wmOperator *op) { bScreen *screen = CTX_wm_screen(C); ScrArea *area = nullptr; @@ -3766,7 +3766,7 @@ static void area_join_exit(bContext *C, wmOperator *op) G.moving &= ~G_TRANSFORM_WM; } -static int area_join_exec(bContext *C, wmOperator *op) +static wmOperatorStatus area_join_exec(bContext *C, wmOperator *op) { if (!area_join_init(C, op, nullptr, nullptr)) { return OPERATOR_CANCELLED; @@ -3791,7 +3791,7 @@ static void area_join_update_data(bContext *C, sAreaJoinData *jd, const wmEvent static int area_join_cursor(sAreaJoinData *jd, const wmEvent *event); /* interaction callback */ -static int area_join_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus area_join_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (event->type == EVT_ACTIONZONE_AREA) { sActionzoneData *sad = static_cast(event->customdata); @@ -4231,7 +4231,7 @@ static void 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, const wmEvent *event) +static wmOperatorStatus area_join_modal(bContext *C, wmOperator *op, const wmEvent *event) { if (event->type == WINDEACTIVATE) { /* This operator can close windows, which can cause it to be re-run. */ @@ -4430,7 +4430,9 @@ static void SCREEN_OT_area_join(wmOperatorType *ot) /** \name Screen Area Options Operator * \{ */ -static int screen_area_options_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus screen_area_options_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { ScrArea *sa1, *sa2; if (screen_area_edge_from_cursor(C, event->xy, &sa1, &sa2) == nullptr) { @@ -4543,7 +4545,7 @@ static void SCREEN_OT_area_options(wmOperatorType *ot) /** \name Space Data Cleanup Operator * \{ */ -static int spacedata_cleanup_exec(bContext *C, wmOperator *op) +static wmOperatorStatus spacedata_cleanup_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); int tot = 0; @@ -4592,7 +4594,7 @@ static bool repeat_history_poll(bContext *C) return !BLI_listbase_is_empty(&wm->operators); } -static int repeat_last_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus repeat_last_exec(bContext *C, wmOperator * /*op*/) { wmWindowManager *wm = CTX_wm_manager(C); wmOperator *lastop = static_cast(wm->operators.last); @@ -4632,7 +4634,9 @@ static void SCREEN_OT_repeat_last(wmOperatorType *ot) /** \name Repeat History Operator * \{ */ -static int repeat_history_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus repeat_history_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { wmWindowManager *wm = CTX_wm_manager(C); @@ -4665,7 +4669,7 @@ static int repeat_history_invoke(bContext *C, wmOperator *op, const wmEvent * /* return OPERATOR_INTERFACE; } -static int repeat_history_exec(bContext *C, wmOperator *op) +static wmOperatorStatus repeat_history_exec(bContext *C, wmOperator *op) { wmWindowManager *wm = CTX_wm_manager(C); @@ -4702,7 +4706,9 @@ static void SCREEN_OT_repeat_history(wmOperatorType *ot) /** \name Redo Operator * \{ */ -static int redo_last_invoke(bContext *C, wmOperator * /*op*/, const wmEvent * /*event*/) +static wmOperatorStatus redo_last_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent * /*event*/) { wmOperator *lastop = WM_operator_last_redo(C); @@ -4764,7 +4770,7 @@ static void region_quadview_init_rv3d( } /* insert a region in the area region list */ -static int region_quadview_exec(bContext *C, wmOperator *op) +static wmOperatorStatus region_quadview_exec(bContext *C, wmOperator *op) { ARegion *region = CTX_wm_region(C); @@ -4903,7 +4909,7 @@ static void SCREEN_OT_region_quadview(wmOperatorType *ot) /** \name Region Toggle Operator * \{ */ -static int region_toggle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus region_toggle_exec(bContext *C, wmOperator *op) { PropertyRNA *prop = RNA_struct_find_property(op->ptr, "region_type"); @@ -4963,7 +4969,7 @@ static void SCREEN_OT_region_toggle(wmOperatorType *ot) * \{ */ /* flip a region alignment */ -static int region_flip_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus region_flip_exec(bContext *C, wmOperator * /*op*/) { ARegion *region = CTX_wm_region(C); @@ -5024,7 +5030,7 @@ static void SCREEN_OT_region_flip(wmOperatorType *ot) * \{ */ /* show/hide header text menus */ -static int header_toggle_menus_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus header_toggle_menus_exec(bContext *C, wmOperator * /*op*/) { ScrArea *area = CTX_wm_area(C); @@ -5188,7 +5194,9 @@ static void ed_screens_statusbar_menu_create(uiLayout *layout, void * /*arg*/) layout, &ptr, "show_statusbar_version", UI_ITEM_NONE, IFACE_("Blender Version"), ICON_NONE); } -static int screen_context_menu_invoke(bContext *C, wmOperator * /*op*/, const wmEvent * /*event*/) +static wmOperatorStatus screen_context_menu_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent * /*event*/) { const ScrArea *area = CTX_wm_area(C); const ARegion *region = CTX_wm_region(C); @@ -5415,7 +5423,9 @@ static void screen_animation_region_tag_redraw( // #define PROFILE_AUDIO_SYNC -static int screen_animation_step_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus screen_animation_step_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { bScreen *screen = CTX_wm_screen(C); wmTimer *wt = screen->animtimer; @@ -5702,7 +5712,7 @@ bScreen *ED_screen_animation_no_scrub(const wmWindowManager *wm) return nullptr; } -int ED_screen_animation_play(bContext *C, int sync, int mode) +wmOperatorStatus ED_screen_animation_play(bContext *C, int sync, int mode) { bScreen *screen = CTX_wm_screen(C); Scene *scene = CTX_data_scene(C); @@ -5748,7 +5758,7 @@ int ED_screen_animation_play(bContext *C, int sync, int mode) return OPERATOR_FINISHED; } -static int screen_animation_play_exec(bContext *C, wmOperator *op) +static wmOperatorStatus screen_animation_play_exec(bContext *C, wmOperator *op) { int mode = RNA_boolean_get(op->ptr, "reverse") ? -1 : 1; int sync = -1; @@ -5787,7 +5797,7 @@ static void SCREEN_OT_animation_play(wmOperatorType *ot) /** \name Animation Cancel Operator * \{ */ -static int screen_animation_cancel_exec(bContext *C, wmOperator *op) +static wmOperatorStatus screen_animation_cancel_exec(bContext *C, wmOperator *op) { bScreen *screen = ED_screen_animation_playing(CTX_wm_manager(C)); @@ -5856,7 +5866,7 @@ static void SCREEN_OT_animation_cancel(wmOperatorType *ot) * poll() has to be filled in by user for context */ #if 0 -static int box_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus box_select_exec(bContext *C, wmOperator *op) { int event_type = RNA_int_get(op->ptr, "event_type"); @@ -5901,7 +5911,7 @@ static void SCREEN_OT_box_select(wmOperatorType *ot) * Use for generic full-screen 'back' button. * \{ */ -static int fullscreen_back_exec(bContext *C, wmOperator *op) +static wmOperatorStatus fullscreen_back_exec(bContext *C, wmOperator *op) { bScreen *screen = CTX_wm_screen(C); ScrArea *area = nullptr; @@ -5941,7 +5951,7 @@ static void SCREEN_OT_back_to_previous(wmOperatorType *ot) /** \name Show User Preferences Operator * \{ */ -static int userpref_show_exec(bContext *C, wmOperator *op) +static wmOperatorStatus userpref_show_exec(bContext *C, wmOperator *op) { wmWindow *win_cur = CTX_wm_window(C); /* Use eventstate, not event from _invoke, so this can be called through exec(). */ @@ -6038,7 +6048,7 @@ static void SCREEN_OT_userpref_show(wmOperatorType *ot) /** \name Show Drivers Editor Operator * \{ */ -static int drivers_editor_show_exec(bContext *C, wmOperator *op) +static wmOperatorStatus drivers_editor_show_exec(bContext *C, wmOperator *op) { wmWindow *win_cur = CTX_wm_window(C); /* Use eventstate, not event from _invoke, so this can be called through exec(). */ @@ -6128,7 +6138,7 @@ static void SCREEN_OT_drivers_editor_show(wmOperatorType *ot) /** \name Show Info Log Operator * \{ */ -static int info_log_show_exec(bContext *C, wmOperator *op) +static wmOperatorStatus info_log_show_exec(bContext *C, wmOperator *op) { wmWindow *win_cur = CTX_wm_window(C); /* Use eventstate, not event from _invoke, so this can be called through exec(). */ @@ -6182,7 +6192,7 @@ static void SCREEN_OT_info_log_show(wmOperatorType *ot) /** \name New Screen Operator * \{ */ -static int screen_new_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus screen_new_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); wmWindow *win = CTX_wm_window(C); @@ -6214,7 +6224,7 @@ static void SCREEN_OT_new(wmOperatorType *ot) /** \name Delete Screen Operator * \{ */ -static int screen_delete_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus screen_delete_exec(bContext *C, wmOperator * /*op*/) { bScreen *screen = CTX_wm_screen(C); WorkSpace *workspace = CTX_wm_workspace(C); @@ -6348,7 +6358,7 @@ void ED_region_visibility_change_update_animated(bContext *C, ScrArea *area, ARe } /* timer runs in win->handlers, so it cannot use context to find area/region */ -static int region_blend_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus region_blend_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) { wmTimer *timer = static_cast(event->customdata); @@ -6402,7 +6412,7 @@ static bool space_type_set_or_cycle_poll(bContext *C) return (area && !ELEM(area->spacetype, SPACE_TOPBAR, SPACE_STATUSBAR)); } -static int space_type_set_or_cycle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus space_type_set_or_cycle_exec(bContext *C, wmOperator *op) { const int space_type = RNA_enum_get(op->ptr, "space_type"); @@ -6506,7 +6516,9 @@ static void context_cycle_prop_get(bScreen *screen, *r_prop = RNA_struct_find_property(r_ptr, propname); } -static int space_context_cycle_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus space_context_cycle_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { const eScreenCycle direction = eScreenCycle(RNA_enum_get(op->ptr, "direction")); @@ -6549,7 +6561,9 @@ static void SCREEN_OT_space_context_cycle(wmOperatorType *ot) /** \name Workspace Cycle Operator * \{ */ -static int space_workspace_cycle_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus space_workspace_cycle_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { wmWindow *win = CTX_wm_window(C); if (WM_window_is_temp_screen(win)) { diff --git a/source/blender/editors/screen/screendump.cc b/source/blender/editors/screen/screendump.cc index 2276e7d1c8f..7581f5d112a 100644 --- a/source/blender/editors/screen/screendump.cc +++ b/source/blender/editors/screen/screendump.cc @@ -98,7 +98,7 @@ static void screenshot_data_free(wmOperator *op) } } -static int screenshot_exec(bContext *C, wmOperator *op) +static wmOperatorStatus screenshot_exec(bContext *C, wmOperator *op) { const bool use_crop = STREQ(op->idname, "SCREEN_OT_screenshot_area"); ScreenshotData *scd = static_cast(op->customdata); @@ -150,7 +150,7 @@ static int screenshot_exec(bContext *C, wmOperator *op) return ok ? OPERATOR_FINISHED : OPERATOR_CANCELLED; } -static int screenshot_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus screenshot_invoke(bContext *C, wmOperator *op, const wmEvent *event) { const bool use_crop = STREQ(op->idname, "SCREEN_OT_screenshot_area"); ScrArea *area = nullptr; diff --git a/source/blender/editors/screen/workspace_edit.cc b/source/blender/editors/screen/workspace_edit.cc index c85841e1eea..b4d6c24ece2 100644 --- a/source/blender/editors/screen/workspace_edit.cc +++ b/source/blender/editors/screen/workspace_edit.cc @@ -294,7 +294,7 @@ static bool workspace_context_poll(bContext *C) return workspace_context_get(C) != nullptr; } -static int workspace_new_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus workspace_new_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); wmWindow *win = CTX_wm_window(C); @@ -319,7 +319,7 @@ static void WORKSPACE_OT_duplicate(wmOperatorType *ot) ot->exec = workspace_new_exec; } -static int workspace_delete_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus workspace_delete_exec(bContext *C, wmOperator * /*op*/) { WorkSpace *workspace = workspace_context_get(C); WM_event_add_notifier(C, NC_SCREEN | ND_WORKSPACE_DELETE, workspace); @@ -340,7 +340,7 @@ static void WORKSPACE_OT_delete(wmOperatorType *ot) ot->exec = workspace_delete_exec; } -static int workspace_append_activate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus workspace_append_activate_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); char idname[MAX_ID_NAME - 2], filepath[FILE_MAX]; @@ -514,7 +514,9 @@ static void workspace_add_menu(bContext * /*C*/, uiLayout *layout, void *templat } } -static int workspace_add_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus workspace_add_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { uiPopupMenu *pup = UI_popup_menu_begin( C, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, op->type->name), ICON_ADD); @@ -561,7 +563,7 @@ static void WORKSPACE_OT_add(wmOperatorType *ot) ot->invoke = workspace_add_invoke; } -static int workspace_reorder_to_back_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus workspace_reorder_to_back_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); WorkSpace *workspace = workspace_context_get(C); @@ -584,7 +586,7 @@ static void WORKSPACE_OT_reorder_to_back(wmOperatorType *ot) ot->exec = workspace_reorder_to_back_exec; } -static int workspace_reorder_to_front_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus workspace_reorder_to_front_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); WorkSpace *workspace = workspace_context_get(C); @@ -607,7 +609,7 @@ static void WORKSPACE_OT_reorder_to_front(wmOperatorType *ot) ot->exec = workspace_reorder_to_front_exec; } -static int workspace_scene_pin_toggle_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus workspace_scene_pin_toggle_exec(bContext *C, wmOperator * /*op*/) { WorkSpace *workspace = workspace_context_get(C); diff --git a/source/blender/editors/sculpt_paint/brush_asset_ops.cc b/source/blender/editors/sculpt_paint/brush_asset_ops.cc index a84e28849fb..955d8327e61 100644 --- a/source/blender/editors/sculpt_paint/brush_asset_ops.cc +++ b/source/blender/editors/sculpt_paint/brush_asset_ops.cc @@ -48,7 +48,7 @@ namespace blender::ed::sculpt_paint { -static int brush_asset_activate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus brush_asset_activate_exec(bContext *C, wmOperator *op) { /* This operator currently covers both cases: the file/asset browser file list and the asset list * used for the asset-view template. Once the asset list design is used by the Asset Browser, @@ -113,7 +113,7 @@ static bool brush_asset_save_as_poll(bContext *C) return true; } -static int brush_asset_save_as_exec(bContext *C, wmOperator *op) +static wmOperatorStatus brush_asset_save_as_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Paint *paint = BKE_paint_get_active_from_context(C); @@ -193,7 +193,9 @@ static bool library_is_editable(const AssetLibraryReference &library) return true; } -static int brush_asset_save_as_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus brush_asset_save_as_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Paint *paint = BKE_paint_get_active_from_context(C); const AssetWeakReference &brush_weak_ref = *paint->brush_asset_reference; @@ -295,7 +297,7 @@ void BRUSH_OT_asset_save_as(wmOperatorType *ot) prop, visit_library_prop_catalogs_catalog_for_search_fn, PROP_STRING_SEARCH_SUGGESTION); } -static int brush_asset_edit_metadata_exec(bContext *C, wmOperator *op) +static wmOperatorStatus brush_asset_edit_metadata_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Paint *paint = BKE_paint_get_active_from_context(C); @@ -336,7 +338,9 @@ static int brush_asset_edit_metadata_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int brush_asset_edit_metadata_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus brush_asset_edit_metadata_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { const Paint *paint = BKE_paint_get_active_from_context(C); const AssetWeakReference &brush_weak_ref = *paint->brush_asset_reference; @@ -443,7 +447,7 @@ void BRUSH_OT_asset_edit_metadata(wmOperatorType *ot) RNA_def_string(ot->srna, "description", nullptr, MAX_NAME, "Description", ""); } -static int brush_asset_load_preview_exec(bContext *C, wmOperator *op) +static wmOperatorStatus brush_asset_load_preview_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Paint *paint = BKE_paint_get_active_from_context(C); @@ -475,7 +479,9 @@ static int brush_asset_load_preview_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int brush_asset_load_preview_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus brush_asset_load_preview_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { if (RNA_struct_property_is_set(op->ptr, "filepath")) { return brush_asset_load_preview_exec(C, op); @@ -521,7 +527,7 @@ static bool brush_asset_delete_poll(bContext *C) return true; } -static int brush_asset_delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus brush_asset_delete_exec(bContext *C, wmOperator *op) { Paint *paint = BKE_paint_get_active_from_context(C); Brush *brush = BKE_paint_brush(paint); @@ -546,7 +552,9 @@ static int brush_asset_delete_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int brush_asset_delete_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus brush_asset_delete_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Paint *paint = BKE_paint_get_active_from_context(C); Brush *brush = BKE_paint_brush(paint); @@ -598,7 +606,7 @@ static bool brush_asset_save_poll(bContext *C) return true; } -static int brush_asset_save_exec(bContext *C, wmOperator *op) +static wmOperatorStatus brush_asset_save_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Paint *paint = BKE_paint_get_active_from_context(C); @@ -644,7 +652,7 @@ static bool brush_asset_revert_poll(bContext *C) return paint->brush_asset_reference && bke::asset_edit_id_is_editable(brush->id); } -static int brush_asset_revert_exec(bContext *C, wmOperator *op) +static wmOperatorStatus brush_asset_revert_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Paint *paint = BKE_paint_get_active_from_context(C); diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc b/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc index 3cef50abc15..1897a558afe 100644 --- a/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc +++ b/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc @@ -206,7 +206,9 @@ static void stroke_done(const bContext *C, PaintStroke *stroke) UNUSED_VARS(C, stroke); } -static int sculpt_curves_stroke_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sculpt_curves_stroke_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Scene *scene = CTX_data_scene(C); Paint *paint = BKE_paint_get_active_from_paintmode(scene, PaintMode::SculptCurves); @@ -239,11 +241,13 @@ static int sculpt_curves_stroke_invoke(bContext *C, wmOperator *op, const wmEven return OPERATOR_RUNNING_MODAL; } -static int sculpt_curves_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sculpt_curves_stroke_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { SculptCurvesBrushStrokeData *op_data = static_cast( op->customdata); - int return_value = paint_stroke_modal(C, op, event, &op_data->stroke); + wmOperatorStatus return_value = paint_stroke_modal(C, op, event, &op_data->stroke); if (ELEM(return_value, OPERATOR_FINISHED, OPERATOR_CANCELLED)) { MEM_delete(op_data); op->customdata = nullptr; @@ -316,7 +320,7 @@ static void curves_sculptmode_exit(bContext *C) ob->mode = OB_MODE_OBJECT; } -static int curves_sculptmode_toggle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus curves_sculptmode_toggle_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); wmMsgBus *mbus = CTX_wm_message_bus(C); @@ -361,7 +365,7 @@ static void CURVES_OT_sculptmode_toggle(wmOperatorType *ot) namespace select_random { -static int select_random_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_random_exec(bContext *C, wmOperator *op) { VectorSet unique_curves = curves::get_unique_editable_curves(*C); @@ -728,7 +732,7 @@ static void select_grow_invoke_per_curve(const Curves &curves_id, [](const float a, const float b) { return std::min(a, b); }); } -static int select_grow_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus select_grow_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Object *active_ob = CTX_data_active_object(C); ARegion *region = CTX_wm_region(C); @@ -750,7 +754,7 @@ static int select_grow_invoke(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int select_grow_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus select_grow_modal(bContext *C, wmOperator *op, const wmEvent *event) { GrowOperatorData &op_data = *static_cast(op->customdata); const int mouse_x = event->xy[0]; @@ -1008,7 +1012,7 @@ static void min_distance_edit_draw(bContext *C, int /*x*/, int /*y*/, void *cust GPU_blend(GPU_BLEND_NONE); } -static int min_distance_edit_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus min_distance_edit_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); ARegion *region = CTX_wm_region(C); @@ -1095,7 +1099,7 @@ static int min_distance_edit_invoke(bContext *C, wmOperator *op, const wmEvent * return OPERATOR_RUNNING_MODAL; } -static int min_distance_edit_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus min_distance_edit_modal(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); MinDistanceEditData &op_data = *static_cast(op->customdata); diff --git a/source/blender/editors/sculpt_paint/grease_pencil_draw_ops.cc b/source/blender/editors/sculpt_paint/grease_pencil_draw_ops.cc index 4a2d121ad6d..a3c51a41cee 100644 --- a/source/blender/editors/sculpt_paint/grease_pencil_draw_ops.cc +++ b/source/blender/editors/sculpt_paint/grease_pencil_draw_ops.cc @@ -236,7 +236,9 @@ static bool grease_pencil_brush_stroke_poll(bContext *C) return true; } -static int grease_pencil_brush_stroke_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus grease_pencil_brush_stroke_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { if (event->tablet.active == EVT_TABLET_ERASER) { RNA_enum_set(op->ptr, "mode", BRUSH_STROKE_ERASE); @@ -266,7 +268,7 @@ static int grease_pencil_brush_stroke_invoke(bContext *C, wmOperator *op, const } return false; }(); - int return_value = ed::greasepencil::grease_pencil_draw_operator_invoke( + wmOperatorStatus return_value = ed::greasepencil::grease_pencil_draw_operator_invoke( C, op, use_duplicate_previous_key); if (return_value != OPERATOR_RUNNING_MODAL) { return return_value; @@ -290,7 +292,9 @@ static int grease_pencil_brush_stroke_invoke(bContext *C, wmOperator *op, const return OPERATOR_RUNNING_MODAL; } -static int grease_pencil_brush_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus grease_pencil_brush_stroke_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { return paint_stroke_modal(C, op, event, reinterpret_cast(&op->customdata)); } @@ -333,7 +337,9 @@ static bool grease_pencil_sculpt_paint_poll(bContext *C) return true; } -static int grease_pencil_sculpt_paint_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus grease_pencil_sculpt_paint_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { const Scene *scene = CTX_data_scene(C); const Object *object = CTX_data_active_object(C); @@ -396,7 +402,9 @@ static int grease_pencil_sculpt_paint_invoke(bContext *C, wmOperator *op, const return OPERATOR_RUNNING_MODAL; } -static int grease_pencil_sculpt_paint_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus grease_pencil_sculpt_paint_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { return paint_stroke_modal(C, op, event, reinterpret_cast(&op->customdata)); } @@ -439,9 +447,9 @@ static bool grease_pencil_weight_brush_stroke_poll(bContext *C) return true; } -static int grease_pencil_weight_brush_stroke_invoke(bContext *C, - wmOperator *op, - const wmEvent *event) +static wmOperatorStatus grease_pencil_weight_brush_stroke_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { const Scene *scene = CTX_data_scene(C); const Object *object = CTX_data_active_object(C); @@ -487,9 +495,9 @@ static int grease_pencil_weight_brush_stroke_invoke(bContext *C, return OPERATOR_RUNNING_MODAL; } -static int grease_pencil_weight_brush_stroke_modal(bContext *C, - wmOperator *op, - const wmEvent *event) +static wmOperatorStatus grease_pencil_weight_brush_stroke_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { return paint_stroke_modal(C, op, event, reinterpret_cast(&op->customdata)); } @@ -532,9 +540,9 @@ static bool grease_pencil_vertex_brush_stroke_poll(bContext *C) return true; } -static int grease_pencil_vertex_brush_stroke_invoke(bContext *C, - wmOperator *op, - const wmEvent *event) +static wmOperatorStatus grease_pencil_vertex_brush_stroke_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { const Scene *scene = CTX_data_scene(C); const Object *object = CTX_data_active_object(C); @@ -593,9 +601,9 @@ static int grease_pencil_vertex_brush_stroke_invoke(bContext *C, return OPERATOR_RUNNING_MODAL; } -static int grease_pencil_vertex_brush_stroke_modal(bContext *C, - wmOperator *op, - const wmEvent *event) +static wmOperatorStatus grease_pencil_vertex_brush_stroke_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { return paint_stroke_modal(C, op, event, reinterpret_cast(&op->customdata)); } @@ -1533,7 +1541,9 @@ static void grease_pencil_fill_exit(bContext &C, wmOperator &op) WM_event_add_notifier(&C, NC_GPENCIL | ND_DATA | NA_EDITED, nullptr); } -static int grease_pencil_fill_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus grease_pencil_fill_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { const ARegion ®ion = *CTX_wm_region(C); ToolSettings &ts = *CTX_data_tool_settings(C); @@ -1583,7 +1593,9 @@ enum class FillToolModalKey : int8_t { Precision, }; -static int grease_pencil_fill_event_modal_map(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus grease_pencil_fill_event_modal_map(bContext *C, + wmOperator *op, + const wmEvent *event) { auto &op_data = *static_cast(op->customdata); /* Extension line length increment, for normal and precise mode respectively. */ @@ -1671,13 +1683,13 @@ static int grease_pencil_fill_event_modal_map(bContext *C, wmOperator *op, const return OPERATOR_RUNNING_MODAL; } -static int grease_pencil_fill_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus grease_pencil_fill_modal(bContext *C, wmOperator *op, const wmEvent *event) { const RegionView3D &rv3d = *CTX_wm_region_view3d(C); auto &op_data = *static_cast(op->customdata); - int estate = OPERATOR_CANCELLED; + wmOperatorStatus estate = OPERATOR_CANCELLED; if (!op_data.show_extension) { /* Apply fill immediately if "Visual Aids" (aka. extension lines) is disabled. */ op_data.fill_mouse_pos = float2(event->mval); @@ -1816,7 +1828,7 @@ static inline bool is_point_inside_lasso(const Array lasso, const int2 poi point, reinterpret_cast(lasso.data()), uint(lasso.size())); } -static int grease_pencil_erase_lasso_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_erase_lasso_exec(bContext *C, wmOperator *op) { using namespace bke::greasepencil; using namespace ed::greasepencil; @@ -1935,7 +1947,7 @@ static inline bool is_point_inside_bounds(const Bounds bounds, const int2 return true; } -static int grease_pencil_erase_box_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_erase_box_exec(bContext *C, wmOperator *op) { using namespace bke::greasepencil; using namespace ed::greasepencil; diff --git a/source/blender/editors/sculpt_paint/grease_pencil_interpolate.cc b/source/blender/editors/sculpt_paint/grease_pencil_interpolate.cc index f271ed3f38b..8d60380401e 100644 --- a/source/blender/editors/sculpt_paint/grease_pencil_interpolate.cc +++ b/source/blender/editors/sculpt_paint/grease_pencil_interpolate.cc @@ -992,7 +992,9 @@ static bool grease_pencil_interpolate_poll(bContext *C) } /* Invoke handler: Initialize the operator */ -static int grease_pencil_interpolate_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus grease_pencil_interpolate_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { wmWindow &win = *CTX_wm_window(C); @@ -1022,7 +1024,9 @@ enum class InterpolateToolModalEvent : int8_t { }; /* Modal handler: Events handling during interactive part */ -static int grease_pencil_interpolate_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus grease_pencil_interpolate_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { wmWindow &win = *CTX_wm_window(C); const ARegion ®ion = *CTX_wm_region(C); @@ -1348,7 +1352,7 @@ static float grease_pencil_interpolate_sequence_easing_calc(const eBezTriple_Eas return time; } -static int grease_pencil_interpolate_sequence_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_interpolate_sequence_exec(bContext *C, wmOperator *op) { using bke::greasepencil::Drawing; using bke::greasepencil::Layer; diff --git a/source/blender/editors/sculpt_paint/grease_pencil_trace.cc b/source/blender/editors/sculpt_paint/grease_pencil_trace.cc index 76cd31398b1..2a4ae4ea6f3 100644 --- a/source/blender/editors/sculpt_paint/grease_pencil_trace.cc +++ b/source/blender/editors/sculpt_paint/grease_pencil_trace.cc @@ -377,7 +377,7 @@ static bool grease_pencil_trace_image_poll(bContext *C) return true; } -static int grease_pencil_trace_image_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grease_pencil_trace_image_exec(bContext *C, wmOperator *op) { TraceJob *job = MEM_new("TraceJob"); job->C = C; @@ -448,7 +448,9 @@ static int grease_pencil_trace_image_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int grease_pencil_trace_image_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus grease_pencil_trace_image_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { /* Show popup dialog to allow editing. */ /* FIXME: hard-coded dimensions here are just arbitrary. */ diff --git a/source/blender/editors/sculpt_paint/paint_curve.cc b/source/blender/editors/sculpt_paint/paint_curve.cc index 080919e7898..5ab91fda0c2 100644 --- a/source/blender/editors/sculpt_paint/paint_curve.cc +++ b/source/blender/editors/sculpt_paint/paint_curve.cc @@ -153,7 +153,7 @@ static PaintCurve *paintcurve_for_brush_add(Main *bmain, const char *name, const return curve; } -static int paintcurve_new_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus paintcurve_new_exec(bContext *C, wmOperator * /*op*/) { Paint *paint = BKE_paint_get_active_from_context(C); Brush *brush = (paint) ? BKE_paint_brush(paint) : nullptr; @@ -247,7 +247,9 @@ static void paintcurve_point_add(bContext *C, wmOperator *op, const int loc[2]) WM_paint_cursor_tag_redraw(window, region); } -static int paintcurve_add_point_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus paintcurve_add_point_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { const int loc[2] = {event->mval[0], event->mval[1]}; paintcurve_point_add(C, op, loc); @@ -255,7 +257,7 @@ static int paintcurve_add_point_invoke(bContext *C, wmOperator *op, const wmEven return OPERATOR_FINISHED; } -static int paintcurve_add_point_exec(bContext *C, wmOperator *op) +static wmOperatorStatus paintcurve_add_point_exec(bContext *C, wmOperator *op) { int loc[2]; @@ -296,7 +298,7 @@ void PAINTCURVE_OT_add_point(wmOperatorType *ot) SHRT_MAX); } -static int paintcurve_delete_point_exec(bContext *C, wmOperator *op) +static wmOperatorStatus paintcurve_delete_point_exec(bContext *C, wmOperator *op) { Paint *paint = BKE_paint_get_active_from_context(C); Brush *br = BKE_paint_brush(paint); @@ -478,7 +480,9 @@ static bool paintcurve_point_select( return true; } -static int paintcurve_select_point_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus paintcurve_select_point_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { const int loc[2] = {event->mval[0], event->mval[1]}; bool toggle = RNA_boolean_get(op->ptr, "toggle"); @@ -490,7 +494,7 @@ static int paintcurve_select_point_invoke(bContext *C, wmOperator *op, const wmE return OPERATOR_CANCELLED; } -static int paintcurve_select_point_exec(bContext *C, wmOperator *op) +static wmOperatorStatus paintcurve_select_point_exec(bContext *C, wmOperator *op) { int loc[2]; @@ -549,7 +553,7 @@ struct PointSlideData { bool align; }; -static int paintcurve_slide_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus paintcurve_slide_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Paint *paint = BKE_paint_get_active_from_context(C); const float loc_fl[2] = {float(event->mval[0]), float(event->mval[1])}; @@ -612,7 +616,7 @@ static int paintcurve_slide_invoke(bContext *C, wmOperator *op, const wmEvent *e return OPERATOR_PASS_THROUGH; } -static int paintcurve_slide_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus paintcurve_slide_modal(bContext *C, wmOperator *op, const wmEvent *event) { PointSlideData *psd = static_cast(op->customdata); @@ -677,7 +681,7 @@ void PAINTCURVE_OT_slide(wmOperatorType *ot) ot->srna, "select", true, "Select", "Attempt to select a point handle before transform"); } -static int paintcurve_draw_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus paintcurve_draw_exec(bContext *C, wmOperator * /*op*/) { PaintMode mode = BKE_paintmode_get_active_from_context(C); const char *name; @@ -724,7 +728,9 @@ void PAINTCURVE_OT_draw(wmOperatorType *ot) ot->flag = OPTYPE_UNDO; } -static int paintcurve_cursor_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus paintcurve_cursor_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { PaintMode mode = BKE_paintmode_get_active_from_context(C); diff --git a/source/blender/editors/sculpt_paint/paint_hide.cc b/source/blender/editors/sculpt_paint/paint_hide.cc index f631a5e30ba..953091e09df 100644 --- a/source/blender/editors/sculpt_paint/paint_hide.cc +++ b/source/blender/editors/sculpt_paint/paint_hide.cc @@ -505,7 +505,7 @@ static void partialvis_all_update_bmesh(const Depsgraph &depsgraph, depsgraph, ob, node_mask, action, [](const BMVert * /*vert*/) { return true; }); } -static int hide_show_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus hide_show_all_exec(bContext *C, wmOperator *op) { const Scene &scene = *CTX_data_scene(C); Object &ob = *CTX_data_active_object(C); @@ -622,7 +622,7 @@ static void partialvis_masked_update_bmesh(const Depsgraph &depsgraph, partialvis_update_bmesh_nodes(depsgraph, ob, node_mask, action, mask_test_fn); } -static int hide_show_masked_exec(bContext *C, wmOperator *op) +static wmOperatorStatus hide_show_masked_exec(bContext *C, wmOperator *op) { const Scene &scene = *CTX_data_scene(C); Object &ob = *CTX_data_active_object(C); @@ -783,7 +783,7 @@ static void invert_visibility_bmesh(const Depsgraph &depsgraph, pbvh.tag_visibility_changed(node_mask); } -static int visibility_invert_exec(bContext *C, wmOperator *op) +static wmOperatorStatus visibility_invert_exec(bContext *C, wmOperator *op) { const Scene &scene = *CTX_data_scene(C); Object &object = *CTX_data_active_object(C); @@ -1113,7 +1113,7 @@ static void grow_shrink_visibility_bmesh(const Depsgraph &depsgraph, } } -static int visibility_filter_exec(bContext *C, wmOperator *op) +static wmOperatorStatus visibility_filter_exec(bContext *C, wmOperator *op) { const Scene &scene = *CTX_data_scene(C); Object &object = *CTX_data_active_object(C); @@ -1331,7 +1331,7 @@ static void hide_show_init_properties(bContext & /*C*/, gesture_data.selection_type = gesture::SelectionType(RNA_enum_get(op.ptr, "area")); } -static int hide_show_gesture_box_exec(bContext *C, wmOperator *op) +static wmOperatorStatus hide_show_gesture_box_exec(bContext *C, wmOperator *op) { std::unique_ptr gesture_data = gesture::init_from_box(C, op); if (!gesture_data) { @@ -1342,7 +1342,7 @@ static int hide_show_gesture_box_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int hide_show_gesture_lasso_exec(bContext *C, wmOperator *op) +static wmOperatorStatus hide_show_gesture_lasso_exec(bContext *C, wmOperator *op) { std::unique_ptr gesture_data = gesture::init_from_lasso(C, op); if (!gesture_data) { @@ -1353,7 +1353,7 @@ static int hide_show_gesture_lasso_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int hide_show_gesture_line_exec(bContext *C, wmOperator *op) +static wmOperatorStatus hide_show_gesture_line_exec(bContext *C, wmOperator *op) { std::unique_ptr gesture_data = gesture::init_from_line(C, op); if (!gesture_data) { @@ -1364,7 +1364,7 @@ static int hide_show_gesture_line_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int hide_show_gesture_polyline_exec(bContext *C, wmOperator *op) +static wmOperatorStatus hide_show_gesture_polyline_exec(bContext *C, wmOperator *op) { std::unique_ptr gesture_data = gesture::init_from_polyline(C, op); if (!gesture_data) { diff --git a/source/blender/editors/sculpt_paint/paint_image.cc b/source/blender/editors/sculpt_paint/paint_image.cc index 95006b810b9..6ca54754fc0 100644 --- a/source/blender/editors/sculpt_paint/paint_image.cc +++ b/source/blender/editors/sculpt_paint/paint_image.cc @@ -529,14 +529,14 @@ static void grab_clone_apply(bContext *C, wmOperator *op) ED_region_tag_redraw(CTX_wm_region(C)); } -static int grab_clone_exec(bContext *C, wmOperator *op) +static wmOperatorStatus grab_clone_exec(bContext *C, wmOperator *op) { grab_clone_apply(C, op); return OPERATOR_FINISHED; } -static int grab_clone_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus grab_clone_invoke(bContext *C, wmOperator *op, const wmEvent *event) { const Scene *scene = CTX_data_scene(C); const ToolSettings *settings = scene->toolsettings; @@ -554,7 +554,7 @@ static int grab_clone_invoke(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int grab_clone_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus grab_clone_modal(bContext *C, wmOperator *op, const wmEvent *event) { const Scene *scene = CTX_data_scene(C); ToolSettings *settings = scene->toolsettings; @@ -653,7 +653,7 @@ static void sample_color_update_header(SampleColorData *data, bContext *C) } } -static int sample_color_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sample_color_exec(bContext *C, wmOperator *op) { Paint *paint = BKE_paint_get_active_from_context(C); Brush *brush = BKE_paint_brush(paint); @@ -684,7 +684,7 @@ static int sample_color_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sample_color_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sample_color_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Scene *scene = CTX_data_scene(C); Paint *paint = BKE_paint_get_active_from_context(C); @@ -722,7 +722,7 @@ static int sample_color_invoke(bContext *C, wmOperator *op, const wmEvent *event return OPERATOR_RUNNING_MODAL; } -static int sample_color_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sample_color_modal(bContext *C, wmOperator *op, const wmEvent *event) { Scene *scene = CTX_data_scene(C); SampleColorData *data = static_cast(op->customdata); @@ -985,7 +985,7 @@ static bool texture_paint_toggle_poll(bContext *C) return true; } -static int texture_paint_toggle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus texture_paint_toggle_exec(bContext *C, wmOperator *op) { using namespace blender::ed; wmMsgBus *mbus = CTX_wm_message_bus(C); @@ -1037,7 +1037,7 @@ void PAINT_OT_texture_paint_toggle(wmOperatorType *ot) /** \name Brush Color Flip Operator * \{ */ -static int brush_colors_flip_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus brush_colors_flip_exec(bContext *C, wmOperator * /*op*/) { Scene &scene = *CTX_data_scene(C); diff --git a/source/blender/editors/sculpt_paint/paint_image_ops_paint.cc b/source/blender/editors/sculpt_paint/paint_image_ops_paint.cc index 1cf8851cb82..0be46dd2dbd 100644 --- a/source/blender/editors/sculpt_paint/paint_image_ops_paint.cc +++ b/source/blender/editors/sculpt_paint/paint_image_ops_paint.cc @@ -451,7 +451,7 @@ static bool paint_stroke_test_start(bContext *C, wmOperator *op, const float mou return true; } -static int paint_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus paint_invoke(bContext *C, wmOperator *op, const wmEvent *event) { int retval; @@ -477,7 +477,7 @@ static int paint_invoke(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int paint_exec(bContext *C, wmOperator *op) +static wmOperatorStatus paint_exec(bContext *C, wmOperator *op) { PropertyRNA *strokeprop; PointerRNA firstpoint; @@ -520,7 +520,7 @@ static int paint_exec(bContext *C, wmOperator *op) return paint_stroke_exec(C, op, static_cast(op->customdata)); } -static int paint_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus paint_modal(bContext *C, wmOperator *op, const wmEvent *event) { return paint_stroke_modal(C, op, event, reinterpret_cast(&op->customdata)); } diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.cc b/source/blender/editors/sculpt_paint/paint_image_proj.cc index 212f12b7c47..047b113063b 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.cc +++ b/source/blender/editors/sculpt_paint/paint_image_proj.cc @@ -6099,7 +6099,7 @@ void paint_proj_stroke_done(void *ps_handle_p) MEM_delete(ps_handle); } /* use project paint to re-apply an image */ -static int texture_paint_camera_project_exec(bContext *C, wmOperator *op) +static wmOperatorStatus texture_paint_camera_project_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Image *image = static_cast( @@ -6251,7 +6251,7 @@ static bool texture_paint_image_from_view_poll(bContext *C) return true; } -static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op) +static wmOperatorStatus texture_paint_image_from_view_exec(bContext *C, wmOperator *op) { using namespace blender; Image *image; @@ -6820,7 +6820,7 @@ static int get_texture_layer_type(wmOperator *op, const char *prop_name) return type; } -static int texture_paint_add_texture_paint_slot_exec(bContext *C, wmOperator *op) +static wmOperatorStatus texture_paint_add_texture_paint_slot_exec(bContext *C, wmOperator *op) { if (proj_paint_add_slot(C, op)) { return OPERATOR_FINISHED; @@ -6838,9 +6838,9 @@ static void get_default_texture_layer_name_for_object(Object *ob, BLI_snprintf(dst, dst_maxncpy, "%s %s", base_name, DATA_(layer_type_items[texture_type].name)); } -static int texture_paint_add_texture_paint_slot_invoke(bContext *C, - wmOperator *op, - const wmEvent * /*event*/) +static wmOperatorStatus texture_paint_add_texture_paint_slot_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Object *ob = blender::ed::object::context_active_object(C); Material *ma = BKE_object_material_get(ob, ob->actcol); @@ -6987,7 +6987,7 @@ void PAINT_OT_add_texture_paint_slot(wmOperatorType *ot) "Type of data stored in attribute"); } -static int add_simple_uvs_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus add_simple_uvs_exec(bContext *C, wmOperator * /*op*/) { /* no checks here, poll function does them for us */ Main *bmain = CTX_data_main(C); diff --git a/source/blender/editors/sculpt_paint/paint_intern.hh b/source/blender/editors/sculpt_paint/paint_intern.hh index 955980d5483..d20374f7699 100644 --- a/source/blender/editors/sculpt_paint/paint_intern.hh +++ b/source/blender/editors/sculpt_paint/paint_intern.hh @@ -15,6 +15,7 @@ #include "DNA_object_enums.h" #include "DNA_scene_enums.h" #include "DNA_vec_types.h" +#include "DNA_windowmanager_enums.h" enum class PaintMode : int8_t; @@ -139,8 +140,11 @@ wmKeyMap *paint_stroke_modal_keymap(wmKeyConfig *keyconf); * 6. Return to step 3 while stroke is ongoing. * 7. Call `StrokeDone` when finished to perform any cleanup or finalization. */ -int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event, PaintStroke **stroke_p); -int paint_stroke_exec(bContext *C, wmOperator *op, PaintStroke *stroke); +wmOperatorStatus paint_stroke_modal(bContext *C, + wmOperator *op, + const wmEvent *event, + PaintStroke **stroke_p); +wmOperatorStatus paint_stroke_exec(bContext *C, wmOperator *op, PaintStroke *stroke); void paint_stroke_cancel(bContext *C, wmOperator *op, PaintStroke *stroke); bool paint_stroke_flipped(PaintStroke *stroke); bool paint_stroke_inverted(PaintStroke *stroke); diff --git a/source/blender/editors/sculpt_paint/paint_mask.cc b/source/blender/editors/sculpt_paint/paint_mask.cc index d4601f4dd77..0e1636ded18 100644 --- a/source/blender/editors/sculpt_paint/paint_mask.cc +++ b/source/blender/editors/sculpt_paint/paint_mask.cc @@ -649,7 +649,7 @@ static void invert_mask(Main &bmain, const Scene &scene, Depsgraph &depsgraph, O } } -static int mask_flood_fill_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mask_flood_fill_exec(bContext *C, wmOperator *op) { Main &bmain = *CTX_data_main(C); const Scene &scene = *CTX_data_scene(C); @@ -883,7 +883,7 @@ static void gesture_operator_properties(wmOperatorType *ot) 1.0f); } -static int gesture_box_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gesture_box_exec(bContext *C, wmOperator *op) { std::unique_ptr gesture_data = gesture::init_from_box(C, op); if (!gesture_data) { @@ -894,7 +894,7 @@ static int gesture_box_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int gesture_lasso_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gesture_lasso_exec(bContext *C, wmOperator *op) { std::unique_ptr gesture_data = gesture::init_from_lasso(C, op); if (!gesture_data) { @@ -905,7 +905,7 @@ static int gesture_lasso_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int gesture_line_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gesture_line_exec(bContext *C, wmOperator *op) { std::unique_ptr gesture_data = gesture::init_from_line(C, op); if (!gesture_data) { @@ -916,7 +916,7 @@ static int gesture_line_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int gesture_polyline_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gesture_polyline_exec(bContext *C, wmOperator *op) { std::unique_ptr gesture_data = gesture::init_from_polyline(C, op); if (!gesture_data) { diff --git a/source/blender/editors/sculpt_paint/paint_ops.cc b/source/blender/editors/sculpt_paint/paint_ops.cc index ba2917b8196..0caf5b0fb69 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.cc +++ b/source/blender/editors/sculpt_paint/paint_ops.cc @@ -48,7 +48,7 @@ #include "paint_mask.hh" #include "sculpt_intern.hh" -static int brush_scale_size_exec(bContext *C, wmOperator *op) +static wmOperatorStatus brush_scale_size_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Paint *paint = BKE_paint_get_active_from_context(C); @@ -124,7 +124,7 @@ static void BRUSH_OT_scale_size(wmOperatorType *ot) /* Palette operators */ -static int palette_new_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus palette_new_exec(bContext *C, wmOperator * /*op*/) { Paint *paint = BKE_paint_get_active_from_context(C); Main *bmain = CTX_data_main(C); @@ -164,7 +164,7 @@ static bool palette_poll(bContext *C) return false; } -static int palette_color_add_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus palette_color_add_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); Paint *paint = BKE_paint_get_active_from_context(C); @@ -211,7 +211,7 @@ static void PALETTE_OT_color_add(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int palette_color_delete_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus palette_color_delete_exec(bContext *C, wmOperator * /*op*/) { Paint *paint = BKE_paint_get_active_from_context(C); Palette *palette = paint->palette; @@ -253,7 +253,7 @@ static bool palette_extract_img_poll(bContext *C) return false; } -static int palette_extract_img_exec(bContext *C, wmOperator *op) +static wmOperatorStatus palette_extract_img_exec(bContext *C, wmOperator *op) { const int threshold = RNA_int_get(op->ptr, "threshold"); @@ -323,7 +323,7 @@ static void PALETTE_OT_extract_from_image(wmOperatorType *ot) } /* Sort Palette color by Hue and Saturation. */ -static int palette_sort_exec(bContext *C, wmOperator *op) +static wmOperatorStatus palette_sort_exec(bContext *C, wmOperator *op) { const int type = RNA_enum_get(op->ptr, "type"); @@ -419,7 +419,7 @@ static void PALETTE_OT_sort(wmOperatorType *ot) } /* Move colors in palette. */ -static int palette_color_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus palette_color_move_exec(bContext *C, wmOperator *op) { Paint *paint = BKE_paint_get_active_from_context(C); Palette *palette = paint->palette; @@ -465,7 +465,7 @@ static void PALETTE_OT_color_move(wmOperatorType *ot) } /* Join Palette swatches. */ -static int palette_join_exec(bContext *C, wmOperator *op) +static wmOperatorStatus palette_join_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Paint *paint = BKE_paint_get_active_from_context(C); @@ -598,7 +598,7 @@ static void stencil_set_target(StencilControlData *scd) scd->init_angle = atan2f(mdiff[1], mdiff[0]); } -static int stencil_control_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus stencil_control_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Paint *paint = BKE_paint_get_active_from_context(C); Brush *br = BKE_paint_brush(paint); @@ -707,7 +707,7 @@ static void stencil_control_calculate(StencilControlData *scd, const int mval[2] #undef PIXEL_MARGIN } -static int stencil_control_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus stencil_control_modal(bContext *C, wmOperator *op, const wmEvent *event) { StencilControlData *scd = static_cast(op->customdata); @@ -814,7 +814,7 @@ static void BRUSH_OT_stencil_control(wmOperatorType *ot) RNA_def_property_flag(prop, PropertyFlag(PROP_HIDDEN | PROP_SKIP_SAVE)); } -static int stencil_fit_image_aspect_exec(bContext *C, wmOperator *op) +static wmOperatorStatus stencil_fit_image_aspect_exec(bContext *C, wmOperator *op) { Paint *paint = BKE_paint_get_active_from_context(C); Brush *br = BKE_paint_brush(paint); @@ -892,7 +892,7 @@ static void BRUSH_OT_stencil_fit_image_aspect(wmOperatorType *ot) ot->srna, "mask", false, "Modify Mask Stencil", "Modify either the primary or mask stencil"); } -static int stencil_reset_transform_exec(bContext *C, wmOperator *op) +static wmOperatorStatus stencil_reset_transform_exec(bContext *C, wmOperator *op) { Paint *paint = BKE_paint_get_active_from_context(C); Brush *br = BKE_paint_brush(paint); diff --git a/source/blender/editors/sculpt_paint/paint_stroke.cc b/source/blender/editors/sculpt_paint/paint_stroke.cc index 689bb2f0a4f..8273b7e81ef 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.cc +++ b/source/blender/editors/sculpt_paint/paint_stroke.cc @@ -1454,7 +1454,10 @@ static void paint_stroke_line_constrain(PaintStroke *stroke, float2 &mouse) } } -int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event, PaintStroke **stroke_p) +wmOperatorStatus paint_stroke_modal(bContext *C, + wmOperator *op, + const wmEvent *event, + PaintStroke **stroke_p) { const Scene *scene = CTX_data_scene(C); Paint *paint = BKE_paint_get_active_from_context(C); @@ -1680,7 +1683,7 @@ int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event, PaintS return OPERATOR_RUNNING_MODAL; } -int paint_stroke_exec(bContext *C, wmOperator *op, PaintStroke *stroke) +wmOperatorStatus paint_stroke_exec(bContext *C, wmOperator *op, PaintStroke *stroke) { /* only when executed for the first time */ if (!stroke->stroke_started) { diff --git a/source/blender/editors/sculpt_paint/paint_utils.cc b/source/blender/editors/sculpt_paint/paint_utils.cc index 2fcc0676d0a..5dd29ae874d 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.cc +++ b/source/blender/editors/sculpt_paint/paint_utils.cc @@ -476,7 +476,7 @@ void paint_sample_color( } } -static int brush_curve_preset_exec(bContext *C, wmOperator *op) +static wmOperatorStatus brush_curve_preset_exec(bContext *C, wmOperator *op) { Brush *br = BKE_paint_brush(BKE_paint_get_active_from_context(C)); @@ -528,7 +528,7 @@ static bool brush_sculpt_curves_falloff_preset_poll(bContext *C) return br && br->curves_sculpt_settings && br->curves_sculpt_settings->curve_parameter_falloff; } -static int brush_sculpt_curves_falloff_preset_exec(bContext *C, wmOperator *op) +static wmOperatorStatus brush_sculpt_curves_falloff_preset_exec(bContext *C, wmOperator *op) { Brush *brush = BKE_paint_brush(BKE_paint_get_active_from_context(C)); CurveMapping *mapping = brush->curves_sculpt_settings->curve_parameter_falloff; @@ -555,7 +555,7 @@ void BRUSH_OT_sculpt_curves_falloff_preset(wmOperatorType *ot) } /* face-select ops */ -static int paint_select_linked_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus paint_select_linked_exec(bContext *C, wmOperator * /*op*/) { paintface_select_linked(C, CTX_data_active_object(C), nullptr, true); ED_region_tag_redraw(CTX_wm_region(C)); @@ -574,7 +574,9 @@ 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, const wmEvent *event) +static wmOperatorStatus paint_select_linked_pick_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { const bool select = !RNA_boolean_get(op->ptr, "deselect"); view3d_operator_needs_gpu(C); @@ -597,7 +599,7 @@ void PAINT_OT_face_select_linked_pick(wmOperatorType *ot) RNA_def_boolean(ot->srna, "deselect", false, "Deselect", "Deselect rather than select items"); } -static int face_select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus face_select_all_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); if (paintface_deselect_all_visible(C, ob, RNA_enum_get(op->ptr, "action"), true)) { @@ -621,7 +623,7 @@ void PAINT_OT_face_select_all(wmOperatorType *ot) WM_operator_properties_select_all(ot); } -static int paint_select_more_exec(bContext *C, wmOperator *op) +static wmOperatorStatus paint_select_more_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); Mesh *mesh = BKE_mesh_from_object(ob); @@ -652,7 +654,7 @@ void PAINT_OT_face_select_more(wmOperatorType *ot) ot->srna, "face_step", true, "Face Step", "Also select faces that only touch on a corner"); } -static int paint_select_less_exec(bContext *C, wmOperator *op) +static wmOperatorStatus paint_select_less_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); Mesh *mesh = BKE_mesh_from_object(ob); @@ -683,7 +685,9 @@ void PAINT_OT_face_select_less(wmOperatorType *ot) ot->srna, "face_step", true, "Face Step", "Also deselect faces that only touch on a corner"); } -static int paintface_select_loop_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus paintface_select_loop_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { const bool select = RNA_boolean_get(op->ptr, "select"); const bool extend = RNA_boolean_get(op->ptr, "extend"); @@ -711,7 +715,7 @@ void PAINT_OT_face_select_loop(wmOperatorType *ot) RNA_def_boolean(ot->srna, "extend", false, "Extend", "Extend the selection"); } -static int vert_select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vert_select_all_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); paintvert_deselect_all_visible(ob, RNA_enum_get(op->ptr, "action"), true); @@ -734,7 +738,7 @@ void PAINT_OT_vert_select_all(wmOperatorType *ot) WM_operator_properties_select_all(ot); } -static int vert_select_ungrouped_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vert_select_ungrouped_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); Mesh *mesh = static_cast(ob->data); @@ -767,7 +771,7 @@ void PAINT_OT_vert_select_ungrouped(wmOperatorType *ot) RNA_def_boolean(ot->srna, "extend", false, "Extend", "Extend the selection"); } -static int paintvert_select_linked_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus paintvert_select_linked_exec(bContext *C, wmOperator * /*op*/) { paintvert_select_linked(C, CTX_data_active_object(C)); ED_region_tag_redraw(CTX_wm_region(C)); @@ -786,7 +790,9 @@ void PAINT_OT_vert_select_linked(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int paintvert_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus paintvert_select_linked_pick_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { const bool select = RNA_boolean_get(op->ptr, "select"); view3d_operator_needs_gpu(C); @@ -814,7 +820,7 @@ void PAINT_OT_vert_select_linked_pick(wmOperatorType *ot) "Whether to select or deselect linked vertices under the cursor"); } -static int paintvert_select_more_exec(bContext *C, wmOperator *op) +static wmOperatorStatus paintvert_select_more_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); Mesh *mesh = BKE_mesh_from_object(ob); @@ -847,7 +853,7 @@ void PAINT_OT_vert_select_more(wmOperatorType *ot) ot->srna, "face_step", true, "Face Step", "Also select faces that only touch on a corner"); } -static int paintvert_select_less_exec(bContext *C, wmOperator *op) +static wmOperatorStatus paintvert_select_less_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); Mesh *mesh = BKE_mesh_from_object(ob); @@ -880,7 +886,7 @@ void PAINT_OT_vert_select_less(wmOperatorType *ot) ot->srna, "face_step", true, "Face Step", "Also deselect faces that only touch on a corner"); } -static int face_select_hide_exec(bContext *C, wmOperator *op) +static wmOperatorStatus face_select_hide_exec(bContext *C, wmOperator *op) { const bool unselected = RNA_boolean_get(op->ptr, "unselected"); Object *ob = CTX_data_active_object(C); @@ -904,7 +910,7 @@ void PAINT_OT_face_select_hide(wmOperatorType *ot) ot->srna, "unselected", false, "Unselected", "Hide unselected rather than selected objects"); } -static int vert_select_hide_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vert_select_hide_exec(bContext *C, wmOperator *op) { const bool unselected = RNA_boolean_get(op->ptr, "unselected"); Object *ob = CTX_data_active_object(C); @@ -931,7 +937,7 @@ void PAINT_OT_vert_select_hide(wmOperatorType *ot) "Hide unselected rather than selected vertices"); } -static int face_vert_reveal_exec(bContext *C, wmOperator *op) +static wmOperatorStatus face_vert_reveal_exec(bContext *C, wmOperator *op) { const bool select = RNA_boolean_get(op->ptr, "select"); Object *ob = CTX_data_active_object(C); diff --git a/source/blender/editors/sculpt_paint/paint_vertex.cc b/source/blender/editors/sculpt_paint/paint_vertex.cc index 191acc3ee6d..f2939e6b761 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.cc +++ b/source/blender/editors/sculpt_paint/paint_vertex.cc @@ -786,7 +786,7 @@ void ED_object_vpaintmode_exit(bContext *C) /** * \note Keep in sync with #wpaint_mode_toggle_exec */ -static int vpaint_mode_toggle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vpaint_mode_toggle_exec(bContext *C, wmOperator *op) { Main &bmain = *CTX_data_main(C); wmMsgBus *mbus = CTX_wm_message_bus(C); @@ -2034,7 +2034,7 @@ static void vpaint_stroke_done(const bContext *C, PaintStroke *stroke) ob.sculpt->cache = nullptr; } -static int vpaint_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus vpaint_invoke(bContext *C, wmOperator *op, const wmEvent *event) { int retval; @@ -2065,7 +2065,7 @@ static int vpaint_invoke(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int vpaint_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vpaint_exec(bContext *C, wmOperator *op) { op->customdata = paint_stroke_new(C, op, @@ -2090,7 +2090,7 @@ static void vpaint_cancel(bContext *C, wmOperator *op) paint_stroke_cancel(C, op, (PaintStroke *)op->customdata); } -static int vpaint_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus vpaint_modal(bContext *C, wmOperator *op, const wmEvent *event) { return paint_stroke_modal(C, op, event, (PaintStroke **)&op->customdata); } @@ -2274,7 +2274,7 @@ bool object_active_color_fill(Object &ob, const float fill_color[4], bool only_s } // namespace blender::ed::sculpt_paint -static int vertex_color_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_color_set_exec(bContext *C, wmOperator *op) { using namespace blender::ed::sculpt_paint; Scene &scene = *CTX_data_scene(C); diff --git a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.cc b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.cc index 508886294c1..c0ecaeddd47 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.cc +++ b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.cc @@ -126,7 +126,7 @@ static bool vertex_paint_from_weight(Object &ob) return true; } -static int vertex_paint_from_weight_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus vertex_paint_from_weight_exec(bContext *C, wmOperator * /*op*/) { Object *obact = CTX_data_active_object(C); if (vertex_paint_from_weight(*obact)) { @@ -220,7 +220,7 @@ static bool vertex_color_smooth(Object &ob) return true; } -static int vertex_color_smooth_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus vertex_color_smooth_exec(bContext *C, wmOperator * /*op*/) { Object *obact = CTX_data_active_object(C); if (vertex_color_smooth(*obact)) { @@ -330,7 +330,7 @@ static void transform_active_color(bContext *C, WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, &obact); } -static int vertex_color_brightness_contrast_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_color_brightness_contrast_exec(bContext *C, wmOperator *op) { Object *obact = CTX_data_active_object(C); @@ -396,7 +396,7 @@ void PAINT_OT_vertex_color_brightness_contrast(wmOperatorType *ot) RNA_def_property_ui_range(prop, min, max, 1, 1); } -static int vertex_color_hsv_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_color_hsv_exec(bContext *C, wmOperator *op) { Object *obact = CTX_data_active_object(C); @@ -451,7 +451,7 @@ void PAINT_OT_vertex_color_hsv(wmOperatorType *ot) RNA_def_float(ot->srna, "v", 1.0f, 0.0f, 2.0f, "Value", "", 0.0f, 2.0f); } -static int vertex_color_invert_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_color_invert_exec(bContext *C, wmOperator *op) { Object *obact = CTX_data_active_object(C); @@ -486,7 +486,7 @@ void PAINT_OT_vertex_color_invert(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int vertex_color_levels_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vertex_color_levels_exec(bContext *C, wmOperator *op) { Object *obact = CTX_data_active_object(C); diff --git a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.cc b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.cc index 27241de95cf..128f14b5a46 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.cc +++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.cc @@ -104,7 +104,7 @@ static bool weight_from_bones_poll(bContext *C) return (ob && (ob->mode & OB_MODE_WEIGHT_PAINT) && BKE_modifiers_is_deformed_by_armature(ob)); } -static int weight_from_bones_exec(bContext *C, wmOperator *op) +static wmOperatorStatus weight_from_bones_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Scene *scene = CTX_data_scene(C); @@ -166,7 +166,7 @@ void PAINT_OT_weight_from_bones(wmOperatorType *ot) * * \note we can't sample front-buffer, weight colors are interpolated too unpredictable. */ -static int weight_sample_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus weight_sample_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Mesh *mesh; @@ -313,7 +313,9 @@ static bool weight_paint_sample_mark_groups(const MDeformVert *dvert, return found; } -static int weight_sample_group_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus weight_sample_group_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); ViewContext vc = ED_view3d_viewcontext_init(C, depsgraph); @@ -492,7 +494,7 @@ static bool weight_paint_set(Object *ob, float paintweight) return true; } -static int weight_paint_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus weight_paint_set_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Object *obact = CTX_data_active_object(C); @@ -694,13 +696,15 @@ static void gradientVertInit__mapFunc(void *user_data, gradientVert_update(grad_data, index); } -static int paint_weight_gradient_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus paint_weight_gradient_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { wmGesture *gesture = static_cast(op->customdata); WPGradient_vertStoreBase *vert_cache = static_cast( gesture->user_data.data); Object *ob = CTX_data_active_object(C); - int ret; + wmOperatorStatus ret; if (BKE_object_defgroup_active_is_locked(ob)) { BKE_report(op->reports, RPT_WARNING, "Active group is locked, aborting"); @@ -742,7 +746,7 @@ static int paint_weight_gradient_modal(bContext *C, wmOperator *op, const wmEven return ret; } -static int paint_weight_gradient_exec(bContext *C, wmOperator *op) +static wmOperatorStatus paint_weight_gradient_exec(bContext *C, wmOperator *op) { using namespace blender; wmGesture *gesture = static_cast(op->customdata); @@ -871,9 +875,11 @@ static int paint_weight_gradient_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int paint_weight_gradient_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus paint_weight_gradient_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { - int ret; + wmOperatorStatus ret; if (ED_wpaint_ensure_data(C, op->reports, eWPaintFlag(0), nullptr) == false) { return OPERATOR_CANCELLED; diff --git a/source/blender/editors/sculpt_paint/paint_weight.cc b/source/blender/editors/sculpt_paint/paint_weight.cc index 74c6234d22d..1ddd11ba17d 100644 --- a/source/blender/editors/sculpt_paint/paint_weight.cc +++ b/source/blender/editors/sculpt_paint/paint_weight.cc @@ -1627,7 +1627,7 @@ bool weight_paint_poll_ignore_tool(bContext *C) /** * \note Keep in sync with #vpaint_mode_toggle_exec */ -static int wpaint_mode_toggle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wpaint_mode_toggle_exec(bContext *C, wmOperator *op) { Main &bmain = *CTX_data_main(C); wmMsgBus *mbus = CTX_wm_message_bus(C); @@ -1922,7 +1922,7 @@ static void wpaint_stroke_done(const bContext *C, PaintStroke * /*stroke*/) ob.sculpt->cache = nullptr; } -static int wpaint_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus wpaint_invoke(bContext *C, wmOperator *op, const wmEvent *event) { int retval; @@ -1947,7 +1947,7 @@ static int wpaint_invoke(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int wpaint_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wpaint_exec(bContext *C, wmOperator *op) { op->customdata = paint_stroke_new(C, op, @@ -1972,7 +1972,7 @@ static void wpaint_cancel(bContext *C, wmOperator *op) paint_stroke_cancel(C, op, (PaintStroke *)op->customdata); } -static int wpaint_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus wpaint_modal(bContext *C, wmOperator *op, const wmEvent *event) { return paint_stroke_modal(C, op, event, (PaintStroke **)&op->customdata); } diff --git a/source/blender/editors/sculpt_paint/sculpt.cc b/source/blender/editors/sculpt_paint/sculpt.cc index 3f9474796cc..69d681da623 100644 --- a/source/blender/editors/sculpt_paint/sculpt.cc +++ b/source/blender/editors/sculpt_paint/sculpt.cc @@ -5741,11 +5741,13 @@ static void stroke_done(const bContext *C, PaintStroke * /*stroke*/) brush_exit_tex(sd); } -static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sculpt_brush_stroke_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { PaintStroke *stroke; int ignore_background_click; - int retval; + wmOperatorStatus retval; Object &ob = *CTX_data_active_object(C); Scene &scene = *CTX_data_scene(C); const View3D *v3d = CTX_wm_view3d(C); @@ -5821,7 +5823,7 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, const wmEvent return OPERATOR_RUNNING_MODAL; } -static int sculpt_brush_stroke_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sculpt_brush_stroke_exec(bContext *C, wmOperator *op) { brush_stroke_init(C); @@ -5863,7 +5865,7 @@ static void sculpt_brush_stroke_cancel(bContext *C, wmOperator *op) brush_exit_tex(sd); } -static int brush_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus brush_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event) { return paint_stroke_modal(C, op, event, (PaintStroke **)&op->customdata); } diff --git a/source/blender/editors/sculpt_paint/sculpt_cloth.cc b/source/blender/editors/sculpt_paint/sculpt_cloth.cc index c3d0ca594e6..0d922a31797 100644 --- a/source/blender/editors/sculpt_paint/sculpt_cloth.cc +++ b/source/blender/editors/sculpt_paint/sculpt_cloth.cc @@ -2278,7 +2278,9 @@ static void apply_filter_forces_bmesh(const Depsgraph &depsgraph, } } -static int sculpt_cloth_filter_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sculpt_cloth_filter_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { Object &object = *CTX_data_active_object(C); Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); @@ -2393,7 +2395,9 @@ static int sculpt_cloth_filter_modal(bContext *C, wmOperator *op, const wmEvent return OPERATOR_RUNNING_MODAL; } -static int sculpt_cloth_filter_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sculpt_cloth_filter_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { const Scene &scene = *CTX_data_scene(C); Object &ob = *CTX_data_active_object(C); diff --git a/source/blender/editors/sculpt_paint/sculpt_detail.cc b/source/blender/editors/sculpt_paint/sculpt_detail.cc index 361a8799fe7..455cca95674 100644 --- a/source/blender/editors/sculpt_paint/sculpt_detail.cc +++ b/source/blender/editors/sculpt_paint/sculpt_detail.cc @@ -99,7 +99,7 @@ static bool sculpt_and_dynamic_topology_poll(bContext *C) /** \name Detail Flood Fill * \{ */ -static int sculpt_detail_flood_fill_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sculpt_detail_flood_fill_exec(bContext *C, wmOperator *op) { const Scene &scene = *CTX_data_scene(C); const Depsgraph &depsgraph = *CTX_data_depsgraph_pointer(C); @@ -287,7 +287,9 @@ static void sample_detail_dyntopo(bContext *C, ViewContext *vc, const int mval[2 } } -static int sample_detail(bContext *C, const int event_xy[2], const SampleDetailModeType mode) +static wmOperatorStatus sample_detail(bContext *C, + const int event_xy[2], + const SampleDetailModeType mode) { /* Find 3D view to pick from. */ bScreen *screen = CTX_wm_screen(C); @@ -356,7 +358,7 @@ static int sample_detail(bContext *C, const int event_xy[2], const SampleDetailM return OPERATOR_FINISHED; } -static int sculpt_sample_detail_size_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sculpt_sample_detail_size_exec(bContext *C, wmOperator *op) { int ss_co[2]; RNA_int_get_array(op->ptr, "location", ss_co); @@ -364,7 +366,9 @@ static int sculpt_sample_detail_size_exec(bContext *C, wmOperator *op) return sample_detail(C, ss_co, mode); } -static int sculpt_sample_detail_size_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus sculpt_sample_detail_size_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { ED_workspace_status_text(C, IFACE_("Click on the mesh to set the detail")); WM_cursor_modal_set(CTX_wm_window(C), WM_CURSOR_EYEDROPPER); @@ -372,7 +376,9 @@ static int sculpt_sample_detail_size_invoke(bContext *C, wmOperator *op, const w return OPERATOR_RUNNING_MODAL; } -static int sculpt_sample_detail_size_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sculpt_sample_detail_size_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { switch (event->type) { case LEFTMOUSE: @@ -721,7 +727,9 @@ static void dyntopo_detail_size_update_header(bContext *C, status.item_bool(IFACE_("Precision Mode"), cd->accurate_mode, ICON_EVENT_SHIFT); } -static int dyntopo_detail_size_edit_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus dyntopo_detail_size_edit_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { Object &active_object = *CTX_data_active_object(C); SculptSession &ss = *active_object.sculpt; @@ -800,7 +808,9 @@ static float dyntopo_detail_size_initial_value(const Sculpt *sd, const eDyntopoD return sd->detail_size; } -static int dyntopo_detail_size_edit_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus dyntopo_detail_size_edit_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { const ToolSettings *tool_settings = CTX_data_tool_settings(C); Sculpt *sd = tool_settings->sculpt; diff --git a/source/blender/editors/sculpt_paint/sculpt_dyntopo.cc b/source/blender/editors/sculpt_paint/sculpt_dyntopo.cc index 1b67611d889..35164bb9bf4 100644 --- a/source/blender/editors/sculpt_paint/sculpt_dyntopo.cc +++ b/source/blender/editors/sculpt_paint/sculpt_dyntopo.cc @@ -197,7 +197,7 @@ static void enable_with_undo(Main &bmain, Depsgraph &depsgraph, const Scene &sce } } -static int sculpt_dynamic_topology_toggle_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sculpt_dynamic_topology_toggle_exec(bContext *C, wmOperator * /*op*/) { Main &bmain = *CTX_data_main(C); Depsgraph &depsgraph = *CTX_data_ensure_evaluated_depsgraph(C); @@ -220,7 +220,7 @@ static int sculpt_dynamic_topology_toggle_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -static int dyntopo_warning_popup(bContext *C, wmOperatorType *ot, enum WarnFlag flag) +static wmOperatorStatus dyntopo_warning_popup(bContext *C, wmOperatorType *ot, enum WarnFlag flag) { uiPopupMenu *pup = UI_popup_menu_begin(C, IFACE_("Warning!"), ICON_ERROR); uiLayout *layout = UI_popup_menu_layout(pup); @@ -314,9 +314,9 @@ WarnFlag check_attribute_warning(Scene &scene, Object &ob) return flag; } -static int sculpt_dynamic_topology_toggle_invoke(bContext *C, - wmOperator *op, - const wmEvent * /*event*/) +static wmOperatorStatus sculpt_dynamic_topology_toggle_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Object &ob = *CTX_data_active_object(C); SculptSession &ss = *ob.sculpt; diff --git a/source/blender/editors/sculpt_paint/sculpt_expand.cc b/source/blender/editors/sculpt_paint/sculpt_expand.cc index e2aa55050fc..94f8d8527cf 100644 --- a/source/blender/editors/sculpt_paint/sculpt_expand.cc +++ b/source/blender/editors/sculpt_paint/sculpt_expand.cc @@ -2288,7 +2288,7 @@ static int active_face_set_id_get(Object &object, Cache &expand_cache) return SCULPT_FACE_SET_NONE; } -static int sculpt_expand_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sculpt_expand_modal(bContext *C, wmOperator *op, const wmEvent *event) { Object &ob = *CTX_data_active_object(C); SculptSession &ss = *ob.sculpt; @@ -2651,7 +2651,7 @@ static bool any_nonzero_mask(const Object &object) return false; } -static int sculpt_expand_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sculpt_expand_invoke(bContext *C, wmOperator *op, const wmEvent *event) { const Scene &scene = *CTX_data_scene(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); diff --git a/source/blender/editors/sculpt_paint/sculpt_face_set.cc b/source/blender/editors/sculpt_paint/sculpt_face_set.cc index 526abe0c9c7..50c762e4a8a 100644 --- a/source/blender/editors/sculpt_paint/sculpt_face_set.cc +++ b/source/blender/editors/sculpt_paint/sculpt_face_set.cc @@ -400,7 +400,7 @@ static void clear_face_sets(const Depsgraph &depsgraph, Object &object, const In attributes.remove(".sculpt_face_set"); } -static int create_op_exec(bContext *C, wmOperator *op) +static wmOperatorStatus create_op_exec(bContext *C, wmOperator *op) { const Scene &scene = *CTX_data_scene(C); Object &object = *CTX_data_active_object(C); @@ -697,7 +697,7 @@ Set gather_hidden_face_sets(const Span hide_poly, const Span fac return hidden_face_sets; } -static int init_op_exec(bContext *C, wmOperator *op) +static wmOperatorStatus init_op_exec(bContext *C, wmOperator *op) { const Scene &scene = *CTX_data_scene(C); Object &ob = *CTX_data_active_object(C); @@ -981,7 +981,7 @@ static void show_all(Depsgraph &depsgraph, Object &object, const IndexMask &node } } -static int change_visibility_exec(bContext *C, wmOperator *op) +static wmOperatorStatus change_visibility_exec(bContext *C, wmOperator *op) { const Scene &scene = *CTX_data_scene(C); Object &object = *CTX_data_active_object(C); @@ -1088,7 +1088,7 @@ static int change_visibility_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int change_visibility_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus change_visibility_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Object &ob = *CTX_data_active_object(C); @@ -1141,7 +1141,7 @@ void SCULPT_OT_face_set_change_visibility(wmOperatorType *ot) RNA_def_enum(ot->srna, "mode", modes, int(VisibilityMode::Toggle), "Mode", ""); } -static int randomize_colors_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus randomize_colors_exec(bContext *C, wmOperator * /*op*/) { Object &ob = *CTX_data_active_object(C); @@ -1517,7 +1517,7 @@ static bool edit_op_init(bContext *C, wmOperator *op) return true; } -static int edit_op_exec(bContext *C, wmOperator *op) +static wmOperatorStatus edit_op_exec(bContext *C, wmOperator *op) { if (!edit_op_init(C, op)) { return OPERATOR_CANCELLED; @@ -1550,7 +1550,7 @@ static int edit_op_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int edit_op_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus edit_op_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); Object &ob = *CTX_data_active_object(C); @@ -1810,7 +1810,7 @@ static void init_operation(gesture::GestureData &gesture_data, wmOperator & /*op face_set_operation->new_face_set_id = face_set::find_next_available_id(object); } -static int gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event) { const View3D *v3d = CTX_wm_view3d(C); const Base *base = CTX_data_active_base(C); @@ -1821,7 +1821,7 @@ static int gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event) return WM_gesture_box_invoke(C, op, event); } -static int gesture_box_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gesture_box_exec(bContext *C, wmOperator *op) { std::unique_ptr gesture_data = gesture::init_from_box(C, op); if (!gesture_data) { @@ -1832,7 +1832,7 @@ static int gesture_box_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event) { const View3D *v3d = CTX_wm_view3d(C); const Base *base = CTX_data_active_base(C); @@ -1843,7 +1843,7 @@ static int gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *even return WM_gesture_lasso_invoke(C, op, event); } -static int gesture_lasso_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gesture_lasso_exec(bContext *C, wmOperator *op) { std::unique_ptr gesture_data = gesture::init_from_lasso(C, op); if (!gesture_data) { @@ -1854,7 +1854,7 @@ static int gesture_lasso_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int gesture_line_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus gesture_line_invoke(bContext *C, wmOperator *op, const wmEvent *event) { const View3D *v3d = CTX_wm_view3d(C); const Base *base = CTX_data_active_base(C); @@ -1865,7 +1865,7 @@ static int gesture_line_invoke(bContext *C, wmOperator *op, const wmEvent *event return WM_gesture_straightline_active_side_invoke(C, op, event); } -static int gesture_line_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gesture_line_exec(bContext *C, wmOperator *op) { std::unique_ptr gesture_data = gesture::init_from_line(C, op); if (!gesture_data) { @@ -1876,7 +1876,7 @@ static int gesture_line_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int gesture_polyline_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus gesture_polyline_invoke(bContext *C, wmOperator *op, const wmEvent *event) { const View3D *v3d = CTX_wm_view3d(C); const Base *base = CTX_data_active_base(C); @@ -1887,7 +1887,7 @@ static int gesture_polyline_invoke(bContext *C, wmOperator *op, const wmEvent *e return WM_gesture_polyline_invoke(C, op, event); } -static int gesture_polyline_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gesture_polyline_exec(bContext *C, wmOperator *op) { std::unique_ptr gesture_data = gesture::init_from_polyline(C, op); if (!gesture_data) { diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_color.cc b/source/blender/editors/sculpt_paint/sculpt_filter_color.cc index 1ef35b344f5..2f503bd4270 100644 --- a/source/blender/editors/sculpt_paint/sculpt_filter_color.cc +++ b/source/blender/editors/sculpt_paint/sculpt_filter_color.cc @@ -432,7 +432,9 @@ static void sculpt_color_filter_end(bContext *C, Object &ob) flush_update_done(C, ob, UpdateType::Color); } -static int sculpt_color_filter_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sculpt_color_filter_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { Object &ob = *CTX_data_active_object(C); SculptSession &ss = *ob.sculpt; @@ -512,7 +514,7 @@ static int sculpt_color_filter_init(bContext *C, wmOperator *op) return OPERATOR_PASS_THROUGH; } -static int sculpt_color_filter_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sculpt_color_filter_exec(bContext *C, wmOperator *op) { Object &ob = *CTX_data_active_object(C); @@ -526,7 +528,9 @@ static int sculpt_color_filter_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sculpt_color_filter_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sculpt_color_filter_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Object &ob = *CTX_data_active_object(C); View3D *v3d = CTX_wm_view3d(C); diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_mask.cc b/source/blender/editors/sculpt_paint/sculpt_filter_mask.cc index 2156298f4d5..f5670507646 100644 --- a/source/blender/editors/sculpt_paint/sculpt_filter_mask.cc +++ b/source/blender/editors/sculpt_paint/sculpt_filter_mask.cc @@ -700,7 +700,7 @@ static bool decrease_contrast_mask_bmesh(const Depsgraph &depsgraph, return true; } -static int sculpt_mask_filter_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sculpt_mask_filter_exec(bContext *C, wmOperator *op) { const Scene &scene = *CTX_data_scene(C); Object &ob = *CTX_data_active_object(C); diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_mesh.cc b/source/blender/editors/sculpt_paint/sculpt_filter_mesh.cc index d41dd1d9266..573ef07a5e3 100644 --- a/source/blender/editors/sculpt_paint/sculpt_filter_mesh.cc +++ b/source/blender/editors/sculpt_paint/sculpt_filter_mesh.cc @@ -2238,9 +2238,9 @@ static void sculpt_mesh_filter_end(bContext *C) flush_update_done(C, ob, UpdateType::Position); } -static int sculpt_mesh_filter_confirm(SculptSession &ss, - wmOperator *op, - const MeshFilterType filter_type) +static wmOperatorStatus sculpt_mesh_filter_confirm(SculptSession &ss, + wmOperator *op, + const MeshFilterType filter_type) { float initial_strength = ss.filter_cache->start_filter_strength; /* Don't update strength property if we're storing an event history. */ @@ -2267,7 +2267,7 @@ static void sculpt_mesh_filter_cancel(bContext *C, wmOperator * /*op*/) pbvh->update_bounds(depsgraph, ob); } -static int sculpt_mesh_filter_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sculpt_mesh_filter_modal(bContext *C, wmOperator *op, const wmEvent *event) { Object &ob = *CTX_data_active_object(C); Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); @@ -2278,7 +2278,7 @@ static int sculpt_mesh_filter_modal(bContext *C, wmOperator *op, const wmEvent * sculpt_mesh_update_status_bar(C, op); if (event->type == EVT_MODAL_MAP) { - int ret = OPERATOR_FINISHED; + wmOperatorStatus ret = OPERATOR_FINISHED; switch (event->val) { case FILTER_MESH_MODAL_CANCEL: sculpt_mesh_filter_cancel(C, op); @@ -2379,7 +2379,7 @@ static void sculpt_filter_specific_init(const Depsgraph &depsgraph, } /* Returns OPERATOR_PASS_THROUGH on success. */ -static int sculpt_mesh_filter_start(bContext *C, wmOperator *op) +static wmOperatorStatus sculpt_mesh_filter_start(bContext *C, wmOperator *op) { const Scene &scene = *CTX_data_scene(C); Object &ob = *CTX_data_active_object(C); @@ -2458,10 +2458,12 @@ static int sculpt_mesh_filter_start(bContext *C, wmOperator *op) return OPERATOR_PASS_THROUGH; } -static int sculpt_mesh_filter_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sculpt_mesh_filter_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { RNA_int_set_array(op->ptr, "start_mouse", event->mval); - int ret = sculpt_mesh_filter_start(C, op); + wmOperatorStatus ret = sculpt_mesh_filter_start(C, op); if (ret == OPERATOR_PASS_THROUGH) { WM_event_add_modal_handler(C, op); @@ -2471,9 +2473,9 @@ static int sculpt_mesh_filter_invoke(bContext *C, wmOperator *op, const wmEvent return ret; } -static int sculpt_mesh_filter_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sculpt_mesh_filter_exec(bContext *C, wmOperator *op) { - int ret = sculpt_mesh_filter_start(C, op); + wmOperatorStatus ret = sculpt_mesh_filter_start(C, op); if (ret == OPERATOR_PASS_THROUGH) { int iterations = RNA_int_get(op->ptr, "iteration_count"); diff --git a/source/blender/editors/sculpt_paint/sculpt_mask_init.cc b/source/blender/editors/sculpt_paint/sculpt_mask_init.cc index 0a6cb008925..d31718493dd 100644 --- a/source/blender/editors/sculpt_paint/sculpt_mask_init.cc +++ b/source/blender/editors/sculpt_paint/sculpt_mask_init.cc @@ -104,7 +104,7 @@ static void init_mask_grids( BKE_subdiv_ccg_average_grids(subdiv_ccg); } -static int sculpt_mask_init_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sculpt_mask_init_exec(bContext *C, wmOperator *op) { const View3D *v3d = CTX_wm_view3d(C); const Base *base = CTX_data_active_base(C); diff --git a/source/blender/editors/sculpt_paint/sculpt_ops.cc b/source/blender/editors/sculpt_paint/sculpt_ops.cc index 14de66f817e..b6df4d79deb 100644 --- a/source/blender/editors/sculpt_paint/sculpt_ops.cc +++ b/source/blender/editors/sculpt_paint/sculpt_ops.cc @@ -81,7 +81,7 @@ namespace blender::ed::sculpt_paint { /** \name Set Persistent Base Operator * \{ */ -static int set_persistent_base_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus set_persistent_base_exec(bContext *C, wmOperator * /*op*/) { Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); Object &ob = *CTX_data_active_object(C); @@ -162,7 +162,7 @@ static void SCULPT_OT_set_persistent_base(wmOperatorType *ot) /** \name Optimize Operator * \{ */ -static int optimize_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus optimize_exec(bContext *C, wmOperator * /*op*/) { Object &ob = *CTX_data_active_object(C); @@ -212,7 +212,7 @@ static bool no_multires_poll(bContext *C) return false; } -static int symmetrize_exec(bContext *C, wmOperator *op) +static wmOperatorStatus symmetrize_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); const Scene &scene = *CTX_data_scene(C); @@ -540,7 +540,7 @@ void object_sculpt_mode_exit(bContext *C, Depsgraph &depsgraph) object_sculpt_mode_exit(bmain, depsgraph, scene, ob); } -static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sculpt_mode_toggle_exec(bContext *C, wmOperator *op) { wmMsgBus *mbus = CTX_wm_message_bus(C); Main &bmain = *CTX_data_main(C); @@ -621,7 +621,7 @@ static void SCULPT_OT_sculptmode_toggle(wmOperatorType *ot) /** \name Sample Color Operator * \{ */ -static int sample_color_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus sample_color_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { Sculpt &sd = *CTX_data_tool_settings(C)->sculpt; Scene &scene = *CTX_data_scene(C); @@ -812,7 +812,7 @@ static void mask_by_color_full_mesh(const Depsgraph &depsgraph, }); } -static int mask_by_color(bContext *C, wmOperator *op, const float2 region_location) +static wmOperatorStatus mask_by_color(bContext *C, wmOperator *op, const float2 region_location) { const Scene &scene = *CTX_data_scene(C); Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); @@ -870,14 +870,14 @@ static int mask_by_color(bContext *C, wmOperator *op, const float2 region_locati return OPERATOR_FINISHED; } -static int mask_by_color_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mask_by_color_exec(bContext *C, wmOperator *op) { int2 mval; RNA_int_get_array(op->ptr, "location", mval); return mask_by_color(C, op, float2(mval[0], mval[1])); } -static int mask_by_color_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus mask_by_color_invoke(bContext *C, wmOperator *op, const wmEvent *event) { RNA_int_set_array(op->ptr, "location", event->mval); return mask_by_color(C, op, float2(event->mval[0], event->mval[1])); @@ -1177,7 +1177,7 @@ static void apply_mask_from_settings(const Depsgraph &depsgraph, } } -static int mask_from_cavity_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mask_from_cavity_exec(bContext *C, wmOperator *op) { const Scene &scene = *CTX_data_scene(C); Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); @@ -1371,7 +1371,7 @@ static void SCULPT_OT_mask_from_cavity(wmOperatorType *ot) enum class MaskBoundaryMode : int8_t { Mesh, FaceSets }; -static int mask_from_boundary_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mask_from_boundary_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); Object &ob = *CTX_data_active_object(C); diff --git a/source/blender/editors/sculpt_paint/sculpt_project.cc b/source/blender/editors/sculpt_paint/sculpt_project.cc index ea95d08cc6f..f6f55e10d23 100644 --- a/source/blender/editors/sculpt_paint/sculpt_project.cc +++ b/source/blender/editors/sculpt_paint/sculpt_project.cc @@ -222,7 +222,7 @@ static void init_operation(gesture::GestureData &gesture_data, wmOperator & /*op project_operation->operation.end = gesture_end; } -static int gesture_line_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus gesture_line_invoke(bContext *C, wmOperator *op, const wmEvent *event) { const View3D *v3d = CTX_wm_view3d(C); const Base *base = CTX_data_active_base(C); @@ -233,7 +233,7 @@ static int gesture_line_invoke(bContext *C, wmOperator *op, const wmEvent *event return WM_gesture_straightline_active_side_invoke(C, op, event); } -static int gesture_line_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gesture_line_exec(bContext *C, wmOperator *op) { std::unique_ptr gesture_data = gesture::init_from_line(C, op); if (!gesture_data) { diff --git a/source/blender/editors/sculpt_paint/sculpt_transform.cc b/source/blender/editors/sculpt_paint/sculpt_transform.cc index 1be3459edf6..38fd1c1f244 100644 --- a/source/blender/editors/sculpt_paint/sculpt_transform.cc +++ b/source/blender/editors/sculpt_paint/sculpt_transform.cc @@ -907,7 +907,7 @@ static float3 average_mask_border_position(const Depsgraph &depsgraph, return float3(0); } -static int set_pivot_position_exec(bContext *C, wmOperator *op) +static wmOperatorStatus set_pivot_position_exec(bContext *C, wmOperator *op) { Object &ob = *CTX_data_active_object(C); SculptSession &ss = *ob.sculpt; @@ -963,7 +963,9 @@ static int set_pivot_position_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int set_pivot_position_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus set_pivot_position_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { RNA_float_set(op->ptr, "mouse_x", event->mval[0]); RNA_float_set(op->ptr, "mouse_y", event->mval[1]); diff --git a/source/blender/editors/sculpt_paint/sculpt_trim.cc b/source/blender/editors/sculpt_paint/sculpt_trim.cc index 686981991cc..45e4324eee0 100644 --- a/source/blender/editors/sculpt_paint/sculpt_trim.cc +++ b/source/blender/editors/sculpt_paint/sculpt_trim.cc @@ -797,7 +797,7 @@ static void initialize_cursor_info(bContext &C, } } -static int gesture_box_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gesture_box_exec(bContext *C, wmOperator *op) { if (!can_exec(*C, *op->reports)) { return OPERATOR_CANCELLED; @@ -817,7 +817,7 @@ static int gesture_box_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (!can_invoke(*C)) { return OPERATOR_CANCELLED; @@ -828,7 +828,7 @@ static int gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event) return WM_gesture_box_invoke(C, op, event); } -static int gesture_lasso_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gesture_lasso_exec(bContext *C, wmOperator *op) { if (!can_exec(*C, *op->reports)) { return OPERATOR_CANCELLED; @@ -848,7 +848,7 @@ static int gesture_lasso_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (!can_invoke(*C)) { return OPERATOR_CANCELLED; @@ -859,7 +859,7 @@ static int gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *even return WM_gesture_lasso_invoke(C, op, event); } -static int gesture_line_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gesture_line_exec(bContext *C, wmOperator *op) { if (!can_exec(*C, *op->reports)) { return OPERATOR_CANCELLED; @@ -879,7 +879,7 @@ static int gesture_line_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int gesture_line_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus gesture_line_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (!can_invoke(*C)) { return OPERATOR_CANCELLED; @@ -890,7 +890,7 @@ static int gesture_line_invoke(bContext *C, wmOperator *op, const wmEvent *event return WM_gesture_straightline_active_side_invoke(C, op, event); } -static int gesture_polyline_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gesture_polyline_exec(bContext *C, wmOperator *op) { if (!can_exec(*C, *op->reports)) { return OPERATOR_CANCELLED; @@ -910,7 +910,7 @@ static int gesture_polyline_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int gesture_polyline_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus gesture_polyline_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (!can_invoke(*C)) { return OPERATOR_CANCELLED; diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.cc b/source/blender/editors/sculpt_paint/sculpt_uv.cc index 26c5fcc5f5e..b771bcbfe05 100644 --- a/source/blender/editors/sculpt_paint/sculpt_uv.cc +++ b/source/blender/editors/sculpt_paint/sculpt_uv.cc @@ -912,7 +912,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, const wm return static_cast(op->customdata); } -static int uv_sculpt_stroke_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus uv_sculpt_stroke_invoke(bContext *C, wmOperator *op, const wmEvent *event) { UvSculptData *data; Object *obedit = CTX_data_edit_object(C); @@ -934,7 +934,7 @@ static int uv_sculpt_stroke_invoke(bContext *C, wmOperator *op, const wmEvent *e return OPERATOR_RUNNING_MODAL; } -static int uv_sculpt_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus 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.cc b/source/blender/editors/sound/sound_ops.cc index 6136dcdaad9..2f6b38629d8 100644 --- a/source/blender/editors/sound/sound_ops.cc +++ b/source/blender/editors/sound/sound_ops.cc @@ -71,7 +71,7 @@ static void sound_open_init(bContext *C, wmOperator *op) } #ifdef WITH_AUDASPACE -static int sound_open_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sound_open_exec(bContext *C, wmOperator *op) { char filepath[FILE_MAX]; bSound *sound; @@ -114,7 +114,7 @@ static int sound_open_exec(bContext *C, wmOperator *op) #else /* WITH_AUDASPACE */ -static int sound_open_exec(bContext * /*C*/, wmOperator *op) +static wmOperatorStatus sound_open_exec(bContext * /*C*/, wmOperator *op) { BKE_report(op->reports, RPT_ERROR, "Compiled without sound support"); @@ -123,7 +123,7 @@ static int sound_open_exec(bContext * /*C*/, wmOperator *op) #endif -static int sound_open_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus 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); @@ -255,7 +255,7 @@ static void sound_update_animation_flags(Scene *scene) } } -static int sound_update_animation_flags_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sound_update_animation_flags_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); @@ -288,7 +288,7 @@ static void SOUND_OT_update_animation_flags(wmOperatorType *ot) /* ******************************************************* */ -static int sound_bake_animation_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sound_bake_animation_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); /* NOTE: We will be forcefully evaluating dependency graph at every frame, so no need to ensure @@ -328,7 +328,7 @@ static void SOUND_OT_bake_animation(wmOperatorType *ot) /******************** mixdown operator ********************/ -static int sound_mixdown_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sound_mixdown_exec(bContext *C, wmOperator *op) { #ifdef WITH_AUDASPACE char filepath[FILE_MAX]; @@ -488,7 +488,7 @@ static bool sound_mixdown_check(bContext * /*C*/, wmOperator *op) #endif /* WITH_AUDASPACE */ -static int sound_mixdown_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus 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); @@ -785,7 +785,7 @@ static bool sound_poll(bContext *C) } /********************* pack operator *********************/ -static int sound_pack_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sound_pack_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Editing *ed = CTX_data_scene(C)->ed; @@ -826,7 +826,7 @@ static void SOUND_OT_pack(wmOperatorType *ot) /********************* unpack operator *********************/ -static int sound_unpack_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sound_unpack_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); int method = RNA_enum_get(op->ptr, "method"); @@ -859,7 +859,7 @@ static int sound_unpack_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sound_unpack_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus sound_unpack_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { Editing *ed = CTX_data_scene(C)->ed; bSound *sound; diff --git a/source/blender/editors/space_action/action_data.cc b/source/blender/editors/space_action/action_data.cc index 919ecfb5b76..d5f4adee90e 100644 --- a/source/blender/editors/space_action/action_data.cc +++ b/source/blender/editors/space_action/action_data.cc @@ -216,7 +216,7 @@ static bool action_new_poll(bContext *C) return false; } -static int action_new_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus action_new_exec(bContext *C, wmOperator * /*op*/) { PointerRNA ptr; PropertyRNA *prop; @@ -339,7 +339,7 @@ static bool action_pushdown_poll(bContext *C) return (adt->flag & ADT_NLA_EDIT_ON) == 0; } -static int action_pushdown_exec(bContext *C, wmOperator *op) +static wmOperatorStatus action_pushdown_exec(bContext *C, wmOperator *op) { SpaceAction *saction = (SpaceAction *)CTX_wm_space_data(C); ID *adt_id_owner = nullptr; @@ -399,7 +399,7 @@ void ACTION_OT_push_down(wmOperatorType *ot) /** \name Action Stash Operator * \{ */ -static int action_stash_exec(bContext *C, wmOperator *op) +static wmOperatorStatus action_stash_exec(bContext *C, wmOperator *op) { SpaceAction *saction = (SpaceAction *)CTX_wm_space_data(C); ID *adt_id_owner = nullptr; @@ -502,7 +502,7 @@ static bool action_stash_create_poll(bContext *C) return false; } -static int action_stash_create_exec(bContext *C, wmOperator *op) +static wmOperatorStatus action_stash_create_exec(bContext *C, wmOperator *op) { SpaceAction *saction = (SpaceAction *)CTX_wm_space_data(C); ID *adt_id_owner = nullptr; @@ -691,7 +691,7 @@ static bool action_unlink_poll(bContext *C) return false; } -static int action_unlink_exec(bContext *C, wmOperator *op) +static wmOperatorStatus action_unlink_exec(bContext *C, wmOperator *op) { ID *animated_id = nullptr; AnimData *adt = ED_actedit_animdata_from_context(C, &animated_id); @@ -707,7 +707,7 @@ static int action_unlink_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int action_unlink_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus action_unlink_invoke(bContext *C, wmOperator *op, const wmEvent *event) { /* NOTE: this is hardcoded to match the behavior for the unlink button * (in `interface_templates.cc`). */ @@ -864,7 +864,7 @@ static bool action_layer_next_poll(bContext *C) return false; } -static int action_layer_next_exec(bContext *C, wmOperator *op) +static wmOperatorStatus action_layer_next_exec(bContext *C, wmOperator *op) { ID *animated_id = nullptr; AnimData *adt = ED_actedit_animdata_from_context(C, &animated_id); @@ -980,7 +980,7 @@ static bool action_layer_prev_poll(bContext *C) return false; } -static int action_layer_prev_exec(bContext *C, wmOperator *op) +static wmOperatorStatus action_layer_prev_exec(bContext *C, wmOperator *op) { ID *animated_id = nullptr; AnimData *adt = ED_actedit_animdata_from_context(C, &animated_id); diff --git a/source/blender/editors/space_action/action_edit.cc b/source/blender/editors/space_action/action_edit.cc index 1a19d496f69..d98b2798133 100644 --- a/source/blender/editors/space_action/action_edit.cc +++ b/source/blender/editors/space_action/action_edit.cc @@ -95,7 +95,7 @@ static bool act_markers_make_local_poll(bContext *C) return ED_markers_get_first_selected(ED_context_get_markers(C)) != nullptr; } -static int act_markers_make_local_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus act_markers_make_local_exec(bContext *C, wmOperator * /*op*/) { ListBase *markers = ED_context_get_markers(C); @@ -257,7 +257,7 @@ static bool get_keyframe_extents(bAnimContext *ac, float *min, float *max, const /** \name View: Automatic Preview-Range Operator * \{ */ -static int actkeys_previewrange_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus actkeys_previewrange_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; Scene *scene; @@ -366,7 +366,7 @@ static bool actkeys_channels_get_selected_extents(bAnimContext *ac, float *r_min return (found != 0); } -static int actkeys_viewall(bContext *C, const bool only_sel) +static wmOperatorStatus actkeys_viewall(bContext *C, const bool only_sel) { bAnimContext ac; View2D *v2d; @@ -434,13 +434,13 @@ static int actkeys_viewall(bContext *C, const bool only_sel) /* ......... */ -static int actkeys_viewall_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus actkeys_viewall_exec(bContext *C, wmOperator * /*op*/) { /* whole range */ return actkeys_viewall(C, false); } -static int actkeys_viewsel_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus actkeys_viewsel_exec(bContext *C, wmOperator * /*op*/) { /* only selected */ return actkeys_viewall(C, true); @@ -484,7 +484,7 @@ void ACTION_OT_view_selected(wmOperatorType *ot) /** \name View: Frame Operator * \{ */ -static int actkeys_view_frame_exec(bContext *C, wmOperator *op) +static wmOperatorStatus actkeys_view_frame_exec(bContext *C, wmOperator *op) { const int smooth_viewtx = WM_operator_smooth_viewtx_get(op); ANIM_center_frame(C, smooth_viewtx); @@ -600,7 +600,7 @@ static blender::ed::greasepencil::KeyframeClipboard &get_grease_pencil_keyframe_ return clipboard; } -static int actkeys_copy_exec(bContext *C, wmOperator *op) +static wmOperatorStatus actkeys_copy_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -656,7 +656,7 @@ void ACTION_OT_copy(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int actkeys_paste_exec(bContext *C, wmOperator *op) +static wmOperatorStatus actkeys_paste_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -972,7 +972,7 @@ static void insert_action_keys(bAnimContext *ac, short mode) /* ------------------- */ -static int actkeys_insertkey_exec(bContext *C, wmOperator *op) +static wmOperatorStatus actkeys_insertkey_exec(bContext *C, wmOperator *op) { bAnimContext ac; short mode; @@ -1072,7 +1072,7 @@ static bool duplicate_action_keys(bAnimContext *ac) /* ------------------- */ -static int actkeys_duplicate_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus actkeys_duplicate_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -1171,7 +1171,7 @@ static bool delete_action_keys(bAnimContext *ac) /* ------------------- */ -static int actkeys_delete_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus actkeys_delete_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -1191,7 +1191,9 @@ static int actkeys_delete_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -static int actkeys_delete_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus actkeys_delete_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (RNA_boolean_get(op->ptr, "confirm")) { return WM_operator_confirm_ex(C, @@ -1257,7 +1259,7 @@ static void clean_action_keys(bAnimContext *ac, float thresh, bool clean_chan) /* ------------------- */ -static int actkeys_clean_exec(bContext *C, wmOperator *op) +static wmOperatorStatus actkeys_clean_exec(bContext *C, wmOperator *op) { bAnimContext ac; float thresh; @@ -1337,7 +1339,7 @@ static void bake_action_keys(bAnimContext *ac) /* ------------------- */ -static int actkeys_bake_exec(bContext *C, wmOperator *op) +static wmOperatorStatus actkeys_bake_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -1464,7 +1466,7 @@ static void setexpo_action_keys(bAnimContext *ac, short mode) /* ------------------- */ -static int actkeys_expo_exec(bContext *C, wmOperator *op) +static wmOperatorStatus actkeys_expo_exec(bContext *C, wmOperator *op) { bAnimContext ac; short mode; @@ -1516,7 +1518,7 @@ void ACTION_OT_extrapolation_type(wmOperatorType *ot) /** \name Settings: Set Interpolation-Type Operator * \{ */ -static int actkeys_ipo_exec(bContext *C, wmOperator *op) +static wmOperatorStatus actkeys_ipo_exec(bContext *C, wmOperator *op) { bAnimContext ac; short mode; @@ -1575,7 +1577,7 @@ void ACTION_OT_interpolation_type(wmOperatorType *ot) /** \name Settings: Set Easing Operator * \{ */ -static int actkeys_easing_exec(bContext *C, wmOperator *op) +static wmOperatorStatus actkeys_easing_exec(bContext *C, wmOperator *op) { bAnimContext ac; short mode; @@ -1664,7 +1666,7 @@ static void sethandles_action_keys(bAnimContext *ac, short mode) /* ------------------- */ -static int actkeys_handletype_exec(bContext *C, wmOperator *op) +static wmOperatorStatus actkeys_handletype_exec(bContext *C, wmOperator *op) { bAnimContext ac; short mode; @@ -1762,7 +1764,7 @@ static void setkeytype_action_keys(bAnimContext *ac, eBezTriple_KeyframeType mod /* ------------------- */ -static int actkeys_keytype_exec(bContext *C, wmOperator *op) +static wmOperatorStatus actkeys_keytype_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -1821,7 +1823,7 @@ static bool actkeys_framejump_poll(bContext *C) } /* snap current-frame indicator to 'average time' of selected keyframe */ -static int actkeys_framejump_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus actkeys_framejump_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; ListBase anim_data = {nullptr, nullptr}; @@ -2010,7 +2012,7 @@ static void snap_action_keys(bAnimContext *ac, short mode) /* ------------------- */ -static int actkeys_snap_exec(bContext *C, wmOperator *op) +static wmOperatorStatus actkeys_snap_exec(bContext *C, wmOperator *op) { bAnimContext ac; short mode; @@ -2144,7 +2146,7 @@ static void mirror_action_keys(bAnimContext *ac, short mode) /* ------------------- */ -static int actkeys_mirror_exec(bContext *C, wmOperator *op) +static wmOperatorStatus actkeys_mirror_exec(bContext *C, wmOperator *op) { bAnimContext ac; short mode; diff --git a/source/blender/editors/space_action/action_select.cc b/source/blender/editors/space_action/action_select.cc index b0e8798616d..2eba7b43424 100644 --- a/source/blender/editors/space_action/action_select.cc +++ b/source/blender/editors/space_action/action_select.cc @@ -371,7 +371,7 @@ static void deselect_action_keys(bAnimContext *ac, short test, eEditKeyframes_Se /* ------------------- */ -static int actkeys_deselectall_exec(bContext *C, wmOperator *op) +static wmOperatorStatus actkeys_deselectall_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -601,7 +601,9 @@ static void box_select_action(bAnimContext *ac, /* ------------------- */ -static int actkeys_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus actkeys_box_select_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { bAnimContext ac; if (ANIM_animdata_get_context(C, &ac) == 0) { @@ -620,7 +622,7 @@ static int actkeys_box_select_invoke(bContext *C, wmOperator *op, const wmEvent return WM_gesture_box_invoke(C, op, event); } -static int actkeys_box_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus actkeys_box_select_exec(bContext *C, wmOperator *op) { bAnimContext ac; rcti rect; @@ -899,7 +901,7 @@ static void region_select_action_keys(bAnimContext *ac, /* ----------------------------------- */ -static int actkeys_lassoselect_exec(bContext *C, wmOperator *op) +static wmOperatorStatus actkeys_lassoselect_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -963,7 +965,7 @@ void ACTION_OT_select_lasso(wmOperatorType *ot) /* ------------------- */ -static int action_circle_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus action_circle_select_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -1234,7 +1236,7 @@ static void columnselect_action_keys(bAnimContext *ac, short mode) /* ------------------- */ -static int actkeys_columnselect_exec(bContext *C, wmOperator *op) +static wmOperatorStatus actkeys_columnselect_exec(bContext *C, wmOperator *op) { bAnimContext ac; short mode; @@ -1287,7 +1289,7 @@ void ACTION_OT_select_column(wmOperatorType *ot) /** \name Select Linked Operator * \{ */ -static int actkeys_select_linked_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus actkeys_select_linked_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -1397,7 +1399,7 @@ static void select_moreless_action_keys(bAnimContext *ac, short mode) /* ----------------- */ -static int actkeys_select_more_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus actkeys_select_more_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -1434,7 +1436,7 @@ void ACTION_OT_select_more(wmOperatorType *ot) /* ----------------- */ -static int actkeys_select_less_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus actkeys_select_less_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -1586,7 +1588,7 @@ static void actkeys_select_leftright(bAnimContext *ac, /* ----------------- */ -static int actkeys_select_leftright_exec(bContext *C, wmOperator *op) +static wmOperatorStatus actkeys_select_leftright_exec(bContext *C, wmOperator *op) { bAnimContext ac; short leftright = RNA_enum_get(op->ptr, "mode"); @@ -1620,7 +1622,9 @@ static int actkeys_select_leftright_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int actkeys_select_leftright_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus actkeys_select_leftright_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { bAnimContext ac; short leftright = RNA_enum_get(op->ptr, "mode"); @@ -1888,13 +1892,13 @@ static void actkeys_mselect_channel_only(bAnimContext *ac, /* ------------------- */ -static int mouse_action_keys(bAnimContext *ac, - const int mval[2], - eEditKeyframes_Select select_mode, - const bool deselect_all, - const bool column, - const bool same_channel, - bool wait_to_deselect_others) +static wmOperatorStatus mouse_action_keys(bAnimContext *ac, + const int mval[2], + eEditKeyframes_Select select_mode, + const bool deselect_all, + const bool column, + const bool same_channel, + bool wait_to_deselect_others) { /* NOTE: keep this functionality in sync with #MARKER_OT_select. * The logic here closely matches its internals. @@ -1908,7 +1912,7 @@ static int mouse_action_keys(bAnimContext *ac, bool is_selected = false; float frame = 0.0f; /* frame of keyframe under mouse - NLA corrections not applied/included */ float selx = 0.0f; /* frame of keyframe under mouse */ - int ret_value = OPERATOR_FINISHED; + wmOperatorStatus ret_value = OPERATOR_FINISHED; actkeys_find_key_at_position( ac, filter, mval[0], mval[1], &ale, &selx, &frame, &found, &is_selected); @@ -2041,10 +2045,10 @@ static int mouse_action_keys(bAnimContext *ac, } /* handle clicking */ -static int actkeys_clickselect_exec(bContext *C, wmOperator *op) +static wmOperatorStatus actkeys_clickselect_exec(bContext *C, wmOperator *op) { bAnimContext ac; - int ret_value; + wmOperatorStatus ret_value; /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) { diff --git a/source/blender/editors/space_buttons/buttons_ops.cc b/source/blender/editors/space_buttons/buttons_ops.cc index 532cba5d529..d5aead6a856 100644 --- a/source/blender/editors/space_buttons/buttons_ops.cc +++ b/source/blender/editors/space_buttons/buttons_ops.cc @@ -48,7 +48,7 @@ * \note Almost a duplicate of the file browser operator #FILE_OT_start_filter. * \{ */ -static int buttons_start_filter_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus buttons_start_filter_exec(bContext *C, wmOperator * /*op*/) { SpaceProperties *space = CTX_wm_space_properties(C); ScrArea *area = CTX_wm_area(C); @@ -71,7 +71,7 @@ void BUTTONS_OT_start_filter(wmOperatorType *ot) ot->poll = ED_operator_buttons_active; } -static int buttons_clear_filter_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus buttons_clear_filter_exec(bContext *C, wmOperator * /*op*/) { SpaceProperties *space = CTX_wm_space_properties(C); @@ -102,7 +102,7 @@ void BUTTONS_OT_clear_filter(wmOperatorType *ot) /** \name Pin ID Operator * \{ */ -static int toggle_pin_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus toggle_pin_exec(bContext *C, wmOperator * /*op*/) { SpaceProperties *sbuts = CTX_wm_space_properties(C); @@ -141,7 +141,9 @@ void BUTTONS_OT_toggle_pin(wmOperatorType *ot) /** \name Context Menu Operator * \{ */ -static int context_menu_invoke(bContext *C, wmOperator * /*op*/, const wmEvent * /*event*/) +static wmOperatorStatus context_menu_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent * /*event*/) { uiPopupMenu *pup = UI_popup_menu_begin(C, IFACE_("Context Menu"), ICON_NONE); uiLayout *layout = UI_popup_menu_layout(pup); @@ -177,7 +179,7 @@ struct FileBrowseOp { bool is_userdef = false; }; -static int file_browse_exec(bContext *C, wmOperator *op) +static wmOperatorStatus file_browse_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); FileBrowseOp *fbo = static_cast(op->customdata); @@ -264,7 +266,7 @@ static void file_browse_cancel(bContext * /*C*/, wmOperator *op) op->customdata = nullptr; } -static int file_browse_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus 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.cc b/source/blender/editors/space_clip/clip_dopesheet_ops.cc index e9ff9960853..288f088354a 100644 --- a/source/blender/editors/space_clip/clip_dopesheet_ops.cc +++ b/source/blender/editors/space_clip/clip_dopesheet_ops.cc @@ -53,7 +53,7 @@ static bool dopesheet_select_channel_poll(bContext *C) return false; } -static int dopesheet_select_channel_exec(bContext *C, wmOperator *op) +static wmOperatorStatus dopesheet_select_channel_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -99,7 +99,9 @@ static int dopesheet_select_channel_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int dopesheet_select_channel_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus dopesheet_select_channel_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); float location[2]; @@ -146,7 +148,7 @@ void CLIP_OT_dopesheet_select_channel(wmOperatorType *ot) /********************** View All operator *********************/ -static int dopesheet_view_all_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus dopesheet_view_all_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *region = CTX_wm_region(C); diff --git a/source/blender/editors/space_clip/clip_graph_ops.cc b/source/blender/editors/space_clip/clip_graph_ops.cc index b10a3f8922a..128b79ba6f8 100644 --- a/source/blender/editors/space_clip/clip_graph_ops.cc +++ b/source/blender/editors/space_clip/clip_graph_ops.cc @@ -276,7 +276,7 @@ static bool mouse_select_curve(bContext *C, const float co[2], bool extend) return false; } -static int mouse_select(bContext *C, float co[2], bool extend) +static wmOperatorStatus mouse_select(bContext *C, float co[2], bool extend) { bool sel = false; @@ -295,7 +295,7 @@ static int mouse_select(bContext *C, float co[2], bool extend) return OPERATOR_FINISHED; } -static int select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_exec(bContext *C, wmOperator *op) { float co[2]; bool extend = RNA_boolean_get(op->ptr, "extend"); @@ -305,7 +305,7 @@ static int select_exec(bContext *C, wmOperator *op) return mouse_select(C, co, extend); } -static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); float co[2]; @@ -394,7 +394,7 @@ static void box_select_cb(void *userdata, } } -static int box_select_graph_exec(bContext *C, wmOperator *op) +static wmOperatorStatus box_select_graph_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *region = CTX_wm_region(C); @@ -451,7 +451,7 @@ void CLIP_OT_graph_select_box(wmOperatorType *ot) /********************** select all operator *********************/ -static int graph_select_all_markers_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graph_select_all_markers_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -516,7 +516,7 @@ void CLIP_OT_graph_select_all_markers(wmOperatorType *ot) /******************** delete curve operator ********************/ -static int delete_curve_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus delete_curve_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -532,7 +532,7 @@ static int delete_curve_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -static int delete_curve_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus delete_curve_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { if (RNA_boolean_get(op->ptr, "confirm")) { return WM_operator_confirm_ex(C, @@ -565,7 +565,7 @@ void CLIP_OT_graph_delete_curve(wmOperatorType *ot) /******************** delete knot operator ********************/ -static int delete_knot_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus delete_knot_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -624,7 +624,7 @@ static void view_all_cb(void *userdata, data->max = std::max(val, data->max); } -static int view_all_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus view_all_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ARegion *region = CTX_wm_region(C); @@ -695,7 +695,7 @@ void ED_clip_graph_center_current_frame(Scene *scene, ARegion *region) v2d->cur.xmax = float(scene->r.cfra) + extra; } -static int center_current_frame_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus center_current_frame_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ARegion *region = CTX_wm_region(C); @@ -721,7 +721,7 @@ void CLIP_OT_graph_center_current_frame(wmOperatorType *ot) /********************** disable markers operator *********************/ -static int graph_disable_markers_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graph_disable_markers_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); diff --git a/source/blender/editors/space_clip/clip_ops.cc b/source/blender/editors/space_clip/clip_ops.cc index bf364dec959..7b0c12b74a6 100644 --- a/source/blender/editors/space_clip/clip_ops.cc +++ b/source/blender/editors/space_clip/clip_ops.cc @@ -181,7 +181,7 @@ static void open_cancel(bContext * /*C*/, wmOperator *op) } } -static int open_exec(bContext *C, wmOperator *op) +static wmOperatorStatus open_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); bScreen *screen = CTX_wm_screen(C); @@ -264,7 +264,7 @@ static int open_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int open_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus open_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { SpaceClip *sc = CTX_wm_space_clip(C); char dirpath[FILE_MAX]; @@ -330,7 +330,7 @@ void CLIP_OT_open(wmOperatorType *ot) /** \name Reload Clip Operator * \{ */ -static int reload_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus reload_exec(bContext *C, wmOperator * /*op*/) { MovieClip *clip = CTX_data_edit_movieclip(C); @@ -419,7 +419,7 @@ static void view_pan_exit(bContext *C, wmOperator *op, bool cancel) MEM_freeN(op->customdata); } -static int view_pan_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_pan_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); float offset[2]; @@ -440,7 +440,7 @@ static int view_pan_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int view_pan_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus view_pan_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (event->type == MOUSEPAN) { SpaceClip *sc = CTX_wm_space_clip(C); @@ -461,7 +461,7 @@ static int view_pan_invoke(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int view_pan_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus view_pan_modal(bContext *C, wmOperator *op, const wmEvent *event) { SpaceClip *sc = CTX_wm_space_clip(C); ViewPanData *vpd = static_cast(op->customdata); @@ -597,7 +597,7 @@ static void view_zoom_exit(bContext *C, wmOperator *op, bool cancel) MEM_freeN(op->customdata); } -static int view_zoom_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_zoom_exec(bContext *C, wmOperator *op) { sclip_zoom_set_factor(C, RNA_float_get(op->ptr, "factor"), nullptr, false); @@ -606,7 +606,7 @@ static int view_zoom_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int view_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus view_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (ELEM(event->type, MOUSEZOOM, MOUSEPAN)) { float delta, factor; @@ -673,7 +673,7 @@ static void view_zoom_apply( ED_region_tag_redraw(CTX_wm_region(C)); } -static int view_zoom_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus view_zoom_modal(bContext *C, wmOperator *op, const wmEvent *event) { ViewZoomData *vpd = static_cast(op->customdata); const bool use_cursor_init = RNA_boolean_get(op->ptr, "use_cursor_init"); @@ -743,7 +743,7 @@ void CLIP_OT_view_zoom(wmOperatorType *ot) /** \name View Zoom In/Out Operator * \{ */ -static int view_zoom_in_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_zoom_in_exec(bContext *C, wmOperator *op) { float location[2]; @@ -756,7 +756,7 @@ static int view_zoom_in_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int view_zoom_in_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus view_zoom_in_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *region = CTX_wm_region(C); @@ -800,7 +800,7 @@ void CLIP_OT_view_zoom_in(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_HIDDEN); } -static int view_zoom_out_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_zoom_out_exec(bContext *C, wmOperator *op) { float location[2]; @@ -813,7 +813,7 @@ static int view_zoom_out_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int view_zoom_out_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus view_zoom_out_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *region = CTX_wm_region(C); @@ -863,7 +863,7 @@ void CLIP_OT_view_zoom_out(wmOperatorType *ot) /** \name View Zoom Ratio Operator * \{ */ -static int view_zoom_ratio_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_zoom_ratio_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); @@ -910,7 +910,7 @@ void CLIP_OT_view_zoom_ratio(wmOperatorType *ot) /** \name View All Operator * \{ */ -static int view_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_all_exec(bContext *C, wmOperator *op) { SpaceClip *sc; ARegion *region; @@ -988,7 +988,7 @@ void CLIP_OT_view_all(wmOperatorType *ot) /** \name Center View To Cursor Operator * \{ */ -static int view_center_cursor_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus view_center_cursor_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *region = CTX_wm_region(C); @@ -1018,7 +1018,7 @@ void CLIP_OT_view_center_cursor(wmOperatorType *ot) /** \name Frame Selected Operator * \{ */ -static int view_selected_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus view_selected_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *region = CTX_wm_region(C); @@ -1077,7 +1077,7 @@ static void change_frame_apply(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene); } -static int change_frame_exec(bContext *C, wmOperator *op) +static wmOperatorStatus change_frame_exec(bContext *C, wmOperator *op) { change_frame_apply(C, op); @@ -1106,7 +1106,7 @@ static int frame_from_event(bContext *C, const wmEvent *event) return framenr; } -static int change_frame_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus change_frame_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); @@ -1126,7 +1126,7 @@ static int change_frame_invoke(bContext *C, wmOperator *op, const wmEvent *event return OPERATOR_RUNNING_MODAL; } -static int change_frame_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus change_frame_modal(bContext *C, wmOperator *op, const wmEvent *event) { switch (event->type) { case EVT_ESCKEY: @@ -1518,7 +1518,7 @@ static void proxy_endjob(void *pjv) WM_main_add_notifier(NC_MOVIECLIP | ND_DISPLAY, pj->clip); } -static int clip_rebuild_proxy_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus clip_rebuild_proxy_exec(bContext *C, wmOperator * /*op*/) { wmJob *wm_job; ProxyJob *pj; @@ -1587,7 +1587,7 @@ void CLIP_OT_rebuild_proxy(wmOperatorType *ot) /** \name Mode Set Operator * \{ */ -static int mode_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mode_set_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); int mode = RNA_enum_get(op->ptr, "mode"); @@ -1636,7 +1636,9 @@ 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 * /*op*/, const wmEvent *event) +static wmOperatorStatus clip_view_ndof_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { if (event->type != NDOF_MOTION) { return OPERATOR_CANCELLED; @@ -1686,7 +1688,7 @@ void CLIP_OT_view_ndof(wmOperatorType *ot) /** \name Prefetch Operator * \{ */ -static int clip_prefetch_modal(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus clip_prefetch_modal(bContext *C, wmOperator * /*op*/, const wmEvent *event) { /* no running blender, remove handler and pass through */ if (0 == WM_jobs_test(CTX_wm_manager(C), CTX_wm_area(C), WM_JOB_TYPE_CLIP_PREFETCH)) { @@ -1702,7 +1704,9 @@ static int clip_prefetch_modal(bContext *C, wmOperator * /*op*/, const wmEvent * return OPERATOR_PASS_THROUGH; } -static int clip_prefetch_invoke(bContext *C, wmOperator *op, const wmEvent * /*_event*/) +static wmOperatorStatus clip_prefetch_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*_event*/) { clip_start_prefetch_job(C); @@ -1731,7 +1735,7 @@ void CLIP_OT_prefetch(wmOperatorType *ot) /** \name Set Scene Frames Operator * \{ */ -static int clip_set_scene_frames_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus clip_set_scene_frames_exec(bContext *C, wmOperator * /*op*/) { MovieClip *clip = CTX_data_edit_movieclip(C); Scene *scene = CTX_data_scene(C); @@ -1771,7 +1775,7 @@ void CLIP_OT_set_scene_frames(wmOperatorType *ot) /** \name Set 3d Cursor Operator * \{ */ -static int clip_set_2d_cursor_exec(bContext *C, wmOperator *op) +static wmOperatorStatus clip_set_2d_cursor_exec(bContext *C, wmOperator *op) { SpaceClip *sclip = CTX_wm_space_clip(C); bool show_cursor = false; @@ -1791,7 +1795,9 @@ static int clip_set_2d_cursor_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH; } -static int clip_set_2d_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus clip_set_2d_cursor_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); SpaceClip *sclip = CTX_wm_space_clip(C); @@ -1837,7 +1843,7 @@ void CLIP_OT_cursor_set(wmOperatorType *ot) /** \name Toggle Lock To Selection Operator * \{ */ -static int lock_selection_toggle_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus lock_selection_toggle_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *space_clip = CTX_wm_space_clip(C); diff --git a/source/blender/editors/space_clip/tracking_ops.cc b/source/blender/editors/space_clip/tracking_ops.cc index 7a20559770c..1c1a4bd08ab 100644 --- a/source/blender/editors/space_clip/tracking_ops.cc +++ b/source/blender/editors/space_clip/tracking_ops.cc @@ -76,7 +76,7 @@ static bool add_marker(const bContext *C, float x, float y) return true; } -static int add_marker_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_marker_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -98,7 +98,7 @@ static int add_marker_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int add_marker_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus add_marker_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *region = CTX_wm_region(C); @@ -147,7 +147,9 @@ void CLIP_OT_add_marker(wmOperatorType *ot) /** \name Add Marker Operator * \{ */ -static int add_marker_at_click_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus add_marker_at_click_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { WorkspaceStatus status(C); status.item(IFACE_("Cancel"), ICON_EVENT_ESC); @@ -159,7 +161,9 @@ static int add_marker_at_click_invoke(bContext *C, wmOperator *op, const wmEvent return OPERATOR_RUNNING_MODAL; } -static int add_marker_at_click_modal(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus add_marker_at_click_modal(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { switch (event->type) { case MOUSEMOVE: @@ -218,7 +222,7 @@ void CLIP_OT_add_marker_at_click(wmOperatorType *ot) /** \name Delete Track Operator * \{ */ -static int delete_track_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus delete_track_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -249,7 +253,7 @@ static int delete_track_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -static int delete_track_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus delete_track_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { if (RNA_boolean_get(op->ptr, "confirm")) { return WM_operator_confirm_ex(C, @@ -286,7 +290,7 @@ void CLIP_OT_delete_track(wmOperatorType *ot) /** \name Delete Marker Operator * \{ */ -static int delete_marker_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus delete_marker_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -329,7 +333,9 @@ static int delete_marker_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -static int delete_marker_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus delete_marker_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (RNA_boolean_get(op->ptr, "confirm")) { return WM_operator_confirm_ex(C, @@ -595,7 +601,7 @@ static SlideMarkerData *slide_marker_customdata(bContext *C, const wmEvent *even return customdata; } -static int slide_marker_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus slide_marker_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SlideMarkerData *slidedata = slide_marker_customdata(C, event); if (slidedata != nullptr) { @@ -662,7 +668,7 @@ static void free_slide_data(SlideMarkerData *data) MEM_freeN(data); } -static int slide_marker_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus slide_marker_modal(bContext *C, wmOperator *op, const wmEvent *event) { SpaceClip *sc = CTX_wm_space_clip(C); @@ -863,7 +869,7 @@ void CLIP_OT_slide_marker(wmOperatorType *ot) /** \name Clear Track Operator * \{ */ -static int clear_track_path_exec(bContext *C, wmOperator *op) +static wmOperatorStatus clear_track_path_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -942,7 +948,7 @@ enum { MARKER_OP_TOGGLE = 2, }; -static int disable_markers_exec(bContext *C, wmOperator *op) +static wmOperatorStatus disable_markers_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -1005,7 +1011,7 @@ void CLIP_OT_disable_markers(wmOperatorType *ot) /** \name Hide Tracks Operator * \{ */ -static int hide_tracks_exec(bContext *C, wmOperator *op) +static wmOperatorStatus hide_tracks_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -1073,7 +1079,7 @@ void CLIP_OT_hide_tracks(wmOperatorType *ot) /** \name Hide Tracks Clear Operator * \{ */ -static int hide_tracks_clear_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus hide_tracks_clear_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -1123,7 +1129,7 @@ static bool frame_jump_poll(bContext *C) return space_clip != nullptr; } -static int frame_jump_exec(bContext *C, wmOperator *op) +static wmOperatorStatus frame_jump_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); SpaceClip *sc = CTX_wm_space_clip(C); @@ -1217,7 +1223,7 @@ void CLIP_OT_frame_jump(wmOperatorType *ot) /** \name Join Tracks Operator * \{ */ -static int join_tracks_exec(bContext *C, wmOperator *op) +static wmOperatorStatus join_tracks_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -1310,7 +1316,7 @@ void CLIP_OT_join_tracks(wmOperatorType *ot) /** \name Average Tracks Operator * \{ */ -static int average_tracks_exec(bContext *C, wmOperator *op) +static wmOperatorStatus average_tracks_exec(bContext *C, wmOperator *op) { SpaceClip *space_clip = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(space_clip); @@ -1359,7 +1365,9 @@ static int average_tracks_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int average_tracks_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus average_tracks_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { PropertyRNA *prop_keep_original = RNA_struct_find_property(op->ptr, "keep_original"); if (!RNA_property_is_set(op->ptr, prop_keep_original)) { @@ -1412,7 +1420,7 @@ enum { TRACK_ACTION_TOGGLE = 2, }; -static int lock_tracks_exec(bContext *C, wmOperator *op) +static wmOperatorStatus lock_tracks_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -1476,7 +1484,7 @@ enum { SOLVER_KEYFRAME_B = 1, }; -static int set_solver_keyframe_exec(bContext *C, wmOperator *op) +static wmOperatorStatus set_solver_keyframe_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -1527,7 +1535,7 @@ void CLIP_OT_set_solver_keyframe(wmOperatorType *ot) /** \name Track Copy Color Operator * \{ */ -static int track_copy_color_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus track_copy_color_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -1684,7 +1692,7 @@ static bool is_track_clean(MovieTrackingTrack *track, int frames, int del) return ok; } -static int clean_tracks_exec(bContext *C, wmOperator *op) +static wmOperatorStatus clean_tracks_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -1738,7 +1746,7 @@ static int clean_tracks_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int clean_tracks_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus clean_tracks_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -1813,7 +1821,7 @@ void CLIP_OT_clean_tracks(wmOperatorType *ot) /** \name Add Tracking Object * \{ */ -static int tracking_object_new_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus tracking_object_new_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -1848,7 +1856,7 @@ void CLIP_OT_tracking_object_new(wmOperatorType *ot) /** \name Remove Tracking Object * \{ */ -static int tracking_object_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus tracking_object_remove_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -1889,7 +1897,7 @@ void CLIP_OT_tracking_object_remove(wmOperatorType *ot) /** \name Copy Tracks to Clipboard Operator * \{ */ -static int copy_tracks_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus copy_tracks_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -1933,7 +1941,7 @@ static bool paste_tracks_poll(bContext *C) return false; } -static int paste_tracks_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus paste_tracks_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -2018,7 +2026,7 @@ static void keyframe_set_flag(bContext *C, bool set) WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, clip); } -static int keyframe_insert_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus keyframe_insert_exec(bContext *C, wmOperator * /*op*/) { keyframe_set_flag(C, true); return OPERATOR_FINISHED; @@ -2045,7 +2053,7 @@ void CLIP_OT_keyframe_insert(wmOperatorType *ot) /** \name Delete Track Keyframe Operator * \{ */ -static int keyframe_delete_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus keyframe_delete_exec(bContext *C, wmOperator * /*op*/) { keyframe_set_flag(C, false); return OPERATOR_FINISHED; @@ -2114,7 +2122,7 @@ static bool new_image_from_plane_marker_poll(bContext *C) return true; } -static int new_image_from_plane_marker_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus new_image_from_plane_marker_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *space_clip = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(space_clip); @@ -2172,7 +2180,7 @@ static bool update_image_from_plane_marker_poll(bContext *C) return image->type == IMA_TYPE_IMAGE && ELEM(image->source, IMA_SRC_FILE, IMA_SRC_GENERATED); } -static int update_image_from_plane_marker_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus update_image_from_plane_marker_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *space_clip = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(space_clip); diff --git a/source/blender/editors/space_clip/tracking_ops_detect.cc b/source/blender/editors/space_clip/tracking_ops_detect.cc index e0c8e0336f1..06cfc9c387c 100644 --- a/source/blender/editors/space_clip/tracking_ops_detect.cc +++ b/source/blender/editors/space_clip/tracking_ops_detect.cc @@ -47,7 +47,7 @@ static bGPDlayer *detect_get_layer(MovieClip *clip) return nullptr; } -static int detect_features_exec(bContext *C, wmOperator *op) +static wmOperatorStatus detect_features_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); diff --git a/source/blender/editors/space_clip/tracking_ops_orient.cc b/source/blender/editors/space_clip/tracking_ops_orient.cc index 48e1ed0fb85..8897582f4b6 100644 --- a/source/blender/editors/space_clip/tracking_ops_orient.cc +++ b/source/blender/editors/space_clip/tracking_ops_orient.cc @@ -158,7 +158,7 @@ static Object *object_solver_camera(Scene *scene, Object *ob) return nullptr; } -static int set_origin_exec(bContext *C, wmOperator *op) +static wmOperatorStatus set_origin_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -372,7 +372,7 @@ static void set_axis(Scene *scene, BKE_object_apply_mat4(ob, mat, false, false); } -static int set_plane_exec(bContext *C, wmOperator *op) +static wmOperatorStatus set_plane_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -515,7 +515,7 @@ void CLIP_OT_set_plane(wmOperatorType *ot) /********************** set axis operator *********************/ -static int set_axis_exec(bContext *C, wmOperator *op) +static wmOperatorStatus set_axis_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -586,7 +586,10 @@ void CLIP_OT_set_axis(wmOperatorType *ot) /********************** set scale operator *********************/ -static int do_set_scale(bContext *C, wmOperator *op, bool scale_solution, bool apply_scale) +static wmOperatorStatus do_set_scale(bContext *C, + wmOperator *op, + bool scale_solution, + bool apply_scale) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -679,12 +682,12 @@ static int do_set_scale(bContext *C, wmOperator *op, bool scale_solution, bool a return OPERATOR_FINISHED; } -static int set_scale_exec(bContext *C, wmOperator *op) +static wmOperatorStatus set_scale_exec(bContext *C, wmOperator *op) { return do_set_scale(C, op, false, false); } -static int set_scale_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus set_scale_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -739,12 +742,14 @@ static bool set_solution_scale_poll(bContext *C) return false; } -static int set_solution_scale_exec(bContext *C, wmOperator *op) +static wmOperatorStatus set_solution_scale_exec(bContext *C, wmOperator *op) { return do_set_scale(C, op, true, false); } -static int set_solution_scale_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus set_solution_scale_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -801,12 +806,14 @@ static bool apply_solution_scale_poll(bContext *C) return false; } -static int apply_solution_scale_exec(bContext *C, wmOperator *op) +static wmOperatorStatus apply_solution_scale_exec(bContext *C, wmOperator *op) { return do_set_scale(C, op, false, true); } -static int apply_solution_scale_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus apply_solution_scale_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*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_ops_plane.cc b/source/blender/editors/space_clip/tracking_ops_plane.cc index 3f4892fcf31..4c4836a01bf 100644 --- a/source/blender/editors/space_clip/tracking_ops_plane.cc +++ b/source/blender/editors/space_clip/tracking_ops_plane.cc @@ -31,7 +31,7 @@ /********************** Create plane track operator *********************/ -static int create_plane_track_tracks_exec(bContext *C, wmOperator *op) +static wmOperatorStatus create_plane_track_tracks_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -170,7 +170,9 @@ static SlidePlaneMarkerData *slide_plane_marker_customdata(bContext *C, const wm return customdata; } -static int slide_plane_marker_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus slide_plane_marker_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { SlidePlaneMarkerData *slidedata = slide_plane_marker_customdata(C, event); @@ -213,7 +215,7 @@ static void slide_plane_marker_update_homographies(SpaceClip *sc, SlidePlaneMark BKE_tracking_track_plane_from_existing_motion(data->plane_track, framenr); } -static int slide_plane_marker_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus slide_plane_marker_modal(bContext *C, wmOperator *op, const wmEvent *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_ops_solve.cc b/source/blender/editors/space_clip/tracking_ops_solve.cc index 82959d9ac92..889b1236f97 100644 --- a/source/blender/editors/space_clip/tracking_ops_solve.cc +++ b/source/blender/editors/space_clip/tracking_ops_solve.cc @@ -176,7 +176,7 @@ static void solve_camera_freejob(void *scv) MEM_freeN(scj); } -static int solve_camera_exec(bContext *C, wmOperator *op) +static wmOperatorStatus solve_camera_exec(bContext *C, wmOperator *op) { SolveCameraJob *scj; char error_msg[256] = "\0"; @@ -194,7 +194,7 @@ static int solve_camera_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int solve_camera_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus solve_camera_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { SolveCameraJob *scj; SpaceClip *sc = CTX_wm_space_clip(C); @@ -247,7 +247,7 @@ static int solve_camera_invoke(bContext *C, wmOperator *op, const wmEvent * /*ev return OPERATOR_RUNNING_MODAL; } -static int solve_camera_modal(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus solve_camera_modal(bContext *C, wmOperator * /*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_CLIP_SOLVE_CAMERA)) { @@ -282,7 +282,7 @@ void CLIP_OT_solve_camera(wmOperatorType *ot) /********************** clear solution operator *********************/ -static int clear_solution_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus clear_solution_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); diff --git a/source/blender/editors/space_clip/tracking_ops_stabilize.cc b/source/blender/editors/space_clip/tracking_ops_stabilize.cc index 7fa84535c9b..6bd1faac11a 100644 --- a/source/blender/editors/space_clip/tracking_ops_stabilize.cc +++ b/source/blender/editors/space_clip/tracking_ops_stabilize.cc @@ -38,7 +38,7 @@ static bool stabilize_2d_poll(bContext *C) return false; } -static int stabilize_2d_add_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus stabilize_2d_add_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -80,7 +80,7 @@ void CLIP_OT_stabilize_2d_add(wmOperatorType *ot) /******************* remove 2d stabilization tracks operator ******************/ -static int stabilize_2d_remove_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus stabilize_2d_remove_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -129,7 +129,7 @@ void CLIP_OT_stabilize_2d_remove(wmOperatorType *ot) /******************* select 2d stabilization tracks operator ******************/ -static int stabilize_2d_select_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus stabilize_2d_select_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -167,7 +167,7 @@ void CLIP_OT_stabilize_2d_select(wmOperatorType *ot) /********************** add 2d stabilization tracks for rotation operator ****************/ -static int stabilize_2d_rotation_add_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus stabilize_2d_rotation_add_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -209,7 +209,7 @@ void CLIP_OT_stabilize_2d_rotation_add(wmOperatorType *ot) /********************** remove 2d stabilization tracks for rotation operator *************/ -static int stabilize_2d_rotation_remove_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus stabilize_2d_rotation_remove_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -258,7 +258,7 @@ void CLIP_OT_stabilize_2d_rotation_remove(wmOperatorType *ot) /********************** select 2d stabilization rotation tracks operator *****************/ -static int stabilize_2d_rotation_select_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus stabilize_2d_rotation_select_exec(bContext *C, wmOperator * /*op*/) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); diff --git a/source/blender/editors/space_clip/tracking_ops_track.cc b/source/blender/editors/space_clip/tracking_ops_track.cc index 7c447f0f3d6..82f8e09daa1 100644 --- a/source/blender/editors/space_clip/tracking_ops_track.cc +++ b/source/blender/editors/space_clip/tracking_ops_track.cc @@ -283,7 +283,7 @@ static void track_markers_freejob(void *tmv) MEM_freeN(tmj); } -static int track_markers(bContext *C, wmOperator *op, bool use_job) +static wmOperatorStatus track_markers(bContext *C, wmOperator *op, bool use_job) { TrackMarkersJob *tmj; SpaceClip *sc = CTX_wm_space_clip(C); @@ -354,17 +354,19 @@ static int track_markers(bContext *C, wmOperator *op, bool use_job) return OPERATOR_FINISHED; } -static int track_markers_exec(bContext *C, wmOperator *op) +static wmOperatorStatus track_markers_exec(bContext *C, wmOperator *op) { return track_markers(C, op, false); } -static int track_markers_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus track_markers_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { return track_markers(C, op, true); } -static int track_markers_modal(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus track_markers_modal(bContext *C, wmOperator * /*op*/, const wmEvent *event) { /* No running tracking, remove handler and pass through. */ if (0 == WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C), WM_JOB_TYPE_ANY)) { @@ -433,7 +435,7 @@ void CLIP_OT_track_markers(wmOperatorType *ot) /********************** Refine track position operator *********************/ -static int refine_marker_exec(bContext *C, wmOperator *op) +static wmOperatorStatus refine_marker_exec(bContext *C, wmOperator *op) { 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.cc b/source/blender/editors/space_clip/tracking_select.cc index 93fb44d9e09..ca0d2132f42 100644 --- a/source/blender/editors/space_clip/tracking_select.cc +++ b/source/blender/editors/space_clip/tracking_select.cc @@ -554,7 +554,7 @@ static bool select_poll(bContext *C) return false; } -static int select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -659,7 +659,7 @@ static int select_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH; } -static int select_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *region = CTX_wm_region(C); @@ -722,7 +722,7 @@ bool ED_clip_can_select(bContext *C) /********************** box select operator *********************/ -static int box_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus box_select_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *region = CTX_wm_region(C); @@ -906,7 +906,7 @@ static int do_lasso_select_marker(bContext *C, const Span mcoords, bool se return changed; } -static int clip_lasso_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus clip_lasso_select_exec(bContext *C, wmOperator *op) { const Array mcoords = WM_gesture_lasso_path_to_array(C, op); @@ -970,7 +970,7 @@ static int marker_inside_ellipse(const MovieTrackingMarker *marker, return point_inside_ellipse(marker->pos, offset, ellipse); } -static int circle_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus circle_select_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *region = CTX_wm_region(C); @@ -1084,7 +1084,7 @@ void CLIP_OT_select_circle(wmOperatorType *ot) /********************** select all operator *********************/ -static int select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_all_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); @@ -1129,7 +1129,7 @@ void CLIP_OT_select_all(wmOperatorType *ot) /********************** select grouped operator *********************/ -static int select_grouped_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_grouped_exec(bContext *C, wmOperator *op) { SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); diff --git a/source/blender/editors/space_console/console_ops.cc b/source/blender/editors/space_console/console_ops.cc index 065b9f77538..bba5b76719a 100644 --- a/source/blender/editors/space_console/console_ops.cc +++ b/source/blender/editors/space_console/console_ops.cc @@ -376,7 +376,7 @@ static const EnumPropertyItem console_move_type_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int console_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus console_move_exec(bContext *C, wmOperator *op) { SpaceConsole *sc = CTX_wm_space_console(C); ConsoleLine *ci = console_history_verify(C); @@ -471,7 +471,7 @@ void CONSOLE_OT_move(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } -static int console_insert_exec(bContext *C, wmOperator *op) +static wmOperatorStatus console_insert_exec(bContext *C, wmOperator *op) { SpaceConsole *sc = CTX_wm_space_console(C); ScrArea *area = CTX_wm_area(C); @@ -513,7 +513,7 @@ static int console_insert_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int console_insert_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus console_insert_invoke(bContext *C, wmOperator *op, const wmEvent *event) { /* NOTE: the "text" property is always set from key-map, * so we can't use #RNA_struct_property_is_set, check the length instead. */ @@ -559,7 +559,7 @@ void CONSOLE_OT_insert(wmOperatorType *ot) /** \name Indent or Autocomplete Operator * \{ */ -static int console_indent_or_autocomplete_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus console_indent_or_autocomplete_exec(bContext *C, wmOperator * /*op*/) { ConsoleLine *ci = console_history_verify(C); bool text_before_cursor = false; @@ -604,7 +604,7 @@ void CONSOLE_OT_indent_or_autocomplete(wmOperatorType *ot) /** \name Indent Operator * \{ */ -static int console_indent_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus console_indent_exec(bContext *C, wmOperator * /*op*/) { SpaceConsole *sc = CTX_wm_space_console(C); ConsoleLine *ci = console_history_verify(C); @@ -653,7 +653,7 @@ void CONSOLE_OT_indent(wmOperatorType *ot) /** \} */ -static int console_unindent_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus console_unindent_exec(bContext *C, wmOperator * /*op*/) { SpaceConsole *sc = CTX_wm_space_console(C); ConsoleLine *ci = console_history_verify(C); @@ -715,7 +715,7 @@ static const EnumPropertyItem console_delete_type_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int console_delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus console_delete_exec(bContext *C, wmOperator *op) { SpaceConsole *sc = CTX_wm_space_console(C); ConsoleLine *ci = console_history_verify(C); @@ -820,7 +820,7 @@ void CONSOLE_OT_delete(wmOperatorType *ot) "Which part of the text to delete"); } -static int console_clear_line_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus console_clear_line_exec(bContext *C, wmOperator * /*op*/) { SpaceConsole *sc = CTX_wm_space_console(C); ConsoleLine *ci = console_history_verify(C); @@ -857,7 +857,7 @@ void CONSOLE_OT_clear_line(wmOperatorType *ot) } /* the python exec operator uses this */ -static int console_clear_exec(bContext *C, wmOperator *op) +static wmOperatorStatus console_clear_exec(bContext *C, wmOperator *op) { SpaceConsole *sc = CTX_wm_space_console(C); ScrArea *area = CTX_wm_area(C); @@ -904,7 +904,7 @@ void CONSOLE_OT_clear(wmOperatorType *ot) } /* the python exec operator uses this */ -static int console_history_cycle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus console_history_cycle_exec(bContext *C, wmOperator *op) { SpaceConsole *sc = CTX_wm_space_console(C); ScrArea *area = CTX_wm_area(C); @@ -990,7 +990,7 @@ void CONSOLE_OT_history_cycle(wmOperatorType *ot) } /* the python exec operator uses this */ -static int console_history_append_exec(bContext *C, wmOperator *op) +static wmOperatorStatus console_history_append_exec(bContext *C, wmOperator *op) { SpaceConsole *sc = CTX_wm_space_console(C); ScrArea *area = CTX_wm_area(C); @@ -1059,7 +1059,7 @@ void CONSOLE_OT_history_append(wmOperatorType *ot) } /* the python exec operator uses this */ -static int console_scrollback_append_exec(bContext *C, wmOperator *op) +static wmOperatorStatus console_scrollback_append_exec(bContext *C, wmOperator *op) { SpaceConsole *sc = CTX_wm_space_console(C); ConsoleLine *ci; @@ -1113,7 +1113,7 @@ void CONSOLE_OT_scrollback_append(wmOperatorType *ot) "Console output type"); } -static int console_copy_exec(bContext *C, wmOperator *op) +static wmOperatorStatus console_copy_exec(bContext *C, wmOperator *op) { SpaceConsole *sc = CTX_wm_space_console(C); char *buf = console_select_to_buffer(sc); @@ -1158,7 +1158,7 @@ void CONSOLE_OT_copy(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } -static int console_paste_exec(bContext *C, wmOperator *op) +static wmOperatorStatus console_paste_exec(bContext *C, wmOperator *op) { const bool selection = RNA_boolean_get(op->ptr, "selection"); SpaceConsole *sc = CTX_wm_space_console(C); @@ -1269,7 +1269,7 @@ static void console_cursor_set_to_pos(SpaceConsole *sc, } } -static void console_select_set_apply(bContext *C, wmOperator *op, const wmEvent *event) +static void console_modal_select_apply(bContext *C, wmOperator *op, const wmEvent *event) { SpaceConsole *sc = CTX_wm_space_console(C); ScrArea *area = CTX_wm_area(C); @@ -1296,7 +1296,9 @@ static void console_cursor_set_exit(bContext *C, wmOperator *op) MEM_freeN(scu); } -static int console_select_set_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus console_select_set_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { SpaceConsole *sc = CTX_wm_space_console(C); ScrArea *area = CTX_wm_area(C); @@ -1323,12 +1325,12 @@ static int console_select_set_invoke(bContext *C, wmOperator *op, const wmEvent WM_event_add_modal_handler(C, op); - console_select_set_apply(C, op, event); + console_modal_select_apply(C, op, event); return OPERATOR_RUNNING_MODAL; } -static int console_select_set_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus console_select_set_modal(bContext *C, wmOperator *op, const wmEvent *event) { /* Move text cursor to the last selection point. */ switch (event->type) { @@ -1336,18 +1338,18 @@ static int console_select_set_modal(bContext *C, wmOperator *op, const wmEvent * case MIDDLEMOUSE: case RIGHTMOUSE: if (event->val == KM_PRESS) { - console_select_set_apply(C, op, event); + console_modal_select_apply(C, op, event); break; } else if (event->val == KM_RELEASE) { - console_select_set_apply(C, op, event); + console_modal_select_apply(C, op, event); ED_area_tag_redraw(CTX_wm_area(C)); console_cursor_set_exit(C, op); return OPERATOR_FINISHED; } break; case MOUSEMOVE: - console_select_set_apply(C, op, event); + console_modal_select_apply(C, op, event); break; } @@ -1373,9 +1375,9 @@ void CONSOLE_OT_select_set(wmOperatorType *ot) ot->poll = ED_operator_console_active; } -static int console_select_set_all_invoke(bContext *C, - wmOperator * /*op*/, - const wmEvent * /*event*/) +static wmOperatorStatus console_modal_select_all_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent * /*event*/) { ScrArea *area = CTX_wm_area(C); SpaceConsole *sc = CTX_wm_space_console(C); @@ -1407,11 +1409,13 @@ void CONSOLE_OT_select_all(wmOperatorType *ot) ot->description = "Select all the text"; /* api callbacks */ - ot->invoke = console_select_set_all_invoke; + ot->invoke = console_modal_select_all_invoke; ot->poll = ED_operator_console_active; } -static int console_selectword_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus console_selectword_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { SpaceConsole *sc = CTX_wm_space_console(C); ScrArea *area = CTX_wm_area(C); @@ -1419,7 +1423,7 @@ static int console_selectword_invoke(bContext *C, wmOperator * /*op*/, const wmE ConsoleLine cl_dummy = {nullptr}; ConsoleLine *cl; - int ret = OPERATOR_CANCELLED; + wmOperatorStatus ret = OPERATOR_CANCELLED; int pos, offset, n; pos = console_char_pick(sc, region, event->mval); diff --git a/source/blender/editors/space_file/file_ops.cc b/source/blender/editors/space_file/file_ops.cc index fa333003796..b1b72e8fc58 100644 --- a/source/blender/editors/space_file/file_ops.cc +++ b/source/blender/editors/space_file/file_ops.cc @@ -442,7 +442,7 @@ static int file_box_select_find_last_selected(SpaceFile *sfile, return (dist_first < dist_last) ? sel->first : sel->last; } -static int file_box_select_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus file_box_select_modal(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -450,7 +450,7 @@ static int file_box_select_modal(bContext *C, wmOperator *op, const wmEvent *eve FileSelection sel; rcti rect; - int result; + wmOperatorStatus result; result = WM_gesture_box_modal(C, op, event); @@ -498,7 +498,7 @@ static int file_box_select_modal(bContext *C, wmOperator *op, const wmEvent *eve return result; } -static int file_box_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus file_box_select_exec(bContext *C, wmOperator *op) { ARegion *region = CTX_wm_region(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -564,7 +564,7 @@ static rcti file_select_mval_to_select_rect(const int mval[2]) return rect; } -static int file_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus file_select_exec(bContext *C, wmOperator *op) { ARegion *region = CTX_wm_region(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -596,7 +596,7 @@ static int file_select_exec(bContext *C, wmOperator *op) wait_to_deselect_others = false; } - int ret_val = OPERATOR_FINISHED; + wmOperatorStatus ret_val = OPERATOR_FINISHED; const FileSelectParams *params = ED_fileselect_get_active_params(sfile); if (params) { @@ -916,7 +916,9 @@ static bool file_walk_select_do(bContext *C, fill); } -static int file_walk_select_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus file_walk_select_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { SpaceFile *sfile = (SpaceFile *)CTX_wm_space_data(C); FileSelectParams *params = ED_fileselect_get_active_params(sfile); @@ -966,7 +968,7 @@ void FILE_OT_select_walk(wmOperatorType *ot) /** \name Select All Operator * \{ */ -static int file_select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus file_select_all_exec(bContext *C, wmOperator *op) { ScrArea *area = CTX_wm_area(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -1045,7 +1047,7 @@ void FILE_OT_select_all(wmOperatorType *ot) /** \name View Selected Operator * \{ */ -static int file_view_selected_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus file_view_selected_exec(bContext *C, wmOperator * /*op*/) { SpaceFile *sfile = CTX_wm_space_file(C); FileSelection sel = file_current_selection_range_get(sfile->files); @@ -1097,7 +1099,7 @@ void FILE_OT_view_selected(wmOperatorType *ot) /* Note we could get rid of this one, but it's used by some addon so... * Does not hurt keeping it around for now. */ -static int bookmark_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus bookmark_select_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -1142,7 +1144,7 @@ void FILE_OT_select_bookmark(wmOperatorType *ot) /** \name Add Bookmark Operator * \{ */ -static int bookmark_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus bookmark_add_exec(bContext *C, wmOperator *op) { ScrArea *area = CTX_wm_area(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -1177,7 +1179,7 @@ void FILE_OT_bookmark_add(wmOperatorType *ot) /** \name Delete Bookmark Operator * \{ */ -static int bookmark_delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus bookmark_delete_exec(bContext *C, wmOperator *op) { ScrArea *area = CTX_wm_area(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -1220,7 +1222,7 @@ void FILE_OT_bookmark_delete(wmOperatorType *ot) /** \name Cleanup Bookmark Operator * \{ */ -static int bookmark_cleanup_exec(bContext *C, wmOperator *op) +static wmOperatorStatus bookmark_cleanup_exec(bContext *C, wmOperator *op) { ScrArea *area = CTX_wm_area(C); FSMenu *fsmenu = ED_fsmenu_get(); @@ -1276,7 +1278,7 @@ enum { FILE_BOOKMARK_MOVE_BOTTOM = 2, }; -static int bookmark_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus bookmark_move_exec(bContext *C, wmOperator *op) { ScrArea *area = CTX_wm_area(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -1371,7 +1373,7 @@ void FILE_OT_bookmark_move(wmOperatorType *ot) /** \name Reset Recent Blend Files Operator * \{ */ -static int reset_recent_exec(bContext *C, wmOperator *op) +static wmOperatorStatus reset_recent_exec(bContext *C, wmOperator *op) { ScrArea *area = CTX_wm_area(C); FSMenu *fsmenu = ED_fsmenu_get(); @@ -1452,7 +1454,9 @@ int file_highlight_set(SpaceFile *sfile, ARegion *region, int mx, int my) return (params->highlight_file != origfile); } -static int file_highlight_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus file_highlight_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -1485,9 +1489,9 @@ void FILE_OT_highlight(wmOperatorType *ot) /** \name Sort from Column Operator * \{ */ -static int file_column_sort_ui_context_invoke(bContext *C, - wmOperator * /*op*/, - const wmEvent *event) +static wmOperatorStatus file_column_sort_ui_context_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { const ARegion *region = CTX_wm_region(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -1552,7 +1556,7 @@ static bool file_operator_poll(bContext *C) return poll; } -static int file_cancel_exec(bContext *C, wmOperator * /*unused*/) +static wmOperatorStatus file_cancel_exec(bContext *C, wmOperator * /*unused*/) { wmWindowManager *wm = CTX_wm_manager(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -1819,7 +1823,7 @@ static const EnumPropertyItem file_external_operation[] = { "Open a command prompt here"}, {0, nullptr, 0, nullptr, nullptr}}; -static int file_external_operation_exec(bContext *C, wmOperator *op) +static wmOperatorStatus file_external_operation_exec(bContext *C, wmOperator *op) { PropertyRNA *prop = RNA_struct_find_property(op->ptr, "filepath"); char filepath[FILE_MAX]; @@ -2117,7 +2121,7 @@ static bool file_execute(bContext *C, SpaceFile *sfile) return true; } -static int file_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus file_exec(bContext *C, wmOperator * /*op*/) { SpaceFile *sfile = CTX_wm_space_file(C); @@ -2171,7 +2175,9 @@ static bool file_ensure_hovered_is_active(bContext *C, const wmEvent *event) return true; } -static int file_execute_mouse_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus file_execute_mouse_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -2218,7 +2224,7 @@ void FILE_OT_mouse_execute(wmOperatorType *ot) /** \name Refresh File List Operator * \{ */ -static int file_refresh_exec(bContext *C, wmOperator * /*unused*/) +static wmOperatorStatus file_refresh_exec(bContext *C, wmOperator * /*unused*/) { wmWindowManager *wm = CTX_wm_manager(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -2255,7 +2261,7 @@ void FILE_OT_refresh(wmOperatorType *ot) /** \name Navigate Parent Operator * \{ */ -static int file_parent_exec(bContext *C, wmOperator * /*unused*/) +static wmOperatorStatus file_parent_exec(bContext *C, wmOperator * /*unused*/) { Main *bmain = CTX_data_main(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -2297,7 +2303,7 @@ void FILE_OT_parent(wmOperatorType *ot) /** \name Navigate Previous Operator * \{ */ -static int file_previous_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus file_previous_exec(bContext *C, wmOperator * /*op*/) { SpaceFile *sfile = CTX_wm_space_file(C); FileSelectParams *params = ED_fileselect_get_active_params(sfile); @@ -2333,7 +2339,7 @@ void FILE_OT_previous(wmOperatorType *ot) /** \name Navigate Next Operator * \{ */ -static int file_next_exec(bContext *C, wmOperator * /*unused*/) +static wmOperatorStatus file_next_exec(bContext *C, wmOperator * /*unused*/) { SpaceFile *sfile = CTX_wm_space_file(C); FileSelectParams *params = ED_fileselect_get_active_params(sfile); @@ -2371,7 +2377,9 @@ void FILE_OT_next(wmOperatorType *ot) * \{ */ /* only meant for timer usage */ -static int file_smoothscroll_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus file_smoothscroll_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { ScrArea *area = CTX_wm_area(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -2564,7 +2572,7 @@ void FILE_OT_smoothscroll(wmOperatorType *ot) /** \name File Selector Drop Operator * \{ */ -static int filepath_drop_exec(bContext *C, wmOperator *op) +static wmOperatorStatus filepath_drop_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -2637,7 +2645,7 @@ static bool new_folder_path(const char *parent, return (len < FILE_MAXFILE); } -static int file_directory_new_exec(bContext *C, wmOperator *op) +static wmOperatorStatus file_directory_new_exec(bContext *C, wmOperator *op) { char dirname[FILE_MAXFILE]; char dirpath[FILE_MAX]; @@ -2724,7 +2732,9 @@ static int file_directory_new_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int file_directory_new_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus file_directory_new_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { /* NOTE: confirm is needed because this operator is invoked * when entering a path from the file selector. Without a confirmation, @@ -3029,7 +3039,7 @@ void file_filename_enter_handle(bContext *C, void * /*arg_unused*/, void *arg_bu /** \name Toggle Show Hidden Files Operator * \{ */ -static int file_hidedot_exec(bContext *C, wmOperator * /*unused*/) +static wmOperatorStatus file_hidedot_exec(bContext *C, wmOperator * /*unused*/) { wmWindowManager *wm = CTX_wm_manager(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -3105,7 +3115,7 @@ static void filenum_newname(char *filename, size_t filename_maxncpy, int add) BLI_path_sequence_encode(filename, filename_maxncpy, head, tail, digits, pic); } -static int file_filenum_exec(bContext *C, wmOperator *op) +static wmOperatorStatus file_filenum_exec(bContext *C, wmOperator *op) { SpaceFile *sfile = CTX_wm_space_file(C); FileSelectParams *params = ED_fileselect_get_active_params(sfile); @@ -3165,7 +3175,7 @@ static void file_rename_state_activate(SpaceFile *sfile, int file_idx, bool requ } } -static int file_rename_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus file_rename_exec(bContext *C, wmOperator * /*op*/) { ScrArea *area = CTX_wm_area(C); SpaceFile *sfile = (SpaceFile *)CTX_wm_space_data(C); @@ -3239,7 +3249,7 @@ static bool file_delete_single(const FileList *files, return true; } -static int file_delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus file_delete_exec(bContext *C, wmOperator *op) { wmWindowManager *wm = CTX_wm_manager(C); SpaceFile *sfile = CTX_wm_space_file(C); @@ -3274,7 +3284,7 @@ static int file_delete_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int file_delete_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus file_delete_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { return WM_operator_confirm_ex( C, op, IFACE_("Delete selected files?"), nullptr, IFACE_("Delete"), ALERT_ICON_NONE, false); @@ -3299,7 +3309,7 @@ void FILE_OT_delete(wmOperatorType *ot) /** \name Enter Filter Text Operator * \{ */ -static int file_start_filter_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus file_start_filter_exec(bContext *C, wmOperator * /*op*/) { const ScrArea *area = CTX_wm_area(C); const SpaceFile *sfile = CTX_wm_space_file(C); @@ -3335,7 +3345,7 @@ void FILE_OT_start_filter(wmOperatorType *ot) /** \name Edit Directory Path Operator * \{ */ -static int file_edit_directory_path_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus file_edit_directory_path_exec(bContext *C, wmOperator * /*op*/) { const ScrArea *area = CTX_wm_area(C); const SpaceFile *sfile = CTX_wm_space_file(C); diff --git a/source/blender/editors/space_graph/graph_edit.cc b/source/blender/editors/space_graph/graph_edit.cc index 9c7fe1331b0..970154df96c 100644 --- a/source/blender/editors/space_graph/graph_edit.cc +++ b/source/blender/editors/space_graph/graph_edit.cc @@ -244,7 +244,7 @@ static void insert_graph_keys(bAnimContext *ac, eGraphKeys_InsertKey_Types mode) /* ------------------- */ -static int graphkeys_insertkey_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_insertkey_exec(bContext *C, wmOperator *op) { bAnimContext ac; eGraphKeys_InsertKey_Types mode; @@ -293,7 +293,7 @@ void GRAPH_OT_keyframe_insert(wmOperatorType *ot) /** \name Click-Insert Keyframes Operator * \{ */ -static int graphkeys_click_insert_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_click_insert_exec(bContext *C, wmOperator *op) { using namespace blender::animrig; bAnimContext ac; @@ -384,7 +384,9 @@ static int graphkeys_click_insert_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int graphkeys_click_insert_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus graphkeys_click_insert_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { bAnimContext ac; ARegion *region; @@ -535,7 +537,7 @@ static eKeyPasteError paste_graph_keys(bAnimContext *ac, /* ------------------- */ -static int graphkeys_copy_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_copy_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -569,7 +571,7 @@ void GRAPH_OT_copy(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int graphkeys_paste_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_paste_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -700,7 +702,7 @@ static bool duplicate_graph_keys(bAnimContext *ac) /* ------------------- */ -static int graphkeys_duplicate_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus graphkeys_duplicate_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -790,7 +792,7 @@ static bool delete_graph_keys(bAnimContext *ac) /* ------------------- */ -static int graphkeys_delete_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus graphkeys_delete_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -810,7 +812,9 @@ static int graphkeys_delete_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -static int graphkeys_delete_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus graphkeys_delete_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (RNA_boolean_get(op->ptr, "confirm")) { return WM_operator_confirm_ex(C, @@ -875,7 +879,7 @@ static void clean_graph_keys(bAnimContext *ac, float thresh, bool clean_chan) /* ------------------- */ -static int graphkeys_clean_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_clean_exec(bContext *C, wmOperator *op) { bAnimContext ac; float thresh; @@ -962,7 +966,7 @@ static void convert_keys_to_samples(bAnimContext *ac, int start, int end) /* ------------------- */ -static int graphkeys_keys_to_samples_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus graphkeys_keys_to_samples_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; Scene *scene = nullptr; @@ -1041,7 +1045,7 @@ static void convert_samples_to_keys(bAnimContext *ac, int start, int end) /* ------------------- */ -static int graphkeys_samples_to_keys_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus graphkeys_samples_to_keys_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; Scene *scene = nullptr; @@ -1120,7 +1124,7 @@ static float fcurve_samplingcb_sound(FCurve * /*fcu*/, void *data, float evaltim /* ------------------- */ -static int graphkeys_sound_to_samples_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_sound_to_samples_exec(bContext *C, wmOperator *op) { bAnimContext ac; ListBase anim_data = {nullptr, nullptr}; @@ -1201,7 +1205,7 @@ static int graphkeys_sound_to_samples_exec(bContext *C, wmOperator *op) #else /* WITH_AUDASPACE */ -static int graphkeys_sound_to_samples_exec(bContext * /*C*/, wmOperator *op) +static wmOperatorStatus graphkeys_sound_to_samples_exec(bContext * /*C*/, wmOperator *op) { BKE_report(op->reports, RPT_ERROR, "Compiled without sound support"); @@ -1210,7 +1214,9 @@ static int graphkeys_sound_to_samples_exec(bContext * /*C*/, wmOperator *op) #endif /* WITH_AUDASPACE */ -static int graphkeys_sound_to_samples_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus graphkeys_sound_to_samples_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { bAnimContext ac; @@ -1355,7 +1361,7 @@ static void bake_graph_keys(bAnimContext *ac) /* ------------------- */ -static int graphkeys_bake_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus graphkeys_bake_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -1484,7 +1490,7 @@ static void setexpo_graph_keys(bAnimContext *ac, short mode) /* ------------------- */ -static int graphkeys_expo_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_expo_exec(bContext *C, wmOperator *op) { bAnimContext ac; short mode; @@ -1561,7 +1567,7 @@ static void setipo_graph_keys(bAnimContext *ac, short mode) /* ------------------- */ -static int graphkeys_ipo_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_ipo_exec(bContext *C, wmOperator *op) { bAnimContext ac; short mode; @@ -1638,7 +1644,7 @@ static void seteasing_graph_keys(bAnimContext *ac, short mode) ANIM_animdata_freelist(&anim_data); } -static int graphkeys_easing_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_easing_exec(bContext *C, wmOperator *op) { bAnimContext ac; short mode; @@ -1723,7 +1729,7 @@ static void sethandles_graph_keys(bAnimContext *ac, short mode) } /* ------------------- */ -static int graphkeys_handletype_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_handletype_exec(bContext *C, wmOperator *op) { bAnimContext ac; short mode; @@ -2006,7 +2012,7 @@ static void euler_filter_perform_filter(ListBase /*tEulerFilter*/ *eulers, } } -static int graphkeys_euler_filter_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_euler_filter_exec(bContext *C, wmOperator *op) { /* Get editor data. */ bAnimContext ac; @@ -2173,7 +2179,7 @@ static KeyframeEditData sum_selected_keyframes(bAnimContext *ac) } /* Snap current-frame indicator to 'average time' of selected keyframe. */ -static int graphkeys_framejump_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus graphkeys_framejump_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -2257,7 +2263,7 @@ static bool find_closest_frame(const FCurve *fcu, return true; } -static int keyframe_jump_exec(bContext *C, wmOperator *op) +static wmOperatorStatus keyframe_jump_exec(bContext *C, wmOperator *op) { bAnimContext ac; Scene *scene = CTX_data_scene(C); @@ -2339,7 +2345,7 @@ void GRAPH_OT_keyframe_jump(wmOperatorType *ot) } /* snap 2D cursor value to the average value of selected keyframe */ -static int graphkeys_snap_cursor_value_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus graphkeys_snap_cursor_value_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -2492,7 +2498,7 @@ static void snap_graph_keys(bAnimContext *ac, short mode) /* ------------------- */ -static int graphkeys_snap_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_snap_exec(bContext *C, wmOperator *op) { bAnimContext ac; short mode; @@ -2545,9 +2551,9 @@ static bool graph_has_selected_control_points(bContext *C) return has_selected_control_points; } -static int graphkeys_selected_control_points_invoke(bContext *C, - wmOperator *op, - const wmEvent *event) +static wmOperatorStatus graphkeys_selected_control_points_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { if (!graph_has_selected_control_points(C)) { BKE_report(op->reports, RPT_ERROR, "No control points are selected"); @@ -2615,7 +2621,7 @@ static void equalize_graph_keys(bAnimContext *ac, int mode, float handle_length, ANIM_animdata_freelist(&anim_data); } -static int graphkeys_equalize_handles_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_equalize_handles_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -2798,7 +2804,7 @@ static void mirror_graph_keys(bAnimContext *ac, short mode) /* ------------------- */ -static int graphkeys_mirror_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_mirror_exec(bContext *C, wmOperator *op) { bAnimContext ac; short mode; @@ -2845,7 +2851,7 @@ void GRAPH_OT_mirror(wmOperatorType *ot) /** \name Smooth Keyframes Operator * \{ */ -static int graphkeys_smooth_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus graphkeys_smooth_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; ListBase anim_data = {nullptr, nullptr}; @@ -2941,7 +2947,7 @@ static const EnumPropertyItem *graph_fmodifier_itemf(bContext *C, return item; } -static int graph_fmodifier_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graph_fmodifier_add_exec(bContext *C, wmOperator *op) { bAnimContext ac; ListBase anim_data = {nullptr, nullptr}; @@ -3029,7 +3035,7 @@ void GRAPH_OT_fmodifier_add(wmOperatorType *ot) /** \name Copy F-Modifiers Operator * \{ */ -static int graph_fmodifier_copy_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graph_fmodifier_copy_exec(bContext *C, wmOperator *op) { bAnimContext ac; bAnimListElem *ale; @@ -3095,7 +3101,7 @@ void GRAPH_OT_fmodifier_copy(wmOperatorType *ot) /** \name Paste F-Modifiers Operator * \{ */ -static int graph_fmodifier_paste_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graph_fmodifier_paste_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -3190,7 +3196,7 @@ void GRAPH_OT_fmodifier_paste(wmOperatorType *ot) /** \name Copy Driver Variables Operator * \{ */ -static int graph_driver_vars_copy_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graph_driver_vars_copy_exec(bContext *C, wmOperator *op) { bool ok = false; @@ -3231,7 +3237,7 @@ void GRAPH_OT_driver_variables_copy(wmOperatorType *ot) /** \name Paste Driver Variables Operator * \{ */ -static int graph_driver_vars_paste_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graph_driver_vars_paste_exec(bContext *C, wmOperator *op) { const bool replace = RNA_boolean_get(op->ptr, "replace"); bool ok = false; @@ -3287,7 +3293,7 @@ void GRAPH_OT_driver_variables_paste(wmOperatorType *ot) /** \name Delete Invalid Drivers Operator * \{ */ -static int graph_driver_delete_invalid_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus graph_driver_delete_invalid_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; ListBase anim_data = {nullptr, nullptr}; diff --git a/source/blender/editors/space_graph/graph_ops.cc b/source/blender/editors/space_graph/graph_ops.cc index 6c7d8640493..a22ea7d1467 100644 --- a/source/blender/editors/space_graph/graph_ops.cc +++ b/source/blender/editors/space_graph/graph_ops.cc @@ -99,7 +99,7 @@ static void graphview_cursor_apply(bContext *C, wmOperator *op) /* ... */ /* Non-modal callback for running operator without user input */ -static int graphview_cursor_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphview_cursor_exec(bContext *C, wmOperator *op) { graphview_cursor_apply(C, op); return OPERATOR_FINISHED; @@ -128,7 +128,7 @@ static void graphview_cursor_setprops(bContext *C, wmOperator *op, const wmEvent } /* Modal Operator init */ -static int graphview_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus graphview_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bScreen *screen = CTX_wm_screen(C); @@ -150,7 +150,7 @@ static int graphview_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *e } /* Modal event handling of cursor changing */ -static int graphview_cursor_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus graphview_cursor_modal(bContext *C, wmOperator *op, const wmEvent *event) { bScreen *screen = CTX_wm_screen(C); Scene *scene = CTX_data_scene(C); @@ -216,7 +216,7 @@ static void GRAPH_OT_cursor_set(wmOperatorType *ot) /** \name Hide/Reveal * \{ */ -static int graphview_curves_hide_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphview_curves_hide_exec(bContext *C, wmOperator *op) { bAnimContext ac; ListBase anim_data = {nullptr, nullptr}; @@ -331,7 +331,7 @@ static void GRAPH_OT_hide(wmOperatorType *ot) /* ........ */ -static int graphview_curves_reveal_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphview_curves_reveal_exec(bContext *C, wmOperator *op) { bAnimContext ac; ListBase anim_data = {nullptr, nullptr}; diff --git a/source/blender/editors/space_graph/graph_select.cc b/source/blender/editors/space_graph/graph_select.cc index 425a7ec23a6..6b25c16a85b 100644 --- a/source/blender/editors/space_graph/graph_select.cc +++ b/source/blender/editors/space_graph/graph_select.cc @@ -418,7 +418,7 @@ void deselect_graph_keys(bAnimContext *ac, bool test, eEditKeyframes_Select sel, /* ------------------- */ -static int graphkeys_deselectall_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_deselectall_exec(bContext *C, wmOperator *op) { bAnimContext ac; bAnimListElem *ale_active = nullptr; @@ -814,7 +814,9 @@ static void box_select_graphcurves(bAnimContext *ac, /* ------------------- */ -static int graphkeys_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus graphkeys_box_select_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { bAnimContext ac; if (ANIM_animdata_get_context(C, &ac) == 0) { @@ -838,7 +840,7 @@ static int graphkeys_box_select_invoke(bContext *C, wmOperator *op, const wmEven return WM_gesture_box_invoke(C, op, event); } -static int graphkeys_box_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_box_select_exec(bContext *C, wmOperator *op) { bAnimContext ac; rcti rect; @@ -945,7 +947,7 @@ void GRAPH_OT_select_box(wmOperatorType *ot) /* ------------------- */ -static int graphkeys_lassoselect_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_lassoselect_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -1032,7 +1034,7 @@ void GRAPH_OT_select_lasso(wmOperatorType *ot) /* ------------------- */ -static int graph_circle_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graph_circle_select_exec(bContext *C, wmOperator *op) { bAnimContext ac; bool incl_handles = false; @@ -1274,7 +1276,7 @@ static void columnselect_graph_keys(bAnimContext *ac, short mode) /* ------------------- */ -static int graphkeys_columnselect_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_columnselect_exec(bContext *C, wmOperator *op) { bAnimContext ac; short mode; @@ -1325,7 +1327,7 @@ void GRAPH_OT_select_column(wmOperatorType *ot) /** \name Select Linked Operator * \{ */ -static int graphkeys_select_linked_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus graphkeys_select_linked_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -1431,7 +1433,7 @@ static void select_moreless_graph_keys(bAnimContext *ac, short mode) /* ----------------- */ -static int graphkeys_select_more_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus graphkeys_select_more_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -1466,7 +1468,7 @@ void GRAPH_OT_select_more(wmOperatorType *ot) /* ----------------- */ -static int graphkeys_select_less_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus graphkeys_select_less_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -1571,7 +1573,7 @@ static void graphkeys_select_leftright(bAnimContext *ac, /* ----------------- */ -static int graphkeys_select_leftright_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_select_leftright_exec(bContext *C, wmOperator *op) { bAnimContext ac; short leftright = RNA_enum_get(op->ptr, "mode"); @@ -1605,7 +1607,9 @@ static int graphkeys_select_leftright_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int graphkeys_select_leftright_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus graphkeys_select_leftright_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { bAnimContext ac; short leftright = RNA_enum_get(op->ptr, "mode"); @@ -1677,12 +1681,12 @@ void GRAPH_OT_select_leftright(wmOperatorType *ot) * \{ */ /* option 1) select keyframe directly under mouse */ -static int mouse_graph_keys(bAnimContext *ac, - const int mval[2], - eEditKeyframes_Select select_mode, - const bool deselect_all, - const bool curves_only, - bool wait_to_deselect_others) +static wmOperatorStatus mouse_graph_keys(bAnimContext *ac, + const int mval[2], + eEditKeyframes_Select select_mode, + const bool deselect_all, + const bool curves_only, + bool wait_to_deselect_others) { SpaceGraph *sipo = (SpaceGraph *)ac->sl; tNearestVertInfo *nvi; @@ -1852,10 +1856,10 @@ static int mouse_graph_keys(bAnimContext *ac, /* (see graphkeys_select_leftright) */ /* Option 3) Selects all visible keyframes in the same frame as the mouse click */ -static int graphkeys_mselect_column(bAnimContext *ac, - const int mval[2], - eEditKeyframes_Select select_mode, - bool wait_to_deselect_others) +static wmOperatorStatus graphkeys_mselect_column(bAnimContext *ac, + const int mval[2], + eEditKeyframes_Select select_mode, + bool wait_to_deselect_others) { ListBase anim_data = {nullptr, nullptr}; int filter; @@ -1933,7 +1937,7 @@ static int graphkeys_mselect_column(bAnimContext *ac, /** \name Click Select Operator * \{ */ -static int graphkeys_clickselect_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_clickselect_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -1949,7 +1953,7 @@ static int graphkeys_clickselect_exec(bContext *C, wmOperator *op) * this. */ const bool wait_to_deselect_others = RNA_boolean_get(op->ptr, "wait_to_deselect_others"); int mval[2]; - int ret_val; + wmOperatorStatus ret_val; mval[0] = RNA_int_get(op->ptr, "mouse_x"); mval[1] = RNA_int_get(op->ptr, "mouse_y"); @@ -2129,7 +2133,7 @@ static void graphkeys_select_key_handles( ANIM_animdata_freelist(&anim_data); } -static int graphkeys_select_key_handles_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_select_key_handles_exec(bContext *C, wmOperator *op) { bAnimContext ac; diff --git a/source/blender/editors/space_graph/graph_slider_ops.cc b/source/blender/editors/space_graph/graph_slider_ops.cc index 605888aa49b..ffbc1833755 100644 --- a/source/blender/editors/space_graph/graph_slider_ops.cc +++ b/source/blender/editors/space_graph/graph_slider_ops.cc @@ -295,7 +295,7 @@ static void update_depsgraph(tGraphSliderOp *gso) ANIM_animdata_freelist(&anim_data); } -static int graph_slider_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus graph_slider_modal(bContext *C, wmOperator *op, const wmEvent *event) { tGraphSliderOp *gso = static_cast(op->customdata); @@ -385,7 +385,7 @@ static int graph_slider_modal(bContext *C, wmOperator *op, const wmEvent *event) } /* Allocate tGraphSliderOp and assign to op->customdata. */ -static int graph_slider_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus graph_slider_invoke(bContext *C, wmOperator *op, const wmEvent *event) { tGraphSliderOp *gso; @@ -489,9 +489,9 @@ static void decimate_modal_update(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr); } -static int decimate_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus decimate_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - const int invoke_result = graph_slider_invoke(C, op, event); + const wmOperatorStatus invoke_result = graph_slider_invoke(C, op, event); if (invoke_result == OPERATOR_CANCELLED) { return OPERATOR_CANCELLED; @@ -505,7 +505,7 @@ static int decimate_invoke(bContext *C, wmOperator *op, const wmEvent *event) return invoke_result; } -static int decimate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus decimate_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -662,9 +662,9 @@ static void blend_to_neighbor_modal_update(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr); } -static int blend_to_neighbor_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus blend_to_neighbor_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - const int invoke_result = graph_slider_invoke(C, op, event); + const wmOperatorStatus invoke_result = graph_slider_invoke(C, op, event); if (invoke_result == OPERATOR_CANCELLED) { return invoke_result; @@ -680,7 +680,7 @@ static int blend_to_neighbor_invoke(bContext *C, wmOperator *op, const wmEvent * return invoke_result; } -static int blend_to_neighbor_exec(bContext *C, wmOperator *op) +static wmOperatorStatus blend_to_neighbor_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -749,9 +749,9 @@ static void breakdown_modal_update(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr); } -static int breakdown_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus breakdown_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - const int invoke_result = graph_slider_invoke(C, op, event); + const wmOperatorStatus invoke_result = graph_slider_invoke(C, op, event); if (invoke_result == OPERATOR_CANCELLED) { return invoke_result; @@ -767,7 +767,7 @@ static int breakdown_invoke(bContext *C, wmOperator *op, const wmEvent *event) return invoke_result; } -static int breakdown_exec(bContext *C, wmOperator *op) +static wmOperatorStatus breakdown_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -856,9 +856,9 @@ static void blend_to_default_modal_update(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr); } -static int blend_to_default_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus blend_to_default_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - const int invoke_result = graph_slider_invoke(C, op, event); + const wmOperatorStatus invoke_result = graph_slider_invoke(C, op, event); if (invoke_result == OPERATOR_CANCELLED) { return invoke_result; @@ -873,7 +873,7 @@ static int blend_to_default_invoke(bContext *C, wmOperator *op, const wmEvent *e return invoke_result; } -static int blend_to_default_exec(bContext *C, wmOperator *op) +static wmOperatorStatus blend_to_default_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -992,7 +992,7 @@ static void ease_modal_update(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr); } -static int ease_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus ease_modal(bContext *C, wmOperator *op, const wmEvent *event) { if (event->val != KM_PRESS) { return graph_slider_modal(C, op, event); @@ -1029,9 +1029,9 @@ static int ease_modal(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int ease_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus ease_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - const int invoke_result = graph_slider_invoke(C, op, event); + const wmOperatorStatus invoke_result = graph_slider_invoke(C, op, event); if (invoke_result == OPERATOR_CANCELLED) { return invoke_result; @@ -1049,7 +1049,7 @@ static int ease_invoke(bContext *C, wmOperator *op, const wmEvent *event) return invoke_result; } -static int ease_exec(bContext *C, wmOperator *op) +static wmOperatorStatus ease_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -1133,9 +1133,9 @@ static void blend_offset_modal_update(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr); } -static int blend_offset_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus blend_offset_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - const int invoke_result = graph_slider_invoke(C, op, event); + const wmOperatorStatus invoke_result = graph_slider_invoke(C, op, event); if (invoke_result == OPERATOR_CANCELLED) { return invoke_result; @@ -1151,7 +1151,7 @@ static int blend_offset_invoke(bContext *C, wmOperator *op, const wmEvent *event return invoke_result; } -static int blend_offset_exec(bContext *C, wmOperator *op) +static wmOperatorStatus blend_offset_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -1226,9 +1226,9 @@ static void blend_to_ease_modal_update(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr); } -static int blend_to_ease_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus blend_to_ease_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - const int invoke_result = graph_slider_invoke(C, op, event); + const wmOperatorStatus invoke_result = graph_slider_invoke(C, op, event); if (invoke_result == OPERATOR_CANCELLED) { return invoke_result; @@ -1245,7 +1245,7 @@ static int blend_to_ease_invoke(bContext *C, wmOperator *op, const wmEvent *even return invoke_result; } -static int blend_to_ease_exec(bContext *C, wmOperator *op) +static wmOperatorStatus blend_to_ease_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -1348,9 +1348,9 @@ static void match_slope_modal_update(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr); } -static int match_slope_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus match_slope_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - const int invoke_result = graph_slider_invoke(C, op, event); + const wmOperatorStatus invoke_result = graph_slider_invoke(C, op, event); if (invoke_result == OPERATOR_CANCELLED) { return invoke_result; @@ -1367,7 +1367,7 @@ static int match_slope_invoke(bContext *C, wmOperator *op, const wmEvent *event) return invoke_result; } -static int match_slope_exec(bContext *C, wmOperator *op) +static wmOperatorStatus match_slope_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -1440,9 +1440,9 @@ static void time_offset_modal_update(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr); } -static int time_offset_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus time_offset_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - const int invoke_result = graph_slider_invoke(C, op, event); + const wmOperatorStatus invoke_result = graph_slider_invoke(C, op, event); if (invoke_result == OPERATOR_CANCELLED) { return invoke_result; @@ -1461,7 +1461,7 @@ static int time_offset_invoke(bContext *C, wmOperator *op, const wmEvent *event) return invoke_result; } -static int time_offset_exec(bContext *C, wmOperator *op) +static wmOperatorStatus time_offset_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -1585,7 +1585,7 @@ static void shear_modal_update(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr); } -static int shear_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus shear_modal(bContext *C, wmOperator *op, const wmEvent *event) { if (event->val != KM_PRESS) { return graph_slider_modal(C, op, event); @@ -1608,9 +1608,9 @@ static int shear_modal(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int shear_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus shear_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - const int invoke_result = graph_slider_invoke(C, op, event); + const wmOperatorStatus invoke_result = graph_slider_invoke(C, op, event); if (invoke_result == OPERATOR_CANCELLED) { return invoke_result; @@ -1628,7 +1628,7 @@ static int shear_invoke(bContext *C, wmOperator *op, const wmEvent *event) return invoke_result; } -static int shear_exec(bContext *C, wmOperator *op) +static wmOperatorStatus shear_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -1706,9 +1706,9 @@ static void scale_average_modal_update(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr); } -static int scale_average_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus scale_average_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - const int invoke_result = graph_slider_invoke(C, op, event); + const wmOperatorStatus invoke_result = graph_slider_invoke(C, op, event); if (invoke_result == OPERATOR_CANCELLED) { return invoke_result; @@ -1724,7 +1724,7 @@ static int scale_average_invoke(bContext *C, wmOperator *op, const wmEvent *even return invoke_result; } -static int scale_average_exec(bContext *C, wmOperator *op) +static wmOperatorStatus scale_average_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -1882,9 +1882,9 @@ static void gaussian_smooth_modal_update(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr); } -static int gaussian_smooth_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus gaussian_smooth_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - const int invoke_result = graph_slider_invoke(C, op, event); + const wmOperatorStatus invoke_result = graph_slider_invoke(C, op, event); if (invoke_result == OPERATOR_CANCELLED) { return invoke_result; @@ -1941,7 +1941,7 @@ static void gaussian_smooth_graph_keys(bAnimContext *ac, ANIM_animdata_freelist(&anim_data); } -static int gaussian_smooth_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gaussian_smooth_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -2136,9 +2136,9 @@ static void btw_smooth_modal_update(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr); } -static int btw_smooth_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus btw_smooth_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - const int invoke_result = graph_slider_invoke(C, op, event); + const wmOperatorStatus invoke_result = graph_slider_invoke(C, op, event); if (invoke_result == OPERATOR_CANCELLED) { return invoke_result; @@ -2213,7 +2213,7 @@ static void btw_smooth_graph_keys(bAnimContext *ac, ANIM_animdata_freelist(&anim_data); } -static int btw_smooth_exec(bContext *C, wmOperator *op) +static wmOperatorStatus btw_smooth_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -2324,9 +2324,9 @@ static void push_pull_modal_update(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr); } -static int push_pull_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus push_pull_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - const int invoke_result = graph_slider_invoke(C, op, event); + const wmOperatorStatus invoke_result = graph_slider_invoke(C, op, event); if (invoke_result == OPERATOR_CANCELLED) { return invoke_result; @@ -2342,7 +2342,7 @@ static int push_pull_invoke(bContext *C, wmOperator *op, const wmEvent *event) return invoke_result; } -static int push_pull_exec(bContext *C, wmOperator *op) +static wmOperatorStatus push_pull_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -2463,7 +2463,9 @@ static void scale_from_neighbor_modal_update(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, nullptr); } -static int scale_from_neighbor_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus scale_from_neighbor_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { if (event->val != KM_PRESS) { return graph_slider_modal(C, op, event); @@ -2491,9 +2493,11 @@ static int scale_from_neighbor_modal(bContext *C, wmOperator *op, const wmEvent return OPERATOR_RUNNING_MODAL; } -static int scale_from_neighbor_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus scale_from_neighbor_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { - const int invoke_result = graph_slider_invoke(C, op, event); + const wmOperatorStatus invoke_result = graph_slider_invoke(C, op, event); if (invoke_result == OPERATOR_CANCELLED) { return OPERATOR_CANCELLED; @@ -2509,7 +2513,7 @@ static int scale_from_neighbor_invoke(bContext *C, wmOperator *op, const wmEvent return invoke_result; } -static int scale_from_neighbor_exec(bContext *C, wmOperator *op) +static wmOperatorStatus scale_from_neighbor_exec(bContext *C, wmOperator *op) { bAnimContext ac; diff --git a/source/blender/editors/space_graph/graph_view.cc b/source/blender/editors/space_graph/graph_view.cc index 1715c1cb0c5..035bf84bb36 100644 --- a/source/blender/editors/space_graph/graph_view.cc +++ b/source/blender/editors/space_graph/graph_view.cc @@ -183,7 +183,7 @@ void get_graph_keyframe_extents(bAnimContext *ac, /** \name Automatic Preview-Range Operator * \{ */ -static int graphkeys_previewrange_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus graphkeys_previewrange_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; Scene *scene; @@ -234,10 +234,10 @@ void GRAPH_OT_previewrange_set(wmOperatorType *ot) /** \name View-All Operator * \{ */ -static int graphkeys_viewall(bContext *C, - const bool do_sel_only, - const bool include_handles, - const int smooth_viewtx) +static wmOperatorStatus graphkeys_viewall(bContext *C, + const bool do_sel_only, + const bool include_handles, + const int smooth_viewtx) { bAnimContext ac; rctf cur_new; @@ -273,7 +273,7 @@ static int graphkeys_viewall(bContext *C, /* ......... */ -static int graphkeys_viewall_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_viewall_exec(bContext *C, wmOperator *op) { const bool include_handles = RNA_boolean_get(op->ptr, "include_handles"); const int smooth_viewtx = WM_operator_smooth_viewtx_get(op); @@ -282,7 +282,7 @@ static int graphkeys_viewall_exec(bContext *C, wmOperator *op) return graphkeys_viewall(C, false, include_handles, smooth_viewtx); } -static int graphkeys_view_selected_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_view_selected_exec(bContext *C, wmOperator *op) { const bool include_handles = RNA_boolean_get(op->ptr, "include_handles"); const int smooth_viewtx = WM_operator_smooth_viewtx_get(op); @@ -345,7 +345,7 @@ void GRAPH_OT_view_selected(wmOperatorType *ot) /** \name View Frame Operator * \{ */ -static int graphkeys_view_frame_exec(bContext *C, wmOperator *op) +static wmOperatorStatus graphkeys_view_frame_exec(bContext *C, wmOperator *op) { const int smooth_viewtx = WM_operator_smooth_viewtx_get(op); ANIM_center_frame(C, smooth_viewtx); @@ -449,7 +449,7 @@ static void create_ghost_curves(bAnimContext *ac, int start, int end) /* ------------------- */ -static int graphkeys_create_ghostcurves_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus graphkeys_create_ghostcurves_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; View2D *v2d; @@ -501,7 +501,7 @@ void GRAPH_OT_ghost_curves_create(wmOperatorType *ot) * This operator clears the 'ghost curves' for the active Graph Editor. * \{ */ -static int graphkeys_clear_ghostcurves_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus graphkeys_clear_ghostcurves_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; SpaceGraph *sipo; diff --git a/source/blender/editors/space_image/image_ops.cc b/source/blender/editors/space_image/image_ops.cc index 9a5b42ef69d..74e0d582a4f 100644 --- a/source/blender/editors/space_image/image_ops.cc +++ b/source/blender/editors/space_image/image_ops.cc @@ -405,7 +405,7 @@ static void image_view_pan_exit(bContext *C, wmOperator *op, bool cancel) MEM_freeN(op->customdata); } -static int image_view_pan_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_view_pan_exec(bContext *C, wmOperator *op) { SpaceImage *sima = CTX_wm_space_image(C); float offset[2]; @@ -419,7 +419,7 @@ static int image_view_pan_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int image_view_pan_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus image_view_pan_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (event->type == MOUSEPAN) { SpaceImage *sima = CTX_wm_space_image(C); @@ -437,7 +437,7 @@ static int image_view_pan_invoke(bContext *C, wmOperator *op, const wmEvent *eve return OPERATOR_RUNNING_MODAL; } -static int image_view_pan_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus image_view_pan_modal(bContext *C, wmOperator *op, const wmEvent *event) { SpaceImage *sima = CTX_wm_space_image(C); ViewPanData *vpd = static_cast(op->customdata); @@ -576,7 +576,7 @@ static void image_view_zoom_exit(bContext *C, wmOperator *op, bool cancel) MEM_freeN(op->customdata); } -static int image_view_zoom_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_view_zoom_exec(bContext *C, wmOperator *op) { SpaceImage *sima = CTX_wm_space_image(C); ARegion *region = CTX_wm_region(C); @@ -594,7 +594,7 @@ enum { VIEW_CONFIRM, }; -static int image_view_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus image_view_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (ELEM(event->type, MOUSEZOOM, MOUSEPAN)) { SpaceImage *sima = CTX_wm_space_image(C); @@ -674,11 +674,11 @@ static void image_zoom_apply(ViewZoomData *vpd, ED_region_tag_redraw(vpd->region); } -static int image_view_zoom_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus image_view_zoom_modal(bContext *C, wmOperator *op, const wmEvent *event) { ViewZoomData *vpd = static_cast(op->customdata); short event_code = VIEW_PASS; - int ret = OPERATOR_RUNNING_MODAL; + wmOperatorStatus ret = OPERATOR_RUNNING_MODAL; /* Execute the events. */ if (event->type == MOUSEMOVE) { @@ -774,7 +774,9 @@ 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 * /*op*/, const wmEvent *event) +static wmOperatorStatus image_view_ndof_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { if (event->type != NDOF_MOTION) { return OPERATOR_CANCELLED; @@ -828,7 +830,7 @@ void IMAGE_OT_view_ndof(wmOperatorType *ot) * Default behavior is to reset the position of the image and set the zoom to 1 * If the image will not fit within the window rectangle, the zoom is adjusted */ -static int image_view_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_view_all_exec(bContext *C, wmOperator *op) { SpaceImage *sima; ARegion *region; @@ -871,7 +873,7 @@ void IMAGE_OT_view_all(wmOperatorType *ot) /** \name Cursor To Center View Operator * \{ */ -static int view_cursor_center_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_cursor_center_exec(bContext *C, wmOperator *op) { SpaceImage *sima; ARegion *region; @@ -914,7 +916,7 @@ void IMAGE_OT_view_cursor_center(wmOperatorType *ot) /** \name Center View To Cursor Operator * \{ */ -static int view_center_cursor_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus view_center_cursor_exec(bContext *C, wmOperator * /*op*/) { SpaceImage *sima = CTX_wm_space_image(C); ARegion *region = CTX_wm_region(C); @@ -944,7 +946,7 @@ void IMAGE_OT_view_center_cursor(wmOperatorType *ot) /** \name Frame Selected Operator * \{ */ -static int image_view_selected_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus image_view_selected_exec(bContext *C, wmOperator * /*op*/) { SpaceImage *sima; ARegion *region; @@ -1015,7 +1017,7 @@ void IMAGE_OT_view_selected(wmOperatorType *ot) /** \name View Zoom In/Out Operator * \{ */ -static int image_view_zoom_in_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_view_zoom_in_exec(bContext *C, wmOperator *op) { SpaceImage *sima = CTX_wm_space_image(C); ARegion *region = CTX_wm_region(C); @@ -1031,7 +1033,9 @@ 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, const wmEvent *event) +static wmOperatorStatus image_view_zoom_in_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); float location[2]; @@ -1074,7 +1078,7 @@ void IMAGE_OT_view_zoom_in(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_HIDDEN); } -static int image_view_zoom_out_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_view_zoom_out_exec(bContext *C, wmOperator *op) { SpaceImage *sima = CTX_wm_space_image(C); ARegion *region = CTX_wm_region(C); @@ -1090,7 +1094,9 @@ 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, const wmEvent *event) +static wmOperatorStatus image_view_zoom_out_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); float location[2]; @@ -1139,7 +1145,7 @@ void IMAGE_OT_view_zoom_out(wmOperatorType *ot) /** \name View Zoom Ratio Operator * \{ */ -static int image_view_zoom_ratio_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_view_zoom_ratio_exec(bContext *C, wmOperator *op) { SpaceImage *sima = CTX_wm_space_image(C); ARegion *region = CTX_wm_region(C); @@ -1187,7 +1193,7 @@ void IMAGE_OT_view_zoom_ratio(wmOperatorType *ot) /** \name View Border-Zoom Operator * \{ */ -static int image_view_zoom_border_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_view_zoom_border_exec(bContext *C, wmOperator *op) { SpaceImage *sima = CTX_wm_space_image(C); ARegion *region = CTX_wm_region(C); @@ -1337,7 +1343,7 @@ static Image *image_open_single(Main *bmain, return ima; } -static int image_open_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_open_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); ScrArea *area = CTX_wm_area(C); @@ -1450,7 +1456,7 @@ static int image_open_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int image_open_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus image_open_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { SpaceImage *sima = CTX_wm_space_image(C); /* XXX other space types can call */ const char *path = U.textudir; @@ -1594,7 +1600,7 @@ void IMAGE_OT_open(wmOperatorType *ot) /** \name Browse Image Operator * \{ */ -static int image_file_browse_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_file_browse_exec(bContext *C, wmOperator *op) { Image *ima = static_cast(op->customdata); if (ima == nullptr) { @@ -1630,7 +1636,7 @@ static int image_file_browse_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int image_file_browse_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus image_file_browse_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Image *ima = image_from_context(C); if (!ima) { @@ -1716,7 +1722,7 @@ void IMAGE_OT_file_browse(wmOperatorType *ot) /** \name Match Movie Length Operator * \{ */ -static int image_match_len_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus image_match_len_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); Image *ima = image_from_context(C); @@ -1766,7 +1772,7 @@ void IMAGE_OT_match_movie_length(wmOperatorType *ot) /** \name Replace Image Operator * \{ */ -static int image_replace_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_replace_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); SpaceImage *sima = CTX_wm_space_image(C); @@ -1804,7 +1810,9 @@ static int image_replace_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int image_replace_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus image_replace_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { SpaceImage *sima = CTX_wm_space_image(C); @@ -1949,7 +1957,7 @@ static void image_save_as_free(wmOperator *op) } } -static int image_save_as_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_save_as_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); ImageSaveData *isd; @@ -1989,7 +1997,9 @@ static bool image_save_as_check(bContext *C, wmOperator *op) return WM_operator_filesel_ensure_ext_imtype(op, &isd->opts.im_format); } -static int image_save_as_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus image_save_as_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (RNA_struct_property_is_set(op->ptr, "filepath")) { return image_save_as_exec(C, op); @@ -2164,7 +2174,7 @@ static bool image_save_poll(bContext *C) return true; } -static int image_save_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_save_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Image *image = image_from_context(C); @@ -2207,7 +2217,7 @@ static int image_save_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int image_save_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus image_save_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Image *ima = image_from_context(C); ImageUser *iuser = image_user_from_context(C); @@ -2244,7 +2254,7 @@ void IMAGE_OT_save(wmOperatorType *ot) /** \name Save Sequence Operator * \{ */ -static int image_save_sequence_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_save_sequence_exec(bContext *C, wmOperator *op) { Image *image = image_from_context(C); ImBuf *ibuf, *first_ibuf = nullptr; @@ -2470,7 +2480,7 @@ static bool image_save_all_modified_poll(bContext *C) return num_files > 0; } -static int image_save_all_modified_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_save_all_modified_exec(bContext *C, wmOperator *op) { ED_image_save_all_modified(C, op->reports); return OPERATOR_FINISHED; @@ -2497,7 +2507,7 @@ void IMAGE_OT_save_all_modified(wmOperatorType *ot) /** \name Reload Image Operator * \{ */ -static int image_reload_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus image_reload_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Image *ima = image_from_context(C); @@ -2569,7 +2579,7 @@ static void image_new_free(wmOperator *op) } } -static int image_new_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_new_exec(bContext *C, wmOperator *op) { SpaceImage *sima; Image *ima; @@ -2658,7 +2668,7 @@ static int image_new_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int image_new_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus image_new_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { /* Get property in advance, it doesn't work after WM_operator_props_dialog_popup. */ ImageNewData *data; @@ -2766,7 +2776,7 @@ void IMAGE_OT_new(wmOperatorType *ot) /** \name Flip Operator * \{ */ -static int image_flip_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_flip_exec(bContext *C, wmOperator *op) { Image *ima = image_from_context(C); ImageUser iuser = image_user_from_context_and_active_tile(C, ima); @@ -2888,7 +2898,7 @@ void IMAGE_OT_flip(wmOperatorType *ot) /** \name Rotate Orthogonal Operator (90, 180, 270) * \{ */ -static int image_rotate_orthogonal_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_rotate_orthogonal_exec(bContext *C, wmOperator *op) { Image *ima = image_from_context(C); ImageUser iuser = image_user_from_context_and_active_tile(C, ima); @@ -2971,7 +2981,7 @@ void IMAGE_OT_rotate_orthogonal(wmOperatorType *ot) /** \name Clipboard Copy Operator * \{ */ -static int image_clipboard_copy_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_clipboard_copy_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Image *ima = image_from_context(C); @@ -3047,7 +3057,7 @@ void IMAGE_OT_clipboard_copy(wmOperatorType *ot) /** \name Clipboard Paste Operator * \{ */ -static int image_clipboard_paste_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_clipboard_paste_exec(bContext *C, wmOperator *op) { bool changed = false; @@ -3108,7 +3118,7 @@ void IMAGE_OT_clipboard_paste(wmOperatorType *ot) /** \name Invert Operators * \{ */ -static int image_invert_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_invert_exec(bContext *C, wmOperator *op) { Image *ima = image_from_context(C); ImageUser iuser = image_user_from_context_and_active_tile(C, ima); @@ -3234,7 +3244,7 @@ void IMAGE_OT_invert(wmOperatorType *ot) /** \name Scale Operator * \{ */ -static int image_scale_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus image_scale_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { Image *ima = image_from_context(C); ImageUser iuser = image_user_from_context_and_active_tile(C, ima); @@ -3249,7 +3259,7 @@ static int image_scale_invoke(bContext *C, wmOperator *op, const wmEvent * /*eve C, op, 200, IFACE_("Scale Image to New Size"), IFACE_("Resize")); } -static int image_scale_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_scale_exec(bContext *C, wmOperator *op) { Image *ima = image_from_context(C); ImageUser iuser = image_user_from_context_and_active_tile(C, ima); @@ -3397,7 +3407,7 @@ static bool image_pack_poll(bContext *C) return false; } -static int image_pack_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_pack_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Image *ima = image_from_context(C); @@ -3443,7 +3453,7 @@ void IMAGE_OT_pack(wmOperatorType *ot) /** \name Unpack Operator * \{ */ -static int image_unpack_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_unpack_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Image *ima = image_from_context(C); @@ -3489,7 +3499,7 @@ static int image_unpack_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int image_unpack_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus image_unpack_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { Image *ima = image_from_context(C); @@ -3656,7 +3666,7 @@ void IMAGE_OT_sample(wmOperatorType *ot) /** \name Sample Line Operator * \{ */ -static int image_sample_line_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_sample_line_exec(bContext *C, wmOperator *op) { SpaceImage *sima = CTX_wm_space_image(C); ARegion *region = CTX_wm_region(C); @@ -3708,7 +3718,7 @@ static int image_sample_line_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int image_sample_line_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus image_sample_line_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceImage *sima = CTX_wm_space_image(C); @@ -3793,7 +3803,7 @@ static bool image_cycle_render_slot_poll(bContext *C) return (ima && ima->type == IMA_TYPE_R_RESULT); } -static int image_cycle_render_slot_exec(bContext *C, wmOperator *op) +static wmOperatorStatus image_cycle_render_slot_exec(bContext *C, wmOperator *op) { Image *ima = image_from_context(C); const int direction = RNA_boolean_get(op->ptr, "reverse") ? -1 : 1; @@ -3836,7 +3846,7 @@ void IMAGE_OT_cycle_render_slot(wmOperatorType *ot) /** \name Clear Render Slot Operator * \{ */ -static int image_clear_render_slot_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus image_clear_render_slot_exec(bContext *C, wmOperator * /*op*/) { Image *ima = image_from_context(C); ImageUser *iuser = image_user_from_context(C); @@ -3871,7 +3881,7 @@ void IMAGE_OT_clear_render_slot(wmOperatorType *ot) /** \name Add Render Slot Operator * \{ */ -static int image_add_render_slot_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus image_add_render_slot_exec(bContext *C, wmOperator * /*op*/) { Image *ima = image_from_context(C); @@ -3904,7 +3914,7 @@ void IMAGE_OT_add_render_slot(wmOperatorType *ot) /** \name Remove Render Slot Operator * \{ */ -static int image_remove_render_slot_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus image_remove_render_slot_exec(bContext *C, wmOperator * /*op*/) { Image *ima = image_from_context(C); ImageUser *iuser = image_user_from_context(C); @@ -3963,7 +3973,7 @@ static void change_frame_apply(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene); } -static int change_frame_exec(bContext *C, wmOperator *op) +static wmOperatorStatus change_frame_exec(bContext *C, wmOperator *op) { change_frame_apply(C, op); @@ -3992,7 +4002,7 @@ static int frame_from_event(bContext *C, const wmEvent *event) return framenr; } -static int change_frame_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus change_frame_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); @@ -4013,7 +4023,7 @@ static int change_frame_invoke(bContext *C, wmOperator *op, const wmEvent *event return OPERATOR_RUNNING_MODAL; } -static int change_frame_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus change_frame_modal(bContext *C, wmOperator *op, const wmEvent *event) { switch (event->type) { case EVT_ESCKEY: @@ -4057,7 +4067,7 @@ void IMAGE_OT_change_frame(wmOperatorType *ot) /* Reload cached render results... */ /* goes over all scenes, reads render layers */ -static int image_read_viewlayers_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus image_read_viewlayers_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -4094,7 +4104,7 @@ void IMAGE_OT_read_viewlayers(wmOperatorType *ot) /** \name Render Border Operator * \{ */ -static int render_border_exec(bContext *C, wmOperator *op) +static wmOperatorStatus render_border_exec(bContext *C, wmOperator *op) { ARegion *region = CTX_wm_region(C); Scene *scene = CTX_data_scene(C); @@ -4182,7 +4192,7 @@ void IMAGE_OT_render_border(wmOperatorType *ot) /** \name Clear Render Border Operator * \{ */ -static int clear_render_border_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus clear_render_border_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); scene->r.mode &= ~R_BORDER; @@ -4299,7 +4309,7 @@ static bool tile_add_poll(bContext *C) return (ima != nullptr && ima->source == IMA_SRC_TILED && BKE_image_has_ibuf(ima, nullptr)); } -static int tile_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus tile_add_exec(bContext *C, wmOperator *op) { Image *ima = CTX_data_edit_image(C); @@ -4342,7 +4352,7 @@ static int tile_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int tile_add_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus tile_add_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { Image *ima = CTX_data_edit_image(C); @@ -4436,7 +4446,7 @@ static bool tile_remove_poll(bContext *C) return (ima != nullptr && ima->source == IMA_SRC_TILED && !BLI_listbase_is_single(&ima->tiles)); } -static int tile_remove_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus tile_remove_exec(bContext *C, wmOperator * /*op*/) { Image *ima = CTX_data_edit_image(C); @@ -4485,7 +4495,7 @@ static bool tile_fill_poll(bContext *C) return false; } -static int tile_fill_exec(bContext *C, wmOperator *op) +static wmOperatorStatus tile_fill_exec(bContext *C, wmOperator *op) { Image *ima = CTX_data_edit_image(C); @@ -4499,7 +4509,7 @@ static int tile_fill_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int tile_fill_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus tile_fill_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { tile_fill_init(op->ptr, CTX_data_edit_image(C), nullptr); diff --git a/source/blender/editors/space_info/info_ops.cc b/source/blender/editors/space_info/info_ops.cc index 625ec56f08c..7772d47d760 100644 --- a/source/blender/editors/space_info/info_ops.cc +++ b/source/blender/editors/space_info/info_ops.cc @@ -41,7 +41,7 @@ /** \name Pack Blend File Libraries Operator * \{ */ -static int pack_libraries_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pack_libraries_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); @@ -66,7 +66,7 @@ void FILE_OT_pack_libraries(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int unpack_libraries_exec(bContext *C, wmOperator *op) +static wmOperatorStatus unpack_libraries_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); @@ -83,7 +83,9 @@ static int unpack_libraries_exec(bContext *C, wmOperator *op) /** \name Unpack Blend File Libraries Operator * \{ */ -static int unpack_libraries_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus unpack_libraries_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { return WM_operator_confirm_ex(C, op, @@ -115,7 +117,7 @@ void FILE_OT_unpack_libraries(wmOperatorType *ot) /** \name Toggle Auto-Pack Operator * \{ */ -static int autopack_toggle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus autopack_toggle_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); @@ -150,7 +152,7 @@ void FILE_OT_autopack_toggle(wmOperatorType *ot) /** \name Pack All Operator * \{ */ -static int pack_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pack_all_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); @@ -161,7 +163,7 @@ static int pack_all_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int pack_all_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus pack_all_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { Main *bmain = CTX_data_main(C); Image *ima; @@ -233,7 +235,7 @@ static const EnumPropertyItem unpack_all_method_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int unpack_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus unpack_all_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); ePF_FileStatus method = ePF_FileStatus(RNA_enum_get(op->ptr, "method")); @@ -249,7 +251,7 @@ static int unpack_all_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int unpack_all_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus unpack_all_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { Main *bmain = CTX_data_main(C); uiPopupMenu *pup; @@ -323,7 +325,7 @@ static const EnumPropertyItem unpack_item_method_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int unpack_item_exec(bContext *C, wmOperator *op) +static wmOperatorStatus unpack_item_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); ID *id; @@ -355,7 +357,7 @@ static int unpack_item_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int unpack_item_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus unpack_item_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { uiPopupMenu *pup; uiLayout *layout; @@ -412,7 +414,7 @@ void FILE_OT_unpack_item(wmOperatorType *ot) /** \name Make Paths Relative Operator * \{ */ -static int make_paths_relative_exec(bContext *C, wmOperator *op) +static wmOperatorStatus make_paths_relative_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); const char *blendfile_path = BKE_main_blendfile_path(bmain); @@ -452,7 +454,7 @@ void FILE_OT_make_paths_relative(wmOperatorType *ot) /** \name Make Paths Absolute Operator * \{ */ -static int make_paths_absolute_exec(bContext *C, wmOperator *op) +static wmOperatorStatus make_paths_absolute_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); const char *blendfile_path = BKE_main_blendfile_path(bmain); @@ -492,7 +494,7 @@ void FILE_OT_make_paths_absolute(wmOperatorType *ot) /** \name Report Missing Files Operator * \{ */ -static int report_missing_files_exec(bContext *C, wmOperator *op) +static wmOperatorStatus report_missing_files_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); @@ -524,7 +526,7 @@ void FILE_OT_report_missing_files(wmOperatorType *ot) /** \name Find Missing Files Operator * \{ */ -static int find_missing_files_exec(bContext *C, wmOperator *op) +static wmOperatorStatus find_missing_files_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); const char *searchpath = RNA_string_get_alloc(op->ptr, "directory", nullptr, 0, nullptr); @@ -538,7 +540,9 @@ static int find_missing_files_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int find_missing_files_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus find_missing_files_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { /* XXX file open button text "Find Missing Files" */ WM_event_add_fileselect(C, op); @@ -592,7 +596,9 @@ void FILE_OT_find_missing_files(wmOperatorType *ot) #define FLASH_TIMEOUT 1.0f #define COLLAPSE_TIMEOUT 0.25f -static int update_reports_display_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus update_reports_display_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { ReportList *reports = CTX_wm_reports(C); Report *report; diff --git a/source/blender/editors/space_info/info_report.cc b/source/blender/editors/space_info/info_report.cc index 27052c50fe7..b69a05e8853 100644 --- a/source/blender/editors/space_info/info_report.cc +++ b/source/blender/editors/space_info/info_report.cc @@ -88,7 +88,7 @@ int info_report_mask(const SpaceInfo * /*sinfo*/) RPT_ERROR_ALL; } -static int report_replay_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus report_replay_exec(bContext *C, wmOperator * /*op*/) { /* TODO: get this working again! */ #if 0 @@ -134,7 +134,7 @@ void INFO_OT_report_replay(wmOperatorType *ot) /* properties */ } -static int select_report_pick_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_report_pick_exec(bContext *C, wmOperator *op) { int report_index = RNA_int_get(op->ptr, "report_index"); bool extend = RNA_boolean_get(op->ptr, "extend"); @@ -158,7 +158,9 @@ static int select_report_pick_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int select_report_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus select_report_pick_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { SpaceInfo *sinfo = CTX_wm_space_info(C); ARegion *region = CTX_wm_region(C); @@ -195,7 +197,7 @@ void INFO_OT_select_pick(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } -static int report_select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus report_select_all_exec(bContext *C, wmOperator *op) { SpaceInfo *sinfo = CTX_wm_space_info(C); ReportList *reports = CTX_wm_reports(C); @@ -225,7 +227,7 @@ void INFO_OT_select_all(wmOperatorType *ot) } /* box_select operator */ -static int box_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus box_select_exec(bContext *C, wmOperator *op) { SpaceInfo *sinfo = CTX_wm_space_info(C); ARegion *region = CTX_wm_region(C); @@ -312,7 +314,7 @@ void INFO_OT_select_box(wmOperatorType *ot) WM_operator_properties_select_operation_simple(ot); } -static int report_delete_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus report_delete_exec(bContext *C, wmOperator * /*op*/) { SpaceInfo *sinfo = CTX_wm_space_info(C); ReportList *reports = CTX_wm_reports(C); @@ -354,7 +356,7 @@ void INFO_OT_report_delete(wmOperatorType *ot) /* properties */ } -static int report_copy_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus report_copy_exec(bContext *C, wmOperator * /*op*/) { SpaceInfo *sinfo = CTX_wm_space_info(C); ReportList *reports = CTX_wm_reports(C); diff --git a/source/blender/editors/space_nla/nla_edit.cc b/source/blender/editors/space_nla/nla_edit.cc index 0bc124d7c31..db0f547f23b 100644 --- a/source/blender/editors/space_nla/nla_edit.cc +++ b/source/blender/editors/space_nla/nla_edit.cc @@ -97,7 +97,7 @@ void ED_nla_postop_refresh(bAnimContext *ac) /** \name Enable Tweak-Mode Operator * \{ */ -static int nlaedit_enable_tweakmode_exec(bContext *C, wmOperator *op) +static wmOperatorStatus nlaedit_enable_tweakmode_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -263,7 +263,7 @@ bool nlaedit_disable_tweakmode(bAnimContext *ac, bool do_solo) } /* Exit tweak-mode operator callback. */ -static int nlaedit_disable_tweakmode_exec(bContext *C, wmOperator *op) +static wmOperatorStatus nlaedit_disable_tweakmode_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -375,7 +375,7 @@ static void get_nlastrip_extents(bAnimContext *ac, float *min, float *max, const /** \name Automatic Preview-Range Operator * \{ */ -static int nlaedit_previewrange_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus nlaedit_previewrange_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; Scene *scene; @@ -480,7 +480,7 @@ static bool nla_tracks_get_selected_extents(bAnimContext *ac, float *r_min, floa return (found != 0); } -static int nlaedit_viewall(bContext *C, const bool only_sel) +static wmOperatorStatus nlaedit_viewall(bContext *C, const bool only_sel) { bAnimContext ac; View2D *v2d; @@ -532,13 +532,13 @@ static int nlaedit_viewall(bContext *C, const bool only_sel) /* ......... */ -static int nlaedit_viewall_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus nlaedit_viewall_exec(bContext *C, wmOperator * /*op*/) { /* whole range */ return nlaedit_viewall(C, false); } -static int nlaedit_viewsel_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus nlaedit_viewsel_exec(bContext *C, wmOperator * /*op*/) { /* only selected */ return nlaedit_viewall(C, true); @@ -580,7 +580,7 @@ void NLA_OT_view_selected(wmOperatorType *ot) /** \name View-Frame Operator * \{ */ -static int nlaedit_viewframe_exec(bContext *C, wmOperator *op) +static wmOperatorStatus nlaedit_viewframe_exec(bContext *C, wmOperator *op) { const int smooth_viewtx = WM_operator_smooth_viewtx_get(op); ANIM_center_frame(C, smooth_viewtx); @@ -621,7 +621,9 @@ static int nlaedit_get_editable_tracks(bAnimContext *ac, ListBase *anim_data) return ANIM_animdata_filter(ac, anim_data, filter, ac->data, eAnimCont_Types(ac->datatype)); } -static int nlaedit_add_actionclip_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus nlaedit_add_actionclip_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { /* Get editor data. */ bAnimContext ac; @@ -644,7 +646,7 @@ static int nlaedit_add_actionclip_invoke(bContext *C, wmOperator *op, const wmEv } /* add the specified action as new strip */ -static int nlaedit_add_actionclip_exec(bContext *C, wmOperator *op) +static wmOperatorStatus nlaedit_add_actionclip_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); bAnimContext ac; @@ -782,7 +784,7 @@ void NLA_OT_actionclip_add(wmOperatorType *ot) * Add a new transition strip between selected strips. * \{ */ -static int nlaedit_add_transition_exec(bContext *C, wmOperator *op) +static wmOperatorStatus nlaedit_add_transition_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -909,7 +911,7 @@ void NLA_OT_transition_add(wmOperatorType *ot) /** \name Add Sound Clip Operator * \{ */ -static int nlaedit_add_sound_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus nlaedit_add_sound_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); bAnimContext ac; @@ -1002,7 +1004,7 @@ void NLA_OT_soundclip_add(wmOperatorType *ot) * \{ */ /* add the specified action as new strip */ -static int nlaedit_add_meta_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus nlaedit_add_meta_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -1076,7 +1078,7 @@ void NLA_OT_meta_add(wmOperatorType *ot) * Separate out the strips held by the selected meta-strips. * \{ */ -static int nlaedit_remove_meta_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus nlaedit_remove_meta_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -1142,7 +1144,7 @@ void NLA_OT_meta_remove(wmOperatorType *ot) * putting them on new tracks above the one the originals were housed in. * \{ */ -static int nlaedit_duplicate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus nlaedit_duplicate_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -1223,7 +1225,9 @@ static int nlaedit_duplicate_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int nlaedit_duplicate_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus nlaedit_duplicate_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { nlaedit_duplicate_exec(C, op); @@ -1261,7 +1265,7 @@ void NLA_OT_duplicate(wmOperatorType *ot) * Deletes the selected NLA-Strips. * \{ */ -static int nlaedit_delete_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus nlaedit_delete_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -1429,7 +1433,7 @@ static void nlaedit_split_strip_meta(NlaTrack *nlt, NlaStrip *strip) /* ----- */ -static int nlaedit_split_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus nlaedit_split_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -1516,7 +1520,7 @@ void NLA_OT_split(wmOperatorType *ot) * Toggles whether strips are muted or not. * \{ */ -static int nlaedit_toggle_mute_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus nlaedit_toggle_mute_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -1583,7 +1587,7 @@ void NLA_OT_mute_toggle(wmOperatorType *ot) * Tries to exchange strips within their owner tracks. * \{ */ -static int nlaedit_swap_exec(bContext *C, wmOperator *op) +static wmOperatorStatus nlaedit_swap_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -1772,7 +1776,7 @@ void NLA_OT_swap(wmOperatorType *ot) * Tries to move the selected strips into the track above if possible. * \{ */ -static int nlaedit_move_up_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus nlaedit_move_up_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -1863,7 +1867,7 @@ void NLA_OT_move_up(wmOperatorType *ot) * Tries to move the selected strips into the track above if possible. * \{ */ -static int nlaedit_move_down_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus nlaedit_move_down_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -1954,7 +1958,7 @@ void NLA_OT_move_down(wmOperatorType *ot) * Recalculate the extents of the action ranges used for the selected strips. * \{ */ -static int nlaedit_sync_actlen_exec(bContext *C, wmOperator *op) +static wmOperatorStatus nlaedit_sync_actlen_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -2046,7 +2050,7 @@ void NLA_OT_action_sync_length(wmOperatorType *ot) * Ensure that each strip has its own action. * \{ */ -static int nlaedit_make_single_user_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus nlaedit_make_single_user_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); bAnimContext ac; @@ -2111,7 +2115,9 @@ static int nlaedit_make_single_user_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -static int nlaedit_make_single_user_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus nlaedit_make_single_user_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (RNA_boolean_get(op->ptr, "confirm")) { return WM_operator_confirm_ex( @@ -2166,7 +2172,7 @@ static short bezt_apply_nlamapping(KeyframeEditData *ked, BezTriple *bezt) return 0; } -static int nlaedit_apply_scale_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus nlaedit_apply_scale_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); bAnimContext ac; @@ -2285,7 +2291,7 @@ void NLA_OT_apply_scale(wmOperatorType *ot) * Reset the scaling of the selected strips to 1.0f. * \{ */ -static int nlaedit_clear_scale_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus nlaedit_clear_scale_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -2362,7 +2368,7 @@ static const EnumPropertyItem prop_nlaedit_snap_types[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int nlaedit_snap_exec(bContext *C, wmOperator *op) +static wmOperatorStatus nlaedit_snap_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -2556,7 +2562,7 @@ static const EnumPropertyItem *nla_fmodifier_itemf(bContext *C, return item; } -static int nla_fmodifier_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus nla_fmodifier_add_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -2669,7 +2675,7 @@ void NLA_OT_fmodifier_add(wmOperatorType *ot) /** \name Copy F-Modifiers Operator * \{ */ -static int nla_fmodifier_copy_exec(bContext *C, wmOperator *op) +static wmOperatorStatus nla_fmodifier_copy_exec(bContext *C, wmOperator *op) { bAnimContext ac; ListBase anim_data = {nullptr, nullptr}; @@ -2746,7 +2752,7 @@ void NLA_OT_fmodifier_copy(wmOperatorType *ot) /** \name Paste F-Modifiers Operator * \{ */ -static int nla_fmodifier_paste_exec(bContext *C, wmOperator *op) +static wmOperatorStatus nla_fmodifier_paste_exec(bContext *C, wmOperator *op) { bAnimContext ac; ListBase anim_data = {nullptr, nullptr}; diff --git a/source/blender/editors/space_nla/nla_select.cc b/source/blender/editors/space_nla/nla_select.cc index 6dd5a692eda..fbfb6a89b8a 100644 --- a/source/blender/editors/space_nla/nla_select.cc +++ b/source/blender/editors/space_nla/nla_select.cc @@ -130,7 +130,7 @@ static void deselect_nla_strips(bAnimContext *ac, short test, short sel) /* ------------------- */ -static int nlaedit_deselectall_exec(bContext *C, wmOperator *op) +static wmOperatorStatus nlaedit_deselectall_exec(bContext *C, wmOperator *op) { bAnimContext ac; @@ -329,7 +329,9 @@ static bool nlaedit_mouse_is_over_strip(bAnimContext *ac, const int mval[2]) return false; } -static int nlaedit_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus nlaedit_box_select_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { bAnimContext ac; if (ANIM_animdata_get_context(C, &ac) == 0) { @@ -343,7 +345,7 @@ static int nlaedit_box_select_invoke(bContext *C, wmOperator *op, const wmEvent return WM_gesture_box_invoke(C, op, event); } -static int nlaedit_box_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus nlaedit_box_select_exec(bContext *C, wmOperator *op) { bAnimContext ac; rcti rect; @@ -494,7 +496,7 @@ static void nlaedit_select_leftright(bContext *C, /* ------------------- */ -static int nlaedit_select_leftright_exec(bContext *C, wmOperator *op) +static wmOperatorStatus nlaedit_select_leftright_exec(bContext *C, wmOperator *op) { bAnimContext ac; short leftright = RNA_enum_get(op->ptr, "mode"); @@ -528,7 +530,9 @@ static int nlaedit_select_leftright_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int nlaedit_select_leftright_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus nlaedit_select_leftright_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { bAnimContext ac; short leftright = RNA_enum_get(op->ptr, "mode"); @@ -588,18 +592,18 @@ void NLA_OT_select_leftright(wmOperatorType *ot) /* ******************** Mouse-Click Select Operator *********************** */ /* select strip directly under mouse */ -static int mouse_nla_strips(bContext *C, - bAnimContext *ac, - const int mval[2], - short select_mode, - const bool deselect_all, - bool wait_to_deselect_others) +static wmOperatorStatus mouse_nla_strips(bContext *C, + bAnimContext *ac, + const int mval[2], + short select_mode, + const bool deselect_all, + bool wait_to_deselect_others) { Scene *scene = ac->scene; bAnimListElem *ale = nullptr; NlaStrip *strip = nullptr; - int ret_value = OPERATOR_FINISHED; + wmOperatorStatus ret_value = OPERATOR_FINISHED; nlaedit_strip_at_region_position(ac, mval[0], mval[1], &ale, &strip); @@ -672,10 +676,10 @@ static int mouse_nla_strips(bContext *C, /* ------------------- */ /* handle clicking */ -static int nlaedit_clickselect_exec(bContext *C, wmOperator *op) +static wmOperatorStatus nlaedit_clickselect_exec(bContext *C, wmOperator *op) { bAnimContext ac; - int ret_value; + wmOperatorStatus ret_value; /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) { diff --git a/source/blender/editors/space_nla/nla_tracks.cc b/source/blender/editors/space_nla/nla_tracks.cc index 19591f5f935..d3e2f98df45 100644 --- a/source/blender/editors/space_nla/nla_tracks.cc +++ b/source/blender/editors/space_nla/nla_tracks.cc @@ -284,7 +284,9 @@ static int mouse_nla_tracks(bContext *C, bAnimContext *ac, int track_index, shor /* ------------------- */ /* handle clicking */ -static int nlatracks_mouseclick_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus nlatracks_mouseclick_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { bAnimContext ac; ARegion *region; @@ -358,7 +360,7 @@ void NLA_OT_channels_click(wmOperatorType *ot) /* ******************** Action Push Down ******************************** */ -static int nlatracks_pushdown_exec(bContext *C, wmOperator *op) +static wmOperatorStatus nlatracks_pushdown_exec(bContext *C, wmOperator *op) { bAnimContext ac; ID *id = nullptr; @@ -493,7 +495,7 @@ static bool nla_action_unlink_poll(bContext *C) return false; } -static int nla_action_unlink_exec(bContext *C, wmOperator *op) +static wmOperatorStatus nla_action_unlink_exec(bContext *C, wmOperator *op) { PointerRNA adt_ptr; @@ -517,7 +519,7 @@ static int nla_action_unlink_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int nla_action_unlink_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus nla_action_unlink_invoke(bContext *C, wmOperator *op, const wmEvent *event) { /* NOTE: this is hardcoded to match the behavior for the unlink button * (in `interface_templates.cc`). */ @@ -639,7 +641,7 @@ bool nlaedit_add_tracks_empty(bAnimContext *ac) /* ----- */ -static int nlaedit_add_tracks_exec(bContext *C, wmOperator *op) +static wmOperatorStatus nlaedit_add_tracks_exec(bContext *C, wmOperator *op) { bAnimContext ac; bool above_sel = RNA_boolean_get(op->ptr, "above_selected"); @@ -698,7 +700,7 @@ void NLA_OT_tracks_add(wmOperatorType *ot) /* ******************** Delete Tracks Operator ***************************** */ /* Delete selected NLA Tracks */ -static int nlaedit_delete_tracks_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus nlaedit_delete_tracks_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; @@ -777,7 +779,7 @@ void NLA_OT_tracks_delete(wmOperatorType *ot) * common use case, we now have a nice shortcut again. */ -static int nlaedit_objects_add_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus nlaedit_objects_add_exec(bContext *C, wmOperator * /*op*/) { bAnimContext ac; diff --git a/source/blender/editors/space_node/clipboard.cc b/source/blender/editors/space_node/clipboard.cc index 8a57d1152d8..ff4bcec503a 100644 --- a/source/blender/editors/space_node/clipboard.cc +++ b/source/blender/editors/space_node/clipboard.cc @@ -278,7 +278,7 @@ static NodeClipboard &get_node_clipboard() /** \name Copy * \{ */ -static int node_clipboard_copy_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_clipboard_copy_exec(bContext *C, wmOperator * /*op*/) { SpaceNode &snode = *CTX_wm_space_node(C); bNodeTree &tree = *snode.edittree; @@ -346,7 +346,7 @@ void NODE_OT_clipboard_copy(wmOperatorType *ot) /** \name Paste * \{ */ -static int node_clipboard_paste_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_clipboard_paste_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); SpaceNode &snode = *CTX_wm_space_node(C); @@ -482,7 +482,9 @@ static int node_clipboard_paste_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int node_clipboard_paste_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus node_clipboard_paste_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { const ARegion *region = CTX_wm_region(C); float2 cursor; diff --git a/source/blender/editors/space_node/node_add.cc b/source/blender/editors/space_node/node_add.cc index d500ef8a1a1..a7357a06c01 100644 --- a/source/blender/editors/space_node/node_add.cc +++ b/source/blender/editors/space_node/node_add.cc @@ -145,7 +145,7 @@ struct RerouteCutsForSocket { Map links; }; -static int add_reroute_exec(bContext *C, wmOperator *op) +static wmOperatorStatus add_reroute_exec(bContext *C, wmOperator *op) { const ARegion ®ion = *CTX_wm_region(C); SpaceNode &snode = *CTX_wm_space_node(C); @@ -294,7 +294,7 @@ static bool node_group_add_poll(const bNodeTree &node_tree, return true; } -static int node_add_group_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_add_group_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -354,7 +354,7 @@ static bool node_add_group_poll(bContext *C) return true; } -static int node_add_group_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus node_add_group_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -444,7 +444,9 @@ static bool add_node_group_asset(const bContext &C, return true; } -static int node_add_group_asset_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus node_add_group_asset_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { ARegion ®ion = *CTX_wm_region(C); SpaceNode &snode = *CTX_wm_space_node(C); @@ -515,7 +517,7 @@ void NODE_OT_add_group_asset(wmOperatorType *ot) /** \name Add Node Object Operator * \{ */ -static int node_add_object_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_add_object_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -554,7 +556,7 @@ static int node_add_object_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int node_add_object_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus node_add_object_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -602,7 +604,7 @@ void NODE_OT_add_object(wmOperatorType *ot) /** \name Add Node Collection Operator * \{ */ -static int node_add_collection_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_add_collection_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); SpaceNode &snode = *CTX_wm_space_node(C); @@ -641,7 +643,9 @@ static int node_add_collection_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int node_add_collection_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus node_add_collection_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -702,7 +706,7 @@ struct NodeStackAnimationData { wmTimer *anim_timer; }; -static int node_add_nodes_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus node_add_nodes_modal(bContext *C, wmOperator *op, const wmEvent *event) { NodeStackAnimationData *data = static_cast(op->customdata); @@ -744,7 +748,7 @@ static int node_add_nodes_modal(bContext *C, wmOperator *op, const wmEvent *even return OPERATOR_RUNNING_MODAL; } -static int node_add_file_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_add_file_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); SpaceNode &snode = *CTX_wm_space_node(C); @@ -846,7 +850,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op) return OPERATOR_RUNNING_MODAL; } -static int node_add_file_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus node_add_file_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -909,7 +913,7 @@ static bool node_add_mask_poll(bContext *C) return ED_operator_node_editable(C) && snode->nodetree->type == NTREE_COMPOSIT; } -static int node_add_mask_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_add_mask_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); SpaceNode &snode = *CTX_wm_space_node(C); @@ -960,7 +964,7 @@ void NODE_OT_add_mask(wmOperatorType *ot) /** \name Add Material Operator * \{ */ -static int node_add_material_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_add_material_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -990,7 +994,7 @@ static int node_add_material_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int node_add_material_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus node_add_material_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -1038,7 +1042,7 @@ void NODE_OT_add_material(wmOperatorType *ot) /** \name Add Import Node Operator * \{ */ -static int node_add_import_node_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_add_import_node_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -1097,7 +1101,9 @@ static int node_add_import_node_exec(bContext *C, wmOperator *op) return OPERATOR_RUNNING_MODAL; } -static int node_add_import_node_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus node_add_import_node_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -1150,7 +1156,7 @@ void NODE_OT_add_import_node(wmOperatorType *ot) /** \name Add Color Operator * \{ */ -static int node_add_color_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_add_color_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -1213,7 +1219,7 @@ static int node_add_color_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int node_add_color_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus node_add_color_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -1265,7 +1271,7 @@ void NODE_OT_add_color(wmOperatorType *ot) /** \name New Node Tree Operator * \{ */ -static int new_node_tree_exec(bContext *C, wmOperator *op) +static wmOperatorStatus new_node_tree_exec(bContext *C, wmOperator *op) { SpaceNode *snode = CTX_wm_space_node(C); Main *bmain = CTX_data_main(C); diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc index 89895910dd9..989f982078c 100644 --- a/source/blender/editors/space_node/node_edit.cc +++ b/source/blender/editors/space_node/node_edit.cc @@ -1029,7 +1029,7 @@ static float nearest_node_grid_coord(float co) return co - rest + offset; } -static int node_resize_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus node_resize_modal(bContext *C, wmOperator *op, const wmEvent *event) { SpaceNode *snode = CTX_wm_space_node(C); ARegion *region = CTX_wm_region(C); @@ -1128,7 +1128,7 @@ static int node_resize_modal(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int node_resize_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus node_resize_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceNode *snode = CTX_wm_space_node(C); ARegion *region = CTX_wm_region(C); @@ -1429,7 +1429,7 @@ void remap_node_pairing(bNodeTree &dst_tree, const Map & } } -static int node_duplicate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_duplicate_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -1576,7 +1576,7 @@ void NODE_OT_duplicate(wmOperatorType *ot) } /* Goes over all scenes, reads render layers. */ -static int node_read_viewlayers_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_read_viewlayers_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -1623,7 +1623,7 @@ void NODE_OT_read_viewlayers(wmOperatorType *ot) ot->poll = composite_node_active; } -int node_render_changed_exec(bContext *C, wmOperator * /*op*/) +wmOperatorStatus node_render_changed_exec(bContext *C, wmOperator * /*op*/) { Scene *sce = CTX_data_scene(C); @@ -1731,7 +1731,7 @@ static void node_flag_toggle_exec(SpaceNode *snode, int toggle_flag) } } -static int node_hide_toggle_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_hide_toggle_exec(bContext *C, wmOperator * /*op*/) { SpaceNode *snode = CTX_wm_space_node(C); @@ -1762,7 +1762,7 @@ void NODE_OT_hide_toggle(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int node_preview_toggle_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_preview_toggle_exec(bContext *C, wmOperator * /*op*/) { SpaceNode *snode = CTX_wm_space_node(C); @@ -1804,7 +1804,7 @@ void NODE_OT_preview_toggle(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int node_activate_viewer_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_activate_viewer_exec(bContext *C, wmOperator * /*op*/) { SpaceNode *snode = CTX_wm_space_node(C); PointerRNA ptr = CTX_data_pointer_get(C, "node"); @@ -1860,7 +1860,7 @@ void NODE_OT_activate_viewer(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int node_deactivate_viewer_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_deactivate_viewer_exec(bContext *C, wmOperator * /*op*/) { SpaceNode &snode = *CTX_wm_space_node(C); WorkSpace &workspace = *CTX_wm_workspace(C); @@ -1900,7 +1900,7 @@ void NODE_OT_deactivate_viewer(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int node_options_toggle_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_options_toggle_exec(bContext *C, wmOperator * /*op*/) { SpaceNode *snode = CTX_wm_space_node(C); @@ -1931,7 +1931,7 @@ void NODE_OT_options_toggle(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int node_socket_toggle_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_socket_toggle_exec(bContext *C, wmOperator * /*op*/) { SpaceNode *snode = CTX_wm_space_node(C); @@ -1989,7 +1989,7 @@ void NODE_OT_hide_socket_toggle(wmOperatorType *ot) /** \name Node Mute Operator * \{ */ -static int node_mute_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_mute_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -2029,7 +2029,7 @@ void NODE_OT_mute_toggle(wmOperatorType *ot) /** \name Node Delete Operator * \{ */ -static int node_delete_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_delete_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -2071,7 +2071,7 @@ void NODE_OT_delete(wmOperatorType *ot) /** \name Node Delete with Reconnect Operator * \{ */ -static int node_delete_reconnect_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_delete_reconnect_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -2118,7 +2118,7 @@ void NODE_OT_delete_reconnect(wmOperatorType *ot) /** \name Node File Output Add Socket Operator * \{ */ -static int node_output_file_add_socket_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_output_file_add_socket_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -2172,7 +2172,8 @@ void NODE_OT_output_file_add_socket(wmOperatorType *ot) /** \name Node Multi File Output Remove Socket Operator * \{ */ -static int node_output_file_remove_active_socket_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_output_file_remove_active_socket_exec(bContext *C, + wmOperator * /*op*/) { SpaceNode *snode = CTX_wm_space_node(C); PointerRNA ptr = CTX_data_pointer_get(C, "node"); @@ -2222,7 +2223,7 @@ void NODE_OT_output_file_remove_active_socket(wmOperatorType *ot) /** \name Node Multi File Output Move Socket Node * \{ */ -static int node_output_file_move_active_socket_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_output_file_move_active_socket_exec(bContext *C, wmOperator *op) { SpaceNode *snode = CTX_wm_space_node(C); PointerRNA ptr = CTX_data_pointer_get(C, "node"); @@ -2299,7 +2300,7 @@ void NODE_OT_output_file_move_active_socket(wmOperatorType *ot) /** \name Node Copy Node Color Operator * \{ */ -static int node_copy_color_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_copy_color_exec(bContext *C, wmOperator * /*op*/) { SpaceNode &snode = *CTX_wm_space_node(C); bNodeTree &ntree = *snode.edittree; @@ -2412,7 +2413,7 @@ static bool node_shader_script_update_text_recursive(RenderEngine *engine, return found; } -static int node_shader_script_update_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_shader_script_update_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -2508,7 +2509,7 @@ static void viewer_border_corner_to_backdrop(SpaceNode *snode, *fy = (bufy > 0.0f ? (float(y) - 0.5f * region->winy - snode->yof) / bufy + 0.5f : 0.0f); } -static int viewer_border_exec(bContext *C, wmOperator *op) +static wmOperatorStatus viewer_border_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); void *lock; @@ -2585,7 +2586,7 @@ void NODE_OT_viewer_border(wmOperatorType *ot) WM_operator_properties_gesture_box(ot); } -static int clear_viewer_border_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus clear_viewer_border_exec(bContext *C, wmOperator * /*op*/) { SpaceNode *snode = CTX_wm_space_node(C); bNodeTree *btree = snode->nodetree; @@ -2618,7 +2619,7 @@ void NODE_OT_clear_viewer_border(wmOperatorType *ot) /** \name Cryptomatte Add Socket * \{ */ -static int node_cryptomatte_add_socket_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_cryptomatte_add_socket_exec(bContext *C, wmOperator * /*op*/) { SpaceNode *snode = CTX_wm_space_node(C); PointerRNA ptr = CTX_data_pointer_get(C, "node"); @@ -2666,7 +2667,7 @@ void NODE_OT_cryptomatte_layer_add(wmOperatorType *ot) /** \name Cryptomatte Remove Socket * \{ */ -static int node_cryptomatte_remove_socket_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_cryptomatte_remove_socket_exec(bContext *C, wmOperator * /*op*/) { SpaceNode *snode = CTX_wm_space_node(C); PointerRNA ptr = CTX_data_pointer_get(C, "node"); diff --git a/source/blender/editors/space_node/node_group.cc b/source/blender/editors/space_node/node_group.cc index 23197e221ff..55a01da8c00 100644 --- a/source/blender/editors/space_node/node_group.cc +++ b/source/blender/editors/space_node/node_group.cc @@ -169,7 +169,7 @@ static void remap_pairing(bNodeTree &dst_tree, /** \name Edit Group Operator * \{ */ -static int node_group_edit_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_group_edit_exec(bContext *C, wmOperator *op) { SpaceNode *snode = CTX_wm_space_node(C); const StringRef node_idname = node_group_idname(C); @@ -456,7 +456,7 @@ static void node_group_ungroup(Main *bmain, bNodeTree *ntree, bNode *gnode) bke::node_remove_node(bmain, *ntree, *gnode, true); } -static int node_group_ungroup_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_group_ungroup_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -629,7 +629,7 @@ static const EnumPropertyItem node_group_separate_types[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int node_group_separate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_group_separate_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -670,7 +670,9 @@ static int node_group_separate_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int node_group_separate_invoke(bContext *C, wmOperator * /*op*/, const wmEvent * /*event*/) +static wmOperatorStatus node_group_separate_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent * /*event*/) { uiPopupMenu *pup = UI_popup_menu_begin( C, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Separate"), ICON_NONE); @@ -1230,7 +1232,7 @@ static bNode *node_group_make_from_nodes(const bContext &C, return gnode; } -static int node_group_make_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_group_make_exec(bContext *C, wmOperator *op) { SpaceNode &snode = *CTX_wm_space_node(C); bNodeTree &ntree = *snode.edittree; @@ -1285,7 +1287,7 @@ void NODE_OT_group_make(wmOperatorType *ot) /** \name Group Insert Operator * \{ */ -static int node_group_insert_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_group_insert_exec(bContext *C, wmOperator *op) { SpaceNode *snode = CTX_wm_space_node(C); bNodeTree *ntree = snode->edittree; @@ -1367,7 +1369,7 @@ static bool node_default_group_width_set_poll(bContext *C) return true; } -static int node_default_group_width_set_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_default_group_width_set_exec(bContext *C, wmOperator * /*op*/) { SpaceNode *snode = CTX_wm_space_node(C); bNodeTree *ntree = snode->edittree; diff --git a/source/blender/editors/space_node/node_intern.hh b/source/blender/editors/space_node/node_intern.hh index 22273c7ee44..fb3c20303c0 100644 --- a/source/blender/editors/space_node/node_intern.hh +++ b/source/blender/editors/space_node/node_intern.hh @@ -352,7 +352,7 @@ bool composite_node_editable(bContext *C); bool node_has_hidden_sockets(bNode *node); void node_set_hidden_sockets(bNode *node, int set); bool node_is_previewable(const SpaceNode &snode, const bNodeTree &ntree, const bNode &node); -int node_render_changed_exec(bContext *, wmOperator *); +wmOperatorStatus node_render_changed_exec(bContext *, wmOperator *); bNodeSocket *node_find_indicated_socket(SpaceNode &snode, ARegion ®ion, const float2 &cursor, diff --git a/source/blender/editors/space_node/node_relationships.cc b/source/blender/editors/space_node/node_relationships.cc index fafd043148d..cc680ffc127 100644 --- a/source/blender/editors/space_node/node_relationships.cc +++ b/source/blender/editors/space_node/node_relationships.cc @@ -826,7 +826,7 @@ static int node_link_viewer(const bContext &C, bNode &bnode_to_view, bNodeSocket /** \name Link to Viewer Node Operator * \{ */ -static int node_active_link_viewer_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_active_link_viewer_exec(bContext *C, wmOperator * /*op*/) { SpaceNode &snode = *CTX_wm_space_node(C); bNode *node = bke::node_get_active(*snode.edittree); @@ -1365,7 +1365,7 @@ wmKeyMap *node_link_modal_keymap(wmKeyConfig *keyconf) return keymap; } -static int node_link_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus node_link_modal(bContext *C, wmOperator *op, const wmEvent *event) { bNodeLinkDrag &nldrag = *static_cast(op->customdata); SpaceNode &snode = *CTX_wm_space_node(C); @@ -1524,7 +1524,7 @@ static std::unique_ptr node_link_init(ARegion ®ion, return {}; } -static int node_link_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus node_link_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Main &bmain = *CTX_data_main(C); SpaceNode &snode = *CTX_wm_space_node(C); @@ -1604,7 +1604,7 @@ void NODE_OT_link(wmOperatorType *ot) * \{ */ /* Makes a link between selected output and input sockets. */ -static int node_make_link_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_make_link_exec(bContext *C, wmOperator *op) { Main &bmain = *CTX_data_main(C); SpaceNode &snode = *CTX_wm_space_node(C); @@ -1649,7 +1649,7 @@ void NODE_OT_link_make(wmOperatorType *ot) /** \name Cut Link Operator * \{ */ -static int cut_links_exec(bContext *C, wmOperator *op) +static wmOperatorStatus cut_links_exec(bContext *C, wmOperator *op) { Main &bmain = *CTX_data_main(C); SpaceNode &snode = *CTX_wm_space_node(C); @@ -1757,7 +1757,7 @@ bool all_links_muted(const bNodeSocket &socket) return true; } -static int mute_links_exec(bContext *C, wmOperator *op) +static wmOperatorStatus mute_links_exec(bContext *C, wmOperator *op) { Main &bmain = *CTX_data_main(C); SpaceNode &snode = *CTX_wm_space_node(C); @@ -1873,7 +1873,7 @@ void NODE_OT_links_mute(wmOperatorType *ot) /** \name Detach Links Operator * \{ */ -static int detach_links_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus detach_links_exec(bContext *C, wmOperator * /*op*/) { SpaceNode &snode = *CTX_wm_space_node(C); bNodeTree &ntree = *snode.edittree; @@ -1910,7 +1910,7 @@ void NODE_OT_links_detach(wmOperatorType *ot) /** \name Set Parent Operator * \{ */ -static int node_parent_set_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_parent_set_exec(bContext *C, wmOperator * /*op*/) { SpaceNode &snode = *CTX_wm_space_node(C); bNodeTree &ntree = *snode.edittree; @@ -2034,7 +2034,7 @@ static const bNode *find_common_parent_node(const Span nodes) return candidates.last(); } -static int node_join_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_join_exec(bContext *C, wmOperator * /*op*/) { Main &bmain = *CTX_data_main(C); SpaceNode &snode = *CTX_wm_space_node(C); @@ -2103,7 +2103,7 @@ static bNode *node_find_frame_to_attach(ARegion ®ion, bNodeTree &ntree, const return nullptr; } -static int node_attach_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus node_attach_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) { ARegion ®ion = *CTX_wm_region(C); SpaceNode &snode = *CTX_wm_space_node(C); @@ -2206,7 +2206,7 @@ static void node_detach_recursive(bNodeTree &ntree, } /* Detach the root nodes in the current selection. */ -static int node_detach_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_detach_exec(bContext *C, wmOperator * /*op*/) { SpaceNode &snode = *CTX_wm_space_node(C); bNodeTree &ntree = *snode.edittree; @@ -2803,7 +2803,7 @@ static void node_link_insert_offset_ntree(NodeInsertOfsData *iofsd, /** * Modal handler for insert offset animation */ -static int node_insert_offset_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus node_insert_offset_modal(bContext *C, wmOperator *op, const wmEvent *event) { SpaceNode *snode = CTX_wm_space_node(C); NodeInsertOfsData *iofsd = static_cast(op->customdata); @@ -2856,7 +2856,9 @@ static int node_insert_offset_modal(bContext *C, wmOperator *op, const wmEvent * #undef NODE_INSOFS_ANIM_DURATION -static int node_insert_offset_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus node_insert_offset_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { const SpaceNode *snode = CTX_wm_space_node(C); NodeInsertOfsData *iofsd = snode->runtime->iofsd; diff --git a/source/blender/editors/space_node/node_select.cc b/source/blender/editors/space_node/node_select.cc index 1d4fcb95ecb..6591b2fbada 100644 --- a/source/blender/editors/space_node/node_select.cc +++ b/source/blender/editors/space_node/node_select.cc @@ -398,7 +398,7 @@ enum { NODE_SELECT_GROUPED_SUFIX = 3, }; -static int node_select_grouped_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_select_grouped_exec(bContext *C, wmOperator *op) { SpaceNode &snode = *CTX_wm_space_node(C); bNodeTree &node_tree = *snode.edittree; @@ -674,7 +674,7 @@ static bool node_mouse_select(bContext *C, return true; } -static int node_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_select_exec(bContext *C, wmOperator *op) { /* Get settings from RNA properties for operator. */ int2 mval; @@ -693,11 +693,11 @@ static int node_select_exec(bContext *C, wmOperator *op) return OPERATOR_PASS_THROUGH | OPERATOR_CANCELLED; } -static int node_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus node_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { RNA_int_set_array(op->ptr, "location", event->mval); - const int retval = node_select_exec(C, op); + const wmOperatorStatus retval = node_select_exec(C, op); return WM_operator_flag_only_pass_through_on_press(retval, event); } @@ -750,7 +750,7 @@ void NODE_OT_select(wmOperatorType *ot) /** \name Box Select Operator * \{ */ -static int node_box_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_box_select_exec(bContext *C, wmOperator *op) { SpaceNode &snode = *CTX_wm_space_node(C); bNodeTree &node_tree = *snode.edittree; @@ -800,7 +800,7 @@ static int node_box_select_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int node_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus node_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { const bool tweak = RNA_boolean_get(op->ptr, "tweak"); @@ -846,7 +846,7 @@ void NODE_OT_select_box(wmOperatorType *ot) /** \name Circle Select Operator * \{ */ -static int node_circleselect_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_circleselect_exec(bContext *C, wmOperator *op) { SpaceNode *snode = CTX_wm_space_node(C); ARegion *region = CTX_wm_region(C); @@ -929,7 +929,7 @@ void NODE_OT_select_circle(wmOperatorType *ot) /** \name Lasso Select Operator * \{ */ -static int node_lasso_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus node_lasso_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { const bool tweak = RNA_boolean_get(op->ptr, "tweak"); @@ -1006,7 +1006,7 @@ static bool do_lasso_select_node(bContext *C, const Span mcoords, eSelectO return changed; } -static int node_lasso_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_lasso_select_exec(bContext *C, wmOperator *op) { const Array mcoords = WM_gesture_lasso_path_to_array(C, op); @@ -1065,7 +1065,7 @@ static bool any_node_selected(const bNodeTree &node_tree) return false; } -static int node_select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_select_all_exec(bContext *C, wmOperator *op) { SpaceNode &snode = *CTX_wm_space_node(C); bNodeTree &node_tree = *snode.edittree; @@ -1128,7 +1128,7 @@ void NODE_OT_select_all(wmOperatorType *ot) /** \name Select Linked To Operator * \{ */ -static int node_select_linked_to_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_select_linked_to_exec(bContext *C, wmOperator * /*op*/) { SpaceNode &snode = *CTX_wm_space_node(C); bNodeTree &node_tree = *snode.edittree; @@ -1178,7 +1178,7 @@ void NODE_OT_select_linked_to(wmOperatorType *ot) /** \name Select Linked From Operator * \{ */ -static int node_select_linked_from_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus node_select_linked_from_exec(bContext *C, wmOperator * /*op*/) { SpaceNode &snode = *CTX_wm_space_node(C); bNodeTree &node_tree = *snode.edittree; @@ -1233,7 +1233,7 @@ static bool nodes_are_same_type_for_select(const bNode &a, const bNode &b) return a.type_legacy == b.type_legacy; } -static int node_select_same_type_step_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_select_same_type_step_exec(bContext *C, wmOperator *op) { SpaceNode *snode = CTX_wm_space_node(C); ARegion *region = CTX_wm_region(C); @@ -1401,7 +1401,9 @@ static uiBlock *node_find_menu(bContext *C, ARegion *region, void *arg_optype) return block; } -static int node_find_node_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus node_find_node_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { UI_popup_block_invoke(C, node_find_menu, op->type, nullptr); return OPERATOR_CANCELLED; diff --git a/source/blender/editors/space_node/node_view.cc b/source/blender/editors/space_node/node_view.cc index 4a1abd77fbf..ab04556bbd0 100644 --- a/source/blender/editors/space_node/node_view.cc +++ b/source/blender/editors/space_node/node_view.cc @@ -134,7 +134,7 @@ bool space_node_view_flag( return true; } -static int node_view_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_view_all_exec(bContext *C, wmOperator *op) { ARegion *region = CTX_wm_region(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -171,7 +171,7 @@ void NODE_OT_view_all(wmOperatorType *ot) /** \name View Selected Operator * \{ */ -static int node_view_selected_exec(bContext *C, wmOperator *op) +static wmOperatorStatus node_view_selected_exec(bContext *C, wmOperator *op) { ARegion *region = CTX_wm_region(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -211,7 +211,7 @@ struct NodeViewMove { float xof_orig, yof_orig; }; -static int snode_bg_viewmove_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus snode_bg_viewmove_modal(bContext *C, wmOperator *op, const wmEvent *event) { SpaceNode *snode = CTX_wm_space_node(C); ARegion *region = CTX_wm_region(C); @@ -260,7 +260,7 @@ static int snode_bg_viewmove_modal(bContext *C, wmOperator *op, const wmEvent *e return OPERATOR_RUNNING_MODAL; } -static int snode_bg_viewmove_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus snode_bg_viewmove_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Main *bmain = CTX_data_main(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -330,7 +330,7 @@ void NODE_OT_backimage_move(wmOperatorType *ot) /** \name Background Image Zoom * \{ */ -static int backimage_zoom_exec(bContext *C, wmOperator *op) +static wmOperatorStatus backimage_zoom_exec(bContext *C, wmOperator *op) { SpaceNode *snode = CTX_wm_space_node(C); ARegion *region = CTX_wm_region(C); @@ -369,7 +369,7 @@ void NODE_OT_backimage_zoom(wmOperatorType *ot) /** \name Background Image Fit * \{ */ -static int backimage_fit_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus backimage_fit_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); SpaceNode *snode = CTX_wm_space_node(C); @@ -645,7 +645,7 @@ static void sample_exit(bContext *C, wmOperator *op) MEM_freeN(info); } -static int sample_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sample_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceNode *snode = CTX_wm_space_node(C); ARegion *region = CTX_wm_region(C); @@ -674,7 +674,7 @@ static int sample_invoke(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int sample_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sample_modal(bContext *C, wmOperator *op, const wmEvent *event) { switch (event->type) { case LEFTMOUSE: diff --git a/source/blender/editors/space_outliner/outliner_collections.cc b/source/blender/editors/space_outliner/outliner_collections.cc index b8678976a93..47bfc892e0a 100644 --- a/source/blender/editors/space_outliner/outliner_collections.cc +++ b/source/blender/editors/space_outliner/outliner_collections.cc @@ -225,7 +225,7 @@ static TreeTraversalAction collection_find_selected_to_add(TreeElement *te, void return TRAVERSE_CONTINUE; } -static int collection_new_exec(bContext *C, wmOperator *op) +static wmOperatorStatus collection_new_exec(bContext *C, wmOperator *op) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); ARegion *region = CTX_wm_region(C); @@ -416,7 +416,7 @@ void outliner_collection_delete( } } -static int collection_hierarchy_delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus collection_hierarchy_delete_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -502,7 +502,7 @@ static LayerCollection *outliner_active_layer_collection(bContext *C) return data.layer_collection; } -static int collection_objects_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus collection_objects_select_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -610,7 +610,7 @@ static TreeElement *outliner_active_collection(bContext *C) return data.te; } -static int collection_duplicate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus collection_duplicate_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); TreeElement *te = outliner_active_collection(C); @@ -712,7 +712,7 @@ void OUTLINER_OT_collection_duplicate(wmOperatorType *ot) /** \name Link Collection * \{ */ -static int collection_link_exec(bContext *C, wmOperator *op) +static wmOperatorStatus collection_link_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -777,7 +777,7 @@ void OUTLINER_OT_collection_link(wmOperatorType *ot) /** \name Instance Collection * \{ */ -static int collection_instance_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus collection_instance_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -933,7 +933,7 @@ static bool collections_indirect_only_clear_poll(bContext *C) return collections_view_layer_poll(C, true, LAYER_COLLECTION_INDIRECT_ONLY); } -static int collection_view_layer_exec(bContext *C, wmOperator *op) +static wmOperatorStatus collection_view_layer_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1066,7 +1066,7 @@ void OUTLINER_OT_collection_indirect_only_clear(wmOperatorType *ot) /** \name Visibility for Collection Operators * \{ */ -static int collection_isolate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus collection_isolate_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1110,7 +1110,9 @@ static int collection_isolate_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int collection_isolate_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus collection_isolate_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { PropertyRNA *prop = RNA_struct_find_property(op->ptr, "extend"); if (!RNA_property_is_set(op->ptr, prop) && (event->modifier & KM_SHIFT)) { @@ -1158,7 +1160,7 @@ static bool collection_inside_poll(bContext *C) return outliner_active_layer_collection(C) != nullptr; } -static int collection_visibility_exec(bContext *C, wmOperator *op) +static wmOperatorStatus collection_visibility_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1301,7 +1303,7 @@ static bool collection_disable_render_poll(bContext *C) return collection_flag_poll(C, false, COLLECTION_HIDE_RENDER); } -static int collection_flag_exec(bContext *C, wmOperator *op) +static wmOperatorStatus collection_flag_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1480,7 +1482,7 @@ static TreeTraversalAction outliner_hide_collect_data_to_edit(TreeElement *te, v return TRAVERSE_CONTINUE; } -static int outliner_hide_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus outliner_hide_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1527,7 +1529,7 @@ void OUTLINER_OT_hide(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int outliner_unhide_all_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus outliner_unhide_all_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1572,7 +1574,7 @@ void OUTLINER_OT_unhide_all(wmOperatorType *ot) /** \name Collection Color Tags * \{ */ -static int outliner_color_tag_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_color_tag_set_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.cc b/source/blender/editors/space_outliner/outliner_dragdrop.cc index ee1948c36b1..4898c9fbc2d 100644 --- a/source/blender/editors/space_outliner/outliner_dragdrop.cc +++ b/source/blender/editors/space_outliner/outliner_dragdrop.cc @@ -405,7 +405,7 @@ static void parent_drop_set_parents(bContext *C, } } -static int parent_drop_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus parent_drop_invoke(bContext *C, wmOperator *op, const wmEvent *event) { TreeElement *te = outliner_drop_find(C, event); TreeStoreElem *tselem = te ? TREESTORE(te) : nullptr; @@ -503,7 +503,7 @@ static bool parent_clear_poll(bContext *C, wmDrag *drag, const wmEvent *event) } } -static int parent_clear_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus parent_clear_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) { Main *bmain = CTX_data_main(C); @@ -559,7 +559,7 @@ static bool scene_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) return (ob && (outliner_ID_drop_find(C, event, ID_SCE) != nullptr)); } -static int scene_drop_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus scene_drop_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) { Main *bmain = CTX_data_main(C); Scene *scene = (Scene *)outliner_ID_drop_find(C, event, ID_SCE); @@ -632,7 +632,9 @@ static bool material_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event) return (!ELEM(nullptr, ob, ma) && ID_IS_EDITABLE(&ob->id) && !ID_IS_OVERRIDE_LIBRARY(&ob->id)); } -static int material_drop_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus material_drop_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { Main *bmain = CTX_data_main(C); Object *ob = (Object *)outliner_ID_drop_find(C, event, ID_OB); @@ -1047,7 +1049,7 @@ static void datastack_drop_reorder(bContext *C, ReportList *reports, StackDropDa } } -static int datastack_drop_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus datastack_drop_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (event->custom != EVT_DATA_DRAGDROP) { return OPERATOR_CANCELLED; @@ -1281,7 +1283,9 @@ static std::string collection_drop_tooltip(bContext *C, return {}; } -static int collection_drop_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus collection_drop_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1396,7 +1400,9 @@ static TreeElement *outliner_item_drag_element_find(SpaceOutliner *space_outline return outliner_find_item_at_y(space_outliner, &space_outliner->tree, my); } -static int outliner_item_drag_drop_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus outliner_item_drag_drop_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); diff --git a/source/blender/editors/space_outliner/outliner_edit.cc b/source/blender/editors/space_outliner/outliner_edit.cc index 9123af194ea..4ce099401dd 100644 --- a/source/blender/editors/space_outliner/outliner_edit.cc +++ b/source/blender/editors/space_outliner/outliner_edit.cc @@ -100,7 +100,9 @@ static void outliner_copybuffer_filepath_get(char filepath[FILE_MAX], size_t fil /** \name Highlight on Cursor Motion Operator * \{ */ -static int outliner_highlight_update_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus outliner_highlight_update_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { /* stop highlighting if out of area */ if (!ED_screen_area_active(C)) { @@ -202,7 +204,9 @@ struct OpenCloseData { int x_location; }; -static int outliner_item_openclose_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus outliner_item_openclose_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); @@ -243,7 +247,9 @@ static int outliner_item_openclose_modal(bContext *C, wmOperator *op, const wmEv return OPERATOR_RUNNING_MODAL; } -static int outliner_item_openclose_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus outliner_item_openclose_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); @@ -412,7 +418,9 @@ static TreeElement *outliner_item_rename_find_hovered(const SpaceOutliner *space return nullptr; } -static int outliner_item_rename_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus outliner_item_rename_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); View2D *v2d = ®ion->v2d; @@ -564,7 +572,9 @@ static int outliner_id_delete_tag(bContext *C, return id_tagged_num; } -static int outliner_id_delete_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus outliner_id_delete_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Main *bmain = CTX_data_main(C); ARegion *region = CTX_wm_region(C); @@ -611,7 +621,7 @@ void OUTLINER_OT_id_delete(wmOperatorType *ot) /** \name ID Remap Operator * \{ */ -static int outliner_id_remap_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_id_remap_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); @@ -684,7 +694,7 @@ static bool outliner_id_remap_find_tree_element(bContext *C, return false; } -static int outliner_id_remap_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus outliner_id_remap_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); ARegion *region = CTX_wm_region(C); @@ -821,7 +831,7 @@ static int outliner_id_copy_tag(SpaceOutliner *space_outliner, return num_ids; } -static int outliner_id_copy_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_id_copy_exec(bContext *C, wmOperator *op) { using namespace blender::bke::blendfile; @@ -865,7 +875,7 @@ void OUTLINER_OT_id_copy(wmOperatorType *ot) /** \name ID Paste Operator * \{ */ -static int outliner_id_paste_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_id_paste_exec(bContext *C, wmOperator *op) { char filepath[FILE_MAX]; const short flag = FILE_AUTOSELECT | FILE_ACTIVE_COLLECTION; @@ -906,11 +916,11 @@ void OUTLINER_OT_id_paste(wmOperatorType *ot) /** \name Library Relocate Operator * \{ */ -static int lib_relocate( +static wmOperatorStatus lib_relocate( bContext *C, TreeElement *te, TreeStoreElem *tselem, wmOperatorType *ot, const bool reload) { PointerRNA op_props; - int ret = 0; + wmOperatorStatus ret = wmOperatorStatus(0); BLI_assert(te->idcode == ID_LI && tselem->id != nullptr); UNUSED_VARS_NDEBUG(te); @@ -946,7 +956,7 @@ static int lib_relocate( return ret; } -static int outliner_lib_relocate_invoke_do( +static wmOperatorStatus outliner_lib_relocate_invoke_do( bContext *C, ReportList *reports, TreeElement *te, const float mval[2], const bool reload) { if (mval[1] > te->ys && mval[1] < te->ys + UI_UNIT_Y) { @@ -968,17 +978,19 @@ static int outliner_lib_relocate_invoke_do( } else { LISTBASE_FOREACH (TreeElement *, te_sub, &te->subtree) { - int ret; + wmOperatorStatus ret; if ((ret = outliner_lib_relocate_invoke_do(C, reports, te_sub, mval, reload))) { return ret; } } } - return 0; + return wmOperatorStatus(0); } -static int outliner_lib_relocate_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus outliner_lib_relocate_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); @@ -989,7 +1001,7 @@ static int outliner_lib_relocate_invoke(bContext *C, wmOperator *op, const wmEve UI_view2d_region_to_view(®ion->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); LISTBASE_FOREACH (TreeElement *, te, &space_outliner->tree) { - int ret; + wmOperatorStatus ret; if ((ret = outliner_lib_relocate_invoke_do(C, op->reports, te, fmval, false))) { return ret; @@ -1028,7 +1040,9 @@ void lib_relocate_fn(bContext *C, lib_relocate(C, te, tselem, ot, false); } -static int outliner_lib_reload_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus outliner_lib_reload_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); @@ -1039,7 +1053,7 @@ static int outliner_lib_reload_invoke(bContext *C, wmOperator *op, const wmEvent UI_view2d_region_to_view(®ion->v2d, event->mval[0], event->mval[1], &fmval[0], &fmval[1]); LISTBASE_FOREACH (TreeElement *, te, &space_outliner->tree) { - int ret; + wmOperatorStatus ret; if ((ret = outliner_lib_relocate_invoke_do(C, op->reports, te, fmval, true))) { return ret; @@ -1163,7 +1177,7 @@ bool outliner_flag_flip(const ListBase &lb, const short flag) /** \name Toggle Expanded (Outliner) Operator * \{ */ -static int outliner_toggle_expanded_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus outliner_toggle_expanded_exec(bContext *C, wmOperator * /*op*/) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); ARegion *region = CTX_wm_region(C); @@ -1200,7 +1214,7 @@ void OUTLINER_OT_expanded_toggle(wmOperatorType *ot) /** \name Toggle Selected (Outliner) Operator * \{ */ -static int outliner_select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_select_all_exec(bContext *C, wmOperator *op) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); ARegion *region = CTX_wm_region(C); @@ -1255,7 +1269,7 @@ void OUTLINER_OT_select_all(wmOperatorType *ot) /** \name Start / Clear Search Filter Operators * \{ */ -static int outliner_start_filter_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus outliner_start_filter_exec(bContext *C, wmOperator * /*op*/) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); ScrArea *area = CTX_wm_area(C); @@ -1277,7 +1291,7 @@ void OUTLINER_OT_start_filter(wmOperatorType *ot) ot->poll = ED_operator_outliner_active; } -static int outliner_clear_filter_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus outliner_clear_filter_exec(bContext *C, wmOperator * /*op*/) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); space_outliner->search_string[0] = '\0'; @@ -1390,7 +1404,7 @@ static void outliner_show_active(SpaceOutliner *space_outliner, } } -static int outliner_show_active_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus outliner_show_active_exec(bContext *C, wmOperator * /*op*/) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); const Scene *scene = CTX_data_scene(C); @@ -1448,7 +1462,7 @@ void OUTLINER_OT_show_active(wmOperatorType *ot) /** \name View Panning (Outliner) Operator * \{ */ -static int outliner_scroll_page_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_scroll_page_exec(bContext *C, wmOperator *op) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); ARegion *region = CTX_wm_region(C); @@ -1512,7 +1526,7 @@ static void outliner_openclose_level(ListBase *lb, int curlevel, int level, int } } -static int outliner_one_level_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_one_level_exec(bContext *C, wmOperator *op) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); ARegion *region = CTX_wm_region(C); @@ -1620,7 +1634,7 @@ static void tree_element_show_hierarchy(Scene *scene, SpaceOutliner *space_outli } /* show entire object level hierarchy */ -static int outliner_show_hierarchy_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus outliner_show_hierarchy_exec(bContext *C, wmOperator * /*op*/) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); ARegion *region = CTX_wm_region(C); @@ -1906,7 +1920,7 @@ static void do_outliner_drivers_editop(SpaceOutliner *space_outliner, /** \name Driver Add Operator * \{ */ -static int outliner_drivers_addsel_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_drivers_addsel_exec(bContext *C, wmOperator *op) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); @@ -1945,7 +1959,7 @@ void OUTLINER_OT_drivers_add_selected(wmOperatorType *ot) /** \name Driver Remove Operator * \{ */ -static int outliner_drivers_deletesel_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_drivers_deletesel_exec(bContext *C, wmOperator *op) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); @@ -2090,7 +2104,7 @@ static void do_outliner_keyingset_editop(SpaceOutliner *space_outliner, /** \name Keying-Set Add Operator * \{ */ -static int outliner_keyingset_additems_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_keyingset_additems_exec(bContext *C, wmOperator *op) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); Scene *scene = CTX_data_scene(C); @@ -2135,7 +2149,7 @@ void OUTLINER_OT_keyingset_add_selected(wmOperatorType *ot) /** \name Keying-Set Remove Operator * \{ */ -static int outliner_keyingset_removeitems_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus outliner_keyingset_removeitems_exec(bContext *C, wmOperator * /*op*/) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); Scene *scene = CTX_data_scene(C); @@ -2263,7 +2277,9 @@ static bool outliner_orphans_purge_check(bContext *C, wmOperator *op) return true; } -static int outliner_orphans_purge_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus outliner_orphans_purge_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { op->customdata = MEM_new(__func__); @@ -2277,7 +2293,7 @@ static int outliner_orphans_purge_invoke(bContext *C, wmOperator *op, const wmEv IFACE_("Delete")); } -static int outliner_orphans_purge_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_orphans_purge_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); ScrArea *area = CTX_wm_area(C); @@ -2411,7 +2427,9 @@ void OUTLINER_OT_orphans_purge(wmOperatorType *ot) /** \name Manage Orphan Data-Blocks Operator * \{ */ -static int outliner_orphans_manage_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus outliner_orphans_manage_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { const int sizex = int(450.0f * UI_SCALE_FAC); const int sizey = int(450.0f * UI_SCALE_FAC); diff --git a/source/blender/editors/space_outliner/outliner_select.cc b/source/blender/editors/space_outliner/outliner_select.cc index 90471e92527..f55d02a1e4d 100644 --- a/source/blender/editors/space_outliner/outliner_select.cc +++ b/source/blender/editors/space_outliner/outliner_select.cc @@ -1762,12 +1762,12 @@ static bool outliner_is_co_within_active_mode_column(bContext *C, * * May expend/collapse branches or activate items. */ -static int outliner_item_do_activate_from_cursor(bContext *C, - const int mval[2], - const bool extend, - const bool use_range, - const bool deselect_all, - const bool recurse) +static wmOperatorStatus outliner_item_do_activate_from_cursor(bContext *C, + const int mval[2], + const bool extend, + const bool use_range, + const bool deselect_all, + const bool recurse) { ARegion *region = CTX_wm_region(C); SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); @@ -1887,7 +1887,9 @@ static int outliner_item_do_activate_from_cursor(bContext *C, } /* Event can enter-key, then it opens/closes. */ -static int outliner_item_activate_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus outliner_item_activate_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); @@ -1951,7 +1953,7 @@ static void outliner_box_select(bContext *C, }); } -static int outliner_box_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_box_select_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); @@ -1978,7 +1980,9 @@ static int outliner_box_select_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int outliner_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus outliner_box_select_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); ARegion *region = CTX_wm_region(C); @@ -2208,7 +2212,9 @@ static void outliner_walk_scroll(SpaceOutliner *space_outliner, ARegion *region, } } -static int outliner_walk_select_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus outliner_walk_select_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); ARegion *region = CTX_wm_region(C); diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc index a449a8a2d5d..2d65428e59e 100644 --- a/source/blender/editors/space_outliner/outliner_tools.cc +++ b/source/blender/editors/space_outliner/outliner_tools.cc @@ -727,7 +727,7 @@ static bool scene_fn(bContext *C, return true; } -static int outliner_scene_operation_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_scene_operation_exec(bContext *C, wmOperator *op) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); const eOutliner_PropSceneOps event = (eOutliner_PropSceneOps)RNA_enum_get(op->ptr, "type"); @@ -1847,7 +1847,7 @@ static bool outliner_liboverride_operation_poll(bContext *C) return true; } -static int outliner_liboverride_operation_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_liboverride_operation_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); @@ -2490,7 +2490,7 @@ static const EnumPropertyItem prop_object_op_types[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int outliner_object_operation_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_object_operation_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -2663,7 +2663,7 @@ static TreeTraversalAction outliner_collect_objects_to_delete(TreeElement *te, v return TRAVERSE_CONTINUE; } -static int outliner_delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_delete_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -2859,7 +2859,7 @@ static const EnumPropertyItem *outliner_id_operation_itemf(bContext *C, return items; } -static int outliner_id_operation_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_id_operation_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); wmWindowManager *wm = CTX_wm_manager(C); @@ -3078,7 +3078,7 @@ static const EnumPropertyItem outliner_lib_op_type_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int outliner_lib_operation_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_lib_operation_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -3185,7 +3185,7 @@ static void actionset_id_fn(TreeElement * /*te*/, /* TODO: other cases not supported yet. */ } -static int outliner_action_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_action_set_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); @@ -3289,7 +3289,7 @@ static const EnumPropertyItem prop_animdata_op_types[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int outliner_animdata_operation_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_animdata_operation_exec(bContext *C, wmOperator *op) { wmWindowManager *wm = CTX_wm_manager(C); SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); @@ -3384,7 +3384,7 @@ static const EnumPropertyItem prop_constraint_op_types[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int outliner_constraint_operation_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_constraint_operation_exec(bContext *C, wmOperator *op) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); eOutliner_PropConstraintOps event = (eOutliner_PropConstraintOps)RNA_enum_get(op->ptr, "type"); @@ -3432,7 +3432,7 @@ static const EnumPropertyItem prop_modifier_op_types[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int outliner_modifier_operation_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_modifier_operation_exec(bContext *C, wmOperator *op) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); eOutliner_PropModifierOps event = (eOutliner_PropModifierOps)RNA_enum_get(op->ptr, "type"); @@ -3492,7 +3492,7 @@ static bool outliner_data_operation_poll(bContext *C) datalevel, TSE_POSE_CHANNEL, TSE_BONE, TSE_EBONE, TSE_STRIP, TSE_GP_LAYER, TSE_RNA_STRUCT); } -static int outliner_data_operation_exec(bContext *C, wmOperator *op) +static wmOperatorStatus outliner_data_operation_exec(bContext *C, wmOperator *op) { SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); int scenelevel = 0, objectlevel = 0, idlevel = 0, datalevel = 0; @@ -3622,7 +3622,7 @@ void OUTLINER_OT_data_operation(wmOperatorType *ot) /** \name Context Menu Operator * \{ */ -static int outliner_operator_menu(bContext *C, const char *opname) +static wmOperatorStatus outliner_operator_menu(bContext *C, const char *opname) { wmOperatorType *ot = WM_operatortype_find(opname, false); uiPopupMenu *pup = UI_popup_menu_begin(C, WM_operatortype_name(ot, nullptr).c_str(), ICON_NONE); @@ -3644,10 +3644,10 @@ static int outliner_operator_menu(bContext *C, const char *opname) return OPERATOR_INTERFACE; } -static int do_outliner_operation_event(bContext *C, - ARegion *region, - SpaceOutliner *space_outliner, - TreeElement *te) +static wmOperatorStatus do_outliner_operation_event(bContext *C, + ARegion *region, + SpaceOutliner *space_outliner, + TreeElement *te) { int scenelevel = 0, objectlevel = 0, idlevel = 0, datalevel = 0; TreeStoreElem *tselem = TREESTORE(te); @@ -3719,7 +3719,9 @@ static int do_outliner_operation_event(bContext *C, return OPERATOR_CANCELLED; } -static int outliner_operation_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus outliner_operation_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); SpaceOutliner *space_outliner = CTX_wm_space_outliner(C); diff --git a/source/blender/editors/space_script/script_edit.cc b/source/blender/editors/space_script/script_edit.cc index abb44a5042f..6b14e660e0f 100644 --- a/source/blender/editors/space_script/script_edit.cc +++ b/source/blender/editors/space_script/script_edit.cc @@ -30,7 +30,7 @@ # include "BPY_extern_run.hh" #endif -static int run_pyfile_exec(bContext *C, wmOperator *op) +static wmOperatorStatus run_pyfile_exec(bContext *C, wmOperator *op) { char filepath[FILE_MAX]; RNA_string_get(op->ptr, "filepath", filepath); @@ -89,7 +89,7 @@ static bool script_test_modal_operators(bContext *C) } #endif -static int script_reload_exec(bContext *C, wmOperator *op) +static wmOperatorStatus script_reload_exec(bContext *C, wmOperator *op) { #ifdef WITH_PYTHON diff --git a/source/blender/editors/space_sequencer/sequencer_add.cc b/source/blender/editors/space_sequencer/sequencer_add.cc index 17b0e03eec9..2b2e3ba0803 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.cc +++ b/source/blender/editors/space_sequencer/sequencer_add.cc @@ -452,7 +452,7 @@ static bool seq_effect_add_properties_poll(const bContext * /*C*/, return true; } -static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_add_scene_strip_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -497,7 +497,9 @@ static void sequencer_disable_one_time_properties(bContext *C, wmOperator *op) } } -static int sequencer_add_scene_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sequencer_add_scene_strip_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { sequencer_disable_one_time_properties(C, op); if (!RNA_struct_property_is_set(op->ptr, "scene")) { @@ -552,7 +554,7 @@ static EnumPropertyItem strip_new_scene_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int sequencer_add_scene_strip_new_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_add_scene_strip_new_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -582,9 +584,9 @@ static int sequencer_add_scene_strip_new_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sequencer_add_scene_strip_new_invoke(bContext *C, - wmOperator *op, - const wmEvent * /*event*/) +static wmOperatorStatus sequencer_add_scene_strip_new_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { sequencer_disable_one_time_properties(C, op); sequencer_generic_invoke_xy__internal(C, op, 0, STRIP_TYPE_SCENE); @@ -651,7 +653,7 @@ void SEQUENCER_OT_scene_strip_add_new(wmOperatorType *ot) RNA_def_property_flag(ot->prop, PROP_ENUM_NO_TRANSLATE); } -static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -683,7 +685,9 @@ 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, const wmEvent *event) +static wmOperatorStatus sequencer_add_movieclip_strip_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { if (!RNA_struct_property_is_set(op->ptr, "clip")) { return WM_enum_search_invoke(C, op, event); @@ -718,7 +722,7 @@ void SEQUENCER_OT_movieclip_strip_add(wmOperatorType *ot) ot->prop = prop; } -static int sequencer_add_mask_strip_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_add_mask_strip_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -747,7 +751,9 @@ 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, const wmEvent *event) +static wmOperatorStatus sequencer_add_mask_strip_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { if (!RNA_struct_property_is_set(op->ptr, "mask")) { return WM_enum_search_invoke(C, op, event); @@ -1000,7 +1006,7 @@ static bool sequencer_add_movie_single_strip(bContext *C, return true; } -static int sequencer_add_movie_strip_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_add_movie_strip_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1061,7 +1067,9 @@ static int sequencer_add_movie_strip_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sequencer_add_movie_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sequencer_add_movie_strip_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { PropertyRNA *prop; Scene *scene = CTX_data_scene(C); @@ -1196,7 +1204,7 @@ static bool sequencer_add_sound_single_strip(bContext *C, wmOperator *op, seq::L return true; } -static int sequencer_add_sound_strip_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_add_sound_strip_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1229,7 +1237,9 @@ static int sequencer_add_sound_strip_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sequencer_add_sound_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sequencer_add_sound_strip_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { /* This is for drag and drop. */ if ((RNA_struct_property_is_set(op->ptr, "files") && @@ -1377,7 +1387,7 @@ static void sequencer_add_image_strip_load_files(wmOperator *op, } } -static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_add_image_strip_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_ensure(scene); @@ -1431,7 +1441,9 @@ 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, const wmEvent *event) +static wmOperatorStatus sequencer_add_image_strip_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { PropertyRNA *prop; Scene *scene = CTX_data_scene(C); @@ -1494,7 +1506,7 @@ void SEQUENCER_OT_image_strip_add(wmOperatorType *ot) "Use placeholders for missing frames of the strip"); } -static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_ensure(scene); @@ -1542,9 +1554,9 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sequencer_add_effect_strip_invoke(bContext *C, - wmOperator *op, - const wmEvent * /*event*/) +static wmOperatorStatus sequencer_add_effect_strip_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { bool is_type_set = RNA_struct_property_is_set(op->ptr, "type"); int type = -1; diff --git a/source/blender/editors/space_sequencer/sequencer_channels_edit.cc b/source/blender/editors/space_sequencer/sequencer_channels_edit.cc index 49092bfb807..f6a78de00a2 100644 --- a/source/blender/editors/space_sequencer/sequencer_channels_edit.cc +++ b/source/blender/editors/space_sequencer/sequencer_channels_edit.cc @@ -22,7 +22,9 @@ namespace blender::ed::vse { -static int sequencer_rename_channel_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus sequencer_rename_channel_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { SeqChannelDrawContext context; SpaceSeq *sseq = CTX_wm_space_seq(C); diff --git a/source/blender/editors/space_sequencer/sequencer_clipboard.cc b/source/blender/editors/space_sequencer/sequencer_clipboard.cc index 30a1441e86e..ca5402433e3 100644 --- a/source/blender/editors/space_sequencer/sequencer_clipboard.cc +++ b/source/blender/editors/space_sequencer/sequencer_clipboard.cc @@ -306,7 +306,7 @@ static bool sequencer_write_copy_paste_file(Main *bmain_src, return retval; } -int sequencer_clipboard_copy_exec(bContext *C, wmOperator *op) +wmOperatorStatus sequencer_clipboard_copy_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -392,7 +392,7 @@ static bool sequencer_paste_animation(Main *bmain_dst, Scene *scene_dst, Scene * return true; } -int sequencer_clipboard_paste_exec(bContext *C, wmOperator *op) +wmOperatorStatus sequencer_clipboard_paste_exec(bContext *C, wmOperator *op) { char filepath[FILE_MAX]; sequencer_copybuffer_filepath_get(filepath, sizeof(filepath)); diff --git a/source/blender/editors/space_sequencer/sequencer_edit.cc b/source/blender/editors/space_sequencer/sequencer_edit.cc index de37f2103ab..03da0fb9e81 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.cc +++ b/source/blender/editors/space_sequencer/sequencer_edit.cc @@ -268,7 +268,7 @@ bool sequencer_view_strips_poll(bContext *C) /** \name Remove Gaps Operator * \{ */ -static int sequencer_gap_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_gap_remove_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); const bool do_all = RNA_boolean_get(op->ptr, "all"); @@ -308,7 +308,7 @@ void SEQUENCER_OT_gap_remove(wmOperatorType *ot) /** \name Insert Gaps Operator * \{ */ -static int sequencer_gap_insert_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_gap_insert_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); const int frames = RNA_int_get(op->ptr, "frames"); @@ -354,7 +354,7 @@ void SEQUENCER_OT_gap_insert(wmOperatorType *ot) /** \name Snap Strips to the Current Frame Operator * \{ */ -static int sequencer_snap_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_snap_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); @@ -422,7 +422,9 @@ static int sequencer_snap_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sequencer_snap_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus sequencer_snap_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Scene *scene = CTX_data_scene(C); @@ -503,7 +505,7 @@ static int slip_count_sequences(ListBase *seqbasep) return trimmed_sequences; } -static int sequencer_slip_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sequencer_slip_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SlipData *data; Scene *scene = CTX_data_scene(C); @@ -593,7 +595,7 @@ static int sequencer_slip_apply_limits(const Scene *scene, SlipData *data, int * return delta_offset; } -static int sequencer_slip_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_slip_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -682,7 +684,7 @@ static void handle_number_input( WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); } -static int sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sequencer_slip_modal(bContext *C, wmOperator *op, const wmEvent *event) { Scene *scene = CTX_data_scene(C); SlipData *data = (SlipData *)op->customdata; @@ -840,7 +842,7 @@ void SEQUENCER_OT_slip(wmOperatorType *ot) /** \name Mute Strips Operator * \{ */ -static int sequencer_mute_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_mute_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -897,7 +899,7 @@ void SEQUENCER_OT_mute(wmOperatorType *ot) /** \name Unmute Strips Operator * \{ */ -static int sequencer_unmute_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_unmute_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -956,7 +958,7 @@ void SEQUENCER_OT_unmute(wmOperatorType *ot) /** \name Lock Strips Operator * \{ */ -static int sequencer_lock_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_lock_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -993,7 +995,7 @@ void SEQUENCER_OT_lock(wmOperatorType *ot) /** \name Unlock Strips Operator * \{ */ -static int sequencer_unlock_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_unlock_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -1030,7 +1032,7 @@ void SEQUENCER_OT_unlock(wmOperatorType *ot) /** \name Connect Strips Operator * \{ */ -static int sequencer_connect_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_connect_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -1074,7 +1076,7 @@ void SEQUENCER_OT_connect(wmOperatorType *ot) /** \name Disconnect Strips Operator * \{ */ -static int sequencer_disconnect_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_disconnect_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -1107,7 +1109,7 @@ void SEQUENCER_OT_disconnect(wmOperatorType *ot) /** \name Reload Strips Operator * \{ */ -static int sequencer_reload_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_reload_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1170,7 +1172,7 @@ static bool sequencer_refresh_all_poll(bContext *C) return sequencer_edit_poll(C); } -static int sequencer_refresh_all_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_refresh_all_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -1258,7 +1260,7 @@ bool strip_effect_get_new_inputs(Scene *scene, return true; } -static int sequencer_reassign_inputs_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_reassign_inputs_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Strip *seq1, *seq2; @@ -1338,7 +1340,7 @@ void SEQUENCER_OT_reassign_inputs(wmOperatorType *ot) /** \name Swap Inputs Operator * \{ */ -static int sequencer_swap_inputs_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_swap_inputs_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Strip *active_strip = seq::select_active_get(scene); @@ -1425,7 +1427,7 @@ static int sequence_split_side_for_exec_get(wmOperator *op) return split_side; } -static int sequencer_split_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_split_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1511,7 +1513,7 @@ static int sequencer_split_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH; } -static int sequencer_split_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sequencer_split_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Scene *scene = CTX_data_scene(C); View2D *v2d = UI_view2d_fromcontext(C); @@ -1634,7 +1636,7 @@ void SEQUENCER_OT_split(wmOperatorType *ot) /** \name Duplicate Strips Operator * \{ */ -static int sequencer_add_duplicate_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_add_duplicate_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -1742,7 +1744,7 @@ static void sequencer_delete_strip_data(bContext *C, Strip *strip) } } -static int sequencer_delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_delete_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1773,7 +1775,7 @@ static int sequencer_delete_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sequencer_delete_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sequencer_delete_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Scene *scene = CTX_data_scene(C); ListBase *markers = &scene->markers; @@ -1823,7 +1825,7 @@ void SEQUENCER_OT_delete(wmOperatorType *ot) /** \name Clear Strip Offset Operator * \{ */ -static int sequencer_offset_clear_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_offset_clear_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -1887,7 +1889,7 @@ void SEQUENCER_OT_offset_clear(wmOperatorType *ot) /** \name Separate Images Operator * \{ */ -static int sequencer_separate_images_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_separate_images_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -1965,7 +1967,9 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sequencer_separate_images_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sequencer_separate_images_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { return WM_operator_props_popup_confirm_ex( C, op, event, IFACE_("Separate Sequence Images"), IFACE_("Separate")); @@ -1995,7 +1999,7 @@ void SEQUENCER_OT_images_separate(wmOperatorType *ot) /** \name Toggle Meta Strip Operator * \{ */ -static int sequencer_meta_toggle_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_meta_toggle_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -2046,7 +2050,7 @@ void SEQUENCER_OT_meta_toggle(wmOperatorType *ot) /** \name Make Meta Strip Operator * \{ */ -static int sequencer_meta_make_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_meta_make_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -2130,7 +2134,7 @@ void SEQUENCER_OT_meta_make(wmOperatorType *ot) /** \name UnMeta Strip Operator * \{ */ -static int sequencer_meta_separate_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_meta_separate_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -2220,7 +2224,7 @@ static bool sequencer_strip_jump_poll(bContext *C) return sequencer_edit_poll(C); } -static int sequencer_strip_jump_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_strip_jump_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); const bool next = RNA_boolean_get(op->ptr, "next"); @@ -2344,7 +2348,7 @@ static bool strip_is_parent(const Strip *par, const Strip *strip) return ((par->seq1 == strip) || (par->seq2 == strip)); } -static int sequencer_swap_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_swap_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -2433,7 +2437,7 @@ void SEQUENCER_OT_swap(wmOperatorType *ot) /** \name Set Render Size Operator * \{ */ -static int sequencer_rendersize_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_rendersize_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); Strip *active_seq = seq::select_active_get(scene); @@ -2566,7 +2570,7 @@ void SEQUENCER_OT_paste(wmOperatorType *ot) /** \name Sequencer Swap Data Operator * \{ */ -static int sequencer_swap_data_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_swap_data_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Strip *strip_act; @@ -2630,7 +2634,7 @@ void SEQUENCER_OT_swap_data(wmOperatorType *ot) /** \name Change Effect Input Operator * \{ */ -static int sequencer_change_effect_input_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_change_effect_input_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Strip *strip = seq::select_active_get(scene); @@ -2691,7 +2695,7 @@ const EnumPropertyItem sequencer_prop_effect_types[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int sequencer_change_effect_type_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_change_effect_type_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Strip *strip = seq::select_active_get(scene); @@ -2753,7 +2757,7 @@ void SEQUENCER_OT_change_effect_type(wmOperatorType *ot) /** \name Change Data/Files Operator * \{ */ -static int sequencer_change_path_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_change_path_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -2849,7 +2853,9 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sequencer_change_path_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus sequencer_change_path_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Scene *scene = CTX_data_scene(C); Strip *strip = seq::select_active_get(scene); @@ -2918,7 +2924,7 @@ static bool sequencer_strip_change_scene_poll(bContext *C) Strip *strip = ed->act_seq; return ((strip != nullptr) && (strip->type == STRIP_TYPE_SCENE)); } -static int sequencer_change_scene_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_change_scene_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -2946,7 +2952,9 @@ static int sequencer_change_scene_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sequencer_change_scene_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sequencer_change_scene_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { if (!RNA_struct_property_is_set(op->ptr, "scene")) { return WM_enum_search_invoke(C, op, event); @@ -3003,9 +3011,9 @@ static int strip_cmp_time_startdisp_channel(void *thunk, const void *a, const vo return (strip_a_start > strip_b_start); } -static int sequencer_export_subtitles_invoke(bContext *C, - wmOperator *op, - const wmEvent * /*event*/) +static wmOperatorStatus sequencer_export_subtitles_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { ED_fileselect_ensure_default_filepath(C, op, ".srt"); @@ -3033,7 +3041,7 @@ static bool strip_get_text_strip_cb(Strip *strip, void *user_data) return true; } -static int sequencer_export_subtitles_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_export_subtitles_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Strip *strip, *strip_next; @@ -3150,7 +3158,7 @@ void SEQUENCER_OT_export_subtitles(wmOperatorType *ot) /** \name Set Range to Strips Operator * \{ */ -static int sequencer_set_range_to_strips_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_set_range_to_strips_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -3237,7 +3245,7 @@ static const EnumPropertyItem transform_reset_properties[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int sequencer_strip_transform_clear_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_strip_transform_clear_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); const Editing *ed = seq::editing_get(scene); @@ -3353,7 +3361,7 @@ static const EnumPropertyItem scale_fit_methods[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int sequencer_strip_transform_fit_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_strip_transform_fit_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); const Editing *ed = seq::editing_get(scene); @@ -3403,7 +3411,7 @@ void SEQUENCER_OT_strip_transform_fit(wmOperatorType *ot) "Scale fit fit_method"); } -static int sequencer_strip_color_tag_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_strip_color_tag_set_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); const Editing *ed = seq::editing_get(scene); @@ -3458,7 +3466,7 @@ void SEQUENCER_OT_strip_color_tag_set(wmOperatorType *ot) /** \name Set 2D Cursor Operator * \{ */ -static int sequencer_set_2d_cursor_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_set_2d_cursor_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); SpaceSeq *sseq = CTX_wm_space_seq(C); @@ -3475,7 +3483,9 @@ static int sequencer_set_2d_cursor_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH; } -static int sequencer_set_2d_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sequencer_set_2d_cursor_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); float cursor_pixel[2]; @@ -3521,7 +3531,7 @@ void SEQUENCER_OT_cursor_set(wmOperatorType *ot) /** \name Update scene strip frame range * \{ */ -static int sequencer_scene_frame_range_update_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_scene_frame_range_update_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); diff --git a/source/blender/editors/space_sequencer/sequencer_intern.hh b/source/blender/editors/space_sequencer/sequencer_intern.hh index a0bf86d0ded..1af3b31cd4d 100644 --- a/source/blender/editors/space_sequencer/sequencer_intern.hh +++ b/source/blender/editors/space_sequencer/sequencer_intern.hh @@ -347,18 +347,18 @@ void SEQUENCER_OT_retiming_freeze_frame_add(wmOperatorType *ot); void SEQUENCER_OT_retiming_transition_add(wmOperatorType *ot); void SEQUENCER_OT_retiming_key_delete(wmOperatorType *ot); void SEQUENCER_OT_retiming_segment_speed_set(wmOperatorType *ot); -int sequencer_retiming_key_select_exec(bContext *C, - wmOperator *op, - SeqRetimingKey *key, - const Strip *key_owner); +wmOperatorStatus sequencer_retiming_key_select_exec(bContext *C, + wmOperator *op, + SeqRetimingKey *key, + const Strip *key_owner); /* Select a key and all following keys. */ -int sequencer_retiming_select_linked_time(bContext *C, - wmOperator *op, - SeqRetimingKey *key, - const Strip *key_owner); -int sequencer_select_exec(bContext *C, wmOperator *op); -int sequencer_retiming_select_all_exec(bContext *C, wmOperator *op); -int sequencer_retiming_box_select_exec(bContext *C, wmOperator *op); +wmOperatorStatus sequencer_retiming_select_linked_time(bContext *C, + wmOperator *op, + SeqRetimingKey *key, + const Strip *key_owner); +wmOperatorStatus sequencer_select_exec(bContext *C, wmOperator *op); +wmOperatorStatus sequencer_retiming_select_all_exec(bContext *C, wmOperator *op); +wmOperatorStatus sequencer_retiming_box_select_exec(bContext *C, wmOperator *op); /* `sequencer_retiming_draw.cc` */ void sequencer_retiming_draw_continuity(const TimelineDrawContext *timeline_ctx, @@ -396,7 +396,7 @@ blender::Vector sequencer_visible_strips_get(const bContext *C); blender::Vector sequencer_visible_strips_get(const Scene *scene, const View2D *v2d); /* `sequencer_clipboard.cc` */ -int sequencer_clipboard_copy_exec(bContext *C, wmOperator *op); -int sequencer_clipboard_paste_exec(bContext *C, wmOperator *op); +wmOperatorStatus sequencer_clipboard_copy_exec(bContext *C, wmOperator *op); +wmOperatorStatus sequencer_clipboard_paste_exec(bContext *C, wmOperator *op); } // namespace blender::ed::vse diff --git a/source/blender/editors/space_sequencer/sequencer_modifier.cc b/source/blender/editors/space_sequencer/sequencer_modifier.cc index 16dd5851891..1ff4c431a98 100644 --- a/source/blender/editors/space_sequencer/sequencer_modifier.cc +++ b/source/blender/editors/space_sequencer/sequencer_modifier.cc @@ -36,7 +36,7 @@ namespace blender::ed::vse { /** \name Add modifier operator * \{ */ -static int strip_modifier_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus strip_modifier_add_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Strip *strip = seq::select_active_get(scene); @@ -97,7 +97,7 @@ void SEQUENCER_OT_strip_modifier_add(wmOperatorType *ot) /** \name Remove Modifier Operator * \{ */ -static int strip_modifier_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus strip_modifier_remove_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Strip *strip = seq::select_active_get(scene); @@ -157,7 +157,7 @@ enum { SEQ_MODIFIER_MOVE_DOWN, }; -static int strip_modifier_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus strip_modifier_move_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Strip *strip = seq::select_active_get(scene); @@ -238,7 +238,7 @@ enum { SEQ_MODIFIER_COPY_APPEND = 1, }; -static int strip_modifier_copy_exec(bContext *C, wmOperator *op) +static wmOperatorStatus strip_modifier_copy_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Editing *ed = scene->ed; @@ -329,7 +329,7 @@ void SEQUENCER_OT_strip_modifier_copy(wmOperatorType *ot) /** \name Redefine Equalizer Graphs Operator * \{ */ -static int strip_modifier_equalizer_redefine_exec(bContext *C, wmOperator *op) +static wmOperatorStatus strip_modifier_equalizer_redefine_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Strip *strip = seq::select_active_get(scene); diff --git a/source/blender/editors/space_sequencer/sequencer_proxy.cc b/source/blender/editors/space_sequencer/sequencer_proxy.cc index 98f82628949..7105e9f0c18 100644 --- a/source/blender/editors/space_sequencer/sequencer_proxy.cc +++ b/source/blender/editors/space_sequencer/sequencer_proxy.cc @@ -89,14 +89,16 @@ static void seq_proxy_build_job(const bContext *C, ReportList *reports) ED_area_tag_redraw(area); } -static int sequencer_rebuild_proxy_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus sequencer_rebuild_proxy_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { seq_proxy_build_job(C, op->reports); return OPERATOR_FINISHED; } -static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator * /*o*/) +static wmOperatorStatus sequencer_rebuild_proxy_exec(bContext *C, wmOperator * /*o*/) { Main *bmain = CTX_data_main(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -149,13 +151,15 @@ void SEQUENCER_OT_rebuild_proxy(wmOperatorType *ot) /** \name Set Selected Strip Proxies Operator * \{ */ -static int sequencer_enable_proxies_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus sequencer_enable_proxies_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { return WM_operator_props_dialog_popup( C, op, 200, IFACE_("Set Selected Strip Proxies"), IFACE_("Set")); } -static int sequencer_enable_proxies_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_enable_proxies_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); diff --git a/source/blender/editors/space_sequencer/sequencer_retiming.cc b/source/blender/editors/space_sequencer/sequencer_retiming.cc index bdf9d65204c..8f4f106f23f 100644 --- a/source/blender/editors/space_sequencer/sequencer_retiming.cc +++ b/source/blender/editors/space_sequencer/sequencer_retiming.cc @@ -86,7 +86,7 @@ static void sequencer_retiming_data_hide_all(ListBase *seqbase) } } -static int sequencer_retiming_data_show_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_retiming_data_show_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -148,7 +148,7 @@ static bool retiming_poll(bContext *C) /** \name Retiming Reset * \{ */ -static int sequencer_retiming_reset_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_retiming_reset_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); const Editing *ed = seq::editing_get(scene); @@ -216,10 +216,10 @@ static bool retiming_key_add_new_for_seq(bContext *C, return true; } -static int retiming_key_add_from_selection(bContext *C, - wmOperator *op, - blender::Span strips, - const int timeline_frame) +static wmOperatorStatus retiming_key_add_from_selection(bContext *C, + wmOperator *op, + blender::Span strips, + const int timeline_frame) { bool inserted = false; @@ -233,9 +233,9 @@ static int retiming_key_add_from_selection(bContext *C, return inserted ? OPERATOR_FINISHED : OPERATOR_CANCELLED; } -static int retiming_key_add_to_editable_strips(bContext *C, - wmOperator *op, - const int timeline_frame) +static wmOperatorStatus retiming_key_add_to_editable_strips(bContext *C, + wmOperator *op, + const int timeline_frame) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -253,7 +253,7 @@ static int retiming_key_add_to_editable_strips(bContext *C, return inserted ? OPERATOR_FINISHED : OPERATOR_CANCELLED; } -static int sequencer_retiming_key_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_retiming_key_add_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); @@ -265,7 +265,7 @@ static int sequencer_retiming_key_add_exec(bContext *C, wmOperator *op) timeline_frame = BKE_scene_frame_get(scene); } - int ret_val; + wmOperatorStatus ret_val; blender::VectorSet strips = selected_strips_from_context(C); if (!strips.is_empty()) { ret_val = retiming_key_add_from_selection(C, op, strips, timeline_frame); @@ -379,7 +379,7 @@ static bool freeze_frame_add_from_retiming_selection(const bContext *C, return success; } -static int sequencer_retiming_freeze_frame_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_retiming_freeze_frame_add_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); bool success = false; @@ -485,7 +485,7 @@ static bool transition_add_from_retiming_selection(const bContext *C, return success; } -static int sequencer_retiming_transition_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_retiming_transition_add_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); bool success = false; @@ -541,7 +541,7 @@ void SEQUENCER_OT_retiming_transition_add(wmOperatorType *ot) /** \name Retiming Delete Key * \{ */ -static int sequencer_retiming_key_delete_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_retiming_key_delete_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); @@ -576,7 +576,9 @@ static int sequencer_retiming_key_delete_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -static int sequencer_retiming_key_delete_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sequencer_retiming_key_delete_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Scene *scene = CTX_data_scene(C); ListBase *markers = &scene->markers; @@ -643,7 +645,7 @@ static float strip_speed_get(bContext *C, const wmOperator * /*op*/) return 1.0f; } -static int strip_speed_set_exec(bContext *C, const wmOperator *op) +static wmOperatorStatus strip_speed_set_exec(bContext *C, const wmOperator *op) { Scene *scene = CTX_data_scene(C); blender::VectorSet strips = selected_strips_from_context(C); @@ -671,9 +673,9 @@ static int strip_speed_set_exec(bContext *C, const wmOperator *op) return OPERATOR_FINISHED; } -static int segment_speed_set_exec(const bContext *C, - const wmOperator *op, - blender::Map selection) +static wmOperatorStatus segment_speed_set_exec(const bContext *C, + const wmOperator *op, + blender::Map selection) { Scene *scene = CTX_data_scene(C); ListBase *seqbase = seq::active_seqbase_get(seq::editing_get(scene)); @@ -696,7 +698,7 @@ static int segment_speed_set_exec(const bContext *C, return OPERATOR_FINISHED; } -static int sequencer_retiming_segment_speed_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_retiming_segment_speed_set_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); @@ -716,9 +718,9 @@ static int sequencer_retiming_segment_speed_set_exec(bContext *C, wmOperator *op return OPERATOR_CANCELLED; } -static int sequencer_retiming_segment_speed_set_invoke(bContext *C, - wmOperator *op, - const wmEvent *event) +static wmOperatorStatus sequencer_retiming_segment_speed_set_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { if (!RNA_struct_property_is_set(op->ptr, "speed")) { RNA_float_set(op->ptr, "speed", strip_speed_get(C, op) * 100.0f); @@ -810,10 +812,10 @@ static bool select_connected_keys(const Scene *scene, return changed; } -int sequencer_retiming_select_linked_time(bContext *C, - wmOperator *op, - SeqRetimingKey *key, - const Strip *key_owner) +wmOperatorStatus sequencer_retiming_select_linked_time(bContext *C, + wmOperator *op, + SeqRetimingKey *key, + const Strip *key_owner) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -829,10 +831,10 @@ int sequencer_retiming_select_linked_time(bContext *C, return OPERATOR_FINISHED; } -int sequencer_retiming_key_select_exec(bContext *C, - wmOperator *op, - SeqRetimingKey *key, - const Strip *key_owner) +wmOperatorStatus sequencer_retiming_key_select_exec(bContext *C, + wmOperator *op, + SeqRetimingKey *key, + const Strip *key_owner) { if (RNA_boolean_get(op->ptr, "linked_time")) { return sequencer_retiming_select_linked_time(C, op, key, key_owner); @@ -886,7 +888,7 @@ static void realize_fake_keys_in_rect(bContext *C, Strip *strip, const rctf &rec } } -int sequencer_retiming_box_select_exec(bContext *C, wmOperator *op) +wmOperatorStatus sequencer_retiming_box_select_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); const View2D *v2d = UI_view2d_fromcontext(C); @@ -969,7 +971,7 @@ int sequencer_retiming_box_select_exec(bContext *C, wmOperator *op) return changed ? OPERATOR_FINISHED : OPERATOR_CANCELLED; } -int sequencer_retiming_select_all_exec(bContext *C, wmOperator *op) +wmOperatorStatus sequencer_retiming_select_all_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); int action = RNA_enum_get(op->ptr, "action"); diff --git a/source/blender/editors/space_sequencer/sequencer_select.cc b/source/blender/editors/space_sequencer/sequencer_select.cc index c2ace10eb6f..38b6c49133f 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.cc +++ b/source/blender/editors/space_sequencer/sequencer_select.cc @@ -397,7 +397,7 @@ static void sequencer_select_do_updates(bContext *C, Scene *scene) /** \name (De)select All Operator * \{ */ -static int sequencer_de_select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_de_select_all_exec(bContext *C, wmOperator *op) { int action = RNA_enum_get(op->ptr, "action"); Scene *scene = CTX_data_scene(C); @@ -472,7 +472,7 @@ void SEQUENCER_OT_select_all(wmOperatorType *ot) /** \name Select Inverse Operator * \{ */ -static int sequencer_select_inverse_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_select_inverse_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); @@ -1109,7 +1109,7 @@ StripSelection pick_strip_and_handle(const Scene *scene, const View2D *v2d, floa return selection; } -int sequencer_select_exec(bContext *C, wmOperator *op) +wmOperatorStatus sequencer_select_exec(bContext *C, wmOperator *op) { const View2D *v2d = UI_view2d_fromcontext(C); Scene *scene = CTX_data_scene(C); @@ -1273,9 +1273,9 @@ int sequencer_select_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - const int retval = WM_generic_select_invoke(C, op, event); + const wmOperatorStatus retval = WM_generic_select_invoke(C, op, event); ARegion *region = CTX_wm_region(C); if (region && (region->regiontype == RGN_TYPE_PREVIEW)) { return WM_operator_flag_only_pass_through_on_press(retval, event); @@ -1370,7 +1370,7 @@ void SEQUENCER_OT_select(wmOperatorType *ot) /** \name Select Handle Operator * \{ */ -static int sequencer_select_handle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_select_handle_exec(bContext *C, wmOperator *op) { /* This operator is only used in the RCS keymap by default and is not exposed in any menus. */ const View2D *v2d = UI_view2d_fromcontext(C); @@ -1427,7 +1427,9 @@ static int sequencer_select_handle_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH; } -static int sequencer_select_handle_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sequencer_select_handle_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { ARegion *region = CTX_wm_region(C); @@ -1555,7 +1557,7 @@ static bool select_more_less_seq__internal(Scene *scene, bool select_more) return changed; } -static int sequencer_select_more_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_select_more_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); @@ -1591,7 +1593,7 @@ void SEQUENCER_OT_select_more(wmOperatorType *ot) /** \name Select Less Operator * \{ */ -static int sequencer_select_less_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_select_less_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); @@ -1627,7 +1629,9 @@ void SEQUENCER_OT_select_less(wmOperatorType *ot) /** \name Select Pick Linked Operator * \{ */ -static int sequencer_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sequencer_select_linked_pick_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Scene *scene = CTX_data_scene(C); const View2D *v2d = UI_view2d_fromcontext(C); @@ -1688,7 +1692,7 @@ void SEQUENCER_OT_select_linked_pick(wmOperatorType *ot) /** \name Select Linked Operator * \{ */ -static int sequencer_select_linked_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_select_linked_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); bool selected; @@ -1745,7 +1749,7 @@ static const EnumPropertyItem prop_select_handles_side_types[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int sequencer_select_handles_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_select_handles_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -1842,7 +1846,7 @@ void SEQUENCER_OT_select_handles(wmOperatorType *ot) /** \name Select Side of Frame Operator * \{ */ -static int sequencer_select_side_of_frame_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_select_side_of_frame_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -1917,7 +1921,7 @@ void SEQUENCER_OT_select_side_of_frame(wmOperatorType *ot) /** \name Select Side Operator * \{ */ -static int sequencer_select_side_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_select_side_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Editing *ed = seq::editing_get(scene); @@ -2039,7 +2043,7 @@ static void seq_box_select_seq_from_preview(const bContext *C, } } -static int sequencer_box_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_box_select_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); View2D *v2d = UI_view2d_fromcontext(C); @@ -2144,7 +2148,9 @@ static int sequencer_box_select_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sequencer_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sequencer_box_select_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Scene *scene = CTX_data_scene(C); const View2D *v2d = UI_view2d_fromcontext(C); @@ -2492,7 +2498,7 @@ static bool select_grouped_effect_link(const Scene *scene, #undef STRIP_IS_EFFECT #undef STRIP_USE_DATA -static int sequencer_select_grouped_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_select_grouped_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ListBase *seqbase = seq::active_seqbase_get(seq::editing_get(scene)); diff --git a/source/blender/editors/space_sequencer/sequencer_text_edit.cc b/source/blender/editors/space_sequencer/sequencer_text_edit.cc index d5a6999877c..795ff91d7ed 100644 --- a/source/blender/editors/space_sequencer/sequencer_text_edit.cc +++ b/source/blender/editors/space_sequencer/sequencer_text_edit.cc @@ -294,7 +294,7 @@ static int2 cursor_move_next_word(int2 cursor_position, const TextVarsRuntime *t return cursor_position; } -static int sequencer_text_cursor_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_text_cursor_move_exec(bContext *C, wmOperator *op) { const Strip *strip = seq::select_active_get(CTX_data_scene(C)); TextVars *data = static_cast(strip->effectdata); @@ -407,7 +407,7 @@ static bool text_insert(TextVars *data, const char *buf) return true; } -static int sequencer_text_insert_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_text_insert_exec(bContext *C, wmOperator *op) { const Strip *strip = seq::select_active_get(CTX_data_scene(C)); TextVars *data = static_cast(strip->effectdata); @@ -428,7 +428,9 @@ static int sequencer_text_insert_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int sequencer_text_insert_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sequencer_text_insert_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { char str[6]; BLI_strncpy(str, event->utf8_buf, BLI_str_utf8_size_safe(event->utf8_buf) + 1); @@ -470,7 +472,7 @@ static void delete_character(const seq::CharInfo character, const TextVars *data std::memmove(cursor_addr, next_char_addr, BLI_strnlen(next_char_addr, sizeof(data->text)) + 1); } -static int sequencer_text_delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_text_delete_exec(bContext *C, wmOperator *op) { const Strip *strip = seq::select_active_get(CTX_data_scene(C)); TextVars *data = static_cast(strip->effectdata); @@ -526,7 +528,7 @@ void SEQUENCER_OT_text_delete(wmOperatorType *ot) "Which part of the text to delete"); } -static int sequencer_text_line_break_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_text_line_break_exec(bContext *C, wmOperator * /*op*/) { const Strip *strip = seq::select_active_get(CTX_data_scene(C)); TextVars *data = static_cast(strip->effectdata); @@ -554,7 +556,7 @@ void SEQUENCER_OT_text_line_break(wmOperatorType *ot) ot->flag = OPTYPE_UNDO; } -static int sequencer_text_select_all_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_text_select_all_exec(bContext *C, wmOperator * /*op*/) { const Strip *strip = seq::select_active_get(CTX_data_scene(C)); TextVars *data = static_cast(strip->effectdata); @@ -579,7 +581,7 @@ void SEQUENCER_OT_text_select_all(wmOperatorType *ot) ot->flag = OPTYPE_UNDO; } -static int sequencer_text_deselect_all_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_text_deselect_all_exec(bContext *C, wmOperator * /*op*/) { Strip *strip = seq::select_active_get(CTX_data_scene(C)); TextVars *data = static_cast(strip->effectdata); @@ -611,7 +613,7 @@ void SEQUENCER_OT_text_deselect_all(wmOperatorType *ot) ot->flag = OPTYPE_UNDO; } -static int sequencer_text_edit_mode_toggle_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_text_edit_mode_toggle_exec(bContext *C, wmOperator * /*op*/) { Strip *strip = seq::select_active_get(CTX_data_scene(C)); if (sequencer_text_editing_active_poll(C)) { @@ -684,7 +686,9 @@ static void cursor_set_by_mouse_position(const bContext *C, const wmEvent *event data->cursor_offset = find_closest_cursor_offset(data, float2(mouse_loc)); } -static int sequencer_text_cursor_set_modal(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus sequencer_text_cursor_set_modal(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { const Scene *scene = CTX_data_scene(C); const Strip *strip = seq::select_active_get(scene); @@ -718,7 +722,9 @@ static int sequencer_text_cursor_set_modal(bContext *C, wmOperator * /*op*/, con return OPERATOR_RUNNING_MODAL; } -static int sequencer_text_cursor_set_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus sequencer_text_cursor_set_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { const Scene *scene = CTX_data_scene(C); Strip *strip = seq::select_active_get(scene); @@ -778,7 +784,7 @@ static void text_edit_copy(const TextVars *data) WM_clipboard_text_set(clipboard_buf, false); } -static int sequencer_text_edit_copy_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_text_edit_copy_exec(bContext *C, wmOperator * /*op*/) { const Strip *strip = seq::select_active_get(CTX_data_scene(C)); const TextVars *data = static_cast(strip->effectdata); @@ -807,7 +813,7 @@ void SEQUENCER_OT_text_edit_copy(wmOperatorType *ot) ot->flag = OPTYPE_UNDO; } -static int sequencer_text_edit_paste_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_text_edit_paste_exec(bContext *C, wmOperator * /*op*/) { const Strip *strip = seq::select_active_get(CTX_data_scene(C)); TextVars *data = static_cast(strip->effectdata); @@ -860,7 +866,7 @@ void SEQUENCER_OT_text_edit_paste(wmOperatorType *ot) ot->flag = OPTYPE_UNDO; } -static int sequencer_text_edit_cut_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_text_edit_cut_exec(bContext *C, wmOperator * /*op*/) { const Strip *strip = seq::select_active_get(CTX_data_scene(C)); TextVars *data = static_cast(strip->effectdata); diff --git a/source/blender/editors/space_sequencer/sequencer_view.cc b/source/blender/editors/space_sequencer/sequencer_view.cc index e45c7a1cb83..8bc06c94a73 100644 --- a/source/blender/editors/space_sequencer/sequencer_view.cc +++ b/source/blender/editors/space_sequencer/sequencer_view.cc @@ -98,7 +98,7 @@ void SEQ_add_timeline_region_padding(const bContext *C, rctf *view_box) BLI_rctf_pad_y(view_box, region->winy, pad_bottom, pad_top); } -static int sequencer_view_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_view_all_exec(bContext *C, wmOperator *op) { ARegion *region = CTX_wm_region(C); rctf box; @@ -143,7 +143,7 @@ void SEQUENCER_OT_view_all(wmOperatorType *ot) /** \name Go to Current Frame Operator * \{ */ -static int sequencer_view_frame_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_view_frame_exec(bContext *C, wmOperator *op) { const int smooth_viewtx = WM_operator_smooth_viewtx_get(op); ANIM_center_frame(C, smooth_viewtx); @@ -172,7 +172,7 @@ void SEQUENCER_OT_view_frame(wmOperatorType *ot) /** \name Preview Frame All Operator * \{ */ -static int sequencer_view_all_preview_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus sequencer_view_all_preview_exec(bContext *C, wmOperator * /*op*/) { SpaceSeq *sseq = CTX_wm_space_seq(C); bScreen *screen = CTX_wm_screen(C); @@ -242,7 +242,7 @@ void SEQUENCER_OT_view_all_preview(wmOperatorType *ot) /** \name Sequencer View Zoom Ratio Operator * \{ */ -static int sequencer_view_zoom_ratio_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_view_zoom_ratio_exec(bContext *C, wmOperator *op) { const RenderData *rd = &CTX_data_scene(C)->r; View2D *v2d = UI_view2d_fromcontext(C); @@ -385,7 +385,7 @@ static void seq_view_collection_rect_timeline(const bContext *C, *rect = new_viewport; } -static int sequencer_view_selected_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sequencer_view_selected_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ARegion *region = CTX_wm_region(C); @@ -435,7 +435,7 @@ void SEQUENCER_OT_view_selected(wmOperatorType *ot) /** \name Border Offset View Operator * \{ */ -static int view_ghost_border_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_ghost_border_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); View2D *v2d = UI_view2d_fromcontext(C); diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_ops.cc b/source/blender/editors/space_spreadsheet/spreadsheet_ops.cc index 05f6472692d..7e5cacdccf2 100644 --- a/source/blender/editors/space_spreadsheet/spreadsheet_ops.cc +++ b/source/blender/editors/space_spreadsheet/spreadsheet_ops.cc @@ -21,7 +21,7 @@ namespace blender::ed::spreadsheet { -static int row_filter_add_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus row_filter_add_exec(bContext *C, wmOperator * /*op*/) { SpaceSpreadsheet *sspreadsheet = CTX_wm_space_spreadsheet(C); @@ -45,7 +45,7 @@ static void SPREADSHEET_OT_add_row_filter_rule(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static int row_filter_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus row_filter_remove_exec(bContext *C, wmOperator *op) { SpaceSpreadsheet *sspreadsheet = CTX_wm_space_spreadsheet(C); @@ -77,7 +77,9 @@ static void SPREADSHEET_OT_remove_row_filter_rule(wmOperatorType *ot) RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "", 0, INT_MAX); } -static int select_component_domain_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus select_component_domain_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { const auto component_type = bke::GeometryComponent::Type(RNA_int_get(op->ptr, "component_type")); bke::AttrDomain domain = bke::AttrDomain(RNA_int_get(op->ptr, "attribute_domain_type")); diff --git a/source/blender/editors/space_text/text_autocomplete.cc b/source/blender/editors/space_text/text_autocomplete.cc index 48a706c0657..6ee6246e12e 100644 --- a/source/blender/editors/space_text/text_autocomplete.cc +++ b/source/blender/editors/space_text/text_autocomplete.cc @@ -287,7 +287,9 @@ static void confirm_suggestion(Text *text) /** \name Auto Complete Operator * \{ */ -static int text_autocomplete_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus text_autocomplete_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { SpaceText *st = CTX_wm_space_text(C); Text *text = CTX_data_edit_text(C); @@ -315,7 +317,7 @@ static int text_autocomplete_invoke(bContext *C, wmOperator *op, const wmEvent * return OPERATOR_CANCELLED; } -static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *event) { /* NOTE(@ideasman42): this code could be refactored or rewritten. */ SpaceText *st = CTX_wm_space_text(C); @@ -323,7 +325,7 @@ static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *e ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW); int draw = 0, tools = 0, swallow = 0, scroll = 1; - int retval = OPERATOR_RUNNING_MODAL; + wmOperatorStatus retval = OPERATOR_RUNNING_MODAL; if (st->doplugins && texttool_text_is_active(st->text)) { if (texttool_suggest_first()) { diff --git a/source/blender/editors/space_text/text_header.cc b/source/blender/editors/space_text/text_header.cc index 8f6dc7a4323..3f86b4623f2 100644 --- a/source/blender/editors/space_text/text_header.cc +++ b/source/blender/editors/space_text/text_header.cc @@ -61,7 +61,7 @@ static bool text_properties_poll(bContext *C) return (CTX_wm_space_text(C) != nullptr); } -static int text_text_search_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus text_text_search_exec(bContext *C, wmOperator * /*op*/) { ScrArea *area = CTX_wm_area(C); ARegion *region = text_has_properties_region(area); diff --git a/source/blender/editors/space_text/text_ops.cc b/source/blender/editors/space_text/text_ops.cc index 99da5583b0a..5fa8775f9a2 100644 --- a/source/blender/editors/space_text/text_ops.cc +++ b/source/blender/editors/space_text/text_ops.cc @@ -333,7 +333,7 @@ void text_update_edited(Text *text) /** \name New Operator * \{ */ -static int text_new_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus text_new_exec(bContext *C, wmOperator * /*op*/) { SpaceText *st = CTX_wm_space_text(C); Main *bmain = CTX_data_main(C); @@ -399,7 +399,7 @@ static void text_open_cancel(bContext * /*C*/, wmOperator *op) MEM_delete(static_cast(op->customdata)); } -static int text_open_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_open_exec(bContext *C, wmOperator *op) { SpaceText *st = CTX_wm_space_text(C); Main *bmain = CTX_data_main(C); @@ -447,7 +447,7 @@ static int text_open_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int text_open_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus text_open_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { Main *bmain = CTX_data_main(C); Text *text = CTX_data_edit_text(C); @@ -498,7 +498,7 @@ void TEXT_OT_open(wmOperatorType *ot) /** \name Reload Operator * \{ */ -static int text_reload_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_reload_exec(bContext *C, wmOperator *op) { SpaceText *st = CTX_wm_space_text(C); Text *text = CTX_data_edit_text(C); @@ -543,7 +543,7 @@ static int text_reload_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int text_reload_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus text_reload_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { return WM_operator_confirm_ex(C, op, @@ -579,7 +579,7 @@ static bool text_unlink_poll(bContext *C) return CTX_data_edit_text(C) != nullptr; } -static int text_unlink_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus text_unlink_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); SpaceText *st = CTX_wm_space_text(C); @@ -605,7 +605,7 @@ static int text_unlink_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -static int text_unlink_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus text_unlink_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { return WM_operator_confirm_ex(C, op, @@ -638,7 +638,7 @@ void TEXT_OT_unlink(wmOperatorType *ot) /** \name Make Internal Operator * \{ */ -static int text_make_internal_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus text_make_internal_exec(bContext *C, wmOperator * /*op*/) { Text *text = CTX_data_edit_text(C); @@ -731,7 +731,7 @@ static void txt_write_file(Main *bmain, Text *text, ReportList *reports) text->flags &= ~TXT_ISDIRTY; } -static int text_save_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_save_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Text *text = CTX_data_edit_text(C); @@ -744,7 +744,7 @@ static int text_save_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int text_save_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus text_save_invoke(bContext *C, wmOperator *op, const wmEvent *event) { Text *text = CTX_data_edit_text(C); @@ -775,7 +775,7 @@ void TEXT_OT_save(wmOperatorType *ot) /** \name Save As Operator * \{ */ -static int text_save_as_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_save_as_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Text *text = CTX_data_edit_text(C); @@ -801,7 +801,7 @@ static int text_save_as_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int text_save_as_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus text_save_as_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { Main *bmain = CTX_data_main(C); Text *text = CTX_data_edit_text(C); @@ -855,7 +855,7 @@ void TEXT_OT_save_as(wmOperatorType *ot) /** \name Run Script Operator * \{ */ -static int text_run_script(bContext *C, ReportList *reports) +static wmOperatorStatus text_run_script(bContext *C, ReportList *reports) { #ifdef WITH_PYTHON Text *text = CTX_data_edit_text(C); @@ -894,7 +894,7 @@ static int text_run_script(bContext *C, ReportList *reports) return OPERATOR_CANCELLED; } -static int text_run_script_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_run_script_exec(bContext *C, wmOperator *op) { #ifndef WITH_PYTHON (void)C; /* unused */ @@ -928,7 +928,7 @@ void TEXT_OT_run_script(wmOperatorType *ot) /** \name Refresh Pyconstraints Operator * \{ */ -static int text_refresh_pyconstraints_exec(bContext * /*C*/, wmOperator * /*op*/) +static wmOperatorStatus text_refresh_pyconstraints_exec(bContext * /*C*/, wmOperator * /*op*/) { #ifdef WITH_PYTHON # if 0 @@ -993,7 +993,7 @@ void TEXT_OT_refresh_pyconstraints(wmOperatorType *ot) /** \name Paste Operator * \{ */ -static int text_paste_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_paste_exec(bContext *C, wmOperator *op) { SpaceText *st = CTX_wm_space_text(C); Text *text = CTX_data_edit_text(C); @@ -1067,7 +1067,7 @@ void TEXT_OT_paste(wmOperatorType *ot) /** \name Duplicate Operator * \{ */ -static int text_duplicate_line_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus text_duplicate_line_exec(bContext *C, wmOperator * /*op*/) { Text *text = CTX_data_edit_text(C); @@ -1122,7 +1122,7 @@ static void txt_copy_clipboard(const Text *text) } } -static int text_copy_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus text_copy_exec(bContext *C, wmOperator * /*op*/) { const Text *text = CTX_data_edit_text(C); @@ -1149,7 +1149,7 @@ void TEXT_OT_copy(wmOperatorType *ot) /** \name Cut Operator * \{ */ -static int text_cut_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus text_cut_exec(bContext *C, wmOperator * /*op*/) { SpaceText *st = CTX_wm_space_text(C); Text *text = CTX_data_edit_text(C); @@ -1193,7 +1193,7 @@ void TEXT_OT_cut(wmOperatorType *ot) /** \name Indent or Autocomplete Operator * \{ */ -static int text_indent_or_autocomplete_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus text_indent_or_autocomplete_exec(bContext *C, wmOperator * /*op*/) { Text *text = CTX_data_edit_text(C); TextLine *line = text->curl; @@ -1228,7 +1228,7 @@ void TEXT_OT_indent_or_autocomplete(wmOperatorType *ot) /** \name Indent Operator * \{ */ -static int text_indent_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus text_indent_exec(bContext *C, wmOperator * /*op*/) { SpaceText *st = CTX_wm_space_text(C); Text *text = CTX_data_edit_text(C); @@ -1274,7 +1274,7 @@ void TEXT_OT_indent(wmOperatorType *ot) /** \name Unindent Operator * \{ */ -static int text_unindent_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus text_unindent_exec(bContext *C, wmOperator * /*op*/) { SpaceText *st = CTX_wm_space_text(C); Text *text = CTX_data_edit_text(C); @@ -1315,7 +1315,7 @@ void TEXT_OT_unindent(wmOperatorType *ot) /** \name Line Break Operator * \{ */ -static int text_line_break_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus text_line_break_exec(bContext *C, wmOperator * /*op*/) { SpaceText *st = CTX_wm_space_text(C); Text *text = CTX_data_edit_text(C); @@ -1372,7 +1372,7 @@ void TEXT_OT_line_break(wmOperatorType *ot) /** \name Toggle-Comment Operator * \{ */ -static int text_comment_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_comment_exec(bContext *C, wmOperator *op) { SpaceText *st = CTX_wm_space_text(C); Text *text = CTX_data_edit_text(C); @@ -1448,7 +1448,7 @@ static const EnumPropertyItem whitespace_type_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int text_convert_whitespace_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_convert_whitespace_exec(bContext *C, wmOperator *op) { SpaceText *st = CTX_wm_space_text(C); Text *text = CTX_data_edit_text(C); @@ -1611,7 +1611,7 @@ void TEXT_OT_convert_whitespace(wmOperatorType *ot) /** \name Select All Operator * \{ */ -static int text_select_all_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus text_select_all_exec(bContext *C, wmOperator * /*op*/) { Text *text = CTX_data_edit_text(C); @@ -1643,7 +1643,7 @@ void TEXT_OT_select_all(wmOperatorType *ot) /** \name Select Line Operator * \{ */ -static int text_select_line_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus text_select_line_exec(bContext *C, wmOperator * /*op*/) { Text *text = CTX_data_edit_text(C); @@ -1675,7 +1675,7 @@ void TEXT_OT_select_line(wmOperatorType *ot) /** \name Select Word Operator * \{ */ -static int text_select_word_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus text_select_word_exec(bContext *C, wmOperator * /*op*/) { Text *text = CTX_data_edit_text(C); @@ -1708,7 +1708,7 @@ void TEXT_OT_select_word(wmOperatorType *ot) /** \name Move Lines Operators * \{ */ -static int move_lines_exec(bContext *C, wmOperator *op) +static wmOperatorStatus move_lines_exec(bContext *C, wmOperator *op) { Text *text = CTX_data_edit_text(C); const int direction = RNA_enum_get(op->ptr, "direction"); @@ -2265,7 +2265,7 @@ static void space_text_cursor_skip( } } -static int text_move_cursor(bContext *C, int type, bool select) +static wmOperatorStatus text_move_cursor(bContext *C, int type, bool select) { SpaceText *st = CTX_wm_space_text(C); Text *text = CTX_data_edit_text(C); @@ -2390,7 +2390,7 @@ static int text_move_cursor(bContext *C, int type, bool select) return OPERATOR_FINISHED; } -static int text_move_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_move_exec(bContext *C, wmOperator *op) { int type = RNA_enum_get(op->ptr, "type"); @@ -2418,7 +2418,7 @@ void TEXT_OT_move(wmOperatorType *ot) /** \name Move Select Operator * \{ */ -static int text_move_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_move_select_exec(bContext *C, wmOperator *op) { int type = RNA_enum_get(op->ptr, "type"); @@ -2451,7 +2451,7 @@ void TEXT_OT_move_select(wmOperatorType *ot) /** \name Jump Operator * \{ */ -static int text_jump_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_jump_exec(bContext *C, wmOperator *op) { Text *text = CTX_data_edit_text(C); int line = RNA_int_get(op->ptr, "line"); @@ -2475,7 +2475,7 @@ static int text_jump_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int text_jump_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus text_jump_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { return WM_operator_props_dialog_popup(C, op, 200, IFACE_("Jump to Line Number")); } @@ -2512,7 +2512,7 @@ static const EnumPropertyItem delete_type_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int text_delete_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_delete_exec(bContext *C, wmOperator *op) { SpaceText *st = CTX_wm_space_text(C); Text *text = CTX_data_edit_text(C); @@ -2633,7 +2633,7 @@ void TEXT_OT_delete(wmOperatorType *ot) /** \name Toggle Overwrite Operator * \{ */ -static int text_toggle_overwrite_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus text_toggle_overwrite_exec(bContext *C, wmOperator * /*op*/) { SpaceText *st = CTX_wm_space_text(C); @@ -2731,7 +2731,7 @@ static bool text_scroll_poll(bContext *C) return CTX_data_edit_text(C) != nullptr; } -static int text_scroll_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_scroll_exec(bContext *C, wmOperator *op) { SpaceText *st = CTX_wm_space_text(C); ARegion *region = CTX_wm_region(C); @@ -2856,7 +2856,7 @@ static void scroll_exit(bContext *C, wmOperator *op) MEM_freeN(op->customdata); } -static int text_scroll_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus text_scroll_modal(bContext *C, wmOperator *op, const wmEvent *event) { TextScroll *tsc = static_cast(op->customdata); SpaceText *st = CTX_wm_space_text(C); @@ -2893,7 +2893,7 @@ static void text_scroll_cancel(bContext *C, wmOperator *op) scroll_exit(C, op); } -static int text_scroll_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus text_scroll_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceText *st = CTX_wm_space_text(C); ARegion *region = CTX_wm_region(C); @@ -2982,7 +2982,7 @@ static bool text_region_scroll_poll(bContext *C) return true; } -static int text_scroll_bar_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus text_scroll_bar_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceText *st = CTX_wm_space_text(C); ARegion *region = CTX_wm_region(C); @@ -3392,7 +3392,9 @@ static void text_cursor_set_exit(bContext *C, wmOperator *op) MEM_freeN(ssel); } -static int text_selection_set_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus text_selection_set_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { SpaceText *st = CTX_wm_space_text(C); SetSelection *ssel; @@ -3417,7 +3419,7 @@ static int text_selection_set_invoke(bContext *C, wmOperator *op, const wmEvent return OPERATOR_RUNNING_MODAL; } -static int text_selection_set_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus text_selection_set_modal(bContext *C, wmOperator *op, const wmEvent *event) { switch (event->type) { case LEFTMOUSE: @@ -3459,7 +3461,7 @@ void TEXT_OT_selection_set(wmOperatorType *ot) /** \name Set Cursor Operator * \{ */ -static int text_cursor_set_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_cursor_set_exec(bContext *C, wmOperator *op) { SpaceText *st = CTX_wm_space_text(C); ARegion *region = CTX_wm_region(C); @@ -3474,7 +3476,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, const wmEvent *event) +static wmOperatorStatus text_cursor_set_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceText *st = CTX_wm_space_text(C); @@ -3511,7 +3513,9 @@ void TEXT_OT_cursor_set(wmOperatorType *ot) /** \name Line Number Operator * \{ */ -static int text_line_number_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus text_line_number_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { SpaceText *st = CTX_wm_space_text(C); Text *text = CTX_data_edit_text(C); @@ -3574,7 +3578,7 @@ void TEXT_OT_line_number(wmOperatorType *ot) /** \name Insert Operator * \{ */ -static int text_insert_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_insert_exec(bContext *C, wmOperator *op) { SpaceText *st = CTX_wm_space_text(C); Text *text = CTX_data_edit_text(C); @@ -3617,10 +3621,10 @@ static int text_insert_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int text_insert_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus text_insert_invoke(bContext *C, wmOperator *op, const wmEvent *event) { SpaceText *st = CTX_wm_space_text(C); - int ret; + wmOperatorStatus ret; /* Auto-close variables. */ bool do_auto_close = false; @@ -3775,7 +3779,7 @@ enum { TEXT_REPLACE = 1, }; -static int text_find_and_replace(bContext *C, wmOperator *op, short mode) +static wmOperatorStatus text_find_and_replace(bContext *C, wmOperator *op, short mode) { Main *bmain = CTX_data_main(C); SpaceText *st = CTX_wm_space_text(C); @@ -3846,7 +3850,7 @@ static int text_find_and_replace(bContext *C, wmOperator *op, short mode) return OPERATOR_FINISHED; } -static int text_find_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_find_exec(bContext *C, wmOperator *op) { return text_find_and_replace(C, op, TEXT_FIND); } @@ -3869,7 +3873,7 @@ void TEXT_OT_find(wmOperatorType *ot) /** \name Replace Operator * \{ */ -static int text_replace_all(bContext *C) +static wmOperatorStatus text_replace_all(bContext *C) { SpaceText *st = CTX_wm_space_text(C); Text *text = st->text; @@ -3911,7 +3915,7 @@ static int text_replace_all(bContext *C) return OPERATOR_FINISHED; } -static int text_replace_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_replace_exec(bContext *C, wmOperator *op) { bool replace_all = RNA_boolean_get(op->ptr, "all"); if (replace_all) { @@ -3946,7 +3950,7 @@ void TEXT_OT_replace(wmOperatorType *ot) /** \name Find Set Selected * \{ */ -static int text_find_set_selected_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_find_set_selected_exec(bContext *C, wmOperator *op) { SpaceText *st = CTX_wm_space_text(C); Text *text = CTX_data_edit_text(C); @@ -3981,7 +3985,7 @@ void TEXT_OT_find_set_selected(wmOperatorType *ot) /** \name Replace Set Selected * \{ */ -static int text_replace_set_selected_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus text_replace_set_selected_exec(bContext *C, wmOperator * /*op*/) { SpaceText *st = CTX_wm_space_text(C); Text *text = CTX_data_edit_text(C); @@ -4096,7 +4100,7 @@ static bool text_jump_to_file_at_point_internal(bContext *C, return true; } -static int text_jump_to_file_at_point_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_jump_to_file_at_point_exec(bContext *C, wmOperator *op) { PropertyRNA *prop_filepath = RNA_struct_find_property(op->ptr, "filepath"); PropertyRNA *prop_line = RNA_struct_find_property(op->ptr, "line"); @@ -4191,7 +4195,7 @@ static bool text_resolve_conflict_poll(bContext *C) return ((text->filepath != nullptr) && !(text->flags & TXT_ISMEM)); } -static int text_resolve_conflict_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_resolve_conflict_exec(bContext *C, wmOperator *op) { Text *text = CTX_data_edit_text(C); int resolution = RNA_enum_get(op->ptr, "resolution"); @@ -4211,7 +4215,9 @@ static int text_resolve_conflict_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int text_resolve_conflict_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus text_resolve_conflict_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Text *text = CTX_data_edit_text(C); uiPopupMenu *pup; @@ -4305,7 +4311,7 @@ void TEXT_OT_resolve_conflict(wmOperatorType *ot) /** \name To 3D Object Operator * \{ */ -static int text_to_3d_object_exec(bContext *C, wmOperator *op) +static wmOperatorStatus text_to_3d_object_exec(bContext *C, wmOperator *op) { const Text *text = CTX_data_edit_text(C); const bool split_lines = RNA_boolean_get(op->ptr, "split_lines"); diff --git a/source/blender/editors/space_userpref/userpref_ops.cc b/source/blender/editors/space_userpref/userpref_ops.cc index e978edec6de..8c68a5aa46b 100644 --- a/source/blender/editors/space_userpref/userpref_ops.cc +++ b/source/blender/editors/space_userpref/userpref_ops.cc @@ -50,7 +50,7 @@ /** \name Reset Default Theme Operator * \{ */ -static int preferences_reset_default_theme_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus preferences_reset_default_theme_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); UI_theme_init_default(); @@ -81,7 +81,7 @@ static void PREFERENCES_OT_reset_default_theme(wmOperatorType *ot) /** \name Add Auto-Execution Path Operator * \{ */ -static int preferences_autoexec_add_exec(bContext * /*C*/, wmOperator * /*op*/) +static wmOperatorStatus preferences_autoexec_add_exec(bContext * /*C*/, wmOperator * /*op*/) { bPathCompare *path_cmp = static_cast( MEM_callocN(sizeof(bPathCompare), "bPathCompare")); @@ -107,7 +107,7 @@ static void PREFERENCES_OT_autoexec_path_add(wmOperatorType *ot) /** \name Remove Auto-Execution Path Operator * \{ */ -static int preferences_autoexec_remove_exec(bContext * /*C*/, wmOperator *op) +static wmOperatorStatus preferences_autoexec_remove_exec(bContext * /*C*/, wmOperator *op) { const int index = RNA_int_get(op->ptr, "index"); bPathCompare *path_cmp = static_cast(BLI_findlink(&U.autoexec_paths, index)); @@ -137,7 +137,7 @@ static void PREFERENCES_OT_autoexec_path_remove(wmOperatorType *ot) /** \name Add Asset Library Operator * \{ */ -static int preferences_asset_library_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus preferences_asset_library_add_exec(bContext *C, wmOperator *op) { char *path = RNA_string_get_alloc(op->ptr, "directory", nullptr, 0, nullptr); char dirname[FILE_MAXFILE]; @@ -159,9 +159,9 @@ static int preferences_asset_library_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int preferences_asset_library_add_invoke(bContext *C, - wmOperator *op, - const wmEvent * /*event*/) +static wmOperatorStatus preferences_asset_library_add_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (!RNA_struct_property_is_set(op->ptr, "directory")) { WM_event_add_fileselect(C, op); @@ -206,7 +206,7 @@ static bool preferences_asset_library_remove_poll(bContext *C) return true; } -static int preferences_asset_library_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus preferences_asset_library_remove_exec(bContext *C, wmOperator *op) { const int index = RNA_int_get(op->ptr, "index"); bUserAssetLibrary *library = static_cast( @@ -269,7 +269,7 @@ static const char *preferences_extension_repo_default_name_from_type( return ""; } -static int preferences_extension_repo_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus preferences_extension_repo_add_exec(bContext *C, wmOperator *op) { const bUserExtensionRepoAddType repo_type = bUserExtensionRepoAddType( RNA_enum_get(op->ptr, "type")); @@ -401,7 +401,9 @@ static int preferences_extension_repo_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int preferences_extension_repo_add_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus preferences_extension_repo_add_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { const bUserExtensionRepoAddType repo_type = bUserExtensionRepoAddType( RNA_enum_get(op->ptr, "type")); @@ -606,9 +608,9 @@ static bool preferences_extension_repo_remove_poll(bContext *C) return true; } -static int preferences_extension_repo_remove_invoke(bContext *C, - wmOperator *op, - const wmEvent * /*event*/) +static wmOperatorStatus preferences_extension_repo_remove_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { const int index = RNA_int_get(op->ptr, "index"); bool remove_files = RNA_boolean_get(op->ptr, "remove_files"); @@ -660,7 +662,7 @@ static int preferences_extension_repo_remove_invoke(bContext *C, C, op, nullptr, message.c_str(), confirm_text, ALERT_ICON_WARNING, true); } -static int preferences_extension_repo_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus preferences_extension_repo_remove_exec(bContext *C, wmOperator *op) { const int index = RNA_int_get(op->ptr, "index"); bool remove_files = RNA_boolean_get(op->ptr, "remove_files"); @@ -778,7 +780,9 @@ static void PREFERENCES_OT_extension_repo_remove(wmOperatorType *ot) /** \name Drop Extension Operator * \{ */ -static int preferences_extension_url_drop_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus preferences_extension_url_drop_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { char *url = RNA_string_get_alloc(op->ptr, "url", nullptr, 0, nullptr); const bool url_is_file = STRPREFIX(url, "file://"); @@ -797,7 +801,7 @@ static int preferences_extension_url_drop_invoke(bContext *C, wmOperator *op, co } wmOperatorType *ot = WM_operatortype_find(idname_external, true); - int retval; + wmOperatorStatus retval; if (ot) { PointerRNA props_ptr; WM_operator_properties_create_ptr(&props_ptr, ot); @@ -870,7 +874,7 @@ static bool associate_blend(bool do_register, bool all_users, char **r_error_msg } #endif -static int associate_blend_exec(bContext * /*C*/, wmOperator *op) +static wmOperatorStatus associate_blend_exec(bContext * /*C*/, wmOperator *op) { #ifdef __APPLE__ UNUSED_VARS(op); @@ -919,7 +923,7 @@ static void PREFERENCES_OT_associate_blend(wmOperatorType *ot) ot->poll = associate_blend_poll; } -static int unassociate_blend_exec(bContext * /*C*/, wmOperator *op) +static wmOperatorStatus unassociate_blend_exec(bContext * /*C*/, wmOperator *op) { #ifdef __APPLE__ UNUSED_VARS(op); diff --git a/source/blender/editors/space_view3d/view3d_buttons.cc b/source/blender/editors/space_view3d/view3d_buttons.cc index 03bf3138ba4..bec4bd1c103 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.cc +++ b/source/blender/editors/space_view3d/view3d_buttons.cc @@ -1794,7 +1794,7 @@ void view3d_buttons_register(ARegionType *art) WM_menutype_add(mt); } -static int view3d_object_mode_menu_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view3d_object_mode_menu_exec(bContext *C, wmOperator *op) { Object *ob = CTX_data_active_object(C); if (ob == nullptr) { diff --git a/source/blender/editors/space_view3d/view3d_edit.cc b/source/blender/editors/space_view3d/view3d_edit.cc index 4853efe279f..0cdd82d5418 100644 --- a/source/blender/editors/space_view3d/view3d_edit.cc +++ b/source/blender/editors/space_view3d/view3d_edit.cc @@ -79,7 +79,7 @@ static bool view3d_lock_poll(bContext *C) /** \name View Lock Clear Operator * \{ */ -static int view_lock_clear_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus view_lock_clear_exec(bContext *C, wmOperator * /*op*/) { View3D *v3d = CTX_wm_view3d(C); @@ -116,7 +116,7 @@ void VIEW3D_OT_view_lock_clear(wmOperatorType *ot) /** \name View Lock to Active Operator * \{ */ -static int view_lock_to_active_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus view_lock_to_active_exec(bContext *C, wmOperator * /*op*/) { View3D *v3d = CTX_wm_view3d(C); Object *obact = CTX_data_active_object(C); @@ -173,7 +173,7 @@ void VIEW3D_OT_view_lock_to_active(wmOperatorType *ot) /** \name Frame Camera Bounds Operator * \{ */ -static int view3d_center_camera_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus view3d_center_camera_exec(bContext *C, wmOperator * /*op*/) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Scene *scene = CTX_data_scene(C); @@ -225,7 +225,7 @@ void VIEW3D_OT_view_center_camera(wmOperatorType *ot) /** \name View Lock Center Operator * \{ */ -static int view3d_center_lock_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus view3d_center_lock_exec(bContext *C, wmOperator * /*op*/) { RegionView3D *rv3d = CTX_wm_region_view3d(C); @@ -257,7 +257,7 @@ void VIEW3D_OT_view_center_lock(wmOperatorType *ot) /** \name Set Render Border Operator * \{ */ -static int render_border_exec(bContext *C, wmOperator *op) +static wmOperatorStatus render_border_exec(bContext *C, wmOperator *op) { View3D *v3d = CTX_wm_view3d(C); ARegion *region = CTX_wm_region(C); @@ -361,7 +361,7 @@ void VIEW3D_OT_render_border(wmOperatorType *ot) /** \name Clear Render Border Operator * \{ */ -static int clear_render_border_exec(bContext *C, wmOperator *op) +static wmOperatorStatus clear_render_border_exec(bContext *C, wmOperator *op) { View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d = ED_view3d_context_rv3d(C); @@ -436,7 +436,7 @@ static void view3d_set_1_to_1_viewborder(Scene *scene, CLAMP(rv3d->camzoom, RV3D_CAMZOOM_MIN, RV3D_CAMZOOM_MAX); } -static int view3d_zoom_1_to_1_camera_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus view3d_zoom_1_to_1_camera_exec(bContext *C, wmOperator * /*op*/) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Scene *scene = CTX_data_scene(C); @@ -478,7 +478,7 @@ void VIEW3D_OT_zoom_camera_1_to_1(wmOperatorType *ot) /** \name View Toggle Perspective/Orthographic Operator * \{ */ -static int viewpersportho_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus viewpersportho_exec(bContext *C, wmOperator * /*op*/) { View3D *v3d; ARegion *region; @@ -527,7 +527,9 @@ void VIEW3D_OT_view_persportho(wmOperatorType *ot) * Wraps walk/fly modes. * \{ */ -static int view3d_navigate_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus view3d_navigate_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { eViewNavigation_Method mode = eViewNavigation_Method(U.navigation_mode); @@ -577,7 +579,7 @@ static Camera *background_image_camera_from_context(bContext *C) return static_cast(CTX_data_pointer_get_type(C, "camera", &RNA_Camera).data); } -static int camera_background_image_add_exec(bContext *C, wmOperator *op) +static wmOperatorStatus camera_background_image_add_exec(bContext *C, wmOperator *op) { Camera *cam = background_image_camera_from_context(C); Image *ima; @@ -636,7 +638,7 @@ void VIEW3D_OT_camera_background_image_add(wmOperatorType *ot) /** \name Background Image Remove Operator * \{ */ -static int camera_background_image_remove_exec(bContext *C, wmOperator *op) +static wmOperatorStatus camera_background_image_remove_exec(bContext *C, wmOperator *op) { Camera *cam = static_cast(CTX_data_pointer_get_type(C, "camera", &RNA_Camera).data); const int index = RNA_int_get(op->ptr, "index"); @@ -693,7 +695,7 @@ void VIEW3D_OT_camera_background_image_remove(wmOperatorType *ot) /** \name Drop World Operator * \{ */ -static int drop_world_exec(bContext *C, wmOperator *op) +static wmOperatorStatus drop_world_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -770,7 +772,7 @@ void ED_view3d_clipping_local(RegionView3D *rv3d, const float mat[4][4]) } } -static int view3d_clipping_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view3d_clipping_exec(bContext *C, wmOperator *op) { ARegion *region = CTX_wm_region(C); RegionView3D *rv3d = CTX_wm_region_view3d(C); @@ -787,7 +789,7 @@ static int view3d_clipping_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int view3d_clipping_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus view3d_clipping_invoke(bContext *C, wmOperator *op, const wmEvent *event) { RegionView3D *rv3d = CTX_wm_region_view3d(C); ARegion *region = CTX_wm_region(C); @@ -1073,7 +1075,7 @@ void ED_view3d_cursor3d_update(bContext *C, DEG_id_tag_update(&scene->id, ID_RECALC_SYNC_TO_EVAL); } -static int view3d_cursor3d_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus view3d_cursor3d_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bool use_depth = (U.uiflag & USER_DEPTH_CURSOR); { @@ -1148,7 +1150,7 @@ static const EnumPropertyItem prop_shading_type_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int toggle_shading_exec(bContext *C, wmOperator *op) +static wmOperatorStatus toggle_shading_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); View3D *v3d = CTX_wm_view3d(C); @@ -1210,7 +1212,7 @@ void VIEW3D_OT_toggle_shading(wmOperatorType *ot) /** \name Toggle XRay * \{ */ -static int toggle_xray_exec(bContext *C, wmOperator *op) +static wmOperatorStatus toggle_xray_exec(bContext *C, wmOperator *op) { View3D *v3d = CTX_wm_view3d(C); ScrArea *area = CTX_wm_area(C); diff --git a/source/blender/editors/space_view3d/view3d_gizmo_preselect_type.cc b/source/blender/editors/space_view3d/view3d_gizmo_preselect_type.cc index 79b0d33fe8d..dd90af4cab4 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_preselect_type.cc +++ b/source/blender/editors/space_view3d/view3d_gizmo_preselect_type.cc @@ -290,9 +290,9 @@ static void gizmo_preselect_elem_free(wmGizmo *gz) gz_ele->bases.~Vector(); } -static int gizmo_preselect_elem_invoke(bContext * /*C*/, - wmGizmo * /*gz*/, - const wmEvent * /*event*/) +static wmOperatorStatus gizmo_preselect_elem_invoke(bContext * /*C*/, + wmGizmo * /*gz*/, + const wmEvent * /*event*/) { return OPERATOR_PASS_THROUGH; } @@ -451,9 +451,9 @@ static void gizmo_preselect_edgering_free(wmGizmo *gz) gz_ring->bases.~Vector(); } -static int gizmo_preselect_edgering_invoke(bContext * /*C*/, - wmGizmo * /*gz*/, - const wmEvent * /*event*/) +static wmOperatorStatus gizmo_preselect_edgering_invoke(bContext * /*C*/, + wmGizmo * /*gz*/, + const wmEvent * /*event*/) { return OPERATOR_PASS_THROUGH; } diff --git a/source/blender/editors/space_view3d/view3d_gizmo_ruler.cc b/source/blender/editors/space_view3d/view3d_gizmo_ruler.cc index 5da0eb3f5b4..ea2617e139b 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_ruler.cc +++ b/source/blender/editors/space_view3d/view3d_gizmo_ruler.cc @@ -1061,13 +1061,13 @@ static int gizmo_ruler_test_select(bContext * /*C*/, wmGizmo *gz, const int mval return -1; } -static int gizmo_ruler_modal(bContext *C, - wmGizmo *gz, - const wmEvent *event, - eWM_GizmoFlagTweak tweak_flag) +static wmOperatorStatus gizmo_ruler_modal(bContext *C, + wmGizmo *gz, + const wmEvent *event, + eWM_GizmoFlagTweak tweak_flag) { bool do_draw = false; - int exit_code = OPERATOR_RUNNING_MODAL; + wmOperatorStatus exit_code = OPERATOR_RUNNING_MODAL; RulerInfo *ruler_info = static_cast(gz->parent_gzgroup->customdata); RulerItem *ruler_item = (RulerItem *)gz; ARegion *region = CTX_wm_region(C); @@ -1137,7 +1137,7 @@ static int gizmo_ruler_modal(bContext *C, return exit_code; } -static int gizmo_ruler_invoke(bContext *C, wmGizmo *gz, const wmEvent *event) +static wmOperatorStatus gizmo_ruler_invoke(bContext *C, wmGizmo *gz, const wmEvent *event) { wmGizmoGroup *gzgroup = gz->parent_gzgroup; RulerInfo *ruler_info = static_cast(gzgroup->customdata); @@ -1360,7 +1360,7 @@ static bool view3d_ruler_poll(bContext *C) return true; } -static int view3d_ruler_add_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus view3d_ruler_add_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); View3D *v3d = CTX_wm_view3d(C); @@ -1437,7 +1437,9 @@ void VIEW3D_OT_ruler_add(wmOperatorType *ot) /** \name Remove Ruler Operator * \{ */ -static int view3d_ruler_remove_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus view3d_ruler_remove_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { ARegion *region = CTX_wm_region(C); View3D *v3d = CTX_wm_view3d(C); diff --git a/source/blender/editors/space_view3d/view3d_header.cc b/source/blender/editors/space_view3d/view3d_header.cc index 5cafa529cf9..af04ef3d1f4 100644 --- a/source/blender/editors/space_view3d/view3d_header.cc +++ b/source/blender/editors/space_view3d/view3d_header.cc @@ -36,7 +36,7 @@ /** \name Toggle Matcap Flip Operator * \{ */ -static int toggle_matcap_flip_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus toggle_matcap_flip_exec(bContext *C, wmOperator * /*op*/) { View3D *v3d = CTX_wm_view3d(C); diff --git a/source/blender/editors/space_view3d/view3d_navigate.cc b/source/blender/editors/space_view3d/view3d_navigate.cc index 5df2c657c85..cd1562ccb51 100644 --- a/source/blender/editors/space_view3d/view3d_navigate.cc +++ b/source/blender/editors/space_view3d/view3d_navigate.cc @@ -535,12 +535,12 @@ static eV3D_OpEvent view3d_navigate_event(ViewOpsData *vod, const wmEvent *event return VIEW_PASS; } -static int view3d_navigation_invoke_generic(bContext *C, - ViewOpsData *vod, - const wmEvent *event, - PointerRNA *ptr, - const ViewOpsType *nav_type, - const float dyn_ofs_override[3]) +static wmOperatorStatus view3d_navigation_invoke_generic(bContext *C, + ViewOpsData *vod, + const wmEvent *event, + PointerRNA *ptr, + const ViewOpsType *nav_type, + const float dyn_ofs_override[3]) { if (!nav_type->init_fn) { return OPERATOR_CANCELLED; @@ -557,14 +557,15 @@ static int view3d_navigation_invoke_generic(bContext *C, return nav_type->init_fn(C, vod, event, ptr); } -int view3d_navigate_invoke_impl(bContext *C, - wmOperator *op, - const wmEvent *event, - const ViewOpsType *nav_type) +wmOperatorStatus view3d_navigate_invoke_impl(bContext *C, + wmOperator *op, + const wmEvent *event, + const ViewOpsType *nav_type) { ViewOpsData *vod = new ViewOpsData(); vod->init_context(C); - int ret = view3d_navigation_invoke_generic(C, vod, event, op->ptr, nav_type, nullptr); + wmOperatorStatus ret = view3d_navigation_invoke_generic( + C, vod, event, op->ptr, nav_type, nullptr); op->customdata = (void *)vod; if (ret == OPERATOR_RUNNING_MODAL) { @@ -605,7 +606,7 @@ bool view3d_zoom_or_dolly_or_rotation_poll(bContext *C) return view3d_navigation_poll_impl(C, RV3D_LOCK_ZOOM_AND_DOLLY | RV3D_LOCK_ROTATION); } -int view3d_navigate_modal_fn(bContext *C, wmOperator *op, const wmEvent *event) +wmOperatorStatus view3d_navigate_modal_fn(bContext *C, wmOperator *op, const wmEvent *event) { ViewOpsData *vod = static_cast(op->customdata); @@ -618,7 +619,7 @@ int view3d_navigate_modal_fn(bContext *C, wmOperator *op, const wmEvent *event) return view3d_navigation_invoke_generic(C, vod, event, op->ptr, vod->nav_type, nullptr); } - int ret = vod->nav_type->apply_fn(C, vod, event_code, event->xy); + wmOperatorStatus ret = vod->nav_type->apply_fn(C, vod, event_code, event->xy); if ((ret & OPERATOR_RUNNING_MODAL) == 0) { if (ret & OPERATOR_FINISHED) { diff --git a/source/blender/editors/space_view3d/view3d_navigate.hh b/source/blender/editors/space_view3d/view3d_navigate.hh index ff712ec0e20..8c398662f1e 100644 --- a/source/blender/editors/space_view3d/view3d_navigate.hh +++ b/source/blender/editors/space_view3d/view3d_navigate.hh @@ -16,6 +16,8 @@ #include "BLI_math_vector_types.hh" #include "BLI_utildefines.h" +#include "DNA_windowmanager_enums.h" + /** * Size of the sphere being dragged for trackball rotation within the view bounds. * also affects speed (smaller is faster). @@ -93,8 +95,14 @@ struct ViewOpsType { eViewOpsFlag flag; const char *idname; bool (*poll_fn)(bContext *C); - int (*init_fn)(bContext *C, ViewOpsData *vod, const wmEvent *event, PointerRNA *ptr); - int (*apply_fn)(bContext *C, ViewOpsData *vod, const eV3D_OpEvent event_code, const int xy[2]); + wmOperatorStatus (*init_fn)(bContext *C, + ViewOpsData *vod, + const wmEvent *event, + PointerRNA *ptr); + wmOperatorStatus (*apply_fn)(bContext *C, + ViewOpsData *vod, + const eV3D_OpEvent event_code, + const int xy[2]); }; /** Generic View Operator Custom-Data */ @@ -207,11 +215,11 @@ bool view3d_rotation_poll(bContext *C); bool view3d_zoom_or_dolly_poll(bContext *C); bool view3d_zoom_or_dolly_or_rotation_poll(bContext *C); -int view3d_navigate_invoke_impl(bContext *C, - wmOperator *op, - const wmEvent *event, - const ViewOpsType *nav_type); -int view3d_navigate_modal_fn(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus view3d_navigate_invoke_impl(bContext *C, + wmOperator *op, + const wmEvent *event, + const ViewOpsType *nav_type); +wmOperatorStatus view3d_navigate_modal_fn(bContext *C, wmOperator *op, const wmEvent *event); void view3d_navigate_cancel_fn(bContext *C, wmOperator *op); void calctrackballvec(const rcti *rect, const int event_xy[2], float r_dir[3]); diff --git a/source/blender/editors/space_view3d/view3d_navigate_fly.cc b/source/blender/editors/space_view3d/view3d_navigate_fly.cc index 484ebb19650..ac653edcf09 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_fly.cc +++ b/source/blender/editors/space_view3d/view3d_navigate_fly.cc @@ -418,7 +418,7 @@ static bool initFlyInfo(bContext *C, FlyInfo *fly, wmOperator *op, const wmEvent return true; } -static int flyEnd(bContext *C, FlyInfo *fly) +static wmOperatorStatus flyEnd(bContext *C, FlyInfo *fly) { wmWindow *win; RegionView3D *rv3d; @@ -1099,7 +1099,7 @@ static void fly_draw_status(bContext *C, wmOperator *op) status.item(fmt::format("{} ({:.2f})", IFACE_("Acceleration"), fly->speed), ICON_NONE); } -static int fly_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus fly_invoke(bContext *C, wmOperator *op, const wmEvent *event) { RegionView3D *rv3d = CTX_wm_region_view3d(C); @@ -1134,9 +1134,9 @@ static void fly_cancel(bContext *C, wmOperator *op) op->customdata = nullptr; } -static int fly_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus fly_modal(bContext *C, wmOperator *op, const wmEvent *event) { - int exit_code; + wmOperatorStatus exit_code; bool do_draw = false; FlyInfo *fly = static_cast(op->customdata); View3D *v3d = fly->v3d; diff --git a/source/blender/editors/space_view3d/view3d_navigate_smoothview.cc b/source/blender/editors/space_view3d/view3d_navigate_smoothview.cc index 696da77b195..ccaeb49f335 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_smoothview.cc +++ b/source/blender/editors/space_view3d/view3d_navigate_smoothview.cc @@ -525,7 +525,9 @@ static void view3d_smoothview_apply_from_timer(bContext *C, View3D *v3d, ARegion ED_region_tag_redraw(region); } -static int view3d_smoothview_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus view3d_smoothview_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { View3D *v3d = CTX_wm_view3d(C); ARegion *region = CTX_wm_region(C); diff --git a/source/blender/editors/space_view3d/view3d_navigate_view_all.cc b/source/blender/editors/space_view3d/view3d_navigate_view_all.cc index 494b6460ca0..083cf3c4843 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_view_all.cc +++ b/source/blender/editors/space_view3d/view3d_navigate_view_all.cc @@ -415,7 +415,7 @@ bool view3d_calc_point_in_selected_bounds(Depsgraph *depsgraph, * Move & Zoom the view to fit all of its contents. * \{ */ -static int view3d_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view3d_all_exec(bContext *C, wmOperator *op) { ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); @@ -500,7 +500,7 @@ void VIEW3D_OT_view_all(wmOperatorType *ot) * Move & Zoom the view to fit selected contents. * \{ */ -static int viewselected_exec(bContext *C, wmOperator *op) +static wmOperatorStatus viewselected_exec(bContext *C, wmOperator *op) { ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); diff --git a/source/blender/editors/space_view3d/view3d_navigate_view_axis.cc b/source/blender/editors/space_view3d/view3d_navigate_view_axis.cc index ba8e9670542..231bdf00f0c 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_view_axis.cc +++ b/source/blender/editors/space_view3d/view3d_navigate_view_axis.cc @@ -42,7 +42,7 @@ static const EnumPropertyItem prop_view_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int view_axis_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_axis_exec(bContext *C, wmOperator *op) { View3D *v3d; ARegion *region; diff --git a/source/blender/editors/space_view3d/view3d_navigate_view_camera.cc b/source/blender/editors/space_view3d/view3d_navigate_view_camera.cc index c83bad7f76d..a3fc15de7d7 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_view_camera.cc +++ b/source/blender/editors/space_view3d/view3d_navigate_view_camera.cc @@ -21,7 +21,7 @@ /** \name View Camera Operator * \{ */ -static int view_camera_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view_camera_exec(bContext *C, wmOperator *op) { View3D *v3d; ARegion *region; diff --git a/source/blender/editors/space_view3d/view3d_navigate_view_center_cursor.cc b/source/blender/editors/space_view3d/view3d_navigate_view_center_cursor.cc index d1aee3f6579..79de372d095 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_view_center_cursor.cc +++ b/source/blender/editors/space_view3d/view3d_navigate_view_center_cursor.cc @@ -20,7 +20,7 @@ /** \name View Center Cursor Operator * \{ */ -static int viewcenter_cursor_exec(bContext *C, wmOperator *op) +static wmOperatorStatus viewcenter_cursor_exec(bContext *C, wmOperator *op) { View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d = CTX_wm_region_view3d(C); diff --git a/source/blender/editors/space_view3d/view3d_navigate_view_center_pick.cc b/source/blender/editors/space_view3d/view3d_navigate_view_center_pick.cc index 2a0da38bf2d..5de992d5e0d 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_view_center_pick.cc +++ b/source/blender/editors/space_view3d/view3d_navigate_view_center_pick.cc @@ -20,7 +20,7 @@ /** \name View Center Pick Operator * \{ */ -static int viewcenter_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus viewcenter_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) { View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d = CTX_wm_region_view3d(C); diff --git a/source/blender/editors/space_view3d/view3d_navigate_view_dolly.cc b/source/blender/editors/space_view3d/view3d_navigate_view_dolly.cc index 72f29466102..91e9f3fc118 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_view_dolly.cc +++ b/source/blender/editors/space_view3d/view3d_navigate_view_dolly.cc @@ -109,12 +109,12 @@ static void viewdolly_apply(ViewOpsData *vod, const int xy[2], const bool zoom_i ED_region_tag_redraw(vod->region); } -static int viewdolly_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus viewdolly_modal(bContext *C, wmOperator *op, const wmEvent *event) { ViewOpsData *vod = static_cast(op->customdata); short event_code = VIEW_PASS; bool use_autokey = false; - int ret = OPERATOR_RUNNING_MODAL; + wmOperatorStatus ret = OPERATOR_RUNNING_MODAL; /* Execute the events. */ if (event->type == EVT_MODAL_MAP) { @@ -183,7 +183,7 @@ static int viewdolly_modal(bContext *C, wmOperator *op, const wmEvent *event) return ret; } -static int viewdolly_exec(bContext *C, wmOperator *op) +static wmOperatorStatus viewdolly_exec(bContext *C, wmOperator *op) { View3D *v3d; RegionView3D *rv3d; @@ -234,7 +234,7 @@ static int viewdolly_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int viewdolly_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus viewdolly_invoke(bContext *C, wmOperator *op, const wmEvent *event) { /* Near duplicate logic in #viewzoom_invoke(), changes here may apply there too. */ diff --git a/source/blender/editors/space_view3d/view3d_navigate_view_move.cc b/source/blender/editors/space_view3d/view3d_navigate_view_move.cc index 80b337b46a8..1333dc578d1 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_view_move.cc +++ b/source/blender/editors/space_view3d/view3d_navigate_view_move.cc @@ -46,13 +46,13 @@ void viewmove_modal_keymap(wmKeyConfig *keyconf) WM_modalkeymap_assign(keymap, "VIEW3D_OT_move"); } -static int viewmove_modal_impl(bContext *C, - ViewOpsData *vod, - const eV3D_OpEvent event_code, - const int xy[2]) +static wmOperatorStatus viewmove_modal_impl(bContext *C, + ViewOpsData *vod, + const eV3D_OpEvent event_code, + const int xy[2]) { bool use_autokey = false; - int ret = OPERATOR_RUNNING_MODAL; + wmOperatorStatus ret = OPERATOR_RUNNING_MODAL; switch (event_code) { case VIEW_APPLY: { @@ -83,10 +83,10 @@ static int viewmove_modal_impl(bContext *C, return ret; } -static int viewmove_invoke_impl(bContext * /*C*/, - ViewOpsData *vod, - const wmEvent *event, - PointerRNA * /*ptr*/) +static wmOperatorStatus viewmove_invoke_impl(bContext * /*C*/, + ViewOpsData *vod, + const wmEvent *event, + PointerRNA * /*ptr*/) { eV3D_OpEvent event_code = event->type == MOUSEPAN ? VIEW_CONFIRM : VIEW_PASS; @@ -101,7 +101,7 @@ static int viewmove_invoke_impl(bContext * /*C*/, return OPERATOR_RUNNING_MODAL; } -static int viewmove_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus viewmove_invoke(bContext *C, wmOperator *op, const wmEvent *event) { return view3d_navigate_invoke_impl(C, op, event, &ViewOpsType_move); } diff --git a/source/blender/editors/space_view3d/view3d_navigate_view_ndof.cc b/source/blender/editors/space_view3d/view3d_navigate_view_ndof.cc index 4fe9b1d0b0f..cc2f7016dc5 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_view_ndof.cc +++ b/source/blender/editors/space_view3d/view3d_navigate_view_ndof.cc @@ -579,7 +579,8 @@ static std::optional ndof_orbit_center_calc(Depsgraph *depsgraph, * 2D orthographic style NDOF navigation within the camera view. * Support navigating the camera view instead of leaving the camera-view and navigating in 3D. */ -static int view3d_ndof_cameraview_pan_zoom(ViewOpsData *vod, const wmNDOFMotionData *ndof) +static wmOperatorStatus view3d_ndof_cameraview_pan_zoom(ViewOpsData *vod, + const wmNDOFMotionData *ndof) { View3D *v3d = vod->v3d; ARegion *region = vod->region; @@ -643,10 +644,10 @@ static int view3d_ndof_cameraview_pan_zoom(ViewOpsData *vod, const wmNDOFMotionD /** \name NDOF Orbit/Translate Operator * \{ */ -static int ndof_orbit_invoke_impl(bContext *C, - ViewOpsData *vod, - const wmEvent *event, - PointerRNA * /*ptr*/) +static wmOperatorStatus ndof_orbit_invoke_impl(bContext *C, + ViewOpsData *vod, + const wmEvent *event, + PointerRNA * /*ptr*/) { if (event->type != NDOF_MOTION) { return OPERATOR_CANCELLED; @@ -691,7 +692,7 @@ static int ndof_orbit_invoke_impl(bContext *C, return OPERATOR_FINISHED; } -static int ndof_orbit_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus ndof_orbit_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (event->type != NDOF_MOTION) { return OPERATOR_CANCELLED; @@ -721,10 +722,10 @@ void VIEW3D_OT_ndof_orbit(wmOperatorType *ot) /** \name NDOF Orbit/Zoom Operator * \{ */ -static int ndof_orbit_zoom_invoke_impl(bContext *C, - ViewOpsData *vod, - const wmEvent *event, - PointerRNA * /*ptr*/) +static wmOperatorStatus ndof_orbit_zoom_invoke_impl(bContext *C, + ViewOpsData *vod, + const wmEvent *event, + PointerRNA * /*ptr*/) { if (event->type != NDOF_MOTION) { return OPERATOR_CANCELLED; @@ -733,7 +734,7 @@ static int ndof_orbit_zoom_invoke_impl(bContext *C, const wmNDOFMotionData *ndof = static_cast(event->customdata); if (U.ndof_flag & NDOF_CAMERA_PAN_ZOOM) { - const int camera_retval = view3d_ndof_cameraview_pan_zoom(vod, ndof); + const wmOperatorStatus camera_retval = view3d_ndof_cameraview_pan_zoom(vod, ndof); if (camera_retval != OPERATOR_PASS_THROUGH) { return camera_retval; } @@ -820,7 +821,7 @@ static int ndof_orbit_zoom_invoke_impl(bContext *C, return OPERATOR_FINISHED; } -static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (event->type != NDOF_MOTION) { return OPERATOR_CANCELLED; @@ -850,10 +851,10 @@ void VIEW3D_OT_ndof_orbit_zoom(wmOperatorType *ot) /** \name NDOF Pan/Zoom Operator * \{ */ -static int ndof_pan_invoke_impl(bContext *C, - ViewOpsData *vod, - const wmEvent *event, - PointerRNA * /*ptr*/) +static wmOperatorStatus ndof_pan_invoke_impl(bContext *C, + ViewOpsData *vod, + const wmEvent *event, + PointerRNA * /*ptr*/) { if (event->type != NDOF_MOTION) { return OPERATOR_CANCELLED; @@ -862,7 +863,7 @@ static int ndof_pan_invoke_impl(bContext *C, const wmNDOFMotionData *ndof = static_cast(event->customdata); if (U.ndof_flag & NDOF_CAMERA_PAN_ZOOM) { - const int camera_retval = view3d_ndof_cameraview_pan_zoom(vod, ndof); + const wmOperatorStatus camera_retval = view3d_ndof_cameraview_pan_zoom(vod, ndof); if (camera_retval != OPERATOR_PASS_THROUGH) { return camera_retval; } @@ -905,7 +906,7 @@ static int ndof_pan_invoke_impl(bContext *C, return OPERATOR_FINISHED; } -static int ndof_pan_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus ndof_pan_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (event->type != NDOF_MOTION) { return OPERATOR_CANCELLED; @@ -938,14 +939,14 @@ void VIEW3D_OT_ndof_pan(wmOperatorType *ot) /** * wraps #ndof_orbit_zoom but never restrict to orbit. */ -static int ndof_all_invoke_impl(bContext *C, - ViewOpsData *vod, - const wmEvent *event, - PointerRNA * /*ptr*/) +static wmOperatorStatus ndof_all_invoke_impl(bContext *C, + ViewOpsData *vod, + const wmEvent *event, + PointerRNA * /*ptr*/) { /* weak!, but it works */ const int ndof_flag = U.ndof_flag; - int ret; + wmOperatorStatus ret; U.ndof_flag &= ~NDOF_MODE_ORBIT; @@ -956,7 +957,7 @@ static int ndof_all_invoke_impl(bContext *C, return ret; } -static int ndof_all_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus ndof_all_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (event->type != NDOF_MOTION) { return OPERATOR_CANCELLED; diff --git a/source/blender/editors/space_view3d/view3d_navigate_view_orbit.cc b/source/blender/editors/space_view3d/view3d_navigate_view_orbit.cc index 1ae923fa9dc..8509171f704 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_view_orbit.cc +++ b/source/blender/editors/space_view3d/view3d_navigate_view_orbit.cc @@ -41,7 +41,7 @@ static const EnumPropertyItem prop_view_orbit_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int vieworbit_exec(bContext *C, wmOperator *op) +static wmOperatorStatus vieworbit_exec(bContext *C, wmOperator *op) { float angle; { diff --git a/source/blender/editors/space_view3d/view3d_navigate_view_pan.cc b/source/blender/editors/space_view3d/view3d_navigate_view_pan.cc index 52953e3d0b2..dd00df65cfa 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_view_pan.cc +++ b/source/blender/editors/space_view3d/view3d_navigate_view_pan.cc @@ -36,10 +36,10 @@ static const EnumPropertyItem prop_view_pan_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int viewpan_invoke_impl(bContext * /*C*/, - ViewOpsData *vod, - const wmEvent * /*event*/, - PointerRNA *ptr) +static wmOperatorStatus viewpan_invoke_impl(bContext * /*C*/, + ViewOpsData *vod, + const wmEvent * /*event*/, + PointerRNA *ptr) { int x = 0, y = 0; int pandir = RNA_enum_get(ptr, "type"); @@ -62,7 +62,7 @@ static int viewpan_invoke_impl(bContext * /*C*/, return OPERATOR_FINISHED; } -static int viewpan_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus viewpan_invoke(bContext *C, wmOperator *op, const wmEvent *event) { return view3d_navigate_invoke_impl(C, op, event, &ViewOpsType_pan); } diff --git a/source/blender/editors/space_view3d/view3d_navigate_view_roll.cc b/source/blender/editors/space_view3d/view3d_navigate_view_roll.cc index 7699d90b29a..20187185f11 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_view_roll.cc +++ b/source/blender/editors/space_view3d/view3d_navigate_view_roll.cc @@ -82,12 +82,12 @@ static void viewroll_apply(ViewOpsData *vod, int x, int y) ED_region_tag_redraw(vod->region); } -static int viewroll_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus viewroll_modal(bContext *C, wmOperator *op, const wmEvent *event) { ViewOpsData *vod = static_cast(op->customdata); short event_code = VIEW_PASS; bool use_autokey = false; - int ret = OPERATOR_RUNNING_MODAL; + wmOperatorStatus ret = OPERATOR_RUNNING_MODAL; /* Execute the events. */ if (event->type == EVT_MODAL_MAP) { @@ -170,7 +170,7 @@ static const EnumPropertyItem prop_view_roll_items[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int viewroll_exec(bContext *C, wmOperator *op) +static wmOperatorStatus viewroll_exec(bContext *C, wmOperator *op) { ViewOpsData *vod; if (op->customdata) { @@ -228,7 +228,7 @@ static int viewroll_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int viewroll_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus viewroll_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ViewOpsData *vod; diff --git a/source/blender/editors/space_view3d/view3d_navigate_view_rotate.cc b/source/blender/editors/space_view3d/view3d_navigate_view_rotate.cc index d3a5b74c24d..d5ef6eaaf7f 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_view_rotate.cc +++ b/source/blender/editors/space_view3d/view3d_navigate_view_rotate.cc @@ -295,13 +295,13 @@ static void viewrotate_apply(ViewOpsData *vod, const int event_xy[2]) ED_region_tag_redraw(vod->region); } -static int viewrotate_modal_impl(bContext *C, - ViewOpsData *vod, - const eV3D_OpEvent event_code, - const int xy[2]) +static wmOperatorStatus viewrotate_modal_impl(bContext *C, + ViewOpsData *vod, + const eV3D_OpEvent event_code, + const int xy[2]) { bool use_autokey = false; - int ret = OPERATOR_RUNNING_MODAL; + wmOperatorStatus ret = OPERATOR_RUNNING_MODAL; switch (event_code) { case VIEW_APPLY: { @@ -332,10 +332,10 @@ static int viewrotate_modal_impl(bContext *C, return ret; } -static int viewrotate_invoke_impl(bContext * /*C*/, - ViewOpsData *vod, - const wmEvent *event, - PointerRNA * /*ptr*/) +static wmOperatorStatus viewrotate_invoke_impl(bContext * /*C*/, + ViewOpsData *vod, + const wmEvent *event, + PointerRNA * /*ptr*/) { if (vod->use_dyn_ofs && (vod->rv3d->is_persp == false)) { vod->use_dyn_ofs_ortho_correction = true; @@ -363,7 +363,7 @@ static int viewrotate_invoke_impl(bContext * /*C*/, return OPERATOR_RUNNING_MODAL; } -static int viewrotate_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus viewrotate_invoke(bContext *C, wmOperator *op, const wmEvent *event) { return view3d_navigate_invoke_impl(C, op, event, &ViewOpsType_rotate); } diff --git a/source/blender/editors/space_view3d/view3d_navigate_view_zoom.cc b/source/blender/editors/space_view3d/view3d_navigate_view_zoom.cc index 8dc9d5d7adb..8d530ebad37 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_view_zoom.cc +++ b/source/blender/editors/space_view3d/view3d_navigate_view_zoom.cc @@ -345,13 +345,13 @@ static void viewzoom_apply(ViewOpsData *vod, } } -static int viewzoom_modal_impl(bContext *C, - ViewOpsData *vod, - const eV3D_OpEvent event_code, - const int xy[2]) +static wmOperatorStatus viewzoom_modal_impl(bContext *C, + ViewOpsData *vod, + const eV3D_OpEvent event_code, + const int xy[2]) { bool use_autokey = false; - int ret = OPERATOR_RUNNING_MODAL; + wmOperatorStatus ret = OPERATOR_RUNNING_MODAL; switch (event_code) { case VIEW_APPLY: { @@ -433,7 +433,7 @@ static void view_zoom_apply_step(bContext *C, ED_region_tag_redraw(region); } -static int viewzoom_exec(bContext *C, wmOperator *op) +static wmOperatorStatus viewzoom_exec(bContext *C, wmOperator *op) { BLI_assert(op->customdata == nullptr); @@ -464,10 +464,10 @@ static int viewzoom_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int viewzoom_invoke_impl(bContext *C, - ViewOpsData *vod, - const wmEvent *event, - PointerRNA *ptr) +static wmOperatorStatus viewzoom_invoke_impl(bContext *C, + ViewOpsData *vod, + const wmEvent *event, + PointerRNA *ptr) { int xy[2]; @@ -519,7 +519,7 @@ static int viewzoom_invoke_impl(bContext *C, return OPERATOR_RUNNING_MODAL; } -static int viewzoom_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus viewzoom_invoke(bContext *C, wmOperator *op, const wmEvent *event) { /* Near duplicate logic in #viewdolly_invoke(), changes here may apply there too. */ return view3d_navigate_invoke_impl(C, op, event, &ViewOpsType_zoom); diff --git a/source/blender/editors/space_view3d/view3d_navigate_walk.cc b/source/blender/editors/space_view3d/view3d_navigate_walk.cc index ea3b5c5f294..a79ee3469d8 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_walk.cc +++ b/source/blender/editors/space_view3d/view3d_navigate_walk.cc @@ -644,7 +644,7 @@ static bool initWalkInfo(bContext *C, WalkInfo *walk, wmOperator *op, const int return true; } -static int walkEnd(bContext *C, WalkInfo *walk) +static wmOperatorStatus walkEnd(bContext *C, WalkInfo *walk) { wmWindow *win; RegionView3D *rv3d; @@ -1527,7 +1527,7 @@ static void walk_draw_status(bContext *C, wmOperator *op) walk->zlock != WALK_AXISLOCK_STATE_OFF); } -static int walk_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus walk_invoke(bContext *C, wmOperator *op, const wmEvent *event) { RegionView3D *rv3d = CTX_wm_region_view3d(C); if (RV3D_LOCK_FLAGS(rv3d) & RV3D_LOCK_ANY_TRANSFORM) { @@ -1561,7 +1561,7 @@ static void walk_cancel(bContext *C, wmOperator *op) op->customdata = nullptr; } -static int walk_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus walk_modal(bContext *C, wmOperator *op, const wmEvent *event) { bool do_draw = false; WalkInfo *walk = static_cast(op->customdata); @@ -1589,7 +1589,7 @@ static int walk_modal(bContext *C, wmOperator *op, const wmEvent *event) do_draw |= walk->redraw; - const int exit_code = walkEnd(C, walk); + const wmOperatorStatus exit_code = walkEnd(C, walk); if (exit_code != OPERATOR_RUNNING_MODAL) { do_draw = true; diff --git a/source/blender/editors/space_view3d/view3d_navigate_zoom_border.cc b/source/blender/editors/space_view3d/view3d_navigate_zoom_border.cc index 33ae9570efe..13ad791224e 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_zoom_border.cc +++ b/source/blender/editors/space_view3d/view3d_navigate_zoom_border.cc @@ -27,7 +27,7 @@ /** \name Border Zoom Operator * \{ */ -static int view3d_zoom_border_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view3d_zoom_border_exec(bContext *C, wmOperator *op) { ARegion *region = CTX_wm_region(C); View3D *v3d = CTX_wm_view3d(C); diff --git a/source/blender/editors/space_view3d/view3d_ops.cc b/source/blender/editors/space_view3d/view3d_ops.cc index 86d0fed7156..49a069fd7a4 100644 --- a/source/blender/editors/space_view3d/view3d_ops.cc +++ b/source/blender/editors/space_view3d/view3d_ops.cc @@ -51,7 +51,7 @@ static void view3d_copybuffer_filepath_get(char filepath[FILE_MAX], size_t filep /** \name Viewport Copy Operator * \{ */ -static int view3d_copybuffer_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view3d_copybuffer_exec(bContext *C, wmOperator *op) { using namespace blender::bke::blendfile; @@ -101,7 +101,7 @@ static void VIEW3D_OT_copybuffer(wmOperatorType *ot) /** \name Viewport Paste Operator * \{ */ -static int view3d_pastebuffer_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view3d_pastebuffer_exec(bContext *C, wmOperator *op) { char filepath[FILE_MAX]; short flag = 0; diff --git a/source/blender/editors/space_view3d/view3d_placement.cc b/source/blender/editors/space_view3d/view3d_placement.cc index 64d25cfa07c..ed8f331fc20 100644 --- a/source/blender/editors/space_view3d/view3d_placement.cc +++ b/source/blender/editors/space_view3d/view3d_placement.cc @@ -883,7 +883,9 @@ static void view3d_interactive_add_begin(bContext *C, wmOperator *op, const wmEv } } -static int view3d_interactive_add_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus view3d_interactive_add_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { const bool wait_for_input = RNA_boolean_get(op->ptr, "wait_for_input"); @@ -968,7 +970,9 @@ void viewplace_modal_keymap(wmKeyConfig *keyconf) WM_modalkeymap_assign(keymap, "VIEW3D_OT_interactive_add"); } -static int view3d_interactive_add_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus view3d_interactive_add_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { UNUSED_VARS(C, op); diff --git a/source/blender/editors/space_view3d/view3d_select.cc b/source/blender/editors/space_view3d/view3d_select.cc index d94bdc2b2fe..633e6d0341c 100644 --- a/source/blender/editors/space_view3d/view3d_select.cc +++ b/source/blender/editors/space_view3d/view3d_select.cc @@ -1478,7 +1478,7 @@ static bool view3d_lasso_select(bContext *C, /* lasso operator gives properties, but since old code works * with short array we convert */ -static int view3d_lasso_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view3d_lasso_select_exec(bContext *C, wmOperator *op) { Array mcoords = WM_gesture_lasso_path_to_array(C, op); if (mcoords.is_empty()) { @@ -1567,7 +1567,7 @@ static const EnumPropertyItem *object_select_menu_enum_itemf(bContext *C, return item; } -static int object_select_menu_exec(bContext *C, wmOperator *op) +static wmOperatorStatus object_select_menu_exec(bContext *C, wmOperator *op) { const int name_index = RNA_enum_get(op->ptr, "name"); const bool extend = RNA_boolean_get(op->ptr, "extend"); @@ -1800,7 +1800,7 @@ static bool object_mouse_select_menu(bContext *C, return true; } -static int bone_select_menu_exec(bContext *C, wmOperator *op) +static wmOperatorStatus bone_select_menu_exec(bContext *C, wmOperator *op) { const int name_index = RNA_enum_get(op->ptr, "name"); @@ -3481,7 +3481,7 @@ static bool ed_grease_pencil_select_pick(bContext *C, return true; } -static int view3d_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view3d_select_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); Object *obedit = CTX_data_edit_object(C); @@ -3599,11 +3599,11 @@ static int view3d_select_exec(bContext *C, wmOperator *op) return OPERATOR_PASS_THROUGH | OPERATOR_CANCELLED; } -static int view3d_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus view3d_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { RNA_int_set_array(op->ptr, "location", event->mval); - const int retval = view3d_select_exec(C, op); + const wmOperatorStatus retval = view3d_select_exec(C, op); return WM_operator_flag_only_pass_through_on_press(retval, event); } @@ -4433,7 +4433,7 @@ static bool do_grease_pencil_box_select(const ViewContext *vc, }); } -static int view3d_box_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view3d_box_select_exec(bContext *C, wmOperator *op) { using namespace blender; Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -5471,9 +5471,11 @@ static void view3d_circle_select_recalc(void *user_data) } } -static int view3d_circle_select_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus view3d_circle_select_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { - int result = WM_gesture_circle_modal(C, op, event); + wmOperatorStatus result = WM_gesture_circle_modal(C, op, event); if (result & OPERATOR_FINISHED) { view3d_circle_select_recalc(C); } @@ -5486,7 +5488,7 @@ static void view3d_circle_select_cancel(bContext *C, wmOperator *op) view3d_circle_select_recalc(C); } -static int view3d_circle_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view3d_circle_select_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); const int radius = RNA_int_get(op->ptr, "radius"); diff --git a/source/blender/editors/space_view3d/view3d_snap.cc b/source/blender/editors/space_view3d/view3d_snap.cc index 8b5dc475463..7558425dafd 100644 --- a/source/blender/editors/space_view3d/view3d_snap.cc +++ b/source/blender/editors/space_view3d/view3d_snap.cc @@ -67,7 +67,7 @@ static bool snap_calc_active_center(bContext *C, const bool select_only, float r * \{ */ /** Snaps every individual object center to its nearest point on the grid. */ -static int snap_sel_to_grid_exec(bContext *C, wmOperator *op) +static wmOperatorStatus snap_sel_to_grid_exec(bContext *C, wmOperator *op) { using namespace blender::ed; Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -573,7 +573,7 @@ bool ED_view3d_snap_selected_to_location(bContext *C, /** \name Snap Selection to Cursor Operator * \{ */ -static int snap_selected_to_cursor_exec(bContext *C, wmOperator *op) +static wmOperatorStatus snap_selected_to_cursor_exec(bContext *C, wmOperator *op) { const bool use_offset = RNA_boolean_get(op->ptr, "use_offset"); @@ -617,7 +617,7 @@ void VIEW3D_OT_snap_selected_to_cursor(wmOperatorType *ot) * \{ */ /** Snaps each selected object to the location of the active selected object. */ -static int snap_selected_to_active_exec(bContext *C, wmOperator *op) +static wmOperatorStatus snap_selected_to_active_exec(bContext *C, wmOperator *op) { float snap_target_global[3]; @@ -654,7 +654,7 @@ void VIEW3D_OT_snap_selected_to_active(wmOperatorType *ot) * \{ */ /** Snaps the 3D cursor location to its nearest point on the grid. */ -static int snap_curs_to_grid_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus snap_curs_to_grid_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); ARegion *region = CTX_wm_region(C); @@ -852,7 +852,7 @@ static bool snap_curs_to_sel_ex(bContext *C, const int pivot_point, float r_curs return true; } -static int snap_curs_to_sel_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus snap_curs_to_sel_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); const int pivot_point = scene->toolsettings->transform_pivot_point; @@ -901,7 +901,7 @@ static bool snap_calc_active_center(bContext *C, const bool select_only, float r return blender::ed::object::calc_active_center(ob, select_only, r_center); } -static int snap_curs_to_active_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus snap_curs_to_active_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); @@ -936,7 +936,7 @@ void VIEW3D_OT_snap_cursor_to_active(wmOperatorType *ot) * \{ */ /** Snaps the 3D cursor location to the origin and clears cursor rotation. */ -static int snap_curs_to_center_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus snap_curs_to_center_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/space_view3d/view3d_view.cc b/source/blender/editors/space_view3d/view3d_view.cc index 79ac4ee6645..767e24cde12 100644 --- a/source/blender/editors/space_view3d/view3d_view.cc +++ b/source/blender/editors/space_view3d/view3d_view.cc @@ -57,7 +57,7 @@ /** \name Camera to View Operator * \{ */ -static int view3d_camera_to_view_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus view3d_camera_to_view_exec(bContext *C, wmOperator * /*op*/) { const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); View3D *v3d; @@ -129,7 +129,7 @@ void VIEW3D_OT_camera_to_view(wmOperatorType *ot) /* unlike VIEW3D_OT_view_selected this is for framing a render and not * meant to take into account vertex/bone selection for eg. */ -static int view3d_camera_to_view_selected_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view3d_camera_to_view_selected_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -226,7 +226,7 @@ static void sync_viewport_camera_smoothview(bContext *C, } } -static int view3d_setobjectascamera_exec(bContext *C, wmOperator *op) +static wmOperatorStatus view3d_setobjectascamera_exec(bContext *C, wmOperator *op) { View3D *v3d; ARegion *region; @@ -1055,7 +1055,7 @@ bool ED_localview_exit_if_empty(const Depsgraph *depsgraph, depsgraph, wm, win, scene, view_layer, area, frame_selected, smooth_viewtx); } -static int localview_exec(bContext *C, wmOperator *op) +static wmOperatorStatus localview_exec(bContext *C, wmOperator *op) { const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); const int smooth_viewtx = WM_operator_smooth_viewtx_get(op); @@ -1125,7 +1125,7 @@ void VIEW3D_OT_localview(wmOperatorType *ot) "Move the view to frame the selected objects"); } -static int localview_remove_from_exec(bContext *C, wmOperator *op) +static wmOperatorStatus localview_remove_from_exec(bContext *C, wmOperator *op) { View3D *v3d = CTX_wm_view3d(C); Main *bmain = CTX_data_main(C); diff --git a/source/blender/editors/transform/transform.cc b/source/blender/editors/transform/transform.cc index 97a03ff3fd3..2a1de22299a 100644 --- a/source/blender/editors/transform/transform.cc +++ b/source/blender/editors/transform/transform.cc @@ -975,7 +975,7 @@ static bool transform_event_modal_constraint(TransInfo *t, short modal_type) return true; } -int transformEvent(TransInfo *t, wmOperator *op, const wmEvent *event) +wmOperatorStatus transformEvent(TransInfo *t, wmOperator *op, const wmEvent *event) { bool is_navigating = t->vod ? ((RegionView3D *)t->region->regiondata)->rflag & RV3D_NAVIGATING : false; @@ -1401,7 +1401,7 @@ int transformEvent(TransInfo *t, wmOperator *op, const wmEvent *event) } if (!is_navigating && t->redraw) { - return 0; + return wmOperatorStatus(0); } return OPERATOR_PASS_THROUGH; } @@ -2127,9 +2127,9 @@ void transformApply(bContext *C, TransInfo *t) t->context = nullptr; } -int transformEnd(bContext *C, TransInfo *t) +wmOperatorStatus transformEnd(bContext *C, TransInfo *t) { - int exit_code = OPERATOR_RUNNING_MODAL; + wmOperatorStatus exit_code = OPERATOR_RUNNING_MODAL; t->context = C; diff --git a/source/blender/editors/transform/transform.hh b/source/blender/editors/transform/transform.hh index cfbd7ed50fd..11c5efaf901 100644 --- a/source/blender/editors/transform/transform.hh +++ b/source/blender/editors/transform/transform.hh @@ -15,6 +15,7 @@ #include "ED_view3d.hh" #include "DNA_listBase.h" +#include "DNA_windowmanager_enums.h" #include "DEG_depsgraph.hh" @@ -906,9 +907,9 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve * \see #initTransform which reads values from the operator. */ void saveTransform(bContext *C, TransInfo *t, wmOperator *op); -int transformEvent(TransInfo *t, wmOperator *op, const wmEvent *event); +wmOperatorStatus transformEvent(TransInfo *t, wmOperator *op, const wmEvent *event); void transformApply(bContext *C, TransInfo *t); -int transformEnd(bContext *C, TransInfo *t); +wmOperatorStatus transformEnd(bContext *C, TransInfo *t); void setTransformViewMatrices(TransInfo *t); void setTransformViewAspect(TransInfo *t, float r_aspect[3]); diff --git a/source/blender/editors/transform/transform_gizmo_2d.cc b/source/blender/editors/transform/transform_gizmo_2d.cc index ee65c8b3d85..c92314ce201 100644 --- a/source/blender/editors/transform/transform_gizmo_2d.cc +++ b/source/blender/editors/transform/transform_gizmo_2d.cc @@ -412,10 +412,10 @@ BLI_INLINE void gizmo2d_origin_to_region(ARegion *region, float *r_origin) /** * Custom handler for gizmo widgets */ -static int gizmo2d_modal(bContext *C, - wmGizmo *widget, - const wmEvent * /*event*/, - eWM_GizmoFlagTweak /*tweak_flag*/) +static wmOperatorStatus gizmo2d_modal(bContext *C, + wmGizmo *widget, + const wmEvent * /*event*/, + eWM_GizmoFlagTweak /*tweak_flag*/) { ARegion *region = CTX_wm_region(C); float origin[3]; diff --git a/source/blender/editors/transform/transform_gizmo_3d.cc b/source/blender/editors/transform/transform_gizmo_3d.cc index e4a0ec18ca2..e8496d852e5 100644 --- a/source/blender/editors/transform/transform_gizmo_3d.cc +++ b/source/blender/editors/transform/transform_gizmo_3d.cc @@ -1650,10 +1650,10 @@ static GizmoGroup *gizmogroup_init(wmGizmoGroup *gzgroup) /** * Custom handler for gizmo widgets */ -static int gizmo_modal(bContext *C, - wmGizmo *widget, - const wmEvent *event, - eWM_GizmoFlagTweak /*tweak_flag*/) +static wmOperatorStatus gizmo_modal(bContext *C, + wmGizmo *widget, + const wmEvent *event, + eWM_GizmoFlagTweak /*tweak_flag*/) { /* Avoid unnecessary updates, partially address: #55458. */ if (ELEM(event->type, TIMER, INBETWEEN_MOUSEMOVE)) { diff --git a/source/blender/editors/transform/transform_ops.cc b/source/blender/editors/transform/transform_ops.cc index 710bb7ff805..b5b4e12478e 100644 --- a/source/blender/editors/transform/transform_ops.cc +++ b/source/blender/editors/transform/transform_ops.cc @@ -175,7 +175,7 @@ const EnumPropertyItem rna_enum_transform_mode_type_items[] = { namespace blender::ed::transform { -static int select_orientation_exec(bContext *C, wmOperator *op) +static wmOperatorStatus select_orientation_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); @@ -192,7 +192,9 @@ static int select_orientation_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int select_orientation_invoke(bContext *C, wmOperator * /*op*/, const wmEvent * /*event*/) +static wmOperatorStatus select_orientation_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent * /*event*/) { uiPopupMenu *pup; uiLayout *layout; @@ -225,7 +227,7 @@ static void TRANSFORM_OT_select_orientation(wmOperatorType *ot) RNA_def_enum_funcs(prop, rna_TransformOrientation_itemf); } -static int delete_orientation_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus delete_orientation_exec(bContext *C, wmOperator * /*op*/) { Scene *scene = CTX_data_scene(C); BIF_removeTransformOrientationIndex(C, @@ -239,7 +241,9 @@ static int delete_orientation_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -static int delete_orientation_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus delete_orientation_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { return delete_orientation_exec(C, op); } @@ -269,7 +273,7 @@ static void TRANSFORM_OT_delete_orientation(wmOperatorType *ot) ot->poll = delete_orientation_poll; } -static int create_orientation_exec(bContext *C, wmOperator *op) +static wmOperatorStatus create_orientation_exec(bContext *C, wmOperator *op) { char name[MAX_NAME]; const bool use = RNA_boolean_get(op->ptr, "use"); @@ -420,9 +424,9 @@ static int transformops_data(bContext *C, wmOperator *op, const wmEvent *event) return retval; /* Return 0 on error. */ } -static int transform_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus transform_modal(bContext *C, wmOperator *op, const wmEvent *event) { - int exit_code = OPERATOR_PASS_THROUGH; + wmOperatorStatus exit_code = OPERATOR_PASS_THROUGH; TransInfo *t = static_cast(op->customdata); const eTfmMode mode_prev = t->mode; @@ -523,7 +527,7 @@ static void transform_cancel(bContext *C, wmOperator *op) transformops_exit(C, op); } -static int transform_exec(bContext *C, wmOperator *op) +static wmOperatorStatus transform_exec(bContext *C, wmOperator *op) { TransInfo *t; @@ -547,7 +551,7 @@ static int transform_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int transform_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus transform_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (!transformops_data(C, op, event)) { G.moving = 0; @@ -1435,7 +1439,9 @@ static void TRANSFORM_OT_transform(wmOperatorType *ot) P_ALIGN_SNAP | P_GPENCIL_EDIT | P_CENTER | P_POST_TRANSFORM | P_OPTIONS); } -static int transform_from_gizmo_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event) +static wmOperatorStatus transform_from_gizmo_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent *event) { bToolRef *tref = WM_toolsystem_ref_from_context(C); if (tref) { diff --git a/source/blender/editors/undo/ed_undo.cc b/source/blender/editors/undo/ed_undo.cc index 3a6cdf99afd..c80cb43b69e 100644 --- a/source/blender/editors/undo/ed_undo.cc +++ b/source/blender/editors/undo/ed_undo.cc @@ -234,7 +234,9 @@ static void ed_undo_step_post(bContext *C, * May undo or redo several steps at once only if the target step is a 'skipped' one. * The target step will be the one immediately before or after the active one. */ -static int ed_undo_step_direction(bContext *C, enum eUndoStepDir step, ReportList *reports) +static wmOperatorStatus ed_undo_step_direction(bContext *C, + enum eUndoStepDir step, + ReportList *reports) { BLI_assert(ELEM(step, STEP_UNDO, STEP_REDO)); @@ -461,18 +463,18 @@ static void ed_undo_refresh_for_op(bContext *C) ED_outliner_select_sync_from_all_tag(C); } -static int ed_undo_exec(bContext *C, wmOperator *op) +static wmOperatorStatus ed_undo_exec(bContext *C, wmOperator *op) { /* "last operator" should disappear, later we can tie this with undo stack nicer */ WM_operator_stack_clear(CTX_wm_manager(C)); - int ret = ed_undo_step_direction(C, STEP_UNDO, op->reports); + wmOperatorStatus ret = ed_undo_step_direction(C, STEP_UNDO, op->reports); if (ret & OPERATOR_FINISHED) { ed_undo_refresh_for_op(C); } return ret; } -static int ed_undo_push_exec(bContext *C, wmOperator *op) +static wmOperatorStatus ed_undo_push_exec(bContext *C, wmOperator *op) { if (G.background) { /* Exception for background mode, see: #60934. @@ -489,19 +491,20 @@ static int ed_undo_push_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int ed_redo_exec(bContext *C, wmOperator *op) +static wmOperatorStatus ed_redo_exec(bContext *C, wmOperator *op) { - int ret = ed_undo_step_direction(C, STEP_REDO, op->reports); + wmOperatorStatus ret = ed_undo_step_direction(C, STEP_REDO, op->reports); if (ret & OPERATOR_FINISHED) { ed_undo_refresh_for_op(C); } return ret; } -static int ed_undo_redo_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus ed_undo_redo_exec(bContext *C, wmOperator * /*op*/) { wmOperator *last_op = WM_operator_last_redo(C); - const int ret = ED_undo_operator_repeat(C, last_op) ? OPERATOR_FINISHED : OPERATOR_CANCELLED; + wmOperatorStatus ret = ED_undo_operator_repeat(C, last_op) ? OPERATOR_FINISHED : + OPERATOR_CANCELLED; if (ret & OPERATOR_FINISHED) { /* Keep button under the cursor active. */ WM_event_add_mousemove(CTX_wm_window(C)); @@ -721,7 +724,7 @@ void ED_undo_operator_repeat_cb_evt(bContext *C, void *arg_op, int /*arg_unused* * \{ */ /* NOTE: also check #ed_undo_step() in top if you change notifiers. */ -static int undo_history_exec(bContext *C, wmOperator *op) +static wmOperatorStatus undo_history_exec(bContext *C, wmOperator *op) { PropertyRNA *prop = RNA_struct_find_property(op->ptr, "item"); if (RNA_property_is_set(op->ptr, prop)) { @@ -737,7 +740,7 @@ static int undo_history_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int undo_history_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus undo_history_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { PropertyRNA *prop = RNA_struct_find_property(op->ptr, "item"); if (RNA_property_is_set(op->ptr, prop)) { diff --git a/source/blender/editors/util/ed_util_imbuf.cc b/source/blender/editors/util/ed_util_imbuf.cc index 30802a4d27b..75e050943a2 100644 --- a/source/blender/editors/util/ed_util_imbuf.cc +++ b/source/blender/editors/util/ed_util_imbuf.cc @@ -445,7 +445,7 @@ void ED_imbuf_sample_exit(bContext *C, wmOperator *op) MEM_freeN(info); } -int ED_imbuf_sample_invoke(bContext *C, wmOperator *op, const wmEvent *event) +wmOperatorStatus ED_imbuf_sample_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); ScrArea *area = CTX_wm_area(C); @@ -486,7 +486,7 @@ int ED_imbuf_sample_invoke(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -int ED_imbuf_sample_modal(bContext *C, wmOperator *op, const wmEvent *event) +wmOperatorStatus ED_imbuf_sample_modal(bContext *C, wmOperator *op, const wmEvent *event) { switch (event->type) { case LEFTMOUSE: diff --git a/source/blender/editors/util/ed_util_ops.cc b/source/blender/editors/util/ed_util_ops.cc index be5db06c315..e5924ca644f 100644 --- a/source/blender/editors/util/ed_util_ops.cc +++ b/source/blender/editors/util/ed_util_ops.cc @@ -124,7 +124,7 @@ static ID *lib_id_load_custom_preview_id_get(bContext *C, const wmOperator *op) return static_cast(idptr.data); } -static int lib_id_load_custom_preview_exec(bContext *C, wmOperator *op) +static wmOperatorStatus lib_id_load_custom_preview_exec(bContext *C, wmOperator *op) { char filepath[FILE_MAX]; @@ -155,7 +155,9 @@ static int lib_id_load_custom_preview_exec(bContext *C, wmOperator *op) * confirmation, leading to failure to obtain the ID at that point. So get it before spawning the * File Browser (store it in the operator custom data). */ -static int lib_id_load_custom_preview_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus lib_id_load_custom_preview_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { op->customdata = lib_id_load_custom_preview_id_get(C, op); return WM_operator_filesel(C, op, event); @@ -256,7 +258,7 @@ static bool lib_id_generate_preview_poll(bContext *C) }); } -static int lib_id_generate_preview_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus lib_id_generate_preview_exec(bContext *C, wmOperator * /*op*/) { using namespace blender::ed; @@ -305,7 +307,7 @@ static bool lib_id_generate_preview_from_object_poll(bContext *C) return true; } -static int lib_id_generate_preview_from_object_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus lib_id_generate_preview_from_object_exec(bContext *C, wmOperator * /*op*/) { using namespace blender::ed; @@ -362,7 +364,7 @@ static bool lib_id_remove_preview_poll(bContext *C) return true; } -static int lib_id_remove_preview_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus lib_id_remove_preview_exec(bContext *C, wmOperator * /*op*/) { lib_id_batch_edit_previews(C, [&](ID *id) { BKE_previewimg_id_free(id); }); @@ -392,7 +394,7 @@ static void ED_OT_lib_id_remove_preview(wmOperatorType *ot) /** \name Generic ID Operators * \{ */ -static int lib_id_fake_user_toggle_exec(bContext *C, wmOperator *op) +static wmOperatorStatus lib_id_fake_user_toggle_exec(bContext *C, wmOperator *op) { PropertyPointerRNA pprop; PointerRNA idptr = PointerRNA_NULL; @@ -442,7 +444,7 @@ static void ED_OT_lib_id_fake_user_toggle(wmOperatorType *ot) ot->flag = OPTYPE_UNDO | OPTYPE_INTERNAL; } -static int lib_id_unlink_exec(bContext *C, wmOperator *op) +static wmOperatorStatus lib_id_unlink_exec(bContext *C, wmOperator *op) { PropertyPointerRNA pprop; PointerRNA idptr; @@ -488,7 +490,7 @@ static bool lib_id_override_editable_toggle_poll(bContext *C) return id && ID_IS_OVERRIDE_LIBRARY_REAL(id) && !ID_IS_LINKED(id); } -static int lib_id_override_editable_toggle_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus lib_id_override_editable_toggle_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); const PointerRNA id_ptr = CTX_data_pointer_get_type(C, "id", &RNA_ID); @@ -533,7 +535,7 @@ static void ED_OT_lib_id_override_editable_toggle(wmOperatorType *ot) /** \name General editor utils. * \{ */ -static int ed_flush_edits_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus ed_flush_edits_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); ED_editors_flush_edits(bmain); diff --git a/source/blender/editors/uvedit/uvedit_clipboard.cc b/source/blender/editors/uvedit/uvedit_clipboard.cc index f158a651222..be326935d5b 100644 --- a/source/blender/editors/uvedit/uvedit_clipboard.cc +++ b/source/blender/editors/uvedit/uvedit_clipboard.cc @@ -272,7 +272,7 @@ bool UV_ClipboardBuffer::find_isomorphism(UvElementMap *dest_element_map, return false; } -static int uv_copy_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus uv_copy_exec(bContext *C, wmOperator * /*op*/) { UV_clipboard_free(); uv_clipboard = new UV_ClipboardBuffer(); @@ -301,7 +301,7 @@ static int uv_copy_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -static int uv_paste_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_paste_exec(bContext *C, wmOperator *op) { /* TODO: Restore `UvClipboard` from system clipboard. */ if (!uv_clipboard) { diff --git a/source/blender/editors/uvedit/uvedit_ops.cc b/source/blender/editors/uvedit/uvedit_ops.cc index 1d2fb7bd7e4..ce39c681e12 100644 --- a/source/blender/editors/uvedit/uvedit_ops.cc +++ b/source/blender/editors/uvedit/uvedit_ops.cc @@ -582,7 +582,7 @@ static void uv_weld_align(bContext *C, eUVWeldAlign tool) } } -static int uv_align_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_align_exec(bContext *C, wmOperator *op) { uv_weld_align(C, eUVWeldAlign(RNA_enum_get(op->ptr, "axis"))); @@ -638,7 +638,7 @@ static void UV_OT_align(wmOperatorType *ot) /** \name Remove Doubles Operator * \{ */ -static int uv_remove_doubles_to_selected(bContext *C, wmOperator *op) +static wmOperatorStatus uv_remove_doubles_to_selected(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -754,7 +754,7 @@ static int uv_remove_doubles_to_selected(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int uv_remove_doubles_to_unselected(bContext *C, wmOperator *op) +static wmOperatorStatus uv_remove_doubles_to_unselected(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -812,7 +812,7 @@ static int uv_remove_doubles_to_unselected(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int uv_remove_doubles_to_selected_shared_vertex(bContext *C, wmOperator *op) +static wmOperatorStatus uv_remove_doubles_to_selected_shared_vertex(bContext *C, wmOperator *op) { /* NOTE: The calculation for the center-point of loops belonging to a vertex will be skewed * if one UV coordinate holds more loops than the others. */ @@ -922,7 +922,7 @@ static int uv_remove_doubles_to_selected_shared_vertex(bContext *C, wmOperator * return OPERATOR_FINISHED; } -static int uv_remove_doubles_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_remove_doubles_exec(bContext *C, wmOperator *op) { if (RNA_boolean_get(op->ptr, "use_unselected")) { return uv_remove_doubles_to_unselected(C, op); @@ -970,7 +970,7 @@ static void UV_OT_remove_doubles(wmOperatorType *ot) /** \name Weld Near Operator * \{ */ -static int uv_weld_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus uv_weld_exec(bContext *C, wmOperator * /*op*/) { uv_weld_align(C, UV_WELD); @@ -1023,7 +1023,7 @@ static void uv_snap_cursor_to_origin(float uvco[2]) uvco[1] = 0; } -static int uv_snap_cursor_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_snap_cursor_exec(bContext *C, wmOperator *op) { SpaceImage *sima = CTX_wm_space_image(C); @@ -1189,7 +1189,7 @@ static bool uv_snap_uvs_to_pixels(SpaceImage *sima, Scene *scene, Object *obedit return changed; } -static int uv_snap_selection_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_snap_selection_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1274,7 +1274,7 @@ static void UV_OT_snap_selected(wmOperatorType *ot) /** \name Pin UVs Operator * \{ */ -static int uv_pin_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_pin_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1397,7 +1397,7 @@ static bool bm_face_is_all_uv_sel(BMFace *f, bool select_test, const BMUVOffsets return true; } -static int uv_hide_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_hide_exec(bContext *C, wmOperator *op) { ViewLayer *view_layer = CTX_data_view_layer(C); Scene *scene = CTX_data_scene(C); @@ -1569,7 +1569,7 @@ static void UV_OT_hide(wmOperatorType *ot) /** \name Reveal Operator * \{ */ -static int uv_reveal_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_reveal_exec(bContext *C, wmOperator *op) { ViewLayer *view_layer = CTX_data_view_layer(C); Scene *scene = CTX_data_scene(C); @@ -1719,7 +1719,7 @@ static void UV_OT_reveal(wmOperatorType *ot) /** \name Set 2D Cursor Operator * \{ */ -static int uv_set_2d_cursor_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_set_2d_cursor_exec(bContext *C, wmOperator *op) { SpaceImage *sima = CTX_wm_space_image(C); @@ -1741,7 +1741,7 @@ static int uv_set_2d_cursor_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH; } -static int uv_set_2d_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus uv_set_2d_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); float location[2]; @@ -1791,7 +1791,7 @@ static void UV_OT_cursor_set(wmOperatorType *ot) /** \name Seam from UV Islands Operator * \{ */ -static int uv_seams_from_islands_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_seams_from_islands_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1888,7 +1888,7 @@ static void UV_OT_seams_from_islands(wmOperatorType *ot) /** \name Mark Seam Operator * \{ */ -static int uv_mark_seam_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_mark_seam_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -1941,7 +1941,7 @@ static int uv_mark_seam_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int uv_mark_seam_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus uv_mark_seam_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { uiPopupMenu *pup; uiLayout *layout; diff --git a/source/blender/editors/uvedit/uvedit_path.cc b/source/blender/editors/uvedit/uvedit_path.cc index 01c7fae52fa..764e87c44f4 100644 --- a/source/blender/editors/uvedit/uvedit_path.cc +++ b/source/blender/editors/uvedit/uvedit_path.cc @@ -474,7 +474,7 @@ static int mouse_mesh_uv_shortest_path_face(Scene *scene, /** \name Main Operator for vert/edge/face tag * \{ */ -static int uv_shortest_path_pick_exec(bContext *C, wmOperator *op); +static wmOperatorStatus uv_shortest_path_pick_exec(bContext *C, wmOperator *op); static bool uv_shortest_path_pick_ex(Scene *scene, Depsgraph *depsgraph, @@ -537,7 +537,9 @@ static bool uv_shortest_path_pick_ex(Scene *scene, return ok; } -static int uv_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus uv_shortest_path_pick_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { Scene *scene = CTX_data_scene(C); const ToolSettings *ts = scene->toolsettings; @@ -679,7 +681,7 @@ static int uv_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmEve return changed ? OPERATOR_FINISHED : OPERATOR_CANCELLED; } -static int uv_shortest_path_pick_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_shortest_path_pick_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Scene *scene = CTX_data_scene(C); @@ -786,7 +788,7 @@ void UV_OT_shortest_path_pick(wmOperatorType *ot) /** \name Select Path Between Existing Selection * \{ */ -static int uv_shortest_path_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_shortest_path_select_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/uvedit/uvedit_rip.cc b/source/blender/editors/uvedit/uvedit_rip.cc index 1c9a3b94694..6913a242d4b 100644 --- a/source/blender/editors/uvedit/uvedit_rip.cc +++ b/source/blender/editors/uvedit/uvedit_rip.cc @@ -895,7 +895,7 @@ static bool uv_rip_object(Scene *scene, Object *obedit, const float co[2], const /** \name UV Rip Operator * \{ */ -static int uv_rip_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_rip_exec(bContext *C, wmOperator *op) { SpaceImage *sima = CTX_wm_space_image(C); Scene *scene = CTX_data_scene(C); @@ -941,7 +941,7 @@ static int uv_rip_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int uv_rip_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus uv_rip_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); float co[2]; diff --git a/source/blender/editors/uvedit/uvedit_select.cc b/source/blender/editors/uvedit/uvedit_select.cc index 54068b901c1..9147c3c3bea 100644 --- a/source/blender/editors/uvedit/uvedit_select.cc +++ b/source/blender/editors/uvedit/uvedit_select.cc @@ -2065,7 +2065,7 @@ const float *uvedit_first_selected_uv_from_vertex(Scene *scene, /** \name Select More/Less Operator * \{ */ -static int uv_select_more_less(bContext *C, const bool select) +static wmOperatorStatus uv_select_more_less(bContext *C, const bool select) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -2212,7 +2212,7 @@ static int uv_select_more_less(bContext *C, const bool select) return OPERATOR_FINISHED; } -static int uv_select_more_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus uv_select_more_exec(bContext *C, wmOperator * /*op*/) { return uv_select_more_less(C, true); } @@ -2230,7 +2230,7 @@ void UV_OT_select_more(wmOperatorType *ot) ot->poll = ED_operator_uvedit_space_image; } -static int uv_select_less_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus uv_select_less_exec(bContext *C, wmOperator * /*op*/) { return uv_select_more_less(C, false); } @@ -2423,7 +2423,7 @@ static void uv_select_all_perform_multi(const Scene *scene, Span objec uv_select_all_perform_multi_ex(scene, objects, action, nullptr); } -static int uv_select_all_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_select_all_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Scene *scene = CTX_data_scene(C); @@ -2717,7 +2717,7 @@ static bool uv_mouse_select(bContext *C, const float co[2], const SelectPick_Par return changed; } -static int uv_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_select_exec(bContext *C, wmOperator *op) { float co[2]; @@ -2734,7 +2734,7 @@ static int uv_select_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH; } -static int uv_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus uv_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { const ARegion *region = CTX_wm_region(C); float co[2]; @@ -2742,7 +2742,7 @@ static int uv_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) UI_view2d_region_to_view(®ion->v2d, event->mval[0], event->mval[1], &co[0], &co[1]); RNA_float_set_array(op->ptr, "location", co); - const int retval = uv_select_exec(C, op); + const wmOperatorStatus retval = uv_select_exec(C, op); return WM_operator_flag_only_pass_through_on_press(retval, event); } @@ -2791,11 +2791,11 @@ enum eUVLoopGenericType { UV_RING_SELECT = 2, }; -static int uv_mouse_select_loop_generic_multi(bContext *C, - const Span objects, - const float co[2], - const bool extend, - enum eUVLoopGenericType loop_type) +static wmOperatorStatus uv_mouse_select_loop_generic_multi(bContext *C, + const Span objects, + const float co[2], + const bool extend, + enum eUVLoopGenericType loop_type) { const ARegion *region = CTX_wm_region(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -2854,16 +2854,16 @@ static int uv_mouse_select_loop_generic_multi(bContext *C, return OPERATOR_PASS_THROUGH | OPERATOR_FINISHED; } -static int uv_mouse_select_loop_generic(bContext *C, - const float co[2], - const bool extend, - enum eUVLoopGenericType loop_type) +static wmOperatorStatus uv_mouse_select_loop_generic(bContext *C, + const float co[2], + const bool extend, + enum eUVLoopGenericType loop_type) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); Vector objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs( scene, view_layer, nullptr); - int ret = uv_mouse_select_loop_generic_multi(C, objects, co, extend, loop_type); + wmOperatorStatus ret = uv_mouse_select_loop_generic_multi(C, objects, co, extend, loop_type); return ret; } @@ -2873,7 +2873,7 @@ static int uv_mouse_select_loop_generic(bContext *C, /** \name Edge Loop Select Operator * \{ */ -static int uv_select_loop_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_select_loop_exec(bContext *C, wmOperator *op) { float co[2]; @@ -2883,7 +2883,7 @@ static int uv_select_loop_exec(bContext *C, wmOperator *op) return uv_mouse_select_loop_generic(C, co, extend, UV_LOOP_SELECT); } -static int uv_select_loop_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus uv_select_loop_invoke(bContext *C, wmOperator *op, const wmEvent *event) { const ARegion *region = CTX_wm_region(C); float co[2]; @@ -2891,7 +2891,7 @@ static int uv_select_loop_invoke(bContext *C, wmOperator *op, const wmEvent *eve UI_view2d_region_to_view(®ion->v2d, event->mval[0], event->mval[1], &co[0], &co[1]); RNA_float_set_array(op->ptr, "location", co); - const int retval = uv_select_loop_exec(C, op); + const wmOperatorStatus retval = uv_select_loop_exec(C, op); return WM_operator_flag_only_pass_through_on_press(retval, event); } @@ -2937,7 +2937,7 @@ void UV_OT_select_loop(wmOperatorType *ot) /** \name Edge Ring Select Operator * \{ */ -static int uv_select_edge_ring_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_select_edge_ring_exec(bContext *C, wmOperator *op) { float co[2]; RNA_float_get_array(op->ptr, "location", co); @@ -2945,7 +2945,9 @@ static int uv_select_edge_ring_exec(bContext *C, wmOperator *op) return uv_mouse_select_loop_generic(C, co, extend, UV_RING_SELECT); } -static int uv_select_edge_ring_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus uv_select_edge_ring_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { const ARegion *region = CTX_wm_region(C); float co[2]; @@ -2953,7 +2955,7 @@ static int uv_select_edge_ring_invoke(bContext *C, wmOperator *op, const wmEvent UI_view2d_region_to_view(®ion->v2d, event->mval[0], event->mval[1], &co[0], &co[1]); RNA_float_set_array(op->ptr, "location", co); - const int retval = uv_select_edge_ring_exec(C, op); + const wmOperatorStatus retval = uv_select_edge_ring_exec(C, op); return WM_operator_flag_only_pass_through_on_press(retval, event); } @@ -2999,7 +3001,10 @@ void UV_OT_select_edge_ring(wmOperatorType *ot) /** \name Select Linked Operator * \{ */ -static int uv_select_linked_internal(bContext *C, wmOperator *op, const wmEvent *event, bool pick) +static wmOperatorStatus uv_select_linked_internal(bContext *C, + wmOperator *op, + const wmEvent *event, + bool pick) { const ARegion *region = CTX_wm_region(C); Scene *scene = CTX_data_scene(C); @@ -3060,7 +3065,7 @@ static int uv_select_linked_internal(bContext *C, wmOperator *op, const wmEvent return OPERATOR_FINISHED; } -static int uv_select_linked_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_select_linked_exec(bContext *C, wmOperator *op) { return uv_select_linked_internal(C, op, nullptr, false); } @@ -3086,12 +3091,14 @@ void UV_OT_select_linked(wmOperatorType *ot) /** \name Select Linked (Cursor Pick) Operator * \{ */ -static int uv_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus uv_select_linked_pick_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { return uv_select_linked_internal(C, op, event, true); } -static int uv_select_linked_pick_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_select_linked_pick_exec(bContext *C, wmOperator *op) { return uv_select_linked_internal(C, op, nullptr, true); } @@ -3151,7 +3158,7 @@ void UV_OT_select_linked_pick(wmOperatorType *ot) * (only having the behavior of being joined) so its best to call this #uv_select_split() * instead of just split(), but assigned to the same key as #MESH_OT_split. */ -static int uv_select_split_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_select_split_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Scene *scene = CTX_data_scene(C); @@ -3560,7 +3567,7 @@ static void uv_select_flush_from_loop_edge_flag(const Scene *scene, BMEditMesh * /** \name Box Select Operator * \{ */ -static int uv_box_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_box_select_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Scene *scene = CTX_data_scene(C); @@ -3806,7 +3813,7 @@ static bool uv_circle_select_is_edge_inside(const float uv_a[2], return dist_squared_to_line_segment_v2(co_zero, co_a, co_b) < 1.0f; } -static int uv_circle_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_circle_select_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); SpaceImage *sima = CTX_wm_space_image(C); @@ -4191,7 +4198,7 @@ static bool do_lasso_select_mesh_uv(bContext *C, const Span mcoords, const return changed_multi; } -static int uv_lasso_select_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_lasso_select_exec(bContext *C, wmOperator *op) { Array mcoords = WM_gesture_lasso_path_to_array(C, op); if (mcoords.is_empty()) { @@ -4230,7 +4237,7 @@ void UV_OT_select_lasso(wmOperatorType *ot) /** \name Select Pinned UVs Operator * \{ */ -static int uv_select_pinned_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_select_pinned_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); const ToolSettings *ts = scene->toolsettings; @@ -4388,7 +4395,7 @@ static bool overlap_tri_tri_uv_test(const float t1[3][2], return false; } -static int uv_select_overlap(bContext *C, const bool extend) +static wmOperatorStatus uv_select_overlap(bContext *C, const bool extend) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Scene *scene = CTX_data_scene(C); @@ -4582,7 +4589,7 @@ static int uv_select_overlap(bContext *C, const bool extend) return OPERATOR_FINISHED; } -static int uv_select_overlap_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_select_overlap_exec(bContext *C, wmOperator *op) { bool extend = RNA_boolean_get(op->ptr, "extend"); return uv_select_overlap(C, extend); @@ -4783,7 +4790,7 @@ static float get_uv_island_needle(const eUVSelectSimilar type, return result; } -static int uv_select_similar_vert_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_select_similar_vert_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -4890,7 +4897,7 @@ static int uv_select_similar_vert_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int uv_select_similar_edge_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_select_similar_edge_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -5000,7 +5007,7 @@ static int uv_select_similar_edge_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int uv_select_similar_face_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_select_similar_face_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -5100,7 +5107,7 @@ static bool uv_island_selected(const Scene *scene, FaceIsland *island) return uvedit_face_select_test(scene, island->faces[0], island->offsets); } -static int uv_select_similar_island_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_select_similar_island_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -5218,7 +5225,7 @@ static int uv_select_similar_island_exec(bContext *C, wmOperator *op) } /* Select similar UV faces/edges/verts based on current selection. */ -static int uv_select_similar_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_select_similar_exec(bContext *C, wmOperator *op) { ToolSettings *ts = CTX_data_tool_settings(C); PropertyRNA *prop = RNA_struct_find_property(op->ptr, "threshold"); @@ -5634,7 +5641,7 @@ void ED_uvedit_selectmode_clean_multi(bContext *C) } } -static int uv_select_mode_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_select_mode_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ToolSettings *ts = scene->toolsettings; @@ -5657,7 +5664,9 @@ static int uv_select_mode_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int uv_select_mode_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus uv_select_mode_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { const ToolSettings *ts = CTX_data_tool_settings(C); const SpaceImage *sima = CTX_wm_space_image(C); diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.cc b/source/blender/editors/uvedit/uvedit_smart_stitch.cc index 9bd0166512a..3d818d28a5a 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.cc +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.cc @@ -2339,7 +2339,7 @@ static int stitch_init_all(bContext *C, wmOperator *op) return 1; } -static int stitch_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus stitch_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { if (!stitch_init_all(C, op)) { return OPERATOR_CANCELLED; @@ -2458,7 +2458,7 @@ static void stitch_cancel(bContext *C, wmOperator *op) stitch_exit(C, op, 0); } -static int stitch_exec(bContext *C, wmOperator *op) +static wmOperatorStatus stitch_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); @@ -2528,7 +2528,7 @@ static StitchState *stitch_select(bContext *C, return nullptr; } -static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus stitch_modal(bContext *C, wmOperator *op, const wmEvent *event) { StitchStateContainer *ssc; Scene *scene = CTX_data_scene(C); diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.cc b/source/blender/editors/uvedit/uvedit_unwrap_ops.cc index eb901bdbc9c..3a5a93afdcf 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.cc +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.cc @@ -1171,7 +1171,7 @@ static void minimize_stretch_exit(bContext *C, wmOperator *op, bool cancel) op->customdata = nullptr; } -static int minimize_stretch_exec(bContext *C, wmOperator *op) +static wmOperatorStatus minimize_stretch_exec(bContext *C, wmOperator *op) { int i, iterations; @@ -1188,7 +1188,9 @@ static int minimize_stretch_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int minimize_stretch_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus minimize_stretch_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (!minimize_stretch_init(C, op)) { return OPERATOR_CANCELLED; @@ -1203,7 +1205,7 @@ static int minimize_stretch_invoke(bContext *C, wmOperator *op, const wmEvent * return OPERATOR_RUNNING_MODAL; } -static int minimize_stretch_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus minimize_stretch_modal(bContext *C, wmOperator *op, const wmEvent *event) { MinStretch *ms = static_cast(op->customdata); @@ -1712,7 +1714,7 @@ static void pack_islands_freejob(void *pidv) MEM_delete(pid); } -static int pack_islands_exec(bContext *C, wmOperator *op) +static wmOperatorStatus pack_islands_exec(bContext *C, wmOperator *op) { ViewLayer *view_layer = CTX_data_view_layer(C); const Scene *scene = CTX_data_scene(C); @@ -1912,7 +1914,7 @@ static void uv_pack_islands_ui(bContext * /*C*/, wmOperator *op) uiItemS(layout); } -static int uv_pack_islands_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus uv_pack_islands_invoke(bContext *C, wmOperator *op, const wmEvent *event) { return WM_operator_props_popup_confirm_ex(C, op, event, IFACE_("Pack Islands"), IFACE_("Pack")); } @@ -2002,7 +2004,7 @@ void UV_OT_pack_islands(wmOperatorType *ot) /** \name Average UV Islands Scale Operator * \{ */ -static int average_islands_scale_exec(bContext *C, wmOperator *op) +static wmOperatorStatus average_islands_scale_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -2766,7 +2768,7 @@ enum { UNWRAP_ERROR_NEGATIVE = (1 << 1), }; -static int unwrap_exec(bContext *C, wmOperator *op) +static wmOperatorStatus unwrap_exec(bContext *C, wmOperator *op) { ViewLayer *view_layer = CTX_data_view_layer(C); const Scene *scene = CTX_data_scene(C); @@ -3149,7 +3151,7 @@ static blender::Vector smart_uv_project_calculate_project_norma return project_normal_array; } -static int smart_project_exec(bContext *C, wmOperator *op) +static wmOperatorStatus smart_project_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -3328,7 +3330,7 @@ static int smart_project_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int smart_project_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus smart_project_invoke(bContext *C, wmOperator *op, const wmEvent *event) { return WM_operator_props_popup_confirm_ex( C, op, event, IFACE_("Smart UV Project"), IFACE_("Unwrap")); @@ -3405,9 +3407,9 @@ void UV_OT_smart_project(wmOperatorType *ot) /** \name Project UV From View Operator * \{ */ -static int uv_from_view_exec(bContext *C, wmOperator *op); +static wmOperatorStatus uv_from_view_exec(bContext *C, wmOperator *op); -static int uv_from_view_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus uv_from_view_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d = CTX_wm_region_view3d(C); @@ -3426,7 +3428,7 @@ static int uv_from_view_invoke(bContext *C, wmOperator *op, const wmEvent * /*ev return uv_from_view_exec(C, op); } -static int uv_from_view_exec(bContext *C, wmOperator *op) +static wmOperatorStatus uv_from_view_exec(bContext *C, wmOperator *op) { ViewLayer *view_layer = CTX_data_view_layer(C); const Scene *scene = CTX_data_scene(C); @@ -3585,7 +3587,7 @@ void UV_OT_project_from_view(wmOperatorType *ot) /** \name Reset UV Operator * \{ */ -static int reset_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus reset_exec(bContext *C, wmOperator * /*op*/) { const Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); @@ -3840,7 +3842,7 @@ static float uv_sphere_project(const Scene *scene, return max_u; } -static int sphere_project_exec(bContext *C, wmOperator *op) +static wmOperatorStatus sphere_project_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); @@ -4018,7 +4020,7 @@ static float uv_cylinder_project(const Scene *scene, return max_u; } -static int cylinder_project_exec(bContext *C, wmOperator *op) +static wmOperatorStatus cylinder_project_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); @@ -4166,7 +4168,7 @@ static void uvedit_unwrap_cube_project(const Scene *scene, } } -static int cube_project_exec(bContext *C, wmOperator *op) +static wmOperatorStatus cube_project_exec(bContext *C, wmOperator *op) { const Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); diff --git a/source/blender/makesdna/DNA_windowmanager_enums.h b/source/blender/makesdna/DNA_windowmanager_enums.h new file mode 100644 index 00000000000..88ac7eae303 --- /dev/null +++ b/source/blender/makesdna/DNA_windowmanager_enums.h @@ -0,0 +1,67 @@ +/* SPDX-FileCopyrightText: 2007 Blender Authors + * + * SPDX-License-Identifier: GPL-2.0-or-later */ + +/** \file + * \ingroup DNA + */ + +#pragma once + +#include "BLI_utildefines.h" + +/** + * Operator type return flags: exec(), invoke() modal(), return values. + */ +enum wmOperatorStatus { + OPERATOR_RUNNING_MODAL = (1 << 0), + OPERATOR_CANCELLED = (1 << 1), + OPERATOR_FINISHED = (1 << 2), + /** Add this flag if the event should pass through. */ + OPERATOR_PASS_THROUGH = (1 << 3), + /** In case operator got executed outside WM code (like via file-select). */ + OPERATOR_HANDLED = (1 << 4), + /** + * Used for operators that act indirectly (eg. popup menu). + * \note this isn't great design (using operators to trigger UI) avoid where possible. + */ + OPERATOR_INTERFACE = (1 << 5), +}; +#define OPERATOR_FLAGS_ALL \ + (OPERATOR_RUNNING_MODAL | OPERATOR_CANCELLED | OPERATOR_FINISHED | OPERATOR_PASS_THROUGH | \ + OPERATOR_HANDLED | OPERATOR_INTERFACE | 0) + +/* sanity checks for debug mode only */ +#define OPERATOR_RETVAL_CHECK(ret) \ + (void)ret, BLI_assert(ret != 0 && (ret & OPERATOR_FLAGS_ALL) == ret) + +ENUM_OPERATORS(wmOperatorStatus, OPERATOR_INTERFACE); + +/** #wmOperator.flag */ +enum { + /** + * Low level flag so exec() operators can tell if they were invoked, use with care. + * Typically this shouldn't make any difference, but it rare cases its needed (see smooth-view). + */ + OP_IS_INVOKE = (1 << 0), + /** So we can detect if an operators exec() call is activated by adjusting the last action. */ + OP_IS_REPEAT = (1 << 1), + /** + * So we can detect if an operators exec() call is activated from #SCREEN_OT_repeat_last. + * + * This difference can be important because previous settings may be used, + * even with #PROP_SKIP_SAVE the repeat last operator will use the previous settings. + * Unlike #OP_IS_REPEAT the selection (and context generally) may be different each time. + * See #60777 for an example of when this is needed. + */ + OP_IS_REPEAT_LAST = (1 << 2), + + /** When the cursor is grabbed */ + OP_IS_MODAL_GRAB_CURSOR = (1 << 3), + + /** + * Allow modal operators to have the region under the cursor for their context + * (the region-type is maintained to prevent errors). + */ + OP_IS_MODAL_CURSOR_REGION = (1 << 4), +}; diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index 49938de2fe9..73b6677addf 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -8,6 +8,8 @@ #pragma once +#include "DNA_windowmanager_enums.h" /* Own enums. */ + #include "DNA_listBase.h" #include "DNA_screen_types.h" /* for #ScrAreaMap */ #include "DNA_xr_types.h" /* for #XrSessionSettings */ @@ -638,57 +640,3 @@ typedef struct wmOperator { short flag; char _pad[6]; } wmOperator; - -/** - * Operator type return flags: exec(), invoke() modal(), return values. - */ -enum { - OPERATOR_RUNNING_MODAL = (1 << 0), - OPERATOR_CANCELLED = (1 << 1), - OPERATOR_FINISHED = (1 << 2), - /** Add this flag if the event should pass through. */ - OPERATOR_PASS_THROUGH = (1 << 3), - /** In case operator got executed outside WM code (like via file-select). */ - OPERATOR_HANDLED = (1 << 4), - /** - * Used for operators that act indirectly (eg. popup menu). - * \note this isn't great design (using operators to trigger UI) avoid where possible. - */ - OPERATOR_INTERFACE = (1 << 5), -}; -#define OPERATOR_FLAGS_ALL \ - (OPERATOR_RUNNING_MODAL | OPERATOR_CANCELLED | OPERATOR_FINISHED | OPERATOR_PASS_THROUGH | \ - OPERATOR_HANDLED | OPERATOR_INTERFACE | 0) - -/* sanity checks for debug mode only */ -#define OPERATOR_RETVAL_CHECK(ret) \ - (void)ret, BLI_assert(ret != 0 && (ret & OPERATOR_FLAGS_ALL) == ret) - -/** #wmOperator.flag */ -enum { - /** - * Low level flag so exec() operators can tell if they were invoked, use with care. - * Typically this shouldn't make any difference, but it rare cases its needed (see smooth-view). - */ - OP_IS_INVOKE = (1 << 0), - /** So we can detect if an operators exec() call is activated by adjusting the last action. */ - OP_IS_REPEAT = (1 << 1), - /** - * So we can detect if an operators exec() call is activated from #SCREEN_OT_repeat_last. - * - * This difference can be important because previous settings may be used, - * even with #PROP_SKIP_SAVE the repeat last operator will use the previous settings. - * Unlike #OP_IS_REPEAT the selection (and context generally) may be different each time. - * See #60777 for an example of when this is needed. - */ - OP_IS_REPEAT_LAST = (1 << 2), - - /** When the cursor is grabbed */ - OP_IS_MODAL_GRAB_CURSOR = (1 << 3), - - /** - * Allow modal operators to have the region under the cursor for their context - * (the region-type is maintained to prevent errors). - */ - OP_IS_MODAL_CURSOR_REGION = (1 << 4), -}; diff --git a/source/blender/makesrna/intern/rna_wm.cc b/source/blender/makesrna/intern/rna_wm.cc index 391385f0640..e569d68d021 100644 --- a/source/blender/makesrna/intern/rna_wm.cc +++ b/source/blender/makesrna/intern/rna_wm.cc @@ -1437,7 +1437,7 @@ static bool rna_operator_poll_cb(bContext *C, wmOperatorType *ot) return visible; } -static int rna_operator_exec_cb(bContext *C, wmOperator *op) +static wmOperatorStatus rna_operator_exec_cb(bContext *C, wmOperator *op) { extern FunctionRNA rna_Operator_execute_func; @@ -1464,7 +1464,8 @@ static int rna_operator_exec_cb(bContext *C, wmOperator *op) WM_event_remove_modal_handler_all(op, false); } - return result; + OPERATOR_RETVAL_CHECK(result); + return wmOperatorStatus(result); } /* same as execute() but no return value */ @@ -1490,10 +1491,11 @@ static bool rna_operator_check_cb(bContext *C, wmOperator *op) RNA_parameter_list_free(&list); - return result; + OPERATOR_RETVAL_CHECK(result); + return wmOperatorStatus(result); } -static int rna_operator_invoke_cb(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus rna_operator_invoke_cb(bContext *C, wmOperator *op, const wmEvent *event) { extern FunctionRNA rna_Operator_invoke_func; @@ -1521,11 +1523,12 @@ static int rna_operator_invoke_cb(bContext *C, wmOperator *op, const wmEvent *ev WM_event_remove_modal_handler_all(op, false); } - return result; + OPERATOR_RETVAL_CHECK(result); + return wmOperatorStatus(result); } /* same as invoke */ -static int rna_operator_modal_cb(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus rna_operator_modal_cb(bContext *C, wmOperator *op, const wmEvent *event) { extern FunctionRNA rna_Operator_modal_func; @@ -1548,7 +1551,8 @@ static int rna_operator_modal_cb(bContext *C, wmOperator *op, const wmEvent *eve RNA_parameter_list_free(&list); - return result; + OPERATOR_RETVAL_CHECK(result); + return wmOperatorStatus(result); } static void rna_operator_draw_cb(bContext *C, wmOperator *op) diff --git a/source/blender/makesrna/intern/rna_wm_api.cc b/source/blender/makesrna/intern/rna_wm_api.cc index 9eb810db77d..c0abdaab9f1 100644 --- a/source/blender/makesrna/intern/rna_wm_api.cc +++ b/source/blender/makesrna/intern/rna_wm_api.cc @@ -118,6 +118,11 @@ static void rna_Operator_enum_search_invoke(bContext *C, wmOperator *op) WM_enum_search_invoke(C, op, nullptr); } +static int rna_Operator_ui_popup(bContext *C, wmOperator *op, int width) +{ + return wmOperatorStatus(WM_operator_ui_popup(C, op, width)); +} + static bool rna_event_modal_handler_add(bContext *C, ReportList *reports, wmOperator *op) { wmWindow *win = CTX_wm_window(C); @@ -983,7 +988,7 @@ void RNA_api_wm(StructRNA *srna) rna_generic_op_invoke(func, 0); /* invoke functions, for use with python */ - func = RNA_def_function(srna, "invoke_popup", "WM_operator_ui_popup"); + func = RNA_def_function(srna, "invoke_popup", "rna_Operator_ui_popup"); RNA_def_function_ui_description(func, "Operator popup invoke " "(only shows operator's properties, without executing it)"); diff --git a/source/blender/makesrna/intern/rna_wm_gizmo.cc b/source/blender/makesrna/intern/rna_wm_gizmo.cc index 1ba1b12cec9..a8f53e45c22 100644 --- a/source/blender/makesrna/intern/rna_wm_gizmo.cc +++ b/source/blender/makesrna/intern/rna_wm_gizmo.cc @@ -110,10 +110,10 @@ static int rna_gizmo_test_select_cb(bContext *C, wmGizmo *gz, const int location return intersect_id; } -static int rna_gizmo_modal_cb(bContext *C, - wmGizmo *gz, - const wmEvent *event, - eWM_GizmoFlagTweak tweak_flag) +static wmOperatorStatus rna_gizmo_modal_cb(bContext *C, + wmGizmo *gz, + const wmEvent *event, + eWM_GizmoFlagTweak tweak_flag) { extern FunctionRNA rna_Gizmo_modal_func; wmGizmoGroup *gzgroup = gz->parent_gzgroup; @@ -134,7 +134,9 @@ static int rna_gizmo_modal_cb(bContext *C, int ret_enum = *(int *)ret; RNA_parameter_list_free(&list); - return ret_enum; + + OPERATOR_RETVAL_CHECK(ret_enum); + return wmOperatorStatus(ret_enum); } static void rna_gizmo_setup_cb(wmGizmo *gz) @@ -151,7 +153,7 @@ static void rna_gizmo_setup_cb(wmGizmo *gz) RNA_parameter_list_free(&list); } -static int rna_gizmo_invoke_cb(bContext *C, wmGizmo *gz, const wmEvent *event) +static wmOperatorStatus rna_gizmo_invoke_cb(bContext *C, wmGizmo *gz, const wmEvent *event) { extern FunctionRNA rna_Gizmo_invoke_func; wmGizmoGroup *gzgroup = gz->parent_gzgroup; @@ -170,7 +172,9 @@ static int rna_gizmo_invoke_cb(bContext *C, wmGizmo *gz, const wmEvent *event) int ret_enum = *(int *)ret; RNA_parameter_list_free(&list); - return ret_enum; + + OPERATOR_RETVAL_CHECK(ret_enum); + return wmOperatorStatus(ret_enum); } static void rna_gizmo_exit_cb(bContext *C, wmGizmo *gz, bool cancel) diff --git a/source/blender/nodes/NOD_socket_items_ops.hh b/source/blender/nodes/NOD_socket_items_ops.hh index 91758e7cba1..cf2f4e08ae5 100644 --- a/source/blender/nodes/NOD_socket_items_ops.hh +++ b/source/blender/nodes/NOD_socket_items_ops.hh @@ -82,7 +82,7 @@ inline void remove_active_item(wmOperatorType *ot, ot->description = description; ot->poll = editable_node_active_poll; - ot->exec = [](bContext *C, wmOperator * /*op*/) -> int { + ot->exec = [](bContext *C, wmOperator * /*op*/) -> wmOperatorStatus { PointerRNA node_ptr = get_active_node_to_operate_on(C, Accessor::node_type); bNode &node = *static_cast(node_ptr.data); SocketItemsRef ref = Accessor::get_items_from_node(node); @@ -106,7 +106,7 @@ inline void remove_item_by_index(wmOperatorType *ot, ot->description = description; ot->poll = editable_node_active_poll; - ot->exec = [](bContext *C, wmOperator *op) -> int { + ot->exec = [](bContext *C, wmOperator *op) -> wmOperatorStatus { PointerRNA node_ptr = get_active_node_to_operate_on(C, Accessor::node_type); bNode &node = *static_cast(node_ptr.data); const int index_to_remove = RNA_int_get(op->ptr, "index"); @@ -132,7 +132,7 @@ inline void add_item(wmOperatorType *ot, ot->description = description; ot->poll = editable_node_active_poll; - ot->exec = [](bContext *C, wmOperator * /*op*/) -> int { + ot->exec = [](bContext *C, wmOperator * /*op*/) -> wmOperatorStatus { PointerRNA node_ptr = get_active_node_to_operate_on(C, Accessor::node_type); bNode &node = *static_cast(node_ptr.data); SocketItemsRef ref = Accessor::get_items_from_node(node); @@ -191,7 +191,7 @@ inline void move_active_item(wmOperatorType *ot, ot->description = description; ot->poll = editable_node_active_poll; - ot->exec = [](bContext *C, wmOperator *op) -> int { + ot->exec = [](bContext *C, wmOperator *op) -> wmOperatorStatus { PointerRNA node_ptr = get_active_node_to_operate_on(C, Accessor::node_type); bNode &node = *static_cast(node_ptr.data); const MoveDirection direction = MoveDirection(RNA_enum_get(op->ptr, "direction")); diff --git a/source/blender/windowmanager/WM_api.hh b/source/blender/windowmanager/WM_api.hh index 9086291a12a..51ea15acbd8 100644 --- a/source/blender/windowmanager/WM_api.hh +++ b/source/blender/windowmanager/WM_api.hh @@ -783,7 +783,7 @@ void WM_event_timer_sleep(wmWindowManager *wm, wmWindow *win, wmTimer *timer, bo * To be used together with #WM_generic_select_invoke() and * #WM_operator_properties_generic_select(). */ -int WM_generic_select_modal(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_generic_select_modal(bContext *C, wmOperator *op, const wmEvent *event); /** * Helper to get select and tweak-transform to work conflict free and as desired. See * #WM_operator_properties_generic_select() for details. @@ -791,44 +791,44 @@ int WM_generic_select_modal(bContext *C, wmOperator *op, const wmEvent *event); * To be used together with #WM_generic_select_modal() and * #WM_operator_properties_generic_select(). */ -int WM_generic_select_invoke(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_generic_select_invoke(bContext *C, wmOperator *op, const wmEvent *event); void WM_operator_view3d_unit_defaults(bContext *C, wmOperator *op); int WM_operator_smooth_viewtx_get(const wmOperator *op); /** * Invoke callback, uses enum property named "type". */ -int WM_menu_invoke_ex(bContext *C, wmOperator *op, wmOperatorCallContext opcontext); -int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_menu_invoke_ex(bContext *C, wmOperator *op, wmOperatorCallContext opcontext); +wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *event); /** * Call an existent menu. The menu can be created in C or Python. */ void WM_menu_name_call(bContext *C, const char *menu_name, short context); -int WM_enum_search_invoke(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_enum_search_invoke(bContext *C, wmOperator *op, const wmEvent *event); /** * Invoke callback, confirm menu + exec. */ -int WM_operator_confirm(bContext *C, wmOperator *op, const wmEvent *event); -int WM_operator_confirm_or_exec(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_operator_confirm(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_operator_confirm_or_exec(bContext *C, wmOperator *op, const wmEvent *event); /** * Like WM_operator_confirm, but with more options and can't be used as an invoke directly. */ -int WM_operator_confirm_ex(bContext *C, - wmOperator *op, - const char *title = nullptr, - const char *message = nullptr, - const char *confirm_text = nullptr, - int icon = 0, /* ALERT_ICON_WARNING. */ - bool cancel_default = false); +wmOperatorStatus WM_operator_confirm_ex(bContext *C, + wmOperator *op, + const char *title = nullptr, + const char *message = nullptr, + const char *confirm_text = nullptr, + int icon = 0, /* ALERT_ICON_WARNING. */ + bool cancel_default = false); /** * Invoke callback, file selector "filepath" unset + exec. * * #wmOperatorType.invoke, opens file-select if path property not set, otherwise executes. */ -int WM_operator_filesel(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_operator_filesel(bContext *C, wmOperator *op, const wmEvent *event); bool WM_operator_filesel_ensure_ext_imtype(wmOperator *op, const ImageFormatData *im_format); /** Callback for #wmOperatorType.poll. */ bool WM_operator_winactive(bContext *C); @@ -838,43 +838,47 @@ bool WM_operator_winactive(bContext *C); * Same as #WM_operator_props_popup but don't use operator redo. * just wraps #WM_operator_props_dialog_popup. */ -int WM_operator_props_popup_confirm(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_operator_props_popup_confirm(bContext *C, + wmOperator *op, + const wmEvent *event); -int WM_operator_props_popup_confirm_ex(bContext *C, - wmOperator *op, - const wmEvent *event, - std::optional title = std::nullopt, - std::optional confirm_text = std::nullopt, - bool cancel_default = false); +wmOperatorStatus WM_operator_props_popup_confirm_ex( + bContext *C, + wmOperator *op, + const wmEvent *event, + std::optional title = std::nullopt, + std::optional confirm_text = std::nullopt, + bool cancel_default = false); /** * Same as #WM_operator_props_popup but call the operator first, * 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, const wmEvent *event); -int WM_operator_props_popup(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_operator_props_popup_call(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_operator_props_popup(bContext *C, wmOperator *op, const wmEvent *event); -int WM_operator_props_dialog_popup(bContext *C, - wmOperator *op, - int width, - std::optional title = std::nullopt, - std::optional confirm_text = std::nullopt, - bool cancel_default = false); +wmOperatorStatus WM_operator_props_dialog_popup( + bContext *C, + wmOperator *op, + int width, + std::optional title = std::nullopt, + std::optional confirm_text = std::nullopt, + bool cancel_default = false); -int WM_operator_redo_popup(bContext *C, wmOperator *op); -int WM_operator_ui_popup(bContext *C, wmOperator *op, int width); +wmOperatorStatus WM_operator_redo_popup(bContext *C, wmOperator *op); +wmOperatorStatus WM_operator_ui_popup(bContext *C, wmOperator *op, int width); /** * Can't be used as an invoke directly, needs message arg (can be NULL). */ -int WM_operator_confirm_message_ex(bContext *C, - wmOperator *op, - const char *title, - int icon, - const char *message, - wmOperatorCallContext opcontext); -int WM_operator_confirm_message(bContext *C, wmOperator *op, const char *message); +wmOperatorStatus WM_operator_confirm_message_ex(bContext *C, + wmOperator *op, + const char *title, + int icon, + const char *message, + wmOperatorCallContext opcontext); +wmOperatorStatus WM_operator_confirm_message(bContext *C, wmOperator *op, const char *message); /* Operator API. */ @@ -905,19 +909,19 @@ bool WM_operator_poll_context(bContext *C, wmOperatorType *ot, short context); * * \warning do not use this within an operator to call itself! #29537. */ -int WM_operator_call_ex(bContext *C, wmOperator *op, bool store); -int WM_operator_call(bContext *C, wmOperator *op); +wmOperatorStatus WM_operator_call_ex(bContext *C, wmOperator *op, bool store); +wmOperatorStatus WM_operator_call(bContext *C, wmOperator *op); /** * This is intended to be used when an invoke operator wants to call exec on itself * and is basically like running op->type->exec() directly, no poll checks no freeing, * since we assume whoever called invoke will take care of that */ -int WM_operator_call_notest(bContext *C, wmOperator *op); +wmOperatorStatus WM_operator_call_notest(bContext *C, wmOperator *op); /** * Execute this operator again, put here so it can share above code */ -int WM_operator_repeat(bContext *C, wmOperator *op); -int WM_operator_repeat_last(bContext *C, wmOperator *op); +wmOperatorStatus WM_operator_repeat(bContext *C, wmOperator *op); +wmOperatorStatus WM_operator_repeat_last(bContext *C, wmOperator *op); /** * \return true if #WM_operator_repeat can run. * Simple check for now but may become more involved. @@ -937,22 +941,22 @@ bool WM_operator_name_poll(bContext *C, const char *opstring); * storing the key that was pressed so as to be able to detect its release. * In these cases it's necessary to forward the current event being handled. */ -int WM_operator_name_call_ptr(bContext *C, - wmOperatorType *ot, - wmOperatorCallContext context, - PointerRNA *properties, - const wmEvent *event); +wmOperatorStatus WM_operator_name_call_ptr(bContext *C, + wmOperatorType *ot, + wmOperatorCallContext context, + PointerRNA *properties, + const wmEvent *event); /** See #WM_operator_name_call_ptr. */ -int WM_operator_name_call(bContext *C, - const char *opstring, - wmOperatorCallContext context, - PointerRNA *properties, - const wmEvent *event); -int WM_operator_name_call_with_properties(bContext *C, - const char *opstring, - wmOperatorCallContext context, - IDProperty *properties, - const wmEvent *event); +wmOperatorStatus WM_operator_name_call(bContext *C, + const char *opstring, + wmOperatorCallContext context, + PointerRNA *properties, + const wmEvent *event); +wmOperatorStatus WM_operator_name_call_with_properties(bContext *C, + const char *opstring, + wmOperatorCallContext context, + IDProperty *properties, + const wmEvent *event); /** * Similar to #WM_operator_name_call called with #WM_OP_EXEC_DEFAULT context. * @@ -1397,38 +1401,40 @@ void WM_paneltype_idname_visit_for_search( /* `wm_gesture_ops.cc` */ -int WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event); -int WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event); void WM_gesture_box_cancel(bContext *C, wmOperator *op); -int WM_gesture_circle_invoke(bContext *C, wmOperator *op, const wmEvent *event); -int WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_gesture_circle_invoke(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event); void WM_gesture_circle_cancel(bContext *C, wmOperator *op); -int WM_gesture_lines_invoke(bContext *C, wmOperator *op, const wmEvent *event); -int WM_gesture_lines_modal(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_gesture_lines_invoke(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_gesture_lines_modal(bContext *C, wmOperator *op, const wmEvent *event); void WM_gesture_lines_cancel(bContext *C, wmOperator *op); -int WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event); -int WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event); void WM_gesture_lasso_cancel(bContext *C, wmOperator *op); -int WM_gesture_polyline_invoke(bContext *C, wmOperator *op, const wmEvent *event); -int WM_gesture_polyline_modal(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_gesture_polyline_invoke(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_gesture_polyline_modal(bContext *C, wmOperator *op, const wmEvent *event); void WM_gesture_polyline_cancel(bContext *C, wmOperator *op); /** * helper function, we may want to add options for conversion to view space */ blender::Array WM_gesture_lasso_path_to_array(bContext *C, wmOperator *op); -int WM_gesture_straightline_invoke(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_gesture_straightline_invoke(bContext *C, wmOperator *op, const wmEvent *event); /** * This invoke callback starts the straight-line gesture with a viewport preview to the right side * of the line. */ -int WM_gesture_straightline_active_side_invoke(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_gesture_straightline_active_side_invoke(bContext *C, + wmOperator *op, + const wmEvent *event); /** * This modal callback calls exec once per mouse move event while the gesture is active with the * updated line start and end values, so it can be used for tools that have a real time preview * (like a gradient updating in real time over the mesh). */ -int WM_gesture_straightline_modal(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_gesture_straightline_modal(bContext *C, wmOperator *op, const wmEvent *event); /** * This modal one-shot callback only calls exec once after the gesture finishes without any updates * during the gesture execution. Should be used for operations that are intended to be applied once @@ -1436,7 +1442,9 @@ int WM_gesture_straightline_modal(bContext *C, wmOperator *op, const wmEvent *ev * after finishing the gesture as the bisect operation is too heavy to be computed in real time for * a preview). */ -int WM_gesture_straightline_oneshot_modal(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus WM_gesture_straightline_oneshot_modal(bContext *C, + wmOperator *op, + const wmEvent *event); void WM_gesture_straightline_cancel(bContext *C, wmOperator *op); /* Gesture manager API. */ @@ -1499,7 +1507,8 @@ void WM_operator_region_active_win_set(bContext *C); * intended to box-select. In this case it's preferred to select on CLICK instead of PRESS * (see the Outliner use of click-drag). */ -int WM_operator_flag_only_pass_through_on_press(int retval, const wmEvent *event); +wmOperatorStatus WM_operator_flag_only_pass_through_on_press(wmOperatorStatus retval, + const wmEvent *event); /* Drag and drop. */ diff --git a/source/blender/windowmanager/WM_types.hh b/source/blender/windowmanager/WM_types.hh index de693fab2cf..b5cb0bc83ac 100644 --- a/source/blender/windowmanager/WM_types.hh +++ b/source/blender/windowmanager/WM_types.hh @@ -1027,7 +1027,7 @@ struct wmOperatorType { * any interface code or input device state. * See defines below for return values. */ - int (*exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT; + wmOperatorStatus (*exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT; /** * This callback executes on a running operator whenever as property @@ -1043,7 +1043,9 @@ struct wmOperatorType { * canceled due to some external reason, cancel is called * See defines below for return values. */ - int (*invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT; + wmOperatorStatus (*invoke)(bContext *C, + wmOperator *op, + const wmEvent *event) ATTR_WARN_UNUSED_RESULT; /** * Called when a modal operator is canceled (not used often). @@ -1057,7 +1059,9 @@ struct wmOperatorType { * or execute other operators. They keep running until they don't return * `OPERATOR_RUNNING_MODAL`. */ - int (*modal)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT; + wmOperatorStatus (*modal)(bContext *C, + wmOperator *op, + const wmEvent *event) ATTR_WARN_UNUSED_RESULT; /** * Verify if the operator can be executed in the current context. Note diff --git a/source/blender/windowmanager/gizmo/WM_gizmo_api.hh b/source/blender/windowmanager/gizmo/WM_gizmo_api.hh index 1caf8e2cfd2..8bd69d71071 100644 --- a/source/blender/windowmanager/gizmo/WM_gizmo_api.hh +++ b/source/blender/windowmanager/gizmo/WM_gizmo_api.hh @@ -98,7 +98,10 @@ PointerRNA *WM_gizmo_operator_set(wmGizmo *gz, int part_index, wmOperatorType *ot, IDProperty *properties); -int WM_gizmo_operator_invoke(bContext *C, wmGizmo *gz, wmGizmoOpElem *gzop, const wmEvent *event); +wmOperatorStatus WM_gizmo_operator_invoke(bContext *C, + wmGizmo *gz, + wmGizmoOpElem *gzop, + const wmEvent *event); /* Callbacks. */ diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo.cc b/source/blender/windowmanager/gizmo/intern/wm_gizmo.cc index f7e179eeaed..794169caed8 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo.cc +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo.cc @@ -224,7 +224,10 @@ PointerRNA *WM_gizmo_operator_set(wmGizmo *gz, return &gzop.ptr; } -int WM_gizmo_operator_invoke(bContext *C, wmGizmo *gz, wmGizmoOpElem *gzop, const wmEvent *event) +wmOperatorStatus WM_gizmo_operator_invoke(bContext *C, + wmGizmo *gz, + wmGizmoOpElem *gzop, + const wmEvent *event) { if (gz->flag & WM_GIZMO_OPERATOR_TOOL_INIT) { /* Merge tool-settings into the gizmo properties. */ diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.cc b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.cc index 1b572eb4f2b..c675ee2396e 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.cc +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.cc @@ -330,7 +330,7 @@ bool wm_gizmogroup_is_any_selected(const wmGizmoGroup *gzgroup) * Basic operators for gizmo interaction with user configurable keymaps. * \{ */ -static int gizmo_select_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus gizmo_select_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { ARegion *region = CTX_wm_region(C); wmGizmoMap *gzmap = region->runtime->gizmo_map; @@ -476,11 +476,11 @@ static void gizmo_tweak_finish(bContext *C, wmOperator *op, const bool cancel, b MEM_freeN(mtweak); } -static int gizmo_tweak_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus gizmo_tweak_modal(bContext *C, wmOperator *op, const wmEvent *event) { GizmoTweakData *mtweak = static_cast(op->customdata); wmGizmo *gz = mtweak->gz_modal; - int retval = OPERATOR_PASS_THROUGH; + wmOperatorStatus retval = OPERATOR_PASS_THROUGH; bool clear_modal = true; if (gz == nullptr) { @@ -560,7 +560,7 @@ static int gizmo_tweak_modal(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_PASS_THROUGH; } -static int gizmo_tweak_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus gizmo_tweak_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); wmGizmoMap *gzmap = region->runtime->gizmo_map; diff --git a/source/blender/windowmanager/gizmo/wm_gizmo_fn.hh b/source/blender/windowmanager/gizmo/wm_gizmo_fn.hh index b74539ea9c2..f7268b27254 100644 --- a/source/blender/windowmanager/gizmo/wm_gizmo_fn.hh +++ b/source/blender/windowmanager/gizmo/wm_gizmo_fn.hh @@ -10,6 +10,8 @@ #pragma once +#include "DNA_windowmanager_enums.h" /* For `wmOperatorStatus`. */ + struct bContext; struct rcti; struct wmEvent; @@ -40,10 +42,13 @@ using wmGizmoFnSetup = void (*)(wmGizmo *); using wmGizmoFnDraw = void (*)(const bContext *, wmGizmo *); using wmGizmoFnDrawSelect = void (*)(const bContext *, wmGizmo *, int); using wmGizmoFnTestSelect = int (*)(bContext *, wmGizmo *, const int mval[2]); -using wmGizmoFnModal = int (*)(bContext *, wmGizmo *, const wmEvent *, eWM_GizmoFlagTweak); +using wmGizmoFnModal = wmOperatorStatus (*)(bContext *, + wmGizmo *, + const wmEvent *, + eWM_GizmoFlagTweak); using wmGizmoFnPropertyUpdate = void (*)(wmGizmo *, wmGizmoProperty *); using wmGizmoFnMatrixBasisGet = void (*)(const wmGizmo *, float[4][4]); -using wmGizmoFnInvoke = int (*)(bContext *, wmGizmo *, const wmEvent *); +using wmGizmoFnInvoke = wmOperatorStatus (*)(bContext *, wmGizmo *, const wmEvent *); using wmGizmoFnExit = void (*)(bContext *, wmGizmo *, const bool); using wmGizmoFnCursorGet = int (*)(wmGizmo *); using wmGizmoFnScreenBoundsGet = bool (*)(bContext *, wmGizmo *, rcti *r_bounding_box); diff --git a/source/blender/windowmanager/intern/wm_event_system.cc b/source/blender/windowmanager/intern/wm_event_system.cc index a4d04ebc86a..ed8d90e8ed0 100644 --- a/source/blender/windowmanager/intern/wm_event_system.cc +++ b/source/blender/windowmanager/intern/wm_event_system.cc @@ -125,13 +125,13 @@ ENUM_OPERATORS(eHandlerActionFlag, WM_HANDLER_MODAL); static void wm_notifier_clear(wmNotifier *note); static bool wm_notifier_is_clear(const wmNotifier *note); -static int wm_operator_call_internal(bContext *C, - wmOperatorType *ot, - PointerRNA *properties, - ReportList *reports, - const wmOperatorCallContext context, - const bool poll_only, - const wmEvent *event); +static wmOperatorStatus wm_operator_call_internal(bContext *C, + wmOperatorType *ot, + PointerRNA *properties, + ReportList *reports, + const wmOperatorCallContext context, + const bool poll_only, + const wmEvent *event); static bool wm_operator_check_locked_interface(bContext *C, wmOperatorType *ot); static wmEvent *wm_event_add_mousemove_to_head(wmWindow *win); @@ -1311,10 +1311,13 @@ static void wm_operator_finished(bContext *C, /** * \param repeat: When true, it doesn't register again, nor does it free. */ -static int wm_operator_exec(bContext *C, wmOperator *op, const bool repeat, const bool store) +static wmOperatorStatus wm_operator_exec(bContext *C, + wmOperator *op, + const bool repeat, + const bool store) { wmWindowManager *wm = CTX_wm_manager(C); - int retval = OPERATOR_CANCELLED; + wmOperatorStatus retval = OPERATOR_CANCELLED; CTX_wm_operator_poll_msg_clear(C); @@ -1369,9 +1372,9 @@ static int wm_operator_exec(bContext *C, wmOperator *op, const bool repeat, cons /** * Simply calls exec with basic checks. */ -static int wm_operator_exec_notest(bContext *C, wmOperator *op) +static wmOperatorStatus wm_operator_exec_notest(bContext *C, wmOperator *op) { - int retval = OPERATOR_CANCELLED; + wmOperatorStatus retval = OPERATOR_CANCELLED; if (op == nullptr || op->type == nullptr || op->type->exec == nullptr) { return retval; @@ -1383,34 +1386,34 @@ static int wm_operator_exec_notest(bContext *C, wmOperator *op) return retval; } -int WM_operator_call_ex(bContext *C, wmOperator *op, const bool store) +wmOperatorStatus WM_operator_call_ex(bContext *C, wmOperator *op, const bool store) { return wm_operator_exec(C, op, false, store); } -int WM_operator_call(bContext *C, wmOperator *op) +wmOperatorStatus WM_operator_call(bContext *C, wmOperator *op) { return WM_operator_call_ex(C, op, false); } -int WM_operator_call_notest(bContext *C, wmOperator *op) +wmOperatorStatus WM_operator_call_notest(bContext *C, wmOperator *op) { return wm_operator_exec_notest(C, op); } -int WM_operator_repeat(bContext *C, wmOperator *op) +wmOperatorStatus WM_operator_repeat(bContext *C, wmOperator *op) { const int op_flag = OP_IS_REPEAT; op->flag |= op_flag; - const int ret = wm_operator_exec(C, op, true, true); + const wmOperatorStatus ret = wm_operator_exec(C, op, true, true); op->flag &= ~op_flag; return ret; } -int WM_operator_repeat_last(bContext *C, wmOperator *op) +wmOperatorStatus WM_operator_repeat_last(bContext *C, wmOperator *op) { const int op_flag = OP_IS_REPEAT_LAST; op->flag |= op_flag; - const int ret = wm_operator_exec(C, op, true, true); + const wmOperatorStatus ret = wm_operator_exec(C, op, true, true); op->flag &= ~op_flag; return ret; } @@ -1577,20 +1580,20 @@ static void wm_region_mouse_co(bContext *C, wmEvent *event) /** * Also used for exec when 'event' is nullptr. */ -static int wm_operator_invoke(bContext *C, - wmOperatorType *ot, - const wmEvent *event, - PointerRNA *properties, - ReportList *reports, - const bool poll_only, - bool use_last_properties) +static wmOperatorStatus wm_operator_invoke(bContext *C, + wmOperatorType *ot, + const wmEvent *event, + PointerRNA *properties, + ReportList *reports, + const bool poll_only, + bool use_last_properties) { - int retval = OPERATOR_PASS_THROUGH; + wmOperatorStatus retval = OPERATOR_PASS_THROUGH; /* This is done because complicated setup is done to call this function * that is better not duplicated. */ if (poll_only) { - return WM_operator_poll(C, ot); + return wmOperatorStatus(WM_operator_poll(C, ot)); } if (WM_operator_poll(C, ot)) { @@ -1736,15 +1739,15 @@ static int wm_operator_invoke(bContext *C, * This is for python to access since its done the operator lookup * invokes operator in context. */ -static int wm_operator_call_internal(bContext *C, - wmOperatorType *ot, - PointerRNA *properties, - ReportList *reports, - const wmOperatorCallContext context, - const bool poll_only, - const wmEvent *event) +static wmOperatorStatus wm_operator_call_internal(bContext *C, + wmOperatorType *ot, + PointerRNA *properties, + ReportList *reports, + const wmOperatorCallContext context, + const bool poll_only, + const wmEvent *event) { - int retval; + wmOperatorStatus retval; CTX_wm_operator_poll_msg_clear(C); @@ -1765,7 +1768,7 @@ static int wm_operator_call_internal(bContext *C, if (poll_only) { CTX_wm_operator_poll_msg_set(C, "Missing 'window' in context"); } - return 0; + return wmOperatorStatus(0); } else { event = window->eventstate; @@ -1869,30 +1872,30 @@ static int wm_operator_call_internal(bContext *C, } } - return 0; + return wmOperatorStatus(0); } -int WM_operator_name_call_ptr(bContext *C, - wmOperatorType *ot, - wmOperatorCallContext context, - PointerRNA *properties, - const wmEvent *event) +wmOperatorStatus WM_operator_name_call_ptr(bContext *C, + wmOperatorType *ot, + wmOperatorCallContext context, + PointerRNA *properties, + const wmEvent *event) { BLI_assert(ot == WM_operatortype_find(ot->idname, true)); return wm_operator_call_internal(C, ot, properties, nullptr, context, false, event); } -int WM_operator_name_call(bContext *C, - const char *opstring, - wmOperatorCallContext context, - PointerRNA *properties, - const wmEvent *event) +wmOperatorStatus WM_operator_name_call(bContext *C, + const char *opstring, + wmOperatorCallContext context, + PointerRNA *properties, + const wmEvent *event) { wmOperatorType *ot = WM_operatortype_find(opstring, false); if (ot) { return WM_operator_name_call_ptr(C, ot, context, properties, event); } - return 0; + return wmOperatorStatus(0); } bool WM_operator_name_poll(bContext *C, const char *opstring) @@ -1905,11 +1908,11 @@ bool WM_operator_name_poll(bContext *C, const char *opstring) return WM_operator_poll(C, ot); } -int WM_operator_name_call_with_properties(bContext *C, - const char *opstring, - wmOperatorCallContext context, - IDProperty *properties, - const wmEvent *event) +wmOperatorStatus WM_operator_name_call_with_properties(bContext *C, + const char *opstring, + wmOperatorCallContext context, + IDProperty *properties, + const wmEvent *event) { wmOperatorType *ot = WM_operatortype_find(opstring, false); PointerRNA props_ptr = RNA_pointer_create_discrete( @@ -1934,7 +1937,7 @@ int WM_operator_call_py(bContext *C, ReportList *reports, const bool is_undo) { - int retval = OPERATOR_CANCELLED; + wmOperatorStatus retval = OPERATOR_CANCELLED; /* Not especially nice using undo depth here. It's used so Python never * triggers undo or stores an operator's last used state. */ wmWindowManager *wm = CTX_wm_manager(C); diff --git a/source/blender/windowmanager/intern/wm_files.cc b/source/blender/windowmanager/intern/wm_files.cc index 3f80e48d4bc..d4341caedc9 100644 --- a/source/blender/windowmanager/intern/wm_files.cc +++ b/source/blender/windowmanager/intern/wm_files.cc @@ -2483,7 +2483,7 @@ void wm_open_init_use_scripts(wmOperator *op, bool use_prefs) * \see #wm_file_write wraps #BLO_write_file in a similar way. * \return success. */ -static int wm_homefile_write_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_homefile_write_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); wmWindowManager *wm = CTX_wm_manager(C); @@ -2549,7 +2549,9 @@ static int wm_homefile_write_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int wm_homefile_write_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus wm_homefile_write_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (!U.app_template[0]) { return WM_operator_confirm_ex(C, @@ -2593,7 +2595,7 @@ void WM_OT_save_homefile(wmOperatorType *ot) * \{ */ /* Only save the prefs block. operator entry. */ -static int wm_userpref_write_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_userpref_write_exec(bContext *C, wmOperator *op) { wmWindowManager *wm = CTX_wm_manager(C); @@ -2689,7 +2691,7 @@ static void wm_userpref_update_when_changed(bContext *C, userdef_curr->runtime.is_dirty = is_dirty; } -static int wm_userpref_read_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_userpref_read_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); const bool use_data = false; @@ -2742,7 +2744,9 @@ void WM_OT_read_userpref(wmOperatorType *ot) ot->exec = wm_userpref_read_exec; } -static int wm_userpref_read_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus wm_userpref_read_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { std::string title; @@ -2789,7 +2793,7 @@ void WM_OT_read_factory_userpref(wmOperatorType *ot) /** \name Read File History Operator * \{ */ -static int wm_history_file_read_exec(bContext * /*C*/, wmOperator * /*op*/) +static wmOperatorStatus wm_history_file_read_exec(bContext * /*C*/, wmOperator * /*op*/) { ED_file_read_bookmarks(); wm_history_file_read(); @@ -2817,7 +2821,7 @@ void WM_OT_read_history(wmOperatorType *ot) * Both #WM_OT_read_homefile & #WM_OT_read_factory_settings. * \{ */ -static int wm_homefile_read_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_homefile_read_exec(bContext *C, wmOperator *op) { const bool use_factory_startup_and_userdef = STREQ(op->type->idname, "WM_OT_read_factory_settings"); @@ -2931,7 +2935,9 @@ static void wm_homefile_read_after_dialog_callback(bContext *C, void *user_data) C, "WM_OT_read_homefile", WM_OP_EXEC_DEFAULT, (IDProperty *)user_data, nullptr); } -static int wm_homefile_read_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus wm_homefile_read_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (wm_operator_close_file_dialog_if_needed(C, op, wm_homefile_read_after_dialog_callback)) { return OPERATOR_INTERFACE; @@ -3001,7 +3007,9 @@ void WM_OT_read_homefile(wmOperatorType *ot) /* Omit poll to run in background mode. */ } -static int wm_read_factory_settings_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus wm_read_factory_settings_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { const bool unsaved = wm_file_or_session_data_has_unsaved_changes(CTX_data_main(C), CTX_wm_manager(C)); @@ -3095,10 +3103,12 @@ static void set_next_operator_state(wmOperator *op, int state) struct OperatorDispatchTarget { int state; - int (*run)(bContext *C, wmOperator *op); + wmOperatorStatus (*run)(bContext *C, wmOperator *op); }; -static int operator_state_dispatch(bContext *C, wmOperator *op, OperatorDispatchTarget *targets) +static wmOperatorStatus operator_state_dispatch(bContext *C, + wmOperator *op, + OperatorDispatchTarget *targets) { int state = get_operator_state(op); for (int i = 0; targets[i].run; i++) { @@ -3123,7 +3133,7 @@ enum { OPEN_MAINFILE_STATE_OPEN, }; -static int wm_open_mainfile_dispatch(bContext *C, wmOperator *op); +static wmOperatorStatus wm_open_mainfile_dispatch(bContext *C, wmOperator *op); static void wm_open_mainfile_after_dialog_callback(bContext *C, void *user_data) { @@ -3131,7 +3141,7 @@ static void wm_open_mainfile_after_dialog_callback(bContext *C, void *user_data) C, "WM_OT_open_mainfile", WM_OP_INVOKE_DEFAULT, (IDProperty *)user_data, nullptr); } -static int wm_open_mainfile__discard_changes(bContext *C, wmOperator *op) +static wmOperatorStatus wm_open_mainfile__discard_changes_exec(bContext *C, wmOperator *op) { if (RNA_boolean_get(op->ptr, "display_file_selector")) { set_next_operator_state(op, OPEN_MAINFILE_STATE_SELECT_FILE_PATH); @@ -3146,7 +3156,7 @@ static int wm_open_mainfile__discard_changes(bContext *C, wmOperator *op) return wm_open_mainfile_dispatch(C, op); } -static int wm_open_mainfile__select_file_path(bContext *C, wmOperator *op) +static wmOperatorStatus wm_open_mainfile__select_file_path_exec(bContext *C, wmOperator *op) { set_next_operator_state(op, OPEN_MAINFILE_STATE_OPEN); @@ -3177,7 +3187,7 @@ static int wm_open_mainfile__select_file_path(bContext *C, wmOperator *op) return OPERATOR_RUNNING_MODAL; } -static int wm_open_mainfile__open(bContext *C, wmOperator *op) +static wmOperatorStatus wm_open_mainfile__open(bContext *C, wmOperator *op) { char filepath[FILE_MAX]; bool success; @@ -3207,23 +3217,25 @@ static int wm_open_mainfile__open(bContext *C, wmOperator *op) } static OperatorDispatchTarget wm_open_mainfile_dispatch_targets[] = { - {OPEN_MAINFILE_STATE_DISCARD_CHANGES, wm_open_mainfile__discard_changes}, - {OPEN_MAINFILE_STATE_SELECT_FILE_PATH, wm_open_mainfile__select_file_path}, + {OPEN_MAINFILE_STATE_DISCARD_CHANGES, wm_open_mainfile__discard_changes_exec}, + {OPEN_MAINFILE_STATE_SELECT_FILE_PATH, wm_open_mainfile__select_file_path_exec}, {OPEN_MAINFILE_STATE_OPEN, wm_open_mainfile__open}, {0, nullptr}, }; -static int wm_open_mainfile_dispatch(bContext *C, wmOperator *op) +static wmOperatorStatus wm_open_mainfile_dispatch(bContext *C, wmOperator *op) { return operator_state_dispatch(C, op, wm_open_mainfile_dispatch_targets); } -static int wm_open_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus wm_open_mainfile_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { return wm_open_mainfile_dispatch(C, op); } -static int wm_open_mainfile_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_open_mainfile_exec(bContext *C, wmOperator *op) { return wm_open_mainfile__open(C, op); } @@ -3373,7 +3385,9 @@ void WM_OT_open_mainfile(wmOperatorType *ot) /** \name Reload (revert) Main .blend File Operator * \{ */ -static int wm_revert_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus wm_revert_mainfile_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { std::string message = IFACE_("Any unsaved changes will be lost."); if (ED_image_should_save_modified(CTX_data_main(C))) { @@ -3390,7 +3404,7 @@ static int wm_revert_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent false); } -static int wm_revert_mainfile_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_revert_mainfile_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); bool success; @@ -3444,7 +3458,7 @@ bool WM_file_recover_last_session(bContext *C, ReportList *reports) return success; } -static int wm_recover_last_session_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_recover_last_session_exec(bContext *C, wmOperator *op) { wm_open_init_use_scripts(op, true); SET_FLAG_FROM_TEST(G.f, RNA_boolean_get(op->ptr, "use_scripts"), G_FLAG_SCRIPT_AUTOEXEC); @@ -3467,7 +3481,9 @@ static void wm_recover_last_session_after_dialog_callback(bContext *C, void *use C, "WM_OT_recover_last_session", WM_OP_EXEC_DEFAULT, (IDProperty *)user_data, nullptr); } -static int wm_recover_last_session_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus wm_recover_last_session_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { /* Keep the current setting instead of using the preferences since a file selector * doesn't give us the option to change the setting. */ @@ -3499,7 +3515,7 @@ void WM_OT_recover_last_session(wmOperatorType *ot) /** \name Auto-Save Main .blend File Operator * \{ */ -static int wm_recover_auto_save_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_recover_auto_save_exec(bContext *C, wmOperator *op) { char filepath[FILE_MAX]; bool success; @@ -3529,7 +3545,9 @@ static int wm_recover_auto_save_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -static int wm_recover_auto_save_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus wm_recover_auto_save_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { char filepath[FILE_MAX]; @@ -3628,7 +3646,9 @@ static void save_set_filepath(bContext *C, wmOperator *op) } } -static int wm_save_as_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus wm_save_as_mainfile_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { save_set_compress(op); @@ -3645,7 +3665,7 @@ static int wm_save_as_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent } /* Function used for #WM_OT_save_mainfile too. */ -static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_save_as_mainfile_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); char filepath[FILE_MAX]; @@ -3837,9 +3857,11 @@ void WM_OT_save_as_mainfile(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } -static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus wm_save_mainfile_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { - int ret; + wmOperatorStatus ret; /* Cancel if no active window. */ if (CTX_wm_window(C) == nullptr) { @@ -3942,13 +3964,15 @@ static const EnumPropertyItem prop_clear_recent_types[] = { {0, nullptr, 0, nullptr, nullptr}, }; -static int wm_clear_recent_files_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus wm_clear_recent_files_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { return WM_operator_props_popup_confirm_ex( C, op, event, IFACE_("Clear Recent Files List"), IFACE_("Remove")); } -static int wm_clear_recent_files_exec(bContext * /*C*/, wmOperator *op) +static wmOperatorStatus wm_clear_recent_files_exec(bContext * /*C*/, wmOperator *op) { ClearRecentInclude include = static_cast(RNA_enum_get(op->ptr, "remove")); diff --git a/source/blender/windowmanager/intern/wm_files_link.cc b/source/blender/windowmanager/intern/wm_files_link.cc index 7187956be19..6588a39f54a 100644 --- a/source/blender/windowmanager/intern/wm_files_link.cc +++ b/source/blender/windowmanager/intern/wm_files_link.cc @@ -87,7 +87,9 @@ static bool wm_link_append_poll(bContext *C) return false; } -static int wm_link_append_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus wm_link_append_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { if (!RNA_struct_property_is_set(op->ptr, "filepath")) { const char *blendfile_path = BKE_main_blendfile_path_from_global(); @@ -193,7 +195,7 @@ static bool wm_link_append_item_poll(ReportList *reports, return true; } -static int wm_link_append_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_link_append_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -598,7 +600,9 @@ ID *WM_file_append_datablock(Main *bmain, /** \name Library Relocate Operator & Library Reload API * \{ */ -static int wm_lib_relocate_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus wm_lib_relocate_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { Library *lib; char lib_name[MAX_NAME]; @@ -673,7 +677,7 @@ void WM_lib_reload(Library *lib, bContext *C, ReportList *reports) WM_event_add_notifier(C, NC_WINDOW, nullptr); } -static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, bool do_reload) +static wmOperatorStatus wm_lib_relocate_exec_do(bContext *C, wmOperator *op, bool do_reload) { Main *bmain = CTX_data_main(C); char lib_name[MAX_NAME]; @@ -814,7 +818,7 @@ static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, bool do_reload) return OPERATOR_FINISHED; } -static int wm_lib_relocate_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_lib_relocate_exec(bContext *C, wmOperator *op) { return wm_lib_relocate_exec_do(C, op, false); } @@ -845,7 +849,7 @@ void WM_OT_lib_relocate(wmOperatorType *ot) FILE_SORT_DEFAULT); } -static int wm_lib_reload_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_lib_reload_exec(bContext *C, wmOperator *op) { return wm_lib_relocate_exec_do(C, op, true); } diff --git a/source/blender/windowmanager/intern/wm_gesture_ops.cc b/source/blender/windowmanager/intern/wm_gesture_ops.cc index 2c4796c2c90..fa6edb15df5 100644 --- a/source/blender/windowmanager/intern/wm_gesture_ops.cc +++ b/source/blender/windowmanager/intern/wm_gesture_ops.cc @@ -168,7 +168,7 @@ static bool gesture_box_apply(bContext *C, wmOperator *op) return (retval & OPERATOR_FINISHED) ? true : false; } -int WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event) +wmOperatorStatus WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event) { wmWindow *win = CTX_wm_window(C); const ARegion *region = CTX_wm_region(C); @@ -195,7 +195,7 @@ int WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -int WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event) +wmOperatorStatus WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event) { wmWindow *win = CTX_wm_window(C); wmGesture *gesture = static_cast(op->customdata); @@ -291,7 +291,7 @@ void WM_gesture_box_cancel(bContext *C, wmOperator *op) static void gesture_circle_apply(bContext *C, wmOperator *op); -int WM_gesture_circle_invoke(bContext *C, wmOperator *op, const wmEvent *event) +wmOperatorStatus WM_gesture_circle_invoke(bContext *C, wmOperator *op, const wmEvent *event) { wmWindow *win = CTX_wm_window(C); const bool wait_for_input = !WM_event_is_mouse_drag_or_press(event) && @@ -350,7 +350,7 @@ static void gesture_circle_apply(bContext *C, wmOperator *op) } } -int WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event) +wmOperatorStatus WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event) { wmWindow *win = CTX_wm_window(C); wmGesture *gesture = static_cast(op->customdata); @@ -483,7 +483,7 @@ void WM_OT_circle_gesture(wmOperatorType *ot) * The operator stores data in the "path" property as a series of screen space positions. * \{ */ -int WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event) +wmOperatorStatus WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event) { wmWindow *win = CTX_wm_window(C); PropertyRNA *prop; @@ -504,7 +504,7 @@ int WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -int WM_gesture_lines_invoke(bContext *C, wmOperator *op, const wmEvent *event) +wmOperatorStatus WM_gesture_lines_invoke(bContext *C, wmOperator *op, const wmEvent *event) { wmWindow *win = CTX_wm_window(C); PropertyRNA *prop; @@ -527,9 +527,9 @@ int WM_gesture_lines_invoke(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static int gesture_lasso_apply(bContext *C, wmOperator *op) +static wmOperatorStatus gesture_lasso_apply(bContext *C, wmOperator *op) { - int retval = OPERATOR_FINISHED; + wmOperatorStatus retval = OPERATOR_FINISHED; wmGesture *gesture = static_cast(op->customdata); PointerRNA itemptr; float loc[2]; @@ -556,7 +556,7 @@ static int gesture_lasso_apply(bContext *C, wmOperator *op) return retval; } -int WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event) +wmOperatorStatus WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event) { wmGesture *gesture = static_cast(op->customdata); const float factor = gesture->use_smooth ? RNA_float_get(op->ptr, "smooth_stroke_factor") : 0.0f; @@ -638,7 +638,7 @@ int WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -int WM_gesture_lines_modal(bContext *C, wmOperator *op, const wmEvent *event) +wmOperatorStatus WM_gesture_lines_modal(bContext *C, wmOperator *op, const wmEvent *event) { return WM_gesture_lasso_modal(C, op, event); } @@ -682,7 +682,7 @@ Array WM_gesture_lasso_path_to_array(bContext * /*C*/, wmOperator *op) #if 0 /* Template to copy from. */ -static int gesture_lasso_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gesture_lasso_exec(bContext *C, wmOperator *op) { RNA_BEGIN (op->ptr, itemptr, "path") { float loc[2]; @@ -725,7 +725,7 @@ void WM_OT_lasso_gesture(wmOperatorType *ot) * Like the Lasso Gesture, the data passed onto other operators via the 'path' property is a * sequential array of mouse positions. * \{ */ -int WM_gesture_polyline_invoke(bContext *C, wmOperator *op, const wmEvent *event) +wmOperatorStatus WM_gesture_polyline_invoke(bContext *C, wmOperator *op, const wmEvent *event) { wmWindow *win = CTX_wm_window(C); PropertyRNA *prop; @@ -785,7 +785,9 @@ static bool gesture_polyline_can_apply(const wmGesture &wmGesture, const bool is return true; } -static int gesture_polyline_apply(bContext *C, wmOperator *op, const bool is_click_submitted) +static wmOperatorStatus gesture_polyline_apply(bContext *C, + wmOperator *op, + const bool is_click_submitted) { wmGesture *gesture = static_cast(op->customdata); BLI_assert(gesture_polyline_can_apply(*gesture, is_click_submitted)); @@ -811,7 +813,7 @@ static int gesture_polyline_apply(bContext *C, wmOperator *op, const bool is_cli gesture_modal_end(C, op); - int retval = OPERATOR_FINISHED; + wmOperatorStatus retval = OPERATOR_FINISHED; if (op->type->exec) { retval = op->type->exec(C, op); OPERATOR_RETVAL_CHECK(retval); @@ -820,7 +822,7 @@ static int gesture_polyline_apply(bContext *C, wmOperator *op, const bool is_cli return retval; } -int WM_gesture_polyline_modal(bContext *C, wmOperator *op, const wmEvent *event) +wmOperatorStatus WM_gesture_polyline_modal(bContext *C, wmOperator *op, const wmEvent *event) { wmGesture *gesture = static_cast(op->customdata); @@ -905,7 +907,7 @@ void WM_gesture_polyline_cancel(bContext *C, wmOperator *op) /* template to copy from */ #if 0 -static int gesture_polyline_exec(bContext *C, wmOperator *op) +static wmOperatorStatus gesture_polyline_exec(bContext *C, wmOperator *op) { RNA_BEGIN (op->ptr, itemptr, "path") { float loc[2]; @@ -995,7 +997,7 @@ static bool gesture_straightline_apply(bContext *C, wmOperator *op) return true; } -int WM_gesture_straightline_invoke(bContext *C, wmOperator *op, const wmEvent *event) +wmOperatorStatus WM_gesture_straightline_invoke(bContext *C, wmOperator *op, const wmEvent *event) { wmWindow *win = CTX_wm_window(C); PropertyRNA *prop; @@ -1018,7 +1020,9 @@ int WM_gesture_straightline_invoke(bContext *C, wmOperator *op, const wmEvent *e return OPERATOR_RUNNING_MODAL; } -int WM_gesture_straightline_active_side_invoke(bContext *C, wmOperator *op, const wmEvent *event) +wmOperatorStatus WM_gesture_straightline_active_side_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { WM_gesture_straightline_invoke(C, op, event); wmGesture *gesture = static_cast(op->customdata); @@ -1066,7 +1070,7 @@ static void wm_gesture_straightline_do_angle_snap(rcti *rect, float snap_angle) } } -int WM_gesture_straightline_modal(bContext *C, wmOperator *op, const wmEvent *event) +wmOperatorStatus WM_gesture_straightline_modal(bContext *C, wmOperator *op, const wmEvent *event) { const Scene *scene = CTX_data_scene(C); const ScrArea *area = CTX_wm_area(C); @@ -1150,7 +1154,9 @@ int WM_gesture_straightline_modal(bContext *C, wmOperator *op, const wmEvent *ev return OPERATOR_RUNNING_MODAL; } -int WM_gesture_straightline_oneshot_modal(bContext *C, wmOperator *op, const wmEvent *event) +wmOperatorStatus WM_gesture_straightline_oneshot_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { const Scene *scene = CTX_data_scene(C); const ScrArea *area = CTX_wm_area(C); diff --git a/source/blender/windowmanager/intern/wm_operator_type.cc b/source/blender/windowmanager/intern/wm_operator_type.cc index fa3e6745cd0..c22afdec507 100644 --- a/source/blender/windowmanager/intern/wm_operator_type.cc +++ b/source/blender/windowmanager/intern/wm_operator_type.cc @@ -320,7 +320,7 @@ static void wm_macro_start(wmOperator *op) } } -static int wm_macro_end(wmOperator *op, int retval) +static wmOperatorStatus wm_macro_end(wmOperator *op, wmOperatorStatus retval) { if (retval & OPERATOR_CANCELLED) { MacroData *md = static_cast(op->customdata); @@ -343,9 +343,9 @@ static int wm_macro_end(wmOperator *op, int retval) } /* Macro exec only runs exec calls. */ -static int wm_macro_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_macro_exec(bContext *C, wmOperator *op) { - int retval = OPERATOR_FINISHED; + wmOperatorStatus retval = OPERATOR_FINISHED; const int op_inherited_flag = op->flag & (OP_IS_REPEAT | OP_IS_REPEAT_LAST); wm_macro_start(op); @@ -374,12 +374,12 @@ 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, - const wmEvent *event, - wmOperator *opm) +static wmOperatorStatus wm_macro_invoke_internal(bContext *C, + wmOperator *op, + const wmEvent *event, + wmOperator *opm) { - int retval = OPERATOR_FINISHED; + wmOperatorStatus retval = OPERATOR_FINISHED; const int op_inherited_flag = op->flag & (OP_IS_REPEAT | OP_IS_REPEAT_LAST); /* Start from operator received as argument. */ @@ -410,16 +410,16 @@ static int wm_macro_invoke_internal(bContext *C, return wm_macro_end(op, retval); } -static int wm_macro_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus wm_macro_invoke(bContext *C, wmOperator *op, const wmEvent *event) { wm_macro_start(op); return wm_macro_invoke_internal(C, op, event, static_cast(op->macro.first)); } -static int wm_macro_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus wm_macro_modal(bContext *C, wmOperator *op, const wmEvent *event) { wmOperator *opm = op->opm; - int retval = OPERATOR_FINISHED; + wmOperatorStatus retval = OPERATOR_FINISHED; if (opm == nullptr) { CLOG_ERROR(WM_LOG_OPERATORS, "macro error, calling nullptr modal()"); diff --git a/source/blender/windowmanager/intern/wm_operator_utils.cc b/source/blender/windowmanager/intern/wm_operator_utils.cc index 4d7fdda6d35..687290fecae 100644 --- a/source/blender/windowmanager/intern/wm_operator_utils.cc +++ b/source/blender/windowmanager/intern/wm_operator_utils.cc @@ -35,7 +35,8 @@ using blender::Vector; /** \name Generic Utilities * \{ */ -int WM_operator_flag_only_pass_through_on_press(int retval, const wmEvent *event) +wmOperatorStatus WM_operator_flag_only_pass_through_on_press(wmOperatorStatus retval, + const wmEvent *event) { if (event->val != KM_PRESS) { if (retval & OPERATOR_PASS_THROUGH) { @@ -197,7 +198,7 @@ static void op_generic_value_cancel(bContext * /*C*/, wmOperator *op) op_generic_value_exit(op); } -static int op_generic_value_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus op_generic_value_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (RNA_property_is_set(op->ptr, op->type->prop)) { return WM_operator_call_notest(C, op); @@ -236,7 +237,7 @@ static int op_generic_value_invoke(bContext *C, wmOperator *op, const wmEvent *e return OPERATOR_RUNNING_MODAL; } -static int op_generic_value_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus op_generic_value_modal(bContext *C, wmOperator *op, const wmEvent *event) { ObCustomData_ForEditMode *cd = static_cast(op->customdata); diff --git a/source/blender/windowmanager/intern/wm_operators.cc b/source/blender/windowmanager/intern/wm_operators.cc index e8b21a5d25c..124a493345f 100644 --- a/source/blender/windowmanager/intern/wm_operators.cc +++ b/source/blender/windowmanager/intern/wm_operators.cc @@ -972,12 +972,11 @@ bool WM_operator_last_properties_store(wmOperator * /*op*/) /** \name Default Operator Callbacks * \{ */ -int WM_generic_select_modal(bContext *C, wmOperator *op, const wmEvent *event) +wmOperatorStatus WM_generic_select_modal(bContext *C, wmOperator *op, const wmEvent *event) { PropertyRNA *wait_to_deselect_prop = RNA_struct_find_property(op->ptr, "wait_to_deselect_others"); const short init_event_type = short(POINTER_AS_INT(op->customdata)); - int ret_value = 0; /* Get settings from RNA properties for operator. */ const int mval[2] = {RNA_int_get(op->ptr, "mouse_x"), RNA_int_get(op->ptr, "mouse_y")}; @@ -986,7 +985,7 @@ int WM_generic_select_modal(bContext *C, wmOperator *op, const wmEvent *event) if (event->val == KM_PRESS) { RNA_property_boolean_set(op->ptr, wait_to_deselect_prop, true); - ret_value = op->type->exec(C, op); + wmOperatorStatus ret_value = op->type->exec(C, op); OPERATOR_RETVAL_CHECK(ret_value); op->customdata = POINTER_FROM_INT(int(event->type)); if (ret_value & OPERATOR_RUNNING_MODAL) { @@ -999,7 +998,7 @@ int WM_generic_select_modal(bContext *C, wmOperator *op, const wmEvent *event) */ RNA_property_boolean_set(op->ptr, wait_to_deselect_prop, false); - ret_value = op->type->exec(C, op); + wmOperatorStatus ret_value = op->type->exec(C, op); OPERATOR_RETVAL_CHECK(ret_value); return ret_value | OPERATOR_PASS_THROUGH; @@ -1007,7 +1006,7 @@ int WM_generic_select_modal(bContext *C, wmOperator *op, const wmEvent *event) if (event->type == init_event_type && event->val == KM_RELEASE) { RNA_property_boolean_set(op->ptr, wait_to_deselect_prop, false); - ret_value = op->type->exec(C, op); + wmOperatorStatus ret_value = op->type->exec(C, op); OPERATOR_RETVAL_CHECK(ret_value); return ret_value | OPERATOR_PASS_THROUGH; @@ -1031,7 +1030,7 @@ int WM_generic_select_modal(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL | OPERATOR_PASS_THROUGH; } -int WM_generic_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) +wmOperatorStatus WM_generic_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ARegion *region = CTX_wm_region(C); @@ -1080,7 +1079,7 @@ int WM_operator_smooth_viewtx_get(const wmOperator *op) return (op->flag & OP_IS_INVOKE) ? U.smooth_viewtx : 0; } -int WM_menu_invoke_ex(bContext *C, wmOperator *op, wmOperatorCallContext opcontext) +wmOperatorStatus WM_menu_invoke_ex(bContext *C, wmOperator *op, wmOperatorCallContext opcontext) { PropertyRNA *prop = op->type->prop; @@ -1094,7 +1093,7 @@ int WM_menu_invoke_ex(bContext *C, wmOperator *op, wmOperatorCallContext opconte RNA_property_identifier(prop)); } else if (RNA_property_is_set(op->ptr, prop)) { - const int retval = op->type->exec(C, op); + const wmOperatorStatus retval = op->type->exec(C, op); OPERATOR_RETVAL_CHECK(retval); return retval; } @@ -1117,7 +1116,7 @@ int WM_menu_invoke_ex(bContext *C, wmOperator *op, wmOperatorCallContext opconte return OPERATOR_CANCELLED; } -int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { return WM_menu_invoke_ex(C, op, WM_OP_INVOKE_REGION_WIN); } @@ -1192,7 +1191,7 @@ static uiBlock *wm_enum_search_menu(bContext *C, ARegion *region, void *arg) return block; } -int WM_enum_search_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +wmOperatorStatus WM_enum_search_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { static EnumSearchMenu search_menu; search_menu.op = op; @@ -1202,12 +1201,12 @@ int WM_enum_search_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/ return OPERATOR_INTERFACE; } -int WM_operator_confirm_message_ex(bContext *C, - wmOperator *op, - const char *title, - const int icon, - const char *message, - const wmOperatorCallContext /*opcontext*/) +wmOperatorStatus WM_operator_confirm_message_ex(bContext *C, + wmOperator *op, + const char *title, + const int icon, + const char *message, + const wmOperatorCallContext /*opcontext*/) { int alert_icon = ALERT_ICON_QUESTION; switch (icon) { @@ -1230,19 +1229,21 @@ int WM_operator_confirm_message_ex(bContext *C, return WM_operator_confirm_ex(C, op, IFACE_(title), nullptr, IFACE_(message), alert_icon, false); } -int WM_operator_confirm_message(bContext *C, wmOperator *op, const char *message) +wmOperatorStatus WM_operator_confirm_message(bContext *C, wmOperator *op, const char *message) { return WM_operator_confirm_ex( C, op, IFACE_(message), nullptr, IFACE_("OK"), ALERT_ICON_NONE, false); } -int WM_operator_confirm(bContext *C, wmOperator *op, const wmEvent * /*event*/) +wmOperatorStatus WM_operator_confirm(bContext *C, wmOperator *op, const wmEvent * /*event*/) { return WM_operator_confirm_ex( C, op, IFACE_(op->type->name), nullptr, IFACE_("OK"), ALERT_ICON_NONE, false); } -int WM_operator_confirm_or_exec(bContext *C, wmOperator *op, const wmEvent * /*event*/) +wmOperatorStatus WM_operator_confirm_or_exec(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { const bool confirm = RNA_boolean_get(op->ptr, "confirm"); if (confirm) { @@ -1252,7 +1253,7 @@ int WM_operator_confirm_or_exec(bContext *C, wmOperator *op, const wmEvent * /*e return op->type->exec(C, op); } -int WM_operator_filesel(bContext *C, wmOperator *op, const wmEvent * /*event*/) +wmOperatorStatus WM_operator_filesel(bContext *C, wmOperator *op, const wmEvent * /*event*/) { if (RNA_struct_property_is_set(op->ptr, "filepath")) { return WM_operator_call_notest(C, op); /* Call exec direct. */ @@ -1732,13 +1733,13 @@ static void wm_operator_ui_popup_ok(bContext *C, void *arg, int retval) MEM_delete(data); } -int WM_operator_confirm_ex(bContext *C, - wmOperator *op, - const char *title, - const char *message, - const char *confirm_text, - int icon, - bool cancel_default) +wmOperatorStatus WM_operator_confirm_ex(bContext *C, + wmOperator *op, + const char *title, + const char *message, + const char *confirm_text, + int icon, + bool cancel_default) { wmOpPopUp *data = MEM_new(__func__); data->op = op; @@ -1765,7 +1766,7 @@ int WM_operator_confirm_ex(bContext *C, return OPERATOR_RUNNING_MODAL; } -int WM_operator_ui_popup(bContext *C, wmOperator *op, int width) +wmOperatorStatus WM_operator_ui_popup(bContext *C, wmOperator *op, int width) { wmOpPopUp *data = MEM_new(__func__); data->op = op; @@ -1780,13 +1781,14 @@ int WM_operator_ui_popup(bContext *C, wmOperator *op, int width) * * \note operator menu needs undo flag enabled, for redo callback. */ -static int wm_operator_props_popup_ex(bContext *C, - wmOperator *op, - const bool do_call, - const bool do_redo, - std::optional title = std::nullopt, - std::optional confirm_text = std::nullopt, - const bool cancel_default = false) +static wmOperatorStatus wm_operator_props_popup_ex( + bContext *C, + wmOperator *op, + const bool do_call, + const bool do_redo, + std::optional title = std::nullopt, + std::optional confirm_text = std::nullopt, + const bool cancel_default = false) { if ((op->type->flag & OPTYPE_REGISTER) == 0) { BKE_reportf(op->reports, @@ -1821,37 +1823,41 @@ static int wm_operator_props_popup_ex(bContext *C, return OPERATOR_RUNNING_MODAL; } -int WM_operator_props_popup_confirm_ex(bContext *C, - wmOperator *op, - const wmEvent * /*event*/, - std::optional title, - std::optional confirm_text, - const bool cancel_default) +wmOperatorStatus WM_operator_props_popup_confirm_ex(bContext *C, + wmOperator *op, + const wmEvent * /*event*/, + std::optional title, + std::optional confirm_text, + const bool cancel_default) { return wm_operator_props_popup_ex(C, op, false, false, title, confirm_text, cancel_default); } -int WM_operator_props_popup_confirm(bContext *C, wmOperator *op, const wmEvent * /*event*/) +wmOperatorStatus WM_operator_props_popup_confirm(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { return wm_operator_props_popup_ex(C, op, false, false, {}, {}); } -int WM_operator_props_popup_call(bContext *C, wmOperator *op, const wmEvent * /*event*/) +wmOperatorStatus WM_operator_props_popup_call(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { return wm_operator_props_popup_ex(C, op, true, true); } -int WM_operator_props_popup(bContext *C, wmOperator *op, const wmEvent * /*event*/) +wmOperatorStatus WM_operator_props_popup(bContext *C, wmOperator *op, const wmEvent * /*event*/) { return wm_operator_props_popup_ex(C, op, false, true); } -int WM_operator_props_dialog_popup(bContext *C, - wmOperator *op, - int width, - std::optional title, - std::optional confirm_text, - const bool cancel_default) +wmOperatorStatus WM_operator_props_dialog_popup(bContext *C, + wmOperator *op, + int width, + std::optional title, + std::optional confirm_text, + const bool cancel_default) { wmOpPopUp *data = MEM_new(__func__); data->op = op; @@ -1874,7 +1880,7 @@ int WM_operator_props_dialog_popup(bContext *C, return OPERATOR_RUNNING_MODAL; } -int WM_operator_redo_popup(bContext *C, wmOperator *op) +wmOperatorStatus WM_operator_redo_popup(bContext *C, wmOperator *op) { /* `CTX_wm_reports(C)` because operator is on stack, not active in event system. */ if ((op->type->flag & OPTYPE_REGISTER) == 0) { @@ -1905,7 +1911,7 @@ int WM_operator_redo_popup(bContext *C, wmOperator *op) * Set internal debug value, mainly for developers. * \{ */ -static int wm_debug_menu_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_debug_menu_exec(bContext *C, wmOperator *op) { G.debug_value = RNA_int_get(op->ptr, "debug_value"); ED_screen_refresh(C, CTX_wm_manager(C), CTX_wm_window(C)); @@ -1914,7 +1920,9 @@ static int wm_debug_menu_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int wm_debug_menu_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus wm_debug_menu_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { RNA_int_set(op->ptr, "debug_value", G.debug_value); return WM_operator_props_dialog_popup(C, op, 250, IFACE_("Set Debug Value"), IFACE_("Set")); @@ -1940,7 +1948,7 @@ static void WM_OT_debug_menu(wmOperatorType *ot) /** \name Reset Defaults Operator * \{ */ -static int wm_operator_defaults_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_operator_defaults_exec(bContext *C, wmOperator *op) { PointerRNA ptr = CTX_data_pointer_get_type(C, "active_operator", &RNA_Operator); @@ -2040,12 +2048,12 @@ static uiBlock *wm_block_search_menu(bContext *C, ARegion *region, void *userdat return block; } -static int wm_search_menu_exec(bContext * /*C*/, wmOperator * /*op*/) +static wmOperatorStatus wm_search_menu_exec(bContext * /*C*/, wmOperator * /*op*/) { return OPERATOR_FINISHED; } -static int wm_search_menu_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus wm_search_menu_invoke(bContext *C, wmOperator *op, const wmEvent *event) { /* Exception for launching via space-bar. */ if (event->type == EVT_SPACEKEY) { @@ -2152,7 +2160,7 @@ static void WM_OT_search_single_menu(wmOperatorType *ot) "Query to insert into the search box"); } -static int wm_call_menu_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_call_menu_exec(bContext *C, wmOperator *op) { char idname[BKE_ST_MAXNAME]; RNA_string_get(op->ptr, "name", idname); @@ -2191,7 +2199,7 @@ static void WM_OT_call_menu(wmOperatorType *ot) (PROP_STRING_SEARCH_SORT | PROP_STRING_SEARCH_SUGGESTION)); } -static int wm_call_pie_menu_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus wm_call_pie_menu_invoke(bContext *C, wmOperator *op, const wmEvent *event) { char idname[BKE_ST_MAXNAME]; RNA_string_get(op->ptr, "name", idname); @@ -2199,7 +2207,7 @@ static int wm_call_pie_menu_invoke(bContext *C, wmOperator *op, const wmEvent *e return UI_pie_menu_invoke(C, idname, event); } -static int wm_call_pie_menu_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_call_pie_menu_exec(bContext *C, wmOperator *op) { char idname[BKE_ST_MAXNAME]; RNA_string_get(op->ptr, "name", idname); @@ -2230,7 +2238,7 @@ static void WM_OT_call_menu_pie(wmOperatorType *ot) (PROP_STRING_SEARCH_SORT | PROP_STRING_SEARCH_SUGGESTION)); } -static int wm_call_panel_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_call_panel_exec(bContext *C, wmOperator *op) { char idname[BKE_ST_MAXNAME]; RNA_string_get(op->ptr, "name", idname); @@ -2273,7 +2281,9 @@ static void WM_OT_call_panel(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } -static int asset_shelf_popover_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +static wmOperatorStatus asset_shelf_popover_invoke(bContext *C, + wmOperator *op, + const wmEvent * /*event*/) { char *asset_shelf_id = RNA_string_get_alloc(op->ptr, "name", nullptr, 0, nullptr); BLI_SCOPED_DEFER([&]() { MEM_freeN(asset_shelf_id); }); @@ -2393,13 +2403,15 @@ static void WM_OT_window_fullscreen_toggle(wmOperatorType *ot) ot->poll = WM_operator_winactive; } -static int wm_exit_blender_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus wm_exit_blender_exec(bContext *C, wmOperator * /*op*/) { wm_exit_schedule_delayed(C); return OPERATOR_FINISHED; } -static int wm_exit_blender_invoke(bContext *C, wmOperator * /*op*/, const wmEvent * /*event*/) +static wmOperatorStatus wm_exit_blender_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent * /*event*/) { if (U.uiflag & USER_SAVE_PROMPT) { wm_quit_with_optional_confirmation_prompt(C, CTX_wm_window(C)); @@ -2428,7 +2440,7 @@ static void WM_OT_quit_blender(wmOperatorType *ot) #if defined(WIN32) -static int wm_console_toggle_exec(bContext * /*C*/, wmOperator * /*op*/) +static wmOperatorStatus wm_console_toggle_exec(bContext * /*C*/, wmOperator * /*op*/) { GHOST_setConsoleWindowState(GHOST_kConsoleWindowStateToggle); return OPERATOR_FINISHED; @@ -3101,7 +3113,7 @@ static int radial_control_get_properties(bContext *C, wmOperator *op) return 1; } -static int radial_control_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus radial_control_invoke(bContext *C, wmOperator *op, const wmEvent *event) { op->customdata = MEM_new(__func__); if (!op->customdata) { @@ -3232,12 +3244,12 @@ static void radial_control_cancel(bContext *C, wmOperator *op) MEM_delete(rc); } -static int radial_control_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus radial_control_modal(bContext *C, wmOperator *op, const wmEvent *event) { RadialControl *rc = static_cast(op->customdata); float new_value, dist = 0.0f, zoom[2]; float delta[2]; - int ret = OPERATOR_RUNNING_MODAL; + wmOperatorStatus ret = OPERATOR_RUNNING_MODAL; float angle_precision = 0.0f; const bool has_numInput = hasNumInput(&rc->num_input); bool handled = false; @@ -3690,7 +3702,7 @@ static bool redraw_timer_poll(bContext *C) return !G.background && WM_operator_winactive(C); } -static int redraw_timer_exec(bContext *C, wmOperator *op) +static wmOperatorStatus redraw_timer_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); wmWindow *win = CTX_wm_window(C); @@ -3787,7 +3799,7 @@ static void WM_OT_redraw_timer(wmOperatorType *ot) * Use for testing/debugging. * \{ */ -static int memory_statistics_exec(bContext * /*C*/, wmOperator * /*op*/) +static wmOperatorStatus memory_statistics_exec(bContext * /*C*/, wmOperator * /*op*/) { MEM_printmemlist_stats(); return OPERATOR_FINISHED; @@ -3847,7 +3859,7 @@ static int previews_id_ensure_callback(LibraryIDLinkCallbackData *cb_data) return IDWALK_RET_NOP; } -static int previews_ensure_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus previews_ensure_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); ListBase *lb[] = {&bmain->materials, @@ -3976,7 +3988,7 @@ static uint preview_filter_to_idfilter(enum PreviewFilterID filter) return 0; } -static int previews_clear_exec(bContext *C, wmOperator *op) +static wmOperatorStatus previews_clear_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); ListBase *lb[] = { @@ -4046,10 +4058,10 @@ static void WM_OT_previews_clear(wmOperatorType *ot) /** \name Doc from UI Operator * \{ */ -static int doc_view_manual_ui_context_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus doc_view_manual_ui_context_exec(bContext *C, wmOperator * /*op*/) { PointerRNA ptr_props; - short retval = OPERATOR_CANCELLED; + wmOperatorStatus retval = OPERATOR_CANCELLED; if (std::optional manual_id = UI_but_online_manual_id_from_active(C)) { WM_operator_properties_create(&ptr_props, "WM_OT_doc_view_manual"); diff --git a/source/blender/windowmanager/intern/wm_splash_screen.cc b/source/blender/windowmanager/intern/wm_splash_screen.cc index 58b1dc1c2cd..1b0f0038406 100644 --- a/source/blender/windowmanager/intern/wm_splash_screen.cc +++ b/source/blender/windowmanager/intern/wm_splash_screen.cc @@ -406,7 +406,9 @@ static uiBlock *wm_block_splash_create(bContext *C, ARegion *region, void * /*ar return block; } -static int wm_splash_invoke(bContext *C, wmOperator * /*op*/, const wmEvent * /*event*/) +static wmOperatorStatus wm_splash_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent * /*event*/) { UI_popup_block_invoke(C, wm_block_splash_create, nullptr, nullptr); @@ -483,7 +485,9 @@ static uiBlock *wm_block_about_create(bContext *C, ARegion *region, void * /*arg return block; } -static int wm_splash_about_invoke(bContext *C, wmOperator * /*op*/, const wmEvent * /*event*/) +static wmOperatorStatus wm_splash_about_invoke(bContext *C, + wmOperator * /*op*/, + const wmEvent * /*event*/) { UI_popup_block_invoke(C, wm_block_about_create, nullptr, nullptr); diff --git a/source/blender/windowmanager/intern/wm_stereo.cc b/source/blender/windowmanager/intern/wm_stereo.cc index d8b68a1cda5..a140f065f75 100644 --- a/source/blender/windowmanager/intern/wm_stereo.cc +++ b/source/blender/windowmanager/intern/wm_stereo.cc @@ -251,7 +251,7 @@ static void wm_stereo3d_set_init(bContext *C, wmOperator *op) s3dd->stereo3d_format = *win->stereo3d_format; } -int wm_stereo3d_set_exec(bContext *C, wmOperator *op) +wmOperatorStatus wm_stereo3d_set_exec(bContext *C, wmOperator *op) { wmWindowManager *wm = CTX_wm_manager(C); wmWindow *win_src = CTX_wm_window(C); @@ -340,7 +340,7 @@ int wm_stereo3d_set_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } -int wm_stereo3d_set_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) +wmOperatorStatus wm_stereo3d_set_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { wm_stereo3d_set_init(C, op); diff --git a/source/blender/windowmanager/intern/wm_window.cc b/source/blender/windowmanager/intern/wm_window.cc index c3a37e07e5b..d37f56b0c6e 100644 --- a/source/blender/windowmanager/intern/wm_window.cc +++ b/source/blender/windowmanager/intern/wm_window.cc @@ -1196,7 +1196,7 @@ wmWindow *WM_window_open(bContext *C, /** \name Operators * \{ */ -int wm_window_close_exec(bContext *C, wmOperator * /*op*/) +wmOperatorStatus wm_window_close_exec(bContext *C, wmOperator * /*op*/) { wmWindowManager *wm = CTX_wm_manager(C); wmWindow *win = CTX_wm_window(C); @@ -1204,7 +1204,7 @@ int wm_window_close_exec(bContext *C, wmOperator * /*op*/) return OPERATOR_FINISHED; } -int wm_window_new_exec(bContext *C, wmOperator *op) +wmOperatorStatus wm_window_new_exec(bContext *C, wmOperator *op) { wmWindow *win_src = CTX_wm_window(C); ScrArea *area = BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_TYPE_ANY, 0); @@ -1233,7 +1233,7 @@ int wm_window_new_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -int wm_window_new_main_exec(bContext *C, wmOperator *op) +wmOperatorStatus wm_window_new_main_exec(bContext *C, wmOperator *op) { wmWindow *win_src = CTX_wm_window(C); @@ -1245,7 +1245,7 @@ int wm_window_new_main_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -int wm_window_fullscreen_toggle_exec(bContext *C, wmOperator * /*op*/) +wmOperatorStatus wm_window_fullscreen_toggle_exec(bContext *C, wmOperator * /*op*/) { wmWindow *window = CTX_wm_window(C); diff --git a/source/blender/windowmanager/wm.hh b/source/blender/windowmanager/wm.hh index db554a4dc34..115f76aa23e 100644 --- a/source/blender/windowmanager/wm.hh +++ b/source/blender/windowmanager/wm.hh @@ -109,8 +109,8 @@ void wm_stereo3d_draw_topbottom(wmWindow *win, int view); * so that drawn cursor and handled mouse position are matching visually. */ void wm_stereo3d_mouse_offset_apply(wmWindow *win, int r_mouse_xy[2]); -int wm_stereo3d_set_exec(bContext *C, wmOperator *op); -int wm_stereo3d_set_invoke(bContext *C, wmOperator *op, const wmEvent *event); +wmOperatorStatus wm_stereo3d_set_exec(bContext *C, wmOperator *op); +wmOperatorStatus wm_stereo3d_set_invoke(bContext *C, wmOperator *op, const wmEvent *event); void wm_stereo3d_set_draw(bContext *C, wmOperator *op); bool wm_stereo3d_set_check(bContext *C, wmOperator *op); void wm_stereo3d_set_cancel(bContext *C, wmOperator *op); diff --git a/source/blender/windowmanager/wm_window.hh b/source/blender/windowmanager/wm_window.hh index 040dd9323a5..4a9922794bf 100644 --- a/source/blender/windowmanager/wm_window.hh +++ b/source/blender/windowmanager/wm_window.hh @@ -124,11 +124,11 @@ void wm_window_timers_delete_removed(wmWindowManager *wm); /* *************** window operators ************** */ -int wm_window_close_exec(bContext *C, wmOperator *op); +wmOperatorStatus wm_window_close_exec(bContext *C, wmOperator *op); /** * Full-screen operator callback. */ -int wm_window_fullscreen_toggle_exec(bContext *C, wmOperator *op); +wmOperatorStatus wm_window_fullscreen_toggle_exec(bContext *C, wmOperator *op); /** * Call the quit confirmation prompt or exit directly if needed. The use can * still cancel via the confirmation popup. Also, this may not quit Blender @@ -138,8 +138,8 @@ int wm_window_fullscreen_toggle_exec(bContext *C, wmOperator *op); */ void wm_quit_with_optional_confirmation_prompt(bContext *C, wmWindow *win) ATTR_NONNULL(); -int wm_window_new_exec(bContext *C, wmOperator *op); -int wm_window_new_main_exec(bContext *C, wmOperator *op); +wmOperatorStatus wm_window_new_exec(bContext *C, wmOperator *op); +wmOperatorStatus wm_window_new_main_exec(bContext *C, wmOperator *op); void wm_test_autorun_revert_action_set(wmOperatorType *ot, PointerRNA *ptr); void wm_test_autorun_warning(bContext *C); diff --git a/source/blender/windowmanager/xr/intern/wm_xr_operators.cc b/source/blender/windowmanager/xr/intern/wm_xr_operators.cc index 319ca113c6d..bd6df1441a5 100644 --- a/source/blender/windowmanager/xr/intern/wm_xr_operators.cc +++ b/source/blender/windowmanager/xr/intern/wm_xr_operators.cc @@ -120,7 +120,7 @@ static void wm_xr_session_update_screen_on_exit_cb(const wmXrData *xr_data) wm_xr_session_update_screen(G_MAIN, xr_data); } -static int wm_xr_session_toggle_exec(bContext *C, wmOperator * /*op*/) +static wmOperatorStatus wm_xr_session_toggle_exec(bContext *C, wmOperator * /*op*/) { Main *bmain = CTX_data_main(C); wmWindowManager *wm = CTX_wm_manager(C); @@ -401,7 +401,9 @@ static void wm_xr_grab_compute_bimanual(const wmXrActionData *actiondata, * Navigates the scene by grabbing with XR controllers. * \{ */ -static int wm_xr_navigation_grab_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus wm_xr_navigation_grab_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { if (!wm_xr_operator_test_event(op, event)) { return OPERATOR_PASS_THROUGH; @@ -417,7 +419,7 @@ static int wm_xr_navigation_grab_invoke(bContext *C, wmOperator *op, const wmEve return OPERATOR_RUNNING_MODAL; } -static int wm_xr_navigation_grab_exec(bContext * /*C*/, wmOperator * /*op*/) +static wmOperatorStatus wm_xr_navigation_grab_exec(bContext * /*C*/, wmOperator * /*op*/) { return OPERATOR_CANCELLED; } @@ -525,7 +527,9 @@ static void wm_xr_navigation_grab_bimanual_state_update(const wmXrActionData *ac } } -static int wm_xr_navigation_grab_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus wm_xr_navigation_grab_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { if (!wm_xr_operator_test_event(op, event)) { return OPERATOR_PASS_THROUGH; @@ -914,7 +918,9 @@ static void wm_xr_basenav_rotation_calc(const wmXrData *xr, mul_qt_qtqt(r_rotation, nav_rotation, base_quatz); } -static int wm_xr_navigation_fly_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus wm_xr_navigation_fly_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { if (!wm_xr_operator_test_event(op, event)) { return OPERATOR_PASS_THROUGH; @@ -929,12 +935,14 @@ static int wm_xr_navigation_fly_invoke(bContext *C, wmOperator *op, const wmEven return OPERATOR_RUNNING_MODAL; } -static int wm_xr_navigation_fly_exec(bContext * /*C*/, wmOperator * /*op*/) +static wmOperatorStatus wm_xr_navigation_fly_exec(bContext * /*C*/, wmOperator * /*op*/) { return OPERATOR_CANCELLED; } -static int wm_xr_navigation_fly_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus wm_xr_navigation_fly_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { if (!wm_xr_operator_test_event(op, event)) { return OPERATOR_PASS_THROUGH; @@ -1289,7 +1297,9 @@ static void wm_xr_navigation_teleport(bContext *C, } } -static int wm_xr_navigation_teleport_invoke(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus wm_xr_navigation_teleport_invoke(bContext *C, + wmOperator *op, + const wmEvent *event) { if (!wm_xr_operator_test_event(op, event)) { return OPERATOR_PASS_THROUGH; @@ -1297,7 +1307,7 @@ static int wm_xr_navigation_teleport_invoke(bContext *C, wmOperator *op, const w wm_xr_raycast_init(op); - int retval = op->type->modal(C, op, event); + wmOperatorStatus retval = op->type->modal(C, op, event); if ((retval & OPERATOR_RUNNING_MODAL) != 0) { WM_event_add_modal_handler(C, op); @@ -1306,12 +1316,14 @@ static int wm_xr_navigation_teleport_invoke(bContext *C, wmOperator *op, const w return retval; } -static int wm_xr_navigation_teleport_exec(bContext * /*C*/, wmOperator * /*op*/) +static wmOperatorStatus wm_xr_navigation_teleport_exec(bContext * /*C*/, wmOperator * /*op*/) { return OPERATOR_CANCELLED; } -static int wm_xr_navigation_teleport_modal(bContext *C, wmOperator *op, const wmEvent *event) +static wmOperatorStatus wm_xr_navigation_teleport_modal(bContext *C, + wmOperator *op, + const wmEvent *event) { if (!wm_xr_operator_test_event(op, event)) { return OPERATOR_PASS_THROUGH; @@ -1445,7 +1457,7 @@ static void WM_OT_xr_navigation_teleport(wmOperatorType *ot) * Resets XR navigation deltas relative to session base pose. * \{ */ -static int wm_xr_navigation_reset_exec(bContext *C, wmOperator *op) +static wmOperatorStatus wm_xr_navigation_reset_exec(bContext *C, wmOperator *op) { wmWindowManager *wm = CTX_wm_manager(C); wmXrData *xr = &wm->xr;