Finalize new implementation of Fl_Copy_Surface.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11267 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2016-03-02 12:36:37 +00:00
parent df94673b61
commit 39fdbecd16
8 changed files with 19 additions and 15 deletions

View File

@ -63,6 +63,8 @@ public:
/** Returns the pixel height of the copy surface */
int h();
void origin(int *x, int *y);
void origin(int x, int y);
int printable_rect(int *w, int *h);
};
#endif // Fl_Copy_Surface_H

View File

@ -28,18 +28,19 @@
#elif defined(FL_PORTING) && !defined(FL_DOXYGEN)
# pragma message "FL_PORTING: implement class Fl_Copy_Surface::Helper for your platform"
class Fl_Copy_Surface::Helper : public Fl_Widget_Surface { // model
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) {}
~Helper() {}
void set_current(){}
void translate(int x, int y) {}
void untranslate() {}
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;}
};
#else
@ -59,6 +60,8 @@ Fl_Copy_Surface::Fl_Copy_Surface(int w, int h) : Fl_Widget_Surface(NULL) {
Fl_Copy_Surface::~Fl_Copy_Surface() { delete platform_surface; }
void Fl_Copy_Surface::origin(int x, int y) {platform_surface->origin(x, y);}
void Fl_Copy_Surface::origin(int *x, int *y) {platform_surface->origin(x, y);}
void Fl_Copy_Surface::set_current() {platform_surface->set_current();}
@ -71,6 +74,8 @@ int Fl_Copy_Surface::w() {return platform_surface->w();}
int Fl_Copy_Surface::h() {return platform_surface->h();}
int Fl_Copy_Surface::printable_rect(int *w, int *h) {return platform_surface->printable_rect(w, h);}
//
// End of "$Id$".
//

View File

@ -37,6 +37,7 @@ private:
void untranslate();
int w() {return width;}
int h() {return height;}
int printable_rect(int *w, int *h) {*w = width; *h = height; return 0;}
};
#endif /* Fl_GDI_Copy_Surface_h */

View File

@ -18,9 +18,7 @@
#include "Fl_GDI_Copy_Surface.H"
Fl_Copy_Surface::Helper::Helper(int w, int h) : Fl_Widget_Surface(NULL) {
width = w;
height = h;
Fl_Copy_Surface::Helper::Helper(int w, int h) : Fl_Widget_Surface(NULL), width(w), height(h) {
driver(new Fl_Translated_GDI_Graphics_Driver);
oldgc = (HDC)Fl_Surface_Device::surface()->driver()->gc();
// exact computation of factor from screen units to EnhMetaFile units (0.01 mm)

View File

@ -40,6 +40,7 @@ private:
void untranslate();
int w() {return width;}
int h() {return height;}
int printable_rect(int *w, int *h) {*w = width; *h = height; return 0;}
};
#endif // FL_QUARTZ_COPY_SURFACE_H

View File

@ -23,9 +23,7 @@
#include "Fl_Quartz_Graphics_Driver.H"
#endif
Fl_Copy_Surface::Helper::Helper(int w, int h) : Fl_Widget_Surface(NULL) {
width = w;
height = h;
Fl_Copy_Surface::Helper::Helper(int w, int h) : Fl_Widget_Surface(NULL), width(w), height(h) {
driver(new Fl_Quartz_Graphics_Driver);
prepare_copy_pdf_and_tiff(w, h);
}

View File

@ -39,6 +39,7 @@ private:
void untranslate();
int w() {return width;}
int h() {return height;}
int printable_rect(int *w, int *h) {*w = width; *h = height; return 0;}
};
#endif /* Fl_Xlib_Copy_Surface_h */

View File

@ -20,9 +20,7 @@
#include <FL/Fl.H>
#include <FL/fl_draw.H>
Fl_Copy_Surface::Helper::Helper(int w, int h) : Fl_Widget_Surface(NULL) {
width = w;
height = h;
Fl_Copy_Surface::Helper::Helper(int w, int h) : Fl_Widget_Surface(NULL), width(w), height(h) {
driver(new Fl_Translated_Xlib_Graphics_Driver());
Fl::first_window()->make_current();
oldwindow = fl_xid(Fl::first_window());