SAL_WNODEPRECATED_DECLARATIONS_PUSH/POP around new macOS 10.12 deprecations

...for now

Change-Id: I64a0a8f6a006d75b6f82d7aae570aef414984a78
This commit is contained in:
Stephan Bergmann
2016-10-05 20:29:06 +02:00
parent af239f5aff
commit a6c88e4bf1
10 changed files with 139 additions and 0 deletions

View File

@@ -85,6 +85,8 @@
- (void) postTheEvent: (short int)buttonIdentifier modifierFlags:(int)modifierFlags - (void) postTheEvent: (short int)buttonIdentifier modifierFlags:(int)modifierFlags
{ {
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSApplicationDefined' is deprecated: first deprecated in macOS 10.12
[NSApp postEvent: [NSApp postEvent:
[NSEvent otherEventWithType:NSApplicationDefined [NSEvent otherEventWithType:NSApplicationDefined
location:NSZeroPoint location:NSZeroPoint
@@ -96,6 +98,7 @@
data1: buttonIdentifier data1: buttonIdentifier
data2: 0] data2: 0]
atStart: NO]; atStart: NO];
SAL_WNODEPRECATED_DECLARATIONS_POP
} }

View File

@@ -371,7 +371,12 @@ void SAL_CALL DropTarget::initialize(const Sequence< Any >& aArguments)
id wnd = [mView window]; id wnd = [mView window];
NSWindow* parentWnd = [wnd parentWindow]; NSWindow* parentWnd = [wnd parentWindow];
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSClosableWindowMask' is deprecated: first deprecated in macOS 10.12
// 'NSResizableWindowMask' is deprecated: first deprecated in macOS 10.12
// 'NSTitleWindowMask' is deprecated: first deprecated in macOS 10.12
unsigned int topWndStyle = (NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask); unsigned int topWndStyle = (NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask);
SAL_WNODEPRECATED_DECLARATIONS_POP
unsigned int wndStyles = [wnd styleMask] & topWndStyle; unsigned int wndStyles = [wnd styleMask] & topWndStyle;
if (parentWnd == nil && (wndStyles == topWndStyle)) if (parentWnd == nil && (wndStyles == topWndStyle))

View File

@@ -272,6 +272,11 @@ using namespace ::com::sun::star::uno;
sal_Int32 alignment; sal_Int32 alignment;
property.Value >>= alignment; property.Value >>= alignment;
NSNumber *textAlignment = nil; NSNumber *textAlignment = nil;
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSCenterTextAlignment' is deprecated: first deprecated in macOS 10.12
// 'NSJustifiedTextAlignment' is deprecated: first deprecated in macOS 10.12
// 'NSLeftTextAlignment' is deprecated: first deprecated in macOS 10.12
// 'NSRightTextAlignment' is deprecated: first deprecated in macOS 10.12
switch(alignment) { switch(alignment) {
case css::style::ParagraphAdjust_RIGHT : textAlignment = [NSNumber numberWithInteger:NSRightTextAlignment] ; break; case css::style::ParagraphAdjust_RIGHT : textAlignment = [NSNumber numberWithInteger:NSRightTextAlignment] ; break;
case css::style::ParagraphAdjust_CENTER: textAlignment = [NSNumber numberWithInteger:NSCenterTextAlignment] ; break; case css::style::ParagraphAdjust_CENTER: textAlignment = [NSNumber numberWithInteger:NSCenterTextAlignment] ; break;
@@ -279,6 +284,7 @@ using namespace ::com::sun::star::uno;
case css::style::ParagraphAdjust_LEFT : case css::style::ParagraphAdjust_LEFT :
default : textAlignment = [NSNumber numberWithInteger:NSLeftTextAlignment] ; break; default : textAlignment = [NSNumber numberWithInteger:NSLeftTextAlignment] ; break;
} }
SAL_WNODEPRECATED_DECLARATIONS_POP
NSDictionary *paragraphStyle = [NSDictionary dictionaryWithObjectsAndKeys:textAlignment, @"AXTextAlignment", textAlignment, @"AXVisualTextAlignment", nil]; NSDictionary *paragraphStyle = [NSDictionary dictionaryWithObjectsAndKeys:textAlignment, @"AXTextAlignment", textAlignment, @"AXVisualTextAlignment", nil];
[string addAttribute:@"AXParagraphStyle" value:paragraphStyle range:range]; [string addAttribute:@"AXParagraphStyle" value:paragraphStyle range:range];
} }

