From 4c45bec12705345621f074922a4eb25c47f39b48 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sat, 12 May 2018 16:59:03 +0000 Subject: [PATCH] MacOS: move some code from file Fl_cocoa.mm to file Fl_Cocoa_Window_Driver.cxx git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12917 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_cocoa.mm | 44 -------------------- src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx | 44 ++++++++++++++++++++ 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 4c6392620..aec94e248 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1081,38 +1081,6 @@ static void orderfront_subwindows(FLWindow *xid) } } -static const unsigned windowDidResize_mask = 1; - -bool Fl_Cocoa_Window_Driver::in_windowDidResize() { - return window_flags_ & windowDidResize_mask; -} - -void Fl_Cocoa_Window_Driver::in_windowDidResize(bool b) { - if (b) window_flags_ |= windowDidResize_mask; - else window_flags_ &= ~windowDidResize_mask; -} - -static const unsigned mapped_mask = 2; -static const unsigned changed_mask = 4; - -bool Fl_Cocoa_Window_Driver::mapped_to_retina() { - return window_flags_ & mapped_mask; -} - -void Fl_Cocoa_Window_Driver::mapped_to_retina(bool b) { - if (b) window_flags_ |= mapped_mask; - else window_flags_ &= ~mapped_mask; -} - -bool Fl_Cocoa_Window_Driver::changed_resolution() { - return window_flags_ & changed_mask; -} - -void Fl_Cocoa_Window_Driver::changed_resolution(bool b) { - if (b) window_flags_ |= changed_mask; - else window_flags_ &= ~changed_mask; -} - @interface FLWindowDelegateBefore10_6 : FLWindowDelegate - (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)client; @@ -4146,18 +4114,6 @@ int Fl_Cocoa_Window_Driver::decorated_h() return h() + bt + by; } -// clip the graphics context to rounded corners -void Fl_Cocoa_Window_Driver::clip_to_rounded_corners(CGContextRef gc, int w, int h) { - const CGFloat radius = 7.5; - CGContextMoveToPoint(gc, 0, 0); - CGContextAddLineToPoint(gc, 0, h - radius); - CGContextAddArcToPoint(gc, 0, h, radius, h, radius); - CGContextAddLineToPoint(gc, w - radius, h); - CGContextAddArcToPoint(gc, w, h, w, h - radius, radius); - CGContextAddLineToPoint(gc, w, 0); - CGContextClip(gc); -} - static CALayer *get_titlebar_layer(Fl_Window *win) { // a compilation warning appears with SDK 10.5, so we require SDK 10.6 instead diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx index f6a05607c..d565ae20c 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx +++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx @@ -276,6 +276,50 @@ int Fl_Cocoa_Window_Driver::scroll(int src_x, int src_y, int src_w, int src_h, i return 0; } +static const unsigned windowDidResize_mask = 1; + +bool Fl_Cocoa_Window_Driver::in_windowDidResize() { + return window_flags_ & windowDidResize_mask; +} + +void Fl_Cocoa_Window_Driver::in_windowDidResize(bool b) { + if (b) window_flags_ |= windowDidResize_mask; + else window_flags_ &= ~windowDidResize_mask; +} + +static const unsigned mapped_mask = 2; +static const unsigned changed_mask = 4; + +bool Fl_Cocoa_Window_Driver::mapped_to_retina() { + return window_flags_ & mapped_mask; +} + +void Fl_Cocoa_Window_Driver::mapped_to_retina(bool b) { + if (b) window_flags_ |= mapped_mask; + else window_flags_ &= ~mapped_mask; +} + +bool Fl_Cocoa_Window_Driver::changed_resolution() { + return window_flags_ & changed_mask; +} + +void Fl_Cocoa_Window_Driver::changed_resolution(bool b) { + if (b) window_flags_ |= changed_mask; + else window_flags_ &= ~changed_mask; +} + +// clip the graphics context to rounded corners +void Fl_Cocoa_Window_Driver::clip_to_rounded_corners(CGContextRef gc, int w, int h) { + const CGFloat radius = 7.5; + CGContextMoveToPoint(gc, 0, 0); + CGContextAddLineToPoint(gc, 0, h - radius); + CGContextAddArcToPoint(gc, 0, h, radius, h, radius); + CGContextAddLineToPoint(gc, w - radius, h); + CGContextAddArcToPoint(gc, w, h, w, h - radius, radius); + CGContextAddLineToPoint(gc, w, 0); + CGContextClip(gc); +} + // // End of "$Id$". //