diff options
| author | Manolo Gouy <Manolo> | 2016-03-30 20:16:40 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-03-30 20:16:40 +0000 |
| commit | d67f395031b0e9cfb266bf31a4a5e08a2d109e3b (patch) | |
| tree | 6a38b9180802e79b16af5de3ff031e6d739ac16c /src/Fl_cocoa.mm | |
| parent | 7799245100a91b10b9a4ca9c6e818a3cdd8d5dc9 (diff) | |
Rewrite functions XRectangleRegion(), XDestroyRegion() under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11479 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_cocoa.mm')
| -rw-r--r-- | src/Fl_cocoa.mm | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index b6be6baba..97f72d388 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -36,6 +36,7 @@ extern "C" { #include <FL/Fl.H> +#include <FL/x.H> #include <FL/Fl_Window_Driver.H> #include <FL/Fl_Window.H> #include <FL/Fl_Tooltip.H> @@ -1945,7 +1946,7 @@ static void handleUpdateEvent( Fl_Window *window ) i->wait_for_expose = 0; if ( i->region ) { - XDestroyRegion(i->region); + Fl_Graphics_Driver::XDestroyRegion(i->region); i->region = 0; } window->clear_damage(FL_DAMAGE_ALL); @@ -3550,8 +3551,8 @@ void Fl_Cocoa_Window_Driver::unmap() { // intersects current and x,y,w,h rectangle and returns result as a new Fl_Region Fl_Region Fl_X::intersect_region_and_rect(Fl_Region current, int x,int y,int w, int h) { - if (current == NULL) return XRectangleRegion(x,y,w,h); - CGRect r = fl_cgrectmake_cocoa(x, y, w, h); + if (current == NULL) return Fl_Graphics_Driver::XRectangleRegion(x,y,w,h); + CGRect r = Fl_Quartz_Graphics_Driver::fl_cgrectmake_cocoa(x, y, w, h); Fl_Region outr = (Fl_Region)malloc(sizeof(*outr)); outr->count = current->count; outr->rects =(CGRect*)malloc(outr->count * sizeof(CGRect)); @@ -3565,8 +3566,8 @@ Fl_Region Fl_X::intersect_region_and_rect(Fl_Region current, int x,int y,int w, outr->rects = (CGRect*)realloc(outr->rects, outr->count * sizeof(CGRect)); } else { - XDestroyRegion(outr); - outr = XRectangleRegion(0,0,0,0); + Fl_Graphics_Driver::XDestroyRegion(outr); + outr = Fl_Graphics_Driver::XRectangleRegion(0,0,0,0); } return outr; } @@ -4262,11 +4263,6 @@ CGImageRef Fl_X::CGImage_from_window_rect(Fl_Window *win, int x, int y, int w, i return img; } -// so a CGRect matches exactly what is denoted x,y,w,h for clipping purposes -CGRect fl_cgrectmake_cocoa(int x, int y, int w, int h) { - return CGRectMake(x - 0.5, y - 0.5, w, h); -} - Window fl_xid(const Fl_Window* w) { Fl_X *temp = Fl_X::i(w); |
