mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
Generalize output handling
This commit is contained in:
parent
15b1ce9e6c
commit
00931f2f8f
16 changed files with 407 additions and 444 deletions
|
|
@ -13,7 +13,6 @@ struct wlr_backend {
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -5,26 +5,12 @@
|
|||
#include <wlr/session.h>
|
||||
#include <wlr/backend.h>
|
||||
#include <xf86drmMode.h> // drmModeModeInfo
|
||||
|
||||
struct wlr_drm_backend;
|
||||
struct wlr_drm_output;
|
||||
|
||||
struct wlr_drm_mode {
|
||||
uint16_t width;
|
||||
uint16_t height;
|
||||
uint32_t rate;
|
||||
drmModeModeInfo mode;
|
||||
};
|
||||
#include <wlr/wayland.h>
|
||||
|
||||
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);
|
||||
|
||||
struct wlr_drm_mode *wlr_drm_output_get_modes(struct wlr_drm_output *out, size_t *count);
|
||||
bool wlr_drm_output_modeset(struct wlr_drm_output *out, struct wlr_drm_mode *mode);
|
||||
|
||||
void wlr_drm_output_begin(struct wlr_drm_output *out);
|
||||
void wlr_drm_output_end(struct wlr_drm_output *out);
|
||||
void wlr_drm_output_begin(struct wlr_output *out);
|
||||
void wlr_drm_output_end(struct wlr_output *out);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
struct wlr_output_mode_state;
|
||||
|
||||
void wlr_wl_seat_free(struct wlr_wl_seat *seat);
|
||||
|
||||
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;
|
||||
struct wlr_output_mode *current_mode;
|
||||
|
||||
struct {
|
||||
struct wl_signal frame;
|
||||
} events;
|
||||
};
|
||||
|
||||
void wlr_wl_output_free(struct wlr_wl_output *output);
|
||||
|
||||
struct wlr_wl_keyboard {
|
||||
struct wl_keyboard *wl_keyboard;
|
||||
};
|
||||
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue