diff options
Diffstat (limited to 'source/blender/windowmanager')
4 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/windowmanager/WM_keymap.h b/source/blender/windowmanager/WM_keymap.h index 2cf71dcf165..ae2810dfb4d 100644 --- a/source/blender/windowmanager/WM_keymap.h +++ b/source/blender/windowmanager/WM_keymap.h @@ -135,10 +135,10 @@ char *WM_modalkeymap_operator_items_to_string_buf(struct wmOperatorType *ot, int *r_available_len, char **r_result); -wmKeyMap *WM_modalkeymap_add(struct wmKeyConfig *keyconf, - const char *idname, - const struct EnumPropertyItem *items); -wmKeyMap *WM_modalkeymap_get(struct wmKeyConfig *keyconf, const char *idname); +wmKeyMap *WM_modalkeymap_ensure(struct wmKeyConfig *keyconf, + const char *idname, + const struct EnumPropertyItem *items); +wmKeyMap *WM_modalkeymap_find(struct wmKeyConfig *keyconf, const char *idname); wmKeyMapItem *WM_modalkeymap_add_item( struct wmKeyMap *km, int type, int val, int modifier, int keymodifier, int value); wmKeyMapItem *WM_modalkeymap_add_item_str( diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c index ef270533855..b7fecb31f96 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c @@ -665,14 +665,14 @@ wmKeyMap *wm_gizmogroup_tweak_modal_keymap(wmKeyConfig *kc) }; STRNCPY(name, "Generic Gizmo Tweak Modal Map"); - keymap = WM_modalkeymap_get(kc, name); + keymap = WM_modalkeymap_find(kc, name); /* this function is called for each spacetype, only needs to add map once */ if (keymap && keymap->modal_items) { return NULL; } - keymap = WM_modalkeymap_add(kc, name, modal_items); + keymap = WM_modalkeymap_ensure(kc, name, modal_items); /* items for modal map */ WM_modalkeymap_add_item(keymap, EVT_ESCKEY, KM_PRESS, KM_ANY, 0, TWEAK_MODAL_CANCEL); diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index ab4888d4d31..890aeb71e1a 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -911,9 +911,9 @@ wmKeyMap *WM_keymap_find_all_spaceid_or_empty(wmWindowManager *wm, * and filter the keys before sending to #wmOperatorType.modal callback. * \{ */ -wmKeyMap *WM_modalkeymap_add(wmKeyConfig *keyconf, - const char *idname, - const EnumPropertyItem *items) +wmKeyMap *WM_modalkeymap_ensure(wmKeyConfig *keyconf, + const char *idname, + const EnumPropertyItem *items) { wmKeyMap *km = WM_keymap_ensure(keyconf, idname, 0, 0); km->flag |= KEYMAP_MODAL; @@ -937,7 +937,7 @@ wmKeyMap *WM_modalkeymap_add(wmKeyConfig *keyconf, return km; } -wmKeyMap *WM_modalkeymap_get(wmKeyConfig *keyconf, const char *idname) +wmKeyMap *WM_modalkeymap_find(wmKeyConfig *keyconf, const char *idname) { wmKeyMap *km; diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 853da714f76..e782b802729 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -3833,14 +3833,14 @@ static void gesture_circle_modal_keymap(wmKeyConfig *keyconf) }; /* WARNING - name is incorrect, use for non-3d views */ - wmKeyMap *keymap = WM_modalkeymap_get(keyconf, "View3D Gesture Circle"); + wmKeyMap *keymap = WM_modalkeymap_find(keyconf, "View3D Gesture Circle"); /* this function is called for each spacetype, only needs to add map once */ if (keymap && keymap->modal_items) { return; } - keymap = WM_modalkeymap_add(keyconf, "View3D Gesture Circle", modal_items); + keymap = WM_modalkeymap_ensure(keyconf, "View3D Gesture Circle", modal_items); /* assign map to operators */ WM_modalkeymap_assign(keymap, "VIEW3D_OT_select_circle"); @@ -3863,14 +3863,14 @@ static void gesture_straightline_modal_keymap(wmKeyConfig *keyconf) {0, NULL, 0, NULL, NULL}, }; - wmKeyMap *keymap = WM_modalkeymap_get(keyconf, "Gesture Straight Line"); + wmKeyMap *keymap = WM_modalkeymap_find(keyconf, "Gesture Straight Line"); /* this function is called for each spacetype, only needs to add map once */ if (keymap && keymap->modal_items) { return; } - keymap = WM_modalkeymap_add(keyconf, "Gesture Straight Line", modal_items); + keymap = WM_modalkeymap_ensure(keyconf, "Gesture Straight Line", modal_items); /* assign map to operators */ WM_modalkeymap_assign(keymap, "IMAGE_OT_sample_line"); @@ -3889,14 +3889,14 @@ static void gesture_box_modal_keymap(wmKeyConfig *keyconf) {0, NULL, 0, NULL, NULL}, }; - wmKeyMap *keymap = WM_modalkeymap_get(keyconf, "Gesture Box"); + wmKeyMap *keymap = WM_modalkeymap_find(keyconf, "Gesture Box"); /* this function is called for each spacetype, only needs to add map once */ if (keymap && keymap->modal_items) { return; } - keymap = WM_modalkeymap_add(keyconf, "Gesture Box", modal_items); + keymap = WM_modalkeymap_ensure(keyconf, "Gesture Box", modal_items); /* assign map to operators */ WM_modalkeymap_assign(keymap, "ACTION_OT_select_box"); @@ -3940,14 +3940,14 @@ static void gesture_zoom_border_modal_keymap(wmKeyConfig *keyconf) {0, NULL, 0, NULL, NULL}, }; - wmKeyMap *keymap = WM_modalkeymap_get(keyconf, "Gesture Zoom Border"); + wmKeyMap *keymap = WM_modalkeymap_find(keyconf, "Gesture Zoom Border"); /* this function is called for each spacetype, only needs to add map once */ if (keymap && keymap->modal_items) { return; } - keymap = WM_modalkeymap_add(keyconf, "Gesture Zoom Border", modal_items); + keymap = WM_modalkeymap_ensure(keyconf, "Gesture Zoom Border", modal_items); /* assign map to operators */ WM_modalkeymap_assign(keymap, "VIEW2D_OT_zoom_border"); |