Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/tree_view.cc
| Show First 20 Lines • Show All 756 Lines • ▼ Show 20 Lines | char *UI_tree_view_item_drop_tooltip(const uiTreeViewItemHandle *item_, const wmDrag *drag) | ||||
| return BLI_strdup(drop_controller->drop_tooltip(*drag).c_str()); | return BLI_strdup(drop_controller->drop_tooltip(*drag).c_str()); | ||||
| } | } | ||||
| /** | /** | ||||
| * Let a tree-view item handle a drop event. | * Let a tree-view item handle a drop event. | ||||
| * \return True if the drop was handled by the tree-view item. | * \return True if the drop was handled by the tree-view item. | ||||
| */ | */ | ||||
| bool UI_tree_view_item_drop_handle(uiTreeViewItemHandle *item_, const ListBase *drags) | bool UI_tree_view_item_drop_handle(struct bContext *C, | ||||
| uiTreeViewItemHandle *item_, | |||||
| const ListBase *drags) | |||||
| { | { | ||||
| AbstractTreeViewItem &item = reinterpret_cast<AbstractTreeViewItem &>(*item_); | AbstractTreeViewItem &item = reinterpret_cast<AbstractTreeViewItem &>(*item_); | ||||
| std::unique_ptr<AbstractTreeViewItemDropController> drop_controller = | std::unique_ptr<AbstractTreeViewItemDropController> drop_controller = | ||||
| item.create_drop_controller(); | item.create_drop_controller(); | ||||
| const char *disabled_hint_dummy = nullptr; | const char *disabled_hint_dummy = nullptr; | ||||
| LISTBASE_FOREACH (const wmDrag *, drag, drags) { | LISTBASE_FOREACH (const wmDrag *, drag, drags) { | ||||
| if (drop_controller->can_drop(*drag, &disabled_hint_dummy)) { | if (drop_controller->can_drop(*drag, &disabled_hint_dummy)) { | ||||
| return drop_controller->on_drop(*drag); | return drop_controller->on_drop(C, *drag); | ||||
| } | } | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| /** | /** | ||||
| * Can \a item_handle be renamed right now? Not that this isn't just a mere wrapper around | * Can \a item_handle be renamed right now? Not that this isn't just a mere wrapper around | ||||
| Show All 23 Lines | |||||