Revision: 3361
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3361&view=rev
Author:   hofman
Date:     2008-01-09 04:49:07 -0800 (Wed, 09 Jan 2008)

Log Message:
-----------
Add hidden defaults for reading bar navigation.

Modified Paths:
--------------
    trunk/SKPDFView.m

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2008-01-09 12:21:38 UTC (rev 3360)
+++ trunk/SKPDFView.m   2008-01-09 12:49:07 UTC (rev 3361)
@@ -77,7 +77,12 @@
 static NSString *SKSmallMagnificationHeightKey = @"SKSmallMagnificationHeight";
 static NSString *SKLargeMagnificationWidthKey = @"SKLargeMagnificationWidth";
 static NSString *SKLargeMagnificationHeightKey = @"SKLargeMagnificationHeight";
+static NSString *SKMoveReadingBarModifiersKey = @"SKMoveReadingBarModifiers";
+static NSString *SKResizeReadingBarModifiersKey = 
@"SKResizeReadingBarModifiers";
 
+static unsigned int moveReadingBarModifiers = NSAlternateKeyMask;
+static unsigned int resizeReadingBarModifiers = NSAlternateKeyMask | 
NSShiftKeyMask;
+
 #define ANCHORED_NOTE_SIZE SKMakeSquareSize(16.0)
 
 static inline int SKIndexOfRectAtYInOrderedRects(float y,  NSArray 
*rectValues, BOOL lower);
@@ -162,12 +167,15 @@
 + (void)initialize {
     OBINITIALIZE;
     
-    static BOOL initialized = NO;
-    if (initialized == YES) return;
-    initialized = YES;
- 
     NSArray *sendTypes = [NSArray arrayWithObjects:NSPDFPboardType, 
NSTIFFPboardType, nil];
     [NSApp registerServicesMenuSendTypes:sendTypes returnTypes:nil];
+    
+    NSNumber *moveReadingBarModifiersNumber = [[NSUserDefaults 
standardUserDefaults] objectForKey:SKMoveReadingBarModifiersKey];
+    NSNumber *resizeReadingBarModifiersNumber = [[NSUserDefaults 
standardUserDefaults] objectForKey:SKResizeReadingBarModifiersKey];
+    if (moveReadingBarModifiersNumber)
+        moveReadingBarModifiers = [moveReadingBarModifiersNumber 
unsignedIntValue];
+    if (resizeReadingBarModifiersNumber)
+        resizeReadingBarModifiers = [resizeReadingBarModifiersNumber 
unsignedIntValue];
 }
 
 - (void)commonInitialization {
@@ -908,6 +916,10 @@
         // backtab is a bit inconsistent, it seems Shift+Tab gives a 
Shift-BackTab key event, I would have expected either Shift-Tab (as for the raw 
event) or BackTab (as for most shift-modified keys)
         } else if (([self toolMode] == SKTextToolMode || [self toolMode] == 
SKNoteToolMode) && (((eventChar == NSBackTabCharacter) && (modifiers == 
(NSAlternateKeyMask | NSShiftKeyMask))) || ((eventChar == NSBackTabCharacter) 
&& (modifiers == NSAlternateKeyMask)) || ((eventChar == NSTabCharacter) && 
(modifiers == NSAlternateKeyMask)))) {
             [self selectPreviousActiveAnnotation:self];
+        } else if ([self hasReadingBar] && (eventChar == 
NSRightArrowFunctionKey || eventChar == NSLeftArrowFunctionKey || eventChar == 
NSUpArrowFunctionKey || eventChar == NSDownArrowFunctionKey) && (modifiers == 
moveReadingBarModifiers)) {
+            [self moveReadingBarForKey:eventChar];
+        } else if ([self hasReadingBar] && (eventChar == NSUpArrowFunctionKey 
|| eventChar == NSDownArrowFunctionKey) && (modifiers == 
resizeReadingBarModifiers)) {
+            [self resizeReadingBarForKey:eventChar];
         } else if ((eventChar == NSRightArrowFunctionKey) && (modifiers == 
(NSCommandKeyMask | NSAlternateKeyMask))) {
             [self setToolMode:(toolMode + 1) % 5];
         } else if ((eventChar == NSLeftArrowFunctionKey) && (modifiers == 
(NSCommandKeyMask | NSAlternateKeyMask))) {
@@ -920,10 +932,6 @@
             [self moveActiveAnnotationForKey:eventChar byAmount:(modifiers & 
NSShiftKeyMask) ? 10.0 : 1.0];
         } else if ([activeAnnotation isNoteAnnotation] && [activeAnnotation 
isResizable] && (eventChar == NSRightArrowFunctionKey || eventChar == 
NSLeftArrowFunctionKey || eventChar == NSUpArrowFunctionKey || eventChar == 
NSDownArrowFunctionKey) && (modifiers == NSControlKeyMask || modifiers == 
(NSControlKeyMask | NSShiftKeyMask))) {
             [self resizeActiveAnnotationForKey:eventChar byAmount:(modifiers & 
NSShiftKeyMask) ? 10.0 : 1.0];
-        } else if ([self hasReadingBar] && (eventChar == 
NSRightArrowFunctionKey || eventChar == NSLeftArrowFunctionKey || eventChar == 
NSUpArrowFunctionKey || eventChar == NSDownArrowFunctionKey) && (modifiers == 
NSAlternateKeyMask)) {
-            [self moveReadingBarForKey:eventChar];
-        } else if ([self hasReadingBar] && (eventChar == NSUpArrowFunctionKey 
|| eventChar == NSDownArrowFunctionKey) && (modifiers == (NSAlternateKeyMask | 
NSShiftKeyMask))) {
-            [self resizeReadingBarForKey:eventChar];
         } else if ([self toolMode] == SKNoteToolMode && modifiers == 0 && 
eventChar == 't') {
             [self setAnnotationMode:SKFreeTextNote];
         } else if ([self toolMode] == SKNoteToolMode && modifiers == 0 && 
eventChar == 'n') {


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

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to