mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
util: add wlr_addon
This commit is contained in:
parent
604674dc54
commit
a6a80850b7
3 changed files with 93 additions and 0 deletions
43
include/wlr/util/addon.h
Normal file
43
include/wlr/util/addon.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* 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
|
||||
|
||||
#include <wayland-server-core.h>
|
||||
|
||||
struct wlr_addon_set {
|
||||
// private state
|
||||
struct wl_list addons;
|
||||
};
|
||||
|
||||
struct wlr_addon;
|
||||
|
||||
struct wlr_addon_interface {
|
||||
const char *name;
|
||||
void (*destroy)(struct wlr_addon *addon);
|
||||
};
|
||||
|
||||
struct wlr_addon {
|
||||
const struct wlr_addon_interface *impl;
|
||||
// private state
|
||||
const void *owner;
|
||||
struct wl_list link;
|
||||
};
|
||||
|
||||
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);
|
||||
void wlr_addon_finish(struct wlr_addon *addon);
|
||||
|
||||
struct wlr_addon *wlr_addon_find_by_owner(struct wlr_addon_set *set,
|
||||
const void *owner);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue