summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2016-02-09 20:15:04 +0000
committerMatthias Melcher <fltk@matthiasm.com>2016-02-09 20:15:04 +0000
commit7a0fe79f99ea90106b035047cb37148b4f3809fc (patch)
treeabeee19f9b4326e1e5b5545aa2b665ed6f8294ee /src
parent4272f32b6b90c3238e4252d8588e1843504e4c7f (diff)
Fix MSWindows issues from last refactoring.
During the last refactoring on OS X, a few thing were relocated into new files, mainly to avoid ifdef's and use C++ inheritance in a driver system instead. This commit makes FLTK compile again under VC2013 with IDE files generated by CMake. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11141 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Copy_Surface.cxx2
-rw-r--r--src/Fl_Double_Window.cxx2
-rw-r--r--src/Fl_GDI_Printer.cxx3
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx1
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx19
5 files changed, 19 insertions, 8 deletions
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 <FL/Fl_Printer.H>
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 <FL/Fl.H>
#include <FL/fl_draw.H>
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 <config.h>
+#include "Fl_GDI_Graphics_Driver.h"
#include <FL/Fl.H>
#include <FL/Fl_Printer.H>
#include <FL/fl_draw.H>
@@ -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();