soc-2008-mxcurioni: merged changes to revision 23516
[blender.git] / source / blender / editors / space_graph / graph_ops.c
index 305ad8250306b740baca30f85be9e00d161eaca7..b82055064f8b5a59e8c5e604fa21f888377a1b9b 100644 (file)
@@ -68,7 +68,7 @@
 
 static int view_toggle_handles_exec (bContext *C, wmOperator *op)
 {
-       SpaceIpo *sipo= (SpaceIpo *)CTX_wm_space_data(C);
+       SpaceIpo *sipo= CTX_wm_space_graph(C);
        ARegion *ar= CTX_wm_region(C);
        
        if (sipo == NULL)
@@ -118,7 +118,7 @@ void graphedit_operatortypes(void)
        WM_operatortype_append(GRAPH_OT_snap);
        WM_operatortype_append(GRAPH_OT_mirror);
        WM_operatortype_append(GRAPH_OT_frame_jump);
-       WM_operatortype_append(GRAPH_OT_handletype);
+       WM_operatortype_append(GRAPH_OT_handle_type);
        WM_operatortype_append(GRAPH_OT_interpolation_type);
        WM_operatortype_append(GRAPH_OT_extrapolation_type);
        WM_operatortype_append(GRAPH_OT_sample);
@@ -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;
        
@@ -191,7 +191,7 @@ static void graphedit_keymap_keyframes (wmWindowManager *wm, ListBase *keymap)
        WM_keymap_add_item(keymap, "GRAPH_OT_snap", SKEY, KM_PRESS, KM_SHIFT, 0);
        WM_keymap_add_item(keymap, "GRAPH_OT_mirror", MKEY, KM_PRESS, KM_SHIFT, 0);
        
-       WM_keymap_add_item(keymap, "GRAPH_OT_handletype", HKEY, KM_PRESS, 0, 0);
+       WM_keymap_add_item(keymap, "GRAPH_OT_handle_type", HKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "GRAPH_OT_interpolation_type", TKEY, KM_PRESS, KM_SHIFT, 0);
        WM_keymap_add_item(keymap, "GRAPH_OT_extrapolation_type", EKEY, KM_PRESS, KM_SHIFT, 0);
        
@@ -221,7 +221,7 @@ static void graphedit_keymap_keyframes (wmWindowManager *wm, ListBase *keymap)
        WM_keymap_add_item(keymap, "GRAPH_OT_view_all", HOMEKEY, KM_PRESS, 0, 0);
        
                /* F-Modifiers */
-       WM_keymap_add_item(keymap, "GRAPH_OT_fmodifier_add", MKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
+       RNA_boolean_set(WM_keymap_add_item(keymap, "GRAPH_OT_fmodifier_add", MKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0)->ptr, "only_active", 0);
        
        
        /* transform system */
@@ -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);
 }