diff options
author | Julian Eisel <julian@blender.org> | 2022-07-02 22:49:21 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-07-03 02:55:38 +0300 |
commit | c355be6faeacef6a65afbce97f9776d2a2c7f54c (patch) | |
tree | e68bff81fa87b208ed433ade2b8fce7c522ed59a /source/blender/editors/include/UI_interface.h | |
parent | 4ffee9a48d1bc01442e554d44a1f55dfc459a221 (diff) |
UI: Add AbstractView base class for views, unify reconstruction in there
No user visible changes expected.
There's plenty of duplicated code in the grid and the tree view, and I expect
this to become more. This starts the process of unifying these parts, which
should also make it easier to add new views. Complexity in the view classes is
reduced, and some type shenanigans for C compatibility and general view
management can be removed, since there is now a common base type.
For the start this ports some of the view reconstruction, where the view and
its items are compared to the version of itself in the previous redraw, so that
state (highlighted, active, renaming, collapsed, ...) can be preserved.
Notifier listening is also ported.
Diffstat (limited to 'source/blender/editors/include/UI_interface.h')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index b2ec2102ddd..f39c62d8e2b 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -72,12 +72,10 @@ typedef struct uiBut uiBut; typedef struct uiButExtraOpIcon uiButExtraOpIcon; typedef struct uiLayout uiLayout; typedef struct uiPopupBlockHandle uiPopupBlockHandle; -/* C handle for C++ #ui::AbstractTreeView type. */ -typedef struct uiTreeViewHandle uiTreeViewHandle; +/* C handle for C++ #ui::AbstractView type. */ +typedef struct uiViewHandle uiViewHandle; /* C handle for C++ #ui::AbstractTreeViewItem type. */ typedef struct uiTreeViewItemHandle uiTreeViewItemHandle; -/* C handle for C++ #ui::AbstractGridView type. */ -typedef struct uiGridViewHandle uiGridViewHandle; /* C handle for C++ #ui::AbstractGridViewItem type. */ typedef struct uiGridViewItemHandle uiGridViewItemHandle; @@ -3243,15 +3241,6 @@ uiTreeViewItemHandle *UI_block_tree_view_find_item_at(const struct ARegion *regi const int xy[2]) ATTR_NONNULL(1, 2); uiTreeViewItemHandle *UI_block_tree_view_find_active_item(const struct ARegion *region); -/** - * Listen to \a notifier, returning true if the region should redraw. - */ -bool UI_tree_view_listen_should_redraw(const uiTreeViewHandle *view, const wmNotifier *notifier); -/** - * Listen to \a notifier, returning true if the region should redraw. - */ -bool UI_grid_view_listen_should_redraw(const uiGridViewHandle *view, const wmNotifier *notifier); - #ifdef __cplusplus } #endif |