]> git.sur5r.net Git - i3/i3/blob - include/randr.h
don’t use reversed identifiers for include guards (Thanks Markus)
[i3/i3] / include / randr.h
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 /**
22  * We have just established a connection to the X server and need the initial
23  * XRandR information to setup workspaces for each screen.
24  *
25  */
26 void randr_init(int *event_base);
27
28 /**
29  * Disables RandR support by creating exactly one output with the size of the
30  * X11 screen.
31  *
32  */
33 void disable_randr(xcb_connection_t *conn);
34
35 /**
36  * Initializes a CT_OUTPUT Con (searches existing ones from inplace restart
37  * before) to use for the given Output.
38  *
39  */
40 void output_init_con(Output *output);
41
42 /**
43  * Initializes at least one workspace for this output, trying the following
44  * steps until there is at least one workspace:
45  *
46  * • Move existing workspaces, which are assigned to be on the given output, to
47  *   the output.
48  * • Create the first assigned workspace for this output.
49  * • Create the first unused workspace.
50  *
51  */
52 void init_ws_for_output(Output *output, Con *content);
53
54 /**
55  * Initializes the specified output, assigning the specified workspace to it.
56  *
57  */
58 //void initialize_output(xcb_connection_t *conn, Output *output, Workspace *workspace);
59
60 /**
61  * (Re-)queries the outputs via RandR and stores them in the list of outputs.
62  *
63  */
64 void randr_query_outputs(void);
65
66 /**
67  * Returns the first output which is active.
68  *
69  */
70 Output *get_first_output(void);
71
72 /**
73  * Returns the output with the given name if it is active (!) or NULL.
74  *
75  */
76 Output *get_output_by_name(const char *name);
77
78 /**
79  * Returns the active (!) output which contains the coordinates x, y or NULL
80  * if there is no output which contains these coordinates.
81  *
82  */
83 Output *get_output_containing(int x, int y);
84
85 /**
86  * Gets the output which is the last one in the given direction, for example
87  * the output on the most bottom when direction == D_DOWN, the output most
88  * right when direction == D_RIGHT and so on.
89  *
90  * This function always returns a output.
91  *
92  */
93 Output *get_output_most(direction_t direction, Output *current);
94
95 /**
96  * Gets the output which is the next one in the given direction.
97  *
98  */
99 Output *get_output_next(direction_t direction, Output *current);
100
101 #endif