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 #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 disable_randr(xcb_connection_t *conn);
38 
44 void output_init_con(Output *output);
45 
56 void init_ws_for_output(Output *output, Con *content);
57 
62 //void initialize_output(xcb_connection_t *conn, Output *output, Workspace *workspace);
63 
68 void randr_query_outputs(void);
69 
75 
80 Output *get_output_by_name(const char *name);
81 
87 Output *get_output_containing(unsigned int x, unsigned int y);
88 
89 /*
90  * In contained_by_output, we check if any active output contains part of the container.
91  * We do this by checking if the output rect is intersected by the Rect.
92  * This is the 2-dimensional counterpart of get_output_containing.
93  * Since we don't actually need the outputs intersected by the given Rect (There could
94  * be many), we just return true or false for convenience.
95  *
96  */
97 bool contained_by_output(Rect rect);
98 
110 Output *get_output_next(direction_t direction, Output *current, output_close_far_t close_far);
111 
122 Output *get_output_next_wrap(direction_t direction, Output *current);
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
direction_t
Definition: data.h:54
xcb_connection_t * conn
Definition: main.c:47
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:161
Stores a rectangle, for example the size of a window, the child window etc.
Definition: data.h:122
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:355
An Output is a physical output on your graphics driver.
Definition: data.h:301
Output * get_output_next_wrap(direction_t direction, Output *current)
Like get_output_next with close_far == CLOSEST_OUTPUT, but wraps.
Definition: randr.c:129
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:227
void randr_query_outputs(void)
Initializes the specified output, assigning the specified workspace to it.
Definition: randr.c:592
struct outputs_head outputs
Definition: randr.c:28
bool contained_by_output(Rect rect)
Definition: randr.c:103
Output * get_first_output(void)
Returns the first output which is active.
Definition: randr.c:65
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:822
output_close_far_t
Definition: randr.h:20
A &#39;Con&#39; represents everything from the X11 root window down to a single X11 window.
Definition: data.h:479
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:80
uint32_t y
Definition: data.h:31
uint32_t x
Definition: data.h:30
#define TAILQ_HEAD(name, type)
Definition: queue.h:305
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:251