diff options
Diffstat (limited to 'source/blender/editors')
82 files changed, 384 insertions, 330 deletions
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 83f5fca5af5..7ee591f8cab 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -1687,9 +1687,9 @@ void ED_operatortypes_animchannels(void) WM_operatortype_append(ANIM_OT_channels_visibility_toggle); } -void ED_keymap_animchannels(wmWindowManager *wm) +void ED_keymap_animchannels(wmKeyConfig *keyconf) { - wmKeyMap *keymap = WM_keymap_find(wm, "Animation_Channels", 0, 0); + wmKeyMap *keymap = WM_keymap_find(keyconf, "Animation_Channels", 0, 0); /* selection */ /* click-select */ diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 6c44086af41..f4ecb9d5def 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -990,9 +990,9 @@ void ED_operatortypes_marker(void) } /* called in screen_ops.c:ED_keymap_screen() */ -void ED_marker_keymap(wmWindowManager *wm) +void ED_marker_keymap(wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(wm, "Markers", 0, 0); + wmKeyMap *keymap= WM_keymap_find(keyconf, "Markers", 0, 0); WM_keymap_verify_item(keymap, "MARKER_OT_add", MKEY, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "MARKER_OT_move", EVT_TWEAK_S, KM_ANY, 0, 0); diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index 83b2e2688c9..35eac6d23f1 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -416,9 +416,9 @@ void ED_operatortypes_anim(void) WM_operatortype_append(ANIM_OT_keying_set_path_remove); } -void ED_keymap_anim(wmWindowManager *wm) +void ED_keymap_anim(wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(wm, "Animation", 0, 0); + wmKeyMap *keymap= WM_keymap_find(keyconf, "Animation", 0, 0); /* frame management */ /* NOTE: 'ACTIONMOUSE' not 'LEFTMOUSE', as user may have swapped mouse-buttons */ diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c index d465c1f8c9a..2bf414ef969 100644 --- a/source/blender/editors/armature/armature_ops.c +++ b/source/blender/editors/armature/armature_ops.c @@ -205,13 +205,13 @@ void ED_operatortypes_armature(void) WM_operatortype_append(ARMATURE_OT_test); // XXX temp test for context iterators... to be removed } -void ED_keymap_armature(wmWindowManager *wm) +void ED_keymap_armature(wmKeyConfig *keyconf) { wmKeyMap *keymap; - wmKeymapItem *kmi; + wmKeyMapItem *kmi; /* Armature ------------------------ */ - keymap= WM_keymap_find(wm, "Armature", 0, 0); + keymap= WM_keymap_find(keyconf, "Armature", 0, 0); keymap->poll= ED_operator_editarmature; /* only set in editmode armature, by space_view3d listener */ @@ -297,7 +297,7 @@ void ED_keymap_armature(wmWindowManager *wm) /* Pose ------------------------ */ /* only set in posemode, by space_view3d listener */ - keymap= WM_keymap_find(wm, "Pose", 0, 0); + keymap= WM_keymap_find(keyconf, "Pose", 0, 0); keymap->poll= ED_operator_posemode; // XXX: set parent is object-based operator, but it should also be available here... diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c index 77c5ed1de2c..a71ff8347e8 100644 --- a/source/blender/editors/curve/curve_ops.c +++ b/source/blender/editors/curve/curve_ops.c @@ -161,11 +161,11 @@ void ED_operatortypes_curve(void) WM_operatortype_append(CURVE_OT_specials_menu); } -void ED_keymap_curve(wmWindowManager *wm) +void ED_keymap_curve(wmKeyConfig *keyconf) { wmKeyMap *keymap; - keymap= WM_keymap_find(wm, "Font", 0, 0); + keymap= WM_keymap_find(keyconf, "Font", 0, 0); keymap->poll= ED_operator_editfont; /* only set in editmode font, by space_view3d listener */ @@ -215,7 +215,7 @@ void ED_keymap_curve(wmWindowManager *wm) WM_keymap_add_item(keymap, "FONT_OT_text_insert", KM_TEXTINPUT, KM_ANY, KM_ANY, 0); // last! /* only set in editmode curve, by space_view3d listener */ - keymap= WM_keymap_find(wm, "Curve", 0, 0); + keymap= WM_keymap_find(keyconf, "Curve", 0, 0); keymap->poll= ED_operator_editsurfcurve; WM_keymap_add_item(keymap, "OBJECT_OT_curve_add", AKEY, KM_PRESS, KM_SHIFT, 0); diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c index d311b39b9a3..6237e193a13 100644 --- a/source/blender/editors/gpencil/gpencil_ops.c +++ b/source/blender/editors/gpencil/gpencil_ops.c @@ -45,10 +45,10 @@ /* ****************************************** */ /* Generic Editing Keymap */ -void ED_keymap_gpencil(wmWindowManager *wm) +void ED_keymap_gpencil(wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(wm, "Grease Pencil", 0, 0); - wmKeymapItem *kmi; + wmKeyMap *keymap= WM_keymap_find(keyconf, "Grease Pencil", 0, 0); + wmKeyMapItem *kmi; /* Draw */ /* draw */ diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index d9439956569..97f4dd915e4 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -34,7 +34,7 @@ struct ListBase; struct AnimData; struct bContext; -struct wmWindowManager; +struct wmKeyConfig; struct ScrArea; struct ARegion; struct View2D; @@ -487,11 +487,11 @@ void ANIM_pose_to_action_sync(struct Object *ob, struct ScrArea *sa); /* generic animation channels */ void ED_operatortypes_animchannels(void); -void ED_keymap_animchannels(struct wmWindowManager *wm); +void ED_keymap_animchannels(struct wmKeyConfig *keyconf); /* generic time editing */ void ED_operatortypes_anim(void); -void ED_keymap_anim(struct wmWindowManager *wm); +void ED_keymap_anim(struct wmKeyConfig *keyconf); /* ************************************************ */ diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index 8bdfe41ef80..6479030bcd1 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -35,7 +35,7 @@ struct Bone; struct bArmature; struct bPoseChannel; struct wmOperator; -struct wmWindowManager; +struct wmKeyConfig; struct ListBase; struct View3D; struct ViewContext; @@ -92,7 +92,7 @@ typedef struct EditBone /* armature_ops.c */ void ED_operatortypes_armature(void); -void ED_keymap_armature(struct wmWindowManager *wm); +void ED_keymap_armature(struct wmKeyConfig *keyconf); /* editarmature.c */ void ED_armature_from_edit(struct Object *obedit); diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h index 4149c6a9cca..fea684971b2 100644 --- a/source/blender/editors/include/ED_curve.h +++ b/source/blender/editors/include/ED_curve.h @@ -36,11 +36,11 @@ struct Scene; struct Text; struct View3D; struct wmOperator; -struct wmWindowManager; +struct wmKeyConfig; /* curve_ops.c */ void ED_operatortypes_curve(void); -void ED_keymap_curve (struct wmWindowManager *wm); +void ED_keymap_curve (struct wmKeyConfig *keyconf); /* editcurve.c */ void undo_push_curve (struct bContext *C, char *name); diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h index 388da9a2acc..ff95f8ce6eb 100644 --- a/source/blender/editors/include/ED_gpencil.h +++ b/source/blender/editors/include/ED_gpencil.h @@ -41,7 +41,7 @@ struct bGPDframe; struct PointerRNA; struct Panel; struct ImBuf; -struct wmWindowManager; +struct wmKeyConfig; /* ------------- Grease-Pencil Helpers ---------------- */ @@ -62,7 +62,7 @@ struct bGPdata *gpencil_data_get_active(struct bContext *C); /* ----------- Grease Pencil Operators ----------------- */ -void ED_keymap_gpencil(struct wmWindowManager *wm); +void ED_keymap_gpencil(struct wmKeyConfig *keyconf); void ED_operatortypes_gpencil(void); /* ------------ Grease-Pencil Drawing API ------------------ */ diff --git a/source/blender/editors/include/ED_markers.h b/source/blender/editors/include/ED_markers.h index 4b7a2954206..58ca85bb74c 100644 --- a/source/blender/editors/include/ED_markers.h +++ b/source/blender/editors/include/ED_markers.h @@ -28,7 +28,7 @@ #ifndef ED_MARKERS_H #define ED_MARKERS_H -struct wmWindowManager; +struct wmKeyConfig; struct bContext; struct TimeMarker; @@ -56,7 +56,7 @@ void ED_markers_make_cfra_list(ListBase *markers, ListBase *lb, short sel); /* called in screen_ops.c:ED_operatortypes_screen() */ void ED_operatortypes_marker(void); /* called in screen_ops.c:ED_keymap_screen() */ -void ED_marker_keymap(struct wmWindowManager *wm); +void ED_marker_keymap(struct wmKeyConfig *keyconf); #endif /* ED_MARKERS_H */ diff --git a/source/blender/editors/include/ED_mball.h b/source/blender/editors/include/ED_mball.h index 49c1d856a27..6708a73e088 100644 --- a/source/blender/editors/include/ED_mball.h +++ b/source/blender/editors/include/ED_mball.h @@ -28,10 +28,10 @@ struct bContext; struct Object; -struct wmWindowManager; +struct wmKeyConfig; void ED_operatortypes_metaball(void); -void ED_keymap_metaball(struct wmWindowManager *wm); +void ED_keymap_metaball(struct wmKeyConfig *keyconf); struct MetaElem *add_metaball_primitive(struct bContext *C, int type, int newname); diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index fd88f9889ae..cf0e6eb01c3 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -38,6 +38,7 @@ struct EditFace; struct bContext; struct wmOperator; struct wmWindowManager; +struct wmKeyConfig; struct ReportList; struct EditSelection; struct ViewContext; @@ -84,13 +85,13 @@ int join_mesh_exec(struct bContext *C, struct wmOperator *op); /* mesh_ops.c */ void ED_operatortypes_mesh(void); -void ED_keymap_mesh(struct wmWindowManager *wm); +void ED_keymap_mesh(struct wmKeyConfig *keyconf); /* editmesh.c */ void ED_spacetypes_init(void); -void ED_keymap_mesh(struct wmWindowManager *wm); +void ED_keymap_mesh(struct wmKeyConfig *keyconf); void make_editMesh(struct Scene *scene, struct Object *ob); void load_editMesh(struct Scene *scene, struct Object *ob); diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index 363795afeab..ec763fe3dfc 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -28,7 +28,7 @@ #ifndef ED_OBJECT_H #define ED_OBJECT_H -struct wmWindowManager; +struct wmKeyConfig; struct Scene; struct Object; struct bContext; @@ -44,7 +44,7 @@ struct ModifierData; /* object_edit.c */ void ED_operatortypes_object(void); -void ED_keymap_object(struct wmWindowManager *wm); +void ED_keymap_object(struct wmKeyConfig *keyconf); /* send your own notifier for select! */ void ED_base_object_select(struct Base *base, short mode); diff --git a/source/blender/editors/include/ED_particle.h b/source/blender/editors/include/ED_particle.h index a052142102d..3d7fc5ea15b 100644 --- a/source/blender/editors/include/ED_particle.h +++ b/source/blender/editors/include/ED_particle.h @@ -36,7 +36,7 @@ struct ParticleEditSettings; struct ParticleSystem; struct RadialControl; struct rcti; -struct wmWindowManager; +struct wmKeyConfig; struct PTCacheEdit; struct Scene; diff --git a/source/blender/editors/include/ED_physics.h b/source/blender/editors/include/ED_physics.h index ee340c54e7d..df303d7c9f1 100644 --- a/source/blender/editors/include/ED_physics.h +++ b/source/blender/editors/include/ED_physics.h @@ -30,9 +30,11 @@ #ifndef ED_PHYSICS_H #define ED_PHYSICS_H +struct wmKeyConfig; + /* operators */ void ED_operatortypes_physics(void); -void ED_keymap_physics(struct wmWindowManager *wm); +void ED_keymap_physics(struct wmKeyConfig *keyconf); #endif /* ED_PHYSICS_H */ diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 63b6a067389..18c86306e44 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -37,6 +37,7 @@ struct wmWindowManager; struct wmWindow; struct wmNotifier; struct wmEvent; +struct wmKeyConfig; struct bContext; struct SpaceType; struct Scene; @@ -63,7 +64,7 @@ void region_scissor_winrct(struct ARegion *ar, struct rcti *winrct); /* spaces */ void ED_spacetypes_init(void); -void ED_spacetypes_keymap(struct wmWindowManager *wm); +void ED_spacetypes_keymap(struct wmKeyConfig *keyconf); int ED_area_header_switchbutton(const struct bContext *C, struct uiBlock *block, int yco); int ED_area_header_standardbuttons(const struct bContext *C, struct uiBlock *block, int yco); void ED_area_overdraw(struct bContext *C); @@ -107,7 +108,7 @@ void ED_screen_new_window(struct bContext *C, struct rcti *position, int type); void ED_update_for_newframe(const struct bContext *C, int mute); void ED_operatortypes_screen(void); -void ED_keymap_screen(struct wmWindowManager *wm); +void ED_keymap_screen(struct wmKeyConfig *keyconf); /* operators; context poll callbacks */ int ED_operator_screenactive(struct bContext *C); diff --git a/source/blender/editors/include/ED_sculpt.h b/source/blender/editors/include/ED_sculpt.h index a08f0576f42..764efb4ef0c 100644 --- a/source/blender/editors/include/ED_sculpt.h +++ b/source/blender/editors/include/ED_sculpt.h @@ -29,14 +29,14 @@ #define ED_SCULPT_H struct bContext; -struct wmWindowManager; +struct wmKeyConfig; /* sculpt.c */ void ED_operatortypes_sculpt(void); /* paint_ops.c */ void ED_operatortypes_paint(void); -void ED_keymap_paint(struct wmWindowManager *wm); +void ED_keymap_paint(struct wmKeyConfig *keyconf); /* paint_image.c */ void undo_imagepaint_step(int step); diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h index 7f08e95aceb..a7ffefba8df 100644 --- a/source/blender/editors/include/ED_transform.h +++ b/source/blender/editors/include/ED_transform.h @@ -42,8 +42,9 @@ struct uiLayout; struct EnumPropertyItem; struct wmOperatorType; struct wmKeyMap; +struct wmKeyConfig; -void transform_keymap_for_space(struct wmWindowManager *wm, struct wmKeyMap *keymap, int spaceid); +void transform_keymap_for_space(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap, int spaceid); void transform_operatortypes(void); /* ******************** Macros & Prototypes *********************** */ diff --git a/source/blender/editors/include/ED_uvedit.h b/source/blender/editors/include/ED_uvedit.h index 74a9be75db6..8823437cf79 100644 --- a/source/blender/editors/include/ED_uvedit.h +++ b/source/blender/editors/include/ED_uvedit.h @@ -34,11 +34,11 @@ struct Object; struct MTFace; struct EditFace; struct Image; -struct wmWindowManager; +struct wmKeyConfig; /* uvedit_ops.c */ void ED_operatortypes_uvedit(void); -void ED_keymap_uvedit(struct wmWindowManager *wm); +void ED_keymap_uvedit(struct wmKeyConfig *keyconf); void ED_uvedit_assign_image(struct Scene *scene, struct Object *obedit, struct Image *ima, struct Image *previma); void ED_uvedit_set_tile(struct bContext *C, struct Scene *scene, struct Object *obedit, struct Image *ima, int curtile, int dotile); diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 35598db9e02..3c6ed1137ae 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -147,6 +147,7 @@ typedef struct uiLayout uiLayout; #define UI_BUT_INACTIVE (1<<23) #define UI_BUT_LAST_ACTIVE (1<<24) #define UI_BUT_UNDO (1<<25) +#define UI_BUT_IMMEDIATE (1<<26) #define UI_PANEL_WIDTH 340 #define UI_COMPACT_PANEL_WIDTH 160 @@ -572,6 +573,8 @@ void UI_exit(void); #define UI_ITEM_R_SLIDER 4 #define UI_ITEM_R_TOGGLE 8 #define UI_ITEM_R_ICON_ONLY 16 +#define UI_ITEM_R_EVENT 32 +#define UI_ITEM_R_FULL_EVENT 64 uiLayout *uiBlockLayout(uiBlock *block, int dir, int type, int x, int y, int size, int em, struct uiStyle *style); void uiBlockSetCurLayout(uiBlock *block, uiLayout *layout); diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h index 38c4d82e6da..8fbff25589d 100644 --- a/source/blender/editors/include/UI_view2d.h +++ b/source/blender/editors/include/UI_view2d.h @@ -128,7 +128,7 @@ struct View2D; struct View2DGrid; struct View2DScrollers; -struct wmWindowManager; +struct wmKeyConfig; struct bScreen; struct ScrArea; struct ARegion; @@ -196,7 +196,7 @@ void UI_view2d_text_cache_draw(struct ARegion *ar); /* operators */ void ui_view2d_operatortypes(void); -void UI_view2d_keymap(struct wmWindowManager *wm); +void UI_view2d_keymap(struct wmKeyConfig *keyconf); #endif /* UI_VIEW2D_H */ diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 3e5cc0e6d67..fcc41e4f533 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1958,7 +1958,10 @@ void ui_check_but(uiBut *but) if (but->flag & UI_SELECT) { short *sp= (short *)but->func_arg3; - strcpy(but->drawstr, but->str); + if(but->flag & UI_BUT_IMMEDIATE) + strcpy(but->drawstr, but->str); + else + strcpy(but->drawstr, ""); if(*sp) { char *str= but->drawstr; @@ -1974,10 +1977,10 @@ void ui_check_but(uiBut *but) } else strcat(but->drawstr, "Press a key "); - } else { - /* XXX todo, button currently only used temporarily */ - strcpy(but->drawstr, WM_key_event_string((short) ui_get_but_val(but))); } + else + strcpy(but->drawstr, but->str); + break; case BUT_TOGDUAL: diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 8dea3fa1fc3..195129eac8f 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1858,6 +1858,7 @@ static int ui_do_but_HOTKEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data if(data->state == BUTTON_STATE_HIGHLIGHT) { if(ELEM3(event->type, LEFTMOUSE, PADENTER, RETKEY) && event->val==KM_PRESS) { but->drawstr[0]= 0; + *(short *)but->func_arg3= 0; button_activate_state(C, but, BUTTON_STATE_WAIT_KEY_EVENT); return WM_UI_HANDLER_BREAK; } @@ -1868,9 +1869,12 @@ static int ui_do_but_HOTKEYEVT(bContext *C, uiBut *but, uiHandleButtonData *data if(event->type == MOUSEMOVE) return WM_UI_HANDLER_CONTINUE; - if(ELEM(event->type, ESCKEY, LEFTMOUSE)) { + if(event->type == ESCKEY) { /* data->cancel doesnt work, this button opens immediate */ - ui_set_but_val(but, 0); + if(but->flag & UI_BUT_IMMEDIATE) + ui_set_but_val(but, 0); + else + data->cancel= 1; button_activate_state(C, but, BUTTON_STATE_EXIT); return WM_UI_HANDLER_BREAK; } @@ -3325,6 +3329,7 @@ static uiBlock *menu_change_hotkey(bContext *C, ARegion *ar, void *arg_but) strcat(buf, " |"); but= uiDefHotKeyevtButS(block, 0, buf, 0, 0, 200, 20, dummy, dummy+1, ""); + uiButSetFlag(but, UI_BUT_IMMEDIATE); uiButSetFunc(but, do_menu_change_hotkey, arg_but, dummy); uiPopupBoundsBlock(block, 6.0f, 50, -10); @@ -3782,8 +3787,11 @@ static void button_activate_init(bContext *C, ARegion *ar, uiBut *but, uiButtonA button_activate_state(C, but, BUTTON_STATE_HIGHLIGHT); /* activate right away */ - if(but->type==HOTKEYEVT) - button_activate_state(C, but, BUTTON_STATE_WAIT_KEY_EVENT); + if(but->flag & UI_BUT_IMMEDIATE) { + if(but->type==HOTKEYEVT) + button_activate_state(C, but, BUTTON_STATE_WAIT_KEY_EVENT); + /* .. more to be added here */ + } if(type == BUTTON_ACTIVATE_OPEN) { button_activate_state(C, but, BUTTON_STATE_MENU_OPEN); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index b15be940eef..eb81044852a 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -476,8 +476,20 @@ static void ui_item_enum_row(uiLayout *layout, uiBlock *block, PointerRNA *ptr, MEM_freeN(item); } +/* callback for keymap item change button */ +static void ui_keymap_but_cb(bContext *C, void *but_v, void *key_v) +{ + uiBut *but= but_v; + short modifier= *((short*)key_v); + + RNA_boolean_set(&but->rnapoin, "shift", (modifier & KM_SHIFT) != 0); + RNA_boolean_set(&but->rnapoin, "ctrl", (modifier & KM_CTRL) != 0); + RNA_boolean_set(&but->rnapoin, "alt", (modifier & KM_ALT) != 0); + RNA_boolean_set(&but->rnapoin, "oskey", (modifier & KM_OSKEY) != 0); +} + /* create label + button for RNA property */ -static uiBut *ui_item_with_label(uiLayout *layout, uiBlock *block, char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, int x, int y, int w, int h, int icon_only) +static uiBut *ui_item_with_label(uiLayout *layout, uiBlock *block, char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, int x, int y, int w, int h, int flag) { uiLayout *sub; uiBut *but=NULL; @@ -507,10 +519,26 @@ static uiBut *ui_item_with_label(uiLayout *layout, uiBlock *block, char *name, i /* BUTTONS_OT_file_browse calls uiFileBrowseContextProperty */ but= uiDefIconButO(block, BUT, "BUTTONS_OT_file_browse", WM_OP_INVOKE_DEFAULT, ICON_FILESEL, x, y, UI_UNIT_X, h, "Browse for file or directory."); } - else if(subtype == PROP_DIRECTION) - uiDefButR(block, BUT_NORMAL, 0, name, 0, 0, 100, 100, ptr, RNA_property_identifier(prop), index, 0, 0, -1, -1, NULL); + else if(subtype == PROP_DIRECTION) { + uiDefButR(block, BUT_NORMAL, 0, name, x, y, 100, 100, ptr, RNA_property_identifier(prop), index, 0, 0, -1, -1, NULL); + } + else if(flag & UI_ITEM_R_EVENT) { + uiDefButR(block, KEYEVT, 0, name, x, y, w, h, ptr, RNA_property_identifier(prop), index, 0, 0, -1, -1, NULL); + } + else if(flag & UI_ITEM_R_FULL_EVENT) { + if(RNA_struct_is_a(ptr->type, &RNA_KeyMapItem)) { + static short dummy = 0; + char buf[128]; + + WM_keymap_item_to_string(ptr->data, buf, sizeof(buf)); + + but= uiDefButR(block, HOTKEYEVT, 0, buf, x, y, w, h, ptr, RNA_property_identifier(prop), 0, 0, 0, -1, -1, NULL); + but->func_arg3= &dummy; // XXX abuse + uiButSetFunc(but, ui_keymap_but_cb, but, &dummy); + } + } else - but= uiDefAutoButR(block, ptr, prop, index, (type == PROP_ENUM && !icon_only)? NULL: "", icon, x, y, w, h); + but= uiDefAutoButR(block, ptr, prop, index, (type == PROP_ENUM && !(flag & UI_ITEM_R_ICON_ONLY))? NULL: "", icon, x, y, w, h); uiBlockSetCurLayout(block, layout); return but; @@ -897,7 +925,7 @@ void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, Proper ui_item_enum_row(layout, block, ptr, prop, name, 0, 0, w, h, icon_only); /* property with separate label */ else if(type == PROP_ENUM || type == PROP_STRING || type == PROP_POINTER) { - but= ui_item_with_label(layout, block, name, icon, ptr, prop, index, 0, 0, w, h, icon_only); + but= ui_item_with_label(layout, block, name, icon, ptr, prop, index, 0, 0, w, h, flag); ui_but_add_search(but, ptr, prop, NULL, NULL); } /* single button */ diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 1d56ed4fb6a..eca4eef230c 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -126,10 +126,12 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind void uiDefAutoButsRNA(const bContext *C, uiLayout *layout, PointerRNA *ptr, int columns) { uiLayout *split, *col; + int flag; char *name; RNA_STRUCT_BEGIN(ptr, prop) { - if(strcmp(RNA_property_identifier(prop), "rna_type") == 0) + flag= RNA_property_flag(prop); + if(flag & PROP_HIDDEN) continue; name= (char*)RNA_property_ui_name(prop); diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 0af5a5cac97..ef37f6e530a 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -1407,9 +1407,9 @@ void ui_view2d_operatortypes(void) WM_operatortype_append(VIEW2D_OT_reset); } -void UI_view2d_keymap(wmWindowManager *wm) +void UI_view2d_keymap(wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(wm, "View2D", 0, 0); + wmKeyMap *keymap= WM_keymap_find(keyconf, "View2D", 0, 0); /* pan/scroll */ WM_keymap_add_item(keymap, "VIEW2D_OT_pan", MIDDLEMOUSE, KM_PRESS, 0, 0); @@ -1445,7 +1445,7 @@ void UI_view2d_keymap(wmWindowManager *wm) WM_keymap_add_item(keymap, "VIEW2D_OT_scroller_activate", LEFTMOUSE, KM_PRESS, 0, 0); /* Alternative keymap for buttons listview */ - keymap= WM_keymap_find(wm, "View2D Buttons List", 0, 0); + keymap= WM_keymap_find(keyconf, "View2D Buttons List", 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_pan", MIDDLEMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_down", WHEELDOWNMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW2D_OT_scroll_up", WHEELUPMOUSE, KM_PRESS, 0, 0); diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index 4c9f63f910c..4669f7a6741 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -1240,36 +1240,34 @@ static EnumPropertyItem *select_similar_type_itemf(bContext *C, PointerRNA *ptr, EnumPropertyItem *item= NULL; int totitem= 0; - if(C==NULL) { - /* needed for doc generation */ - RNA_enum_items_add(&item, &totitem, prop_simvertex_types); - RNA_enum_items_add(&item, &totitem, prop_simedge_types); - RNA_enum_items_add(&item, &totitem, prop_simface_types); - RNA_enum_item_end(&item, &totitem); - *free= 1; + if(C) { + obedit= CTX_data_edit_object(C); - return item; - } - - obedit= CTX_data_edit_object(C); - - if(obedit && obedit->type == OB_MESH) { - EditMesh *em= BKE_mesh_get_editmesh(obedit->data); + if(obedit && obedit->type == OB_MESH) { + EditMesh *em= BKE_mesh_get_editmesh(obedit->data); - if(em->selectmode & SCE_SELECT_VERTEX) - RNA_enum_items_add(&item, &totitem, prop_simvertex_types); - else if(em->selectmode & SCE_SELECT_EDGE) - RNA_enum_items_add(&item, &totitem, prop_simedge_types); - else if(em->selectmode & SCE_SELECT_FACE) - RNA_enum_items_add(&item, &totitem, prop_simface_types); - RNA_enum_item_end(&item, &totitem); + if(em->selectmode & SCE_SELECT_VERTEX) + RNA_enum_items_add(&item, &totitem, prop_simvertex_types); + else if(em->selectmode & SCE_SELECT_EDGE) + RNA_enum_items_add(&item, &totitem, prop_simedge_types); + else if(em->selectmode & SCE_SELECT_FACE) + RNA_enum_items_add(&item, &totitem, prop_simface_types); + RNA_enum_item_end(&item, &totitem); - *free= 1; + *free= 1; - return item; + return item; + } } + + /* needed for doc generation */ + RNA_enum_items_add(&item, &totitem, prop_simvertex_types); + RNA_enum_items_add(&item, &totitem, prop_simedge_types); + RNA_enum_items_add(&item, &totitem, prop_simface_types); + RNA_enum_item_end(&item, &totitem); + *free= 1; - return NULL; + return item; } void MESH_OT_select_similar(wmOperatorType *ot) @@ -1290,7 +1288,7 @@ void MESH_OT_select_similar(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "type", prop_simvertex_types, 0, "Type", ""); + prop= RNA_def_enum(ot->srna, "type", prop_simvertex_types, SIMVERT_NORMAL, "Type", ""); RNA_def_enum_funcs(prop, select_similar_type_itemf); } diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 13d73faeb98..6f94db38316 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -348,12 +348,12 @@ void ED_operatortypes_mesh(void) } /* note mesh keymap also for other space? */ -void ED_keymap_mesh(wmWindowManager *wm) +void ED_keymap_mesh(wmKeyConfig *keyconf) { wmKeyMap *keymap; - wmKeymapItem *kmi; + wmKeyMapItem *kmi; - keymap= WM_keymap_find(wm, "EditMesh", 0, 0); + keymap= WM_keymap_find(keyconf, "EditMesh", 0, 0); keymap->poll= ED_operator_editmesh; WM_keymap_add_item(keymap, "MESH_OT_loopcut", RKEY, KM_PRESS, KM_CTRL, 0); diff --git a/source/blender/editors/metaball/mball_ops.c b/source/blender/editors/metaball/mball_ops.c index dd8a18f385c..01da90212a0 100644 --- a/source/blender/editors/metaball/mball_ops.c +++ b/source/blender/editors/metaball/mball_ops.c @@ -51,11 +51,11 @@ void ED_operatortypes_metaball(void) WM_operatortype_append(MBALL_OT_select_random_metaelems); } -void ED_keymap_metaball(wmWindowManager *wm) +void ED_keymap_metaball(wmKeyConfig *keyconf) { wmKeyMap *keymap; - keymap= WM_keymap_find(wm, "Metaball", 0, 0); + keymap= WM_keymap_find(keyconf, "Metaball", 0, 0); keymap->poll= ED_operator_editmball; WM_keymap_add_item(keymap, "OBJECT_OT_metaball_add", AKEY, KM_PRESS, KM_SHIFT, 0); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 82135bf3804..f2f24c099bc 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -196,12 +196,12 @@ static int object_mode_poll(bContext *C) return (!ob || ob->mode == OB_MODE_OBJECT); } -void ED_keymap_object(wmWindowManager *wm) +void ED_keymap_object(wmKeyConfig *keyconf) { wmKeyMap *keymap; - wmKeymapItem *kmi; + wmKeyMapItem *kmi; - keymap= WM_keymap_find(wm, "Object Non-modal", 0, 0); + keymap= WM_keymap_find(keyconf, "Object Non-modal", 0, 0); /* Note: this keymap works disregarding mode */ WM_keymap_add_item(keymap, "OBJECT_OT_editmode_toggle", TABKEY, KM_PRESS, 0, 0); @@ -217,7 +217,7 @@ void ED_keymap_object(wmWindowManager *wm) WM_keymap_add_item(keymap, "OBJECT_OT_center_set", CKEY, KM_PRESS, KM_ALT|KM_SHIFT|KM_CTRL, 0); /* Note: this keymap gets disabled in non-objectmode, */ - keymap= WM_keymap_find(wm, "Object Mode", 0, 0); + keymap= WM_keymap_find(keyconf, "Object Mode", 0, 0); keymap->poll= object_mode_poll; WM_keymap_add_item(keymap, "OBJECT_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); @@ -264,7 +264,7 @@ void ED_keymap_object(wmWindowManager *wm) WM_keymap_verify_item(keymap, "GROUP_OT_objects_remove_active", GKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0); /* Lattice */ - keymap= WM_keymap_find(wm, "Lattice", 0, 0); + keymap= WM_keymap_find(keyconf, "Lattice", 0, 0); keymap->poll= ED_operator_editlattice; WM_keymap_add_item(keymap, "LATTICE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/physics/physics_ops.c b/source/blender/editors/physics/physics_ops.c index ddc5fb9c9b6..0ebbfa6b701 100644 --- a/source/blender/editors/physics/physics_ops.c +++ b/source/blender/editors/physics/physics_ops.c @@ -83,11 +83,11 @@ static void operatortypes_particle(void) WM_operatortype_append(PARTICLE_OT_dupliob_move_down); } -static void keymap_particle(wmWindowManager *wm) +static void keymap_particle(wmKeyConfig *keyconf) { wmKeyMap *keymap; - keymap= WM_keymap_find(wm, "Particle", 0, 0); + keymap= WM_keymap_find(keyconf, "Particle", 0, 0); keymap->poll= PE_poll; WM_keymap_add_item(keymap, "PARTICLE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); @@ -166,10 +166,10 @@ void ED_operatortypes_physics(void) operatortypes_pointcache(); } -void ED_keymap_physics(wmWindowManager *wm) +void ED_keymap_physics(wmKeyConfig *keyconf) { - keymap_particle(wm); - //keymap_pointcache(wm); + keymap_particle(keyconf); + //keymap_pointcache(keyconf); } diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index fb782837d5e..f539020c93d 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -824,24 +824,24 @@ static void ed_default_handlers(wmWindowManager *wm, ListBase *handlers, int fla UI_add_region_handlers(handlers); } if(flag & ED_KEYMAP_VIEW2D) { - wmKeyMap *keymap= WM_keymap_find(wm, "View2D", 0, 0); + wmKeyMap *keymap= WM_keymap_find(wm->defaultconf, "View2D", 0, 0); WM_event_add_keymap_handler(handlers, keymap); } if(flag & ED_KEYMAP_MARKERS) { - wmKeyMap *keymap= WM_keymap_find(wm, "Markers", 0, 0); + wmKeyMap *keymap= WM_keymap_find(wm->defaultconf, "Markers", 0, 0); WM_event_add_keymap_handler(handlers, keymap); // XXX need boundbox check urgently!!! } if(flag & ED_KEYMAP_ANIMATION) { - wmKeyMap *keymap= WM_keymap_find(wm, "Animation", 0, 0); + wmKeyMap *keymap= WM_keymap_find(wm->defaultconf, "Animation", 0, 0); WM_event_add_keymap_handler(handlers, keymap); } if(flag & ED_KEYMAP_FRAMES) { - wmKeyMap *keymap= WM_keymap_find(wm, "Frames", 0, 0); + wmKeyMap *keymap= WM_keymap_find(wm->defaultconf, "Frames", 0, 0); WM_event_add_keymap_handler(handlers, keymap); } if(flag & ED_KEYMAP_GPENCIL) { - wmKeyMap *keymap= WM_keymap_find(wm, "Grease Pencil", 0, 0); + wmKeyMap *keymap= WM_keymap_find(wm->defaultconf, "Grease Pencil", 0, 0); WM_event_add_keymap_handler(handlers, keymap); } } @@ -1371,7 +1371,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, "View2D Buttons List", 0, 0); + keymap= WM_keymap_find(wm->defaultconf, "View2D Buttons List", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 8d8c2eba2a8..7ba83753fee 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2550,7 +2550,7 @@ static ScrArea *find_empty_image_area(bContext *C) static void screen_set_image_output(bContext *C, int mx, int my) { Scene *scene= CTX_data_scene(C); - ScrArea *sa; + ScrArea *sa= NULL; SpaceImage *sima; if(scene->r.displaymode==R_OUTPUT_WINDOW) { @@ -2580,8 +2580,8 @@ static void screen_set_image_output(bContext *C, int mx, int my) ED_screen_full_newspace(C, CTX_wm_area(C), SPACE_IMAGE); sa= CTX_wm_area(C); } - else { + if(!sa) { sa= find_area_showing_r_result(C); if(sa==NULL) sa= find_area_image_empty(C); @@ -3286,7 +3286,7 @@ void ED_operatortypes_screen(void) } -static void keymap_modal_set(wmWindowManager *wm) +static void keymap_modal_set(wmKeyConfig *keyconf) { static EnumPropertyItem modal_items[] = { {KM_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""}, @@ -3297,7 +3297,7 @@ static void keymap_modal_set(wmWindowManager *wm) wmKeyMap *keymap; /* Standard Modal keymap ------------------------------------------------ */ - keymap= WM_modalkeymap_add(wm, "Standard Modal Map", modal_items); + keymap= WM_modalkeymap_add(keyconf, "Standard Modal Map", modal_items); WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, KM_MODAL_CANCEL); WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_ANY, KM_ANY, 0, KM_MODAL_APPLY); @@ -3312,12 +3312,12 @@ static void keymap_modal_set(wmWindowManager *wm) } /* called in spacetypes.c */ -void ED_keymap_screen(wmWindowManager *wm) +void ED_keymap_screen(wmKeyConfig *keyconf) { wmKeyMap *keymap; /* Screen Editing ------------------------------------------------ */ - keymap= WM_keymap_find(wm, "Screen Editing", 0, 0); + keymap= WM_keymap_find(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); @@ -3334,7 +3334,7 @@ void ED_keymap_screen(wmWindowManager *wm) /* Screen General ------------------------------------------------ */ - keymap= WM_keymap_find(wm, "Screen", 0, 0); + keymap= WM_keymap_find(keyconf, "Screen", 0, 0); /* standard timers */ WM_keymap_add_item(keymap, "SCREEN_OT_animation_step", TIMER0, KM_ANY, KM_ANY, 0); @@ -3389,7 +3389,7 @@ void ED_keymap_screen(wmWindowManager *wm) /* Anim Playback ------------------------------------------------ */ - keymap= WM_keymap_find(wm, "Frames", 0, 0); + keymap= WM_keymap_find(keyconf, "Frames", 0, 0); /* frame offsets */ RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_offset", UPARROWKEY, KM_PRESS, 0, 0)->ptr, "delta", 10); @@ -3409,6 +3409,6 @@ void ED_keymap_screen(wmWindowManager *wm) WM_keymap_add_item(keymap, "SCREEN_OT_animation_play", KKEY, KM_PRESS, 0, LKEY); RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_animation_play", AKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0)->ptr, "reverse", 1); - keymap_modal_set(wm); + keymap_modal_set(keyconf); } diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index 514c80d929d..11dbeffdb22 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -134,12 +134,12 @@ void ED_operatortypes_paint(void) WM_operatortype_append(PAINT_OT_vertex_color_set); } -void ED_keymap_paint(wmWindowManager *wm) +void ED_keymap_paint(wmKeyConfig *keyconf) { wmKeyMap *keymap; /* Sculpt mode */ - keymap= WM_keymap_find(wm, "Sculpt", 0, 0); + keymap= WM_keymap_find(keyconf, "Sculpt", 0, 0); keymap->poll= sculpt_poll; RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE); @@ -150,7 +150,7 @@ void ED_keymap_paint(wmWindowManager *wm) WM_keymap_add_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0); /* Vertex Paint mode */ - keymap= WM_keymap_find(wm, "Vertex Paint", 0, 0); + keymap= WM_keymap_find(keyconf, "Vertex Paint", 0, 0); keymap->poll= vertex_paint_poll; RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_vertex_paint_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE); @@ -159,7 +159,7 @@ void ED_keymap_paint(wmWindowManager *wm) WM_keymap_add_item(keymap, "PAINT_OT_sample_color", RIGHTMOUSE, KM_PRESS, 0, 0); /* Weight Paint mode */ - keymap= WM_keymap_find(wm, "Weight Paint", 0, 0); + keymap= WM_keymap_find(keyconf, "Weight Paint", 0, 0); keymap->poll= weight_paint_poll; RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_weight_paint_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE); @@ -168,7 +168,7 @@ void ED_keymap_paint(wmWindowManager *wm) WM_keymap_verify_item(keymap, "PAINT_OT_weight_paint", LEFTMOUSE, KM_PRESS, 0, 0); /* Image/Texture Paint mode */ - keymap= WM_keymap_find(wm, "Image Paint", 0, 0); + keymap= WM_keymap_find(keyconf, "Image Paint", 0, 0); keymap->poll= image_texture_paint_poll; RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_texture_paint_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE); diff --git a/source/blender/editors/space_action/action_intern.h b/source/blender/editors/space_action/action_intern.h index 4326bed62d3..c436475b537 100644 --- a/source/blender/editors/space_action/action_intern.h +++ b/source/blender/editors/space_action/action_intern.h @@ -124,7 +124,7 @@ enum { /* ***************************************** */ /* action_ops.c */ void action_operatortypes(void); -void action_keymap(struct wmWindowManager *wm); +void action_keymap(struct wmKeyConfig *keyconf); #endif /* ED_ACTION_INTERN_H */ diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c index 00b22232608..ba504fa8a69 100644 --- a/source/blender/editors/space_action/action_ops.c +++ b/source/blender/editors/space_action/action_ops.c @@ -91,9 +91,9 @@ void action_operatortypes(void) /* ************************** registration - keymaps **********************************/ -static void action_keymap_keyframes (wmWindowManager *wm, wmKeyMap *keymap) +static void action_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap) { - wmKeymapItem *kmi; + wmKeyMapItem *kmi; /* action_select.c - selection tools */ /* click-select */ @@ -156,7 +156,7 @@ static void action_keymap_keyframes (wmWindowManager *wm, wmKeyMap *keymap) WM_keymap_add_item(keymap, "ACT_OT_view_all", HOMEKEY, KM_PRESS, 0, 0); /* transform system */ - transform_keymap_for_space(wm, keymap, SPACE_ACTION); + transform_keymap_for_space(keyconf, keymap, SPACE_ACTION); /* test */ /* WM_keymap_add_item(keymap, "ACT_OT_test", QKEY, KM_PRESS, 0, 0); */ @@ -164,7 +164,7 @@ static void action_keymap_keyframes (wmWindowManager *wm, wmKeyMap *keymap) /* --------------- */ -void action_keymap(wmWindowManager *wm) +void action_keymap(wmKeyConfig *keyconf) { wmKeyMap *keymap; @@ -175,7 +175,7 @@ void action_keymap(wmWindowManager *wm) */ /* keyframes */ - keymap= WM_keymap_find(wm, "Action_Keys", SPACE_ACTION, 0); - action_keymap_keyframes(wm, keymap); + keymap= WM_keymap_find(keyconf, "Action_Keys", SPACE_ACTION, 0); + action_keymap_keyframes(keyconf, keymap); } diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 3b275cab814..07de15a26b4 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -158,7 +158,7 @@ static void action_main_area_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, "Action_Keys", SPACE_ACTION, 0); + keymap= WM_keymap_find(wm->defaultconf, "Action_Keys", SPACE_ACTION, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } @@ -221,7 +221,7 @@ static void action_channel_area_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, "Animation_Channels", 0, 0); + keymap= WM_keymap_find(wm->defaultconf, "Animation_Channels", 0, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index 8c563c98d9b..397da005543 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -110,35 +110,35 @@ void ED_spacetypes_init(void) /* called in wm.c */ /* keymap definitions are registered only once per WM initialize, usually on file read, using the keymap the actual areas/regions add the handlers */ -void ED_spacetypes_keymap(wmWindowManager *wm) +void ED_spacetypes_keymap(wmKeyConfig *keyconf) { const ListBase *spacetypes; SpaceType *stype; ARegionType *atype; - ED_keymap_screen(wm); - ED_keymap_anim(wm); - ED_keymap_animchannels(wm); - ED_keymap_gpencil(wm); - ED_keymap_object(wm); - ED_keymap_mesh(wm); - ED_keymap_uvedit(wm); - ED_keymap_curve(wm); - ED_keymap_armature(wm); - ED_keymap_physics(wm); - ED_keymap_metaball(wm); - ED_keymap_paint(wm); - ED_marker_keymap(wm); - - UI_view2d_keymap(wm); + ED_keymap_screen(keyconf); + ED_keymap_anim(keyconf); + ED_keymap_animchannels(keyconf); + ED_keymap_gpencil(keyconf); + ED_keymap_object(keyconf); + ED_keymap_mesh(keyconf); + ED_keymap_uvedit(keyconf); + ED_keymap_curve(keyconf); + ED_keymap_armature(keyconf); + ED_keymap_physics(keyconf); + ED_keymap_metaball(keyconf); + ED_keymap_paint(keyconf); + ED_marker_keymap(keyconf); + + UI_view2d_keymap(keyconf); spacetypes = BKE_spacetypes_list(); for(stype=spacetypes->first; stype; stype=stype->next) { if(stype->keymap) - stype->keymap(wm); + stype->keymap(keyconf); for(atype=stype->regiontypes.first; atype; atype=atype->next) { if(atype->keymap) - atype->keymap(wm); + atype->keymap(keyconf); } } } @@ -234,7 +234,7 @@ static void xxx_operatortypes(void) /* register operator types for this space */ } -static void xxx_keymap(wmWindowManager *wm) +static void xxx_keymap(wmKeyConfig *keyconf) { /* add default items to keymap */ } diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 6ffbb79f273..03d126a3e7b 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -142,7 +142,7 @@ static void buttons_main_area_init(wmWindowManager *wm, ARegion *ar) ED_region_panels_init(wm, ar); - keymap= WM_keymap_find(wm, "Buttons Generic", SPACE_BUTS, 0); + keymap= WM_keymap_find(wm->defaultconf, "Buttons Generic", SPACE_BUTS, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } @@ -189,9 +189,9 @@ void buttons_operatortypes(void) WM_operatortype_append(BUTTONS_OT_file_browse); } -void buttons_keymap(struct wmWindowManager *wm) +void buttons_keymap(struct wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(wm, "Buttons Generic", SPACE_BUTS, 0); + wmKeyMap *keymap= WM_keymap_find(keyconf, "Buttons Generic", SPACE_BUTS, 0); WM_keymap_add_item(keymap, "BUTTONS_OT_toolbox", RIGHTMOUSE, KM_PRESS, 0, 0); } diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c index 19fb575ed16..49bc3adb5b9 100644 --- a/source/blender/editors/space_console/space_console.c +++ b/source/blender/editors/space_console/space_console.c @@ -152,7 +152,7 @@ static void console_main_area_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, "Console", SPACE_CONSOLE, 0); + keymap= WM_keymap_find(wm->defaultconf, "Console", SPACE_CONSOLE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } @@ -232,9 +232,9 @@ void console_operatortypes(void) WM_operatortype_append(CONSOLE_OT_report_copy); } -void console_keymap(struct wmWindowManager *wm) +void console_keymap(struct wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(wm, "Console", SPACE_CONSOLE, 0); + wmKeyMap *keymap= WM_keymap_find(keyconf, "Console", SPACE_CONSOLE, 0); #ifdef __APPLE__ RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", LEFTARROWKEY, KM_PRESS, KM_OSKEY, 0)->ptr, "type", LINE_BEGIN); diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index 1b54277c383..afdb0d24917 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -172,16 +172,16 @@ static void file_panel_operator(const bContext *C, Panel *pa) { SpaceFile *sfile= CTX_wm_space_file(C); wmOperator *op= sfile->op; - int empty= 1; + int empty= 1, flag; if(op->type->ui) { op->type->ui((bContext*)C, op->ptr, pa->layout); } else { RNA_STRUCT_BEGIN(op->ptr, prop) { - if(strcmp(RNA_property_identifier(prop), "rna_type") == 0) - continue; - if(strcmp(RNA_property_identifier(prop), "filemode") == 0) + flag= RNA_property_flag(prop); + + if(flag & PROP_HIDDEN) continue; if(strcmp(RNA_property_identifier(prop), "path") == 0) continue; @@ -189,10 +189,6 @@ static void file_panel_operator(const bContext *C, Panel *pa) continue; if(strcmp(RNA_property_identifier(prop), "filename") == 0) continue; - if(strcmp(RNA_property_identifier(prop), "display") == 0) - continue; - if(strncmp(RNA_property_identifier(prop), "filter", 6) == 0) - continue; uiItemFullR(pa->layout, NULL, 0, op->ptr, prop, -1, 0, 0); empty= 0; diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 8257aa5482f..94d90929d80 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -406,7 +406,7 @@ void folderlist_pushdir(ListBase* folderlist, const char *dir) previous_folder = folderlist->last; // check if already exists - if(previous_folder){ + if(previous_folder && previous_folder->foldername){ if(! strcmp(previous_folder->foldername, dir)){ return; } diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 1f461f1bbd5..9f5d889c7b9 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -124,7 +124,10 @@ short ED_fileselect_set_params(SpaceFile *sfile) if (op) { BLI_strncpy(params->title, op->type->name, sizeof(params->title)); - params->type = RNA_int_get(op->ptr, "filemode"); + if(RNA_struct_find_property(op->ptr, "filename")) + params->type = RNA_int_get(op->ptr, "filemode"); + else + params->type = FILE_SPECIAL; if (RNA_property_is_set(op->ptr, "path")) { RNA_string_get(op->ptr, "path", name); @@ -140,15 +143,24 @@ short ED_fileselect_set_params(SpaceFile *sfile) } } params->filter = 0; - params->filter |= RNA_boolean_get(op->ptr, "filter_blender") ? BLENDERFILE : 0; - params->filter |= RNA_boolean_get(op->ptr, "filter_image") ? IMAGEFILE : 0; - params->filter |= RNA_boolean_get(op->ptr, "filter_movie") ? MOVIEFILE : 0; - params->filter |= RNA_boolean_get(op->ptr, "filter_text") ? TEXTFILE : 0; - params->filter |= RNA_boolean_get(op->ptr, "filter_python") ? PYSCRIPTFILE : 0; - params->filter |= RNA_boolean_get(op->ptr, "filter_font") ? FTFONTFILE : 0; - params->filter |= RNA_boolean_get(op->ptr, "filter_sound") ? SOUNDFILE : 0; - params->filter |= RNA_boolean_get(op->ptr, "filter_text") ? TEXTFILE : 0; - params->filter |= RNA_boolean_get(op->ptr, "filter_folder") ? FOLDERFILE : 0; + if(RNA_struct_find_property(op->ptr, "filter_blender")) + params->filter |= RNA_boolean_get(op->ptr, "filter_blender") ? BLENDERFILE : 0; + if(RNA_struct_find_property(op->ptr, "filter_image")) + params->filter |= RNA_boolean_get(op->ptr, "filter_image") ? IMAGEFILE : 0; + if(RNA_struct_find_property(op->ptr, "filter_movie")) + params->filter |= RNA_boolean_get(op->ptr, "filter_movie") ? MOVIEFILE : 0; + if(RNA_struct_find_property(op->ptr, "filter_text")) + params->filter |= RNA_boolean_get(op->ptr, "filter_text") ? TEXTFILE : 0; + if(RNA_struct_find_property(op->ptr, "filter_python")) + params->filter |= RNA_boolean_get(op->ptr, "filter_python") ? PYSCRIPTFILE : 0; + if(RNA_struct_find_property(op->ptr, "filter_font")) + params->filter |= RNA_boolean_get(op->ptr, "filter_font") ? FTFONTFILE : 0; + if(RNA_struct_find_property(op->ptr, "filter_sound")) + params->filter |= RNA_boolean_get(op->ptr, "filter_sound") ? SOUNDFILE : 0; + if(RNA_struct_find_property(op->ptr, "filter_text")) + params->filter |= RNA_boolean_get(op->ptr, "filter_text") ? TEXTFILE : 0; + if(RNA_struct_find_property(op->ptr, "filter_folder")) + params->filter |= RNA_boolean_get(op->ptr, "filter_folder") ? FOLDERFILE : 0; if (params->filter != 0) params->flag |= FILE_FILTER; diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 77f50d91e77..4d3376e0e1f 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -253,10 +253,10 @@ static void file_main_area_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, "File", SPACE_FILE, 0); + keymap= WM_keymap_find(wm->defaultconf, "File", SPACE_FILE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); - keymap= WM_keymap_find(wm, "FileMain", SPACE_FILE, 0); + keymap= WM_keymap_find(wm->defaultconf, "FileMain", SPACE_FILE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); @@ -364,11 +364,11 @@ void file_operatortypes(void) } /* NOTE: do not add .blend file reading on this level */ -void file_keymap(struct wmWindowManager *wm) +void file_keymap(struct wmKeyConfig *keyconf) { - wmKeymapItem *kmi; + wmKeyMapItem *kmi; /* keys for all areas */ - wmKeyMap *keymap= WM_keymap_find(wm, "File", SPACE_FILE, 0); + wmKeyMap *keymap= WM_keymap_find(keyconf, "File", SPACE_FILE, 0); WM_keymap_add_item(keymap, "FILE_OT_bookmark_toggle", NKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_parent", PKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_add_bookmark", BKEY, KM_PRESS, KM_CTRL, 0); @@ -380,7 +380,7 @@ void file_keymap(struct wmWindowManager *wm) WM_keymap_add_item(keymap, "FILE_OT_delete", DELKEY, KM_PRESS, 0, 0); /* keys for main area */ - keymap= WM_keymap_find(wm, "FileMain", SPACE_FILE, 0); + keymap= WM_keymap_find(keyconf, "FileMain", SPACE_FILE, 0); WM_keymap_add_item(keymap, "FILE_OT_select", LEFTMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_select_border", BKEY, KM_PRESS, 0, 0); @@ -401,7 +401,7 @@ void file_keymap(struct wmWindowManager *wm) RNA_int_set(kmi->ptr, "increment",-100); /* keys for button area (top) */ - keymap= WM_keymap_find(wm, "FileButtons", SPACE_FILE, 0); + keymap= WM_keymap_find(keyconf, "FileButtons", SPACE_FILE, 0); WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, 0, 0); kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, 0, 0); RNA_int_set(kmi->ptr, "increment", 1); @@ -425,7 +425,7 @@ static void file_channel_area_init(wmWindowManager *wm, ARegion *ar) ED_region_panels_init(wm, ar); /* own keymaps */ - keymap= WM_keymap_find(wm, "File", SPACE_FILE, 0); + keymap= WM_keymap_find(wm->defaultconf, "File", SPACE_FILE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } @@ -461,10 +461,10 @@ static void file_ui_area_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, "File", SPACE_FILE, 0); + keymap= WM_keymap_find(wm->defaultconf, "File", SPACE_FILE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); - keymap= WM_keymap_find(wm, "FileButtons", SPACE_FILE, 0); + keymap= WM_keymap_find(wm->defaultconf, "FileButtons", SPACE_FILE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } diff --git a/source/blender/editors/space_graph/graph_intern.h b/source/blender/editors/space_graph/graph_intern.h index 83a565e485f..9b7c2eb3656 100644 --- a/source/blender/editors/space_graph/graph_intern.h +++ b/source/blender/editors/space_graph/graph_intern.h @@ -159,7 +159,7 @@ int graphop_selected_fcurve_poll(struct bContext *C); /* ***************************************** */ /* graph_ops.c */ -void graphedit_keymap(struct wmWindowManager *wm); +void graphedit_keymap(struct wmKeyConfig *keyconf); void graphedit_operatortypes(void); diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index b82055064f8..ab35bda0e2f 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -141,9 +141,9 @@ void graphedit_operatortypes(void) /* ************************** registration - keymaps **********************************/ -static void graphedit_keymap_keyframes (wmWindowManager *wm, wmKeyMap *keymap) +static void graphedit_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap) { - wmKeymapItem *kmi; + wmKeyMapItem *kmi; /* view */ WM_keymap_add_item(keymap, "GRAPH_OT_handles_view_toggle", HKEY, KM_PRESS, KM_CTRL, 0); @@ -225,17 +225,17 @@ static void graphedit_keymap_keyframes (wmWindowManager *wm, wmKeyMap *keymap) /* transform system */ - transform_keymap_for_space(wm, keymap, SPACE_IPO); + transform_keymap_for_space(keyconf, keymap, SPACE_IPO); } /* --------------- */ -void graphedit_keymap(wmWindowManager *wm) +void graphedit_keymap(wmKeyConfig *keyconf) { wmKeyMap *keymap; /* keymap for all regions */ - keymap= WM_keymap_find(wm, "GraphEdit Generic", SPACE_IPO, 0); + keymap= WM_keymap_find(keyconf, "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_find(wm, "GraphEdit Keys", SPACE_IPO, 0); - graphedit_keymap_keyframes(wm, keymap); + keymap= WM_keymap_find(keyconf, "GraphEdit Keys", SPACE_IPO, 0); + graphedit_keymap_keyframes(keyconf, keymap); } diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index a7ea2294ed4..c8d2c571a16 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -208,9 +208,9 @@ static void graph_main_area_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, "GraphEdit Keys", SPACE_IPO, 0); + keymap= WM_keymap_find(wm->defaultconf, "GraphEdit Keys", SPACE_IPO, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); - keymap= WM_keymap_find(wm, "GraphEdit Generic", SPACE_IPO, 0); + keymap= WM_keymap_find(wm->defaultconf, "GraphEdit Generic", SPACE_IPO, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } @@ -286,9 +286,9 @@ static void graph_channel_area_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, "Animation_Channels", 0, 0); + keymap= WM_keymap_find(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, "GraphEdit Generic", SPACE_IPO, 0); + keymap= WM_keymap_find(wm->defaultconf, "GraphEdit Generic", SPACE_IPO, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } @@ -356,7 +356,7 @@ static void graph_buttons_area_init(wmWindowManager *wm, ARegion *ar) ED_region_panels_init(wm, ar); - keymap= WM_keymap_find(wm, "GraphEdit Generic", SPACE_IPO, 0); + keymap= WM_keymap_find(wm->defaultconf, "GraphEdit Generic", SPACE_IPO, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 4cf59c9a28e..e64bb1a4209 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -202,9 +202,9 @@ void image_operatortypes(void) WM_operatortype_append(IMAGE_OT_properties); } -void image_keymap(struct wmWindowManager *wm) +void image_keymap(struct wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(wm, "Image Generic", SPACE_IMAGE, 0); + wmKeyMap *keymap= WM_keymap_find(keyconf, "Image Generic", SPACE_IMAGE, 0); WM_keymap_add_item(keymap, "IMAGE_OT_new", NKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "IMAGE_OT_open", OKEY, KM_PRESS, KM_ALT, 0); @@ -212,7 +212,7 @@ void image_keymap(struct wmWindowManager *wm) WM_keymap_add_item(keymap, "IMAGE_OT_save", SKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "IMAGE_OT_properties", NKEY, KM_PRESS, 0, 0); - keymap= WM_keymap_find(wm, "Image", SPACE_IMAGE, 0); + keymap= WM_keymap_find(keyconf, "Image", SPACE_IMAGE, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_all", HOMEKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "IMAGE_OT_view_selected", PADPERIOD, KM_PRESS, 0, 0); @@ -389,16 +389,16 @@ static void image_main_area_init(wmWindowManager *wm, ARegion *ar) // UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy); /* image paint polls for mode */ - keymap= WM_keymap_find(wm, "Image Paint", SPACE_IMAGE, 0); + keymap= WM_keymap_find(wm->defaultconf, "Image Paint", SPACE_IMAGE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); - keymap= WM_keymap_find(wm, "UVEdit", 0, 0); + keymap= WM_keymap_find(wm->defaultconf, "UVEdit", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); /* own keymaps */ - keymap= WM_keymap_find(wm, "Image Generic", SPACE_IMAGE, 0); + keymap= WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm, "Image", SPACE_IMAGE, 0); + keymap= WM_keymap_find(wm->defaultconf, "Image", SPACE_IMAGE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } @@ -463,7 +463,7 @@ static void image_buttons_area_init(wmWindowManager *wm, ARegion *ar) ED_region_panels_init(wm, ar); - keymap= WM_keymap_find(wm, "Image Generic", SPACE_IMAGE, 0); + keymap= WM_keymap_find(wm->defaultconf, "Image Generic", SPACE_IMAGE, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index d3f9c97205c..518553c9a7a 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -134,7 +134,7 @@ void info_operatortypes(void) WM_operatortype_append(FILE_OT_find_missing_files); } -void info_keymap(struct wmWindowManager *wm) +void info_keymap(struct wmKeyConfig *keyconf) { } diff --git a/source/blender/editors/space_logic/space_logic.c b/source/blender/editors/space_logic/space_logic.c index 7043d625ab0..836ac4c6659 100644 --- a/source/blender/editors/space_logic/space_logic.c +++ b/source/blender/editors/space_logic/space_logic.c @@ -186,9 +186,9 @@ void logic_operatortypes(void) } -void logic_keymap(struct wmWindowManager *wm) +void logic_keymap(struct wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(wm, "Logic Generic", SPACE_LOGIC, 0); + wmKeyMap *keymap= WM_keymap_find(keyconf, "Logic Generic", SPACE_LOGIC, 0); WM_keymap_add_item(keymap, "LOGIC_OT_properties", NKEY, KM_PRESS, 0, 0); } @@ -239,7 +239,7 @@ static void logic_main_area_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, "Logic Generic", SPACE_LOGIC, 0); + keymap= WM_keymap_find(wm->defaultconf, "Logic Generic", SPACE_LOGIC, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } @@ -280,7 +280,7 @@ static void logic_buttons_area_init(wmWindowManager *wm, ARegion *ar) ED_region_panels_init(wm, ar); - keymap= WM_keymap_find(wm, "Logic Generic", SPACE_LOGIC, 0); + keymap= WM_keymap_find(wm->defaultconf, "Logic Generic", SPACE_LOGIC, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index e4557ec878f..91c1decc576 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -130,7 +130,7 @@ short nlaedit_is_tweakmode_on(bAnimContext *ac); /* --- */ void nla_operatortypes(void); -void nla_keymap(wmWindowManager *wm); +void nla_keymap(wmKeyConfig *keyconf); #endif /* ED_NLA_INTERN_H */ diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 5ea2e99ad6a..6c940f32c24 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -167,7 +167,7 @@ void nla_operatortypes(void) /* ************************** registration - keymaps **********************************/ -static void nla_keymap_channels (wmWindowManager *wm, wmKeyMap *keymap) +static void nla_keymap_channels (wmKeyConfig *keyconf, wmKeyMap *keymap) { /* NLA-specific (different to standard channels keymap) -------------------------- */ /* selection */ @@ -210,9 +210,9 @@ static void nla_keymap_channels (wmWindowManager *wm, wmKeyMap *keymap) RNA_boolean_set(WM_keymap_add_item(keymap, "ANIM_OT_channels_collapse", PADMINUS, KM_PRESS, KM_CTRL, 0)->ptr, "all", 1); } -static void nla_keymap_main (wmWindowManager *wm, wmKeyMap *keymap) +static void nla_keymap_main (wmKeyConfig *keyconf, wmKeyMap *keymap) { - wmKeymapItem *kmi; + wmKeyMapItem *kmi; /* selection */ /* click select */ @@ -277,17 +277,17 @@ static void nla_keymap_main (wmWindowManager *wm, wmKeyMap *keymap) WM_keymap_add_item(keymap, "NLA_OT_fmodifier_add", MKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); /* transform system */ - transform_keymap_for_space(wm, keymap, SPACE_NLA); + transform_keymap_for_space(keyconf, keymap, SPACE_NLA); } /* --------------- */ -void nla_keymap(wmWindowManager *wm) +void nla_keymap(wmKeyConfig *keyconf) { wmKeyMap *keymap; /* keymap for all regions */ - keymap= WM_keymap_find(wm, "NLA Generic", SPACE_NLA, 0); + keymap= WM_keymap_find(keyconf, "NLA Generic", SPACE_NLA, 0); WM_keymap_add_item(keymap, "NLA_OT_properties", NKEY, KM_PRESS, 0, 0); /* channels */ @@ -297,11 +297,11 @@ void nla_keymap(wmWindowManager *wm) * * 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(wm, "NLA Channels", SPACE_NLA, 0); - nla_keymap_channels(wm, keymap); + keymap= WM_keymap_find(keyconf, "NLA Channels", SPACE_NLA, 0); + nla_keymap_channels(keyconf, keymap); /* data */ - keymap= WM_keymap_find(wm, "NLA Data", SPACE_NLA, 0); - nla_keymap_main(wm, keymap); + keymap= WM_keymap_find(keyconf, "NLA Data", SPACE_NLA, 0); + nla_keymap_main(keyconf, keymap); } diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 41435810889..32ff7766690 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -214,9 +214,9 @@ static void nla_channel_area_init(wmWindowManager *wm, ARegion *ar) /* own keymap */ // TODO: cannot use generic copy, need special NLA version - keymap= WM_keymap_find(wm, "NLA Channels", SPACE_NLA, 0); + keymap= WM_keymap_find(wm->defaultconf, "NLA Channels", SPACE_NLA, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); - keymap= WM_keymap_find(wm, "NLA Generic", SPACE_NLA, 0); + keymap= WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } @@ -259,9 +259,9 @@ static void nla_main_area_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, "NLA Data", SPACE_NLA, 0); + keymap= WM_keymap_find(wm->defaultconf, "NLA Data", SPACE_NLA, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); - keymap= WM_keymap_find(wm, "NLA Generic", SPACE_NLA, 0); + keymap= WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } @@ -358,7 +358,7 @@ static void nla_buttons_area_init(wmWindowManager *wm, ARegion *ar) ED_region_panels_init(wm, ar); - keymap= WM_keymap_find(wm, "NLA Generic", SPACE_NLA, 0); + keymap= WM_keymap_find(wm->defaultconf, "NLA Generic", SPACE_NLA, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h index 9f28a5e3dcb..f55ecf1d0f4 100644 --- a/source/blender/editors/space_node/node_intern.h +++ b/source/blender/editors/space_node/node_intern.h @@ -53,7 +53,7 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d); /* node_ops.c */ void node_operatortypes(void); -void node_keymap(wmWindowManager *wm); +void node_keymap(wmKeyConfig *keyconf); /* node_select.c */ void NODE_OT_select(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c index 880cc489838..443b83a91bc 100644 --- a/source/blender/editors/space_node/node_ops.c +++ b/source/blender/editors/space_node/node_ops.c @@ -67,10 +67,10 @@ void node_operatortypes(void) WM_operatortype_append(NODE_OT_group_edit); } -void node_keymap(struct wmWindowManager *wm) +void node_keymap(struct wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(wm, "Node", SPACE_NODE, 0); - wmKeymapItem *kmi; + wmKeyMap *keymap= WM_keymap_find(keyconf, "Node", SPACE_NODE, 0); + wmKeyMapItem *kmi; /* mouse select in nodes used to be both keys, it's UI elements... */ RNA_enum_set(WM_keymap_add_item(keymap, "NODE_OT_select", ACTIONMOUSE, KM_PRESS, 0, 0)->ptr, "select_type", NODE_SELECT_MOUSE); @@ -101,5 +101,5 @@ void node_keymap(struct wmWindowManager *wm) kmi= WM_keymap_add_item(keymap, "WM_OT_call_menu", AKEY, KM_PRESS, KM_SHIFT, 0); RNA_string_set(kmi->ptr, "name", "NODE_MT_add"); - transform_keymap_for_space(wm, keymap, SPACE_NODE); + transform_keymap_for_space(keyconf, keymap, SPACE_NODE); } diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index bdd2a65984f..41140eae776 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -252,7 +252,7 @@ static void node_main_area_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, "Node", SPACE_NODE, 0); + keymap= WM_keymap_find(wm->defaultconf, "Node", SPACE_NODE, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 641137c010b..28fdc4708df 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -1113,16 +1113,16 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i } else if(type == TSE_KEYMAP) { wmKeyMap *km= (wmKeyMap *)idv; - wmKeymapItem *kmi; + wmKeyMapItem *kmi; char opname[OP_MAX_TYPENAME]; te->directdata= idv; - te->name= km->nameid; + te->name= km->idname; if(!(tselem->flag & TSE_CLOSED)) { a= 0; - for (kmi= km->keymap.first; kmi; kmi= kmi->next, a++) { + for (kmi= km->items.first; kmi; kmi= kmi->next, a++) { const char *key= WM_key_event_string(kmi->type); if(key[0]) { @@ -1408,7 +1408,7 @@ static void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops) wmWindowManager *wm= mainvar->wm.first; wmKeyMap *km; - for(km= wm->keymaps.first; km; km= km->next) { + for(km= wm->defaultconf->keymaps.first; km; km= km->next) { ten= outliner_add_element(soops, &soops->tree, (void*)km, NULL, TSE_KEYMAP, 0); } } @@ -2229,14 +2229,14 @@ static int tree_element_active_sequence_dup(bContext *C, Scene *scene, TreeEleme static int tree_element_active_keymap_item(bContext *C, TreeElement *te, TreeStoreElem *tselem, int set) { - wmKeymapItem *kmi= te->directdata; + wmKeyMapItem *kmi= te->directdata; if(set==0) { - if(kmi->inactive) return 0; + if(kmi->flag & KMI_INACTIVE) return 0; return 1; } else { - kmi->inactive= !kmi->inactive; + kmi->flag ^= KMI_INACTIVE; } return 0; } @@ -4957,7 +4957,7 @@ static void outliner_draw_rnabuts(uiBlock *block, Scene *scene, ARegion *ar, Spa static void operator_call_cb(struct bContext *C, void *arg_kmi, void *arg2) { wmOperatorType *ot= arg2; - wmKeymapItem *kmi= arg_kmi; + wmKeyMapItem *kmi= arg_kmi; if(ot) BLI_strncpy(kmi->idname, ot->idname, OP_MAX_TYPENAME); @@ -4987,7 +4987,7 @@ static uiBlock *operator_search_menu(bContext *C, ARegion *ar, void *arg_kmi) static char search[OP_MAX_TYPENAME]; wmEvent event; wmWindow *win= CTX_wm_window(C); - wmKeymapItem *kmi= arg_kmi; + wmKeyMapItem *kmi= arg_kmi; wmOperatorType *ot= WM_operatortype_find(kmi->idname, 0); uiBlock *block; uiBut *but; @@ -5026,8 +5026,8 @@ static uiBlock *operator_search_menu(bContext *C, ARegion *ar, void *arg_kmi) static short keymap_menu_type(short type) { if(ISKEYBOARD(type)) return OL_KM_KEYBOARD; - if(WM_key_event_is_tweak(type)) return OL_KM_TWEAK; - if(type >= LEFTMOUSE && type <= WHEELOUTMOUSE) return OL_KM_MOUSE; + if(ISTWEAK(type)) return OL_KM_TWEAK; + if(ISMOUSE(type)) return OL_KM_MOUSE; // return OL_KM_SPECIALS; return 0; } @@ -5083,8 +5083,6 @@ static char *keymap_tweak_menu(void) str += sprintf(str, formatstr, "Left Mouse", EVT_TWEAK_L); str += sprintf(str, formatstr, "Middle Mouse", EVT_TWEAK_M); str += sprintf(str, formatstr, "Right Mouse", EVT_TWEAK_R); - str += sprintf(str, formatstr, "Button4 Mouse ", BUTTON4MOUSE); - str += sprintf(str, formatstr, "Button5 Mouse ", BUTTON5MOUSE); str += sprintf(str, formatstr, "Action Mouse", EVT_TWEAK_A); str += sprintf(str, formatstr, "Select Mouse", EVT_TWEAK_S); @@ -5115,7 +5113,7 @@ static char *keymap_tweak_dir_menu(void) static void keymap_type_cb(bContext *C, void *kmi_v, void *unused_v) { - wmKeymapItem *kmi= kmi_v; + wmKeyMapItem *kmi= kmi_v; short maptype= keymap_menu_type(kmi->type); if(maptype!=kmi->maptype) { @@ -5158,7 +5156,7 @@ static void outliner_draw_keymapbuts(uiBlock *block, ARegion *ar, SpaceOops *soo int butw3= 43; /* modifiers */ if(tselem->type == TSE_KEYMAP_ITEM) { - wmKeymapItem *kmi= te->directdata; + wmKeyMapItem *kmi= te->directdata; /* modal map? */ if(kmi->propvalue); diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index 4f9a0f686b9..c71b5181d16 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -110,7 +110,7 @@ typedef struct TreeElement { /* outliner_ops.c */ void outliner_operatortypes(void); -void outliner_keymap(struct wmWindowManager *wm); +void outliner_keymap(struct wmKeyConfig *keyconf); /* outliner_header.c */ void outliner_header_buttons(const struct bContext *C, struct ARegion *ar); diff --git a/source/blender/editors/space_outliner/outliner_ops.c b/source/blender/editors/space_outliner/outliner_ops.c index a35b91249db..3cdd054fe0e 100644 --- a/source/blender/editors/space_outliner/outliner_ops.c +++ b/source/blender/editors/space_outliner/outliner_ops.c @@ -74,9 +74,9 @@ void outliner_operatortypes(void) WM_operatortype_append(OUTLINER_OT_drivers_delete); } -void outliner_keymap(wmWindowManager *wm) +void outliner_keymap(wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(wm, "Outliner", SPACE_OUTLINER, 0); + wmKeyMap *keymap= WM_keymap_find(keyconf, "Outliner", SPACE_OUTLINER, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "OUTLINER_OT_item_activate", LEFTMOUSE, KM_PRESS, 0, 0)->ptr, "extend", 0); RNA_boolean_set(WM_keymap_add_item(keymap, "OUTLINER_OT_item_activate", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "extend", 1); diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index eb0e9dafbaa..fabe889ace6 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -77,7 +77,7 @@ static void outliner_main_area_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, "Outliner", SPACE_OUTLINER, 0); + keymap= WM_keymap_find(wm->defaultconf, "Outliner", SPACE_OUTLINER, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } diff --git a/source/blender/editors/space_script/script_intern.h b/source/blender/editors/space_script/script_intern.h index 59858ee6289..7534fc98de1 100644 --- a/source/blender/editors/space_script/script_intern.h +++ b/source/blender/editors/space_script/script_intern.h @@ -36,7 +36,7 @@ void script_header_buttons(const bContext *C, ARegion *ar); /* script_ops.c */ void script_operatortypes(void); -void script_keymap(struct wmWindowManager *wm); +void script_keymap(struct wmKeyConfig *keyconf); /* script_edit.c */ void SCRIPT_OT_python_file_run(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_script/script_ops.c b/source/blender/editors/space_script/script_ops.c index 0e6ea9cf4fd..bf0a7e5769e 100644 --- a/source/blender/editors/space_script/script_ops.c +++ b/source/blender/editors/space_script/script_ops.c @@ -63,9 +63,9 @@ void script_operatortypes(void) WM_operatortype_append(SCRIPT_OT_python_run_ui_scripts); } -void script_keymap(wmWindowManager *wm) +void script_keymap(wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(wm, "Script", SPACE_SCRIPT, 0); + wmKeyMap *keymap= WM_keymap_find(keyconf, "Script", SPACE_SCRIPT, 0); /* TODO - this is just while we have no way to load a text datablock */ RNA_string_set(WM_keymap_add_item(keymap, "SCRIPT_OT_python_file_run", PKEY, KM_PRESS, KM_CTRL|KM_SHIFT|KM_ALT, 0)->ptr, "path", "test.py"); diff --git a/source/blender/editors/space_script/space_script.c b/source/blender/editors/space_script/space_script.c index a0e73082701..eae0f77d0e1 100644 --- a/source/blender/editors/space_script/space_script.c +++ b/source/blender/editors/space_script/space_script.c @@ -138,7 +138,7 @@ static void script_main_area_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, "Script", SPACE_SCRIPT, 0); + keymap= WM_keymap_find(wm->defaultconf, "Script", SPACE_SCRIPT, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h index ac396440a00..d45d7bf4d18 100644 --- a/source/blender/editors/space_sequencer/sequencer_intern.h +++ b/source/blender/editors/space_sequencer/sequencer_intern.h @@ -75,7 +75,8 @@ extern EnumPropertyItem prop_side_types[]; /* operators */ struct wmOperatorType; -struct wmWindowManager; +struct wmKeyConfig; + void SEQUENCER_OT_cut(struct wmOperatorType *ot); void SEQUENCER_OT_mute(struct wmOperatorType *ot); void SEQUENCER_OT_unmute(struct wmOperatorType *ot); @@ -137,7 +138,7 @@ enum { /* sequencer_ops.c */ void sequencer_operatortypes(void); -void sequencer_keymap(struct wmWindowManager *wm); +void sequencer_keymap(struct wmKeyConfig *keyconf); /* sequencer_scope.c */ struct ImBuf *make_waveform_view_from_ibuf(struct ImBuf * ibuf); diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c index 1541b32f566..eedbab779c0 100644 --- a/source/blender/editors/space_sequencer/sequencer_ops.c +++ b/source/blender/editors/space_sequencer/sequencer_ops.c @@ -103,10 +103,10 @@ void sequencer_operatortypes(void) } -void sequencer_keymap(wmWindowManager *wm) +void sequencer_keymap(wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(wm, "Sequencer", SPACE_SEQ, 0); - wmKeymapItem *kmi; + wmKeyMap *keymap= WM_keymap_find(keyconf, "Sequencer", SPACE_SEQ, 0); + wmKeyMapItem *kmi; WM_keymap_add_item(keymap, "SEQUENCER_OT_properties", NKEY, KM_PRESS, 0, 0); @@ -183,6 +183,6 @@ void sequencer_keymap(wmWindowManager *wm) WM_keymap_verify_item(keymap, "ANIM_OT_change_frame", LEFTMOUSE, KM_PRESS, 0, 0); - transform_keymap_for_space(wm, keymap, SPACE_SEQ); + transform_keymap_for_space(keyconf, keymap, SPACE_SEQ); } diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index c2756b05946..626a3e6e2e0 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -190,7 +190,7 @@ static void sequencer_main_area_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, "Sequencer", SPACE_SEQ, 0); + keymap= WM_keymap_find(wm->defaultconf, "Sequencer", SPACE_SEQ, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } diff --git a/source/blender/editors/space_sound/space_sound.c b/source/blender/editors/space_sound/space_sound.c index 6713e19b6de..7cd9988eea0 100644 --- a/source/blender/editors/space_sound/space_sound.c +++ b/source/blender/editors/space_sound/space_sound.c @@ -147,7 +147,7 @@ static void sound_main_area_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, "Sound", SPACE_SOUND, 0); + keymap= WM_keymap_find(wm->defaultconf, "Sound", SPACE_SOUND, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } @@ -179,7 +179,7 @@ void sound_operatortypes(void) } -void sound_keymap(struct wmWindowManager *wm) +void sound_keymap(struct wmKeyConfig *keyconf) { } diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index e068c1a70bb..e3816ed7495 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -206,11 +206,11 @@ static void text_operatortypes(void) WM_operatortype_append(TEXT_OT_resolve_conflict); } -static void text_keymap(struct wmWindowManager *wm) +static void text_keymap(struct wmKeyConfig *keyconf) { wmKeyMap *keymap; - keymap= WM_keymap_find(wm, "Text", SPACE_TEXT, 0); + keymap= WM_keymap_find(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); @@ -336,7 +336,7 @@ static void text_main_area_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, "Text", SPACE_TEXT, 0); + keymap= WM_keymap_find(wm->defaultconf, "Text", SPACE_TEXT, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index 0f05eb0149d..501ac1c0cba 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -207,7 +207,7 @@ static void time_main_area_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, "TimeLine", SPACE_TIME, 0); + keymap= WM_keymap_find(wm->defaultconf, "TimeLine", SPACE_TIME, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } diff --git a/source/blender/editors/space_time/time_intern.h b/source/blender/editors/space_time/time_intern.h index 25f4c63fed1..ac6b407d117 100644 --- a/source/blender/editors/space_time/time_intern.h +++ b/source/blender/editors/space_time/time_intern.h @@ -35,7 +35,7 @@ struct wmWindowManager; /* time_ops.c */ void time_operatortypes(void); -void time_keymap(struct wmWindowManager *wm); +void time_keymap(struct wmKeyConfig *keyconf); /* time_header.c */ void time_header_buttons(const bContext *C, ARegion *ar); diff --git a/source/blender/editors/space_time/time_ops.c b/source/blender/editors/space_time/time_ops.c index 2b073f269bf..7d91c6d0fc7 100644 --- a/source/blender/editors/space_time/time_ops.c +++ b/source/blender/editors/space_time/time_ops.c @@ -140,9 +140,9 @@ void time_operatortypes(void) WM_operatortype_append(TIME_OT_end_frame_set); } -void time_keymap(wmWindowManager *wm) +void time_keymap(wmKeyConfig *keyconf) { - wmKeyMap *keymap= WM_keymap_find(wm, "TimeLine", SPACE_TIME, 0); + wmKeyMap *keymap= WM_keymap_find(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); diff --git a/source/blender/editors/space_userpref/space_userpref.c b/source/blender/editors/space_userpref/space_userpref.c index 8c9d723ce2c..39fc2fd2bd1 100644 --- a/source/blender/editors/space_userpref/space_userpref.c +++ b/source/blender/editors/space_userpref/space_userpref.c @@ -115,7 +115,7 @@ void userpref_operatortypes(void) { } -void userpref_keymap(struct wmWindowManager *wm) +void userpref_keymap(struct wmKeyConfig *keyconf) { } @@ -167,7 +167,7 @@ void ED_spacetype_userpref(void) art->init= userpref_main_area_init; art->draw= userpref_main_area_draw; art->listener= userpref_main_area_listener; - art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D; + art->keymapflag= ED_KEYMAP_UI; BLI_addhead(&st->regiontypes, art); diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 735f3df9b09..e1bd48e002f 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -280,62 +280,62 @@ static void view3d_main_area_init(wmWindowManager *wm, ARegion *ar) wmKeyMap *keymap; /* object ops. */ - keymap= WM_keymap_find(wm, "Object Non-modal", 0, 0); + keymap= WM_keymap_find(wm->defaultconf, "Object Non-modal", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); /* pose is not modal, operator poll checks for this */ - keymap= WM_keymap_find(wm, "Pose", 0, 0); + keymap= WM_keymap_find(wm->defaultconf, "Pose", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm, "Object Mode", 0, 0); + keymap= WM_keymap_find(wm->defaultconf, "Object Mode", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm, "Image Paint", 0, 0); + keymap= WM_keymap_find(wm->defaultconf, "Image Paint", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm, "Vertex Paint", 0, 0); + keymap= WM_keymap_find(wm->defaultconf, "Vertex Paint", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm, "Weight Paint", 0, 0); + keymap= WM_keymap_find(wm->defaultconf, "Weight Paint", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm, "Sculpt", 0, 0); + keymap= WM_keymap_find(wm->defaultconf, "Sculpt", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm, "EditMesh", 0, 0); + keymap= WM_keymap_find(wm->defaultconf, "EditMesh", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm, "Curve", 0, 0); + keymap= WM_keymap_find(wm->defaultconf, "Curve", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm, "Armature", 0, 0); + keymap= WM_keymap_find(wm->defaultconf, "Armature", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm, "Pose", 0, 0); + keymap= WM_keymap_find(wm->defaultconf, "Pose", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm, "Metaball", 0, 0); + keymap= WM_keymap_find(wm->defaultconf, "Metaball", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm, "Lattice", 0, 0); + keymap= WM_keymap_find(wm->defaultconf, "Lattice", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); /* armature sketching needs to take over mouse */ - keymap= WM_keymap_find(wm, "Armature_Sketch", 0, 0); + keymap= WM_keymap_find(wm->defaultconf, "Armature_Sketch", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm, "Particle", 0, 0); + keymap= WM_keymap_find(wm->defaultconf, "Particle", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); /* editfont keymap swallows all... */ - keymap= WM_keymap_find(wm, "Font", 0, 0); + keymap= WM_keymap_find(wm->defaultconf, "Font", 0, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); /* own keymap, last so modes can override it */ - keymap= WM_keymap_find(wm, "View3D Generic", SPACE_VIEW3D, 0); + keymap= WM_keymap_find(wm->defaultconf, "View3D Generic", SPACE_VIEW3D, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); - keymap= WM_keymap_find(wm, "View3D", SPACE_VIEW3D, 0); + keymap= WM_keymap_find(wm->defaultconf, "View3D", SPACE_VIEW3D, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } @@ -491,7 +491,7 @@ static void view3d_main_area_cursor(wmWindow *win, ScrArea *sa, ARegion *ar) /* add handlers, stuff you only do once or on area/region changes */ static void view3d_header_area_init(wmWindowManager *wm, ARegion *ar) { - wmKeyMap *keymap= WM_keymap_find(wm, "View3D Generic", SPACE_VIEW3D, 0); + wmKeyMap *keymap= WM_keymap_find(wm->defaultconf, "View3D Generic", SPACE_VIEW3D, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); @@ -531,7 +531,7 @@ static void view3d_buttons_area_init(wmWindowManager *wm, ARegion *ar) ED_region_panels_init(wm, ar); - keymap= WM_keymap_find(wm, "View3D Generic", SPACE_VIEW3D, 0); + keymap= WM_keymap_find(wm->defaultconf, "View3D Generic", SPACE_VIEW3D, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } @@ -602,7 +602,7 @@ static void view3d_tools_area_init(wmWindowManager *wm, ARegion *ar) ED_region_panels_init(wm, ar); - keymap= WM_keymap_find(wm, "View3D Generic", SPACE_VIEW3D, 0); + keymap= WM_keymap_find(wm->defaultconf, "View3D Generic", SPACE_VIEW3D, 0); WM_event_add_keymap_handler(&ar->handlers, keymap); } diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index c07d9108993..4c96e1fee39 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -371,7 +371,7 @@ enum { /* called in transform_ops.c, on each regeneration of keymaps */ -void viewrotate_modal_keymap(wmWindowManager *wm) +void viewrotate_modal_keymap(wmKeyConfig *keyconf) { static EnumPropertyItem modal_items[] = { {VIEW_MODAL_CONFIRM, "CONFIRM", 0, "Cancel", ""}, @@ -381,12 +381,12 @@ void viewrotate_modal_keymap(wmWindowManager *wm) {0, NULL, 0, NULL, NULL}}; - wmKeyMap *keymap= WM_modalkeymap_get(wm, "View3D Rotate Modal"); + wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "View3D Rotate Modal"); /* this function is called for each spacetype, only needs to add map once */ if(keymap) return; - keymap= WM_modalkeymap_add(wm, "View3D Rotate Modal", modal_items); + keymap= WM_modalkeymap_add(keyconf, "View3D Rotate Modal", modal_items); /* items for modal map */ WM_modalkeymap_add_item(keymap, MIDDLEMOUSE, KM_RELEASE, KM_ANY, 0, VIEW_MODAL_CONFIRM); @@ -630,19 +630,19 @@ void VIEW3D_OT_rotate(wmOperatorType *ot) /* NOTE: these defines are saved in keymap files, do not change values but just add new ones */ /* called in transform_ops.c, on each regeneration of keymaps */ -void viewmove_modal_keymap(wmWindowManager *wm) +void viewmove_modal_keymap(wmKeyConfig *keyconf) { static EnumPropertyItem modal_items[] = { {VIEW_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""}, {0, NULL, 0, NULL, NULL}}; - wmKeyMap *keymap= WM_modalkeymap_get(wm, "View3D Move Modal"); + wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "View3D Move Modal"); /* this function is called for each spacetype, only needs to add map once */ if(keymap) return; - keymap= WM_modalkeymap_add(wm, "View3D Move Modal", modal_items); + keymap= WM_modalkeymap_add(keyconf, "View3D Move Modal", modal_items); /* items for modal map */ WM_modalkeymap_add_item(keymap, MIDDLEMOUSE, KM_RELEASE, KM_ANY, 0, VIEW_MODAL_CONFIRM); @@ -749,19 +749,19 @@ void VIEW3D_OT_move(wmOperatorType *ot) /* ************************ viewzoom ******************************** */ /* called in transform_ops.c, on each regeneration of keymaps */ -void viewzoom_modal_keymap(wmWindowManager *wm) +void viewzoom_modal_keymap(wmKeyConfig *keyconf) { static EnumPropertyItem modal_items[] = { {VIEW_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""}, {0, NULL, 0, NULL, NULL}}; - wmKeyMap *keymap= WM_modalkeymap_get(wm, "View3D Zoom Modal"); + wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "View3D Zoom Modal"); /* this function is called for each spacetype, only needs to add map once */ if(keymap) return; - keymap= WM_modalkeymap_add(wm, "View3D Zoom Modal", modal_items); + keymap= WM_modalkeymap_add(keyconf, "View3D Zoom Modal", modal_items); /* items for modal map */ WM_modalkeymap_add_item(keymap, MIDDLEMOUSE, KM_RELEASE, KM_ANY, 0, VIEW_MODAL_CONFIRM); diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index d80cec9ad48..84d1a1275a9 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -62,7 +62,7 @@ void VIEW3D_OT_layers(struct wmOperatorType *ot); /* view3d_ops.c */ void view3d_operatortypes(void); -void view3d_keymap(struct wmWindowManager *wm); +void view3d_keymap(struct wmKeyConfig *keyconf); /* view3d_edit.c */ void VIEW3D_OT_zoom(struct wmOperatorType *ot); @@ -137,10 +137,10 @@ void smooth_view(struct bContext *C, Object *, Object *, float *ofs, float *quat void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect); /* rect: for picking */ void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d); -void fly_modal_keymap(struct wmWindowManager *wm); -void viewrotate_modal_keymap(struct wmWindowManager *wm); -void viewmove_modal_keymap(struct wmWindowManager *wm); -void viewzoom_modal_keymap(struct wmWindowManager *wm); +void fly_modal_keymap(struct wmKeyConfig *keyconf); +void viewrotate_modal_keymap(struct wmKeyConfig *keyconf); +void viewmove_modal_keymap(struct wmKeyConfig *keyconf); +void viewzoom_modal_keymap(struct wmKeyConfig *keyconf); /* view3d_buttons.c */ void VIEW3D_OT_properties(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index a151ff3e73a..74074a04188 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -103,18 +103,18 @@ void view3d_operatortypes(void) transform_operatortypes(); } -void view3d_keymap(wmWindowManager *wm) +void view3d_keymap(wmKeyConfig *keyconf) { wmKeyMap *keymap; - wmKeymapItem *km; + wmKeyMapItem *km; - keymap= WM_keymap_find(wm, "View3D Generic", SPACE_VIEW3D, 0); + keymap= WM_keymap_find(keyconf, "View3D Generic", SPACE_VIEW3D, 0); WM_keymap_add_item(keymap, "VIEW3D_OT_properties", NKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW3D_OT_toolbar", TKEY, KM_PRESS, 0, 0); /* only for region 3D window */ - keymap= WM_keymap_find(wm, "View3D", SPACE_VIEW3D, 0); + keymap= WM_keymap_find(keyconf, "View3D", SPACE_VIEW3D, 0); WM_keymap_verify_item(keymap, "VIEW3D_OT_manipulator", LEFTMOUSE, KM_PRESS, 0, 0); /* manipulator always on left mouse, not on action mouse*/ @@ -221,11 +221,11 @@ void view3d_keymap(wmWindowManager *wm) WM_keymap_add_item(keymap, "VIEW3D_OT_snap_menu", SKEY, KM_PRESS, KM_SHIFT, 0); - transform_keymap_for_space(wm, keymap, SPACE_VIEW3D); + transform_keymap_for_space(keyconf, keymap, SPACE_VIEW3D); - fly_modal_keymap(wm); - viewrotate_modal_keymap(wm); - viewmove_modal_keymap(wm); - viewzoom_modal_keymap(wm); + fly_modal_keymap(keyconf); + viewrotate_modal_keymap(keyconf); + viewmove_modal_keymap(keyconf); + viewzoom_modal_keymap(keyconf); } diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 505f3abf401..d26141e3b54 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1633,7 +1633,7 @@ void VIEW3D_OT_game_start(wmOperatorType *ot) #define FLY_MODAL_PRECISION_DISABLE 16 /* called in transform_ops.c, on each regeneration of keymaps */ -void fly_modal_keymap(wmWindowManager *wm) +void fly_modal_keymap(wmKeyConfig *keyconf) { static EnumPropertyItem modal_items[] = { {FLY_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""}, @@ -1659,12 +1659,12 @@ void fly_modal_keymap(wmWindowManager *wm) {0, NULL, 0, NULL, NULL}}; - wmKeyMap *keymap= WM_modalkeymap_get(wm, "View3D Fly Modal"); + wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "View3D Fly Modal"); /* this function is called for each spacetype, only needs to add map once */ if(keymap) return; - keymap= WM_modalkeymap_add(wm, "View3D Fly Modal", modal_items); + keymap= WM_modalkeymap_add(keyconf, "View3D Fly Modal", modal_items); /* items for modal map */ WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, FLY_MODAL_CANCEL); diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 839c3543515..ad89d8a3a59 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -515,7 +515,7 @@ static char *transform_to_undostr(TransInfo *t) #define TFM_MODAL_SNAP_GEARS_OFF 7 /* called in transform_ops.c, on each regeneration of keymaps */ -void transform_modal_keymap(wmWindowManager *wm) +void transform_modal_keymap(wmKeyConfig *keyconf) { static EnumPropertyItem modal_items[] = { {TFM_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""}, @@ -527,12 +527,12 @@ void transform_modal_keymap(wmWindowManager *wm) {TFM_MODAL_SNAP_GEARS_OFF, "SNAP_GEARS_OFF", 0, "Snap Off", ""}, {0, NULL, 0, NULL, NULL}}; - wmKeyMap *keymap= WM_modalkeymap_get(wm, "Transform Modal Map"); + wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "Transform Modal Map"); /* this function is called for each spacetype, only needs to add map once */ if(keymap) return; - keymap= WM_modalkeymap_add(wm, "Transform Modal Map", modal_items); + keymap= WM_modalkeymap_add(keyconf, "Transform Modal Map", modal_items); /* items for modal map */ WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, TFM_MODAL_CANCEL); diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 1c170a31c45..60786127e3a 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -508,7 +508,7 @@ int Align(TransInfo *t, short mval[2]); void drawPropCircle(const struct bContext *C, TransInfo *t); -void transform_modal_keymap(struct wmWindowManager *wm); +void transform_modal_keymap(struct wmKeyConfig *keyconf); /*********************** transform_conversions.c ********** */ diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 7ef8ad17a69..0913f0ea273 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -734,12 +734,12 @@ void transform_operatortypes(void) WM_operatortype_append(TFM_OT_delete_orientation); } -void transform_keymap_for_space(struct wmWindowManager *wm, struct wmKeyMap *keymap, int spaceid) +void transform_keymap_for_space(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap, int spaceid) { - wmKeymapItem *km; + wmKeyMapItem *km; /* transform.c, only adds modal map once, checks if it's there */ - transform_modal_keymap(wm); + transform_modal_keymap(keyconf); switch(spaceid) { diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 9216cfb5cdc..0f79420d3a7 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -3084,11 +3084,11 @@ void ED_operatortypes_uvedit(void) WM_operatortype_append(UV_OT_tile_set); } -void ED_keymap_uvedit(wmWindowManager *wm) +void ED_keymap_uvedit(wmKeyConfig *keyconf) { wmKeyMap *keymap; - keymap= WM_keymap_find(wm, "UVEdit", 0, 0); + keymap= WM_keymap_find(keyconf, "UVEdit", 0, 0); keymap->poll= ED_operator_uvedit; /* pick selection */ @@ -3129,6 +3129,6 @@ void ED_keymap_uvedit(wmWindowManager *wm) WM_keymap_add_item(keymap, "UV_OT_cursor_set", ACTIONMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "UV_OT_tile_set", ACTIONMOUSE, KM_PRESS, KM_SHIFT, 0); - transform_keymap_for_space(wm, keymap, SPACE_IMAGE); + transform_keymap_for_space(keyconf, keymap, SPACE_IMAGE); } |