View File

@@ -151,6 +151,12 @@ void AquaSalFrame::initWindowAndView()
maGeometry.nHeight = static_cast<unsigned int>(aVisibleRect.size.height * 0.8); maGeometry.nHeight = static_cast<unsigned int>(aVisibleRect.size.height * 0.8);
// calculate style mask // calculate style mask
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSBorderlessWindowMask' is deprecated: first deprecated in macOS 10.12
// 'NSClosableWindowMask' is deprecated: first deprecated in macOS 10.12
// 'NSMiniaturizableWindowMask' is deprecated: first deprecated in macOS 10.12
// 'NSResizableWindowMask' is deprecated: first deprecated in macOS 10.12
// 'NSTitledWindowMask' is deprecated: first deprecated in macOS 10.12
if( (mnStyle & SalFrameStyleFlags::FLOAT) || if( (mnStyle & SalFrameStyleFlags::FLOAT) ||
(mnStyle & SalFrameStyleFlags::OWNERDRAWDECORATION) ) (mnStyle & SalFrameStyleFlags::OWNERDRAWDECORATION) )
mnStyleMask = NSBorderlessWindowMask; mnStyleMask = NSBorderlessWindowMask;
@@ -184,6 +190,7 @@ void AquaSalFrame::initWindowAndView()
if( mnStyleMask != 0 ) if( mnStyleMask != 0 )
mnStyleMask |= NSTitledWindowMask; mnStyleMask |= NSTitledWindowMask;
} }
SAL_WNODEPRECATED_DECLARATIONS_POP
// #i91990# support GUI-less (daemon) execution // #i91990# support GUI-less (daemon) execution
@try @try
@@ -1213,7 +1220,10 @@ void AquaSalFrame::UpdateSettings( AllSettings& rSettings )
getAppleScrollBarVariant(aStyleSettings); getAppleScrollBarVariant(aStyleSettings);
// set scrollbar size // set scrollbar size
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSRegularControlSize' is deprecated: first deprecated in macOS 10.12
aStyleSettings.SetScrollBarSize( static_cast<long int>([NSScroller scrollerWidthForControlSize:NSRegularControlSize scrollerStyle:NSScrollerStyleLegacy]) ); aStyleSettings.SetScrollBarSize( static_cast<long int>([NSScroller scrollerWidthForControlSize:NSRegularControlSize scrollerStyle:NSScrollerStyleLegacy]) );
SAL_WNODEPRECATED_DECLARATIONS_POP
// images in menus false for MacOSX // images in menus false for MacOSX
aStyleSettings.SetPreferredUseImagesInMenus( false ); aStyleSettings.SetPreferredUseImagesInMenus( false );
aStyleSettings.SetHideDisabledMenuItems( true ); aStyleSettings.SetHideDisabledMenuItems( true );
@@ -1364,6 +1374,17 @@ SalPointerState AquaSalFrame::GetPointerState()
if( pCur ) if( pCur )
{ {
bMouseEvent = true; bMouseEvent = true;
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSLeftMouseDown' is deprecated: first deprecated in macOS 10.12
// 'NSLeftMouseDragged' is deprecated: first deprecated in macOS 10.12
// 'NSLeftMouseUp' is deprecated: first deprecated in macOS 10.12
// 'NSMouseMoved' is deprecated: first deprecated in macOS 10.12
// 'NSOtherMouseDown' is deprecated: first deprecated in macOS 10.12
// 'NSOtherMouseDragged' is deprecated: first deprecated in macOS 10.12
// 'NSOtherMouseUp' is deprecated: first deprecated in macOS 10.12
// 'NSRightMouseDown' is deprecated: first deprecated in macOS 10.12
// 'NSRightMouseDragged' is deprecated: first deprecated in macOS 10.12
// 'NSRightMouseUp' is deprecated: first deprecated in macOS 10.12
switch( [pCur type] ) switch( [pCur type] )
{ {
case NSLeftMouseDown: state.mnState |= MOUSE_LEFT; break; case NSLeftMouseDown: state.mnState |= MOUSE_LEFT; break;
@@ -1381,10 +1402,16 @@ SalPointerState AquaSalFrame::GetPointerState()
bMouseEvent = false; bMouseEvent = false;
break; break;
} }
SAL_WNODEPRECATED_DECLARATIONS_POP
} }
if( bMouseEvent ) if( bMouseEvent )
{ {
unsigned int nMask = (unsigned int)[pCur modifierFlags]; unsigned int nMask = (unsigned int)[pCur modifierFlags];
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSAlternateKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSCommandKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSControlKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSShiftKeyMask' is deprecated: first deprecated in macOS 10.12
if( (nMask & NSShiftKeyMask) != 0 ) if( (nMask & NSShiftKeyMask) != 0 )
state.mnState |= KEY_SHIFT; state.mnState |= KEY_SHIFT;
if( (nMask & NSControlKeyMask) != 0 ) if( (nMask & NSControlKeyMask) != 0 )
@@ -1393,6 +1420,7 @@ SalPointerState AquaSalFrame::GetPointerState()
state.mnState |= KEY_MOD2; state.mnState |= KEY_MOD2;
if( (nMask & NSCommandKeyMask) != 0 ) if( (nMask & NSCommandKeyMask) != 0 )
state.mnState |= KEY_MOD1; state.mnState |= KEY_MOD1;
SAL_WNODEPRECATED_DECLARATIONS_POP
} }
else else

