diff options
author | nyamatongwe <nyamatongwe@gmail.com> | 2012-06-07 14:24:29 +1000 |
---|---|---|
committer | nyamatongwe <nyamatongwe@gmail.com> | 2012-06-07 14:24:29 +1000 |
commit | d732def6ae09c7434ace89f14c9094016b215912 (patch) | |
tree | 3ebdeb14efa1ca01a5ab46774a6cfb27b62c1529 | |
parent | ff4e99df2cb0d2fdfec09c7ddd538b862e156c6c (diff) | |
download | scintilla-mirror-d732def6ae09c7434ace89f14c9094016b215912.tar.gz |
Protect against APIs only available on 10.6+ when building for 10.5.
-rw-r--r-- | cocoa/ScintillaCocoa.mm | 14 | ||||
-rw-r--r-- | cocoa/ScintillaView.mm | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index 0518d292d..afb0d35cb 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -15,7 +15,9 @@ */ #import <Cocoa/Cocoa.h> +#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 #import <QuartzCore/CAGradientLayer.h> +#endif #import <QuartzCore/CAAnimation.h> #import <QuartzCore/CATransaction.h> @@ -137,6 +139,10 @@ static const KeyToCommand macMapDefault[] = //-------------------------------------------------------------------------------------------------- +#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 + +// Only implement FindHighlightLayer on OS X 10.6+ + /** * Class to display the animated gold roundrect used on OS X for matches. */ @@ -295,6 +301,8 @@ const CGFloat paddingHighlightY = 2; @end +#endif + //-------------------------------------------------------------------------------------------------- @implementation TimerTarget @@ -2038,6 +2046,7 @@ void ScintillaCocoa::ActiveStateChanged(bool isActive) void ScintillaCocoa::ShowFindIndicatorForRange(NSRange charRange, BOOL retaining) { +#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 NSView *content = ContentView(); if (!layerFindIndicator) { @@ -2078,10 +2087,12 @@ void ScintillaCocoa::ShowFindIndicatorForRange(NSRange charRange, BOOL retaining { [layerFindIndicator hideMatch]; } +#endif } void ScintillaCocoa::MoveFindIndicatorWithBounce(BOOL bounce) { +#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 if (layerFindIndicator) { NSView *content = ContentView(); @@ -2091,14 +2102,17 @@ void ScintillaCocoa::MoveFindIndicatorWithBounce(BOOL bounce) ptText.y = rcBounds.size.height - WndProc(SCI_POINTYFROMPOSITION, 0, layerFindIndicator.positionFind); [layerFindIndicator animateMatch:ptText bounce:bounce]; } +#endif } void ScintillaCocoa::HideFindIndicator() { +#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 if (layerFindIndicator) { [layerFindIndicator hideMatch]; } +#endif } diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm index 67d79665e..3cdc612c7 100644 --- a/cocoa/ScintillaView.mm +++ b/cocoa/ScintillaView.mm @@ -642,6 +642,7 @@ NSString *SCIUpdateUINotification = @"SCIUpdateUI"; */ - (void) magnifyWithEvent: (NSEvent *) event { +#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 CGFloat z = [event magnification]; // Zoom out or in 1pt depending on sign of magnification event value (0.0 = no change) @@ -649,6 +650,7 @@ NSString *SCIUpdateUINotification = @"SCIUpdateUI"; [ScintillaView directCall: self message: SCI_ZOOMOUT wParam: 0 lParam: 0]; else if (z >= 0.0) [ScintillaView directCall: self message: SCI_ZOOMIN wParam: 0 lParam: 0]; +#endif } //-------------------------------------------------------------------------------------------------- |