2 * vim:ts=4:sw=4:expandtab
4 * i3 - an improved dynamic tiling window manager
5 * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
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).
15 #include <xcb/randr.h>
17 TAILQ_HEAD(outputs_head, xoutput);
18 extern struct outputs_head outputs;
26 * We have just established a connection to the X server and need the initial
27 * XRandR information to setup workspaces for each screen.
30 void randr_init(int *event_base);
33 * Disables RandR support by creating exactly one output with the size of the
37 void disable_randr(xcb_connection_t *conn);
40 * Initializes a CT_OUTPUT Con (searches existing ones from inplace restart
41 * before) to use for the given Output.
44 void output_init_con(Output *output);
47 * Initializes at least one workspace for this output, trying the following
48 * steps until there is at least one workspace:
50 * • Move existing workspaces, which are assigned to be on the given output, to
52 * • Create the first assigned workspace for this output.
53 * • Create the first unused workspace.
56 void init_ws_for_output(Output *output, Con *content);
59 * Initializes the specified output, assigning the specified workspace to it.
62 //void initialize_output(xcb_connection_t *conn, Output *output, Workspace *workspace);
65 * (Re-)queries the outputs via RandR and stores them in the list of outputs.
68 void randr_query_outputs(void);
71 * Returns the first output which is active.
74 Output *get_first_output(void);
77 * Returns the output with the given name if it is active (!) or NULL.
80 Output *get_output_by_name(const char *name);
83 * Returns the active (!) output which contains the coordinates x, y or NULL
84 * if there is no output which contains these coordinates.
87 Output *get_output_containing(unsigned int x, unsigned int y);
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.
97 bool contained_by_output(Rect rect);
100 * Gets the output which is the next one in the given direction.
102 * If close_far == CLOSEST_OUTPUT, then the output next to the current one will
103 * selected. If close_far == FARTHEST_OUTPUT, the output which is the last one
104 * in the given direction will be selected.
106 * NULL will be returned when no active outputs are present in the direction
107 * specified (note that ‘current’ counts as such an output).
110 Output *get_output_next(direction_t direction, Output *current, output_close_far_t close_far);
113 * Like get_output_next with close_far == CLOSEST_OUTPUT, but wraps.
115 * For example if get_output_next(D_DOWN, x, FARTHEST_OUTPUT) = NULL, then
116 * get_output_next_wrap(D_DOWN, x) will return the topmost output.
118 * This function always returns a output: if no active outputs can be found,
119 * current itself is returned.
122 Output *get_output_next_wrap(direction_t direction, Output *current);