Revision: 3680
http://skim-app.svn.sourceforge.net/skim-app/?rev=3680&view=rev
Author: hofman
Date: 2008-04-08 13:27:15 -0700 (Tue, 08 Apr 2008)
Log Message:
-----------
Rename some FDF globals. Use globals in formats for main FDF file.
Modified Paths:
--------------
trunk/PDFAnnotation_SKExtensions.m
trunk/SKDocument.m
trunk/SKFDFParser.h
trunk/SKFDFParser.m
Modified: trunk/PDFAnnotation_SKExtensions.m
===================================================================
--- trunk/PDFAnnotation_SKExtensions.m 2008-04-08 18:22:32 UTC (rev 3679)
+++ trunk/PDFAnnotation_SKExtensions.m 2008-04-08 20:27:15 UTC (rev 3680)
@@ -187,7 +187,7 @@
PDFBorder *border = [self border];
NSString *contents = [self contents];
[[self color] getRed:&r green:&g blue:&b alpha:&a];
- [fdfString appendFormat:@"/%s/%s/%s/", SKFDFAnnotationTypeKey,
SKFDFAnnotation, SKFDFAnnotationSubtypeKey];
+ [fdfString appendFormat:@"/%s/%s/%s/", SKFDFTypeKey, SKFDFAnnotation,
SKFDFAnnotationTypeKey];
[fdfString appendString:[[self type] isEqualToString:SKNoteString] ?
SKTextString : [self type]];
[fdfString appendFormat:@"/%s[%f %f %f %f]", SKFDFAnnotationRectKey,
NSMinX(bounds), NSMinY(bounds), NSMaxX(bounds), NSMaxY(bounds)];
[fdfString appendFormat:@"/%s %i", SKFDFAnnotationPageKey, [self
pageIndex]];
Modified: trunk/SKDocument.m
===================================================================
--- trunk/SKDocument.m 2008-04-08 18:22:32 UTC (rev 3679)
+++ trunk/SKDocument.m 2008-04-08 20:27:15 UTC (rev 3680)
@@ -1502,10 +1502,10 @@
[string appendFormat:@"%i 0 obj<<%@>>\nendobj\n", i + 1, [[[self
notes] objectAtIndex:i] fdfString]];
[annots appendFormat:@"%i 0 R ", i + 1];
}
- [string appendFormat:@"%i 0 obj<</FDF<</[EMAIL PROTECTED]/F(%@)", i + 1,
annots, filename ? [filename stringByEscapingParenthesis] : @""];
+ [string appendFormat:@"%i 0 obj<</%s<</[EMAIL PROTECTED]/%s(%@)", i + 1,
SKFDFCatalogKey, SKFDFAnnotationsKey, annots, SKFDFFileKey, filename ?
[filename stringByEscapingParenthesis] : @""];
if ([fileIDStrings count] == 2)
- [string appendFormat:@"/ID[<%@><%@>]", [fileIDStrings
objectAtIndex:0], [fileIDStrings objectAtIndex:1]];
- [string appendFormat:@">>>>\nendobj\ntrailer\n<</Root %i 0 R>>\n%%EOF\n",
i + 1];
+ [string appendFormat:@"/%s[<%@><%@>]", SKFDFFileIDKey, [fileIDStrings
objectAtIndex:0], [fileIDStrings objectAtIndex:1]];
+ [string appendFormat:@">>>>\nendobj\ntrailer\n<</%s %i 0 R>>\n%%EOF\n",
SKFDFRootKey, i + 1];
return string;
}
Modified: trunk/SKFDFParser.h
===================================================================
--- trunk/SKFDFParser.h 2008-04-08 18:22:32 UTC (rev 3679)
+++ trunk/SKFDFParser.h 2008-04-08 20:27:15 UTC (rev 3680)
@@ -38,11 +38,16 @@
#import <Cocoa/Cocoa.h>
-extern const char *SKFDFAnnotationCatalogKey;
-extern const char *SKFDFAnnotationAnnotsKey;
+extern const char *SKFDFCatalogKey;
+extern const char *SKFDFAnnotationsKey;
+extern const char *SKFDFFileKey;
+extern const char *SKFDFFileIDKey;
+extern const char *SKFDFRootKey;
+
+extern const char *SKFDFTypeKey;
+
+extern const char *SKFDFAnnotationFlagsKey;
extern const char *SKFDFAnnotationTypeKey;
-extern const char *SKFDFAnnotationFlagsKey;
-extern const char *SKFDFAnnotationSubtypeKey;
extern const char *SKFDFAnnotationRectKey;
extern const char *SKFDFAnnotationContentsKey;
extern const char *SKFDFAnnotationBoundsKey;
Modified: trunk/SKFDFParser.m
===================================================================
--- trunk/SKFDFParser.m 2008-04-08 18:22:32 UTC (rev 3679)
+++ trunk/SKFDFParser.m 2008-04-08 20:27:15 UTC (rev 3680)
@@ -52,11 +52,15 @@
#import "SKPDFAnnotationNote.h"
const char *SKFDFCatalogKey = "FDF";
-const char *SKFDFAnnotsKey = "Annots";
+const char *SKFDFAnnotationsKey = "Annots";
+const char *SKFDFFileKey = "F";
+const char *SKFDFFileIDKey = "ID";
+const char *SKFDFRootKey = "Root";
-const char *SKFDFAnnotationTypeKey = "Type";
+const char *SKFDFTypeKey = "Type";
+
const char *SKFDFAnnotationFlagsKey = "F";
-const char *SKFDFAnnotationSubtypeKey = "Subtype";
+const char *SKFDFAnnotationTypeKey = "Subtype";
const char *SKFDFAnnotationRectKey = "Rect";
const char *SKFDFAnnotationContentsKey = "Contents";
const char *SKFDFAnnotationBoundsKey = "Bounds";
@@ -126,7 +130,7 @@
if (catalog &&
CGPDFDictionaryGetDictionary(catalog, SKFDFCatalogKey, &fdfDict) &&
- CGPDFDictionaryGetArray(fdfDict, SKFDFAnnotsKey, &annots)) {
+ CGPDFDictionaryGetArray(fdfDict, SKFDFAnnotationsKey, &annots)) {
size_t i, count = CGPDFArrayGetCount(annots);
notes = [NSMutableArray arrayWithCapacity:count];
@@ -163,11 +167,11 @@
BOOL success = YES;
NSRect bounds = NSZeroRect;
- if (CGPDFDictionaryGetName(annot, SKFDFAnnotationTypeKey, &name) == NO ||
strcmp(name, SKFDFAnnotation) != 0) {
+ if (CGPDFDictionaryGetName(annot, SKFDFTypeKey, &name) == NO ||
strcmp(name, SKFDFAnnotation) != 0) {
success = NO;
}
- if (CGPDFDictionaryGetName(annot, SKFDFAnnotationSubtypeKey, &name)) {
+ if (CGPDFDictionaryGetName(annot, SKFDFAnnotationTypeKey, &name)) {
[dictionary setObject:[NSString stringWithFormat:@"%s", name]
forKey:SKPDFAnnotationTypeKey];
} else {
success = 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
Register now and save $200. Hurry, offer ends at 11:59 p.m.,
Monday, April 7! Use priority code J8TLD2.
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