diff options
Diffstat (limited to 'include/wlr')
-rw-r--r-- | include/wlr/backend.h | 26 | ||||
-rw-r--r-- | include/wlr/backend/drm.h | 16 | ||||
-rw-r--r-- | include/wlr/common/log.h | 1 | ||||
-rw-r--r-- | include/wlr/session.h | 12 | ||||
-rw-r--r-- | include/wlr/wayland.h | 41 |
5 files changed, 71 insertions, 25 deletions
diff --git a/include/wlr/backend.h b/include/wlr/backend.h index 527efa05..b424c29f 100644 --- a/include/wlr/backend.h +++ b/include/wlr/backend.h @@ -1,7 +1,29 @@ #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 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 new file mode 100644 index 00000000..2d9bf879 --- /dev/null +++ b/include/wlr/backend/drm.h @@ -0,0 +1,16 @@ +#ifndef WLR_BACKEND_DRM_H +#define WLR_BACKEND_DRM_H + +#include <wayland-server.h> +#include <wlr/session.h> +#include <wlr/backend.h> +#include <xf86drmMode.h> // drmModeModeInfo +#include <wlr/wayland.h> + +struct wlr_backend *wlr_drm_backend_create(struct wl_display *display, + struct wlr_session *session); + +void wlr_drm_output_begin(struct wlr_output *out); +void wlr_drm_output_end(struct wlr_output *out); + +#endif diff --git a/include/wlr/common/log.h b/include/wlr/common/log.h index 5b4d5a53..079f989a 100644 --- a/include/wlr/common/log.h +++ b/include/wlr/common/log.h @@ -1,6 +1,7 @@ #ifndef _WLR_COMMON_LOG_H #define _WLR_COMMON_LOG_H #include <stdbool.h> +#include <stdarg.h> typedef enum { L_SILENT = 0, diff --git a/include/wlr/session.h b/include/wlr/session.h new file mode 100644 index 00000000..cf04f1da --- /dev/null +++ b/include/wlr/session.h @@ -0,0 +1,12 @@ +#ifndef WLR_SESSION_H +#define WLR_SESSION_H + +struct wlr_session; + +struct wlr_session *wlr_session_start(void); +void wlr_session_finish(struct wlr_session *session); +int wlr_session_open_file(struct wlr_session *restrict session, + const char *restrict path); +void wlr_session_close_file(struct wlr_session *session, int fd); + +#endif diff --git a/include/wlr/wayland.h b/include/wlr/wayland.h index bbbd2457..158acc33 100644 --- a/include/wlr/wayland.h +++ b/include/wlr/wayland.h @@ -3,26 +3,26 @@ #include <wayland-server.h> #include <wlr/common/list.h> +#include <stdbool.h> -struct wlr_wl_seat { - struct wl_seat *wl_seat; - uint32_t capabilities; - char *name; - list_t *keyboards; - list_t *pointers; -}; - -void wlr_wl_seat_free(struct wlr_wl_seat *seat); +struct wlr_output_mode_state; -struct wlr_wl_output_mode { +struct wlr_output_mode { + struct wlr_output_mode_state *state; uint32_t flags; // enum wl_output_mode int32_t width, height; int32_t refresh; // mHz }; -struct wlr_wl_output { - struct wl_output *wl_output; +struct wlr_output_impl; +struct wlr_output_state; + +struct wlr_output { + const struct wlr_output_impl *impl; + struct wlr_output_state *state; + uint32_t flags; + char *name; char *make; char *model; uint32_t scale; @@ -30,20 +30,15 @@ struct wlr_wl_output { int32_t phys_width, phys_height; // mm int32_t subpixel; // enum wl_output_subpixel int32_t transform; // enum wl_output_transform - list_t *modes; - struct wlr_wl_output_mode *current_mode; -}; -void wlr_wl_output_free(struct wlr_wl_output *output); + list_t *modes; + struct wlr_output_mode *current_mode; -struct wlr_wl_keyboard { - struct wl_keyboard *wl_keyboard; + struct { + struct wl_signal frame; + } events; }; -struct wlr_wl_pointer { - struct wl_pointer *wl_pointer; - struct wl_surface *current_surface; - wl_fixed_t x, y; -}; +bool wlr_output_set_mode(struct wlr_output *output, struct wlr_output_mode *mode); #endif |