25 # ifdef FLTK_HAVE_CAIRO
30 # include <FL/Fl_Export.H>
32 # if defined(USE_X11) // X11
33 # include <cairo-xlib.h>
35 # include <cairo-win32.h>
36 # elif defined(__APPLE_QUARTZ__)
37 # include <cairo-quartz.h>
39 # error Cairo is not supported on that platform.
56 Fl_Cairo_State() : cc_(0), own_cc_(
false), autolink_(
false), window_(0), gc_(0) {}
59 cairo_t*
cc()
const {
return cc_;}
62 void cc(cairo_t* c,
bool own=
true) {
63 if (cc_ && own_cc_) cairo_destroy(cc_);
68 void autolink(
bool b);
70 void*
window()
const {
return window_;}
71 void gc(
void* c) {gc_=c;}
72 void*
gc()
const {
return gc_;}
83 # endif // FLTK_HAVE_CAIRO
void window(void *w)
Sets the window w to keep track on.
Definition: Fl_Cairo.H:69
bool autolink() const
Gets the autolink option. See Fl::cairo_autolink_context(bool)
Definition: Fl_Cairo.H:60
void * gc() const
Gets the last gc attached to a cc.
Definition: Fl_Cairo.H:72
void * window() const
Gets the last window attached to a cc.
Definition: Fl_Cairo.H:70
void gc(void *c)
Sets the gc c to keep track on.
Definition: Fl_Cairo.H:71
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:62
Contains all the necessary info on the current cairo context.
Definition: Fl_Cairo.H:54
cairo_t * cc() const
Gets the current cairo context.
Definition: Fl_Cairo.H:59