From 5438954d8c6213f1b0cc9d23b70ffaae388e1d60 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sat, 18 Dec 2021 22:42:30 +0100 Subject: Generate FL/fl_config.h rather than FL/abi-version.h ... as discussed in fltk.coredev in thread "RFC: introduce public config header ", see: https://groups.google.com/g/fltkcoredev/c/xLCs1AIXMVo/m/MHZpQggzAQAJ - Rename abi-version.h to fl_config.h, rename input files, update dependencies, .gitignore, CMake, configure and Makefiles. - Include Cairo options in FL/fl_config.h - Rename FLTK_USE_CAIRO to FLTK_HAVE_CAIROEXT for consistency. - Include in config.h and wherever necessary, fix include order (move FL/Fl.H to the top) and more. - Move USE_X11 to fl_config.h and rename to FLTK_USE_X11 - Do not include in Cairo demo program which is no longer required in Cairo programs since FLTK 1.4.0 --- cairo/Fl_Cairo.cxx | 14 +++++++------- cairo/makedepend | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'cairo') diff --git a/cairo/Fl_Cairo.cxx b/cairo/Fl_Cairo.cxx index 0ebd04b97..3a5b59f73 100644 --- a/cairo/Fl_Cairo.cxx +++ b/cairo/Fl_Cairo.cxx @@ -24,11 +24,11 @@ // Cairo is currently supported for the following platforms: // Win32, Apple Quartz, X11 -#if defined(USE_X11) // X11 +#if defined(FLTK_USE_X11) // X11 # include -#elif defined(_WIN32) +#elif defined(_WIN32) // Windows # include -#elif defined(__APPLE_QUARTZ__) // PORTME: Cairo Support +#elif defined(__APPLE_QUARTZ__) // macOS # include #else # error Cairo is not supported on this platform. @@ -43,7 +43,7 @@ Fl_Cairo_State Fl::cairo_state_; ///< contains all necessary info for cur // Fl_Cairo_State class impl void Fl_Cairo_State::autolink(bool b) { -#ifdef FLTK_USE_CAIRO +#ifdef FLTK_HAVE_CAIROEXT autolink_ = b; #else Fl::fatal("In Fl::autolink(bool) : Cairo autolink() feature is only " @@ -86,7 +86,7 @@ cairo_t * Fl::cairo_make_current(Fl_Window* wi) { #ifndef __APPLE__ float scale = Fl::screen_scale(wi->screen_num()); // get the screen scaling factor #endif -#if defined(USE_X11) +#if defined(FLTK_USE_X11) cairo_ctxt = Fl::cairo_make_current(0, wi->w() * scale, wi->h() * scale); #else // on macOS, scaling is done before by Fl_Window::make_current(), on Windows, the size is not used @@ -105,7 +105,7 @@ cairo_t * Fl::cairo_make_current(Fl_Window* wi) { */ static cairo_surface_t * cairo_create_surface(void * gc, int W, int H) { -# if defined(USE_X11) +# if defined(FLTK_USE_X11) return cairo_xlib_surface_create(fl_display, fl_window, fl_visual->visual, W, H); # elif defined(_WIN32) return cairo_win32_surface_create((HDC) gc); @@ -123,7 +123,7 @@ static cairo_surface_t * cairo_create_surface(void * gc, int W, int H) { */ cairo_t * Fl::cairo_make_current(void *gc) { int W=0,H=0; -#if defined(USE_X11) +#if defined(FLTK_USE_X11) // FIXME X11 get W,H // gc will be the window handle here // # warning FIXME get W,H for cairo_make_current(void*) diff --git a/cairo/makedepend b/cairo/makedepend index 23089dcd5..7c0ee6703 100644 --- a/cairo/makedepend +++ b/cairo/makedepend @@ -1,12 +1,12 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. Fl_Cairo.o: ../config.h -Fl_Cairo.o: ../FL/abi-version.h Fl_Cairo.o: ../FL/Enumerations.H Fl_Cairo.o: ../FL/Fl.H Fl_Cairo.o: ../FL/Fl_Bitmap.H Fl_Cairo.o: ../FL/Fl_Cairo.H Fl_Cairo.o: ../FL/fl_casts.H +Fl_Cairo.o: ../FL/fl_config.h Fl_Cairo.o: ../FL/Fl_Export.H Fl_Cairo.o: ../FL/Fl_Group.H Fl_Cairo.o: ../FL/Fl_Image.H -- cgit v1.2.3