mirror of
https://github.com/swaywm/sway.git
synced 2025-11-13 13:29:49 -05:00
Implement shell views
This commit is contained in:
parent
9939d98454
commit
dcd15a2d3d
5 changed files with 228 additions and 207 deletions
|
|
@ -7,15 +7,10 @@
|
|||
#include "sway/tree/layout.h"
|
||||
#include "sway/tree/view.h"
|
||||
|
||||
struct sway_view *view_create(enum sway_view_type type,
|
||||
void view_init(struct sway_view *view, enum sway_view_type type,
|
||||
const struct sway_view_impl *impl) {
|
||||
struct sway_view *view = calloc(1, sizeof(struct sway_view));
|
||||
if (view == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
view->type = type;
|
||||
view->impl = impl;
|
||||
return view;
|
||||
}
|
||||
|
||||
void view_destroy(struct sway_view *view) {
|
||||
|
|
@ -28,6 +23,12 @@ void view_destroy(struct sway_view *view) {
|
|||
}
|
||||
|
||||
container_destroy(view->swayc);
|
||||
|
||||
if (view->impl->destroy) {
|
||||
view->impl->destroy(view);
|
||||
} else {
|
||||
free(view);
|
||||
}
|
||||
}
|
||||
|
||||
const char *view_get_title(struct sway_view *view) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue