diff options
Diffstat (limited to 'source/blender/windowmanager/WM_types.h')
-rw-r--r-- | source/blender/windowmanager/WM_types.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index f4595869baf..bbfc9d53e44 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -1020,7 +1020,7 @@ typedef struct wmDragAssetListItem { typedef char *(*WMDropboxTooltipFunc)(struct bContext *, struct wmDrag *, - const struct wmEvent *event, + const int xy[2], struct wmDropBox *drop); typedef struct wmDrag { @@ -1038,8 +1038,11 @@ typedef struct wmDrag { float scale; int sx, sy; - /** If filled, draws operator tooltip/operator name. */ - char tooltip[200]; + /** Informs which dropbox is activated with the drag item. + * When this value changes, the #draw_activate and #draw_deactivate dropbox callbacks are + * triggered. + */ + struct wmDropBox *active_dropbox; unsigned int flags; /** List of wmDragIDs, all are guaranteed to have the same ID type. */ @@ -1067,6 +1070,18 @@ typedef struct wmDropBox { */ void (*cancel)(struct Main *, struct wmDrag *, struct wmDropBox *); + /** Override the default drawing function. */ + void (*draw)(struct bContext *, struct wmWindow *, struct wmDrag *, const int *); + + /** Called when pool returns true the first time. */ + void (*draw_activate)(struct wmDropBox *, struct wmDrag *drag); + + /** Called when pool returns false the first time or when the drag event ends. */ + void (*draw_deactivate)(struct wmDropBox *, struct wmDrag *drag); + + /** Custom data for drawing. */ + void *draw_data; + /** Custom tooltip shown during dragging. */ WMDropboxTooltipFunc tooltip; |