headless backend: add wlr_output_is_headless

This commit is contained in:
Dominique Martinet 2017-12-19 20:17:47 +01:00
parent 995383b049
commit d9eaca6c9f
3 changed files with 6 additions and 1 deletions

View File

@ -82,6 +82,10 @@ static const struct wlr_output_impl output_impl = {
.swap_buffers = output_swap_buffers, .swap_buffers = output_swap_buffers,
}; };
bool wlr_output_is_headless(struct wlr_output *wlr_output) {
return wlr_output->impl == &output_impl;
}
static int signal_frame(void *data) { static int signal_frame(void *data) {
struct wlr_headless_output *output = data; struct wlr_headless_output *output = data;
wl_signal_emit(&output->wlr_output.events.frame, &output->wlr_output); wl_signal_emit(&output->wlr_output.events.frame, &output->wlr_output);

View File

@ -3,7 +3,6 @@
#include <wlr/backend/interface.h> #include <wlr/backend/interface.h>
#include <wlr/backend/headless.h> #include <wlr/backend/headless.h>
#include <wlr/types/wlr_output.h>
struct wlr_headless_backend { struct wlr_headless_backend {
struct wlr_backend backend; struct wlr_backend backend;

View File

@ -3,6 +3,7 @@
#include <wlr/backend.h> #include <wlr/backend.h>
#include <wlr/types/wlr_input_device.h> #include <wlr/types/wlr_input_device.h>
#include <wlr/types/wlr_output.h>
struct wlr_backend *wlr_headless_backend_create(struct wl_display *display); struct wlr_backend *wlr_headless_backend_create(struct wl_display *display);
struct wlr_output *wlr_headless_add_output(struct wlr_backend *backend, struct wlr_output *wlr_headless_add_output(struct wlr_backend *backend,
@ -11,5 +12,6 @@ struct wlr_input_device *wlr_headless_add_input_device(
struct wlr_backend *backend, enum wlr_input_device_type type); struct wlr_backend *backend, enum wlr_input_device_type type);
bool wlr_backend_is_headless(struct wlr_backend *backend); bool wlr_backend_is_headless(struct wlr_backend *backend);
bool wlr_input_device_is_headless(struct wlr_input_device *device); bool wlr_input_device_is_headless(struct wlr_input_device *device);
bool wlr_output_is_headless(struct wlr_output *output);
#endif #endif