summaryrefslogtreecommitdiff
path: root/src/drivers/Cocoa
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-04-02 16:08:56 +0000
committerManolo Gouy <Manolo>2016-04-02 16:08:56 +0000
commit64c96b9098a8cc173eae58a3e2bc4cdaa2de11c8 (patch)
tree84e2b2e9554b224c4e1e4baf4e88cea0acde74d9 /src/drivers/Cocoa
parentddc95025fd371a645782972b048e867e94767a28 (diff)
Continue removing from class Fl_X all what is not window-related.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11514 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Cocoa')
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm5
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H7
2 files changed, 10 insertions, 2 deletions
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm b/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm
index 3c536ae7c..30fec61e1 100644
--- a/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm
+++ b/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm
@@ -21,6 +21,7 @@
#include <FL/Fl_Window_Driver.H>
#include "../Quartz/Fl_Quartz_Printer_Graphics_Driver.H"
#include "../Darwin/Fl_Darwin_System_Driver.H"
+#include "Fl_Cocoa_Screen_Driver.H"
#include <FL/Fl.H>
#include <FL/x.H>
@@ -403,7 +404,7 @@ void Fl_Cocoa_Printer_Driver::draw_decorated_window(Fl_Window *win, int x_offset
CGContextSaveGState(gc);
CGContextTranslateCTM(gc, x_offset - 0.5, y_offset + bt - 0.5);
CGContextScaleCTM(gc, 1, -1);
- Fl_X::draw_layer_to_context(layer, gc, win->w(), bt);
+ Fl_Cocoa_Screen_Driver::draw_layer_to_context(layer, gc, win->w(), bt);
CGContextRestoreGState(gc);
}
else {
@@ -411,7 +412,7 @@ void Fl_Cocoa_Printer_Driver::draw_decorated_window(Fl_Window *win, int x_offset
CGContextRef gc = CGBitmapContextCreate(NULL, 2*win->w(), 2*bt, 8, 0, cspace, kCGImageAlphaPremultipliedLast);
CGColorSpaceRelease(cspace);
CGContextScaleCTM(gc, 2, 2);
- Fl_X::draw_layer_to_context(layer, gc, win->w(), bt);
+ Fl_Cocoa_Screen_Driver::draw_layer_to_context(layer, gc, win->w(), bt);
Fl_RGB_Image *image = new Fl_RGB_Image((const uchar*)CGBitmapContextGetData(gc), 2*win->w(), 2*bt, 4,
CGBitmapContextGetBytesPerRow(gc)); // 10.2
int ori_x, ori_y;
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H
index a1f278a63..063985b7e 100644
--- a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H
+++ b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.H
@@ -26,6 +26,7 @@
#define FL_COCOA_SCREEN_DRIVER_H
#include <FL/Fl_Screen_Driver.H>
+#include <ApplicationServices/ApplicationServices.h>
/*
Move everything here that manages the native screen interface.
@@ -39,6 +40,11 @@
class Fl_Window;
+#ifdef __OBJC__
+@class CALayer;
+#else
+class CALayer;
+#endif // __OBJC__
class FL_EXPORT Fl_Cocoa_Screen_Driver : public Fl_Screen_Driver
@@ -87,6 +93,7 @@ public:
int insertion_point_location(int *px, int *py, int *pheight);
virtual int dnd(int use_selection);
virtual int compose(int &del);
+ static void draw_layer_to_context(CALayer *layer, CGContextRef gc, int w, int h);
};