Revision: 3594
http://skim-app.svn.sourceforge.net/skim-app/?rev=3594&view=rev
Author: hofman
Date: 2008-04-02 05:01:48 -0700 (Wed, 02 Apr 2008)
Log Message:
-----------
Rename initializer and accessor to properties.
Modified Paths:
--------------
trunk/PDFAnnotation_SKExtensions.h
trunk/PDFAnnotation_SKExtensions.m
trunk/SKDocument.m
trunk/SKMainWindowController.m
trunk/SKPDFAnnotationCircle.m
trunk/SKPDFAnnotationFreeText.m
trunk/SKPDFAnnotationLine.m
trunk/SKPDFAnnotationMarkup.m
trunk/SKPDFAnnotationNote.m
trunk/SKPDFAnnotationSquare.m
trunk/SKPDFView.m
Modified: trunk/PDFAnnotation_SKExtensions.h
===================================================================
--- trunk/PDFAnnotation_SKExtensions.h 2008-04-02 11:52:49 UTC (rev 3593)
+++ trunk/PDFAnnotation_SKExtensions.h 2008-04-02 12:01:48 UTC (rev 3594)
@@ -81,9 +81,9 @@
@interface PDFAnnotation (SKExtensions)
-- (id)initWithDictionary:(NSDictionary *)dict;
+- (id)initWithProperties:(NSDictionary *)dict;
-- (NSDictionary *)dictionaryValue;
+- (NSDictionary *)properties;
- (NSString *)fdfString;
Modified: trunk/PDFAnnotation_SKExtensions.m
===================================================================
--- trunk/PDFAnnotation_SKExtensions.m 2008-04-02 11:52:49 UTC (rev 3593)
+++ trunk/PDFAnnotation_SKExtensions.m 2008-04-02 12:01:48 UTC (rev 3594)
@@ -97,7 +97,7 @@
return nil;
}
-- (id)initWithDictionary:(NSDictionary *)dict{
+- (id)initWithProperties:(NSDictionary *)dict{
Class stringClass = [NSString class];
if ([self class] == [PDFAnnotation class]) {
@@ -121,7 +121,7 @@
annotationClass = [SKPDFAnnotationLine class];
[[self initWithBounds:NSZeroRect] release];
- self = [[annotationClass alloc] initWithDictionary:dict];
+ self = [[annotationClass alloc] initWithProperties:dict];
} else {
// called from the initialization of a subclass
@@ -159,7 +159,7 @@
return self;
}
-- (NSDictionary *)dictionaryValue{
+- (NSDictionary *)properties{
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity:5];
[dict setValue:[self type] forKey:SKPDFAnnotationTypeKey];
[dict setValue:[self string] forKey:SKPDFAnnotationContentsKey];
@@ -388,7 +388,7 @@
// to support the 'duplicate' command
- (id)copyWithZone:(NSZone *)zone {
if ([self isMovable]) // we don't want to duplicate markup
- return [[PDFAnnotation allocWithZone:zone] initWithDictionary:[self
dictionaryValue]];
+ return [[PDFAnnotation allocWithZone:zone] initWithProperties:[self
properties]];
else
return nil;
}
Modified: trunk/SKDocument.m
===================================================================
--- trunk/SKDocument.m 2008-04-02 11:52:49 UTC (rev 3593)
+++ trunk/SKDocument.m 2008-04-02 12:01:48 UTC (rev 3594)
@@ -1374,7 +1374,7 @@
}
- (NSData *)notesData {
- NSArray *array = [[self notes] valueForKey:@"dictionaryValue"];
+ NSArray *array = [[self notes] valueForKey:@"properties"];
return array ? [NSKeyedArchiver archivedDataWithRootObject:array] : nil;
}
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2008-04-02 11:52:49 UTC (rev 3593)
+++ trunk/SKMainWindowController.m 2008-04-02 12:01:48 UTC (rev 3594)
@@ -1040,7 +1040,7 @@
// create new annotations from the dictionary and add them to their page
and to the document
while (dict = [e nextObject]) {
unsigned pageIndex = [[dict objectForKey:@"pageIndex"]
unsignedIntValue];
- if (annotation = [[PDFAnnotation alloc] initWithDictionary:dict]) {
+ if (annotation = [[PDFAnnotation alloc] initWithProperties:dict]) {
if (pageIndex == NSNotFound)
pageIndex = 0;
else if (pageIndex >= [pdfDoc pageCount])
@@ -4023,7 +4023,7 @@
itemEnum = [[self noteItems:items] objectEnumerator];
while (item = [itemEnum nextObject]) {
if ([item isMovable]) {
- noteData = [NSKeyedArchiver archivedDataWithRootObject:[item
dictionaryValue]];
+ noteData = [NSKeyedArchiver archivedDataWithRootObject:[item
properties]];
[types addObject:SKSkimNotePboardType];
break;
}
Modified: trunk/SKPDFAnnotationCircle.m
===================================================================
--- trunk/SKPDFAnnotationCircle.m 2008-04-02 11:52:49 UTC (rev 3593)
+++ trunk/SKPDFAnnotationCircle.m 2008-04-02 12:01:48 UTC (rev 3594)
@@ -60,8 +60,8 @@
return self;
}
-- (id)initWithDictionary:(NSDictionary *)dict{
- if (self = [super initWithDictionary:dict]) {
+- (id)initWithProperties:(NSDictionary *)dict{
+ if (self = [super initWithProperties:dict]) {
Class colorClass = [NSColor class];
NSColor *interiorColor = [dict
objectForKey:SKPDFAnnotationInteriorColorKey];
if ([interiorColor isKindOfClass:colorClass])
@@ -70,8 +70,8 @@
return self;
}
-- (NSDictionary *)dictionaryValue{
- NSMutableDictionary *dict = [[[super dictionaryValue] mutableCopy]
autorelease];
+- (NSDictionary *)properties{
+ NSMutableDictionary *dict = [[[super properties] mutableCopy] autorelease];
[dict setValue:[self interiorColor]
forKey:SKPDFAnnotationInteriorColorKey];
return dict;
}
Modified: trunk/SKPDFAnnotationFreeText.m
===================================================================
--- trunk/SKPDFAnnotationFreeText.m 2008-04-02 11:52:49 UTC (rev 3593)
+++ trunk/SKPDFAnnotationFreeText.m 2008-04-02 12:01:48 UTC (rev 3594)
@@ -74,8 +74,8 @@
return self;
}
-- (id)initWithDictionary:(NSDictionary *)dict{
- if (self = [super initWithDictionary:dict]) {
+- (id)initWithProperties:(NSDictionary *)dict{
+ if (self = [super initWithProperties:dict]) {
Class fontClass = [NSFont class];
NSFont *font = [dict objectForKey:SKPDFAnnotationFontKey];
NSNumber *rotation = [dict objectForKey:SKPDFAnnotationRotationKey];
@@ -87,8 +87,8 @@
return self;
}
-- (NSDictionary *)dictionaryValue{
- NSMutableDictionary *dict = [[[super dictionaryValue] mutableCopy]
autorelease];
+- (NSDictionary *)properties{
+ NSMutableDictionary *dict = [[[super properties] mutableCopy] autorelease];
[dict setValue:[self font] forKey:SKPDFAnnotationFontKey];
if ([self respondsToSelector:@selector(rotation)])
[dict setValue:[NSNumber numberWithInt:[self rotation]]
forKey:SKPDFAnnotationRotationKey];
Modified: trunk/SKPDFAnnotationLine.m
===================================================================
--- trunk/SKPDFAnnotationLine.m 2008-04-02 11:52:49 UTC (rev 3593)
+++ trunk/SKPDFAnnotationLine.m 2008-04-02 12:01:48 UTC (rev 3594)
@@ -99,8 +99,8 @@
return self;
}
-- (id)initWithDictionary:(NSDictionary *)dict{
- if (self = [super initWithDictionary:dict]) {
+- (id)initWithProperties:(NSDictionary *)dict{
+ if (self = [super initWithProperties:dict]) {
Class stringClass = [NSString class];
NSString *startPoint = [dict
objectForKey:SKPDFAnnotationStartPointKey];
NSString *endPoint = [dict objectForKey:SKPDFAnnotationEndPointKey];
@@ -118,8 +118,8 @@
return self;
}
-- (NSDictionary *)dictionaryValue {
- NSMutableDictionary *dict = [[[super dictionaryValue] mutableCopy]
autorelease];
+- (NSDictionary *)properties {
+ NSMutableDictionary *dict = [[[super properties] mutableCopy] autorelease];
[dict setValue:[NSNumber numberWithInt:[self startLineStyle]]
forKey:SKPDFAnnotationStartLineStyleKey];
[dict setValue:[NSNumber numberWithInt:[self endLineStyle]]
forKey:SKPDFAnnotationEndLineStyleKey];
[dict setValue:NSStringFromPoint([self startPoint])
forKey:SKPDFAnnotationStartPointKey];
Modified: trunk/SKPDFAnnotationMarkup.m
===================================================================
--- trunk/SKPDFAnnotationMarkup.m 2008-04-02 11:52:49 UTC (rev 3593)
+++ trunk/SKPDFAnnotationMarkup.m 2008-04-02 12:01:48 UTC (rev 3594)
@@ -149,8 +149,8 @@
return self;
}
-- (id)initWithDictionary:(NSDictionary *)dict{
- if (self = [super initWithDictionary:dict]) {
+- (id)initWithProperties:(NSDictionary *)dict{
+ if (self = [super initWithProperties:dict]) {
Class stringClass = [NSString class];
NSString *type = [dict objectForKey:SKPDFAnnotationTypeKey];
if ([type isKindOfClass:stringClass]) {
@@ -275,8 +275,8 @@
[super dealloc];
}
-- (NSDictionary *)dictionaryValue {
- NSMutableDictionary *dict = [[[super dictionaryValue] mutableCopy]
autorelease];
+- (NSDictionary *)properties {
+ NSMutableDictionary *dict = [[[super properties] mutableCopy] autorelease];
NSArray *quadPoints = createStringsFromPoints([self quadrilateralPoints]);
[dict setValue:quadPoints forKey:SKPDFAnnotationQuadrilateralPointsKey];
[quadPoints release];
Modified: trunk/SKPDFAnnotationNote.m
===================================================================
--- trunk/SKPDFAnnotationNote.m 2008-04-02 11:52:49 UTC (rev 3593)
+++ trunk/SKPDFAnnotationNote.m 2008-04-02 12:01:48 UTC (rev 3594)
@@ -106,8 +106,8 @@
[self setContents:contents];
}
-- (id)initWithDictionary:(NSDictionary *)dict{
- if (self = [super initWithDictionary:dict]) {
+- (id)initWithProperties:(NSDictionary *)dict{
+ if (self = [super initWithProperties:dict]) {
Class attrStringClass = [NSAttributedString class];
Class stringClass = [NSString class];
Class imageClass = [NSImage class];
@@ -135,8 +135,8 @@
[super dealloc];
}
-- (NSDictionary *)dictionaryValue{
- NSMutableDictionary *dict = [[[super dictionaryValue] mutableCopy]
autorelease];
+- (NSDictionary *)properties{
+ NSMutableDictionary *dict = [[[super properties] mutableCopy] autorelease];
[dict setValue:[NSNumber numberWithInt:[self iconType]]
forKey:SKPDFAnnotationTypeKey];
[dict setValue:[self text] forKey:SKPDFAnnotationTextKey];
[dict setValue:[self image] forKey:SKPDFAnnotationImageKey];
Modified: trunk/SKPDFAnnotationSquare.m
===================================================================
--- trunk/SKPDFAnnotationSquare.m 2008-04-02 11:52:49 UTC (rev 3593)
+++ trunk/SKPDFAnnotationSquare.m 2008-04-02 12:01:48 UTC (rev 3594)
@@ -60,8 +60,8 @@
return self;
}
-- (id)initWithDictionary:(NSDictionary *)dict{
- if (self = [super initWithDictionary:dict]) {
+- (id)initWithProperties:(NSDictionary *)dict{
+ if (self = [super initWithProperties:dict]) {
Class colorClass = [NSColor class];
NSColor *interiorColor = [dict
objectForKey:SKPDFAnnotationInteriorColorKey];
if ([interiorColor isKindOfClass:colorClass])
@@ -70,8 +70,8 @@
return self;
}
-- (NSDictionary *)dictionaryValue{
- NSMutableDictionary *dict = [[[super dictionaryValue] mutableCopy]
autorelease];
+- (NSDictionary *)properties{
+ NSMutableDictionary *dict = [[[super properties] mutableCopy] autorelease];
[dict setValue:[self interiorColor]
forKey:SKPDFAnnotationInteriorColorKey];
return dict;
}
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2008-04-02 11:52:49 UTC (rev 3593)
+++ trunk/SKPDFView.m 2008-04-02 12:01:48 UTC (rev 3594)
@@ -687,7 +687,7 @@
NSData *tiffData = nil;
if ([self hideNotes] == NO && [activeAnnotation isNoteAnnotation] &&
[activeAnnotation isMovable]) {
- if (noteData = [NSKeyedArchiver
archivedDataWithRootObject:[activeAnnotation dictionaryValue]])
+ if (noteData = [NSKeyedArchiver
archivedDataWithRootObject:[activeAnnotation properties]])
[types addObject:SKSkimNotePboardType];
}
@@ -797,7 +797,7 @@
NSDictionary *note = [NSKeyedUnarchiver unarchiveObjectWithData:data];
NSRect bounds;
- newAnnotation = [[[PDFAnnotation alloc] initWithDictionary:note]
autorelease];
+ newAnnotation = [[[PDFAnnotation alloc] initWithProperties:note]
autorelease];
bounds = [newAnnotation bounds];
page = [self currentPage];
bounds = SKConstrainRect(bounds, [page boundsForBox:[self
displayBox]]);
@@ -2705,7 +2705,7 @@
if (hideNotes == NO) {
if (([theEvent modifierFlags] & NSAlternateKeyMask) &&
[newActiveAnnotation isMovable]) {
// select a new copy of the annotation
- PDFAnnotation *newAnnotation = [[PDFAnnotation alloc]
initWithDictionary:[newActiveAnnotation dictionaryValue]];
+ PDFAnnotation *newAnnotation = [[PDFAnnotation alloc]
initWithProperties:[newActiveAnnotation properties]];
[self addAnnotation:newAnnotation toPage:page];
[[self undoManager] setActionName:NSLocalizedString(@"Add Note",
@"Undo action name")];
newActiveAnnotation = newAnnotation;
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