Back to index

plt-scheme  4.2.1
wx_cairo.h
Go to the documentation of this file.
00001 #ifdef WX_USE_CAIRO
00002 extern "C" {
00003 # include <cairo.h>
00004 # ifndef WX_CAIRO_NO_XLIBH
00005 #  include <cairo-xlib.h>
00006 # endif
00007 };
00008 
00009 /* Check API version: */
00010 # ifdef cairo_set_rgb_color
00011   /* New Cairo API (0.5 and up) */
00012 typedef cairo_matrix_t cairo_matrix_p;
00013 #  undef cairo_set_rgb_color
00014 #  define cairo_set_rgb_color(d, r, g, b) cairo_set_source_rgb(d, r, g, b)
00015 #  define cairo_set_matrix_create(m) /* no op */
00016 #  undef cairo_current_matrix
00017 #  define cairo_current_matrix(d, m) cairo_get_matrix(d, &(m))
00018 #  undef cairo_matrix_destroy
00019 #  define cairo_matrix_destroy(m) /* no op */
00020 #  define cairo__set_matrix(CAIRO_DEV, m) cairo_set_matrix(CAIRO_DEV, &(m))
00021 #  define cairo_set_create_xlib(dev, display, drawable, vis, w, h) \
00022           dev = cairo_create(cairo_xlib_surface_create(wxAPP_DISPLAY, DRAWABLE, vis, w, h))
00023 #  undef cairo_default_matrix
00024 #  define cairo_default_matrix(dev) cairo_identity_matrix(dev)
00025 #  undef cairo_init_clip
00026 #  define cairo_init_clip(dev) cairo_reset_clip(dev)
00027 #  define cairo_destroy_it(c) (cairo_surface_destroy(cairo_get_target(c)), cairo_destroy(c))
00028 # else
00029   /* Old Cairo API (0.5 and up) */
00030 typedef cairo_matrix_t *cairo_matrix_p;
00031 #  define cairo_set_matrix_create(m) { cairo_matrix_t *__m; __m = cairo_matrix_create(); m = __m; }
00032 #  define cairo__set_matrix(CAIRO_DEV, m) cairo_set_matrix(CAIRO_DEV, m)
00033 #  define cairo_set_create_xlib(dev, display, drawable, vis, w, h) \
00034           dev = cairo_create(); cairo_set_target_drawable(dev, wxAPP_DISPLAY, DRAWABLE)
00035 #  define cairo_destroy_it(c) cairo_destroy(c)
00036 # endif
00037 #endif