Cleanup: Add constructor/destructor for drag data to avoid includes
`wmDragActiveDropState` contains a `bContextStore` unique pointer, so when constructing/destructing an object of this type `BKE_context.hh` had to be included. It wouldn't be obvious why this include is necessary in some cases. And the pointer is otherwise managed internally in the source file, so the need for this include shouldn't bleed into other files. Make sure the unique pointer construction/destruction happens in the translation unit of the source file that otherwise also manages it. Avoids include in #107230.
This commit is contained in:
@@ -1189,6 +1189,9 @@ using WMDropboxTooltipFunc = char *(*)(bContext *C,
|
||||
wmDropBox *drop);
|
||||
|
||||
struct wmDragActiveDropState {
|
||||
wmDragActiveDropState();
|
||||
~wmDragActiveDropState();
|
||||
|
||||
/**
|
||||
* Informs which dropbox is activated with the drag item.
|
||||
* When this value changes, the #on_enter() and #on_exit() dropbox callbacks are triggered.
|
||||
|
||||
@@ -67,6 +67,9 @@ static ListBase dropboxes = {nullptr, nullptr};
|
||||
static void wm_drag_free_asset_data(wmDragAsset **asset_data);
|
||||
static void wm_drag_free_path_data(wmDragPath **path_data);
|
||||
|
||||
wmDragActiveDropState::wmDragActiveDropState() = default;
|
||||
wmDragActiveDropState::~wmDragActiveDropState() = default;
|
||||
|
||||
/* drop box maps are stored global for now */
|
||||
/* these are part of blender's UI/space specs, and not like keymaps */
|
||||
/* when editors become configurable, they can add own dropbox definitions */
|
||||
|
||||
Reference in New Issue
Block a user