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>2013-04-04 19:16:29 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-04-04 19:16:29 +0400
commit677172fd65f119fd5101ebe2292f47974ecfeb08 (patch)
treec4ae6b7b9b4bbb10a0376f33ce775456a588ad41 /source/blender/windowmanager
parented88229ebcfac4a3297f2263842e9000eb184870 (diff)
code cleanup: use bools in interface handlers, dont show translation menu when right clicking on splash, use less confusing args for copy/paste function.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/WM_api.h4
-rw-r--r--source/blender/windowmanager/WM_keymap.h2
-rw-r--r--source/blender/windowmanager/intern/wm_cursors.c2
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c18
-rw-r--r--source/blender/windowmanager/intern/wm_keymap.c2
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c2
6 files changed, 19 insertions, 11 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 236560bdac4..a395d535907 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -119,7 +119,7 @@ void WM_cursor_set (struct wmWindow *win, int curs);
void WM_cursor_modal (struct wmWindow *win, int curs);
void WM_cursor_restore (struct wmWindow *win);
void WM_cursor_wait (bool val);
-void WM_cursor_grab_enable(struct wmWindow *win, int wrap, int hide, int bounds[4]);
+void WM_cursor_grab_enable(struct wmWindow *win, bool wrap, bool hide, int bounds[4]);
void WM_cursor_grab_disable(struct wmWindow *win, int mouse_ungrab_xy[2]);
void WM_cursor_time (struct wmWindow *win, int nr);
@@ -154,7 +154,7 @@ struct wmEventHandler *WM_event_add_ui_handler(
void WM_event_remove_ui_handler(ListBase *handlers,
int (*func)(struct bContext *C, const struct wmEvent *event, void *userdata),
void (*remove)(struct bContext *C, void *userdata),
- void *userdata, int postpone);
+ void *userdata, const bool postpone);
void WM_event_remove_area_handler(struct ListBase *handlers, void *area);
struct wmEventHandler *WM_event_add_modal_handler(struct bContext *C, struct wmOperator *op);
diff --git a/source/blender/windowmanager/WM_keymap.h b/source/blender/windowmanager/WM_keymap.h
index 49ee759bbf2..6f3b90c00a1 100644
--- a/source/blender/windowmanager/WM_keymap.h
+++ b/source/blender/windowmanager/WM_keymap.h
@@ -94,7 +94,7 @@ void WM_keymap_restore_item_to_default(struct bContext *C, struct wmKeyMap *key
const char *WM_key_event_string(short type);
int WM_key_event_operator_id(const struct bContext *C, const char *opname, int opcontext, struct IDProperty *properties, int hotkey, struct wmKeyMap **keymap_r);
-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);
+char *WM_key_event_operator_string(const struct bContext *C, const char *opname, int opcontext, struct IDProperty *properties, const bool sloppy, char *str, int len);
#ifdef __cplusplus
}
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index f8081cb8012..bf48d9e6561 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -184,7 +184,7 @@ void WM_cursor_wait(bool val)
/**
* \param bounds can be NULL
*/
-void WM_cursor_grab_enable(wmWindow *win, int wrap, int hide, int bounds[4])
+void WM_cursor_grab_enable(wmWindow *win, bool wrap, bool hide, int bounds[4])
{
/* Only grab cursor when not running debug.
* It helps not to get a stuck WM when hitting a breakpoint
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index d7b642fc5cf..626eeeadfe4 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -987,7 +987,7 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event,
}
}
- WM_cursor_grab_enable(CTX_wm_window(C), wrap, FALSE, bounds);
+ WM_cursor_grab_enable(CTX_wm_window(C), wrap, false, bounds);
}
/* cancel UI handlers, typically tooltips that can hang around
@@ -2403,9 +2403,17 @@ wmEventHandler *WM_event_add_ui_handler(const bContext *C, ListBase *handlers,
handler->ui_handle = func;
handler->ui_remove = remove;
handler->ui_userdata = userdata;
- handler->ui_area = (C) ? CTX_wm_area(C) : NULL;
- handler->ui_region = (C) ? CTX_wm_region(C) : NULL;
- handler->ui_menu = (C) ? CTX_wm_menu(C) : NULL;
+ if (C) {
+ handler->ui_area = CTX_wm_area(C);
+ handler->ui_region = CTX_wm_region(C);
+ handler->ui_menu = CTX_wm_menu(C);
+ }
+ else {
+ handler->ui_area = NULL;
+ handler->ui_region = NULL;
+ handler->ui_menu = NULL;
+ }
+
BLI_addhead(handlers, handler);
@@ -2414,7 +2422,7 @@ wmEventHandler *WM_event_add_ui_handler(const bContext *C, ListBase *handlers,
/* set "postpone" for win->modalhandlers, this is in a running for () loop in wm_handlers_do() */
void WM_event_remove_ui_handler(ListBase *handlers,
- wmUIHandlerFunc func, wmUIHandlerRemoveFunc remove, void *userdata, int postpone)
+ wmUIHandlerFunc func, wmUIHandlerRemoveFunc remove, void *userdata, const bool postpone)
{
wmEventHandler *handler;
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c
index ff711c5ca4d..886003d2f74 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -972,7 +972,7 @@ static wmKeyMapItem *wm_keymap_item_find(
char *WM_key_event_operator_string(
const bContext *C, const char *opname, int opcontext,
- IDProperty *properties, const short sloppy, char *str, int len)
+ IDProperty *properties, const bool sloppy, char *str, int len)
{
wmKeyMapItem *kmi = wm_keymap_item_find(C, opname, opcontext, properties, 0, sloppy, NULL);
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index d0f258dc375..77b9fe46265 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -333,7 +333,7 @@ static int wm_macro_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
}
- WM_cursor_grab_enable(CTX_wm_window(C), wrap, FALSE, bounds);
+ WM_cursor_grab_enable(CTX_wm_window(C), wrap, false, bounds);
}
}
}