Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/WM_types.h
| Show First 20 Lines • Show All 976 Lines • ▼ Show 20 Lines | |||||
| typedef struct wmDragAsset { | typedef struct wmDragAsset { | ||||
| /* NOTE: Can't store the #AssetHandle here, since the #FileDirEntry it wraps may be freed while | /* NOTE: Can't store the #AssetHandle here, since the #FileDirEntry it wraps may be freed while | ||||
| * dragging. So store necessary data here directly. */ | * dragging. So store necessary data here directly. */ | ||||
| char name[64]; /* MAX_NAME */ | char name[64]; /* MAX_NAME */ | ||||
| /* Always freed. */ | /* Always freed. */ | ||||
| const char *path; | const char *path; | ||||
| int id_type; | int id_type; | ||||
| struct AssetMetaData *metadata; | |||||
| int import_type; /* eFileAssetImportType */ | int import_type; /* eFileAssetImportType */ | ||||
| /* FIXME: This is temporary evil solution to get scene/view-layer/etc in the copy callback of the | /* FIXME: This is temporary evil solution to get scene/view-layer/etc in the copy callback of the | ||||
| * #wmDropBox. | * #wmDropBox. | ||||
| * TODO: Handle link/append in operator called at the end of the drop process, and NOT in its | * TODO: Handle link/append in operator called at the end of the drop process, and NOT in its | ||||
| * copy callback. | * copy callback. | ||||
| * */ | * */ | ||||
| struct bContext *evil_C; | struct bContext *evil_C; | ||||
| Show All 33 Lines | typedef struct wmDrag { | ||||
| 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; | ||||
| /** Don't draw the icon or image (`imb`). */ | |||||
| bool no_preview; | |||||
| /** If filled, draws operator tooltip/operator name. */ | /** If filled, draws operator tooltip/operator name. */ | ||||
| char tooltip[200]; | char tooltip[200]; | ||||
| /** If set, draws gizmo group. */ | |||||
| char gizmo_group[64]; | |||||
| struct IDProperty *gizmo_group_prop; | |||||
| 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; | ||||
| typedef void (*wmDropBoxCopyFn)(struct wmDrag *, struct wmDropBox *); | |||||
| /** | /** | ||||
| * Dropboxes are like keymaps, part of the screen/area/region definition. | * Dropboxes are like keymaps, part of the screen/area/region definition. | ||||
| * Allocation and free is on startup and exit. | * Allocation and free is on startup and exit. | ||||
| */ | */ | ||||
| typedef struct wmDropBox { | typedef struct wmDropBox { | ||||
| struct wmDropBox *next, *prev; | struct wmDropBox *next, *prev; | ||||
| /** Test if the dropbox is active. */ | /** Test if the dropbox is active. */ | ||||
| bool (*poll)(struct bContext *, struct wmDrag *, const wmEvent *); | bool (*poll)(struct bContext *, struct wmDrag *, const wmEvent *); | ||||
| /** Before exec, this copies drag info to #wmDrop properties. */ | /** Before exec, this copies drag info to #wmDrop properties. */ | ||||
| void (*copy)(struct wmDrag *, struct wmDropBox *); | wmDropBoxCopyFn copy; | ||||
| /** Before `gizmo_group` is enabled, this copies drag info to #wmDrop gizmo-group properties. */ | |||||
| wmDropBoxCopyFn copy_gizmo_group; | |||||
| /** | /** | ||||
| * 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 *); | ||||
| /** 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; | ||||
| /** Operator properties, assigned to ptr->data and can be written to a file. */ | /** Operator properties, assigned to ptr->data and can be written to a file. */ | ||||
| struct IDProperty *properties; | struct IDProperty *properties; | ||||
| /** RNA pointer to access properties. */ | /** RNA pointer to access properties. */ | ||||
| struct PointerRNA *ptr; | struct PointerRNA *ptr; | ||||
| /** Default invoke. */ | /** Default invoke. */ | ||||
| short opcontext; | short opcontext; | ||||
| /** | |||||
| * If poll succeeds, gizmo is drawn. | |||||
| */ | |||||
| char gizmo_group[64]; | |||||
| struct PointerRNA *gizmo_group_ptr; | |||||
| } wmDropBox; | } wmDropBox; | ||||
| /** | /** | ||||
| * Struct to store tool-tip timer and possible creation if the time is reached. | * Struct to store tool-tip timer and possible creation if the time is reached. | ||||
| * Allows UI code to call #WM_tooltip_timer_init without each user having to handle the timer. | * Allows UI code to call #WM_tooltip_timer_init without each user having to handle the timer. | ||||
| */ | */ | ||||
| typedef struct wmTooltipState { | typedef struct wmTooltipState { | ||||
| /** Create tooltip on this event. */ | /** Create tooltip on this event. */ | ||||
| ▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines | |||||