diff options
author | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-30 16:09:14 +0000 |
---|---|---|
committer | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-30 16:09:14 +0000 |
commit | 43016609b3fe8630b53cd0ed6f331a239f9e5142 (patch) | |
tree | 7ffd8d4f9999fc95937baf8cd7e7a8b90da310b7 /base/mac | |
parent | e70af14f185e44efa93be6df2568fea3953417c0 (diff) | |
download | chromium_src-43016609b3fe8630b53cd0ed6f331a239f9e5142.zip chromium_src-43016609b3fe8630b53cd0ed6f331a239f9e5142.tar.gz chromium_src-43016609b3fe8630b53cd0ed6f331a239f9e5142.tar.bz2 |
[Mac] Move the large block of NSEvent forward declarations to a shared header.
BUG=none
R=mark@chromium.org
Review URL: https://codereview.chromium.org/15979009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203155 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/mac')
-rw-r--r-- | base/mac/sdk_forward_declarations.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/base/mac/sdk_forward_declarations.h b/base/mac/sdk_forward_declarations.h new file mode 100644 index 0000000..387400d --- /dev/null +++ b/base/mac/sdk_forward_declarations.h @@ -0,0 +1,48 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This file contains forward declarations for items in later SDKs than the +// default one with which Chromium is built (currently 10.6). + +#ifndef BASE_MAC_SDK_FORWARD_DECLARATIONS_H_ +#define BASE_MAC_SDK_FORWARD_DECLARATIONS_H_ + +#if !defined(MAC_OS_X_VERSION_10_7) || \ + MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 +enum { + NSEventPhaseNone = 0, // event not associated with a phase. + NSEventPhaseBegan = 0x1 << 0, + NSEventPhaseStationary = 0x1 << 1, + NSEventPhaseChanged = 0x1 << 2, + NSEventPhaseEnded = 0x1 << 3, + NSEventPhaseCancelled = 0x1 << 4, +}; +typedef NSUInteger NSEventPhase; + +enum { + NSEventSwipeTrackingLockDirection = 0x1 << 0, + NSEventSwipeTrackingClampGestureAmount = 0x1 << 1, +}; +typedef NSUInteger NSEventSwipeTrackingOptions; + +@interface NSEvent (LionSDK) ++ (BOOL)isSwipeTrackingFromScrollEventsEnabled; + +- (NSEventPhase)phase; +- (CGFloat)scrollingDeltaX; +- (CGFloat)scrollingDeltaY; +- (void)trackSwipeEventWithOptions:(NSEventSwipeTrackingOptions)options + dampenAmountThresholdMin:(CGFloat)minDampenThreshold + max:(CGFloat)maxDampenThreshold + usingHandler:(void (^)(CGFloat gestureAmount, + NSEventPhase phase, + BOOL isComplete, + BOOL *stop))trackingHandler; + +- (BOOL)isDirectionInvertedFromDevice; + +@end +#endif // MAC_OS_X_VERSION_10_7 + +#endif // BASE_MAC_SDK_FORWARD_DECLARATIONS_H_ |