]> git.sur5r.net Git - i3/i3/blob - include/randr.h
Merge branch 'fix-ws-direction'
[i3/i3] / include / randr.h
1 /*
2  * vim:ts=8:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  *
6  * © 2009-2010 Michael Stapelberg and contributors
7  *
8  * See file LICENSE for license information.
9  *
10  */
11 #include "data.h"
12 #include <xcb/randr.h>
13
14 #ifndef _RANDR_H
15 #define _RANDR_H
16
17 TAILQ_HEAD(outputs_head, xoutput);
18 extern struct outputs_head outputs;
19
20 /**
21  * We have just established a connection to the X server and need the initial
22  * XRandR information to setup workspaces for each screen.
23  *
24  */
25 void randr_init(int *event_base);
26
27 /**
28  * Disables RandR support by creating exactly one output with the size of the
29  * X11 screen.
30  *
31  */
32 void disable_randr(xcb_connection_t *conn);
33
34 /**
35  * Initializes a CT_OUTPUT Con (searches existing ones from inplace restart
36  * before) to use for the given Output.
37  *
38  */
39 void output_init_con(Output *output);
40
41 /**
42  * Initializes at least one workspace for this output, trying the following
43  * steps until there is at least one workspace:
44  *
45  * • Move existing workspaces, which are assigned to be on the given output, to
46  *   the output.
47  * • Create the first assigned workspace for this output.
48  * • Create the first unused workspace.
49  *
50  */
51 void init_ws_for_output(Output *output, Con *content);
52
53 /**
54  * Initializes the specified output, assigning the specified workspace to it.
55  *
56  */
57 //void initialize_output(xcb_connection_t *conn, Output *output, Workspace *workspace);
58
59 /**
60  * (Re-)queries the outputs via RandR and stores them in the list of outputs.
61  *
62  */
63 void randr_query_outputs();
64
65 /**
66  * Returns the first output which is active.
67  *
68  */
69 Output *get_first_output();
70
71 /**
72  * Returns the output with the given name if it is active (!) or NULL.
73  *
74  */
75 Output *get_output_by_name(const char *name);
76
77 /**
78  * Returns the active (!) output which contains the coordinates x, y or NULL
79  * if there is no output which contains these coordinates.
80  *
81  */
82 Output *get_output_containing(int x, int y);
83
84 /**
85  * Gets the output which is the last one in the given direction, for example
86  * the output on the most bottom when direction == D_DOWN, the output most
87  * right when direction == D_RIGHT and so on.
88  *
89  * This function always returns a output.
90  *
91  */
92 Output *get_output_most(direction_t direction, Output *current);
93
94 /**
95  * Gets the output which is the next one in the given direction.
96  *
97  */
98 Output *get_output_next(direction_t direction, Output *current);
99
100 #endif