diff options
-rw-r--r-- | release/scripts/modules/bpy_ops.py | 2 | ||||
-rw-r--r-- | source/blender/makesrna/RNA_enum_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_screen.c | 25 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 53 |
4 files changed, 80 insertions, 2 deletions
diff --git a/release/scripts/modules/bpy_ops.py b/release/scripts/modules/bpy_ops.py index b1d782917b6..022c0581a81 100644 --- a/release/scripts/modules/bpy_ops.py +++ b/release/scripts/modules/bpy_ops.py @@ -204,7 +204,7 @@ class WM_OT_context_toggle_values(bpy.types.Operator): class WM_OT_context_cycle_enum(bpy.types.Operator): '''Toggle a context value.''' __idname__ = "wm.context_cycle_enum" - __label__ = "Context Toggle Values" + __label__ = "Context Enum Cycle" __register__ = True __undo__ = True diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index f102143f0ed..af950c1148a 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -60,6 +60,8 @@ extern EnumPropertyItem unpack_method_items[]; extern EnumPropertyItem object_type_items[]; +extern EnumPropertyItem space_type_items[]; + struct bContext; struct PointerRNA; EnumPropertyItem *rna_TransformOrientation_itemf(struct bContext *C, struct PointerRNA *ptr, int *free); diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index 2a72845dd42..004c57eedfc 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -26,6 +26,7 @@ #include "RNA_define.h" #include "RNA_types.h" +#include "RNA_enum_types.h" #include "rna_internal.h" @@ -77,6 +78,22 @@ static int rna_Screen_animation_playing_get(PointerRNA *ptr) return (sc->animtimer != NULL); } +static void rna_Area_type_set(PointerRNA *ptr, int value) +{ + ScrArea *sa= (ScrArea*)ptr->data; + sa->butspacetype= value; +} + +static void rna_Area_type_update(bContext *C, PointerRNA *ptr) +{ + ScrArea *sa= (ScrArea*)ptr->data; + + if(sa) { + ED_area_newspace(C, sa, sa->butspacetype); /* XXX - this uses the window */ + ED_area_tag_redraw(sa); + } +} + #else static void rna_def_area(BlenderRNA *brna) @@ -107,6 +124,14 @@ static void rna_def_area(BlenderRNA *brna) RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", HEADER_NO_PULLDOWN); RNA_def_property_ui_text(prop, "Show Menus", "Show menus in the header."); + prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "spacetype"); + RNA_def_property_enum_items(prop, space_type_items); + RNA_def_property_enum_funcs(prop, NULL, "rna_Area_type_set", NULL); + RNA_def_property_ui_text(prop, "Type", "Space type."); + RNA_def_property_update(prop, 0, "rna_Area_type_update"); + + RNA_def_function(srna, "tag_redraw", "ED_area_tag_redraw"); } diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index e3f23a488a2..2ed32808f48 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -2186,6 +2186,7 @@ void wm_operatortype_init(void) void wm_window_keymap(wmKeyConfig *keyconf) { wmKeyMap *keymap= WM_keymap_find(keyconf, "Window", 0, 0); + wmKeyMapItem *km; /* items to make WM work */ WM_keymap_verify_item(keymap, "WM_OT_jobs_timer", TIMERJOBS, KM_ANY, KM_ANY, 0); @@ -2208,7 +2209,7 @@ void wm_window_keymap(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0); - WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", F11KEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", F11KEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "WM_OT_exit_blender", QKEY, KM_PRESS, KM_CTRL, 0); /* debug/testing */ @@ -2216,5 +2217,55 @@ void wm_window_keymap(wmKeyConfig *keyconf) WM_keymap_verify_item(keymap, "WM_OT_debug_menu", DKEY, KM_PRESS, KM_ALT|KM_CTRL, 0); WM_keymap_verify_item(keymap, "WM_OT_search_menu", SPACEKEY, KM_PRESS, 0, 0); + /* Space switching */ + + + km = WM_keymap_add_item(keymap, "WM_OT_context_set", F2KEY, KM_PRESS, KM_SHIFT, 0); /* new in 2.5x, was DXF export */ + RNA_string_set(km->ptr, "path", "area.type"); + RNA_string_set(km->ptr, "value", "'LOGIC_EDITOR'"); + + km = WM_keymap_add_item(keymap, "WM_OT_context_set", F3KEY, KM_PRESS, KM_SHIFT, 0); + RNA_string_set(km->ptr, "path", "area.type"); + RNA_string_set(km->ptr, "value", "'NODE_EDITOR'"); + + km = WM_keymap_add_item(keymap, "WM_OT_context_set", F4KEY, KM_PRESS, KM_SHIFT, 0); /* new in 2.5x, was data browser */ + RNA_string_set(km->ptr, "path", "area.type"); + RNA_string_set(km->ptr, "value", "'CONSOLE'"); + + km = WM_keymap_add_item(keymap, "WM_OT_context_set", F5KEY, KM_PRESS, KM_SHIFT, 0); + RNA_string_set(km->ptr, "path", "area.type"); + RNA_string_set(km->ptr, "value", "'VIEW_3D'"); + + km = WM_keymap_add_item(keymap, "WM_OT_context_set", F6KEY, KM_PRESS, KM_SHIFT, 0); + RNA_string_set(km->ptr, "path", "area.type"); + RNA_string_set(km->ptr, "value", "'GRAPH_EDITOR'"); + + km = WM_keymap_add_item(keymap, "WM_OT_context_set", F7KEY, KM_PRESS, KM_SHIFT, 0); + RNA_string_set(km->ptr, "path", "area.type"); + RNA_string_set(km->ptr, "value", "'PROPERTIES'"); + + km = WM_keymap_add_item(keymap, "WM_OT_context_set", F8KEY, KM_PRESS, KM_SHIFT, 0); + RNA_string_set(km->ptr, "path", "area.type"); + RNA_string_set(km->ptr, "value", "'SEQUENCE_EDITOR'"); + + km = WM_keymap_add_item(keymap, "WM_OT_context_set", F9KEY, KM_PRESS, KM_SHIFT, 0); + RNA_string_set(km->ptr, "path", "area.type"); + RNA_string_set(km->ptr, "value", "'OUTLINER'"); + + km = WM_keymap_add_item(keymap, "WM_OT_context_set", F9KEY, KM_PRESS, KM_SHIFT, 0); + RNA_string_set(km->ptr, "path", "area.type"); + RNA_string_set(km->ptr, "value", "'OUTLINER'"); + + km = WM_keymap_add_item(keymap, "WM_OT_context_set", F10KEY, KM_PRESS, KM_SHIFT, 0); + RNA_string_set(km->ptr, "path", "area.type"); + RNA_string_set(km->ptr, "value", "'IMAGE_EDITOR'"); + + km = WM_keymap_add_item(keymap, "WM_OT_context_set", F11KEY, KM_PRESS, KM_SHIFT, 0); + RNA_string_set(km->ptr, "path", "area.type"); + RNA_string_set(km->ptr, "value", "'TEXT_EDITOR'"); + + km = WM_keymap_add_item(keymap, "WM_OT_context_set", F12KEY, KM_PRESS, KM_SHIFT, 0); + RNA_string_set(km->ptr, "path", "area.type"); + RNA_string_set(km->ptr, "value", "'DOPESHEET_EDITOR'"); } |