]> git.sur5r.net Git - i3/i3/blob - i3bar/include/outputs.h
7ad3ed5052a290823cc6ecb57d089ebf85ede406
[i3/i3] / i3bar / include / outputs.h
1 /*
2  * vim:ts=4:sw=4:expandtab
3  *
4  * i3bar - an xcb-based status- and ws-bar for i3
5  * © 2010 Axel Wagner and contributors (see also: LICENSE)
6  *
7  * outputs.c: Maintaining the outputs list
8  *
9  */
10 #pragma once
11
12 #include <xcb/xcb.h>
13 #include <cairo/cairo-xcb.h>
14
15 #include "common.h"
16 #include "cairo_util.h"
17
18 typedef struct i3_output i3_output;
19
20 SLIST_HEAD(outputs_head, i3_output);
21 struct outputs_head* outputs;
22
23 /*
24  * Start parsing the received JSON string
25  *
26  */
27 void parse_outputs_json(char* json);
28
29 /*
30  * Initiate the outputs list
31  *
32  */
33 void init_outputs(void);
34
35 /*
36  * Returns the output with the given name
37  *
38  */
39 i3_output* get_output_by_name(char* name);
40
41 struct i3_output {
42     char* name;   /* Name of the output */
43     bool active;  /* If the output is active */
44     bool primary; /* If it is the primary output */
45     bool visible; /* If the bar is visible on this output */
46     int ws;       /* The number of the currently visible ws */
47     rect rect;    /* The rect (relative to the root window) */
48
49     /* Off-screen buffer for preliminary rendering. */
50     surface_t buffer;
51     /* The actual window on which we draw. */
52     surface_t bar;
53
54     struct ws_head* workspaces;  /* The workspaces on this output */
55     struct tc_head* trayclients; /* The tray clients on this output */
56
57     SLIST_ENTRY(i3_output) slist; /* Pointer for the SLIST-Macro */
58 };