Revision: 5568
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5568&view=rev
Author:   hofman
Date:     2009-08-19 20:50:59 +0000 (Wed, 19 Aug 2009)

Log Message:
-----------
hidden pref to disable pinch zoom

Modified Paths:
--------------
    trunk/SKPDFView.m
    trunk/SKSecondaryPDFView.m
    trunk/SKSnapshotPDFView.m
    trunk/SKStringConstants.h
    trunk/SKStringConstants.m

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2009-08-17 23:23:58 UTC (rev 5567)
+++ trunk/SKPDFView.m   2009-08-19 20:50:59 UTC (rev 5568)
@@ -101,7 +101,6 @@
 #define SKMoveReadingBarModifiersKey @"SKMoveReadingBarModifiers"
 #define SKResizeReadingBarModifiersKey @"SKResizeReadingBarModifiers"
 #define SKDisableUpdateContentsFromEnclosedTextKey 
@"SKDisableUpdateContentsFromEnclosedText"
-
 #define SKDefaultFreeTextNoteContentsKey @"SKDefaultFreeTextNoteContents"
 #define SKDefaultAnchoredNoteContentsKey @"SKDefaultAnchoredNoteContents"
 
@@ -1557,7 +1556,7 @@
 }
 
 - (void)magnifyWithEvent:(NSEvent *)theEvent {
-    if (interactionMode != SKPresentationMode && [[SKPDFView superclass] 
instancesRespondToSelector:_cmd])
+    if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKDisablePinchZoomKey] == NO && interactionMode != 
SKPresentationMode && [[SKPDFView superclass] instancesRespondToSelector:_cmd])
         [super magnifyWithEvent:theEvent];
 }
 

Modified: trunk/SKSecondaryPDFView.m
===================================================================
--- trunk/SKSecondaryPDFView.m  2009-08-17 23:23:58 UTC (rev 5567)
+++ trunk/SKSecondaryPDFView.m  2009-08-19 20:50:59 UTC (rev 5568)
@@ -46,6 +46,7 @@
 #import "SKHighlightingPopUpButton.h"
 #import "SKPDFDocument.h"
 #import "SKPDFSynchronizer.h"
+#import "SKStringConstants.h"
 
 
 @interface NSResponder (BDSKGesturesPrivate)
@@ -562,7 +563,7 @@
 }
 
 - (void)magnifyWithEvent:(NSEvent *)theEvent {
-    if ([theEvent respondsToSelector:@selector(magnification)]) {
+    if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKDisablePinchZoomKey] == NO && [theEvent 
respondsToSelector:@selector(magnification)]) {
         pinchZoomFactor *= 1.0 + SKMax(-0.5, SKMin(1.0 , [theEvent 
magnification]));
         CGFloat scaleFactor = pinchZoomFactor * [self scaleFactor];
         NSUInteger i = [self indexForScaleFactor:SKMax(scaleFactor, 
SKMinDefaultScaleMenuFactor)];

Modified: trunk/SKSnapshotPDFView.m
===================================================================
--- trunk/SKSnapshotPDFView.m   2009-08-17 23:23:58 UTC (rev 5567)
+++ trunk/SKSnapshotPDFView.m   2009-08-19 20:50:59 UTC (rev 5568)
@@ -44,6 +44,7 @@
 #import "PDFPage_SKExtensions.h"
 #import "SKPDFDocument.h"
 #import "SKPDFSynchronizer.h"
+#import "SKStringConstants.h"
 
 
 @implementation SKSnapshotPDFView
@@ -414,7 +415,7 @@
 }
 
 - (void)magnifyWithEvent:(NSEvent *)theEvent {
-    if ([theEvent respondsToSelector:@selector(magnification)]) {
+    if ([[NSUserDefaults standardUserDefaults] 
boolForKey:SKDisablePinchZoomKey] == NO && [theEvent 
respondsToSelector:@selector(magnification)]) {
         pinchZoomFactor *= 1.0 + SKMax(-0.5, SKMin(1.0 , [theEvent 
magnification]));
         CGFloat scaleFactor = pinchZoomFactor * [self scaleFactor];
         NSUInteger i = [self indexForScaleFactor:SKMax(scaleFactor, 
SKMinDefaultScaleMenuFactor)];

Modified: trunk/SKStringConstants.h
===================================================================
--- trunk/SKStringConstants.h   2009-08-17 23:23:58 UTC (rev 5567)
+++ trunk/SKStringConstants.h   2009-08-19 20:50:59 UTC (rev 5568)
@@ -120,3 +120,4 @@
 extern NSString *SKShouldSetCreatorCodeKey;
 extern NSString *SKTableFontSizeKey;
 extern NSString *SKSequentialPageNumberingKey;
+extern NSString *SKDisablePinchZoomKey;

Modified: trunk/SKStringConstants.m
===================================================================
--- trunk/SKStringConstants.m   2009-08-17 23:23:58 UTC (rev 5567)
+++ trunk/SKStringConstants.m   2009-08-19 20:50:59 UTC (rev 5568)
@@ -121,3 +121,4 @@
 NSString *SKShouldSetCreatorCodeKey = @"SKShouldSetCreatorCode";
 NSString *SKTableFontSizeKey = @"SKTableFontSize";
 NSString *SKSequentialPageNumberingKey = @"SKSequentialPageNumbering";
+NSString *SKDisablePinchZoomKey = @"SKDisablePinchZoom";


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to