WM: minor changes to cursor API
[blender.git] / source / blender / windowmanager / intern / wm_operators.c
index 45084980727d3e3aef99f7a90045fdd36ba17de0..2008d388ad3e1756a7ad92902b9a84524d338fe2 100644 (file)
@@ -1813,7 +1813,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)
 {
@@ -1828,7 +1828,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;
 
@@ -1836,9 +1836,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 ****************** */