View File

@@ -38,6 +38,11 @@
static sal_uInt16 ImplGetModifierMask( unsigned int nMask ) static sal_uInt16 ImplGetModifierMask( unsigned int nMask )
{ {
sal_uInt16 nRet = 0; sal_uInt16 nRet = 0;
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSAlternateKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSCommandKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSControlKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSShiftKeyMask' is deprecated: first deprecated in macOS 10.12
if( (nMask & NSShiftKeyMask) != 0 ) if( (nMask & NSShiftKeyMask) != 0 )
nRet |= KEY_SHIFT; nRet |= KEY_SHIFT;
if( (nMask & NSControlKeyMask) != 0 ) if( (nMask & NSControlKeyMask) != 0 )
@@ -46,6 +51,7 @@ static sal_uInt16 ImplGetModifierMask( unsigned int nMask )
nRet |= KEY_MOD2; nRet |= KEY_MOD2;
if( (nMask & NSCommandKeyMask) != 0 ) if( (nMask & NSCommandKeyMask) != 0 )
nRet |= KEY_MOD1; nRet |= KEY_MOD1;
SAL_WNODEPRECATED_DECLARATIONS_POP
return nRet; return nRet;
} }
@@ -152,8 +158,14 @@ static const struct ExceptionalKey
const unsigned int nModifierMask; const unsigned int nModifierMask;
} aExceptionalKeys[] = } aExceptionalKeys[] =
{ {
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSAlternateKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSCommandKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSControlKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSShiftKeyMask' is deprecated: first deprecated in macOS 10.12
{ KEY_D, NSControlKeyMask | NSShiftKeyMask | NSAlternateKeyMask }, { KEY_D, NSControlKeyMask | NSShiftKeyMask | NSAlternateKeyMask },
{ KEY_D, NSCommandKeyMask | NSShiftKeyMask | NSAlternateKeyMask } { KEY_D, NSCommandKeyMask | NSShiftKeyMask | NSAlternateKeyMask }
SAL_WNODEPRECATED_DECLARATIONS_POP
}; };
static AquaSalFrame* getMouseContainerFrame() static AquaSalFrame* getMouseContainerFrame()
@@ -827,7 +839,10 @@ private:
{ {
dX += [pEvent deltaX]; dX += [pEvent deltaX];
dY += [pEvent deltaY]; dY += [pEvent deltaY];
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSScrollWheelMask' is deprecated: first deprecated in macOS 10.12
NSEvent* pNextEvent = [NSApp nextEventMatchingMask: NSScrollWheelMask NSEvent* pNextEvent = [NSApp nextEventMatchingMask: NSScrollWheelMask
SAL_WNODEPRECATED_DECLARATIONS_POP
untilDate: nil inMode: NSDefaultRunLoopMode dequeue: YES ]; untilDate: nil inMode: NSDefaultRunLoopMode dequeue: YES ];
if( !pNextEvent ) if( !pNextEvent )
break; break;
@@ -887,7 +902,10 @@ private:
{ {
dX += [pEvent deltaX]; dX += [pEvent deltaX];
dY += [pEvent deltaY]; dY += [pEvent deltaY];
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSScrollWheelMask' is deprecated: first deprecated in macOS 10.12
NSEvent* pNextEvent = [NSApp nextEventMatchingMask: NSScrollWheelMask NSEvent* pNextEvent = [NSApp nextEventMatchingMask: NSScrollWheelMask
SAL_WNODEPRECATED_DECLARATIONS_POP
untilDate: nil inMode: NSDefaultRunLoopMode dequeue: YES ]; untilDate: nil inMode: NSDefaultRunLoopMode dequeue: YES ];
if( !pNextEvent ) if( !pNextEvent )
break; break;
@@ -973,8 +991,12 @@ private:
interpretKeyEvents (why?). Try to dispatch them here first, interpretKeyEvents (why?). Try to dispatch them here first,
if not successful continue normally if not successful continue normally
*/ */
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSAlternateKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSCommandKeyMask' is deprecated: first deprecated in macOS 10.12
if( (mpFrame->mnLastModifierFlags & (NSAlternateKeyMask | NSCommandKeyMask)) if( (mpFrame->mnLastModifierFlags & (NSAlternateKeyMask | NSCommandKeyMask))
== (NSAlternateKeyMask | NSCommandKeyMask) ) == (NSAlternateKeyMask | NSCommandKeyMask) )
SAL_WNODEPRECATED_DECLARATIONS_POP
{ {
if( [self sendSingleCharacter: mpLastEvent] ) if( [self sendSingleCharacter: mpLastEvent] )
return YES; return YES;
@@ -1044,6 +1066,12 @@ private:
// #i99567# // #i99567#
// find out the unmodified key code // find out the unmodified key code
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSAlternateKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSCommandKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSControlKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSKeyDown' is deprecated: first deprecated in macOS 10.12
// 'NSKeyUp' is deprecated: first deprecated in macOS 10.12
// sanity check // sanity check
if( mpLastEvent && ( [mpLastEvent type] == NSKeyDown || [mpLastEvent type] == NSKeyUp ) ) if( mpLastEvent && ( [mpLastEvent type] == NSKeyDown || [mpLastEvent type] == NSKeyUp ) )
{ {
@@ -1067,6 +1095,7 @@ private:
{ {
nLastModifiers = 0; nLastModifiers = 0;
} }
SAL_WNODEPRECATED_DECLARATIONS_POP
[self sendKeyInputAndReleaseToFrame: nKeyCode character: aCharCode modifiers: nLastModifiers]; [self sendKeyInputAndReleaseToFrame: nKeyCode character: aCharCode modifiers: nLastModifiers];
} }
else else
@@ -1119,7 +1148,10 @@ private:
-(void)moveLeftAndModifySelection: (id)aSender -(void)moveLeftAndModifySelection: (id)aSender
{ {
(void)aSender; (void)aSender;
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSShiftKeyMask' is deprecated: first deprecated in macOS 10.12
[self sendKeyInputAndReleaseToFrame: KEY_LEFT character: 0 modifiers: NSShiftKeyMask]; [self sendKeyInputAndReleaseToFrame: KEY_LEFT character: 0 modifiers: NSShiftKeyMask];
SAL_WNODEPRECATED_DECLARATIONS_POP
} }
-(void)moveBackwardAndModifySelection: (id)aSender -(void)moveBackwardAndModifySelection: (id)aSender
@@ -1137,7 +1169,10 @@ private:
-(void)moveRightAndModifySelection: (id)aSender -(void)moveRightAndModifySelection: (id)aSender
{ {
(void)aSender; (void)aSender;
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSShiftKeyMask' is deprecated: first deprecated in macOS 10.12
[self sendKeyInputAndReleaseToFrame: KEY_RIGHT character: 0 modifiers: NSShiftKeyMask]; [self sendKeyInputAndReleaseToFrame: KEY_RIGHT character: 0 modifiers: NSShiftKeyMask];
SAL_WNODEPRECATED_DECLARATIONS_POP
} }
-(void)moveForwardAndModifySelection: (id)aSender -(void)moveForwardAndModifySelection: (id)aSender

View File

@@ -373,6 +373,8 @@ void AquaSalInstance::wakeupYield()
if( mbWaitingYield ) if( mbWaitingYield )
{ {
SalData::ensureThreadAutoreleasePool(); SalData::ensureThreadAutoreleasePool();
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSApplicationDefined' is deprecated: first deprecated in macOS 10.12
NSEvent* pEvent = [NSEvent otherEventWithType: NSApplicationDefined NSEvent* pEvent = [NSEvent otherEventWithType: NSApplicationDefined
location: NSZeroPoint location: NSZeroPoint
modifierFlags: 0 modifierFlags: 0
@@ -382,6 +384,7 @@ void AquaSalInstance::wakeupYield()
subtype: AquaSalInstance::YieldWakeupEvent subtype: AquaSalInstance::YieldWakeupEvent
data1: 0 data1: 0
data2: 0 ]; data2: 0 ];
SAL_WNODEPRECATED_DECLARATIONS_POP
if( pEvent ) if( pEvent )
[NSApp postEvent: pEvent atStart: NO]; [NSApp postEvent: pEvent atStart: NO];
} }
@@ -620,7 +623,10 @@ SalYieldResult AquaSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents
{ {
sal_uLong nCount = ReleaseYieldMutex(); sal_uLong nCount = ReleaseYieldMutex();
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSAnyEventMask' is deprecated: first deprecated in macOS 10.12
pEvent = [NSApp nextEventMatchingMask: NSAnyEventMask untilDate: nil pEvent = [NSApp nextEventMatchingMask: NSAnyEventMask untilDate: nil
SAL_WNODEPRECATED_DECLARATIONS_POP
inMode: NSDefaultRunLoopMode dequeue: YES]; inMode: NSDefaultRunLoopMode dequeue: YES];
if( pEvent ) if( pEvent )
{ {
@@ -638,7 +644,10 @@ SalYieldResult AquaSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents
sal_uLong nCount = ReleaseYieldMutex(); sal_uLong nCount = ReleaseYieldMutex();
NSDate* pDt = AquaSalTimer::pRunningTimer ? [AquaSalTimer::pRunningTimer fireDate] : [NSDate distantFuture]; NSDate* pDt = AquaSalTimer::pRunningTimer ? [AquaSalTimer::pRunningTimer fireDate] : [NSDate distantFuture];
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSAnyEventMask' is deprecated: first deprecated in macOS 10.12
pEvent = [NSApp nextEventMatchingMask: NSAnyEventMask untilDate: pDt pEvent = [NSApp nextEventMatchingMask: NSAnyEventMask untilDate: pDt
SAL_WNODEPRECATED_DECLARATIONS_POP
inMode: NSDefaultRunLoopMode dequeue: YES]; inMode: NSDefaultRunLoopMode dequeue: YES];
if( pEvent ) if( pEvent )
[NSApp sendEvent: pEvent]; [NSApp sendEvent: pEvent];
@@ -740,6 +749,23 @@ bool AquaSalInstance::AnyInput( VclInputFlags nType )
return false; return false;
unsigned/*NSUInteger*/ nEventMask = 0; unsigned/*NSUInteger*/ nEventMask = 0;
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSFlagsChangedMask' is deprecated: first deprecated in macOS 10.12
// 'NSKeyDownMask' is deprecated: first deprecated in macOS 10.12
// 'NSKeyUpMask' is deprecated: first deprecated in macOS 10.12
// 'NSLeftMouseDownMask' is deprecated: first deprecated in macOS 10.12
// 'NSLeftMouseDraggedMask' is deprecated: first deprecated in macOS 10.12
// 'NSLeftMouseUpMask' is deprecated: first deprecated in macOS 10.12
// 'NSMouseEnteredMask' is deprecated: first deprecated in macOS 10.12
// 'NSMouseExitedMask' is deprecated: first deprecated in macOS 10.12
// 'NSOtherMouseDownMask' is deprecated: first deprecated in macOS 10.12
// 'NSOtherMouseDraggedMask' is deprecated: first deprecated in macOS 10.12
// 'NSOtherMouseUpMask' is deprecated: first deprecated in macOS 10.12
// 'NSRightMouseDownMask' is deprecated: first deprecated in macOS 10.12
// 'NSRightMouseDraggedMask' is deprecated: first deprecated in macOS 10.12
// 'NSRightMouseUpMask' is deprecated: first deprecated in macOS 10.12
// 'NSScrollWheelMask' is deprecated: first deprecated in macOS 10.12
// 'NSTabletPoint' is deprecated: first deprecated in macOS 10.12
if( nType & VclInputFlags::MOUSE) if( nType & VclInputFlags::MOUSE)
nEventMask |= nEventMask |=
NSLeftMouseDownMask | NSRightMouseDownMask | NSOtherMouseDownMask | NSLeftMouseDownMask | NSRightMouseDownMask | NSOtherMouseDownMask |
@@ -752,6 +778,7 @@ bool AquaSalInstance::AnyInput( VclInputFlags nType )
nEventMask |= NSKeyDownMask | NSKeyUpMask | NSFlagsChangedMask; nEventMask |= NSKeyDownMask | NSKeyUpMask | NSFlagsChangedMask;
if( nType & VclInputFlags::OTHER) if( nType & VclInputFlags::OTHER)
nEventMask |= NSTabletPoint; nEventMask |= NSTabletPoint;
SAL_WNODEPRECATED_DECLARATIONS_POP
// TODO: VclInputFlags::PAINT / more VclInputFlags::OTHER // TODO: VclInputFlags::PAINT / more VclInputFlags::OTHER
if( !bool(nType) ) if( !bool(nType) )
return false; return false;

View File

@@ -157,7 +157,10 @@ static void initAppMenu()
[pString release]; [pString release];
if( pNewItem ) if( pNewItem )
{ {
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSCommandKeyMask' is deprecated: first deprecated in macOS 10.12
[pNewItem setKeyEquivalentModifierMask: NSCommandKeyMask]; [pNewItem setKeyEquivalentModifierMask: NSCommandKeyMask];
SAL_WNODEPRECATED_DECLARATIONS_POP
[pNewItem setTarget: pMainMenuSelector]; [pNewItem setTarget: pMainMenuSelector];
[pAppMenu insertItem: [NSMenuItem separatorItem] atIndex: 3]; [pAppMenu insertItem: [NSMenuItem separatorItem] atIndex: 3];
} }
@@ -724,6 +727,11 @@ void AquaSalMenu::SetAccelerator( unsigned /*nPos*/, SalMenuItem* pSalMenuItem,
// should always use the command key // should always use the command key
int nItemModifier = 0; int nItemModifier = 0;
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSAlternateKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSCommandKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSControlKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSShiftKeyMask' is deprecated: first deprecated in macOS 10.12
if (nModifier & KEY_SHIFT) if (nModifier & KEY_SHIFT)
{ {
nItemModifier |= NSShiftKeyMask; // actually useful only for function keys nItemModifier |= NSShiftKeyMask; // actually useful only for function keys
@@ -739,6 +747,7 @@ void AquaSalMenu::SetAccelerator( unsigned /*nPos*/, SalMenuItem* pSalMenuItem,
if(nModifier & KEY_MOD3) if(nModifier & KEY_MOD3)
nItemModifier |= NSControlKeyMask; nItemModifier |= NSControlKeyMask;
SAL_WNODEPRECATED_DECLARATIONS_POP
AquaSalMenuItem *pAquaSalMenuItem = static_cast<AquaSalMenuItem *>(pSalMenuItem); AquaSalMenuItem *pAquaSalMenuItem = static_cast<AquaSalMenuItem *>(pSalMenuItem);
NSString* pString = CreateNSString( OUString( &nCommandKey, 1 ) ); NSString* pString = CreateNSString( OUString( &nCommandKey, 1 ) );

View File

@@ -99,6 +99,12 @@
// must still end up in the view. This is necessary to handle common edit actions in docked // must still end up in the view. This is necessary to handle common edit actions in docked
// windows (e.g. in toolbar fields). // windows (e.g. in toolbar fields).
NSEvent* pEvent = [NSApp currentEvent]; NSEvent* pEvent = [NSApp currentEvent];
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSAlternateKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSCommandKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSControlKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSKeyDown' is deprecated: first deprecated in macOS 10.12
// 'NSShiftKeyMask' is deprecated: first deprecated in macOS 10.12
if( pEvent && [pEvent type] == NSKeyDown ) if( pEvent && [pEvent type] == NSKeyDown )
{ {
unsigned int nModMask = ([pEvent modifierFlags] & (NSShiftKeyMask|NSControlKeyMask|NSAlternateKeyMask|NSCommandKeyMask)); unsigned int nModMask = ([pEvent modifierFlags] & (NSShiftKeyMask|NSControlKeyMask|NSAlternateKeyMask|NSCommandKeyMask));
@@ -114,6 +120,7 @@
return; return;
} }
} }
SAL_WNODEPRECATED_DECLARATIONS_POP
const AquaSalFrame* pFrame = mpMenuItem->mpParentMenu ? mpMenuItem->mpParentMenu->getFrame() : nullptr; const AquaSalFrame* pFrame = mpMenuItem->mpParentMenu ? mpMenuItem->mpParentMenu->getFrame() : nullptr;
if( pFrame && AquaSalFrame::isAlive( pFrame ) && ! pFrame->GetWindow()->IsInModalMode() ) if( pFrame && AquaSalFrame::isAlive( pFrame ) && ! pFrame->GetWindow()->IsInModalMode() )
@@ -173,7 +180,10 @@
aImgRect.origin.y = floor((aFrame.size.height - aFromRect.size.height)/2); aImgRect.origin.y = floor((aFrame.size.height - aFromRect.size.height)/2);
aImgRect.size = aFromRect.size; aImgRect.size = aFromRect.size;
if( rButtons[i].mpNSImage ) if( rButtons[i].mpNSImage )
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSCompositeSourceOver' is deprecated: first deprecated in macOS 10.12
[rButtons[i].mpNSImage drawInRect: aImgRect fromRect: aFromRect operation: NSCompositeSourceOver fraction: 1.0]; [rButtons[i].mpNSImage drawInRect: aImgRect fromRect: aFromRect operation: NSCompositeSourceOver fraction: 1.0];
SAL_WNODEPRECATED_DECLARATIONS_POP
aImgRect.origin.x += aFromRect.size.width + 2; aImgRect.origin.x += aFromRect.size.width + 2;
} }
} }

View File

@@ -68,6 +68,8 @@ void ImplSalStartTimer( sal_uLong nMS )
{ {
SalData::ensureThreadAutoreleasePool(); SalData::ensureThreadAutoreleasePool();
// post an event so we can get into the main thread // post an event so we can get into the main thread
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSApplicationDefined' is deprecated: first deprecated in macOS 10.12
NSEvent* pEvent = [NSEvent otherEventWithType: NSApplicationDefined NSEvent* pEvent = [NSEvent otherEventWithType: NSApplicationDefined
location: NSZeroPoint location: NSZeroPoint
modifierFlags: 0 modifierFlags: 0
@@ -77,6 +79,7 @@ void ImplSalStartTimer( sal_uLong nMS )
subtype: AquaSalInstance::AppStartTimerEvent subtype: AquaSalInstance::AppStartTimerEvent
data1: (int)nMS data1: (int)nMS
data2: 0 ]; data2: 0 ];
SAL_WNODEPRECATED_DECLARATIONS_POP
if( pEvent ) if( pEvent )
[NSApp postEvent: pEvent atStart: YES]; [NSApp postEvent: pEvent atStart: YES];
} }

View File

@@ -61,6 +61,8 @@
{ {
(void)pNotification; (void)pNotification;
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSApplicationDefined' is deprecated: first deprecated in macOS 10.12
NSEvent* pEvent = [NSEvent otherEventWithType: NSApplicationDefined NSEvent* pEvent = [NSEvent otherEventWithType: NSApplicationDefined
location: NSZeroPoint location: NSZeroPoint
modifierFlags: 0 modifierFlags: 0
@@ -70,6 +72,7 @@
subtype: AquaSalInstance::AppExecuteSVMain subtype: AquaSalInstance::AppExecuteSVMain
data1: 0 data1: 0
data2: 0 ]; data2: 0 ];
SAL_WNODEPRECATED_DECLARATIONS_POP
if( pEvent ) if( pEvent )
[NSApp postEvent: pEvent atStart: NO]; [NSApp postEvent: pEvent atStart: NO];
} }
@@ -77,6 +80,15 @@
-(void)sendEvent:(NSEvent*)pEvent -(void)sendEvent:(NSEvent*)pEvent
{ {
NSEventType eType = [pEvent type]; NSEventType eType = [pEvent type];
SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSAlternateKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSApplicationDefined' is deprecated: first deprecated in macOS 10.12
// 'NSClosableWindowMask' is deprecated: first deprecated in macOS 10.12
// 'NSCommandKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSControlKeyMask' is deprecated: first deprecated in macOS 10.12
// 'NSKeyDown' is deprecated: first deprecated in macOS 10.12
// 'NSMiniaturizableWindowMask' is deprecated: first deprecated in macOS 10.12
// 'NSShiftKeyMask' is deprecated: first deprecated in macOS 10.12
if( eType == NSApplicationDefined ) if( eType == NSApplicationDefined )
{ {
AquaSalInstance::handleAppDefinedEvent( pEvent ); AquaSalInstance::handleAppDefinedEvent( pEvent );
@@ -224,6 +236,7 @@
} }
} }
} }
SAL_WNODEPRECATED_DECLARATIONS_POP
[super sendEvent: pEvent]; [super sendEvent: pEvent];
} }