You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
(23) |
Apr
(254) |
May
(252) |
Jun
(209) |
Jul
(198) |
Aug
(192) |
Sep
(207) |
Oct
(120) |
Nov
(179) |
Dec
(52) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(48) |
Feb
(69) |
Mar
(129) |
Apr
(250) |
May
(113) |
Jun
(177) |
Jul
(228) |
Aug
(155) |
Sep
(218) |
Oct
(185) |
Nov
(109) |
Dec
(88) |
2009 |
Jan
(83) |
Feb
(39) |
Mar
(70) |
Apr
(47) |
May
(48) |
Jun
(67) |
Jul
(61) |
Aug
(97) |
Sep
(221) |
Oct
(141) |
Nov
(70) |
Dec
(61) |
2010 |
Jan
(45) |
Feb
(76) |
Mar
(178) |
Apr
(106) |
May
(57) |
Jun
(32) |
Jul
(64) |
Aug
(98) |
Sep
(96) |
Oct
(19) |
Nov
(34) |
Dec
(117) |
2011 |
Jan
(55) |
Feb
(48) |
Mar
(64) |
Apr
(21) |
May
(39) |
Jun
(53) |
Jul
(99) |
Aug
(56) |
Sep
(39) |
Oct
(26) |
Nov
(19) |
Dec
(69) |
2012 |
Jan
(17) |
Feb
(40) |
Mar
(17) |
Apr
|
May
(2) |
Jun
(8) |
Jul
(2) |
Aug
(10) |
Sep
(10) |
Oct
(38) |
Nov
(48) |
Dec
(70) |
2013 |
Jan
(43) |
Feb
(47) |
Mar
(39) |
Apr
(37) |
May
(25) |
Jun
(6) |
Jul
(20) |
Aug
(49) |
Sep
(33) |
Oct
(34) |
Nov
(75) |
Dec
(6) |
2014 |
Jan
(32) |
Feb
(10) |
Mar
(17) |
Apr
|
May
|
Jun
(26) |
Jul
(5) |
Aug
|
Sep
(4) |
Oct
(23) |
Nov
(80) |
Dec
(48) |
2015 |
Jan
(80) |
Feb
(50) |
Mar
(58) |
Apr
(20) |
May
(11) |
Jun
(16) |
Jul
(24) |
Aug
(27) |
Sep
(56) |
Oct
(30) |
Nov
(16) |
Dec
(6) |
2016 |
Jan
(31) |
Feb
(14) |
Mar
(23) |
Apr
(17) |
May
(40) |
Jun
(12) |
Jul
(17) |
Aug
(9) |
Sep
(32) |
Oct
(36) |
Nov
(23) |
Dec
(9) |
2017 |
Jan
(37) |
Feb
(23) |
Mar
(65) |
Apr
(22) |
May
(6) |
Jun
(3) |
Jul
|
Aug
|
Sep
(3) |
Oct
(22) |
Nov
(63) |
Dec
(71) |
2018 |
Jan
(83) |
Feb
(21) |
Mar
(35) |
Apr
(44) |
May
(14) |
Jun
(12) |
Jul
(8) |
Aug
(18) |
Sep
(10) |
Oct
(145) |
Nov
(144) |
Dec
(76) |
2019 |
Jan
(18) |
Feb
(28) |
Mar
(5) |
Apr
(208) |
May
(291) |
Jun
(158) |
Jul
(27) |
Aug
(8) |
Sep
(10) |
Oct
(83) |
Nov
(41) |
Dec
(31) |
2020 |
Jan
(16) |
Feb
(46) |
Mar
(100) |
Apr
(78) |
May
(69) |
Jun
(71) |
Jul
(28) |
Aug
(131) |
Sep
(176) |
Oct
(89) |
Nov
(147) |
Dec
(19) |
2021 |
Jan
(19) |
Feb
(25) |
Mar
(91) |
Apr
(98) |
May
(14) |
Jun
(44) |
Jul
(8) |
Aug
(3) |
Sep
(38) |
Oct
(57) |
Nov
(97) |
Dec
(74) |
2022 |
Jan
(89) |
Feb
(47) |
Mar
(15) |
Apr
(50) |
May
(54) |
Jun
(56) |
Jul
(80) |
Aug
(12) |
Sep
(11) |
Oct
(60) |
Nov
(48) |
Dec
(4) |
2023 |
Jan
(75) |
Feb
(49) |
Mar
(84) |
Apr
(24) |
May
(13) |
Jun
(74) |
Jul
(32) |
Aug
(66) |
Sep
(50) |
Oct
(38) |
Nov
(105) |
Dec
(181) |
2024 |
Jan
(21) |
Feb
(49) |
Mar
(77) |
Apr
(84) |
May
(20) |
Jun
(71) |
Jul
(53) |
Aug
(33) |
Sep
(54) |
Oct
(124) |
Nov
(151) |
Dec
(73) |
2025 |
Jan
(61) |
Feb
(17) |
Mar
(136) |
Apr
(72) |
May
(200) |
Jun
(238) |
Jul
(91) |
Aug
(8) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <ho...@us...> - 2007-07-06 18:23:03
|
Revision: 2432 http://skim-app.svn.sourceforge.net/skim-app/?rev=2432&view=rev Author: hofman Date: 2007-07-06 11:23:00 -0700 (Fri, 06 Jul 2007) Log Message: ----------- Fix export templates. Unfortunately, @-keypaths are not fully supported. Modified Paths: -------------- trunk/notesTemplate.rtf trunk/notesTemplate.txt Modified: trunk/notesTemplate.rtf =================================================================== --- trunk/notesTemplate.rtf 2007-07-06 17:21:16 UTC (rev 2431) +++ trunk/notesTemplate.rtf 2007-07-06 18:23:00 UTC (rev 2432) @@ -1,10 +1,9 @@ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 {\fonttbl\f0\fswiss\fcharset77 Helvetica;} {\colortbl;\red255\green255\blue255;} -\vieww10500\viewh9000\viewkind0 \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural -\f0\fs24 \cf0 <$notes.@arraySortedByBounds.@arraySortedByPageIndex>\ +\f0\fs24 \cf0 <$notes.@arraySortedByPageIndex>\ \'a5 <$type.typeName/>, page <$pageIndex.numberByAddingOne/>\ \ <$contents?>\ @@ -15,5 +14,5 @@ <$text/>\ \ </$text?>\ -</$notes.@arraySortedByBounds.@arraySortedByPageIndex>\ +</$notes.@arraySortedByPageIndex>\ } \ No newline at end of file Modified: trunk/notesTemplate.txt =================================================================== --- trunk/notesTemplate.txt 2007-07-06 17:21:16 UTC (rev 2431) +++ trunk/notesTemplate.txt 2007-07-06 18:23:00 UTC (rev 2432) @@ -1,4 +1,4 @@ -<$notes.@arraySortedByBounds.@arraySortedByPageIndex> +<$notes.@arraySortedByPageIndex> * <$type.typeName/>, page <$pageIndex.numberByAddingOne/> <$contents?> @@ -9,4 +9,4 @@ <$text/> </$text?> -</$notes.@arraySortedByBounds.@arraySortedByPageIndex> +</$notes.@arraySortedByPageIndex> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-06 17:21:22
|
Revision: 2431 http://skim-app.svn.sourceforge.net/skim-app/?rev=2431&view=rev Author: hofman Date: 2007-07-06 10:21:16 -0700 (Fri, 06 Jul 2007) Log Message: ----------- Load the data from the appcast URL ourselves so we can ignore the cache. Modified Paths: -------------- trunk/vendorsrc/andymatuschak/Sparkle/SUAppcast.m Modified: trunk/vendorsrc/andymatuschak/Sparkle/SUAppcast.m =================================================================== --- trunk/vendorsrc/andymatuschak/Sparkle/SUAppcast.m 2007-07-06 08:42:49 UTC (rev 2430) +++ trunk/vendorsrc/andymatuschak/Sparkle/SUAppcast.m 2007-07-06 17:21:16 UTC (rev 2431) @@ -42,8 +42,11 @@ { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; - NSError *error; - NSXMLDocument *document = [[NSXMLDocument alloc] initWithContentsOfURL:url options:0 error:&error]; + NSError *error = nil; + NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:60.0]; + NSURLResponse *response = nil; + NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; + NSXMLDocument *document = [[NSXMLDocument alloc] initWithData:data options:0 error:&error]; BOOL failed = NO; if (nil == document) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-06 08:42:51
|
Revision: 2430 http://skim-app.svn.sourceforge.net/skim-app/?rev=2430&view=rev Author: hofman Date: 2007-07-06 01:42:49 -0700 (Fri, 06 Jul 2007) Log Message: ----------- Tag for release Added Paths: ----------- tags/REL_0_5/ Copied: tags/REL_0_5 (from rev 2429, trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-06 08:41:31
|
Revision: 2429 http://skim-app.svn.sourceforge.net/skim-app/?rev=2429&view=rev Author: hofman Date: 2007-07-06 01:41:28 -0700 (Fri, 06 Jul 2007) Log Message: ----------- Update version numbers and release notes for release. Modified Paths: -------------- trunk/Dutch.lproj/InfoPlist.strings trunk/Dutch.lproj/Skim Help/version.texi trunk/English.lproj/InfoPlist.strings trunk/English.lproj/Skim Help/version.texi trunk/Info.plist trunk/Italian.lproj/InfoPlist.strings trunk/Italian.lproj/Skim Help/version.texi trunk/ReleaseNotes.rtf Modified: trunk/Dutch.lproj/InfoPlist.strings =================================================================== (Binary files differ) Modified: trunk/Dutch.lproj/Skim Help/version.texi =================================================================== --- trunk/Dutch.lproj/Skim Help/version.texi 2007-07-05 18:49:54 UTC (rev 2428) +++ trunk/Dutch.lproj/Skim Help/version.texi 2007-07-06 08:41:28 UTC (rev 2429) @@ -1 +1 @@ -@set VERSION 0.4.1 \ No newline at end of file +@set VERSION 0.5 Modified: trunk/English.lproj/InfoPlist.strings =================================================================== (Binary files differ) Modified: trunk/English.lproj/Skim Help/version.texi =================================================================== --- trunk/English.lproj/Skim Help/version.texi 2007-07-05 18:49:54 UTC (rev 2428) +++ trunk/English.lproj/Skim Help/version.texi 2007-07-06 08:41:28 UTC (rev 2429) @@ -1 +1 @@ -@set VERSION 0.4.1 +@set VERSION 0.5 Modified: trunk/Info.plist =================================================================== --- trunk/Info.plist 2007-07-05 18:49:54 UTC (rev 2428) +++ trunk/Info.plist 2007-07-06 08:41:28 UTC (rev 2429) @@ -312,11 +312,11 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>0.4.1</string> + <string>0.5</string> <key>CFBundleSignature</key> <string>SKIM</string> <key>CFBundleVersion</key> - <string>v5</string> + <string>v6</string> <key>LSMinimumSystemVersion</key> <string>10.4.0</string> <key>NSAppleScriptEnabled</key> Modified: trunk/Italian.lproj/InfoPlist.strings =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/Skim Help/version.texi =================================================================== --- trunk/Italian.lproj/Skim Help/version.texi 2007-07-05 18:49:54 UTC (rev 2428) +++ trunk/Italian.lproj/Skim Help/version.texi 2007-07-06 08:41:28 UTC (rev 2429) @@ -1 +1 @@ -@set VERSION 0.4.1 +@set VERSION 0.5 Modified: trunk/ReleaseNotes.rtf =================================================================== --- trunk/ReleaseNotes.rtf 2007-07-05 18:49:54 UTC (rev 2428) +++ trunk/ReleaseNotes.rtf 2007-07-06 08:41:28 UTC (rev 2429) @@ -1,7 +1,6 @@ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 -{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fnil\fcharset77 LucidaGrande;\f2\fnil\fcharset77 LucidaSans-Typewriter; -\f3\fswiss\fcharset77 Helvetica-Bold;\f4\fswiss\fcharset77 Helvetica-BoldOblique;\f5\fnil\fcharset77 LucidaGrande-Bold; -} +{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fnil\fcharset77 LucidaGrande;\f2\fswiss\fcharset77 Helvetica-Bold; +\f3\fswiss\fcharset77 Helvetica-BoldOblique;\f4\fnil\fcharset77 LucidaGrande-Bold;} {\colortbl;\red255\green255\blue255;} {\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid1} {\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid2} @@ -99,18 +98,14 @@ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\fs22 \cf0 \ -Last update: 5 July 2007 (rev -\f2\fs20 2425) -\f1\fs22 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\b\fs28 \cf0 \ -Changes since 0.4.1\ +\f2\b\fs28 \cf0 Changes since 0.4.1\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\fs26 \cf0 New Features\ +\f3\i\fs26 \cf0 New Features\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls1\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }You can now hide all notes and highlights.\ @@ -146,10 +141,10 @@ {\listtext \'a5 }New color swatch toolbar control to easily use a few default colors.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\f3\b\fs28 \cf0 \ +\f2\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\fs26 \cf0 Bugs Fixed\ +\f3\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls6\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Use old-style check for network availability for the updater, as the newer API is not reliable for dial-up connections.\ @@ -177,22 +172,22 @@ {\listtext \'a5 }The rotation of text notes is now saved.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\b\fs28 \cf0 \ +\f2\b\fs28 \cf0 \ Changes since 0.4\ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\fs26 \cf0 Bugs Fixed\ +\f3\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls8\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Fixed installation of new versions by updater.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\b\fs28 \cf0 \ +\f2\b\fs28 \cf0 \ Changes since 0.3\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\f4\i\fs26 \cf0 \ +\f3\i\fs26 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 New Features\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural @@ -242,10 +237,10 @@ \ls30\ilvl0\cf0 {\listtext \'a5 }You can now supply templates for text export of notes. See the wiki for more information.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\f3\b\fs28 \cf0 \ +\f2\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\fs26 \cf0 Bugs Fixed\ +\f3\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls31\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Fix links in help.\ @@ -267,12 +262,12 @@ \ls39\ilvl0\cf0 {\listtext \'a5 }Retry automatic reloading of files changed on disk a few times.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls39\ilvl0 -\f3\b\fs28 \cf0 \ +\f2\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Changes since 0.2\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\f4\i\fs26 \cf0 \ +\f3\i\fs26 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 New Features\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural @@ -346,10 +341,10 @@ \ls72\ilvl0\cf0 {\listtext \'a5 }New tool modes for ading notes or highlights.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\f3\b\fs28 \cf0 \ +\f2\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\fs26 \cf0 Bugs Fixed\ +\f3\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls73\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }We now don't edit new text notes, so they can be moved, resized or deleted.\ @@ -387,11 +382,11 @@ \ls89\ilvl0\cf0 {\listtext \'a5 }Lazy updating of page thumbnails to avoid slowdown when opening a file.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\b\fs28 \cf0 \ +\f2\b\fs28 \cf0 \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f0\b0\fs48 \cf0 Colofon -\f3\b\fs28 \ +\f2\b\fs28 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural @@ -402,7 +397,7 @@ \fs22 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\b\fs28 \cf0 About Skim\ +\f2\b\fs28 \cf0 About Skim\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\b0\fs22 \cf0 \ @@ -410,7 +405,7 @@ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\b\fs26 \cf0 Web Site\ +\f3\i\b\fs26 \cf0 Web Site\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\i0\b0\fs22 \cf0 \ @@ -418,7 +413,7 @@ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\b\fs26 \cf0 Getting Help\ +\f3\i\b\fs26 \cf0 Getting Help\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\i0\b0\fs22 \cf0 \ @@ -426,11 +421,11 @@ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\b\fs26 \cf0 Reporting Bugs\ +\f3\i\b\fs26 \cf0 Reporting Bugs\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\i0\b0\fs22 \cf0 \ Bug reports should be submitted to the {\field{\*\fldinst{HYPERLINK "http://sourceforge.net/tracker/?group_id=192583&atid=941981"}}{\fldrslt bug tracker}} on SourceForge. -\f5\b Note: +\f4\b Note: \f1\b0 If you can, please assign the bug report to someone - if you don't personally know any developers, assign the bug to Mike (username mmcc). If you don't assign the bug to someone, nobody may notice it for a long time. Assigning it to someone sends them an email notification.\ } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-05 18:49:55
|
Revision: 2428 http://skim-app.svn.sourceforge.net/skim-app/?rev=2428&view=rev Author: hofman Date: 2007-07-05 11:49:54 -0700 (Thu, 05 Jul 2007) Log Message: ----------- Simplify code using a custom method. Modified Paths: -------------- trunk/NSString_SKExtensions.h trunk/NSString_SKExtensions.m trunk/SKApplication.m trunk/SKDocument.m trunk/SKDocumentController.m trunk/SKNotesDocument.m trunk/SKPSProgressController.m trunk/skimnotes.m Modified: trunk/NSString_SKExtensions.h =================================================================== --- trunk/NSString_SKExtensions.h 2007-07-05 18:34:13 UTC (rev 2427) +++ trunk/NSString_SKExtensions.h 2007-07-05 18:49:54 UTC (rev 2428) @@ -45,6 +45,8 @@ - (NSString *)stringByAppendingEllipsis; +- (NSString *)stringByReplacingPathExtension:(NSString *)ext; + - (NSArray *)shellScriptArgumentsArray; - (NSRange)rangeOfLeadingEmptyLine; Modified: trunk/NSString_SKExtensions.m =================================================================== --- trunk/NSString_SKExtensions.m 2007-07-05 18:34:13 UTC (rev 2427) +++ trunk/NSString_SKExtensions.m 2007-07-05 18:49:54 UTC (rev 2428) @@ -112,6 +112,11 @@ return [self stringByAppendingFormat:@"%C", 0x2026]; } +- (NSString *)stringByReplacingPathExtension:(NSString *)ext; +{ + return [[self stringByDeletingPathExtension] stringByAppendingPathExtension:ext]; +} + // parses a space separated list of shell script argments // allows quoting parts of an argument and escaped characters outside quotes, according to shell rules - (NSArray *)shellScriptArgumentsArray; Modified: trunk/SKApplication.m =================================================================== --- trunk/SKApplication.m 2007-07-05 18:34:13 UTC (rev 2427) +++ trunk/SKApplication.m 2007-07-05 18:49:54 UTC (rev 2428) @@ -42,6 +42,7 @@ #import "SKPDFSynchronizer.h" #import "SKPDFView.h" #import "SKLineInspector.h" +#import "NSString_SKExtensions.h" NSString *SKApplicationWillTerminateNotification = @"SKApplicationWillTerminateNotification"; @@ -109,11 +110,7 @@ if ([file isKindOfClass:[NSURL class]] && [source isKindOfClass:[NSURL class]]) { - source = [source path]; - if ([[source pathExtension] length] == 0) - source = [source stringByAppendingPathExtension:@"tex"]; - else if ([[source pathExtension] caseInsensitiveCompare:@"tex"] == NO) - source = [[source stringByDeletingPathExtension] stringByAppendingPathExtension:@"tex"]; + source = [[source path] stringByReplacingPathExtension:@"tex"]; if ([[NSFileManager defaultManager] fileExistsAtPath:[file path]] && [[NSFileManager defaultManager] fileExistsAtPath:source]) { Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-07-05 18:34:13 UTC (rev 2427) +++ trunk/SKDocument.m 2007-07-05 18:49:54 UTC (rev 2428) @@ -175,7 +175,7 @@ [self saveNotesToExtendedAttributesAtURL:absoluteURL error:NULL]; if ([[NSUserDefaults standardUserDefaults] boolForKey:SKAutoSaveSkimNotesKey]) { - NSString *notesPath = [[[absoluteURL path] stringByDeletingPathExtension] stringByAppendingPathExtension:@"skim"]; + NSString *notesPath = [[absoluteURL path] stringByReplacingPathExtension:@"skim"]; BOOL canMove = YES; BOOL fileExists = [fm fileExistsAtPath:notesPath]; @@ -360,7 +360,7 @@ pdfDoc = nil; } } else if ([noteDicts count] == 0) { - NSString *path = [[[absoluteURL path] stringByDeletingPathExtension] stringByAppendingPathExtension:@"skim"]; + NSString *path = [[absoluteURL path] stringByReplacingPathExtension:@"skim"]; if ([[NSFileManager defaultManager] fileExistsAtPath:path]) { int readOption = [[NSUserDefaults standardUserDefaults] integerForKey:SKReadMissingNotesFromSkimFileOptionKey]; if (readOption == NSAlertOtherReturn) { @@ -511,7 +511,7 @@ } [oPanel beginSheetForDirectory:[path stringByDeletingLastPathComponent] - file:[[[path lastPathComponent] stringByDeletingPathExtension] stringByAppendingPathExtension:@"skim"] + file:[[path lastPathComponent] stringByReplacingPathExtension:@"skim"] types:[NSArray arrayWithObject:@"skim"] modalForWindow:[self windowForSheet] modalDelegate:self @@ -547,7 +547,7 @@ [sp setRequiredFileType:@"tgz"]; [sp setCanCreateDirectories:YES]; [sp beginSheetForDirectory:nil - file:[[[path lastPathComponent] stringByDeletingPathExtension] stringByAppendingPathExtension:@"tgz"] + file:[[path lastPathComponent] stringByReplacingPathExtension:@"tgz"] modalForWindow:[self windowForSheet] modalDelegate:self didEndSelector:@selector(archiveSavePanelDidEnd:returnCode:contextInfo:) @@ -807,7 +807,7 @@ [self stopCheckingFileUpdatesForFile:[self fileName]]; [super setFileURL:absoluteURL]; if ([absoluteURL isFileURL]) - [synchronizer setFileName:[[[absoluteURL path] stringByDeletingPathExtension] stringByAppendingPathExtension:@"pdfsync"]]; + [synchronizer setFileName:[[absoluteURL path] stringByReplacingPathExtension:@"pdfsync"]]; else [synchronizer setFileName:nil]; // if we're saving this will be called when saving has finished @@ -819,7 +819,7 @@ if (synchronizer == nil) { synchronizer = [[SKPDFSynchronizer alloc] init]; [synchronizer setDelegate:self]; - [synchronizer setFileName:[[[self fileName] stringByDeletingPathExtension] stringByAppendingPathExtension:@"pdfsync"]]; + [synchronizer setFileName:[[self fileName] stringByReplacingPathExtension:@"pdfsync"]]; } return synchronizer; } Modified: trunk/SKDocumentController.m =================================================================== --- trunk/SKDocumentController.m 2007-07-05 18:34:13 UTC (rev 2427) +++ trunk/SKDocumentController.m 2007-07-05 18:49:54 UTC (rev 2428) @@ -37,6 +37,7 @@ */ #import "SKDocumentController.h" +#import "NSString_SKExtensions.h" // See CFBundleTypeName in Info.plist NSString *SKPDFDocumentType = nil; /* set to NSPDFPboardType, not @"NSPDFPboardType" */ @@ -135,7 +136,7 @@ if ([type isEqualToString:SKNotesDocumentType]) { NSAppleEventDescriptor *event = [[NSAppleEventManager sharedAppleEventManager] currentAppleEvent]; if ([event eventID] == kAEOpenDocuments && [event descriptorForKeyword:keyAESearchText]) { - NSString *pdfFile = [[[absoluteURL path] stringByDeletingPathExtension] stringByAppendingPathExtension:@"pdf"]; + NSString *pdfFile = [[absoluteURL path] stringByReplacingPathExtension:@"pdf"]; BOOL isDir; if ([[NSFileManager defaultManager] fileExistsAtPath:pdfFile isDirectory:&isDir] && isDir == NO) absoluteURL = [NSURL fileURLWithPath:pdfFile]; Modified: trunk/SKNotesDocument.m =================================================================== --- trunk/SKNotesDocument.m 2007-07-05 18:34:13 UTC (rev 2427) +++ trunk/SKNotesDocument.m 2007-07-05 18:49:54 UTC (rev 2428) @@ -44,6 +44,7 @@ #import "SKTemplateParser.h" #import "SKApplicationController.h" #import "NSValue_SKExtensions.h" +#import "NSString_SKExtensions.h" @implementation SKNotesDocument @@ -170,7 +171,7 @@ } - (IBAction)openPDF:(id)sender { - NSString *path = [[[self fileName] stringByDeletingPathExtension] stringByAppendingPathExtension:@"pdf"]; + NSString *path = [[self fileName] stringByReplacingPathExtension:@"pdf"]; if ([[NSFileManager defaultManager] fileExistsAtPath:path]) [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:[NSURL fileURLWithPath:path] display:YES error:NULL]; else NSBeep(); Modified: trunk/SKPSProgressController.m =================================================================== --- trunk/SKPSProgressController.m 2007-07-05 18:34:13 UTC (rev 2427) +++ trunk/SKPSProgressController.m 2007-07-05 18:49:54 UTC (rev 2428) @@ -318,7 +318,7 @@ } NSString *tmpDir = NSTemporaryDirectory(); - NSString *pdfFile = [tmpDir stringByAppendingPathComponent:[[[dviFile lastPathComponent] stringByDeletingPathExtension] stringByAppendingPathExtension:@"pdf"]]; + NSString *pdfFile = [tmpDir stringByAppendingPathComponent:[[dviFile lastPathComponent] stringByReplacingPathExtension:@"pdf"]]; BOOL success = dvipdfmxPath != nil && [fm fileExistsAtPath:dviFile]; NSMethodSignature *ms; Modified: trunk/skimnotes.m =================================================================== --- trunk/skimnotes.m 2007-07-05 18:34:13 UTC (rev 2427) +++ trunk/skimnotes.m 2007-07-05 18:49:54 UTC (rev 2428) @@ -48,10 +48,7 @@ BOOL isDir = NO; if (action != SKNActionRemove && notesPath == nil) { - if ([[pdfPath pathExtension] caseInsensitiveCompare:@"pdf"] == NSOrderedSame) - notesPath = [[pdfPath stringByDeletingPathExtension] stringByAppendingPathExtension:@"skim"]; - else - notesPath = [pdfPath stringByAppendingPathExtension:@"skim"]; + notesPath = [[pdfPath stringByDeletingPathExtension] stringByAppendingPathExtension:@"skim"]; } if ([[pdfPath pathExtension] caseInsensitiveCompare:@"pdf"] == NSOrderedSame && This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-05 18:34:15
|
Revision: 2427 http://skim-app.svn.sourceforge.net/skim-app/?rev=2427&view=rev Author: hofman Date: 2007-07-05 11:34:13 -0700 (Thu, 05 Jul 2007) Log Message: ----------- Add global string for transformer name. Modified Paths: -------------- trunk/SKColorSwatch.h trunk/SKColorSwatch.m trunk/SKMainWindowController.m Modified: trunk/SKColorSwatch.h =================================================================== --- trunk/SKColorSwatch.h 2007-07-05 17:32:43 UTC (rev 2426) +++ trunk/SKColorSwatch.h 2007-07-05 18:34:13 UTC (rev 2427) @@ -63,6 +63,7 @@ @end +extern NSString *SKUnarchiveFromDataArrayTransformerName; @interface SKUnarchiveFromDataArrayTransformer : NSValueTransformer @end Modified: trunk/SKColorSwatch.m =================================================================== --- trunk/SKColorSwatch.m 2007-07-05 17:32:43 UTC (rev 2426) +++ trunk/SKColorSwatch.m 2007-07-05 18:34:13 UTC (rev 2427) @@ -430,7 +430,10 @@ @end +#pragma mark - +NSString *SKUnarchiveFromDataArrayTransformerName = @"SKUnarchiveFromDataArrayTransformer"; + @implementation SKUnarchiveFromDataArrayTransformer + (Class)transformedValueClass { Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-07-05 17:32:43 UTC (rev 2426) +++ trunk/SKMainWindowController.m 2007-07-05 18:34:13 UTC (rev 2427) @@ -122,7 +122,7 @@ @implementation SKMainWindowController + (void)initialize { - [NSValueTransformer setValueTransformer:[[[SKUnarchiveFromDataArrayTransformer alloc] init] autorelease] forName:@"SKUnarchiveFromDataArrayTransformer"]; + [NSValueTransformer setValueTransformer:[[[SKUnarchiveFromDataArrayTransformer alloc] init] autorelease] forName:SKUnarchiveFromDataArrayTransformerName]; } - (id)initWithWindowNibName:(NSString *)windowNibName owner:(id)owner{ @@ -3669,7 +3669,7 @@ [toolbarItems setObject:item forKey:SKDocumentToolbarDisplayBoxItemIdentifier]; [item release]; - NSDictionary *options = [NSDictionary dictionaryWithObject:@"SKUnarchiveFromDataArrayTransformer" forKey:NSValueTransformerNameBindingOption]; + NSDictionary *options = [NSDictionary dictionaryWithObject:SKUnarchiveFromDataArrayTransformerName forKey:NSValueTransformerNameBindingOption]; [colorSwatch bind:@"colors" toObject:[NSUserDefaultsController sharedUserDefaultsController] withKeyPath:[NSString stringWithFormat:@"values.%@", SKSwatchColorsKey] options:options]; [colorSwatch sizeToFit]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleColorSwatchColorsChangedNotification:) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-05 17:32:44
|
Revision: 2426 http://skim-app.svn.sourceforge.net/skim-app/?rev=2426&view=rev Author: hofman Date: 2007-07-05 10:32:43 -0700 (Thu, 05 Jul 2007) Log Message: ----------- Update release notes. Modified Paths: -------------- trunk/ReleaseNotes.rtf Modified: trunk/ReleaseNotes.rtf =================================================================== --- trunk/ReleaseNotes.rtf 2007-07-05 17:16:28 UTC (rev 2425) +++ trunk/ReleaseNotes.rtf 2007-07-05 17:32:43 UTC (rev 2426) @@ -99,8 +99,8 @@ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\fs22 \cf0 \ -Last update: 29 June 2007 (rev -\f2\fs20 2389) +Last update: 5 July 2007 (rev +\f2\fs20 2425) \f1\fs22 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural @@ -138,7 +138,12 @@ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls5\ilvl0\cf0 {\listtext \'a5 }Allow setting the interior (fill) color for circles and boxes. Select the check button at the bottom of the color panel.\ {\listtext \'a5 }Add a TeX editor perset for LyX.\ -{\listtext \'a5 }Hidden defaults for line styles and interior colors.\ +{\listtext \'a5 }You can now reopen snapshots from a previous run.\ +{\listtext \'a5 }New preferences for line styles and interior colors.\ +{\listtext \'a5 }You can now change the colors and line styles of notes using drag and drop.\ +{\listtext \'a5 }Hidden default for the timeout of Apple remote switch indication.\ +{\listtext \'a5 }You can now open DVI files with Skim. These are first converted to PostScript using the dvipdfmx tool, which must be installed as part of a ghostscript installation. \ +{\listtext \'a5 }New color swatch toolbar control to easily use a few default colors.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \f3\b\fs28 \cf0 \ @@ -165,6 +170,11 @@ {\listtext \'a5 }Scroll reading bar to visible when it is moved.\ {\listtext \'a5 }Default text templates now sort the notes according to the page.\ {\listtext \'a5 }Fix a bug that prevented adding notes in note tool mode on some places on the page.\ +{\listtext \'a5 }Snapshots are now reopened after reverting a document.\ +{\listtext \'a5 }The page chooser toolbar item now uses the page label (logical page) rather than in index. \ +{\listtext \'a5 }Increase maximal width of page column in note table.\ +{\listtext \'a5 }Links are now active in move tool mode.\ +{\listtext \'a5 }The rotation of text notes is now saved.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f3\b\fs28 \cf0 \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-05 17:16:30
|
Revision: 2425 http://skim-app.svn.sourceforge.net/skim-app/?rev=2425&view=rev Author: hofman Date: 2007-07-05 10:16:28 -0700 (Thu, 05 Jul 2007) Log Message: ----------- Save rotation of free text annotations using private accessors. Modified Paths: -------------- trunk/SKPDFAnnotationNote.m Modified: trunk/SKPDFAnnotationNote.m =================================================================== --- trunk/SKPDFAnnotationNote.m 2007-07-05 11:33:52 UTC (rev 2424) +++ trunk/SKPDFAnnotationNote.m 2007-07-05 17:16:28 UTC (rev 2425) @@ -117,6 +117,12 @@ @end +@interface PDFAnnotationFreeText (SKPDFAnnotationFreeTextPrivateDeclarations) +- (int)rotation; +- (void)setRotation:(int)rotation; +@end + + @interface PDFAnnotation (PDFAnnotationPrivateDeclarations) - (void)drawWithBox:(CGPDFBox)box inContext:(CGContextRef)context; - (void)setPage:(id)page; @@ -170,8 +176,11 @@ } else if ([type isEqualToString:@"FreeText"]) { self = [[SKPDFAnnotationFreeText alloc] initWithBounds:bounds]; NSFont *font = [dict objectForKey:@"font"]; + NSNumber *rotation = [dict objectForKey:@"rotation"]; if (font) [(SKPDFAnnotationFreeText *)self setFont:font]; + if (rotation && [self respondsToSelector:@selector(setRotation:)]) + [(SKPDFAnnotationFreeText *)self setRotation:[rotation intValue]]; } else if ([type isEqualToString:@"Circle"]) { self = [[SKPDFAnnotationCircle alloc] initWithBounds:bounds]; NSColor *interiorColor = [dict objectForKey:@"interiorColor"]; @@ -995,6 +1004,8 @@ - (NSDictionary *)dictionaryValue{ NSMutableDictionary *dict = (NSMutableDictionary *)[super dictionaryValue]; [dict setValue:[self font] forKey:@"font"]; + if ([self respondsToSelector:@selector(rotation)]) + [dict setValue:[NSNumber numberWithInt:[self rotation]] forKey:@"rotation"]; return dict; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-05 11:33:57
|
Revision: 2424 http://skim-app.svn.sourceforge.net/skim-app/?rev=2424&view=rev Author: hofman Date: 2007-07-05 04:33:52 -0700 (Thu, 05 Jul 2007) Log Message: ----------- Add menu with colors for color swatch toolbar item. Replace purple by magenta in default color swatch colors. Modified Paths: -------------- trunk/InitialUserDefaults.plist trunk/SKMainWindowController.h trunk/SKMainWindowController.m Modified: trunk/InitialUserDefaults.plist =================================================================== --- trunk/InitialUserDefaults.plist 2007-07-04 23:09:11 UTC (rev 2423) +++ trunk/InitialUserDefaults.plist 2007-07-05 11:33:52 UTC (rev 2424) @@ -195,7 +195,7 @@ </data> <data> BAt0eXBlZHN0cmVhbYED6IQBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWE - AWMBhARmZmZmgz8AAAAAgz8AAAABhg== + AWMBhARmZmZmAQABAYY= </data> </array> <key>SKActivateFullScreenNavigationAtBottom</key> Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2007-07-04 23:09:11 UTC (rev 2423) +++ trunk/SKMainWindowController.h 2007-07-05 11:33:52 UTC (rev 2424) @@ -142,6 +142,7 @@ IBOutlet BDSKImagePopUpButton *markupPopUpButton; IBOutlet SKColorSwatch *colorSwatch; NSMutableDictionary *toolbarItems; + NSToolbarItem *colorSwatchToolbarItem; IBOutlet NSWindow *choosePageSheet; IBOutlet NSTextField *choosePageField; @@ -341,6 +342,7 @@ - (void)handleDocumentBeginWrite:(NSNotification *)notification; - (void)handleDocumentEndWrite:(NSNotification *)notification; - (void)handleDocumentEndPageWrite:(NSNotification *)notification; +- (void)handleColorSwatchColorsChangedNotification:(NSNotification *)notification; - (void)addAnnotationsFromDictionaries:(NSArray *)noteDicts; - (void)setAnnotationsFromDictionaries:(NSArray *)noteDicts; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-07-04 23:09:11 UTC (rev 2423) +++ trunk/SKMainWindowController.m 2007-07-05 11:33:52 UTC (rev 2424) @@ -907,7 +907,7 @@ PDFAnnotation *annotation = [pdfView activeAnnotation]; if ([annotation isNoteAnnotation]) { NSColor *color = [annotation color]; - NSColor *newColor = [sender color]; + NSColor *newColor = [sender respondsToSelector:@selector(representedObject)] ? [sender representedObject] : [sender respondsToSelector:@selector(color)] ? [sender color] : nil; if (newColor && [color isEqual:newColor] == NO) [annotation setColor:newColor]; } @@ -2611,6 +2611,38 @@ [progressBar displayIfNeeded]; } +- (void)handleColorSwatchColorsChangedNotification:(NSNotification *)notification { + NSMenu *menu = [[[toolbarItems objectForKey:SKDocumentToolbarColorSwatchItemIdentifier] menuFormRepresentation] submenu]; + + int i = [menu numberOfItems]; + while (i--) + [menu removeItemAtIndex:i]; + + NSEnumerator *colorEnum = [[colorSwatch colors] objectEnumerator]; + NSColor *color; + NSRect rect = NSMakeRect(0.0, 0.0, 16.0, 16.0); + NSRect lineRect = NSInsetRect(rect, 0.5, 0.5); + NSRect swatchRect = NSInsetRect(rect, 1.0, 1.0); + + while (color = [colorEnum nextObject]) { + NSImage *image = [[NSImage alloc] initWithSize:rect.size]; + NSMenuItem *item = [menu addItemWithTitle:@"" action:@selector(selectColor:) keyEquivalent:@""]; + + [image lockFocus]; + [[NSColor lightGrayColor] setStroke]; + [NSBezierPath strokeRect:lineRect]; + [color drawSwatchInRect:swatchRect]; + [image unlockFocus]; + [item setTarget:self]; + [item setRepresentedObject:color]; + [item setImage:image]; + [image release]; + } + + if (colorSwatchToolbarItem) + [[colorSwatchToolbarItem menuFormRepresentation] setSubmenu:[NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:menu]]]; +} + #pragma mark KVO - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { @@ -3640,7 +3672,11 @@ NSDictionary *options = [NSDictionary dictionaryWithObject:@"SKUnarchiveFromDataArrayTransformer" forKey:NSValueTransformerNameBindingOption]; [colorSwatch bind:@"colors" toObject:[NSUserDefaultsController sharedUserDefaultsController] withKeyPath:[NSString stringWithFormat:@"values.%@", SKSwatchColorsKey] options:options]; [colorSwatch sizeToFit]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleColorSwatchColorsChangedNotification:) + name:SKColorSwatchColorsChangedNotification object:colorSwatch]; + menu = [[[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@""] autorelease]; menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:NSLocalizedString(@"Colors", @"Toolbar item label") action:@selector(orderFrontColorPanel:) keyEquivalent:@""] autorelease]; + [menuItem setSubmenu:menu]; item = [[SKToolbarItem alloc] initWithItemIdentifier:SKDocumentToolbarColorSwatchItemIdentifier]; [item setLabels:NSLocalizedString(@"Colors", @"Toolbar item label")]; [item setToolTip:NSLocalizedString(@"Colors", @"Tool tip message")]; @@ -3648,6 +3684,7 @@ [item setMenuFormRepresentation:menuItem]; [toolbarItems setObject:item forKey:SKDocumentToolbarColorSwatchItemIdentifier]; [item release]; + [self handleColorSwatchColorsChangedNotification:nil]; item = [[SKToolbarItem alloc] initWithItemIdentifier:SKDocumentToolbarInfoItemIdentifier]; [item setLabels:NSLocalizedString(@"Info", @"Toolbar item label")]; @@ -3692,6 +3729,20 @@ return newItem; } +- (void)toolbarWillAddItem:(NSNotification *)notification { + NSToolbarItem *item = [[notification userInfo] objectForKey:@"item"]; + if ([[item itemIdentifier] isEqualToString:SKDocumentToolbarColorSwatchItemIdentifier]) { + colorSwatchToolbarItem = item; + } +} + +- (void)toolbarDidRemoveItem:(NSNotification *)notification { + NSToolbarItem *item = [[notification userInfo] objectForKey:@"item"]; + if ([[item itemIdentifier] isEqualToString:SKDocumentToolbarColorSwatchItemIdentifier]) { + colorSwatchToolbarItem = nil; + } +} + - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar { return [NSArray arrayWithObjects: SKDocumentToolbarPreviousItemIdentifier, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-04 23:09:12
|
Revision: 2423 http://skim-app.svn.sourceforge.net/skim-app/?rev=2423&view=rev Author: hofman Date: 2007-07-04 16:09:11 -0700 (Wed, 04 Jul 2007) Log Message: ----------- Slightly smaller color swatches Modified Paths: -------------- trunk/Dutch.lproj/MainWindow.nib/data.dependency trunk/Dutch.lproj/MainWindow.nib/info.nib trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib trunk/English.lproj/MainWindow.nib/info.nib trunk/English.lproj/MainWindow.nib/keyedobjects.nib trunk/Italian.lproj/MainWindow.nib/info.nib trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib Modified: trunk/Dutch.lproj/MainWindow.nib/data.dependency =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/data.dependency 2007-07-04 21:36:00 UTC (rev 2422) +++ trunk/Dutch.lproj/MainWindow.nib/data.dependency 2007-07-04 23:09:11 UTC (rev 2423) @@ -4,7 +4,6 @@ <dict> <key>IBPaletteDependency</key> <array> - <string>Controllers</string> <string>PDFKit</string> </array> </dict> Modified: trunk/Dutch.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-07-04 21:36:00 UTC (rev 2422) +++ trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-07-04 23:09:11 UTC (rev 2423) @@ -7,7 +7,7 @@ <key>IBEditorPositions</key> <dict> <key>168</key> - <string>601 515 237 239 0 0 1440 938 </string> + <string>601 521 237 239 0 0 1440 938 </string> <key>224</key> <string>610 420 220 442 0 0 1440 938 </string> <key>256</key> @@ -25,6 +25,10 @@ <array> <integer>208</integer> </array> + <key>IBOpenObjects</key> + <array> + <integer>168</integer> + </array> <key>IBSystem Version</key> <string>8R218</string> </dict> Modified: trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/English.lproj/MainWindow.nib/info.nib 2007-07-04 21:36:00 UTC (rev 2422) +++ trunk/English.lproj/MainWindow.nib/info.nib 2007-07-04 23:09:11 UTC (rev 2423) @@ -7,7 +7,7 @@ <key>IBEditorPositions</key> <dict> <key>168</key> - <string>601 515 237 239 0 0 1440 938 </string> + <string>601 521 237 239 0 0 1440 938 </string> <key>224</key> <string>610 420 220 442 0 0 1440 938 </string> <key>256</key> @@ -27,17 +27,17 @@ </array> <key>IBOpenObjects</key> <array> + <integer>539</integer> + <integer>208</integer> + <integer>553</integer> <integer>224</integer> <integer>585</integer> <integer>511</integer> + <integer>256</integer> <integer>502</integer> - <integer>208</integer> <integer>314</integer> <integer>5</integer> <integer>168</integer> - <integer>553</integer> - <integer>256</integer> - <integer>539</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/English.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Italian.lproj/MainWindow.nib/info.nib 2007-07-04 21:36:00 UTC (rev 2422) +++ trunk/Italian.lproj/MainWindow.nib/info.nib 2007-07-04 23:09:11 UTC (rev 2423) @@ -7,7 +7,7 @@ <key>IBEditorPositions</key> <dict> <key>168</key> - <string>601 499 237 239 0 0 1440 938 </string> + <string>601 521 237 239 0 0 1440 938 </string> <key>224</key> <string>402 294 220 442 0 0 1024 746 </string> <key>256</key> @@ -27,11 +27,11 @@ </array> <key>IBOpenObjects</key> <array> + <integer>511</integer> + <integer>208</integer> <integer>539</integer> + <integer>168</integer> <integer>553</integer> - <integer>208</integer> - <integer>511</integer> - <integer>168</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-04 21:36:24
|
Revision: 2422 http://skim-app.svn.sourceforge.net/skim-app/?rev=2422&view=rev Author: hofman Date: 2007-07-04 14:36:00 -0700 (Wed, 04 Jul 2007) Log Message: ----------- Allow clicking link in move tool mode. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-07-04 21:14:07 UTC (rev 2421) +++ trunk/SKPDFView.m 2007-07-04 21:36:00 UTC (rev 2422) @@ -808,7 +808,10 @@ } break; case SKMoveToolMode: - [self dragWithEvent:theEvent]; + if (area & kPDFLinkArea) + [super mouseDown:theEvent]; + else + [self dragWithEvent:theEvent]; break; case SKSelectToolMode: [self selectWithEvent:theEvent]; @@ -860,6 +863,8 @@ draggingAnnotation = NO; break; case SKMoveToolMode: + [super mouseUp:theEvent]; + break; case SKMagnifyToolMode: case SKSelectToolMode: // shouldn't reach this @@ -888,6 +893,8 @@ } break; case SKMoveToolMode: + [super mouseDragged:theEvent]; + break; case SKMagnifyToolMode: case SKSelectToolMode: // shouldn't reach this @@ -3263,7 +3270,10 @@ break; } case SKMoveToolMode: - cursor = [NSCursor openHandCursor]; + if ([self areaOfInterestForMouse:theEvent] & kPDFLinkArea) + cursor = [NSCursor pointingHandCursor]; + else + cursor = [NSCursor openHandCursor]; break; case SKSelectToolMode: if ([self areaOfInterestForMouse:theEvent] == kPDFNoArea) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-04 21:14:14
|
Revision: 2421 http://skim-app.svn.sourceforge.net/skim-app/?rev=2421&view=rev Author: hofman Date: 2007-07-04 14:14:07 -0700 (Wed, 04 Jul 2007) Log Message: ----------- Add a new color swatch toolbar item to pick from a set of standard colors. Colors can be picked by drag/drop or clicking the color. The standard colors can be changed using drag/drop from the color panel. Modified Paths: -------------- trunk/Dutch.lproj/Localizable.strings trunk/Dutch.lproj/MainWindow.nib/classes.nib trunk/Dutch.lproj/MainWindow.nib/data.dependency trunk/Dutch.lproj/MainWindow.nib/info.nib trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib trunk/English.lproj/MainWindow.nib/classes.nib trunk/English.lproj/MainWindow.nib/info.nib trunk/English.lproj/MainWindow.nib/keyedobjects.nib trunk/InitialUserDefaults.plist trunk/Italian.lproj/Localizable.strings trunk/Italian.lproj/MainWindow.nib/classes.nib trunk/Italian.lproj/MainWindow.nib/info.nib trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib trunk/SKMainWindowController.h trunk/SKMainWindowController.m trunk/SKStringConstants.h trunk/SKStringConstants.m trunk/Skim.xcodeproj/project.pbxproj Added Paths: ----------- trunk/SKColorSwatch.h trunk/SKColorSwatch.m Modified: trunk/Dutch.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/Dutch.lproj/MainWindow.nib/classes.nib =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/classes.nib 2007-07-04 18:26:07 UTC (rev 2420) +++ trunk/Dutch.lproj/MainWindow.nib/classes.nib 2007-07-04 21:14:07 UTC (rev 2421) @@ -31,6 +31,7 @@ LANGUAGE = ObjC; SUPERCLASS = NSImageCell; }, + {CLASS = SKColorSwatch; LANGUAGE = ObjC; SUPERCLASS = NSControl; }, {CLASS = SKFullScreenWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; }, {CLASS = SKMainWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; }, { @@ -82,6 +83,8 @@ savePDFSettingToDefaults = id; search = id; searchPDF = id; + selectColor = id; + smartAutoCropAll = id; takeSnapshot = id; toggleAutoActualSize = id; toggleAutoScale = id; @@ -105,6 +108,7 @@ chooseScaleField = NSTextField; chooseScaleSheet = NSWindow; circlePopUpButton = BDSKImagePopUpButton; + colorSwatch = SKColorSwatch; currentLeftSideView = NSView; currentRightSideView = NSView; displayBoxPopUpButton = NSPopUpButton; Modified: trunk/Dutch.lproj/MainWindow.nib/data.dependency =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/data.dependency 2007-07-04 18:26:07 UTC (rev 2420) +++ trunk/Dutch.lproj/MainWindow.nib/data.dependency 2007-07-04 21:14:07 UTC (rev 2421) @@ -4,6 +4,7 @@ <dict> <key>IBPaletteDependency</key> <array> + <string>Controllers</string> <string>PDFKit</string> </array> </dict> Modified: trunk/Dutch.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-07-04 18:26:07 UTC (rev 2420) +++ trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-07-04 21:14:07 UTC (rev 2421) @@ -7,7 +7,7 @@ <key>IBEditorPositions</key> <dict> <key>168</key> - <string>601 543 237 195 0 0 1440 938 </string> + <string>601 515 237 239 0 0 1440 938 </string> <key>224</key> <string>610 420 220 442 0 0 1440 938 </string> <key>256</key> @@ -25,13 +25,6 @@ <array> <integer>208</integer> </array> - <key>IBOpenObjects</key> - <array> - <integer>208</integer> - <integer>168</integer> - <integer>539</integer> - <integer>511</integer> - </array> <key>IBSystem Version</key> <string>8R218</string> </dict> Modified: trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/MainWindow.nib/classes.nib =================================================================== --- trunk/English.lproj/MainWindow.nib/classes.nib 2007-07-04 18:26:07 UTC (rev 2420) +++ trunk/English.lproj/MainWindow.nib/classes.nib 2007-07-04 21:14:07 UTC (rev 2421) @@ -31,6 +31,7 @@ LANGUAGE = ObjC; SUPERCLASS = NSImageCell; }, + {CLASS = SKColorSwatch; LANGUAGE = ObjC; SUPERCLASS = NSControl; }, {CLASS = SKFullScreenWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; }, {CLASS = SKMainWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; }, { @@ -82,6 +83,8 @@ savePDFSettingToDefaults = id; search = id; searchPDF = id; + selectColor = id; + smartAutoCropAll = id; takeSnapshot = id; toggleAutoActualSize = id; toggleAutoScale = id; @@ -105,6 +108,7 @@ chooseScaleField = NSTextField; chooseScaleSheet = NSWindow; circlePopUpButton = BDSKImagePopUpButton; + colorSwatch = SKColorSwatch; currentLeftSideView = NSView; currentRightSideView = NSView; displayBoxPopUpButton = NSPopUpButton; Modified: trunk/English.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/English.lproj/MainWindow.nib/info.nib 2007-07-04 18:26:07 UTC (rev 2420) +++ trunk/English.lproj/MainWindow.nib/info.nib 2007-07-04 21:14:07 UTC (rev 2421) @@ -7,7 +7,7 @@ <key>IBEditorPositions</key> <dict> <key>168</key> - <string>601 543 237 195 0 0 1440 938 </string> + <string>601 515 237 239 0 0 1440 938 </string> <key>224</key> <string>610 420 220 442 0 0 1440 938 </string> <key>256</key> @@ -27,17 +27,17 @@ </array> <key>IBOpenObjects</key> <array> - <integer>168</integer> + <integer>224</integer> + <integer>585</integer> <integer>511</integer> - <integer>539</integer> + <integer>502</integer> + <integer>208</integer> + <integer>314</integer> <integer>5</integer> - <integer>314</integer> + <integer>168</integer> + <integer>553</integer> <integer>256</integer> - <integer>585</integer> - <integer>553</integer> - <integer>502</integer> - <integer>208</integer> - <integer>224</integer> + <integer>539</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/English.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/InitialUserDefaults.plist =================================================================== --- trunk/InitialUserDefaults.plist 2007-07-04 18:26:07 UTC (rev 2420) +++ trunk/InitialUserDefaults.plist 2007-07-04 21:14:07 UTC (rev 2421) @@ -171,6 +171,33 @@ <string>mate</string> <key>SKTeXEditorArguments</key> <string>-l %line "%file"</string> + <key>SKSwatchColors</key> + <array> + <data> + BAt0eXBlZHN0cmVhbYED6IQBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWE + AWMBhARmZmZmAQAAAYY= + </data> + <data> + BAt0eXBlZHN0cmVhbYED6IQBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWE + AWMBhARmZmZmAYM/AAAAAAGG + </data> + <data> + BAt0eXBlZHN0cmVhbYED6IQBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWE + AWMBhARmZmZmAQEAAYY= + </data> + <data> + BAt0eXBlZHN0cmVhbYED6IQBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWE + AWMBhARmZmZmAAEAAYY= + </data> + <data> + BAt0eXBlZHN0cmVhbYED6IQBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWE + AWMBhARmZmZmAAABAYY= + </data> + <data> + BAt0eXBlZHN0cmVhbYED6IQBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWE + AWMBhARmZmZmgz8AAAAAgz8AAAABhg== + </data> + </array> <key>SKActivateFullScreenNavigationAtBottom</key> <false/> <key>SKActivatePresentationNavigationAtBottom</key> Modified: trunk/Italian.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/MainWindow.nib/classes.nib =================================================================== --- trunk/Italian.lproj/MainWindow.nib/classes.nib 2007-07-04 18:26:07 UTC (rev 2420) +++ trunk/Italian.lproj/MainWindow.nib/classes.nib 2007-07-04 21:14:07 UTC (rev 2421) @@ -31,6 +31,7 @@ LANGUAGE = ObjC; SUPERCLASS = NSImageCell; }, + {CLASS = SKColorSwatch; LANGUAGE = ObjC; SUPERCLASS = NSControl; }, {CLASS = SKFullScreenWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; }, {CLASS = SKMainWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; }, { @@ -82,6 +83,8 @@ savePDFSettingToDefaults = id; search = id; searchPDF = id; + selectColor = id; + smartAutoCropAll = id; takeSnapshot = id; toggleAutoActualSize = id; toggleAutoScale = id; @@ -105,6 +108,7 @@ chooseScaleField = NSTextField; chooseScaleSheet = NSWindow; circlePopUpButton = BDSKImagePopUpButton; + colorSwatch = SKColorSwatch; currentLeftSideView = NSView; currentRightSideView = NSView; displayBoxPopUpButton = NSPopUpButton; Modified: trunk/Italian.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Italian.lproj/MainWindow.nib/info.nib 2007-07-04 18:26:07 UTC (rev 2420) +++ trunk/Italian.lproj/MainWindow.nib/info.nib 2007-07-04 21:14:07 UTC (rev 2421) @@ -7,7 +7,7 @@ <key>IBEditorPositions</key> <dict> <key>168</key> - <string>601 543 237 195 0 0 1440 938 </string> + <string>601 499 237 239 0 0 1440 938 </string> <key>224</key> <string>402 294 220 442 0 0 1024 746 </string> <key>256</key> @@ -27,10 +27,10 @@ </array> <key>IBOpenObjects</key> <array> - <integer>511</integer> <integer>539</integer> + <integer>553</integer> <integer>208</integer> - <integer>553</integer> + <integer>511</integer> <integer>168</integer> </array> <key>IBSystem Version</key> Modified: trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Added: trunk/SKColorSwatch.h =================================================================== --- trunk/SKColorSwatch.h (rev 0) +++ trunk/SKColorSwatch.h 2007-07-04 21:14:07 UTC (rev 2421) @@ -0,0 +1,68 @@ +// +// SKColorSwatch.h +// Skim +// +// Created by Christiaan Hofman on 7/4/07. +/* + This software is Copyright (c) 2007 + Christiaan Hofman. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of Christiaan Hofman nor the names of any + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import <Cocoa/Cocoa.h> + +extern NSString *SKColorSwatchColorsChangedNotification; + +@interface SKColorSwatch : NSControl { + NSMutableArray *colors; + int highlightedIndex; + int focusedIndex; + int clickedIndex; + int draggedIndex; + + SEL action; + id target; + + NSMutableDictionary *bindingInfo; +} + +- (NSArray *)colors; +- (void)setColors:(NSArray *)newColors; + +- (int)clickedColorIndex; +- (NSColor *)color; + +- (int)colorIndexAtPoint:(NSPoint)point; + +@end + + +@interface SKUnarchiveFromDataArrayTransformer : NSValueTransformer +@end Added: trunk/SKColorSwatch.m =================================================================== --- trunk/SKColorSwatch.m (rev 0) +++ trunk/SKColorSwatch.m 2007-07-04 21:14:07 UTC (rev 2421) @@ -0,0 +1,464 @@ +// +// SKColorSwatch.m +// Skim +// +// Created by Christiaan Hofman on 7/4/07. +/* + This software is Copyright (c) 2007 + Christiaan Hofman. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of Christiaan Hofman nor the names of any + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "SKColorSwatch.h" + +NSString *SKColorSwatchColorsChangedNotification = @"SKColorSwatchColorsChangedNotification"; + + +static void *SKColorsObservationContext = (void *)1091; +static NSString *SKColorsBindingName = @"colors"; + +@implementation SKColorSwatch + ++ (void)initialize { + [self exposeBinding:@"colors"]; +} + +- (id)initWithFrame:(NSRect)frame { + self = [super initWithFrame:frame]; + if (self) { + colors = [[NSMutableArray alloc] initWithObjects:[NSColor whiteColor], nil]; + highlightedIndex = -1; + focusedIndex = 0; + clickedIndex = -1; + draggedIndex = -1; + + bindingInfo = [[NSMutableDictionary alloc] init]; + [self registerForDraggedTypes:[NSArray arrayWithObjects:NSColorPboardType, nil]]; + } + return self; +} + +- (id)initWithCoder:(NSCoder *)decoder { + if (self = [super initWithCoder:decoder]) { + if ([decoder allowsKeyedCoding]) { + colors = [[NSMutableArray alloc] initWithArray:[decoder decodeObjectForKey:@"colors"]]; + action = NSSelectorFromString([decoder decodeObjectForKey:@"action"]); + target = [decoder decodeObjectForKey:@"target"]; + } else { + colors = [[NSMutableArray alloc] initWithArray:[decoder decodeObject]]; + [decoder decodeValueOfObjCType:@encode(SEL) at:&action]; + target = [decoder decodeObject]; + } + + highlightedIndex = -1; + focusedIndex = 0; + clickedIndex = -1; + draggedIndex = -1; + + bindingInfo = [[NSMutableDictionary alloc] init]; + [self registerForDraggedTypes:[NSArray arrayWithObjects:NSColorPboardType, nil]]; + } + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder { + [super encodeWithCoder:coder]; + if ([coder allowsKeyedCoding]) { + [coder encodeObject:colors forKey:@"colors"]; + [coder encodeObject:NSStringFromSelector(action) forKey:@"action"]; + [coder encodeObject:target forKey:@"target"]; + } else { + [coder encodeObject:colors]; + [coder encodeValueOfObjCType:@encode(SEL) at:action]; + [coder encodeObject:target]; + } +} + +- (void)dealloc { + [self unbind:SKColorsBindingName]; + [colors release]; + [bindingInfo release]; + [super dealloc]; +} + +- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent { return YES; } + +- (BOOL)acceptsFirstResponder { return YES; } + +- (void)sizeToFit { + NSRect frame = [self frame]; + int count = [colors count]; + frame.size.width = fmin(NSWidth(frame), count * (NSHeight(frame) - 3.0) + 3.0); + [self setFrame:frame]; +} + +- (void)drawRect:(NSRect)rect { + NSRect bounds = [self bounds]; + int count = [colors count]; + + bounds.size.width = fmin(NSWidth(bounds), count * (NSHeight(bounds) - 3.0) + 3.0); + + NSRectEdge sides[4] = {NSMaxYEdge, NSMaxXEdge, NSMinXEdge, NSMinYEdge}; + float grays[4] = {0.5, 0.75, 0.75, 0.75}; + + rect = NSDrawTiledRects(bounds, rect, sides, grays, 4); + + [[NSBezierPath bezierPathWithRect:rect] addClip]; + + NSRect r = NSMakeRect(1.0, 1.0, NSHeight(rect), NSHeight(rect)); + int i; + for (i = 0; i < count; i++) { + NSColor *borderColor = [NSColor colorWithCalibratedWhite:0.66667 alpha:1.0]; + [borderColor set]; + [NSBezierPath strokeRect:NSInsetRect(r, 0.5, 0.5)]; + borderColor = highlightedIndex == i ? [NSColor selectedControlColor] : [NSColor controlBackgroundColor]; + [borderColor set]; + [[NSBezierPath bezierPathWithRect:NSInsetRect(r, 1.5, 1.5)] stroke]; + [[colors objectAtIndex:i] drawSwatchInRect:NSInsetRect(r, 2.0, 2.0)]; + r.origin.x += NSHeight(r) - 1.0; + } + + if ([self refusesFirstResponder] == NO && [NSApp isActive] && [[self window] isKeyWindow] && [[self window] firstResponder] == self && focusedIndex != -1) { + NSRect rect = NSInsetRect([self bounds], 1.0, 1.0); + rect.size.width = NSHeight(rect); + rect.origin.x += focusedIndex * (NSWidth(rect) - 1.0); + NSSetFocusRingStyle(NSFocusRingOnly); + NSRectFill(rect); + } +} + +- (void)setKeyboardFocusRingNeedsDisplayInRect:(NSRect)rect { + [super setKeyboardFocusRingNeedsDisplayInRect:rect]; + [self setNeedsDisplay:YES]; +} + +- (void)mouseDown:(NSEvent *)theEvent { + NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; + int i = [self colorIndexAtPoint:mouseLoc]; + + if ([self isEnabled]) { + highlightedIndex = i; + [self setKeyboardFocusRingNeedsDisplayInRect:[self bounds]]; + [self setNeedsDisplay:YES]; + } + + if (i != -1) { + BOOL keepOn = YES; + while (keepOn) { + theEvent = [[self window] nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask]; + switch ([theEvent type]) { + case NSLeftMouseDragged: + { + if ([self isEnabled]) { + highlightedIndex = -1; + [self setNeedsDisplay:YES]; + } + + draggedIndex = i; + + NSColor *color = [colors objectAtIndex:i]; + NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard]; + [pboard declareTypes:[NSArray arrayWithObjects:NSColorPboardType, nil] owner:nil]; + [color writeToPasteboard:pboard]; + + NSRect rect = NSMakeRect(0.0, 0.0, 12.0, 12.0); + NSImage *image = [[NSImage alloc] initWithSize:rect.size]; + [image lockFocus]; + [[NSColor blackColor] set]; + [NSBezierPath strokeRect:NSInsetRect(rect, 0.5, 0.5)]; + [color drawSwatchInRect:NSInsetRect(rect, 1.0, 1.0)]; + [image unlockFocus]; + + mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; + mouseLoc.x -= 6.0; + mouseLoc.y -= 6.0; + [self dragImage:image at:mouseLoc offset:NSZeroSize event:theEvent pasteboard:pboard source:self slideBack:YES]; + + keepOn = NO; + break; + } + case NSLeftMouseUp: + if ([self isEnabled]) { + highlightedIndex = -1; + clickedIndex = i; + [self setNeedsDisplay:YES]; + [self sendAction:[self action] to:[self target]]; + clickedIndex = -1; + } + keepOn = NO; + break; + default: + break; + } + } + } +} + +- (void)unhighlight { + highlightedIndex = -1; + [self setKeyboardFocusRingNeedsDisplayInRect:[self bounds]]; + [self setNeedsDisplay:YES]; +} + +- (void)performClick:(NSEvent *)theEvent { + if ([self isEnabled] && focusedIndex != -1) { + clickedIndex = focusedIndex; + [self sendAction:[self action] to:[self target]]; + clickedIndex = -1; + highlightedIndex = focusedIndex; + [self setKeyboardFocusRingNeedsDisplayInRect:[self bounds]]; + [self setNeedsDisplay:YES]; + [self performSelector:@selector(unhighlight) withObject:nil afterDelay:0.2]; + } +} + +- (void)moveRight:(NSEvent *)theEvent { + if (++focusedIndex >= (int)[colors count]) + focusedIndex = [colors count] - 1; + [self setKeyboardFocusRingNeedsDisplayInRect:[self bounds]]; +} + +- (void)moveLeft:(NSEvent *)theEvent { + if (--focusedIndex < 0) + focusedIndex = 0; + [self setKeyboardFocusRingNeedsDisplayInRect:[self bounds]]; +} + +- (int)colorIndexAtPoint:(NSPoint)point { + NSRect rect = NSInsetRect([self bounds], 2.0, 2.0); + + if (NSPointInRect(point, rect)) { + int i, count = [colors count]; + + rect.size.width = NSHeight(rect); + for (i = 0; i < count; i++) { + if (NSPointInRect(point, rect)) + return i; + rect.origin.x += NSWidth(rect) + 1.0; + } + } + return -1; +} + +#pragma mark Accessors + +- (NSArray *)colors { + return colors; +} + +- (void)setColors:(NSArray *)newColors { + [colors setArray:newColors]; +} + +- (int)clickedColorIndex { + return clickedIndex; +} + +- (NSColor *)color { + int index = clickedIndex; + return index == -1 ? nil : [colors objectAtIndex:index]; +} + +- (SEL)action { + return action; +} + +- (void)setAction:(SEL)selector { + if (selector != action) { + action = selector; + } +} + +- (id)target { + return target; +} + +- (void)setTarget:(id)newTarget { + if (target != newTarget) { + target = newTarget; + } +} + +#pragma mark Binding support + +- (void)bind:(NSString *)bindingName toObject:(id)observableController withKeyPath:(NSString *)keyPath options:(NSDictionary *)options { + if ([bindingName isEqualToString:SKColorsBindingName]) { + + if ([bindingInfo objectForKey:bindingName]) + [self unbind:bindingName]; + + NSDictionary *bindingsData = [NSDictionary dictionaryWithObjectsAndKeys:observableController, NSObservedObjectKey, [[keyPath copy] autorelease], NSObservedKeyPathKey, [[options copy] autorelease], NSOptionsKey, nil]; + [bindingInfo setObject:bindingsData forKey:bindingName]; + + [observableController addObserver:self forKeyPath:keyPath options:nil context:SKColorsObservationContext]; + [self observeValueForKeyPath:keyPath ofObject:observableController change:nil context:SKColorsObservationContext]; + } else { + [super bind:bindingName toObject:observableController withKeyPath:keyPath options:options]; + } + [self setNeedsDisplay:YES]; +} + +- (void)unbind:(NSString *)bindingName { + if ([bindingName isEqualToString:SKColorsBindingName]) { + + NSDictionary *info = [self infoForBinding:bindingName]; + [[info objectForKey:NSObservedObjectKey] removeObserver:self forKeyPath:[info objectForKey:NSObservedKeyPathKey]]; + [bindingInfo removeObjectForKey:bindingName]; + } else { + [super unbind:bindingName]; + } + [self setNeedsDisplay:YES]; +} + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { + if (context == SKColorsObservationContext) { + NSDictionary *info = [self infoForBinding:SKColorsBindingName]; + id value = [[info objectForKey:NSObservedObjectKey] valueForKeyPath:[info objectForKey:NSObservedKeyPathKey]]; + if (NSIsControllerMarker(value) == NO) { + NSString *transformerName = [[info objectForKey:NSOptionsKey] objectForKey:NSValueTransformerNameBindingOption]; + if (transformerName) { + NSValueTransformer *valueTransformer = [NSValueTransformer valueTransformerForName:transformerName]; + value = [valueTransformer transformedValue:value]; + } + [self setValue:value forKey:SKColorsBindingName]; + } + } else { + [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; + } +} + +- (NSDictionary *)infoForBinding:(NSString *)bindingName { + NSDictionary *info = [bindingInfo objectForKey:bindingName]; + if (info == nil) + info = [super infoForBinding:bindingName]; + return info; +} + +#pragma mark NSDraggingDestination protocol + +- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender { + NSPoint mouseLoc = [self convertPoint:[sender draggingLocation] fromView:nil]; + int i = [self colorIndexAtPoint:mouseLoc]; + + if ([sender draggingSource] == self && draggedIndex == i) + i = -1; + highlightedIndex = i; + [self setKeyboardFocusRingNeedsDisplayInRect:[self bounds]]; + [self setNeedsDisplay:YES]; + if ([self isEnabled] && i != -1) + return NSDragOperationEvery; + else + return NSDragOperationNone; +} + +- (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender { + return [self draggingEntered:sender]; +} + +- (void)draggingExited:(id <NSDraggingInfo>)sender { + highlightedIndex = -1; + [self setKeyboardFocusRingNeedsDisplayInRect:[self bounds]]; + [self setNeedsDisplay:YES]; +} + +- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender { + NSPoint mouseLoc = [self convertPoint:[sender draggingLocation] fromView:nil]; + int i = [self colorIndexAtPoint:mouseLoc]; + if ([self isEnabled] && i != -1 && ([sender draggingSource] != self || draggedIndex != i)) + return YES; + else + return NO; +} + +- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender{ + NSPasteboard *pboard = [sender draggingPasteboard]; + NSColor *color = [NSColor colorFromPasteboard:pboard]; + NSPoint mouseLoc = [self convertPoint:[sender draggingLocation] fromView:nil]; + int i = [self colorIndexAtPoint:mouseLoc]; + + if (i != -1 && color) { + [colors replaceObjectAtIndex:i withObject:color]; + + NSDictionary *info = [self infoForBinding:@"colors"]; + id observedObject = [info objectForKey:NSObservedObjectKey]; + NSString *observedKeyPath = [info objectForKey:NSObservedKeyPathKey]; + if (observedObject && observedKeyPath) { + id value = [[colors copy] autorelease]; + NSString *transformerName = [[info objectForKey:NSOptionsKey] objectForKey:NSValueTransformerNameBindingOption]; + if (transformerName) { + NSValueTransformer *valueTransformer = [NSValueTransformer valueTransformerForName:transformerName]; + value = [valueTransformer reverseTransformedValue:value]; + } + [observedObject setValue:value forKeyPath:observedKeyPath]; + } + + [[NSNotificationCenter defaultCenter] postNotificationName:SKColorSwatchColorsChangedNotification object:self]; + } + + highlightedIndex = -1; + [self setNeedsDisplay:YES]; + + return YES; +} + +@end + + +@implementation SKUnarchiveFromDataArrayTransformer + ++ (Class)transformedValueClass { + return [NSArray class]; +} + ++ (BOOL)allowsReverseTransformation { + return YES; +} + +- (id)transformedValue:(id)array { + NSValueTransformer *unarchiveTransformer = [NSValueTransformer valueTransformerForName:NSUnarchiveFromDataTransformerName]; + NSMutableArray *transformedArray = [NSMutableArray arrayWithCapacity:[array count]]; + NSEnumerator *objEnum = [array objectEnumerator]; + NSData *obj; + while (obj = [objEnum nextObject]) + [transformedArray addObject:[unarchiveTransformer transformedValue:obj]]; + return transformedArray; +} + +- (id)reverseTransformedValue:(id)array { + NSValueTransformer *unarchiveTransformer = [NSValueTransformer valueTransformerForName:NSUnarchiveFromDataTransformerName]; + NSMutableArray *transformedArray = [NSMutableArray arrayWithCapacity:[array count]]; + NSEnumerator *objEnum = [array objectEnumerator]; + NSData *obj; + while (obj = [objEnum nextObject]) + [transformedArray addObject:[unarchiveTransformer reverseTransformedValue:obj]]; + return transformedArray; +} + +@end Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2007-07-04 18:26:07 UTC (rev 2420) +++ trunk/SKMainWindowController.h 2007-07-04 21:14:07 UTC (rev 2421) @@ -58,7 +58,7 @@ } SKPDFViewState; @class PDFOutline, SKThumbnail; -@class SKPDFView, SKOutlineView, SKNoteOutlineView, SKThumbnailTableView, SKSnapshotTableView, SKSplitView, BDSKCollapsibleView, BDSKEdgeView, BDSKImagePopUpButton; +@class SKPDFView, SKOutlineView, SKNoteOutlineView, SKThumbnailTableView, SKSnapshotTableView, SKSplitView, BDSKCollapsibleView, BDSKEdgeView, BDSKImagePopUpButton, SKColorSwatch; @class SKFullScreenWindow, SKNavigationWindow, SKSideWindow, SKSnapshotWindowController; @interface SKMainWindowController : NSWindowController { @@ -140,6 +140,7 @@ IBOutlet BDSKImagePopUpButton *notePopUpButton; IBOutlet BDSKImagePopUpButton *circlePopUpButton; IBOutlet BDSKImagePopUpButton *markupPopUpButton; + IBOutlet SKColorSwatch *colorSwatch; NSMutableDictionary *toolbarItems; IBOutlet NSWindow *choosePageSheet; @@ -181,6 +182,7 @@ - (IBAction)changeColor:(id)sender; - (IBAction)changeColorFill:(id)sender; +- (IBAction)selectColor:(id)sender; - (IBAction)changeFont:(id)sender; - (IBAction)createNewNote:(id)sender; - (IBAction)editNote:(id)sender; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-07-04 18:26:07 UTC (rev 2420) +++ trunk/SKMainWindowController.m 2007-07-04 21:14:07 UTC (rev 2421) @@ -72,6 +72,7 @@ #import "NSString_SKExtensions.h" #import "SKReadingBar.h" #import "SKLineInspector.h" +#import "SKColorSwatch.h" #define SEGMENTED_CONTROL_HEIGHT 25.0 #define WINDOW_X_DELTA 0.0 @@ -103,6 +104,7 @@ static NSString *SKDocumentToolbarInfoItemIdentifier = @"SKDocumentToolbarInfoItemIdentifier"; static NSString *SKDocumentToolbarToolModeItemIdentifier = @"SKDocumentToolbarToolModeItemIdentifier"; static NSString *SKDocumentToolbarDisplayBoxItemIdentifier = @"SKDocumentToolbarDisplayBoxItemIdentifier"; +static NSString *SKDocumentToolbarColorSwatchItemIdentifier = @"SKDocumentToolbarColorSwatchItemIdentifier"; static NSString *SKDocumentToolbarContentsPaneItemIdentifier = @"SKDocumentToolbarContentsPaneItemIdentifier"; static NSString *SKDocumentToolbarNotesPaneItemIdentifier = @"SKDocumentToolbarNotesPaneItemIdentifier"; @@ -119,6 +121,10 @@ @implementation SKMainWindowController ++ (void)initialize { + [NSValueTransformer setValueTransformer:[[[SKUnarchiveFromDataArrayTransformer alloc] init] autorelease] forName:@"SKUnarchiveFromDataArrayTransformer"]; +} + - (id)initWithWindowNibName:(NSString *)windowNibName owner:(id)owner{ self = [super initWithWindowNibName:windowNibName owner:owner]; if(self){ @@ -147,7 +153,7 @@ } - (void)dealloc { - + [colorSwatch unbind:@"color"]; [[NSNotificationCenter defaultCenter] removeObserver: self]; [self unregisterAsObserver]; [(id)temporaryAnnotations release]; @@ -897,6 +903,16 @@ [self updateColorPanel]; } +- (IBAction)selectColor:(id)sender{ + PDFAnnotation *annotation = [pdfView activeAnnotation]; + if ([annotation isNoteAnnotation]) { + NSColor *color = [annotation color]; + NSColor *newColor = [sender color]; + if (newColor && [color isEqual:newColor] == NO) + [annotation setColor:newColor]; + } +} + - (IBAction)changeFont:(id)sender{ PDFAnnotation *annotation = [pdfView activeAnnotation]; if (updatingFont == NO && [annotation isNoteAnnotation] && [annotation respondsToSelector:@selector(setFont:)] && [annotation respondsToSelector:@selector(font)]) { @@ -3285,7 +3301,7 @@ [item release]; - menu = [[NSMenu allocWithZone:[NSMenu menuZone]] init]; + menu = [[[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@""] autorelease]; menuItem = [menu addItemWithTitle:NSLocalizedString(@"Back", @"Menu item title") action:@selector(doGoBack:) keyEquivalent:@""]; [menuItem setTarget:self]; menuItem = [menu addItemWithTitle:NSLocalizedString(@"Forward", @"Menu item title") action:@selector(doGoForward:) keyEquivalent:@""]; @@ -3514,7 +3530,7 @@ [markupPopUpButton setRefreshesMenu:NO]; [markupPopUpButton setMenu:menu]; - menu = [[NSMenu allocWithZone:[NSMenu menuZone]] init]; + menu = [[[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@""] autorelease]; menuItem = [menu addItemWithTitle:NSLocalizedString(@"Text Tool", @"Menu item title") action:@selector(changeToolMode:) keyEquivalent:@""]; [menuItem setTarget:self]; [menuItem setTag:SKTextToolMode]; @@ -3569,7 +3585,7 @@ [item setMenuFormRepresentation:menuItem]; [toolbarItems setObject:item forKey:SKDocumentToolbarToolModeItemIdentifier]; [item release]; - menu = [[NSMenu allocWithZone:[NSMenu menuZone]] init]; + menu = [[[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@""] autorelease]; menuItem = [menu addItemWithTitle:NSLocalizedString(@"Text Note", @"Menu item title") action:@selector(changeAnnotationMode:) keyEquivalent:@""]; [menuItem setTarget:self]; [menuItem setTag:SKFreeTextNote]; @@ -3604,7 +3620,7 @@ [menuItem setImage:[NSImage imageNamed:@"LineNoteAdorn"]]; [toolModeButton setMenu:menu forSegment:SKNoteToolMode]; - menu = [[NSMenu allocWithZone:[NSMenu menuZone]] init]; + menu = [[[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@""] autorelease]; menuItem = [menu addItemWithTitle:NSLocalizedString(@"Media Box", @"Menu item title") action:@selector(changeDisplayBox:) keyEquivalent:@""]; [menuItem setTarget:self]; [menuItem setTag:kPDFDisplayBoxMediaBox]; @@ -3621,6 +3637,18 @@ [toolbarItems setObject:item forKey:SKDocumentToolbarDisplayBoxItemIdentifier]; [item release]; + NSDictionary *options = [NSDictionary dictionaryWithObject:@"SKUnarchiveFromDataArrayTransformer" forKey:NSValueTransformerNameBindingOption]; + [colorSwatch bind:@"colors" toObject:[NSUserDefaultsController sharedUserDefaultsController] withKeyPath:[NSString stringWithFormat:@"values.%@", SKSwatchColorsKey] options:options]; + [colorSwatch sizeToFit]; + menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:NSLocalizedString(@"Colors", @"Toolbar item label") action:@selector(orderFrontColorPanel:) keyEquivalent:@""] autorelease]; + item = [[SKToolbarItem alloc] initWithItemIdentifier:SKDocumentToolbarColorSwatchItemIdentifier]; + [item setLabels:NSLocalizedString(@"Colors", @"Toolbar item label")]; + [item setToolTip:NSLocalizedString(@"Colors", @"Tool tip message")]; + [item setViewWithSizes:colorSwatch]; + [item setMenuFormRepresentation:menuItem]; + [toolbarItems setObject:item forKey:SKDocumentToolbarColorSwatchItemIdentifier]; + [item release]; + item = [[SKToolbarItem alloc] initWithItemIdentifier:SKDocumentToolbarInfoItemIdentifier]; [item setLabels:NSLocalizedString(@"Info", @"Toolbar item label")]; [item setToolTip:NSLocalizedString(@"Get Document Info", @"Tool tip message")]; @@ -3702,11 +3730,12 @@ SKDocumentToolbarNewCircleNoteItemIdentifier, SKDocumentToolbarNewMarkupItemIdentifier, SKDocumentToolbarNewLineItemIdentifier, - SKDocumentToolbarInfoItemIdentifier, SKDocumentToolbarContentsPaneItemIdentifier, SKDocumentToolbarNotesPaneItemIdentifier, + SKDocumentToolbarInfoItemIdentifier, SKDocumentToolbarToolModeItemIdentifier, SKDocumentToolbarDisplayBoxItemIdentifier, + SKDocumentToolbarColorSwatchItemIdentifier, NSToolbarPrintItemIdentifier, NSToolbarFlexibleSpaceItemIdentifier, NSToolbarSpaceItemIdentifier, Modified: trunk/SKStringConstants.h =================================================================== --- trunk/SKStringConstants.h 2007-07-04 18:26:07 UTC (rev 2420) +++ trunk/SKStringConstants.h 2007-07-04 21:14:07 UTC (rev 2421) @@ -89,6 +89,7 @@ extern NSString *SKLineNoteDashPatternKey; extern NSString *SKLineNoteStartLineStyleKey; extern NSString *SKLineNoteEndLineStyleKey; +extern NSString *SKSwatchColorsKey; extern NSString *SKDefaultPDFDisplaySettingsKey; extern NSString *SKDefaultFullScreenPDFDisplaySettingsKey; extern NSString *SKEnableAppleRemoteKey; Modified: trunk/SKStringConstants.m =================================================================== --- trunk/SKStringConstants.m 2007-07-04 18:26:07 UTC (rev 2420) +++ trunk/SKStringConstants.m 2007-07-04 21:14:07 UTC (rev 2421) @@ -90,6 +90,7 @@ NSString *SKLineNoteLineStyleKey = @"SKLineNoteLineStyle"; NSString *SKLineNoteStartLineStyleKey = @"SKLineNoteStartLineStyle"; NSString *SKLineNoteEndLineStyleKey = @"SKLineNoteEndLineStyle"; +NSString *SKSwatchColorsKey = @"SKSwatchColors"; NSString *SKDefaultPDFDisplaySettingsKey = @"SKDefaultPDFDisplaySettings"; NSString *SKDefaultFullScreenPDFDisplaySettingsKey = @"SKDefaultFullScreenPDFDisplaySettings"; NSString *SKEnableAppleRemoteKey = @"SKEnableAppleRemote"; Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-07-04 18:26:07 UTC (rev 2420) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-07-04 21:14:07 UTC (rev 2421) @@ -114,6 +114,8 @@ CE4BC12F0C357A0300C2AF03 /* SKLineWell.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE4BC12D0C357A0300C2AF03 /* SKLineWell.h */; }; CE4BC1300C357A0300C2AF03 /* SKLineWell.m in Sources */ = {isa = PBXBuildFile; fileRef = CE4BC12E0C357A0300C2AF03 /* SKLineWell.m */; }; CE4D88D80C3AE531002C20CB /* DVIDocument.icns in Resources */ = {isa = PBXBuildFile; fileRef = CE4D88D70C3AE52F002C20CB /* DVIDocument.icns */; }; + CE4D97FC0C3C2BFF002C20CB /* SKColorSwatch.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE4D97FA0C3C2BFF002C20CB /* SKColorSwatch.h */; }; + CE4D97FD0C3C2BFF002C20CB /* SKColorSwatch.m in Sources */ = {isa = PBXBuildFile; fileRef = CE4D97FB0C3C2BFF002C20CB /* SKColorSwatch.m */; }; CE4DA2380B9D9BE10039E89C /* ToolbarSquareNote.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CE4DA2160B9D9AA70039E89C /* ToolbarSquareNote.tiff */; }; CE4DA2440B9D9EC00039E89C /* SquareNoteAdorn.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CE4DA2430B9D9E640039E89C /* SquareNoteAdorn.tiff */; }; CE4DA9240B9E190D0039E89C /* Skim Help in Resources */ = {isa = PBXBuildFile; fileRef = CE4DA9190B9E190D0039E89C /* Skim Help */; }; @@ -265,6 +267,7 @@ files = ( CE2BD8450BD4135600A5F4DB /* Sparkle.framework in CopyFiles */, CE4BC12F0C357A0300C2AF03 /* SKLineWell.h in CopyFiles */, + CE4D97FC0C3C2BFF002C20CB /* SKColorSwatch.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -450,6 +453,8 @@ CE4BC12D0C357A0300C2AF03 /* SKLineWell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SKLineWell.h; sourceTree = "<group>"; }; CE4BC12E0C357A0300C2AF03 /* SKLineWell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SKLineWell.m; sourceTree = "<group>"; }; CE4D88D70C3AE52F002C20CB /* DVIDocument.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = DVIDocument.icns; path = Images/DVIDocument.icns; sourceTree = "<group>"; }; + CE4D97FA0C3C2BFF002C20CB /* SKColorSwatch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SKColorSwatch.h; sourceTree = "<group>"; }; + CE4D97FB0C3C2BFF002C20CB /* SKColorSwatch.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SKColorSwatch.m; sourceTree = "<group>"; }; CE4DA2160B9D9AA70039E89C /* ToolbarSquareNote.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = ToolbarSquareNote.tiff; path = Images/ToolbarSquareNote.tiff; sourceTree = "<group>"; }; CE4DA2430B9D9E640039E89C /* SquareNoteAdorn.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = SquareNoteAdorn.tiff; path = Images/SquareNoteAdorn.tiff; sourceTree = "<group>"; }; CE4DA8D00B9E15AD0039E89C /* applehelp.init */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = applehelp.init; path = "Skim Help/applehelp.init"; sourceTree = "<group>"; }; @@ -843,6 +848,8 @@ CE2DE4D10B85D92F00D0DA12 /* Views */ = { isa = PBXGroup; children = ( + CE4D97FA0C3C2BFF002C20CB /* SKColorSwatch.h */, + CE4D97FB0C3C2BFF002C20CB /* SKColorSwatch.m */, CE4BC12D0C357A0300C2AF03 /* SKLineWell.h */, CE4BC12E0C357A0300C2AF03 /* SKLineWell.m */, CEA575CC0B9206E60003D2E7 /* SKNoteOutlineView.h */, @@ -1365,6 +1372,7 @@ CE7C20500C259A5D0059E08C /* NSColor_SKExtensions.m in Sources */, CE8B46E90C29CA00005CE7F1 /* SKLineInspector.m in Sources */, CE4BC1300C357A0300C2AF03 /* SKLineWell.m in Sources */, + CE4D97FD0C3C2BFF002C20CB /* SKColorSwatch.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-04 18:26:09
|
Revision: 2420 http://skim-app.svn.sourceforge.net/skim-app/?rev=2420&view=rev Author: hofman Date: 2007-07-04 11:26:07 -0700 (Wed, 04 Jul 2007) Log Message: ----------- Update keyboard focus while receiving a drag. Modified Paths: -------------- trunk/SKLineWell.m Modified: trunk/SKLineWell.m =================================================================== --- trunk/SKLineWell.m 2007-07-04 18:00:13 UTC (rev 2419) +++ trunk/SKLineWell.m 2007-07-04 18:26:07 UTC (rev 2420) @@ -731,6 +731,7 @@ - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender { if ([self isEnabled] && [sender draggingSource] != self && [[sender draggingPasteboard] availableTypeFromArray:[NSArray arrayWithObjects:SKLineStylePboardType, nil]]) { [self setHighlighted:YES]; + [self setKeyboardFocusRingNeedsDisplayInRect:[self bounds]]; [self setNeedsDisplay:YES]; return NSDragOperationEvery; } else @@ -740,6 +741,7 @@ - (void)draggingExited:(id <NSDraggingInfo>)sender { if ([self isEnabled] && [sender draggingSource] != self && [[sender draggingPasteboard] availableTypeFromArray:[NSArray arrayWithObjects:SKLineStylePboardType, nil]]) { [self setHighlighted:NO]; + [self setKeyboardFocusRingNeedsDisplayInRect:[self bounds]]; [self setNeedsDisplay:YES]; } } @@ -767,6 +769,7 @@ [self sendAction:[self action] to:[self target]]; [self setHighlighted:NO]; + [self setKeyboardFocusRingNeedsDisplayInRect:[self bounds]]; [self setNeedsDisplay:YES]; return dict != nil; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-04 18:00:15
|
Revision: 2419 http://skim-app.svn.sourceforge.net/skim-app/?rev=2419&view=rev Author: hofman Date: 2007-07-04 11:00:13 -0700 (Wed, 04 Jul 2007) Log Message: ----------- No need to implement keyDown as space calls performClick by default. Modified Paths: -------------- trunk/SKLineWell.m Modified: trunk/SKLineWell.m =================================================================== --- trunk/SKLineWell.m 2007-07-04 16:20:04 UTC (rev 2418) +++ trunk/SKLineWell.m 2007-07-04 18:00:13 UTC (rev 2419) @@ -378,21 +378,6 @@ } } -- (void)keyDown:(NSEvent *)theEvent { - NSString *characters = [theEvent charactersIgnoringModifiers]; - unichar eventChar = [characters length] > 0 ? [characters characterAtIndex:0] : 0; - unsigned int modifiers = [theEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask; - if (eventChar == 0x20) { - if ([self isEnabled]) { - if ([self isActive]) - [self deactivate]; - else - [self activate:(modifiers & NSShiftKeyMask) == 0]; - } - } else - [super keyDown:theEvent]; -} - - (void)performClick:(id)sender { if ([self isEnabled]) { if ([self isActive]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-04 16:20:07
|
Revision: 2418 http://skim-app.svn.sourceforge.net/skim-app/?rev=2418&view=rev Author: hofman Date: 2007-07-04 09:20:04 -0700 (Wed, 04 Jul 2007) Log Message: ----------- Increase max width of page column in note table. Modified Paths: -------------- trunk/Dutch.lproj/MainWindow.nib/info.nib trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib trunk/English.lproj/MainWindow.nib/info.nib trunk/English.lproj/MainWindow.nib/keyedobjects.nib trunk/Italian.lproj/MainWindow.nib/info.nib trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib Modified: trunk/Dutch.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-07-04 12:08:02 UTC (rev 2417) +++ trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-07-04 16:20:04 UTC (rev 2418) @@ -27,9 +27,10 @@ </array> <key>IBOpenObjects</key> <array> - <integer>539</integer> <integer>208</integer> <integer>168</integer> + <integer>539</integer> + <integer>511</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/English.lproj/MainWindow.nib/info.nib 2007-07-04 12:08:02 UTC (rev 2417) +++ trunk/English.lproj/MainWindow.nib/info.nib 2007-07-04 16:20:04 UTC (rev 2418) @@ -27,17 +27,17 @@ </array> <key>IBOpenObjects</key> <array> + <integer>168</integer> + <integer>511</integer> + <integer>539</integer> <integer>5</integer> + <integer>314</integer> <integer>256</integer> - <integer>539</integer> - <integer>511</integer> + <integer>585</integer> <integer>553</integer> + <integer>502</integer> <integer>208</integer> <integer>224</integer> - <integer>168</integer> - <integer>585</integer> - <integer>314</integer> - <integer>502</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/English.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Italian.lproj/MainWindow.nib/info.nib 2007-07-04 12:08:02 UTC (rev 2417) +++ trunk/Italian.lproj/MainWindow.nib/info.nib 2007-07-04 16:20:04 UTC (rev 2418) @@ -27,11 +27,11 @@ </array> <key>IBOpenObjects</key> <array> - <integer>168</integer> <integer>511</integer> <integer>539</integer> + <integer>208</integer> <integer>553</integer> - <integer>208</integer> + <integer>168</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-04 13:37:17
|
Revision: 2417 http://skim-app.svn.sourceforge.net/skim-app/?rev=2417&view=rev Author: hofman Date: 2007-07-04 05:08:02 -0700 (Wed, 04 Jul 2007) Log Message: ----------- use small margin for change of a float Modified Paths: -------------- trunk/SKLineInspector.m trunk/SKLineWell.m Modified: trunk/SKLineInspector.m =================================================================== --- trunk/SKLineInspector.m 2007-07-04 12:06:21 UTC (rev 2416) +++ trunk/SKLineInspector.m 2007-07-04 12:08:02 UTC (rev 2417) @@ -420,7 +420,7 @@ } - (void)setLineWidth:(float)width { - if (fabs(lineWidth - width) > 0.0) { + if (fabs(lineWidth - width) > 0.00001) { lineWidth = width; [self sendActionToTarget:@selector(changeLineWidth:)]; [[NSNotificationCenter defaultCenter] postNotificationName:SKLineInspectorLineWidthDidChangeNotification object:self]; Modified: trunk/SKLineWell.m =================================================================== --- trunk/SKLineWell.m 2007-07-04 12:06:21 UTC (rev 2416) +++ trunk/SKLineWell.m 2007-07-04 12:08:02 UTC (rev 2417) @@ -571,7 +571,7 @@ } - (void)setLineWidth:(float)width { - if (fabs(lineWidth - width) > 0.0) { + if (fabs(lineWidth - width) > 0.00001) { lineWidth = width; [self updateValue:[NSNumber numberWithFloat:lineWidth] forKey:@"lineWidth"]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-04 13:37:16
|
Revision: 2415 http://skim-app.svn.sourceforge.net/skim-app/?rev=2415&view=rev Author: hofman Date: 2007-07-04 05:05:36 -0700 (Wed, 04 Jul 2007) Log Message: ----------- Use dvi icon for dvi files. Modified Paths: -------------- trunk/Info.plist Modified: trunk/Info.plist =================================================================== --- trunk/Info.plist 2007-07-03 20:13:51 UTC (rev 2414) +++ trunk/Info.plist 2007-07-04 12:05:36 UTC (rev 2415) @@ -169,6 +169,8 @@ <array> <string>dvi</string> </array> + <key>CFBundleTypeIconFile</key> + <string>DVIDocument</string> <key>CFBundleTypeMIMETypes</key> <array> <string>application/x-dvi</string> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-04 13:37:16
|
Revision: 2416 http://skim-app.svn.sourceforge.net/skim-app/?rev=2416&view=rev Author: hofman Date: 2007-07-04 05:06:21 -0700 (Wed, 04 Jul 2007) Log Message: ----------- Check for change of lineWidth and dashPattern before setting. Modified Paths: -------------- trunk/SKLineInspector.m trunk/SKLineWell.m Modified: trunk/SKLineInspector.m =================================================================== --- trunk/SKLineInspector.m 2007-07-04 12:05:36 UTC (rev 2415) +++ trunk/SKLineInspector.m 2007-07-04 12:06:21 UTC (rev 2416) @@ -420,9 +420,11 @@ } - (void)setLineWidth:(float)width { - lineWidth = width; - [self sendActionToTarget:@selector(changeLineWidth:)]; - [[NSNotificationCenter defaultCenter] postNotificationName:SKLineInspectorLineWidthDidChangeNotification object:self]; + if (fabs(lineWidth - width) > 0.0) { + lineWidth = width; + [self sendActionToTarget:@selector(changeLineWidth:)]; + [[NSNotificationCenter defaultCenter] postNotificationName:SKLineInspectorLineWidthDidChangeNotification object:self]; + } } - (PDFBorderStyle)style { @@ -442,7 +444,7 @@ } - (void)setDashPattern:(NSArray *)pattern { - if (pattern != dashPattern) { + if ([pattern isEqualToArray:dashPattern] == NO && (pattern || dashPattern)) { [dashPattern release]; dashPattern = [pattern copy]; [self sendActionToTarget:@selector(changeDashPattern:)]; Modified: trunk/SKLineWell.m =================================================================== --- trunk/SKLineWell.m 2007-07-04 12:05:36 UTC (rev 2415) +++ trunk/SKLineWell.m 2007-07-04 12:06:21 UTC (rev 2416) @@ -571,8 +571,10 @@ } - (void)setLineWidth:(float)width { - lineWidth = width; - [self updateValue:[NSNumber numberWithFloat:lineWidth] forKey:@"lineWidth"]; + if (fabs(lineWidth - width) > 0.0) { + lineWidth = width; + [self updateValue:[NSNumber numberWithFloat:lineWidth] forKey:@"lineWidth"]; + } } - (PDFBorderStyle)style { @@ -591,7 +593,7 @@ } - (void)setDashPattern:(NSArray *)pattern { - if (pattern != dashPattern) { + if ([pattern isEqualToArray:dashPattern] == NO && (pattern || dashPattern)) { [dashPattern release]; dashPattern = [pattern copy]; [self updateValue:dashPattern forKey:@"dashPattern"]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-03 20:13:52
|
Revision: 2414 http://skim-app.svn.sourceforge.net/skim-app/?rev=2414&view=rev Author: hofman Date: 2007-07-03 13:13:51 -0700 (Tue, 03 Jul 2007) Log Message: ----------- Add an icon for DVI files. Modified Paths: -------------- trunk/Skim.xcodeproj/project.pbxproj Added Paths: ----------- trunk/Images/DVIDocument.icns Added: trunk/Images/DVIDocument.icns =================================================================== (Binary files differ) Property changes on: trunk/Images/DVIDocument.icns ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-07-03 19:21:35 UTC (rev 2413) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-07-03 20:13:51 UTC (rev 2414) @@ -113,6 +113,7 @@ CE4A8BA20BB15980004AD07D /* NSWindowController_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE4A8BA10BB15980004AD07D /* NSWindowController_SKExtensions.m */; }; CE4BC12F0C357A0300C2AF03 /* SKLineWell.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE4BC12D0C357A0300C2AF03 /* SKLineWell.h */; }; CE4BC1300C357A0300C2AF03 /* SKLineWell.m in Sources */ = {isa = PBXBuildFile; fileRef = CE4BC12E0C357A0300C2AF03 /* SKLineWell.m */; }; + CE4D88D80C3AE531002C20CB /* DVIDocument.icns in Resources */ = {isa = PBXBuildFile; fileRef = CE4D88D70C3AE52F002C20CB /* DVIDocument.icns */; }; CE4DA2380B9D9BE10039E89C /* ToolbarSquareNote.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CE4DA2160B9D9AA70039E89C /* ToolbarSquareNote.tiff */; }; CE4DA2440B9D9EC00039E89C /* SquareNoteAdorn.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CE4DA2430B9D9E640039E89C /* SquareNoteAdorn.tiff */; }; CE4DA9240B9E190D0039E89C /* Skim Help in Resources */ = {isa = PBXBuildFile; fileRef = CE4DA9190B9E190D0039E89C /* Skim Help */; }; @@ -448,6 +449,7 @@ CE4A8BA10BB15980004AD07D /* NSWindowController_SKExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSWindowController_SKExtensions.m; sourceTree = "<group>"; }; CE4BC12D0C357A0300C2AF03 /* SKLineWell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SKLineWell.h; sourceTree = "<group>"; }; CE4BC12E0C357A0300C2AF03 /* SKLineWell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SKLineWell.m; sourceTree = "<group>"; }; + CE4D88D70C3AE52F002C20CB /* DVIDocument.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = DVIDocument.icns; path = Images/DVIDocument.icns; sourceTree = "<group>"; }; CE4DA2160B9D9AA70039E89C /* ToolbarSquareNote.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = ToolbarSquareNote.tiff; path = Images/ToolbarSquareNote.tiff; sourceTree = "<group>"; }; CE4DA2430B9D9E640039E89C /* SquareNoteAdorn.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = SquareNoteAdorn.tiff; path = Images/SquareNoteAdorn.tiff; sourceTree = "<group>"; }; CE4DA8D00B9E15AD0039E89C /* applehelp.init */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = applehelp.init; path = "Skim Help/applehelp.init"; sourceTree = "<group>"; }; @@ -927,6 +929,7 @@ CE7469170B7F40B600CBF969 /* Skim.icns */, CE07158A0B8A3D6300733CC8 /* PDFDocument.icns */, CE4373B30BB5440E00A56987 /* PSDocument.icns */, + CE4D88D70C3AE52F002C20CB /* DVIDocument.icns */, CE0715890B8A3D6300733CC8 /* NoteDocument.icns */, CE380A7A0B834E6100A1B779 /* CameraCursor.tiff */, CE5478B80B33456300F8AFB6 /* BackAdorn.tiff */, @@ -1192,6 +1195,7 @@ CE9A87930C0C9E9A004F1F97 /* ProgressSheet.nib in Resources */, CE327A460C11BF6700DB4BEB /* NoteTypeSheet.nib in Resources */, CE8B46F00C29CA3D005CE7F1 /* LineInspector.nib in Resources */, + CE4D88D80C3AE531002C20CB /* DVIDocument.icns in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-03 19:21:36
|
Revision: 2413 http://skim-app.svn.sourceforge.net/skim-app/?rev=2413&view=rev Author: hofman Date: 2007-07-03 12:21:35 -0700 (Tue, 03 Jul 2007) Log Message: ----------- Rename enum. Move CGPSCnverterRef ivar to PS converter. Modified Paths: -------------- trunk/SKPSProgressController.h trunk/SKPSProgressController.m Modified: trunk/SKPSProgressController.h =================================================================== --- trunk/SKPSProgressController.h 2007-07-03 19:12:06 UTC (rev 2412) +++ trunk/SKPSProgressController.h 2007-07-03 19:21:35 UTC (rev 2413) @@ -39,7 +39,6 @@ #import <Cocoa/Cocoa.h> @interface SKConversionProgressController : NSWindowController { - CGPSConverterRef converter; IBOutlet NSButton *cancelButton; IBOutlet NSProgressIndicator *progressBar; IBOutlet NSTextField *textField; @@ -48,7 +47,10 @@ - (IBAction)close:(id)sender; @end -@interface SKPSProgressController : SKConversionProgressController + +@interface SKPSProgressController : SKConversionProgressController { + CGPSConverterRef converter; +} - (NSData *)PDFDataWithPostScriptData:(NSData *)psData; @end Modified: trunk/SKPSProgressController.m =================================================================== --- trunk/SKPSProgressController.m 2007-07-03 19:12:06 UTC (rev 2412) +++ trunk/SKPSProgressController.m 2007-07-03 19:21:35 UTC (rev 2413) @@ -39,11 +39,11 @@ #import "SKPSProgressController.h" #import "NSString_SKExtensions.h" -typedef enum { - SKPSConversionCanceled = -1, - SKPSConversionSucceeded = 0, - SKPSConversionFailed = 1 -} SKPSConversionStatus; +enum { + SKConversionCanceled = -1, + SKConversionSucceeded = 0, + SKConversionFailed = 1 +}; @interface SKConversionProgressController (Private) - (int)runModalConversionInWithInfo:(NSDictionary *)info; @@ -174,7 +174,7 @@ - (IBAction)cancel:(id)sender { - [NSApp stopModalWithCode:SKPSConversionCanceled]; + [NSApp stopModalWithCode:SKConversionCanceled]; if (CGPSConverterAbort(converter) == false) { NSBeep(); @@ -215,7 +215,7 @@ CGDataProviderRelease(provider); CGDataConsumerRelease(consumer); - if (rv != SKPSConversionSucceeded) { + if (rv != SKConversionSucceeded) { CFRelease(pdfData); pdfData = nil; } @@ -236,7 +236,7 @@ CGDataConsumerRef consumer = (void *)[info objectForKey:@"consumer"]; Boolean success = CGPSConverterConvert(converter, provider, consumer, NULL); - int val = (success ? SKPSConversionSucceeded : SKPSConversionFailed); + int val = (success ? SKConversionSucceeded : SKConversionFailed); NSMethodSignature *ms = [NSApp methodSignatureForSelector:@selector(stopModalWithCode:)]; NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:ms]; @@ -287,7 +287,7 @@ int rv = [self runModalConversionInWithInfo:dictionary]; - if (rv != SKPSConversionSucceeded) { + if (rv != SKConversionSucceeded) { [pdfData release]; pdfData = nil; } @@ -371,7 +371,7 @@ [invocation setArgument:&success atIndex:2]; [invocation performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:NO]; - int val = (success ? SKPSConversionSucceeded : SKPSConversionFailed); + int val = (success ? SKConversionSucceeded : SKConversionFailed); ms = [NSApp methodSignatureForSelector:@selector(stopModalWithCode:)]; invocation = [NSInvocation invocationWithMethodSignature:ms]; [invocation setTarget:NSApp]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-03 19:12:12
|
Revision: 2412 http://skim-app.svn.sourceforge.net/skim-app/?rev=2412&view=rev Author: hofman Date: 2007-07-03 12:12:06 -0700 (Tue, 03 Jul 2007) Log Message: ----------- Use dvipdfmx instead of dvips. This converts annotations and links. Run the task in the background. Factor some basic conversion methods off into an abstract superclass of the converter and make the PS and DVI converter subclasses implementing the actual conversion. Modified Paths: -------------- trunk/Dutch.lproj/ConversionProgressWindow.nib/classes.nib trunk/Dutch.lproj/ConversionProgressWindow.nib/info.nib trunk/Dutch.lproj/ConversionProgressWindow.nib/keyedobjects.nib trunk/English.lproj/ConversionProgressWindow.nib/classes.nib trunk/English.lproj/ConversionProgressWindow.nib/info.nib trunk/English.lproj/ConversionProgressWindow.nib/keyedobjects.nib trunk/Italian.lproj/ConversionProgressWindow.nib/classes.nib trunk/Italian.lproj/ConversionProgressWindow.nib/info.nib trunk/Italian.lproj/ConversionProgressWindow.nib/keyedobjects.nib trunk/SKPSProgressController.h trunk/SKPSProgressController.m Modified: trunk/Dutch.lproj/ConversionProgressWindow.nib/classes.nib =================================================================== --- trunk/Dutch.lproj/ConversionProgressWindow.nib/classes.nib 2007-07-03 17:28:20 UTC (rev 2411) +++ trunk/Dutch.lproj/ConversionProgressWindow.nib/classes.nib 2007-07-03 19:12:06 UTC (rev 2412) @@ -3,7 +3,7 @@ {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { ACTIONS = {cancel = id; }; - CLASS = SKPSProgressController; + CLASS = SKConversionProgressController; LANGUAGE = ObjC; OUTLETS = { cancelButton = NSButton; Modified: trunk/Dutch.lproj/ConversionProgressWindow.nib/info.nib =================================================================== --- trunk/Dutch.lproj/ConversionProgressWindow.nib/info.nib 2007-07-03 17:28:20 UTC (rev 2411) +++ trunk/Dutch.lproj/ConversionProgressWindow.nib/info.nib 2007-07-03 19:12:06 UTC (rev 2412) @@ -11,6 +11,6 @@ <integer>5</integer> </array> <key>IBSystem Version</key> - <string>8P135</string> + <string>8R218</string> </dict> </plist> Modified: trunk/Dutch.lproj/ConversionProgressWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/ConversionProgressWindow.nib/classes.nib =================================================================== --- trunk/English.lproj/ConversionProgressWindow.nib/classes.nib 2007-07-03 17:28:20 UTC (rev 2411) +++ trunk/English.lproj/ConversionProgressWindow.nib/classes.nib 2007-07-03 19:12:06 UTC (rev 2412) @@ -3,7 +3,7 @@ {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { ACTIONS = {cancel = id; }; - CLASS = SKPSProgressController; + CLASS = SKConversionProgressController; LANGUAGE = ObjC; OUTLETS = { cancelButton = NSButton; Modified: trunk/English.lproj/ConversionProgressWindow.nib/info.nib =================================================================== --- trunk/English.lproj/ConversionProgressWindow.nib/info.nib 2007-07-03 17:28:20 UTC (rev 2411) +++ trunk/English.lproj/ConversionProgressWindow.nib/info.nib 2007-07-03 19:12:06 UTC (rev 2412) @@ -3,7 +3,7 @@ <plist version="1.0"> <dict> <key>IBDocumentLocation</key> - <string>69 40 356 240 0 0 1280 832 </string> + <string>81 92 356 240 0 0 1440 938 </string> <key>IBFramework Version</key> <string>446.1</string> <key>IBOpenObjects</key> @@ -11,6 +11,6 @@ <integer>5</integer> </array> <key>IBSystem Version</key> - <string>8L127</string> + <string>8R218</string> </dict> </plist> Modified: trunk/English.lproj/ConversionProgressWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/ConversionProgressWindow.nib/classes.nib =================================================================== --- trunk/Italian.lproj/ConversionProgressWindow.nib/classes.nib 2007-07-03 17:28:20 UTC (rev 2411) +++ trunk/Italian.lproj/ConversionProgressWindow.nib/classes.nib 2007-07-03 19:12:06 UTC (rev 2412) @@ -3,7 +3,7 @@ {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { ACTIONS = {cancel = id; }; - CLASS = SKPSProgressController; + CLASS = SKConversionProgressController; LANGUAGE = ObjC; OUTLETS = { cancelButton = NSButton; Modified: trunk/Italian.lproj/ConversionProgressWindow.nib/info.nib =================================================================== --- trunk/Italian.lproj/ConversionProgressWindow.nib/info.nib 2007-07-03 17:28:20 UTC (rev 2411) +++ trunk/Italian.lproj/ConversionProgressWindow.nib/info.nib 2007-07-03 19:12:06 UTC (rev 2412) @@ -3,7 +3,7 @@ <plist version="1.0"> <dict> <key>IBDocumentLocation</key> - <string>50 94 356 240 0 0 1024 746 </string> + <string>81 130 356 240 0 0 1440 938 </string> <key>IBFramework Version</key> <string>446.1</string> <key>IBOpenObjects</key> @@ -11,6 +11,6 @@ <integer>5</integer> </array> <key>IBSystem Version</key> - <string>8P135</string> + <string>8R218</string> </dict> </plist> Modified: trunk/Italian.lproj/ConversionProgressWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/SKPSProgressController.h =================================================================== --- trunk/SKPSProgressController.h 2007-07-03 17:28:20 UTC (rev 2411) +++ trunk/SKPSProgressController.h 2007-07-03 19:12:06 UTC (rev 2412) @@ -38,18 +38,23 @@ #import <Cocoa/Cocoa.h> -@interface SKPSProgressController : NSWindowController -{ +@interface SKConversionProgressController : NSWindowController { CGPSConverterRef converter; IBOutlet NSButton *cancelButton; IBOutlet NSProgressIndicator *progressBar; IBOutlet NSTextField *textField; } -- (NSData *)PDFDataWithPostScriptData:(NSData *)psData; - (IBAction)cancel:(id)sender; +- (IBAction)close:(id)sender; @end +@interface SKPSProgressController : SKConversionProgressController +- (NSData *)PDFDataWithPostScriptData:(NSData *)psData; +@end -@interface SKDVIProgressController : SKPSProgressController + +@interface SKDVIProgressController : SKConversionProgressController { + NSTask *task; +} - (NSData *)PDFDataWithDVIFile:(NSString *)dviFile; @end Modified: trunk/SKPSProgressController.m =================================================================== --- trunk/SKPSProgressController.m 2007-07-03 17:28:20 UTC (rev 2411) +++ trunk/SKPSProgressController.m 2007-07-03 19:12:06 UTC (rev 2412) @@ -45,20 +45,24 @@ SKPSConversionFailed = 1 } SKPSConversionStatus; +@interface SKConversionProgressController (Private) +- (int)runModalConversionInWithInfo:(NSDictionary *)info; +- (void)doConversionWithInfo:(NSDictionary *)info; +- (void)conversionCompleted:(BOOL)didComplete; +- (void)conversionStarted; +- (NSString *)fileType; +@end + @interface SKPSProgressController (Private) -- (void)doConversionWithInfo:(NSDictionary *)info; - (void)processingPostScriptPage:(NSNumber *)page; -- (void)postscriptConversionCompleted:(BOOL)didComplete; -- (void)postscriptConversionStarted; - (void)showPostScriptConversionMessage:(NSString *)message; -- (NSString *)fileType; @end static void PSConverterBeginDocumentCallback(void *info) { id delegate = (id)info; - if (delegate && [delegate respondsToSelector:@selector(postscriptConversionStarted)]) - [delegate performSelectorOnMainThread:@selector(postscriptConversionStarted) withObject:nil waitUntilDone:NO]; + if (delegate && [delegate respondsToSelector:@selector(conversionStarted)]) + [delegate performSelectorOnMainThread:@selector(conversionStarted) withObject:nil waitUntilDone:NO]; } static void PSConverterBeginPageCallback(void *info, size_t pageNumber, CFDictionaryRef pageInfo) @@ -71,11 +75,11 @@ static void PSConverterEndDocumentCallback(void *info, bool success) { id delegate = (id)info; - if (delegate && [delegate respondsToSelector:@selector(postscriptConversionCompleted:)]) { - NSMethodSignature *ms = [delegate methodSignatureForSelector:@selector(postscriptConversionCompleted:)]; + if (delegate && [delegate respondsToSelector:@selector(conversionCompleted:)]) { + NSMethodSignature *ms = [delegate methodSignatureForSelector:@selector(conversionCompleted:)]; NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:ms]; [invocation setTarget:delegate]; - [invocation setSelector:@selector(postscriptConversionCompleted:)]; + [invocation setSelector:@selector(conversionCompleted:)]; BOOL val = (success == true); [invocation setArgument:&val atIndex:2]; @@ -90,12 +94,9 @@ [delegate performSelectorOnMainThread:@selector(showPostScriptConversionMessage:) withObject:(id)message waitUntilDone:NO]; } -@implementation SKPSProgressController +#pragma mark - -- (id)init -{ - return [super initWithWindowNibName:[self windowNibName] owner:self]; -} +@implementation SKConversionProgressController - (void)awakeFromNib { @@ -103,16 +104,74 @@ [[self window] setTitle:@""]; } +- (NSString *)windowNibName { return @"ConversionProgressWindow"; } + +- (IBAction)close:(id)sender { [self close]; } + +- (IBAction)cancel:(id)sender {} + +@end + + +@implementation SKConversionProgressController (Private) + +- (int)runModalConversionInWithInfo:(NSDictionary *)info { + + NSModalSession session = [NSApp beginModalSessionForWindow:[self window]]; + BOOL didDetach = NO; + int rv = 0; + + while (1) { + + // we run this inside the modal session since the thread could end before runModalForWindow starts + if (NO == didDetach) { + [NSThread detachNewThreadSelector:@selector(doConversionWithInfo:) toTarget:self withObject:info]; + didDetach = YES; + } + + rv = [NSApp runModalSession:session]; + if (rv != NSRunContinuesResponse) + break; + } + + [NSApp endModalSession:session]; + + // close the window when finished + [self close]; + + return rv; +} + +- (void)doConversionWithInfo:(NSDictionary *)info {} + +- (NSString *)fileType { return @""; } + +- (void)conversionCompleted:(BOOL)didComplete; +{ + [textField setStringValue:NSLocalizedString(@"File successfully converted!", @"PS conversion progress message")]; + [progressBar stopAnimation:nil]; + [cancelButton setTitle:NSLocalizedString(@"Close", @"Button title")]; + [cancelButton setAction:@selector(close:)]; +} + +- (void)conversionStarted; +{ + [progressBar startAnimation:nil]; + [textField setStringValue:[[NSString stringWithFormat:NSLocalizedString(@"Converting %@", @"PS conversion progress message"), [self fileType]] stringByAppendingEllipsis]]; +} + +@end + +#pragma mark - + +@implementation SKPSProgressController + - (void)dealloc { if (converter) CFRelease(converter); [super dealloc]; } -- (NSString *)windowNibName { return @"ConversionProgressWindow"; } - -- (IBAction)close:(id)sender { [self close]; } - - (IBAction)cancel:(id)sender { [NSApp stopModalWithCode:SKPSConversionCanceled]; @@ -151,25 +210,8 @@ NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:(id)provider, @"provider", (id)consumer, @"consumer", nil]; - NSModalSession session = [NSApp beginModalSessionForWindow:[self window]]; - BOOL didDetach = NO; - int rv; + int rv = [self runModalConversionInWithInfo:dictionary]; - while (1) { - - // we run this inside the modal session since the thread could end before runModalForWindow starts - if (NO == didDetach) { - [NSThread detachNewThreadSelector:@selector(doConversionWithInfo:) toTarget:self withObject:dictionary]; - didDetach = YES; - } - - rv = [NSApp runModalSession:session]; - if (rv != NSRunContinuesResponse) - break; - } - - [NSApp endModalSession:session]; - CGDataProviderRelease(provider); CGDataConsumerRelease(consumer); @@ -178,14 +220,12 @@ pdfData = nil; } - // close the window when finished - [self close]; - return [(id)pdfData autorelease]; } @end + @implementation SKPSProgressController (Private) - (void)doConversionWithInfo:(NSDictionary *)info; @@ -217,20 +257,6 @@ [textField setStringValue:[[NSString stringWithFormat:NSLocalizedString(@"Processing page %d", @"PS conversion progress message"), [page intValue]] stringByAppendingEllipsis]]; } -- (void)postscriptConversionCompleted:(BOOL)didComplete; -{ - [textField setStringValue:NSLocalizedString(@"File successfully converted!", @"PS conversion progress message")]; - [progressBar stopAnimation:nil]; - [cancelButton setTitle:NSLocalizedString(@"Close", @"Button title")]; - [cancelButton setAction:@selector(close:)]; -} - -- (void)postscriptConversionStarted; -{ - [progressBar startAnimation:nil]; - [textField setStringValue:[[NSString stringWithFormat:NSLocalizedString(@"Converting %@", @"PS conversion progress message"), [self fileType]] stringByAppendingEllipsis]]; -} - - (void)showPostScriptConversionMessage:(NSString *)message; { [textField setStringValue:message]; @@ -238,45 +264,122 @@ @end +#pragma mark - @implementation SKDVIProgressController +- (IBAction)cancel:(id)sender +{ + if (task == nil) { + NSBeep(); + [textField setStringValue:NSLocalizedString(@"Converter already stopped.", @"PS conversion progress message")]; + [cancelButton setTitle:NSLocalizedString(@"Close", @"Button title")]; + [cancelButton setAction:@selector(close:)]; + } else { + [task terminate]; + } +} + - (NSData *)PDFDataWithDVIFile:(NSString *)dviFile { - NSData *psData = nil; + NSMutableData *pdfData = [[NSMutableData alloc] init]; - NSString *dvipsPath = [[NSUserDefaults standardUserDefaults] stringForKey:@"SKDvipsBinaryPath"]; + NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:dviFile, @"dviFile", pdfData, @"pdfData", nil]; + + int rv = [self runModalConversionInWithInfo:dictionary]; + + if (rv != SKPSConversionSucceeded) { + [pdfData release]; + pdfData = nil; + } + + return [pdfData autorelease]; +} + +@end + +@implementation SKDVIProgressController (Private) + +- (void)doConversionWithInfo:(NSDictionary *)info { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + NSString *dviFile = [info objectForKey:@"dviFile"]; + NSString *dvipdfmxPath = [[NSUserDefaults standardUserDefaults] stringForKey:@"SKDvipdfmxBinaryPath"]; NSFileManager *fm = [NSFileManager defaultManager]; NSArray *paths = [NSArray arrayWithObjects:@"/usr/texbin", @"/usr/local/teTeX/bin/powerpc-apple-darwin-current", @"/sw/bin", @"/opt/local/bin", @"/usr/local/bin", nil]; int i = 0, count = [paths count]; - while ([fm isExecutableFileAtPath:dvipsPath] == NO) { + while ([fm isExecutableFileAtPath:dvipdfmxPath] == NO) { if (i < count) { - dvipsPath = [[paths objectAtIndex:i++] stringByAppendingPathComponent:@"dvips"]; + dvipdfmxPath = [[paths objectAtIndex:i++] stringByAppendingPathComponent:@"dvipdfmx"]; } else { - dvipsPath = nil; + dvipdfmxPath = nil; break; } } - if (dvipsPath && [fm fileExistsAtPath:dviFile]) { - NSTask *task = [[NSTask alloc] init]; - NSPipe *pipe = [NSPipe pipe]; - NSFileHandle *fileHandle = [pipe fileHandleForReading]; + NSString *tmpDir = NSTemporaryDirectory(); + NSString *pdfFile = [tmpDir stringByAppendingPathComponent:[[[dviFile lastPathComponent] stringByDeletingPathExtension] stringByAppendingPathExtension:@"pdf"]]; + BOOL success = dvipdfmxPath != nil && [fm fileExistsAtPath:dviFile]; + + NSMethodSignature *ms; + NSInvocation *invocation; + + if (success) { - [task setLaunchPath:dvipsPath]; - [task setArguments:[NSArray arrayWithObjects:@"-q", @"-f", dviFile, nil]]; + [fm createDirectoryAtPath:tmpDir attributes:nil]; + + task = [[NSTask alloc] init]; + [task setLaunchPath:dvipdfmxPath]; + [task setArguments:[NSArray arrayWithObjects:@"-o", pdfFile, dviFile, nil]]; [task setCurrentDirectoryPath:[dviFile stringByDeletingLastPathComponent]]; [task setStandardError:[NSFileHandle fileHandleWithNullDevice]]; - [task setStandardOutput:pipe]; - [task launch]; + @try { + [task launch]; + } + @catch(id exception) { + if([task isRunning]) + [task terminate]; + NSLog(@"%@ %@ failed", [task description], [task launchPath]); + success = NO; + } - psData = [fileHandle readDataToEndOfFile]; + ms = [self methodSignatureForSelector:@selector(conversionStarted)]; + invocation = [NSInvocation invocationWithMethodSignature:ms]; + [invocation setTarget:self]; + [invocation setSelector:@selector(conversionStarted)]; + [invocation performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:NO]; - [task release]; + if (success) { + [task waitUntilExit]; + [task terminate]; + success = 0 == [task terminationStatus]; + } } - return [psData length] ? [self PDFDataWithPostScriptData:psData] : nil; + [task release]; + task = nil; + + if (success) + [[info objectForKey:@"pdfData"] setData:[NSData dataWithContentsOfFile:pdfFile]]; + [fm removeFileAtPath:tmpDir handler:nil]; + + ms = [self methodSignatureForSelector:@selector(conversionCompleted:)]; + invocation = [NSInvocation invocationWithMethodSignature:ms]; + [invocation setTarget:self]; + [invocation setSelector:@selector(conversionCompleted:)]; + [invocation setArgument:&success atIndex:2]; + [invocation performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:NO]; + + int val = (success ? SKPSConversionSucceeded : SKPSConversionFailed); + ms = [NSApp methodSignatureForSelector:@selector(stopModalWithCode:)]; + invocation = [NSInvocation invocationWithMethodSignature:ms]; + [invocation setTarget:NSApp]; + [invocation setSelector:@selector(stopModalWithCode:)]; + [invocation setArgument:&val atIndex:2]; + [invocation performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:NO]; + + [pool release]; } - (NSString *)fileType { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-03 17:28:22
|
Revision: 2411 http://skim-app.svn.sourceforge.net/skim-app/?rev=2411&view=rev Author: hofman Date: 2007-07-03 10:28:20 -0700 (Tue, 03 Jul 2007) Log Message: ----------- Stop search and remove searchResults before reloading a PDF document. Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-07-02 19:35:45 UTC (rev 2410) +++ trunk/SKMainWindowController.m 2007-07-03 17:28:20 UTC (rev 2411) @@ -566,25 +566,30 @@ unsigned pageIndex = NSNotFound; NSRect visibleRect = NSZeroRect; + NSArray *snapshotDicts = nil; if ([pdfView document]) { pageIndex = [[pdfView document] indexForPage:[pdfView currentPage]]; visibleRect = [pdfView convertRect:[pdfView convertRect:[[pdfView documentView] visibleRect] fromView:[pdfView documentView]] toPage:[pdfView currentPage]]; + + [[pdfView document] cancelFindString]; + + // these will be invalid. If needed, the document will restore them + [[self mutableArrayValueForKey:@"searchResults"] removeAllObjects]; + [[self mutableArrayValueForKey:@"notes"] removeAllObjects]; + [[self mutableArrayValueForKey:@"thumbnails"] removeAllObjects]; + + snapshotDicts = [snapshots valueForKey:@"currentSetup"]; + [snapshots makeObjectsPerformSelector:@selector(close)]; + [[self mutableArrayValueForKey:@"snapshots"] removeAllObjects]; + + [lastViewedPages removeAllObjects]; + + [self unregisterForDocumentNotifications]; + + [[pdfView document] setDelegate:nil]; } - // these will be invalid. If needed, the document will restore them - [[self mutableArrayValueForKey:@"notes"] removeAllObjects]; - [[self mutableArrayValueForKey:@"thumbnails"] removeAllObjects]; - - NSArray *snapshotDicts = [snapshots valueForKey:@"currentSetup"]; - [snapshots makeObjectsPerformSelector:@selector(close)]; - [[self mutableArrayValueForKey:@"snapshots"] removeAllObjects]; - - [lastViewedPages removeAllObjects]; - - [self unregisterForDocumentNotifications]; - - [[pdfView document] setDelegate:nil]; [pdfView setDocument:document]; [[pdfView document] setDelegate:self]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-02 19:35:46
|
Revision: 2410 http://skim-app.svn.sourceforge.net/skim-app/?rev=2410&view=rev Author: hofman Date: 2007-07-02 12:35:45 -0700 (Mon, 02 Jul 2007) Log Message: ----------- Declare DVI file type. Use converted type in progress message. Modified Paths: -------------- trunk/Dutch.lproj/Localizable.strings trunk/Info.plist trunk/Italian.lproj/Localizable.strings trunk/SKPSProgressController.m Modified: trunk/Dutch.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/Info.plist =================================================================== --- trunk/Info.plist 2007-07-02 18:54:04 UTC (rev 2409) +++ trunk/Info.plist 2007-07-02 19:35:45 UTC (rev 2410) @@ -167,6 +167,30 @@ <dict> <key>CFBundleTypeExtensions</key> <array> + <string>dvi</string> + </array> + <key>CFBundleTypeMIMETypes</key> + <array> + <string>application/x-dvi</string> + </array> + <key>CFBundleTypeName</key> + <string>DVI document</string> + <key>CFBundleTypeOSTypes</key> + <array> + <string>*DVI</string> + </array> + <key>CFBundleTypeRole</key> + <string>Viewer</string> + <key>LSTypeIsPackage</key> + <false/> + <key>NSDocumentClass</key> + <string>SKDocument</string> + <key>NSPersistentStoreTypeKey</key> + <string>Binary</string> + </dict> + <dict> + <key>CFBundleTypeExtensions</key> + <array> <string>pdf</string> </array> <key>CFBundleTypeIconFile</key> Modified: trunk/Italian.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/SKPSProgressController.m =================================================================== --- trunk/SKPSProgressController.m 2007-07-02 18:54:04 UTC (rev 2409) +++ trunk/SKPSProgressController.m 2007-07-02 19:35:45 UTC (rev 2410) @@ -51,6 +51,7 @@ - (void)postscriptConversionCompleted:(BOOL)didComplete; - (void)postscriptConversionStarted; - (void)showPostScriptConversionMessage:(NSString *)message; +- (NSString *)fileType; @end static void PSConverterBeginDocumentCallback(void *info) @@ -207,6 +208,10 @@ [pool release]; } +- (NSString *)fileType { + return @"PostScript"; +} + - (void)processingPostScriptPage:(NSNumber *)page; { [textField setStringValue:[[NSString stringWithFormat:NSLocalizedString(@"Processing page %d", @"PS conversion progress message"), [page intValue]] stringByAppendingEllipsis]]; @@ -223,7 +228,7 @@ - (void)postscriptConversionStarted; { [progressBar startAnimation:nil]; - [textField setStringValue:[[NSString stringWithFormat:NSLocalizedString(@"Converting PostScript", @"PS conversion progress message")] stringByAppendingEllipsis]]; + [textField setStringValue:[[NSString stringWithFormat:NSLocalizedString(@"Converting %@", @"PS conversion progress message"), [self fileType]] stringByAppendingEllipsis]]; } - (void)showPostScriptConversionMessage:(NSString *)message; @@ -274,4 +279,8 @@ return [psData length] ? [self PDFDataWithPostScriptData:psData] : nil; } +- (NSString *)fileType { + return @"DVI"; +} + @end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-02 18:54:12
|
Revision: 2409 http://skim-app.svn.sourceforge.net/skim-app/?rev=2409&view=rev Author: hofman Date: 2007-07-02 11:54:04 -0700 (Mon, 02 Jul 2007) Log Message: ----------- Open DVI document. Pass it through a dvips task first before converting postscript. Look for the dvips binary in a few standard locations and optionally a location given by a hidden default. Modified Paths: -------------- trunk/SKDocument.m trunk/SKDocumentController.h trunk/SKDocumentController.m trunk/SKPSProgressController.h trunk/SKPSProgressController.m Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-07-01 19:00:41 UTC (rev 2408) +++ trunk/SKDocument.m 2007-07-02 18:54:04 UTC (rev 2409) @@ -388,6 +388,13 @@ pdfDoc = [[PDFDocument alloc] initWithData:data]; [progressController autorelease]; } + } else if ([docType isEqualToString:SKDVIDocumentType]) { + if (data = [NSData dataWithContentsOfURL:absoluteURL options:0 error:&error]) { + SKDVIProgressController *progressController = [[SKDVIProgressController alloc] init]; + if (data = [[progressController PDFDataWithDVIFile:[absoluteURL path]] retain]) + pdfDoc = [[PDFDocument alloc] initWithData:data]; + [progressController autorelease]; + } } if (data) { Modified: trunk/SKDocumentController.h =================================================================== --- trunk/SKDocumentController.h 2007-07-01 19:00:41 UTC (rev 2408) +++ trunk/SKDocumentController.h 2007-07-02 18:54:04 UTC (rev 2409) @@ -45,6 +45,7 @@ extern NSString *SKNotesRTFDocumentType; extern NSString *SKNotesTextDocumentType; extern NSString *SKPostScriptDocumentType; +extern NSString *SKDVIDocumentType; @interface SKDocumentController : NSDocumentController Modified: trunk/SKDocumentController.m =================================================================== --- trunk/SKDocumentController.m 2007-07-01 19:00:41 UTC (rev 2408) +++ trunk/SKDocumentController.m 2007-07-02 18:54:04 UTC (rev 2409) @@ -46,6 +46,7 @@ NSString *SKNotesRTFDocumentType = @"Notes as RTF"; NSString *SKNotesTextDocumentType = @"Notes as Text"; NSString *SKPostScriptDocumentType = @"PostScript document"; +NSString *SKDVIDocumentType = @"DVI document"; @implementation SKDocumentController Modified: trunk/SKPSProgressController.h =================================================================== --- trunk/SKPSProgressController.h 2007-07-01 19:00:41 UTC (rev 2408) +++ trunk/SKPSProgressController.h 2007-07-02 18:54:04 UTC (rev 2409) @@ -48,3 +48,8 @@ - (NSData *)PDFDataWithPostScriptData:(NSData *)psData; - (IBAction)cancel:(id)sender; @end + + +@interface SKDVIProgressController : SKPSProgressController +- (NSData *)PDFDataWithDVIFile:(NSString *)dviFile; +@end Modified: trunk/SKPSProgressController.m =================================================================== --- trunk/SKPSProgressController.m 2007-07-01 19:00:41 UTC (rev 2408) +++ trunk/SKPSProgressController.m 2007-07-02 18:54:04 UTC (rev 2409) @@ -232,3 +232,46 @@ } @end + + +@implementation SKDVIProgressController + +- (NSData *)PDFDataWithDVIFile:(NSString *)dviFile { + NSData *psData = nil; + + NSString *dvipsPath = [[NSUserDefaults standardUserDefaults] stringForKey:@"SKDvipsBinaryPath"]; + NSFileManager *fm = [NSFileManager defaultManager]; + NSArray *paths = [NSArray arrayWithObjects:@"/usr/texbin", @"/usr/local/teTeX/bin/powerpc-apple-darwin-current", @"/sw/bin", @"/opt/local/bin", @"/usr/local/bin", nil]; + int i = 0, count = [paths count]; + + while ([fm isExecutableFileAtPath:dvipsPath] == NO) { + if (i < count) { + dvipsPath = [[paths objectAtIndex:i++] stringByAppendingPathComponent:@"dvips"]; + } else { + dvipsPath = nil; + break; + } + } + + if (dvipsPath && [fm fileExistsAtPath:dviFile]) { + NSTask *task = [[NSTask alloc] init]; + NSPipe *pipe = [NSPipe pipe]; + NSFileHandle *fileHandle = [pipe fileHandleForReading]; + + [task setLaunchPath:dvipsPath]; + [task setArguments:[NSArray arrayWithObjects:@"-q", @"-f", dviFile, nil]]; + [task setCurrentDirectoryPath:[dviFile stringByDeletingLastPathComponent]]; + [task setStandardError:[NSFileHandle fileHandleWithNullDevice]]; + [task setStandardOutput:pipe]; + + [task launch]; + + psData = [fileHandle readDataToEndOfFile]; + + [task release]; + } + + return [psData length] ? [self PDFDataWithPostScriptData:psData] : nil; +} + +@end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-01 19:00:45
|
Revision: 2408 http://skim-app.svn.sourceforge.net/skim-app/?rev=2408&view=rev Author: hofman Date: 2007-07-01 12:00:41 -0700 (Sun, 01 Jul 2007) Log Message: ----------- fix typo Modified Paths: -------------- trunk/SKDocument.m Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-07-01 19:00:13 UTC (rev 2407) +++ trunk/SKDocument.m 2007-07-01 19:00:41 UTC (rev 2408) @@ -1026,7 +1026,7 @@ } if ([fileExtensions containsObject:[extension lowercaseString]] == NO) { [command setScriptErrorNumber:NSArgumentsWrongScriptError]; - [command setScriptErrorString:[NSString stringWithFormat:@"Invalid file extension for this file type."]; + [command setScriptErrorString:[NSString stringWithFormat:@"Invalid file extension for this file type."]]; } else if (fileType) { if ([self saveToURL:fileURL ofType:fileType forSaveOperation:NSSaveToOperation error:NULL] == NO) { [command setScriptErrorNumber:NSInternalScriptError]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |