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 {
24  FARTHEST_OUTPUT = 1
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);
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 
98 
105 
114 
126 Output *get_output_next(direction_t direction, Output *current, output_close_far_t close_far);
127 
138 Output *get_output_next_wrap(direction_t direction, Output *current);
139 
144 Output *create_root_output(xcb_connection_t *conn);
#define y(x,...)
Definition: commands.c:18
xcb_connection_t * conn
XCB connection and root screen.
Definition: main.c:54
direction_t
Definition: data.h:53
Output * create_root_output(xcb_connection_t *conn)
Creates an output covering the root window.
Definition: randr.c:307
Output * get_first_output(void)
Returns the first output which is active.
Definition: randr.c:75
TAILQ_HEAD(outputs_head, xoutput)
Output * get_output_by_name(const char *name, const bool require_active)
Returns the output with the given name or NULL.
Definition: randr.c:50
void init_ws_for_output(Output *output)
Initializes at least one workspace for this output, trying the following steps until there is at leas...
Definition: randr.c:437
void randr_query_outputs(void)
Initializes the specified output, assigning the specified workspace to it.
Definition: randr.c:905
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:150
Output * output_containing_rect(Rect rect)
In output_containing_rect, we check if any active output contains part of the container.
Definition: randr.c:173
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:329
struct outputs_head outputs
Definition: randr.c:22
Output * get_output_next_wrap(direction_t direction, Output *current)
Like get_output_next with close_far == CLOSEST_OUTPUT, but wraps.
Definition: randr.c:210
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:1063
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:242
output_close_far_t
Definition: randr.h:22
@ FARTHEST_OUTPUT
Definition: randr.h:24
@ CLOSEST_OUTPUT
Definition: randr.h:23
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:116
void randr_disable_output(Output *output)
Disables the output and moves its content.
Definition: randr.c:1035
Output * get_output_from_rect(Rect rect)
Returns the active output which contains the midpoint of the given rect.
Definition: randr.c:137
Stores a rectangle, for example the size of a window, the child window etc.
Definition: data.h:156
An Output is a physical output on your graphics driver.
Definition: data.h:361