2010-08-07 20:05:16 +04:00
|
|
|
/*
|
2011-10-26 00:19:38 +04:00
|
|
|
* vim:ts=4:sw=4:expandtab
|
2010-08-07 20:05:16 +04:00
|
|
|
*
|
2011-10-26 00:19:38 +04:00
|
|
|
* i3bar - an xcb-based status- and ws-bar for i3
|
2015-04-04 03:17:56 +03:00
|
|
|
* © 2010 Axel Wagner and contributors (see also: LICENSE)
|
2010-08-07 20:05:16 +04:00
|
|
|
*
|
2015-03-23 22:56:49 +03:00
|
|
|
* outputs.c: Maintaining the outputs list
|
2010-08-07 20:05:16 +04:00
|
|
|
*
|
|
|
|
*/
|
2013-12-29 06:11:50 +04:00
|
|
|
#pragma once
|
2010-07-22 03:15:18 +04:00
|
|
|
|
|
|
|
#include <xcb/xcb.h>
|
2015-09-06 00:38:15 +03:00
|
|
|
#include <cairo/cairo-xcb.h>
|
2010-07-22 03:15:18 +04:00
|
|
|
|
2010-07-30 05:11:54 +04:00
|
|
|
#include "common.h"
|
|
|
|
|
|
|
|
typedef struct i3_output i3_output;
|
2010-07-22 03:15:18 +04:00
|
|
|
|
2010-07-30 05:11:54 +04:00
|
|
|
SLIST_HEAD(outputs_head, i3_output);
|
2014-06-19 13:20:32 +04:00
|
|
|
struct outputs_head* outputs;
|
2010-07-22 03:15:18 +04:00
|
|
|
|
2010-08-07 04:10:05 +04:00
|
|
|
/*
|
2015-03-23 22:56:49 +03:00
|
|
|
* Start parsing the received JSON string
|
2010-08-07 04:10:05 +04:00
|
|
|
*
|
|
|
|
*/
|
2011-08-12 20:43:09 +04:00
|
|
|
void parse_outputs_json(char* json);
|
2010-08-07 04:10:05 +04:00
|
|
|
|
|
|
|
/*
|
2015-03-23 22:56:49 +03:00
|
|
|
* Initiate the outputs list
|
2010-08-07 04:10:05 +04:00
|
|
|
*
|
|
|
|
*/
|
2012-08-23 14:55:28 +04:00
|
|
|
void init_outputs(void);
|
2010-08-07 04:10:05 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Returns the output with the given name
|
|
|
|
*
|
|
|
|
*/
|
2011-08-12 20:43:09 +04:00
|
|
|
i3_output* get_output_by_name(char* name);
|
2010-07-22 03:15:18 +04:00
|
|
|
|
2015-10-26 23:55:01 +03:00
|
|
|
/*
|
|
|
|
* Returns true if the output has the currently focused workspace
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
bool output_has_focus(i3_output* output);
|
|
|
|
|
2010-07-30 05:11:54 +04:00
|
|
|
struct i3_output {
|
2014-06-19 13:20:32 +04:00
|
|
|
char* name; /* Name of the output */
|
|
|
|
bool active; /* If the output is active */
|
|
|
|
bool primary; /* If it is the primary output */
|
2015-01-09 01:18:23 +03:00
|
|
|
bool visible; /* If the bar is visible on this output */
|
2014-06-19 13:20:32 +04:00
|
|
|
int ws; /* The number of the currently visible ws */
|
2015-03-23 22:56:49 +03:00
|
|
|
rect rect; /* The rect (relative to the root window) */
|
2014-06-19 13:20:32 +04:00
|
|
|
|
2015-10-26 18:27:09 +03:00
|
|
|
/* Off-screen buffer for preliminary rendering of the bar. */
|
2015-09-06 00:38:15 +03:00
|
|
|
surface_t buffer;
|
2015-10-26 18:27:09 +03:00
|
|
|
/* Off-screen buffer for pre-rendering the statusline, separated to make clipping easier. */
|
|
|
|
surface_t statusline_buffer;
|
|
|
|
/* How much of statusline_buffer's horizontal space was used on last statusline render. */
|
|
|
|
int statusline_width;
|
|
|
|
/* Whether statusline block short texts where used on last statusline render. */
|
|
|
|
bool statusline_short_text;
|
2015-09-06 00:38:15 +03:00
|
|
|
/* The actual window on which we draw. */
|
|
|
|
surface_t bar;
|
2014-06-19 13:20:32 +04:00
|
|
|
|
|
|
|
struct ws_head* workspaces; /* The workspaces on this output */
|
|
|
|
struct tc_head* trayclients; /* The tray clients on this output */
|
2010-07-30 05:11:54 +04:00
|
|
|
|
2011-08-12 20:43:09 +04:00
|
|
|
SLIST_ENTRY(i3_output) slist; /* Pointer for the SLIST-Macro */
|
2010-07-22 03:15:18 +04:00
|
|
|
};
|