comparison mac/dw.m @ 2131:fc29c4c2d386

Mac: Changes for supporting Big Sur. These changes don't actually work. The Xcode beta SDK is listed as 10.16, although it has been reported that Big Sur will be 11.0 not 10.16. The 10.16 SDK does not include constants for either 10.16 or 11.0 so I am writing the code as if it will be 11.0. The 10.16 SDK complains that NSBox's setBorderType is deprecated and it seems like the styles don't apply to the box type I am using anyway, so might want to just remove the setBorderType from NSBox and see if it still works on other versions of MacOS, but committing for now so I have this record of it.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 30 Jun 2020 20:10:23 +0000
parents 663467f6eee4
children 42f8ad7a89e8
comparison
equal deleted inserted replaced
2130:55c6587f269c 2131:fc29c4c2d386
158 158
159 /* Handle deprecation of constants in 10.15... */ 159 /* Handle deprecation of constants in 10.15... */
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
164
165 /* Handle deprecation of constants in 10.16... */
166 #if defined(MAC_OS_X_VERSION_11_0) && ((defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_11_0) || !defined(MAC_OS_X_VERSION_MAX_ALLOWED))
167 #define BUILDING_FOR_BIG_SUR
163 #endif 168 #endif
164 169
165 /* Macros to encapsulate running functions on the main thread 170 /* Macros to encapsulate running functions on the main thread
166 * on Mojave or later... and locking mutexes on earlier versions. 171 * on Mojave or later... and locking mutexes on earlier versions.
167 */ 172 */
4439 { 4444 {
4440 NSBox *groupbox = [[DWGroupBox alloc] init]; 4445 NSBox *groupbox = [[DWGroupBox alloc] init];
4441 DWBox *thisbox = dw_box_new(type, pad); 4446 DWBox *thisbox = dw_box_new(type, pad);
4442 Box *box = [thisbox box]; 4447 Box *box = [thisbox box];
4443 4448
4449 #ifndef BUILDING_FOR_BIG_SUR
4444 [groupbox setBorderType:NSBezelBorder]; 4450 [groupbox setBorderType:NSBezelBorder];
4451 #endif
4445 [groupbox setTitle:[NSString stringWithUTF8String:title]]; 4452 [groupbox setTitle:[NSString stringWithUTF8String:title]];
4446 box->grouphwnd = groupbox; 4453 box->grouphwnd = groupbox;
4447 [groupbox setContentView:thisbox]; 4454 [groupbox setContentView:thisbox];
4448 [thisbox autorelease]; 4455 [thisbox autorelease];
4449 return groupbox; 4456 return groupbox;
6385 HWND API dw_status_text_new(const char *text, ULONG cid) 6392 HWND API dw_status_text_new(const char *text, ULONG cid)
6386 { 6393 {
6387 NSBox *border = [[NSBox alloc] init]; 6394 NSBox *border = [[NSBox alloc] init];
6388 NSTextField *textfield = dw_text_new(text, cid); 6395 NSTextField *textfield = dw_text_new(text, cid);
6389 6396
6397 #ifndef BUILDING_FOR_BIG_SUR
6390 [border setBorderType:NSGrooveBorder]; 6398 [border setBorderType:NSGrooveBorder];
6391 //[border setBorderType:NSLineBorder]; 6399 #endif
6392 [border setTitlePosition:NSNoTitle]; 6400 [border setTitlePosition:NSNoTitle];
6393 [border setContentView:textfield]; 6401 [border setContentView:textfield];
6394 [border setContentViewMargins:NSMakeSize(1.5,1.5)]; 6402 [border setContentViewMargins:NSMakeSize(1.5,1.5)];
6395 [textfield autorelease]; 6403 [textfield autorelease];
6396 [textfield setBackgroundColor:[NSColor clearColor]]; 6404 [textfield setBackgroundColor:[NSColor clearColor]];