Revision: 6809
http://skim-app.svn.sourceforge.net/skim-app/?rev=6809&view=rev
Author: hofman
Date: 2010-09-17 20:02:58 +0000 (Fri, 17 Sep 2010)
Log Message:
-----------
Support for alignment in free text Skim notes. Add alignment menu items to Font
submenu. Support alignment actions in main window controller. Pref key for
default alignment.
Modified Paths:
--------------
trunk/Dutch.lproj/MainMenu.strings
trunk/English.lproj/MainMenu.strings
trunk/French.lproj/MainMenu.strings
trunk/German.lproj/MainMenu.strings
trunk/InitialUserDefaults.plist
trunk/Italian.lproj/MainMenu.strings
trunk/MainMenu.xib
trunk/PDFAnnotationFreeText_SKExtensions.m
trunk/SKFDFParser.h
trunk/SKFDFParser.m
trunk/SKMainWindowController_Actions.h
trunk/SKMainWindowController_Actions.m
trunk/SKStringConstants.h
trunk/SKStringConstants.m
trunk/Spanish.lproj/MainMenu.strings
trunk/pl.lproj/MainMenu.strings
trunk/ru.lproj/MainMenu.strings
trunk/zh_TW.lproj/MainMenu.strings
Modified: trunk/Dutch.lproj/MainMenu.strings
===================================================================
(Binary files differ)
Modified: trunk/English.lproj/MainMenu.strings
===================================================================
(Binary files differ)
Modified: trunk/French.lproj/MainMenu.strings
===================================================================
(Binary files differ)
Modified: trunk/German.lproj/MainMenu.strings
===================================================================
(Binary files differ)
Modified: trunk/InitialUserDefaults.plist
===================================================================
--- trunk/InitialUserDefaults.plist 2010-09-17 20:00:55 UTC (rev 6808)
+++ trunk/InitialUserDefaults.plist 2010-09-17 20:02:58 UTC (rev 6809)
@@ -101,6 +101,8 @@
<data>BAt0eXBlZHN0cmVhbYED6IQBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMDhAJmZgAAhg==</data>
<key>SKFreeTextNoteFontColor</key>
<data>BAt0eXBlZHN0cmVhbYED6IQBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARmZmZmAAAAAYY=</data>
+ <key>SKFreeTextNoteAlignment</key>
+ <integer>0</integer>
<key>SKFreeTextNoteLineWidth</key>
<real>1</real>
<key>SKFreeTextNoteLineStyle</key>
@@ -259,6 +261,7 @@
<string>SKFreeTextNoteLineWidth</string>
<string>SKFreeTextNoteLineStyle</string>
<string>SKFreeTextNoteDashPattern</string>
+ <string>SKFreeTextNoteAlignment</string>
<string>SKAnchoredNoteIconType</string>
<string>SKCircleNoteLineWidth</string>
<string>SKCircleNoteLineStyle</string>
Modified: trunk/Italian.lproj/MainMenu.strings
===================================================================
(Binary files differ)
Modified: trunk/MainMenu.xib
===================================================================
--- trunk/MainMenu.xib 2010-09-17 20:00:55 UTC (rev 6808)
+++ trunk/MainMenu.xib 2010-09-17 20:02:58 UTC (rev 6809)
@@ -918,6 +918,43 @@
<reference key="NSOnImage" ref="1022008517"/>
<reference key="NSMixedImage" ref="290280874"/>
</object>
+
<object class="NSMenuItem" id="316578428">
+
<reference key="NSMenu" ref="934112995"/>
+
<bool key="NSIsDisabled">YES</bool>
+
<bool key="NSIsSeparator">YES</bool>
+
<string key="NSTitle"/>
+
<string key="NSKeyEquiv"/>
+
<int key="NSMnemonicLoc">2147483647</int>
+
<reference key="NSOnImage" ref="1022008517"/>
+
<reference key="NSMixedImage" ref="290280874"/>
+
</object>
+
<object class="NSMenuItem" id="972931254">
+
<reference key="NSMenu" ref="934112995"/>
+
<string key="NSTitle">Align Left</string>
+
<string key="NSKeyEquiv">{</string>
+
<int key="NSKeyEquivModMask">1048576</int>
+
<int key="NSMnemonicLoc">2147483647</int>
+
<reference key="NSOnImage" ref="1022008517"/>
+
<reference key="NSMixedImage" ref="290280874"/>
+
</object>
+
<object class="NSMenuItem" id="984141521">
+
<reference key="NSMenu" ref="934112995"/>
+
<string key="NSTitle">Center</string>
+
<string key="NSKeyEquiv">|</string>
+
<int key="NSKeyEquivModMask">1048576</int>
+
<int key="NSMnemonicLoc">2147483647</int>
+
<reference key="NSOnImage" ref="1022008517"/>
+
<reference key="NSMixedImage" ref="290280874"/>
+
</object>
+
<object class="NSMenuItem" id="982723489">
+
<reference key="NSMenu" ref="934112995"/>
+
<string key="NSTitle">Align Right</string>
+
<string key="NSKeyEquiv">}</string>
+
<int key="NSKeyEquivModMask">1048576</int>
+
<int key="NSMnemonicLoc">2147483647</int>
+
<reference key="NSOnImage" ref="1022008517"/>
+
<reference key="NSMixedImage" ref="290280874"/>
+
</object>
</object>
<string key="NSName">_NSFontMenu</string>
</object>
@@ -3587,6 +3624,30 @@
</object>
<int key="connectionID">1046</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection"
key="connection">
+ <string
key="label">alignCenter:</string>
+ <reference key="source"
ref="660174102"/>
+ <reference key="destination"
ref="984141521"/>
+ </object>
+ <int key="connectionID">1069</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection"
key="connection">
+ <string
key="label">alignRight:</string>
+ <reference key="source"
ref="660174102"/>
+ <reference key="destination"
ref="982723489"/>
+ </object>
+ <int key="connectionID">1073</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection"
key="connection">
+ <string
key="label">alignLeft:</string>
+ <reference key="source"
ref="660174102"/>
+ <reference key="destination"
ref="972931254"/>
+ </object>
+ <int key="connectionID">1075</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -5033,6 +5094,10 @@
<reference
ref="196397365"/>
<reference
ref="622018929"/>
<reference
ref="85391443"/>
+ <reference
ref="316578428"/>
+ <reference
ref="982723489"/>
+ <reference
ref="984141521"/>
+ <reference
ref="972931254"/>
</object>
<reference key="parent"
ref="730755045"/>
</object>
@@ -5229,6 +5294,26 @@
<reference key="object"
ref="618195290"/>
<reference key="parent"
ref="548272754"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1085</int>
+ <reference key="object"
ref="316578428"/>
+ <reference key="parent"
ref="934112995"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1049</int>
+ <reference key="object"
ref="972931254"/>
+ <reference key="parent"
ref="934112995"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1050</int>
+ <reference key="object"
ref="984141521"/>
+ <reference key="parent"
ref="934112995"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1052</int>
+ <reference key="object"
ref="982723489"/>
+ <reference key="parent"
ref="934112995"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary"
key="flattenedProperties">
@@ -5248,8 +5333,12 @@
<string>1039.ImportedFromIB2</string>
<string>1043.IBPluginDependency</string>
<string>1043.ImportedFromIB2</string>
+ <string>1049.IBPluginDependency</string>
+ <string>1050.IBPluginDependency</string>
+ <string>1052.IBPluginDependency</string>
<string>106.IBPluginDependency</string>
<string>106.ImportedFromIB2</string>
+ <string>1085.IBPluginDependency</string>
<string>111.IBPluginDependency</string>
<string>111.ImportedFromIB2</string>
<string>124.IBPluginDependency</string>
@@ -5308,6 +5397,7 @@
<string>172.ImportedFromIB2</string>
<string>184.IBPluginDependency</string>
<string>184.ImportedFromIB2</string>
+
<string>185.IBEditorWindowLastContentRect</string>
<string>185.IBPluginDependency</string>
<string>185.ImportedFromIB2</string>
<string>187.IBPluginDependency</string>
@@ -5728,8 +5818,12 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
@@ -5778,7 +5872,7 @@
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
- <string>{{291, 409}, {250,
303}}</string>
+ <string>{{145, 472}, {250,
303}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -5787,6 +5881,7 @@
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
+ <string>{{395, 452}, {257, 63}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -6159,7 +6254,7 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{541, 219}, {169,
253}}</string>
+ <string>{{395, 212}, {169,
323}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -6208,7 +6303,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">1046</int>
+ <int key="maxID">1085</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray"
key="referencedPartialClassDescriptions">
@@ -9030,6 +9125,7 @@
<bool
key="EncodedWithXMLCoder">YES</bool>
<string>copy:</string>
<string>delete:</string>
+ <string>paste:</string>
<string>scrollToBeginningOfDocument:</string>
<string>scrollToEndOfDocument:</string>
</object>
@@ -9039,6 +9135,7 @@
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>id</string>
</object>
</object>
<object class="NSMutableDictionary"
key="actionInfosByName">
@@ -9047,6 +9144,7 @@
<bool
key="EncodedWithXMLCoder">YES</bool>
<string>copy:</string>
<string>delete:</string>
+ <string>paste:</string>
<string>scrollToBeginningOfDocument:</string>
<string>scrollToEndOfDocument:</string>
</object>
@@ -9061,6 +9159,10 @@
<string
key="candidateClassName">id</string>
</object>
<object
class="IBActionInfo">
+ <string
key="name">paste:</string>
+ <string
key="candidateClassName">id</string>
+ </object>
+ <object
class="IBActionInfo">
<string
key="name">scrollToBeginningOfDocument:</string>
<string
key="candidateClassName">id</string>
</object>
Modified: trunk/PDFAnnotationFreeText_SKExtensions.m
===================================================================
--- trunk/PDFAnnotationFreeText_SKExtensions.m 2010-09-17 20:00:55 UTC (rev
6808)
+++ trunk/PDFAnnotationFreeText_SKExtensions.m 2010-09-17 20:02:58 UTC (rev
6809)
@@ -62,6 +62,7 @@
[self setFont:font];
[self setColor:[[NSUserDefaults standardUserDefaults]
colorForKey:SKFreeTextNoteColorKey]];
[self setFontColor:[[NSUserDefaults standardUserDefaults]
colorForKey:SKFreeTextNoteFontColorKey]];
+ [self setAlignment:[[NSUserDefaults standardUserDefaults]
integerForKey:SKFreeTextNoteAlignmentKey]];
PDFBorder *border = [[PDFBorder allocWithZone:[self zone]] init];
[border setLineWidth:[[NSUserDefaults standardUserDefaults]
floatForKey:SKFreeTextNoteLineWidthKey]];
[border setDashPattern:[[NSUserDefaults standardUserDefaults]
arrayForKey:SKFreeTextNoteDashPatternKey]];
@@ -84,6 +85,8 @@
[fdfString appendString:@")"];
[fdfString appendFDFName:SKFDFDefaultStyleKey];
[fdfString appendFormat:@"(font: %@ %fpt)", [[self font] fontName], [[self
font] pointSize]];
+ [fdfString appendFDFName:SKFDFAnnotationAlignmentKey];
+ [fdfString appendFormat:@" %ld",
(long)SKFDFFreeTextAnnotationAlignmentFromPDFFreeTextAnnotationAlignment([self
alignment])];
return fdfString;
}
@@ -99,6 +102,7 @@
NSMutableSet *mutableKeys = [[super keysForValuesToObserveForUndo]
mutableCopy];
[mutableKeys addObject:SKNPDFAnnotationFontKey];
[mutableKeys addObject:SKNPDFAnnotationFontColorKey];
+ [mutableKeys addObject:SKNPDFAnnotationAlignmentKey];
freeTextKeys = [mutableKeys copy];
[mutableKeys release];
}
Modified: trunk/SKFDFParser.h
===================================================================
--- trunk/SKFDFParser.h 2010-09-17 20:00:55 UTC (rev 6808)
+++ trunk/SKFDFParser.h 2010-09-17 20:02:58 UTC (rev 6809)
@@ -63,6 +63,7 @@
extern SKFDFString SKFDFAnnotationBorderKey;
extern SKFDFString SKFDFAnnotationModificationDateKey;
extern SKFDFString SKFDFAnnotationUserNameKey;
+extern SKFDFString SKFDFAnnotationAlignmentKey;
extern SKFDFString SKFDFAnnotationIconTypeKey;
extern SKFDFString SKFDFAnnotationLineStylesKey;
extern SKFDFString SKFDFAnnotationLinePointsKey;
@@ -98,6 +99,9 @@
extern PDFBorderStyle SKPDFBorderStyleFromFDFBorderStyle(SKFDFString name);
extern SKFDFString SKFDFBorderStyleFromPDFBorderStyle(PDFBorderStyle
borderStyle);
+extern NSTextAlignment
SKPDFFreeTextAnnotationAlignmentFromFDFFreeTextAnnotationAlignment(NSInteger
anInt);
+extern NSInteger
SKFDFFreeTextAnnotationAlignmentFromPDFFreeTextAnnotationAlignment(NSTextAlignment
alignment);
+
extern PDFTextAnnotationIconType
SKPDFTextAnnotationIconTypeFromFDFTextAnnotationIconType(SKFDFString name);
extern SKFDFString
SKFDFTextAnnotationIconTypeFromPDFTextAnnotationIconType(PDFTextAnnotationIconType
iconType);
Modified: trunk/SKFDFParser.m
===================================================================
--- trunk/SKFDFParser.m 2010-09-17 20:00:55 UTC (rev 6808)
+++ trunk/SKFDFParser.m 2010-09-17 20:02:58 UTC (rev 6809)
@@ -66,6 +66,7 @@
SKFDFString SKFDFAnnotationBorderKey = "Border";
SKFDFString SKFDFAnnotationModificationDateKey = "M";
SKFDFString SKFDFAnnotationUserNameKey = "T";
+SKFDFString SKFDFAnnotationAlignmentKey = "Q";
SKFDFString SKFDFAnnotationIconTypeKey = "Name";
SKFDFString SKFDFAnnotationLineStylesKey = "LE";
SKFDFString SKFDFAnnotationLinePointsKey = "L";
@@ -126,6 +127,24 @@
}
}
+NSTextAlignment
SKPDFFreeTextAnnotationAlignmentFromFDFFreeTextAnnotationAlignment(NSInteger
anInt) {
+ switch (anInt) {
+ case 0: return NSLeftTextAlignment;
+ case 1: return NSCenterTextAlignment;
+ case 2: return NSRightTextAlignment;
+ default: return NSLeftTextAlignment;
+ }
+}
+
+NSInteger
SKFDFFreeTextAnnotationAlignmentFromPDFFreeTextAnnotationAlignment(NSTextAlignment
alignment) {
+ switch (alignment) {
+ case NSLeftTextAlignment: return 0;
+ case NSRightTextAlignment: return 2;
+ case NSCenterTextAlignment: return 1;
+ default: return 0;
+ }
+}
+
PDFTextAnnotationIconType
SKPDFTextAnnotationIconTypeFromFDFTextAnnotationIconType(SKFDFString name) {
if (SKFDFEqualStrings(name, SKFDFTextAnnotationIconComment))
return kPDFTextAnnotationIconComment;
@@ -332,6 +351,10 @@
[userName release];
}
+ if (success && CGPDFDictionaryGetInteger(annot,
SKFDFAnnotationPageIndexKey, &integer)) {
+ [dictionary setObject:[NSNumber
numberWithInteger:SKPDFFreeTextAnnotationAlignmentFromFDFFreeTextAnnotationAlignment(integer)]
forKey:SKNPDFAnnotationAlignmentKey];
+ }
+
if (success && CGPDFDictionaryGetName(annot, SKFDFAnnotationIconTypeKey,
&name)) {
[dictionary setObject:[NSNumber
numberWithInteger:SKPDFTextAnnotationIconTypeFromFDFTextAnnotationIconType(name)]
forKey:SKNPDFAnnotationIconTypeKey];
}
Modified: trunk/SKMainWindowController_Actions.h
===================================================================
--- trunk/SKMainWindowController_Actions.h 2010-09-17 20:00:55 UTC (rev
6808)
+++ trunk/SKMainWindowController_Actions.h 2010-09-17 20:02:58 UTC (rev
6809)
@@ -44,6 +44,10 @@
- (IBAction)changeColor:(id)sender;
- (IBAction)changeFont:(id)sender;
+- (IBAction)changeAttributes:(id)sender;
+- (IBAction)alignLeft:(id)sender;
+- (IBAction)alignRight:(id)sender;
+- (IBAction)alignCenter:(id)sender;
- (IBAction)createNewNote:(id)sender;
- (IBAction)editNote:(id)sender;
- (IBAction)toggleHideNotes:(id)sender;
Modified: trunk/SKMainWindowController_Actions.m
===================================================================
--- trunk/SKMainWindowController_Actions.m 2010-09-17 20:00:55 UTC (rev
6808)
+++ trunk/SKMainWindowController_Actions.m 2010-09-17 20:02:58 UTC (rev
6809)
@@ -115,6 +115,27 @@
}
}
+- (IBAction)alignLeft:(id)sender {
+ PDFAnnotation *annotation = [pdfView activeAnnotation];
+ if ([annotation isSkimNote] && [annotation
respondsToSelector:@selector(setAlignment:)] && [annotation
respondsToSelector:@selector(alignment)]) {
+ [(PDFAnnotationFreeText *)annotation setAlignment:NSLeftTextAlignment];
+ }
+}
+
+- (IBAction)alignRight:(id)sender {
+ PDFAnnotation *annotation = [pdfView activeAnnotation];
+ if ([annotation isSkimNote] && [annotation
respondsToSelector:@selector(setAlignment:)] && [annotation
respondsToSelector:@selector(alignment)]) {
+ [(PDFAnnotationFreeText *)annotation
setAlignment:NSRightTextAlignment];
+ }
+}
+
+- (IBAction)alignCenter:(id)sender {
+ PDFAnnotation *annotation = [pdfView activeAnnotation];
+ if ([annotation isSkimNote] && [annotation
respondsToSelector:@selector(setAlignment:)] && [annotation
respondsToSelector:@selector(alignment)]) {
+ [(PDFAnnotationFreeText *)annotation
setAlignment:NSCenterTextAlignment];
+ }
+}
+
- (void)changeLineAttribute:(id)sender {
SKLineChangeAction action = [sender currentLineChangeAction];
PDFAnnotation *annotation = [pdfView activeAnnotation];
Modified: trunk/SKStringConstants.h
===================================================================
--- trunk/SKStringConstants.h 2010-09-17 20:00:55 UTC (rev 6808)
+++ trunk/SKStringConstants.h 2010-09-17 20:02:58 UTC (rev 6809)
@@ -79,6 +79,7 @@
extern NSString *SKCircleNoteInteriorColorKey;
extern NSString *SKSquareNoteInteriorColorKey;
extern NSString *SKFreeTextNoteFontColorKey;
+extern NSString *SKFreeTextNoteAlignmentKey;
extern NSString *SKAnchoredNoteIconTypeKey;
extern NSString *SKFreeTextNoteLineWidthKey;
extern NSString *SKFreeTextNoteLineStyleKey;
Modified: trunk/SKStringConstants.m
===================================================================
--- trunk/SKStringConstants.m 2010-09-17 20:00:55 UTC (rev 6808)
+++ trunk/SKStringConstants.m 2010-09-17 20:02:58 UTC (rev 6809)
@@ -80,6 +80,7 @@
NSString *SKCircleNoteInteriorColorKey = @"SKCircleNoteInteriorColor";
NSString *SKSquareNoteInteriorColorKey = @"SKSquareNoteInteriorColor";
NSString *SKFreeTextNoteFontColorKey = @"SKFreeTextNoteFontColor";
+NSString *SKFreeTextNoteAlignmentKey = @"SKFreeTextNoteAlignment";
NSString *SKFreeTextNoteLineWidthKey = @"SKFreeTextNoteLineWidth";
NSString *SKAnchoredNoteIconTypeKey = @"SKAnchoredNoteIconType";
NSString *SKFreeTextNoteLineStyleKey = @"SKFreeTextNoteLineStyle";
Modified: trunk/Spanish.lproj/MainMenu.strings
===================================================================
(Binary files differ)
Modified: trunk/pl.lproj/MainMenu.strings
===================================================================
(Binary files differ)
Modified: trunk/ru.lproj/MainMenu.strings
===================================================================
(Binary files differ)
Modified: trunk/zh_TW.lproj/MainMenu.strings
===================================================================
(Binary files differ)
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