diff options
| author | Manolo Gouy <Manolo> | 2010-01-29 21:16:20 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2010-01-29 21:16:20 +0000 |
| commit | 4645ed97031bb2ce1122ec890a6c6ac55590c94a (patch) | |
| tree | dac195e42bb3183ae1626f8c00f3af0a9515480d /FL | |
| parent | 7f518b9287269190f63d4bb3d6933624308ffecd (diff) | |
defined macro FL_CGRECTMAKE_COCOA that
contains the correct way to transform x,y,w,h into
a CGRect adequate for clipping
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7035 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/mac.H | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -54,7 +54,7 @@ #ifndef MAC_OS_X_VERSION_MAX_ALLOWED #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_3 #endif -#endif //__APPLE_COCOA__ +#endif // __APPLE_COCOA__ #ifndef CGFLOAT_DEFINED //appears with 10.5 in CGBase.h #if defined(__LP64__) && __LP64__ @@ -62,7 +62,7 @@ typedef double CGFloat; #else typedef float CGFloat; #endif -#endif //CGFLOAT_DEFINED +#endif // CGFLOAT_DEFINED // Now make some fixes to the headers... @@ -73,9 +73,11 @@ struct XPoint { int x, y; }; struct XRectangle {int x, y, width, height;}; #ifdef __APPLE_COCOA__ +// necessary so a CGRect matches exactly what is denoted x,y,w,h for clipping purposes +#define FL_CGRECTMAKE_COCOA(x,y,w,h) CGRectMake(x, y, w > 0 ? w - 0.9 : 0, h > 0 ? h - 0.9 : 0) -typedef void *Window; //this is really a pter to the subclass FLWindow of NSWindow -typedef struct flCocoaRegion{ +typedef void *Window; // this is really a pter to the subclass FLWindow of NSWindow +typedef struct flCocoaRegion { int count; CGRect *rects; } *Fl_Region; // a region is the union of a series of rectangles @@ -83,7 +85,7 @@ inline Fl_Region XRectangleRegion(int x, int y, int w, int h) { Fl_Region R = (Fl_Region)malloc(sizeof(*R)); R->count = 1; R->rects = (CGRect *)malloc(sizeof(CGRect)); - *(R->rects) = CGRectMake(x, y, w > 0 ? w - 0.9 : 0, h > 0 ? h - 0.9 : 0); + *(R->rects) = FL_CGRECTMAKE_COCOA(x, y, w, h); return R; } inline void XDestroyRegion(Fl_Region r) { @@ -145,10 +147,6 @@ public: void flush(); // Quartz additions: CGContextRef gc; // graphics context (NULL when using QD) -#ifndef __APPLE_COCOA__ - static ATSUTextLayout atsu_layout; // windows share a global font - static ATSUStyle atsu_style; -#endif static void q_fill_context(); // fill a Quartz context with current FLTK state static void q_clear_clipping(); // remove all clipping from a Quartz context static void q_release_context(Fl_X *x=0); // free all resources associated with fl_gc |
