mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-02-28 04:14:08 +03:00
Treeview: Add API for attaching and detaching from corewindows.
This commit is contained in:
parent
7750d926ad
commit
ded1979fa1
@ -1421,6 +1421,35 @@ nserror treeview_create(treeview **tree,
|
||||
}
|
||||
|
||||
|
||||
/* Exported interface, documented in treeview.h */
|
||||
nserror treeview_cw_attach(treeview *tree,
|
||||
const struct core_window_callback_table *cw_t,
|
||||
struct core_window *cw)
|
||||
{
|
||||
assert(cw_t != NULL);
|
||||
assert(cw != NULL);
|
||||
|
||||
if (tree->cw_t != NULL || tree->cw_h != NULL) {
|
||||
LOG("Treeview already attached.");
|
||||
return NSERROR_UNKNOWN;
|
||||
}
|
||||
tree->cw_t = cw_t;
|
||||
tree->cw_h = cw;
|
||||
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
|
||||
/* Exported interface, documented in treeview.h */
|
||||
nserror treeview_cw_detach(treeview *tree)
|
||||
{
|
||||
tree->cw_t = NULL;
|
||||
tree->cw_h = NULL;
|
||||
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
|
||||
/* Exported interface, documented in treeview.h */
|
||||
nserror treeview_destroy(treeview *tree)
|
||||
{
|
||||
|
@ -149,6 +149,28 @@ nserror treeview_create(treeview **tree,
|
||||
const struct core_window_callback_table *cw_t,
|
||||
struct core_window *cw, treeview_flags flags);
|
||||
|
||||
/**
|
||||
* Attach a treeview to a corewindow.
|
||||
*
|
||||
* Treeview must be detached.
|
||||
*
|
||||
* \param tree Treeview object
|
||||
* \param cw_t Callback table for core_window containing the treeview
|
||||
* \param cw The core_window in which the treeview is shown
|
||||
* \return NSERROR_OK on success, appropriate error otherwise
|
||||
*/
|
||||
nserror treeview_cw_attach(treeview *tree,
|
||||
const struct core_window_callback_table *cw_t,
|
||||
struct core_window *cw);
|
||||
|
||||
/**
|
||||
* Detach a treeview from a corewindow
|
||||
*
|
||||
* \param tree Treeview object
|
||||
* \return NSERROR_OK on success, appropriate error otherwise
|
||||
*/
|
||||
nserror treeview_cw_detach(treeview *tree);
|
||||
|
||||
/**
|
||||
* Destroy a treeview object
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user