summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-10-16 10:13:46 +0300
committerTor Lillqvist <tml@collabora.com>2014-10-16 11:22:12 +0300
commitb02e958fa0bf7d062a5b8aff03d22325e3068feb (patch)
treee76ec94b574b2f371cbcfe88611dda27d8c80467 /vcl
parentf9aa686432c0ba62c6f440302d5a35856496a786 (diff)
MAC_OS_X_VERSION_MAX_ALLOWED is always >= 1080 now
Change-Id: Ieae67cbf917cdf4bca2b0d6c1697eddc6137dbe2
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/osx/salframe.h4
-rw-r--r--vcl/inc/osx/salframeview.h12
-rw-r--r--vcl/inc/quartz/salgdi.h9
-rw-r--r--vcl/osx/DropTarget.cxx8
-rw-r--r--vcl/osx/salframe.cxx38
-rw-r--r--vcl/osx/salframeview.mm53
-rw-r--r--vcl/osx/salinst.cxx5
-rw-r--r--vcl/osx/salmenu.cxx4
-rw-r--r--vcl/osx/salprn.cxx4
-rw-r--r--vcl/quartz/ctfonts.cxx6
-rw-r--r--vcl/quartz/ctlayout.cxx20
-rw-r--r--vcl/quartz/salgdi.cxx16
12 files changed, 2 insertions, 177 deletions
diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index 82bd117284ce..7611b6d7aa08 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -93,11 +93,7 @@ public:
sal_uLong mnICOptions;
// To prevent display sleep during presentation
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
- boost::shared_ptr< Timer > mpActivityTimer;
-#else
IOPMAssertionID mnAssertionID;
-#endif
public:
/** Constructor
diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h
index 7e957b67acc1..93f8b8f42634 100644
--- a/vcl/inc/osx/salframeview.h
+++ b/vcl/inc/osx/salframeview.h
@@ -22,11 +22,7 @@
#include "osx/a11ywrapper.h"
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-@interface SalFrameWindow : NSWindow
-#else
@interface SalFrameWindow : NSWindow<NSWindowDelegate>
-#endif
{
AquaSalFrame* mpFrame;
id mDraggingDestinationHandler;
@@ -63,11 +59,7 @@
-(void)unregisterDraggingDestinationHandler:(id)theHandler;
@end
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-@interface SalFrameView : AquaA11yWrapper <NSTextInput>
-#else
@interface SalFrameView : AquaA11yWrapper <NSTextInputClient>
-#endif
{
AquaSalFrame* mpFrame;
@@ -121,11 +113,7 @@
/*
text action methods
*/
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
--(void)insertText:(id)aString;
-#else
-(void)insertText:(id)aString replacementRange:(NSRange)replacementRange;
-#endif
-(void)insertTab: (id)aSender;
-(void)insertBacktab: (id)aSender;
-(void)moveLeft: (id)aSender;
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 45a12c4ee63b..23d3bb3904a9 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -29,15 +29,6 @@
#include <ApplicationServices/ApplicationServices.h>
#include "osx/osxvcltypes.h"
#include "osx/salframe.h"
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-// The following symbols are SPI (System Programming Interface) in 10.5.
-extern "C" {
- void CTRunGetAdvances(CTRunRef run, CFRange range, CGSize buffer[]);
- const CGSize* CTRunGetAdvancesPtr(CTRunRef run);
- extern const CFStringRef kCTTypesetterOptionForcedEmbeddingLevel;
-}
-#endif
#else
#include <CoreGraphics/CoreGraphics.h>
#include <CoreText/CoreText.h>
diff --git a/vcl/osx/DropTarget.cxx b/vcl/osx/DropTarget.cxx
index e8179a9ababa..7ee0f5b48e1e 100644
--- a/vcl/osx/DropTarget.cxx
+++ b/vcl/osx/DropTarget.cxx
@@ -264,17 +264,9 @@ NSDragOperation DropTarget::draggingUpdated(id sender)
}
if (dragOp == NSDragOperationNone)
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
- SetThemeCursor(kThemeNotAllowedCursor);
-#else
[[NSCursor operationNotAllowedCursor] set];
-#endif
else if (dragOp == NSDragOperationCopy)
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
- SetThemeCursor(kThemeCopyArrowCursor);
-#else
[[NSCursor dragCopyCursor] set];
-#endif
else
[[NSCursor arrowCursor] set];
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 43a0674da8da..f205caf2add7 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -37,11 +37,6 @@
#include "osx/a11yfactory.h"
#include "quartz/utils.h"
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-#include "vcl/timer.hxx"
-#include "osx/saltimer.h"
-#endif
-
#include "salwtype.hxx"
#include "premac.h"
@@ -198,11 +193,7 @@ void AquaSalFrame::initWindowAndView()
[mpNSWindow setAcceptsMouseMovedEvents: YES];
[mpNSWindow setHasShadow: YES];
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
- objc_msgSend(mpNSWindow, @selector(setDelegate:), mpNSWindow);
-#else
[mpNSWindow setDelegate: static_cast<id<NSWindowDelegate> >(mpNSWindow)];
-#endif
if( [mpNSWindow respondsToSelector: @selector(setRestorable:)])
{
@@ -759,27 +750,6 @@ void AquaSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay )
SendPaintEvent();
}
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-class PreventSleepTimer : public AutoTimer
-{
-public:
- PreventSleepTimer()
- {
- SetTimeout( 30000 );
- Start();
- }
-
- virtual ~PreventSleepTimer()
- {
- }
-
- virtual void Timeout() SAL_OVERRIDE
- {
- UpdateSystemActivity(OverallAct);
- }
-};
-#endif
-
void AquaSalFrame::StartPresentation( bool bStart )
{
if ( !mpNSWindow )
@@ -791,14 +761,10 @@ void AquaSalFrame::StartPresentation( bool bStart )
if( bStart )
{
GetSalData()->maPresentationFrames.push_back( this );
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
- mpActivityTimer.reset( new PreventSleepTimer() );
-#else /* OS X 10.6 and above */
IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep,
kIOPMAssertionLevelOn,
CFSTR("LibreOffice presentation running"),
&mnAssertionID);
-#endif
[mpNSWindow setLevel: NSPopUpMenuWindowLevel];
if( mbShown )
[mpNSWindow makeMainWindow];
@@ -806,11 +772,7 @@ void AquaSalFrame::StartPresentation( bool bStart )
else
{
GetSalData()->maPresentationFrames.remove( this );
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
- mpActivityTimer.reset();
-#else
IOPMAssertionRelease(mnAssertionID);
-#endif
[mpNSWindow setLevel: NSNormalWindowLevel];
}
}
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 8e74086e3dc7..74404365eb67 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -34,14 +34,6 @@
#define WHEEL_EVENT_FACTOR 1.5
-// for allowing fullscreen support on deployment targets < OSX 10.7
-#if !defined(MAC_OS_X_VERSION_10_7)
- #define NSWindowCollectionBehaviorFullScreenPrimary (1 << 7)
- #define NSWindowCollectionBehaviorFullScreenAuxiliary (1 << 8)
-// #define NSFullScreenWindowMask (1 << 14)
-#endif
-
-
static sal_uInt16 ImplGetModifierMask( unsigned int nMask )
{
sal_uInt16 nRet = 0;
@@ -166,18 +158,6 @@ static const struct ExceptionalKey
static AquaSalFrame* getMouseContainerFrame()
{
AquaSalFrame* pDispatchFrame = NULL;
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
- NSInteger nWindows = 0;
- NSCountWindows( &nWindows );
- NSInteger* pWindows = (NSInteger*)alloca( nWindows * sizeof(NSInteger) );
- NSWindowList( nWindows, pWindows ); // NSWindowList is supposed to be in z-order front to back
- for(int i = 0; i < nWindows && ! pDispatchFrame; i++ )
- {
- NSWindow* pWin = [NSApp windowWithWindowNumber: pWindows[i]];
- if( pWin && [pWin isMemberOfClass: [SalFrameWindow class]] && [(SalFrameWindow*)pWin containsMouse] )
- pDispatchFrame = [(SalFrameWindow*)pWin getSalFrame];
- }
-#else
NSArray* aWindows = [NSWindow windowNumbersWithOptions:0];
for(NSUInteger i = 0; i < [aWindows count] && ! pDispatchFrame; i++ )
{
@@ -185,7 +165,6 @@ static AquaSalFrame* getMouseContainerFrame()
if( pWin && [pWin isMemberOfClass: [SalFrameWindow class]] && [(SalFrameWindow*)pWin containsMouse] )
pDispatchFrame = [(SalFrameWindow*)pWin getSalFrame];
}
-#endif
return pDispatchFrame;
}
@@ -776,19 +755,11 @@ private:
if( bNewSeries )
mfMagnifyDeltaSum = 0.0;
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
- mfMagnifyDeltaSum += [pEvent deltaZ];
-#else
mfMagnifyDeltaSum += [pEvent magnification];
-#endif
mfLastMagnifyTime = [pEvent timestamp];
// TODO: change to 0.1 when COMMAND_WHEEL_ZOOM handlers allow finer zooming control
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
- static const float fMagnifyFactor = 0.25;
-#else
static const float fMagnifyFactor = 0.25*500; // steps are 500 times smaller for -magnification
-#endif
static const float fMinMagnifyStep = 15.0 / fMagnifyFactor;
if( fabs(mfMagnifyDeltaSum) <= fMinMagnifyStep )
return;
@@ -1041,15 +1012,9 @@ private:
}
}
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
--(void)insertText:(id)aString
-#else
-(void)insertText:(id)aString replacementRange:(NSRange)replacementRange
-#endif
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
(void) replacementRange; // FIXME: surely it must be used
-#endif
YIELD_GUARD;
@@ -1619,15 +1584,9 @@ private:
return mSelectedRange;
}
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-- (void)setMarkedText:(id)aString selectedRange:(NSRange)selRange
-#else
- (void)setMarkedText:(id)aString selectedRange:(NSRange)selRange replacementRange:(NSRange)replacementRange
-#endif
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
(void) replacementRange; // FIXME - use it!
-#endif
YIELD_GUARD;
@@ -1697,16 +1656,10 @@ private:
mSelectedRange = mMarkedRange = NSMakeRange(NSNotFound, 0);
}
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-- (NSAttributedString *)attributedSubstringFromRange:(NSRange)aRange
-#else
- (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange
-#endif
{
(void) aRange;
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
(void) actualRange;
-#endif
// FIXME - Implement
return nil;
@@ -1750,17 +1703,11 @@ private:
mpLastEvent = nil;
}
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-- (NSRect)firstRectForCharacterRange:(NSRange)aRange
-#else
- (NSRect)firstRectForCharacterRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange
-#endif
{
// FIXME - These should probably be used?
(void) aRange;
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
(void) actualRange;
-#endif
YIELD_GUARD;
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index d8adf03893e2..71758b6b1da4 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -1046,12 +1046,7 @@ NSImage* CreateNSImage( const Image& rImage )
NSImage* pImage = [[NSImage alloc] initWithSize: NSMakeSize( aSize.Width(), aSize.Height() )];
if( pImage )
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
- [pImage setFlipped:YES];
- [pImage lockFocus];
-#else
[pImage lockFocusFlipped:YES];
-#endif
NSGraphicsContext* pContext = [NSGraphicsContext currentContext];
CGContextRef rCGContext = reinterpret_cast<CGContextRef>([pContext graphicsPort]);
diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index 47129b9a9c04..f7234496ae03 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -246,11 +246,7 @@ AquaSalMenu::AquaSalMenu( bool bMenuBar ) :
if( ! mbMenuBar )
{
mpMenu = [[SalNSMenu alloc] initWithMenu: this];
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
- objc_msgSend(mpMenu, @selector(setDelegate:), mpMenu);
-#else
[mpMenu setDelegate: (id<NSMenuDelegate>)mpMenu];
-#endif
}
else
{
diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx
index 52c090243087..9440bb3eec7d 100644
--- a/vcl/osx/salprn.cxx
+++ b/vcl/osx/salprn.cxx
@@ -462,11 +462,7 @@ bool AquaSalInfoPrinter::StartJob( const OUString* i_pFileName,
{
[mpPrintInfo setJobDisposition: NSPrintSaveJob];
NSString* pPath = CreateNSString( *i_pFileName );
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
- [pPrintDict setObject:[NSURL fileURLWithPath:pPath] forKey:NSPrintSavePath];
-#else
[pPrintDict setObject:[NSURL fileURLWithPath:pPath] forKey:NSPrintJobSavingURL];
-#endif
[pPath release];
}
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 8a06d3b7dd10..a11453cc6d98 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -83,13 +83,9 @@ CoreTextStyle::CoreTextStyle( const FontSelectPattern& rFSD )
((mpFontData->GetWeight() < WEIGHT_SEMIBOLD) &&
(mpFontData->GetWeight() != WEIGHT_DONTKNOW)) )
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
int nStroke = -10.0;
CFNumberRef rStroke = CFNumberCreate(NULL, kCFNumberSInt32Type, &nStroke);
CFDictionarySetValue(mpStyleDict, kCTStrokeWidthAttributeName, rStroke);
-#else /* kCTStrokeWidthAttributeName is not available */
- /* do we really need "fake" bold? */
-#endif
}
// fake italic
@@ -319,10 +315,8 @@ ImplDevFontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool
// get font-enabled status
if( bFontEnabled ) {
int bEnabled = TRUE; // by default (and when we're on OS X < 10.6) it's "enabled"
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
CFNumberRef pEnabled = (CFNumberRef)CTFontDescriptorCopyAttribute( pFD, kCTFontEnabledAttribute );
CFNumberGetValue( pEnabled, kCFNumberIntType, &bEnabled );
-#endif
*bFontEnabled = bEnabled;
}
diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index cd9771a072e5..a0bcd243799f 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -267,11 +267,6 @@ void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs )
// - CoreText handles spaces specially (in particular at the text end)
if( mnTrailingSpaceCount )
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1060
- // don't recreate line layout here, because this can lead to problems
- // (looks like internal issues inside early CoreText versions)
- mfTrailingSpaceWidth = CTLineGetTrailingWhitespaceWidth( mpCTLine );
-#else
if(mfTrailingSpaceWidth <= 0.0)
{
mfTrailingSpaceWidth = CTLineGetTrailingWhitespaceWidth( mpCTLine );
@@ -296,7 +291,7 @@ void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs )
SAL_INFO( "vcl.ct", "CTLineCreateWithAttributedString(\"" << GetOUString(aCFText) << "\") = " << mpCTLine );
CFRelease( pAttrStr );
CFRelease( aCFText );
-#endif
+
// in RTL-layouts trailing spaces are leftmost
// TODO: use BiDi-algorithm to thoroughly check this assumption
if( rArgs.mnFlags & SAL_LAYOUT_BIDI_RTL)
@@ -304,12 +299,9 @@ void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs )
mfBaseAdv = mfTrailingSpaceWidth;
}
}
-#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1060
- CTLineRef pNewCTLine = CTLineCreateJustifiedLine( mpCTLine, 1.0, nPixelWidth - mfTrailingSpaceWidth );
-#else
CTLineRef pNewCTLine = CTLineCreateJustifiedLine( mpCTLine, 1.0, nPixelWidth);
SAL_INFO( "vcl.ct", "CTLineCreateJustifiedLine(" << mpCTLine << ",1.0," << nPixelWidth << ") = " << pNewCTLine );
-#endif
+
if( !pNewCTLine )
{
// CTLineCreateJustifiedLine can and does fail
@@ -323,11 +315,7 @@ void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs )
SAL_INFO( "vcl.ct", "CFRelease(" << mpCTLine << ")" );
CFRelease( mpCTLine );
mpCTLine = pNewCTLine;
-#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1060
- mfCachedWidth = nPixelWidth;
-#else
mfCachedWidth = nPixelWidth + mfTrailingSpaceWidth;
-#endif
}
}
@@ -382,13 +370,9 @@ bool CTLayout::DrawTextSpecial( SalGraphics& rGraphics, sal_uInt32 flags ) const
CFDictionaryGetCount(mpTextStyle->GetStyleDict()),
mpTextStyle->GetStyleDict());
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
- /* just don't do 'kCTStrokeWidthAttributeName' */
-#else
int nStroke = 2;
CFNumberRef rStroke = CFNumberCreate(NULL, kCFNumberSInt32Type, &nStroke);
CFDictionarySetValue(styledict, kCTStrokeWidthAttributeName, rStroke);
-#endif
CFAttributedStringRef pAttrStr = CFAttributedStringCreate(
NULL,
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index d33e570d564e..2462ec00ecb4 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -339,28 +339,12 @@ static bool AddTempDevFont(const OUString& rFontFileURL)
bool success = false;
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
CFErrorRef error;
success = CTFontManagerRegisterFontsForURL(rFontURL, kCTFontManagerScopeProcess, &error);
if (!success)
{
CFRelease(error);
}
-#else /* CTFontManagerRegisterFontsForURL is not available on OS X <10.6 */
- CGDataProviderRef dataProvider = CGDataProviderCreateWithURL(rFontURL);
- CGFontRef graphicsFont = CGFontCreateWithDataProvider(dataProvider);
- if (graphicsFont)
- {
- CTFontRef coreTextFont = CTFontCreateWithGraphicsFont(graphicsFont, /*fontSize*/ 0, /*matrix*/ NULL, /*attributes*/ NULL);
- if (coreTextFont)
- {
- success = true;
- CFRelease(coreTextFont);
- }
- CGFontRelease(graphicsFont);
- }
- CGDataProviderRelease(dataProvider);
-#endif
return success;
}