diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-09-18 01:36:02 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-09-18 01:36:02 +0400 |
commit | 69e919530e179c0ac251534003e3ab8f540e82fe (patch) | |
tree | f45b87b1d2a31c94540011c3f5f828d073f12cae /source/blender/editors/space_graph | |
parent | b572ae2a8bdd4adfc1641a43ca02061b9ae6eff9 (diff) |
Keymaps now have a poll() function, rather than adding/removing
their handlers based on notifiers, which is simpler and more
reliable.
This fixes for example editmode or uv edit keymaps not working
when creating a new 3dview or image space.
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r-- | source/blender/editors/space_graph/graph_ops.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_graph/space_graph.c | 16 |
2 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index fc4c05915c9..b7d67c85ab9 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -141,7 +141,7 @@ void graphedit_operatortypes(void) /* ************************** registration - keymaps **********************************/ -static void graphedit_keymap_keyframes (wmWindowManager *wm, ListBase *keymap) +static void graphedit_keymap_keyframes (wmWindowManager *wm, wmKeyMap *keymap) { wmKeymapItem *kmi; @@ -232,10 +232,10 @@ static void graphedit_keymap_keyframes (wmWindowManager *wm, ListBase *keymap) void graphedit_keymap(wmWindowManager *wm) { - ListBase *keymap; + wmKeyMap *keymap; /* keymap for all regions */ - keymap= WM_keymap_listbase(wm, "GraphEdit Generic", SPACE_IPO, 0); + keymap= WM_keymap_find(wm, "GraphEdit Generic", SPACE_IPO, 0); WM_keymap_add_item(keymap, "GRAPH_OT_properties", NKEY, KM_PRESS, 0, 0); /* channels */ @@ -245,7 +245,7 @@ void graphedit_keymap(wmWindowManager *wm) */ /* keyframes */ - keymap= WM_keymap_listbase(wm, "GraphEdit Keys", SPACE_IPO, 0); + keymap= WM_keymap_find(wm, "GraphEdit Keys", SPACE_IPO, 0); graphedit_keymap_keyframes(wm, keymap); } diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 8887d464f30..e0b961b38f1 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -203,14 +203,14 @@ static SpaceLink *graph_duplicate(SpaceLink *sl) /* add handlers, stuff you only do once or on area/region changes */ static void graph_main_area_init(wmWindowManager *wm, ARegion *ar) { - ListBase *keymap; + wmKeyMap *keymap; UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy); /* own keymap */ - keymap= WM_keymap_listbase(wm, "GraphEdit Keys", SPACE_IPO, 0); /* XXX weak? */ + keymap= WM_keymap_find(wm, "GraphEdit Keys", SPACE_IPO, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); - keymap= WM_keymap_listbase(wm, "GraphEdit Generic", SPACE_IPO, 0); + keymap= WM_keymap_find(wm, "GraphEdit Generic", SPACE_IPO, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } @@ -281,14 +281,14 @@ static void graph_main_area_draw(const bContext *C, ARegion *ar) static void graph_channel_area_init(wmWindowManager *wm, ARegion *ar) { - ListBase *keymap; + wmKeyMap *keymap; UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy); /* own keymap */ - keymap= WM_keymap_listbase(wm, "Animation_Channels", 0, 0); /* XXX weak? */ + keymap= WM_keymap_find(wm, "Animation_Channels", 0, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); - keymap= WM_keymap_listbase(wm, "GraphEdit Generic", SPACE_IPO, 0); + keymap= WM_keymap_find(wm, "GraphEdit Generic", SPACE_IPO, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } @@ -352,11 +352,11 @@ static void graph_header_area_draw(const bContext *C, ARegion *ar) /* add handlers, stuff you only do once or on area/region changes */ static void graph_buttons_area_init(wmWindowManager *wm, ARegion *ar) { - ListBase *keymap; + wmKeyMap *keymap; ED_region_panels_init(wm, ar); - keymap= WM_keymap_listbase(wm, "GraphEdit Generic", SPACE_IPO, 0); + keymap= WM_keymap_find(wm, "GraphEdit Generic", SPACE_IPO, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } |