Revision: 5444
http://skim-app.svn.sourceforge.net/skim-app/?rev=5444&view=rev
Author: hofman
Date: 2009-06-22 17:09:04 +0000 (Mon, 22 Jun 2009)
Log Message:
-----------
reimplement swipe gesture handler in presentation mode when transition is active
Modified Paths:
--------------
trunk/NSResponder_SKExtensions.h
trunk/SKPDFView.m
Modified: trunk/NSResponder_SKExtensions.h
===================================================================
--- trunk/NSResponder_SKExtensions.h 2009-06-21 22:02:27 UTC (rev 5443)
+++ trunk/NSResponder_SKExtensions.h 2009-06-22 17:09:04 UTC (rev 5444)
@@ -51,6 +51,7 @@
@interface NSResponder (SKLeopardGestures)
- (void)magnifyWithEvent:(NSEvent *)theEvent;
- (void)rotateWithEvent:(NSEvent *)theEvent;
+- (void)swipeWithEvent:(NSEvent *)theEvent;
- (void)beginGestureWithEvent:(NSEvent *)theEvent;
- (void)endGestureWithEvent:(NSEvent *)theEvent;
@end
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2009-06-21 22:02:27 UTC (rev 5443)
+++ trunk/SKPDFView.m 2009-06-22 17:09:04 UTC (rev 5444)
@@ -1549,6 +1549,20 @@
[super magnifyWithEvent:theEvent];
}
+- (void)swipeWithEvent:(NSEvent *)theEvent {
+ if (interactionMode == SKPresentationMode && transitionController &&
[transitionController transitionStyle] != SKNoTransition) {
+ if ([theEvent deltaX] < 0.0 || [theEvent deltaY] < 0.0) {
+ if ([self canGoToNextPage])
+ [self goToNextPage:nil];
+ } else if ([theEvent deltaX] > 0.0 || [theEvent deltaY] > 0.0) {
+ if ([self canGoToPreviousPage])
+ [self goToPreviousPage:nil];
+ }
+ } else if ([[SKPDFView superclass] instancesRespondToSelector:_cmd]) {
+ [super swipeWithEvent:theEvent];
+ }
+}
+
- (void)checkSpellingStartingAtIndex:(NSInteger)anIndex onPage:(PDFPage *)page
{
NSUInteger i, first = [page pageIndex];
NSUInteger count = [[self document] pageCount];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit