From 8630bdbed221afa4a20a6a4fe8d354ccab877fcf Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sat, 13 Feb 2016 18:02:17 +0000 Subject: [Cairo] Remove part of the dependency of FL/Fl.H on config.h. To use Fl_Cairo_Window one did not only need to configure with --enable-cairo, but also needed to #include before #include . This commit removes the smaller part of the dependency of the public header file FL/Fl.H on config.h. This needs a better solution in FLTK 1.4.0. The user still needs to define FLTK_HAVE_CAIRO _before_ #include . Note: This is not compatible with fluid, since fluid _always_ includes FL/Fl.H as the first statement in generated header files. See also the discussion in fltk.general: https://groups.google.com/d/msg/fltkgeneral/_C1OJhMLQl0/pHUFtz9SCwAJ Note: also fixed a typo in src/drivers/X11/Fl_X11_Screen_Driver.cxx git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11168 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl_Cairo.H | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'FL/Fl_Cairo.H') diff --git a/FL/Fl_Cairo.H b/FL/Fl_Cairo.H index 10e68392a..1994f0e5e 100644 --- a/FL/Fl_Cairo.H +++ b/FL/Fl_Cairo.H @@ -3,7 +3,7 @@ // // Main header file for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2010 by Bill Spitzak and others. +// Copyright 1998-2016 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -29,17 +29,7 @@ # include -#if defined(USE_X11) // X11 -# include -#elif defined(WIN32) -# include -#elif defined(__APPLE_QUARTZ__) // PORTME: Cairo Support -# include -#elif defined(FL_PORTING) -# pragma message "FL_PORTING: is the Cairo library available on this platform?" -#else -# error Cairo is not supported on that platform. -#endif +# include /** \addtogroup group_cairo @@ -60,9 +50,16 @@ public: // access attributes cairo_t* cc() const {return cc_;} ///< Gets the current cairo context bool autolink() const {return autolink_;} ///< Gets the autolink option. See Fl::cairo_autolink_context(bool) - /** Sets the current cairo context, \p own indicates cc deletion is handle externally by user */ - void cc(cairo_t* c, bool own=true) { - if (cc_ && own_cc_) cairo_destroy(cc_); + /** Sets the current cairo context. + + \p own == \e true (the default) indicates that the cairo context \p c + will be deleted by FLTK internally when another cc is set later. + + \p own == \e false indicates cc deletion is handled externally + by the user program. + */ + void cc(cairo_t* c, bool own=true) { + if (cc_ && own_cc_) cairo_destroy(cc_); cc_=c; if (!cc_) window_=0; own_cc_=own; @@ -76,7 +73,8 @@ public: private: cairo_t * cc_; // contains the unique autoupdated cairo context bool own_cc_; // indicates whether we must delete the cc, useful for internal cleanup - bool autolink_; // true by default, permits to prevent the automatic cairo mapping on fltk windows for custom cairo implementations + bool autolink_; // false by default, prevents the automatic cairo mapping on fltk windows + // for custom cairo implementations. void* window_, *gc_; // for keeping track internally of last win+gc treated }; -- cgit v1.2.3