From b6872d574b9aa8dfdea128486303dc4d45e42adf Mon Sep 17 00:00:00 2001 From: rmottola Date: Wed, 28 Oct 2015 01:39:07 +0000 Subject: [PATCH] Primitive presentationOptions implementation git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@39100 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Headers/AppKit/NSApplication.h | 30 +++++++++++++++++++++++++++++- Source/NSApplication.m | 21 ++++++++++++++++++++- 3 files changed, 55 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f6cc5d497..c4cae732f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-10-28 Riccardo Mottola + + * Headers/AppKit/NSApplication.h + * Source/NSApplication.m + Primitive presentationOptions implementation. + 2015-10-28 Riccardo Mottola * Headers/AppKit/NSScrollView.h diff --git a/Headers/AppKit/NSApplication.h b/Headers/AppKit/NSApplication.h index 442d8e0ce..db65f8a81 100644 --- a/Headers/AppKit/NSApplication.h +++ b/Headers/AppKit/NSApplication.h @@ -3,7 +3,7 @@ The one and only application class - Copyright (C) 1996,1999 Free Software Foundation, Inc. + Copyright (C) 1996-2105 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 @@ -149,6 +149,27 @@ enum _NSApplicationPrintReply typedef NSUInteger NSApplicationPrintReply; #endif + +#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) +typedef enum _NSApplicationPresentationOptions +{ + NSApplicationPresentationDefault = 0, + NSApplicationPresentationAutoHideDock = (1 << 0), + NSApplicationPresentationHideDock = (1 << 1), + NSApplicationPresentationAutoHideMenuBar = (1 << 2), + NSApplicationPresentationHideMenuBar = (1 << 3), + NSApplicationPresentationDisableAppleMenu = (1 << 4), + NSApplicationPresentationDisableProcessSwitching = (1 << 5), + NSApplicationPresentationDisableForceQuit = (1 << 6), + NSApplicationPresentationDisableSessionTermination = (1 << 7), + NSApplicationPresentationDisableHideApplication = (1 << 8), + NSApplicationPresentationDisableMenuBarTransparency = (1 << 9), + NSApplicationPresentationFullScreen = (1 << 10), + NSApplicationPresentationAutoHideToolbar = (1 << 11) +} NSApplicationPresentationOptions; + +#endif + APPKIT_EXPORT NSString *NSModalPanelRunLoopMode; APPKIT_EXPORT NSString *NSEventTrackingRunLoopMode; @@ -177,6 +198,7 @@ APPKIT_EXPORT NSString *NSEventTrackingRunLoopMode; NSWindow *_hidden_key; NSWindow *_hidden_main; GSInfoPanel *_infoPanel; + NSApplicationPresentationOptions _presentationOptions; /* This autorelease pool should only be created and used by -run, with a single exception (which is why it is stored here as an ivar): the @@ -398,6 +420,12 @@ APPKIT_EXPORT NSString *NSEventTrackingRunLoopMode; - (NSInteger) requestUserAttention: (NSRequestUserAttentionType)requestType; #endif +#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) +- (NSApplicationPresentationOptions) currentPresentationOptions; +- (NSApplicationPresentationOptions) presentationOptions; +- (void)setPresentationOptions: (NSApplicationPresentationOptions)options; +#endif + @end /** diff --git a/Source/NSApplication.m b/Source/NSApplication.m index a976e0d2b..aa4e2601e 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -2,7 +2,7 @@ The one and only application class. - Copyright (C) 1996,1999 Free Software Foundation, Inc. + Copyright (C) 1996-2015 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 @@ -3698,6 +3698,25 @@ struct _DelegateWrapper return 0; } +- (NSApplicationPresentationOptions) currentPresentationOptions +{ + return _presentationOptions; +} + +- (NSApplicationPresentationOptions) presentationOptions +{ + return _presentationOptions; +} + +/** + * Currently unimplemented and unused in GNUstep, it could be extended to handle + * special GNUstep needs too + */ +- (void)setPresentationOptions: (NSApplicationPresentationOptions)options +{ + _presentationOptions = options; +} + /* * NSCoding protocol */