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:
authorCampbell Barton <campbell@blender.org>2022-04-04 06:47:06 +0300
committerCampbell Barton <campbell@blender.org>2022-04-04 07:32:42 +0300
commitf699dbba86156ad3f24c24e3d369f0708b3fd1b5 (patch)
treee244f3f17a5a2166d443d25c14abb915d316f1a2 /source/blender/windowmanager/intern/wm_keymap_utils.c
parent0ef96cd3922dbc16271f2dbaca0c7752db92a40d (diff)
Cleanup: use event parameters for functions that create key-map items
Replace 5 arguments with a single struct as the same arguments are used in many places. This didn't read well and was confusing with both arguments named `val` & `value` in the case of WM_modalkeymap_add_item.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_keymap_utils.c')
-rw-r--r--source/blender/windowmanager/intern/wm_keymap_utils.c36
1 files changed, 8 insertions, 28 deletions
diff --git a/source/blender/windowmanager/intern/wm_keymap_utils.c b/source/blender/windowmanager/intern/wm_keymap_utils.c
index 24c221221d1..5a35570296a 100644
--- a/source/blender/windowmanager/intern/wm_keymap_utils.c
+++ b/source/blender/windowmanager/intern/wm_keymap_utils.c
@@ -31,42 +31,27 @@
wmKeyMapItem *WM_keymap_add_menu(wmKeyMap *keymap,
const char *idname,
- int type,
- int val,
- int modifier,
- int keymodifier,
- int direction)
+ const KeyMapItem_Params *params)
{
- wmKeyMapItem *kmi = WM_keymap_add_item(
- keymap, "WM_OT_call_menu", type, val, modifier, keymodifier, direction);
+ wmKeyMapItem *kmi = WM_keymap_add_item(keymap, "WM_OT_call_menu", params);
RNA_string_set(kmi->ptr, "name", idname);
return kmi;
}
wmKeyMapItem *WM_keymap_add_menu_pie(wmKeyMap *keymap,
const char *idname,
- int type,
- int val,
- int modifier,
- int keymodifier,
- int direction)
+ const KeyMapItem_Params *params)
{
- wmKeyMapItem *kmi = WM_keymap_add_item(
- keymap, "WM_OT_call_menu_pie", type, val, modifier, keymodifier, direction);
+ wmKeyMapItem *kmi = WM_keymap_add_item(keymap, "WM_OT_call_menu_pie", params);
RNA_string_set(kmi->ptr, "name", idname);
return kmi;
}
wmKeyMapItem *WM_keymap_add_panel(wmKeyMap *keymap,
const char *idname,
- int type,
- int val,
- int modifier,
- int keymodifier,
- int direction)
+ const KeyMapItem_Params *params)
{
- wmKeyMapItem *kmi = WM_keymap_add_item(
- keymap, "WM_OT_call_panel", type, val, modifier, keymodifier, direction);
+ wmKeyMapItem *kmi = WM_keymap_add_item(keymap, "WM_OT_call_panel", params);
RNA_string_set(kmi->ptr, "name", idname);
/* TODO: we might want to disable this. */
RNA_boolean_set(kmi->ptr, "keep_open", false);
@@ -75,14 +60,9 @@ wmKeyMapItem *WM_keymap_add_panel(wmKeyMap *keymap,
wmKeyMapItem *WM_keymap_add_tool(wmKeyMap *keymap,
const char *idname,
- int type,
- int val,
- int modifier,
- int keymodifier,
- int direction)
+ const KeyMapItem_Params *params)
{
- wmKeyMapItem *kmi = WM_keymap_add_item(
- keymap, "WM_OT_tool_set_by_id", type, val, modifier, keymodifier, direction);
+ wmKeyMapItem *kmi = WM_keymap_add_item(keymap, "WM_OT_tool_set_by_id", params);
RNA_string_set(kmi->ptr, "name", idname);
return kmi;
}