wlroots/include/wlr/util/addon.h

48 lines
1.1 KiB
C
Raw Normal View History

2021-08-09 17:57:19 +03:00
/*
* This an unstable interface of wlroots. No guarantees are made regarding the
* future consistency of this API.
*/
#ifndef WLR_USE_UNSTABLE
#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
#endif
#ifndef WLR_UTIL_ADDON_H
#define WLR_UTIL_ADDON_H
2022-10-27 00:00:29 +03:00
#include <stdint.h>
2021-08-09 17:57:19 +03:00
struct wlr_addon_set {
// private state
2022-10-27 00:00:29 +03:00
struct wlr_addon *root;
2021-08-09 17:57:19 +03:00
};
struct wlr_addon;
struct wlr_addon_interface {
const char *name;
void (*destroy)(struct wlr_addon *addon);
};
struct wlr_addon {
// private state
2022-10-27 00:00:29 +03:00
struct wlr_addon_set *set;
2021-08-09 17:57:19 +03:00
const void *owner;
2022-10-27 00:00:29 +03:00
const struct wlr_addon_interface *impl;
struct wlr_addon *parent; // NULL if it's set->root
struct wlr_addon *left;
struct wlr_addon *right;
int8_t balance;
2021-08-09 17:57:19 +03:00
};
void wlr_addon_set_init(struct wlr_addon_set *set);
void wlr_addon_set_finish(struct wlr_addon_set *set);
void wlr_addon_init(struct wlr_addon *addon, struct wlr_addon_set *set,
const void *owner, const struct wlr_addon_interface *impl);
2021-08-09 17:57:19 +03:00
void wlr_addon_finish(struct wlr_addon *addon);
struct wlr_addon *wlr_addon_find(struct wlr_addon_set *set, const void *owner,
const struct wlr_addon_interface *impl);
2021-08-09 17:57:19 +03:00
#endif