1 #ifndef _XTITLE_H
2 #define _XTITLE_H
3 
4 #define FORMAT         L"%ls\n"
5 /* Reference: http://www.sensi.org/~alec/locale/other/ctext.html */
6 #define CT_UTF8_BEGIN   "\x1b\x25\x47"
7 #define CT_UTF8_END     "\x1b\x25\x40"
8 
9 xcb_connection_t *dpy;
10 xcb_ewmh_connection_t *ewmh;
11 int default_screen;
12 xcb_window_t root;
13 bool running, visible;
14 
15 bool setup(void);
16 wchar_t* expand_escapes(const wchar_t *src);
17 void output_title(xcb_window_t win, wchar_t *format, bool escaped, int truncate);
18 void print_title(wchar_t *format, wchar_t *title, xcb_window_t win);
19 bool title_changed(xcb_generic_event_t *evt, xcb_window_t *win, xcb_window_t *last_win);
20 void watch(xcb_window_t win, bool state);
21 bool get_active_window(xcb_window_t *win);
22 wchar_t *get_window_title(xcb_window_t win);
23 void hold(int sig);
24 
25 #endif
26