#define FFI_LIB "libcairo.so.2" #define FFI_SCOPE "cairo" typedef struct _cairo cairo_t; typedef struct _cairo_surface cairo_surface_t; typedef int cairo_format_t; typedef int cairo_font_slant_t; typedef int cairo_font_weight_t; // Context cairo_t *cairo_create(cairo_surface_t *target); void cairo_set_source_rgba(cairo_t *cr, double red, double green, double blue, double alpha); // Drawing void cairo_move_to(cairo_t *cr, double x, double y); void cairo_stroke(cairo_t *cr); void cairo_fill(cairo_t *cr); void cairo_rectangle(cairo_t *cr, double x, double y, double width, double height); // Surface cairo_surface_t *cairo_image_surface_create (cairo_format_t format, int width, int height); cairo_surface_t *cairo_image_surface_create_for_data (unsigned char *data, cairo_format_t format, int width, int height, int stride); int cairo_format_stride_for_width (cairo_format_t format, int width); void cairo_surface_flush (cairo_surface_t *surface); // Text void cairo_show_text (cairo_t *cr, const char *utf8); void cairo_select_font_face (cairo_t *cr, const char *family, cairo_font_slant_t slant, cairo_font_weight_t weight); void cairo_set_font_size (cairo_t *cr, double size);