diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-05-07 10:00:23 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-05-07 10:12:54 -0400 |
commit | 15b1ce9e6ced22a90ab0df7a6b86c6d35c40ca93 (patch) | |
tree | 5fde5b7177005e3270509d3a119323d1f5897907 /include/wlr | |
parent | 7e9feb70a0b50caf7e9072d3b5c77b4e91235efa (diff) |
Refactor backend state management
Diffstat (limited to 'include/wlr')
-rw-r--r-- | include/wlr/backend.h | 27 | ||||
-rw-r--r-- | include/wlr/backend/drm.h | 7 |
2 files changed, 28 insertions, 6 deletions
diff --git a/include/wlr/backend.h b/include/wlr/backend.h index 527efa05..88a5c8e9 100644 --- a/include/wlr/backend.h +++ b/include/wlr/backend.h @@ -1,7 +1,30 @@ #ifndef _WLR_BACKEND_H #define _WLR_BACKEND_H -struct wlr_backend *wlr_backend_init(); -void wlr_backend_free(struct wlr_backend *backend); +#include <wayland-server.h> + +struct wlr_backend_impl; +struct wlr_backend_state; + +struct wlr_backend { + const struct wlr_backend_impl *impl; + struct wlr_backend_state *state; + + struct { + struct wl_signal output_add; + struct wl_signal output_remove; + struct wl_signal output_frame; + struct wl_signal keyboard_add; + struct wl_signal keyboard_remove; + struct wl_signal pointer_add; + struct wl_signal pointer_remove; + struct wl_signal touch_add; + struct wl_signal touch_remove; + } events; +}; + +struct wlr_backend *wlr_backend_autocreate(); +bool wlr_backend_init(struct wlr_backend *backend); +void wlr_backend_destroy(struct wlr_backend *backend); #endif diff --git a/include/wlr/backend/drm.h b/include/wlr/backend/drm.h index 4131b4cb..5db9b35c 100644 --- a/include/wlr/backend/drm.h +++ b/include/wlr/backend/drm.h @@ -3,6 +3,7 @@ #include <wayland-server.h> #include <wlr/session.h> +#include <wlr/backend.h> #include <xf86drmMode.h> // drmModeModeInfo struct wlr_drm_backend; @@ -15,10 +16,8 @@ struct wlr_drm_mode { drmModeModeInfo mode; }; -struct wlr_drm_backend *wlr_drm_backend_init(struct wl_display *display, - struct wlr_session *session, struct wl_listener *add, struct wl_listener *rem, - struct wl_listener *render); -void wlr_drm_backend_free(struct wlr_drm_backend *backend); +struct wlr_backend *wlr_drm_backend_create(struct wl_display *display, + struct wlr_session *session); const char *wlr_drm_output_get_name(struct wlr_drm_output *out); |