Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/WM_types.h
| Show First 20 Lines • Show All 1,014 Lines • ▼ Show 20 Lines | union { | ||||
| wmDragAsset *external_info; | wmDragAsset *external_info; | ||||
| } asset_data; | } asset_data; | ||||
| bool is_external; | bool is_external; | ||||
| } wmDragAssetListItem; | } wmDragAssetListItem; | ||||
| typedef char *(*WMDropboxTooltipFunc)(struct bContext *, | typedef char *(*WMDropboxTooltipFunc)(struct bContext *, | ||||
| struct wmDrag *, | struct wmDrag *, | ||||
| const struct wmEvent *event, | const int xy[2], | ||||
| struct wmDropBox *drop); | struct wmDropBox *drop); | ||||
| typedef struct wmDrag { | typedef struct wmDrag { | ||||
| struct wmDrag *next, *prev; | struct wmDrag *next, *prev; | ||||
| int icon; | int icon; | ||||
| /** See 'WM_DRAG_' defines above. */ | /** See 'WM_DRAG_' defines above. */ | ||||
| int type; | int type; | ||||
| void *poin; | void *poin; | ||||
| char path[1024]; /* FILE_MAX */ | char path[1024]; /* FILE_MAX */ | ||||
| double value; | double value; | ||||
| /** If no icon but imbuf should be drawn around cursor. */ | /** If no icon but imbuf should be drawn around cursor. */ | ||||
| struct ImBuf *imb; | struct ImBuf *imb; | ||||
| float scale; | float scale; | ||||
| int sx, sy; | int sx, sy; | ||||
| /** If filled, draws operator tooltip/operator name. */ | /** Informs which dropbox is activated with the drag item. | ||||
| char tooltip[200]; | * When this value changes, the #draw_activate and #draw_deactivate dropbox callbacks are | ||||
| * triggered. | |||||
| */ | |||||
| struct wmDropBox *active_dropbox; | |||||
| unsigned int flags; | unsigned int flags; | ||||
| /** List of wmDragIDs, all are guaranteed to have the same ID type. */ | /** List of wmDragIDs, all are guaranteed to have the same ID type. */ | ||||
| ListBase ids; | ListBase ids; | ||||
| /** List of `wmDragAssetListItem`s. */ | /** List of `wmDragAssetListItem`s. */ | ||||
| ListBase asset_items; | ListBase asset_items; | ||||
| } wmDrag; | } wmDrag; | ||||
| Show All 11 Lines | typedef struct wmDropBox { | ||||
| void (*copy)(struct wmDrag *, struct wmDropBox *); | void (*copy)(struct wmDrag *, struct wmDropBox *); | ||||
| /** | /** | ||||
| * If the operator is cancelled (returns `OPERATOR_CANCELLED`), this can be used for cleanup of | * If the operator is cancelled (returns `OPERATOR_CANCELLED`), this can be used for cleanup of | ||||
| * `copy()` resources. | * `copy()` resources. | ||||
| */ | */ | ||||
| void (*cancel)(struct Main *, struct wmDrag *, 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. */ | /** Custom tooltip shown during dragging. */ | ||||
| WMDropboxTooltipFunc tooltip; | WMDropboxTooltipFunc tooltip; | ||||
| /** | /** | ||||
| * If poll succeeds, operator is called. | * If poll succeeds, operator is called. | ||||
| * Not saved in file, so can be pointer. | * Not saved in file, so can be pointer. | ||||
| */ | */ | ||||
| wmOperatorType *ot; | wmOperatorType *ot; | ||||
| ▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines | |||||