Revision: 6816
http://skim-app.svn.sourceforge.net/skim-app/?rev=6816&view=rev
Author: hofman
Date: 2010-09-17 23:30:29 +0000 (Fri, 17 Sep 2010)
Log Message:
-----------
support interiorColor for line notes
Modified Paths:
--------------
trunk/InitialUserDefaults.plist
trunk/PDFAnnotationLine_SKExtensions.h
trunk/PDFAnnotationLine_SKExtensions.m
trunk/SKApplicationController.m
trunk/SKStringConstants.h
trunk/SKStringConstants.m
trunk/Skim.sdef
Modified: trunk/InitialUserDefaults.plist
===================================================================
--- trunk/InitialUserDefaults.plist 2010-09-17 23:29:31 UTC (rev 6815)
+++ trunk/InitialUserDefaults.plist 2010-09-17 23:30:29 UTC (rev 6816)
@@ -99,6 +99,8 @@
<data>BAt0eXBlZHN0cmVhbYED6IQBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMDhAJmZgAAhg==</data>
<key>SKSquareNoteInteriorColor</key>
<data>BAt0eXBlZHN0cmVhbYED6IQBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMDhAJmZgAAhg==</data>
+ <key>SKLineNoteInteriorColor</key>
+
<data>BAt0eXBlZHN0cmVhbYED6IQBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMDhAJmZgAAhg==</data>
<key>SKFreeTextNoteFontColor</key>
<data>BAt0eXBlZHN0cmVhbYED6IQBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARmZmZmAAAAAYY=</data>
<key>SKFreeTextNoteAlignment</key>
@@ -253,6 +255,7 @@
<string>SKInkNoteColor</string>
<string>SKCircleNoteInteriorColor</string>
<string>SKSquareNoteInteriorColor</string>
+ <string>SKLineNoteInteriorColor</string>
<string>SKFreeTextNoteFontColor</string>
<string>SKFreeTextNoteFontName</string>
<string>SKFreeTextNoteFontSize</string>
Modified: trunk/PDFAnnotationLine_SKExtensions.h
===================================================================
--- trunk/PDFAnnotationLine_SKExtensions.h 2010-09-17 23:29:31 UTC (rev
6815)
+++ trunk/PDFAnnotationLine_SKExtensions.h 2010-09-17 23:30:29 UTC (rev
6816)
@@ -65,5 +65,6 @@
- (void)setEndPointAsQDPoint:(NSData *)inQDPointAsData;
- (void)setScriptingStartLineStyle:(FourCharCode)style;
- (void)setScriptingEndLineStyle:(FourCharCode)style;
+- (void)setScriptingInteriorColor:(NSColor *)newColor;
@end
Modified: trunk/PDFAnnotationLine_SKExtensions.m
===================================================================
--- trunk/PDFAnnotationLine_SKExtensions.m 2010-09-17 23:29:31 UTC (rev
6815)
+++ trunk/PDFAnnotationLine_SKExtensions.m 2010-09-17 23:30:29 UTC (rev
6816)
@@ -39,6 +39,7 @@
#import "PDFAnnotationLine_SKExtensions.h"
#import <SkimNotes/SkimNotes.h>
#import "PDFAnnotation_SKExtensions.h"
+#import "PDFAnnotationCircle_SKExtensions.h"
#import "PDFBorder_SKExtensions.h"
#import "SKStringConstants.h"
#import "SKFDFParser.h"
@@ -83,6 +84,9 @@
- (id)initSkimNoteWithBounds:(NSRect)bounds {
if (self = [super initSkimNoteWithBounds:bounds]) {
[self setColor:[[NSUserDefaults standardUserDefaults]
colorForKey:SKLineNoteColorKey]];
+ NSColor *color = [[NSUserDefaults standardUserDefaults]
colorForKey:SKLineNoteInteriorColorKey];
+ if ([color alphaComponent] > 0.0)
+ [self setInteriorColor:color];
[self setStartLineStyle:[[NSUserDefaults standardUserDefaults]
integerForKey:SKLineNoteStartLineStyleKey]];
[self setEndLineStyle:[[NSUserDefaults standardUserDefaults]
integerForKey:SKLineNoteEndLineStyleKey]];
[self setStartPoint:NSMakePoint(0.0, 0.0)];
@@ -108,6 +112,12 @@
NSPoint endPoint = SKAddPoints([self endPoint], [self bounds].origin);
[fdfString appendFDFName:SKFDFAnnotationLinePointsKey];
[fdfString appendFormat:@"[%f %f %f %f]", startPoint.x, startPoint.y,
endPoint.x, endPoint.y];
+ CGFloat r, g, b, a = 0.0;
+ [[self interiorColor] getRed:&r green:&g blue:&b alpha:&a];
+ if (a > 0.0) {
+ [fdfString appendFDFName:SKFDFAnnotationInteriorColorKey];
+ [fdfString appendFormat:@"[%f %f %f]", r, g, b];
+ }
return fdfString;
}
@@ -136,6 +146,7 @@
[mutableKeys addObject:SKNPDFAnnotationEndLineStyleKey];
[mutableKeys addObject:SKNPDFAnnotationStartPointKey];
[mutableKeys addObject:SKNPDFAnnotationEndPointKey];
+ [mutableKeys addObject:SKNPDFAnnotationInteriorColorKey];
lineKeys = [mutableKeys copy];
[mutableKeys release];
}
@@ -152,6 +163,7 @@
[customKeys addObject:SKPDFAnnotationEndPointAsQDPointKey];
[customKeys addObject:SKPDFAnnotationScriptingStartLineStyleKey];
[customKeys addObject:SKPDFAnnotationScriptingEndLineStyleKey];
+ [customKeys addObject:SKPDFAnnotationScriptingInteriorColorKey];
customLineScriptingKeys = [customKeys copy];
[customKeys release];
}
@@ -254,6 +266,16 @@
}
}
+- (NSColor *)scriptingInteriorColor {
+ return [self interiorColor];
+}
+
+- (void)setScriptingInteriorColor:(NSColor *)newColor {
+ if ([self isEditable]) {
+ [self setInteriorColor:newColor];
+ }
+}
+
#pragma mark Accessibility
- (NSArray *)accessibilityAttributeNames {
Modified: trunk/SKApplicationController.m
===================================================================
--- trunk/SKApplicationController.m 2010-09-17 23:29:31 UTC (rev 6815)
+++ trunk/SKApplicationController.m 2010-09-17 23:30:29 UTC (rev 6816)
@@ -101,6 +101,7 @@
#define SKCircleInteriorString @"CircleInterior"
#define SKSquareInteriorString @"SquareInterior"
+#define SKLineInteriorString @"LineInterior"
#define SKFreeTextFontString @"FreeTextFont"
@interface SKApplicationController (SKPrivate)
@@ -548,6 +549,7 @@
[sud colorForKey:SKInkNoteColorKey], SKNInkString,
[sud colorForKey:SKCircleNoteInteriorColorKey],
SKCircleInteriorString,
[sud colorForKey:SKSquareNoteInteriorColorKey],
SKSquareInteriorString,
+ [sud colorForKey:SKLineNoteInteriorColorKey], SKLineInteriorString,
[sud colorForKey:SKFreeTextNoteFontColorKey], SKFreeTextFontString,
nil];
}
@@ -577,6 +579,8 @@
[sud setColor:color forKey:SKCircleNoteInteriorColorKey];
if (color = [colorDict objectForKey:SKSquareInteriorString])
[sud setColor:color forKey:SKSquareNoteInteriorColorKey];
+ if (color = [colorDict objectForKey:SKLineInteriorString])
+ [sud setColor:color forKey:SKLineNoteInteriorColorKey];
if (color = [colorDict objectForKey:SKFreeTextFontString])
[sud setColor:color forKey:SKFreeTextNoteFontColorKey];
}
Modified: trunk/SKStringConstants.h
===================================================================
--- trunk/SKStringConstants.h 2010-09-17 23:29:31 UTC (rev 6815)
+++ trunk/SKStringConstants.h 2010-09-17 23:30:29 UTC (rev 6816)
@@ -78,6 +78,7 @@
extern NSString *SKInkNoteColorKey;
extern NSString *SKCircleNoteInteriorColorKey;
extern NSString *SKSquareNoteInteriorColorKey;
+extern NSString *SKLineNoteInteriorColorKey;
extern NSString *SKFreeTextNoteFontColorKey;
extern NSString *SKFreeTextNoteAlignmentKey;
extern NSString *SKAnchoredNoteIconTypeKey;
Modified: trunk/SKStringConstants.m
===================================================================
--- trunk/SKStringConstants.m 2010-09-17 23:29:31 UTC (rev 6815)
+++ trunk/SKStringConstants.m 2010-09-17 23:30:29 UTC (rev 6816)
@@ -79,6 +79,7 @@
NSString *SKInkNoteColorKey = @"SKInkNoteColor";
NSString *SKCircleNoteInteriorColorKey = @"SKCircleNoteInteriorColor";
NSString *SKSquareNoteInteriorColorKey = @"SKSquareNoteInteriorColor";
+NSString *SKLineNoteInteriorColorKey = @"SKLineNoteInteriorColor";
NSString *SKFreeTextNoteFontColorKey = @"SKFreeTextNoteFontColor";
NSString *SKFreeTextNoteAlignmentKey = @"SKFreeTextNoteAlignment";
NSString *SKFreeTextNoteLineWidthKey = @"SKFreeTextNoteLineWidth";
Modified: trunk/Skim.sdef
===================================================================
--- trunk/Skim.sdef 2010-09-17 23:29:31 UTC (rev 6815)
+++ trunk/Skim.sdef 2010-09-17 23:30:29 UTC (rev 6816)
@@ -1077,7 +1077,7 @@
<cocoa key="scriptingIconType"/>
</property>
<property name="interior color" code="IClr" type="RGBA color"
- description="The fill color of a circle or box.">
+ description="The fill color of a circle, box, or line.">
<cocoa key="scriptingInteriorColor"/>
</property>
<property name="line width" code="LnWd" type="real"
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