summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-09-26 16:43:10 +0000
committerManolo Gouy <Manolo>2016-09-26 16:43:10 +0000
commit5b5ba880f5c517eb2206c63b3def45ce60cc7136 (patch)
tree000fce14837b2872444b00e53c5d130fd4605d4f /src
parent45e6be7316af7f2950f83b2c5cc28cf985315bf7 (diff)
MacOS platform: the printer's graphics driver should also call Fl_Graphics_Driver::newMainGraphicsDriver()
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11982 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Makefile1
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm6
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H5
3 files changed, 8 insertions, 4 deletions
diff --git a/src/Makefile b/src/Makefile
index 271ce867d..0e767b404 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -223,7 +223,6 @@ QUARTZCPPFILES = \
drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx \
drivers/Quartz/Fl_Quartz_Graphics_Driver_vertex.cxx \
drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx \
- drivers/Quartz/Fl_Quartz_Printer_Graphics_Driver.cxx \
drivers/Quartz/Fl_Quartz_Graphics_Driver_arci.cxx \
drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx \
drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.cxx \
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm b/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm
index 5c0e7ba75..e5fb88ff1 100644
--- a/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm
+++ b/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm
@@ -19,7 +19,7 @@
#include <FL/Fl_Printer.H>
#include <FL/Fl_Shared_Image.H>
#include <FL/Fl_Window_Driver.H>
-#include "../Quartz/Fl_Quartz_Printer_Graphics_Driver.H"
+#include "../Quartz/Fl_Quartz_Graphics_Driver.H"
#include "../Darwin/Fl_Darwin_System_Driver.H"
#include "Fl_Cocoa_Window_Driver.H"
@@ -81,7 +81,9 @@ Fl_Cocoa_Printer_Driver::Fl_Cocoa_Printer_Driver(void)
x_offset = 0;
y_offset = 0;
scale_x = scale_y = 1.;
- driver(new Fl_Quartz_Printer_Graphics_Driver);
+ Fl_Quartz_Graphics_Driver *d = (Fl_Quartz_Graphics_Driver*)Fl_Graphics_Driver::newMainGraphicsDriver();
+ d->is_printer_ = Fl_Graphics_Driver::PRINTER;
+ driver(d);
}
Fl_Paged_Device* Fl_Paged_Device::newPrinterDriver(void)
diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H
index 216554f86..b46b94000 100644
--- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H
+++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.H
@@ -41,20 +41,23 @@ struct Fl_Fontdesc;
*/
class Fl_Quartz_Graphics_Driver : public Fl_Graphics_Driver {
friend class Fl_Font_Descriptor;
+ friend class Fl_Cocoa_Printer_Driver;
protected:
CGContextRef gc_;
int p_size;
typedef struct { float x; float y; } XPOINT;
XPOINT *p;
bool high_resolution_;
+ driver_feature is_printer_;
// protected constructor to ensure only derived classes are allocated
Fl_Quartz_Graphics_Driver() : Fl_Graphics_Driver(), gc_(NULL), p_size(0), p(NULL) {
high_resolution_ = false;
+ is_printer_ = (driver_feature)0;
}
public:
static const int CoreText_threshold; // min Mac OS version for CoreText
virtual ~Fl_Quartz_Graphics_Driver() { if (p) free(p); }
- virtual int has_feature(driver_feature mask) { return mask & NATIVE; }
+ virtual int has_feature(driver_feature mask) { return mask & (NATIVE | is_printer_); }
virtual void gc(void *ctxt) {if (ctxt != gc_) global_gc(); gc_ = (CGContextRef)ctxt; }
virtual void *gc() {return gc_;}
char can_do_alpha_blending();