34 # ifdef FLTK_HAVE_CAIRO
39 # include <FL/Fl_Export.H>
41 # if defined(USE_X11) // X11
42 # include <cairo-xlib.h>
44 # include <cairo-win32.h>
45 # elif defined(__APPLE_QUARTZ__)
46 # include <cairo-quartz.h>
48 # error Cairo is not supported on that platform.
65 Fl_Cairo_State() : cc_(0), own_cc_(
false), autolink_(
false), window_(0), gc_(0) {}
68 cairo_t*
cc()
const {
return cc_;}
71 void cc(cairo_t* c,
bool own=
true) {
72 if (cc_ && own_cc_) cairo_destroy(cc_);
77 void autolink(
bool b);
79 void*
window()
const {
return window_;}
80 void gc(
void* c) {gc_=c;}
81 void*
gc()
const {
return gc_;}
92 # endif // FLTK_HAVE_CAIRO
void window(void *w)
Sets the window w to keep track on.
Definition: Fl_Cairo.H:78
bool autolink() const
Gets the autolink option. See Fl::cairo_autolink_context(bool)
Definition: Fl_Cairo.H:69
void * gc() const
Gets the last gc attached to a cc.
Definition: Fl_Cairo.H:81
void * window() const
Gets the last window attached to a cc.
Definition: Fl_Cairo.H:79
void gc(void *c)
Sets the gc c to keep track on.
Definition: Fl_Cairo.H:80
void cc(cairo_t *c, bool own=true)
Sets the current cairo context, own indicates cc deletion is handle externally by user...
Definition: Fl_Cairo.H:71
Contains all the necessary info on the current cairo context.
Definition: Fl_Cairo.H:63
cairo_t * cc() const
Gets the current cairo context.
Definition: Fl_Cairo.H:68