changeset 2149:c08e03168a9e

Mac: Fix deprecation warnings about constants in Big Sur 11.0.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 10 Sep 2020 20:18:43 +0000
parents 79e9c8080ad9
children be4547734f0b
files mac/dw.m
diffstat 1 files changed, 16 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mac/dw.m	Fri Jul 24 19:27:31 2020 +0000
+++ b/mac/dw.m	Thu Sep 10 20:18:43 2020 +0000
@@ -162,9 +162,18 @@
 #define WK_API_ENABLED 1
 #endif
 
-/* Handle deprecation of constants in 10.16... */
-#if defined(MAC_OS_X_VERSION_10_16) && ((defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_16) || !defined(MAC_OS_X_VERSION_MAX_ALLOWED))
+/* Handle deprecation of constants in 11.0 (also known as 10.16)... */
+#if (defined(MAC_OS_VERSION_11_0) || defined(MAC_OS_X_VERSION_10_16)) && ((defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_10_16) || !defined(MAC_OS_X_VERSION_MAX_ALLOWED))
+#define DWPrintingPaginationModeFit NSPrintingPaginationModeFit
+#define DWDatePickerModeSingle NSDatePickerModeSingle
+#define DWDatePickerStyleClockAndCalendar NSDatePickerStyleClockAndCalendar
+#define DWDatePickerElementFlagYearMonthDay NSDatePickerElementFlagYearMonthDay
 #define BUILDING_FOR_BIG_SUR
+#else
+#define DWPrintingPaginationModeFit NSFitPagination
+#define DWDatePickerModeSingle NSSingleDateMode
+#define DWDatePickerStyleClockAndCalendar NSClockAndCalendarDatePickerStyle
+#define DWDatePickerElementFlagYearMonthDay NSYearMonthDayDatePickerElementFlag
 #endif
 
 /* Macros to encapsulate running functions on the main thread
@@ -8809,9 +8818,9 @@
 HWND API dw_calendar_new(ULONG cid)
 {
     DWCalendar *calendar = [[DWCalendar alloc] init];
-    [calendar setDatePickerMode:NSSingleDateMode];
-    [calendar setDatePickerStyle:NSClockAndCalendarDatePickerStyle];
-    [calendar setDatePickerElements:NSYearMonthDayDatePickerElementFlag];
+    [calendar setDatePickerMode:DWDatePickerModeSingle];
+    [calendar setDatePickerStyle:DWDatePickerStyleClockAndCalendar];
+    [calendar setDatePickerElements:DWDatePickerElementFlagYearMonthDay];
     [calendar setTag:cid];
     [calendar setDateValue:[NSDate date]];
     return calendar;
@@ -12519,9 +12528,9 @@
 
     /* Get the page range */
     pi = [NSPrintInfo sharedPrintInfo];
-    [pi setHorizontalPagination:NSFitPagination];
+    [pi setHorizontalPagination:DWPrintingPaginationModeFit];
     [pi setHorizontallyCentered:YES];
-    [pi setVerticalPagination:NSFitPagination];
+    [pi setVerticalPagination:DWPrintingPaginationModeFit];
     [pi setVerticallyCentered:YES];
     [pi setOrientation:DWPaperOrientationPortrait];
     [pi setLeftMargin:0.0];