Mercurial > dwindows
comparison mac/dw.m @ 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 |
comparison
equal
deleted
inserted
replaced
2148:79e9c8080ad9 | 2149:c08e03168a9e |
---|---|
160 #if defined(MAC_OS_X_VERSION_10_15) && ((defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_15) || !defined(MAC_OS_X_VERSION_MAX_ALLOWED)) | 160 #if defined(MAC_OS_X_VERSION_10_15) && ((defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_15) || !defined(MAC_OS_X_VERSION_MAX_ALLOWED)) |
161 #define BUILDING_FOR_CATALINA | 161 #define BUILDING_FOR_CATALINA |
162 #define WK_API_ENABLED 1 | 162 #define WK_API_ENABLED 1 |
163 #endif | 163 #endif |
164 | 164 |
165 /* Handle deprecation of constants in 10.16... */ | 165 /* Handle deprecation of constants in 11.0 (also known as 10.16)... */ |
166 #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)) | 166 #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)) |
167 #define DWPrintingPaginationModeFit NSPrintingPaginationModeFit | |
168 #define DWDatePickerModeSingle NSDatePickerModeSingle | |
169 #define DWDatePickerStyleClockAndCalendar NSDatePickerStyleClockAndCalendar | |
170 #define DWDatePickerElementFlagYearMonthDay NSDatePickerElementFlagYearMonthDay | |
167 #define BUILDING_FOR_BIG_SUR | 171 #define BUILDING_FOR_BIG_SUR |
172 #else | |
173 #define DWPrintingPaginationModeFit NSFitPagination | |
174 #define DWDatePickerModeSingle NSSingleDateMode | |
175 #define DWDatePickerStyleClockAndCalendar NSClockAndCalendarDatePickerStyle | |
176 #define DWDatePickerElementFlagYearMonthDay NSYearMonthDayDatePickerElementFlag | |
168 #endif | 177 #endif |
169 | 178 |
170 /* Macros to encapsulate running functions on the main thread | 179 /* Macros to encapsulate running functions on the main thread |
171 * on Mojave or later... and locking mutexes on earlier versions. | 180 * on Mojave or later... and locking mutexes on earlier versions. |
172 */ | 181 */ |
8807 * id: An ID to be used with dw_window_from_id() or 0L. | 8816 * id: An ID to be used with dw_window_from_id() or 0L. |
8808 */ | 8817 */ |
8809 HWND API dw_calendar_new(ULONG cid) | 8818 HWND API dw_calendar_new(ULONG cid) |
8810 { | 8819 { |
8811 DWCalendar *calendar = [[DWCalendar alloc] init]; | 8820 DWCalendar *calendar = [[DWCalendar alloc] init]; |
8812 [calendar setDatePickerMode:NSSingleDateMode]; | 8821 [calendar setDatePickerMode:DWDatePickerModeSingle]; |
8813 [calendar setDatePickerStyle:NSClockAndCalendarDatePickerStyle]; | 8822 [calendar setDatePickerStyle:DWDatePickerStyleClockAndCalendar]; |
8814 [calendar setDatePickerElements:NSYearMonthDayDatePickerElementFlag]; | 8823 [calendar setDatePickerElements:DWDatePickerElementFlagYearMonthDay]; |
8815 [calendar setTag:cid]; | 8824 [calendar setTag:cid]; |
8816 [calendar setDateValue:[NSDate date]]; | 8825 [calendar setDateValue:[NSDate date]]; |
8817 return calendar; | 8826 return calendar; |
8818 } | 8827 } |
8819 | 8828 |
12517 print->drawdata = drawdata; | 12526 print->drawdata = drawdata; |
12518 print->flags = flags; | 12527 print->flags = flags; |
12519 | 12528 |
12520 /* Get the page range */ | 12529 /* Get the page range */ |
12521 pi = [NSPrintInfo sharedPrintInfo]; | 12530 pi = [NSPrintInfo sharedPrintInfo]; |
12522 [pi setHorizontalPagination:NSFitPagination]; | 12531 [pi setHorizontalPagination:DWPrintingPaginationModeFit]; |
12523 [pi setHorizontallyCentered:YES]; | 12532 [pi setHorizontallyCentered:YES]; |
12524 [pi setVerticalPagination:NSFitPagination]; | 12533 [pi setVerticalPagination:DWPrintingPaginationModeFit]; |
12525 [pi setVerticallyCentered:YES]; | 12534 [pi setVerticallyCentered:YES]; |
12526 [pi setOrientation:DWPaperOrientationPortrait]; | 12535 [pi setOrientation:DWPaperOrientationPortrait]; |
12527 [pi setLeftMargin:0.0]; | 12536 [pi setLeftMargin:0.0]; |
12528 [pi setRightMargin:0.0]; | 12537 [pi setRightMargin:0.0]; |
12529 [pi setTopMargin:0.0]; | 12538 [pi setTopMargin:0.0]; |