i3
randr.h
Go to the documentation of this file.
1 /*
2  * vim:ts=4:sw=4:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
6  *
7  * For more information on RandR, please see the X.org RandR specification at
8  * https://cgit.freedesktop.org/xorg/proto/randrproto/tree/randrproto.txt
9  * (take your time to read it completely, it answers all questions).
10  *
11  */
12 #pragma once
13 
14 #include <config.h>
15 
16 #include "data.h"
17 #include <xcb/randr.h>
18 
19 TAILQ_HEAD(outputs_head, xoutput);
20 extern struct outputs_head outputs;
21 
22 typedef enum {
26 
32 void randr_init(int *event_base, const bool disable_randr15);
33 
39 void output_init_con(Output *output);
40 
51 void init_ws_for_output(Output *output, Con *content);
52 
57 //void initialize_output(xcb_connection_t *conn, Output *output, Workspace *workspace);
58 
63 void randr_query_outputs(void);
64 
69 void randr_disable_output(Output *output);
70 
76 
82 Output *get_output_by_name(const char *name, const bool require_active);
83 
89 Output *get_output_containing(unsigned int x, unsigned int y);
90 
97 
98 /*
99  * In contained_by_output, we check if any active output contains part of the container.
100  * We do this by checking if the output rect is intersected by the Rect.
101  * This is the 2-dimensional counterpart of get_output_containing.
102  * Since we don't actually need the outputs intersected by the given Rect (There could
103  * be many), we just return true or false for convenience.
104  *
105  */
106 bool contained_by_output(Rect rect);
107 
119 Output *get_output_next(direction_t direction, Output *current, output_close_far_t close_far);
120 
131 Output *get_output_next_wrap(direction_t direction, Output *current);
132 
133 /*
134  * Creates an output covering the root window.
135  *
136  */
137 Output *create_root_output(xcb_connection_t *conn);
output_close_far_t
Definition: randr.h:22
direction_t
Definition: data.h:55
void randr_init(int *event_base, const bool disable_randr15)
We have just established a connection to the X server and need the initial XRandR information to setu...
Definition: randr.c:1037
A &#39;Con&#39; represents everything from the X11 root window down to a single X11 window.
Definition: data.h:591
xcb_connection_t * conn
XCB connection and root screen.
Definition: main.c:46
Output * get_output_next_wrap(direction_t direction, Output *current)
Like get_output_next with close_far == CLOSEST_OUTPUT, but wraps.
Definition: randr.c:172
Output * get_output_next(direction_t direction, Output *current, output_close_far_t close_far)
Gets the output which is the next one in the given direction.
Definition: randr.c:204
Output * create_root_output(xcb_connection_t *conn)
Definition: randr.c:269
uint32_t x
Definition: data.h:127
TAILQ_HEAD(outputs_head, xoutput)
bool contained_by_output(Rect rect)
Definition: randr.c:146
An Output is a physical output on your graphics driver.
Definition: data.h:366
Output * get_output_containing(unsigned int x, unsigned int y)
Returns the active (!) output which contains the coordinates x, y or NULL if there is no output which...
Definition: randr.c:102
Output * get_output_by_name(const char *name, const bool require_active)
Returns the output with the given name or NULL.
Definition: randr.c:47
uint32_t y
Definition: data.h:128
struct outputs_head outputs
Definition: randr.c:21
void init_ws_for_output(Output *output, Con *content)
Initializes at least one workspace for this output, trying the following steps until there is at leas...
Definition: randr.c:399
void randr_query_outputs(void)
Initializes the specified output, assigning the specified workspace to it.
Definition: randr.c:829
Output * get_first_output(void)
Returns the first output which is active.
Definition: randr.c:72
void randr_disable_output(Output *output)
Disables the output and moves its content.
Definition: randr.c:940
void output_init_con(Output *output)
Initializes a CT_OUTPUT Con (searches existing ones from inplace restart before) to use for the given...
Definition: randr.c:291
Stores a rectangle, for example the size of a window, the child window etc.
Definition: data.h:148
Output * get_output_with_dimensions(Rect rect)
Returns the active output which spans exactly the area specified by rect or NULL if there is no outpu...
Definition: randr.c:122