1b18c2d1eSnia/*
2b18c2d1eSnia * Copyright notice...
3b18c2d1eSnia */
4b18c2d1eSnia
5b18c2d1eSnia#ifndef _CTWM_R_STRUCTS_H
6b18c2d1eSnia#define _CTWM_R_STRUCTS_H
7b18c2d1eSnia
8b18c2d1eSnia
9b18c2d1eSnia/**
10b18c2d1eSnia * A particular extent of space.
11b18c2d1eSnia *
12b18c2d1eSnia * This defines an area on the abstract display.  It commonly represents
13b18c2d1eSnia * a monitor when defining our screen layout, and is also used to
14b18c2d1eSnia * represent a window when we're manipulating it on our screen space.
15b18c2d1eSnia */
16b18c2d1eSniastruct RArea {
17b18c2d1eSnia	int x; ///< X position
18b18c2d1eSnia	int y; ///< Y position
19b18c2d1eSnia	int width;  ///< X dimension
20b18c2d1eSnia	int height; ///< Y dimension
21b18c2d1eSnia};
22b18c2d1eSnia
23b18c2d1eSnia
24b18c2d1eSnia/**
25b18c2d1eSnia * A set of RArea's.
26b18c2d1eSnia *
27b18c2d1eSnia * This is generally used to define a contiguous region formed of various
28b18c2d1eSnia * stitched-together subareas.
29b18c2d1eSnia */
30b18c2d1eSniastruct RAreaList {
31b18c2d1eSnia	int len; ///< How many we're using
32b18c2d1eSnia	int cap; ///< How many we have space for
33b18c2d1eSnia	RArea *areas; ///< Array of RArea members of this list
34b18c2d1eSnia};
35b18c2d1eSnia
36b18c2d1eSnia
37b18c2d1eSnia/**
38b18c2d1eSnia * The layout of our display.
39b18c2d1eSnia *
40b18c2d1eSnia * This may encompass multiple monitors, of differing sizes.  It's
41b18c2d1eSnia * generally only used by a few vars at startup describing the layout,
42b18c2d1eSnia * which gets referred to when we need to find various borders of our
43b18c2d1eSnia * output.
44b18c2d1eSnia */
45b18c2d1eSniastruct RLayout {
46b18c2d1eSnia	RAreaList *monitors; ///< List of all output monitors
47b18c2d1eSnia	RAreaList *horiz; ///< List of all unique horizontal regions
48b18c2d1eSnia	RAreaList *vert;  ///< List of all unique vertical regions
49b18c2d1eSnia
50b18c2d1eSnia	/// List of names of the monitors.  `names[i]` corresponds with
51b18c2d1eSnia	/// `monitors->areas[i]`.  This is used for looking up geometries
52b18c2d1eSnia	/// with output names via RLayoutXParseGeometry(); e.g,
53b18c2d1eSnia	/// "HDMI1:800x600+20+50".
54b18c2d1eSnia	char **names;
55b18c2d1eSnia};
56b18c2d1eSnia
57b18c2d1eSnia#endif  /* _CTWM_R_STRUCTS_H */
58