WM: rename manipulator to gizmo internally
authorCampbell Barton <ideasman42@gmail.com>
Sat, 14 Jul 2018 21:49:00 +0000 (23:49 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 14 Jul 2018 21:49:00 +0000 (23:49 +0200)
124 files changed:
release/datafiles/userdef/userdef_default_theme.c
release/scripts/modules/bpy_types.py
release/scripts/startup/bl_ui/space_toolsystem_common.py
release/scripts/startup/bl_ui/space_userpref.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/BKE_context.h
source/blender/blenkernel/BKE_screen.h
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/blendfile.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/context.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/screen.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/versioning_280.c
source/blender/bmesh/intern/bmesh_marking.c
source/blender/bmesh/intern/bmesh_polygon.c
source/blender/draw/intern/draw_manager.c
source/blender/draw/intern/draw_view.c
source/blender/draw/intern/draw_view.h
source/blender/draw/modes/pose_mode.c
source/blender/editors/gizmo_library/geometry/geom_arrow_gizmo.c
source/blender/editors/gizmo_library/geometry/geom_cube_gizmo.c
source/blender/editors/gizmo_library/geometry/geom_dial_gizmo.c
source/blender/editors/gizmo_library/gizmo_draw_utils.c
source/blender/editors/gizmo_library/gizmo_geometry.h
source/blender/editors/gizmo_library/gizmo_library_intern.h
source/blender/editors/gizmo_library/gizmo_library_presets.c
source/blender/editors/gizmo_library/gizmo_library_utils.c
source/blender/editors/gizmo_library/gizmo_types/arrow2d_gizmo.c
source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c
source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c
source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c
source/blender/editors/gizmo_library/gizmo_types/grab3d_gizmo.c
source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.c
source/blender/editors/include/ED_gizmo_library.h
source/blender/editors/include/ED_transform.h
source/blender/editors/include/UI_interface.h
source/blender/editors/include/UI_resources.h
source/blender/editors/interface/interface_region_tooltip.c
source/blender/editors/interface/resources.c
source/blender/editors/mesh/editmesh_add_gizmo.c
source/blender/editors/mesh/editmesh_bevel.c
source/blender/editors/mesh/editmesh_bisect.c
source/blender/editors/mesh/editmesh_extrude.c
source/blender/editors/mesh/editmesh_extrude_spin.c
source/blender/editors/mesh/editmesh_inset.c
source/blender/editors/mesh/editmesh_polybuild.c
source/blender/editors/mesh/mesh_intern.h
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/screen/area.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/space_api/spacetypes.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_node/node_gizmo.c
source/blender/editors/space_node/node_intern.h
source/blender/editors/space_node/space_node.c
source/blender/editors/space_sequencer/sequencer_select.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_gizmo_armature.c
source/blender/editors/space_view3d/view3d_gizmo_camera.c
source/blender/editors/space_view3d/view3d_gizmo_empty.c
source/blender/editors/space_view3d/view3d_gizmo_forcefield.c
source/blender/editors/space_view3d/view3d_gizmo_lamp.c
source/blender/editors/space_view3d/view3d_gizmo_navigate.c
source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
source/blender/editors/space_view3d/view3d_gizmo_ruler.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_ops.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform.h
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_gizmo_2d.c
source/blender/editors/transform/transform_gizmo_3d.c
source/blender/editors/transform/transform_ops.c
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_screen_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/DNA_view3d_types.h
source/blender/makesdna/DNA_workspace_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_context.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/makesrna/intern/rna_wm_api.c
source/blender/makesrna/intern/rna_wm_gizmo.c
source/blender/makesrna/intern/rna_wm_gizmo_api.c
source/blender/makesrna/intern/rna_workspace_api.c
source/blender/python/intern/bpy.c
source/blender/python/intern/bpy_gizmo_wrap.c
source/blender/python/intern/bpy_gizmo_wrap.h
source/blender/python/intern/bpy_rna.c
source/blender/python/intern/bpy_rna_gizmo.c
source/blender/python/intern/bpy_rna_gizmo.h
source/blender/python/intern/gpu_py_select.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/gizmo/WM_gizmo_api.h
source/blender/windowmanager/gizmo/WM_gizmo_types.h
source/blender/windowmanager/gizmo/intern/wm_gizmo.c
source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c
source/blender/windowmanager/gizmo/intern/wm_gizmo_group_type.c
source/blender/windowmanager/gizmo/intern/wm_gizmo_intern.h
source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
source/blender/windowmanager/gizmo/intern/wm_gizmo_target_props.c
source/blender/windowmanager/gizmo/intern/wm_gizmo_type.c
source/blender/windowmanager/gizmo/wm_gizmo_fn.h
source/blender/windowmanager/gizmo/wm_gizmo_wmapi.h
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_toolsystem.c
source/blender/windowmanager/wm_event_system.h
source/blender/windowmanager/wm_event_types.h

index 666fb03596c9ac366b39c4b7160c2db7ce0c193d..f77b06b56e2577a3b30ca4579ce6058ee45e9d5d 100644 (file)
@@ -239,11 +239,11 @@ const bTheme U_theme_default = {
                .xaxis = RGBA(0xff3352ff),
                .yaxis = RGBA(0x8bdc00ff),
                .zaxis = RGBA(0x2890ffff),
-               .manipulator_hi = RGBA(0xffffffff),
-               .manipulator_primary = RGBA(0xf5f14dff),
-               .manipulator_secondary = RGBA(0x63ffffff),
-               .manipulator_a = RGBA(0x4da84dff),
-               .manipulator_b = RGBA(0xa33535ff),
+               .gizmo_hi = RGBA(0xffffffff),
+               .gizmo_primary = RGBA(0xf5f14dff),
+               .gizmo_secondary = RGBA(0x63ffffff),
+               .gizmo_a = RGBA(0x4da84dff),
+               .gizmo_b = RGBA(0xa33535ff),
        },
        .tbuts = {
                .back = RGBA(0x42424200),
index 3bdf92f8e6370f08b8b81242aaf44ac3fff47ab2..e9f40bd0c3c7aa2f98bdb78c7e588326fa491cdb 100644 (file)
@@ -581,10 +581,10 @@ class Manipulator(StructRNA):
         return super().__delattr__(attr)
 
     from _bpy import (
-        _rna_manipulator_target_set_handler as target_set_handler,
-        _rna_manipulator_target_get_value as target_get_value,
-        _rna_manipulator_target_set_value as target_set_value,
-        _rna_manipulator_target_get_range as target_get_range,
+        _rna_gizmo_target_set_handler as target_set_handler,
+        _rna_gizmo_target_get_value as target_get_value,
+        _rna_gizmo_target_set_value as target_set_value,
+        _rna_gizmo_target_get_range as target_get_range,
     )
 
     # Convenience wrappers around private `_gawain` module.
index 9cc57bc2c873df2aa8ae432237a7b67f86751481..4c954874f0d9ef9c5d2b01e1125cb7ed24955082 100644 (file)
@@ -569,7 +569,7 @@ def _activate_by_item(context, space_type, item, index):
         name=item.text,
         keymap=item.keymap[0].name if item.keymap is not None else "",
         cursor=item.cursor or 'DEFAULT',
-        manipulator_group=item.widget or "",
+        gizmo_group=item.widget or "",
         data_block=item.data_block or "",
         operator=item.operator or "",
         index=index,
index 0c717aa21d5840976238e7f4329c4b889941bb9c..e2bca0b6b3360c7c0b71a0382afc59c3d849dab6 100644 (file)
@@ -238,7 +238,7 @@ class USERPREF_PT_interface(Panel):
 
         col.separator()
 
-        # col.prop(view, "show_manipulator_navigate")
+        # col.prop(view, "show_gizmo_navigate")
 
         sub = col.column(align=True)
 
@@ -258,10 +258,10 @@ class USERPREF_PT_interface(Panel):
         #col.label(text="Open Toolbox Delay:")
         #col.prop(view, "open_left_mouse_delay", text="Hold LMB")
         #col.prop(view, "open_right_mouse_delay", text="Hold RMB")
-        col.prop(view, "show_manipulator", text="Gizmos")
+        col.prop(view, "show_gizmo", text="Gizmos")
         sub = col.column()
-        sub.active = view.show_manipulator
-        sub.prop(view, "manipulator_size", text="Size")
+        sub.active = view.show_gizmo
+        sub.prop(view, "gizmo_size", text="Size")
 
         col.separator()
 
@@ -934,10 +934,10 @@ class USERPREF_PT_theme(Panel):
             padding = subsplit.split(percentage=0.15)
             colsub = padding.column()
             colsub = padding.column()
-            colsub.row().prop(ui, "manipulator_primary")
-            colsub.row().prop(ui, "manipulator_secondary")
-            colsub.row().prop(ui, "manipulator_a")
-            colsub.row().prop(ui, "manipulator_b")
+            colsub.row().prop(ui, "gizmo_primary")
+            colsub.row().prop(ui, "gizmo_secondary")
+            colsub.row().prop(ui, "gizmo_a")
+            colsub.row().prop(ui, "gizmo_b")
 
             col.separator()
             col.separator()
index 3f711ace97e84102c1ab901b692ee01d6d8eda8d..682af76500b157d06b3d41ace8fd71bad2040df3 100644 (file)
@@ -3954,7 +3954,7 @@ class VIEW3D_PT_overlay(Panel):
         pass
 
 
-class VIEW3D_PT_overlay_manipulators(Panel):
+class VIEW3D_PT_overlay_gizmo(Panel):
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'HEADER'
     bl_parent_id = 'VIEW3D_PT_overlay'
@@ -3962,7 +3962,7 @@ class VIEW3D_PT_overlay_manipulators(Panel):
 
     def draw_header(self, context):
         view = context.space_data
-        self.layout.prop(view, "show_manipulator", text="")
+        self.layout.prop(view, "show_gizmo", text="")
 
     def draw(self, context):
         layout = self.layout
@@ -3975,10 +3975,10 @@ class VIEW3D_PT_overlay_manipulators(Panel):
         col.active = display_all
 
         row = col.row(align=True)
-        row.active = view.show_manipulator
-        row.prop(view, "show_manipulator_navigate", text="Navigate", toggle=True)
-        row.prop(view, "show_manipulator_context", text="Active Object", toggle=True)
-        row.prop(view, "show_manipulator_tool", text="Active Tools", toggle=True)
+        row.active = view.show_gizmo
+        row.prop(view, "show_gizmo_navigate", text="Navigate", toggle=True)
+        row.prop(view, "show_gizmo_context", text="Active Object", toggle=True)
+        row.prop(view, "show_gizmo_tool", text="Active Tools", toggle=True)
 
 
 class VIEW3D_PT_overlay_guides(Panel):
@@ -4818,7 +4818,7 @@ classes = (
     VIEW3D_PT_shading_options_shadow,
     VIEW3D_PT_shading_options_ssao,
     VIEW3D_PT_overlay,
-    VIEW3D_PT_overlay_manipulators,
+    VIEW3D_PT_overlay_gizmo,
     VIEW3D_PT_overlay_guides,
     VIEW3D_PT_overlay_object,
     VIEW3D_PT_overlay_geometry,
index 9fa00e7f63f0c426e95c31a3ca9246aa461aba92..6703d828bf0be181570e0ae5d4144d0b0dd4cb01 100644 (file)
@@ -157,7 +157,7 @@ struct SpaceLink *CTX_wm_space_data(const bContext *C);
 struct ARegion *CTX_wm_region(const bContext *C);
 void *CTX_wm_region_data(const bContext *C);
 struct ARegion *CTX_wm_menu(const bContext *C);
-struct wmManipulatorGroup *CTX_wm_manipulator_group(const bContext *C);
+struct wmGizmoGroup *CTX_wm_gizmo_group(const bContext *C);
 struct wmMsgBus *CTX_wm_message_bus(const bContext *C);
 struct ReportList *CTX_wm_reports(const bContext *C);
 
@@ -185,7 +185,7 @@ void CTX_wm_screen_set(bContext *C, struct bScreen *screen); /* to be removed */
 void CTX_wm_area_set(bContext *C, struct ScrArea *sa);
 void CTX_wm_region_set(bContext *C, struct ARegion *region);
 void CTX_wm_menu_set(bContext *C, struct ARegion *menu);
-void CTX_wm_manipulator_group_set(bContext *C, struct wmManipulatorGroup *mgroup);
+void CTX_wm_gizmo_group_set(bContext *C, struct wmGizmoGroup *mgroup);
 const char *CTX_wm_operator_poll_msg_get(struct bContext *C);
 void CTX_wm_operator_poll_msg_set(struct bContext *C, const char *msg);
 
index 23f57586ed1ce73a39445cac700234fa926f02dc..60981c6e76e4a6ae5b7ba0e6815104ecc978bcbe 100644 (file)
@@ -51,7 +51,7 @@ struct bScreen;
 struct uiLayout;
 struct uiList;
 struct wmKeyConfig;
-struct wmManipulatorMap;
+struct wmGizmoMap;
 struct wmNotifier;
 struct wmWindow;
 struct wmWindowManager;
@@ -104,8 +104,8 @@ typedef struct SpaceType {
        /* on startup, define dropboxes for spacetype+regions */
        void (*dropboxes)(void);
 
-       /* initialize manipulator-map-types and manipulator-group-types with the region */
-       void (*manipulators)(void);
+       /* initialize gizmo-map-types and gizmo-group-types with the region */
+       void (*gizmos)(void);
 
        /* return context data */
        int (*context)(const struct bContext *C, const char *member, struct bContextDataResult *result);
@@ -325,9 +325,9 @@ void BKE_spacedata_id_unref(struct ScrArea *sa, struct SpaceLink *sl, struct ID
 struct ARegion *BKE_area_region_copy(struct SpaceType *st, struct ARegion *ar);
 void            BKE_area_region_free(struct SpaceType *st, struct ARegion *ar);
 void            BKE_screen_area_free(struct ScrArea *sa);
-/* Manipulator-maps of a region need to be freed with the region. Uses callback to avoid low-level call. */
-void BKE_region_callback_free_manipulatormap_set(void (*callback)(struct wmManipulatorMap *));
-void BKE_region_callback_refresh_tag_manipulatormap_set(void (*callback)(struct wmManipulatorMap *));
+/* Gizmo-maps of a region need to be freed with the region. Uses callback to avoid low-level call. */
+void BKE_region_callback_free_gizmomap_set(void (*callback)(struct wmGizmoMap *));
+void BKE_region_callback_refresh_tag_gizmomap_set(void (*callback)(struct wmGizmoMap *));
 
 struct ARegion *BKE_area_find_region_type(struct ScrArea *sa, int type);
 struct ARegion *BKE_area_find_region_active_win(struct ScrArea *sa);
@@ -344,7 +344,7 @@ unsigned int BKE_screen_view3d_layer_active(
 
 unsigned int BKE_screen_view3d_layer_all(const struct bScreen *sc) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
 
-void BKE_screen_manipulator_tag_refresh(struct bScreen *sc);
+void BKE_screen_gizmo_tag_refresh(struct bScreen *sc);
 
 void BKE_screen_view3d_sync(struct View3D *v3d, struct Scene *scene);
 void BKE_screen_view3d_scene_sync(struct bScreen *sc, struct Scene *scene);
index 23c2147ff7eec12ed8bef13a16799b3e16282903..66020679bf7da5ec976f1286e8f9ff6a537baf3f 100644 (file)
@@ -300,7 +300,7 @@ void BKE_blender_userdef_app_template_data_swap(UserDef *userdef_a, UserDef *use
        DATA_SWAP(font_path_ui_mono);
        DATA_SWAP(keyconfigstr);
 
-       DATA_SWAP(manipulator_flag);
+       DATA_SWAP(gizmo_flag);
        DATA_SWAP(app_flag);
 
        /* We could add others. */
index 27b5089b0929884a647fae97c03a07442fa2f955..b16648fd73f1197b934454ca3ff0024809365ccb 100644 (file)
@@ -226,7 +226,7 @@ static void setup_app_data(
                 * only the current screen is important because we wont have to handle
                 * events from multiple screens at once.*/
                {
-                       BKE_screen_manipulator_tag_refresh(curscreen);
+                       BKE_screen_gizmo_tag_refresh(curscreen);
                }
        }
 
index 0cbd77b67d253265459240a8c61193b760901209..4f772673e1de6e62f6c1a19690a025d2428bb734 100644 (file)
@@ -463,8 +463,8 @@ static void contarget_get_mesh_mat(Object *ob, const char *substring, float mat[
        }
 
        /* derive the rotation from the average normal:
-        *              - code taken from transform_manipulator.c,
-        *                      calc_manipulator_stats, V3D_MANIP_NORMAL case
+        *              - code taken from transform_gizmo.c,
+        *                      calc_gizmo_stats, V3D_MANIP_NORMAL case
         */
        /*      we need the transpose of the inverse for a normal... */
        copy_m3_m4(imat, ob->obmat);
index 1aaf5e4f4858c1bb220de1454ee1168f0018d245..68a1e607517a79e7ddf151a7ac7f0f5f2524babd 100644 (file)
@@ -80,7 +80,7 @@ struct bContext {
                struct ScrArea *area;
                struct ARegion *region;
                struct ARegion *menu;
-               struct wmManipulatorGroup *manipulator_group;
+               struct wmGizmoGroup *gizmo_group;
                struct bContextStore *store;
                const char *operator_poll_msg; /* reason for poll failing */
        } wm;
@@ -675,9 +675,9 @@ struct ARegion *CTX_wm_menu(const bContext *C)
        return C->wm.menu;
 }
 
-struct wmManipulatorGroup *CTX_wm_manipulator_group(const bContext *C)
+struct wmGizmoGroup *CTX_wm_gizmo_group(const bContext *C)
 {
-       return C->wm.manipulator_group;
+       return C->wm.gizmo_group;
 }
 
 struct wmMsgBus *CTX_wm_message_bus(const bContext *C)
@@ -876,9 +876,9 @@ void CTX_wm_menu_set(bContext *C, ARegion *menu)
        C->wm.menu = menu;
 }
 
-void CTX_wm_manipulator_group_set(bContext *C, struct wmManipulatorGroup *mgroup)
+void CTX_wm_gizmo_group_set(bContext *C, struct wmGizmoGroup *mgroup)
 {
-       C->wm.manipulator_group = mgroup;
+       C->wm.gizmo_group = mgroup;
 }
 
 void CTX_wm_operator_poll_msg_set(bContext *C, const char *msg)
index 8299d785cfcce207c3fcaf2054ea76a76d562aa8..6a8f46badd9a23ad3aa7c4e296428459fdeb4d36 100644 (file)
@@ -645,7 +645,7 @@ void BKE_scene_init(Scene *sce)
        sce->toolsettings->uvcalc_flag = UVCALC_TRANSFORM_CORRECT;
        sce->toolsettings->unwrapper = 1;
        sce->toolsettings->select_thresh = 0.01f;
-       sce->toolsettings->manipulator_flag = SCE_MANIP_TRANSLATE | SCE_MANIP_ROTATE | SCE_MANIP_SCALE;
+       sce->toolsettings->gizmo_flag = SCE_MANIP_TRANSLATE | SCE_MANIP_ROTATE | SCE_MANIP_SCALE;
 
        sce->toolsettings->selectmode = SCE_SELECT_VERTEX;
        sce->toolsettings->uv_selectmode = UV_SELECT_VERTEX;
index 1c8a93981c7e5e466754f0611baea5ce8fae2576..448b97c63b334b407b195ef5238989ade897e061 100644 (file)
@@ -222,7 +222,7 @@ ARegion *BKE_area_region_copy(SpaceType *st, ARegion *ar)
        BLI_listbase_clear(&newar->panels_category_active);
        BLI_listbase_clear(&newar->ui_lists);
        newar->visible = 0;
-       newar->manipulator_map = NULL;
+       newar->gizmo_map = NULL;
        newar->regiontimer = NULL;
        newar->headerstr = NULL;
        newar->draw_buffer = NULL;
@@ -324,18 +324,18 @@ void BKE_spacedata_id_unref(struct ScrArea *sa, struct SpaceLink *sl, struct ID
 }
 
 /**
- * Avoid bad-level calls to #WM_manipulatormap_tag_refresh.
+ * Avoid bad-level calls to #WM_gizmomap_tag_refresh.
  */
-static void (*region_refresh_tag_manipulatormap_callback)(struct wmManipulatorMap *) = NULL;
+static void (*region_refresh_tag_gizmomap_callback)(struct wmGizmoMap *) = NULL;
 
-void BKE_region_callback_refresh_tag_manipulatormap_set(void (*callback)(struct wmManipulatorMap *))
+void BKE_region_callback_refresh_tag_gizmomap_set(void (*callback)(struct wmGizmoMap *))
 {
-       region_refresh_tag_manipulatormap_callback = callback;
+       region_refresh_tag_gizmomap_callback = callback;
 }
 
-void BKE_screen_manipulator_tag_refresh(struct bScreen *sc)
+void BKE_screen_gizmo_tag_refresh(struct bScreen *sc)
 {
-       if (region_refresh_tag_manipulatormap_callback == NULL) {
+       if (region_refresh_tag_gizmomap_callback == NULL) {
                return;
        }
 
@@ -343,21 +343,21 @@ void BKE_screen_manipulator_tag_refresh(struct bScreen *sc)
        ARegion *ar;
        for (sa = sc->areabase.first; sa; sa = sa->next) {
                for (ar = sa->regionbase.first; ar; ar = ar->next) {
-                       if (ar->manipulator_map != NULL) {
-                               region_refresh_tag_manipulatormap_callback(ar->manipulator_map);
+                       if (ar->gizmo_map != NULL) {
+                               region_refresh_tag_gizmomap_callback(ar->gizmo_map);
                        }
                }
        }
 }
 
 /**
- * Avoid bad-level calls to #WM_manipulatormap_delete.
+ * Avoid bad-level calls to #WM_gizmomap_delete.
  */
-static void (*region_free_manipulatormap_callback)(struct wmManipulatorMap *) = NULL;
+static void (*region_free_gizmomap_callback)(struct wmGizmoMap *) = NULL;
 
-void BKE_region_callback_free_manipulatormap_set(void (*callback)(struct wmManipulatorMap *))
+void BKE_region_callback_free_gizmomap_set(void (*callback)(struct wmGizmoMap *))
 {
-       region_free_manipulatormap_callback = callback;
+       region_free_gizmomap_callback = callback;
 }
 
 static void panel_list_free(ListBase *lb)
@@ -414,8 +414,8 @@ void BKE_area_region_free(SpaceType *st, ARegion *ar)
                }
        }
 
-       if (ar->manipulator_map != NULL) {
-               region_free_manipulatormap_callback(ar->manipulator_map);
+       if (ar->gizmo_map != NULL) {
+               region_free_gizmomap_callback(ar->gizmo_map);
        }
 
        BLI_freelistN(&ar->ui_lists);
index 6bc0a634599b9a96f3f42a1c95ea31b3019a9f63..6b356ac2e966094ba75c1bf00f51f419be95daad 100644 (file)
@@ -6535,7 +6535,7 @@ static void direct_link_region(FileData *fd, ARegion *ar, int spacetype)
        ar->visible = 0;
        ar->type = NULL;
        ar->do_draw = 0;
-       ar->manipulator_map = NULL;
+       ar->gizmo_map = NULL;
        ar->regiontimer = NULL;
        ar->draw_buffer = NULL;
        memset(&ar->drawrct, 0, sizeof(ar->drawrct));
index a078b794536dd93abe746f0b7eb31f462d4ba433..b854438ed47e4e0fff0267e97974f93b96158e26 100644 (file)
@@ -1549,8 +1549,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
                }
 
                for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
-                       if (scene->toolsettings->manipulator_flag == 0) {
-                               scene->toolsettings->manipulator_flag = SCE_MANIP_TRANSLATE | SCE_MANIP_ROTATE | SCE_MANIP_SCALE;
+                       if (scene->toolsettings->gizmo_flag == 0) {
+                               scene->toolsettings->gizmo_flag = SCE_MANIP_TRANSLATE | SCE_MANIP_ROTATE | SCE_MANIP_SCALE;
                        }
                }
 
index 10a03050d4bbe666148f0ccf960679ccd4f38b7d..1e53180396e9cd1ca7e667c785fdfaec0cf882fe 100644 (file)
@@ -863,7 +863,7 @@ void BM_editselection_normal(BMEditSelection *ese, float r_normal[3])
 
 /* Calculate a plane that is rightangles to the edge/vert/faces normal
  * also make the plane run along an axis that is related to the geometry,
- * because this is used for the manipulators Y axis. */
+ * because this is used for the gizmos Y axis. */
 void BM_editselection_plane(BMEditSelection *ese, float r_plane[3])
 {
        if (ese->htype == BM_VERT) {
@@ -895,7 +895,7 @@ void BM_editselection_plane(BMEditSelection *ese, float r_plane[3])
                else {
                        /* the plane is simple, it runs along the edge
                         * however selecting different edges can swap the direction of the y axis.
-                        * this makes it less likely for the y axis of the manipulator
+                        * this makes it less likely for the y axis of the gizmo
                         * (running along the edge).. to flip less often.
                         * at least its more predictable */
                        if (eed->v2->co[1] > eed->v1->co[1]) {  /* check which to do first */
index 7cbc6461667e1444aa94bd8f46aaebb8786c5581..421b2adc3a78fadccf3de23e4736c1a6d90ce172 100644 (file)
@@ -487,7 +487,7 @@ void  BM_face_calc_tangent_vert_diagonal(const BMFace *f, float r_tangent[3])
 }
 
 /**
- * Compute a meaningful direction along the face (use for manipulator axis).
+ * Compute a meaningful direction along the face (use for gizmo axis).
  *
  * \note Callers shouldn't depend on the *exact* method used here.
  */
index d8e1aa2c7a426eec03760f4074c3565931256c91..98d6f167d300bb52a63919fa1f6e2e0abccb1fa6 100644 (file)
@@ -1438,12 +1438,12 @@ void DRW_draw_render_loop_ex(
        glEnable(GL_DEPTH_TEST);
 
        if (DST.draw_ctx.evil_C) {
-               /* needed so manipulator isn't obscured */
+               /* needed so gizmo isn't obscured */
                if (((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) &&
-                   ((v3d->mpr_flag & V3D_MANIPULATOR_HIDE) == 0))
+                   ((v3d->mpr_flag & V3D_GIZMO_HIDE) == 0))
                {
                        glDisable(GL_DEPTH_TEST);
-                       DRW_draw_manipulator_3d();
+                       DRW_draw_gizmo_3d();
                }
 
                DRW_draw_region_info();
@@ -1451,7 +1451,7 @@ void DRW_draw_render_loop_ex(
                if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) {
                        /* Draw 2D after region info so we can draw on top of the camera passepartout overlay.
                         * 'DRW_draw_region_info' sets the projection in pixel-space. */
-                       DRW_draw_manipulator_2d();
+                       DRW_draw_gizmo_2d();
                        glEnable(GL_DEPTH_TEST);
                }
        }
index 59ae8a918f97b01a0ffcd66ef9319ce7d913016b..75a7d567d5c22ac4d069da510a7e028495416bee 100644 (file)
@@ -739,30 +739,30 @@ void DRW_draw_cursor(void)
        }
 }
 
-/* **************************** 3D Manipulator ******************************** */
+/* **************************** 3D Gizmo ******************************** */
 
-void DRW_draw_manipulator_3d(void)
+void DRW_draw_gizmo_3d(void)
 {
        const DRWContextState *draw_ctx = DRW_context_state_get();
        ARegion *ar = draw_ctx->ar;
 
-       /* draw depth culled manipulators - manipulators need to be updated *after* view matrix was set up */
-       /* TODO depth culling manipulators is not yet supported, just drawing _3D here, should
+       /* draw depth culled gizmos - gizmos need to be updated *after* view matrix was set up */
+       /* TODO depth culling gizmos is not yet supported, just drawing _3D here, should
         * later become _IN_SCENE (and draw _3D separate) */
-       WM_manipulatormap_draw(
-               ar->manipulator_map, draw_ctx->evil_C,
-               WM_MANIPULATORMAP_DRAWSTEP_3D);
+       WM_gizmomap_draw(
+               ar->gizmo_map, draw_ctx->evil_C,
+               WM_GIZMOMAP_DRAWSTEP_3D);
 
 }
 
-void DRW_draw_manipulator_2d(void)
+void DRW_draw_gizmo_2d(void)
 {
        const DRWContextState *draw_ctx = DRW_context_state_get();
        ARegion *ar = draw_ctx->ar;
 
-       WM_manipulatormap_draw(
-               ar->manipulator_map, draw_ctx->evil_C,
-               WM_MANIPULATORMAP_DRAWSTEP_2D);
+       WM_gizmomap_draw(
+               ar->gizmo_map, draw_ctx->evil_C,
+               WM_GIZMOMAP_DRAWSTEP_2D);
 
        glDepthMask(GL_TRUE);
 }
index 203420483a75f87f402677ed4840784faa58cb9d..8f45a5fd786f1ada94a3498b68e62e10424ecdba 100644 (file)
@@ -30,7 +30,7 @@ void DRW_draw_grid(void);
 void DRW_draw_region_info(void);
 void DRW_draw_background(void);
 void DRW_draw_cursor(void);
-void DRW_draw_manipulator_3d(void);
-void DRW_draw_manipulator_2d(void);
+void DRW_draw_gizmo_3d(void);
+void DRW_draw_gizmo_2d(void);
 
 #endif /* __DRAW_VIEW_H__ */
index 90bbd3580cb75c0f7ee5e456fcdf21f53b3b1eeb..57efc65542c45215e96d96988ec7494cff01de83 100644 (file)
@@ -198,7 +198,7 @@ static void POSE_cache_populate(void *vedata, Object *ob)
        POSE_StorageList *stl = ((POSE_Data *)vedata)->stl;
        const DRWContextState *draw_ctx = DRW_context_state_get();
 
-       /* In the future this will allow us to implement face manipulators,
+       /* In the future this will allow us to implement face gizmos,
         * and similar functionalities. For now we handle only pose bones. */
 
        if (ob->type == OB_ARMATURE) {
index e8804238590a251338c9cce6431fca104d4ddede..11708f5b5ce48462a9b7aeb7d1d6a78f84861f5f 100644 (file)
@@ -132,7 +132,7 @@ static unsigned short indices[] = {
        3, 1, 17,
 };
 
-ManipulatorGeomInfo wm_manipulator_geom_data_arrow = {
+GizmoGeomInfo wm_gizmo_geom_data_arrow = {
        .nverts  = 25,
        .ntris   = 46,
        .verts   = verts,
index f2d038213020c6eeb3e22c5d5184033a3efdb6f5..28eb772c0827f6910eefbe750e2bf036ef805c22 100644 (file)
@@ -66,7 +66,7 @@ static const unsigned short indices[] = {
        4, 0, 7,
 };
 
-ManipulatorGeomInfo wm_manipulator_geom_data_cube = {
+GizmoGeomInfo wm_gizmo_geom_data_cube = {
        .nverts  = 8,
        .ntris   = 12,
        .verts   = verts,
index bc3fb6fcafff416f8df4946a227c7dfc6784a734..0225a662ff36ae2061e640c754fde49e9ba78a4b 100644 (file)
@@ -804,7 +804,7 @@ static const unsigned short indices[] = {
        186, 191, 0,
 };
 
-ManipulatorGeomInfo wm_manipulator_geom_data_dial = {
+GizmoGeomInfo wm_gizmo_geom_data_dial = {
        .nverts  = 192,
        .ntris   = 384,
        .verts   = verts,
index 8ae21f617582e0b45ef406a0e12013976c30009a..aaaee182c71c6f2118857acdc07861e64dede4e1 100644 (file)
 #include "WM_api.h"
 #include "WM_types.h"
 
-/* only for own init/exit calls (wm_manipulatortype_init/wm_manipulatortype_free) */
+/* only for own init/exit calls (wm_gizmotype_init/wm_gizmotype_free) */
 #include "wm.h"
 
 /* own includes */
 #include "gizmo_library_intern.h"
 
 /**
- * Main draw call for ManipulatorGeomInfo data
+ * Main draw call for GizmoGeomInfo data
  */
-void wm_manipulator_geometryinfo_draw(const ManipulatorGeomInfo *info, const bool UNUSED(select), const float color[4])
+void wm_gizmo_geometryinfo_draw(const GizmoGeomInfo *info, const bool UNUSED(select), const float color[4])
 {
-       /* TODO store the Batches inside the ManipulatorGeomInfo and updated it when geom changes
+       /* TODO store the Batches inside the GizmoGeomInfo and updated it when geom changes
         * So we don't need to re-created and discard it every time */
 
        Gwn_VertBuf *vbo;
@@ -108,7 +108,7 @@ void wm_manipulator_geometryinfo_draw(const ManipulatorGeomInfo *info, const boo
        GWN_batch_discard(batch);
 }
 
-void wm_manipulator_vec_draw(
+void wm_gizmo_vec_draw(
         const float color[4], const float (*verts)[3], uint vert_count,
         uint pos, uint primitive_type)
 {
index de976bbad4802e5be89225b914afb5807ddda7de..254fb6b09579bc76aea0b3dcb2dd8f4744843350 100644 (file)
 /** \file gizmo_geometry.h
  *  \ingroup wm
  *
- * \name Manipulator Geometry
+ * \name Gizmo Geometry
  *
- * \brief Prototypes for arrays defining the manipulator geometry. The actual definitions can be found in files usually
- *        called geom_xxx_manipulator.c
+ * \brief Prototypes for arrays defining the gizmo geometry. The actual definitions can be found in files usually
+ *        called geom_xxx_gizmo.c
  */
 
 
 #ifndef __GIZMO_GEOMETRY_H__
 #define __GIZMO_GEOMETRY_H__
 
-typedef struct ManipulatorGeomInfo {
+typedef struct GizmoGeomInfo {
        int nverts;
        int ntris;
        const float (*verts)[3];
        const float (*normals)[3];
        const unsigned short *indices;
-} ManipulatorGeomInfo;
+} GizmoGeomInfo;
 
-/* arrow manipulator */
-extern ManipulatorGeomInfo wm_manipulator_geom_data_arrow;
+/* arrow gizmo */
+extern GizmoGeomInfo wm_gizmo_geom_data_arrow;
 
-/* cube manipulator */
-extern ManipulatorGeomInfo wm_manipulator_geom_data_cube;
+/* cube gizmo */
+extern GizmoGeomInfo wm_gizmo_geom_data_cube;
 
-/* dial manipulator */
-extern ManipulatorGeomInfo wm_manipulator_geom_data_dial;
+/* dial gizmo */
+extern GizmoGeomInfo wm_gizmo_geom_data_dial;
 
 #endif  /* __GIZMO_GEOMETRY_H__ */
index 17121d3752e7ef48df7c5a9966ec6eaf9ef39099..f1689ee93db8f27cff04d59cea207bfdabd6e44f 100644 (file)
 #ifndef __GIZMO_LIBRARY_INTERN_H__
 #define __GIZMO_LIBRARY_INTERN_H__
 
-/* distance around which manipulators respond to input (and get highlighted) */
-#define MANIPULATOR_HOTSPOT 14.0f
+/* distance around which gizmos respond to input (and get highlighted) */
+#define GIZMO_HOTSPOT 14.0f
 
 /**
- * Data for common interactions. Used in manipulator_library_utils.c functions.
+ * Data for common interactions. Used in gizmo_library_utils.c functions.
  */
-typedef struct ManipulatorCommonData {
+typedef struct GizmoCommonData {
        int flag;
 
        float range_fac;      /* factor for arrow min/max distance */
        float offset;
 
-       /* property range for constrained manipulators */
+       /* property range for constrained gizmos */
        float range;
-       /* min/max value for constrained manipulators */
+       /* min/max value for constrained gizmos */
        float min, max;
-} ManipulatorCommonData;
+} GizmoCommonData;
 
-typedef struct ManipulatorInteraction {
+typedef struct GizmoInteraction {
        float init_value; /* initial property value */
        float init_mval[2];
        float init_offset;
@@ -60,50 +60,50 @@ typedef struct ManipulatorInteraction {
        /* Total offset added by precision tweaking.
         * Needed to allow toggling precision on/off without causing jumps */
        float precision_offset;
-} ManipulatorInteraction;
+} GizmoInteraction;
 
-/* ManipulatorCommonData->flag  */
+/* GizmoCommonData->flag  */
 enum {
-       MANIPULATOR_CUSTOM_RANGE_SET = (1 << 0),
+       GIZMO_CUSTOM_RANGE_SET = (1 << 0),
 };
 
 
-float manipulator_offset_from_value(
-        ManipulatorCommonData *data, const float value,
+float gizmo_offset_from_value(
+        GizmoCommonData *data, const float value,
         const bool constrained, const bool inverted);
-float manipulator_value_from_offset(
-        ManipulatorCommonData *data, ManipulatorInteraction *inter, const float offset,
+float gizmo_value_from_offset(
+        GizmoCommonData *data, GizmoInteraction *inter, const float offset,
         const bool constrained, const bool inverted, const bool use_precision);
 
-void manipulator_property_data_update(
-        struct wmManipulator *mpr, ManipulatorCommonData *data, wmManipulatorProperty *mpr_prop,
+void gizmo_property_data_update(
+        struct wmGizmo *mpr, GizmoCommonData *data, wmGizmoProperty *mpr_prop,
         const bool constrained, const bool inverted);
 
-void  manipulator_property_value_reset(
-        bContext *C, const struct wmManipulator *mpr, ManipulatorInteraction *inter, wmManipulatorProperty *mpr_prop);
+void  gizmo_property_value_reset(
+        bContext *C, const struct wmGizmo *mpr, GizmoInteraction *inter, wmGizmoProperty *mpr_prop);
 
 
 /* -------------------------------------------------------------------- */
 
-void manipulator_color_get(
-        const struct wmManipulator *mpr, const bool highlight,
+void gizmo_color_get(
+        const struct wmGizmo *mpr, const bool highlight,
         float r_color[4]);
 
-bool manipulator_window_project_2d(
-        bContext *C, const struct wmManipulator *mpr, const float mval[2], int axis, bool use_offset,
+bool gizmo_window_project_2d(
+        bContext *C, const struct wmGizmo *mpr, const float mval[2], int axis, bool use_offset,
         float r_co[2]);
 
-bool manipulator_window_project_3d(
-        bContext *C, const struct wmManipulator *mpr, const float mval[2], bool use_offset,
+bool gizmo_window_project_3d(
+        bContext *C, const struct wmGizmo *mpr, const float mval[2], bool use_offset,
         float r_co[3]);
 
 /* -------------------------------------------------------------------- */
-/* Manipulator drawing */
+/* Gizmo drawing */
 
 #include "gizmo_geometry.h"
 
-void wm_manipulator_geometryinfo_draw(const struct ManipulatorGeomInfo *info, const bool select, const float color[4]);
-void wm_manipulator_vec_draw(
+void wm_gizmo_geometryinfo_draw(const struct GizmoGeomInfo *info, const bool select, const float color[4]);
+void wm_gizmo_vec_draw(
         const float color[4], const float (*verts)[3], uint vert_count,
         uint pos, uint primitive_type);
 
index d58e0c9dc85aecb4016e12e4f348772240973a02..8a6b92e48d69627a2efee552f5d0466817208239 100644 (file)
@@ -21,9 +21,9 @@
 /** \file blender/editors/gizmo_library/gizmo_library_presets.c
  *  \ingroup wm
  *
- * \name Manipulator Lib Presets
+ * \name Gizmo Lib Presets
  *
- * \brief Preset shapes that can be drawn from any manipulator type.
+ * \brief Preset shapes that can be drawn from any gizmo type.
  */
 
 #include "MEM_guardedalloc.h"
@@ -57,7 +57,7 @@
 #include "ED_gizmo_library.h"  /* own include */
 #include "gizmo_library_intern.h"  /* own include */
 
-/* TODO, this is to be used by RNA. might move to ED_manipulator_library */
+/* TODO, this is to be used by RNA. might move to ED_gizmo_library */
 
 /**
  * Given a single axis, orient the matrix to a different direction.
@@ -80,15 +80,15 @@ static void single_axis_convert(
 /**
  * Use for all geometry.
  */
-static void ed_manipulator_draw_preset_geometry(
-        const struct wmManipulator *mpr, float mat[4][4], int select_id,
-        const ManipulatorGeomInfo *info)
+static void ed_gizmo_draw_preset_geometry(
+        const struct wmGizmo *mpr, float mat[4][4], int select_id,
+        const GizmoGeomInfo *info)
 {
        const bool is_select = (select_id != -1);
-       const bool is_highlight = is_select && (mpr->state & WM_MANIPULATOR_STATE_HIGHLIGHT) != 0;
+       const bool is_highlight = is_select && (mpr->state & WM_GIZMO_STATE_HIGHLIGHT) != 0;
 
        float color[4];
-       manipulator_color_get(mpr, is_highlight, color);
+       gizmo_color_get(mpr, is_highlight, color);
 
        if (is_select) {
                GPU_select_load_id(select_id);
@@ -96,7 +96,7 @@ static void ed_manipulator_draw_preset_geometry(
 
        gpuPushMatrix();
        gpuMultMatrix(mat);
-       wm_manipulator_geometryinfo_draw(info, is_select, color);
+       wm_gizmo_geometryinfo_draw(info, is_select, color);
        gpuPopMatrix();
 
        if (is_select) {
@@ -104,36 +104,36 @@ static void ed_manipulator_draw_preset_geometry(
        }
 }
 
-void ED_manipulator_draw_preset_box(
-        const struct wmManipulator *mpr, float mat[4][4], int select_id)
+void ED_gizmo_draw_preset_box(
+        const struct wmGizmo *mpr, float mat[4][4], int select_id)
 {
-       ed_manipulator_draw_preset_geometry(mpr, mat, select_id, &wm_manipulator_geom_data_cube);
+       ed_gizmo_draw_preset_geometry(mpr, mat, select_id, &wm_gizmo_geom_data_cube);
 }
 
-void ED_manipulator_draw_preset_arrow(
-        const struct wmManipulator *mpr, float mat[4][4], int axis, int select_id)
+void ED_gizmo_draw_preset_arrow(
+        const struct wmGizmo *mpr, float mat[4][4], int axis, int select_id)
 {
        float mat_rotate[4][4];
        single_axis_convert(OB_POSZ, mat, axis, mat_rotate);
-       ed_manipulator_draw_preset_geometry(mpr, mat_rotate, select_id, &wm_manipulator_geom_data_arrow);
+       ed_gizmo_draw_preset_geometry(mpr, mat_rotate, select_id, &wm_gizmo_geom_data_arrow);
 }
 
-void ED_manipulator_draw_preset_circle(
-        const struct wmManipulator *mpr, float mat[4][4], int axis, int select_id)
+void ED_gizmo_draw_preset_circle(
+        const struct wmGizmo *mpr, float mat[4][4], int axis, int select_id)
 {
        float mat_rotate[4][4];
        single_axis_convert(OB_POSZ, mat, axis, mat_rotate);
-       ed_manipulator_draw_preset_geometry(mpr, mat_rotate, select_id, &wm_manipulator_geom_data_dial);
+       ed_gizmo_draw_preset_geometry(mpr, mat_rotate, select_id, &wm_gizmo_geom_data_dial);
 }
 
-void ED_manipulator_draw_preset_facemap(
-        const bContext *C, const struct wmManipulator *mpr, struct Scene *scene, Object *ob,  const int facemap, int select_id)
+void ED_gizmo_draw_preset_facemap(
+        const bContext *C, const struct wmGizmo *mpr, struct Scene *scene, Object *ob,  const int facemap, int select_id)
 {
        const bool is_select = (select_id != -1);
-       const bool is_highlight = is_select && (mpr->state & WM_MANIPULATOR_STATE_HIGHLIGHT) != 0;
+       const bool is_highlight = is_select && (mpr->state & WM_GIZMO_STATE_HIGHLIGHT) != 0;
 
        float color[4];
-       manipulator_color_get(mpr, is_highlight, color);
+       gizmo_color_get(mpr, is_highlight, color);
 
        if (is_select) {
                GPU_select_load_id(select_id);
index 794728dd03cf8dedd2aa076c225934decb808df2..6e6bc2ed824b7eb1fff7fc6095f695452e9f12d7 100644 (file)
@@ -26,9 +26,9 @@
 /** \file gizmo_library_utils.c
  *  \ingroup wm
  *
- * \name Manipulator Library Utilities
+ * \name Gizmo Library Utilities
  *
- * \brief This file contains functions for common behaviors of manipulators.
+ * \brief This file contains functions for common behaviors of gizmos.
  */
 
 #include "BLI_math.h"
 #include "gizmo_library_intern.h"
 
 /* factor for precision tweaking */
-#define MANIPULATOR_PRECISION_FAC 0.05f
+#define GIZMO_PRECISION_FAC 0.05f
 
 
-BLI_INLINE float manipulator_offset_from_value_constr(
+BLI_INLINE float gizmo_offset_from_value_constr(
         const float range_fac, const float min, const float range, const float value,
         const bool inverted)
 {
        return inverted ? (range_fac * (min + range - value) / range) : (range_fac * (value / range));
 }
 
-BLI_INLINE float manipulator_value_from_offset_constr(
+BLI_INLINE float gizmo_value_from_offset_constr(
         const float range_fac, const float min, const float range, const float value,
         const bool inverted)
 {
        return inverted ? (min + range - (value * range / range_fac)) : (value * range / range_fac);
 }
 
-float manipulator_offset_from_value(
-        ManipulatorCommonData *data, const float value, const bool constrained, const bool inverted)
+float gizmo_offset_from_value(
+        GizmoCommonData *data, const float value, const bool constrained, const bool inverted)
 {
        if (constrained)
-               return manipulator_offset_from_value_constr(data->range_fac, data->min, data->range, value, inverted);
+               return gizmo_offset_from_value_constr(data->range_fac, data->min, data->range, value, inverted);
 
        return value;
 }
 
-float manipulator_value_from_offset(
-        ManipulatorCommonData *data, ManipulatorInteraction *inter, const float offset,
+float gizmo_value_from_offset(
+        GizmoCommonData *data, GizmoInteraction *inter, const float offset,
         const bool constrained, const bool inverted, const bool use_precision)
 {
        const float max = data->min + data->range;
@@ -88,26 +88,26 @@ float manipulator_value_from_offset(
        }
        inter->prev_offset = offset;
 
-       float ofs_new = inter->init_offset + offset - inter->precision_offset * (1.0f - MANIPULATOR_PRECISION_FAC);
+       float ofs_new = inter->init_offset + offset - inter->precision_offset * (1.0f - GIZMO_PRECISION_FAC);
        float value;
 
        if (constrained) {
-               value = manipulator_value_from_offset_constr(data->range_fac, data->min, data->range, ofs_new, inverted);
+               value = gizmo_value_from_offset_constr(data->range_fac, data->min, data->range, ofs_new, inverted);
        }
        else {
                value = ofs_new;
        }
 
        /* clamp to custom range */
-       if (data->flag & MANIPULATOR_CUSTOM_RANGE_SET) {
+       if (data->flag & GIZMO_CUSTOM_RANGE_SET) {
                CLAMP(value, data->min, max);
        }
 
        return value;
 }
 
-void manipulator_property_data_update(
-        wmManipulator *mpr, ManipulatorCommonData *data, wmManipulatorProperty *mpr_prop,
+void gizmo_property_data_update(
+        wmGizmo *mpr, GizmoCommonData *data, wmGizmoProperty *mpr_prop,
         const bool constrained, const bool inverted)
 {
        if (mpr_prop->custom_func.value_get_fn != NULL) {
@@ -121,12 +121,12 @@ void manipulator_property_data_update(
                return;
        }
 
-       float value = WM_manipulator_target_property_value_get(mpr, mpr_prop);
+       float value = WM_gizmo_target_property_value_get(mpr, mpr_prop);
 
        if (constrained) {
-               if ((data->flag & MANIPULATOR_CUSTOM_RANGE_SET) == 0) {
+               if ((data->flag & GIZMO_CUSTOM_RANGE_SET) == 0) {
                        float range[2];
-                       if (WM_manipulator_target_property_range_get(mpr, mpr_prop, range)) {
+                       if (WM_gizmo_target_property_range_get(mpr, mpr_prop, range)) {
                                data->range = range[1] - range[0];
                                data->min = range[0];
                        }
@@ -134,27 +134,27 @@ void manipulator_property_data_update(
                                BLI_assert(0);
                        }
                }
-               data->offset = manipulator_offset_from_value_constr(data->range_fac, data->min, data->range, value, inverted);
+               data->offset = gizmo_offset_from_value_constr(data->range_fac, data->min, data->range, value, inverted);
        }
        else {
                data->offset = value;
        }
 }
 
-void manipulator_property_value_reset(
-        bContext *C, const wmManipulator *mpr, ManipulatorInteraction *inter,
-        wmManipulatorProperty *mpr_prop)
+void gizmo_property_value_reset(
+        bContext *C, const wmGizmo *mpr, GizmoInteraction *inter,
+        wmGizmoProperty *mpr_prop)
 {
-       WM_manipulator_target_property_value_set(C, mpr, mpr_prop, inter->init_value);
+       WM_gizmo_target_property_value_set(C, mpr, mpr_prop, inter->init_value);
 }
 
 /* -------------------------------------------------------------------- */
 
-void manipulator_color_get(
-        const wmManipulator *mpr, const bool highlight,
+void gizmo_color_get(
+        const wmGizmo *mpr, const bool highlight,
         float r_col[4])
 {
-       if (highlight && !(mpr->flag & WM_MANIPULATOR_DRAW_HOVER)) {
+       if (highlight && !(mpr->flag & WM_GIZMO_DRAW_HOVER)) {
                copy_v4_v4(r_col, mpr->color_hi);
        }
        else {
@@ -165,26 +165,26 @@ void manipulator_color_get(
 /* -------------------------------------------------------------------- */
 
 /**
- * Takes mouse coordinates and returns them in relation to the manipulator.
- * Both 2D & 3D supported, use so we can use 2D manipulators in the 3D view.
+ * Takes mouse coordinates and returns them in relation to the gizmo.
+ * Both 2D & 3D supported, use so we can use 2D gizmos in the 3D view.
  */
-bool manipulator_window_project_2d(
-        bContext *C, const struct wmManipulator *mpr, const float mval[2], int axis, bool use_offset,
+bool gizmo_window_project_2d(
+        bContext *C, const struct wmGizmo *mpr, const float mval[2], int axis, bool use_offset,
         float r_co[2])
 {
        float mat[4][4];
        {
                float mat_identity[4][4];
-               struct WM_ManipulatorMatrixParams params = {NULL};
+               struct WM_GizmoMatrixParams params = {NULL};
                if (use_offset == false) {
                        unit_m4(mat_identity);
                        params.matrix_offset = mat_identity;
                }
-               WM_manipulator_calc_matrix_final_params(mpr, &params, mat);
+               WM_gizmo_calc_matrix_final_params(mpr, &params, mat);
        }
 
        /* rotate mouse in relation to the center and relocate it */
-       if (mpr->parent_mgroup->type->flag & WM_MANIPULATORGROUPTYPE_3D) {
+       if (mpr->parent_mgroup->type->flag & WM_GIZMOGROUPTYPE_3D) {
                /* For 3d views, transform 2D mouse pos onto plane. */
                View3D *v3d = CTX_wm_view3d(C);
                ARegion *ar = CTX_wm_region(C);
@@ -220,26 +220,26 @@ bool manipulator_window_project_2d(
        }
 }
 
-bool manipulator_window_project_3d(
-        bContext *C, const struct wmManipulator *mpr, const float mval[2], bool use_offset,
+bool gizmo_window_project_3d(
+        bContext *C, const struct wmGizmo *mpr, const float mval[2], bool use_offset,
         float r_co[3])
 {
        float mat[4][4];
        {
                float mat_identity[4][4];
-               struct WM_ManipulatorMatrixParams params = {NULL};
+               struct WM_GizmoMatrixParams params = {NULL};
                if (use_offset == false) {
                        unit_m4(mat_identity);
                        params.matrix_offset = mat_identity;
                }
-               WM_manipulator_calc_matrix_final_params(mpr, &params, mat);
+               WM_gizmo_calc_matrix_final_params(mpr, &params, mat);
        }
 
-       if (mpr->parent_mgroup->type->flag & WM_MANIPULATORGROUPTYPE_3D) {
+       if (mpr->parent_mgroup->type->flag & WM_GIZMOGROUPTYPE_3D) {
                View3D *v3d = CTX_wm_view3d(C);
                ARegion *ar = CTX_wm_region(C);
                /* Note: we might want a custom reference point passed in,
-                * instead of the manipulator center. */
+                * instead of the gizmo center. */
                ED_view3d_win_to_3d(v3d, ar, mat[3], mval, r_co);
                invert_m4(mat);
                mul_m4_v3(mat, r_co);
index fbb30b955625c8ded00bb6ba480a7efd1aa12f8b..dfa2eeeb38bfc77b1f798593477211fe3def23d8 100644 (file)
@@ -26,9 +26,9 @@
 /** \file arrow2d_gizmo.c
  *  \ingroup wm
  *
- * \name 2D Arrow Manipulator
+ * \name 2D Arrow Gizmo
  *
- * \brief Simple arrow manipulator which is dragged into a certain direction.
+ * \brief Simple arrow gizmo which is dragged into a certain direction.
  */
 
 #include "BLI_listbase.h"
@@ -61,7 +61,7 @@
 
 #include "../gizmo_library_intern.h"
 
-static void arrow2d_draw_geom(wmManipulator *mpr, const float matrix[4][4], const float color[4])
+static void arrow2d_draw_geom(wmGizmo *mpr, const float matrix[4][4], const float color[4])
 {
        const float size = 0.11f;
        const float size_breadth = size / 2.0f;
@@ -96,24 +96,24 @@ static void arrow2d_draw_geom(wmManipulator *mpr, const float matrix[4][4], cons
        gpuPopMatrix();
 }
 
-static void manipulator_arrow2d_draw(const bContext *UNUSED(C), wmManipulator *mpr)
+static void gizmo_arrow2d_draw(const bContext *UNUSED(C), wmGizmo *mpr)
 {
        float color[4];
 
        float matrix_final[4][4];
 
-       manipulator_color_get(mpr, mpr->state & WM_MANIPULATOR_STATE_HIGHLIGHT, color);
+       gizmo_color_get(mpr, mpr->state & WM_GIZMO_STATE_HIGHLIGHT, color);
 
        GPU_line_width(mpr->line_width);
 
-       WM_manipulator_calc_matrix_final(mpr, matrix_final);
+       WM_gizmo_calc_matrix_final(mpr, matrix_final);
 
        GPU_blend(true);
        arrow2d_draw_geom(mpr, matrix_final, color);
        GPU_blend(false);
 
        if (mpr->interaction_data) {
-               ManipulatorInteraction *inter = mpr->interaction_data;
+               GizmoInteraction *inter = mpr->interaction_data;
 
                GPU_blend(true);
                arrow2d_draw_geom(mpr, inter->init_matrix_final, (const float[4]){0.5f, 0.5f, 0.5f, 0.5f});
@@ -121,26 +121,26 @@ static void manipulator_arrow2d_draw(const bContext *UNUSED(C), wmManipulator *m
        }
 }
 
-static void manipulator_arrow2d_setup(wmManipulator *mpr)
+static void gizmo_arrow2d_setup(wmGizmo *mpr)
 {
-       mpr->flag |= WM_MANIPULATOR_DRAW_MODAL;
+       mpr->flag |= WM_GIZMO_DRAW_MODAL;
 }
 
-static int manipulator_arrow2d_invoke(
-        bContext *UNUSED(C), wmManipulator *mpr, const wmEvent *UNUSED(event))
+static int gizmo_arrow2d_invoke(
+        bContext *UNUSED(C), wmGizmo *mpr, const wmEvent *UNUSED(event))
 {
-       ManipulatorInteraction *inter = MEM_callocN(sizeof(ManipulatorInteraction), __func__);
+       GizmoInteraction *inter = MEM_callocN(sizeof(GizmoInteraction), __func__);
 
        copy_m4_m4(inter->init_matrix_basis, mpr->matrix_basis);
-       WM_manipulator_calc_matrix_final(mpr, inter->init_matrix_final);
+       WM_gizmo_calc_matrix_final(mpr, inter->init_matrix_final);
 
        mpr->interaction_data = inter;
 
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int manipulator_arrow2d_test_select(
-        bContext *UNUSED(C), wmManipulator *mpr, const wmEvent *event)
+static int gizmo_arrow2d_test_select(
+        bContext *UNUSED(C), wmGizmo *mpr, const wmEvent *event)
 {
        const float mval[2] = {event->mval[0], event->mval[1]};
        const float arrow_length = RNA_float_get(mpr->ptr, "length");
@@ -165,14 +165,14 @@ static int manipulator_arrow2d_test_select(
        /* arrow line intersection check */
        float isect_1[2], isect_2[2];
        const int isect = isect_line_sphere_v2(
-               line[0], line[1], mval_local, MANIPULATOR_HOTSPOT + mpr->line_width * 0.5f,
+               line[0], line[1], mval_local, GIZMO_HOTSPOT + mpr->line_width * 0.5f,
                isect_1, isect_2);
 
        if (isect > 0) {
                float line_ext[2][2]; /* extended line for segment check including hotspot */
                copy_v2_v2(line_ext[0], line[0]);
-               line_ext[1][0] = line[1][0] + MANIPULATOR_HOTSPOT * ((line[1][0] - line[0][0]) / line_len);
-               line_ext[1][1] = line[1][1] + MANIPULATOR_HOTSPOT * ((line[1][1] - line[0][1]) / line_len);
+               line_ext[1][0] = line[1][0] + GIZMO_HOTSPOT * ((line[1][0] - line[0][0]) / line_len);
+               line_ext[1][1] = line[1][1] + GIZMO_HOTSPOT * ((line[1][1] - line[0][1]) / line_len);
 
                const float lambda_1 = line_point_factor_v2(isect_1, line_ext[0], line_ext[1]);
                if (isect == 1) {
@@ -193,22 +193,22 @@ static int manipulator_arrow2d_test_select(
 }
 
 /* -------------------------------------------------------------------- */
-/** \name 2D Arrow Manipulator API
+/** \name 2D Arrow Gizmo API
  *
  * \{ */
 
-static void MANIPULATOR_WT_arrow_2d(wmManipulatorType *wt)
+static void GIZMO_WT_arrow_2d(wmGizmoType *wt)
 {
        /* identifiers */
-       wt->idname = "MANIPULATOR_WT_arrow_2d";
+       wt->idname = "GIZMO_WT_arrow_2d";
 
        /* api callbacks */
-       wt->draw = manipulator_arrow2d_draw;
-       wt->setup = manipulator_arrow2d_setup;
-       wt->invoke = manipulator_arrow2d_invoke;
-       wt->test_select = manipulator_arrow2d_test_select;
+       wt->draw = gizmo_arrow2d_draw;
+       wt->setup = gizmo_arrow2d_setup;
+       wt->invoke = gizmo_arrow2d_invoke;
+       wt->test_select = gizmo_arrow2d_test_select;
 
-       wt->struct_size = sizeof(wmManipulator);
+       wt->struct_size = sizeof(wmGizmo);
 
        /* rna */
        RNA_def_float(wt->srna, "length", 1.0f, 0.0f, FLT_MAX, "Arrow Line Length", "", 0.0f, FLT_MAX);
@@ -217,9 +217,9 @@ static void MANIPULATOR_WT_arrow_2d(wmManipulatorType *wt)
                "Roll", "", DEG2RADF(-360.0f), DEG2RADF(360.0f));
 }
 
-void ED_manipulatortypes_arrow_2d(void)
+void ED_gizmotypes_arrow_2d(void)
 {
-       WM_manipulatortype_append(MANIPULATOR_WT_arrow_2d);
+       WM_gizmotype_append(GIZMO_WT_arrow_2d);
 }
 
 /** \} */
index 72b24e03c00828a0160b67cbc1f60ab8881cb3a8..9807a111d261d4aeafb3474b0b08d3f33b2e103b 100644 (file)
 /** \file arrow3d_gizmo.c
  *  \ingroup wm
  *
- * \name Arrow Manipulator
+ * \name Arrow Gizmo
  *
- * 3D Manipulator
+ * 3D Gizmo
  *
- * \brief Simple arrow manipulator which is dragged into a certain direction.
+ * \brief Simple arrow gizmo which is dragged into a certain direction.
  * The arrow head can have varying shapes, e.g. cone, box, etc.
  *
  * - `matrix[0]` is derived from Y and Z.
- * - `matrix[1]` is 'up' for manipulator types that have an up.
+ * - `matrix[1]` is 'up' for gizmo types that have an up.
  * - `matrix[2]` is the arrow direction (for all arrowes).
  */
 
 #include "../gizmo_geometry.h"
 #include "../gizmo_library_intern.h"
 
-/* to use custom arrows exported to geom_arrow_manipulator.c */
-//#define USE_MANIPULATOR_CUSTOM_ARROWS
+/* to use custom arrows exported to geom_arrow_gizmo.c */
+//#define USE_GIZMO_CUSTOM_ARROWS
 
-typedef struct ArrowManipulator3D {
-       wmManipulator manipulator;
-       ManipulatorCommonData data;
-} ArrowManipulator3D;
+typedef struct ArrowGizmo3D {
+       wmGizmo gizmo;
+       GizmoCommonData data;
+} ArrowGizmo3D;
 
 
 /* -------------------------------------------------------------------- */
 
-static void manipulator_arrow_matrix_basis_get(const wmManipulator *mpr, float r_matrix[4][4])
+static void gizmo_arrow_matrix_basis_get(const wmGizmo *mpr, float r_matrix[4][4])
 {
-       ArrowManipulator3D *arrow = (ArrowManipulator3D *)mpr;
+       ArrowGizmo3D *arrow = (ArrowGizmo3D *)mpr;
 
-       copy_m4_m4(r_matrix, arrow->manipulator.matrix_basis);
-       madd_v3_v3fl(r_matrix[3], arrow->manipulator.matrix_basis[2], arrow->data.offset);
+       copy_m4_m4(r_matrix, arrow->gizmo.matrix_basis);
+       madd_v3_v3fl(r_matrix[3], arrow->gizmo.matrix_basis[2], arrow->data.offset);
 }
 
-static void arrow_draw_geom(const ArrowManipulator3D *arrow, const bool select, const float color[4])
+static void arrow_draw_geom(const ArrowGizmo3D *arrow, const bool select, const float color[4])
 {
        uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
        bool unbind_shader = true;
-       const int draw_style = RNA_enum_get(arrow->manipulator.ptr, "draw_style");
-       const int draw_options = RNA_enum_get(arrow->manipulator.ptr, "draw_options");
+       const int draw_style = RNA_enum_get(arrow->gizmo.ptr, "draw_style");
+       const int draw_options = RNA_enum_get(arrow->gizmo.ptr, "draw_options");
 
        immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
 
-       if (draw_style == ED_MANIPULATOR_ARROW_STYLE_CROSS) {
+       if (draw_style == ED_GIZMO_ARROW_STYLE_CROSS) {
                immUniformColor4fv(color);
 
                immBegin(GWN_PRIM_LINES, 4);
@@ -107,9 +107,9 @@ static void arrow_draw_geom(const ArrowManipulator3D *arrow, const bool select,
                immVertex3f(pos,  0.0f,  1.0f, 0.0f);
                immEnd();
        }
-       else if (draw_style == ED_MANIPULATOR_ARROW_STYLE_CONE) {
+       else if (draw_style == ED_GIZMO_ARROW_STYLE_CONE) {
                float aspect[2];
-               RNA_float_get_array(arrow->manipulator.ptr, "aspect", aspect);
+               RNA_float_get_array(arrow->gizmo.ptr, "aspect", aspect);
                const float unitx = aspect[0];
                const float unity = aspect[1];
                const float vec[4][3] = {
@@ -119,23 +119,23 @@ static void arrow_draw_geom(const ArrowManipulator3D *arrow, const bool select,
                        {-unitx,  unity, 0},
                };
 
-               GPU_line_width(arrow->manipulator.line_width);
-               wm_manipulator_vec_draw(color, vec, ARRAY_SIZE(vec), pos, GWN_PRIM_LINE_LOOP);
+               GPU_line_width(arrow->gizmo.line_width);
+               wm_gizmo_vec_draw(color, vec, ARRAY_SIZE(vec), pos, GWN_PRIM_LINE_LOOP);
        }
        else {
-#ifdef USE_MANIPULATOR_CUSTOM_ARROWS
-               wm_manipulator_geometryinfo_draw(&wm_manipulator_geom_data_arrow, select, color);
+#ifdef USE_GIZMO_CUSTOM_ARROWS
+               wm_gizmo_geometryinfo_draw(&wm_gizmo_geom_data_arrow, select, color);
 #else
-               const float arrow_length = RNA_float_get(arrow->manipulator.ptr, "length");
+               const float arrow_length = RNA_float_get(arrow->gizmo.ptr, "length");
 
                const float vec[2][3] = {
                        {0.0f, 0.0f, 0.0f},
                        {0.0f, 0.0f, arrow_length},
                };
 
-               if (draw_options & ED_MANIPULATOR_ARROW_DRAW_FLAG_STEM) {
-                       GPU_line_width(arrow->manipulator.line_width);
-                       wm_manipulator_vec_draw(color, vec, ARRAY_SIZE(vec), pos, GWN_PRIM_LINE_STRIP);
+               if (draw_options & ED_GIZMO_ARROW_DRAW_FLAG_STEM) {
+                       GPU_line_width(arrow->gizmo.line_width);
+                       wm_gizmo_vec_draw(color, vec, ARRAY_SIZE(vec), pos, GWN_PRIM_LINE_STRIP);
                }
                else {
                        immUniformColor4fv(color);
@@ -145,7 +145,7 @@ static void arrow_draw_geom(const ArrowManipulator3D *arrow, const bool select,
 
                gpuPushMatrix();
 
-               if (draw_style == ED_MANIPULATOR_ARROW_STYLE_BOX) {
+               if (draw_style == ED_GIZMO_ARROW_STYLE_BOX) {
                        const float size = 0.05f;
 
                        /* translate to line end with some extra offset so box starts exactly where line ends */
@@ -156,10 +156,10 @@ static void arrow_draw_geom(const ArrowManipulator3D *arrow, const bool select,
                        /* draw cube */
                        immUnbindProgram();
                        unbind_shader = false;
-                       wm_manipulator_geometryinfo_draw(&wm_manipulator_geom_data_cube, select, color);
+                       wm_gizmo_geometryinfo_draw(&wm_gizmo_geom_data_cube, select, color);
                }
                else {
-                       BLI_assert(draw_style == ED_MANIPULATOR_ARROW_STYLE_NORMAL);
+                       BLI_assert(draw_style == ED_GIZMO_ARROW_STYLE_NORMAL);
 
                        const float len = 0.25f;
                        const float width = 0.06f;
@@ -172,7 +172,7 @@ static void arrow_draw_geom(const ArrowManipulator3D *arrow, const bool select,
                }
 
                gpuPopMatrix();
-#endif  /* USE_MANIPULATOR_CUSTOM_ARROWS */
+#endif  /* USE_GIZMO_CUSTOM_ARROWS */
        }
 
        if (unbind_shader) {
@@ -180,15 +180,15 @@ static void arrow_draw_geom(const ArrowManipulator3D *arrow, const bool select,
        }
 }
 
-static void arrow_draw_intern(ArrowManipulator3D *arrow, const bool select, const bool highlight)
+static void arrow_draw_intern(ArrowGizmo3D *arrow, const bool select, const bool highlight)
 {
-       wmManipulator *mpr = &arrow->manipulator;
+       wmGizmo *mpr = &arrow->gizmo;
        float color[4];
        float matrix_final[4][4];
 
-       manipulator_color_get(mpr, highlight, color);
+       gizmo_color_get(mpr, highlight, color);
 
-       WM_manipulator_calc_matrix_final(mpr, matrix_final);
+       WM_gizmo_calc_matrix_final(mpr, matrix_final);
 
        gpuPushMatrix();
        gpuMultMatrix(matrix_final);
@@ -199,7 +199,7 @@ static void arrow_draw_intern(ArrowManipulator3D *arrow, const bool select, cons
        gpuPopMatrix();
 
        if (mpr->interaction_data) {
-               ManipulatorInteraction *inter = mpr->interaction_data;
+               GizmoInteraction *inter = mpr->interaction_data;
 
                gpuPushMatrix();
                gpuMultMatrix(inter->init_matrix_final);
@@ -213,29 +213,29 @@ static void arrow_draw_intern(ArrowManipulator3D *arrow, const bool select, cons
        }
 }
 
-static void manipulator_arrow_draw_select(
-        const bContext *UNUSED(C), wmManipulator *mpr,
+static void gizmo_arrow_draw_select(
+        const bContext *UNUSED(C), wmGizmo *mpr,
         int select_id)
 {
        GPU_select_load_id(select_id);
-       arrow_draw_intern((ArrowManipulator3D *)mpr, true, false);
+       arrow_draw_intern((ArrowGizmo3D *)mpr, true, false);
 }
 
-static void manipulator_arrow_draw(const bContext *UNUSED(C), wmManipulator *mpr)
+static void gizmo_arrow_draw(const bContext *UNUSED(C), wmGizmo *mpr)
 {
-       arrow_draw_intern((ArrowManipulator3D *)mpr, false, (mpr->state & WM_MANIPULATOR_STATE_HIGHLIGHT) != 0);
+       arrow_draw_intern((ArrowGizmo3D *)mpr, false, (mpr->state & WM_GIZMO_STATE_HIGHLIGHT) != 0);
 }
 
 /**
  * Calculate arrow offset independent from prop min value,
  * meaning the range will not be offset by min value first.
  */
-static int manipulator_arrow_modal(
-        bContext *C, wmManipulator *mpr, const wmEvent *event,
-        eWM_ManipulatorTweak tweak_flag)
+static int gizmo_arrow_modal(
+        bContext *C, wmGizmo *mpr, const wmEvent *event,
+        eWM_GizmoFlagTweak tweak_flag)
 {
-       ArrowManipulator3D *arrow = (ArrowManipulator3D *)mpr;
-       ManipulatorInteraction *inter = mpr->interaction_data;
+       ArrowGizmo3D *arrow = (ArrowGizmo3D *)mpr;
+       GizmoInteraction *inter = mpr->interaction_data;
        View3D *v3d = CTX_wm_view3d(C);
        ARegion *ar = CTX_wm_region(C);
        RegionView3D *rv3d = ar->regiondata;
@@ -256,7 +256,7 @@ static int manipulator_arrow_modal(
        float arrow_co[3];
        float arrow_no[3];
        copy_v3_v3(arrow_co, inter->init_matrix_basis[3]);
-       normalize_v3_v3(arrow_no, arrow->manipulator.matrix_basis[2]);
+       normalize_v3_v3(arrow_no, arrow->gizmo.matrix_basis[2]);
 
        int ok = 0;
 
@@ -268,7 +268,7 @@ static int manipulator_arrow_modal(
                {
                        /* Force Y axis if we're view aligned */
                        if (j == 0) {
-                               if (RAD2DEGF(acosf(dot_v3v3(proj[j].ray_direction, arrow->manipulator.matrix_basis[2]))) < 5.0f) {
+                               if (RAD2DEGF(acosf(dot_v3v3(proj[j].ray_direction, arrow->gizmo.matrix_basis[2]))) < 5.0f) {
                                        normalize_v3_v3(arrow_no, rv3d->viewinv[1]);
                                }
                        }
@@ -296,24 +296,24 @@ static int manipulator_arrow_modal(
        sub_v3_v3v3(offset, proj[1].location, proj[0].location);
        facdir = dot_v3v3(arrow_no, offset) < 0.0f ? -1 : 1;
 
-       ManipulatorCommonData *data = &arrow->data;
+       GizmoCommonData *data = &arrow->data;
        const float ofs_new = facdir * len_v3(offset);
 
-       wmManipulatorProperty *mpr_prop = WM_manipulator_target_property_find(mpr, "offset");
+       wmGizmoProperty *mpr_prop = WM_gizmo_target_property_find(mpr, "offset");
 
        /* set the property for the operator and call its modal function */
-       if (WM_manipulator_target_property_is_valid(mpr_prop)) {
-               const int transform_flag = RNA_enum_get(arrow->manipulator.ptr, "transform");
-               const bool constrained = (transform_flag & ED_MANIPULATOR_ARROW_XFORM_FLAG_CONSTRAINED) != 0;
-               const bool inverted = (transform_flag & ED_MANIPULATOR_ARROW_XFORM_FLAG_INVERTED) != 0;
-               const bool use_precision = (tweak_flag & WM_MANIPULATOR_TWEAK_PRECISE) != 0;
-               float value = manipulator_value_from_offset(data, inter, ofs_new, constrained, inverted, use_precision);
-
-               WM_manipulator_target_property_value_set(C, mpr, mpr_prop, value);
+       if (WM_gizmo_target_property_is_valid(mpr_prop)) {
+               const int transform_flag = RNA_enum_get(arrow->gizmo.ptr, "transform");
+               const bool constrained = (transform_flag & ED_GIZMO_ARROW_XFORM_FLAG_CONSTRAINED) != 0;
+               const bool inverted = (transform_flag & ED_GIZMO_ARROW_XFORM_FLAG_INVERTED) != 0;
+               const bool use_precision = (tweak_flag & WM_GIZMO_TWEAK_PRECISE) != 0;
+               float value = gizmo_value_from_offset(data, inter, ofs_new, constrained, inverted, use_precision);
+
+               WM_gizmo_target_property_value_set(C, mpr, mpr_prop, value);
                /* get clamped value */
-               value = WM_manipulator_target_property_value_get(mpr, mpr_prop);
+               value = WM_gizmo_target_property_value_get(mpr, mpr_prop);
 
-               data->offset = manipulator_offset_from_value(data, value, constrained, inverted);
+               data->offset = gizmo_offset_from_value(data, value, constrained, inverted);
        }
        else {
                data->offset = ofs_new;
@@ -326,25 +326,25 @@ static int manipulator_arrow_modal(
        return OPERATOR_RUNNING_MODAL;
 }
 
-static void manipulator_arrow_setup(wmManipulator *mpr)
+static void gizmo_arrow_setup(wmGizmo *mpr)
 {
-       ArrowManipulator3D *arrow = (ArrowManipulator3D *)mpr;
+       ArrowGizmo3D *arrow = (ArrowGizmo3D *)mpr;
 
-       arrow->manipulator.flag |= WM_MANIPULATOR_DRAW_MODAL;
+       arrow->gizmo.flag |= WM_GIZMO_DRAW_MODAL;
 
        arrow->data.range_fac = 1.0f;
 }
 
-static int manipulator_arrow_invoke(
-        bContext *UNUSED(C), wmManipulator *mpr, const wmEvent *event)
+static int gizmo_arrow_invoke(
+        bContext *UNUSED(C), wmGizmo *mpr, const wmEvent *event)
 {
-       ArrowManipulator3D *arrow = (ArrowManipulator3D *)mpr;
-       ManipulatorInteraction *inter = MEM_callocN(sizeof(ManipulatorInteraction), __func__);
-       wmManipulatorProperty *mpr_prop = WM_manipulator_target_property_find(mpr, "offset");
+       ArrowGizmo3D *arrow = (ArrowGizmo3D *)mpr;
+       GizmoInteraction *inter = MEM_callocN(sizeof(GizmoInteraction), __func__);
+       wmGizmoProperty *mpr_prop = WM_gizmo_target_property_find(mpr, "offset");
 
-       /* Some manipulators don't use properties. */
-       if (WM_manipulator_target_property_is_valid(mpr_prop)) {
-               inter->init_value = WM_manipulator_target_property_value_get(mpr, mpr_prop);
+       /* Some gizmos don't use properties. */
+       if (WM_gizmo_target_property_is_valid(mpr_prop)) {
+               inter->init_value = WM_gizmo_target_property_value_get(mpr, mpr_prop);
        }
 
        inter->init_offset = arrow->data.offset;
@@ -352,126 +352,126 @@ static int manipulator_arrow_invoke(
        inter->init_mval[0] = event->mval[0];
        inter->init_mval[1] = event->mval[1];
 
-       manipulator_arrow_matrix_basis_get(mpr, inter->init_matrix_basis);
-       WM_manipulator_calc_matrix_final(mpr, inter->init_matrix_final);
+       gizmo_arrow_matrix_basis_get(mpr, inter->init_matrix_basis);
+       WM_gizmo_calc_matrix_final(mpr, inter->init_matrix_final);
 
        mpr->interaction_data = inter;
 
        return OPERATOR_RUNNING_MODAL;
 }
 
-static void manipulator_arrow_property_update(wmManipulator *mpr, wmManipulatorProperty *mpr_prop)
+static void gizmo_arrow_property_update(wmGizmo *mpr, wmGizmoProperty *mpr_prop)
 {
-       ArrowManipulator3D *arrow = (ArrowManipulator3D *)mpr;
-       const int transform_flag = RNA_enum_get(arrow->manipulator.ptr, "transform");
-       const bool constrained = (transform_flag & ED_MANIPULATOR_ARROW_XFORM_FLAG_CONSTRAINED) != 0;
-       const bool inverted = (transform_flag & ED_MANIPULATOR_ARROW_XFORM_FLAG_INVERTED) != 0;
-       manipulator_property_data_update(mpr, &arrow->data, mpr_prop, constrained, inverted);
+       ArrowGizmo3D *arrow = (ArrowGizmo3D *)mpr;
+       const int transform_flag = RNA_enum_get(arrow->gizmo.ptr, "transform");
+       const bool constrained = (transform_flag & ED_GIZMO_ARROW_XFORM_FLAG_CONSTRAINED) != 0;
+       const bool inverted = (transform_flag & ED_GIZMO_ARROW_XFORM_FLAG_INVERTED) != 0;
+       gizmo_property_data_update(mpr, &arrow->data, mpr_prop, constrained, inverted);
 }
 
-static void manipulator_arrow_exit(bContext *C, wmManipulator *mpr, const bool cancel)
+static void gizmo_arrow_exit(bContext *C, wmGizmo *mpr, const bool cancel)
 {
-       ArrowManipulator3D *arrow = (ArrowManipulator3D *)mpr;
-       ManipulatorCommonData *data = &arrow->data;
-       wmManipulatorProperty *mpr_prop = WM_manipulator_target_property_find(mpr, "offset");
-       const bool is_prop_valid = WM_manipulator_target_property_is_valid(mpr_prop);
+       ArrowGizmo3D *arrow = (ArrowGizmo3D *)mpr;
+       GizmoCommonData *data = &arrow->data;
+       wmGizmoProperty *mpr_prop = WM_gizmo_target_property_find(mpr, "offset");
+       const bool is_prop_valid = WM_gizmo_target_property_is_valid(mpr_prop);
 
        if (!cancel) {
                /* Assign incase applying the opetration needs an updated offset
                 * editmesh bisect needs this. */
                if (is_prop_valid) {
-                       data->offset = WM_manipulator_target_property_value_get(mpr, mpr_prop);
+                       data->offset = WM_gizmo_target_property_value_get(mpr, mpr_prop);
                }
                return;
        }
 
-       ManipulatorInteraction *inter = mpr->interaction_data;
+       GizmoInteraction *inter = mpr->interaction_data;
        if (is_prop_valid) {
-               manipulator_property_value_reset(C, mpr, inter, mpr_prop);
+               gizmo_property_value_reset(C, mpr, inter, mpr_prop);
        }
        data->offset = inter->init_offset;
 }
 
 
 /* -------------------------------------------------------------------- */
-/** \name Arrow Manipulator API
+/** \name Arrow Gizmo API
  *
  * \{ */
 
 /**
  * Define a custom property UI range
  *
- * \note Needs to be called before WM_manipulator_target_property_def_rna!
+ * \note Needs to be called before WM_gizmo_target_property_def_rna!
  */
-void ED_manipulator_arrow3d_set_ui_range(wmManipulator *mpr, const float min, const float max)
+void ED_gizmo_arrow3d_set_ui_range(wmGizmo *mpr, const float min, const float max)
 {
-       ArrowManipulator3D *arrow = (ArrowManipulator3D *)mpr;
+       ArrowGizmo3D *arrow = (ArrowGizmo3D *)mpr;
 
        BLI_assert(min < max);
-       BLI_assert(!(WM_manipulator_target_property_is_valid(WM_manipulator_target_property_find(mpr, "offset")) &&
-                    "Make sure this function is called before WM_manipulator_target_property_def_rna"));
+       BLI_assert(!(WM_gizmo_target_property_is_valid(WM_gizmo_target_property_find(mpr, "offset")) &&
+                    "Make sure this function is called before WM_gizmo_target_property_def_rna"));
 
        arrow->data.range = max - min;
        arrow->data.min = min;
-       arrow->data.flag |= MANIPULATOR_CUSTOM_RANGE_SET;
+       arrow->data.flag |= GIZMO_CUSTOM_RANGE_SET;
 }
 
 /**
  * Define a custom factor for arrow min/max distance
  *
- * \note Needs to be called before WM_manipulator_target_property_def_rna!
+ * \note Needs to be called before WM_gizmo_target_property_def_rna!
  */
-void ED_manipulator_arrow3d_set_range_fac(wmManipulator *mpr, const float range_fac)
+void ED_gizmo_arrow3d_set_range_fac(wmGizmo *mpr, const float range_fac)
 {
-       ArrowManipulator3D *arrow = (ArrowManipulator3D *)mpr;
-       BLI_assert(!(WM_manipulator_target_property_is_valid(WM_manipulator_target_property_find(mpr, "offset")) &&
-                    "Make sure this function is called before WM_manipulator_target_property_def_rna"));
+       ArrowGizmo3D *arrow = (ArrowGizmo3D *)mpr;
+       BLI_assert(!(WM_gizmo_target_property_is_valid(WM_gizmo_target_property_find(mpr, "offset")) &&
+                    "Make sure this function is called before WM_gizmo_target_property_def_rna"));
 
        arrow->data.range_fac = range_fac;
 }
 
-static void MANIPULATOR_WT_arrow_3d(wmManipulatorType *wt)
+static void GIZMO_WT_arrow_3d(wmGizmoType *wt)
 {
        /* identifiers */
-       wt->idname = "MANIPULATOR_WT_arrow_3d";
+       wt->idname = "GIZMO_WT_arrow_3d";
 
        /* api callbacks */
-       wt->draw = manipulator_arrow_draw;
-       wt->draw_select = manipulator_arrow_draw_select;
-       wt->matrix_basis_get = manipulator_arrow_matrix_basis_get;
-       wt->modal = manipulator_arrow_modal;
-       wt->setup = manipulator_arrow_setup;
-       wt->invoke = manipulator_arrow_invoke;
-       wt->property_update = manipulator_arrow_property_update;
-       wt->exit = manipulator_arrow_exit;
+       wt->draw = gizmo_arrow_draw;
+       wt->draw_select = gizmo_arrow_draw_select;
+       wt->matrix_basis_get = gizmo_arrow_matrix_basis_get;
+       wt->modal = gizmo_arrow_modal;
+       wt->setup = gizmo_arrow_setup;
+       wt->invoke = gizmo_arrow_invoke;
+       wt->property_update = gizmo_arrow_property_update;
+       wt->exit = gizmo_arrow_exit;
 
-       wt->struct_size = sizeof(ArrowManipulator3D);
+       wt->struct_size = sizeof(ArrowGizmo3D);
 
        /* rna */
        static EnumPropertyItem rna_enum_draw_style_items[] = {
-               {ED_MANIPULATOR_ARROW_STYLE_NORMAL, "NORMAL", 0, "Normal", ""},
-               {ED_MANIPULATOR_ARROW_STYLE_CROSS, "CROSS", 0, "Cross", ""},
-               {ED_MANIPULATOR_ARROW_STYLE_BOX, "BOX", 0, "Box", ""},
-               {ED_MANIPULATOR_ARROW_STYLE_CONE, "CONE", 0, "Cone", ""},
+               {ED_GIZMO_ARROW_STYLE_NORMAL, "NORMAL", 0, "Normal", ""},
+               {ED_GIZMO_ARROW_STYLE_CROSS, "CROSS", 0, "Cross", ""},
+               {ED_GIZMO_ARROW_STYLE_BOX, "BOX", 0, "Box", ""},
+               {ED_GIZMO_ARROW_STYLE_CONE, "CONE", 0, "Cone", ""},
                {0, NULL, 0, NULL, NULL}
        };
        static EnumPropertyItem rna_enum_draw_options_items[] = {
-               {ED_MANIPULATOR_ARROW_DRAW_FLAG_STEM, "STEM", 0, "Stem", ""},
+               {ED_GIZMO_ARROW_DRAW_FLAG_STEM, "STEM", 0, "Stem", ""},
                {0, NULL, 0, NULL, NULL}
        };
        static EnumPropertyItem rna_enum_transform_items[] = {
-               {ED_MANIPULATOR_ARROW_XFORM_FLAG_INVERTED, "INVERT", 0, "Inverted", ""},
-               {ED_MANIPULATOR_ARROW_XFORM_FLAG_CONSTRAINED, "CONSTRAIN", 0, "Constrained", ""},
+               {ED_GIZMO_ARROW_XFORM_FLAG_INVERTED, "INVERT", 0, "Inverted", ""},
+               {ED_GIZMO_ARROW_XFORM_FLAG_CONSTRAINED, "CONSTRAIN", 0, "Constrained", ""},
                {0, NULL, 0, NULL, NULL}
        };
 
        RNA_def_enum(
                wt->srna, "draw_style", rna_enum_draw_style_items,
-               ED_MANIPULATOR_ARROW_STYLE_NORMAL,
+               ED_GIZMO_ARROW_STYLE_NORMAL,
                "Draw Style", "");
        RNA_def_enum_flag(
                wt->srna, "draw_options", rna_enum_draw_options_items,
-               ED_MANIPULATOR_ARROW_DRAW_FLAG_STEM,
+               ED_GIZMO_ARROW_DRAW_FLAG_STEM,
                "Draw Options", "");
        RNA_def_enum_flag(
                wt->srna, "transform", rna_enum_transform_items,
@@ -481,12 +481,12 @@ static void MANIPULATOR_WT_arrow_3d(wmManipulatorType *wt)
        RNA_def_float(wt->srna, "length", 1.0f, 0.0f, FLT_MAX, "Arrow Line Length", "", 0.0f, FLT_MAX);
        RNA_def_float_vector(wt->srna, "aspect", 2, NULL, 0, FLT_MAX, "Aspect", "Cone/box style only", 0.0f, FLT_MAX);
 
-       WM_manipulatortype_target_property_def(wt, "offset", PROP_FLOAT, 1);
+       WM_gizmotype_target_property_def(wt, "offset", PROP_FLOAT, 1);
 }
 
-void ED_manipulatortypes_arrow_3d(void)
+void ED_gizmotypes_arrow_3d(void)
 {
-       WM_manipulatortype_append(MANIPULATOR_WT_arrow_3d);
+       WM_gizmotype_append(GIZMO_WT_arrow_3d);
 }
 
 /** \} */
index 78f374064e6b54a7c42a101c272bf7eaec0c6fcf..33639dd7ec7386f6c0ed066889de6431df45691f 100644 (file)
 /** \file button2d_gizmo.c
  *  \ingroup wm
  *
- * \name Button Manipulator
+ * \name Button Gizmo
  *
- * 2D Manipulator, also works in 3D views.
+ * 2D Gizmo, also works in 3D views.
  *
- * \brief Single click button action for use in manipulator groups.
+ * \brief Single click button action for use in gizmo groups.
  *
  * \note Currently only basic icon & vector-shape buttons are supported.
  *
 #include "../gizmo_geometry.h"
 #include "../gizmo_library_intern.h"
 
-typedef struct ButtonManipulator2D {
-       wmManipulator manipulator;
+typedef struct ButtonGizmo2D {
+       wmGizmo gizmo;
        bool is_init;
        /* Use an icon or shape */
        int icon;
        Gwn_Batch *shape_batch[2];
-} ButtonManipulator2D;
+} ButtonGizmo2D;
 
 #define CIRCLE_RESOLUTION 32
 
 /* -------------------------------------------------------------------- */
 
 static void button2d_geom_draw_backdrop(
-        const wmManipulator *mpr, const float color[4], const bool select)
+        const wmGizmo *mpr, const float color[4], const bool select)
 {
        GPU_line_width(mpr->line_width);
 
@@ -99,10 +99,10 @@ static void button2d_geom_draw_backdrop(
 }
 
 static void button2d_draw_intern(
-        const bContext *C, wmManipulator *mpr,
+        const bContext *C, wmGizmo *mpr,
         const bool select, const bool highlight)
 {
-       ButtonManipulator2D *button = (ButtonManipulator2D *)mpr;
+       ButtonGizmo2D *button = (ButtonGizmo2D *)mpr;
 
        const int draw_options = RNA_enum_get(mpr->ptr, "draw_options");
        if (button->is_init == false) {
@@ -126,16 +126,16 @@ static void button2d_draw_intern(
        float color[4];
        float matrix_final[4][4];
 
-       manipulator_color_get(mpr, highlight, color);
-       WM_manipulator_calc_matrix_final(mpr, matrix_final);
+       gizmo_color_get(mpr, highlight, color);
+       WM_gizmo_calc_matrix_final(mpr, matrix_final);
 
 
-       bool is_3d = (mpr->parent_mgroup->type->flag & WM_MANIPULATORGROUPTYPE_3D) != 0;
+       bool is_3d = (mpr->parent_mgroup->type->flag & WM_GIZMOGROUPTYPE_3D) != 0;
 
 
-       if (draw_options & ED_MANIPULATOR_BUTTON_SHOW_HELPLINE) {
+       if (draw_options & ED_GIZMO_BUTTON_SHOW_HELPLINE) {
                float matrix_final_no_offset[4][4];
-               WM_manipulator_calc_matrix_final_no_offset(mpr, matrix_final_no_offset);
+               WM_gizmo_calc_matrix_final_no_offset(mpr, matrix_final_no_offset);
                uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
                immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
                immUniformColor4fv(color);
@@ -180,7 +180,7 @@ static void button2d_draw_intern(
                                GWN_batch_uniform_4f(button->shape_batch[i], "color", UNPACK4(color));
                                GWN_batch_draw(button->shape_batch[i]);
 
-                               if (draw_options & ED_MANIPULATOR_BUTTON_SHOW_OUTLINE) {
+                               if (draw_options & ED_GIZMO_BUTTON_SHOW_OUTLINE) {
                                        color[0] = 1.0f - color[0];
                                        color[1] = 1.0f - color[1];
                                        color[2] = 1.0f - color[2];
@@ -215,29 +215,29 @@ static void button2d_draw_intern(
        }
 }
 
-static void manipulator_button2d_draw_select(const bContext *C, wmManipulator *mpr, int select_id)
+static void gizmo_button2d_draw_select(const bContext *C, wmGizmo *mpr, int select_id)
 {
        GPU_select_load_id(select_id);
        button2d_draw_intern(C, mpr, true, false);
 }
 
-static void manipulator_button2d_draw(const bContext *C, wmManipulator *mpr)
+static void gizmo_button2d_draw(const bContext *C, wmGizmo *mpr)
 {
-       const bool is_highlight = (mpr->state & WM_MANIPULATOR_STATE_HIGHLIGHT) != 0;
+       const bool is_highlight = (mpr->state & WM_GIZMO_STATE_HIGHLIGHT) != 0;
 
        GPU_blend(true);
        button2d_draw_intern(C, mpr, false, is_highlight);
        GPU_blend(false);
 }
 
-static int manipulator_button2d_test_select(
-        bContext *C, wmManipulator *mpr, const wmEvent *event)
+static int gizmo_button2d_test_select(
+        bContext *C, wmGizmo *mpr, const wmEvent *event)
 {
        float point_local[2];
 
        if (0) {
                /* correct, but unnecessarily slow. */
-               if (manipulator_window_project_2d(
+               if (gizmo_window_project_2d(
                        C, mpr, (const float[2]){UNPACK2(event->mval)}, 2, true, point_local) == false)
                {
                        return -1;
@@ -256,7 +256,7 @@ static int manipulator_button2d_test_select(
        return -1;
 }
 
-static int manipulator_button2d_cursor_get(wmManipulator *mpr)
+static int gizmo_button2d_cursor_get(wmGizmo *mpr)
 {
        if (RNA_boolean_get(mpr->ptr, "show_drag")) {
                return BC_NSEW_SCROLLCURSOR;
@@ -264,9 +264,9 @@ static int manipulator_button2d_cursor_get(wmManipulator *mpr)
        return CURSOR_STD;
 }
 
-static void manipulator_button2d_free(wmManipulator *mpr)
+static void gizmo_button2d_free(wmGizmo *mpr)
 {
-       ButtonManipulator2D *shape = (ButtonManipulator2D *)mpr;
+       ButtonGizmo2D *shape = (ButtonGizmo2D *)mpr;
 
        for (uint i = 0; i < ARRAY_SIZE(shape->shape_batch); i++) {
                GWN_BATCH_DISCARD_SAFE(shape->shape_batch[i]);
@@ -276,28 +276,28 @@ static void manipulator_button2d_free(wmManipulator *mpr)
 /** \} */
 
 /* -------------------------------------------------------------------- */
-/** \name Button Manipulator API
+/** \name Button Gizmo API
  *
  * \{ */
 
-static void MANIPULATOR_WT_button_2d(wmManipulatorType *wt)
+static void GIZMO_WT_button_2d(wmGizmoType *wt)
 {
        /* identifiers */
-       wt->idname = "MANIPULATOR_WT_button_2d";
+       wt->idname = "GIZMO_WT_button_2d";
 
        /* api callbacks */
-       wt->draw = manipulator_button2d_draw;
-       wt->draw_select = manipulator_button2d_draw_select;
-       wt->test_select = manipulator_button2d_test_select;
-       wt->cursor_get = manipulator_button2d_cursor_get;
-       wt->free = manipulator_button2d_free;
+       wt->draw = gizmo_button2d_draw;
+       wt->draw_select = gizmo_button2d_draw_select;
+       wt->test_select = gizmo_button2d_test_select;
+       wt->cursor_get = gizmo_button2d_cursor_get;
+       wt->free = gizmo_button2d_free;
 
-       wt->struct_size = sizeof(ButtonManipulator2D);
+       wt->struct_size = sizeof(ButtonGizmo2D);
 
        /* rna */
        static EnumPropertyItem rna_enum_draw_options[] = {
-               {ED_MANIPULATOR_BUTTON_SHOW_OUTLINE, "OUTLINE", 0, "Outline", ""},
-               {ED_MANIPULATOR_BUTTON_SHOW_HELPLINE, "HELPLINE", 0, "Help Line", ""},
+               {ED_GIZMO_BUTTON_SHOW_OUTLINE, "OUTLINE", 0, "Outline", ""},
+               {ED_GIZMO_BUTTON_SHOW_HELPLINE, "HELPLINE", 0, "Help Line", ""},
                {0, NULL, 0, NULL, NULL}
        };
        PropertyRNA *prop;
@@ -314,9 +314,9 @@ static void MANIPULATOR_WT_button_2d(wmManipulatorType *wt)
        RNA_def_boolean(wt->srna, "show_drag", true, "Show Drag", "");
 }
 
-void ED_manipulatortypes_button_2d(void)
+void ED_gizmotypes_button_2d(void)
 {
-       WM_manipulatortype_append(MANIPULATOR_WT_button_2d);
+       WM_gizmotype_append(GIZMO_WT_button_2d);
 }
 
-/** \} */ // Button Manipulator API
+/** \} */ // Button Gizmo API
index 382733d298f36f3db260c373648392b5ff171c16..a037727de589481e8c795e9f263d375831e97d57 100644 (file)
 /** \file cage2d_gizmo.c
  *  \ingroup wm
  *
- * \name Cage Manipulator
+ * \name Cage Gizmo
  *
- * 2D Manipulator
+ * 2D Gizmo
  *
- * \brief Rectangular manipulator acting as a 'cage' around its content.
- * Interacting scales or translates the manipulator.
+ * \brief Rectangular gizmo acting as a 'cage' around its content.
+ * Interacting scales or translates the gizmo.
  */
 
 #include "MEM_guardedalloc.h"
 /* own includes */
 #include "../gizmo_library_intern.h"
 
-#define MANIPULATOR_RESIZER_SIZE 10.0f
-#define MANIPULATOR_MARGIN_OFFSET_SCALE 1.5f
+#define GIZMO_RESIZER_SIZE 10.0f
+#define GIZMO_MARGIN_OFFSET_SCALE 1.5f
 
-static void manipulator_calc_rect_view_scale(
-        const wmManipulator *mpr, const float dims[2], float scale[2])
+static void gizmo_calc_rect_view_scale(
+        const wmGizmo *mpr, const float dims[2], float scale[2])
 {
        float matrix_final_no_offset[4][4];
        float asp[2] = {1.0f, 1.0f};
@@ -79,7 +79,7 @@ static void manipulator_calc_rect_view_scale(
                asp[1] = dims[0] / dims[1];
        }
        float x_axis[3], y_axis[3];
-       WM_manipulator_calc_matrix_final_no_offset(mpr, matrix_final_no_offset);
+       WM_gizmo_calc_matrix_final_no_offset(mpr, matrix_final_no_offset);
        mul_v3_mat3_m4v3(x_axis, matrix_final_no_offset, mpr->matrix_offset[0]);
        mul_v3_mat3_m4v3(y_axis, matrix_final_no_offset, mpr->matrix_offset[1]);
 
@@ -90,37 +90,37 @@ static void manipulator_calc_rect_view_scale(
        scale[1] = 1.0f / len_v3(y_axis);
 }
 
-static void manipulator_calc_rect_view_margin(
-        const wmManipulator *mpr, const float dims[2], float margin[2])
+static void gizmo_calc_rect_view_margin(
+        const wmGizmo *mpr, const float dims[2], float margin[2])
 {
        float handle_size;
-       if (mpr->parent_mgroup->type->flag & WM_MANIPULATORGROUPTYPE_3D) {
+       if (mpr->parent_mgroup->type->flag & WM_GIZMOGROUPTYPE_3D) {
                handle_size = 0.15f;
        }
        else {
-               handle_size = MANIPULATOR_RESIZER_SIZE;
+               handle_size = GIZMO_RESIZER_SIZE;
        }
        handle_size *= mpr->scale_final;
        float scale_xy[2];
-       manipulator_calc_rect_view_scale(mpr, dims, scale_xy);
+       gizmo_calc_rect_view_scale(mpr, dims, scale_xy);
        margin[0] = ((handle_size * scale_xy[0]));
        margin[1] = ((handle_size * scale_xy[1]));
 }
 
 /* -------------------------------------------------------------------- */
 
-static void manipulator_rect_pivot_from_scale_part(int part, float r_pt[2], bool r_constrain_axis[2])
+static void gizmo_rect_pivot_from_scale_part(int part, float r_pt[2], bool r_constrain_axis[2])
 {
        bool x = true, y = true;
        switch (part) {
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X: { ARRAY_SET_ITEMS(r_pt,  0.5,  0.0); x = false; break; }
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X: { ARRAY_SET_ITEMS(r_pt, -0.5,  0.0); x = false; break; }
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_Y: { ARRAY_SET_ITEMS(r_pt,  0.0,  0.5); y = false; break; }
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_Y: { ARRAY_SET_ITEMS(r_pt,  0.0, -0.5); y = false; break; }
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X_MIN_Y: { ARRAY_SET_ITEMS(r_pt,  0.5,  0.5); x = y = false; break; }
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X_MAX_Y: { ARRAY_SET_ITEMS(r_pt,  0.5, -0.5); x = y = false; break; }
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X_MIN_Y: { ARRAY_SET_ITEMS(r_pt, -0.5,  0.5); x = y = false; break; }
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X_MAX_Y: { ARRAY_SET_ITEMS(r_pt, -0.5, -0.5); x = y = false; break; }
+               case ED_GIZMO_CAGE2D_PART_SCALE_MIN_X: { ARRAY_SET_ITEMS(r_pt,  0.5,  0.0); x = false; break; }
+               case ED_GIZMO_CAGE2D_PART_SCALE_MAX_X: { ARRAY_SET_ITEMS(r_pt, -0.5,  0.0); x = false; break; }
+               case ED_GIZMO_CAGE2D_PART_SCALE_MIN_Y: { ARRAY_SET_ITEMS(r_pt,  0.0,  0.5); y = false; break; }
+               case ED_GIZMO_CAGE2D_PART_SCALE_MAX_Y: { ARRAY_SET_ITEMS(r_pt,  0.0, -0.5); y = false; break; }
+               case ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MIN_Y: { ARRAY_SET_ITEMS(r_pt,  0.5,  0.5); x = y = false; break; }
+               case ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MAX_Y: { ARRAY_SET_ITEMS(r_pt,  0.5, -0.5); x = y = false; break; }
+               case ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MIN_Y: { ARRAY_SET_ITEMS(r_pt, -0.5,  0.5); x = y = false; break; }
+               case ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MAX_Y: { ARRAY_SET_ITEMS(r_pt, -0.5, -0.5); x = y = false; break; }
                default: BLI_assert(0);
        }
        r_constrain_axis[0] = x;
@@ -130,7 +130,7 @@ static void manipulator_rect_pivot_from_scale_part(int part, float r_pt[2], bool
 /* -------------------------------------------------------------------- */
 /** \name Box Draw Style
  *
- * Useful for 3D views, see: #ED_MANIPULATOR_CAGE2D_STYLE_BOX
+ * Useful for 3D views, see: #ED_GIZMO_CAGE2D_STYLE_BOX
  * \{ */
 
 static void cage2d_draw_box_corners(
@@ -179,7 +179,7 @@ static void cage2d_draw_box_interaction(
        Gwn_PrimType prim_type = GWN_PRIM_NONE;
 
        switch (highlighted) {
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X:
+               case ED_GIZMO_CAGE2D_PART_SCALE_MIN_X:
                {
                        rctf r = {
                                .xmin = -size[0], .xmax = -size[0] + margin[0],
@@ -199,7 +199,7 @@ static void cage2d_draw_box_interaction(
                        }
                        break;
                }
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X:
+               case ED_GIZMO_CAGE2D_PART_SCALE_MAX_X:
                {
                        rctf r = {
                                .xmin = size[0] - margin[0], .xmax = size[0],
@@ -219,7 +219,7 @@ static void cage2d_draw_box_interaction(
                        }
                        break;
                }
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_Y:
+               case ED_GIZMO_CAGE2D_PART_SCALE_MIN_Y:
                {
                        rctf r = {
                                .xmin = -size[0] + margin[0], .xmax = size[0] - margin[0],
@@ -239,7 +239,7 @@ static void cage2d_draw_box_interaction(
                        }
                        break;
                }
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_Y:
+               case ED_GIZMO_CAGE2D_PART_SCALE_MAX_Y:
                {
                        rctf r = {
                                .xmin = -size[0] + margin[0], .xmax = size[0] - margin[0],
@@ -259,7 +259,7 @@ static void cage2d_draw_box_interaction(
                        }
                        break;
                }
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X_MIN_Y:
+               case ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MIN_Y:
                {
                        rctf r = {
                                .xmin = -size[0], .xmax = -size[0] + margin[0],
@@ -279,7 +279,7 @@ static void cage2d_draw_box_interaction(
                        }
                        break;
                }
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X_MAX_Y:
+               case ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MAX_Y:
                {
                        rctf r = {
                                .xmin = -size[0], .xmax = -size[0] + margin[0],
@@ -299,7 +299,7 @@ static void cage2d_draw_box_interaction(
                        }
                        break;
                }
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X_MIN_Y:
+               case ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MIN_Y:
                {
                        rctf r = {
                                .xmin = size[0] - margin[0], .xmax = size[0],
@@ -319,7 +319,7 @@ static void cage2d_draw_box_interaction(
                        }
                        break;
                }
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X_MAX_Y:
+               case ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MAX_Y:
                {
                        rctf r = {
                                .xmin = size[0] - margin[0], .xmax = size[0],
@@ -339,7 +339,7 @@ static void cage2d_draw_box_interaction(
                        }
                        break;
                }
-               case ED_MANIPULATOR_CAGE2D_PART_ROTATE:
+               case ED_GIZMO_CAGE2D_PART_ROTATE:
                {
                        const float rotate_pt[2] = {0.0f, size[1] + margin[1]};
                        const rctf r_rotate = {
@@ -363,8 +363,8 @@ static void cage2d_draw_box_interaction(
                        break;
                }
 
-               case ED_MANIPULATOR_CAGE2D_PART_TRANSLATE:
-                       if (draw_options & ED_MANIPULATOR_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE) {
+               case ED_GIZMO_CAGE2D_PART_TRANSLATE:
+                       if (draw_options & ED_GIZMO_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE) {
                                ARRAY_SET_ITEMS(verts[0], -margin[0] / 2, -margin[1] / 2);
                                ARRAY_SET_ITEMS(verts[1],  margin[0] / 2,  margin[1] / 2);
                                ARRAY_SET_ITEMS(verts[2], -margin[0] / 2,  margin[1] / 2);
@@ -449,7 +449,7 @@ static void cage2d_draw_box_interaction(
 /* -------------------------------------------------------------------- */
 /** \name Circle Draw Style
  *
- * Useful for 2D views, see: #ED_MANIPULATOR_CAGE2D_STYLE_CIRCLE
+ * Useful for 2D views, see: #ED_GIZMO_CAGE2D_STYLE_CIRCLE
  * \{ */
 
 static void imm_draw_point_aspect_2d(
@@ -479,15 +479,15 @@ static void cage2d_draw_circle_wire(
        immVertex2f(pos, r->xmin, r->ymax);
        immEnd();
 
-       if (transform_flag & ED_MANIPULATOR_CAGE2D_XFORM_FLAG_ROTATE) {
+       if (transform_flag & ED_GIZMO_CAGE2D_XFORM_FLAG_ROTATE) {
                immBegin(GWN_PRIM_LINE_LOOP, 2);
                immVertex2f(pos, BLI_rctf_cent_x(r), r->ymax);
                immVertex2f(pos, BLI_rctf_cent_x(r), r->ymax + margin[1]);
                immEnd();
        }
 
-       if (transform_flag & ED_MANIPULATOR_CAGE2D_XFORM_FLAG_TRANSLATE) {
-               if (draw_options & ED_MANIPULATOR_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE) {
+       if (transform_flag & ED_GIZMO_CAGE2D_XFORM_FLAG_TRANSLATE) {
+               if (draw_options & ED_GIZMO_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE) {
                        const float rad[2] = {margin[0] / 2, margin[1] / 2};
                        const float center[2] = {BLI_rctf_cent_x(r), BLI_rctf_cent_y(r)};
 
@@ -525,8 +525,8 @@ static void cage2d_draw_circle_handles(
                imm_draw_point_aspect_2d(pos, r->xmin, r->ymax, rad[0], rad[1], solid);
        }
 
-       if (transform_flag & ED_MANIPULATOR_CAGE2D_XFORM_FLAG_ROTATE) {
-               const float handle[2] = {BLI_rctf_cent_x(r), r->ymax + (margin[1] * MANIPULATOR_MARGIN_OFFSET_SCALE)};
+       if (transform_flag & ED_GIZMO_CAGE2D_XFORM_FLAG_ROTATE) {
+               const float handle[2] = {BLI_rctf_cent_x(r), r->ymax + (margin[1] * GIZMO_MARGIN_OFFSET_SCALE)};
                circle_fn(pos, handle[0], handle[1], rad[0], rad[1], resolu);
        }
 
@@ -535,10 +535,10 @@ static void cage2d_draw_circle_handles(
 
 /** \} */
 
-static void manipulator_cage2d_draw_intern(
-        wmManipulator *mpr, const bool select, const bool highlight, const int select_id)
+static void gizmo_cage2d_draw_intern(
+        wmGizmo *mpr, const bool select, const bool highlight, const int select_id)
 {
-       // const bool use_clamp = (mpr->parent_mgroup->type->flag & WM_MANIPULATORGROUPTYPE_3D) == 0;
+       // const bool use_clamp = (mpr->parent_mgroup->type->flag & WM_GIZMOGROUPTYPE_3D) == 0;
        float dims[2];
        RNA_float_get_array(mpr->ptr, "dimensions", dims);
        float matrix_final[4][4];
@@ -549,13 +549,13 @@ static void manipulator_cage2d_draw_intern(
 
        const float size_real[2] = {dims[0] / 2.0f, dims[1] / 2.0f};
 
-       WM_manipulator_calc_matrix_final(mpr, matrix_final);
+       WM_gizmo_calc_matrix_final(mpr, matrix_final);
 
        gpuPushMatrix();
        gpuMultMatrix(matrix_final);
 
        float margin[2];
-       manipulator_calc_rect_view_margin(mpr, dims, margin);
+       gizmo_calc_rect_view_margin(mpr, dims, margin);
 
        /* Handy for quick testing draw (if it's outside bounds). */
        if (false) {
@@ -573,17 +573,17 @@ static void manipulator_cage2d_draw_intern(
                /* expand for hotspot */
                const float size[2] = {size_real[0] + margin[0] / 2, size_real[1] + margin[1] / 2};
 
-               if (transform_flag & ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE) {
+               if (transform_flag & ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE) {
                        int scale_parts[] = {
-                               ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X,
-                               ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X,
-                               ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_Y,
-                               ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_Y,
-
-                               ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X_MIN_Y,
-                               ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X_MAX_Y,
-                               ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X_MIN_Y,
-                               ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X_MAX_Y,
+                               ED_GIZMO_CAGE2D_PART_SCALE_MIN_X,
+                               ED_GIZMO_CAGE2D_PART_SCALE_MAX_X,
+                               ED_GIZMO_CAGE2D_PART_SCALE_MIN_Y,
+                               ED_GIZMO_CAGE2D_PART_SCALE_MAX_Y,
+
+                               ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MIN_Y,
+                               ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MAX_Y,
+                               ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MIN_Y,
+                               ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MAX_Y,
                        };
                        for (int i = 0; i < ARRAY_SIZE(scale_parts); i++) {
                                GPU_select_load_id(select_id | scale_parts[i]);
@@ -591,15 +591,15 @@ static void manipulator_cage2d_draw_intern(
                                        mpr->color, scale_parts[i], size, margin, mpr->line_width, true, draw_options);
                        }
                }
-               if (transform_flag & ED_MANIPULATOR_CAGE2D_XFORM_FLAG_TRANSLATE) {
-                       const int transform_part = ED_MANIPULATOR_CAGE2D_PART_TRANSLATE;
+               if (transform_flag & ED_GIZMO_CAGE2D_XFORM_FLAG_TRANSLATE) {
+                       const int transform_part = ED_GIZMO_CAGE2D_PART_TRANSLATE;
                        GPU_select_load_id(select_id | transform_part);
                        cage2d_draw_box_interaction(
                                mpr->color, transform_part, size, margin, mpr->line_width, true, draw_options);
                }
-               if (transform_flag & ED_MANIPULATOR_CAGE2D_XFORM_FLAG_ROTATE) {
+               if (transform_flag & ED_GIZMO_CAGE2D_XFORM_FLAG_ROTATE) {
                        cage2d_draw_box_interaction(
-                               mpr->color, ED_MANIPULATOR_CAGE2D_PART_ROTATE, size_real, margin, mpr->line_width, true, draw_options);
+                               mpr->color, ED_GIZMO_CAGE2D_PART_ROTATE, size_real, margin, mpr->line_width, true, draw_options);
                }
        }
        else {
@@ -609,22 +609,22 @@ static void manipulator_cage2d_draw_intern(
                        .xmax = size_real[0],
                        .ymax = size_real[1],
                };
-               if (draw_style == ED_MANIPULATOR_CAGE2D_STYLE_BOX) {
-                       /* corner manipulators */
+               if (draw_style == ED_GIZMO_CAGE2D_STYLE_BOX) {
+                       /* corner gizmos */
                        GPU_line_width(mpr->line_width + 3.0f);
                        cage2d_draw_box_corners(&r, margin, (const float[3]){0, 0, 0});
 
-                       /* corner manipulators */
+                       /* corner gizmos */
                        float color[4];
-                       manipulator_color_get(mpr, highlight, color);
+                       gizmo_color_get(mpr, highlight, color);
                        GPU_line_width(mpr->line_width);
                        cage2d_draw_box_corners(&r, margin, color);
 
                        bool show = false;
-                       if (mpr->highlight_part == ED_MANIPULATOR_CAGE2D_PART_TRANSLATE) {
+                       if (mpr->highlight_part == ED_GIZMO_CAGE2D_PART_TRANSLATE) {
                                /* Only show if we're drawing the center handle
                                 * otherwise the entire rectangle is the hotspot. */
-                               if (draw_options & ED_MANIPULATOR_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE) {
+                               if (draw_options & ED_GIZMO_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE) {
                                        show = true;
                                }
                        }
@@ -637,14 +637,14 @@ static void manipulator_cage2d_draw_intern(
                                        mpr->color, mpr->highlight_part, size_real, margin, mpr->line_width, false, draw_options);
                        }
 
-                       if (transform_flag & ED_MANIPULATOR_CAGE2D_XFORM_FLAG_ROTATE) {
+                       if (transform_flag & ED_GIZMO_CAGE2D_XFORM_FLAG_ROTATE) {
                                cage2d_draw_box_interaction(
-                                       mpr->color, ED_MANIPULATOR_CAGE2D_PART_ROTATE, size_real, margin, mpr->line_width, false, draw_options);
+                                       mpr->color, ED_GIZMO_CAGE2D_PART_ROTATE, size_real, margin, mpr->line_width, false, draw_options);
                        }
                }
-               else if (draw_style == ED_MANIPULATOR_CAGE2D_STYLE_CIRCLE) {
+               else if (draw_style == ED_GIZMO_CAGE2D_STYLE_CIRCLE) {
                        float color[4];
-                       manipulator_color_get(mpr, highlight, color);
+                       gizmo_color_get(mpr, highlight, color);
 
                        GPU_line_smooth(true);
                        GPU_blend(true);
@@ -655,7 +655,7 @@ static void manipulator_cage2d_draw_intern(
                        cage2d_draw_circle_wire(&r, margin, color, transform_flag, draw_options);
 
 
-                       /* corner manipulators */
+                       /* corner gizmos */
                        cage2d_draw_circle_handles(&r, margin, color, transform_flag, true);
                        cage2d_draw_circle_handles(&r, margin, (const float[3]){0, 0, 0}, transform_flag, false);
 
@@ -674,74 +674,74 @@ static void manipulator_cage2d_draw_intern(
 /**
  * For when we want to draw 2d cage in 3d views.
  */
-static void manipulator_cage2d_draw_select(const bContext *UNUSED(C), wmManipulator *mpr, int select_id)
+static void gizmo_cage2d_draw_select(const bContext *UNUSED(C), wmGizmo *mpr, int select_id)
 {
-       manipulator_cage2d_draw_intern(mpr, true, false, select_id);
+       gizmo_cage2d_draw_intern(mpr, true, false, select_id);
 }
 
-static void manipulator_cage2d_draw(const bContext *UNUSED(C), wmManipulator *mpr)
+static void gizmo_cage2d_draw(const bContext *UNUSED(C), wmGizmo *mpr)
 {
-       const bool is_highlight = (mpr->state & WM_MANIPULATOR_STATE_HIGHLIGHT) != 0;
-       manipulator_cage2d_draw_intern(mpr, false, is_highlight, -1);
+       const bool is_highlight = (mpr->state & WM_GIZMO_STATE_HIGHLIGHT) != 0;
+       gizmo_cage2d_draw_intern(mpr, false, is_highlight, -1);
 }
 
-static int manipulator_cage2d_get_cursor(wmManipulator *mpr)
+static int gizmo_cage2d_get_cursor(wmGizmo *mpr)
 {
        int highlight_part = mpr->highlight_part;
 
-       if (mpr->parent_mgroup->type->flag & WM_MANIPULATORGROUPTYPE_3D) {
+       if (mpr->parent_mgroup->type->flag & WM_GIZMOGROUPTYPE_3D) {
                return BC_NSEW_SCROLLCURSOR;
        }
 
        switch (highlight_part) {
-               case ED_MANIPULATOR_CAGE2D_PART_TRANSLATE:
+               case ED_GIZMO_CAGE2D_PART_TRANSLATE:
                        return BC_NSEW_SCROLLCURSOR;
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X:
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X:
+               case ED_GIZMO_CAGE2D_PART_SCALE_MIN_X:
+               case ED_GIZMO_CAGE2D_PART_SCALE_MAX_X:
                        return CURSOR_X_MOVE;
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_Y:
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_Y:
+               case ED_GIZMO_CAGE2D_PART_SCALE_MIN_Y:
+               case ED_GIZMO_CAGE2D_PART_SCALE_MAX_Y:
                        return CURSOR_Y_MOVE;
 
                        /* TODO diagonal cursor */
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X_MIN_Y:
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X_MIN_Y:
+               case ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MIN_Y:
+               case ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MIN_Y:
                        return BC_NSEW_SCROLLCURSOR;
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X_MAX_Y:
-               case ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X_MAX_Y:
+               case ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MAX_Y:
+               case ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MAX_Y:
                        return BC_NSEW_SCROLLCURSOR;
-               case ED_MANIPULATOR_CAGE2D_PART_ROTATE:
+               case ED_GIZMO_CAGE2D_PART_ROTATE:
                        return BC_CROSSCURSOR;
                default:
                        return CURSOR_STD;
        }
 }
 
-static int manipulator_cage2d_test_select(
-        bContext *C, wmManipulator *mpr, const wmEvent *event)
+static int gizmo_cage2d_test_select(
+        bContext *C, wmGizmo *mpr, const wmEvent *event)
 {
        float point_local[2];
        float dims[2];
        RNA_float_get_array(mpr->ptr, "dimensions", dims);
        const float size_real[2] = {dims[0] / 2.0f, dims[1] / 2.0f};
 
-       if (manipulator_window_project_2d(
+       if (gizmo_window_project_2d(
                C, mpr, (const float[2]){UNPACK2(event->mval)}, 2, true, point_local) == false)
        {
                return -1;
        }
 
        float margin[2];
-       manipulator_calc_rect_view_margin(mpr, dims, margin);
+       gizmo_calc_rect_view_margin(mpr, dims, margin);
        /* expand for hotspot */
        const float size[2] = {size_real[0] + margin[0] / 2, size_real[1] + margin[1] / 2};
 
        const int transform_flag = RNA_enum_get(mpr->ptr, "transform");
        const int draw_options = RNA_enum_get(mpr->ptr, "draw_options");
 
-       if (transform_flag & ED_MANIPULATOR_CAGE2D_XFORM_FLAG_TRANSLATE) {
+       if (transform_flag & ED_GIZMO_CAGE2D_XFORM_FLAG_TRANSLATE) {
                rctf r;
-               if (draw_options & ED_MANIPULATOR_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE) {
+               if (draw_options & ED_GIZMO_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE) {
                        r.xmin = -margin[0] / 2;
                        r.ymin = -margin[1] / 2;
                        r.xmax =  margin[0] / 2;
@@ -755,12 +755,12 @@ static int manipulator_cage2d_test_select(
                };
                bool isect = BLI_rctf_isect_pt_v(&r, point_local);
                if (isect) {
-                       return ED_MANIPULATOR_CAGE2D_PART_TRANSLATE;
+                       return ED_GIZMO_CAGE2D_PART_TRANSLATE;
                }
        }
 
-       /* if manipulator does not have a scale intersection, don't do it */
-       if (transform_flag & (ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE | ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE_UNIFORM)) {
+       /* if gizmo does not have a scale intersection, don't do it */
+       if (transform_flag & (ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE | ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE_UNIFORM)) {
                const rctf r_xmin = {.xmin = -size[0], .ymin = -size[1], .xmax = -size[0] + margin[0], .ymax = size[1]};
                const rctf r_xmax = {.xmin = size[0] - margin[0], .ymin = -size[1], .xmax = size[0], .ymax = size[1]};
                const rctf r_ymin = {.xmin = -size[0], .ymin = -size[1], .xmax = size[0], .ymax = -size[1] + margin[1]};
@@ -768,37 +768,37 @@ static int manipulator_cage2d_test_select(
 
                if (BLI_rctf_isect_pt_v(&r_xmin, point_local)) {
                        if (BLI_rctf_isect_pt_v(&r_ymin, point_local)) {
-                               return ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X_MIN_Y;
+                               return ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MIN_Y;
                        }
                        if (BLI_rctf_isect_pt_v(&r_ymax, point_local)) {
-                               return ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X_MAX_Y;
+                               return ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MAX_Y;
                        }
-                       return ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X;
+                       return ED_GIZMO_CAGE2D_PART_SCALE_MIN_X;
                }
                if (BLI_rctf_isect_pt_v(&r_xmax, point_local)) {
                        if (BLI_rctf_isect_pt_v(&r_ymin, point_local)) {
-                               return ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X_MIN_Y;
+                               return ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MIN_Y;
                        }
                        if (BLI_rctf_isect_pt_v(&r_ymax, point_local)) {
-                               return ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X_MAX_Y;
+                               return ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MAX_Y;
                        }
-                       return ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X;
+                       return ED_GIZMO_CAGE2D_PART_SCALE_MAX_X;
                }
                if (BLI_rctf_isect_pt_v(&r_ymin, point_local)) {
-                       return ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_Y;
+                       return ED_GIZMO_CAGE2D_PART_SCALE_MIN_Y;
                }
                if (BLI_rctf_isect_pt_v(&r_ymax, point_local)) {
-                       return ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_Y;
+                       return ED_GIZMO_CAGE2D_PART_SCALE_MAX_Y;
                }
        }
 
-       if (transform_flag & ED_MANIPULATOR_CAGE2D_XFORM_FLAG_ROTATE) {
+       if (transform_flag & ED_GIZMO_CAGE2D_XFORM_FLAG_ROTATE) {
                /* Rotate:
                 *  (*) <-- hot spot is here!
                 * +---+
                 * |   |
                 * +---+ */
-               const float r_rotate_pt[2] = {0.0f, size_real[1] + (margin[1] * MANIPULATOR_MARGIN_OFFSET_SCALE)};
+               const float r_rotate_pt[2] = {0.0f, size_real[1] + (margin[1] * GIZMO_MARGIN_OFFSET_SCALE)};
                const rctf r_rotate = {
                        .xmin = r_rotate_pt[0] - margin[0] / 2.0f,
                        .xmax = r_rotate_pt[0] + margin[0] / 2.0f,
@@ -807,7 +807,7 @@ static int manipulator_cage2d_test_select(
                };
 
                if (BLI_rctf_isect_pt_v(&r_rotate, point_local)) {
-                       return ED_MANIPULATOR_CAGE2D_PART_ROTATE;
+                       return ED_GIZMO_CAGE2D_PART_ROTATE;
                }
        }
 
@@ -821,20 +821,20 @@ typedef struct RectTransformInteraction {
        Dial *dial;
 } RectTransformInteraction;
 
-static void manipulator_cage2d_setup(wmManipulator *mpr)
+static void gizmo_cage2d_setup(wmGizmo *mpr)
 {
-       mpr->flag |= WM_MANIPULATOR_DRAW_MODAL | WM_MANIPULATOR_DRAW_NO_SCALE;
+       mpr->flag |= WM_GIZMO_DRAW_MODAL | WM_GIZMO_DRAW_NO_SCALE;
 }
 
-static int manipulator_cage2d_invoke(
-        bContext *C, wmManipulator *mpr, const wmEvent *event)
+static int gizmo_cage2d_invoke(
+        bContext *C, wmGizmo *mpr, const wmEvent *event)
 {
        RectTransformInteraction *data = MEM_callocN(sizeof(RectTransformInteraction), "cage_interaction");
 
        copy_m4_m4(data->orig_matrix_offset, mpr->matrix_offset);
-       WM_manipulator_calc_matrix_final_no_offset(mpr, data->orig_matrix_final_no_offset);
+       WM_gizmo_calc_matrix_final_no_offset(mpr, data->orig_matrix_final_no_offset);
 
-       if (manipulator_window_project_2d(
+       if (gizmo_window_project_2d(
                C, mpr, (const float[2]){UNPACK2(event->mval)}, 2, false, data->orig_mouse) == 0)
        {
                zero_v2(data->orig_mouse);
@@ -845,9 +845,9 @@ static int manipulator_cage2d_invoke(
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int manipulator_cage2d_modal(
-        bContext *C, wmManipulator *mpr, const wmEvent *event,
-        eWM_ManipulatorTweak UNUSED(tweak_flag))
+static int gizmo_cage2d_modal(
+        bContext *C, wmGizmo *mpr, const wmEvent *event,
+        eWM_GizmoFlagTweak UNUSED(tweak_flag))
 {
        /* For transform logic to be managable we operate in -0.5..0.5 2D space,
         * no matter the size of the rectangle, mouse coorts are scaled to unit space.
@@ -867,7 +867,7 @@ static int manipulator_cage2d_modal(
                copy_m4_m4(matrix_back, mpr->matrix_offset);
                copy_m4_m4(mpr->matrix_offset, data->orig_matrix_offset);
 
-               bool ok = manipulator_window_project_2d(
+               bool ok = gizmo_window_project_2d(
                        C, mpr, (const float[2]){UNPACK2(event->mval)}, 2, false, point_local);
                copy_m4_m4(mpr->matrix_offset, matrix_back);
                if (!ok) {
@@ -876,20 +876,20 @@ static int manipulator_cage2d_modal(
        }
 
        const int transform_flag = RNA_enum_get(mpr->ptr, "transform");
-       wmManipulatorProperty *mpr_prop;
+       wmGizmoProperty *mpr_prop;
 
-       mpr_prop = WM_manipulator_target_property_find(mpr, "matrix");
+       mpr_prop = WM_gizmo_target_property_find(mpr, "matrix");
        if (mpr_prop->type != NULL) {
-               WM_manipulator_target_property_value_get_array(mpr, mpr_prop, &mpr->matrix_offset[0][0]);
+               WM_gizmo_target_property_value_get_array(mpr, mpr_prop, &mpr->matrix_offset[0][0]);
        }
 
-       if (mpr->highlight_part == ED_MANIPULATOR_CAGE2D_PART_TRANSLATE) {
+       if (mpr->highlight_part == ED_GIZMO_CAGE2D_PART_TRANSLATE) {
                /* do this to prevent clamping from changing size */
                copy_m4_m4(mpr->matrix_offset, data->orig_matrix_offset);
                mpr->matrix_offset[3][0] = data->orig_matrix_offset[3][0] + (point_local[0] - data->orig_mouse[0]);
                mpr->matrix_offset[3][1] = data->orig_matrix_offset[3][1] + (point_local[1] - data->orig_mouse[1]);
        }
-       else if (mpr->highlight_part == ED_MANIPULATOR_CAGE2D_PART_ROTATE) {
+       else if (mpr->highlight_part == ED_GIZMO_CAGE2D_PART_ROTATE) {
 
 #define MUL_V2_V3_M4_FINAL(test_co, mouse_co) \
                mul_v3_m4v3(test_co, data->orig_matrix_final_no_offset, ((const float[3]){UNPACK2(mouse_co), 0.0}))
@@ -935,8 +935,8 @@ static int manipulator_cage2d_modal(
                float pivot[2];
                bool constrain_axis[2] = {false};
 
-               if (transform_flag & ED_MANIPULATOR_CAGE2D_XFORM_FLAG_TRANSLATE) {
-                       manipulator_rect_pivot_from_scale_part(mpr->highlight_part, pivot, constrain_axis);
+               if (transform_flag & ED_GIZMO_CAGE2D_XFORM_FLAG_TRANSLATE) {
+                       gizmo_rect_pivot_from_scale_part(mpr->highlight_part, pivot, constrain_axis);
                }
                else {
                        zero_v2(pivot);
@@ -960,7 +960,7 @@ static int manipulator_cage2d_modal(
 
                                scale[i] = 1.0f + ((delta_curr[i] - delta_orig[i]) / len_v3(data->orig_matrix_offset[i]));
 
-                               if ((transform_flag & ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE_SIGNED) == 0) {
+                               if ((transform_flag & ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE_SIGNED) == 0) {
                                        if (sign != signum_i(scale[i])) {
                                                scale[i] = 0.0f;
                                        }
@@ -968,7 +968,7 @@ static int manipulator_cage2d_modal(
                        }
                }
 
-               if (transform_flag & ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE_UNIFORM) {
+               if (transform_flag & ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE_UNIFORM) {
                        if (constrain_axis[0] == false && constrain_axis[1] == false) {
                                scale[1] = scale[0] = (scale[1] + scale[0]) / 2.0f;
                        }
@@ -995,7 +995,7 @@ static int manipulator_cage2d_modal(
        }
 
        if (mpr_prop->type != NULL) {
-               WM_manipulator_target_property_value_set_array(C, mpr, mpr_prop, &mpr->matrix_offset[0][0]);
+               WM_gizmo_target_property_value_set_array(C, mpr, mpr_prop, &mpr->matrix_offset[0][0]);
        }
 
        /* tag the region for redraw */
@@ -1005,11 +1005,11 @@ static int manipulator_cage2d_modal(
        return OPERATOR_RUNNING_MODAL;
 }
 
-static void manipulator_cage2d_property_update(wmManipulator *mpr, wmManipulatorProperty *mpr_prop)
+static void gizmo_cage2d_property_update(wmGizmo *mpr, wmGizmoProperty *mpr_prop)
 {
        if (STREQ(mpr_prop->type->idname, "matrix")) {
-               if (WM_manipulator_target_property_array_length(mpr, mpr_prop) == 16) {
-                       WM_manipulator_target_property_value_get_array(mpr, mpr_prop, &mpr->matrix_offset[0][0]);
+               if (WM_gizmo_target_property_array_length(mpr, mpr_prop) == 16) {
+                       WM_gizmo_target_property_value_get_array(mpr, mpr_prop, &mpr->matrix_offset[0][0]);
                }
                else {
                        BLI_assert(0);
@@ -1020,7 +1020,7 @@ static void manipulator_cage2d_property_update(wmManipulator *mpr, wmManipulator
        }
 }
 
-static void manipulator_cage2d_exit(bContext *C, wmManipulator *mpr, const bool cancel)
+static void gizmo_cage2d_exit(bContext *C, wmGizmo *mpr, const bool cancel)
 {
        RectTransformInteraction *data = mpr->interaction_data;
 
@@ -1029,12 +1029,12 @@ static void manipulator_cage2d_exit(bContext *C, wmManipulator *mpr, const bool
        if (!cancel)
                return;
 
-       wmManipulatorProperty *mpr_prop;
+       wmGizmoProperty *mpr_prop;
 
        /* reset properties */
-       mpr_prop = WM_manipulator_target_property_find(mpr, "matrix");
+       mpr_prop = WM_gizmo_target_property_find(mpr, "matrix");
        if (mpr_prop->type != NULL) {
-               WM_manipulator_target_property_value_set_array(C, mpr, mpr_prop, &data->orig_matrix_offset[0][0]);
+               WM_gizmo_target_property_value_set_array(C, mpr, mpr_prop, &data->orig_matrix_offset[0][0]);
        }
 
        copy_m4_m4(mpr->matrix_offset, data->orig_matrix_offset);
@@ -1042,59 +1042,59 @@ static void manipulator_cage2d_exit(bContext *C, wmManipulator *mpr, const bool
 
 
 /* -------------------------------------------------------------------- */
-/** \name Cage Manipulator API
+/** \name Cage Gizmo API
  *
  * \{ */
 
-static void MANIPULATOR_WT_cage_2d(wmManipulatorType *wt)
+static void GIZMO_WT_cage_2d(wmGizmoType *wt)
 {
        /* identifiers */
-       wt->idname = "MANIPULATOR_WT_cage_2d";
+       wt->idname = "GIZMO_WT_cage_2d";
 
        /* api callbacks */
-       wt->draw = manipulator_cage2d_draw;
-       wt->draw_select = manipulator_cage2d_draw_select;
-       wt->test_select = manipulator_cage2d_test_select;
-       wt->setup = manipulator_cage2d_setup;
-       wt->invoke = manipulator_cage2d_invoke;
-       wt->property_update = manipulator_cage2d_property_update;
-       wt->modal = manipulator_cage2d_modal;
-       wt->exit = manipulator_cage2d_exit;
-       wt->cursor_get = manipulator_cage2d_get_cursor;
-
-       wt->struct_size = sizeof(wmManipulator);
+       wt->draw = gizmo_cage2d_draw;
+       wt->draw_select = gizmo_cage2d_draw_select;
+       wt->test_select = gizmo_cage2d_test_select;
+       wt->setup = gizmo_cage2d_setup;
+       wt->invoke = gizmo_cage2d_invoke;
+       wt->property_update = gizmo_cage2d_property_update;
+       wt->modal = gizmo_cage2d_modal;
+       wt->exit = gizmo_cage2d_exit;
+       wt->cursor_get = gizmo_cage2d_get_cursor;
+
+       wt->struct_size = sizeof(wmGizmo);
 
        /* rna */
        static EnumPropertyItem rna_enum_draw_style[] = {
-               {ED_MANIPULATOR_CAGE2D_STYLE_BOX, "BOX", 0, "Box", ""},
-               {ED_MANIPULATOR_CAGE2D_STYLE_CIRCLE, "CIRCLE", 0, "Circle", ""},
+               {ED_GIZMO_CAGE2D_STYLE_BOX, "BOX", 0, "Box", ""},
+               {ED_GIZMO_CAGE2D_STYLE_CIRCLE, "CIRCLE", 0, "Circle", ""},
                {0, NULL, 0, NULL, NULL}
        };
        static EnumPropertyItem rna_enum_transform[] = {
-               {ED_MANIPULATOR_CAGE2D_XFORM_FLAG_TRANSLATE, "TRANSLATE", 0, "Translate", ""},
-               {ED_MANIPULATOR_CAGE2D_XFORM_FLAG_ROTATE, "ROTATE", 0, "Rotate", ""},
-               {ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE, "SCALE", 0, "Scale", ""},
-               {ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE_UNIFORM, "SCALE_UNIFORM", 0, "Scale Uniform", ""},
+               {ED_GIZMO_CAGE2D_XFORM_FLAG_TRANSLATE, "TRANSLATE", 0, "Translate", ""},
+               {ED_GIZMO_CAGE2D_XFORM_FLAG_ROTATE, "ROTATE", 0, "Rotate", ""},
+               {ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE, "SCALE", 0, "Scale", ""},
+               {ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE_UNIFORM, "SCALE_UNIFORM", 0, "Scale Uniform", ""},
                {0, NULL, 0, NULL, NULL}
        };
        static EnumPropertyItem rna_enum_draw_options[] = {
-               {ED_MANIPULATOR_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE, "XFORM_CENTER_HANDLE", 0, "Center Handle", ""},
+               {ED_GIZMO_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE, "XFORM_CENTER_HANDLE", 0, "Center Handle", ""},
                {0, NULL, 0, NULL, NULL}
        };
        static float unit_v2[2] = {1.0f, 1.0f};
        RNA_def_float_vector(wt->srna, "dimensions", 2, unit_v2, 0, FLT_MAX, "Dimensions", "", 0.0f, FLT_MAX);
        RNA_def_enum_flag(wt->srna, "transform", rna_enum_transform, 0, "Transform Options", "");
-       RNA_def_enum(wt->srna, "draw_style", rna_enum_draw_style, ED_MANIPULATOR_CAGE2D_STYLE_CIRCLE, "Draw Style", "");
+       RNA_def_enum(wt->srna, "draw_style", rna_enum_draw_style, ED_GIZMO_CAGE2D_STYLE_CIRCLE, "Draw Style", "");
        RNA_def_enum_flag(
                wt->srna, "draw_options", rna_enum_draw_options,
-               ED_MANIPULATOR_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE, "Draw Options", "");
+               ED_GIZMO_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE, "Draw Options", "");
 
-       WM_manipulatortype_target_property_def(wt, "matrix", PROP_FLOAT, 16);
+       WM_gizmotype_target_property_def(wt, "matrix", PROP_FLOAT, 16);
 }
 
-void ED_manipulatortypes_cage_2d(void)
+void ED_gizmotypes_cage_2d(void)
 {
-       WM_manipulatortype_append(MANIPULATOR_WT_cage_2d);
+       WM_gizmotype_append(GIZMO_WT_cage_2d);
 }
 
 /** \} */
index 0f3e67d7585837dae868cfba9e1a97c8ca109382..e266514855b0c6382cb5de215002175805aa8319 100644 (file)
 /** \file cage3d_gizmo.c
  *  \ingroup wm
  *
- * \name Cage Manipulator
+ * \name Cage Gizmo
  *
- * 2D Manipulator
+ * 2D Gizmo
  *
- * \brief Rectangular manipulator acting as a 'cage' around its content.
- * Interacting scales or translates the manipulator.
+ * \brief Rectangular gizmo acting as a 'cage' around its content.
+ * Interacting scales or translates the gizmo.
  */
 
 #include "MEM_guardedalloc.h"
 /* own includes */
 #include "../gizmo_library_intern.h"
 
-#define MANIPULATOR_RESIZER_SIZE 10.0f
-#define MANIPULATOR_MARGIN_OFFSET_SCALE 1.5f
+#define GIZMO_RESIZER_SIZE 10.0f
+#define GIZMO_MARGIN_OFFSET_SCALE 1.5f
 
-static void manipulator_calc_matrix_final_no_offset(
-        const wmManipulator *mpr, float orig_matrix_final_no_offset[4][4], bool use_space)
+static void gizmo_calc_matrix_final_no_offset(
+        const wmGizmo *mpr, float orig_matrix_final_no_offset[4][4], bool use_space)
 {
        float mat_identity[4][4];
-       struct WM_ManipulatorMatrixParams params = {NULL};
+       struct WM_GizmoMatrixParams params = {NULL};
        unit_m4(mat_identity);
        if (use_space == false) {
                params.matrix_basis = mat_identity;
        }
        params.matrix_offset = mat_identity;
-       WM_manipulator_calc_matrix_final_params(mpr, &params, orig_matrix_final_no_offset);
+       WM_gizmo_calc_matrix_final_params(mpr, &params, orig_matrix_final_no_offset);
 }
 
-static void manipulator_calc_rect_view_scale(
-        const wmManipulator *mpr, const float dims[3], float scale[3])
+static void gizmo_calc_rect_view_scale(
+        const wmGizmo *mpr, const float dims[3], float scale[3])
 {
        UNUSED_VARS(dims);
 
@@ -88,7 +88,7 @@ static void manipulator_calc_rect_view_scale(
        float matrix_final_no_offset[4][4];
 
        float x_axis[3], y_axis[3], z_axis[3];
-       manipulator_calc_matrix_final_no_offset(mpr, matrix_final_no_offset, false);
+       gizmo_calc_matrix_final_no_offset(mpr, matrix_final_no_offset, false);
        mul_v3_mat3_m4v3(x_axis, matrix_final_no_offset, mpr->matrix_offset[0]);
        mul_v3_mat3_m4v3(y_axis, matrix_final_no_offset, mpr->matrix_offset[1]);
        mul_v3_mat3_m4v3(z_axis, matrix_final_no_offset, mpr->matrix_offset[2]);
@@ -98,21 +98,21 @@ static void manipulator_calc_rect_view_scale(
        scale[2] = 1.0f / len_v3(z_axis);
 }
 
-static void manipulator_calc_rect_view_margin(
-        const wmManipulator *mpr, const float dims[3], float margin[3])
+static void gizmo_calc_rect_view_margin(
+        const wmGizmo *mpr, const float dims[3], float margin[3])
 {
        float handle_size;
-       if (mpr->parent_mgroup->type->flag & WM_MANIPULATORGROUPTYPE_3D) {
+       if (mpr->parent_mgroup->type->flag & WM_GIZMOGROUPTYPE_3D) {
                handle_size = 0.15f;
        }
        else {
-               handle_size = MANIPULATOR_RESIZER_SIZE;
+               handle_size = GIZMO_RESIZER_SIZE;
        }
        // XXX, the scale isn't taking offset into account, we need to calculate scale per handle!
        // handle_size *= mpr->scale_final;
 
        float scale_xyz[3];
-       manipulator_calc_rect_view_scale(mpr, dims, scale_xyz);
+       gizmo_calc_rect_view_scale(mpr, dims, scale_xyz);
        margin[0] = ((handle_size * scale_xyz[0]));
        margin[1] = ((handle_size * scale_xyz[1]));
        margin[2] = ((handle_size * scale_xyz[2]));
@@ -120,12 +120,12 @@ static void manipulator_calc_rect_view_margin(
 
 /* -------------------------------------------------------------------- */
 
-static void manipulator_rect_pivot_from_scale_part(int part, float r_pt[3], bool r_constrain_axis[3])
+static void gizmo_rect_pivot_from_scale_part(int part, float r_pt[3], bool r_constrain_axis[3])
 {
-       if (part >= ED_MANIPULATOR_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MIN_Z &&
-           part <= ED_MANIPULATOR_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MAX_Z)
+       if (part >= ED_GIZMO_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MIN_Z &&
+           part <= ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MAX_Z)
        {
-               int index = (part - ED_MANIPULATOR_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MIN_Z);
+               int index = (part - ED_GIZMO_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MIN_Z);
                int range[3];
                range[2] = index % 3;
                index    = index / 3;
@@ -144,7 +144,7 @@ static void manipulator_rect_pivot_from_scale_part(int part, float r_pt[3], bool
 /* -------------------------------------------------------------------- */
 /** \name Box Draw Style
  *
- * Useful for 3D views, see: #ED_MANIPULATOR_CAGE2D_STYLE_BOX
+ * Useful for 3D views, see: #ED_GIZMO_CAGE2D_STYLE_BOX
  * \{ */
 
 static void cage3d_draw_box_corners(
@@ -165,10 +165,10 @@ static void cage3d_draw_box_interaction(
         const float color[4], const int highlighted,
         const float size[3], const float margin[3])
 {
-       if (highlighted >= ED_MANIPULATOR_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MIN_Z &&
-           highlighted <= ED_MANIPULATOR_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MAX_Z)
+       if (highlighted >= ED_GIZMO_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MIN_Z &&
+           highlighted <= ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MAX_Z)
        {
-               int index = (highlighted - ED_MANIPULATOR_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MIN_Z);
+               int index = (highlighted - ED_GIZMO_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MIN_Z);
                int range[3];
                range[2] = index % 3;
                index    = index / 3;
@@ -199,7 +199,7 @@ static void cage3d_draw_box_interaction(
 /* -------------------------------------------------------------------- */
 /** \name Circle Draw Style
  *
- * Useful for 2D views, see: #ED_MANIPULATOR_CAGE2D_STYLE_CIRCLE
+ * Useful for 2D views, see: #ED_GIZMO_CAGE2D_STYLE_CIRCLE
  * \{ */
 
 static void imm_draw_point_aspect_3d(
@@ -225,8 +225,8 @@ static void cage3d_draw_circle_wire(
        imm_draw_cube_wire_3d(pos, (float[3]){0}, r);
 
 #if 0
-       if (transform_flag & ED_MANIPULATOR_CAGE2D_XFORM_FLAG_TRANSLATE) {
-               if (draw_options & ED_MANIPULATOR_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE) {
+       if (transform_flag & ED_GIZMO_CAGE2D_XFORM_FLAG_TRANSLATE) {
+               if (draw_options & ED_GIZMO_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE) {
                        const float rad[2] = {margin[0] / 2, margin[1] / 2};
                        const float center[2] = {0.0f, 0.0f};
 
@@ -279,11 +279,11 @@ static void cage3d_draw_circle_handles(
 
 /** \} */
 
-static void manipulator_cage3d_draw_intern(
+static void gizmo_cage3d_draw_intern(
         RegionView3D *rv3d,
-        wmManipulator *mpr, const bool select, const bool highlight, const int select_id)
+        wmGizmo *mpr, const bool select, const bool highlight, const int select_id)
 {
-       // const bool use_clamp = (mpr->parent_mgroup->type->flag & WM_MANIPULATORGROUPTYPE_3D) == 0;
+       // const bool use_clamp = (mpr->parent_mgroup->type->flag & WM_GIZMOGROUPTYPE_3D) == 0;
        float dims[3];
        RNA_float_get_array(mpr->ptr, "dimensions", dims);
        float matrix_final[4][4];
@@ -294,13 +294,13 @@ static void manipulator_cage3d_draw_intern(
 
        const float size_real[3] = {dims[0] / 2.0f, dims[1] / 2.0f, dims[2] / 2.0f};
 
-       WM_manipulator_calc_matrix_final(mpr, matrix_final);
+       WM_gizmo_calc_matrix_final(mpr, matrix_final);
 
        gpuPushMatrix();
        gpuMultMatrix(matrix_final);
 
        float margin[3];
-       manipulator_calc_rect_view_margin(mpr, dims, margin);
+       gizmo_calc_rect_view_margin(mpr, dims, margin);
 
        /* Handy for quick testing draw (if it's outside bounds). */
        if (false) {
@@ -328,12 +328,12 @@ static void manipulator_cage3d_draw_intern(
 #endif
 
 
-               if (transform_flag & ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE) {
-                       for (int i = ED_MANIPULATOR_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MIN_Z;
-                            i <= ED_MANIPULATOR_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MAX_Z;
+               if (transform_flag & ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE) {
+                       for (int i = ED_GIZMO_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MIN_Z;
+                            i <= ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MAX_Z;
                             i++)
                        {
-                               if (i == ED_MANIPULATOR_CAGE3D_PART_SCALE_MID_X_MID_Y_MID_Z) {
+                               if (i == ED_GIZMO_CAGE3D_PART_SCALE_MID_X_MID_Y_MID_Z) {
                                        continue;
                                }
                                GPU_select_load_id(select_id | i);
@@ -341,8 +341,8 @@ static void manipulator_cage3d_draw_intern(
                                        mpr->color, i, size, margin);
                        }
                }
-               if (transform_flag & ED_MANIPULATOR_CAGE2D_XFORM_FLAG_TRANSLATE) {
-                       const int transform_part = ED_MANIPULATOR_CAGE3D_PART_TRANSLATE;
+               if (transform_flag & ED_GIZMO_CAGE2D_XFORM_FLAG_TRANSLATE) {
+                       const int transform_part = ED_GIZMO_CAGE3D_PART_TRANSLATE;
                        GPU_select_load_id(select_id | transform_part);
                        cage3d_draw_box_interaction(
                                mpr->color, transform_part, size, margin);
@@ -357,22 +357,22 @@ static void manipulator_cage3d_draw_intern(
                        .ymax = size_real[1],
                };
 #endif
-               if (draw_style == ED_MANIPULATOR_CAGE2D_STYLE_BOX) {
-                       /* corner manipulators */
+               if (draw_style == ED_GIZMO_CAGE2D_STYLE_BOX) {
+                       /* corner gizmos */
                        GPU_line_width(mpr->line_width + 3.0f);
                        cage3d_draw_box_corners(size_real, margin, (const float[3]){0, 0, 0});
 
-                       /* corner manipulators */
+                       /* corner gizmos */
                        float color[4];
-                       manipulator_color_get(mpr, highlight, color);
+                       gizmo_color_get(mpr, highlight, color);
                        GPU_line_width(mpr->line_width);
                        cage3d_draw_box_corners(size_real, margin, color);
 
                        bool show = false;
-                       if (mpr->highlight_part == ED_MANIPULATOR_CAGE3D_PART_TRANSLATE) {
+                       if (mpr->highlight_part == ED_GIZMO_CAGE3D_PART_TRANSLATE) {
                                /* Only show if we're drawing the center handle
                                 * otherwise the entire rectangle is the hotspot. */
-                               if (draw_options & ED_MANIPULATOR_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE) {
+                               if (draw_options & ED_GIZMO_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE) {
                                        show = true;
                                }
                        }
@@ -385,9 +385,9 @@ static void manipulator_cage3d_draw_intern(
                                        mpr->color, mpr->highlight_part, size_real, margin);
                        }
                }
-               else if (draw_style == ED_MANIPULATOR_CAGE2D_STYLE_CIRCLE) {
+               else if (draw_style == ED_GIZMO_CAGE2D_STYLE_CIRCLE) {
                        float color[4];
-                       manipulator_color_get(mpr, highlight, color);
+                       gizmo_color_get(mpr, highlight, color);
 
                        GPU_line_smooth(true);
                        GPU_polygon_smooth(true);
@@ -398,7 +398,7 @@ static void manipulator_cage3d_draw_intern(
                        GPU_line_width(mpr->line_width);
                        cage3d_draw_circle_wire(size_real, margin, color, transform_flag, draw_options);
 
-                       /* corner manipulators */
+                       /* corner gizmos */
                        cage3d_draw_circle_handles(rv3d, matrix_final, size_real, margin, (const float[3]){0, 0, 0}, true, 60);
                        cage3d_draw_circle_handles(rv3d, matrix_final, size_real, margin, color, true, 40);
 
@@ -418,24 +418,24 @@ static void manipulator_cage3d_draw_intern(
 /**
  * For when we want to draw 3d cage in 3d views.
  */
-static void manipulator_cage3d_draw_select(const bContext *C, wmManipulator *mpr, int select_id)
+static void gizmo_cage3d_draw_select(const bContext *C, wmGizmo *mpr, int select_id)
 {
        ARegion *ar = CTX_wm_region(C);
        RegionView3D *rv3d = ar->regiondata;
-       manipulator_cage3d_draw_intern(rv3d, mpr, true, false, select_id);
+       gizmo_cage3d_draw_intern(rv3d, mpr, true, false, select_id);
 }
 
-static void manipulator_cage3d_draw(const bContext *C, wmManipulator *mpr)
+static void gizmo_cage3d_draw(const bContext *C, wmGizmo *mpr)
 {
        ARegion *ar = CTX_wm_region(C);
        RegionView3D *rv3d = ar->regiondata;
-       const bool is_highlight = (mpr->state & WM_MANIPULATOR_STATE_HIGHLIGHT) != 0;
-       manipulator_cage3d_draw_intern(rv3d, mpr, false, is_highlight, -1);
+       const bool is_highlight = (mpr->state & WM_GIZMO_STATE_HIGHLIGHT) != 0;
+       gizmo_cage3d_draw_intern(rv3d, mpr, false, is_highlight, -1);
 }
 
-static int manipulator_cage3d_get_cursor(wmManipulator *mpr)
+static int gizmo_cage3d_get_cursor(wmGizmo *mpr)
 {
-       if (mpr->parent_mgroup->type->flag & WM_MANIPULATORGROUPTYPE_3D) {
+       if (mpr->parent_mgroup->type->flag & WM_GIZMOGROUPTYPE_3D) {
                return BC_NSEW_SCROLLCURSOR;
        }
 
@@ -448,21 +448,21 @@ typedef struct RectTransformInteraction {
        float orig_matrix_final_no_offset[4][4];
 } RectTransformInteraction;
 
-static void manipulator_cage3d_setup(wmManipulator *mpr)
+static void gizmo_cage3d_setup(wmGizmo *mpr)
 {
-       mpr->flag |= /* WM_MANIPULATOR_DRAW_MODAL | */ /* TODO */
-                    WM_MANIPULATOR_DRAW_NO_SCALE;
+       mpr->flag |= /* WM_GIZMO_DRAW_MODAL | */ /* TODO */
+                    WM_GIZMO_DRAW_NO_SCALE;
 }
 
-static int manipulator_cage3d_invoke(
-        bContext *C, wmManipulator *mpr, const wmEvent *event)
+static int gizmo_cage3d_invoke(
+        bContext *C, wmGizmo *mpr, const wmEvent *event)
 {
        RectTransformInteraction *data = MEM_callocN(sizeof(RectTransformInteraction), "cage_interaction");
 
        copy_m4_m4(data->orig_matrix_offset, mpr->matrix_offset);
-       manipulator_calc_matrix_final_no_offset(mpr, data->orig_matrix_final_no_offset, true);
+       gizmo_calc_matrix_final_no_offset(mpr, data->orig_matrix_final_no_offset, true);
 
-       if (manipulator_window_project_3d(
+       if (gizmo_window_project_3d(
                C, mpr, (const float[2]){UNPACK2(event->mval)}, false, data->orig_mouse) == 0)
        {
                zero_v3(data->orig_mouse);
@@ -473,9 +473,9 @@ static int manipulator_cage3d_invoke(
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int manipulator_cage3d_modal(
-        bContext *C, wmManipulator *mpr, const wmEvent *event,
-        eWM_ManipulatorTweak UNUSED(tweak_flag))
+static int gizmo_cage3d_modal(
+        bContext *C, wmGizmo *mpr, const wmEvent *event,
+        eWM_GizmoFlagTweak UNUSED(tweak_flag))
 {
        /* For transform logic to be managable we operate in -0.5..0.5 2D space,
         * no matter the size of the rectangle, mouse coorts are scaled to unit space.
@@ -495,7 +495,7 @@ static int manipulator_cage3d_modal(
                copy_m4_m4(matrix_back, mpr->matrix_offset);
                copy_m4_m4(mpr->matrix_offset, data->orig_matrix_offset);
 
-               bool ok = manipulator_window_project_3d(
+               bool ok = gizmo_window_project_3d(
                        C, mpr, (const float[2]){UNPACK2(event->mval)}, false, point_local);
                copy_m4_m4(mpr->matrix_offset, matrix_back);
                if (!ok) {
@@ -504,21 +504,21 @@ static int manipulator_cage3d_modal(
        }
 
        const int transform_flag = RNA_enum_get(mpr->ptr, "transform");
-       wmManipulatorProperty *mpr_prop;
+       wmGizmoProperty *mpr_prop;
 
-       mpr_prop = WM_manipulator_target_property_find(mpr, "matrix");
+       mpr_prop = WM_gizmo_target_property_find(mpr, "matrix");
        if (mpr_prop->type != NULL) {
-               WM_manipulator_target_property_value_get_array(mpr, mpr_prop, &mpr->matrix_offset[0][0]);
+               WM_gizmo_target_property_value_get_array(mpr, mpr_prop, &mpr->matrix_offset[0][0]);
        }
 
-       if (mpr->highlight_part == ED_MANIPULATOR_CAGE3D_PART_TRANSLATE) {
+       if (mpr->highlight_part == ED_GIZMO_CAGE3D_PART_TRANSLATE) {
                /* do this to prevent clamping from changing size */
                copy_m4_m4(mpr->matrix_offset, data->orig_matrix_offset);
                mpr->matrix_offset[3][0] = data->orig_matrix_offset[3][0] + (point_local[0] - data->orig_mouse[0]);
                mpr->matrix_offset[3][1] = data->orig_matrix_offset[3][1] + (point_local[1] - data->orig_mouse[1]);
                mpr->matrix_offset[3][2] = data->orig_matrix_offset[3][2] + (point_local[2] - data->orig_mouse[2]);
        }
-       else if (mpr->highlight_part == ED_MANIPULATOR_CAGE3D_PART_ROTATE) {
+       else if (mpr->highlight_part == ED_GIZMO_CAGE3D_PART_ROTATE) {
                /* TODO (if needed) */
        }
        else {
@@ -527,8 +527,8 @@ static int manipulator_cage3d_modal(
                float pivot[3];
                bool constrain_axis[3] = {false};
 
-               if (transform_flag & ED_MANIPULATOR_CAGE2D_XFORM_FLAG_TRANSLATE) {
-                       manipulator_rect_pivot_from_scale_part(mpr->highlight_part, pivot, constrain_axis);
+               if (transform_flag & ED_GIZMO_CAGE2D_XFORM_FLAG_TRANSLATE) {
+                       gizmo_rect_pivot_from_scale_part(mpr->highlight_part, pivot, constrain_axis);
                }
                else {
                        zero_v3(pivot);
@@ -553,7 +553,7 @@ static int manipulator_cage3d_modal(
 
                                scale[i] = 1.0f + ((delta_curr[i] - delta_orig[i]) / len_v3(data->orig_matrix_offset[i]));
 
-                               if ((transform_flag & ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE_SIGNED) == 0) {
+                               if ((transform_flag & ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE_SIGNED) == 0) {
                                        if (sign != signum_i(scale[i])) {
                                                scale[i] = 0.0f;
                                        }
@@ -561,7 +561,7 @@ static int manipulator_cage3d_modal(
                        }
                }
 
-               if (transform_flag & ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE_UNIFORM) {
+               if (transform_flag & ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE_UNIFORM) {
                        if (constrain_axis[0] == false && constrain_axis[1] == false) {
                                scale[1] = scale[0] = (scale[1] + scale[0]) / 2.0f;
                        }
@@ -591,7 +591,7 @@ static int manipulator_cage3d_modal(
        }
 
        if (mpr_prop->type != NULL) {
-               WM_manipulator_target_property_value_set_array(C, mpr, mpr_prop, &mpr->matrix_offset[0][0]);
+               WM_gizmo_target_property_value_set_array(C, mpr, mpr_prop, &mpr->matrix_offset[0][0]);
        }
 
        /* tag the region for redraw */
@@ -601,11 +601,11 @@ static int manipulator_cage3d_modal(
        return OPERATOR_RUNNING_MODAL;
 }
 
-static void manipulator_cage3d_property_update(wmManipulator *mpr, wmManipulatorProperty *mpr_prop)
+static void gizmo_cage3d_property_update(wmGizmo *mpr, wmGizmoProperty *mpr_prop)
 {
        if (STREQ(mpr_prop->type->idname, "matrix")) {
-               if (WM_manipulator_target_property_array_length(mpr, mpr_prop) == 16) {
-                       WM_manipulator_target_property_value_get_array(mpr, mpr_prop, &mpr->matrix_offset[0][0]);
+               if (WM_gizmo_target_property_array_length(mpr, mpr_prop) == 16) {
+                       WM_gizmo_target_property_value_get_array(mpr, mpr_prop, &mpr->matrix_offset[0][0]);
                }
                else {
                        BLI_assert(0);
@@ -616,19 +616,19 @@ static void manipulator_cage3d_property_update(wmManipulator *mpr, wmManipulator
        }
 }
 
-static void manipulator_cage3d_exit(bContext *C, wmManipulator *mpr, const bool cancel)
+static void gizmo_cage3d_exit(bContext *C, wmGizmo *mpr, const bool cancel)
 {
        RectTransformInteraction *data = mpr->interaction_data;
 
        if (!cancel)
                return;
 
-       wmManipulatorProperty *mpr_prop;
+       wmGizmoProperty *mpr_prop;
 
        /* reset properties */
-       mpr_prop = WM_manipulator_target_property_find(mpr, "matrix");
+       mpr_prop = WM_gizmo_target_property_find(mpr, "matrix");
        if (mpr_prop->type != NULL) {
-               WM_manipulator_target_property_value_set_array(C, mpr, mpr_prop, &data->orig_matrix_offset[0][0]);
+               WM_gizmo_target_property_value_set_array(C, mpr, mpr_prop, &data->orig_matrix_offset[0][0]);
        }
 
        copy_m4_m4(mpr->matrix_offset, data->orig_matrix_offset);
@@ -636,57 +636,57 @@ static void manipulator_cage3d_exit(bContext *C, wmManipulator *mpr, const bool
 
 
 /* -------------------------------------------------------------------- */
-/** \name Cage Manipulator API
+/** \name Cage Gizmo API
  *
  * \{ */
 
-static void MANIPULATOR_WT_cage_3d(wmManipulatorType *wt)
+static void GIZMO_WT_cage_3d(wmGizmoType *wt)
 {
        /* identifiers */
-       wt->idname = "MANIPULATOR_WT_cage_3d";
+       wt->idname = "GIZMO_WT_cage_3d";
 
        /* api callbacks */
-       wt->draw = manipulator_cage3d_draw;
-       wt->draw_select = manipulator_cage3d_draw_select;
-       wt->setup = manipulator_cage3d_setup;
-       wt->invoke = manipulator_cage3d_invoke;
-       wt->property_update = manipulator_cage3d_property_update;
-       wt->modal = manipulator_cage3d_modal;
-       wt->exit = manipulator_cage3d_exit;
-       wt->cursor_get = manipulator_cage3d_get_cursor;
+       wt->draw = gizmo_cage3d_draw;
+       wt->draw_select = gizmo_cage3d_draw_select;
+       wt->setup = gizmo_cage3d_setup;
+       wt->invoke = gizmo_cage3d_invoke;
+       wt->property_update = gizmo_cage3d_property_update;
+       wt->modal = gizmo_cage3d_modal;
+       wt->exit = gizmo_cage3d_exit;
+       wt->cursor_get = gizmo_cage3d_get_cursor;
 
-       wt->struct_size = sizeof(wmManipulator);
+       wt->struct_size = sizeof(wmGizmo);
 
        /* rna */
        static EnumPropertyItem rna_enum_draw_style[] = {
-               {ED_MANIPULATOR_CAGE2D_STYLE_BOX, "BOX", 0, "Box", ""},
-               {ED_MANIPULATOR_CAGE2D_STYLE_CIRCLE, "CIRCLE", 0, "Circle", ""},
+               {ED_GIZMO_CAGE2D_STYLE_BOX, "BOX", 0, "Box", ""},
+               {ED_GIZMO_CAGE2D_STYLE_CIRCLE, "CIRCLE", 0, "Circle", ""},
                {0, NULL, 0, NULL, NULL}
        };
        static EnumPropertyItem rna_enum_transform[] = {
-               {ED_MANIPULATOR_CAGE2D_XFORM_FLAG_TRANSLATE, "TRANSLATE", 0, "Translate", ""},
-               {ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE, "SCALE", 0, "Scale", ""},
-               {ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE_UNIFORM, "SCALE_UNIFORM", 0, "Scale Uniform", ""},
+               {ED_GIZMO_CAGE2D_XFORM_FLAG_TRANSLATE, "TRANSLATE", 0, "Translate", ""},
+               {ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE, "SCALE", 0, "Scale", ""},
+               {ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE_UNIFORM, "SCALE_UNIFORM", 0, "Scale Uniform", ""},
                {0, NULL, 0, NULL, NULL}
        };
        static EnumPropertyItem rna_enum_draw_options[] = {
-               {ED_MANIPULATOR_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE, "XFORM_CENTER_HANDLE", 0, "Center Handle", ""},
+               {ED_GIZMO_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE, "XFORM_CENTER_HANDLE", 0, "Center Handle", ""},
                {0, NULL, 0, NULL, NULL}
        };
        static float unit_v3[3] = {1.0f, 1.0f, 1.0f};
        RNA_def_float_vector(wt->srna, "dimensions", 3, unit_v3, 0, FLT_MAX, "Dimensions", "", 0.0f, FLT_MAX);
        RNA_def_enum_flag(wt->srna, "transform", rna_enum_transform, 0, "Transform Options", "");
-       RNA_def_enum(wt->srna, "draw_style", rna_enum_draw_style, ED_MANIPULATOR_CAGE2D_STYLE_CIRCLE, "Draw Style", "");
+       RNA_def_enum(wt->srna, "draw_style", rna_enum_draw_style, ED_GIZMO_CAGE2D_STYLE_CIRCLE, "Draw Style", "");
        RNA_def_enum_flag(
                wt->srna, "draw_options", rna_enum_draw_options,
-               ED_MANIPULATOR_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE, "Draw Options", "");
+               ED_GIZMO_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE, "Draw Options", "");
 
-       WM_manipulatortype_target_property_def(wt, "matrix", PROP_FLOAT, 16);
+       WM_gizmotype_target_property_def(wt, "matrix", PROP_FLOAT, 16);
 }
 
-void ED_manipulatortypes_cage_3d(void)
+void ED_gizmotypes_cage_3d(void)
 {
-       WM_manipulatortype_append(MANIPULATOR_WT_cage_3d);
+       WM_gizmotype_append(GIZMO_WT_cage_3d);
 }
 
 /** \} */
index 8d0061f66c89a96b7bf53c37c9f5105f056bcfc9..b93b87b1efac23e545f0c780307ec364be466ae4 100644 (file)
 /** \file dial3d_gizmo.c
  *  \ingroup wm
  *
- * \name Dial Manipulator
+ * \name Dial Gizmo
  *
- * 3D Manipulator
+ * 3D Gizmo
  *
- * \brief Circle shaped manipulator for circular interaction.
+ * \brief Circle shaped gizmo for circular interaction.
  * Currently no own handling, use with operator only.
  *
  * - `matrix[0]` is derived from Y and Z.
- * - `matrix[1]` is 'up' when DialManipulator.use_start_y_axis is set.
+ * - `matrix[1]` is 'up' when DialGizmo.use_start_y_axis is set.
  * - `matrix[2]` is the axis the dial rotates around (all dials).
  */
 
 #include "../gizmo_geometry.h"
 #include "../gizmo_library_intern.h"
 
-/* to use custom dials exported to geom_dial_manipulator.c */
-// #define USE_MANIPULATOR_CUSTOM_DIAL
+/* to use custom dials exported to geom_dial_gizmo.c */
+// #define USE_GIZMO_CUSTOM_DIAL
 
-static int manipulator_dial_modal(
-        bContext *C, wmManipulator *mpr, const wmEvent *event,
-        eWM_ManipulatorTweak tweak_flag);
+static int gizmo_dial_modal(
+        bContext *C, wmGizmo *mpr, const wmEvent *event,
+        eWM_GizmoFlagTweak tweak_flag);
 
 typedef struct DialInteraction {
        float init_mval[2];
@@ -99,9 +99,9 @@ typedef struct DialInteraction {
 #define DIAL_CLIP_BIAS 0.02
 
 /**
- * We can't use this for the #wmManipulatorType.matrix_basis_get callback, it conflicts with depth picking.
+ * We can't use this for the #wmGizmoType.matrix_basis_get callback, it conflicts with depth picking.
  */
-static void dial_calc_matrix(const wmManipulator *mpr, float mat[4][4])
+static void dial_calc_matrix(const wmGizmo *mpr, float mat[4][4])
 {
        float rot[3][3];
        const float up[3] = {0.0f, 0.0f, 1.0f};
@@ -114,15 +114,15 @@ static void dial_calc_matrix(const wmManipulator *mpr, float mat[4][4])
 /* -------------------------------------------------------------------- */
 
 static void dial_geom_draw(
-        const wmManipulator *mpr, const float color[4], const bool select,
+        const wmGizmo *mpr, const float color[4], const bool select,
         float axis_modal_mat[4][4], float clip_plane[4])
 {
-#ifdef USE_MANIPULATOR_CUSTOM_DIAL
+#ifdef USE_GIZMO_CUSTOM_DIAL
        UNUSED_VARS(dial, col, axis_modal_mat, clip_plane);
-       wm_manipulator_geometryinfo_draw(&wm_manipulator_geom_data_dial, select);
+       wm_gizmo_geometryinfo_draw(&wm_gizmo_geom_data_dial, select);
 #else
        const int draw_options = RNA_enum_get(mpr->ptr, "draw_options");
-       const bool filled = (draw_options & ED_MANIPULATOR_DIAL_DRAW_FLAG_FILL) != 0;
+       const bool filled = (draw_options & ED_GIZMO_DIAL_DRAW_FLAG_FILL) != 0;
 
        GPU_line_width(mpr->line_width);
 
@@ -181,9 +181,9 @@ static void dial_ghostarc_draw_helpline(const float angle, const float co_outer[
 }
 
 static void dial_ghostarc_draw(
-        const wmManipulator *mpr, const float angle_ofs, const float angle_delta, const float color[4])
+        const wmGizmo *mpr, const float angle_ofs, const float angle_delta, const float color[4])
 {
-       const float width_inner = DIAL_WIDTH - mpr->line_width * 0.5f / U.manipulator_size;
+       const float width_inner = DIAL_WIDTH - mpr->line_width * 0.5f / U.gizmo_size;
 
        Gwn_VertFormat *format = immVertexFormat();
        uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
@@ -196,7 +196,7 @@ static void dial_ghostarc_draw(
 
 static void dial_ghostarc_get_angles(
         struct Depsgraph *depsgraph,
-        const wmManipulator *mpr,
+        const wmGizmo *mpr,
         const wmEvent *event,
         const ARegion *ar, const View3D *v3d,
         float mat[4][4], const float co_outer[3],
@@ -243,7 +243,7 @@ static void dial_ghostarc_get_angles(
 
        /* Start direction from mouse or set by user */
        const float *proj_init_rel =
-               (draw_options & ED_MANIPULATOR_DIAL_DRAW_FLAG_ANGLE_START_Y) ?
+               (draw_options & ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_START_Y) ?
                mpr->matrix_basis[1] : proj_mval_init_rel;
 
        /* return angles */
@@ -274,7 +274,7 @@ fail:
 }
 
 static void dial_draw_intern(
-        const bContext *C, wmManipulator *mpr,
+        const bContext *C, wmGizmo *mpr,
         const bool select, const bool highlight, float clip_plane[4])
 {
        float matrix_basis_adjust[4][4];
@@ -283,12 +283,12 @@ static void dial_draw_intern(
 
        BLI_assert(CTX_wm_area(C)->spacetype == SPACE_VIEW3D);
 
-       manipulator_color_get(mpr, highlight, color);
+       gizmo_color_get(mpr, highlight, color);
 
        dial_calc_matrix(mpr, matrix_basis_adjust);
 
-       WM_manipulator_calc_matrix_final_params(
-               mpr, &((struct WM_ManipulatorMatrixParams) {
+       WM_gizmo_calc_matrix_final_params(
+               mpr, &((struct WM_GizmoMatrixParams) {
                    .matrix_basis = (void *)matrix_basis_adjust,
                }), matrix_final);
 
@@ -296,17 +296,17 @@ static void dial_draw_intern(
        gpuMultMatrix(matrix_final);
 
        /* draw rotation indicator arc first */
-       if ((mpr->flag & WM_MANIPULATOR_DRAW_VALUE) &&
-           (mpr->state & WM_MANIPULATOR_STATE_MODAL))
+       if ((mpr->flag & WM_GIZMO_DRAW_VALUE) &&
+           (mpr->state & WM_GIZMO_STATE_MODAL))
        {
                const float co_outer[4] = {0.0f, DIAL_WIDTH, 0.0f}; /* coordinate at which the arc drawing will be started */
 
                DialInteraction *inter = mpr->interaction_data;
 
-               /* XXX, View3D rotation manipulator doesn't call modal. */
-               if (!WM_manipulator_target_property_is_valid_any(mpr)) {
+               /* XXX, View3D rotation gizmo doesn't call modal. */
+               if (!WM_gizmo_target_property_is_valid_any(mpr)) {
                        wmWindow *win = CTX_wm_window(C);
-                       manipulator_dial_modal((bContext *)C, mpr, win->eventstate, 0);
+                       gizmo_dial_modal((bContext *)C, mpr, win->eventstate, 0);
                }
 
                float angle_ofs = inter->output.angle_ofs;
@@ -323,7 +323,7 @@ static void dial_draw_intern(
 
                        if (i == 0) {
                                const int draw_options = RNA_enum_get(mpr->ptr, "draw_options");
-                               if ((draw_options & ED_MANIPULATOR_DIAL_DRAW_FLAG_ANGLE_MIRROR) == 0) {
+                               if ((draw_options & ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_MIRROR) == 0) {
                                        break;
                                }
                        }
@@ -332,17 +332,17 @@ static void dial_draw_intern(
                }
        }
 
-       /* draw actual dial manipulator */
+       /* draw actual dial gizmo */
        dial_geom_draw(mpr, color, select, matrix_basis_adjust, clip_plane);
 
        gpuPopMatrix();
 }
 
-static void manipulator_dial_draw_select(const bContext *C, wmManipulator *mpr, int select_id)
+static void gizmo_dial_draw_select(const bContext *C, wmGizmo *mpr, int select_id)
 {
        float clip_plane_buf[4];
        const int draw_options = RNA_enum_get(mpr->ptr, "draw_options");
-       float *clip_plane = (draw_options & ED_MANIPULATOR_DIAL_DRAW_FLAG_CLIP) ? clip_plane_buf : NULL;
+       float *clip_plane = (draw_options & ED_GIZMO_DIAL_DRAW_FLAG_CLIP) ? clip_plane_buf : NULL;
 
        /* enable clipping if needed */
        if (clip_plane) {
@@ -363,13 +363,13 @@ static void manipulator_dial_draw_select(const bContext *C, wmManipulator *mpr,
        }
 }
 
-static void manipulator_dial_draw(const bContext *C, wmManipulator *mpr)
+static void gizmo_dial_draw(const bContext *C, wmGizmo *mpr)
 {
-       const bool is_modal = mpr->state & WM_MANIPULATOR_STATE_MODAL;
-       const bool is_highlight = (mpr->state & WM_MANIPULATOR_STATE_HIGHLIGHT) != 0;
+       const bool is_modal = mpr->state & WM_GIZMO_STATE_MODAL;
+       const bool is_highlight = (mpr->state & WM_GIZMO_STATE_HIGHLIGHT) != 0;
        float clip_plane_buf[4];
        const int draw_options = RNA_enum_get(mpr->ptr, "draw_options");
-       float *clip_plane = (!is_modal && (draw_options & ED_MANIPULATOR_DIAL_DRAW_FLAG_CLIP)) ? clip_plane_buf : NULL;
+       float *clip_plane = (!is_modal && (draw_options & ED_GIZMO_DIAL_DRAW_FLAG_CLIP)) ? clip_plane_buf : NULL;
 
        /* enable clipping if needed */
        if (clip_plane) {
@@ -392,9 +392,9 @@ static void manipulator_dial_draw(const bContext *C, wmManipulator *mpr)
        }
 }
 
-static int manipulator_dial_modal(
-        bContext *C, wmManipulator *mpr, const wmEvent *event,
-        eWM_ManipulatorTweak UNUSED(tweak_flag))
+static int gizmo_dial_modal(
+        bContext *C, wmGizmo *mpr, const wmEvent *event,
+        eWM_GizmoFlagTweak UNUSED(tweak_flag))
 {
        const float co_outer[4] = {0.0f, DIAL_WIDTH, 0.0f}; /* coordinate at which the arc drawing will be started */
        float angle_ofs, angle_delta;
@@ -413,15 +413,15 @@ static int manipulator_dial_modal(
        inter->output.angle_ofs = angle_ofs;
 
        /* set the property for the operator and call its modal function */
-       wmManipulatorProperty *mpr_prop = WM_manipulator_target_property_find(mpr, "offset");
-       if (WM_manipulator_target_property_is_valid(mpr_prop)) {
-               WM_manipulator_target_property_value_set(C, mpr, mpr_prop, inter->init_prop_angle + angle_delta);
+       wmGizmoProperty *mpr_prop = WM_gizmo_target_property_find(mpr, "offset");
+       if (WM_gizmo_target_property_is_valid(mpr_prop)) {
+               WM_gizmo_target_property_value_set(C, mpr, mpr_prop, inter->init_prop_angle + angle_delta);
        }
        return OPERATOR_RUNNING_MODAL;
 }
 
 
-static void manipulator_dial_setup(wmManipulator *mpr)
+static void gizmo_dial_setup(wmGizmo *mpr)
 {
        const float dir_default[3] = {0.0f, 0.0f, 1.0f};
 
@@ -429,17 +429,17 @@ static void manipulator_dial_setup(wmManipulator *mpr)
        copy_v3_v3(mpr->matrix_basis[2], dir_default);
 }
 
-static int manipulator_dial_invoke(
-        bContext *UNUSED(C), wmManipulator *mpr, const wmEvent *event)
+static int gizmo_dial_invoke(
+        bContext *UNUSED(C), wmGizmo *mpr, const wmEvent *event)
 {
        DialInteraction *inter = MEM_callocN(sizeof(DialInteraction), __func__);
 
        inter->init_mval[0] = event->mval[0];
        inter->init_mval[1] = event->mval[1];
 
-       wmManipulatorProperty *mpr_prop = WM_manipulator_target_property_find(mpr, "offset");
-       if (WM_manipulator_target_property_is_valid(mpr_prop)) {
-               inter->init_prop_angle = WM_manipulator_target_property_value_get(mpr, mpr_prop);
+       wmGizmoProperty *mpr_prop = WM_gizmo_target_property_find(mpr, "offset");
+       if (WM_gizmo_target_property_is_valid(mpr_prop)) {
+               inter->init_prop_angle = WM_gizmo_target_property_value_get(mpr, mpr_prop);
        }
 
        mpr->interaction_data = inter;
@@ -448,40 +448,40 @@ static int manipulator_dial_invoke(
 }
 
 /* -------------------------------------------------------------------- */
-/** \name Dial Manipulator API
+/** \name Dial Gizmo API
  *
  * \{ */
 
-static void MANIPULATOR_WT_dial_3d(wmManipulatorType *wt)
+static void GIZMO_WT_dial_3d(wmGizmoType *wt)
 {
        /* identifiers */
-       wt->idname = "MANIPULATOR_WT_dial_3d";
+       wt->idname = "GIZMO_WT_dial_3d";
 
        /* api callbacks */
-       wt->draw = manipulator_dial_draw;
-       wt->draw_select = manipulator_dial_draw_select;
-       wt->setup = manipulator_dial_setup;
-       wt->invoke = manipulator_dial_invoke;
-       wt->modal = manipulator_dial_modal;
+       wt->draw = gizmo_dial_draw;
+       wt->draw_select = gizmo_dial_draw_select;
+       wt->setup = gizmo_dial_setup;
+       wt->invoke = gizmo_dial_invoke;
+       wt->modal = gizmo_dial_modal;
 
-       wt->struct_size = sizeof(wmManipulator);
+       wt->struct_size = sizeof(wmGizmo);
 
        /* rna */
        static EnumPropertyItem rna_enum_draw_options[] = {
-               {ED_MANIPULATOR_DIAL_DRAW_FLAG_CLIP, "CLIP", 0, "Clipped", ""},
-               {ED_MANIPULATOR_DIAL_DRAW_FLAG_FILL, "FILL", 0, "Filled", ""},
-               {ED_MANIPULATOR_DIAL_DRAW_FLAG_ANGLE_MIRROR, "ANGLE_MIRROR", 0, "Angle Mirror", ""},
-               {ED_MANIPULATOR_DIAL_DRAW_FLAG_ANGLE_START_Y, "ANGLE_START_Y", 0, "Angle Start Y", ""},
+               {ED_GIZMO_DIAL_DRAW_FLAG_CLIP, "CLIP", 0, "Clipped", ""},
+               {ED_GIZMO_DIAL_DRAW_FLAG_FILL, "FILL", 0, "Filled", ""},
+               {ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_MIRROR, "ANGLE_MIRROR", 0, "Angle Mirror", ""},
+               {ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_START_Y, "ANGLE_START_Y", 0, "Angle Start Y", ""},
                {0, NULL, 0, NULL, NULL}
        };
        RNA_def_enum_flag(wt->srna, "draw_options", rna_enum_draw_options, 0, "Draw Options", "");
 
-       WM_manipulatortype_target_property_def(wt, "offset", PROP_FLOAT, 1);
+       WM_gizmotype_target_property_def(wt, "offset", PROP_FLOAT, 1);
 }
 
-void ED_manipulatortypes_dial_3d(void)
+void ED_gizmotypes_dial_3d(void)
 {
-       WM_manipulatortype_append(MANIPULATOR_WT_dial_3d);
+       WM_gizmotype_append(GIZMO_WT_dial_3d);
 }
 
 /** \} */
index e55b57327b68d8eca0b7e91d84808a6b3ced002e..2a89c8cc4ab3e917722b0aaa0ccc63a57f11ace1 100644 (file)
 /** \file grab3d_gizmo.c
  *  \ingroup wm
  *
- * \name Grab Manipulator
+ * \name Grab Gizmo
  *
- * 3D Manipulator, also works in 2D views.
+ * 3D Gizmo, also works in 2D views.
  *
- * \brief Simple manipulator to grab and translate.
+ * \brief Simple gizmo to grab and translate.
  *
  * - `matrix[0]` is derived from Y and Z.
  * - `matrix[1]` currently not used.
- * - `matrix[2]` is the widget direction (for all manipulators).
+ * - `matrix[2]` is the widget direction (for all gizmos).
  *
  */
 
 #include "../gizmo_geometry.h"
 #include "../gizmo_library_intern.h"
 
-typedef struct GrabManipulator3D {
-       wmManipulator manipulator;
+typedef struct GrabGizmo3D {
+       wmGizmo gizmo;
        /* Added to 'matrix_basis' when calculating the matrix. */
        float prop_co[3];
-} GrabManipulator3D;
+} GrabGizmo3D;
 
-static void manipulator_grab_matrix_basis_get(const wmManipulator *mpr, float r_matrix[4][4])
+static void gizmo_grab_matrix_basis_get(const wmGizmo *mpr, float r_matrix[4][4])
 {
-       GrabManipulator3D *grab = (GrabManipulator3D *)mpr;
+       GrabGizmo3D *grab = (GrabGizmo3D *)mpr;
 
-       copy_m4_m4(r_matrix, grab->manipulator.matrix_basis);
+       copy_m4_m4(r_matrix, grab->gizmo.matrix_basis);
        add_v3_v3(r_matrix[3], grab->prop_co);
 }
 
-static int manipulator_grab_modal(
-        bContext *C, wmManipulator *mpr, const wmEvent *event,
-        eWM_ManipulatorTweak tweak_flag);
+static int gizmo_grab_modal(
+        bContext *C, wmGizmo *mpr, const wmEvent *event,
+        eWM_GizmoFlagTweak tweak_flag);
 
 typedef struct GrabInteraction {
        float init_mval[2];
@@ -94,14 +94,14 @@ typedef struct GrabInteraction {
 /* -------------------------------------------------------------------- */
 
 static void grab_geom_draw(
-        const wmManipulator *mpr, const float color[4], const bool select, const int draw_options)
+        const wmGizmo *mpr, const float color[4], const bool select, const int draw_options)
 {
-#ifdef USE_MANIPULATOR_CUSTOM_DIAL
+#ifdef USE_GIZMO_CUSTOM_DIAL
        UNUSED_VARS(grab3d, col, axis_modal_mat);
-       wm_manipulator_geometryinfo_draw(&wm_manipulator_geom_data_grab3d, select);
+       wm_gizmo_geometryinfo_draw(&wm_gizmo_geom_data_grab3d, select);
 #else
        const int draw_style = RNA_enum_get(mpr->ptr, "draw_style");
-       const bool filled = (draw_options & ED_MANIPULATOR_GRAB_DRAW_FLAG_FILL) != 0;
+       const bool filled = (draw_options & ED_GIZMO_GRAB_DRAW_FLAG_FILL) != 0;
 
        GPU_line_width(mpr->line_width);
 
@@ -112,7 +112,7 @@ static void grab_geom_draw(
 
        immUniformColor4fv(color);
 
-       if (draw_style == ED_MANIPULATOR_GRAB_STYLE_RING_2D) {
+       if (draw_style == ED_GIZMO_GRAB_STYLE_RING_2D) {
                if (filled) {
                        imm_draw_circle_fill_2d(pos, 0, 0, 1.0f, DIAL_RESOLUTION);
                }
@@ -120,7 +120,7 @@ static void grab_geom_draw(
                        imm_draw_circle_wire_2d(pos, 0, 0, 1.0f, DIAL_RESOLUTION);
                }
        }
-       else if (draw_style == ED_MANIPULATOR_GRAB_STYLE_CROSS_2D) {
+       else if (draw_style == ED_GIZMO_GRAB_STYLE_CROSS_2D) {
                immBegin(GWN_PRIM_LINES, 4);
                immVertex2f(pos,  1.0f,  1.0f);
                immVertex2f(pos, -1.0f, -1.0f);
@@ -140,7 +140,7 @@ static void grab_geom_draw(
 }
 
 static void grab3d_get_translate(
-        const wmManipulator *mpr, const wmEvent *event, const ARegion *ar,
+        const wmGizmo *mpr, const wmEvent *event, const ARegion *ar,
         float co_delta[3])
 {
        GrabInteraction *inter = mpr->interaction_data;
@@ -163,18 +163,18 @@ static void grab3d_get_translate(
 }
 
 static void grab3d_draw_intern(
-        const bContext *C, wmManipulator *mpr,
+        const bContext *C, wmGizmo *mpr,
         const bool select, const bool highlight)
 {
        GrabInteraction *inter = mpr->interaction_data;
        const int draw_options = RNA_enum_get(mpr->ptr, "draw_options");
-       const bool align_view = (draw_options & ED_MANIPULATOR_GRAB_DRAW_FLAG_ALIGN_VIEW) != 0;
+       const bool align_view = (draw_options & ED_GIZMO_GRAB_DRAW_FLAG_ALIGN_VIEW) != 0;
        float color[4];
        float matrix_final[4][4];
        float matrix_align[4][4];
 
-       manipulator_color_get(mpr, highlight, color);
-       WM_manipulator_calc_matrix_final(mpr, matrix_final);
+       gizmo_color_get(mpr, highlight, color);
+       WM_gizmo_calc_matrix_final(mpr, matrix_final);
 
        gpuPushMatrix();
        gpuMultMatrix(matrix_final);
@@ -209,16 +209,16 @@ static void grab3d_draw_intern(
        }
 }
 
-static void manipulator_grab_draw_select(const bContext *C, wmManipulator *mpr, int select_id)
+static void gizmo_grab_draw_select(const bContext *C, wmGizmo *mpr, int select_id)
 {
        GPU_select_load_id(select_id);
        grab3d_draw_intern(C, mpr, true, false);
 }
 
-static void manipulator_grab_draw(const bContext *C, wmManipulator *mpr)
+static void gizmo_grab_draw(const bContext *C, wmGizmo *mpr)
 {
-       const bool is_modal = mpr->state & WM_MANIPULATOR_STATE_MODAL;
-       const bool is_highlight = (mpr->state & WM_MANIPULATOR_STATE_HIGHLIGHT) != 0;
+       const bool is_modal = mpr->state & WM_GIZMO_STATE_MODAL;
+       const bool is_highlight = (mpr->state & WM_GIZMO_STATE_HIGHLIGHT) != 0;
 
        (void)is_modal;
 
@@ -227,11 +227,11 @@ static void manipulator_grab_draw(const bContext *C, wmManipulator *mpr)
        GPU_blend(false);
 }
 
-static int manipulator_grab_modal(
-        bContext *C, wmManipulator *mpr, const wmEvent *event,
-        eWM_ManipulatorTweak UNUSED(tweak_flag))
+static int gizmo_grab_modal(
+        bContext *C, wmGizmo *mpr, const wmEvent *event,
+        eWM_GizmoFlagTweak UNUSED(tweak_flag))
 {
-       GrabManipulator3D *grab = (GrabManipulator3D *)mpr;
+       GrabGizmo3D *grab = (GrabGizmo3D *)mpr;
        GrabInteraction *inter = mpr->interaction_data;
        ARegion *ar = CTX_wm_region(C);
 
@@ -241,9 +241,9 @@ static int manipulator_grab_modal(
        }
        else {
                float mval_proj_init[2], mval_proj_curr[2];
-               if ((manipulator_window_project_2d(
+               if ((gizmo_window_project_2d(
                         C, mpr, inter->init_mval, 2, false, mval_proj_init) == false) ||
-                   (manipulator_window_project_2d(
+                   (gizmo_window_project_2d(
                         C, mpr, (const float[2]){UNPACK2(event->mval)}, 2, false, mval_proj_curr) == false))
                {
                        return OPERATOR_RUNNING_MODAL;
@@ -254,9 +254,9 @@ static int manipulator_grab_modal(
        add_v3_v3v3(grab->prop_co, inter->init_prop_co, prop_delta);
 
        /* set the property for the operator and call its modal function */
-       wmManipulatorProperty *mpr_prop = WM_manipulator_target_property_find(mpr, "offset");
-       if (WM_manipulator_target_property_is_valid(mpr_prop)) {
-               WM_manipulator_target_property_value_set_array(C, mpr, mpr_prop, grab->prop_co);
+       wmGizmoProperty *mpr_prop = WM_gizmo_target_property_find(mpr, "offset");
+       if (WM_gizmo_target_property_is_valid(mpr_prop)) {
+               WM_gizmo_target_property_value_set_array(C, mpr, mpr_prop, grab->prop_co);
        }
        else {
                zero_v3(grab->prop_co);
@@ -267,8 +267,8 @@ static int manipulator_grab_modal(
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int manipulator_grab_invoke(
-        bContext *UNUSED(C), wmManipulator *mpr, const wmEvent *event)
+static int gizmo_grab_invoke(
+        bContext *UNUSED(C), wmGizmo *mpr, const wmEvent *event)
 {
        GrabInteraction *inter = MEM_callocN(sizeof(GrabInteraction), __func__);
 
@@ -278,13 +278,13 @@ static int manipulator_grab_invoke(
 #if 0
        copy_v3_v3(inter->init_prop_co, grab->prop_co);
 #else
-       wmManipulatorProperty *mpr_prop = WM_manipulator_target_property_find(mpr, "offset");
-       if (WM_manipulator_target_property_is_valid(mpr_prop)) {
-               WM_manipulator_target_property_value_get_array(mpr, mpr_prop, inter->init_prop_co);
+       wmGizmoProperty *mpr_prop = WM_gizmo_target_property_find(mpr, "offset");
+       if (WM_gizmo_target_property_is_valid(mpr_prop)) {
+               WM_gizmo_target_property_value_get_array(mpr, mpr_prop, inter->init_prop_co);
        }
 #endif
 
-       WM_manipulator_calc_matrix_final(mpr, inter->init_matrix_final);
+       WM_gizmo_calc_matrix_final(mpr, inter->init_matrix_final);
 
        mpr->interaction_data = inter;
 
@@ -292,12 +292,12 @@ static int manipulator_grab_invoke(
 }
 
 
-static int manipulator_grab_test_select(
-        bContext *C, wmManipulator *mpr, const wmEvent *event)
+static int gizmo_grab_test_select(
+        bContext *C, wmGizmo *mpr, const wmEvent *event)
 {
        float point_local[2];
 
-       if (manipulator_window_project_2d(
+       if (gizmo_window_project_2d(
                C, mpr, (const float[2]){UNPACK2(event->mval)}, 2, true, point_local) == false)
        {
                return -1;
@@ -311,65 +311,65 @@ static int manipulator_grab_test_select(
        return -1;
 }
 
-static void manipulator_grab_property_update(wmManipulator *mpr, wmManipulatorProperty *mpr_prop)
+static void gizmo_grab_property_update(wmGizmo *mpr, wmGizmoProperty *mpr_prop)
 {
-       GrabManipulator3D *grab = (GrabManipulator3D *)mpr;
-       if (WM_manipulator_target_property_is_valid(mpr_prop)) {
-               WM_manipulator_target_property_value_get_array(mpr, mpr_prop, grab->prop_co);
+       GrabGizmo3D *grab = (GrabGizmo3D *)mpr;
+       if (WM_gizmo_target_property_is_valid(mpr_prop)) {
+               WM_gizmo_target_property_value_get_array(mpr, mpr_prop, grab->prop_co);
        }
        else {
                zero_v3(grab->prop_co);
        }
 }
 
-static int manipulator_grab_cursor_get(wmManipulator *UNUSED(mpr))
+static int gizmo_grab_cursor_get(wmGizmo *UNUSED(mpr))
 {
        return BC_NSEW_SCROLLCURSOR;
 }
 
 /* -------------------------------------------------------------------- */
-/** \name Grab Manipulator API
+/** \name Grab Gizmo API
  *
  * \{ */
 
-static void MANIPULATOR_WT_grab_3d(wmManipulatorType *wt)
+static void GIZMO_WT_grab_3d(wmGizmoType *wt)
 {
        /* identifiers */
-       wt->idname = "MANIPULATOR_WT_grab_3d";
+       wt->idname = "GIZMO_WT_grab_3d";
 
        /* api callbacks */
-       wt->draw = manipulator_grab_draw;
-       wt->draw_select = manipulator_grab_draw_select;
-       wt->test_select = manipulator_grab_test_select;
-       wt->matrix_basis_get = manipulator_grab_matrix_basis_get;
-       wt->invoke = manipulator_grab_invoke;
-       wt->property_update = manipulator_grab_property_update;
-       wt->modal = manipulator_grab_modal;
-       wt->cursor_get = manipulator_grab_cursor_get;
+       wt->draw = gizmo_grab_draw;
+       wt->draw_select = gizmo_grab_draw_select;
+       wt->test_select = gizmo_grab_test_select;
+       wt->matrix_basis_get = gizmo_grab_matrix_basis_get;
+       wt->invoke = gizmo_grab_invoke;
+       wt->property_update = gizmo_grab_property_update;
+       wt->modal = gizmo_grab_modal;
+       wt->cursor_get = gizmo_grab_cursor_get;
 
-       wt->struct_size = sizeof(GrabManipulator3D);
+       wt->struct_size = sizeof(GrabGizmo3D);
 
        /* rna */
        static EnumPropertyItem rna_enum_draw_style[] = {
-               {ED_MANIPULATOR_GRAB_STYLE_RING_2D, "RING_2D", 0, "Ring", ""},
-               {ED_MANIPULATOR_GRAB_STYLE_CROSS_2D, "CROSS_2D", 0, "Ring", ""},
+               {ED_GIZMO_GRAB_STYLE_RING_2D, "RING_2D", 0, "Ring", ""},
+               {ED_GIZMO_GRAB_STYLE_CROSS_2D, "CROSS_2D", 0, "Ring", ""},
                {0, NULL, 0, NULL, NULL}
        };
        static EnumPropertyItem rna_enum_draw_options[] = {
-               {ED_MANIPULATOR_GRAB_DRAW_FLAG_FILL, "FILL", 0, "Filled", ""},
-               {ED_MANIPULATOR_GRAB_DRAW_FLAG_ALIGN_VIEW, "ALIGN_VIEW", 0, "Align View", ""},
+               {ED_GIZMO_GRAB_DRAW_FLAG_FILL, "FILL", 0, "Filled", ""},
+               {ED_GIZMO_GRAB_DRAW_FLAG_ALIGN_VIEW, "ALIGN_VIEW", 0, "Align View", ""},
                {0, NULL, 0, NULL, NULL}
        };
 
-       RNA_def_enum(wt->srna, "draw_style", rna_enum_draw_style, ED_MANIPULATOR_GRAB_STYLE_RING_2D, "Draw Style", "");
+       RNA_def_enum(wt->srna, "draw_style", rna_enum_draw_style, ED_GIZMO_GRAB_STYLE_RING_2D, "Draw Style", "");
        RNA_def_enum_flag(wt->srna, "draw_options", rna_enum_draw_options, 0, "Draw Options", "");
 
-       WM_manipulatortype_target_property_def(wt, "offset", PROP_FLOAT, 3);
+       WM_gizmotype_target_property_def(wt, "offset", PROP_FLOAT, 3);
 }
 
-void ED_manipulatortypes_grab_3d(void)
+void ED_gizmotypes_grab_3d(void)
 {
-       WM_manipulatortype_append(MANIPULATOR_WT_grab_3d);
+       WM_gizmotype_append(GIZMO_WT_grab_3d);
 }
 
-/** \} */ // Grab Manipulator API
+/** \} */ // Grab Gizmo API
index 1331a4e983f1cadc7f036a36e5901ac9c15c8b82..ff02517dafa6eb6a1fd9affedc63a3e9925b99f0 100644 (file)
 /** \file primitive3d_gizmo.c
  *  \ingroup wm
  *
- * \name Primitive Manipulator
+ * \name Primitive Gizmo
  *
- * 3D Manipulator
+ * 3D Gizmo
  *
- * \brief Manipulator with primitive drawing type (plane, cube, etc.).
+ * \brief Gizmo with primitive drawing type (plane, cube, etc.).
  * Currently only plane primitive supported without own handling, use with operator only.
  */
 
@@ -65,13 +65,13 @@ static float verts_plane[4][3] = {
 
 /* -------------------------------------------------------------------- */
 
-static void manipulator_primitive_draw_geom(
+static void gizmo_primitive_draw_geom(
         const float col_inner[4], const float col_outer[4], const int draw_style)
 {
        float (*verts)[3];
        uint vert_count = 0;
 
-       if (draw_style == ED_MANIPULATOR_PRIMITIVE_STYLE_PLANE) {
+       if (draw_style == ED_GIZMO_PRIMITIVE_STYLE_PLANE) {
                verts = verts_plane;
                vert_count = ARRAY_SIZE(verts_plane);
        }
@@ -79,37 +79,37 @@ static void manipulator_primitive_draw_geom(
        if (vert_count > 0) {
                uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
                immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
-               wm_manipulator_vec_draw(col_inner, verts, vert_count, pos, GWN_PRIM_TRI_FAN);
-               wm_manipulator_vec_draw(col_outer, verts, vert_count, pos, GWN_PRIM_LINE_LOOP);
+               wm_gizmo_vec_draw(col_inner, verts, vert_count, pos, GWN_PRIM_TRI_FAN);
+               wm_gizmo_vec_draw(col_outer, verts, vert_count, pos, GWN_PRIM_LINE_LOOP);
                immUnbindProgram();
        }
 }
 
-static void manipulator_primitive_draw_intern(
-        wmManipulator *mpr, const bool UNUSED(select),
+static void gizmo_primitive_draw_intern(
+        wmGizmo *mpr, const bool UNUSED(select),
         const bool highlight)
 {
        float color_inner[4], color_outer[4];
        float matrix_final[4][4];
        const int draw_style = RNA_enum_get(mpr->ptr, "draw_style");
 
-       manipulator_color_get(mpr, highlight, color_outer);
+       gizmo_color_get(mpr, highlight, color_outer);
        copy_v4_v4(color_inner, color_outer);
        color_inner[3] *= 0.5f;
 
-       WM_manipulator_calc_matrix_final(mpr, matrix_final);
+       WM_gizmo_calc_matrix_final(mpr, matrix_final);
 
        gpuPushMatrix();
        gpuMultMatrix(matrix_final);
 
        GPU_blend(true);
-       manipulator_primitive_draw_geom(color_inner, color_outer, draw_style);
+       gizmo_primitive_draw_geom(color_inner, color_outer, draw_style);
        GPU_blend(false);
 
        gpuPopMatrix();
 
        if (mpr->interaction_data) {
-               ManipulatorInteraction *inter = mpr->interaction_data;
+               GizmoInteraction *inter = mpr->interaction_data;
 
                copy_v4_fl(color_inner, 0.5f);
                copy_v3_fl(color_outer, 0.5f);
@@ -119,39 +119,39 @@ static void manipulator_primitive_draw_intern(
                gpuMultMatrix(inter->init_matrix_final);
 
                GPU_blend(true);
-               manipulator_primitive_draw_geom(color_inner, color_outer, draw_style);
+               gizmo_primitive_draw_geom(color_inner, color_outer, draw_style);
                GPU_blend(false);
 
                gpuPopMatrix();
        }
 }
 
-static void manipulator_primitive_draw_select(
-        const bContext *UNUSED(C), wmManipulator *mpr,
+static void gizmo_primitive_draw_select(
+        const bContext *UNUSED(C), wmGizmo *mpr,
         int select_id)
 {
        GPU_select_load_id(select_id);
-       manipulator_primitive_draw_intern(mpr, true, false);
+       gizmo_primitive_draw_intern(mpr, true, false);
 }
 
-static void manipulator_primitive_draw(const bContext *UNUSED(C), wmManipulator *mpr)
+static void gizmo_primitive_draw(const bContext *UNUSED(C), wmGizmo *mpr)
 {
-       manipulator_primitive_draw_intern(
+       gizmo_primitive_draw_intern(
                mpr, false,
-               (mpr->state & WM_MANIPULATOR_STATE_HIGHLIGHT));
+               (mpr->state & WM_GIZMO_STATE_HIGHLIGHT));
 }
 
-static void manipulator_primitive_setup(wmManipulator *mpr)
+static void gizmo_primitive_setup(wmGizmo *mpr)
 {
-       mpr->flag |= WM_MANIPULATOR_DRAW_MODAL;
+       mpr->flag |= WM_GIZMO_DRAW_MODAL;
 }
 
-static int manipulator_primitive_invoke(
-        bContext *UNUSED(C), wmManipulator *mpr, const wmEvent *UNUSED(event))
+static int gizmo_primitive_invoke(
+        bContext *UNUSED(C), wmGizmo *mpr, const wmEvent *UNUSED(event))
 {
-       ManipulatorInteraction *inter = MEM_callocN(sizeof(ManipulatorInteraction), __func__);
+       GizmoInteraction *inter = MEM_callocN(sizeof(GizmoInteraction), __func__);
 
-       WM_manipulator_calc_matrix_final(mpr, inter->init_matrix_final);
+       WM_gizmo_calc_matrix_final(mpr, inter->init_matrix_final);
 
        mpr->interaction_data = inter;
 
@@ -159,33 +159,33 @@ static int manipulator_primitive_invoke(
 }
 
 /* -------------------------------------------------------------------- */
-/** \name Primitive Manipulator API
+/** \name Primitive Gizmo API
  *
  * \{ */
 
-static void MANIPULATOR_WT_primitive_3d(wmManipulatorType *wt)
+static void GIZMO_WT_primitive_3d(wmGizmoType *wt)
 {
        /* identifiers */
-       wt->idname = "MANIPULATOR_WT_primitive_3d";
+       wt->idname = "GIZMO_WT_primitive_3d";
 
        /* api callbacks */
-       wt->draw = manipulator_primitive_draw;
-       wt->draw_select = manipulator_primitive_draw_select;
-       wt->setup = manipulator_primitive_setup;
-       wt->invoke = manipulator_primitive_invoke;
+       wt->draw = gizmo_primitive_draw;
+       wt->draw_select = gizmo_primitive_draw_select;
+       wt->setup = gizmo_primitive_setup;
+       wt->invoke = gizmo_primitive_invoke;
 
-       wt->struct_size = sizeof(wmManipulator);
+       wt->struct_size = sizeof(wmGizmo);
 
        static EnumPropertyItem rna_enum_draw_style[] = {
-               {ED_MANIPULATOR_PRIMITIVE_STYLE_PLANE, "PLANE", 0, "Plane", ""},
+               {ED_GIZMO_PRIMITIVE_STYLE_PLANE, "PLANE", 0, "Plane", ""},
                {0, NULL, 0, NULL, NULL}
        };
-       RNA_def_enum(wt->srna, "draw_style", rna_enum_draw_style, ED_MANIPULATOR_PRIMITIVE_STYLE_PLANE, "Draw Style", "");
+       RNA_def_enum(wt->srna, "draw_style", rna_enum_draw_style, ED_GIZMO_PRIMITIVE_STYLE_PLANE, "Draw Style", "");
 }
 
-void ED_manipulatortypes_primitive_3d(void)
+void ED_gizmotypes_primitive_3d(void)
 {
-       WM_manipulatortype_append(MANIPULATOR_WT_primitive_3d);
+       WM_gizmotype_append(GIZMO_WT_primitive_3d);
 }
 
 /** \} */
index b33fbf47630cadbc17fb2f85d0a325a63490bd1d..39a58929b7cb47c7613aed71b28e7a8789f7f119 100644 (file)
 /** \file ED_gizmo_library.h
  *  \ingroup wm
  *
- * \name Generic Manipulators.
+ * \name Generic Gizmos.
  *
- * This is exposes pre-defined manipulators for re-use.
+ * This is exposes pre-defined gizmos for re-use.
  */
 
 
 #ifndef __ED_GIZMO_LIBRARY_H__
 #define __ED_GIZMO_LIBRARY_H__
 
-/* initialize manipulators */
-void ED_manipulatortypes_arrow_2d(void);
-void ED_manipulatortypes_arrow_3d(void);
-void ED_manipulatortypes_button_2d(void);
-void ED_manipulatortypes_cage_2d(void);
-void ED_manipulatortypes_cage_3d(void);
-void ED_manipulatortypes_dial_3d(void);
-void ED_manipulatortypes_grab_3d(void);
-void ED_manipulatortypes_facemap_3d(void);
-void ED_manipulatortypes_primitive_3d(void);
+/* initialize gizmos */
+void ED_gizmotypes_arrow_2d(void);
+void ED_gizmotypes_arrow_3d(void);
+void ED_gizmotypes_button_2d(void);
+void ED_gizmotypes_cage_2d(void);
+void ED_gizmotypes_cage_3d(void);
+void ED_gizmotypes_dial_3d(void);
+void ED_gizmotypes_grab_3d(void);
+void ED_gizmotypes_facemap_3d(void);
+void ED_gizmotypes_primitive_3d(void);
 
-struct wmManipulator;
-struct wmManipulatorGroup;
+struct wmGizmo;
+struct wmGizmoGroup;
 
 
 /* -------------------------------------------------------------------- */
@@ -51,172 +51,172 @@ struct wmManipulatorGroup;
  * Intended to be called by custom draw functions.
  */
 
-/* manipulator_library_presets.c */
-void ED_manipulator_draw_preset_box(
-        const struct wmManipulator *mpr, float mat[4][4], int select_id);
-void ED_manipulator_draw_preset_arrow(
-        const struct wmManipulator *mpr, float mat[4][4], int axis, int select_id);
-void ED_manipulator_draw_preset_circle(
-        const struct wmManipulator *mpr, float mat[4][4], int axis, int select_id);
-void ED_manipulator_draw_preset_facemap(
-        const struct bContext *C, const struct wmManipulator *mpr, struct Scene *scene,
+/* gizmo_library_presets.c */
+void ED_gizmo_draw_preset_box(
+        const struct wmGizmo *mpr, float mat[4][4], int select_id);
+void ED_gizmo_draw_preset_arrow(
+        const struct wmGizmo *mpr, float mat[4][4], int axis, int select_id);
+void ED_gizmo_draw_preset_circle(
+        const struct wmGizmo *mpr, float mat[4][4], int axis, int select_id);
+void ED_gizmo_draw_preset_facemap(
+        const struct bContext *C, const struct wmGizmo *mpr, struct Scene *scene,
         struct Object *ob,  const int facemap, int select_id);
 
 
 /* -------------------------------------------------------------------- */
-/* 3D Arrow Manipulator */
+/* 3D Arrow Gizmo */
 
 enum {
-       ED_MANIPULATOR_ARROW_STYLE_NORMAL        = 0,
-       ED_MANIPULATOR_ARROW_STYLE_CROSS         = 1,
-       ED_MANIPULATOR_ARROW_STYLE_BOX           = 2,
-       ED_MANIPULATOR_ARROW_STYLE_CONE          = 3,
+       ED_GIZMO_ARROW_STYLE_NORMAL        = 0,
+       ED_GIZMO_ARROW_STYLE_CROSS         = 1,
+       ED_GIZMO_ARROW_STYLE_BOX           = 2,
+       ED_GIZMO_ARROW_STYLE_CONE          = 3,
 };
 
 /* transform */
 enum {
        /* inverted offset during interaction - if set it also sets constrained below */
-       ED_MANIPULATOR_ARROW_XFORM_FLAG_INVERTED      = (1 << 3),
+       ED_GIZMO_ARROW_XFORM_FLAG_INVERTED      = (1 << 3),
        /* clamp arrow interaction to property width */
-       ED_MANIPULATOR_ARROW_XFORM_FLAG_CONSTRAINED   = (1 << 4),
+       ED_GIZMO_ARROW_XFORM_FLAG_CONSTRAINED   = (1 << 4),
 };
 
 /* draw_options */
 enum {
        /* Show arrow stem. */
-       ED_MANIPULATOR_ARROW_DRAW_FLAG_STEM      = (1 << 0),
+       ED_GIZMO_ARROW_DRAW_FLAG_STEM      = (1 << 0),
 };
 
-void ED_manipulator_arrow3d_set_ui_range(struct wmManipulator *mpr, const float min, const float max);
-void ED_manipulator_arrow3d_set_range_fac(struct wmManipulator *mpr, const float range_fac);
+void ED_gizmo_arrow3d_set_ui_range(struct wmGizmo *mpr, const float min, const float max);
+void ED_gizmo_arrow3d_set_range_fac(struct wmGizmo *mpr, const float range_fac);
 
 /* -------------------------------------------------------------------- */
-/* 2D Arrow Manipulator */
+/* 2D Arrow Gizmo */
 
 /* none */
 
 /* -------------------------------------------------------------------- */
-/* Cage Manipulator */
+/* Cage Gizmo */
 
 enum {
-       ED_MANIPULATOR_CAGE2D_XFORM_FLAG_TRANSLATE        = (1 << 0), /* Translates */
-       ED_MANIPULATOR_CAGE2D_XFORM_FLAG_ROTATE           = (1 << 1), /* Rotates */
-       ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE            = (1 << 2), /* Scales */
-       ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE_UNIFORM    = (1 << 3), /* Scales uniformly */
-       ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE_SIGNED     = (1 << 4), /* Negative scale allowed */
+       ED_GIZMO_CAGE2D_XFORM_FLAG_TRANSLATE        = (1 << 0), /* Translates */
+       ED_GIZMO_CAGE2D_XFORM_FLAG_ROTATE           = (1 << 1), /* Rotates */
+       ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE            = (1 << 2), /* Scales */
+       ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE_UNIFORM    = (1 << 3), /* Scales uniformly */
+       ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE_SIGNED     = (1 << 4), /* Negative scale allowed */
 };
 
 /* draw_style */
 enum {
-       ED_MANIPULATOR_CAGE2D_STYLE_BOX = 0,
-       ED_MANIPULATOR_CAGE2D_STYLE_CIRCLE = 1,
+       ED_GIZMO_CAGE2D_STYLE_BOX = 0,
+       ED_GIZMO_CAGE2D_STYLE_CIRCLE = 1,
 };
 
 /* draw_options */
 enum {
        /** Draw a central handle (instead of having the entire area selectable)
         * Needed for large rectangles that we don't want to swallow all events. */
-       ED_MANIPULATOR_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE = (1 << 0),
+       ED_GIZMO_CAGE2D_DRAW_FLAG_XFORM_CENTER_HANDLE = (1 << 0),
 };
 
-/** #wmManipulator.highlight_part */
+/** #wmGizmo.highlight_part */
 enum {
-       ED_MANIPULATOR_CAGE2D_PART_TRANSLATE     = 0,
-       ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X   = 1,
-       ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X   = 2,
-       ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_Y   = 3,
-       ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_Y   = 4,
+       ED_GIZMO_CAGE2D_PART_TRANSLATE     = 0,
+       ED_GIZMO_CAGE2D_PART_SCALE_MIN_X   = 1,
+       ED_GIZMO_CAGE2D_PART_SCALE_MAX_X   = 2,
+       ED_GIZMO_CAGE2D_PART_SCALE_MIN_Y   = 3,
+       ED_GIZMO_CAGE2D_PART_SCALE_MAX_Y   = 4,
        /* Corners */
-       ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X_MIN_Y = 5,
-       ED_MANIPULATOR_CAGE2D_PART_SCALE_MIN_X_MAX_Y = 6,
-       ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X_MIN_Y = 7,
-       ED_MANIPULATOR_CAGE2D_PART_SCALE_MAX_X_MAX_Y = 8,
+       ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MIN_Y = 5,
+       ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MAX_Y = 6,
+       ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MIN_Y = 7,
+       ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MAX_Y = 8,
 
-       ED_MANIPULATOR_CAGE2D_PART_ROTATE = 9,
+       ED_GIZMO_CAGE2D_PART_ROTATE = 9,
 };
 
-/** #wmManipulator.highlight_part */
+/** #wmGizmo.highlight_part */
 enum {
        /* ordered min/mid/max so we can loop over values (MIN/MID/MAX) on each axis. */
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MIN_Z = 0,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MID_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MAX_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MIN_X_MID_Y_MIN_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MIN_X_MID_Y_MID_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MIN_X_MID_Y_MAX_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MIN_X_MAX_Y_MIN_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MIN_X_MAX_Y_MID_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MIN_X_MAX_Y_MAX_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MID_X_MIN_Y_MIN_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MID_X_MIN_Y_MID_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MID_X_MIN_Y_MAX_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MID_X_MID_Y_MIN_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MID_X_MID_Y_MID_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MID_X_MID_Y_MAX_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MID_X_MAX_Y_MIN_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MID_X_MAX_Y_MID_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MID_X_MAX_Y_MAX_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MAX_X_MIN_Y_MIN_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MAX_X_MIN_Y_MID_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MAX_X_MIN_Y_MAX_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MAX_X_MID_Y_MIN_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MAX_X_MID_Y_MID_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MAX_X_MID_Y_MAX_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MIN_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MID_Z,
-       ED_MANIPULATOR_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MAX_Z,
-
-       ED_MANIPULATOR_CAGE3D_PART_TRANSLATE,
-
-       ED_MANIPULATOR_CAGE3D_PART_ROTATE,
+       ED_GIZMO_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MIN_Z = 0,
+       ED_GIZMO_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MID_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MAX_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MIN_X_MID_Y_MIN_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MIN_X_MID_Y_MID_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MIN_X_MID_Y_MAX_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MIN_X_MAX_Y_MIN_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MIN_X_MAX_Y_MID_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MIN_X_MAX_Y_MAX_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MID_X_MIN_Y_MIN_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MID_X_MIN_Y_MID_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MID_X_MIN_Y_MAX_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MID_X_MID_Y_MIN_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MID_X_MID_Y_MID_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MID_X_MID_Y_MAX_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MID_X_MAX_Y_MIN_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MID_X_MAX_Y_MID_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MID_X_MAX_Y_MAX_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MIN_Y_MIN_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MIN_Y_MID_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MIN_Y_MAX_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MID_Y_MIN_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MID_Y_MID_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MID_Y_MAX_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MIN_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MID_Z,
+       ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MAX_Z,
+
+       ED_GIZMO_CAGE3D_PART_TRANSLATE,
+
+       ED_GIZMO_CAGE3D_PART_ROTATE,
 };
 
 /* -------------------------------------------------------------------- */
-/* Dial Manipulator */
+/* Dial Gizmo */
 
 /* draw_options */
 enum {
-       ED_MANIPULATOR_DIAL_DRAW_FLAG_NOP               = 0,
-       ED_MANIPULATOR_DIAL_DRAW_FLAG_CLIP              = (1 << 0),
-       ED_MANIPULATOR_DIAL_DRAW_FLAG_FILL              = (1 << 1),
-       ED_MANIPULATOR_DIAL_DRAW_FLAG_ANGLE_MIRROR      = (1 << 2),
-       ED_MANIPULATOR_DIAL_DRAW_FLAG_ANGLE_START_Y     = (1 << 3),
+       ED_GIZMO_DIAL_DRAW_FLAG_NOP               = 0,
+       ED_GIZMO_DIAL_DRAW_FLAG_CLIP              = (1 << 0),
+       ED_GIZMO_DIAL_DRAW_FLAG_FILL              = (1 << 1),
+       ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_MIRROR      = (1 << 2),
+       ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_START_Y     = (1 << 3),
 };
 
 /* -------------------------------------------------------------------- */
-/* Grab Manipulator */
+/* Grab Gizmo */
 
 /* draw_options */
 enum {
-       ED_MANIPULATOR_GRAB_DRAW_FLAG_NOP               = 0,
+       ED_GIZMO_GRAB_DRAW_FLAG_NOP               = 0,
        /* only for solid shapes */
-       ED_MANIPULATOR_GRAB_DRAW_FLAG_FILL              = (1 << 0),
-       ED_MANIPULATOR_GRAB_DRAW_FLAG_ALIGN_VIEW        = (1 << 1),
+       ED_GIZMO_GRAB_DRAW_FLAG_FILL              = (1 << 0),
+       ED_GIZMO_GRAB_DRAW_FLAG_ALIGN_VIEW        = (1 << 1),
 };
 
 enum {
-       ED_MANIPULATOR_GRAB_STYLE_RING_2D = 0,
-       ED_MANIPULATOR_GRAB_STYLE_CROSS_2D = 1,
+       ED_GIZMO_GRAB_STYLE_RING_2D = 0,
+       ED_GIZMO_GRAB_STYLE_CROSS_2D = 1,
 };
 
 /* -------------------------------------------------------------------- */
-/* Button Manipulator */
+/* Button Gizmo */
 
 enum {
-       ED_MANIPULATOR_BUTTON_SHOW_OUTLINE = (1 << 0),
+       ED_GIZMO_BUTTON_SHOW_OUTLINE = (1 << 0),
        /**
         * Draw a line from the origin to the offset (similar to an arrow)
         * sometimes needed to show what the button edits.
         */
-       ED_MANIPULATOR_BUTTON_SHOW_HELPLINE = (1 << 1),
+       ED_GIZMO_BUTTON_SHOW_HELPLINE = (1 << 1),
 };
 
 
 /* -------------------------------------------------------------------- */
-/* Primitive Manipulator */
+/* Primitive Gizmo */
 
 enum {
-       ED_MANIPULATOR_PRIMITIVE_STYLE_PLANE = 0,
+       ED_GIZMO_PRIMITIVE_STYLE_PLANE = 0,
 };
 
 #endif  /* __ED_GIZMO_LIBRARY_H__ */
index 1e3c8995314b42b958790b575a6b3d7445aca0bf..80dea103f8c0b388c85e6454f2362ae5a9a9016f 100644 (file)
@@ -113,8 +113,8 @@ bool calculateTransformCenter(struct bContext *C, int centerMode, float cent3d[3
 struct TransInfo;
 struct Scene;
 struct Object;
-struct wmManipulatorGroup;
-struct wmManipulatorGroupType;
+struct wmGizmoGroup;
+struct wmGizmoGroupType;
 struct wmOperator;
 
 /* UNUSED */
@@ -157,15 +157,15 @@ int BIF_countTransformOrientation(const struct bContext *C);
 
 void Transform_Properties(struct wmOperatorType *ot, int flags);
 
-/* transform manipulators */
+/* transform gizmos */
 
-void TRANSFORM_WGT_manipulator(struct wmManipulatorGroupType *wgt);
-void VIEW3D_WGT_xform_cage(struct wmManipulatorGroupType *wgt);
+void TRANSFORM_WGT_gizmo(struct wmGizmoGroupType *wgt);
+void VIEW3D_WGT_xform_cage(struct wmGizmoGroupType *wgt);
 
-bool ED_widgetgroup_manipulator2d_poll(const struct bContext *C, struct wmManipulatorGroupType *wgt);
-void ED_widgetgroup_manipulator2d_setup(const struct bContext *C, struct wmManipulatorGroup *mgroup);
-void ED_widgetgroup_manipulator2d_refresh(const struct bContext *C, struct wmManipulatorGroup *mgroup);
-void ED_widgetgroup_manipulator2d_draw_prepare(const struct bContext *C, struct wmManipulatorGroup *mgroup);
+bool ED_widgetgroup_gizmo2d_poll(const struct bContext *C, struct wmGizmoGroupType *wgt);
+void ED_widgetgroup_gizmo2d_setup(const struct bContext *C, struct wmGizmoGroup *mgroup);
+void ED_widgetgroup_gizmo2d_refresh(const struct bContext *C, struct wmGizmoGroup *mgroup);
+void ED_widgetgroup_gizmo2d_draw_prepare(const struct bContext *C, struct wmGizmoGroup *mgroup);
 
 
 /* Snapping */
@@ -211,7 +211,7 @@ struct TransformCalcParams {
        /* Use 'Scene.orientation_type' when zero, otherwise subtract one and use. */
        ushort orientation_type;
 };
-int ED_transform_calc_manipulator_stats(
+int ED_transform_calc_gizmo_stats(
         const struct bContext *C,
         const struct TransformCalcParams *params,
         struct TransformBounds *tbounds);
index 251f2b92acd67eb3776c5d7b441db24ccd7d9cff..723dde640e442fc57c7ef02a5e4d333b313cae62 100644 (file)
@@ -73,7 +73,7 @@ struct bNodeSocket;
 struct wmDropBox;
 struct wmDrag;
 struct wmEvent;
-struct wmManipulator;
+struct wmGizmo;
 struct wmMsgBus;
 struct wmKeyMap;
 struct wmKeyMapItem;
@@ -1265,7 +1265,7 @@ void UI_butstore_unregister(uiButStore *bs_handle, uiBut **but_p);
 
 /* ui_interface_region_tooltip.c */
 struct ARegion *UI_tooltip_create_from_button(struct bContext *C, struct ARegion *butregion, uiBut *but);
-struct ARegion *UI_tooltip_create_from_manipulator(struct bContext *C, struct wmManipulator *mpr);
+struct ARegion *UI_tooltip_create_from_gizmo(struct bContext *C, struct wmGizmo *mpr);
 void UI_tooltip_free(struct bContext *C, struct bScreen *sc, struct ARegion *ar);
 
 /* How long before a tool-tip shows. */
index 5e6c346d9cf10d7d5d4537ea4c6aca979560d2fe..d2fbb881a0af3ebb5263f570507a86fdf1a6893d 100644 (file)
@@ -280,11 +280,11 @@ typedef enum ThemeColorID {
        TH_AXIS_Y,
        TH_AXIS_Z,
 
-       TH_MANIPULATOR_HI,
-       TH_MANIPULATOR_PRIMARY,
-       TH_MANIPULATOR_SECONDARY,
-       TH_MANIPULATOR_A,
-       TH_MANIPULATOR_B,
+       TH_GIZMO_HI,
+       TH_GIZMO_PRIMARY,
+       TH_GIZMO_SECONDARY,
+       TH_GIZMO_A,
+       TH_GIZMO_B,
 
        TH_LOW_GRAD,
        TH_HIGH_GRAD,
index ed83a715c7ecec528e9ecc0506a5903642f07ab3..fae547d460cf5cee004f84ef8e83c467bbebf8ad 100644 (file)
@@ -615,11 +615,11 @@ static uiTooltipData *ui_tooltip_data_from_button(bContext *C, uiBut *but)
        }
 }
 
-static uiTooltipData *ui_tooltip_data_from_manipulator(bContext *C, wmManipulator *mpr)
+static uiTooltipData *ui_tooltip_data_from_gizmo(bContext *C, wmGizmo *mpr)
 {
        uiTooltipData *data = MEM_callocN(sizeof(uiTooltipData), "uiTooltipData");
 
-       /* TODO(campbell): a way for manipulators to have their own descriptions (low priority). */
+       /* TODO(campbell): a way for gizmos to have their own descriptions (low priority). */
 
        /* Operator Actions */
        {
@@ -639,7 +639,7 @@ static uiTooltipData *ui_tooltip_data_from_manipulator(bContext *C, wmManipulato
                };
 
                for (int i = 0; i < ARRAY_SIZE(mpop_actions); i++) {
-                       wmManipulatorOpElem *mpop = (mpop_actions[i].part != -1) ? WM_manipulator_operator_get(mpr, mpop_actions[i].part) : NULL;
+                       wmGizmoOpElem *mpop = (mpop_actions[i].part != -1) ? WM_gizmo_operator_get(mpr, mpop_actions[i].part) : NULL;
                        if (mpop != NULL) {
                                /* Description */
                                const char *info = RNA_struct_ui_description(mpop->type->srna);
@@ -692,10 +692,10 @@ static uiTooltipData *ui_tooltip_data_from_manipulator(bContext *C, wmManipulato
 
        /* Property Actions */
        if (mpr->type->target_property_defs_len) {
-               wmManipulatorProperty *mpr_prop_array = WM_manipulator_target_property_array(mpr);
+               wmGizmoProperty *mpr_prop_array = WM_gizmo_target_property_array(mpr);
                for (int i = 0; i < mpr->type->target_property_defs_len; i++) {
                        /* TODO(campbell): function callback descriptions. */
-                       wmManipulatorProperty *mpr_prop = &mpr_prop_array[i];
+                       wmGizmoProperty *mpr_prop = &mpr_prop_array[i];
                        if (mpr_prop->prop != NULL) {
                                const char *info = RNA_property_ui_description(mpr_prop->prop);
                                if (info && info[0]) {
@@ -934,13 +934,13 @@ ARegion *UI_tooltip_create_from_button(bContext *C, ARegion *butregion, uiBut *b
        return ui_tooltip_create_with_data(C, data, init_position, aspect);
 }
 
-ARegion *UI_tooltip_create_from_manipulator(bContext *C, wmManipulator *mpr)
+ARegion *UI_tooltip_create_from_gizmo(bContext *C, wmGizmo *mpr)
 {
        wmWindow *win = CTX_wm_window(C);
        const float aspect = 1.0f;
        float init_position[2];
 
-       uiTooltipData *data = ui_tooltip_data_from_manipulator(C, mpr);
+       uiTooltipData *data = ui_tooltip_data_from_gizmo(C, mpr);
        if (data == NULL) {
                return NULL;
        }
index a2b1aa1f251547afe0df2ef16bb1c82d48fe84e0..47d664eaeb2f6af6a243b47b2d37f484c0db8ec6 100644 (file)
@@ -679,16 +679,16 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo
                                case TH_AXIS_Z:
                                        cp = btheme->tui.zaxis; break;
 
-                               case TH_MANIPULATOR_HI:
-                                       cp = btheme->tui.manipulator_hi; break;
-                               case TH_MANIPULATOR_PRIMARY:
-                                       cp = btheme->tui.manipulator_primary; break;
-                               case TH_MANIPULATOR_SECONDARY:
-                                       cp = btheme->tui.manipulator_secondary; break;
-                               case TH_MANIPULATOR_A:
-                                       cp = btheme->tui.manipulator_a; break;
-                               case TH_MANIPULATOR_B:
-                                       cp = btheme->tui.manipulator_b; break;
+                               case TH_GIZMO_HI:
+                                       cp = btheme->tui.gizmo_hi; break;
+                               case TH_GIZMO_PRIMARY:
+                                       cp = btheme->tui.gizmo_primary; break;
+                               case TH_GIZMO_SECONDARY:
+                                       cp = btheme->tui.gizmo_secondary; break;
+                               case TH_GIZMO_A:
+                                       cp = btheme->tui.gizmo_a; break;
+                               case TH_GIZMO_B:
+                                       cp = btheme->tui.gizmo_b; break;
 
                                case TH_INFO_SELECTED:
                                        cp = ts->info_selected;
@@ -1338,9 +1338,9 @@ void init_userdef_do_versions(Main *bmain)
                U.savetime = 1;
 // XXX         error(STRINGIFY(BLENDER_STARTUP_FILE)" is buggy, please consider removing it.\n");
        }
-       if (U.manipulator_size == 0) {
-               U.manipulator_size = 75;
-               U.manipulator_flag |= USER_MANIPULATOR_DRAW;
+       if (U.gizmo_size == 0) {
+               U.gizmo_size = 75;
+               U.gizmo_flag |= USER_GIZMO_DRAW;
        }
        if (U.pad_rot_angle == 0.0f)
                U.pad_rot_angle = 15.0f;
@@ -1383,7 +1383,7 @@ void init_userdef_do_versions(Main *bmain)
                if (U.rvisize == 0) {
                        U.rvisize = 15;
                        U.rvibright = 8;
-                       U.uiflag |= USER_SHOW_MANIPULATOR_AXIS;
+                       U.uiflag |= USER_SHOW_GIZMO_AXIS;
                }
 
        }
index 3918d8847a6388ae9c062a32d16e488b13fe1e0d..be5c01e08dfec6007667b3eb51141d736c33de34 100644 (file)
@@ -21,7 +21,7 @@
 /** \file blender/editors/mesh/editmesh_add_gizmo.c
  *  \ingroup edmesh
  *
- * Creation manipulators.
+ * Creation gizmos.
  */
 
 #include "MEM_guardedalloc.h"
@@ -123,24 +123,24 @@ static void calc_initial_placement_point_from_view(
 /** \} */
 
 /* -------------------------------------------------------------------- */
-/** \name Placement Manipulator
+/** \name Placement Gizmo
  * \{ */
 
-typedef struct ManipulatorPlacementGroup {
-       struct wmManipulator *cage;
+typedef struct GizmoPlacementGroup {
+       struct wmGizmo *cage;
        struct {
                bContext *context;
                wmOperator *op;
                PropertyRNA *prop_matrix;
        } data;
-} ManipulatorPlacementGroup;
+} GizmoPlacementGroup;
 
 /**
  * \warning Calling redo from property updates is not great.
  * This is needed because changing the RNA doesn't cause a redo
  * and we're not using operator UI which does just this.
  */
-static void manipulator_placement_exec(ManipulatorPlacementGroup *man)
+static void gizmo_placement_exec(GizmoPlacementGroup *man)
 {
        wmOperator *op = man->data.op;
        if (op == WM_operator_last_redo((bContext *)man->data.context)) {
@@ -148,7 +148,7 @@ static void manipulator_placement_exec(ManipulatorPlacementGroup *man)
        }
 }
 
-static void manipulator_mesh_placement_update_from_op(ManipulatorPlacementGroup *man)
+static void gizmo_mesh_placement_update_from_op(GizmoPlacementGroup *man)
 {
        wmOperator *op = man->data.op;
        UNUSED_VARS(op);
@@ -159,11 +159,11 @@ static void manipulator_mesh_placement_update_from_op(ManipulatorPlacementGroup
 }
 
 /* translate callbacks */
-static void manipulator_placement_prop_matrix_get(
-        const wmManipulator *mpr, wmManipulatorProperty *mpr_prop,
+static void gizmo_placement_prop_matrix_get(
+        const wmGizmo *mpr, wmGizmoProperty *mpr_prop,
         void *value_p)
 {
-       ManipulatorPlacementGroup *man = mpr->parent_mgroup->customdata;
+       GizmoPlacementGroup *man = mpr->parent_mgroup->customdata;
        wmOperator *op = man->data.op;
        float *value = value_p;
        BLI_assert(mpr_prop->type->array_length == 16);
@@ -175,11 +175,11 @@ static void manipulator_placement_prop_matrix_get(
        }
 }
 
-static void manipulator_placement_prop_matrix_set(
-        const wmManipulator *mpr, wmManipulatorProperty *mpr_prop,
+static void gizmo_placement_prop_matrix_set(
+        const wmGizmo *mpr, wmGizmoProperty *mpr_prop,
         const void *value)
 {
-       ManipulatorPlacementGroup *man = mpr->parent_mgroup->customdata;
+       GizmoPlacementGroup *man = mpr->parent_mgroup->customdata;
        wmOperator *op = man->data.op;
 
        BLI_assert(mpr_prop->type->array_length == 16);
@@ -194,30 +194,30 @@ static void manipulator_placement_prop_matrix_set(
 
        RNA_property_float_set_array(op->ptr, man->data.prop_matrix, &mat[0][0]);
 
-       manipulator_placement_exec(man);
+       gizmo_placement_exec(man);
 }
 
-static bool manipulator_mesh_placement_poll(const bContext *C, wmManipulatorGroupType *wgt)
+static bool gizmo_mesh_placement_poll(const bContext *C, wmGizmoGroupType *wgt)
 {
        wmOperator *op = WM_operator_last_redo(C);
-       if (op == NULL || !STREQ(op->type->idname, "MESH_OT_primitive_cube_add_manipulator")) {
-               WM_manipulator_group_type_unlink_delayed_ptr(wgt);
+       if (op == NULL || !STREQ(op->type->idname, "MESH_OT_primitive_cube_add_gizmo")) {
+               WM_gizmo_group_type_unlink_delayed_ptr(wgt);
                return false;
        }
        return true;
 }
 
-static void manipulator_mesh_placement_modal_from_setup(
-        const bContext *C, wmManipulatorGroup *mgroup)
+static void gizmo_mesh_placement_modal_from_setup(
+        const bContext *C, wmGizmoGroup *mgroup)
 {
-       ManipulatorPlacementGroup *man = mgroup->customdata;
+       GizmoPlacementGroup *man = mgroup->customdata;
 
        /* Initial size. */
        {
-               wmManipulator *mpr = man->cage;
+               wmGizmo *mpr = man->cage;
                zero_m4(mpr->matrix_offset);
 
-               /* TODO: support zero scaled matrix in 'MANIPULATOR_WT_cage_3d'. */
+               /* TODO: support zero scaled matrix in 'GIZMO_WT_cage_3d'. */
                mpr->matrix_offset[0][0] = 0.01;
                mpr->matrix_offset[1][1] = 0.01;
                mpr->matrix_offset[2][2] = 0.01;
@@ -228,7 +228,7 @@ static void manipulator_mesh_placement_modal_from_setup(
        {
                wmWindow *win = CTX_wm_window(C);
                ARegion *ar = CTX_wm_region(C);
-               wmManipulator *mpr = man->cage;
+               wmGizmo *mpr = man->cage;
 
                {
                        float mat3[3][3];
@@ -244,87 +244,87 @@ static void manipulator_mesh_placement_modal_from_setup(
                }
 
                if (1) {
-                       wmManipulatorMap *mmap = mgroup->parent_mmap;
-                       WM_manipulator_modal_set_from_setup(
-                               mmap, (bContext *)C, man->cage, ED_MANIPULATOR_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MAX_Z, win->eventstate);
+                       wmGizmoMap *mmap = mgroup->parent_mmap;
+                       WM_gizmo_modal_set_from_setup(
+                               mmap, (bContext *)C, man->cage, ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MAX_Z, win->eventstate);
                }
        }
 }
 
-static void manipulator_mesh_placement_setup(const bContext *C, wmManipulatorGroup *mgroup)
+static void gizmo_mesh_placement_setup(const bContext *C, wmGizmoGroup *mgroup)
 {
        wmOperator *op = WM_operator_last_redo(C);
 
-       if (op == NULL || !STREQ(op->type->idname, "MESH_OT_primitive_cube_add_manipulator")) {
+       if (op == NULL || !STREQ(op->type->idname, "MESH_OT_primitive_cube_add_gizmo")) {
                return;
        }
 
-       struct ManipulatorPlacementGroup *man = MEM_callocN(sizeof(ManipulatorPlacementGroup), __func__);
+       struct GizmoPlacementGroup *man = MEM_callocN(sizeof(GizmoPlacementGroup), __func__);
        mgroup->customdata = man;
 
-       const wmManipulatorType *wt_cage = WM_manipulatortype_find("MANIPULATOR_WT_cage_3d", true);
+       const wmGizmoType *wt_cage = WM_gizmotype_find("GIZMO_WT_cage_3d", true);
 
-       man->cage = WM_manipulator_new_ptr(wt_cage, mgroup, NULL);
+       man->cage = WM_gizmo_new_ptr(wt_cage, mgroup, NULL);
 
-       UI_GetThemeColor3fv(TH_MANIPULATOR_PRIMARY, man->cage->color);
+       UI_GetThemeColor3fv(TH_GIZMO_PRIMARY, man->cage->color);
 
        RNA_enum_set(man->cage->ptr, "transform",
-                    ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE |
-                    ED_MANIPULATOR_CAGE2D_XFORM_FLAG_TRANSLATE |
-                    ED_MANIPULATOR_CAGE2D_XFORM_FLAG_SCALE_SIGNED);
+                    ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE |
+                    ED_GIZMO_CAGE2D_XFORM_FLAG_TRANSLATE |
+                    ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE_SIGNED);
 
-       WM_manipulator_set_flag(man->cage, WM_MANIPULATOR_DRAW_VALUE, true);
+       WM_gizmo_set_flag(man->cage, WM_GIZMO_DRAW_VALUE, true);
 
        man->data.context = (bContext *)C;
        man->data.op = op;
        man->data.prop_matrix = RNA_struct_find_property(op->ptr, "matrix");
 
-       manipulator_mesh_placement_update_from_op(man);
+       gizmo_mesh_placement_update_from_op(man);
 
        /* Setup property callbacks */
        {
-               WM_manipulator_target_property_def_func(
+               WM_gizmo_target_property_def_func(
                        man->cage, "matrix",
-                       &(const struct wmManipulatorPropertyFnParams) {
-                           .value_get_fn = manipulator_placement_prop_matrix_get,
-                           .value_set_fn = manipulator_placement_prop_matrix_set,
+                       &(const struct wmGizmoPropertyFnParams) {
+                           .value_get_fn = gizmo_placement_prop_matrix_get,
+                           .value_set_fn = gizmo_placement_prop_matrix_set,
                            .range_get_fn = NULL,
                            .user_data = NULL,
                        });
        }
 
-       manipulator_mesh_placement_modal_from_setup(C, mgroup);
+       gizmo_mesh_placement_modal_from_setup(C, mgroup);
 }
 
-static void manipulator_mesh_placement_draw_prepare(
-        const bContext *UNUSED(C), wmManipulatorGroup *mgroup)
+static void gizmo_mesh_placement_draw_prepare(
+        const bContext *UNUSED(C), wmGizmoGroup *mgroup)
 {
-       ManipulatorPlacementGroup *man = mgroup->customdata;
+       GizmoPlacementGroup *man = mgroup->customdata;
        if (man->data.op->next) {
                man->data.op = WM_operator_last_redo((bContext *)man->data.context);
        }
-       manipulator_mesh_placement_update_from_op(man);
+       gizmo_mesh_placement_update_from_op(man);
 }
 
-static void MESH_WGT_add_bounds(struct wmManipulatorGroupType *wgt)
+static void MESH_WGT_add_bounds(struct wmGizmoGroupType *wgt)
 {
        wgt->name = "Mesh Add Bounds";
        wgt->idname = "MESH_WGT_add_bounds";
 
-       wgt->flag = WM_MANIPULATORGROUPTYPE_3D;
+       wgt->flag = WM_GIZMOGROUPTYPE_3D;
 
        wgt->mmap_params.spaceid = SPACE_VIEW3D;
        wgt->mmap_params.regionid = RGN_TYPE_WINDOW;
 
-       wgt->poll = manipulator_mesh_placement_poll;
-       wgt->setup = manipulator_mesh_placement_setup;
-       wgt->draw_prepare = manipulator_mesh_placement_draw_prepare;
+       wgt->poll = gizmo_mesh_placement_poll;
+       wgt->setup = gizmo_mesh_placement_setup;
+       wgt->draw_prepare = gizmo_mesh_placement_draw_prepare;
 }
 
 /** \} */
 
 /* -------------------------------------------------------------------- */
-/** \name Add Cube Manipulator-Operator
+/** \name Add Cube Gizmo-Operator
  *
  * For now we use a separate operator to add a cube,
  * we can try to merge then however they are invoked differently
@@ -332,13 +332,13 @@ static void MESH_WGT_add_bounds(struct wmManipulatorGroupType *wgt)
  * \{ */
 
 
-static int add_primitive_cube_manipulator_exec(bContext *C, wmOperator *op)
+static int add_primitive_cube_gizmo_exec(bContext *C, wmOperator *op)
 {
        Object *obedit = CTX_data_edit_object(C);;
        BMEditMesh *em = BKE_editmesh_from_object(obedit);
        float matrix[4][4];
 
-       /* Get the matrix that defines the cube bounds (as set by the manipulator cage). */
+       /* Get the matrix that defines the cube bounds (as set by the gizmo cage). */
        {
                PropertyRNA *prop_matrix = RNA_struct_find_property(op->ptr, "matrix");
                if (RNA_property_is_set(op->ptr, prop_matrix)) {
@@ -372,25 +372,25 @@ static int add_primitive_cube_manipulator_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
 
-static int add_primitive_cube_manipulator_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
+static int add_primitive_cube_gizmo_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 {
        View3D *v3d = CTX_wm_view3d(C);
 
-       int ret = add_primitive_cube_manipulator_exec(C, op);
+       int ret = add_primitive_cube_gizmo_exec(C, op);
        if (ret & OPERATOR_FINISHED) {
-               /* Setup manipulators */
-               if (v3d && ((v3d->mpr_flag & V3D_MANIPULATOR_HIDE) == 0)) {
+               /* Setup gizmos */
+               if (v3d && ((v3d->mpr_flag & V3D_GIZMO_HIDE) == 0)) {
                        ARegion *ar = CTX_wm_region(C);
-                       wmManipulatorMap *mmap = ar->manipulator_map;
-                       wmManipulatorGroupType *wgt = WM_manipulatorgrouptype_find("MESH_WGT_add_bounds", false);
-                       wmManipulatorGroup *mgroup = WM_manipulatormap_group_find_ptr(mmap, wgt);
+                       wmGizmoMap *mmap = ar->gizmo_map;
+                       wmGizmoGroupType *wgt = WM_gizmogrouptype_find("MESH_WGT_add_bounds", false);
+                       wmGizmoGroup *mgroup = WM_gizmomap_group_find_ptr(mmap, wgt);
                        if (mgroup != NULL) {
-                               ManipulatorPlacementGroup *man = mgroup->customdata;
+                               GizmoPlacementGroup *man = mgroup->customdata;
                                man->data.op = op;
-                               manipulator_mesh_placement_modal_from_setup(C, mgroup);
+                               gizmo_mesh_placement_modal_from_setup(C, mgroup);
                        }
                        else {
-                               WM_manipulator_group_type_ensure_ptr(wgt);
+                               WM_gizmo_group_type_ensure_ptr(wgt);
                        }
                }
        }
@@ -398,16 +398,16 @@ static int add_primitive_cube_manipulator_invoke(bContext *C, wmOperator *op, co
        return ret;
 }
 
-void MESH_OT_primitive_cube_add_manipulator(wmOperatorType *ot)
+void MESH_OT_primitive_cube_add_gizmo(wmOperatorType *ot)
 {
        /* identifiers */
        ot->name = "Add Cube";
        ot->description = "Construct a cube mesh";
-       ot->idname = "MESH_OT_primitive_cube_add_manipulator";
+       ot->idname = "MESH_OT_primitive_cube_add_gizmo";
 
        /* api callbacks */
-       ot->invoke = add_primitive_cube_manipulator_invoke;
-       ot->exec = add_primitive_cube_manipulator_exec;
+       ot->invoke = add_primitive_cube_gizmo_invoke;
+       ot->exec = add_primitive_cube_gizmo_exec;
        ot->poll = ED_operator_editmesh_view3d;
 
        /* flags */
@@ -420,7 +420,7 @@ void MESH_OT_primitive_cube_add_manipulator(wmOperatorType *ot)
        PropertyRNA *prop = RNA_def_float_matrix(ot->srna, "matrix", 4, 4, NULL, 0.0f, 0.0f, "Matrix", "", 0.0f, 0.0f);
        RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
 
-       WM_manipulatorgrouptype_append(MESH_WGT_add_bounds);
+       WM_gizmogrouptype_append(MESH_WGT_add_bounds);
 }
 
 /** \} */
index 58246a60362f583a87f929a3048c5f6457059415..b73ce4106269a42b763689ff7b2771e9cda62e3d 100644 (file)
@@ -202,7 +202,7 @@ static bool edbm_bevel_init(bContext *C, wmOperator *op, const bool is_modal)
 
                if (v3d) {
                        opdata->mpr_flag = v3d->mpr_flag;
-                       v3d->mpr_flag = V3D_MANIPULATOR_HIDE;
+                       v3d->mpr_flag = V3D_GIZMO_HIDE;
                }
        }
 
index 87a65924979e21f460525d39d711877198cce80d..a9e11b7b411bee9ead5c12108ef85cc5b9675900 100644 (file)
@@ -54,9 +54,9 @@
 
 #include "mesh_intern.h"  /* own include */
 
-#define USE_MANIPULATOR
+#define USE_GIZMO
 
-#ifdef USE_MANIPULATOR
+#ifdef USE_GIZMO
 #include "ED_gizmo_library.h"
 #include "ED_undo.h"
 #endif
@@ -157,7 +157,7 @@ static int mesh_bisect_invoke(bContext *C, wmOperator *op, const wmEvent *event)
                /* misc other vars */
                G.moving = G_TRANSFORM_EDIT;
                opdata->mpr_flag = v3d->mpr_flag;
-               v3d->mpr_flag = V3D_MANIPULATOR_HIDE;
+               v3d->mpr_flag = V3D_GIZMO_HIDE;
 
                /* initialize modal callout */
                ED_workspace_status_text(C, IFACE_("LMB: Click and drag to draw cut line"));
@@ -195,12 +195,12 @@ static int mesh_bisect_modal(bContext *C, wmOperator *op, const wmEvent *event)
        if (ret & (OPERATOR_FINISHED | OPERATOR_CANCELLED)) {
                edbm_bisect_exit(C, &opdata_back);
 
-#ifdef USE_MANIPULATOR
-               /* Setup manipulators */
+#ifdef USE_GIZMO
+               /* Setup gizmos */
                {
                        View3D *v3d = CTX_wm_view3d(C);
-                       if (v3d && (v3d->mpr_flag & V3D_MANIPULATOR_HIDE) == 0) {
-                               WM_manipulator_group_type_ensure("MESH_WGT_bisect");
+                       if (v3d && (v3d->mpr_flag & V3D_GIZMO_HIDE) == 0) {
+                               WM_gizmo_group_type_ensure("MESH_WGT_bisect");
                        }
                }
 #endif
@@ -333,8 +333,8 @@ static int mesh_bisect_exec(bContext *C, wmOperator *op)
        }
 }
 
-#ifdef USE_MANIPULATOR
-static void MESH_WGT_bisect(struct wmManipulatorGroupType *wgt);
+#ifdef USE_GIZMO
+static void MESH_WGT_bisect(struct wmGizmoGroupType *wgt);
 #endif
 
 void MESH_OT_bisect(struct wmOperatorType *ot)
@@ -373,26 +373,26 @@ void MESH_OT_bisect(struct wmOperatorType *ot)
 
        WM_operator_properties_gesture_straightline(ot, CURSOR_EDIT);
 
-#ifdef USE_MANIPULATOR
-       WM_manipulatorgrouptype_append(MESH_WGT_bisect);
+#ifdef USE_GIZMO
+       WM_gizmogrouptype_append(MESH_WGT_bisect);
 #endif
 }
 
 
-#ifdef USE_MANIPULATOR
+#ifdef USE_GIZMO
 
 /* -------------------------------------------------------------------- */
 
-/** \name Bisect Manipulator
+/** \name Bisect Gizmo
  * \{ */
 
-typedef struct ManipulatorGroup {
+typedef struct GizmoGroup {
        /* Arrow to change plane depth. */
-       struct wmManipulator *translate_z;
+       struct wmGizmo *translate_z;
        /* Translate XYZ */
-       struct wmManipulator *translate_c;
-       /* For grabbing the manipulator and moving freely. */
-       struct wmManipulator *rotate_c;
+       struct wmGizmo *translate_c;
+       /* For grabbing the gizmo and moving freely. */
+       struct wmGizmo *rotate_c;
 
        /* We could store more vars here! */
        struct {
@@ -404,14 +404,14 @@ typedef struct ManipulatorGroup {
                float rotate_axis[3];
                float rotate_up[3];
        } data;
-} ManipulatorGroup;
+} GizmoGroup;
 
 /**
  * XXX. calling redo from property updates is not great.
  * This is needed because changing the RNA doesn't cause a redo
  * and we're not using operator UI which does just this.
  */
-static void manipulator_bisect_exec(ManipulatorGroup *man)
+static void gizmo_bisect_exec(GizmoGroup *man)
 {
        wmOperator *op = man->data.op;
        if (op == WM_operator_last_redo((bContext *)man->data.context)) {
@@ -419,7 +419,7 @@ static void manipulator_bisect_exec(ManipulatorGroup *man)
        }
 }
 
-static void manipulator_mesh_bisect_update_from_op(ManipulatorGroup *man)
+static void gizmo_mesh_bisect_update_from_op(GizmoGroup *man)
 {
        wmOperator *op = man->data.op;
 
@@ -428,13 +428,13 @@ static void manipulator_mesh_bisect_update_from_op(ManipulatorGroup *man)
        RNA_property_float_get_array(op->ptr, man->data.prop_plane_co, plane_co);
        RNA_property_float_get_array(op->ptr, man->data.prop_plane_no, plane_no);
 
-       WM_manipulator_set_matrix_location(man->translate_z, plane_co);
-       WM_manipulator_set_matrix_location(man->rotate_c, plane_co);
+       WM_gizmo_set_matrix_location(man->translate_z, plane_co);
+       WM_gizmo_set_matrix_location(man->rotate_c, plane_co);
        /* translate_c location comes from the property. */
 
-       WM_manipulator_set_matrix_rotation_from_z_axis(man->translate_z, plane_no);
+       WM_gizmo_set_matrix_rotation_from_z_axis(man->translate_z, plane_no);
 
-       WM_manipulator_set_scale(man->translate_c, 0.2);
+       WM_gizmo_set_scale(man->translate_c, 0.2);
 
        RegionView3D *rv3d = ED_view3d_context_rv3d(man->data.context);
        if (rv3d) {
@@ -445,24 +445,24 @@ static void manipulator_mesh_bisect_update_from_op(ManipulatorGroup *man)
                project_plane_normalized_v3_v3v3(man->data.rotate_up, man->data.rotate_up, man->data.rotate_axis);
                normalize_v3(man->data.rotate_up);
 
-               WM_manipulator_set_matrix_rotation_from_z_axis(man->translate_c, plane_no);
+               WM_gizmo_set_matrix_rotation_from_z_axis(man->translate_c, plane_no);
 
                float plane_no_cross[3];
                cross_v3_v3v3(plane_no_cross, plane_no, man->data.rotate_axis);
 
-               WM_manipulator_set_matrix_offset_rotation_from_yz_axis(man->rotate_c, plane_no_cross, man->data.rotate_axis);
+               WM_gizmo_set_matrix_offset_rotation_from_yz_axis(man->rotate_c, plane_no_cross, man->data.rotate_axis);
                RNA_enum_set(man->rotate_c->ptr, "draw_options",
-                            ED_MANIPULATOR_DIAL_DRAW_FLAG_ANGLE_MIRROR |
-                            ED_MANIPULATOR_DIAL_DRAW_FLAG_ANGLE_START_Y);
+                            ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_MIRROR |
+                            ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_START_Y);
        }
 }
 
 /* depth callbacks */
-static void manipulator_bisect_prop_depth_get(
-        const wmManipulator *mpr, wmManipulatorProperty *mpr_prop,
+static void gizmo_bisect_prop_depth_get(
+        const wmGizmo *mpr, wmGizmoProperty *mpr_prop,
         void *value_p)
 {
-       ManipulatorGroup *man = mpr->parent_mgroup->customdata;
+       GizmoGroup *man = mpr->parent_mgroup->customdata;
        wmOperator *op = man->data.op;
        float *value = value_p;
 
@@ -476,11 +476,11 @@ static void manipulator_bisect_prop_depth_get(
        value[0] = dot_v3v3(plane_no, plane_co) - dot_v3v3(plane_no, mpr->matrix_basis[3]);
 }
 
-static void manipulator_bisect_prop_depth_set(
-        const wmManipulator *mpr, wmManipulatorProperty *mpr_prop,
+static void gizmo_bisect_prop_depth_set(
+        const wmGizmo *mpr, wmGizmoProperty *mpr_prop,
         const void *value_p)
 {
-       ManipulatorGroup *man = mpr->parent_mgroup->customdata;
+       GizmoGroup *man = mpr->parent_mgroup->customdata;
        wmOperator *op = man->data.op;
        const float *value = value_p;
 
@@ -499,15 +499,15 @@ static void manipulator_bisect_prop_depth_set(
 
        RNA_property_float_set_array(op->ptr, man->data.prop_plane_co, plane_co);
 
-       manipulator_bisect_exec(man);
+       gizmo_bisect_exec(man);
 }
 
 /* translate callbacks */
-static void manipulator_bisect_prop_translate_get(
-        const wmManipulator *mpr, wmManipulatorProperty *mpr_prop,
+static void gizmo_bisect_prop_translate_get(
+        const wmGizmo *mpr, wmGizmoProperty *mpr_prop,
         void *value_p)
 {
-       ManipulatorGroup *man = mpr->parent_mgroup->customdata;
+       GizmoGroup *man = mpr->parent_mgroup->customdata;
        wmOperator *op = man->data.op;
 
        BLI_assert(mpr_prop->type->array_length == 3);
@@ -516,11 +516,11 @@ static void manipulator_bisect_prop_translate_get(
        RNA_property_float_get_array(op->ptr, man->data.prop_plane_co, value_p);
 }
 
-static void manipulator_bisect_prop_translate_set(
-        const wmManipulator *mpr, wmManipulatorProperty *mpr_prop,
+static void gizmo_bisect_prop_translate_set(
+        const wmGizmo *mpr, wmGizmoProperty *mpr_prop,
         const void *value_p)
 {
-       ManipulatorGroup *man = mpr->parent_mgroup->customdata;
+       GizmoGroup *man = mpr->parent_mgroup->customdata;
        wmOperator *op = man->data.op;
 
        BLI_assert(mpr_prop->type->array_length == 3);
@@ -528,15 +528,15 @@ static void manipulator_bisect_prop_translate_set(
 
        RNA_property_float_set_array(op->ptr, man->data.prop_plane_co, value_p);
 
-       manipulator_bisect_exec(man);
+       gizmo_bisect_exec(man);
 }
 
 /* angle callbacks */
-static void manipulator_bisect_prop_angle_get(
-        const wmManipulator *mpr, wmManipulatorProperty *mpr_prop,
+static void gizmo_bisect_prop_angle_get(
+        const wmGizmo *mpr, wmGizmoProperty *mpr_prop,
         void *value_p)
 {
-       ManipulatorGroup *man = mpr->parent_mgroup->customdata;
+       GizmoGroup *man = mpr->parent_mgroup->customdata;
        wmOperator *op = man->data.op;
        float *value = value_p;
 
@@ -559,11 +559,11 @@ static void manipulator_bisect_prop_angle_get(
        }
 }
 
-static void manipulator_bisect_prop_angle_set(
-        const wmManipulator *mpr, wmManipulatorProperty *mpr_prop,
+static void gizmo_bisect_prop_angle_set(
+        const wmGizmo *mpr, wmGizmoProperty *mpr_prop,
         const void *value_p)
 {
-       ManipulatorGroup *man = mpr->parent_mgroup->customdata;
+       GizmoGroup *man = mpr->parent_mgroup->customdata;
        wmOperator *op = man->data.op;
        const float *value = value_p;
 
@@ -588,22 +588,22 @@ static void manipulator_bisect_prop_angle_set(
                        /* re-normalize - seems acceptable */
                        RNA_property_float_set_array(op->ptr, man->data.prop_plane_no, plane_no);
 
-                       manipulator_bisect_exec(man);
+                       gizmo_bisect_exec(man);
                }
        }
 }
 
-static bool manipulator_mesh_bisect_poll(const bContext *C, wmManipulatorGroupType *wgt)
+static bool gizmo_mesh_bisect_poll(const bContext *C, wmGizmoGroupType *wgt)
 {
        wmOperator *op = WM_operator_last_redo(C);
        if (op == NULL || !STREQ(op->type->idname, "MESH_OT_bisect")) {
-               WM_manipulator_group_type_unlink_delayed_ptr(wgt);
+               WM_gizmo_group_type_unlink_delayed_ptr(wgt);
                return false;
        }
        return true;
 }
 
-static void manipulator_mesh_bisect_setup(const bContext *C, wmManipulatorGroup *mgroup)
+static void gizmo_mesh_bisect_setup(const bContext *C, wmGizmoGroup *mgroup)
 {
        wmOperator *op = WM_operator_last_redo(C);
 
@@ -611,26 +611,26 @@ static void manipulator_mesh_bisect_setup(const bContext *C, wmManipulatorGroup
                return;
        }
 
-       struct ManipulatorGroup *man = MEM_callocN(sizeof(ManipulatorGroup), __func__);
+       struct GizmoGroup *man = MEM_callocN(sizeof(GizmoGroup), __func__);
        mgroup->customdata = man;
 
-       const wmManipulatorType *wt_arrow = WM_manipulatortype_find("MANIPULATOR_WT_arrow_3d", true);
-       const wmManipulatorType *wt_grab = WM_manipulatortype_find("MANIPULATOR_WT_grab_3d", true);
-       const wmManipulatorType *wt_dial = WM_manipulatortype_find("MANIPULATOR_WT_dial_3d", true);
+       const wmGizmoType *wt_arrow = WM_gizmotype_find("GIZMO_WT_arrow_3d", true);
+       const wmGizmoType *wt_grab = WM_gizmotype_find("GIZMO_WT_grab_3d", true);
+       const wmGizmoType *wt_dial = WM_gizmotype_find("GIZMO_WT_dial_3d", true);
 
-       man->translate_z = WM_manipulator_new_ptr(wt_arrow, mgroup, NULL);
-       man->translate_c = WM_manipulator_new_ptr(wt_grab, mgroup, NULL);
-       man->rotate_c = WM_manipulator_new_ptr(wt_dial, mgroup, NULL);
+       man->translate_z = WM_gizmo_new_ptr(wt_arrow, mgroup, NULL);
+       man->translate_c = WM_gizmo_new_ptr(wt_grab, mgroup, NULL);
+       man->rotate_c = WM_gizmo_new_ptr(wt_dial, mgroup, NULL);
 
-       UI_GetThemeColor3fv(TH_MANIPULATOR_PRIMARY, man->translate_z->color);
-       UI_GetThemeColor3fv(TH_MANIPULATOR_PRIMARY, man->translate_c->color);
-       UI_GetThemeColor3fv(TH_MANIPULATOR_SECONDARY, man->rotate_c->color);
+       UI_GetThemeColor3fv(TH_GIZMO_PRIMARY, man->translate_z->color);
+       UI_GetThemeColor3fv(TH_GIZMO_PRIMARY, man->translate_c->color);
+       UI_GetThemeColor3fv(TH_GIZMO_SECONDARY, man->rotate_c->color);
 
-       RNA_enum_set(man->translate_z->ptr, "draw_style", ED_MANIPULATOR_ARROW_STYLE_NORMAL);
-       RNA_enum_set(man->translate_c->ptr, "draw_style", ED_MANIPULATOR_GRAB_STYLE_RING_2D);
+       RNA_enum_set(man->translate_z->ptr, "draw_style", ED_GIZMO_ARROW_STYLE_NORMAL);
+       RNA_enum_set(man->translate_c->ptr, "draw_style", ED_GIZMO_GRAB_STYLE_RING_2D);
 
-       WM_manipulator_set_flag(man->translate_c, WM_MANIPULATOR_DRAW_VALUE, true);
-       WM_manipulator_set_flag(man->rotate_c, WM_MANIPULATOR_DRAW_VALUE, true);
+       WM_gizmo_set_flag(man->translate_c, WM_GIZMO_DRAW_VALUE, true);
+       WM_gizmo_set_flag(man->rotate_c, WM_GIZMO_DRAW_VALUE, true);
 
        {
                man->data.context = (bContext *)C;
@@ -639,64 +639,64 @@ static void manipulator_mesh_bisect_setup(const bContext *C, wmManipulatorGroup
                man->data.prop_plane_no = RNA_struct_find_property(op->ptr, "plane_no");
        }
 
-       manipulator_mesh_bisect_update_from_op(man);
+       gizmo_mesh_bisect_update_from_op(man);
 
        /* Setup property callbacks */
        {
-               WM_manipulator_target_property_def_func(
+               WM_gizmo_target_property_def_func(
                        man->translate_z, "offset",
-                       &(const struct wmManipulatorPropertyFnParams) {
-                           .value_get_fn = manipulator_bisect_prop_depth_get,
-                           .value_set_fn = manipulator_bisect_prop_depth_set,
+                       &(const struct wmGizmoPropertyFnParams) {
+                           .value_get_fn = gizmo_bisect_prop_depth_get,
+                           .value_set_fn = gizmo_bisect_prop_depth_set,
                            .range_get_fn = NULL,
                            .user_data = NULL,
                        });
 
-               WM_manipulator_target_property_def_func(
+               WM_gizmo_target_property_def_func(
                        man->translate_c, "offset",
-                       &(const struct wmManipulatorPropertyFnParams) {
-                           .value_get_fn = manipulator_bisect_prop_translate_get,
-                           .value_set_fn = manipulator_bisect_prop_translate_set,
+                       &(const struct wmGizmoPropertyFnParams) {
+                           .value_get_fn = gizmo_bisect_prop_translate_get,
+                           .value_set_fn = gizmo_bisect_prop_translate_set,
                            .range_get_fn = NULL,
                            .user_data = NULL,
                        });
 
-               WM_manipulator_target_property_def_func(
+               WM_gizmo_target_property_def_func(
                        man->rotate_c, "offset",
-                       &(const struct wmManipulatorPropertyFnParams) {
-                           .value_get_fn = manipulator_bisect_prop_angle_get,
-                           .value_set_fn = manipulator_bisect_prop_angle_set,
+                       &(const struct wmGizmoPropertyFnParams) {
+                           .value_get_fn = gizmo_bisect_prop_angle_get,
+                           .value_set_fn = gizmo_bisect_prop_angle_set,
                            .range_get_fn = NULL,
                            .user_data = NULL,
                        });
        }
 }
 
-static void manipulator_mesh_bisect_draw_prepare(
-        const bContext *UNUSED(C), wmManipulatorGroup *mgroup)
+static void gizmo_mesh_bisect_draw_prepare(
+        const bContext *UNUSED(C), wmGizmoGroup *mgroup)
 {
-       ManipulatorGroup *man = mgroup->customdata;
+       GizmoGroup *man = mgroup->customdata;
        if (man->data.op->next) {
                man->data.op = WM_operator_last_redo((bContext *)man->data.context);
        }
-       manipulator_mesh_bisect_update_from_op(man);
+       gizmo_mesh_bisect_update_from_op(man);
 }
 
-static void MESH_WGT_bisect(struct wmManipulatorGroupType *wgt)
+static void MESH_WGT_bisect(struct wmGizmoGroupType *wgt)
 {
        wgt->name = "Mesh Bisect";
        wgt->idname = "MESH_WGT_bisect";
 
-       wgt->flag = WM_MANIPULATORGROUPTYPE_3D;
+       wgt->flag = WM_GIZMOGROUPTYPE_3D;
 
        wgt->mmap_params.spaceid = SPACE_VIEW3D;
        wgt->mmap_params.regionid = RGN_TYPE_WINDOW;
 
-       wgt->poll = manipulator_mesh_bisect_poll;
-       wgt->setup = manipulator_mesh_bisect_setup;
-       wgt->draw_prepare = manipulator_mesh_bisect_draw_prepare;
+       wgt->poll = gizmo_mesh_bisect_poll;
+       wgt->setup = gizmo_mesh_bisect_setup;
+       wgt->draw_prepare = gizmo_mesh_bisect_draw_prepare;
 }
 
 /** \} */
 
-#endif  /* USE_MANIPULATOR */
+#endif  /* USE_GIZMO */
index b007bcf04baa1fba0e2a0071071443c12a069863..dd167c1fc15ef8c3ee0afc368497f1172bad180f 100644 (file)
@@ -61,7 +61,7 @@
 
 #include "mesh_intern.h"  /* own include */
 
-#define USE_MANIPULATOR
+#define USE_GIZMO
 
 /* -------------------------------------------------------------------- */
 /** \name Extrude Internal Utilities
@@ -360,10 +360,10 @@ void MESH_OT_extrude_repeat(wmOperatorType *ot)
 
 
 /* -------------------------------------------------------------------- */
-/** \name Extrude Manipulator
+/** \name Extrude Gizmo
  * \{ */
 
-#ifdef USE_MANIPULATOR
+#ifdef USE_GIZMO
 
 const float extrude_button_scale = 0.15f;
 const float extrude_button_offset_scale = 1.5f;
@@ -380,11 +380,11 @@ static const uchar shape_plus[] = {
        0x90, 0x6e, 0xd7, 0x80, 0xff, 0x5f, 0xfb, 0x5f, 0xfb,
 };
 
-typedef struct ManipulatorExtrudeGroup {
+typedef struct GizmoExtrudeGroup {
 
        /* XYZ & normal. */
-       struct wmManipulator *invoke_xyz_no[4];
-       struct wmManipulator *adjust_xyz_no[5];
+       struct wmGizmo *invoke_xyz_no[4];
+       struct wmGizmo *adjust_xyz_no[5];
 
        struct {
                float normal_mat3[3][3];  /* use Z axis for normal. */
@@ -392,10 +392,10 @@ typedef struct ManipulatorExtrudeGroup {
        } data;
 
        wmOperatorType *ot_extrude;
-} ManipulatorExtrudeGroup;
+} GizmoExtrudeGroup;
 
-static void manipulator_mesh_extrude_orientation_matrix_set(
-        struct ManipulatorExtrudeGroup *man, const float mat[3][3])
+static void gizmo_mesh_extrude_orientation_matrix_set(
+        struct GizmoExtrudeGroup *man, const float mat[3][3])
 {
        for (int i = 0; i < 3; i++) {
                /* Set orientation without location. */
@@ -417,32 +417,32 @@ static void manipulator_mesh_extrude_orientation_matrix_set(
        }
 }
 
-static bool manipulator_mesh_extrude_poll(const bContext *C, wmManipulatorGroupType *wgt)
+static bool gizmo_mesh_extrude_poll(const bContext *C, wmGizmoGroupType *wgt)
 {
        ScrArea *sa = CTX_wm_area(C);
        bToolRef_Runtime *tref_rt = sa->runtime.tool ? sa->runtime.tool->runtime : NULL;
        if ((tref_rt == NULL) ||
-           !STREQ(wgt->idname, tref_rt->manipulator_group) ||
+           !STREQ(wgt->idname, tref_rt->gizmo_group) ||
            !ED_operator_editmesh_view3d((bContext *)C))
        {
-               WM_manipulator_group_type_unlink_delayed_ptr(wgt);
+               WM_gizmo_group_type_unlink_delayed_ptr(wgt);
                return false;
        }
        return true;
 }
 
-static void manipulator_mesh_extrude_setup(const bContext *UNUSED(C), wmManipulatorGroup *mgroup)
+static void gizmo_mesh_extrude_setup(const bContext *UNUSED(C), wmGizmoGroup *mgroup)
 {
-       struct ManipulatorExtrudeGroup *man = MEM_callocN(sizeof(ManipulatorExtrudeGroup), __func__);
+       struct GizmoExtrudeGroup *man = MEM_callocN(sizeof(GizmoExtrudeGroup), __func__);
        mgroup->customdata = man;
 
-       const wmManipulatorType *wt_arrow = WM_manipulatortype_find("MANIPULATOR_WT_arrow_3d", true);
-       const wmManipulatorType *wt_grab = WM_manipulatortype_find("MANIPULATOR_WT_button_2d", true);
+       const wmGizmoType *wt_arrow = WM_gizmotype_find("GIZMO_WT_arrow_3d", true);
+       const wmGizmoType *wt_grab = WM_gizmotype_find("GIZMO_WT_button_2d", true);
 
        for (int i = 0; i < 4; i++) {
-               man->adjust_xyz_no[i] = WM_manipulator_new_ptr(wt_arrow, mgroup, NULL);
-               man->invoke_xyz_no[i] = WM_manipulator_new_ptr(wt_grab, mgroup, NULL);
-               man->invoke_xyz_no[i]->flag |= WM_MANIPULATOR_DRAW_OFFSET_SCALE;
+               man->adjust_xyz_no[i] = WM_gizmo_new_ptr(wt_arrow, mgroup, NULL);
+               man->invoke_xyz_no[i] = WM_gizmo_new_ptr(wt_grab, mgroup, NULL);
+               man->invoke_xyz_no[i]->flag |= WM_GIZMO_DRAW_OFFSET_SCALE;
        }
 
        {
@@ -460,25 +460,25 @@ static void manipulator_mesh_extrude_setup(const bContext *UNUSED(C), wmManipula
                UI_GetThemeColor3fv(TH_AXIS_X + i, man->invoke_xyz_no[i]->color);
                UI_GetThemeColor3fv(TH_AXIS_X + i, man->adjust_xyz_no[i]->color);
        }
-       UI_GetThemeColor3fv(TH_MANIPULATOR_PRIMARY, man->invoke_xyz_no[3]->color);
-       UI_GetThemeColor3fv(TH_MANIPULATOR_PRIMARY, man->adjust_xyz_no[3]->color);
+       UI_GetThemeColor3fv(TH_GIZMO_PRIMARY, man->invoke_xyz_no[3]->color);
+       UI_GetThemeColor3fv(TH_GIZMO_PRIMARY, man->adjust_xyz_no[3]->color);
 
        for (int i = 0; i < 4; i++) {
-               WM_manipulator_set_scale(man->invoke_xyz_no[i], extrude_button_scale);
-               WM_manipulator_set_scale(man->adjust_xyz_no[i], extrude_arrow_scale);
+               WM_gizmo_set_scale(man->invoke_xyz_no[i], extrude_button_scale);
+               WM_gizmo_set_scale(man->adjust_xyz_no[i], extrude_arrow_scale);
        }
-       WM_manipulator_set_scale(man->adjust_xyz_no[3], extrude_arrow_normal_axis_scale);
+       WM_gizmo_set_scale(man->adjust_xyz_no[3], extrude_arrow_normal_axis_scale);
 
        for (int i = 0; i < 4; i++) {
        }
 
        for (int i = 0; i < 4; i++) {
-               WM_manipulator_set_flag(man->adjust_xyz_no[i], WM_MANIPULATOR_DRAW_VALUE, true);
+               WM_gizmo_set_flag(man->adjust_xyz_no[i], WM_GIZMO_DRAW_VALUE, true);
        }
 
        /* XYZ & normal axis extrude. */
        for (int i = 0; i < 4; i++) {
-               PointerRNA *ptr = WM_manipulator_operator_set(man->invoke_xyz_no[i], 0, man->ot_extrude, NULL);
+               PointerRNA *ptr = WM_gizmo_operator_set(man->invoke_xyz_no[i], 0, man->ot_extrude, NULL);
                {
                        bool constraint[3] = {0, 0, 0};
                        constraint[MIN2(i, 2)] = 1;
@@ -490,7 +490,7 @@ static void manipulator_mesh_extrude_setup(const bContext *UNUSED(C), wmManipula
 
        /* Adjust extrude. */
        for (int i = 0; i < 4; i++) {
-               PointerRNA *ptr = WM_manipulator_operator_set(man->adjust_xyz_no[i], 0, man->ot_extrude, NULL);
+               PointerRNA *ptr = WM_gizmo_operator_set(man->adjust_xyz_no[i], 0, man->ot_extrude, NULL);
                {
                        bool constraint[3] = {0, 0, 0};
                        constraint[MIN2(i, 2)] = 1;
@@ -498,18 +498,18 @@ static void manipulator_mesh_extrude_setup(const bContext *UNUSED(C), wmManipula
                        RNA_boolean_set(&macroptr, "release_confirm", true);
                        RNA_boolean_set_array(&macroptr, "constraint_axis", constraint);
                }
-               wmManipulatorOpElem *mpop = WM_manipulator_operator_get(man->adjust_xyz_no[i], 0);
+               wmGizmoOpElem *mpop = WM_gizmo_operator_get(man->adjust_xyz_no[i], 0);
                mpop->is_redo = true;
        }
 }
 
-static void manipulator_mesh_extrude_refresh(const bContext *C, wmManipulatorGroup *mgroup)
+static void gizmo_mesh_extrude_refresh(const bContext *C, wmGizmoGroup *mgroup)
 {
-       ManipulatorExtrudeGroup *man = mgroup->customdata;
+       GizmoExtrudeGroup *man = mgroup->customdata;
 
        for (int i = 0; i < 4; i++) {
-               WM_manipulator_set_flag(man->invoke_xyz_no[i], WM_MANIPULATOR_HIDDEN, true);
-               WM_manipulator_set_flag(man->adjust_xyz_no[i], WM_MANIPULATOR_HIDDEN, true);
+               WM_gizmo_set_flag(man->invoke_xyz_no[i], WM_GIZMO_HIDDEN, true);
+               WM_gizmo_set_flag(man->adjust_xyz_no[i], WM_GIZMO_HIDDEN, true);
        }
 
        if (G.moving) {
@@ -525,7 +525,7 @@ static void manipulator_mesh_extrude_refresh(const bContext *C, wmManipulatorGro
 
        if (use_normal) {
                struct TransformBounds tbounds_normal;
-               if (!ED_transform_calc_manipulator_stats(
+               if (!ED_transform_calc_gizmo_stats(
                            C, &(struct TransformCalcParams){
                                .orientation_type = V3D_MANIP_NORMAL + 1,
                            }, &tbounds_normal))
@@ -536,7 +536,7 @@ static void manipulator_mesh_extrude_refresh(const bContext *C, wmManipulatorGro
        }
 
        /* TODO(campbell): run second since this modifies the 3D view, it should not. */
-       if (!ED_transform_calc_manipulator_stats(
+       if (!ED_transform_calc_gizmo_stats(
                    C, &(struct TransformCalcParams){
                        .orientation_type = man->data.orientation_type + 1,
                    }, &tbounds))
@@ -556,15 +556,15 @@ static void manipulator_mesh_extrude_refresh(const bContext *C, wmManipulatorGro
                (extrude_arrow_normal_axis_scale * extrude_button_offset_scale) / extrude_button_scale);
 
        /* Needed for normal orientation. */
-       manipulator_mesh_extrude_orientation_matrix_set(man, tbounds.axis);
+       gizmo_mesh_extrude_orientation_matrix_set(man, tbounds.axis);
        if (use_normal) {
                copy_m4_m3(man->adjust_xyz_no[3]->matrix_basis, man->data.normal_mat3);
        }
 
        /* Location. */
        for (int i = 0; i < axis_len_used; i++) {
-               WM_manipulator_set_matrix_location(man->invoke_xyz_no[i], tbounds.center);
-               WM_manipulator_set_matrix_location(man->adjust_xyz_no[i], tbounds.center);
+               WM_gizmo_set_matrix_location(man->invoke_xyz_no[i], tbounds.center);
+               WM_gizmo_set_matrix_location(man->adjust_xyz_no[i], tbounds.center);
        }
 
        wmOperator *op = WM_operator_last_redo(C);
@@ -572,13 +572,13 @@ static void manipulator_mesh_extrude_refresh(const bContext *C, wmManipulatorGro
 
        /* Un-hide. */
        for (int i = 0; i < axis_len_used; i++) {
-               WM_manipulator_set_flag(man->invoke_xyz_no[i], WM_MANIPULATOR_HIDDEN, false);
-               WM_manipulator_set_flag(man->adjust_xyz_no[i], WM_MANIPULATOR_HIDDEN, !has_redo);
+               WM_gizmo_set_flag(man->invoke_xyz_no[i], WM_GIZMO_HIDDEN, false);
+               WM_gizmo_set_flag(man->adjust_xyz_no[i], WM_GIZMO_HIDDEN, !has_redo);
        }
 
        /* Operator properties. */
        if (use_normal) {
-               wmManipulatorOpElem *mpop = WM_manipulator_operator_get(man->invoke_xyz_no[3], 0);
+               wmGizmoOpElem *mpop = WM_gizmo_operator_get(man->invoke_xyz_no[3], 0);
                PointerRNA macroptr = RNA_pointer_get(&mpop->ptr, "TRANSFORM_OT_translate");
                RNA_enum_set(&macroptr, "constraint_orientation", V3D_MANIP_NORMAL);
        }
@@ -598,7 +598,7 @@ static void manipulator_mesh_extrude_refresh(const bContext *C, wmManipulatorGro
                            (orientation_type == man->data.orientation_type && constraint_axis[i]) :
                            (orientation_type == V3D_MANIP_NORMAL && constraint_axis[2]))
                        {
-                               wmManipulatorOpElem *mpop = WM_manipulator_operator_get(man->adjust_xyz_no[i], 0);
+                               wmGizmoOpElem *mpop = WM_gizmo_operator_get(man->adjust_xyz_no[i], 0);
 
                                PointerRNA macroptr = RNA_pointer_get(&mpop->ptr, "TRANSFORM_OT_translate");
 
@@ -609,7 +609,7 @@ static void manipulator_mesh_extrude_refresh(const bContext *C, wmManipulatorGro
                        else {
                                /* TODO(campbell): ideally we could adjust all,
                                 * this is complicated by how operator redo and the transform macro works. */
-                               WM_manipulator_set_flag(man->adjust_xyz_no[i], WM_MANIPULATOR_HIDDEN, true);
+                               WM_gizmo_set_flag(man->adjust_xyz_no[i], WM_GIZMO_HIDDEN, true);
                        }
                }
        }
@@ -618,14 +618,14 @@ static void manipulator_mesh_extrude_refresh(const bContext *C, wmManipulatorGro
                RNA_enum_set(
                        man->invoke_xyz_no[i]->ptr,
                        "draw_options",
-                       (man->adjust_xyz_no[i]->flag & WM_MANIPULATOR_HIDDEN) ?
-                       ED_MANIPULATOR_BUTTON_SHOW_HELPLINE : 0);
+                       (man->adjust_xyz_no[i]->flag & WM_GIZMO_HIDDEN) ?
+                       ED_GIZMO_BUTTON_SHOW_HELPLINE : 0);
        }
 }
 
-static void manipulator_mesh_extrude_draw_prepare(const bContext *C, wmManipulatorGroup *mgroup)
+static void gizmo_mesh_extrude_draw_prepare(const bContext *C, wmGizmoGroup *mgroup)
 {
-       ManipulatorExtrudeGroup *man = mgroup->customdata;
+       GizmoExtrudeGroup *man = mgroup->customdata;
        switch (man->data.orientation_type) {
                case V3D_MANIP_VIEW:
                {
@@ -633,14 +633,14 @@ static void manipulator_mesh_extrude_draw_prepare(const bContext *C, wmManipulat
                        float mat[3][3];
                        copy_m3_m4(mat, rv3d->viewinv);
                        normalize_m3(mat);
-                       manipulator_mesh_extrude_orientation_matrix_set(man, mat);
+                       gizmo_mesh_extrude_orientation_matrix_set(man, mat);
                        break;
                }
        }
 }
 
-static void manipulator_mesh_extrude_message_subscribe(
-        const bContext *C, wmManipulatorGroup *mgroup, struct wmMsgBus *mbus)
+static void gizmo_mesh_extrude_message_subscribe(
+        const bContext *C, wmGizmoGroup *mgroup, struct wmMsgBus *mbus)
 {
        ARegion *ar = CTX_wm_region(C);
 
@@ -648,7 +648,7 @@ static void manipulator_mesh_extrude_message_subscribe(
        wmMsgSubscribeValue msg_sub_value_mpr_tag_refresh = {
                .owner = ar,
                .user_data = mgroup->parent_mmap,
-               .notify = WM_manipulator_do_msg_notify_tag_refresh,
+               .notify = WM_gizmo_do_msg_notify_tag_refresh,
        };
 
        {
@@ -657,24 +657,24 @@ static void manipulator_mesh_extrude_message_subscribe(
 
 }
 
-static void MESH_WGT_extrude(struct wmManipulatorGroupType *wgt)
+static void MESH_WGT_extrude(struct wmGizmoGroupType *wgt)
 {
        wgt->name = "Mesh Extrude";
        wgt->idname = "MESH_WGT_extrude";
 
-       wgt->flag = WM_MANIPULATORGROUPTYPE_3D;
+       wgt->flag = WM_GIZMOGROUPTYPE_3D;
 
        wgt->mmap_params.spaceid = SPACE_VIEW3D;
        wgt->mmap_params.regionid = RGN_TYPE_WINDOW;
 
-       wgt->poll = manipulator_mesh_extrude_poll;
-       wgt->setup = manipulator_mesh_extrude_setup;
-       wgt->refresh = manipulator_mesh_extrude_refresh;
-       wgt->draw_prepare = manipulator_mesh_extrude_draw_prepare;
-       wgt->message_subscribe = manipulator_mesh_extrude_message_subscribe;
+       wgt->poll = gizmo_mesh_extrude_poll;
+       wgt->setup = gizmo_mesh_extrude_setup;
+       wgt->refresh = gizmo_mesh_extrude_refresh;
+       wgt->draw_prepare = gizmo_mesh_extrude_draw_prepare;
+       wgt->message_subscribe = gizmo_mesh_extrude_message_subscribe;
 }
 
-#endif  /* USE_MANIPULATOR */
+#endif  /* USE_GIZMO */
 
 /** \} */
 
@@ -825,8 +825,8 @@ void MESH_OT_extrude_context(wmOperatorType *ot)
 
        Transform_Properties(ot, P_NO_DEFAULTS | P_MIRROR_DUMMY);
 
-#ifdef USE_MANIPULATOR
-       WM_manipulatorgrouptype_append(MESH_WGT_extrude);
+#ifdef USE_GIZMO
+       WM_gizmogrouptype_append(MESH_WGT_extrude);
 #endif
 }
 
index 74e2833b2d919701d7467372138a3c8e93888b76..3864bd6303603ae3f604d1a3cbe96d06ba86e777 100644 (file)
 
 #include "mesh_intern.h"  /* own include */
 
-#define USE_MANIPULATOR
+#define USE_GIZMO
 
-#ifdef USE_MANIPULATOR
+#ifdef USE_GIZMO
 #include "ED_gizmo_library.h"
 #include "ED_undo.h"
 #endif
 
 /* -------------------------------------------------------------------- */
-/** \name Spin Manipulator
+/** \name Spin Gizmo
  * \{ */
 
-#ifdef USE_MANIPULATOR
-typedef struct ManipulatorSpinGroup {
+#ifdef USE_GIZMO
+typedef struct GizmoSpinGroup {
        /* Arrow to change plane depth. */
-       struct wmManipulator *translate_z;
+       struct wmGizmo *translate_z;
        /* Translate XYZ */
-       struct wmManipulator *translate_c;
-       /* For grabbing the manipulator and moving freely. */
-       struct wmManipulator *rotate_c;
+       struct wmGizmo *translate_c;
+       /* For grabbing the gizmo and moving freely. */
+       struct wmGizmo *rotate_c;
        /* Spin angle */
-       struct wmManipulator *angle_z;
+       struct wmGizmo *angle_z;
 
        /* We could store more vars here! */
        struct {
@@ -87,14 +87,14 @@ typedef struct ManipulatorSpinGroup {
                float rotate_axis[3];
                float rotate_up[3];
        } data;
-} ManipulatorSpinGroup;
+} GizmoSpinGroup;
 
 /**
  * XXX. calling redo from property updates is not great.
  * This is needed because changing the RNA doesn't cause a redo
  * and we're not using operator UI which does just this.
  */
-static void manipulator_spin_exec(ManipulatorSpinGroup *man)
+static void gizmo_spin_exec(GizmoSpinGroup *man)
 {
        wmOperator *op = man->data.op;
        if (op == WM_operator_last_redo((bContext *)man->data.context)) {
@@ -102,7 +102,7 @@ static void manipulator_spin_exec(ManipulatorSpinGroup *man)
        }
 }
 
-static void manipulator_mesh_spin_update_from_op(ManipulatorSpinGroup *man)
+static void gizmo_mesh_spin_update_from_op(GizmoSpinGroup *man)
 {
        wmOperator *op = man->data.op;
 
@@ -111,15 +111,15 @@ static void manipulator_mesh_spin_update_from_op(ManipulatorSpinGroup *man)
        RNA_property_float_get_array(op->ptr, man->data.prop_axis_co, plane_co);
        RNA_property_float_get_array(op->ptr, man->data.prop_axis_no, plane_no);
 
-       WM_manipulator_set_matrix_location(man->translate_z, plane_co);
-       WM_manipulator_set_matrix_location(man->rotate_c, plane_co);
-       WM_manipulator_set_matrix_location(man->angle_z, plane_co);
+       WM_gizmo_set_matrix_location(man->translate_z, plane_co);
+       WM_gizmo_set_matrix_location(man->rotate_c, plane_co);
+       WM_gizmo_set_matrix_location(man->angle_z, plane_co);
        /* translate_c location comes from the property. */
 
-       WM_manipulator_set_matrix_rotation_from_z_axis(man->translate_z, plane_no);
-       WM_manipulator_set_matrix_rotation_from_z_axis(man->angle_z, plane_no);
+       WM_gizmo_set_matrix_rotation_from_z_axis(man->translate_z, plane_no);
+       WM_gizmo_set_matrix_rotation_from_z_axis(man->angle_z, plane_no);
 
-       WM_manipulator_set_scale(man->translate_c, 0.2);
+       WM_gizmo_set_scale(man->translate_c, 0.2);
 
        RegionView3D *rv3d = ED_view3d_context_rv3d(man->data.context);
        if (rv3d) {
@@ -130,23 +130,23 @@ static void manipulator_mesh_spin_update_from_op(ManipulatorSpinGroup *man)
                project_plane_normalized_v3_v3v3(man->data.rotate_up, man->data.rotate_up, man->data.rotate_axis);
                normalize_v3(man->data.rotate_up);
 
-               WM_manipulator_set_matrix_rotation_from_z_axis(man->translate_c, plane_no);
-               WM_manipulator_set_matrix_rotation_from_yz_axis(man->rotate_c, plane_no, man->data.rotate_axis);
+               WM_gizmo_set_matrix_rotation_from_z_axis(man->translate_c, plane_no);
+               WM_gizmo_set_matrix_rotation_from_yz_axis(man->rotate_c, plane_no, man->data.rotate_axis);
 
                /* show the axis instead of mouse cursor */
                RNA_enum_set(man->rotate_c->ptr, "draw_options",
-                            ED_MANIPULATOR_DIAL_DRAW_FLAG_ANGLE_MIRROR |
-                            ED_MANIPULATOR_DIAL_DRAW_FLAG_ANGLE_START_Y);
+                            ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_MIRROR |
+                            ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_START_Y);
 
        }
 }
 
 /* depth callbacks */
-static void manipulator_spin_prop_depth_get(
-        const wmManipulator *mpr, wmManipulatorProperty *mpr_prop,
+static void gizmo_spin_prop_depth_get(
+        const wmGizmo *mpr, wmGizmoProperty *mpr_prop,
         void *value_p)
 {
-       ManipulatorSpinGroup *man = mpr->parent_mgroup->customdata;
+       GizmoSpinGroup *man = mpr->parent_mgroup->customdata;
        wmOperator *op = man->data.op;
        float *value = value_p;
 
@@ -160,11 +160,11 @@ static void manipulator_spin_prop_depth_get(
        value[0] = dot_v3v3(plane_no, plane_co) - dot_v3v3(plane_no, mpr->matrix_basis[3]);
 }
 
-static void manipulator_spin_prop_depth_set(
-        const wmManipulator *mpr, wmManipulatorProperty *mpr_prop,
+static void gizmo_spin_prop_depth_set(
+        const wmGizmo *mpr, wmGizmoProperty *mpr_prop,
         const void *value_p)
 {
-       ManipulatorSpinGroup *man = mpr->parent_mgroup->customdata;
+       GizmoSpinGroup *man = mpr->parent_mgroup->customdata;
        wmOperator *op = man->data.op;
        const float *value = value_p;
 
@@ -183,15 +183,15 @@ static void manipulator_spin_prop_depth_set(
 
        RNA_property_float_set_array(op->ptr, man->data.prop_axis_co, plane_co);
 
-       manipulator_spin_exec(man);
+       gizmo_spin_exec(man);
 }
 
 /* translate callbacks */
-static void manipulator_spin_prop_translate_get(
-        const wmManipulator *mpr, wmManipulatorProperty *mpr_prop,
+static void gizmo_spin_prop_translate_get(
+        const wmGizmo *mpr, wmGizmoProperty *mpr_prop,
         void *value_p)
 {
-       ManipulatorSpinGroup *man = mpr->parent_mgroup->customdata;
+       GizmoSpinGroup *man = mpr->parent_mgroup->customdata;
        wmOperator *op = man->data.op;
        float *value = value_p;
 
@@ -201,11 +201,11 @@ static void manipulator_spin_prop_translate_get(
        RNA_property_float_get_array(op->ptr, man->data.prop_axis_co, value);
 }
 
-static void manipulator_spin_prop_translate_set(
-        const wmManipulator *mpr, wmManipulatorProperty *mpr_prop,
+static void gizmo_spin_prop_translate_set(
+        const wmGizmo *mpr, wmGizmoProperty *mpr_prop,
         const void *value)
 {
-       ManipulatorSpinGroup *man = mpr->parent_mgroup->customdata;
+       GizmoSpinGroup *man = mpr->parent_mgroup->customdata;
        wmOperator *op = man->data.op;
 
        BLI_assert(mpr_prop->type->array_length == 3);
@@ -213,15 +213,15 @@ static void manipulator_spin_prop_translate_set(
 
        RNA_property_float_set_array(op->ptr, man->data.prop_axis_co, value);
 
-       manipulator_spin_exec(man);
+       gizmo_spin_exec(man);
 }
 
 /* angle callbacks */
-static void manipulator_spin_prop_axis_angle_get(
-        const wmManipulator *mpr, wmManipulatorProperty *mpr_prop,
+static void gizmo_spin_prop_axis_angle_get(
+        const wmGizmo *mpr, wmGizmoProperty *mpr_prop,
         void *value_p)
 {
-       ManipulatorSpinGroup *man = mpr->parent_mgroup->customdata;
+       GizmoSpinGroup *man = mpr->parent_mgroup->customdata;
        wmOperator *op = man->data.op;
        float *value = value_p;
 
@@ -244,11 +244,11 @@ static void manipulator_spin_prop_axis_angle_get(
        }
 }
 
-static void manipulator_spin_prop_axis_angle_set(
-        const wmManipulator *mpr, wmManipulatorProperty *mpr_prop,
+static void gizmo_spin_prop_axis_angle_set(
+        const wmGizmo *mpr,&n