mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-19 06:47:02 -04:00
backend/multi: improve type-safety by exposing wlr_multi_backend
Expose an opaque wlr_multi_backend struct. That way functions operating on a multi backend can take this struct instead of a generic wlr_backend, without having to assert.
This commit is contained in:
parent
b1e38fc7ea
commit
7e633eea50
6 changed files with 50 additions and 46 deletions
|
|
@ -11,25 +11,31 @@
|
|||
|
||||
#include <wlr/backend.h>
|
||||
|
||||
struct wlr_multi_backend;
|
||||
|
||||
/**
|
||||
* Creates a multi-backend. Multi-backends wrap an arbitrary number of backends
|
||||
* and aggregate their new_output/new_input signals.
|
||||
*/
|
||||
struct wlr_backend *wlr_multi_backend_create(struct wl_display *display);
|
||||
struct wlr_multi_backend *wlr_multi_backend_create(struct wl_display *display);
|
||||
|
||||
/**
|
||||
* Adds the given backend to the multi backend. This should be done before the
|
||||
* new backend is started.
|
||||
*/
|
||||
bool wlr_multi_backend_add(struct wlr_backend *multi,
|
||||
bool wlr_multi_backend_add(struct wlr_multi_backend *multi,
|
||||
struct wlr_backend *backend);
|
||||
|
||||
void wlr_multi_backend_remove(struct wlr_backend *multi,
|
||||
void wlr_multi_backend_remove(struct wlr_multi_backend *multi,
|
||||
struct wlr_backend *backend);
|
||||
|
||||
bool wlr_backend_is_multi(struct wlr_backend *backend);
|
||||
bool wlr_multi_is_empty(struct wlr_backend *backend);
|
||||
bool wlr_multi_backend_is_empty(struct wlr_multi_backend *backend);
|
||||
|
||||
void wlr_multi_for_each_backend(struct wlr_backend *backend,
|
||||
void wlr_multi_backend_for_each(struct wlr_multi_backend *backend,
|
||||
void (*callback)(struct wlr_backend *backend, void *data), void *data);
|
||||
|
||||
struct wlr_multi_backend *wlr_multi_backend_try_from(struct wlr_backend *backend);
|
||||
|
||||
struct wlr_backend *wlr_multi_backend_base(struct wlr_multi_backend *backend);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue