2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2007 Blender Foundation.
19 * All rights reserved.
21 * Contributor(s): Blender Foundation
23 * ***** END GPL LICENSE BLOCK *****
33 /* dna-savable wmStructs here */
34 #include "DNA_windowmanager_types.h"
40 struct EnumPropertyItem;
42 /* Key Configuration */
44 wmKeyConfig *WM_keyconfig_new (struct wmWindowManager *wm, const char *idname);
45 wmKeyConfig *WM_keyconfig_new_user(struct wmWindowManager *wm, const char *idname);
46 void WM_keyconfig_remove (struct wmWindowManager *wm, struct wmKeyConfig *keyconf);
47 void WM_keyconfig_free (struct wmKeyConfig *keyconf);
49 void WM_keyconfig_set_active(struct wmWindowManager *wm, const char *idname);
51 void WM_keyconfig_update(struct wmWindowManager *wm);
52 void WM_keyconfig_update_tag(struct wmKeyMap *keymap, struct wmKeyMapItem *kmi);
56 void WM_keymap_init (struct bContext *C);
57 void WM_keymap_free (struct wmKeyMap *keymap);
59 wmKeyMapItem *WM_keymap_verify_item(struct wmKeyMap *keymap, const char *idname, int type,
60 int val, int modifier, int keymodifier);
61 wmKeyMapItem *WM_keymap_add_item(struct wmKeyMap *keymap, const char *idname, int type,
62 int val, int modifier, int keymodifier);
63 wmKeyMapItem *WM_keymap_add_menu(struct wmKeyMap *keymap, const char *idname, int type,
64 int val, int modifier, int keymodifier);
66 void WM_keymap_remove_item(struct wmKeyMap *keymap, struct wmKeyMapItem *kmi);
67 char *WM_keymap_item_to_string(wmKeyMapItem *kmi, char *str, int len);
69 wmKeyMap *WM_keymap_list_find(ListBase *lb, const char *idname, int spaceid, int regionid);
70 wmKeyMap *WM_keymap_find(struct wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid);
71 wmKeyMap *WM_keymap_find_all(const struct bContext *C, const char *idname, int spaceid, int regionid);
72 wmKeyMap *WM_keymap_active(struct wmWindowManager *wm, struct wmKeyMap *keymap);
73 wmKeyMap *WM_keymap_guess_opname(const struct bContext *C, const char *opname);
75 wmKeyMapItem *WM_keymap_item_find_id(struct wmKeyMap *keymap, int id);
76 int WM_keymap_item_compare(struct wmKeyMapItem *k1, struct wmKeyMapItem *k2);
80 wmKeyMap *WM_modalkeymap_add(struct wmKeyConfig *keyconf, const char *idname, struct EnumPropertyItem *items);
81 wmKeyMap *WM_modalkeymap_get(struct wmKeyConfig *keyconf, const char *idname);
82 wmKeyMapItem *WM_modalkeymap_add_item(struct wmKeyMap *km, int type, int val, int modifier, int keymodifier, int value);
83 void WM_modalkeymap_assign(struct wmKeyMap *km, const char *opname);
87 void WM_keymap_restore_to_default(struct wmKeyMap *keymap, struct bContext *C);
88 void WM_keymap_properties_reset(struct wmKeyMapItem *kmi, struct IDProperty *properties);
89 void WM_keymap_restore_item_to_default(struct bContext *C, struct wmKeyMap *keymap, struct wmKeyMapItem *kmi);
93 const char *WM_key_event_string(short type);
94 int WM_key_event_operator_id(const struct bContext *C, const char *opname, int opcontext, struct IDProperty *properties, int hotkey, struct wmKeyMap **keymap_r);
95 char *WM_key_event_operator_string(const struct bContext *C, const char *opname, int opcontext, struct IDProperty *properties, const short sloppy, char *str, int len);
101 #endif /* WM_KEYMAP_H */