From f936eb1a962d9578befff4d4cdeac64339644594 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sat, 19 Mar 2016 18:14:58 +0000 Subject: Driver-based rewrite of the Fl_Copy_Surface class. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11374 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Copy_Surface.cxx | 41 +++++++++-------------------------------- 1 file changed, 9 insertions(+), 32 deletions(-) (limited to 'src/Fl_Copy_Surface.cxx') diff --git a/src/Fl_Copy_Surface.cxx b/src/Fl_Copy_Surface.cxx index 204f1d7f3..7e07928ab 100644 --- a/src/Fl_Copy_Surface.cxx +++ b/src/Fl_Copy_Surface.cxx @@ -16,44 +16,21 @@ // http://www.fltk.org/str.php // -#include "config_lib.h" #include -#ifdef FL_CFG_GFX_QUARTZ -#include +#if defined(FL_PORTING) +# pragma message "FL_PORTING: implement class Fl_XXX_Copy_Surface_Driver for your platform" -#elif defined(FL_CFG_GFX_GDI) -#include - -#elif defined(USE_SDL) -#include - -#elif defined(FL_PORTING) || defined(USE_SDL) -# pragma message "FL_PORTING: implement class Fl_Copy_Surface::Helper for your platform" - -class Fl_Copy_Surface::Helper : public Fl_Widget_Surface { // class model - friend class Fl_Copy_Surface; -private: - int width; - int height; - Helper(int w, int h) : Fl_Widget_Surface(NULL), width(w), height(h) {} // to implement - ~Helper() {} // to implement - void set_current(){} // to implement - void translate(int x, int y) {} // to implement - void untranslate() {} // to implement - int w() {return width;} - int h() {return height;} - int printable_rect(int *w, int *h) {*w = width; *h = height; return 0;} -}; - -#elif defined(FL_CFG_GFX_XLIB) -#include +Fl_Copy_Surface_Driver *Fl_Copy_Surface_Driver::newCopySurfaceDriver(int w, int h) +{ + return NULL; +} #endif /** the constructor */ Fl_Copy_Surface::Fl_Copy_Surface(int w, int h) : Fl_Widget_Surface(NULL) { - platform_surface = new Helper(w, h); + platform_surface = Fl_Copy_Surface_Driver::newCopySurfaceDriver(w, h); driver(platform_surface->driver()); } @@ -69,9 +46,9 @@ void Fl_Copy_Surface::translate(int x, int y) {platform_surface->translate(x, y) void Fl_Copy_Surface::untranslate() {platform_surface->untranslate();} -int Fl_Copy_Surface::w() {return platform_surface->w();} +int Fl_Copy_Surface::w() {return platform_surface->width;} -int Fl_Copy_Surface::h() {return platform_surface->h();} +int Fl_Copy_Surface::h() {return platform_surface->height;} int Fl_Copy_Surface::printable_rect(int *w, int *h) {return platform_surface->printable_rect(w, h);} -- cgit v1.2.3