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-2011 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 #ifndef I3_RANDR_H
13 #define I3_RANDR_H
14 
15 #include "data.h"
16 #include <xcb/randr.h>
17 
18 TAILQ_HEAD(outputs_head, xoutput);
19 extern struct outputs_head outputs;
20 
21 typedef enum {
25 
31 void randr_init(int *event_base);
32 
38 void disable_randr(xcb_connection_t *conn);
39 
45 void output_init_con(Output *output);
46 
57 void init_ws_for_output(Output *output, Con *content);
58 
63 //void initialize_output(xcb_connection_t *conn, Output *output, Workspace *workspace);
64 
69 void randr_query_outputs(void);
70 
76 
81 Output *get_output_by_name(const char *name);
82 
88 Output *get_output_containing(int x, int y);
89 
90 /*
91  * In contained_by_output, we check if any active output contains part of the container.
92  * We do this by checking if the output rect is intersected by the Rect.
93  * This is the 2-dimensional counterpart of get_output_containing.
94  * Since we don't actually need the outputs intersected by the given Rect (There could
95  * be many), we just return true or false for convenience.
96  *
97  */
98 bool contained_by_output(Rect rect);
99 
111 Output *get_output_next(direction_t direction, Output *current, output_close_far_t close_far);
112 
123 Output *get_output_next_wrap(direction_t direction, Output *current);
124 
125 #endif
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:820
A &#39;Con&#39; represents everything from the X11 root window down to a single X11 window.
Definition: data.h:457
Stores a rectangle, for example the size of a window, the child window etc.
Definition: data.h:107
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:252
output_close_far_t
Definition: randr.h:21
void randr_query_outputs(void)
Initializes the specified output, assigning the specified workspace to it.
Definition: randr.c:591
Output * get_output_by_name(const char *name)
Returns the output with the given name if it is active (!) or NULL.
Definition: randr.c:51
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:162
xcb_connection_t * conn
Definition: main.c:42
Output * get_first_output(void)
Returns the first output which is active.
Definition: randr.c:65
#define TAILQ_HEAD(name, type)
Definition: queue.h:306
struct outputs_head outputs
Definition: randr.c:28
Output * get_output_next_wrap(direction_t direction, Output *current)
Like get_output_next with close_far == CLOSEST_OUTPUT, but wraps.
Definition: randr.c:130
uint32_t x
Definition: data.h:30
An Output is a physical output on your graphics driver.
Definition: data.h:282
Output * get_output_containing(int x, int y)
Returns the active (!) output which contains the coordinates x, y or NULL if there is no output which...
Definition: randr.c:80
uint32_t y
Definition: data.h:31
bool contained_by_output(Rect rect)
Definition: randr.c:103
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:356
void disable_randr(xcb_connection_t *conn)
Disables RandR support by creating exactly one output with the size of the X11 screen.
Definition: randr.c:228
direction_t
Definition: data.h:55