diff options
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 7 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 12 |
2 files changed, 14 insertions, 5 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 1db4b4328e9..98df18169cd 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -58,6 +58,7 @@ struct wmMsgSubscribeKey; struct wmMsgSubscribeValue; struct wmOperatorType; struct wmOperator; +struct wmPaintCursor; struct rcti; struct PointerRNA; struct PropertyRNA; @@ -170,15 +171,17 @@ void WM_cursor_grab_enable(struct wmWindow *win, bool wrap, bool hide, int boun void WM_cursor_grab_disable(struct wmWindow *win, const int mouse_ungrab_xy[2]); void WM_cursor_time (struct wmWindow *win, int nr); -void *WM_paint_cursor_activate( +struct wmPaintCursor *WM_paint_cursor_activate( struct wmWindowManager *wm, bool (*poll)(struct bContext *C), void (*draw)(struct bContext *C, int, int, void *customdata), void *customdata); -void WM_paint_cursor_end(struct wmWindowManager *wm, void *handle); +bool WM_paint_cursor_end(struct wmWindowManager *wm, struct wmPaintCursor *handle); +void *WM_paint_cursor_customdata_get(struct wmPaintCursor *pc); void WM_paint_cursor_tag_redraw(struct wmWindow *win, struct ARegion *ar); + void WM_cursor_warp (struct wmWindow *win, int x, int y); void WM_cursor_compatible_xy(wmWindow *win, int *x, int *y); float WM_cursor_pressure (const struct wmWindow *win); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index e3c96ff926c..fa654e46cf1 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1844,7 +1844,7 @@ static void WM_OT_console_toggle(wmOperatorType *ot) * - draw(bContext): drawing callback for paint cursor */ -void *WM_paint_cursor_activate( +wmPaintCursor *WM_paint_cursor_activate( wmWindowManager *wm, bool (*poll)(bContext *C), wmPaintCursorDraw draw, void *customdata) { @@ -1859,7 +1859,7 @@ void *WM_paint_cursor_activate( return pc; } -void WM_paint_cursor_end(wmWindowManager *wm, void *handle) +bool WM_paint_cursor_end(wmWindowManager *wm, wmPaintCursor *handle) { wmPaintCursor *pc; @@ -1867,9 +1867,15 @@ void WM_paint_cursor_end(wmWindowManager *wm, void *handle) if (pc == (wmPaintCursor *)handle) { BLI_remlink(&wm->paintcursors, pc); MEM_freeN(pc); - return; + return true; } } + return false; +} + +void *WM_paint_cursor_customdata_get(wmPaintCursor *pc) +{ + return pc->customdata; } /* *********************** radial control ****************** */ |