2010-08-07 18:05:16 +02:00
|
|
|
/*
|
2011-10-25 22:19:38 +02:00
|
|
|
* vim:ts=4:sw=4:expandtab
|
2010-08-07 18:05:16 +02:00
|
|
|
*
|
2011-10-25 22:19:38 +02:00
|
|
|
* i3bar - an xcb-based status- and ws-bar for i3
|
2012-08-23 12:55:28 +02:00
|
|
|
* © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
|
2010-08-07 18:05:16 +02:00
|
|
|
*
|
2011-10-25 22:19:38 +02:00
|
|
|
* outputs.c: Maintaining the output-list
|
2010-08-07 18:05:16 +02:00
|
|
|
*
|
|
|
|
*/
|
2013-12-29 03:11:50 +01:00
|
|
|
#pragma once
|
2010-07-22 01:15:18 +02:00
|
|
|
|
|
|
|
#include <xcb/xcb.h>
|
|
|
|
|
2010-07-30 03:11:54 +02:00
|
|
|
#include "common.h"
|
|
|
|
|
|
|
|
typedef struct i3_output i3_output;
|
2010-07-22 01:15:18 +02:00
|
|
|
|
2010-07-30 03:11:54 +02:00
|
|
|
SLIST_HEAD(outputs_head, i3_output);
|
2014-06-19 11:20:32 +02:00
|
|
|
struct outputs_head* outputs;
|
2010-07-22 01:15:18 +02:00
|
|
|
|
2010-08-07 02:10:05 +02:00
|
|
|
/*
|
|
|
|
* Start parsing the received json-string
|
|
|
|
*
|
|
|
|
*/
|
2011-08-12 18:43:09 +02:00
|
|
|
void parse_outputs_json(char* json);
|
2010-08-07 02:10:05 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Initiate the output-list
|
|
|
|
*
|
|
|
|
*/
|
2012-08-23 12:55:28 +02:00
|
|
|
void init_outputs(void);
|
2010-08-07 02:10:05 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Returns the output with the given name
|
|
|
|
*
|
|
|
|
*/
|
2011-08-12 18:43:09 +02:00
|
|
|
i3_output* get_output_by_name(char* name);
|
2010-07-22 01:15:18 +02:00
|
|
|
|
2010-07-30 03:11:54 +02:00
|
|
|
struct i3_output {
|
2014-06-19 11:20:32 +02:00
|
|
|
char* name; /* Name of the output */
|
|
|
|
bool active; /* If the output is active */
|
|
|
|
bool primary; /* If it is the primary output */
|
2015-01-08 23:18:23 +01:00
|
|
|
bool visible; /* If the bar is visible on this output */
|
2014-06-19 11:20:32 +02:00
|
|
|
int ws; /* The number of the currently visible ws */
|
|
|
|
rect rect; /* The rect (relative to the root-win) */
|
|
|
|
|
|
|
|
xcb_window_t bar; /* The id of the bar of the output */
|
|
|
|
xcb_pixmap_t buffer; /* An extra pixmap for double-buffering */
|
|
|
|
xcb_gcontext_t bargc; /* The graphical context of the bar */
|
|
|
|
|
|
|
|
struct ws_head* workspaces; /* The workspaces on this output */
|
|
|
|
struct tc_head* trayclients; /* The tray clients on this output */
|
2010-07-30 03:11:54 +02:00
|
|
|
|
2011-08-12 18:43:09 +02:00
|
|
|
SLIST_ENTRY(i3_output) slist; /* Pointer for the SLIST-Macro */
|
2010-07-22 01:15:18 +02:00
|
|
|
};
|