Implement set_font_colors.

This paves the way for other font rendering backends. Fonts and
colors shouldn't be specified manually from now on.
This commit is contained in:
Fernando Tarlá Cardoso Lemos
2011-11-14 20:20:18 -02:00
committed by Michael Stapelberg
parent eafc7af606
commit 344c04af12
8 changed files with 63 additions and 68 deletions

View File

@ -209,14 +209,20 @@ xcb_char2b_t *convert_utf8_to_ucs2(char *input, int *real_strlen);
*/
void set_font(i3Font *font);
/**
* Defines the colors to be used for the forthcoming draw_text calls.
*
*/
void set_font_colors(xcb_gcontext_t gc, uint32_t foreground, uint32_t background);
/**
* Draws text onto the specified X drawable (normally a pixmap) at the
* specified coordinates (from the top left corner of the leftmost, uppermost
* glyph) and using the provided gc. Text can be specified as UCS-2 or UTF-8.
*
*/
void draw_text(char *text, size_t text_len, bool is_ucs2,
xcb_drawable_t drawable, xcb_gcontext_t gc, int x, int y);
void draw_text(char *text, size_t text_len, bool is_ucs2, xcb_drawable_t drawable,
xcb_gcontext_t gc, int x, int y, int max_width);
/**
* Predict the text width in pixels for the given text. Text can be specified