Revision: 3811
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3811&view=rev
Author:   hofman
Date:     2008-04-24 08:19:18 -0700 (Thu, 24 Apr 2008)

Log Message:
-----------
Use appkit version number instead of gestalt.

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

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2008-04-24 15:00:24 UTC (rev 3810)
+++ trunk/SKPDFView.m   2008-04-24 15:19:18 UTC (rev 3811)
@@ -70,6 +70,9 @@
 #import "PDFDisplayView_SKExtensions.h"
 #import "SKAccessibilityPDFAnnotationElement.h"
 
+#define ANNOTATION_MODE_COUNT 8
+#define TOOL_MODE_COUNT 5
+
 NSString *SKPDFViewToolModeChangedNotification = 
@"SKPDFViewToolModeChangedNotification";
 NSString *SKPDFViewAnnotationModeChangedNotification = 
@"SKPDFViewAnnotationModeChangedNotification";
 NSString *SKPDFViewActiveAnnotationDidChangeNotification = 
@"SKPDFViewActiveAnnotationDidChangeNotification";
@@ -981,9 +984,9 @@
         } else if ([self hasReadingBar] && isUpDownArrow && (modifiers == 
resizeReadingBarModifiers)) {
             [self doResizeReadingBarForKey:eventChar];
         } else if (isLeftRightArrow && (modifiers == (NSCommandKeyMask | 
NSAlternateKeyMask))) {
-            [self setToolMode:(toolMode + (eventChar == 
NSRightArrowFunctionKey ? 1 : 4)) % 5];
+            [self setToolMode:(toolMode + (eventChar == 
NSRightArrowFunctionKey ? 1 : TOOL_MODE_COUNT - 1)) % TOOL_MODE_COUNT];
         } else if (isUpDownArrow && (modifiers == (NSCommandKeyMask | 
NSAlternateKeyMask))) {
-            [self setAnnotationMode:(annotationMode + (eventChar == 
NSDownArrowFunctionKey ? 1 : 7)) % 8];
+            [self setAnnotationMode:(annotationMode + (eventChar == 
NSDownArrowFunctionKey ? 1 : ANNOTATION_MODE_COUNT - 1)) % 
ANNOTATION_MODE_COUNT];
         } else if ([activeAnnotation isMovable] && isArrow && ((modifiers & 
~NSShiftKeyMask) == 0)) {
             [self doMoveActiveAnnotationForKey:eventChar byAmount:(modifiers & 
NSShiftKeyMask) ? 10.0 : 1.0];
         } else if ([activeAnnotation isResizable] && isArrow && (modifiers == 
(NSAlternateKeyMask | NSControlKeyMask) || modifiers == (NSShiftKeyMask | 
NSControlKeyMask))) {
@@ -1268,18 +1271,11 @@
     item = [menu insertItemWithTitle:NSLocalizedString(@"Take Snapshot", 
@"Menu item title") action:@selector(takeSnapshot:) keyEquivalent:@"" 
atIndex:0];
     [item setTarget:self];
     
-    if ([self toolMode] == SKTextToolMode) {
+    if ([self toolMode] == SKTextToolMode && [[self currentSelection] string] 
&& NSAppKitVersionNumber <= NSAppKitVersionNumber10_4) {
         
-        long version;
-        OSStatus err = Gestalt(gestaltSystemVersion, &version);
-        
-        if ([[self currentSelection] string] && noErr == err && version < 
0x00001050) {
+        [menu insertItem:[NSMenuItem separatorItem] atIndex:0];
             
-            [menu insertItem:[NSMenuItem separatorItem] atIndex:0];
-            
-            item = [menu insertItemWithTitle:NSLocalizedString(@"Look Up in 
Dictionary", @"") action:@selector(lookUpCurrentSelectionInDictionary:) 
keyEquivalent:@"" atIndex:0];
-        }
-    
+        item = [menu insertItemWithTitle:NSLocalizedString(@"Look Up in 
Dictionary", @"") action:@selector(lookUpCurrentSelectionInDictionary:) 
keyEquivalent:@"" atIndex:0];
     }
     
     if (([self toolMode] == SKTextToolMode || [self toolMode] == 
SKNoteToolMode) && [self hideNotes] == NO) {


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

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to