Cleanup: rename WM_keymap_find -> WM_keymap_ensure
authorCampbell Barton <ideasman42@gmail.com>
Fri, 31 Aug 2018 03:36:14 +0000 (13:36 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 31 Aug 2018 03:36:46 +0000 (13:36 +1000)
49 files changed:
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_markers.c
source/blender/editors/animation/anim_ops.c
source/blender/editors/armature/armature_ops.c
source/blender/editors/curve/curve_ops.c
source/blender/editors/gpencil/gpencil_ops.c
source/blender/editors/interface/interface_ops.c
source/blender/editors/interface/view2d_ops.c
source/blender/editors/lattice/lattice_ops.c
source/blender/editors/mask/mask_edit.c
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/metaball/mball_ops.c
source/blender/editors/object/object_ops.c
source/blender/editors/physics/physics_ops.c
source/blender/editors/screen/area.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_ops.c
source/blender/editors/space_action/action_ops.c
source/blender/editors/space_action/space_action.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_clip/space_clip.c
source/blender/editors/space_console/space_console.c
source/blender/editors/space_file/space_file.c
source/blender/editors/space_graph/graph_ops.c
source/blender/editors/space_graph/space_graph.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_info/space_info.c
source/blender/editors/space_logic/space_logic.c
source/blender/editors/space_nla/nla_ops.c
source/blender/editors/space_nla/space_nla.c
source/blender/editors/space_node/node_ops.c
source/blender/editors/space_node/space_node.c
source/blender/editors/space_outliner/outliner_ops.c
source/blender/editors/space_outliner/space_outliner.c
source/blender/editors/space_script/space_script.c
source/blender/editors/space_sequencer/sequencer_ops.c
source/blender/editors/space_sequencer/space_sequencer.c
source/blender/editors/space_text/space_text.c
source/blender/editors/space_time/space_time.c
source/blender/editors/space_time/time_ops.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_ops.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/makesrna/intern/rna_wm_api.c
source/blender/windowmanager/WM_keymap.h
source/blender/windowmanager/intern/wm_keymap.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_window.c
source/blenderplayer/bad_level_call_stubs/stubs.c

index 75557e60e218ba84b037ccf9ac7bc4c837a72773..0366ef3a026a3018026ac208bdd7cf2ad65a933b 100644 (file)
@@ -3184,7 +3184,7 @@ void ED_operatortypes_animchannels(void)
 // TODO: check on a poll callback for this, to get hotkeys into menus
 void ED_keymap_animchannels(wmKeyConfig *keyconf)
 {
-       wmKeyMap *keymap = WM_keymap_find(keyconf, "Animation Channels", 0, 0);
+       wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Animation Channels", 0, 0);
        wmKeyMapItem *kmi;
 
        /* click-select */
index 88166ac65c8e8ee050c7beda5f36bd990313fdcc..836a2ca948ddd24c929d23186f82e72ffd9a47ec 100644 (file)
@@ -1581,7 +1581,7 @@ void ED_operatortypes_marker(void)
 /* called in screen_ops.c:ED_keymap_screen() */
 void ED_keymap_marker(wmKeyConfig *keyconf)
 {
-       wmKeyMap *keymap = WM_keymap_find(keyconf, "Markers", 0, 0);
+       wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Markers", 0, 0);
        wmKeyMapItem *kmi;
 
        WM_keymap_verify_item(keymap, "MARKER_OT_add", MKEY, KM_PRESS, 0, 0);
index 939d547dc947dabc4bfed77338aaf0a5cc9653d4..ce991f64d5d8b9528bbf7cf0631dd2df1570462a 100644 (file)
@@ -422,7 +422,7 @@ void ED_operatortypes_anim(void)
 
 void ED_keymap_anim(wmKeyConfig *keyconf)
 {
-       wmKeyMap *keymap = WM_keymap_find(keyconf, "Animation", 0, 0);
+       wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Animation", 0, 0);
        wmKeyMapItem *kmi;
 
        /* frame management */
index 3f2eefced7d7c0ad4b2fe8ce656a0b7a293312fc..d0b8754579875eedbb68cc9318b5a5fc069b55a2 100644 (file)
@@ -201,7 +201,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
        wmKeyMapItem *kmi;
 
        /* Armature ------------------------ */
-       keymap = WM_keymap_find(keyconf, "Armature", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Armature", 0, 0);
        keymap->poll = ED_operator_editarmature;
 
        /* Armature -> Etch-A-Ton ------------------------ */
@@ -309,7 +309,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
 
        /* Pose ------------------------ */
        /* only set in posemode, by space_view3d listener */
-       keymap = WM_keymap_find(keyconf, "Pose", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Pose", 0, 0);
        keymap->poll = ED_operator_posemode;
 
        /* set parent and add object are object-based operators, but we make them
index 5d27e13ed17aaa583527502afe427555ae67806e..4a801d9de64f5527853253ccc78cbc0e2b9f60be 100644 (file)
@@ -169,7 +169,7 @@ void ED_keymap_curve(wmKeyConfig *keyconf)
        wmKeyMap *keymap;
        wmKeyMapItem *kmi;
 
-       keymap = WM_keymap_find(keyconf, "Font", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Font", 0, 0);
        keymap->poll = ED_operator_editfont;
 
        /* only set in editmode font, by space_view3d listener */
@@ -229,7 +229,7 @@ void ED_keymap_curve(wmKeyConfig *keyconf)
        RNA_boolean_set(kmi->ptr, "accent", true); /* accented characters */
 
        /* only set in editmode curve, by space_view3d listener */
-       keymap = WM_keymap_find(keyconf, "Curve", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Curve", 0, 0);
        keymap->poll = ED_operator_editsurfcurve;
 
        WM_keymap_add_menu(keymap, "INFO_MT_edit_curve_add", AKEY, KM_PRESS, KM_SHIFT, 0);
index 2a575c02046bb67563544f424db57cc5099d9a54..e209b7f46e72dabe7361f2af3b0d7477c6e2e83b 100644 (file)
@@ -55,7 +55,7 @@
 /* Generic Drawing Keymap */
 static void ed_keymap_gpencil_general(wmKeyConfig *keyconf)
 {
-       wmKeyMap *keymap = WM_keymap_find(keyconf, "Grease Pencil", 0, 0);
+       wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil", 0, 0);
        wmKeyMapItem *kmi;
 
        /* Draw  --------------------------------------- */
@@ -123,7 +123,7 @@ static bool gp_stroke_editmode_poll(bContext *C)
 /* Stroke Editing Keymap - Only when editmode is enabled */
 static void ed_keymap_gpencil_editing(wmKeyConfig *keyconf)
 {
-       wmKeyMap *keymap = WM_keymap_find(keyconf, "Grease Pencil Stroke Edit Mode", 0, 0);
+       wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Grease Pencil Stroke Edit Mode", 0, 0);
        wmKeyMapItem *kmi;
 
        /* set poll callback - so that this keymap only gets enabled when stroke editmode is enabled */
index 1e67ecdfc90f9f8d24a81cdae6ddb0814ae5d283..d941f429339c102b911e292b77941689308795ef 100644 (file)
@@ -1151,7 +1151,7 @@ void ED_operatortypes_ui(void)
  */
 void ED_keymap_ui(wmKeyConfig *keyconf)
 {
-       wmKeyMap *keymap = WM_keymap_find(keyconf, "User Interface", 0, 0);
+       wmKeyMap *keymap = WM_keymap_ensure(keyconf, "User Interface", 0, 0);
        wmKeyMapItem *kmi;
 
        /* eyedroppers - notice they all have the same shortcut, but pass the event
index 3cad2167cfa3dd95ae84aee6b7b328aaa1763ace..b9ea5d9605731ff6a8ad7da460bbe9f28e965995 100644 (file)
@@ -2098,7 +2098,7 @@ void ED_operatortypes_view2d(void)
 
 void ED_keymap_view2d(wmKeyConfig *keyconf)
 {
-       wmKeyMap *keymap = WM_keymap_find(keyconf, "View2D", 0, 0);
+       wmKeyMap *keymap = WM_keymap_ensure(keyconf, "View2D", 0, 0);
        wmKeyMapItem *kmi;
 
        /* scrollers */
@@ -2158,7 +2158,7 @@ void ED_keymap_view2d(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "VIEW2D_OT_zoom_border", BKEY, KM_PRESS, KM_SHIFT, 0);
 
        /* Alternative keymap for buttons listview */
-       keymap = WM_keymap_find(keyconf, "View2D Buttons List", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "View2D Buttons List", 0, 0);
 
        WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", LEFTMOUSE, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", MIDDLEMOUSE, KM_PRESS, 0, 0);
index 4f2e87c11c141cffb8119326b27abbcee886e9f4..561397d71ffe24abd2018bdd182e6b3aab3db463 100644 (file)
@@ -58,7 +58,7 @@ void ED_keymap_lattice(wmKeyConfig *keyconf)
        wmKeyMap *keymap;
        wmKeyMapItem *kmi;
 
-       keymap = WM_keymap_find(keyconf, "Lattice", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Lattice", 0, 0);
        keymap->poll = ED_operator_editlattice;
 
        kmi = WM_keymap_add_item(keymap, "LATTICE_OT_select_all", AKEY, KM_PRESS, 0, 0);
index 192ada40b5d2e1759c2d4ed48260276c320d4889..540101ba401c0a6bba95f8fae007716e1c678689 100644 (file)
@@ -525,7 +525,7 @@ void ED_keymap_mask(wmKeyConfig *keyconf)
        wmKeyMap *keymap;
        wmKeyMapItem *kmi;
 
-       keymap = WM_keymap_find(keyconf, "Mask Editing", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Mask Editing", 0, 0);
        keymap->poll = ED_maskedit_poll;
 
        WM_keymap_add_item(keymap, "MASK_OT_new", NKEY, KM_PRESS, KM_ALT, 0);
index 658bc5996a82d7c9b3a09d5f2a7a198aa94b5b2f..ca43cfdf3a310967325b9767f56fe3d87339984b 100644 (file)
@@ -297,7 +297,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
        wmKeyMapItem *kmi;
        int i;
 
-       keymap = WM_keymap_find(keyconf, "Mesh", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Mesh", 0, 0);
        keymap->poll = ED_operator_editmesh;
 
        WM_keymap_add_item(keymap, "MESH_OT_loopcut_slide", RKEY, KM_PRESS, KM_CTRL, 0);
index 3ea5f891f5fba86eabf9ac87db9993533aa4b243..b277584ab9eb001aacaa6343452d94b47773df2f 100644 (file)
@@ -72,7 +72,7 @@ void ED_keymap_metaball(wmKeyConfig *keyconf)
        wmKeyMap *keymap;
        wmKeyMapItem *kmi;
 
-       keymap = WM_keymap_find(keyconf, "Metaball", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Metaball", 0, 0);
        keymap->poll = ED_operator_editmball;
 
        WM_keymap_add_item(keymap, "OBJECT_OT_metaball_add", AKEY, KM_PRESS, KM_SHIFT, 0);
index 407cddedbb09f4b9e67381b9f92dc7a8c85e9a61..f6db6d1f5fc56274413463d1e46b3f9d4d91312e 100644 (file)
@@ -287,7 +287,7 @@ void ED_keymap_object(wmKeyConfig *keyconf)
        int i;
 
        /* Objects, Regardless of Mode -------------------------------------------------- */
-       keymap = WM_keymap_find(keyconf, "Object Non-modal", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Object Non-modal", 0, 0);
 
        /* Note: this keymap works disregarding mode */
        kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, 0, 0);
@@ -310,7 +310,7 @@ void ED_keymap_object(wmKeyConfig *keyconf)
 
        /* Object Mode ---------------------------------------------------------------- */
        /* Note: this keymap gets disabled in non-objectmode,  */
-       keymap = WM_keymap_find(keyconf, "Object Mode", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Object Mode", 0, 0);
        keymap->poll = object_mode_poll;
 
        /* object mode supports PET now */
index de2ee73ab260534c458b54ed13a88613a0759428..910e461435c2fe8676495c4b1bef141f45ad381f 100644 (file)
@@ -112,7 +112,7 @@ static void keymap_particle(wmKeyConfig *keyconf)
        wmKeyMapItem *kmi;
        wmKeyMap *keymap;
 
-       keymap = WM_keymap_find(keyconf, "Particle", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Particle", 0, 0);
        keymap->poll = PE_poll;
 
        kmi = WM_keymap_add_item(keymap, "PARTICLE_OT_select_all", AKEY, KM_PRESS, 0, 0);
@@ -221,7 +221,7 @@ static void operatortypes_dynamicpaint(void)
 
 //static void keymap_pointcache(wmWindowManager *wm)
 //{
-//     wmKeyMap *keymap = WM_keymap_find(wm, "Pointcache", 0, 0);
+//     wmKeyMap *keymap = WM_keymap_ensure(wm, "Pointcache", 0, 0);
 //
 //     WM_keymap_add_item(keymap, "PHYSICS_OT_bake_all", AKEY, KM_PRESS, 0, 0);
 //     WM_keymap_add_item(keymap, "PHYSICS_OT_free_all", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
index 6e4cbf27e287d42922f50c0f6e9c34d28439857f..5b6a81328fa4e2fcce0a54c515ac49a9667107b2 100644 (file)
@@ -1375,7 +1375,7 @@ static void ed_default_handlers(wmWindowManager *wm, ScrArea *sa, ListBase *hand
 
        /* XXX it would be good to have boundbox checks for some of these... */
        if (flag & ED_KEYMAP_UI) {
-               wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "User Interface", 0, 0);
+               wmKeyMap *keymap = WM_keymap_ensure(wm->defaultconf, "User Interface", 0, 0);
                WM_event_add_keymap_handler(handlers, keymap);
 
                /* user interface widgets */
@@ -1383,12 +1383,12 @@ static void ed_default_handlers(wmWindowManager *wm, ScrArea *sa, ListBase *hand
        }
        if (flag & ED_KEYMAP_VIEW2D) {
                /* 2d-viewport handling+manipulation */
-               wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "View2D", 0, 0);
+               wmKeyMap *keymap = WM_keymap_ensure(wm->defaultconf, "View2D", 0, 0);
                WM_event_add_keymap_handler(handlers, keymap);
        }
        if (flag & ED_KEYMAP_MARKERS) {
                /* time-markers */
-               wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Markers", 0, 0);
+               wmKeyMap *keymap = WM_keymap_ensure(wm->defaultconf, "Markers", 0, 0);
 
                /* time space only has this keymap, the others get a boundbox restricted map */
                if (sa->spacetype != SPACE_TIME) {
@@ -1406,12 +1406,12 @@ static void ed_default_handlers(wmWindowManager *wm, ScrArea *sa, ListBase *hand
        }
        if (flag & ED_KEYMAP_ANIMATION) {
                /* frame changing and timeline operators (for time spaces) */
-               wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Animation", 0, 0);
+               wmKeyMap *keymap = WM_keymap_ensure(wm->defaultconf, "Animation", 0, 0);
                WM_event_add_keymap_handler(handlers, keymap);
        }
        if (flag & ED_KEYMAP_FRAMES) {
                /* frame changing/jumping (for all spaces) */
-               wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Frames", 0, 0);
+               wmKeyMap *keymap = WM_keymap_ensure(wm->defaultconf, "Frames", 0, 0);
                WM_event_add_keymap_handler(handlers, keymap);
        }
        if (flag & ED_KEYMAP_GPENCIL) {
@@ -1423,15 +1423,15 @@ static void ed_default_handlers(wmWindowManager *wm, ScrArea *sa, ListBase *hand
                 *       For now, it's easier to just include both,
                 *       since you hardly want one without the other.
                 */
-               wmKeyMap *keymap_general = WM_keymap_find(wm->defaultconf, "Grease Pencil", 0, 0);
-               wmKeyMap *keymap_edit = WM_keymap_find(wm->defaultconf, "Grease Pencil Stroke Edit Mode", 0, 0);
+               wmKeyMap *keymap_general = WM_keymap_ensure(wm->defaultconf, "Grease Pencil", 0, 0);
+               wmKeyMap *keymap_edit = WM_keymap_ensure(wm->defaultconf, "Grease Pencil Stroke Edit Mode", 0, 0);
 
                WM_event_add_keymap_handler(handlers, keymap_general);
                WM_event_add_keymap_handler(handlers, keymap_edit);
        }
        if (flag & ED_KEYMAP_HEADER) {
                /* standard keymap for headers regions */
-               wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Header", 0, 0);
+               wmKeyMap *keymap = WM_keymap_ensure(wm->defaultconf, "Header", 0, 0);
                WM_event_add_keymap_handler(handlers, keymap);
        }
 }
@@ -2024,7 +2024,7 @@ void ED_region_panels_init(wmWindowManager *wm, ARegion *ar)
 
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_PANELS_UI, ar->winx, ar->winy);
 
-       keymap = WM_keymap_find(wm->defaultconf, "View2D Buttons List", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "View2D Buttons List", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 }
 
index 44467b6a99401bbc938e8af68d45fde4ace2e0a9..d3d486405c5a517df6d2ea32a76545e61e071e32 100644 (file)
@@ -4604,7 +4604,7 @@ void ED_keymap_screen(wmKeyConfig *keyconf)
        wmKeyMapItem *kmi;
 
        /* Screen Editing ------------------------------------------------ */
-       keymap = WM_keymap_find(keyconf, "Screen Editing", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Screen Editing", 0, 0);
 
        RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_actionzone", LEFTMOUSE, KM_PRESS, 0, 0)->ptr, "modifier", 0);
        RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_actionzone", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "modifier", 1);
@@ -4627,12 +4627,12 @@ void ED_keymap_screen(wmKeyConfig *keyconf)
 
        /* Header Editing ------------------------------------------------ */
        /* note: this is only used when the cursor is inside the header */
-       keymap = WM_keymap_find(keyconf, "Header", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Header", 0, 0);
 
        WM_keymap_add_item(keymap, "SCREEN_OT_header_toolbox", RIGHTMOUSE, KM_PRESS, 0, 0);
 
        /* Screen General ------------------------------------------------ */
-       keymap = WM_keymap_find(keyconf, "Screen", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Screen", 0, 0);
 
        /* standard timers */
        WM_keymap_add_item(keymap, "SCREEN_OT_animation_step", TIMER0, KM_ANY, KM_ANY, 0);
@@ -4696,7 +4696,7 @@ void ED_keymap_screen(wmKeyConfig *keyconf)
 
 
        /* Anim Playback ------------------------------------------------ */
-       keymap = WM_keymap_find(keyconf, "Frames", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Frames", 0, 0);
 
        /* frame offsets */
        RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_offset", UPARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "delta", 10);
@@ -4735,7 +4735,7 @@ void ED_keymap_screen(wmKeyConfig *keyconf)
 
        /* Alternative keys for animation and sequencer playing */
 #if 0 /* XXX: disabled for restoring later... bad implementation */
-       keymap = WM_keymap_find(keyconf, "Frames", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Frames", 0, 0);
        kmi = WM_keymap_add_item(keymap, "SCREEN_OT_animation_play", RIGHTARROWKEY, KM_PRESS, KM_ALT, 0);
        RNA_boolean_set(kmi->ptr, "cycle_speed", true);
 
index b42a825ad7c6e2e8a6deb3e2fd42527370cc8ca1..74984d090f8dff4b51270537fc219715120385f4 100644 (file)
@@ -1255,13 +1255,13 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
        wmKeyMapItem *kmi;
        int i;
 
-       keymap = WM_keymap_find(keyconf, "Paint Curve", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Paint Curve", 0, 0);
        keymap->poll = paint_curve_poll;
 
        paint_keymap_curve(keymap);
 
        /* Sculpt mode */
-       keymap = WM_keymap_find(keyconf, "Sculpt", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Sculpt", 0, 0);
        keymap->poll = sculpt_mode_poll;
 
        RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, 0,        0)->ptr, "mode", BRUSH_STROKE_NORMAL);
@@ -1337,7 +1337,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
        WM_keymap_add_menu(keymap, "VIEW3D_MT_angle_control", RKEY, KM_PRESS, 0, 0);
 
        /* Vertex Paint mode */
-       keymap = WM_keymap_find(keyconf, "Vertex Paint", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Vertex Paint", 0, 0);
        keymap->poll = vertex_paint_mode_poll;
 
        WM_keymap_verify_item(keymap, "PAINT_OT_vertex_paint", LEFTMOUSE, KM_PRESS, 0, 0);
@@ -1364,7 +1364,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
        RNA_string_set(kmi->ptr, "data_path", "tool_settings.vertex_paint.brush.stroke_method");
 
        /* Weight Paint mode */
-       keymap = WM_keymap_find(keyconf, "Weight Paint", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Weight Paint", 0, 0);
        keymap->poll = weight_paint_mode_poll;
 
        WM_keymap_verify_item(keymap, "PAINT_OT_weight_paint", LEFTMOUSE, KM_PRESS, 0, 0);
@@ -1396,7 +1396,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
        RNA_string_set(kmi->ptr, "data_path", "tool_settings.weight_paint.brush.use_smooth_stroke");
 
        /*Weight paint's Vertex Selection Mode */
-       keymap = WM_keymap_find(keyconf, "Weight Paint Vertex Selection", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Weight Paint Vertex Selection", 0, 0);
        keymap->poll = vert_paint_poll;
        kmi = WM_keymap_add_item(keymap, "PAINT_OT_vert_select_all", AKEY, KM_PRESS, 0, 0);
        RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
@@ -1410,7 +1410,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "VIEW3D_OT_select_circle", CKEY, KM_PRESS, 0, 0);
 
        /* Image/Texture Paint mode */
-       keymap = WM_keymap_find(keyconf, "Image Paint", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Image Paint", 0, 0);
        keymap->poll = image_texture_paint_poll;
 
        RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_image_paint", LEFTMOUSE, KM_PRESS, 0,        0)->ptr, "mode", BRUSH_STROKE_NORMAL);
@@ -1439,7 +1439,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
        RNA_string_set(kmi->ptr, "data_path", "tool_settings.image_paint.brush.stroke_method");
 
        /* face-mask mode */
-       keymap = WM_keymap_find(keyconf, "Face Mask", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "Face Mask", 0, 0);
        keymap->poll = facemask_paint_poll;
 
        kmi = WM_keymap_add_item(keymap, "PAINT_OT_face_select_all", AKEY, KM_PRESS, 0, 0);
@@ -1458,7 +1458,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
        kmi = WM_keymap_add_item(keymap, "PAINT_OT_face_select_linked_pick", LKEY, KM_PRESS, KM_SHIFT, 0);
        RNA_boolean_set(kmi->ptr, "deselect", true);
 
-       keymap = WM_keymap_find(keyconf, "UV Sculpt", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "UV Sculpt", 0, 0);
        keymap->poll = uv_sculpt_keymap_poll;
 
        kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", QKEY, KM_PRESS, 0, 0);
index 32407286258499c68b5f50fe1b338444cc5e3f3c..ea7591c36c0e8eb5758a6d404ef43afcc3f68a01 100644 (file)
@@ -275,7 +275,7 @@ void action_keymap(wmKeyConfig *keyconf)
        wmKeyMap *keymap;
 
        /* keymap for all regions */
-       keymap = WM_keymap_find(keyconf, "Dopesheet Generic", SPACE_ACTION, 0);
+       keymap = WM_keymap_ensure(keyconf, "Dopesheet Generic", SPACE_ACTION, 0);
 
        /* region management... */
        WM_keymap_add_item(keymap, "ACTION_OT_properties", NKEY, KM_PRESS, 0, 0);
@@ -288,6 +288,6 @@ void action_keymap(wmKeyConfig *keyconf)
         */
 
        /* keyframes */
-       keymap = WM_keymap_find(keyconf, "Dopesheet", SPACE_ACTION, 0);
+       keymap = WM_keymap_ensure(keyconf, "Dopesheet", SPACE_ACTION, 0);
        action_keymap_keyframes(keyconf, keymap);
 }
index 9082abc05758d22d1d24189394868c6c3a80ea63..a2fe129c819a2705c505bd99b609f58b960f2ce9 100644 (file)
@@ -192,9 +192,9 @@ static void action_main_region_init(wmWindowManager *wm, ARegion *ar)
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
 
        /* own keymap */
-       keymap = WM_keymap_find(wm->defaultconf, "Dopesheet", SPACE_ACTION, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Dopesheet", SPACE_ACTION, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
-       keymap = WM_keymap_find(wm->defaultconf, "Dopesheet Generic", SPACE_ACTION, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Dopesheet Generic", SPACE_ACTION, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 }
 
@@ -266,10 +266,10 @@ static void action_channel_region_init(wmWindowManager *wm, ARegion *ar)
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
 
        /* own keymap */
-       keymap = WM_keymap_find(wm->defaultconf, "Animation Channels", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Animation Channels", 0, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Dopesheet Generic", SPACE_ACTION, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Dopesheet Generic", SPACE_ACTION, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 }
 
@@ -550,7 +550,7 @@ static void action_buttons_area_init(wmWindowManager *wm, ARegion *ar)
 
        ED_region_panels_init(wm, ar);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Dopesheet Generic", SPACE_ACTION, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Dopesheet Generic", SPACE_ACTION, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 }
 
index 7bcad841bca298e0921b75eb803415d2e5907393..1ff0cb53f6add17c8e1e49a531ef7c02ab51b14f 100644 (file)
@@ -131,7 +131,7 @@ static void buttons_main_region_init(wmWindowManager *wm, ARegion *ar)
 
        ED_region_panels_init(wm, ar);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Property Editor", SPACE_BUTS, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Property Editor", SPACE_BUTS, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 }
 
@@ -185,7 +185,7 @@ static void buttons_operatortypes(void)
 
 static void buttons_keymap(struct wmKeyConfig *keyconf)
 {
-       wmKeyMap *keymap = WM_keymap_find(keyconf, "Property Editor", SPACE_BUTS, 0);
+       wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Property Editor", SPACE_BUTS, 0);
 
        WM_keymap_add_item(keymap, "BUTTONS_OT_toolbox", RIGHTMOUSE, KM_PRESS, 0, 0);
 }
index 2d17460318eb751740b7b6d3fc28ae330efc19c8..35aa9896d12e9a89ff2abd2c6e312bf81ed6d2d7 100644 (file)
@@ -548,7 +548,7 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
 
        /* ******** Global hotkeys avalaible for all regions ******** */
 
-       keymap = WM_keymap_find(keyconf, "Clip", SPACE_CLIP, 0);
+       keymap = WM_keymap_ensure(keyconf, "Clip", SPACE_CLIP, 0);
 
        WM_keymap_add_item(keymap, "CLIP_OT_open", OKEY, KM_PRESS, KM_ALT, 0);
 
@@ -588,7 +588,7 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
 
        /* ******** Hotkeys avalaible for main region only ******** */
 
-       keymap = WM_keymap_find(keyconf, "Clip Editor", SPACE_CLIP, 0);
+       keymap = WM_keymap_ensure(keyconf, "Clip Editor", SPACE_CLIP, 0);
 //     keymap->poll = ED_space_clip_tracking_poll;
        /* ** View/navigation ** */
 
@@ -756,7 +756,7 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
 
        /* ******** Hotkeys avalaible for preview region only ******** */
 
-       keymap = WM_keymap_find(keyconf, "Clip Graph Editor", SPACE_CLIP, 0);
+       keymap = WM_keymap_ensure(keyconf, "Clip Graph Editor", SPACE_CLIP, 0);
 
        /* "timeline" */
        WM_keymap_add_item(keymap, "CLIP_OT_change_frame", ACTIONMOUSE, KM_PRESS, 0, 0);
@@ -810,7 +810,7 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
 
        /* ******** Hotkeys avalaible for channels region only ******** */
 
-       keymap = WM_keymap_find(keyconf, "Clip Dopesheet Editor", SPACE_CLIP, 0);
+       keymap = WM_keymap_ensure(keyconf, "Clip Dopesheet Editor", SPACE_CLIP, 0);
 
        kmi = WM_keymap_add_item(keymap, "CLIP_OT_dopesheet_select_channel", LEFTMOUSE, KM_PRESS, 0, 0);
        RNA_boolean_set(kmi->ptr, "extend", true);  /* toggle */
@@ -1137,14 +1137,14 @@ static void clip_main_region_init(wmWindowManager *wm, ARegion *ar)
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy);
 
        /* mask polls mode */
-       keymap = WM_keymap_find(wm->defaultconf, "Mask Editing", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", 0, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
        /* own keymap */
-       keymap = WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Clip", SPACE_CLIP, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Clip Editor", SPACE_CLIP, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Clip Editor", SPACE_CLIP, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 }
 
@@ -1261,13 +1261,13 @@ static void clip_preview_region_init(wmWindowManager *wm, ARegion *ar)
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
 
        /* own keymap */
-       keymap = WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Clip", SPACE_CLIP, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Clip Graph Editor", SPACE_CLIP, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Clip Graph Editor", SPACE_CLIP, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Clip Dopesheet Editor", SPACE_CLIP, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Clip Dopesheet Editor", SPACE_CLIP, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 }
 
@@ -1365,7 +1365,7 @@ static void clip_channels_region_init(wmWindowManager *wm, ARegion *ar)
 
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Clip Dopesheet Editor", SPACE_CLIP, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Clip Dopesheet Editor", SPACE_CLIP, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 }
 
@@ -1437,7 +1437,7 @@ static void clip_tools_region_init(wmWindowManager *wm, ARegion *ar)
 
        ED_region_panels_init(wm, ar);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Clip", SPACE_CLIP, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 }
 
@@ -1480,7 +1480,7 @@ static void clip_properties_region_init(wmWindowManager *wm, ARegion *ar)
 
        ED_region_panels_init(wm, ar);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Clip", SPACE_CLIP, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 }
 
index 3f5adf6c1c5fbd2a80034ee86045fdcd1abe8131..919602f7bb5654fe392448c3ed7eb318cc81e941 100644 (file)
@@ -145,7 +145,7 @@ static void console_main_region_init(wmWindowManager *wm, ARegion *ar)
        }
 
        /* own keymap */
-       keymap = WM_keymap_find(wm->defaultconf, "Console", SPACE_CONSOLE, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Console", SPACE_CONSOLE, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
        /* add drop boxes */
@@ -271,7 +271,7 @@ static void console_operatortypes(void)
 
 static void console_keymap(struct wmKeyConfig *keyconf)
 {
-       wmKeyMap *keymap = WM_keymap_find(keyconf, "Console", SPACE_CONSOLE, 0);
+       wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Console", SPACE_CONSOLE, 0);
        wmKeyMapItem *kmi;
 
 #ifdef __APPLE__
index 94f47d5a6aa7c67a95e9d25715653a4dace24161..7bab5e34d40e9625fe22dcc190d4824589bc7aeb 100644 (file)
@@ -330,10 +330,10 @@ static void file_main_region_init(wmWindowManager *wm, ARegion *ar)
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
 
        /* own keymaps */
-       keymap = WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "File Browser", SPACE_FILE, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
-       keymap = WM_keymap_find(wm->defaultconf, "File Browser Main", SPACE_FILE, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "File Browser Main", SPACE_FILE, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 }
 
@@ -453,7 +453,7 @@ static void file_keymap(struct wmKeyConfig *keyconf)
 {
        wmKeyMapItem *kmi;
        /* keys for all regions */
-       wmKeyMap *keymap = WM_keymap_find(keyconf, "File Browser", SPACE_FILE, 0);
+       wmKeyMap *keymap = WM_keymap_ensure(keyconf, "File Browser", SPACE_FILE, 0);
 
        /* More common 'fliebrowser-like navigation' shortcuts. */
        WM_keymap_add_item(keymap, "FILE_OT_parent", UPARROWKEY, KM_PRESS, KM_ALT, 0);
@@ -476,7 +476,7 @@ static void file_keymap(struct wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "FILE_OT_bookmark_add", BKEY, KM_PRESS, KM_CTRL, 0);
 
        /* keys for main region */
-       keymap = WM_keymap_find(keyconf, "File Browser Main", SPACE_FILE, 0);
+       keymap = WM_keymap_ensure(keyconf, "File Browser Main", SPACE_FILE, 0);
        kmi = WM_keymap_add_item(keymap, "FILE_OT_execute", LEFTMOUSE, KM_DBL_CLICK, 0, 0);
        RNA_boolean_set(kmi->ptr, "need_active", true);
 
@@ -568,7 +568,7 @@ static void file_keymap(struct wmKeyConfig *keyconf)
 
 
        /* keys for button region (top) */
-       keymap = WM_keymap_find(keyconf, "File Browser Buttons", SPACE_FILE, 0);
+       keymap = WM_keymap_ensure(keyconf, "File Browser Buttons", SPACE_FILE, 0);
        kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, 0, 0);
        RNA_int_set(kmi->ptr, "increment", 1);
        kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, KM_SHIFT, 0);
@@ -592,7 +592,7 @@ static void file_tools_region_init(wmWindowManager *wm, ARegion *ar)
        ED_region_panels_init(wm, ar);
 
        /* own keymaps */
-       keymap = WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "File Browser", SPACE_FILE, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 }
 
@@ -618,7 +618,7 @@ static void file_header_region_init(wmWindowManager *wm, ARegion *ar)
 
        ED_region_header_init(ar);
 
-       keymap = WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "File Browser", SPACE_FILE, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 }
 
@@ -635,10 +635,10 @@ static void file_ui_region_init(wmWindowManager *wm, ARegion *ar)
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
 
        /* own keymap */
-       keymap = WM_keymap_find(wm->defaultconf, "File Browser", SPACE_FILE, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "File Browser", SPACE_FILE, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
-       keymap = WM_keymap_find(wm->defaultconf, "File Browser Buttons", SPACE_FILE, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "File Browser Buttons", SPACE_FILE, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 }
 
index c5d6093dc4a329e7f5c9b49ebaa393783c8d3307..0bb46ca6fb85f04ae39fac525415d31b126085f0 100644 (file)
@@ -686,7 +686,7 @@ void graphedit_keymap(wmKeyConfig *keyconf)
        wmKeyMapItem *kmi;
 
        /* keymap for all regions */
-       keymap = WM_keymap_find(keyconf, "Graph Editor Generic", SPACE_IPO, 0);
+       keymap = WM_keymap_ensure(keyconf, "Graph Editor Generic", SPACE_IPO, 0);
        WM_keymap_add_item(keymap, "GRAPH_OT_properties", NKEY, KM_PRESS, 0, 0);
 
        /* extrapolation works on channels, not keys */
@@ -712,6 +712,6 @@ void graphedit_keymap(wmKeyConfig *keyconf)
         */
 
        /* keyframes */
-       keymap = WM_keymap_find(keyconf, "Graph Editor", SPACE_IPO, 0);
+       keymap = WM_keymap_ensure(keyconf, "Graph Editor", SPACE_IPO, 0);
        graphedit_keymap_keyframes(keyconf, keymap);
 }
index 5eec0b05e416a86eaf296fe01bdefe44826e337d..4e39c741b9baa5d215ed36e531449a7aa344776b 100644 (file)
@@ -216,9 +216,9 @@ static void graph_main_region_init(wmWindowManager *wm, ARegion *ar)
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
 
        /* own keymap */
-       keymap = WM_keymap_find(wm->defaultconf, "Graph Editor", SPACE_IPO, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Graph Editor", SPACE_IPO, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
-       keymap = WM_keymap_find(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 }
 
@@ -343,9 +343,9 @@ static void graph_channel_region_init(wmWindowManager *wm, ARegion *ar)
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
 
        /* own keymap */
-       keymap = WM_keymap_find(wm->defaultconf, "Animation Channels", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Animation Channels", 0, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
-       keymap = WM_keymap_find(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 }
 
@@ -395,7 +395,7 @@ static void graph_buttons_region_init(wmWindowManager *wm, ARegion *ar)
 
        ED_region_panels_init(wm, ar);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Graph Editor Generic", SPACE_IPO, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 }
 
index b9c0ca66778bfcc61e4584f83fba23c3b6acb187..fd661883f796e86faf3174c5c7cc22c4fd755a9f 100644 (file)
@@ -282,7 +282,7 @@ static void image_operatortypes(void)
 
 static void image_keymap(struct wmKeyConfig *keyconf)
 {
-       wmKeyMap *keymap = WM_keymap_find(keyconf, "Image Generic", SPACE_IMAGE, 0);
+       wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Image Generic", SPACE_IMAGE, 0);
        wmKeyMapItem *kmi;
        int i;
 
@@ -298,7 +298,7 @@ static void image_keymap(struct wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "IMAGE_OT_cycle_render_slot", JKEY, KM_PRESS, 0, 0);
        RNA_boolean_set(WM_keymap_add_item(keymap, "IMAGE_OT_cycle_render_slot", JKEY, KM_PRESS, KM_ALT, 0)->ptr, "reverse", true);
 
-       keymap = WM_keymap_find(keyconf, "Image", SPACE_IMAGE, 0);
+       keymap = WM_keymap_ensure(keyconf, "Image", SPACE_IMAGE, 0);
 
        WM_keymap_add_item(keymap, "IMAGE_OT_view_all", HOMEKEY, KM_PRESS, 0, 0);
 
@@ -660,29 +660,29 @@ static void image_main_region_init(wmWindowManager *wm, ARegion *ar)
        // UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy);
 
        /* mask polls mode */
-       keymap = WM_keymap_find(wm->defaultconf, "Mask Editing", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", 0, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
        /* image paint polls for mode */
-       keymap = WM_keymap_find(wm->defaultconf, "Curve", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Curve", 0, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Paint Curve", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Paint Curve", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Image Paint", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Image Paint", 0, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
-       keymap = WM_keymap_find(wm->defaultconf, "UV Editor", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "UV Editor", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap = WM_keymap_find(wm->defaultconf, "UV Sculpt", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "UV Sculpt", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
        /* own keymaps */
-       keymap = WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
-       keymap = WM_keymap_find(wm->defaultconf, "Image", SPACE_IMAGE, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Image", SPACE_IMAGE, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
 }
@@ -835,7 +835,7 @@ static void image_buttons_region_init(wmWindowManager *wm, ARegion *ar)
        ar->v2d.scroll = V2D_SCROLL_RIGHT | V2D_SCROLL_VERTICAL_HIDE;
        ED_region_panels_init(wm, ar);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 }
 
@@ -887,7 +887,7 @@ static void image_tools_region_init(wmWindowManager *wm, ARegion *ar)
        ar->v2d.scroll = V2D_SCROLL_RIGHT | V2D_SCROLL_VERTICAL_HIDE;
        ED_region_panels_init(wm, ar);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 }
 
index 9ffa73af52be502c3c4ffad99ad919ee06bf8d87..7e3d57f95ed64d099640cb014b6f2e3f5b462f3d 100644 (file)
@@ -133,7 +133,7 @@ static void info_main_region_init(wmWindowManager *wm, ARegion *ar)
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
 
        /* own keymap */
-       keymap = WM_keymap_find(wm->defaultconf, "Info", SPACE_INFO, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Info", SPACE_INFO, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 }
 
@@ -203,12 +203,12 @@ static void info_operatortypes(void)
 
 static void info_keymap(struct wmKeyConfig *keyconf)
 {
-       wmKeyMap *keymap = WM_keymap_find(keyconf, "Window", 0, 0);
+       wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Window", 0, 0);
 
        WM_keymap_verify_item(keymap, "INFO_OT_reports_display_update", TIMERREPORT, KM_ANY, KM_ANY, 0);
 
        /* info space */
-       keymap = WM_keymap_find(keyconf, "Info", SPACE_INFO, 0);
+       keymap = WM_keymap_ensure(keyconf, "Info", SPACE_INFO, 0);
 
 
        /* report selection */
index 339139b7e9e6075272b7134c718a566c37a9fbc4..6d484b4cb4c69e50b66c9cc6b51d0bc3c7bd0fcb 100644 (file)
@@ -179,7 +179,7 @@ static void logic_operatortypes(void)
 
 static void logic_keymap(struct wmKeyConfig *keyconf)
 {
-       wmKeyMap *keymap = WM_keymap_find(keyconf, "Logic Editor", SPACE_LOGIC, 0);
+       wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Logic Editor", SPACE_LOGIC, 0);
 
        WM_keymap_add_item(keymap, "LOGIC_OT_properties", NKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "LOGIC_OT_links_cut", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
@@ -242,7 +242,7 @@ static void logic_main_region_init(wmWindowManager *wm, ARegion *ar)
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
 
        /* own keymaps */
-       keymap = WM_keymap_find(wm->defaultconf, "Logic Editor", SPACE_LOGIC, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Logic Editor", SPACE_LOGIC, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 }
 
@@ -281,7 +281,7 @@ static void logic_buttons_region_init(wmWindowManager *wm, ARegion *ar)
 
        ED_region_panels_init(wm, ar);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Logic Editor", SPACE_LOGIC, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Logic Editor", SPACE_LOGIC, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 }
 
index 5bfd73b816302320862c14d9ab0fdb63c88b8db6..78e70b765641a6075830ec7f35d521c0d680dc5b 100644 (file)
@@ -313,7 +313,7 @@ void nla_keymap(wmKeyConfig *keyconf)
        wmKeyMapItem *kmi;
 
        /* keymap for all regions ------------------------------------------- */
-       keymap = WM_keymap_find(keyconf, "NLA Generic", SPACE_NLA, 0);
+       keymap = WM_keymap_ensure(keyconf, "NLA Generic", SPACE_NLA, 0);
 
        /* region management */
        WM_keymap_add_item(keymap, "NLA_OT_properties", NKEY, KM_PRESS, 0, 0);
@@ -345,10 +345,10 @@ void nla_keymap(wmKeyConfig *keyconf)
         *
         * However, those operations which involve clicking on channels and/or the placement of them in the view are implemented here instead
         */
-       keymap = WM_keymap_find(keyconf, "NLA Channels", SPACE_NLA, 0);
+       keymap = WM_keymap_ensure(keyconf, "NLA Channels", SPACE_NLA, 0);
        nla_keymap_channels(keymap);
 
        /* data ------------------------------------------------------------- */
-       keymap = WM_keymap_find(keyconf, "NLA Editor", SPACE_NLA, 0);
+       keymap = WM_keymap_ensure(keyconf, "NLA Editor", SPACE_NLA, 0);
        nla_keymap_main(keyconf, keymap);
 }
index 88ef4a181420fcc4aa28ee6c405f2b8c797affed..1f9ff9aaabd86bd48be5e7becffe58b4c7006157 100644 (file)
@@ -212,13 +212,13 @@ static void nla_channel_region_init(wmWindowManager *wm, ARegion *ar)
 
        /* own keymap */
        /* own channels map first to override some channel keymaps */
-       keymap = WM_keymap_find(wm->defaultconf, "NLA Channels", SPACE_NLA, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "NLA Channels", SPACE_NLA, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
        /* now generic channels map for everything else that can apply */
-       keymap = WM_keymap_find(wm->defaultconf, "Animation Channels", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Animation Channels", 0, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
-       keymap = WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "NLA Generic", SPACE_NLA, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 }
 
@@ -258,9 +258,9 @@ static void nla_main_region_init(wmWindowManager *wm, ARegion *ar)
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
 
        /* own keymap */
-       keymap = WM_keymap_find(wm->defaultconf, "NLA Editor", SPACE_NLA, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "NLA Editor", SPACE_NLA, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
-       keymap = WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "NLA Generic", SPACE_NLA, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 }
 
@@ -344,7 +344,7 @@ static void nla_buttons_region_init(wmWindowManager *wm, ARegion *ar)
 
        ED_region_panels_init(wm, ar);
 
-       keymap = WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "NLA Generic", SPACE_NLA, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 }
 
index ea07341beb98b22633d9082f798cfee088193be6..d4585c0835da9279896bbf056e113170c4315e39 100644 (file)
@@ -231,13 +231,13 @@ void node_keymap(struct wmKeyConfig *keyconf)
        wmKeyMapItem *kmi;
 
        /* Entire Editor only ----------------- */
-       keymap = WM_keymap_find(keyconf, "Node Generic", SPACE_NODE, 0);
+       keymap = WM_keymap_ensure(keyconf, "Node Generic", SPACE_NODE, 0);
 
        WM_keymap_add_item(keymap, "NODE_OT_properties", NKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "NODE_OT_toolbar", TKEY, KM_PRESS, 0, 0);
 
        /* Main Region only ----------------- */
-       keymap = WM_keymap_find(keyconf, "Node Editor", SPACE_NODE, 0);
+       keymap = WM_keymap_ensure(keyconf, "Node Editor", SPACE_NODE, 0);
 
        /* mouse select in nodes used to be both keys, but perhaps this should be reduced?
         * NOTE: mouse-clicks on left-mouse will fall through to allow transform-tweak, but also link/resize
index 33f4847c90f25765c9afa2b1645e58e5c1a8d366..ed228cdaf74a1922118ca5ec3e18cc4a30a8ac73 100644 (file)
@@ -593,7 +593,7 @@ static void node_buttons_region_init(wmWindowManager *wm, ARegion *ar)
 
        ED_region_panels_init(wm, ar);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Node Generic", SPACE_NODE, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Node Generic", SPACE_NODE, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 }
 
@@ -609,7 +609,7 @@ static void node_toolbar_region_init(wmWindowManager *wm, ARegion *ar)
 
        ED_region_panels_init(wm, ar);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Node Generic", SPACE_NODE, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Node Generic", SPACE_NODE, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 }
 
@@ -644,10 +644,10 @@ static void node_main_region_init(wmWindowManager *wm, ARegion *ar)
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
 
        /* own keymaps */
-       keymap = WM_keymap_find(wm->defaultconf, "Node Generic", SPACE_NODE, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Node Generic", SPACE_NODE, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Node Editor", SPACE_NODE, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Node Editor", SPACE_NODE, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
        /* add drop boxes */
index 9574e82505fc7d3ba3962f42d2f09339ec92afeb..16cd383b5c2ab5ce2bdb350064956bd1fe6817ba 100644 (file)
@@ -91,7 +91,7 @@ void outliner_operatortypes(void)
 
 void outliner_keymap(wmKeyConfig *keyconf)
 {
-       wmKeyMap *keymap = WM_keymap_find(keyconf, "Outliner", SPACE_OUTLINER, 0);
+       wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Outliner", SPACE_OUTLINER, 0);
        wmKeyMapItem *kmi;
 
        WM_keymap_add_item(keymap, "OUTLINER_OT_item_rename", LEFTMOUSE, KM_DBL_CLICK, 0, 0);
index 413ea8cc3a7016ceebfb6c5ad1f554aac584ce27..c10399278105611c644b9b22fa7ceeb763d778d6 100644 (file)
@@ -81,7 +81,7 @@ static void outliner_main_region_init(wmWindowManager *wm, ARegion *ar)
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
 
        /* own keymap */
-       keymap = WM_keymap_find(wm->defaultconf, "Outliner", SPACE_OUTLINER, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Outliner", SPACE_OUTLINER, 0);
        /* don't pass on view2d mask, it's always set with scrollbar space, hide fails */
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, NULL, &ar->winrct);
 
index 6f72c1d0159f83fcc71fd104596d98137db358f6..2adfcc521f593f408b435c170429837a70a83ffc 100644 (file)
@@ -132,7 +132,7 @@ static void script_main_region_init(wmWindowManager *wm, ARegion *ar)
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy);
 
        /* own keymap */
-       keymap = WM_keymap_find(wm->defaultconf, "Script", SPACE_SCRIPT, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Script", SPACE_SCRIPT, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 }
 
index 234989ef244894874cb9ac2506763acab5688b8b..408dc551382f44e54ad72b08ad6d845bbc375d9b 100644 (file)
@@ -137,7 +137,7 @@ void sequencer_keymap(wmKeyConfig *keyconf)
        wmKeyMapItem *kmi;
 
        /* Common items ------------------------------------------------------------------ */
-       keymap = WM_keymap_find(keyconf, "SequencerCommon", SPACE_SEQ, 0);
+       keymap = WM_keymap_ensure(keyconf, "SequencerCommon", SPACE_SEQ, 0);
 
        WM_keymap_add_item(keymap, "SEQUENCER_OT_properties", NKEY, KM_PRESS, 0, 0);
 
@@ -148,7 +148,7 @@ void sequencer_keymap(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "SEQUENCER_OT_view_toggle", TABKEY, KM_PRESS, KM_CTRL, 0);
 
        /* Strips Region --------------------------------------------------------------- */
-       keymap = WM_keymap_find(keyconf, "Sequencer", SPACE_SEQ, 0);
+       keymap = WM_keymap_ensure(keyconf, "Sequencer", SPACE_SEQ, 0);
 
        kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_select_all", AKEY, KM_PRESS, 0, 0);
        RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
@@ -340,7 +340,7 @@ void sequencer_keymap(wmKeyConfig *keyconf)
 
 
        /* Preview Region ----------------------------------------------------------- */
-       keymap = WM_keymap_find(keyconf, "SequencerPreview", SPACE_SEQ, 0);
+       keymap = WM_keymap_ensure(keyconf, "SequencerPreview", SPACE_SEQ, 0);
        WM_keymap_add_item(keymap, "SEQUENCER_OT_view_all_preview", HOMEKEY, KM_PRESS, 0, 0);
 #ifdef WITH_INPUT_NDOF
        WM_keymap_add_item(keymap, "SEQUENCER_OT_view_all_preview", NDOF_BUTTON_FIT, KM_PRESS, 0, 0);
index 281dafe32c9f99457a0738e765eeeb1b64e08ae3..ebeeef191918b02fa14c83dcaf90452cf37304d7 100644 (file)
@@ -475,15 +475,15 @@ static void sequencer_main_region_init(wmWindowManager *wm, ARegion *ar)
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
 
 #if 0
-       keymap = WM_keymap_find(wm->defaultconf, "Mask Editing", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", 0, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 #endif
 
-       keymap = WM_keymap_find(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
        /* own keymap */
-       keymap = WM_keymap_find(wm->defaultconf, "Sequencer", SPACE_SEQ, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Sequencer", SPACE_SEQ, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
        /* add drop boxes */
@@ -556,15 +556,15 @@ static void sequencer_preview_region_init(wmWindowManager *wm, ARegion *ar)
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
 
 #if 0
-       keymap = WM_keymap_find(wm->defaultconf, "Mask Editing", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", 0, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 #endif
 
-       keymap = WM_keymap_find(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
        /* own keymap */
-       keymap = WM_keymap_find(wm->defaultconf, "SequencerPreview", SPACE_SEQ, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "SequencerPreview", SPACE_SEQ, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 }
 
@@ -659,7 +659,7 @@ static void sequencer_buttons_region_init(wmWindowManager *wm, ARegion *ar)
 {
        wmKeyMap *keymap;
 
-       keymap = WM_keymap_find(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
        ED_region_panels_init(wm, ar);
index 3bc859dcf1713d275dc109e2633c3984285811c4..fc05fb51c1ab93ae30e21e4c1f6f3809f5a4b8f2 100644 (file)
@@ -243,7 +243,7 @@ static void text_keymap(struct wmKeyConfig *keyconf)
        wmKeyMap *keymap;
        wmKeyMapItem *kmi;
 
-       keymap = WM_keymap_find(keyconf, "Text Generic", SPACE_TEXT, 0);
+       keymap = WM_keymap_ensure(keyconf, "Text Generic", SPACE_TEXT, 0);
        WM_keymap_add_item(keymap, "TEXT_OT_start_find", FKEY, KM_PRESS, KM_CTRL, 0);
 #ifdef __APPLE__
        WM_keymap_add_item(keymap, "TEXT_OT_start_find", FKEY, KM_PRESS, KM_OSKEY, 0);
@@ -253,7 +253,7 @@ static void text_keymap(struct wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "TEXT_OT_replace", HKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_item(keymap, "TEXT_OT_properties", TKEY, KM_PRESS, KM_CTRL, 0);
 
-       keymap = WM_keymap_find(keyconf, "Text", SPACE_TEXT, 0);
+       keymap = WM_keymap_ensure(keyconf, "Text", SPACE_TEXT, 0);
 
 #ifdef __APPLE__
        RNA_enum_set(WM_keymap_add_item(keymap, "TEXT_OT_move", LEFTARROWKEY, KM_PRESS, KM_OSKEY, 0)->ptr, "type", LINE_BEGIN);
@@ -421,9 +421,9 @@ static void text_main_region_init(wmWindowManager *wm, ARegion *ar)
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy);
 
        /* own keymap */
-       keymap = WM_keymap_find(wm->defaultconf, "Text Generic", SPACE_TEXT, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Text Generic", SPACE_TEXT, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
-       keymap = WM_keymap_find(wm->defaultconf, "Text", SPACE_TEXT, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Text", SPACE_TEXT, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
        /* add drop boxes */
@@ -541,7 +541,7 @@ static void text_properties_region_init(wmWindowManager *wm, ARegion *ar)
        ED_region_panels_init(wm, ar);
 
        /* own keymaps */
-       keymap = WM_keymap_find(wm->defaultconf, "Text Generic", SPACE_TEXT, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Text Generic", SPACE_TEXT, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 
 }
index 97daed53e2422ecc655f54b36c9b9c0aa94f6a09..e3fe124a5c4282e3caf2d5aaef4be4addcec02cb 100644 (file)
@@ -562,7 +562,7 @@ static void time_main_region_init(wmWindowManager *wm, ARegion *ar)
        UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
 
        /* own keymap */
-       keymap = WM_keymap_find(wm->defaultconf, "Timeline", SPACE_TIME, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Timeline", SPACE_TIME, 0);
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 }
 
index d88e2fdae91ef00fd1d510025a2fb789424a2a26..a68bd2a9fbb81e2537100e95446b82222aa006bc 100644 (file)
@@ -214,7 +214,7 @@ void time_operatortypes(void)
 
 void time_keymap(wmKeyConfig *keyconf)
 {
-       wmKeyMap *keymap = WM_keymap_find(keyconf, "Timeline", SPACE_TIME, 0);
+       wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Timeline", SPACE_TIME, 0);
 
        WM_keymap_add_item(keymap, "TIME_OT_start_frame_set", SKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "TIME_OT_end_frame_set", EKEY, KM_PRESS, 0, 0);
index 7f3a36c7ba6b37e5b27fde89cd0828432d5104b5..fed056333c0d5b18d7039e0c9217b3301064d200 100644 (file)
@@ -485,74 +485,74 @@ static void view3d_main_region_init(wmWindowManager *wm, ARegion *ar)
        /* object ops. */
 
        /* important to be before Pose keymap since they can both be enabled at once */
-       keymap = WM_keymap_find(wm->defaultconf, "Face Mask", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Face Mask", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
 
-       keymap = WM_keymap_find(wm->defaultconf, "Weight Paint Vertex Selection", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Weight Paint Vertex Selection", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
        /* pose is not modal, operator poll checks for this */
-       keymap = WM_keymap_find(wm->defaultconf, "Pose", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Pose", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Object Mode", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Object Mode", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Paint Curve", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Paint Curve", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Curve", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Curve", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Image Paint", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Image Paint", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Vertex Paint", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Vertex Paint", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Weight Paint", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Weight Paint", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Sculpt", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Sculpt", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Mesh", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Mesh", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Curve", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Curve", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Armature", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Armature", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Pose", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Pose", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Metaball", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Metaball", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Lattice", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Lattice", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Particle", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Particle", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
        /* editfont keymap swallows all... */
-       keymap = WM_keymap_find(wm->defaultconf, "Font", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Font", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Object Non-modal", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Object Non-modal", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap = WM_keymap_find(wm->defaultconf, "Frames", 0, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "Frames", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
        /* own keymap, last so modes can override it */
-       keymap = WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
-       keymap = WM_keymap_find(wm->defaultconf, "3D View", SPACE_VIEW3D, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "3D View", SPACE_VIEW3D, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
        /* add drop boxes */
@@ -1036,7 +1036,7 @@ static void view3d_main_region_cursor(wmWindow *win, ScrArea *UNUSED(sa), ARegio
 /* add handlers, stuff you only do once or on area/region changes */
 static void view3d_header_region_init(wmWindowManager *wm, ARegion *ar)
 {
-       wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
+       wmKeyMap *keymap = WM_keymap_ensure(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
 
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 
@@ -1085,7 +1085,7 @@ static void view3d_buttons_region_init(wmWindowManager *wm, ARegion *ar)
 
        ED_region_panels_init(wm, ar);
 
-       keymap = WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 }
 
@@ -1191,7 +1191,7 @@ static void view3d_tools_region_init(wmWindowManager *wm, ARegion *ar)
 
        ED_region_panels_init(wm, ar);
 
-       keymap = WM_keymap_find(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
+       keymap = WM_keymap_ensure(wm->defaultconf, "3D View Generic", SPACE_VIEW3D, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
 }
 
index a1441d74af46aa4c6f2da37530fe8173a181deca..5d662282e56a459204913e38b88071c8ccce44ad 100644 (file)
@@ -232,13 +232,13 @@ void view3d_keymap(wmKeyConfig *keyconf)
        wmKeyMap *keymap;
        wmKeyMapItem *kmi;
 
-       keymap = WM_keymap_find(keyconf, "3D View Generic", SPACE_VIEW3D, 0);
+       keymap = WM_keymap_ensure(keyconf, "3D View Generic", SPACE_VIEW3D, 0);
 
        WM_keymap_add_item(keymap, "VIEW3D_OT_properties", NKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "VIEW3D_OT_toolshelf", TKEY, KM_PRESS, 0, 0);
 
        /* only for region 3D window */
-       keymap = WM_keymap_find(keyconf, "3D View", SPACE_VIEW3D, 0);
+       keymap = WM_keymap_ensure(keyconf, "3D View", SPACE_VIEW3D, 0);
 
        /* Shift+LMB behavior first, so it has priority over KM_ANY item below. */
        kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_manipulator", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0);
index 375dda7dd6a0a2d914b2e84964228d3eb0078aba..c0378f967ad0613ebd97e8275b9a38c0f6ddbaef 100644 (file)
@@ -4458,7 +4458,7 @@ void ED_keymap_uvedit(wmKeyConfig *keyconf)
        wmKeyMap *keymap;
        wmKeyMapItem *kmi;
 
-       keymap = WM_keymap_find(keyconf, "UV Editor", 0, 0);
+       keymap = WM_keymap_ensure(keyconf, "UV Editor", 0, 0);
        keymap->poll = ED_operator_uvedit_can_uv_sculpt;
 
        /* Uv sculpt toggle */
index dc13ef3d163c1efc40c68b854cb8380514309228..3015d56e1ee04f00a5426feb9ab1d6931334096b 100644 (file)
@@ -253,7 +253,7 @@ static void rna_KeyMap_item_remove(wmKeyMap *km, ReportList *reports, PointerRNA
 static wmKeyMap *rna_keymap_new(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid, bool modal)
 {
        if (modal == 0) {
-               return WM_keymap_find(keyconf, idname, spaceid, regionid);
+               return WM_keymap_ensure(keyconf, idname, spaceid, regionid);
        }
        else {
                return WM_modalkeymap_add(keyconf, idname, NULL); /* items will be lazy init */
index 9d0ccbfef64e97cbb0e43aaaa1f3874435934182..c6dad2ef03ce044cb8f76353aa90c432c30b66b3 100644 (file)
@@ -71,7 +71,7 @@ bool        WM_keymap_remove_item(struct wmKeyMap *keymap, struct wmKeyMapItem *
 int         WM_keymap_item_to_string(wmKeyMapItem *kmi, const bool compact, char *result, const int result_len);
 
 wmKeyMap       *WM_keymap_list_find(ListBase *lb, const char *idname, int spaceid, int regionid);
-wmKeyMap       *WM_keymap_find(struct wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid);
+wmKeyMap       *WM_keymap_ensure(struct wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid);
 wmKeyMap       *WM_keymap_find_all(const struct bContext *C, const char *idname, int spaceid, int regionid);
 wmKeyMap       *WM_keymap_active(struct wmWindowManager *wm, struct wmKeyMap *keymap);
 wmKeyMap       *WM_keymap_guess_opname(const struct bContext *C, const char *opname);
index 762cef4a635713fe4508754a55394d29e3cfcf72..ccf06155f258724db3b423ccffd1b31cd233ef2c 100644 (file)
@@ -771,7 +771,7 @@ wmKeyMap *WM_keymap_list_find(ListBase *lb, const char *idname, int spaceid, int
        return NULL;
 }
 
-wmKeyMap *WM_keymap_find(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
+wmKeyMap *WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
 {
        wmKeyMap *km = WM_keymap_list_find(&keyconf->keymaps, idname, spaceid, regionid);
 
@@ -798,7 +798,7 @@ wmKeyMap *WM_keymap_find_all(const bContext *C, const char *idname, int spaceid,
 
 wmKeyMap *WM_modalkeymap_add(wmKeyConfig *keyconf, const char *idname, const EnumPropertyItem *items)
 {
-       wmKeyMap *km = WM_keymap_find(keyconf, idname, 0, 0);
+       wmKeyMap *km = WM_keymap_ensure(keyconf, idname, 0, 0);
        km->flag |= KEYMAP_MODAL;
        km->modal_items = items;
 
index 454d7dc57f06a33a63bda1935ee401474b278500..1b73f40bb8dba8ac946a38821f97b627d4c39928 100644 (file)
@@ -3320,7 +3320,7 @@ static void gesture_zoom_border_modal_keymap(wmKeyConfig *keyconf)
 /* default keymap for windows and screens, only call once per WM */
 void wm_window_keymap(wmKeyConfig *keyconf)
 {
-       wmKeyMap *keymap = WM_keymap_find(keyconf, "Window", 0, 0);
+       wmKeyMap *keymap = WM_keymap_ensure(keyconf, "Window", 0, 0);
        wmKeyMapItem *kmi;
 
        /* note, this doesn't replace existing keymap items */
index f6ebdae841400c7f514b55909b04c534ae051378..97df94af38d55364f9dff43df8c73281acc9ed66 100644 (file)
@@ -719,13 +719,13 @@ void wm_window_ghostwindows_ensure(wmWindowManager *wm)
                        win->eventstate = MEM_callocN(sizeof(wmEvent), "window event state");
 
                /* add keymap handlers (1 handler for all keys in map!) */
-               keymap = WM_keymap_find(wm->defaultconf, "Window", 0, 0);
+               keymap = WM_keymap_ensure(wm->defaultconf, "Window", 0, 0);
                WM_event_add_keymap_handler(&win->handlers, keymap);
 
-               keymap = WM_keymap_find(wm->defaultconf, "Screen", 0, 0);
+               keymap = WM_keymap_ensure(wm->defaultconf, "Screen", 0, 0);
                WM_event_add_keymap_handler(&win->handlers, keymap);
 
-               keymap = WM_keymap_find(wm->defaultconf, "Screen Editing", 0, 0);
+               keymap = WM_keymap_ensure(wm->defaultconf, "Screen Editing", 0, 0);
                WM_event_add_keymap_handler(&win->modalhandlers, keymap);
 
                /* add drop boxes */
index 4762516fb8443e1d85570261eb4469db48cbe515..9f34729cd2f203f67d990f3d0e23fb3cf2f210fd 100644 (file)
@@ -422,7 +422,7 @@ void PE_current_changed(struct Main *bmain, struct Scene *scene, struct Object *
 
 /* rna keymap */
 struct wmKeyMap *WM_keymap_active(struct wmWindowManager *wm, struct wmKeyMap *keymap) RET_NULL
-struct wmKeyMap *WM_keymap_find(struct wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid) RET_NULL
+struct wmKeyMap *WM_keymap_ensure(struct wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid) RET_NULL
 struct wmKeyMapItem *WM_keymap_add_item(struct wmKeyMap *keymap, const char *idname, int type,  int val, int modifier, int keymodifier) RET_NULL
 struct wmKeyMap *WM_keymap_list_find(ListBase *lb, const char *idname, int spaceid, int regionid) RET_NULL
 struct wmKeyConfig *WM_keyconfig_new(struct wmWindowManager *wm, const char *idname) RET_NULL