Revision: 3084
http://skim-app.svn.sourceforge.net/skim-app/?rev=3084&view=rev
Author: hofman
Date: 2007-10-28 08:56:09 -0700 (Sun, 28 Oct 2007)
Log Message:
-----------
Add global string for Link.
Modified Paths:
--------------
trunk/SKPDFHoverWindow.m
trunk/SKPDFView.m
trunk/SKStringConstants.h
trunk/SKStringConstants.m
Modified: trunk/SKPDFHoverWindow.m
===================================================================
--- trunk/SKPDFHoverWindow.m 2007-10-28 15:53:04 UTC (rev 3083)
+++ trunk/SKPDFHoverWindow.m 2007-10-28 15:56:09 UTC (rev 3084)
@@ -43,6 +43,7 @@
#import "NSParagraphStyle_SKExtensions.h"
#import "NSGeometry_SKExtensions.h"
#import "NSAffineTransform_SKExtensions.h"
+#import "SKStringConstants.h"
#define WINDOW_OFFSET 20.0
#define TEXT_MARGIN_X 2.0
@@ -197,7 +198,7 @@
[self stopTimer];
- if ([[annotation type] isEqualToString:@"Link"]) {
+ if ([[annotation type] isEqualToString:SKLinkString]) {
PDFDestination *dest = [annotation destination];
PDFPage *page = [dest page];
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2007-10-28 15:53:04 UTC (rev 3083)
+++ trunk/SKPDFView.m 2007-10-28 15:56:09 UTC (rev 3084)
@@ -289,7 +289,7 @@
unsigned j, jMax = [annotations count];
for (j = 0; j < jMax; j++) {
PDFAnnotation *annotation = [annotations objectAtIndex:j];
- if ([[annotation type] isEqualToString:SKNoteString] ||
[[annotation type] isEqualToString:@"Link"]) {
+ if ([[annotation type] isEqualToString:SKNoteString] ||
[[annotation type] isEqualToString:SKLinkString]) {
NSRect rect = NSIntersectionRect([self convertRect:[annotation
bounds] fromPage:page], visibleRect);
if (NSIsEmptyRect(rect) == NO) {
NSTrackingRectTag tag = [self addTrackingRect:rect
owner:self userData:annotation assumeInside:NO];
@@ -320,13 +320,13 @@
for (i = 0; i < count; i++) {
PDFAnnotation *annotation = [allAnnotations objectAtIndex: i];
- if ([[annotation type] isEqualToString:@"Link"])
+ if ([[annotation type] isEqualToString:SKLinkString])
[(PDFAnnotationLink *)annotation fixRelativeURLIfNeeded];
}
// activeAnnotation may be a leftover, and we don't want to outline it
on the wrong page
if (activeAnnotation && [[activeAnnotation page] isEqual:pdfPage]) {
- BOOL isLink = [[activeAnnotation type] isEqualToString:@"Link"];
+ BOOL isLink = [[activeAnnotation type]
isEqualToString:SKLinkString];
float lineWidth = isLink ? 2.0 : 1.0;
NSRect bounds = [activeAnnotation bounds];
float color[4] = { 0.0, 0.0, 0.0, 1.0 };
@@ -951,7 +951,7 @@
}
- (void)mouseDown:(NSEvent *)theEvent{
- if ([[activeAnnotation type] isEqualToString:@"Link"])
+ if ([[activeAnnotation type] isEqualToString:SKLinkString])
[self setActiveAnnotation:nil];
mouseDownLoc = [theEvent locationInWindow];
@@ -1042,7 +1042,7 @@
[self setNeedsDisplayInRect:selectionRect];
selectionRect = NSZeroRect;
[[NSNotificationCenter defaultCenter]
postNotificationName:SKPDFViewSelectionChangedNotification object:self];
- } else if ([[activeAnnotation type] isEqualToString:@"Link"]) {
+ } else if ([[activeAnnotation type]
isEqualToString:SKLinkString]) {
NSPoint p = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
PDFPage *page = [self pageForPoint:p nearest:NO];
if (page && NSPointInRect([self convertPoint:p
toPage:page], [activeAnnotation bounds]))
@@ -1125,7 +1125,7 @@
else
[super mouseMoved:theEvent];
- if ([[activeAnnotation type] isEqualToString:@"Link"]) {
+ if ([[activeAnnotation type] isEqualToString:SKLinkString]) {
[[SKPDFHoverWindow sharedHoverWindow] hide];
[self setActiveAnnotation:nil];
}
@@ -1884,7 +1884,7 @@
NSString *type = [activeAnnotation type];
- if ([type isEqualToString:@"Link"]) {
+ if ([type isEqualToString:SKLinkString]) {
[[SKPDFHoverWindow sharedHoverWindow] orderOut:self];
if ([activeAnnotation destination])
@@ -1972,7 +1972,7 @@
NSArray *annotations = [[pdfDoc pageAtIndex:pageIndex] annotations];
while (++i < (int)[annotations count] && annotation == nil) {
annotation = [annotations objectAtIndex:i];
- if (([self hideNotes] || [annotation isNoteAnnotation] == NO) &&
[[annotation type] isEqualToString:@"Link"] == NO)
+ if (([self hideNotes] || [annotation isNoteAnnotation] == NO) &&
[[annotation type] isEqualToString:SKLinkString] == NO)
annotation = nil;
}
if (startPageIndex == -1)
@@ -1986,7 +1986,7 @@
if (annotation) {
[self scrollAnnotationToVisible:annotation];
[self setActiveAnnotation:annotation];
- if ([[annotation type] isEqualToString:@"Link"] || [annotation text]) {
+ if ([[annotation type] isEqualToString:SKLinkString] || [annotation
text]) {
NSRect bounds = [annotation bounds];
NSPoint point = NSMakePoint(NSMinX(bounds) + 0.3 *
NSWidth(bounds), NSMinY(bounds) + 0.3 * NSHeight(bounds));
point = [self convertPoint:[self convertPoint:point
fromPage:[annotation page]] toView:nil];
@@ -2017,7 +2017,7 @@
NSArray *annotations = [[pdfDoc pageAtIndex:pageIndex] annotations];
while (--i >= 0 && annotation == nil) {
annotation = [annotations objectAtIndex:i];
- if (([self hideNotes] || [annotation isNoteAnnotation] == NO) &&
[[annotation type] isEqualToString:@"Link"] == NO)
+ if (([self hideNotes] || [annotation isNoteAnnotation] == NO) &&
[[annotation type] isEqualToString:SKLinkString] == NO)
annotation = nil;
}
if (startPageIndex == -1)
@@ -2031,7 +2031,7 @@
if (annotation) {
[self scrollAnnotationToVisible:annotation];
[self setActiveAnnotation:annotation];
- if ([[annotation type] isEqualToString:@"Link"] || [annotation text]) {
+ if ([[annotation type] isEqualToString:SKLinkString] || [annotation
text]) {
NSRect bounds = [annotation bounds];
NSPoint point = NSMakePoint(NSMinX(bounds) + 0.3 *
NSWidth(bounds), NSMinY(bounds) + 0.3 * NSHeight(bounds));
point = [self convertPoint:[self convertPoint:point
fromPage:[annotation page]] toView:nil];
@@ -2752,7 +2752,7 @@
if ([annotation isTemporaryAnnotation]) {
// register this, so we can do our own selection later
mouseDownInAnnotation = YES;
- } else if ([[annotation type] isEqualToString:@"Link"]) {
+ } else if ([[annotation type] isEqualToString:SKLinkString]) {
if (mouseDownInAnnotation && (toolMode == SKTextToolMode ||
annotationMode == SKHighlightNote || annotationMode == SKUnderlineNote ||
annotationMode == SKStrikeOutNote))
newActiveAnnotation = annotation;
break;
Modified: trunk/SKStringConstants.h
===================================================================
--- trunk/SKStringConstants.h 2007-10-28 15:53:04 UTC (rev 3083)
+++ trunk/SKStringConstants.h 2007-10-28 15:56:09 UTC (rev 3084)
@@ -121,3 +121,4 @@
extern NSString *SKUnderlineString;
extern NSString *SKStrikeOutString;
extern NSString *SKLineString;
+extern NSString *SKLinkString;
Modified: trunk/SKStringConstants.m
===================================================================
--- trunk/SKStringConstants.m 2007-10-28 15:53:04 UTC (rev 3083)
+++ trunk/SKStringConstants.m 2007-10-28 15:56:09 UTC (rev 3084)
@@ -122,3 +122,4 @@
NSString *SKUnderlineString = @"Underline";
NSString *SKStrikeOutString = @"StrikeOut";
NSString *SKLineString = @"Line";
+NSString *SKLinkString = @"Link";
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: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit