2 * vim:ts=4:sw=4:expandtab
4 * i3bar - an xcb-based status- and ws-bar for i3
5 * © 2010 Axel Wagner and contributors (see also: LICENSE)
7 * outputs.c: Maintaining the outputs list
13 #include <cairo/cairo-xcb.h>
16 #include "draw_util.h"
18 typedef struct i3_output i3_output;
20 SLIST_HEAD(outputs_head, i3_output);
21 struct outputs_head* outputs;
24 * Start parsing the received JSON string
27 void parse_outputs_json(char* json);
30 * Initiate the outputs list
33 void init_outputs(void);
36 * Returns the output with the given name
39 i3_output* get_output_by_name(char* name);
42 * Returns true if the output has the currently focused workspace
45 bool output_has_focus(i3_output* output);
48 char* name; /* Name of the output */
49 bool active; /* If the output is active */
50 bool primary; /* If it is the primary output */
51 bool visible; /* If the bar is visible on this output */
52 int ws; /* The number of the currently visible ws */
53 rect rect; /* The rect (relative to the root window) */
55 /* Off-screen buffer for preliminary rendering of the bar. */
57 /* Off-screen buffer for pre-rendering the statusline, separated to make clipping easier. */
58 surface_t statusline_buffer;
59 /* How much of statusline_buffer's horizontal space was used on last statusline render. */
61 /* Whether statusline block short texts where used on last statusline render. */
62 bool statusline_short_text;
63 /* The actual window on which we draw. */
66 struct ws_head* workspaces; /* The workspaces on this output */
67 struct tc_head* trayclients; /* The tray clients on this output */
69 SLIST_ENTRY(i3_output) slist; /* Pointer for the SLIST-Macro */