Revision: 3836
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3836&view=rev
Author:   hofman
Date:     2008-05-02 07:20:28 -0700 (Fri, 02 May 2008)

Log Message:
-----------
Use a different initializer for skim notes. Rename accessor.

Modified Paths:
--------------
    trunk/PDFAnnotation_SKExtensions.h
    trunk/PDFAnnotation_SKExtensions.m
    trunk/PDFPage_SKExtensions.m
    trunk/SKMainWindowController.m
    trunk/SKMainWindowController_UI.m
    trunk/SKPDFAnnotationCircle.m
    trunk/SKPDFAnnotationFreeText.m
    trunk/SKPDFAnnotationLine.m
    trunk/SKPDFAnnotationMarkup.m
    trunk/SKPDFAnnotationNote.m
    trunk/SKPDFAnnotationSquare.m
    trunk/SKPDFDocument.m
    trunk/SKPDFView.m

Modified: trunk/PDFAnnotation_SKExtensions.h
===================================================================
--- trunk/PDFAnnotation_SKExtensions.h  2008-05-02 12:19:52 UTC (rev 3835)
+++ trunk/PDFAnnotation_SKExtensions.h  2008-05-02 14:20:28 UTC (rev 3836)
@@ -82,6 +82,7 @@
 
 @interface PDFAnnotation (SKExtensions)
 
+- (id)initNoteWithBounds:(NSRect)bounds;
 - (id)initWithProperties:(NSDictionary *)dict;
 
 - (NSDictionary *)properties;
@@ -106,7 +107,7 @@
 
 - (NSArray *)texts;
 
-- (BOOL)isNoteAnnotation;
+- (BOOL)isNote;
 - (BOOL)isMarkup;
 - (BOOL)isLink;
 - (BOOL)isResizable;

Modified: trunk/PDFAnnotation_SKExtensions.m
===================================================================
--- trunk/PDFAnnotation_SKExtensions.m  2008-05-02 12:19:52 UTC (rev 3835)
+++ trunk/PDFAnnotation_SKExtensions.m  2008-05-02 14:20:28 UTC (rev 3836)
@@ -104,6 +104,11 @@
 
 @implementation PDFAnnotation (SKExtensions)
 
+- (id)initNoteWithBounds:(NSRect)bounds {
+    return [self initWithBounds:bounds];
+
+}
+
 - (id)initWithProperties:(NSDictionary *)dict{
     Class stringClass = [NSString class];
     
@@ -134,7 +139,7 @@
         // called from the initialization of a subclass
         NSString *boundsString = [dict objectForKey:SKPDFAnnotationBoundsKey];
         NSRect bounds = [boundsString isKindOfClass:stringClass] ? 
NSRectFromString(boundsString) : NSZeroRect;
-        if (self = [self initWithBounds:bounds]) {
+        if (self = [self initNoteWithBounds:bounds]) {
             Class colorClass = [NSColor class];
             Class arrayClass = [NSArray class];
             NSString *contents = [dict 
objectForKey:SKPDFAnnotationContentsKey];
@@ -293,7 +298,7 @@
 
 - (NSColor *)interiorColor { return nil; }
 
-- (BOOL)isNoteAnnotation { return NO; }
+- (BOOL)isNote { return NO; }
 
 - (BOOL)isMarkup { return NO; }
 
@@ -372,16 +377,16 @@
                     }
                 }
             } else if (type == SKScriptingTextNote) {
-                self = [[SKPDFAnnotationFreeText alloc] initWithBounds:bounds];
+                self = [[SKPDFAnnotationFreeText alloc] 
initNoteWithBounds:bounds];
             } else if (type == SKScriptingAnchoredNote) {
                 bounds.size = SKPDFAnnotationNoteSize;
-                self = [[SKPDFAnnotationNote alloc] initWithBounds:bounds];
+                self = [[SKPDFAnnotationNote alloc] initNoteWithBounds:bounds];
             } else if (type == SKScriptingCircleNote) {
-                self = [[SKPDFAnnotationCircle alloc] initWithBounds:bounds];
+                self = [[SKPDFAnnotationCircle alloc] 
initNoteWithBounds:bounds];
             } else if (type == SKScriptingSquareNote) {
-                self = [[SKPDFAnnotationSquare alloc] initWithBounds:bounds];
+                self = [[SKPDFAnnotationSquare alloc] 
initNoteWithBounds:bounds];
             } else if (type == SKScriptingLineNote) {
-                self = [[SKPDFAnnotationLine alloc] initWithBounds:bounds];
+                self = [[SKPDFAnnotationLine alloc] initNoteWithBounds:bounds];
             }
         }
     }

