Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/WM_types.h
| Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | |||||
| #pragma once | #pragma once | ||||
| struct ID; | struct ID; | ||||
| struct ImBuf; | struct ImBuf; | ||||
| struct bContext; | struct bContext; | ||||
| struct wmEvent; | struct wmEvent; | ||||
| struct wmOperator; | struct wmOperator; | ||||
| struct wmWindowManager; | struct wmWindowManager; | ||||
| struct wmDrag; | |||||
| #include "BLI_compiler_attrs.h" | #include "BLI_compiler_attrs.h" | ||||
| #include "DNA_listBase.h" | #include "DNA_listBase.h" | ||||
| #include "DNA_vec_types.h" | #include "DNA_vec_types.h" | ||||
| #include "RNA_types.h" | #include "RNA_types.h" | ||||
| /* exported types for WM */ | /* exported types for WM */ | ||||
| #include "gizmo/WM_gizmo_types.h" | #include "gizmo/WM_gizmo_types.h" | ||||
| ▲ Show 20 Lines • Show All 804 Lines • ▼ Show 20 Lines | typedef struct wmDragAsset { | ||||
| 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; | ||||
| int import_type; /* eFileAssetImportType */ | int import_type; /* eFileAssetImportType */ | ||||
| } wmDragAsset; | } wmDragAsset; | ||||
| typedef char *(*WMDropboxTooltipFunc)(struct bContext *, | |||||
| struct wmDrag *, | |||||
| const struct wmEvent *event); | |||||
| 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 set, draws operator name. */ | /** If filled, draws operator tooltip/operator name. */ | ||||
| char opname[200]; | char tooltip[200]; | ||||
| 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; | ||||
| } wmDrag; | } wmDrag; | ||||
| /** | /** | ||||
| * 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, then can print optype name. */ | /** Test if the dropbox is active. */ | ||||
| bool (*poll)(struct bContext *, struct wmDrag *, const wmEvent *, const char **); | 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 *); | 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 *); | ||||
| /** Custom tooltip shown during dragging. */ | |||||
| 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; | ||||
| ▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines | |||||