From 74b0591d420ddccca1c6435dc70a154aaaf8eed1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 18 Apr 2016 06:20:42 +1000 Subject: Cleanup: pass event args as const --- source/blender/windowmanager/intern/wm_cursors.c | 2 +- source/blender/windowmanager/intern/wm_event_system.c | 16 ++++++++-------- source/blender/windowmanager/wm_cursors.h | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'source') diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c index d9466cbd035..d4c3928bd6c 100644 --- a/source/blender/windowmanager/intern/wm_cursors.c +++ b/source/blender/windowmanager/intern/wm_cursors.c @@ -253,7 +253,7 @@ static void wm_cursor_warp_relative(wmWindow *win, int x, int y) } /* give it a modal keymap one day? */ -int wm_cursor_arrow_move(wmWindow *win, wmEvent *event) +bool wm_cursor_arrow_move(wmWindow *win, const wmEvent *event) { if (win && event->val == KM_PRESS) { if (event->type == UPARROWKEY) { diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index d7ece0c7c0b..e5b98a1b735 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -410,7 +410,7 @@ void wm_event_do_notifiers(bContext *C) CTX_wm_window_set(C, NULL); } -static int wm_event_always_pass(wmEvent *event) +static int wm_event_always_pass(const wmEvent *event) { /* some events we always pass on, to ensure proper communication */ return ISTIMER(event->type) || (event->type == WINDEACTIVATE); @@ -418,7 +418,7 @@ static int wm_event_always_pass(wmEvent *event) /* ********************* ui handler ******************* */ -static int wm_handler_ui_call(bContext *C, wmEventHandler *handler, wmEvent *event, int always_pass) +static int wm_handler_ui_call(bContext *C, wmEventHandler *handler, const wmEvent *event, int always_pass) { ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); @@ -1526,7 +1526,7 @@ int WM_userdef_event_map(int kmitype) } -static int wm_eventmatch(wmEvent *winevent, wmKeyMapItem *kmi) +static int wm_eventmatch(const wmEvent *winevent, wmKeyMapItem *kmi) { int kmitype = WM_userdef_event_map(kmi->type); @@ -1921,7 +1921,7 @@ static int wm_handler_fileselect_do(bContext *C, ListBase *handlers, wmEventHand return action; } -static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHandler *handler, wmEvent *event) +static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHandler *handler, const wmEvent *event) { int action = WM_HANDLER_CONTINUE; @@ -1933,7 +1933,7 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa return wm_handler_fileselect_do(C, handlers, handler, event->val); } -static bool handler_boundbox_test(wmEventHandler *handler, wmEvent *event) +static bool handler_boundbox_test(wmEventHandler *handler, const wmEvent *event) { if (handler->bbwin) { if (handler->bblocal) { @@ -2245,7 +2245,7 @@ static void wm_paintcursor_tag(bContext *C, wmPaintCursor *pc, ARegion *ar) /* called on mousemove, check updates for paintcursors */ /* context was set on active area and region */ -static void wm_paintcursor_test(bContext *C, wmEvent *event) +static void wm_paintcursor_test(bContext *C, const wmEvent *event) { wmWindowManager *wm = CTX_wm_manager(C); @@ -2312,7 +2312,7 @@ static void wm_event_drag_test(wmWindowManager *wm, wmWindow *win, wmEvent *even } /* filter out all events of the pie that spawned the last pie unless it's a release event */ -static bool wm_event_pie_filter(wmWindow *win, wmEvent *event) +static bool wm_event_pie_filter(wmWindow *win, const wmEvent *event) { if (win->lock_pie_event && win->lock_pie_event == event->type) { if (event->val == KM_RELEASE) { @@ -3124,7 +3124,7 @@ static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *wi return NULL; } -static bool wm_event_is_double_click(wmEvent *event, wmEvent *event_state) +static bool wm_event_is_double_click(wmEvent *event, const wmEvent *event_state) { if ((event->type == event_state->prevtype) && (event_state->prevval == KM_RELEASE) && diff --git a/source/blender/windowmanager/wm_cursors.h b/source/blender/windowmanager/wm_cursors.h index e99f80f53cd..c695a12f52c 100644 --- a/source/blender/windowmanager/wm_cursors.h +++ b/source/blender/windowmanager/wm_cursors.h @@ -111,7 +111,7 @@ enum { struct wmWindow; struct wmEvent; -int wm_cursor_arrow_move(struct wmWindow *win, struct wmEvent *event); +bool wm_cursor_arrow_move(struct wmWindow *win, const struct wmEvent *event); #endif /* __WM_CURSORS_H__ */ -- cgit v1.2.3