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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user