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
This commit is contained in:
Manolo Gouy 2018-05-12 16:59:03 +00:00
parent 6fd216d759
commit 4c45bec127
2 changed files with 44 additions and 44 deletions

View File

@ -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

View File

@ -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$".
//