Modified: trunk/PDFPage_SKExtensions.m
===================================================================
--- trunk/PDFPage_SKExtensions.m        2008-05-02 12:19:52 UTC (rev 3835)
+++ trunk/PDFPage_SKExtensions.m        2008-05-02 14:20:28 UTC (rev 3836)
@@ -436,7 +436,7 @@
     NSMutableArray *notes = [NSMutableArray array];
     
     while (annotation = [annEnum nextObject]) {
-        if ([annotation isNoteAnnotation])
+        if ([annotation isNote])
             [notes addObject:annotation];
     }
     return notes;

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2008-05-02 12:19:52 UTC (rev 3835)
+++ trunk/SKMainWindowController.m      2008-05-02 14:20:28 UTC (rev 3836)
@@ -570,7 +570,7 @@
     PDFAnnotation *annotation = [pdfView activeAnnotation];
     
     if ([[self window] isMainWindow]) {
-        if ([annotation isNoteAnnotation] && [annotation 
respondsToSelector:@selector(font)]) {
+        if ([annotation isNote] && [annotation 
respondsToSelector:@selector(font)]) {
             updatingFont = YES;
             [[NSFontManager sharedFontManager] 
setSelectedFont:[(PDFAnnotationFreeText *)annotation font] isMultiple:NO];
             updatingFont = NO;
@@ -584,7 +584,7 @@
     NSView *accessoryView = nil;
     
     if ([[self window] isMainWindow]) {
-        if ([annotation isNoteAnnotation]) {
+        if ([annotation isNote]) {
             if ([annotation respondsToSelector:@selector(setInteriorColor:)]) {
                 if (colorAccessoryView == nil) {
                     colorAccessoryView = [[NSButton alloc] init];
@@ -621,7 +621,7 @@
     NSString *type = [annotation type];
     
     if ([[self window] isMainWindow]) {
-        if ([annotation isNoteAnnotation] && ([type 
isEqualToString:SKFreeTextString] || [type isEqualToString:SKCircleString] || 
[type isEqualToString:SKSquareString] || [type isEqualToString:@""] || [type 
isEqualToString:SKLineString])) {
+        if ([annotation isNote] && ([type isEqualToString:SKFreeTextString] || 
[type isEqualToString:SKCircleString] || [type isEqualToString:SKSquareString] 
|| [type isEqualToString:@""] || [type isEqualToString:SKLineString])) {
             updatingLine = YES;
             [[SKLineInspector sharedLineInspector] 
setAnnotationStyle:annotation];
             updatingLine = NO;
@@ -1190,7 +1190,7 @@
 
 - (IBAction)changeColor:(id)sender{
     PDFAnnotation *annotation = [pdfView activeAnnotation];
-    if (updatingColor == NO && [annotation isNoteAnnotation]) {
+    if (updatingColor == NO && [annotation isNote]) {
         BOOL isFill = [colorAccessoryView state] == NSOnState && [annotation 
respondsToSelector:@selector(setInteriorColor:)];
         NSColor *color = isFill ? [(id)annotation interiorColor] : [annotation 
color];
         if (color == nil)
@@ -1212,7 +1212,7 @@
 
 - (IBAction)selectColor:(id)sender{
     PDFAnnotation *annotation = [pdfView activeAnnotation];
-    if ([annotation isNoteAnnotation]) {
+    if ([annotation isNote]) {
         NSColor *color = [annotation color];
         NSColor *newColor = [sender 
respondsToSelector:@selector(representedObject)] ? [sender representedObject] : 
[sender respondsToSelector:@selector(color)] ? [sender color] : nil;
         if (newColor && [color isEqual:newColor] == NO)
@@ -1222,7 +1222,7 @@
 
 - (IBAction)changeFont:(id)sender{
     PDFAnnotation *annotation = [pdfView activeAnnotation];
-    if (updatingFont == NO && [annotation isNoteAnnotation] && [annotation 
respondsToSelector:@selector(setFont:)] && [annotation 
respondsToSelector:@selector(font)]) {
+    if (updatingFont == NO && [annotation isNote] && [annotation 
respondsToSelector:@selector(setFont:)] && [annotation 
respondsToSelector:@selector(font)]) {
         NSFont *font = [sender convertFont:[(PDFAnnotationFreeText 
*)annotation font]];
         updatingFont = YES;
         [(PDFAnnotationFreeText *)annotation setFont:font];
@@ -1233,7 +1233,7 @@
 - (void)changeLineWidth:(id)sender {
     PDFAnnotation *annotation = [pdfView activeAnnotation];
     NSString *type = [annotation type];
-    if (updatingLine == NO && [annotation isNoteAnnotation] && ([type 
isEqualToString:SKFreeTextString] || [type isEqualToString:SKCircleString] || 
[type isEqualToString:SKSquareString] || [type isEqualToString:@""] || [type 
isEqualToString:SKLineString])) {
+    if (updatingLine == NO && [annotation isNote] && ([type 
isEqualToString:SKFreeTextString] || [type isEqualToString:SKCircleString] || 
[type isEqualToString:SKSquareString] || [type isEqualToString:@""] || [type 
isEqualToString:SKLineString])) {
         [annotation setLineWidth:[sender lineWidth]];
     }
 }
@@ -1241,7 +1241,7 @@
 - (void)changeLineStyle:(id)sender {
     PDFAnnotation *annotation = [pdfView activeAnnotation];
     NSString *type = [annotation type];
-    if (updatingLine == NO && [annotation isNoteAnnotation] && ([type 
isEqualToString:SKFreeTextString] || [type isEqualToString:SKCircleString] || 
[type isEqualToString:SKSquareString] || [type isEqualToString:SKLineString])) {
+    if (updatingLine == NO && [annotation isNote] && ([type 
isEqualToString:SKFreeTextString] || [type isEqualToString:SKCircleString] || 
[type isEqualToString:SKSquareString] || [type isEqualToString:SKLineString])) {
         [annotation setBorderStyle:[sender style]];
     }
 }
@@ -1249,7 +1249,7 @@
 - (void)changeDashPattern:(id)sender {
     PDFAnnotation *annotation = [pdfView activeAnnotation];
     NSString *type = [annotation type];
-    if (updatingLine == NO && [annotation isNoteAnnotation] && ([type 
isEqualToString:SKFreeTextString] || [type isEqualToString:SKCircleString] || 
[type isEqualToString:SKSquareString] || [type isEqualToString:SKLineString])) {
+    if (updatingLine == NO && [annotation isNote] && ([type 
isEqualToString:SKFreeTextString] || [type isEqualToString:SKCircleString] || 
[type isEqualToString:SKSquareString] || [type isEqualToString:SKLineString])) {
         [annotation setDashPattern:[sender dashPattern]];
     }
 }
@@ -1257,7 +1257,7 @@
 - (void)changeStartLineStyle:(id)sender {
     PDFAnnotation *annotation = [pdfView activeAnnotation];
     NSString *type = [annotation type];
-    if (updatingLine == NO && [annotation isNoteAnnotation] && [type 
isEqualToString:SKLineString]) {
+    if (updatingLine == NO && [annotation isNote] && [type 
isEqualToString:SKLineString]) {
         updatingLine = YES;
         [(SKPDFAnnotationLine *)annotation setStartLineStyle:[sender 
startLineStyle]];
         updatingLine = NO;
@@ -1267,7 +1267,7 @@
 - (void)changeEndLineStyle:(id)sender {
     PDFAnnotation *annotation = [pdfView activeAnnotation];
     NSString *type = [annotation type];
-    if (updatingLine == NO && [annotation isNoteAnnotation] && [type 
isEqualToString:SKLineString]) {
+    if (updatingLine == NO && [annotation isNote] && [type 
isEqualToString:SKLineString]) {
         updatingLine = YES;
         [(SKPDFAnnotationLine *)annotation setEndLineStyle:[sender 
endLineStyle]];
         updatingLine = NO;

Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m   2008-05-02 12:19:52 UTC (rev 3835)
+++ trunk/SKMainWindowController_UI.m   2008-05-02 14:20:28 UTC (rev 3836)
@@ -1051,7 +1051,7 @@
         return [self isPresentation] == NO && ([pdfView toolMode] == 
SKTextToolMode || [pdfView toolMode] == SKNoteToolMode) && [[[pdfView 
currentSelection] pages] count] && [pdfView hideNotes] == NO;
     } else if (action == @selector(editNote:)) {
         PDFAnnotation *annotation = [pdfView activeAnnotation];
-        return [self isPresentation] == NO && [annotation isNoteAnnotation] && 
([[annotation type] isEqualToString:SKFreeTextString] || [[annotation type] 
isEqualToString:SKNoteString]);
+        return [self isPresentation] == NO && [annotation isNote] && 
([[annotation type] isEqualToString:SKFreeTextString] || [[annotation type] 
isEqualToString:SKNoteString]);
     } else if (action == @selector(toggleHideNotes:)) {
         if ([pdfView hideNotes])
             [menuItem setTitle:NSLocalizedString(@"Show Notes", @"Menu item 
title")];
@@ -1340,7 +1340,7 @@
         [self updateColorPanel];
         [self updateLineInspector];
     }
-    if ([annotation isNoteAnnotation]) {
+    if ([annotation isNote]) {
         if ([[self selectedNotes] containsObject:annotation] == NO) {
             [noteOutlineView selectRowIndexes:[NSIndexSet 
indexSetWithIndex:[noteOutlineView rowForItem:annotation]] 
byExtendingSelection:NO];
         }

Modified: trunk/SKPDFAnnotationCircle.m
===================================================================
--- trunk/SKPDFAnnotationCircle.m       2008-05-02 12:19:52 UTC (rev 3835)
+++ trunk/SKPDFAnnotationCircle.m       2008-05-02 14:20:28 UTC (rev 3836)
@@ -47,8 +47,8 @@
 
 @implementation SKPDFAnnotationCircle
 
-- (id)initWithBounds:(NSRect)bounds {
-    if (self = [super initWithBounds:bounds]) {
+- (id)initNoteWithBounds:(NSRect)bounds {
+    if (self = [super initNoteWithBounds:bounds]) {
         [self setShouldPrint:YES];
         NSColor *color = [[NSUserDefaults standardUserDefaults] 
colorForKey:SKCircleNoteInteriorColorKey];
         if ([color alphaComponent] > 0.0)
@@ -88,7 +88,7 @@
     return fdfString;
 }
 
-- (BOOL)isNoteAnnotation { return YES; }
+- (BOOL)isNote { return YES; }
 
 - (BOOL)isResizable { return YES; }
 
@@ -165,7 +165,7 @@
 - (BOOL)isConvertibleAnnotation { return YES; }
 
 - (id)copyNoteAnnotation {
-    SKPDFAnnotationCircle *annotation = [[SKPDFAnnotationCircle alloc] 
initWithBounds:[self bounds]];
+    SKPDFAnnotationCircle *annotation = [[SKPDFAnnotationCircle alloc] 
initNoteWithBounds:[self bounds]];
     [annotation setString:[self string]];
     [annotation setColor:[self color]];
     [annotation setBorder:[[[self border] copy] autorelease]];

Modified: trunk/SKPDFAnnotationFreeText.m
===================================================================
--- trunk/SKPDFAnnotationFreeText.m     2008-05-02 12:19:52 UTC (rev 3835)
+++ trunk/SKPDFAnnotationFreeText.m     2008-05-02 14:20:28 UTC (rev 3836)
@@ -57,8 +57,8 @@
 
 @implementation SKPDFAnnotationFreeText
 
-- (id)initWithBounds:(NSRect)bounds {
-    if (self = [super initWithBounds:bounds]) {
+- (id)initNoteWithBounds:(NSRect)bounds {
+    if (self = [super initNoteWithBounds:bounds]) {
         [self setShouldPrint:YES];
         NSFont *font = [NSFont fontWithName:[[NSUserDefaults 
standardUserDefaults] stringForKey:SKTextNoteFontNameKey]
                                        size:[[NSUserDefaults 
standardUserDefaults] floatForKey:SKTextNoteFontSizeKey]];
@@ -105,7 +105,7 @@
     return fdfString;
 }
 
-- (BOOL)isNoteAnnotation { return YES; }
+- (BOOL)isNote { return YES; }
 
 - (BOOL)isResizable { return YES; }
 
@@ -220,7 +220,7 @@
 - (BOOL)isConvertibleAnnotation { return YES; }
 
 - (id)copyNoteAnnotation {
-    SKPDFAnnotationFreeText *annotation = [[SKPDFAnnotationFreeText alloc] 
initWithBounds:[self bounds]];
+    SKPDFAnnotationFreeText *annotation = [[SKPDFAnnotationFreeText alloc] 
initNoteWithBounds:[self bounds]];
     [annotation setString:[self string]];
     [annotation setColor:[self color]];
     [annotation setBorder:[[[self border] copy] autorelease]];

Modified: trunk/SKPDFAnnotationLine.m
===================================================================
--- trunk/SKPDFAnnotationLine.m 2008-05-02 12:19:52 UTC (rev 3835)
+++ trunk/SKPDFAnnotationLine.m 2008-05-02 14:20:28 UTC (rev 3836)
@@ -83,8 +83,8 @@
 
 @implementation SKPDFAnnotationLine
 
-- (id)initWithBounds:(NSRect)bounds {
-    if (self = [super initWithBounds:bounds]) {
+- (id)initNoteWithBounds:(NSRect)bounds {
+    if (self = [super initNoteWithBounds:bounds]) {
         [self setColor:[[NSUserDefaults standardUserDefaults] 
colorForKey:SKLineNoteColorKey]];
         [self setStartLineStyle:[[NSUserDefaults standardUserDefaults] 
integerForKey:SKLineNoteStartLineStyleKey]];
         [self setEndLineStyle:[[NSUserDefaults standardUserDefaults] 
integerForKey:SKLineNoteEndLineStyleKey]];
@@ -142,7 +142,7 @@
     return fdfString;
 }
 
-- (BOOL)isNoteAnnotation { return YES; }
+- (BOOL)isNote { return YES; }
 
 - (BOOL)isResizable { return YES; }
 
@@ -348,7 +348,7 @@
 - (BOOL)isConvertibleAnnotation { return YES; }
 
 - (id)copyNoteAnnotation {
-    SKPDFAnnotationLine *annotation = [[SKPDFAnnotationLine alloc] 
initWithBounds:[self bounds]];
+    SKPDFAnnotationLine *annotation = [[SKPDFAnnotationLine alloc] 
initNoteWithBounds:[self bounds]];
     [annotation setString:[self string]];
     [annotation setColor:[self color]];
     [annotation setBorder:[[[self border] copy] autorelease]];

Modified: trunk/SKPDFAnnotationMarkup.m
===================================================================
--- trunk/SKPDFAnnotationMarkup.m       2008-05-02 12:19:52 UTC (rev 3835)
+++ trunk/SKPDFAnnotationMarkup.m       2008-05-02 14:20:28 UTC (rev 3836)
@@ -128,8 +128,8 @@
     return nil;
 }
 
-- (id)initWithBounds:(NSRect)bounds markupType:(int)type 
quadrilateralPointsAsStrings:(NSArray *)pointStrings {
-    if (self = [super initWithBounds:bounds]) {
+- (id)initNoteWithBounds:(NSRect)bounds markupType:(int)type 
quadrilateralPointsAsStrings:(NSArray *)pointStrings {
+    if (self = [super initNoteWithBounds:bounds]) {
         [self setShouldPrint:YES];
         [self setMarkupType:type];
         
@@ -145,8 +145,8 @@
     return self;
 }
 
-- (id)initWithBounds:(NSRect)bounds {
-    self = [self initWithBounds:bounds markupType:kPDFMarkupTypeHighlight 
quadrilateralPointsAsStrings:nil];
+- (id)initNoteWithBounds:(NSRect)bounds {
+    self = [self initNoteWithBounds:bounds markupType:kPDFMarkupTypeHighlight 
quadrilateralPointsAsStrings:nil];
     return self;
 }
 
@@ -205,7 +205,7 @@
     if (selection == nil || NSIsEmptyRect(bounds)) {
         [[self initWithBounds:NSZeroRect] release];
         self = nil;
-    } else if (self = [self initWithBounds:bounds markupType:type 
quadrilateralPointsAsStrings:nil]) {
+    } else if (self = [self initNoteWithBounds:bounds markupType:type 
quadrilateralPointsAsStrings:nil]) {
         PDFPage *page = [[selection pages] objectAtIndex:0];
         NSString *string = [page string];
         NSMutableArray *quadPoints = [[NSMutableArray alloc] init];
@@ -377,7 +377,7 @@
     return bounds;
 }
 
-- (BOOL)isNoteAnnotation { return YES; }
+- (BOOL)isNote { return YES; }
 
 - (BOOL)isMarkup { return YES; }
 
@@ -468,7 +468,7 @@
 
 - (id)copyNoteAnnotation {
     NSArray *quadPoints = createStringsFromPoints([self quadrilateralPoints]);
-    SKPDFAnnotationMarkup *annotation = [[SKPDFAnnotationMarkup alloc] 
initWithBounds:[self bounds] markupType:[self markupType] 
quadrilateralPointsAsStrings:quadPoints];
+    SKPDFAnnotationMarkup *annotation = [[SKPDFAnnotationMarkup alloc] 
initNoteWithBounds:[self bounds] markupType:[self markupType] 
quadrilateralPointsAsStrings:quadPoints];
     [quadPoints release];
     [annotation setString:[self string]];
     [annotation setColor:[self color]];

Modified: trunk/SKPDFAnnotationNote.m
===================================================================
--- trunk/SKPDFAnnotationNote.m 2008-05-02 12:19:52 UTC (rev 3835)
+++ trunk/SKPDFAnnotationNote.m 2008-05-02 14:20:28 UTC (rev 3836)
@@ -84,8 +84,8 @@
 
 @implementation SKPDFAnnotationNote
 
-- (id)initWithBounds:(NSRect)bounds {
-    if (self = [super initWithBounds:bounds]) {
+- (id)initNoteWithBounds:(NSRect)bounds {
+    if (self = [super initNoteWithBounds:bounds]) {
         [self setShouldPrint:YES];
         [self setColor:[[NSUserDefaults standardUserDefaults] 
colorForKey:SKAnchoredNoteColorKey]];
         [self setIconType:[[NSUserDefaults standardUserDefaults] 
integerForKey:SKAnchoredNoteIconTypeKey]];
@@ -152,7 +152,7 @@
     return fdfString;
 }
 
-- (BOOL)isNoteAnnotation { return YES; }
+- (BOOL)isNote { return YES; }
 
 - (BOOL)isMovable { return YES; }
 
@@ -344,7 +344,7 @@
 - (id)copyNoteAnnotation {
     NSRect bounds = [self bounds];
     bounds.size = SKPDFAnnotationNoteSize;
-    SKPDFAnnotationNote *annotation = [[SKPDFAnnotationNote alloc] 
initWithBounds:bounds];
+    SKPDFAnnotationNote *annotation = [[SKPDFAnnotationNote alloc] 
initNoteWithBounds:bounds];
     [annotation setString:[self string]];
     [annotation setColor:[self color]];
     [annotation setBorder:[[[self border] copy] autorelease]];

Modified: trunk/SKPDFAnnotationSquare.m
===================================================================
--- trunk/SKPDFAnnotationSquare.m       2008-05-02 12:19:52 UTC (rev 3835)
+++ trunk/SKPDFAnnotationSquare.m       2008-05-02 14:20:28 UTC (rev 3836)
@@ -47,8 +47,8 @@
 
 @implementation SKPDFAnnotationSquare
 
-- (id)initWithBounds:(NSRect)bounds {
-    if (self = [super initWithBounds:bounds]) {
+- (id)initNoteWithBounds:(NSRect)bounds {
+    if (self = [super initNoteWithBounds:bounds]) {
         [self setShouldPrint:YES];
         NSColor *color = [[NSUserDefaults standardUserDefaults] 
colorForKey:SKSquareNoteInteriorColorKey];
         if ([color alphaComponent] > 0.0)
@@ -88,7 +88,7 @@
     return fdfString;
 }
 
-- (BOOL)isNoteAnnotation { return YES; }
+- (BOOL)isNote { return YES; }
 
 - (BOOL)isResizable { return YES; }
 
@@ -165,7 +165,7 @@
 - (BOOL)isConvertibleAnnotation { return YES; }
 
 - (id)copyNoteAnnotation {
-    SKPDFAnnotationSquare *annotation = [[SKPDFAnnotationSquare alloc] 
initWithBounds:[self bounds]];
+    SKPDFAnnotationSquare *annotation = [[SKPDFAnnotationSquare alloc] 
initNoteWithBounds:[self bounds]];
     [annotation setString:[self string]];
     [annotation setColor:[self color]];
     [annotation setBorder:[[[self border] copy] autorelease]];

Modified: trunk/SKPDFDocument.m
===================================================================
--- trunk/SKPDFDocument.m       2008-05-02 12:19:52 UTC (rev 3835)
+++ trunk/SKPDFDocument.m       2008-05-02 14:20:28 UTC (rev 3836)
@@ -815,7 +815,7 @@
         PDFAnnotation *annotation;
         
         while (annotation = [annEnum nextObject]) {
-            if ([annotation isNoteAnnotation] == NO && [annotation 
isConvertibleAnnotation]) {
+            if ([annotation isNote] == NO && [annotation 
isConvertibleAnnotation]) {
                 PDFAnnotation *newAnnotation = [annotation copyNoteAnnotation];
                 [[self pdfView] removeAnnotation:annotation];
                 [[self pdfView] addAnnotation:newAnnotation toPage:page];
@@ -836,7 +836,7 @@
             PDFAnnotation *annotation;
             
             while (annotation = [annEnum nextObject]) {
-                if ([annotation isNoteAnnotation] == NO && [annotation 
isConvertibleAnnotation])
+                if ([annotation isNote] == NO && [annotation 
isConvertibleAnnotation])
                     [page removeAnnotation:annotation];
             }
         }
@@ -1781,11 +1781,11 @@
 
 - (id)activeNote {
     id note = [[self pdfView] activeAnnotation];
-    return [note isNoteAnnotation] ? note : [NSNull null];
+    return [note isNote] ? note : [NSNull null];
 }
 
 - (void)setActiveNote:(id)note {
-    if ([note isEqual:[NSNull null]] == NO && [note isNoteAnnotation])
+    if ([note isEqual:[NSNull null]] == NO && [note isNote])
         [[self pdfView] setActiveAnnotation:note];
 }
 

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2008-05-02 12:19:52 UTC (rev 3835)
+++ trunk/SKPDFView.m   2008-05-02 14:20:28 UTC (rev 3836)
@@ -705,7 +705,7 @@
 
 - (void)delete:(id)sender
 {
-       if ([activeAnnotation isNoteAnnotation])
+       if ([activeAnnotation isNote])
         [self removeActiveAnnotation:self];
     else
         NSBeep();
@@ -730,7 +730,7 @@
     NSData *pdfData = nil;
     NSData *tiffData = nil;
     
-    if ([self hideNotes] == NO && [activeAnnotation isNoteAnnotation] && 
[activeAnnotation isMovable]) {
+    if ([self hideNotes] == NO && [activeAnnotation isNote] && 
[activeAnnotation isMovable]) {
         if (noteData = [NSKeyedArchiver 
archivedDataWithRootObject:[activeAnnotation properties]])
             [types addObject:SKSkimNotePboardType];
     }
@@ -876,9 +876,9 @@
         bounds = SKConstrainRect(bounds, [page boundsForBox:[self 
displayBox]]);
         
         if (isAlternate)
-            newAnnotation = [[SKPDFAnnotationNote alloc] 
initWithBounds:bounds];
+            newAnnotation = [[SKPDFAnnotationNote alloc] 
initNoteWithBounds:bounds];
         else
-            newAnnotation = [[SKPDFAnnotationFreeText alloc] 
initWithBounds:bounds];
+            newAnnotation = [[SKPDFAnnotationFreeText alloc] 
initNoteWithBounds:bounds];
         [newAnnotation setString:[pboard stringForType:NSStringPboardType]];
     }
     
@@ -898,7 +898,7 @@
 
 - (void)cut:(id)sender
 {
-       if ([self hideNotes] == NO && [activeAnnotation isNoteAnnotation]) {
+       if ([self hideNotes] == NO && [activeAnnotation isNote]) {
         [self copy:sender];
         [self delete:sender];
     } else
@@ -1330,7 +1330,7 @@
         
         if (page) {
             annotation = [page annotationAtPoint:[self convertPoint:point 
toPage:page]];
-            if ([annotation isNoteAnnotation] == NO)
+            if ([annotation isNote] == NO)
                 annotation = nil;
         }
         
@@ -1344,7 +1344,7 @@
             item = [menu insertItemWithTitle:NSLocalizedString(@"Remove Note", 
@"Menu item title") action:@selector(removeThisAnnotation:) keyEquivalent:@"" 
atIndex:0];
             [item setRepresentedObject:annotation];
             [item setTarget:self];
-        } else if ([activeAnnotation isNoteAnnotation]) {
+        } else if ([activeAnnotation isNote]) {
             if ([self isEditing] == NO && [activeAnnotation isEditable]) {
                 item = [menu insertItemWithTitle:NSLocalizedString(@"Edit 
Current Note", @"Menu item title") action:@selector(editActiveAnnotation:) 
keyEquivalent:@"" atIndex:0];
                 [item setTarget:self];
@@ -1359,8 +1359,8 @@
             item = [menu insertItemWithTitle:NSLocalizedString(@"Paste", 
@"Menu item title") action:selector keyEquivalent:@"" atIndex:0];
         }
         
-        if ([self currentSelection] || ([activeAnnotation isNoteAnnotation] && 
[activeAnnotation isMovable])) {
-            if ([activeAnnotation isNoteAnnotation] && [activeAnnotation 
isMovable])
+        if ([self currentSelection] || ([activeAnnotation isNote] && 
[activeAnnotation isMovable])) {
+            if ([activeAnnotation isNote] && [activeAnnotation isMovable])
                 item = [menu insertItemWithTitle:NSLocalizedString(@"Cut", 
@"Menu item title") action:@selector(copy:) keyEquivalent:@"" atIndex:0];
             item = [menu insertItemWithTitle:NSLocalizedString(@"Copy", @"Menu 
item title") action:@selector(copy:) keyEquivalent:@"" atIndex:0];
         }
@@ -1564,7 +1564,7 @@
             while (i-- > 0) {
                 annotation = [annotations objectAtIndex:i];
                 NSString *type = [annotation type];
-                if ([annotation isNoteAnnotation] && [annotation 
hitTest:location] && 
+                if ([annotation isNote] && [annotation hitTest:location] && 
                     ([pboardType isEqualToString:NSColorPboardType] || [type 
isEqualToString:SKFreeTextString] || [type isEqualToString:SKCircleString] || 
[type isEqualToString:SKSquareString] || [type isEqualToString:SKLineString])) {
                     if ([annotation isEqual:highlightAnnotation] == NO) {
                         if (highlightAnnotation)
@@ -1795,20 +1795,20 @@
        // Create annotation and add to page.
     switch (annotationType) {
         case SKFreeTextNote:
-            newAnnotation = [[SKPDFAnnotationFreeText alloc] 
initWithBounds:bounds];
+            newAnnotation = [[SKPDFAnnotationFreeText alloc] 
initNoteWithBounds:bounds];
             if (text == nil)
                 text = NSLocalizedString(@"Double-click to edit.", @"Default 
text for new text note");
             break;
         case SKAnchoredNote:
-            newAnnotation = [[SKPDFAnnotationNote alloc] 
initWithBounds:bounds];
+            newAnnotation = [[SKPDFAnnotationNote alloc] 
initNoteWithBounds:bounds];
             if (text == nil)
                 text = NSLocalizedString(@"New note", @"Default text for new 
anchored note");
             break;
         case SKCircleNote:
-            newAnnotation = [[SKPDFAnnotationCircle alloc] 
initWithBounds:bounds];
+            newAnnotation = [[SKPDFAnnotationCircle alloc] 
initNoteWithBounds:bounds];
             break;
         case SKSquareNote:
-            newAnnotation = [[SKPDFAnnotationSquare alloc] 
initWithBounds:bounds];
+            newAnnotation = [[SKPDFAnnotationSquare alloc] 
initNoteWithBounds:bounds];
             break;
         case SKHighlightNote:
             if ([[activeAnnotation type] isEqualToString:SKHighlightString] && 
[[activeAnnotation page] isEqual:page]) {
@@ -1832,7 +1832,7 @@
             newAnnotation = [[SKPDFAnnotationMarkup alloc] 
initWithSelection:sel markupType:kPDFMarkupTypeStrikeOut];
             break;
         case SKLineNote:
-            newAnnotation = [[SKPDFAnnotationLine alloc] 
initWithBounds:bounds];
+            newAnnotation = [[SKPDFAnnotationLine alloc] 
initNoteWithBounds:bounds];
             break;
        }
     if (newAnnotation) {
@@ -1866,7 +1866,7 @@
 }
 
 - (void)removeActiveAnnotation:(id)sender{
-    if ([activeAnnotation isNoteAnnotation]) {
+    if ([activeAnnotation isNote]) {
         [self removeAnnotation:activeAnnotation];
         [accessibilityChildren release];
         accessibilityChildren = nil;
@@ -2032,7 +2032,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 isLink] == NO)
+            if (([self hideNotes] || [annotation isNote] == NO) && [annotation 
isLink] == NO)
                 annotation = nil;
         }
         if (startPageIndex == -1)
@@ -2080,7 +2080,7 @@
     while (annotation == nil) {
         while (--i >= 0 && annotation == nil) {
             annotation = [annotations objectAtIndex:i];
-            if (([self hideNotes] || [annotation isNoteAnnotation] == NO) && 
[annotation isLink] == NO)
+            if (([self hideNotes] || [annotation isNote] == NO) && [annotation 
isLink] == NO)
                 annotation = nil;
         }
         if (startPageIndex == -1)
@@ -2160,7 +2160,7 @@
             NSEnumerator *annotationEnum = [[page annotations] 
objectEnumerator];
             PDFAnnotation *annotation;
             while (annotation = [annotationEnum nextObject]) {
-                if ([annotation isLink] || [annotation isNoteAnnotation])
+                if ([annotation isLink] || [annotation isNote])
                     [children addObject:[SKAccessibilityProxyElement 
elementWithObject:annotation parent:[self documentView]]];
             }
         }
@@ -2181,7 +2181,7 @@
         PDFPage *page = [self pageForPoint:localPoint nearest:NO];
         if (page) {
             PDFAnnotation *annotation = [page annotationAtPoint:[self 
convertPoint:localPoint toPage:page]];
-            if ([annotation isLink] || [annotation isNoteAnnotation])
+            if ([annotation isLink] || [annotation isNote])
                 child = 
NSAccessibilityUnignoredAncestor([SKAccessibilityProxyElement 
elementWithObject:annotation parent:[self documentView]]);
         }
     }
@@ -2281,13 +2281,13 @@
     } else if (action == @selector(copy:)) {
         if ([self currentSelection])
             return YES;
-        if ([activeAnnotation isNoteAnnotation] && [activeAnnotation 
isMovable])
+        if ([activeAnnotation isNote] && [activeAnnotation isMovable])
             return YES;
         if (toolMode == SKSelectToolMode && NSIsEmptyRect(selectionRect) == NO)
             return YES;
         return NO;
     } else if (action == @selector(delete:)) {
-        return [activeAnnotation isNoteAnnotation];
+        return [activeAnnotation isNote];
     } else if (action == @selector(printDocument:)) {
         return [[self document] allowsPrinting];
     } else if (action == @selector(selectAll:)) {
@@ -2842,7 +2842,7 @@
         NSRect bounds = [annotation bounds];
         
         // Hit test annotation.
-        if ([annotation isNoteAnnotation]) {
+        if ([annotation isNote]) {
             if ([annotation hitTest:pagePoint] && (editField == nil || 
annotation != activeAnnotation)) {
                 mouseDownInAnnotation = YES;
                 newActiveAnnotation = annotation;


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