2010-08-07 12:05:16 -04:00
|
|
|
/*
|
2011-10-25 16:19:38 -04:00
|
|
|
* vim:ts=4:sw=4:expandtab
|
2010-08-07 12:05:16 -04:00
|
|
|
*
|
2011-10-25 16:19:38 -04:00
|
|
|
* i3bar - an xcb-based status- and ws-bar for i3
|
2012-08-23 06:55:28 -04:00
|
|
|
* © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
|
2010-08-07 12:05:16 -04:00
|
|
|
*
|
2011-10-25 16:19:38 -04:00
|
|
|
* xcb.c: Communicating with X
|
2010-08-07 12:05:16 -04:00
|
|
|
*
|
|
|
|
*/
|
2010-07-21 19:15:18 -04:00
|
|
|
#ifndef XCB_H_
|
|
|
|
#define XCB_H_
|
|
|
|
|
2010-10-23 23:24:51 -04:00
|
|
|
#include <stdint.h>
|
2010-11-04 07:27:10 -04:00
|
|
|
//#include "outputs.h"
|
2010-10-23 23:24:51 -04:00
|
|
|
|
2011-08-16 19:32:29 -04:00
|
|
|
#ifdef XCB_COMPAT
|
|
|
|
#define XCB_ATOM_CARDINAL CARDINAL
|
|
|
|
#endif
|
|
|
|
|
2011-08-16 18:58:00 -04:00
|
|
|
#define _NET_SYSTEM_TRAY_ORIENTATION_HORZ 0
|
|
|
|
#define _NET_SYSTEM_TRAY_ORIENTATION_VERT 1
|
2011-08-16 18:05:05 -04:00
|
|
|
#define SYSTEM_TRAY_REQUEST_DOCK 0
|
|
|
|
#define SYSTEM_TRAY_BEGIN_MESSAGE 1
|
|
|
|
#define SYSTEM_TRAY_CANCEL_MESSAGE 2
|
|
|
|
#define XEMBED_MAPPED (1 << 0)
|
2011-08-16 18:44:03 -04:00
|
|
|
#define XEMBED_EMBEDDED_NOTIFY 0
|
2011-08-16 18:05:05 -04:00
|
|
|
|
2010-11-04 07:27:10 -04:00
|
|
|
struct xcb_color_strings_t {
|
2010-10-23 23:24:51 -04:00
|
|
|
char *bar_fg;
|
|
|
|
char *bar_bg;
|
|
|
|
char *active_ws_fg;
|
|
|
|
char *active_ws_bg;
|
2012-01-20 16:36:50 -05:00
|
|
|
char *active_ws_border;
|
2010-10-23 23:24:51 -04:00
|
|
|
char *inactive_ws_fg;
|
|
|
|
char *inactive_ws_bg;
|
2012-01-20 16:36:50 -05:00
|
|
|
char *inactive_ws_border;
|
2011-03-20 14:29:30 -04:00
|
|
|
char *focus_ws_bg;
|
|
|
|
char *focus_ws_fg;
|
2012-01-20 16:36:50 -05:00
|
|
|
char *focus_ws_border;
|
2010-10-23 23:24:51 -04:00
|
|
|
char *urgent_ws_bg;
|
|
|
|
char *urgent_ws_fg;
|
2012-01-20 16:36:50 -05:00
|
|
|
char *urgent_ws_border;
|
2010-10-23 23:24:51 -04:00
|
|
|
};
|
|
|
|
|
2010-11-04 07:27:10 -04:00
|
|
|
typedef struct xcb_colors_t xcb_colors_t;
|
2010-10-23 23:24:51 -04:00
|
|
|
|
2010-08-06 20:10:05 -04:00
|
|
|
/*
|
2011-10-19 17:58:19 -04:00
|
|
|
* Early initialization of the connection to X11: Everything which does not
|
|
|
|
* depend on 'config'.
|
2010-08-06 20:10:05 -04:00
|
|
|
*
|
|
|
|
*/
|
2011-10-19 17:58:19 -04:00
|
|
|
char *init_xcb_early();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialization which depends on 'config' being usable. Called after the
|
|
|
|
* configuration has arrived.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void init_xcb_late(char *fontname);
|
2010-08-06 20:10:05 -04:00
|
|
|
|
2010-10-23 23:24:51 -04:00
|
|
|
/*
|
|
|
|
* Initialize the colors
|
|
|
|
*
|
|
|
|
*/
|
2010-11-04 07:27:10 -04:00
|
|
|
void init_colors(const struct xcb_color_strings_t *colors);
|
2010-10-23 23:24:51 -04:00
|
|
|
|
2010-08-06 20:10:05 -04:00
|
|
|
/*
|
|
|
|
* Cleanup the xcb-stuff.
|
|
|
|
* Called once, before the program terminates.
|
|
|
|
*
|
|
|
|
*/
|
2012-08-23 06:55:28 -04:00
|
|
|
void clean_xcb(void);
|
2010-08-06 20:10:05 -04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Get the earlier requested atoms and save them in the prepared data-structure
|
|
|
|
*
|
|
|
|
*/
|
2012-08-23 06:55:28 -04:00
|
|
|
void get_atoms(void);
|
2010-08-06 20:10:05 -04:00
|
|
|
|
2012-04-22 14:43:52 -04:00
|
|
|
/*
|
|
|
|
* Reparents all tray clients of the specified output to the root window. This
|
|
|
|
* is either used when shutting down, when an output appears (xrandr --output
|
|
|
|
* VGA1 --off) or when the primary output changes.
|
|
|
|
*
|
|
|
|
* Applications using the tray will start the protocol from the beginning again
|
|
|
|
* afterwards.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void kick_tray_clients(i3_output *output);
|
|
|
|
|
2010-08-06 20:10:05 -04:00
|
|
|
/*
|
|
|
|
* Destroy the bar of the specified output
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void destroy_window(i3_output *output);
|
|
|
|
|
2011-03-19 17:27:35 -04:00
|
|
|
/*
|
|
|
|
* Reallocate the statusline-buffer
|
|
|
|
*
|
|
|
|
*/
|
2012-08-23 06:55:28 -04:00
|
|
|
void realloc_sl_buffer(void);
|
2011-03-19 17:27:35 -04:00
|
|
|
|
2010-08-06 20:10:05 -04:00
|
|
|
/*
|
|
|
|
* Reconfigure all bars and create new for newly activated outputs
|
|
|
|
*
|
|
|
|
*/
|
2012-08-23 06:55:28 -04:00
|
|
|
void reconfig_windows(void);
|
2010-08-06 20:10:05 -04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Render the bars, with buttons and statusline
|
|
|
|
*
|
|
|
|
*/
|
2012-08-21 07:51:40 -04:00
|
|
|
void draw_bars(bool force_unhide);
|
2010-08-06 20:10:05 -04:00
|
|
|
|
2010-08-22 04:24:32 -04:00
|
|
|
/*
|
|
|
|
* Redraw the bars, i.e. simply copy the buffer to the barwindow
|
|
|
|
*
|
|
|
|
*/
|
2012-08-23 06:55:28 -04:00
|
|
|
void redraw_bars(void);
|
2010-08-22 04:24:32 -04:00
|
|
|
|
2010-07-21 19:15:18 -04:00
|
|
|
#endif
|