NS{Application,Window}: define modal constants

Define constants and stubs related to modal sheets in GUI for increased
compatibility.
This commit is contained in:
Daniel Ferreira 2017-08-15 11:38:54 +10:00 committed by Ivan Vučica
parent 5e8b278e93
commit 07d0f2002f
3 changed files with 30 additions and 0 deletions

View file

@ -750,6 +750,16 @@ NSShowSystemInfoPanel(NSDictionary *options);
*/
APPKIT_EXPORT NSApplication *NSApp;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
enum
{
NSModalResponseStop = -1000,
NSModalResponseAbort = -1001,
NSModalResponseContinue = -1002
};
typedef NSInteger NSModalResponse;
#endif
#if defined(__cplusplus)
}
#endif

View file

@ -87,6 +87,13 @@ enum {
NSScreenSaverWindowLevel = 1000 // 12
};
#if OS_API_VERSION(MAC_OS_X_VERSION_10_9, GS_API_LATEST)
enum {
NSModalResponseOK = 1,
NSModalResponseCancel = 0
};
#endif
enum {
NSBorderlessWindowMask = 0,
NSTitledWindowMask = 1,
@ -810,6 +817,14 @@ PACKAGE_SCOPE
- (void) setDisplaysWhenScreenProfileChanges: (BOOL)flag;
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_9, GS_API_LATEST)
#if GS_HAS_DECLARED_PROPERTIES
@property (readonly) NSWindow *sheetParent;
#else
- (NSWindow *) sheetParent;
#endif
#endif
@end
@class NSToolbar;

View file

@ -5653,6 +5653,11 @@ current key view.<br />
return _attachedSheet;
}
- (NSWindow *) sheetParent
{
return nil;
}
@end
@implementation NSWindow (Toolbar)