void cairo_set_source_color(surface_t *surface, color_t color) {
cairo_set_source_rgba(surface->cr, color.red, color.green, color.blue, color.alpha);
}
+
+/**
+ * Draw the given text using libi3.
+ * This function also marks the surface dirty which is needed if other means of
+ * drawing are used. This will be the case when using XCB to draw text.
+ *
+ */
+void cairo_draw_text(i3String *text, surface_t *surface, color_t fg_color, color_t bg_color, int x, int y, int max_width) {
+ set_font_colors(surface->gc, fg_color.colorpixel, bg_color.colorpixel);
+ draw_text(text, surface->id, surface->gc, visual_type, x, y, max_width);
+
+ cairo_surface_mark_dirty(surface->surface);
+}