wlroots-hyprland/include/wlr/types/wlr_output_layout.h

72 lines
2.2 KiB
C
Raw Normal View History

#ifndef _WLR_TYPES_OUTPUT_LAYOUT_H
#define _WLR_TYPES_OUTPUT_LAYOUT_H
#include <wlr/types/wlr_output.h>
#include <wayland-util.h>
#include <stdbool.h>
2017-08-27 23:35:12 +02:00
struct wlr_output_layout_state;
struct wlr_output_layout {
struct wl_list outputs;
2017-08-27 23:35:12 +02:00
struct wlr_output_layout_state *state;
};
2017-08-27 23:35:12 +02:00
struct wlr_output_layout_output_state;
struct wlr_output_layout_output {
struct wlr_output *output;
int x, y;
struct wl_list link;
2017-08-27 23:35:12 +02:00
struct wlr_output_layout_output_state *state;
};
struct wlr_output_layout *wlr_output_layout_init();
void wlr_output_layout_destroy(struct wlr_output_layout *layout);
struct wlr_output_layout_output *wlr_output_layout_get(
struct wlr_output_layout *layout, struct wlr_output *reference);
struct wlr_output *wlr_output_layout_output_at(struct wlr_output_layout *layout,
2017-08-18 03:04:05 +02:00
double x, double y);
void wlr_output_layout_add(struct wlr_output_layout *layout,
2017-08-18 03:04:05 +02:00
struct wlr_output *output, int x, int y);
void wlr_output_layout_move(struct wlr_output_layout *layout,
2017-08-18 03:04:05 +02:00
struct wlr_output *output, int x, int y);
void wlr_output_layout_remove(struct wlr_output_layout *layout,
2017-08-18 03:04:05 +02:00
struct wlr_output *output);
/**
* Given x and y as pointers to global coordinates, adjusts them to local output
* coordinates relative to the given reference output.
*/
void wlr_output_layout_output_coords(struct wlr_output_layout *layout,
struct wlr_output *reference, double *x, double *y);
2017-08-17 16:12:36 +02:00
bool wlr_output_layout_contains_point(struct wlr_output_layout *layout,
2017-08-18 03:04:05 +02:00
struct wlr_output *reference, int x, int y);
2017-08-17 16:12:36 +02:00
bool wlr_output_layout_intersects(struct wlr_output_layout *layout,
2017-08-18 03:04:05 +02:00
struct wlr_output *reference, int x1, int y1, int x2, int y2);
2017-08-17 16:12:36 +02:00
2017-08-24 16:11:57 +02:00
/**
2017-08-24 18:30:34 +02:00
* Get the closest boundary point of this layout from the given point from the
* reference output. If reference is NULL, gets the closest boundary point from
* the entire layout.
2017-08-24 16:11:57 +02:00
*/
void wlr_output_layout_closest_boundary(struct wlr_output_layout *layout,
2017-08-24 18:30:34 +02:00
struct wlr_output *reference, double x, double y, double *dest_x,
double *dest_y);
2017-08-24 16:11:57 +02:00
2017-08-27 23:35:12 +02:00
/**
* Get the geometry of the layout for the given reference output. If `reference`
* is NULL, the geometry will be for the extents of the entire layout.
*/
struct wlr_geometry *wlr_output_layout_get_geometry(
struct wlr_output_layout *layout, struct wlr_output *reference);
#endif