Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-10-08 22:40:03 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-10-08 22:40:03 +0400
commit3ebd58673fb9a8c5ef13048b2e8e8a4cb7bb3a4e (patch)
tree81031f2772990c6292eafce955d09897a8e40d6f /source/blender/makesdna/DNA_windowmanager_types.h
parente0c5e484732bb344fb845acc2678777e4bff1d5c (diff)
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note that editing one item in a keymap means the whole keymap is now defined by the user and will not be updated by Blender, an option for syncing might be added later. The outliner interface is still there, but I will probably remove it. There's actually 3 levels now: * Default builtin key configuration. * Key configuration loaded from .py file, for configs like Blender 2.4x or other 3D applications. * Keymaps edited by the user and saved in .B.blend. These can be saved to .py files as well to make creating distributable configurations easier. Also, user preferences sections were reorganized a bit, now there is: Interface, Editing, Input, Files and System. Implementation notes: * wmKeyConfig was added which represents a key configuration containing keymaps. * wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap. * Modal maps are not wrapped yet. * User preferences DNA file reading did not support newdataadr() yet, added this now for reading keymaps. * Key configuration related settings are now RNA wrapped. * is_property_set and is_property_hidden python methods were added.
Diffstat (limited to 'source/blender/makesdna/DNA_windowmanager_types.h')
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h65
1 files changed, 46 insertions, 19 deletions
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index ea9d0e86c38..2b986d6d802 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -42,6 +42,7 @@ struct wmGesture;
struct wmOperatorType;
struct wmOperator;
struct wmKeyMap;
+struct wmKeyConfig;
/* forwards */
struct bContext;
@@ -120,9 +121,9 @@ typedef struct wmWindowManager {
ListBase paintcursors; /* extra overlay cursors to draw, like circles */
- /* used keymaps, optionally/partially saved */
- ListBase keymaps;
-
+ ListBase keyconfigs; /* known key configurations */
+ struct wmKeyConfig *defaultconf; /* default configuration, not saved */
+ int defaultactmap, pad2; /* active keymap from default for editing */
} wmWindowManager;
/* wmWindowManager.initialized */
@@ -234,44 +235,70 @@ typedef struct wmOperatorType {
/* partial copy of the event, for matching by eventhandler */
-typedef struct wmKeymapItem {
- struct wmKeymapItem *next, *prev;
+typedef struct wmKeyMapItem {
+ struct wmKeyMapItem *next, *prev;
+ /* operator */
char idname[64]; /* used to retrieve operator type pointer */
- struct PointerRNA *ptr; /* rna pointer to access properties */
+ IDProperty *properties; /* operator properties */
+ /* modal */
+ short propvalue; /* if used, the item is from modal map */
+
+ /* event */
short type; /* event code itself */
short val; /* 0=any, 1=click, 2=release, or wheelvalue, or... */
short shift, ctrl, alt, oskey; /* oskey is apple or windowskey, value denotes order of pressed */
short keymodifier; /* rawkey modifier */
- short propvalue; /* if used, the item is from modal map */
-
- short inactive; /* if set, deactivated item */
- short maptype; /* keymap editor */
- short pad2, pad3;
-} wmKeymapItem;
+ /* flag: inactive, expanded */
+ short flag;
+ /* runtime */
+ short maptype, pad[2]; /* keymap editor */
+ struct PointerRNA *ptr; /* rna pointer to access properties */
+} wmKeyMapItem;
+
+/* wmKeyMapItem.flag */
+#define KMI_INACTIVE 1
+#define KMI_EXPANDED 2
/* stored in WM, the actively used keymaps */
typedef struct wmKeyMap {
struct wmKeyMap *next, *prev;
- ListBase keymap;
+ ListBase items;
- char nameid[64]; /* global editor keymaps, or for more per space/region */
+ char idname[64]; /* global editor keymaps, or for more per space/region */
short spaceid; /* same IDs as in DNA_space_types.h */
short regionid; /* see above */
- short is_modal; /* modal map, not using operatornames */
+ short flag; /* general flags */
short pad;
- void *items; /* struct EnumPropertyItem for now */
-
- /* verify if the keymap is enabled in the current context */
- int (*poll)(struct bContext *);
+ /* runtime */
+ int (*poll)(struct bContext *); /* verify if enabled in the current context */
+ void *modal_items; /* for modal, EnumPropertyItem for now */
} wmKeyMap;
+/* wmKeyMap.flag */
+#define KEYMAP_MODAL 1 /* modal map, not using operatornames */
+#define KEYMAP_USER 2 /* user created keymap */
+
+typedef struct wmKeyConfig {
+ struct wmKeyConfig *next, *prev;
+
+ char idname[64]; /* unique name */
+ char basename[64]; /* idname of configuration this is derives from, "" if none */
+
+ ListBase keymaps;
+ int actkeymap, flag;
+} wmKeyConfig;
+
+/* wmKeyConfig.flag */
+#define KEYCONF_TWOBUTTONMOUSE (1 << 1)
+#define KEYCONF_LMOUSESELECT (1 << 2)
+#define KEYCONF_NONUMPAD (1 << 3)
/* this one is the operator itself, stored in files for macros etc */
/* operator + operatortype should be able to redo entirely, but for different contextes */