utils/cairo.h file

Cairo utilities.

Contents

Classes

struct CairoCaches
Caches for cairo.

Typedefs

using CairoCaches = struct CairoCaches
Caches for cairo.

Functions

void _z_cairo_get_text_extents_for_widget(GtkWidget* widget, PangoLayout* layout, const char* text, int* width, int* height)
Gets the width of the given text in pixels for the given widget.
void z_cairo_draw_text_full(cairo_t* cr, GtkWidget* widget, PangoLayout* layout, const char* text, int start_x, int start_y)
Draws the given text using the given font starting at the given position.
static void z_cairo_diamond(cairo_t* cr, double x, double y, double width, double height)
Draws a diamond shape.
auto z_cairo_get_surface_from_icon_name(const char* icon_name, int size, int scale) -> cairo_surface_t*
Returns a surface for the icon name.
auto z_cairo_create_pango_layout(GtkWidget* widget, const char* font, PangoEllipsizeMode ellipsize_mode, int ellipsize_padding) -> PangoLayout*
Creates a PangoLayout to be cached in widgets based on the given settings.
auto z_cairo_create_default_pango_layout(GtkWidget* widget) -> PangoLayout*
Creates a PangoLayout with default settings.

Defines

#define Z_CAIRO_FONT
Default font for drawing pango text.
#define Z_CAIRO_TEXT_PADDING
Padding to leave from the top/left edges when drawing text.
#define z_cairo_draw_text(cr, widget, layout, text)
Draw text with default padding.