diff options
| author | Manolo Gouy <Manolo> | 2016-01-27 18:11:20 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-01-27 18:11:20 +0000 |
| commit | 8e3f66073f8e30e874eb3e6cf76ab0a614c39aad (patch) | |
| tree | de1aaad8e102b792439c7cdef6dbb826d6d1ae90 /src/Fl_cocoa.mm | |
| parent | 1c4661c4816d9e9b8cc37165a554a4d60c5339da (diff) | |
1) Added a new way to detect whether the drawing operation is using the platform's native driver
and whether we are printing: virtual int Fl_Graphics_Driver::has_feature(driver_feature feature)
This is also because it is not convenient to derive a printer-specific driver with its own
implementation of virtual functions when this implementation differs only in one line of code.
2) Solved the problem of inclusion of non public header by the public header FL/Fl_Device.H:
bracket this with #if FL_LIBRARY / #endif so this non public header is included only when building
FLTK itself.
3) Removed several (but not all) of the FLTK_ABI_VERSION guards that are no longer
useful for code targeting FLTK 1.4.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11063 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_cocoa.mm')
| -rw-r--r-- | src/Fl_cocoa.mm | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 45dd10fc0..7c12a2136 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1207,72 +1207,36 @@ static void orderfront_subwindows(FLWindow *xid) } } -#if FLTK_ABI_VERSION >= 10304 static const unsigned windowDidResize_mask = 1; -#else -static const unsigned long windowDidResize_mask = 1; -#endif bool Fl_X::in_windowDidResize() { -#if FLTK_ABI_VERSION >= 10304 return mapped_to_retina_ & windowDidResize_mask; -#else - return (unsigned long)xidChildren & windowDidResize_mask; -#endif } void Fl_X::in_windowDidResize(bool b) { -#if FLTK_ABI_VERSION >= 10304 if (b) mapped_to_retina_ |= windowDidResize_mask; else mapped_to_retina_ &= ~windowDidResize_mask; -#else - if (b) xidChildren = (Fl_X*)((unsigned long)xidChildren | windowDidResize_mask); - else xidChildren = (Fl_X*)((unsigned long)xidChildren & ~windowDidResize_mask); -#endif } -#if FLTK_ABI_VERSION >= 10304 static const unsigned mapped_mask = 2; static const unsigned changed_mask = 4; -#else -static const unsigned long mapped_mask = 2; // sizeof(unsigned long) = sizeof(Fl_X*) -static const unsigned long changed_mask = 4; -#endif bool Fl_X::mapped_to_retina() { -#if FLTK_ABI_VERSION >= 10304 return mapped_to_retina_ & mapped_mask; -#else - return (unsigned long)xidChildren & mapped_mask; -#endif } void Fl_X::mapped_to_retina(bool b) { -#if FLTK_ABI_VERSION >= 10304 if (b) mapped_to_retina_ |= mapped_mask; else mapped_to_retina_ &= ~mapped_mask; -#else - if (b) xidChildren = (Fl_X*)((unsigned long)xidChildren | mapped_mask); - else xidChildren = (Fl_X*)((unsigned long)xidChildren & ~mapped_mask); -#endif } bool Fl_X::changed_resolution() { -#if FLTK_ABI_VERSION >= 10304 return mapped_to_retina_ & changed_mask; -#else - return (unsigned long)xidChildren & changed_mask; -#endif } void Fl_X::changed_resolution(bool b) { -#if FLTK_ABI_VERSION >= 10304 if (b) mapped_to_retina_ |= changed_mask; else mapped_to_retina_ &= ~changed_mask; -#else - if (b) xidChildren = (Fl_X*)((unsigned long)xidChildren | changed_mask); - else xidChildren = (Fl_X*)((unsigned long)xidChildren & ~changed_mask); -#endif } @@ -4445,7 +4409,7 @@ void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset) } int bx, by, bt; get_window_frame_sizes(bx, by, bt); - BOOL to_quartz = (this->driver()->class_name() == Fl_Quartz_Graphics_Driver::class_id); + BOOL to_quartz = (this->driver()->has_feature(Fl_Graphics_Driver::NATIVE)); CALayer *layer = get_titlebar_layer(win); if (layer) { // if title bar uses a layer if (to_quartz) { // to Quartz printer |
