]> git.sur5r.net Git - i3/i3/blob - i3bar/include/outputs.h
Use #pragma once
[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-2012 Axel Wagner and contributors (see also: LICENSE)
6  *
7  * outputs.c: Maintaining the output-list
8  *
9  */
10 #pragma once
11
12 #include <xcb/xcb.h>
13
14 #include "common.h"
15
16 typedef struct i3_output i3_output;
17
18 SLIST_HEAD(outputs_head, i3_output);
19 struct outputs_head *outputs;
20
21 /*
22  * Start parsing the received json-string
23  *
24  */
25 void parse_outputs_json(char* json);
26
27 /*
28  * Initiate the output-list
29  *
30  */
31 void init_outputs(void);
32
33 /*
34  * Returns the output with the given name
35  *
36  */
37 i3_output* get_output_by_name(char* name);
38
39 struct i3_output {
40     char*          name;          /* Name of the output */
41     bool           active;        /* If the output is active */
42     bool           primary;       /* If it is the primary output */
43     int            ws;            /* The number of the currently visible ws */
44     rect           rect;          /* The rect (relative to the root-win) */
45
46     xcb_window_t   bar;           /* The id of the bar of the output */
47     xcb_pixmap_t   buffer;        /* An extra pixmap for double-buffering */
48     xcb_gcontext_t bargc;         /* The graphical context of the bar */
49
50     struct ws_head *workspaces;   /* The workspaces on this output */
51     struct tc_head *trayclients;  /* The tray clients on this output */
52
53     SLIST_ENTRY(i3_output) slist; /* Pointer for the SLIST-Macro */
54 };