From b549cfaaea11ce5e881e2151a838c91a031ad9ba Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Sun, 13 Mar 2022 08:56:23 +0100 Subject: Separate platform init functions from platform-specific driver files --- src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.H | 1 + .../Quartz/Fl_Quartz_Copy_Surface_Driver.cxx | 15 ---------- src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx | 8 ----- .../Quartz/Fl_Quartz_Image_Surface_Driver.H | 35 ++++++++++++++++++++++ .../Quartz/Fl_Quartz_Image_Surface_Driver.cxx | 32 +------------------- 5 files changed, 37 insertions(+), 54 deletions(-) create mode 100644 src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.H (limited to 'src/drivers/Quartz') diff --git a/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.H b/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.H index 6aab63978..14d469dbe 100644 --- a/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.H +++ b/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.H @@ -20,6 +20,7 @@ #define Fl_Quartz_Copy_Surface_Driver_H #include +#include class Fl_Quartz_Copy_Surface_Driver : public Fl_Copy_Surface_Driver { friend class Fl_Copy_Surface_Driver; diff --git a/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx index 401fd1daf..3ededb5ab 100644 --- a/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx @@ -20,21 +20,6 @@ #include "Fl_Quartz_Copy_Surface_Driver.H" #include "../Cocoa/Fl_Cocoa_Window_Driver.H" -/** - \cond DriverDev - \addtogroup DriverDeveloper - \{ - */ - -Fl_Copy_Surface_Driver *Fl_Copy_Surface_Driver::newCopySurfaceDriver(int w, int h) -{ - return new Fl_Quartz_Copy_Surface_Driver(w, h); -} - -/** - \} - \endcond - */ Fl_Quartz_Copy_Surface_Driver::Fl_Quartz_Copy_Surface_Driver(int w, int h) : Fl_Copy_Surface_Driver(w, h) { driver(new Fl_Quartz_Printer_Graphics_Driver); diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx index 85872f9ed..ee9542c21 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx @@ -43,14 +43,6 @@ void Fl_Quartz_Graphics_Driver::init_CoreText_or_ATSU() } #endif -/* - * By linking this module, the following static method will instantiate the - * OS X Quartz Graphics driver as the main display driver. - */ -Fl_Graphics_Driver *Fl_Graphics_Driver::newMainGraphicsDriver() -{ - return new Fl_Quartz_Graphics_Driver(); -} void Fl_Quartz_Graphics_Driver::antialias(int state) { } diff --git a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.H b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.H new file mode 100644 index 000000000..4e6f8c79d --- /dev/null +++ b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.H @@ -0,0 +1,35 @@ +// +// Draw-to-image code for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2021 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 +// file is missing or damaged, see the license at: +// +// https://www.fltk.org/COPYING.php +// +// Please see the following page on how to report bugs and issues: +// +// https://www.fltk.org/bugs.php +// + +#ifndef FL_QUARTZ_IMAGE_SURFACE_DRIVER_H +#define FL_QUARTZ_IMAGE_SURFACE_DRIVER_H + +#include +#include + +class Fl_Quartz_Image_Surface_Driver : public Fl_Image_Surface_Driver { + virtual void end_current(); +public: + Window pre_window; + Fl_Quartz_Image_Surface_Driver(int w, int h, int high_res, Fl_Offscreen off); + ~Fl_Quartz_Image_Surface_Driver(); + void set_current(); + void translate(int x, int y); + void untranslate(); + Fl_RGB_Image *image(); +}; + +#endif // FL_QUARTZ_IMAGE_SURFACE_DRIVER_H diff --git a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx index 388d2d246..ff18c2626 100644 --- a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx @@ -16,41 +16,11 @@ #include #include -#include +#include "Fl_Quartz_Image_Surface_Driver.H" #include "Fl_Quartz_Graphics_Driver.H" #include "../Cocoa/Fl_Cocoa_Window_Driver.H" #include -class Fl_Quartz_Image_Surface_Driver : public Fl_Image_Surface_Driver { - virtual void end_current(); -public: - Window pre_window; - Fl_Quartz_Image_Surface_Driver(int w, int h, int high_res, Fl_Offscreen off); - ~Fl_Quartz_Image_Surface_Driver(); - void set_current(); - void translate(int x, int y); - void untranslate(); - Fl_RGB_Image *image(); -}; - - -/** - \cond DriverDev - \addtogroup DriverDeveloper - \{ - */ - -Fl_Image_Surface_Driver *Fl_Image_Surface_Driver::newImageSurfaceDriver(int w, int h, int high_res, Fl_Offscreen off) -{ - return new Fl_Quartz_Image_Surface_Driver(w, h, high_res, off); -} - -/** - \} - \endcond - */ - - Fl_Quartz_Image_Surface_Driver::Fl_Quartz_Image_Surface_Driver(int w, int h, int high_res, Fl_Offscreen off) : Fl_Image_Surface_Driver(w, h, high_res, off) { int W = w, H = h; -- cgit v1.2.3