summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-10-09 11:16:36 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-10-09 11:16:36 +0200
commitbb7e1635adb15d685a94e96b015d4bfd09cf2f05 (patch)
treebf50398b7e8a3068e8c75ae6615676d3ca46b840 /src/drivers
parentd1436f4f63c0c788d25065a4ce108cedb82ae866 (diff)
macOS: remove a bunch of deprecation warnings
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm2
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm5
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx14
3 files changed, 14 insertions, 7 deletions
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm b/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
index dd69ad344..dcf7cab44 100644
--- a/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
+++ b/src/drivers/Cocoa/Fl_Cocoa_Gl_Window_Driver.mm
@@ -106,7 +106,7 @@ static NSOpenGLPixelFormat* mode_to_NSOpenGLPixelFormat(int m, const int *alistp
}
if (m & FL_STEREO) {
//list[n++] = AGL_STEREO;
- attribs[n++] = NSOpenGLPFAStereo;
+ attribs[n++] = 6/*NSOpenGLPFAStereo*/;
}
if ((m & FL_MULTISAMPLE) && fl_mac_os_version >= 100400) {
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm b/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm
index c144ab243..3163f01b3 100644
--- a/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm
+++ b/src/drivers/Cocoa/Fl_Cocoa_Printer_Driver.mm
@@ -126,7 +126,10 @@ int Fl_Cocoa_Printer_Driver::begin_job (int pagecount, int *frompage, int *topag
[main makeKeyAndOrderFront:nil];
} else
retval = [panel runModalWithPrintInfo:info]; //from 10.5
- if (retval != NSOKButton) return 1;
+#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9
+ const NSInteger NSModalResponseOK = NSOKButton;
+#endif
+ if (retval != NSModalResponseOK) return 1;
printSession = (PMPrintSession)[info PMPrintSession];//from 10.5
pageFormat = (PMPageFormat)[info PMPageFormat];//from 10.5
printSettings = (PMPrintSettings)[info PMPrintSettings];//from 10.5
diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx
index e3b03b949..7b2085c23 100644
--- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx
+++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_font.cxx
@@ -77,6 +77,10 @@
#include <FL/fl_utf8.h> // for fl_utf8toUtf16()
#include <FL/fl_string_functions.h> // fl_strdup()
+#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8
+const NSUInteger kCTFontOrientationHorizontal = kCTFontHorizontalOrientation;
+#endif
+
Fl_Fontdesc* fl_fonts = NULL;
static CGAffineTransform font_mx = { 1, 0, 0, -1, 0, 0 };
@@ -418,14 +422,14 @@ void Fl_Quartz_Graphics_Driver::ADD_SUFFIX(descriptor_init, _CoreText)(const cha
CTFontGetGlyphsForCharacters(d->fontref, A, glyph, 2);
CGSize advances[2];
double w;
- CTFontGetAdvancesForGlyphs(d->fontref, kCTFontHorizontalOrientation, glyph, advances, 2);
+ CTFontGetAdvancesForGlyphs(d->fontref, kCTFontOrientationHorizontal, glyph, advances, 2);
w = advances[0].width;
if ( fabs(advances[0].width - advances[1].width) < 1E-2 ) {//this is a fixed-width font
// slightly rescale fixed-width fonts so the character width has an integral value
CFRelease(d->fontref);
CGFloat fsize = size / ( w/floor(w + 0.5) );
d->fontref = CTFontCreateWithName(str, fsize, NULL);
- w = CTFontGetAdvancesForGlyphs(d->fontref, kCTFontHorizontalOrientation, glyph, NULL, 1);
+ w = CTFontGetAdvancesForGlyphs(d->fontref, kCTFontOrientationHorizontal, glyph, NULL, 1);
}
CFRelease(str);
d->ascent = (short)(CTFontGetAscent(d->fontref) + 0.5);
@@ -473,7 +477,7 @@ static CGFloat surrogate_width(const UniChar *txt, Fl_Quartz_Font_Descriptor *fl
CFRelease(str);
b = CTFontGetGlyphsForCharacters(font2, txt, glyphs, 2);
}
- if (b) CTFontGetAdvancesForGlyphs(font2, kCTFontHorizontalOrientation, glyphs, &a, 1);
+ if (b) CTFontGetAdvancesForGlyphs(font2, kCTFontOrientationHorizontal, glyphs, &a, 1);
else a.width = fl_fontsize->q_width;
if(must_release) CFRelease(font2);
return a.width;
@@ -525,7 +529,7 @@ double Fl_Quartz_Graphics_Driver::ADD_SUFFIX(width, _CoreText)(const UniChar* tx
// ii spans all characters of this block
bool b = CTFontGetGlyphsForCharacters(fl_fontsize->fontref, &ii, &glyph, 1);
if (b)
- CTFontGetAdvancesForGlyphs(fl_fontsize->fontref, kCTFontHorizontalOrientation, &glyph, &advance_size, 1);
+ CTFontGetAdvancesForGlyphs(fl_fontsize->fontref, kCTFontOrientationHorizontal, &glyph, &advance_size, 1);
else
advance_size.width = -1e9; // calculate this later
// the width of one character of this block of characters
@@ -549,7 +553,7 @@ double Fl_Quartz_Graphics_Driver::ADD_SUFFIX(width, _CoreText)(const UniChar* tx
CFRelease(str);
b = CTFontGetGlyphsForCharacters(font2, &uni, &glyph, 1);
}
- if (b) CTFontGetAdvancesForGlyphs(font2, kCTFontHorizontalOrientation, &glyph, &advance_size, 1);
+ if (b) CTFontGetAdvancesForGlyphs(font2, kCTFontOrientationHorizontal, &glyph, &advance_size, 1);
else advance_size.width = 0.;
// the width of the 'uni' character
wdt = fl_fontsize->width[r][uni & (block-1)] = advance_size.width;