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 <ideasman42@gmail.com>2014-01-27 20:52:21 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-01-27 21:00:04 +0400
commita5c35fb27f090bb716a3bb49a69a56be80dff6d3 (patch)
treec2486c0781d2135c00ee58c78c042ba9d4f87b97 /source/blender/windowmanager/intern/wm_keymap.c
parent60287e23b53a273aae56c42502278991dbeee9e7 (diff)
Code cleanup: use booleans where appropriate
Diffstat (limited to 'source/blender/windowmanager/intern/wm_keymap.c')
-rw-r--r--source/blender/windowmanager/intern/wm_keymap.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c
index 10837178f35..7caa5b31df4 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -928,7 +928,7 @@ int WM_keymap_item_to_string(wmKeyMapItem *kmi, char *str, const int len)
static wmKeyMapItem *wm_keymap_item_find_handlers(
const bContext *C, ListBase *handlers, const char *opname, int UNUSED(opcontext),
- IDProperty *properties, int is_strict, int hotkey, wmKeyMap **keymap_r)
+ IDProperty *properties, const bool is_strict, const bool is_hotkey, wmKeyMap **keymap_r)
{
wmWindowManager *wm = CTX_wm_manager(C);
wmEventHandler *handler;
@@ -943,7 +943,7 @@ static wmKeyMapItem *wm_keymap_item_find_handlers(
for (kmi = keymap->items.first; kmi; kmi = kmi->next) {
if (strcmp(kmi->idname, opname) == 0 && WM_key_event_string(kmi->type)[0]) {
- if (hotkey)
+ if (is_hotkey)
if (!ISHOTKEY(kmi->type))
continue;
@@ -982,7 +982,7 @@ static wmKeyMapItem *wm_keymap_item_find_handlers(
static wmKeyMapItem *wm_keymap_item_find_props(
const bContext *C, const char *opname, int opcontext,
- IDProperty *properties, int is_strict, int hotkey, wmKeyMap **keymap_r)
+ IDProperty *properties, const bool is_strict, const bool is_hotkey, wmKeyMap **keymap_r)
{
wmWindow *win = CTX_wm_window(C);
ScrArea *sa = CTX_wm_area(C);
@@ -991,10 +991,10 @@ static wmKeyMapItem *wm_keymap_item_find_props(
/* look into multiple handler lists to find the item */
if (win)
- found = wm_keymap_item_find_handlers(C, &win->handlers, opname, opcontext, properties, is_strict, hotkey, keymap_r);
+ found = wm_keymap_item_find_handlers(C, &win->handlers, opname, opcontext, properties, is_strict, is_hotkey, keymap_r);
if (sa && found == NULL)
- found = wm_keymap_item_find_handlers(C, &sa->handlers, opname, opcontext, properties, is_strict, hotkey, keymap_r);
+ found = wm_keymap_item_find_handlers(C, &sa->handlers, opname, opcontext, properties, is_strict, is_hotkey, keymap_r);
if (found == NULL) {
if (ELEM(opcontext, WM_OP_EXEC_REGION_WIN, WM_OP_INVOKE_REGION_WIN)) {
@@ -1003,7 +1003,7 @@ static wmKeyMapItem *wm_keymap_item_find_props(
ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
if (ar)
- found = wm_keymap_item_find_handlers(C, &ar->handlers, opname, opcontext, properties, is_strict, hotkey, keymap_r);
+ found = wm_keymap_item_find_handlers(C, &ar->handlers, opname, opcontext, properties, is_strict, is_hotkey, keymap_r);
}
}
else if (ELEM(opcontext, WM_OP_EXEC_REGION_CHANNELS, WM_OP_INVOKE_REGION_CHANNELS)) {
@@ -1011,18 +1011,18 @@ static wmKeyMapItem *wm_keymap_item_find_props(
ar = BKE_area_find_region_type(sa, RGN_TYPE_CHANNELS);
if (ar)
- found = wm_keymap_item_find_handlers(C, &ar->handlers, opname, opcontext, properties, is_strict, hotkey, keymap_r);
+ found = wm_keymap_item_find_handlers(C, &ar->handlers, opname, opcontext, properties, is_strict, is_hotkey, keymap_r);
}
else if (ELEM(opcontext, WM_OP_EXEC_REGION_PREVIEW, WM_OP_INVOKE_REGION_PREVIEW)) {
if (!(ar && ar->regiontype == RGN_TYPE_PREVIEW))
ar = BKE_area_find_region_type(sa, RGN_TYPE_PREVIEW);
if (ar)
- found = wm_keymap_item_find_handlers(C, &ar->handlers, opname, opcontext, properties, is_strict, hotkey, keymap_r);
+ found = wm_keymap_item_find_handlers(C, &ar->handlers, opname, opcontext, properties, is_strict, is_hotkey, keymap_r);
}
else {
if (ar)
- found = wm_keymap_item_find_handlers(C, &ar->handlers, opname, opcontext, properties, is_strict, hotkey, keymap_r);
+ found = wm_keymap_item_find_handlers(C, &ar->handlers, opname, opcontext, properties, is_strict, is_hotkey, keymap_r);
}
}
@@ -1031,9 +1031,9 @@ static wmKeyMapItem *wm_keymap_item_find_props(
static wmKeyMapItem *wm_keymap_item_find(
const bContext *C, const char *opname, int opcontext,
- IDProperty *properties, const short hotkey, const bool strict, wmKeyMap **keymap_r)
+ IDProperty *properties, const bool is_hotkey, const bool is_strict, wmKeyMap **keymap_r)
{
- wmKeyMapItem *found = wm_keymap_item_find_props(C, opname, opcontext, properties, strict, hotkey, keymap_r);
+ wmKeyMapItem *found = wm_keymap_item_find_props(C, opname, opcontext, properties, is_strict, is_hotkey, keymap_r);
if (!found && properties) {
wmOperatorType *ot = WM_operatortype_find(opname, TRUE);
@@ -1046,14 +1046,14 @@ static wmKeyMapItem *wm_keymap_item_find(
RNA_pointer_create(NULL, ot->srna, properties_default, &opptr);
if (WM_operator_properties_default(&opptr, true) ||
- (!strict && ot->prop && RNA_property_is_set(&opptr, ot->prop)))
+ (!is_strict && ot->prop && RNA_property_is_set(&opptr, ot->prop)))
{
/* for operator that has enum menu, unset it so it always matches */
- if (!strict && ot->prop) {
+ if (!is_strict && ot->prop) {
RNA_property_unset(&opptr, ot->prop);
}
- found = wm_keymap_item_find_props(C, opname, opcontext, properties_default, false, hotkey, keymap_r);
+ found = wm_keymap_item_find_props(C, opname, opcontext, properties_default, false, is_hotkey, keymap_r);
}
IDP_FreeProperty(properties_default);
@@ -1066,9 +1066,9 @@ static wmKeyMapItem *wm_keymap_item_find(
char *WM_key_event_operator_string(
const bContext *C, const char *opname, int opcontext,
- IDProperty *properties, const bool strict, char *str, int len)
+ IDProperty *properties, const bool is_strict, char *str, int len)
{
- wmKeyMapItem *kmi = wm_keymap_item_find(C, opname, opcontext, properties, 0, strict, NULL);
+ wmKeyMapItem *kmi = wm_keymap_item_find(C, opname, opcontext, properties, false, is_strict, NULL);
if (kmi) {
WM_keymap_item_to_string(kmi, str, len);
@@ -1080,9 +1080,9 @@ char *WM_key_event_operator_string(
int WM_key_event_operator_id(
const bContext *C, const char *opname, int opcontext,
- IDProperty *properties, int hotkey, wmKeyMap **keymap_r)
+ IDProperty *properties, const bool is_hotkey, wmKeyMap **keymap_r)
{
- wmKeyMapItem *kmi = wm_keymap_item_find(C, opname, opcontext, properties, hotkey, true, keymap_r);
+ wmKeyMapItem *kmi = wm_keymap_item_find(C, opname, opcontext, properties, is_hotkey, true, keymap_r);
if (kmi)
return kmi->id;