diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-10-16 14:08:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-10-16 14:09:27 +0300 |
commit | 3f3eae675aa83007e641c9a3849189251cae83b0 (patch) | |
tree | fbd8279d2299cc74a44cb15798b4a4f37b7e3d4a /source | |
parent | 48034f0eb3f731e726d2f651a2a6bad736c58ca6 (diff) |
Cleanup: naming
'mp' was a reference to 'manipulator'
Diffstat (limited to 'source')
8 files changed, 64 insertions, 64 deletions
diff --git a/source/blender/editors/interface/interface_region_tooltip.c b/source/blender/editors/interface/interface_region_tooltip.c index 0645d58cc5f..e410421479c 100644 --- a/source/blender/editors/interface/interface_region_tooltip.c +++ b/source/blender/editors/interface/interface_region_tooltip.c @@ -872,7 +872,7 @@ static uiTooltipData *ui_tooltip_data_from_gizmo(bContext *C, wmGizmo *gz) const struct { int part; const char *prefix; - } mpop_actions[] = { + } gzop_actions[] = { { .part = gz->highlight_part, .prefix = use_drag ? TIP_("Click") : NULL, @@ -882,19 +882,19 @@ static uiTooltipData *ui_tooltip_data_from_gizmo(bContext *C, wmGizmo *gz) }, }; - for (int i = 0; i < ARRAY_SIZE(mpop_actions); i++) { - wmGizmoOpElem *mpop = (mpop_actions[i].part != -1) ? WM_gizmo_operator_get(gz, mpop_actions[i].part) : NULL; - if (mpop != NULL) { + for (int i = 0; i < ARRAY_SIZE(gzop_actions); i++) { + wmGizmoOpElem *gzop = (gzop_actions[i].part != -1) ? WM_gizmo_operator_get(gz, gzop_actions[i].part) : NULL; + if (gzop != NULL) { /* Description */ - const char *info = RNA_struct_ui_description(mpop->type->srna); + const char *info = RNA_struct_ui_description(gzop->type->srna); if (!(info && info[0])) { - info = RNA_struct_ui_name(mpop->type->srna); + info = RNA_struct_ui_name(gzop->type->srna); } if (info && info[0]) { char *text = NULL; - if (mpop_actions[i].prefix != NULL) { - text = BLI_sprintfN("%s: %s", mpop_actions[i].prefix, info); + if (gzop_actions[i].prefix != NULL) { + text = BLI_sprintfN("%s: %s", gzop_actions[i].prefix, info); } else { text = BLI_strdup(info); @@ -914,10 +914,10 @@ static uiTooltipData *ui_tooltip_data_from_gizmo(bContext *C, wmGizmo *gz) /* Shortcut */ { bool found = false; - IDProperty *prop = mpop->ptr.data; + IDProperty *prop = gzop->ptr.data; char buf[128]; if (WM_key_event_operator_string( - C, mpop->type->idname, WM_OP_INVOKE_DEFAULT, prop, true, + C, gzop->type->idname, WM_OP_INVOKE_DEFAULT, prop, true, buf, ARRAY_SIZE(buf))) { found = true; diff --git a/source/blender/editors/mesh/editmesh_extrude_gizmo.c b/source/blender/editors/mesh/editmesh_extrude_gizmo.c index b934a8d27bc..e0b1f5e9916 100644 --- a/source/blender/editors/mesh/editmesh_extrude_gizmo.c +++ b/source/blender/editors/mesh/editmesh_extrude_gizmo.c @@ -187,8 +187,8 @@ static void gizmo_mesh_extrude_setup(const bContext *UNUSED(C), wmGizmoGroup *gz RNA_boolean_set(¯optr, "release_confirm", true); RNA_boolean_set_array(¯optr, "constraint_axis", constraint); } - wmGizmoOpElem *mpop = WM_gizmo_operator_get(ggd->adjust_xyz_no[i], 0); - mpop->is_redo = true; + wmGizmoOpElem *gzop = WM_gizmo_operator_get(ggd->adjust_xyz_no[i], 0); + gzop->is_redo = true; } } @@ -280,8 +280,8 @@ static void gizmo_mesh_extrude_refresh(const bContext *C, wmGizmoGroup *gzgroup) /* Operator properties. */ if (use_normal) { - wmGizmoOpElem *mpop = WM_gizmo_operator_get(ggd->invoke_xyz_no[3], 0); - PointerRNA macroptr = RNA_pointer_get(&mpop->ptr, "TRANSFORM_OT_translate"); + wmGizmoOpElem *gzop = WM_gizmo_operator_get(ggd->invoke_xyz_no[3], 0); + PointerRNA macroptr = RNA_pointer_get(&gzop->ptr, "TRANSFORM_OT_translate"); RNA_enum_set(¯optr, "constraint_orientation", V3D_MANIP_NORMAL); } @@ -300,9 +300,9 @@ static void gizmo_mesh_extrude_refresh(const bContext *C, wmGizmoGroup *gzgroup) (orientation_type == ggd->data.orientation_type && constraint_axis[i]) : (orientation_type == V3D_MANIP_NORMAL && constraint_axis[2])) { - wmGizmoOpElem *mpop = WM_gizmo_operator_get(ggd->adjust_xyz_no[i], 0); + wmGizmoOpElem *gzop = WM_gizmo_operator_get(ggd->adjust_xyz_no[i], 0); - PointerRNA macroptr = RNA_pointer_get(&mpop->ptr, "TRANSFORM_OT_translate"); + PointerRNA macroptr = RNA_pointer_get(&gzop->ptr, "TRANSFORM_OT_translate"); RNA_float_set_array(¯optr, "value", value); RNA_boolean_set_array(¯optr, "constraint_axis", constraint_axis); diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate.c b/source/blender/editors/space_view3d/view3d_gizmo_navigate.c index 63c15c7fe5d..d17f0df0c20 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_navigate.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate.c @@ -192,8 +192,8 @@ static void WIDGETGROUP_navigate_setup(const bContext *UNUSED(C), wmGizmoGroup * int gz_ids[] = {MPR_MOVE, MPR_ROTATE, MPR_ZOOM}; for (int i = 0; i < ARRAY_SIZE(gz_ids); i++) { wmGizmo *gz = navgroup->gz_array[gz_ids[i]]; - wmGizmoOpElem *mpop = WM_gizmo_operator_get(gz, 0); - RNA_boolean_set(&mpop->ptr, "use_mouse_init", false); + wmGizmoOpElem *gzop = WM_gizmo_operator_get(gz, 0); + RNA_boolean_set(&gzop->ptr, "use_mouse_init", false); } } diff --git a/source/blender/editors/transform/transform_gizmo_2d.c b/source/blender/editors/transform/transform_gizmo_2d.c index 708b74086b5..48c18ef2d8a 100644 --- a/source/blender/editors/transform/transform_gizmo_2d.c +++ b/source/blender/editors/transform/transform_gizmo_2d.c @@ -303,33 +303,33 @@ void ED_widgetgroup_gizmo2d_refresh(const bContext *C, wmGizmoGroup *gzgroup) } if (show_cage) { - wmGizmoOpElem *mpop; + wmGizmoOpElem *gzop; float mid[2]; const float *min = ggd->min; const float *max = ggd->max; mid_v2_v2v2(mid, min, max); - mpop = WM_gizmo_operator_get(ggd->cage, ED_GIZMO_CAGE2D_PART_SCALE_MIN_X); - PropertyRNA *prop_center_override = RNA_struct_find_property(&mpop->ptr, "center_override"); - RNA_property_float_set_array(&mpop->ptr, prop_center_override, (float[3]){max[0], mid[1], 0.0f}); - mpop = WM_gizmo_operator_get(ggd->cage, ED_GIZMO_CAGE2D_PART_SCALE_MAX_X); - RNA_property_float_set_array(&mpop->ptr, prop_center_override, (float[3]){min[0], mid[1], 0.0f}); - mpop = WM_gizmo_operator_get(ggd->cage, ED_GIZMO_CAGE2D_PART_SCALE_MIN_Y); - RNA_property_float_set_array(&mpop->ptr, prop_center_override, (float[3]){mid[0], max[1], 0.0f}); - mpop = WM_gizmo_operator_get(ggd->cage, ED_GIZMO_CAGE2D_PART_SCALE_MAX_Y); - RNA_property_float_set_array(&mpop->ptr, prop_center_override, (float[3]){mid[0], min[1], 0.0f}); - - mpop = WM_gizmo_operator_get(ggd->cage, ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MIN_Y); - RNA_property_float_set_array(&mpop->ptr, prop_center_override, (float[3]){max[0], max[1], 0.0f}); - mpop = WM_gizmo_operator_get(ggd->cage, ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MAX_Y); - RNA_property_float_set_array(&mpop->ptr, prop_center_override, (float[3]){max[0], min[1], 0.0f}); - mpop = WM_gizmo_operator_get(ggd->cage, ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MIN_Y); - RNA_property_float_set_array(&mpop->ptr, prop_center_override, (float[3]){min[0], max[1], 0.0f}); - mpop = WM_gizmo_operator_get(ggd->cage, ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MAX_Y); - RNA_property_float_set_array(&mpop->ptr, prop_center_override, (float[3]){min[0], min[1], 0.0f}); - - mpop = WM_gizmo_operator_get(ggd->cage, ED_GIZMO_CAGE2D_PART_ROTATE); - RNA_property_float_set_array(&mpop->ptr, prop_center_override, (float[3]){mid[0], mid[1], 0.0f}); + gzop = WM_gizmo_operator_get(ggd->cage, ED_GIZMO_CAGE2D_PART_SCALE_MIN_X); + PropertyRNA *prop_center_override = RNA_struct_find_property(&gzop->ptr, "center_override"); + RNA_property_float_set_array(&gzop->ptr, prop_center_override, (float[3]){max[0], mid[1], 0.0f}); + gzop = WM_gizmo_operator_get(ggd->cage, ED_GIZMO_CAGE2D_PART_SCALE_MAX_X); + RNA_property_float_set_array(&gzop->ptr, prop_center_override, (float[3]){min[0], mid[1], 0.0f}); + gzop = WM_gizmo_operator_get(ggd->cage, ED_GIZMO_CAGE2D_PART_SCALE_MIN_Y); + RNA_property_float_set_array(&gzop->ptr, prop_center_override, (float[3]){mid[0], max[1], 0.0f}); + gzop = WM_gizmo_operator_get(ggd->cage, ED_GIZMO_CAGE2D_PART_SCALE_MAX_Y); + RNA_property_float_set_array(&gzop->ptr, prop_center_override, (float[3]){mid[0], min[1], 0.0f}); + + gzop = WM_gizmo_operator_get(ggd->cage, ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MIN_Y); + RNA_property_float_set_array(&gzop->ptr, prop_center_override, (float[3]){max[0], max[1], 0.0f}); + gzop = WM_gizmo_operator_get(ggd->cage, ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MAX_Y); + RNA_property_float_set_array(&gzop->ptr, prop_center_override, (float[3]){max[0], min[1], 0.0f}); + gzop = WM_gizmo_operator_get(ggd->cage, ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MIN_Y); + RNA_property_float_set_array(&gzop->ptr, prop_center_override, (float[3]){min[0], max[1], 0.0f}); + gzop = WM_gizmo_operator_get(ggd->cage, ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MAX_Y); + RNA_property_float_set_array(&gzop->ptr, prop_center_override, (float[3]){min[0], min[1], 0.0f}); + + gzop = WM_gizmo_operator_get(ggd->cage, ED_GIZMO_CAGE2D_PART_ROTATE); + RNA_property_float_set_array(&gzop->ptr, prop_center_override, (float[3]){mid[0], mid[1], 0.0f}); } } diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c index 11a93843939..98a0e880ef6 100644 --- a/source/blender/editors/transform/transform_gizmo_3d.c +++ b/source/blender/editors/transform/transform_gizmo_3d.c @@ -1919,12 +1919,12 @@ static void WIDGETGROUP_xform_cage_refresh(const bContext *C, wmGizmoGroup *gzgr center[1] = (float)(1 - y) * dims[1]; for (int z = 0; z < 3; z++) { center[2] = (float)(1 - z) * dims[2]; - struct wmGizmoOpElem *mpop = WM_gizmo_operator_get(gz, i); + struct wmGizmoOpElem *gzop = WM_gizmo_operator_get(gz, i); if (prop_center_override == NULL) { - prop_center_override = RNA_struct_find_property(&mpop->ptr, "center_override"); + prop_center_override = RNA_struct_find_property(&gzop->ptr, "center_override"); } mul_v3_m4v3(center_global, matrix_offset_global, center); - RNA_property_float_set_array(&mpop->ptr, prop_center_override, center_global); + RNA_property_float_set_array(&gzop->ptr, prop_center_override, center_global); i++; } } diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo.c index 6abc37a893f..123857f3251 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo.c @@ -258,19 +258,19 @@ PointerRNA *WM_gizmo_operator_set( gz->op_data_len = part_index + 1; gz->op_data = MEM_recallocN(gz->op_data, sizeof(*gz->op_data) * gz->op_data_len); } - wmGizmoOpElem *mpop = &gz->op_data[part_index]; - mpop->type = ot; + wmGizmoOpElem *gzop = &gz->op_data[part_index]; + gzop->type = ot; - if (mpop->ptr.data) { - WM_operator_properties_free(&mpop->ptr); + if (gzop->ptr.data) { + WM_operator_properties_free(&gzop->ptr); } - WM_operator_properties_create_ptr(&mpop->ptr, ot); + WM_operator_properties_create_ptr(&gzop->ptr, ot); if (properties) { - mpop->ptr.data = properties; + gzop->ptr.data = properties; } - return &mpop->ptr; + return &gzop->ptr; } static void wm_gizmo_set_matrix_rotation_from_z_axis__internal( diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c index f4cb40b0b94..9cc8bacd20b 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c @@ -351,20 +351,20 @@ static bool gizmo_tweak_start( static bool gizmo_tweak_start_and_finish( bContext *C, wmGizmoMap *gzmap, wmGizmo *gz, const wmEvent *event, bool *r_is_modal) { - wmGizmoOpElem *mpop = WM_gizmo_operator_get(gz, gz->highlight_part); + wmGizmoOpElem *gzop = WM_gizmo_operator_get(gz, gz->highlight_part); if (r_is_modal) { *r_is_modal = false; } - if (mpop && mpop->type) { + if (gzop && gzop->type) { /* Undo/Redo */ - if (mpop->is_redo) { + if (gzop->is_redo) { wmWindowManager *wm = CTX_wm_manager(C); wmOperator *op = WM_operator_last_redo(C); /* We may want to enable this, for now the gizmo can manage it's own properties. */ #if 0 - IDP_MergeGroup(mpop->ptr.data, op->properties, false); + IDP_MergeGroup(gzop->ptr.data, op->properties, false); #endif WM_operator_free_all_after(wm, op); @@ -373,7 +373,7 @@ static bool gizmo_tweak_start_and_finish( /* XXX temporary workaround for modal gizmo operator * conflicting with modal operator attached to gizmo */ - if (mpop->type->modal) { + if (gzop->type->modal) { /* activate highlighted gizmo */ wm_gizmomap_modal_set(gzmap, C, gz, event, true); if (r_is_modal) { @@ -385,7 +385,7 @@ static bool gizmo_tweak_start_and_finish( gz->parent_gzgroup->type->invoke_prepare(C, gz->parent_gzgroup, gz); } /* Allow for 'button' gizmos, single click to run an action. */ - WM_operator_name_call_ptr(C, mpop->type, WM_OP_INVOKE_DEFAULT, &mpop->ptr); + WM_operator_name_call_ptr(C, gzop->type, WM_OP_INVOKE_DEFAULT, &gzop->ptr); } return true; } @@ -548,9 +548,9 @@ static int gizmo_tweak_invoke(bContext *C, wmOperator *op, const wmEvent *event) bool use_drag_detect = false; #ifdef USE_DRAG_DETECT if (use_drag_fallback) { - wmGizmoOpElem *mpop = WM_gizmo_operator_get(gz, gz->highlight_part); - if (mpop && mpop->type) { - if (mpop->type->modal == NULL) { + wmGizmoOpElem *gzop = WM_gizmo_operator_get(gz, gz->highlight_part); + if (gzop && gzop->type) { + if (gzop->type->modal == NULL) { use_drag_detect = true; } } diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c index 2c52b06a32a..ede0f7c96ea 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c @@ -718,8 +718,8 @@ void wm_gizmomaps_handled_modal_update( /* regular update for running operator */ if (modal_running) { - wmGizmoOpElem *mpop = gz ? WM_gizmo_operator_get(gz, gz->highlight_part) : NULL; - if (gz && mpop && (mpop->type != NULL) && (mpop->type == handler->op->type)) { + wmGizmoOpElem *gzop = gz ? WM_gizmo_operator_get(gz, gz->highlight_part) : NULL; + if (gz && gzop && (gzop->type != NULL) && (gzop->type == handler->op->type)) { wmGizmoFnModal modal_fn = gz->custom_modal ? gz->custom_modal : gz->type->modal; if (modal_fn != NULL) { int retval = modal_fn(C, gz, event, 0); @@ -971,9 +971,9 @@ void wm_gizmomap_modal_set( gzmap->gzmap_context.event_xy[0] = INT_MAX; } - struct wmGizmoOpElem *mpop = WM_gizmo_operator_get(gz, gz->highlight_part); - if (mpop && mpop->type) { - const int retval = WM_operator_name_call_ptr(C, mpop->type, WM_OP_INVOKE_DEFAULT, &mpop->ptr); + struct wmGizmoOpElem *gzop = WM_gizmo_operator_get(gz, gz->highlight_part); + if (gzop && gzop->type) { + const int retval = WM_operator_name_call_ptr(C, gzop->type, WM_OP_INVOKE_DEFAULT, &gzop->ptr); if ((retval & OPERATOR_RUNNING_MODAL) == 0) { wm_gizmomap_modal_set(gzmap, C, gz, event, false); } |