+#define wxCAIRO_METHOD_TYPE(name) \
+ wxCairo##name##_t
+
+#define wxCAIRO_STATIC_METHOD_DEFINE(rettype, name, args, argnames, defret) \
+ static wxCAIRO_METHOD_TYPE(name) name;
+
+#define wxCAIRO_STATIC_VOIDMETHOD_DEFINE(name, args, argnames) \
+ wxCAIRO_STATIC_METHOD_DEFINE(void, name, args, argnames, NULL)
+
+#define wxFOR_ALL_CAIRO_VOIDMETHODS(m) \
+ m( cairo_append_path, \
+ (cairo_t *cr, const cairo_path_t *path), (cr, path) ) \
+ m( cairo_arc, \
+ (cairo_t *cr, double xc, double yc, double radius, double angle1, double angle2), (cr, xc, yc, radius, angle1, angle2) ) \
+ m( cairo_arc_negative, \
+ (cairo_t *cr, double xc, double yc, double radius, double angle1, double angle2), (cr, xc, yc, radius, angle1, angle2) ) \
+ m( cairo_clip, \
+ (cairo_t *cr), (cr) ) \
+ m( cairo_close_path, \
+ (cairo_t *cr), (cr) ) \
+ m( cairo_curve_to, \
+ (cairo_t *cr, double x1, double y1, double x2, double y2, double x3, double y3), (cr, x1, y1, x2, y2, x3, y3) ) \
+ m( cairo_destroy, \
+ (cairo_t *cr), (cr) ) \
+ m( cairo_fill, \
+ (cairo_t *cr), (cr) ) \
+ m( cairo_fill_preserve, \
+ (cairo_t *cr), (cr) ) \
+ m( cairo_font_extents, \
+ (cairo_t *cr, cairo_font_extents_t *extents), (cr, extents) ) \
+ m( cairo_font_face_destroy, \
+ (cairo_font_face_t *font_face), (font_face) ) \
+ m( cairo_get_current_point, \
+ (cairo_t *cr, double *x, double *y), (cr, x, y) ) \
+ m( cairo_get_matrix, \
+ (cairo_t *cr, cairo_matrix_t *matrix), (cr, matrix) ) \
+ m( cairo_line_to, \
+ (cairo_t *cr, double x, double y), (cr, x, y) ) \
+ m( cairo_matrix_init, \
+ (cairo_matrix_t *matrix, double xx, double yx, double xy, double yy, double x0, double y0), (matrix, xx, yx, xy, yy, x0, y0) ) \
+ m( cairo_matrix_multiply, \
+ (cairo_matrix_t *result, const cairo_matrix_t *a, const cairo_matrix_t *b), (result, a, b) ) \
+ m( cairo_matrix_rotate, \
+ (cairo_matrix_t *matrix, double radians), (matrix, radians) ) \
+ m( cairo_matrix_scale, \
+ (cairo_matrix_t *matrix, double sx, double sy), (matrix, sx, sy) ) \
+ m( cairo_matrix_transform_distance, \
+ (const cairo_matrix_t *matrix, double *dx, double *dy), (matrix, dx, dy) ) \
+ m( cairo_matrix_transform_point, \
+ (const cairo_matrix_t *matrix, double *x, double *y), (matrix, x, y) ) \
+ m( cairo_matrix_translate, \
+ (cairo_matrix_t *matrix, double tx, double ty), (matrix, tx, ty) ) \
+ m( cairo_move_to, \
+ (cairo_t *cr, double x, double y), (cr, x, y) ) \
+ m( cairo_new_path, \
+ (cairo_t *cr), (cr) ) \
+ m( cairo_paint, \
+ (cairo_t *cr), (cr) ) \
+ m( cairo_paint_with_alpha, \
+ (cairo_t *cr, double alpha), (cr, alpha) ) \
+ m( cairo_path_destroy, \
+ (cairo_path_t *path), (path) ) \
+ m( cairo_pattern_add_color_stop_rgba, \
+ (cairo_pattern_t *pattern, double offset, double red, double green, double blue, double alpha), (pattern, offset, red, green, blue, alpha) ) \
+ m( cairo_pattern_destroy, \
+ (cairo_pattern_t *pattern), (pattern) ) \
+ m( cairo_pattern_set_extend, \
+ (cairo_pattern_t *pattern, cairo_extend_t extend), (pattern, extend) ) \
+ m( cairo_pattern_set_filter, \
+ (cairo_pattern_t *pattern, cairo_filter_t filter), (pattern, filter) ) \
+ m( cairo_pop_group_to_source, \
+ (cairo_t *cr), (cr) ) \
+ m( cairo_push_group, \
+ (cairo_t *cr), (cr) ) \
+ m( cairo_rectangle, \
+ (cairo_t *cr, double x, double y, double width, double height), (cr, x, y, width, height) ) \
+ m( cairo_reset_clip, \
+ (cairo_t *cr), (cr) ) \
+ m( cairo_restore, \
+ (cairo_t *cr), (cr) ) \
+ m( cairo_rotate, \
+ (cairo_t *cr, double angle), (cr, angle) ) \
+ m( cairo_save, \
+ (cairo_t *cr), (cr) ) \
+ m( cairo_scale, \
+ (cairo_t *cr, double sx, double sy), (cr, sx, sy) ) \
+ m( cairo_select_font_face, \
+ (cairo_t *cr, const char *family, cairo_font_slant_t slant, cairo_font_weight_t weight), (cr, family, slant, weight) ) \
+ m( cairo_set_antialias, \
+ (cairo_t *cr, cairo_antialias_t antialias), (cr, antialias) ) \
+ m( cairo_set_dash, \
+ (cairo_t *cr, const double *dashes, int num_dashes, double offset), (cr, dashes, num_dashes, offset) ) \
+ m( cairo_set_fill_rule, \
+ (cairo_t *cr, cairo_fill_rule_t fill_rule), (cr, fill_rule) ) \
+ m( cairo_set_font_face, \
+ (cairo_t *cr, cairo_font_face_t *font_face), (cr, font_face) ) \
+ m( cairo_set_font_size, \
+ (cairo_t *cr, double size), (cr, size) ) \
+ m( cairo_set_line_cap, \
+ (cairo_t *cr, cairo_line_cap_t line_cap), (cr, line_cap) ) \
+ m( cairo_set_line_join, \
+ (cairo_t *cr, cairo_line_join_t line_join), (cr, line_join) ) \
+ m( cairo_set_line_width, \
+ (cairo_t *cr, double width), (cr, width) ) \
+ m( cairo_set_matrix, \
+ (cairo_t *cr, const cairo_matrix_t *matrix), (cr, matrix) ) \
+ m( cairo_set_operator, \
+ (cairo_t *cr, cairo_operator_t op), (cr, op) ) \
+ m( cairo_set_source, \
+ (cairo_t *cr, cairo_pattern_t *source), (cr, source) ) \
+ m( cairo_set_source_rgba, \
+ (cairo_t *cr, double red, double green, double blue, double alpha), (cr, red, green, blue, alpha) ) \
+ m( cairo_show_text, \
+ (cairo_t *cr, const char *utf8), (cr, utf8) ) \
+ m( cairo_stroke, \
+ (cairo_t *cr), (cr) ) \
+ m( cairo_stroke_extents, \
+ (cairo_t *cr, double *x1, double *y1, double *x2, double *y2), (cr, x1, y1, x2, y2) ) \
+ m( cairo_stroke_preserve, \
+ (cairo_t *cr), (cr) ) \
+ m( cairo_surface_destroy, \
+ (cairo_surface_t *surface), (surface) ) \
+ m( cairo_text_extents, \
+ (cairo_t *cr, const char *utf8, cairo_text_extents_t *extents), (cr, utf8, extents) ) \
+ m( cairo_transform, \
+ (cairo_t *cr, const cairo_matrix_t *matrix), (cr, matrix) ) \
+ m( cairo_translate, \
+ (cairo_t *cr, double tx, double ty), (cr, tx, ty) ) \
+
+#ifdef __WXMAC__
+#define wxCAIRO_PLATFORM_METHODS(m) \
+ m( cairo_font_face_t*, cairo_quartz_font_face_create_for_cgfont, \
+ (CGFontRef font), (font), NULL ) \
+ m( cairo_surface_t*, cairo_quartz_surface_create_for_cg_context, \
+ (CGContextRef cgContext, unsigned int width, unsigned int height), (cgContext, width, height), NULL )
+#elif defined(__WXMSW__)
+#define wxCAIRO_PLATFORM_METHODS(m) \
+ m( cairo_surface_t*, cairo_win32_surface_create, \
+ (HDC hdc), (hdc), NULL ) \
+ m( cairo_surface_t*, cairo_win32_printing_surface_create, \
+ (HDC hdc), (hdc), NULL )
+#else
+#define wxCAIRO_PLATFORM_METHODS(m)
+#endif
+
+#define wxFOR_ALL_CAIRO_METHODS(m) \
+ m( cairo_path_t*, cairo_copy_path, \
+ (cairo_t *cr), (cr), NULL ) \
+ m( cairo_t*, cairo_create, \
+ (cairo_surface_t *target), (target), NULL) \
+ m( cairo_surface_t*, cairo_get_target, \
+ (cairo_t *cr), (cr), NULL) \
+ m( cairo_surface_t*, cairo_image_surface_create, \
+ (cairo_format_t format, int width, int height), (format, width, height), NULL ) \
+ m( cairo_surface_t*, cairo_image_surface_create_for_data, \
+ (unsigned char *data, cairo_format_t format, int width, int height, int stride), (data, format, width, height, stride), NULL) \
+ m( cairo_bool_t, cairo_in_fill, \
+ (cairo_t *cr, double x, double y), (cr, x, y), false ) \
+ m( cairo_status_t, cairo_matrix_invert, \
+ (cairo_matrix_t *matrix), (matrix), NULL) \
+ m( cairo_pattern_t*, cairo_pattern_create_for_surface, \
+ (cairo_surface_t *surface), (surface), NULL) \
+ m( cairo_pattern_t*, cairo_pattern_create_linear, \
+ (double x0, double y0, double x1, double y1), (x0, y0, x1, y1), NULL) \
+ m( cairo_pattern_t*, cairo_pattern_create_radial, \
+ (double cx0, double cy0, double radius0, double cx1, double cy1, double radius1), (cx0, cy0, radius0, cx1, cy1, radius1), NULL) \
+ m( cairo_status_t, cairo_pattern_status, \
+ (cairo_pattern_t *pattern), (pattern), 4) \
+ m( cairo_t*, cairo_reference, \
+ (cairo_t *cr), (cr), NULL ) \
+ m( cairo_surface_t*, cairo_surface_create_similar, \
+ (cairo_surface_t *other, cairo_content_t content, int width, int height), (other, content, width, height), NULL) \
+ wxCAIRO_PLATFORM_METHODS(m)
+
+#if wxUSE_PANGO
+#define wxFOR_ALL_PANGO_CAIRO_VOIDMETHODS(m) \
+ m( pango_cairo_update_layout, \
+ (cairo_t *cr, PangoLayout *layout), (cr, layout) ) \
+ m( pango_cairo_show_layout, \
+ (cairo_t *cr, PangoLayout *layout), (cr, layout) )
+#endif