diff options
| author | Manolo Gouy <Manolo> | 2016-03-01 17:20:25 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-03-01 17:20:25 +0000 |
| commit | 7decb3d3b226854175b99ff0173ed7136e9f2176 (patch) | |
| tree | 95149f69f1c6a0a8de6acca4bc706ebad21d0566 /FL | |
| parent | 4af165781fbaec69533b6db933e3e46778a81797 (diff) | |
Rewrite the Fl_Copy_Surface class with strict separation of public API and platform-related code.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11257 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Fl_Copy_Surface.H | 42 | ||||
| -rw-r--r-- | FL/mac.H | 1 |
2 files changed, 7 insertions, 36 deletions
diff --git a/FL/Fl_Copy_Surface.H b/FL/Fl_Copy_Surface.H index 292d04577..734335e45 100644 --- a/FL/Fl_Copy_Surface.H +++ b/FL/Fl_Copy_Surface.H @@ -50,27 +50,9 @@ */ class FL_EXPORT Fl_Copy_Surface : public Fl_Widget_Surface { private: - int width; - int height; -#ifdef __APPLE__ // PORTME: Fl_Surface_Driver - platform surface driver - CFMutableDataRef pdfdata; - CGContextRef oldgc; - CGContextRef gc; - void prepare_copy_pdf_and_tiff(int w, int h); - void complete_copy_pdf_and_tiff(); - void init_PDF_context(int w, int h); - static size_t MyPutBytes(void* info, const void* buffer, size_t count); -#elif defined(WIN32) - HDC oldgc; - HDC gc; -#elif defined(FL_PORTING) -# pragma message "FL_PORTING: define variables to hold a native offscreen bitmap in Fl_Copy_Surface" - // no default implementation -#else // Xlib - Fl_Offscreen xid; - Window oldwindow; - Fl_Surface_Device *_ss; -#endif + class Helper; + Helper *platform_surface; + static Helper *newPlatformSurface(int w, int h); protected: void translate(int x, int y); void untranslate(); @@ -79,24 +61,12 @@ public: ~Fl_Copy_Surface(); void set_current(); /** Returns the pixel width of the copy surface */ - int w() { return width; } + int w(); /** Returns the pixel height of the copy surface */ - int h() { return height; } + int h(); + void origin(int *x, int *y); }; -#if defined(__APPLE__) // PORTME: Fl_Surface_Driver - platform surface driver - - -#elif defined(WIN32) - -#elif defined(FL_PORTING) - -# pragma message "FL_PORTING: define a drawing surface for your platform" - -#elif !defined(FL_DOXYGEN) - -#endif - #endif // Fl_Copy_Surface_H // @@ -197,6 +197,7 @@ public: static int dnd(int use_selection); // call Fl_X::dnd(1) to support text dragging static int calc_mac_os_version(void); // computes the fl_mac_os_version global variable static void clip_to_rounded_corners(CGContextRef gc, int w, int h); + static void complete_copy_pdf_and_tiff(CGContextRef gc, CFMutableDataRef pdfdata); private: CGRect* subRect_; // makes sure subwindow remains inside its parent window // stores 3 binary flags: whether window is mapped to retina display; whether resolution just changed; |
