diff --git a/FL/Fl_Pixmap.H b/FL/Fl_Pixmap.H index 12e917978..e8b643acc 100644 --- a/FL/Fl_Pixmap.H +++ b/FL/Fl_Pixmap.H @@ -61,6 +61,7 @@ private: // for internal use fl_uintptr_t id_; fl_uintptr_t mask_; + Fl_Color pixmap_bg_color; public: diff --git a/src/Fl_Copy_Surface.cxx b/src/Fl_Copy_Surface.cxx index 12eb0bcf7..f667c7083 100644 --- a/src/Fl_Copy_Surface.cxx +++ b/src/Fl_Copy_Surface.cxx @@ -37,6 +37,8 @@ const char *Fl_Quartz_Surface_::class_id = "Fl_Quartz_Surface_"; #elif defined(WIN32) +#include "drivers/GDI/Fl_GDI_Graphics_Driver.h" + Fl_GDI_Surface_::Fl_GDI_Surface_() : Fl_Paged_Device() { driver(new Fl_GDI_Graphics_Driver); depth = 0; diff --git a/src/Fl_Double_Window.cxx b/src/Fl_Double_Window.cxx index dae43a40d..9bdbf4406 100644 --- a/src/Fl_Double_Window.cxx +++ b/src/Fl_Double_Window.cxx @@ -150,6 +150,8 @@ char fl_can_do_alpha_blending() { } #elif defined(WIN32) +#include "drivers/GDI/Fl_GDI_Graphics_Driver.h" + // Code used to switch output to an off-screen window. See macros in // win32.H which save the old state in local variables. diff --git a/src/Fl_GDI_Printer.cxx b/src/Fl_GDI_Printer.cxx index 98a3a7be4..76bbd0ea2 100644 --- a/src/Fl_GDI_Printer.cxx +++ b/src/Fl_GDI_Printer.cxx @@ -17,6 +17,9 @@ // #ifdef WIN32 + +#include "drivers/GDI/Fl_GDI_Graphics_Driver.h" + #include diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx index ba2dcda4f..07d9fbdba 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx @@ -36,6 +36,7 @@ #endif // Select fonts from the FLTK font table. +#include "Fl_GDI_Graphics_Driver.h" #include "../../flstring.h" #include #include diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx index f12de853b..eecb07fd7 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx @@ -36,6 +36,7 @@ //////////////////////////////////////////////////////////////// #include +#include "Fl_GDI_Graphics_Driver.h" #include #include #include @@ -507,7 +508,7 @@ void Fl_GDI_Graphics_Driver::draw(Fl_RGB_Image *img, int XP, int YP, int WP, int if (start(img, XP, YP, WP, HP, img->w(), img->h(), cx, cy, X, Y, W, H)) { return; } - if (!img->id_) img->id_ = build_id(img, &(img->mask_)); + if (!img->id_) img->id_ = (fl_uintptr_t)build_id(img, (void**)&(img->mask_)); if (img->mask_) { HDC new_gc = CreateCompatibleDC(fl_gc); int save = SaveDC(new_gc); @@ -530,8 +531,8 @@ int Fl_GDI_Printer_Graphics_Driver::draw_scaled(Fl_Image *img, int XP, int YP, i tr.eM11 = float(WP)/float(img->w()); tr.eM22 = float(HP)/float(img->h()); tr.eM12 = tr.eM21 = 0; - tr.eDx = XP; - tr.eDy = YP; + tr.eDx = float(XP); + tr.eDy = float(YP); ModifyWorldTransform(fl_gc, &tr, MWT_LEFTMULTIPLY); img->draw(0, 0, img->w(), img->h(), 0, 0); SetWorldTransform(fl_gc, &old_tr); @@ -580,7 +581,7 @@ static Fl_Bitmask fl_create_bitmap(int w, int h, const uchar *data) { } fl_uintptr_t Fl_GDI_Graphics_Driver::cache(Fl_Bitmap*, int w, int h, const uchar *array) { - return (fl_uintptr_t)create_bitmap(w, h, array); + return (fl_uintptr_t)fl_create_bitmap(w, h, array); } void Fl_GDI_Graphics_Driver::uncache(Fl_Bitmap *img, fl_uintptr_t &id_) { @@ -629,18 +630,20 @@ void Fl_GDI_Printer_Graphics_Driver::draw(Fl_Pixmap *pxm, int XP, int YP, int WP } } -fl_uintptr_t Fl_GDI_Printer_Graphics_Driver::cache(Fl_Pixmap *img, int w, int h, const char *const*data) { +extern uchar **fl_mask_bitmap; + +fl_uintptr_t Fl_GDI_Graphics_Driver::cache(Fl_Pixmap *img, int w, int h, const char *const*data) { Fl_Offscreen id; - id = fl_create_offscreen(w(), h()); + id = fl_create_offscreen(w, h); fl_begin_offscreen(id); uchar *bitmap = 0; fl_mask_bitmap = &bitmap; fl_draw_pixmap(data, 0, 0, FL_BLACK); extern UINT win_pixmap_bg_color; // computed by fl_draw_pixmap() - this->pixmap_bg_color = win_pixmap_bg_color; + img->pixmap_bg_color = win_pixmap_bg_color; fl_mask_bitmap = 0; if (bitmap) { - img->mask_ = (fl_uintptr_t)fl_create_bitmask(w(), h(), bitmap); + img->mask_ = (fl_uintptr_t)fl_create_bitmask(w, h, bitmap); delete[] bitmap; } fl_end_offscreen();