Revision: 6808
          http://skim-app.svn.sourceforge.net/skim-app/?rev=6808&view=rev
Author:   hofman
Date:     2010-09-17 20:00:55 +0000 (Fri, 17 Sep 2010)

Log Message:
-----------
Support for alignment in free text Skim notes.

Modified Paths:
--------------
    trunk/SkimNotes/PDFAnnotation_SKNExtensions.h
    trunk/SkimNotes/PDFAnnotation_SKNExtensions.m

Modified: trunk/SkimNotes/PDFAnnotation_SKNExtensions.h
===================================================================
--- trunk/SkimNotes/PDFAnnotation_SKNExtensions.h       2010-09-16 12:17:31 UTC 
(rev 6807)
+++ trunk/SkimNotes/PDFAnnotation_SKNExtensions.h       2010-09-17 20:00:55 UTC 
(rev 6808)
@@ -141,6 +141,7 @@
     @discussion  Global string for annotation user name key.
 */
 extern NSString *SKNPDFAnnotationUserNameKey;
+
 /*!
     @discussion  Global string for annotation interior color key.
 */
@@ -180,6 +181,10 @@
 */
 extern NSString *SKNPDFAnnotationFontSizeKey;
 /*!
+    @discussion  Global string for annotation text alignment key.
+*/
+extern NSString *SKNPDFAnnotationAlignmentKey;
+/*!
     @discussion  Global string for annotation rotation key.
 */
 extern NSString *SKNPDFAnnotationRotationKey;

Modified: trunk/SkimNotes/PDFAnnotation_SKNExtensions.m
===================================================================
--- trunk/SkimNotes/PDFAnnotation_SKNExtensions.m       2010-09-16 12:17:31 UTC 
(rev 6807)
+++ trunk/SkimNotes/PDFAnnotation_SKNExtensions.m       2010-09-17 20:00:55 UTC 
(rev 6808)
@@ -79,6 +79,7 @@
 NSString *SKNPDFAnnotationFontColorKey = @"fontColor";
 NSString *SKNPDFAnnotationFontNameKey = @"fontName";
 NSString *SKNPDFAnnotationFontSizeKey = @"fontSize";
+NSString *SKNPDFAnnotationAlignmentKey = @"alignment";
 NSString *SKNPDFAnnotationRotationKey = @"rotation";
 
 NSString *SKNPDFAnnotationQuadrilateralPointsKey = @"quadrilateralPoints";
@@ -346,11 +347,14 @@
         Class colorClass = [NSColor class];
         NSFont *font = [dict objectForKey:SKNPDFAnnotationFontKey];
         NSColor *fontColor = [dict objectForKey:SKNPDFAnnotationFontColorKey];
+        NSNumber *alignment = [dict objectForKey:SKNPDFAnnotationAlignmentKey];
         NSNumber *rotation = [dict objectForKey:SKNPDFAnnotationRotationKey];
         if ([font isKindOfClass:fontClass])
             [self setFont:font];
         if ([fontColor isKindOfClass:colorClass] && [self 
respondsToSelector:@selector(setFontColor:)])
             [self setFontColor:fontColor];
+        if ([alignment respondsToSelector:@selector(intValue)])
+            [self setAlignment:[alignment intValue]];
         if ([rotation respondsToSelector:@selector(intValue)] && [self 
respondsToSelector:@selector(setRotation:)])
             [self setRotation:[rotation intValue]];
     }
@@ -362,6 +366,7 @@
     [dict setValue:[self font] forKey:SKNPDFAnnotationFontKey];
     if ([self respondsToSelector:@selector(fontColor)] && [[self fontColor] 
isEqual:[NSColor colorWithCalibratedWhite:0.0 alpha:0.0]] == NO)
         [dict setValue:[self fontColor] forKey:SKNPDFAnnotationFontColorKey];
+    [dict setValue:[NSNumber numberWithInt:[self alignment]] 
forKey:SKNPDFAnnotationAlignmentKey];
     if ([self respondsToSelector:@selector(rotation)])
         [dict setValue:[NSNumber numberWithInt:[self rotation]] 
forKey:SKNPDFAnnotationRotationKey];
     return dict;


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

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to