i3bar: use Pango markup

Parse text within workspace buttons and the i3bar statusline as Pango
markup. This lets people specify things like font weight, text color,
background color, font size, and font family in the text of i3bar.

fixes #1468
This commit is contained in:
Tony Crisci
2015-02-12 14:45:34 -05:00
parent fbe25297b7
commit e18e2b9f98
7 changed files with 83 additions and 14 deletions

View File

@ -141,6 +141,12 @@ int sasprintf(char **strp, const char *fmt, ...);
*/
i3String *i3string_from_utf8(const char *from_utf8);
/**
* Build an i3String from an UTF-8 encoded string in Pango markup.
*
*/
i3String *i3string_from_markup(const char *from_markup);
/**
* Build an i3String from an UTF-8 encoded string with fixed length.
* To be used when no proper NUL-terminaison is available.
@ -149,6 +155,13 @@ i3String *i3string_from_utf8(const char *from_utf8);
*/
i3String *i3string_from_utf8_with_length(const char *from_utf8, size_t num_bytes);
/**
* Build an i3String from an UTF-8 encoded string in Pango markup with fixed
* length.
*
*/
i3String *i3string_from_markup_with_length(const char *from_markup, size_t num_bytes);
/**
* Build an i3String from an UCS-2 encoded string.
* Returns the newly-allocated i3String.
@ -193,6 +206,11 @@ const xcb_char2b_t *i3string_as_ucs2(i3String *str);
*/
size_t i3string_get_num_bytes(i3String *str);
/**
* Whether the given i3String is in Pango markup.
*/
bool i3string_is_markup(i3String *str);
/**
* Returns the number of glyphs in an i3String.
*