2017-09-23 10:26:01 +02:00
|
|
|
#ifndef WLR_TYPES_WLR_OUTPUT_H
|
|
|
|
#define WLR_TYPES_WLR_OUTPUT_H
|
|
|
|
|
2017-06-20 00:41:02 +02:00
|
|
|
#include <wayland-server.h>
|
2017-06-21 18:10:07 +02:00
|
|
|
#include <wlr/util/list.h>
|
2017-06-20 00:41:02 +02:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
struct wlr_output_mode {
|
|
|
|
uint32_t flags; // enum wl_output_mode
|
|
|
|
int32_t width, height;
|
|
|
|
int32_t refresh; // mHz
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_output_impl;
|
|
|
|
|
|
|
|
struct wlr_output {
|
|
|
|
const struct wlr_output_impl *impl;
|
2017-08-13 16:51:50 +02:00
|
|
|
|
2017-06-22 20:26:02 +02:00
|
|
|
struct wl_global *wl_global;
|
2017-06-23 21:10:52 +02:00
|
|
|
struct wl_list wl_resources;
|
2017-06-20 00:41:02 +02:00
|
|
|
|
|
|
|
uint32_t flags;
|
|
|
|
char name[16];
|
|
|
|
char make[48];
|
|
|
|
char model[16];
|
|
|
|
uint32_t scale;
|
|
|
|
int32_t width, height;
|
|
|
|
int32_t phys_width, phys_height; // mm
|
|
|
|
int32_t subpixel; // enum wl_output_subpixel
|
|
|
|
int32_t transform; // enum wl_output_transform
|
|
|
|
|
|
|
|
float transform_matrix[16];
|
|
|
|
|
|
|
|
/* Note: some backends may have zero modes */
|
|
|
|
list_t *modes;
|
|
|
|
struct wlr_output_mode *current_mode;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
struct wl_signal frame;
|
2017-10-07 12:01:21 +02:00
|
|
|
struct wl_signal swap_buffers;
|
2017-06-20 00:41:02 +02:00
|
|
|
struct wl_signal resolution;
|
2017-08-30 19:28:50 +02:00
|
|
|
struct wl_signal destroy;
|
2017-06-20 00:41:02 +02:00
|
|
|
} events;
|
2017-06-26 07:34:15 +02:00
|
|
|
|
|
|
|
struct {
|
|
|
|
bool is_sw;
|
|
|
|
int32_t x, y;
|
|
|
|
uint32_t width, height;
|
2017-10-06 08:07:08 +02:00
|
|
|
int32_t hotspot_x, hotspot_y;
|
2017-06-26 07:34:15 +02:00
|
|
|
struct wlr_renderer *renderer;
|
2017-08-08 18:02:14 +02:00
|
|
|
struct wlr_texture *texture;
|
2017-06-26 07:34:15 +02:00
|
|
|
} cursor;
|
2017-08-11 20:23:53 +02:00
|
|
|
|
|
|
|
void *data;
|
2017-06-20 00:41:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
void wlr_output_enable(struct wlr_output *output, bool enable);
|
|
|
|
bool wlr_output_set_mode(struct wlr_output *output,
|
|
|
|
struct wlr_output_mode *mode);
|
|
|
|
void wlr_output_transform(struct wlr_output *output,
|
|
|
|
enum wl_output_transform transform);
|
|
|
|
bool wlr_output_set_cursor(struct wlr_output *output,
|
2017-10-06 08:07:08 +02:00
|
|
|
const uint8_t *buf, int32_t stride, uint32_t width, uint32_t height,
|
|
|
|
int32_t hotspot_x, int32_t hotspot_y);
|
2017-06-20 00:41:02 +02:00
|
|
|
bool wlr_output_move_cursor(struct wlr_output *output, int x, int y);
|
|
|
|
void wlr_output_destroy(struct wlr_output *output);
|
|
|
|
void wlr_output_effective_resolution(struct wlr_output *output,
|
|
|
|
int *width, int *height);
|
2017-06-26 07:34:15 +02:00
|
|
|
void wlr_output_make_current(struct wlr_output *output);
|
|
|
|
void wlr_output_swap_buffers(struct wlr_output *output);
|
2017-09-06 17:34:09 +02:00
|
|
|
void wlr_output_set_gamma(struct wlr_output *output,
|
|
|
|
uint16_t size, uint16_t *r, uint16_t *g, uint16_t *b);
|
|
|
|
uint16_t wlr_output_get_gamma_size(struct wlr_output *output);
|
2017-10-07 19:01:11 +02:00
|
|
|
|
2017-06-20 00:41:02 +02:00
|
|
|
#endif
|