summaryrefslogtreecommitdiff
path: root/src/Fl_Copy_Surface.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Fl_Copy_Surface.cxx')
-rw-r--r--src/Fl_Copy_Surface.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/Fl_Copy_Surface.cxx b/src/Fl_Copy_Surface.cxx
index b1cc00b8b..c91695883 100644
--- a/src/Fl_Copy_Surface.cxx
+++ b/src/Fl_Copy_Surface.cxx
@@ -49,15 +49,15 @@ Fl_GDI_Surface_::~Fl_GDI_Surface_() {
}
void Fl_GDI_Surface_::translate(int x, int y) {
- GetWindowOrgEx(fl_gc, origins+depth);
- SetWindowOrgEx(fl_gc, origins[depth].x - x, origins[depth].y - y, NULL);
+ GetWindowOrgEx((HDC)driver()->get_gc(), origins+depth);
+ SetWindowOrgEx((HDC)driver()->get_gc(), origins[depth].x - x, origins[depth].y - y, NULL);
if (depth < sizeof(origins)/sizeof(POINT)) depth++;
else Fl::warning("Fl_GDI_Surface_: translate stack overflow!");
}
void Fl_GDI_Surface_::untranslate() {
if (depth > 0) depth--;
- SetWindowOrgEx(fl_gc, origins[depth].x, origins[depth].y, NULL);
+ SetWindowOrgEx((HDC)driver()->get_gc(), origins[depth].x, origins[depth].y, NULL);
}
const char *Fl_GDI_Surface_::class_id = "Fl_GDI_Surface_";
@@ -79,11 +79,10 @@ Fl_Copy_Surface::Fl_Copy_Surface(int w, int h) : Fl_Surface_Device(NULL)
helper = new Fl_Quartz_Surface_(width, height);
driver(helper->driver());
prepare_copy_pdf_and_tiff(w, h);
- oldgc = fl_gc;
#elif defined(WIN32)
helper = new Fl_GDI_Surface_();
driver(helper->driver());
- oldgc = fl_gc;
+ oldgc = (HDC)Fl_Surface_Device::surface()->driver()->get_gc();
// exact computation of factor from screen units to EnhMetaFile units (0.01 mm)
HDC hdc = GetDC(NULL);
int hmm = GetDeviceCaps(hdc, HORZSIZE);
@@ -122,10 +121,9 @@ Fl_Copy_Surface::~Fl_Copy_Surface()
{
#ifdef __APPLE__ // PORTME: Fl_Surface_Driver - platform copy surface
complete_copy_pdf_and_tiff();
- fl_gc = oldgc;
delete (Fl_Quartz_Surface_*)helper;
#elif defined(WIN32)
- if(oldgc == fl_gc) oldgc = NULL;
+ if (oldgc == (HDC)Fl_Surface_Device::surface()->driver()->get_gc()) oldgc = NULL;
HENHMETAFILE hmf = CloseEnhMetaFile (gc);
if ( hmf != NULL ) {
if ( OpenClipboard (NULL) ){
@@ -136,7 +134,7 @@ Fl_Copy_Surface::~Fl_Copy_Surface()
DeleteEnhMetaFile(hmf);
}
DeleteDC(gc);
- fl_gc = oldgc;
+ Fl_Surface_Device::surface()->driver()->set_gc(oldgc);
delete (Fl_GDI_Surface_*)helper;
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: free resources in destructor of Fl_Copy_Surface"
@@ -166,7 +164,7 @@ void Fl_Copy_Surface::draw(Fl_Widget* widget, int delta_x, int delta_y)
void Fl_Copy_Surface::set_current()
{
#if defined(__APPLE__) || defined(WIN32) // PORTME: Fl_Surface_Driver - platform copy surface
- fl_gc = gc;
+ driver()->set_gc(gc);
fl_window = (Window)1;
Fl_Surface_Device::set_current();
#elif defined(FL_PORTING)