]> git.sur5r.net Git - i3/i3/blob - i3bar/include/outputs.h
rename config.h to configuration.h
[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
17 typedef struct i3_output i3_output;
18
19 SLIST_HEAD(outputs_head, i3_output);
20 struct outputs_head* outputs;
21
22 /*
23  * Start parsing the received JSON string
24  *
25  */
26 void parse_outputs_json(char* json);
27
28 /*
29  * Initiate the outputs list
30  *
31  */
32 void init_outputs(void);
33
34 /*
35  * Returns the output with the given name
36  *
37  */
38 i3_output* get_output_by_name(char* name);
39
40 /*
41  * Returns true if the output has the currently focused workspace
42  *
43  */
44 bool output_has_focus(i3_output* output);
45
46 struct i3_output {
47     char* name;   /* Name of the output */
48     bool active;  /* If the output is active */
49     bool primary; /* If it is the primary output */
50     bool visible; /* If the bar is visible on this output */
51     int ws;       /* The number of the currently visible ws */
52     rect rect;    /* The rect (relative to the root window) */
53
54     /* Off-screen buffer for preliminary rendering of the bar. */
55     surface_t buffer;
56     /* Off-screen buffer for pre-rendering the statusline, separated to make clipping easier. */
57     surface_t statusline_buffer;
58     /* How much of statusline_buffer's horizontal space was used on last statusline render. */
59     int statusline_width;
60     /* Whether statusline block short texts where used on last statusline render. */
61     bool statusline_short_text;
62     /* The actual window on which we draw. */
63     surface_t bar;
64
65     struct ws_head* workspaces;  /* The workspaces on this output */
66     struct tc_head* trayclients; /* The tray clients on this output */
67
68     SLIST_ENTRY(i3_output) slist; /* Pointer for the SLIST-Macro */
69 };