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  * http://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 "data.h"
15 #include <xcb/randr.h>
16 
17 TAILQ_HEAD(outputs_head, xoutput);
18 extern struct outputs_head outputs;
19 
20 typedef enum {
24 
30 void randr_init(int *event_base);
31 
37 void output_init_con(Output *output);
38 
49 void init_ws_for_output(Output *output, Con *content);
50 
55 //void initialize_output(xcb_connection_t *conn, Output *output, Workspace *workspace);
56 
61 void randr_query_outputs(void);
62 
68 
73 Output *get_output_by_name(const char *name);
74 
80 Output *get_output_containing(unsigned int x, unsigned int y);
81 
82 /*
83  * In contained_by_output, we check if any active output contains part of the container.
84  * We do this by checking if the output rect is intersected by the Rect.
85  * This is the 2-dimensional counterpart of get_output_containing.
86  * Since we don't actually need the outputs intersected by the given Rect (There could
87  * be many), we just return true or false for convenience.
88  *
89  */
90 bool contained_by_output(Rect rect);
91 
103 Output *get_output_next(direction_t direction, Output *current, output_close_far_t close_far);
104 
115 Output *get_output_next_wrap(direction_t direction, Output *current);
116 
117 /*
118  * Creates an output covering the root window.
119  *
120  */
121 Output *create_root_output(xcb_connection_t *conn);
Output * get_output_next_wrap(direction_t direction, Output *current)
Like get_output_next with close_far == CLOSEST_OUTPUT, but wraps.
Definition: randr.c:145
xcb_connection_t * conn
XCB connection and root screen.
Definition: main.c:43
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:177
bool contained_by_output(Rect rect)
Definition: randr.c:119
output_close_far_t
Definition: randr.h:20
#define TAILQ_HEAD(name, type)
Definition: queue.h:318
uint32_t x
Definition: data.h:120
Stores a rectangle, for example the size of a window, the child window etc.
Definition: data.h:141
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:96
direction_t
Definition: data.h:54
void randr_query_outputs(void)
Initializes the specified output, assigning the specified workspace to it.
Definition: randr.c:603
uint32_t y
Definition: data.h:121
A &#39;Con&#39; represents everything from the X11 root window down to a single X11 window.
Definition: data.h:544
struct outputs_head outputs
Definition: randr.c:28
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:260
Output * get_first_output(void)
Returns the first output which is active.
Definition: randr.c:66
void randr_init(int *event_base)
We have just established a connection to the X server and need the initial XRandR information to setu...
Definition: randr.c:833
Output * get_output_by_name(const char *name)
Returns the output with the given name if it is active (!) or NULL.
Definition: randr.c:52
An Output is a physical output on your graphics driver.
Definition: data.h:330
Output * create_root_output(xcb_connection_t *conn)
Definition: randr.c:242
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:364