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-08-22 22:26:27
|
Revision: 2706 http://skim-app.svn.sourceforge.net/skim-app/?rev=2706&view=rev Author: hofman Date: 2007-08-22 15:26:26 -0700 (Wed, 22 Aug 2007) Log Message: ----------- Add quotes around type select string in status message. Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-08-22 19:53:29 UTC (rev 2705) +++ trunk/SKMainWindowController.m 2007-08-22 22:26:26 UTC (rev 2706) @@ -3577,7 +3577,7 @@ [self updateRightStatus]; } else if ([typeSelectHelper isEqual:[outlineView typeSelectHelper]]) { if (searchString) - [statusBar setLeftStringValue:[NSString stringWithFormat:NSLocalizedString(@"Finding: %@", @"Status message"), searchString]]; + [statusBar setLeftStringValue:[NSString stringWithFormat:NSLocalizedString(@"Finding: \"%@\"", @"Status message"), searchString]]; else [self updateLeftStatus]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-22 19:53:36
|
Revision: 2705 http://skim-app.svn.sourceforge.net/skim-app/?rev=2705&view=rev Author: hofman Date: 2007-08-22 12:53:29 -0700 (Wed, 22 Aug 2007) Log Message: ----------- Remove header file from target. Modified Paths: -------------- trunk/Skim.xcodeproj/project.pbxproj Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-08-22 19:50:59 UTC (rev 2704) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-08-22 19:53:29 UTC (rev 2705) @@ -129,7 +129,6 @@ CE5BD6740C7ADF1500EBDCF7 /* SKTypeSelectHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5BD6720C7ADF1500EBDCF7 /* SKTypeSelectHelper.m */; }; CE5BEA190C7C635400EBDCF7 /* NSGeometry_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5BEA170C7C635400EBDCF7 /* NSGeometry_SKExtensions.m */; }; CE5BF8010C7CBF6300EBDCF7 /* SKTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5BF7FF0C7CBF6300EBDCF7 /* SKTableView.m */; }; - CE5BF8420C7CC24A00EBDCF7 /* SKOutlineView.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE5BF8400C7CC24A00EBDCF7 /* SKOutlineView.h */; }; CE5BF8430C7CC24A00EBDCF7 /* SKOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5BF8410C7CC24A00EBDCF7 /* SKOutlineView.m */; }; CE5F42AF0BF89FE00069D89C /* AppleRemote.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5F42AD0BF89FE00069D89C /* AppleRemote.m */; }; CE5F43730BF8A3410069D89C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE5F42D30BF8A3400069D89C /* IOKit.framework */; }; @@ -260,7 +259,6 @@ dstSubfolderSpec = 10; files = ( CE2BD8450BD4135600A5F4DB /* Sparkle.framework in CopyFiles */, - CE5BF8420C7CC24A00EBDCF7 /* SKOutlineView.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-22 19:51:05
|
Revision: 2704 http://skim-app.svn.sourceforge.net/skim-app/?rev=2704&view=rev Author: hofman Date: 2007-08-22 12:50:59 -0700 (Wed, 22 Aug 2007) Log Message: ----------- Add files for outlineView base class. Added Paths: ----------- trunk/SKOutlineView.h trunk/SKOutlineView.m Added: trunk/SKOutlineView.h =================================================================== --- trunk/SKOutlineView.h (rev 0) +++ trunk/SKOutlineView.h 2007-08-22 19:50:59 UTC (rev 2704) @@ -0,0 +1,53 @@ +// +// SKOutlineView.h +// Skim +// +// Created by Christiaan Hofman on 8/22/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> + +@class SKTypeSelectHelper; + +@interface SKOutlineView : NSOutlineView { + SKTypeSelectHelper *typeSelectHelper; +} + +- (SKTypeSelectHelper *)typeSelectHelper; +- (void)setTypeSelectHelper:(SKTypeSelectHelper *)newTypeSelectHelper; + +- (void)scrollToBeginningOfDocument:(id)sender; +- (void)scrollToEndOfDocument:(id)sender; + +@end Added: trunk/SKOutlineView.m =================================================================== --- trunk/SKOutlineView.m (rev 0) +++ trunk/SKOutlineView.m 2007-08-22 19:50:59 UTC (rev 2704) @@ -0,0 +1,104 @@ +// +// SKOutlineView.m +// Skim +// +// Created by Christiaan Hofman on 8/22/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 "SKOutlineView.h" +#import "SKTypeSelectHelper.h" + + +@implementation SKOutlineView + +- (void)dealloc { + [typeSelectHelper setDataSource:nil]; + [typeSelectHelper release]; + [super dealloc]; +} + +- (SKTypeSelectHelper *)typeSelectHelper { + return typeSelectHelper; +} + +- (void)setTypeSelectHelper:(SKTypeSelectHelper *)newTypeSelectHelper { + if (typeSelectHelper != newTypeSelectHelper) { + [typeSelectHelper release]; + typeSelectHelper = [newTypeSelectHelper retain]; + } +} + +- (void)expandItem:(id)item expandChildren:(BOOL)collapseChildren { + [super expandItem:item expandChildren:collapseChildren]; + [typeSelectHelper rebuildTypeSelectSearchCache]; +} + +- (void)collapseItem:(id)item collapseChildren:(BOOL)collapseChildren { + [super collapseItem:item collapseChildren:collapseChildren]; + [typeSelectHelper rebuildTypeSelectSearchCache]; +} + +- (void)reloadData{ + [super reloadData]; + [typeSelectHelper rebuildTypeSelectSearchCache]; +} + +- (void)keyDown:(NSEvent *)theEvent { + NSString *characters = [theEvent charactersIgnoringModifiers]; + unichar eventChar = [characters length] > 0 ? [characters characterAtIndex:0] : 0; + unsigned modifierFlags = [theEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask; + + if (typeSelectHelper && modifierFlags == 0 && [[NSCharacterSet alphanumericCharacterSet] characterIsMember:eventChar]) + [typeSelectHelper processKeyDownCharacter:eventChar]; + else if (typeSelectHelper && modifierFlags == 0 && eventChar == '/') + [typeSelectHelper repeatSearch]; + else if (eventChar == NSHomeFunctionKey && (modifierFlags & ~NSFunctionKeyMask) == 0) + [self scrollToBeginningOfDocument:nil]; + else if (eventChar == NSEndFunctionKey && (modifierFlags & ~NSFunctionKeyMask) == 0) + [self scrollToEndOfDocument:nil]; + else + [super keyDown:theEvent]; +} + +- (void)scrollToBeginningOfDocument:(id)sender { + if ([self numberOfRows]) + [self scrollRowToVisible:0]; +} + +- (void)scrollToEndOfDocument:(id)sender { + if ([self numberOfRows]) + [self scrollRowToVisible:[self numberOfRows] - 1]; +} + +@end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-22 19:38:18
|
Revision: 2703 http://skim-app.svn.sourceforge.net/skim-app/?rev=2703&view=rev Author: hofman Date: 2007-08-22 12:38:17 -0700 (Wed, 22 Aug 2007) Log Message: ----------- Create custom tableView and outlineView base classes to hold typeSelectHelper and Home/End button. Partly instead of NSTableView category. Implement type-select for bookmarks and downloads. Modified Paths: -------------- trunk/Dutch.lproj/BookmarksWindow.nib/classes.nib trunk/Dutch.lproj/BookmarksWindow.nib/info.nib trunk/Dutch.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/Dutch.lproj/DownloadsWindow.nib/classes.nib trunk/Dutch.lproj/DownloadsWindow.nib/info.nib trunk/Dutch.lproj/DownloadsWindow.nib/keyedobjects.nib trunk/Dutch.lproj/MainWindow.nib/classes.nib trunk/Dutch.lproj/MainWindow.nib/data.dependency trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib trunk/Dutch.lproj/NotesDocument.nib/classes.nib trunk/Dutch.lproj/NotesDocument.nib/keyedobjects.nib trunk/English.lproj/BookmarksWindow.nib/classes.nib trunk/English.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/English.lproj/DownloadsWindow.nib/classes.nib trunk/English.lproj/DownloadsWindow.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/English.lproj/NotesDocument.nib/classes.nib trunk/English.lproj/NotesDocument.nib/keyedobjects.nib trunk/French.lproj/BookmarksWindow.nib/classes.nib trunk/French.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/French.lproj/DownloadsWindow.nib/classes.nib trunk/French.lproj/DownloadsWindow.nib/info.nib trunk/French.lproj/DownloadsWindow.nib/keyedobjects.nib trunk/French.lproj/MainWindow.nib/classes.nib trunk/French.lproj/MainWindow.nib/info.nib trunk/French.lproj/MainWindow.nib/keyedobjects.nib trunk/Italian.lproj/BookmarksWindow.nib/classes.nib trunk/Italian.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/Italian.lproj/DownloadsWindow.nib/classes.nib trunk/Italian.lproj/DownloadsWindow.nib/info.nib trunk/Italian.lproj/DownloadsWindow.nib/keyedobjects.nib trunk/Italian.lproj/MainWindow.nib/classes.nib trunk/Italian.lproj/MainWindow.nib/info.nib trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib trunk/Italian.lproj/NotesDocument.nib/classes.nib trunk/Italian.lproj/NotesDocument.nib/keyedobjects.nib trunk/SKBookmarkController.h trunk/SKBookmarkController.m trunk/SKDownloadController.h trunk/SKDownloadController.m trunk/SKFindTableView.h trunk/SKMainWindowController.h trunk/SKMainWindowController.m trunk/SKNoteOutlineView.h trunk/SKNoteOutlineView.m trunk/SKThumbnailTableView.h trunk/SKThumbnailTableView.m trunk/Skim.xcodeproj/project.pbxproj Added Paths: ----------- trunk/SKTableView.h trunk/SKTableView.m trunk/SKTocOutlineView.h trunk/SKTocOutlineView.m Removed Paths: ------------- trunk/NSTableView_SKExtensions.h trunk/NSTableView_SKExtensions.m trunk/SKOutlineView.h trunk/SKOutlineView.m Modified: trunk/Dutch.lproj/BookmarksWindow.nib/classes.nib =================================================================== --- trunk/Dutch.lproj/BookmarksWindow.nib/classes.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/Dutch.lproj/BookmarksWindow.nib/classes.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -2,12 +2,14 @@ IBClasses = ( {CLASS = BDSKGradientView; LANGUAGE = ObjC; SUPERCLASS = NSView; }, {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + {CLASS = SKBookmark; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { CLASS = SKBookmarkController; LANGUAGE = ObjC; - OUTLETS = {tableView = NSTableView; }; + OUTLETS = {tableView = SKTableView; }; SUPERCLASS = NSWindowController; - } + }, + {CLASS = SKTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; } ); IBVersion = 1; } \ No newline at end of file Modified: trunk/Dutch.lproj/BookmarksWindow.nib/info.nib =================================================================== --- trunk/Dutch.lproj/BookmarksWindow.nib/info.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/Dutch.lproj/BookmarksWindow.nib/info.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -6,6 +6,10 @@ <string>69 58 356 240 0 0 1440 938 </string> <key>IBFramework Version</key> <string>446.1</string> + <key>IBOpenObjects</key> + <array> + <integer>5</integer> + </array> <key>IBSystem Version</key> <string>8R218</string> </dict> Modified: trunk/Dutch.lproj/BookmarksWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Dutch.lproj/DownloadsWindow.nib/classes.nib =================================================================== --- trunk/Dutch.lproj/DownloadsWindow.nib/classes.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/Dutch.lproj/DownloadsWindow.nib/classes.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -7,6 +7,7 @@ LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + {CLASS = NSObject; LANGUAGE = ObjC; }, { ACTIONS = { cancelDownload = id; @@ -20,11 +21,17 @@ OUTLETS = { clearButton = NSButton; preferencesSheet = NSWindow; - tableView = NSTableView; + tableView = SKTableView; }; SUPERCLASS = NSWindowController; }, - {CLASS = SKProgressCell; LANGUAGE = ObjC; SUPERCLASS = NSTextFieldCell; } + {CLASS = SKProgressCell; LANGUAGE = ObjC; SUPERCLASS = NSTextFieldCell; }, + { + ACTIONS = {delete = id; scrollToBeginningOfDocument = id; scrollToEndOfDocument = id; }; + CLASS = SKTableView; + LANGUAGE = ObjC; + SUPERCLASS = NSTableView; + } ); IBVersion = 1; } \ No newline at end of file Modified: trunk/Dutch.lproj/DownloadsWindow.nib/info.nib =================================================================== --- trunk/Dutch.lproj/DownloadsWindow.nib/info.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/Dutch.lproj/DownloadsWindow.nib/info.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -8,6 +8,7 @@ <string>446.1</string> <key>IBOpenObjects</key> <array> + <integer>5</integer> <integer>30</integer> </array> <key>IBSystem Version</key> Modified: trunk/Dutch.lproj/DownloadsWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Dutch.lproj/MainWindow.nib/classes.nib =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/classes.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/Dutch.lproj/MainWindow.nib/classes.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -38,7 +38,7 @@ SUPERCLASS = NSTextFieldCell; }, {CLASS = SKColorSwatch; LANGUAGE = ObjC; SUPERCLASS = NSControl; }, - {CLASS = SKFindTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; }, + {CLASS = SKFindTableView; LANGUAGE = ObjC; SUPERCLASS = SKTableView; }, {CLASS = SKFullScreenWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; }, {CLASS = SKMainWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; }, { @@ -139,7 +139,7 @@ notePopUpButton = BDSKImagePopUpButton; noteSearchField = NSSearchField; noteView = NSView; - outlineView = NSOutlineView; + outlineView = SKTocOutlineView; ownerController = NSObjectController; pageNumberField = NSTextField; pageNumberStepper = NSStepper; @@ -176,25 +176,36 @@ }; SUPERCLASS = NSWindowController; }, - {CLASS = SKNoteOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; }, { - ACTIONS = {delete = id; }; - CLASS = SKNoteTableView; + ACTIONS = { + dismissNoteTypeSheet = id; + displayAllNoteTypes = id; + selectNoteTypes = id; + toggleDisplayNoteType = id; + }; + CLASS = SKNoteOutlineView; LANGUAGE = ObjC; - SUPERCLASS = NSTableView; + OUTLETS = {noteTypeMatrix = NSMatrix; noteTypeSheet = NSWindow; }; + SUPERCLASS = SKOutlineView; }, {CLASS = SKOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; }, {CLASS = SKPDFView; LANGUAGE = ObjC; SUPERCLASS = PDFView; }, {CLASS = SKSnapshotPageCell; LANGUAGE = ObjC; SUPERCLASS = NSTextFieldCell; }, - {CLASS = SKSnapshotTableView; LANGUAGE = ObjC; SUPERCLASS = SKNoteTableView; }, + { + CLASS = SKSnapshotTableView; + LANGUAGE = ObjC; + SUPERCLASS = SKThumbnailTableView; + }, {CLASS = SKSplitView; LANGUAGE = ObjC; SUPERCLASS = NSSplitView; }, + {CLASS = SKTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; }, { CLASS = SKThumbnail; LANGUAGE = ObjC; OUTLETS = {controller = id; }; SUPERCLASS = NSObject; }, - {CLASS = SKThumbnailTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; }, + {CLASS = SKThumbnailTableView; LANGUAGE = ObjC; SUPERCLASS = SKTableView; }, + {CLASS = SKTocOutlineView; LANGUAGE = ObjC; SUPERCLASS = SKOutlineView; }, {CLASS = SkimDocument; LANGUAGE = ObjC; SUPERCLASS = NSDocument; } ); IBVersion = 1; Modified: trunk/Dutch.lproj/MainWindow.nib/data.dependency =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/data.dependency 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/Dutch.lproj/MainWindow.nib/data.dependency 2007-08-22 19:38:17 UTC (rev 2703) @@ -4,7 +4,6 @@ <dict> <key>IBPaletteDependency</key> <array> - <string>Controllers</string> <string>PDFKit</string> </array> </dict> Modified: trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Dutch.lproj/NotesDocument.nib/classes.nib =================================================================== --- trunk/Dutch.lproj/NotesDocument.nib/classes.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/Dutch.lproj/NotesDocument.nib/classes.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -13,13 +13,30 @@ LANGUAGE = ObjC; SUPERCLASS = NSImageCell; }, - {CLASS = SKNoteOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; }, { + ACTIONS = { + dismissNoteTypeSheet = id; + displayAllNoteTypes = id; + selectNoteTypes = id; + toggleDisplayNoteType = id; + }; + CLASS = SKNoteOutlineView; + LANGUAGE = ObjC; + OUTLETS = {noteTypeMatrix = NSMatrix; noteTypeSheet = NSWindow; }; + SUPERCLASS = SKOutlineView; + }, + { ACTIONS = {openPDF = id; }; CLASS = SKNotesDocument; LANGUAGE = ObjC; OUTLETS = {arrayController = NSArrayController; outlineView = SKNoteOutlineView; }; SUPERCLASS = NSDocument; + }, + { + ACTIONS = {scrollToBeginningOfDocument = id; scrollToEndOfDocument = id; }; + CLASS = SKOutlineView; + LANGUAGE = ObjC; + SUPERCLASS = NSOutlineView; } ); IBVersion = 1; Modified: trunk/Dutch.lproj/NotesDocument.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/BookmarksWindow.nib/classes.nib =================================================================== --- trunk/English.lproj/BookmarksWindow.nib/classes.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/English.lproj/BookmarksWindow.nib/classes.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -2,12 +2,14 @@ IBClasses = ( {CLASS = BDSKGradientView; LANGUAGE = ObjC; SUPERCLASS = NSView; }, {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + {CLASS = SKBookmark; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { CLASS = SKBookmarkController; LANGUAGE = ObjC; - OUTLETS = {tableView = NSTableView; }; + OUTLETS = {tableView = SKTableView; }; SUPERCLASS = NSWindowController; - } + }, + {CLASS = SKTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; } ); IBVersion = 1; } \ No newline at end of file Modified: trunk/English.lproj/BookmarksWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/DownloadsWindow.nib/classes.nib =================================================================== --- trunk/English.lproj/DownloadsWindow.nib/classes.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/English.lproj/DownloadsWindow.nib/classes.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -7,6 +7,7 @@ LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + {CLASS = NSObject; LANGUAGE = ObjC; }, { ACTIONS = { cancelDownload = id; @@ -20,11 +21,17 @@ OUTLETS = { clearButton = NSButton; preferencesSheet = NSWindow; - tableView = NSTableView; + tableView = SKTableView; }; SUPERCLASS = NSWindowController; }, - {CLASS = SKProgressCell; LANGUAGE = ObjC; SUPERCLASS = NSTextFieldCell; } + {CLASS = SKProgressCell; LANGUAGE = ObjC; SUPERCLASS = NSTextFieldCell; }, + { + ACTIONS = {delete = id; scrollToBeginningOfDocument = id; scrollToEndOfDocument = id; }; + CLASS = SKTableView; + LANGUAGE = ObjC; + SUPERCLASS = NSTableView; + } ); IBVersion = 1; } \ No newline at end of file Modified: trunk/English.lproj/DownloadsWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/MainWindow.nib/classes.nib =================================================================== --- trunk/English.lproj/MainWindow.nib/classes.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/English.lproj/MainWindow.nib/classes.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -38,7 +38,7 @@ SUPERCLASS = NSTextFieldCell; }, {CLASS = SKColorSwatch; LANGUAGE = ObjC; SUPERCLASS = NSControl; }, - {CLASS = SKFindTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; }, + {CLASS = SKFindTableView; LANGUAGE = ObjC; SUPERCLASS = SKTableView; }, {CLASS = SKFullScreenWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; }, {CLASS = SKMainWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; }, { @@ -139,7 +139,7 @@ notePopUpButton = BDSKImagePopUpButton; noteSearchField = NSSearchField; noteView = NSView; - outlineView = NSOutlineView; + outlineView = SKTocOutlineView; ownerController = NSObjectController; pageNumberField = NSTextField; pageNumberStepper = NSStepper; @@ -176,25 +176,36 @@ }; SUPERCLASS = NSWindowController; }, - {CLASS = SKNoteOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; }, { - ACTIONS = {delete = id; }; - CLASS = SKNoteTableView; + ACTIONS = { + dismissNoteTypeSheet = id; + displayAllNoteTypes = id; + selectNoteTypes = id; + toggleDisplayNoteType = id; + }; + CLASS = SKNoteOutlineView; LANGUAGE = ObjC; - SUPERCLASS = NSTableView; + OUTLETS = {noteTypeMatrix = NSMatrix; noteTypeSheet = NSWindow; }; + SUPERCLASS = SKOutlineView; }, {CLASS = SKOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; }, {CLASS = SKPDFView; LANGUAGE = ObjC; SUPERCLASS = PDFView; }, {CLASS = SKSnapshotPageCell; LANGUAGE = ObjC; SUPERCLASS = NSTextFieldCell; }, - {CLASS = SKSnapshotTableView; LANGUAGE = ObjC; SUPERCLASS = SKNoteTableView; }, + { + CLASS = SKSnapshotTableView; + LANGUAGE = ObjC; + SUPERCLASS = SKThumbnailTableView; + }, {CLASS = SKSplitView; LANGUAGE = ObjC; SUPERCLASS = NSSplitView; }, + {CLASS = SKTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; }, { CLASS = SKThumbnail; LANGUAGE = ObjC; OUTLETS = {controller = id; }; SUPERCLASS = NSObject; }, - {CLASS = SKThumbnailTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; }, + {CLASS = SKThumbnailTableView; LANGUAGE = ObjC; SUPERCLASS = SKTableView; }, + {CLASS = SKTocOutlineView; LANGUAGE = ObjC; SUPERCLASS = SKOutlineView; }, {CLASS = SkimDocument; LANGUAGE = ObjC; SUPERCLASS = NSDocument; } ); IBVersion = 1; Modified: trunk/English.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/English.lproj/MainWindow.nib/info.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/English.lproj/MainWindow.nib/info.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -7,7 +7,7 @@ <key>IBEditorPositions</key> <dict> <key>168</key> - <string>601 495 237 265 0 0 1440 938 </string> + <string>601 508 237 265 0 0 1440 938 </string> <key>224</key> <string>610 420 220 442 0 0 1440 938 </string> <key>256</key> @@ -31,20 +31,20 @@ </array> <key>IBOpenObjects</key> <array> + <integer>256</integer> + <integer>5</integer> + <integer>208</integer> + <integer>694</integer> <integer>314</integer> + <integer>585</integer> + <integer>502</integer> <integer>633</integer> - <integer>511</integer> - <integer>539</integer> <integer>168</integer> - <integer>256</integer> - <integer>5</integer> - <integer>502</integer> - <integer>687</integer> <integer>224</integer> - <integer>585</integer> - <integer>694</integer> - <integer>208</integer> <integer>553</integer> + <integer>511</integer> + <integer>687</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/English.lproj/NotesDocument.nib/classes.nib =================================================================== --- trunk/English.lproj/NotesDocument.nib/classes.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/English.lproj/NotesDocument.nib/classes.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -13,13 +13,30 @@ LANGUAGE = ObjC; SUPERCLASS = NSImageCell; }, - {CLASS = SKNoteOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; }, { + ACTIONS = { + dismissNoteTypeSheet = id; + displayAllNoteTypes = id; + selectNoteTypes = id; + toggleDisplayNoteType = id; + }; + CLASS = SKNoteOutlineView; + LANGUAGE = ObjC; + OUTLETS = {noteTypeMatrix = NSMatrix; noteTypeSheet = NSWindow; }; + SUPERCLASS = SKOutlineView; + }, + { ACTIONS = {openPDF = id; }; CLASS = SKNotesDocument; LANGUAGE = ObjC; OUTLETS = {arrayController = NSArrayController; outlineView = SKNoteOutlineView; }; SUPERCLASS = NSDocument; + }, + { + ACTIONS = {scrollToBeginningOfDocument = id; scrollToEndOfDocument = id; }; + CLASS = SKOutlineView; + LANGUAGE = ObjC; + SUPERCLASS = NSOutlineView; } ); IBVersion = 1; Modified: trunk/English.lproj/NotesDocument.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/French.lproj/BookmarksWindow.nib/classes.nib =================================================================== --- trunk/French.lproj/BookmarksWindow.nib/classes.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/French.lproj/BookmarksWindow.nib/classes.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -2,12 +2,14 @@ IBClasses = ( {CLASS = BDSKGradientView; LANGUAGE = ObjC; SUPERCLASS = NSView; }, {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + {CLASS = SKBookmark; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { CLASS = SKBookmarkController; LANGUAGE = ObjC; - OUTLETS = {tableView = NSTableView; }; + OUTLETS = {tableView = SKTableView; }; SUPERCLASS = NSWindowController; - } + }, + {CLASS = SKTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; } ); IBVersion = 1; } \ No newline at end of file Modified: trunk/French.lproj/BookmarksWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/French.lproj/DownloadsWindow.nib/classes.nib =================================================================== --- trunk/French.lproj/DownloadsWindow.nib/classes.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/French.lproj/DownloadsWindow.nib/classes.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -7,6 +7,7 @@ LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + {CLASS = NSObject; LANGUAGE = ObjC; }, { ACTIONS = { cancelDownload = id; @@ -20,11 +21,17 @@ OUTLETS = { clearButton = NSButton; preferencesSheet = NSWindow; - tableView = NSTableView; + tableView = SKTableView; }; SUPERCLASS = NSWindowController; }, - {CLASS = SKProgressCell; LANGUAGE = ObjC; SUPERCLASS = NSTextFieldCell; } + {CLASS = SKProgressCell; LANGUAGE = ObjC; SUPERCLASS = NSTextFieldCell; }, + { + ACTIONS = {delete = id; scrollToBeginningOfDocument = id; scrollToEndOfDocument = id; }; + CLASS = SKTableView; + LANGUAGE = ObjC; + SUPERCLASS = NSTableView; + } ); IBVersion = 1; } \ No newline at end of file Modified: trunk/French.lproj/DownloadsWindow.nib/info.nib =================================================================== --- trunk/French.lproj/DownloadsWindow.nib/info.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/French.lproj/DownloadsWindow.nib/info.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -8,8 +8,8 @@ <string>446.1</string> <key>IBOpenObjects</key> <array> + <integer>30</integer> <integer>5</integer> - <integer>30</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/French.lproj/DownloadsWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/French.lproj/MainWindow.nib/classes.nib =================================================================== --- trunk/French.lproj/MainWindow.nib/classes.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/French.lproj/MainWindow.nib/classes.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -38,7 +38,7 @@ SUPERCLASS = NSTextFieldCell; }, {CLASS = SKColorSwatch; LANGUAGE = ObjC; SUPERCLASS = NSControl; }, - {CLASS = SKFindTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; }, + {CLASS = SKFindTableView; LANGUAGE = ObjC; SUPERCLASS = SKTableView; }, {CLASS = SKFullScreenWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; }, {CLASS = SKMainWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; }, { @@ -139,7 +139,7 @@ notePopUpButton = BDSKImagePopUpButton; noteSearchField = NSSearchField; noteView = NSView; - outlineView = NSOutlineView; + outlineView = SKTocOutlineView; ownerController = NSObjectController; pageNumberField = NSTextField; pageNumberStepper = NSStepper; @@ -176,25 +176,36 @@ }; SUPERCLASS = NSWindowController; }, - {CLASS = SKNoteOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; }, { - ACTIONS = {delete = id; }; - CLASS = SKNoteTableView; + ACTIONS = { + dismissNoteTypeSheet = id; + displayAllNoteTypes = id; + selectNoteTypes = id; + toggleDisplayNoteType = id; + }; + CLASS = SKNoteOutlineView; LANGUAGE = ObjC; - SUPERCLASS = NSTableView; + OUTLETS = {noteTypeMatrix = NSMatrix; noteTypeSheet = NSWindow; }; + SUPERCLASS = SKOutlineView; }, {CLASS = SKOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; }, {CLASS = SKPDFView; LANGUAGE = ObjC; SUPERCLASS = PDFView; }, {CLASS = SKSnapshotPageCell; LANGUAGE = ObjC; SUPERCLASS = NSTextFieldCell; }, - {CLASS = SKSnapshotTableView; LANGUAGE = ObjC; SUPERCLASS = SKNoteTableView; }, + { + CLASS = SKSnapshotTableView; + LANGUAGE = ObjC; + SUPERCLASS = SKThumbnailTableView; + }, {CLASS = SKSplitView; LANGUAGE = ObjC; SUPERCLASS = NSSplitView; }, + {CLASS = SKTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; }, { CLASS = SKThumbnail; LANGUAGE = ObjC; OUTLETS = {controller = id; }; SUPERCLASS = NSObject; }, - {CLASS = SKThumbnailTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; }, + {CLASS = SKThumbnailTableView; LANGUAGE = ObjC; SUPERCLASS = SKTableView; }, + {CLASS = SKTocOutlineView; LANGUAGE = ObjC; SUPERCLASS = SKOutlineView; }, {CLASS = SkimDocument; LANGUAGE = ObjC; SUPERCLASS = NSDocument; } ); IBVersion = 1; Modified: trunk/French.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/French.lproj/MainWindow.nib/info.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/French.lproj/MainWindow.nib/info.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -7,7 +7,7 @@ <key>IBEditorPositions</key> <dict> <key>168</key> - <string>601 493 237 267 0 0 1440 938 </string> + <string>601 507 237 267 0 0 1440 938 </string> <key>224</key> <string>610 420 220 442 0 0 1440 938 </string> <key>256</key> @@ -31,16 +31,16 @@ </array> <key>IBOpenObjects</key> <array> + <integer>224</integer> + <integer>661</integer> <integer>511</integer> <integer>168</integer> + <integer>633</integer> <integer>314</integer> + <integer>660</integer> + <integer>502</integer> <integer>5</integer> - <integer>661</integer> <integer>256</integer> - <integer>660</integer> - <integer>633</integer> - <integer>502</integer> - <integer>224</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/French.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/BookmarksWindow.nib/classes.nib =================================================================== --- trunk/Italian.lproj/BookmarksWindow.nib/classes.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/Italian.lproj/BookmarksWindow.nib/classes.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -2,12 +2,14 @@ IBClasses = ( {CLASS = BDSKGradientView; LANGUAGE = ObjC; SUPERCLASS = NSView; }, {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + {CLASS = SKBookmark; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { CLASS = SKBookmarkController; LANGUAGE = ObjC; - OUTLETS = {tableView = NSTableView; }; + OUTLETS = {tableView = SKTableView; }; SUPERCLASS = NSWindowController; - } + }, + {CLASS = SKTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; } ); IBVersion = 1; } \ No newline at end of file Modified: trunk/Italian.lproj/BookmarksWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/DownloadsWindow.nib/classes.nib =================================================================== --- trunk/Italian.lproj/DownloadsWindow.nib/classes.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/Italian.lproj/DownloadsWindow.nib/classes.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -7,6 +7,7 @@ LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + {CLASS = NSObject; LANGUAGE = ObjC; }, { ACTIONS = { cancelDownload = id; @@ -20,11 +21,17 @@ OUTLETS = { clearButton = NSButton; preferencesSheet = NSWindow; - tableView = NSTableView; + tableView = SKTableView; }; SUPERCLASS = NSWindowController; }, - {CLASS = SKProgressCell; LANGUAGE = ObjC; SUPERCLASS = NSTextFieldCell; } + {CLASS = SKProgressCell; LANGUAGE = ObjC; SUPERCLASS = NSTextFieldCell; }, + { + ACTIONS = {delete = id; scrollToBeginningOfDocument = id; scrollToEndOfDocument = id; }; + CLASS = SKTableView; + LANGUAGE = ObjC; + SUPERCLASS = NSTableView; + } ); IBVersion = 1; } \ No newline at end of file Modified: trunk/Italian.lproj/DownloadsWindow.nib/info.nib =================================================================== --- trunk/Italian.lproj/DownloadsWindow.nib/info.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/Italian.lproj/DownloadsWindow.nib/info.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -8,8 +8,8 @@ <string>446.1</string> <key>IBOpenObjects</key> <array> + <integer>30</integer> <integer>5</integer> - <integer>30</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/Italian.lproj/DownloadsWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/MainWindow.nib/classes.nib =================================================================== --- trunk/Italian.lproj/MainWindow.nib/classes.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/Italian.lproj/MainWindow.nib/classes.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -38,7 +38,7 @@ SUPERCLASS = NSTextFieldCell; }, {CLASS = SKColorSwatch; LANGUAGE = ObjC; SUPERCLASS = NSControl; }, - {CLASS = SKFindTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; }, + {CLASS = SKFindTableView; LANGUAGE = ObjC; SUPERCLASS = SKTableView; }, {CLASS = SKFullScreenWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; }, {CLASS = SKMainWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; }, { @@ -139,7 +139,7 @@ notePopUpButton = BDSKImagePopUpButton; noteSearchField = NSSearchField; noteView = NSView; - outlineView = NSOutlineView; + outlineView = SKTocOutlineView; ownerController = NSObjectController; pageNumberField = NSTextField; pageNumberStepper = NSStepper; @@ -176,25 +176,36 @@ }; SUPERCLASS = NSWindowController; }, - {CLASS = SKNoteOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; }, { - ACTIONS = {delete = id; }; - CLASS = SKNoteTableView; + ACTIONS = { + dismissNoteTypeSheet = id; + displayAllNoteTypes = id; + selectNoteTypes = id; + toggleDisplayNoteType = id; + }; + CLASS = SKNoteOutlineView; LANGUAGE = ObjC; - SUPERCLASS = NSTableView; + OUTLETS = {noteTypeMatrix = NSMatrix; noteTypeSheet = NSWindow; }; + SUPERCLASS = SKOutlineView; }, {CLASS = SKOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; }, {CLASS = SKPDFView; LANGUAGE = ObjC; SUPERCLASS = PDFView; }, {CLASS = SKSnapshotPageCell; LANGUAGE = ObjC; SUPERCLASS = NSTextFieldCell; }, - {CLASS = SKSnapshotTableView; LANGUAGE = ObjC; SUPERCLASS = SKNoteTableView; }, + { + CLASS = SKSnapshotTableView; + LANGUAGE = ObjC; + SUPERCLASS = SKThumbnailTableView; + }, {CLASS = SKSplitView; LANGUAGE = ObjC; SUPERCLASS = NSSplitView; }, + {CLASS = SKTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; }, { CLASS = SKThumbnail; LANGUAGE = ObjC; OUTLETS = {controller = id; }; SUPERCLASS = NSObject; }, - {CLASS = SKThumbnailTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; }, + {CLASS = SKThumbnailTableView; LANGUAGE = ObjC; SUPERCLASS = SKTableView; }, + {CLASS = SKTocOutlineView; LANGUAGE = ObjC; SUPERCLASS = SKOutlineView; }, {CLASS = SkimDocument; LANGUAGE = ObjC; SUPERCLASS = NSDocument; } ); IBVersion = 1; Modified: trunk/Italian.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Italian.lproj/MainWindow.nib/info.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/Italian.lproj/MainWindow.nib/info.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -7,7 +7,7 @@ <key>IBEditorPositions</key> <dict> <key>168</key> - <string>601 493 237 267 0 0 1440 938 </string> + <string>601 507 237 267 0 0 1440 938 </string> <key>224</key> <string>610 420 220 442 0 0 1440 938 </string> <key>256</key> @@ -31,19 +31,19 @@ </array> <key>IBOpenObjects</key> <array> - <integer>511</integer> - <integer>314</integer> + <integer>539</integer> + <integer>628</integer> + <integer>677</integer> + <integer>5</integer> + <integer>676</integer> + <integer>502</integer> + <integer>553</integer> <integer>208</integer> <integer>224</integer> - <integer>502</integer> + <integer>314</integer> <integer>256</integer> - <integer>628</integer> - <integer>676</integer> - <integer>677</integer> - <integer>553</integer> + <integer>511</integer> <integer>168</integer> - <integer>539</integer> - <integer>5</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/NotesDocument.nib/classes.nib =================================================================== --- trunk/Italian.lproj/NotesDocument.nib/classes.nib 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/Italian.lproj/NotesDocument.nib/classes.nib 2007-08-22 19:38:17 UTC (rev 2703) @@ -13,13 +13,30 @@ LANGUAGE = ObjC; SUPERCLASS = NSImageCell; }, - {CLASS = SKNoteOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; }, { + ACTIONS = { + dismissNoteTypeSheet = id; + displayAllNoteTypes = id; + selectNoteTypes = id; + toggleDisplayNoteType = id; + }; + CLASS = SKNoteOutlineView; + LANGUAGE = ObjC; + OUTLETS = {noteTypeMatrix = NSMatrix; noteTypeSheet = NSWindow; }; + SUPERCLASS = SKOutlineView; + }, + { ACTIONS = {openPDF = id; }; CLASS = SKNotesDocument; LANGUAGE = ObjC; OUTLETS = {arrayController = NSArrayController; outlineView = SKNoteOutlineView; }; SUPERCLASS = NSDocument; + }, + { + ACTIONS = {scrollToBeginningOfDocument = id; scrollToEndOfDocument = id; }; + CLASS = SKOutlineView; + LANGUAGE = ObjC; + SUPERCLASS = NSOutlineView; } ); IBVersion = 1; Modified: trunk/Italian.lproj/NotesDocument.nib/keyedobjects.nib =================================================================== (Binary files differ) Deleted: trunk/NSTableView_SKExtensions.h =================================================================== --- trunk/NSTableView_SKExtensions.h 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/NSTableView_SKExtensions.h 2007-08-22 19:38:17 UTC (rev 2703) @@ -1,51 +0,0 @@ -// -// NSTableView_SKExtensions.h -// Skim -// -// Created by Christiaan Hofman on 8/20/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> - - -@interface NSTableView (SKExtensions) -- (BOOL)canDelete; -- (void)delete:(id)sender; -@end - - -@interface NSObject (NSTableViewSKExtendedDelegate) -- (void)tableView:(NSTableView *)aTableView deleteRowsWithIndexes:(NSIndexSet *)rowIndexes; -- (BOOL)tableView:(NSTableView *)aTableView canDeleteRowsWithIndexes:(NSIndexSet *)rowIndexes; -@end Deleted: trunk/NSTableView_SKExtensions.m =================================================================== --- trunk/NSTableView_SKExtensions.m 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/NSTableView_SKExtensions.m 2007-08-22 19:38:17 UTC (rev 2703) @@ -1,101 +0,0 @@ -// -// NSTableView_SKExtensions.m -// Skim -// -// Created by Christiaan Hofman on 8/20/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 "NSTableView_SKExtensions.h" -#import "OBUtilities.h" - - -@interface NSTableView (SKPrivateExtensions) -- (void)replacementKeyDown:(NSEvent *)theEvent; -@end - -@implementation NSTableView (SKExtensions) - -static IMP originalKeyDown = NULL; - -+ (void)load { - originalKeyDown = OBReplaceMethodImplementationWithSelector(self, @selector(keyDown:), @selector(replacementKeyDown:)); -} - -- (void)scrollToBeginningOfDocument:(id)sender { - if ([self numberOfRows]) - [self scrollRowToVisible:0]; -} - -- (void)scrollToEndOfDocument:(id)sender { - if ([self numberOfRows]) - [self scrollRowToVisible:[self numberOfRows] - 1]; -} - -- (void)replacementKeyDown:(NSEvent *)theEvent { - NSString *characters = [theEvent charactersIgnoringModifiers]; - unichar eventChar = [characters length] > 0 ? [characters characterAtIndex:0] : 0; - unsigned modifierFlags = [theEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask; - - if ((eventChar == NSDeleteCharacter || eventChar == NSDeleteFunctionKey) && modifierFlags == 0 && [self canDelete]) - [self delete:self]; - else if (eventChar == NSHomeFunctionKey && (modifierFlags & ~NSFunctionKeyMask) == 0) - [self scrollToBeginningOfDocument:nil]; - else if (eventChar == NSEndFunctionKey && (modifierFlags & ~NSFunctionKeyMask) == 0) - [self scrollToEndOfDocument:nil]; - else - originalKeyDown(self, _cmd, theEvent); -} - -- (BOOL)canDelete { - NSIndexSet *indexes = [self selectedRowIndexes]; - return [indexes count] && - [[self delegate] respondsToSelector:@selector(tableView:canDeleteRowsWithIndexes:)] && - [[self delegate] respondsToSelector:@selector(tableView:deleteRowsWithIndexes:)] && - [[self delegate] tableView:self canDeleteRowsWithIndexes:indexes]; -} - -- (void)delete:(id)sender { - if ([self canDelete]) - [[self delegate] tableView:self deleteRowsWithIndexes:[self selectedRowIndexes]]; - else - NSBeep(); -} - -- (BOOL)validateMenuItem:(NSMenuItem *)menuItem { - if ([menuItem action] == @selector(delete:)) - return [self canDelete]; - return YES; -} - -@end Modified: trunk/SKBookmarkController.h =================================================================== --- trunk/SKBookmarkController.h 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/SKBookmarkController.h 2007-08-22 19:38:17 UTC (rev 2703) @@ -38,9 +38,10 @@ #import <Cocoa/Cocoa.h> +@class SKTableView; @interface SKBookmarkController : NSWindowController { - IBOutlet NSTableView *tableView; + IBOutlet SKTableView *tableView; NSMutableArray *bookmarks; NSMutableArray *recentDocuments; NSUndoManager *undoManager; Modified: trunk/SKBookmarkController.m =================================================================== --- trunk/SKBookmarkController.m 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/SKBookmarkController.m 2007-08-22 19:38:17 UTC (rev 2703) @@ -41,7 +41,8 @@ #import "SKDocument.h" #import "SKMainWindowController.h" #import "Files_SKExtensions.h" -#import "NSTableView_SKExtensions.h" +#import "SKTableView.h" +#import "SKTypeSelectHelper.h" static NSString *SKBookmarkRowsPboardType = @"SKBookmarkRowsPboardType"; static NSString *SKBookmarkChangedNotification = @"SKBookmarkChangedNotification"; @@ -111,6 +112,11 @@ - (void)windowDidLoad { [self setWindowFrameAutosaveName:@"SKBookmarksWindow"]; + + SKTypeSelectHelper *typeSelectHelper = [[[SKTypeSelectHelper alloc] init] autorelease]; + [typeSelectHelper setDataSource:self]; + [tableView setTypeSelectHelper:typeSelectHelper]; + [tableView registerForDraggedTypes:[NSArray arrayWithObjects:SKBookmarkRowsPboardType, nil]]; } @@ -350,6 +356,20 @@ return YES; } +#pragma mark SKTypeSelectHelper datasource protocol + +- (NSArray *)typeSelectHelperSelectionItems:(SKTypeSelectHelper *)typeSelectHelper { + return [bookmarks valueForKey:@"label"]; +} + +- (unsigned int)typeSelectHelperCurrentlySelectedIndex:(SKTypeSelectHelper *)typeSelectHelper { + return [[tableView selectedRowIndexes] lastIndex]; +} + +- (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper selectItemAtIndex:(unsigned int)itemIndex { + [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:itemIndex] byExtendingSelection:NO]; +} + @end #pragma mark - Modified: trunk/SKDownloadController.h =================================================================== --- trunk/SKDownloadController.h 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/SKDownloadController.h 2007-08-22 19:38:17 UTC (rev 2703) @@ -38,9 +38,10 @@ #import <Cocoa/Cocoa.h> +@class SKTableView; @interface SKDownloadController : NSWindowController { - IBOutlet NSTableView *tableView; + IBOutlet SKTableView *tableView; IBOutlet NSButton *clearButton; IBOutlet NSWindow *preferencesSheet; NSMutableArray *downloads; Modified: trunk/SKDownloadController.m =================================================================== --- trunk/SKDownloadController.m 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/SKDownloadController.m 2007-08-22 19:38:17 UTC (rev 2703) @@ -41,6 +41,8 @@ #import "SKProgressCell.h" #import "NSURL_SKExtensions.h" #import "SKStringConstants.h" +#import "SKTableView.h" +#import "SKTypeSelectHelper.h" @implementation SKDownloadController @@ -89,6 +91,11 @@ - (void)windowDidLoad { [self setWindowFrameAutosaveName:@"SKDownloadsWindow"]; [self updateButtons]; + + SKTypeSelectHelper *typeSelectHelper = [[[SKTypeSelectHelper alloc] init] autorelease]; + [typeSelectHelper setDataSource:self]; + [tableView setTypeSelectHelper:typeSelectHelper]; + [tableView registerForDraggedTypes:[NSArray arrayWithObjects:NSURLPboardType, SKWeblocFilePboardType, NSStringPboardType, nil]]; } @@ -299,4 +306,18 @@ return toolTip; } +#pragma mark SKTypeSelectHelper datasource protocol + +- (NSArray *)typeSelectHelperSelectionItems:(SKTypeSelectHelper *)typeSelectHelper { + return [downloads valueForKeyPath:@"fileName"]; +} + +- (unsigned int)typeSelectHelperCurrentlySelectedIndex:(SKTypeSelectHelper *)typeSelectHelper { + return [[tableView selectedRowIndexes] lastIndex]; +} + +- (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper selectItemAtIndex:(unsigned int)itemIndex { + [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:itemIndex] byExtendingSelection:NO]; +} + @end Modified: trunk/SKFindTableView.h =================================================================== --- trunk/SKFindTableView.h 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/SKFindTableView.h 2007-08-22 19:38:17 UTC (rev 2703) @@ -8,9 +8,10 @@ #import <Cocoa/Cocoa.h> #import <Carbon/Carbon.h> +#import "SKTableView.h" -@interface SKFindTableView : NSTableView { +@interface SKFindTableView : SKTableView { CFMutableArrayRef trackingRects; } @end Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/SKMainWindowController.h 2007-08-22 19:38:17 UTC (rev 2703) @@ -64,7 +64,7 @@ } SKPDFViewState; @class PDFOutline, SKThumbnail; -@class SKPDFView, SKOutlineView, SKNoteOutlineView, SKThumbnailTableView, SKSnapshotTableView, SKSplitView, BDSKCollapsibleView, BDSKEdgeView, BDSKGradientView, BDSKImagePopUpButton, SKColorSwatch, SKStatusBar; +@class SKPDFView, SKTocOutlineView, SKNoteOutlineView, SKThumbnailTableView, SKSnapshotTableView, SKSplitView, BDSKCollapsibleView, BDSKEdgeView, BDSKGradientView, BDSKImagePopUpButton, SKColorSwatch, SKStatusBar; @class SKFullScreenWindow, SKNavigationWindow, SKSideWindow, SKSnapshotWindowController; @interface SKMainWindowController : NSWindowController { @@ -97,7 +97,7 @@ SKStatusBar *statusBar; - IBOutlet SKOutlineView *outlineView; + IBOutlet SKTocOutlineView *outlineView; IBOutlet NSView *tocView; PDFOutline *pdfOutline; NSMutableArray *pdfOutlineItems; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/SKMainWindowController.m 2007-08-22 19:38:17 UTC (rev 2703) @@ -61,7 +61,7 @@ #import "NSScrollView_SKExtensions.h" #import "NSBezierPath_BDSKExtensions.h" #import "NSUserDefaultsController_SKExtensions.h" -#import "SKOutlineView.h" +#import "SKTocOutlineView.h" #import "SKNoteOutlineView.h" #import "SKThumbnailTableView.h" #import "SKFindTableView.h" @@ -376,6 +376,7 @@ // typeSelectHelpers SKTypeSelectHelper *typeSelectHelper = [[[SKTypeSelectHelper alloc] init] autorelease]; [typeSelectHelper setMatchesImmediately:NO]; + [typeSelectHelper setCyclesSimilarResults:NO]; [typeSelectHelper setMatchOption:SKFullStringMatch]; [typeSelectHelper setDataSource:self]; [thumbnailTableView setTypeSelectHelper:typeSelectHelper]; Modified: trunk/SKNoteOutlineView.h =================================================================== --- trunk/SKNoteOutlineView.h 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/SKNoteOutlineView.h 2007-08-22 19:38:17 UTC (rev 2703) @@ -37,13 +37,12 @@ */ #import <Cocoa/Cocoa.h> +#import "SKOutlineView.h"; -@class SKTypeSelectHelper; -@interface SKNoteOutlineView : NSOutlineView { +@interface SKNoteOutlineView : SKOutlineView { IBOutlet NSWindow *noteTypeSheet; IBOutlet NSMatrix *noteTypeMatrix; - SKTypeSelectHelper *typeSelectHelper; } - (NSArray *)noteTypes; @@ -55,9 +54,6 @@ - (IBAction)selectNoteTypes:(id)sender; - (IBAction)dismissNoteTypeSheet:(id)sender; -- (SKTypeSelectHelper *)typeSelectHelper; -- (void)setTypeSelectHelper:(SKTypeSelectHelper *)newTypeSelectHelper; - @end Modified: trunk/SKNoteOutlineView.m =================================================================== --- trunk/SKNoteOutlineView.m 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/SKNoteOutlineView.m 2007-08-22 19:38:17 UTC (rev 2703) @@ -45,8 +45,6 @@ @implementation SKNoteOutlineView - (void)dealloc { - [typeSelectHelper setDataSource:nil]; - [typeSelectHelper release]; [noteTypeSheet release]; [super dealloc]; } @@ -55,22 +53,6 @@ [self noteTypeMenu]; // this sets the menu for the header view } -- (SKTypeSelectHelper *)typeSelectHelper { - return typeSelectHelper; -} - -- (void)setTypeSelectHelper:(SKTypeSelectHelper *)newTypeSelectHelper { - if (typeSelectHelper != newTypeSelectHelper) { - [typeSelectHelper release]; - typeSelectHelper = [newTypeSelectHelper retain]; - } -} - -- (void)reloadData{ - [super reloadData]; - [typeSelectHelper rebuildTypeSelectSearchCache]; -} - - (void)delete:(id)sender { if ([[self delegate] respondsToSelector:@selector(outlineViewDeleteSelectedRows:)]) { if ([[self selectedRowIndexes] count] == 0) @@ -87,10 +69,6 @@ if ((eventChar == NSDeleteCharacter || eventChar == NSDeleteFunctionKey) && modifiers == 0) [self delete:self]; - else if (typeSelectHelper && modifiers == 0 && [[NSCharacterSet alphanumericCharacterSet] characterIsMember:eventChar]) - [typeSelectHelper processKeyDownCharacter:eventChar]; - else if (typeSelectHelper && modifiers == 0 && eventChar == '/') - [typeSelectHelper repeatSearch]; else [super keyDown:theEvent]; } Deleted: trunk/SKOutlineView.h =================================================================== --- trunk/SKOutlineView.h 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/SKOutlineView.h 2007-08-22 19:38:17 UTC (rev 2703) @@ -1,60 +0,0 @@ -// -// SKOutlineView.h -// Skim -// -// Created by Christiaan Hofman on 2/25/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> -#import <Carbon/Carbon.h> - -@class SKTypeSelectHelper; - -@interface SKOutlineView : NSOutlineView { - CFMutableArrayRef trackingRects; - SKTypeSelectHelper *typeSelectHelper; -} - -- (SKTypeSelectHelper *)typeSelectHelper; -- (void)setTypeSelectHelper:(SKTypeSelectHelper *)newTypeSelectHelper; - -@end - - -@interface NSObject (SKOutlineViewDelegate) -- (NSArray *)outlineViewHighlightedRows:(NSOutlineView *)anOutlineView; -- (BOOL)outlineView:(NSOutlineView *)anOutlineView shouldTrackTableColumn:(NSTableColumn *)aTableColumn item:(id)item; -- (void)outlineView:(NSOutlineView *)anOutlineView mouseEnteredTableColumn:(NSTableColumn *)aTableColumn item:(id)item; -- (void)outlineView:(NSOutlineView *)anOutlineView mouseExitedTableColumn:(NSTableColumn *)aTableColumn item:(id)item; -@end Deleted: trunk/SKOutlineView.m =================================================================== --- trunk/SKOutlineView.m 2007-08-22 16:40:50 UTC (rev 2702) +++ trunk/SKOutlineView.m 2007-08-22 19:38:17 UTC (rev 2703) @@ -1,210 +0,0 @@ -// -// SKOutlineView.m -// Skim -// -// Created by Christiaan Hofman on 2/25/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 "SKOutlineView.h" -#import "SKTypeSelectHelper.h" - - -@implementation SKOutlineView - -- (void)dealloc { - if (trackingRects != NULL) - CFRelease(trackingRects); - [typeSelectHelper setDataSource:nil]; - [typeSelectHelper release]; - [super dealloc]; -} - -- (SKTypeSelectHelper *)typeSelectHelper { - return typeSelectHelper; -} - -- (void)setTypeSelectHelper:(SKTypeSelectHelper *)newTypeSelectHelper { - if (typeSelectHelper != newTypeSelectHelper) { - [typeSelectHelper release]; - typeSelectHelper = [newTypeSelectHelper retain]; - } -} - -- (void)highlightSelectionInClipRect:(NSRect)clipRect { - if ([[self delegate] respondsToSelector:@selector(outlineViewHighlightedRows:)]) { - NSMutableIndexSet *rowIndexes = [[[self selectedRowIndexes] mutableCopy] autorelease]; - NSArray *rows = [[self delegate] outlineViewHighlightedRows:self]; - NSColor *color = ([[self window] isKeyWindow] && [[self window] firstResponder] == self) ? [NSColor alternateSelectedControlColor] : [NSColor secondarySelectedControlColor]; - float factor = 0.5; - int i, count = [rows count]; - - [NSGraphicsContext saveGraphicsState]; - for (i = 0; i < count; i++) { - int row = [[rows objectAtIndex:i] intValue]; - [[[NSColor controlBackgroundColor] blendedColorWithFraction:factor ofColor:color] set]; - factor -= 0.1; - if ([rowIndexes containsIndex:row] == NO) { - NSRectFill([self rectOfRow:row]); - [rowIndexes addIndex:row]; - } - if (factor <= 0.0) break; - } - [NSGraphicsContext restoreGraphicsState]; - } - [super highlightSelectionInClipRect:clipRect]; -} - -- (void)removeTrackingRects { - if (trackingRects) { - CFIndex idx = CFArrayGetCount(trackingRects); - while(idx--) - [self removeTrackingRect:(NSTrackingRectTag)CFArrayGetValueAtIndex(trackingRects, idx)]; - CFArrayRemoveAllValues(trackingRects); - } -} - -- (void)rebuildTrackingRects { - if ([[self delegate] respondsToSelector:@selector(outlineView:shouldTrackTableColumn:item:)] == NO) - return; - - if (trackingRects == nil) - trackingRects = CFArrayCreateMutable(kCFAllocatorDefault, 0, NULL); - else - [self removeTrackingRects]; - - NSRange rowRange = [self rowsInRect:[self visibleRect]]; - NSRange columnRange = [self columnsInRect:[self visibleRect]]; - unsigned int row, column; - NSTableColumn *tableColumn; - int userData; - NSTrackingRectTag tag; - - for (column = columnRange.location; column < NSMaxRange(columnRange); column++) { - ... [truncated message content] |
From: <ho...@us...> - 2007-08-22 16:40:52
|
Revision: 2702 http://skim-app.svn.sourceforge.net/skim-app/?rev=2702&view=rev Author: hofman Date: 2007-08-22 09:40:50 -0700 (Wed, 22 Aug 2007) Log Message: ----------- Implement type-select for the TOC outlineView. Don't update outline selection when the outline selection changes. Reset tracking rects in outline views when items expand or collapse, as Apple does not call resetCursorRects in those cases. Modified Paths: -------------- trunk/SKMainWindowController.h trunk/SKMainWindowController.m trunk/SKNoteOutlineView.m trunk/SKOutlineView.h trunk/SKOutlineView.m trunk/SKTypeSelectHelper.m Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2007-08-22 15:02:59 UTC (rev 2701) +++ trunk/SKMainWindowController.h 2007-08-22 16:40:50 UTC (rev 2702) @@ -97,7 +97,7 @@ SKStatusBar *statusBar; - IBOutlet NSOutlineView *outlineView; + IBOutlet SKOutlineView *outlineView; IBOutlet NSView *tocView; PDFOutline *pdfOutline; NSMutableArray *pdfOutlineItems; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-08-22 15:02:59 UTC (rev 2701) +++ trunk/SKMainWindowController.m 2007-08-22 16:40:50 UTC (rev 2702) @@ -385,6 +385,11 @@ [typeSelectHelper setDataSource:self]; [noteOutlineView setTypeSelectHelper:typeSelectHelper]; + typeSelectHelper = [[[SKTypeSelectHelper alloc] init] autorelease]; + [typeSelectHelper setMatchOption:SKSubstringMatch]; + [typeSelectHelper setDataSource:self]; + [outlineView setTypeSelectHelper:typeSelectHelper]; + // This update toolbar item and other states [self handleChangedHistoryNotification:nil]; [self handlePageChangedNotification:nil]; @@ -3169,7 +3174,9 @@ - (void)outlineViewSelectionDidChange:(NSNotification *)notification{ // Get the destination associated with the search result list. Tell the PDFView to go there. if ([[notification object] isEqual:outlineView] && (updatingOutlineSelection == NO)){ + updatingOutlineSelection = YES; [pdfView goToDestination: [[outlineView itemAtRow: [outlineView selectedRow]] destination]]; + updatingOutlineSelection = NO; if ([self isPresentation] && [[NSUserDefaults standardUserDefaults] boolForKey:SKAutoHidePresentationContentsKey]) [self hideLeftSideWindow]; } @@ -3523,6 +3530,12 @@ return pageLabels; } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { return [[noteArrayController arrangedObjects] valueForKey:@"contents"]; + } else if ([typeSelectHelper isEqual:[outlineView typeSelectHelper]]) { + int i, count = [outlineView numberOfRows]; + NSMutableArray *array = [NSMutableArray arrayWithCapacity:count]; + for (i = 0; i < count; i++) + [array addObject:[(PDFOutline *)[outlineView itemAtRow:i] label]]; + return array; } return nil; } @@ -3532,6 +3545,9 @@ return [[thumbnailTableView selectedRowIndexes] lastIndex]; } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { return [[noteArrayController arrangedObjects] indexOfObject:[self selectedNote]]; + } else if ([typeSelectHelper isEqual:[outlineView typeSelectHelper]]) { + int row = [outlineView selectedRow]; + return row == -1 ? NSNotFound : row; } return NSNotFound; } @@ -3542,6 +3558,8 @@ } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { int row = [noteOutlineView rowForItem:[[noteArrayController arrangedObjects] objectAtIndex:itemIndex]]; [noteOutlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; + } else if ([typeSelectHelper isEqual:[outlineView typeSelectHelper]]) { + [outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:itemIndex] byExtendingSelection:NO]; } } @@ -3556,6 +3574,11 @@ [statusBar setRightStringValue:[NSString stringWithFormat:NSLocalizedString(@"Finding note: \"%@\"", @"Status message"), searchString]]; else [self updateRightStatus]; + } else if ([typeSelectHelper isEqual:[outlineView typeSelectHelper]]) { + if (searchString) + [statusBar setLeftStringValue:[NSString stringWithFormat:NSLocalizedString(@"Finding: %@", @"Status message"), searchString]]; + else + [self updateLeftStatus]; } } @@ -3580,7 +3603,7 @@ - (void)updateOutlineSelection{ // Skip out if this PDF has no outline. - if (pdfOutline == nil) + if (pdfOutline == nil || updatingOutlineSelection) return; // Get index of current page. @@ -3588,7 +3611,8 @@ // Test that the current selection is still valid. PDFOutline *outlineItem = (PDFOutline *)[outlineView itemAtRow: [outlineView selectedRow]]; - if ([[pdfView document] indexForPage: [[outlineItem destination] page]] == pageIndex) + + if ([[pdfView document] indexForPage: [[outlineItem destination] page]] == pageIndex) return; int row = [self outlineRowForPageIndex:pageIndex]; Modified: trunk/SKNoteOutlineView.m =================================================================== --- trunk/SKNoteOutlineView.m 2007-08-22 15:02:59 UTC (rev 2701) +++ trunk/SKNoteOutlineView.m 2007-08-22 16:40:50 UTC (rev 2702) @@ -207,8 +207,14 @@ } } +- (void)expandItem:(id)item expandChildren:(BOOL)collapseChildren { + // NSOutlineView does not call resetCursorRect when expanding + [super expandItem:item expandChildren:collapseChildren]; + [self resetCursorRects]; +} + - (void)collapseItem:(id)item collapseChildren:(BOOL)collapseChildren { - // NSOutlineView seems to call resetCursorRect when expanding, but not when collapsing + // NSOutlineView does not call resetCursorRect when collapsing [super collapseItem:item collapseChildren:collapseChildren]; [self resetCursorRects]; } Modified: trunk/SKOutlineView.h =================================================================== --- trunk/SKOutlineView.h 2007-08-22 15:02:59 UTC (rev 2701) +++ trunk/SKOutlineView.h 2007-08-22 16:40:50 UTC (rev 2702) @@ -39,10 +39,16 @@ #import <Cocoa/Cocoa.h> #import <Carbon/Carbon.h> +@class SKTypeSelectHelper; @interface SKOutlineView : NSOutlineView { CFMutableArrayRef trackingRects; + SKTypeSelectHelper *typeSelectHelper; } + +- (SKTypeSelectHelper *)typeSelectHelper; +- (void)setTypeSelectHelper:(SKTypeSelectHelper *)newTypeSelectHelper; + @end Modified: trunk/SKOutlineView.m =================================================================== --- trunk/SKOutlineView.m 2007-08-22 15:02:59 UTC (rev 2701) +++ trunk/SKOutlineView.m 2007-08-22 16:40:50 UTC (rev 2702) @@ -37,6 +37,7 @@ */ #import "SKOutlineView.h" +#import "SKTypeSelectHelper.h" @implementation SKOutlineView @@ -44,9 +45,22 @@ - (void)dealloc { if (trackingRects != NULL) CFRelease(trackingRects); + [typeSelectHelper setDataSource:nil]; + [typeSelectHelper release]; [super dealloc]; } +- (SKTypeSelectHelper *)typeSelectHelper { + return typeSelectHelper; +} + +- (void)setTypeSelectHelper:(SKTypeSelectHelper *)newTypeSelectHelper { + if (typeSelectHelper != newTypeSelectHelper) { + [typeSelectHelper release]; + typeSelectHelper = [newTypeSelectHelper retain]; + } +} + - (void)highlightSelectionInClipRect:(NSRect)clipRect { if ([[self delegate] respondsToSelector:@selector(outlineViewHighlightedRows:)]) { NSMutableIndexSet *rowIndexes = [[[self selectedRowIndexes] mutableCopy] autorelease]; @@ -108,8 +122,23 @@ } } +- (void)expandItem:(id)item expandChildren:(BOOL)collapseChildren { + // NSOutlineView does not call resetCursorRect when expanding + [super expandItem:item expandChildren:collapseChildren]; + [typeSelectHelper rebuildTypeSelectSearchCache]; + [self rebuildTrackingRects]; +} + +- (void)collapseItem:(id)item collapseChildren:(BOOL)collapseChildren { + // NSOutlineView does not call resetCursorRect when collapsing + [super collapseItem:item collapseChildren:collapseChildren]; + [typeSelectHelper rebuildTypeSelectSearchCache]; + [self rebuildTrackingRects]; +} + - (void)reloadData{ [super reloadData]; + [typeSelectHelper rebuildTypeSelectSearchCache]; [self rebuildTrackingRects]; } @@ -164,4 +193,18 @@ } } +- (void)keyDown:(NSEvent *)theEvent { + NSString *characters = [theEvent charactersIgnoringModifiers]; + unichar eventChar = [characters length] > 0 ? [characters characterAtIndex:0] : 0; + unsigned modifierFlags = [theEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask; + + if (typeSelectHelper && modifierFlags == 0 && [[NSCharacterSet alphanumericCharacterSet] characterIsMember:eventChar]) { + [typeSelectHelper processKeyDownCharacter:eventChar]; + } else if (typeSelectHelper && modifierFlags == 0 && eventChar == '/') { + [typeSelectHelper repeatSearch]; + } else { + [super keyDown:theEvent]; + } +} + @end Modified: trunk/SKTypeSelectHelper.m =================================================================== --- trunk/SKTypeSelectHelper.m 2007-08-22 15:02:59 UTC (rev 2701) +++ trunk/SKTypeSelectHelper.m 2007-08-22 16:40:50 UTC (rev 2702) @@ -248,8 +248,9 @@ if ([label caseInsensitiveCompare:searchString] == NSOrderedSame) return labelIndex; } else { - if ([label containsStringStartingAtWord:searchString options:options range:NSMakeRange(0, [label length])]) + if ([label containsStringStartingAtWord:searchString options:options range:NSMakeRange(0, [label length])]) { return labelIndex; + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-22 15:03:02
|
Revision: 2701 http://skim-app.svn.sourceforge.net/skim-app/?rev=2701&view=rev Author: hofman Date: 2007-08-22 08:02:59 -0700 (Wed, 22 Aug 2007) Log Message: ----------- Move definition of a static character set to category file. Modified Paths: -------------- trunk/NSCharacterSet_SKExtensions.h trunk/NSCharacterSet_SKExtensions.m trunk/PDFPage_SKExtensions.m Modified: trunk/NSCharacterSet_SKExtensions.h =================================================================== --- trunk/NSCharacterSet_SKExtensions.h 2007-08-22 14:58:22 UTC (rev 2700) +++ trunk/NSCharacterSet_SKExtensions.h 2007-08-22 15:02:59 UTC (rev 2701) @@ -42,4 +42,5 @@ @interface NSCharacterSet (SKExtensions) + (NSCharacterSet *)newlineCharacterSet; + (NSCharacterSet *)nonWhitespaceCharacterSet; ++ (NSCharacterSet *)nonWhitespaceAndNewlineCharacterSet; @end Modified: trunk/NSCharacterSet_SKExtensions.m =================================================================== --- trunk/NSCharacterSet_SKExtensions.m 2007-08-22 14:58:22 UTC (rev 2700) +++ trunk/NSCharacterSet_SKExtensions.m 2007-08-22 15:02:59 UTC (rev 2701) @@ -60,4 +60,11 @@ return nonWhitespaceCharacterSet; } ++ (NSCharacterSet *)nonWhitespaceAndNewlineCharacterSet { + static NSCharacterSet *nonWhitespaceAndNewlineCharacterSet = nil; + if (nonWhitespaceAndNewlineCharacterSet == nil) + nonWhitespaceAndNewlineCharacterSet = [[[NSCharacterSet whitespaceAndNewlineCharacterSet] invertedSet] copy]; + return nonWhitespaceAndNewlineCharacterSet; +} + @end Modified: trunk/PDFPage_SKExtensions.m =================================================================== --- trunk/PDFPage_SKExtensions.m 2007-08-22 14:58:22 UTC (rev 2700) +++ trunk/PDFPage_SKExtensions.m 2007-08-22 15:02:59 UTC (rev 2701) @@ -44,6 +44,7 @@ #import "OBUtilities.h" #import "NSBitmapImageRep_SKExtensions.h" #import "SKStringConstants.h" +#import "NSCharacterSet_SKExtensions.h" #import "NSGeometry_SKExtensions.h" NSString *SKPDFDocumentPageBoundsDidChangeNotification = @"SKPDFDocumentPageBoundsDidChangeNotification"; @@ -212,10 +213,6 @@ } - (NSArray *)lineBounds { - static NSCharacterSet *nonWhitespaceAndNewlineCharacterSet = nil; - if (nonWhitespaceAndNewlineCharacterSet == nil) - nonWhitespaceAndNewlineCharacterSet = [[[NSCharacterSet whitespaceAndNewlineCharacterSet] invertedSet] copy]; - NSMutableArray *lines = [NSMutableArray array]; PDFSelection *sel = [self selectionForRect:[self boundsForBox:kPDFDisplayBoxCropBox]]; unsigned i, iMax = [sel safeNumberOfRangesOnPage:self]; @@ -240,7 +237,7 @@ NSRange selRange = [s safeRangeAtIndex:k onPage:self]; [indexes addIndexesInRange:selRange]; // due to a bug in PDFKit, the range of the selection can sometimes lie partly outside the range of the string - if ([string rangeOfCharacterFromSet:nonWhitespaceAndNewlineCharacterSet options:0 range:NSIntersectionRange(selRange, stringRange)].length) + if ([string rangeOfCharacterFromSet:[NSCharacterSet nonWhitespaceAndNewlineCharacterSet] options:0 range:NSIntersectionRange(selRange, stringRange)].length) notEmpty = YES; } if (notEmpty) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-22 14:58:24
|
Revision: 2700 http://skim-app.svn.sourceforge.net/skim-app/?rev=2700&view=rev Author: hofman Date: 2007-08-22 07:58:22 -0700 (Wed, 22 Aug 2007) Log Message: ----------- Remove some header files from target and build phase. Modified Paths: -------------- trunk/Skim.xcodeproj/project.pbxproj Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-08-22 14:21:38 UTC (rev 2699) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-08-22 14:58:22 UTC (rev 2700) @@ -126,10 +126,8 @@ CE5487BC0B35A20A00F8AFB6 /* NSFileManager_ExtendedAttributes.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5487BB0B35A20A00F8AFB6 /* NSFileManager_ExtendedAttributes.m */; }; CE54898C0B35D4EF00F8AFB6 /* InfoWindow.nib in Resources */ = {isa = PBXBuildFile; fileRef = CE54898A0B35D4EF00F8AFB6 /* InfoWindow.nib */; }; CE54898F0B35D50E00F8AFB6 /* SKInfoWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE54898E0B35D50E00F8AFB6 /* SKInfoWindowController.m */; }; - CE5BC5B10C79A27B00EBDCF7 /* NSTableView_SKExtensions.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE5BC5AF0C79A27B00EBDCF7 /* NSTableView_SKExtensions.h */; }; CE5BC5B20C79A27B00EBDCF7 /* NSTableView_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5BC5B00C79A27B00EBDCF7 /* NSTableView_SKExtensions.m */; }; CE5BD6740C7ADF1500EBDCF7 /* SKTypeSelectHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5BD6720C7ADF1500EBDCF7 /* SKTypeSelectHelper.m */; }; - CE5BEA180C7C635400EBDCF7 /* NSGeometry_SKExtensions.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE5BEA160C7C635400EBDCF7 /* NSGeometry_SKExtensions.h */; }; CE5BEA190C7C635400EBDCF7 /* NSGeometry_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5BEA170C7C635400EBDCF7 /* NSGeometry_SKExtensions.m */; }; CE5F42AF0BF89FE00069D89C /* AppleRemote.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5F42AD0BF89FE00069D89C /* AppleRemote.m */; }; CE5F43730BF8A3410069D89C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE5F42D30BF8A3400069D89C /* IOKit.framework */; }; @@ -260,8 +258,6 @@ dstSubfolderSpec = 10; files = ( CE2BD8450BD4135600A5F4DB /* Sparkle.framework in CopyFiles */, - CE5BC5B10C79A27B00EBDCF7 /* NSTableView_SKExtensions.h in CopyFiles */, - CE5BEA180C7C635400EBDCF7 /* NSGeometry_SKExtensions.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-22 14:21:50
|
Revision: 2699 http://skim-app.svn.sourceforge.net/skim-app/?rev=2699&view=rev Author: hofman Date: 2007-08-22 07:21:38 -0700 (Wed, 22 Aug 2007) Log Message: ----------- Add a category with some convenience geometry functions. Modified Paths: -------------- trunk/PDFPage_SKExtensions.m trunk/SKApplicationController.m trunk/SKMainWindowController.m trunk/SKPDFAnnotationNote.m trunk/SKPDFHoverWindow.m trunk/SKPDFView.m trunk/SKSnapshotWindowController.m trunk/Skim.xcodeproj/project.pbxproj Added Paths: ----------- trunk/NSGeometry_SKExtensions.h trunk/NSGeometry_SKExtensions.m Added: trunk/NSGeometry_SKExtensions.h =================================================================== --- trunk/NSGeometry_SKExtensions.h (rev 0) +++ trunk/NSGeometry_SKExtensions.h 2007-08-22 14:21:38 UTC (rev 2699) @@ -0,0 +1,111 @@ +// +// NSGeometry_SKExtensions.h +// Skim +// +// Created by Christiaan Hofman on 8/22/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> + + +static inline NSPoint SKIntegralPoint(NSPoint point) { + return NSMakePoint(roundf(point.x), roundf(point.y)); +} + +static inline NSPoint SKAddPoints(NSPoint aPoint, NSPoint bPoint) { + return NSMakePoint(aPoint.x + bPoint.x, aPoint.y + bPoint.y); +} + +static inline NSPoint SKSubstractPoints(NSPoint aPoint, NSPoint bPoint) { + return NSMakePoint(aPoint.x - bPoint.x, aPoint.y - bPoint.y); +} + +static inline NSPoint SKBottomLeftPoint(NSRect rect) { + return NSMakePoint(NSMinX(rect), NSMinY(rect)); +} + +static inline NSPoint SKBottomRightPoint(NSRect rect) { + return NSMakePoint(NSMaxX(rect), NSMinY(rect)); +} + +static inline NSPoint SKTopLeftPoint(NSRect rect) { + return NSMakePoint(NSMinX(rect), NSMaxY(rect)); +} + +static inline NSPoint SKTopRightPoint(NSRect rect) { + return NSMakePoint(NSMaxX(rect), NSMaxY(rect)); +} + +static inline NSPoint SKCenterPoint(NSRect rect) { + return NSMakePoint(NSMidX(rect), NSMidY(rect)); +} + +static inline NSRect SKRectFromPoints(NSPoint aPoint, NSPoint bPoint) { + NSRect rect; + rect.origin.x = fmin(aPoint.x, bPoint.x); + rect.origin.y = fmin(aPoint.y, bPoint.y); + rect.size.width = fmax(aPoint.x, bPoint.x) - NSMinX(rect); + rect.size.height = fmax(aPoint.y, bPoint.y) - NSMinY(rect); + return rect; +} + +static inline NSRect SKIntegralRectFromPoints(NSPoint aPoint, NSPoint bPoint) { + NSRect rect; + rect.origin.x = floorf(fmin(aPoint.x, bPoint.x)); + rect.origin.y = floorf(fmin(aPoint.y, bPoint.y)); + rect.size.width = ceilf(fmax(aPoint.x, bPoint.x) - NSMinX(rect)); + rect.size.height = ceilf(fmax(aPoint.y, bPoint.y) - NSMinY(rect)); + return rect; +} + +static inline NSRect SKRectFromCenterAndPoint(NSPoint center, NSPoint point) { + NSRect rect; + rect.size.width = 2.0 * fabs(center.x - point.x); + rect.size.height = 2.0 * fabs(center.y - point.y); + rect.origin.x = center.x - 0.5 * NSWidth(rect); + rect.origin.y = center.y - 0.5 * NSHeight(rect); + return rect; +} + +static inline NSRect SKRectFromCenterAndSize(NSPoint center, NSSize size) { + NSRect rect; + rect.origin.x = center.x - 0.5 * size.width; + rect.origin.y = center.y - 0.5 * size.height; + rect.size = size; + return rect; +} + +extern NSPoint SKConstrainPointInRect(NSPoint point, NSRect boundary); +extern NSRect SKConstrainRect(NSRect rect, NSRect boundary); +extern NSRect SKIntersectionRect(NSRect rect, NSRect boundary); Added: trunk/NSGeometry_SKExtensions.m =================================================================== --- trunk/NSGeometry_SKExtensions.m (rev 0) +++ trunk/NSGeometry_SKExtensions.m 2007-08-22 14:21:38 UTC (rev 2699) @@ -0,0 +1,80 @@ +// +// NSGeometry_SKExtensions.m +// Skim +// +// Created by Christiaan Hofman on 8/22/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 "NSGeometry_SKExtensions.h" + +NSPoint SKConstrainPointInRect(NSPoint point, NSRect boundary){ + if (point.x < NSMinX(boundary)) + point.x = NSMinX(boundary); + else if (point.x > NSMaxX(boundary)) + point.x = NSMaxX(boundary); + + if (point.y < NSMinY(boundary)) + point.y = NSMinY(boundary); + else if (point.y > NSMaxY(boundary)) + point.y = NSMaxY(boundary); + + return point; +} + +NSRect SKConstrainRect(NSRect rect, NSRect boundary) { + if (NSWidth(rect) > NSWidth(boundary)) + rect.size.width = NSWidth(boundary); + if (NSHeight(rect) > NSHeight(boundary)) + rect.size.height = NSHeight(boundary); + + if (NSMinX(rect) < NSMinX(boundary)) + rect.origin.x = NSMinX(boundary); + else if (NSMaxX(rect) > NSMaxX(boundary)) + rect.origin.x = NSMaxX(boundary) - NSWidth(rect); + + if (NSMinY(rect) < NSMinY(boundary)) + rect.origin.y = NSMinY(boundary); + else if (NSMaxY(rect) > NSMaxY(boundary)) + rect.origin.y = NSMaxY(boundary) - NSHeight(rect); + + return rect; +} + +NSRect SKIntersectionRect(NSRect rect, NSRect boundary) { + float minX = fmin(fmax(NSMinX(rect), NSMinX(boundary)), NSMaxX(boundary)); + float maxX = fmax(fmin(NSMaxX(rect), NSMaxX(boundary)), NSMinX(boundary)); + float minY = fmin(fmax(NSMinY(rect), NSMinY(boundary)), NSMaxY(boundary)); + float maxY = fmax(fmin(NSMaxY(rect), NSMaxY(boundary)), NSMinY(boundary)); + return NSMakeRect(minX, minY, maxX - minX, maxY - minY); +} Modified: trunk/PDFPage_SKExtensions.m =================================================================== --- trunk/PDFPage_SKExtensions.m 2007-08-22 09:56:30 UTC (rev 2698) +++ trunk/PDFPage_SKExtensions.m 2007-08-22 14:21:38 UTC (rev 2699) @@ -44,6 +44,7 @@ #import "OBUtilities.h" #import "NSBitmapImageRep_SKExtensions.h" #import "SKStringConstants.h" +#import "NSGeometry_SKExtensions.h" NSString *SKPDFDocumentPageBoundsDidChangeNotification = @"SKPDFDocumentPageBoundsDidChangeNotification"; @@ -84,8 +85,7 @@ } else if (NSEqualRects(NSZeroRect, r)) { r = NSMakeRect(NSMidX(b), NSMidY(b), 0.0, 0.0); } else { - r.origin.x += NSMinX(b); - r.origin.y += NSMinY(b); + r.origin = SKAddPoints(r.origin, b.origin); } [imageRep release]; r = NSIntersectionRect(NSInsetRect(r, -marginWidth, -marginHeight), b); @@ -165,8 +165,7 @@ scaleX = scaleY = 1.0; } - readingBarRect.origin.x -= NSMinX(bounds); - readingBarRect.origin.y -= NSMinY(bounds); + readingBarRect.origin = SKSubstractPoints(readingBarRect.origin, bounds.origin); image = [[NSImage alloc] initWithSize:thumbnailSize]; [image lockFocus]; @@ -233,7 +232,7 @@ continue; NSRect r = [self characterBoundsAtIndex:j]; - PDFSelection *s = [self selectionForLineAtPoint:NSMakePoint(NSMidX(r), NSMidY(r))]; + PDFSelection *s = [self selectionForLineAtPoint:SKCenterPoint(r)]; unsigned k, kMax = [s safeNumberOfRangesOnPage:self]; BOOL notEmpty = NO; Modified: trunk/SKApplicationController.m =================================================================== --- trunk/SKApplicationController.m 2007-08-22 09:56:30 UTC (rev 2698) +++ trunk/SKApplicationController.m 2007-08-22 14:21:38 UTC (rev 2699) @@ -56,6 +56,7 @@ #import "NSURL_SKExtensions.h" #import "SKDocumentController.h" #import "Files_SKExtensions.h" +#import "NSGeometry_SKExtensions.h" @implementation SKApplicationController @@ -616,7 +617,7 @@ - (void)drawRect:(NSRect)rect { NSRect bounds = [self bounds]; - NSPoint center = NSMakePoint(NSMidX(bounds), NSMidY(bounds)); + NSPoint center = SKCenterPoint(bounds); [[NSColor colorWithCalibratedWhite:0.0 alpha:0.5] setFill]; [NSBezierPath fillRoundRectInRect:[self bounds] radius:10.0]; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-08-22 09:56:30 UTC (rev 2698) +++ trunk/SKMainWindowController.m 2007-08-22 14:21:38 UTC (rev 2699) @@ -78,6 +78,7 @@ #import "SKStatusBar.h" #import "SKTransitionController.h" #import "SKTypeSelectHelper.h" +#import "NSGeometry_SKExtensions.h" #define SEGMENTED_CONTROL_HEIGHT 25.0 #define WINDOW_X_DELTA 0.0 @@ -1568,14 +1569,7 @@ rect.origin.x = NSMaxX(rect) - size.width; rect.origin.y = NSMaxY(rect) - size.height; rect.size = size; - if (NSMaxX(rect) > NSMaxX(bounds)) - rect.origin.x = NSMaxX(bounds) - NSWidth(rect); - if (NSMinX(rect) < NSMinX(bounds)) - rect.origin.x = NSMinX(bounds); - if (NSMaxY(rect) > NSMaxY(bounds)) - rect.origin.y = NSMaxY(bounds) - NSHeight(rect); - if (NSMinY(rect) < NSMinY(bounds)) - rect.origin.y = NSMinY(bounds); + rect = SKConstrainRect(rect, bounds); [rectArray addObject:[NSValue valueWithRect:rect]]; if (i && i % 10 == 0) { [progressBar incrementBy:1.0]; @@ -1674,7 +1668,6 @@ } PDFDisplayMode displayMode = [pdfView displayMode]; - NSRect screenFrame = [[[self window] screen] visibleFrame]; NSRect frame = [splitView frame]; NSRect documentRect = [[[self pdfView] documentView] convertRect:[[[self pdfView] documentView] bounds] toView:nil]; float bottomOffset = -1.0; @@ -1704,14 +1697,7 @@ frame.origin = [[self window] convertBaseToScreen:[[[self window] contentView] convertPoint:frame.origin toView:nil]]; frame = [[self window] frameRectForContentRect:frame]; - if (frame.size.width > NSWidth(screenFrame)) - frame.size.width = NSWidth(screenFrame); - if (frame.size.height > NSHeight(screenFrame)) - frame.size.height = NSHeight(screenFrame); - if (NSMaxX(frame) > NSMaxX(screenFrame)) - frame.origin.x = NSMaxX(screenFrame) - NSWidth(frame); - if (NSMaxY(frame) > NSMaxY(screenFrame)) - frame.origin.y = NSMaxY(screenFrame) - NSHeight(frame); + frame = SKConstrainRect(frame, [[[self window] screen] visibleFrame]); [[self window] setFrame:frame display:[[self window] isVisible]]; } Modified: trunk/SKPDFAnnotationNote.m =================================================================== --- trunk/SKPDFAnnotationNote.m 2007-08-22 09:56:30 UTC (rev 2698) +++ trunk/SKPDFAnnotationNote.m 2007-08-22 14:21:38 UTC (rev 2699) @@ -43,6 +43,7 @@ #import "SKPDFView.h" #import "OBUtilities.h" #import "NSUserDefaultsController_SKExtensions.h" +#import "NSGeometry_SKExtensions.h" enum { SKASTextNote = 'NTxt', @@ -223,7 +224,7 @@ - (PDFDestination *)destination{ NSRect bounds = [self bounds]; - NSPoint point = NSMakePoint(NSMinX(bounds), NSMaxY(bounds)); + NSPoint point = SKTopLeftPoint(bounds); return [[[PDFDestination alloc] initWithPage:[self page] atPoint:point] autorelease]; } @@ -742,10 +743,11 @@ static NSArray *createQuadPointsWithBounds(const NSRect bounds, const NSPoint origin) { - NSPoint p0 = NSMakePoint(NSMinX(bounds) - origin.x, NSMaxY(bounds) - origin.y); - NSPoint p1 = NSMakePoint(NSMaxX(bounds) - origin.x, NSMaxY(bounds) - origin.y); - NSPoint p2 = NSMakePoint(NSMinX(bounds) - origin.x, NSMinY(bounds) - origin.y); - NSPoint p3 = NSMakePoint(NSMaxX(bounds) - origin.x, NSMinY(bounds) - origin.y); + NSRect r = NSOffsetRect(bounds, -origin.x, -origin.y); + NSPoint p0 = SKTopLeftPoint(r); + NSPoint p1 = SKTopRightPoint(r); + NSPoint p2 = SKBottomLeftPoint(r); + NSPoint p3 = SKBottomRightPoint(r); return [[NSArray alloc] initWithObjects:[NSValue valueWithPoint:p0], [NSValue valueWithPoint:p1], [NSValue valueWithPoint:p2], [NSValue valueWithPoint:p3], nil]; } @@ -928,9 +930,7 @@ NSRect lineRect; lineRect.size.height = points[1].y - points[2].y; lineRect.size.width = points[1].x - points[2].x; - lineRect.origin = points[2]; - lineRect.origin.x += [self bounds].origin.x; - lineRect.origin.y += [self bounds].origin.y; + lineRect.origin = SKAddPoints(points[2], [self bounds].origin); [self addLineRect:lineRect]; } } @@ -1415,20 +1415,20 @@ NSPoint startPoint = [self startPoint]; NSPoint endPoint = [self endPoint]; + point = SKSubstractPoints(point, bounds.origin); + if ([super hitTest:point]) { - NSPoint relPoint = NSMakePoint(endPoint.x - startPoint.x, endPoint.y - startPoint.y); + NSPoint relPoint = SKSubstractPoints(endPoint, startPoint); float lengthSquared = relPoint.x * relPoint.x + relPoint.y * relPoint.y; float extProduct; if (lengthSquared < 16.0) return YES; - extProduct = (point.x - NSMinX(bounds) - startPoint.x) * relPoint.y - (point.y - NSMinY(bounds) - startPoint.y) * relPoint.x; + extProduct = (point.x - startPoint.x) * relPoint.y - (point.y - startPoint.y) * relPoint.x; return extProduct * extProduct < 16.0 * lengthSquared; } else { - point.x -= NSMinX(bounds); - point.y -= NSMinY(bounds); return (fabs(point.x - startPoint.x) < 3.5 && fabs(point.y - startPoint.y) < 3.5) || (fabs(point.x - endPoint.x) < 3.5 && fabs(point.y - endPoint.y) < 3.5); @@ -1464,14 +1464,9 @@ NSPoint startPoint = NSPointFromPoint(*qdPoint); NSRect bounds = [self bounds]; - NSPoint endPoint = [self endPoint]; - endPoint.x = roundf(endPoint.x + NSMinX(bounds)); - endPoint.y = roundf(endPoint.y + NSMinY(bounds)); + NSPoint endPoint = SKIntegralPoint(SKAddPoints([self endPoint], bounds.origin)); - bounds.origin.x = floorf(fmin(startPoint.x, endPoint.x)); - bounds.size.width = ceilf(fmax(endPoint.x, startPoint.x)) - NSMinX(bounds); - bounds.origin.y = floorf(fmin(startPoint.y, endPoint.y)); - bounds.size.height = ceilf(fmax(endPoint.y, startPoint.y)) - NSMinY(bounds); + bounds = SKIntegralRectFromPoints(startPoint, endPoint); if (NSWidth(bounds) < 8.0) { bounds.size.width = 8.0; @@ -1482,10 +1477,8 @@ bounds.origin.y = floorf(0.5 * (startPoint.y + endPoint.y) - 4.0); } - startPoint.x -= NSMinX(bounds); - startPoint.y -= NSMinY(bounds); - endPoint.x -= NSMinX(bounds); - endPoint.y -= NSMinY(bounds); + startPoint = SKSubstractPoints(startPoint, bounds.origin); + endPoint = SKSubstractPoints(endPoint, bounds.origin); [self setBounds:bounds]; [self setStartPoint:startPoint]; @@ -1496,9 +1489,9 @@ - (NSData *)startPointAsQDPoint { NSRect bounds = [self bounds]; - NSPoint startPoint = [self startPoint]; - startPoint.x = floorf(startPoint.x + NSMinX(bounds)); - startPoint.y = floorf(startPoint.y + NSMinY(bounds)); + NSPoint startPoint = SKAddPoints([self startPoint], bounds.origin); + startPoint.x = floorf(startPoint.x); + startPoint.y = floorf(startPoint.y); Point qdPoint = PointFromNSPoint(startPoint); return [NSData dataWithBytes:&qdPoint length:sizeof(Point)]; } @@ -1509,14 +1502,9 @@ NSPoint endPoint = NSPointFromPoint(*qdPoint); NSRect bounds = [self bounds]; - NSPoint startPoint = [self startPoint]; - startPoint.x = roundf(startPoint.x + NSMinX(bounds)); - startPoint.y = roundf(startPoint.y + NSMinY(bounds)); + NSPoint startPoint = SKIntegralPoint(SKAddPoints([self startPoint], bounds.origin)); - bounds.origin.x = floorf(fmin(startPoint.x, endPoint.x)); - bounds.size.width = ceilf(fmax(endPoint.x, startPoint.x)) - NSMinX(bounds); - bounds.origin.y = floorf(fmin(startPoint.y, endPoint.y)); - bounds.size.height = ceilf(fmax(endPoint.y, startPoint.y)) - NSMinY(bounds); + bounds = SKIntegralRectFromPoints(startPoint, endPoint); if (NSWidth(bounds) < 8.0) { bounds.size.width = 8.0; @@ -1527,10 +1515,8 @@ bounds.origin.y = floorf(0.5 * (startPoint.y + endPoint.y) - 4.0); } - startPoint.x -= NSMinX(bounds); - startPoint.y -= NSMinY(bounds); - endPoint.x -= NSMinX(bounds); - endPoint.y -= NSMinY(bounds); + startPoint = SKSubstractPoints(startPoint, bounds.origin); + endPoint = SKSubstractPoints(endPoint, bounds.origin); [self setBounds:bounds]; [self setStartPoint:startPoint]; @@ -1541,9 +1527,9 @@ - (NSData *)endPointAsQDPoint { NSRect bounds = [self bounds]; - NSPoint endPoint = [self endPoint]; - endPoint.x = floorf(endPoint.x + NSMinX(bounds)); - endPoint.y = floorf(endPoint.y + NSMinY(bounds)); + NSPoint endPoint = SKAddPoints([self endPoint], bounds.origin); + endPoint.x = floorf(endPoint.x); + endPoint.y = floorf(endPoint.y); Point qdPoint = PointFromNSPoint(endPoint); return [NSData dataWithBytes:&qdPoint length:sizeof(Point)]; } Modified: trunk/SKPDFHoverWindow.m =================================================================== --- trunk/SKPDFHoverWindow.m 2007-08-22 09:56:30 UTC (rev 2698) +++ trunk/SKPDFHoverWindow.m 2007-08-22 14:21:38 UTC (rev 2699) @@ -41,6 +41,7 @@ #import "SKPDFAnnotationNote.h" #import "NSBezierPath_BDSKExtensions.h" #import "NSParagraphStyle_SKExtensions.h" +#import "NSGeometry_SKExtensions.h" #define WINDOW_WIDTH 400.0 #define WINDOW_HEIGHT 80.0 @@ -172,22 +173,6 @@ [super orderOut:sender]; } -static NSRect SKRectFittingRectInRect(NSRect inRect, NSRect outRect) { - if (NSWidth(inRect) > NSWidth(outRect)) - inRect.size.width = NSWidth(outRect); - if (NSHeight(inRect) > NSHeight(outRect)) - inRect.size.height = NSHeight(outRect); - if (NSMaxX(inRect) > NSMaxX(outRect) ) - inRect.origin.x = NSMaxX(outRect) - NSWidth(inRect); - if (NSMinX(inRect) < NSMinX(outRect)) - inRect.origin.x = NSMinX(outRect); - if (NSMaxY(inRect) > NSMaxY(outRect)) - inRect.origin.y = NSMaxY(outRect) - NSHeight(inRect); - if (NSMinY(inRect) < NSMinY(outRect)) - inRect.origin.y = NSMinY(outRect); - return inRect; -} - - (void)showWithTimer:(NSTimer *)aTimer { NSPoint thePoint = NSEqualPoints(point, NSZeroPoint) ? [NSEvent mouseLocation] : point; NSRect contentRect = NSMakeRect(thePoint.x, thePoint.y - WINDOW_OFFSET, WINDOW_WIDTH, WINDOW_HEIGHT); @@ -227,7 +212,7 @@ color = [NSColor controlBackgroundColor]; - sourceRect = SKRectFittingRectInRect(sourceRect, pageImageRect); + sourceRect = SKConstrainRect(sourceRect, pageImageRect); NSDictionary *attrs = [[NSDictionary alloc] initWithObjectsAndKeys:labelFont, NSFontAttributeName, color, NSForegroundColorAttributeName, [NSParagraphStyle defaultClippingParagraphStyle], NSParagraphStyleAttributeName, nil]; NSAttributedString *labelString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:NSLocalizedString(@"Page %@", @"Tool tip label format"), [page label]] attributes:attrs]; @@ -308,7 +293,7 @@ contentRect.size = [image size]; contentRect.origin.y -= NSHeight(contentRect); - contentRect = SKRectFittingRectInRect(contentRect, [[NSScreen mainScreen] visibleFrame]); + contentRect = SKConstrainRect(contentRect, [[NSScreen mainScreen] visibleFrame]); [self setFrame:[self frameRectForContentRect:contentRect] display:NO]; [[imageView enclosingScrollView] setBackgroundColor:color]; Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-08-22 09:56:30 UTC (rev 2698) +++ trunk/SKPDFView.m 2007-08-22 14:21:38 UTC (rev 2699) @@ -54,6 +54,7 @@ #import "NSBezierPath_BDSKExtensions.h" #import "SKLineWell.h" #import <Carbon/Carbon.h> +#import "NSGeometry_SKExtensions.h" NSString *SKPDFViewToolModeChangedNotification = @"SKPDFViewToolModeChangedNotification"; NSString *SKPDFViewAnnotationModeChangedNotification = @"SKPDFViewAnnotationModeChangedNotification"; @@ -777,22 +778,13 @@ NSData *data = [pboard dataForType:SKSkimNotePboardType]; NSDictionary *note = [NSKeyedUnarchiver unarchiveObjectWithData:data]; - NSRect bounds, pageBounds; + NSRect bounds; newAnnotation = [[[PDFAnnotation alloc] initWithDictionary:note] autorelease]; bounds = [newAnnotation bounds]; page = [self currentPage]; - pageBounds = [page boundsForBox:[self displayBox]]; + bounds = SKConstrainRect(bounds, [page boundsForBox:[self displayBox]]); - if (NSMaxX(bounds) > NSMaxX(pageBounds)) - bounds.origin.x = NSMaxX(pageBounds) - NSWidth(bounds); - if (NSMinX(bounds) < NSMinX(pageBounds)) - bounds.origin.x = NSMinX(pageBounds); - if (NSMaxY(bounds) > NSMaxY(pageBounds)) - bounds.origin.y = NSMaxY(pageBounds) - NSHeight(bounds); - if (NSMinY(bounds) < NSMinY(pageBounds)) - bounds.origin.y = NSMinY(pageBounds); - [newAnnotation setBounds:bounds]; } else { @@ -808,27 +800,17 @@ if (page == nil) { // Get center of the PDFView. NSRect viewFrame = [self frame]; - center = NSMakePoint(NSMidX(viewFrame), NSMidY(viewFrame)); + center = SKCenterPoint(viewFrame); page = [self pageForPoint: center nearest: YES]; } // Convert to "page space". - center = [self convertPoint: center toPage: page]; - center.x = roundf(center.x); - center.y = roundf(center.y); + center = SKIntegralPoint([self convertPoint: center toPage: page]); NSSize defaultSize = isAlternate ? NSMakeSize(16.0, 16.0) : ([page rotation] % 180 == 90) ? NSMakeSize(64.0, 128.0) : NSMakeSize(128.0, 64.0); - NSRect bounds = NSMakeRect(center.x - 0.5 * defaultSize.width, center.y - 0.5 * defaultSize.height, defaultSize.width, defaultSize.height); - NSRect pageBounds = [page boundsForBox:[self displayBox]]; + NSRect bounds = SKRectFromCenterAndSize(center, defaultSize); - if (NSMaxX(bounds) > NSMaxX(pageBounds)) - bounds.origin.x = NSMaxX(pageBounds) - NSWidth(bounds); - if (NSMinX(bounds) < NSMinX(pageBounds)) - bounds.origin.x = NSMinX(pageBounds); - if (NSMaxY(bounds) > NSMaxY(pageBounds)) - bounds.origin.y = NSMaxY(pageBounds) - NSHeight(bounds); - if (NSMinY(bounds) < NSMinY(pageBounds)) - bounds.origin.y = NSMinY(pageBounds); + bounds = SKConstrainRect(bounds, [page boundsForBox:[self displayBox]]); if (isAlternate) newAnnotation = [[SKPDFAnnotationNote alloc] initWithBounds:bounds]; @@ -1622,8 +1604,7 @@ NSImage *pageImage = [[self currentPage] imageForBox:[self displayBox]]; NSImage *image = nil; - sourceRect.origin.x -= NSMinX(bounds); - sourceRect.origin.y -= NSMinY(bounds); + sourceRect.origin = SKSubstractPoints(sourceRect.origin, bounds.origin); targetRect.origin = NSZeroPoint; targetRect.size = sourceRect.size; image = [[NSImage alloc] initWithSize:targetRect.size]; @@ -1684,15 +1665,7 @@ } // Make sure it fits in the page - NSRect pageBounds = [page boundsForBox:[self displayBox]]; - if (NSMaxX(bounds) > NSMaxX(pageBounds)) - bounds.origin.x = NSMaxX(pageBounds) - NSWidth(bounds); - if (NSMinX(bounds) < NSMinX(pageBounds)) - bounds.origin.x = NSMinX(pageBounds); - if (NSMaxY(bounds) > NSMaxY(pageBounds)) - bounds.origin.y = NSMaxY(pageBounds) - NSHeight(bounds); - if (NSMinY(bounds) < NSMinY(pageBounds)) - bounds.origin.y = NSMinY(pageBounds); + bounds = SKConstrainRect(bounds, [page boundsForBox:[self displayBox]]); [self addAnnotationWithType:annotationType contents:text page:page bounds:bounds]; } @@ -1727,28 +1700,18 @@ if (page == nil) { // Get center of the PDFView. NSRect viewFrame = [self frame]; - center = NSMakePoint(NSMidX(viewFrame), NSMidY(viewFrame)); + center = SKCenterPoint(viewFrame); page = [self pageForPoint: center nearest: YES]; } // Convert to "page space". - center = [self convertPoint: center toPage: page]; - center.x = roundf(center.x); - center.y = roundf(center.y); + center = SKIntegralPoint([self convertPoint: center toPage: page]); if ([page rotation] % 180 == 90) defaultSize = NSMakeSize(defaultSize.height, defaultSize.width); bounds = NSMakeRect(center.x - 0.5 * defaultSize.width, center.y - 0.5 * defaultSize.height, defaultSize.width, defaultSize.height); // Make sure it fits in the page - NSRect pageBounds = [page boundsForBox:[self displayBox]]; - if (NSMaxX(bounds) > NSMaxX(pageBounds)) - bounds.origin.x = NSMaxX(pageBounds) - NSWidth(bounds); - if (NSMinX(bounds) < NSMinX(pageBounds)) - bounds.origin.x = NSMinX(pageBounds); - if (NSMaxY(bounds) > NSMaxY(pageBounds)) - bounds.origin.y = NSMaxY(pageBounds) - NSHeight(bounds); - if (NSMinY(bounds) < NSMinY(pageBounds)) - bounds.origin.y = NSMinY(pageBounds); + bounds = SKConstrainRect(bounds, [page boundsForBox:[self displayBox]]); } [self addAnnotationWithType:annotationType contents:text page:page bounds:bounds]; } @@ -1926,7 +1889,7 @@ [[activeAnnotation page] addAnnotation:editAnnotation]; // Start editing - NSPoint location = [self convertPoint:[self convertPoint:NSMakePoint(NSMidX(editBounds), NSMidY(editBounds)) fromPage:[activeAnnotation page]] toView:nil]; + NSPoint location = [self convertPoint:[self convertPoint:SKCenterPoint(editBounds) fromPage:[activeAnnotation page]] toView:nil]; NSEvent *theEvent = [NSEvent mouseEventWithType:NSLeftMouseDown location:location modifierFlags:0 timestamp:0 windowNumber:[[self window] windowNumber] context:nil eventNumber:0 clickCount:1 pressure:1.0]; [super mouseDown:theEvent]; @@ -2095,7 +2058,7 @@ if (page == nil) { // Get the center NSRect viewFrame = [self frame]; - point = NSMakePoint(NSMidX(viewFrame), NSMidY(viewFrame)); + point = SKCenterPoint(viewFrame); page = [self pageForPoint:point nearest:YES]; } } @@ -2219,10 +2182,10 @@ @implementation SKPDFView (Private) - (NSRect)resizeThumbForRect:(NSRect)rect rotation:(int)rotation { + NSSize size = NSMakeSize(8.0, 8.0); NSRect thumb = rect; - float size = 8.0; - thumb.size = NSMakeSize(size, size); + thumb.size = size; // Use rotation to determine thumb origin. switch (rotation) { @@ -2244,14 +2207,9 @@ } - (NSRect)resizeThumbForRect:(NSRect)rect point:(NSPoint)point { - NSRect thumb = rect; - float size = 8.0; + NSSize size = NSMakeSize(8.0, 8.0); + NSRect thumb = SKRectFromCenterAndSize(SKAddPoints(rect.origin, point), size); - thumb.size = NSMakeSize(size, size); - - thumb.origin.x = NSMinX(rect) + point.x - 0.5 * size; - thumb.origin.y = NSMinY(rect) + point.y - 0.5 * size; - thumb.origin.x = point.x > 0.5 * NSWidth(rect) ? floorf(NSMinX(thumb)) : ceilf(NSMinX(thumb)); thumb.origin.y = point.y > 0.5 * NSHeight(rect) ? floorf(NSMinY(thumb)) : ceilf(NSMinY(thumb)); @@ -2300,9 +2258,9 @@ PDFPage *page; unsigned first, last; - page = [self pageForPoint:NSMakePoint(NSMinX(visibleRect), NSMaxY(visibleRect)) nearest:YES]; + page = [self pageForPoint:SKTopLeftPoint(visibleRect) nearest:YES]; first = [[self document] indexForPage:page]; - page = [self pageForPoint:NSMakePoint(NSMaxX(visibleRect), NSMinY(visibleRect)) nearest:YES]; + page = [self pageForPoint:SKBottomRightPoint(visibleRect) nearest:YES]; last = [[self document] indexForPage:page]; return NSMakeRange(first, last - first + 1); @@ -2438,14 +2396,9 @@ if ([[activeAnnotation type] isEqualToString:@"Line"]) { SKPDFAnnotationLine *annotation = (SKPDFAnnotationLine *)activeAnnotation; - NSPoint oldEndPoint = [annotation endPoint]; - NSPoint endPoint; - NSPoint startPoint = [annotation startPoint]; - startPoint.x = roundf(startPoint.x + NSMinX(bounds)); - startPoint.y = roundf(startPoint.y + NSMinY(bounds)); - oldEndPoint.x = roundf(oldEndPoint.x + NSMinX(bounds)); - oldEndPoint.y = roundf(oldEndPoint.y + NSMinY(bounds)); - endPoint = oldEndPoint; + NSPoint startPoint = SKIntegralPoint(SKAddPoints([annotation startPoint], bounds.origin)); + NSPoint endPoint = SKIntegralPoint(SKAddPoints([annotation endPoint], bounds.origin)); + NSPoint oldEndPoint = endPoint; // Resize the annotation. switch ([page rotation]) { @@ -2531,10 +2484,7 @@ endPoint.y = floorf(endPoint.y); if (NSEqualPoints(endPoint, oldEndPoint) == NO) { - newBounds.origin.x = floorf(fmin(startPoint.x, endPoint.x)); - newBounds.size.width = ceilf(fmax(endPoint.x, startPoint.x)) - NSMinX(newBounds); - newBounds.origin.y = floorf(fmin(startPoint.y, endPoint.y)); - newBounds.size.height = ceilf(fmax(endPoint.y, startPoint.y)) - NSMinY(newBounds); + newBounds = SKIntegralRectFromPoints(startPoint, endPoint); if (NSWidth(newBounds) < 8.0) { newBounds.size.width = 8.0; @@ -2545,10 +2495,8 @@ newBounds.origin.y = floorf(0.5 * (startPoint.y + endPoint.y) - 4.0); } - startPoint.x -= NSMinX(newBounds); - startPoint.y -= NSMinY(newBounds); - endPoint.x -= NSMinX(newBounds); - endPoint.y -= NSMinY(newBounds); + startPoint = SKSubstractPoints(startPoint, newBounds.origin); + endPoint = SKSubstractPoints(endPoint, newBounds.origin); [annotation setBounds:newBounds]; [annotation setStartPoint:startPoint]; @@ -2858,37 +2806,21 @@ NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; NSPoint startPoint = [self convertPoint:[self convertPoint:mouseDownLoc fromView:nil] toPage:page]; NSPoint endPt = [self convertPoint:mouseLoc toPage:page]; - NSPoint relPoint = NSMakePoint(endPt.x - startPoint.x, endPt.y - startPoint.y); + NSPoint relPoint = SKSubstractPoints(endPt, startPoint); newBounds = wasBounds; if ([[activeAnnotation type] isEqualToString:@"Line"]) { SKPDFAnnotationLine *annotation = (SKPDFAnnotationLine *)activeAnnotation; - NSPoint endPoint = wasEndPoint; - endPoint.x = roundf(endPoint.x + NSMinX(wasBounds)); - endPoint.y = roundf(endPoint.y + NSMinY(wasBounds)); - startPoint = wasStartPoint; - startPoint.x = roundf(startPoint.x + NSMinX(wasBounds)); - startPoint.y = roundf(startPoint.y + NSMinY(wasBounds)); + NSPoint endPoint = SKIntegralPoint(SKSubstractPoints(wasEndPoint, wasBounds.origin)); + startPoint = SKIntegralPoint(SKSubstractPoints(wasStartPoint, wasBounds.origin)); NSPoint *draggedPoint = draggingStartPoint ? &startPoint : &endPoint; - draggedPoint->x += relPoint.x; - draggedPoint->y += relPoint.y; - if (draggedPoint->x > NSMaxX(pageBounds)) - draggedPoint->x = NSMaxX(pageBounds); - else if (draggedPoint->x < NSMinX(pageBounds)) - draggedPoint->x = NSMinX(pageBounds); - if (draggedPoint->y > NSMaxY(pageBounds)) - draggedPoint->y = NSMaxY(pageBounds) ; - else if (draggedPoint->y < NSMinY(pageBounds)) - draggedPoint->y = NSMinY(pageBounds); + *draggedPoint = SKConstrainPointInRect(SKAddPoints(*draggedPoint, relPoint), pageBounds); draggedPoint->x = floorf(draggedPoint->x); draggedPoint->y = floorf(draggedPoint->y); - newBounds.origin.x = floorf(fmin(startPoint.x, endPoint.x)); - newBounds.size.width = ceilf(fmax(endPoint.x, startPoint.x)) - NSMinX(newBounds); - newBounds.origin.y = floorf(fmin(startPoint.y, endPoint.y)); - newBounds.size.height = ceilf(fmax(endPoint.y, startPoint.y)) - NSMinY(newBounds); + newBounds = SKIntegralRectFromPoints(startPoint, endPoint); if (NSWidth(newBounds) < 8.0) { newBounds.size.width = 8.0; @@ -2899,10 +2831,8 @@ newBounds.origin.y = floorf(0.5 * (startPoint.y + endPoint.y) - 4.0); } - startPoint.x -= NSMinX(newBounds); - startPoint.y -= NSMinY(newBounds); - endPoint.x -= NSMinX(newBounds); - endPoint.y -= NSMinY(newBounds); + startPoint = SKSubstractPoints(startPoint, newBounds.origin); + endPoint = SKSubstractPoints(endPoint, newBounds.origin); [annotation setStartPoint:startPoint]; [annotation setEndPoint:endPoint]; @@ -3011,19 +2941,10 @@ page = newActivePage; } - NSPoint endPt = [self convertPoint:mouseLoc toPage:page]; newBounds = currentBounds; - newBounds.origin.x = roundf(endPt.x - clickDelta.x); - newBounds.origin.y = roundf(endPt.y - clickDelta.y); + newBounds.origin = SKIntegralPoint(SKSubstractPoints([self convertPoint:mouseLoc toPage:page], clickDelta)); // constrain bounds inside page bounds - if (NSMaxX(newBounds) > NSMaxX(pageBounds)) - newBounds.origin.x = NSMaxX(pageBounds) - NSWidth(newBounds); - if (NSMinX(newBounds) < NSMinX(pageBounds)) - newBounds.origin.x = NSMinX(pageBounds); - if (NSMaxY(newBounds) > NSMaxY(pageBounds)) - newBounds.origin.y = NSMaxY(pageBounds) - NSHeight(newBounds); - if (NSMinY(newBounds) < NSMinY(pageBounds)) - newBounds.origin.y = NSMinY(pageBounds); + newBounds = SKConstrainRect(newBounds, pageBounds); } } @@ -3044,17 +2965,14 @@ break; // dragging - NSPoint newLocation; + NSPoint newLocation = [theEvent locationInWindow]; + NSPoint delta = SKSubstractPoints(initialLocation, newLocation); NSRect newVisibleRect; - float xDelta, yDelta; - newLocation = [theEvent locationInWindow]; - xDelta = initialLocation.x - newLocation.x; - yDelta = initialLocation.y - newLocation.y; if ([self isFlipped]) - yDelta = -yDelta; + delta.y = -delta.y; - newVisibleRect = NSOffsetRect (visibleRect, xDelta, yDelta); + newVisibleRect = NSOffsetRect (visibleRect, delta.x, delta.y); [[self documentView] scrollRectToVisible: newVisibleRect]; } @@ -3119,25 +3037,23 @@ // we must be dragging NSPoint newPoint; NSRect newRect = initialRect; - float xDelta, yDelta; + NSPoint delta; newPoint = [self convertPoint:[self convertPoint:[theEvent locationInWindow] fromView:nil] toPage:page]; - xDelta = newPoint.x - initialPoint.x; - yDelta = newPoint.y - initialPoint.y; + delta = SKSubstractPoints(newPoint, initialPoint); if (xEdge == 0 && yEdge == 0) { - newRect.origin.x += xDelta; - newRect.origin.y += yDelta; + newRect.origin = SKAddPoints(newRect.origin, delta); } else { if (xEdge == 1) { - newRect.size.width += xDelta; + newRect.size.width += delta.x; if (NSWidth(newRect) < 0.0) { newRect.size.width *= -1.0; newRect.origin.x -= NSWidth(newRect); } } else if (xEdge == 2) { - newRect.origin.x += xDelta; - newRect.size.width -= xDelta; + newRect.origin.x += delta.x; + newRect.size.width -= delta.x; if (NSWidth(newRect) < 0.0) { newRect.size.width *= -1.0; newRect.origin.x -= NSWidth(newRect); @@ -3145,14 +3061,14 @@ } if (yEdge == 1) { - newRect.size.height += yDelta; + newRect.size.height += delta.y; if (NSHeight(newRect) < 0.0) { newRect.size.height *= -1.0; newRect.origin.y -= NSHeight(newRect); } } else if (yEdge == 2) { - newRect.origin.y += yDelta; - newRect.size.height -= yDelta; + newRect.origin.y += delta.y; + newRect.size.height -= delta.y; if (NSHeight(newRect) < 0.0) { newRect.size.height *= -1.0; newRect.origin.y -= NSHeight(newRect); @@ -3161,11 +3077,7 @@ } // don't use NSIntersectionRect, because we want to keep empty rects - float minX = fmin(fmax(NSMinX(newRect), NSMinX(pageBounds)), NSMaxX(pageBounds)); - float maxX = fmax(fmin(NSMaxX(newRect), NSMaxX(pageBounds)), NSMinX(pageBounds)); - float minY = fmin(fmax(NSMinY(newRect), NSMinY(pageBounds)), NSMaxY(pageBounds)); - float maxY = fmax(fmin(NSMaxY(newRect), NSMaxY(pageBounds)), NSMinY(pageBounds)); - newRect = NSMakeRect(minX, minY, maxX - minX, maxY - minY); + newRect = SKIntersectionRect(newRect, pageBounds); if (didDrag) { NSRect dirtyRect = NSUnionRect(NSInsetRect(selectionRect, -margin, -margin), NSInsetRect(newRect, -margin, -margin)); NSRange r = [self visiblePageIndexRange]; @@ -3248,7 +3160,7 @@ PDFSelection *sel = nil; if (rectSelection) { // how to handle multipage selection? Preview.app's behavior is screwy as well, so we'll do the same thing - NSRect selRect = NSMakeRect(fmin(p2.x, p1.x), fmin(p2.y, p1.y), fabs(p2.x - p1.x), fabs(p2.y - p1.y)); + NSRect selRect = SKRectFromPoints(p1, p2); sel = [page1 selectionForRect:selRect]; if (NSIsEmptyRect(selectionRect) == NO) [self setNeedsDisplayInRect:selectionRect]; @@ -3317,8 +3229,6 @@ NSPoint startPoint = [[self documentView] convertPoint:mouseLoc fromView:nil]; NSPoint currentPoint; NSRect selRect = {startPoint, NSZeroSize}; - NSRect bounds; - float minX, maxX, minY, maxY; BOOL dragged = NO; [[self window] discardCachedImage]; @@ -3346,28 +3256,14 @@ currentPoint = [[self documentView] convertPoint:mouseLoc fromView:nil]; - minX = fmin(startPoint.x, currentPoint.x); - maxX = fmax(startPoint.x, currentPoint.x); - minY = fmin(startPoint.y, currentPoint.y); - maxY = fmax(startPoint.y, currentPoint.y); // center around startPoint when holding down the Shift key - if ([theEvent modifierFlags] & NSShiftKeyMask) { - if (currentPoint.x > startPoint.x) - minX -= maxX - minX; - else - maxX += maxX - minX; - if (currentPoint.y > startPoint.y) - minY -= maxY - minY; - else - maxY += maxY - minY; - } + if ([theEvent modifierFlags] & NSShiftKeyMask) + selRect = SKRectFromCenterAndPoint(startPoint, currentPoint); + else + selRect = SKRectFromPoints(startPoint, currentPoint); + // intersect with the bounds, project on the bounds if necessary and allow zero width or height - bounds = [[self documentView] bounds]; - minX = fmin(fmax(minX, NSMinX(bounds)), NSMaxX(bounds)); - maxX = fmax(fmin(maxX, NSMaxX(bounds)), NSMinX(bounds)); - minY = fmin(fmax(minY, NSMinY(bounds)), NSMaxY(bounds)); - maxY = fmax(fmin(maxY, NSMaxY(bounds)), NSMinY(bounds)); - selRect = NSMakeRect(minX, minY, maxX - minX, maxY - minY); + selRect = SKIntersectionRect(selRect, [[self documentView] bounds]); [[self window] cacheImageInRect:NSInsetRect([[self documentView] convertRect:selRect toView:nil], -2.0, -2.0)]; @@ -3385,9 +3281,10 @@ [[self window] discardCachedImage]; [[self cursorForEvent:theEvent] set]; - NSPoint point = [self convertPoint:NSMakePoint(NSMidX(selRect), NSMidY(selRect)) fromView:[self documentView]]; + NSPoint point = [self convertPoint:SKCenterPoint(selRect) fromView:[self documentView]]; PDFPage *page = [self pageForPoint:point nearest:YES]; NSRect rect = [self convertRect:selRect fromView:[self documentView]]; + NSRect bounds; int factor = 1; BOOL autoFits = NO; @@ -3496,8 +3393,7 @@ magRect = visibleRect; } else { magRect = currentLevel == 2 ? largeMagRect : smallMagRect; - magRect.origin.x += mouseLoc.x; - magRect.origin.y += mouseLoc.y; + magRect.origin = SKAddPoints(magRect.origin, mouseLoc); // restore the cached image in order to clear the rect [[self window] restoreCachedImage]; [[self window] cacheImageInRect:NSIntersectionRect(NSInsetRect(magRect, -2.0, -2.0), visibleRect)]; Modified: trunk/SKSnapshotWindowController.m =================================================================== --- trunk/SKSnapshotWindowController.m 2007-08-22 09:56:30 UTC (rev 2698) +++ trunk/SKSnapshotWindowController.m 2007-08-22 14:21:38 UTC (rev 2699) @@ -47,6 +47,7 @@ #import "NSWindowController_SKExtensions.h" #import "SKStringConstants.h" #import "NSUserDefaultsController_SKExtensions.h" +#import "NSGeometry_SKExtensions.h" static NSString *SKSnapshotWindowFrameAutosaveName = @"SKSnapshotWindow"; static NSString *SKSnapshotViewChangedNotification = @"SKSnapshotViewChangedNotification"; @@ -199,27 +200,12 @@ NSRect contentRect = [pdfView convertRect:rect fromPage:page]; contentRect = [pdfView convertRect:contentRect toView:nil]; NSRect frame = [[self window] frame]; - NSRect screenFrame = [[[self window] screen] visibleFrame]; contentRect.size.width += [NSScroller scrollerWidth]; contentRect.size.height += [NSScroller scrollerWidth]; frame.size = [[self window] frameRectForContentRect:contentRect].size; + frame = SKConstrainRect(frame, [[[self window] screen] visibleFrame]); - if (NSMaxX(frame) > NSMaxX(screenFrame)) - frame.origin.x = NSMaxX(screenFrame) - NSWidth(frame); - if (NSMinX(frame) < NSMinX(screenFrame)) { - frame.origin.x = NSMinX(screenFrame); - if (NSWidth(frame) > NSWidth(screenFrame)) - frame.size.width = NSWidth(screenFrame); - } - if (NSMaxY(frame) > NSMaxY(screenFrame)) - frame.origin.x = NSMaxY(screenFrame) - NSHeight(frame); - if (NSMinY(frame) < NSMinY(screenFrame)) { - frame.origin.x = NSMinY(screenFrame); - if (NSHeight(frame) > NSHeight(screenFrame)) - frame.size.height = NSHeight(screenFrame); - } - [[self window] setFrame:NSIntegralRect(frame) display:NO animate:NO]; [pdfView goToPage:page]; @@ -246,8 +232,8 @@ NSRect visibleRect = [clipView convertRect:[clipView visibleRect] toView:pdfView]; unsigned first, last, index = [[pdfView document] indexForPage:page]; - first = [[pdfView document] indexForPage:[pdfView pageForPoint:NSMakePoint(NSMinX(visibleRect), NSMaxY(visibleRect)) nearest:YES]]; - last = [[pdfView document] indexForPage:[pdfView pageForPoint:NSMakePoint(NSMaxX(visibleRect), NSMinY(visibleRect)) nearest:YES]]; + first = [[pdfView document] indexForPage:[pdfView pageForPoint:SKTopLeftPoint(visibleRect) nearest:YES]]; + last = [[pdfView document] indexForPage:[pdfView pageForPoint:SKBottomRightPoint(visibleRect) nearest:YES]]; return index >= first && index <= last; } Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-08-22 09:56:30 UTC (rev 2698) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-08-22 14:21:38 UTC (rev 2699) @@ -129,6 +129,8 @@ CE5BC5B10C79A27B00EBDCF7 /* NSTableView_SKExtensions.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE5BC5AF0C79A27B00EBDCF7 /* NSTableView_SKExtensions.h */; }; CE5BC5B20C79A27B00EBDCF7 /* NSTableView_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5BC5B00C79A27B00EBDCF7 /* NSTableView_SKExtensions.m */; }; CE5BD6740C7ADF1500EBDCF7 /* SKTypeSelectHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5BD6720C7ADF1500EBDCF7 /* SKTypeSelectHelper.m */; }; + CE5BEA180C7C635400EBDCF7 /* NSGeometry_SKExtensions.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE5BEA160C7C635400EBDCF7 /* NSGeometry_SKExtensions.h */; }; + CE5BEA190C7C635400EBDCF7 /* NSGeometry_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5BEA170C7C635400EBDCF7 /* NSGeometry_SKExtensions.m */; }; CE5F42AF0BF89FE00069D89C /* AppleRemote.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5F42AD0BF89FE00069D89C /* AppleRemote.m */; }; CE5F43730BF8A3410069D89C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE5F42D30BF8A3400069D89C /* IOKit.framework */; }; CE67BB260BC44AC9007B6929 /* ZoomValues.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE67BB240BC44AC9007B6929 /* ZoomValues.strings */; }; @@ -259,6 +261,7 @@ files = ( CE2BD8450BD4135600A5F4DB /* Sparkle.framework in CopyFiles */, CE5BC5B10C79A27B00EBDCF7 /* NSTableView_SKExtensions.h in CopyFiles */, + CE5BEA180C7C635400EBDCF7 /* NSGeometry_SKExtensions.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -488,6 +491,8 @@ CE5BC5B00C79A27B00EBDCF7 /* NSTableView_SKExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSTableView_SKExtensions.m; sourceTree = "<group>"; }; CE5BD6710C7ADF1500EBDCF7 /* SKTypeSelectHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKTypeSelectHelper.h; sourceTree = "<group>"; }; CE5BD6720C7ADF1500EBDCF7 /* SKTypeSelectHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKTypeSelectHelper.m; sourceTree = "<group>"; }; + CE5BEA160C7C635400EBDCF7 /* NSGeometry_SKExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSGeometry_SKExtensions.h; sourceTree = "<group>"; }; + CE5BEA170C7C635400EBDCF7 /* NSGeometry_SKExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSGeometry_SKExtensions.m; sourceTree = "<group>"; }; CE5F42AC0BF89FE00069D89C /* AppleRemote.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AppleRemote.h; path = vendorsrc/martinkahr/AppleRemoteSource_R80/AppleRemote.h; sourceTree = "<group>"; }; CE5F42AD0BF89FE00069D89C /* AppleRemote.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = AppleRemote.m; path = vendorsrc/martinkahr/AppleRemoteSource_R80/AppleRemote.m; sourceTree = "<group>"; }; CE5F42D30BF8A3400069D89C /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; }; @@ -817,6 +822,8 @@ CE2DE50C0B85DC4000D0DA12 /* PDFPage_SKExtensions.m */, CE49726A0BDE8A7400D7F1D2 /* PDFSelection_SKExtensions.h */, CE49726B0BDE8A7400D7F1D2 /* PDFSelection_SKExtensions.m */, + CE5BEA160C7C635400EBDCF7 /* NSGeometry_SKExtensions.h */, + CE5BEA170C7C635400EBDCF7 /* NSGeometry_SKExtensions.m */, ); name = Categories; sourceTree = "<group>"; @@ -1474,6 +1481,7 @@ CEF839B30C77742A00A3AD51 /* Files_SKExtensions.m in Sources */, CE5BC5B20C79A27B00EBDCF7 /* NSTableView_SKExtensions.m in Sources */, CE5BD6740C7ADF1500EBDCF7 /* SKTypeSelectHelper.m in Sources */, + CE5BEA190C7C635400EBDCF7 /* NSGeometry_SKExtensions.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-08-22 09:56:32
|
Revision: 2698 http://skim-app.svn.sourceforge.net/skim-app/?rev=2698&view=rev Author: hofman Date: 2007-08-22 02:56:30 -0700 (Wed, 22 Aug 2007) Log Message: ----------- Fix matching of substring for type select. Add some comments. Modified Paths: -------------- trunk/SKTypeSelectHelper.m Modified: trunk/SKTypeSelectHelper.m =================================================================== --- trunk/SKTypeSelectHelper.m 2007-08-21 23:55:47 UTC (rev 2697) +++ trunk/SKTypeSelectHelper.m 2007-08-22 09:56:30 UTC (rev 2698) @@ -266,21 +266,21 @@ unsigned int stringLength = [string length]; if (stringLength == 0 || stringLength > range.length) return NO; - if (mask & NSAnchoredSearch) - return [self rangeOfString:string options:mask range:range].length > 0; - NSRange searchRange = range; - while (searchRange.length >= stringLength) { - NSRange r = [self rangeOfString:string options:mask range:searchRange]; + while (range.length >= stringLength) { + NSRange r = [self rangeOfString:string options:mask range:range]; if (r.location == NSNotFound) return NO; - if (r.location == 0 || [[NSCharacterSet letterCharacterSet] characterIsMember:[self characterAtIndex:r.location - 1]]) + // see if we start at a "word boundary" + if (r.location == 0 || [[NSCharacterSet alphanumericCharacterSet] characterIsMember:[self characterAtIndex:r.location - 1]] == NO) return YES; + // if it's anchored, we only should search once + if (mask & NSAnchoredSearch) + return NO; + // get the new range, shifted by one from the last match if (mask & NSBackwardsSearch) - searchRange = NSMakeRange(searchRange.location, NSMaxRange(r) - searchRange.location - 1); + range = NSMakeRange(range.location, NSMaxRange(r) - range.location - 1); else - searchRange = NSMakeRange(r.location + 1, NSMaxRange(searchRange) - r.location - 1); - if (mask & NSAnchoredSearch) - return NO; + range = NSMakeRange(r.location + 1, NSMaxRange(range) - r.location - 1); } return NO; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-21 23:55:48
|
Revision: 2697 http://skim-app.svn.sourceforge.net/skim-app/?rev=2697&view=rev Author: hofman Date: 2007-08-21 16:55:47 -0700 (Tue, 21 Aug 2007) Log Message: ----------- Better determination of substring match for type-select. Modified Paths: -------------- trunk/SKTypeSelectHelper.m Modified: trunk/SKTypeSelectHelper.m =================================================================== --- trunk/SKTypeSelectHelper.m 2007-08-21 23:13:30 UTC (rev 2696) +++ trunk/SKTypeSelectHelper.m 2007-08-21 23:55:47 UTC (rev 2697) @@ -40,6 +40,12 @@ #define TIMEOUT 0.7 +@interface NSString (BDSKTypeAheadHelperExtensions) +- (BOOL)containsStringStartingAtWord:(NSString *)string options:(int)mask range:(NSRange)range; +@end + +#pragma mark - + @interface SKTypeSelectHelper (SKPrivate) - (NSArray *)searchCache; - (void)searchWithStickyMatch:(BOOL)allowUpdate; @@ -223,7 +229,6 @@ unsigned int labelIndex = selectedIndex; BOOL looped = NO; - unsigned int searchStringLength = [searchString length]; int options = NSCaseInsensitiveSearch; if (matchOption == SKPrefixMatch) @@ -243,11 +248,8 @@ if ([label caseInsensitiveCompare:searchString] == NSOrderedSame) return labelIndex; } else { - int location = [label length] < searchStringLength ? NSNotFound : [label rangeOfString:searchString options:options].location; - if (location != NSNotFound) { - if (location == 0 || [[NSCharacterSet letterCharacterSet] characterIsMember:[label characterAtIndex:location - 1]] == NO) - return labelIndex; - } + if ([label containsStringStartingAtWord:searchString options:options range:NSMakeRange(0, [label length])]) + return labelIndex; } } @@ -255,3 +257,32 @@ } @end + +#pragma mark - + +@implementation NSString (BDSKTypeAheadHelperExtensions) + +- (BOOL)containsStringStartingAtWord:(NSString *)string options:(int)mask range:(NSRange)range { + unsigned int stringLength = [string length]; + if (stringLength == 0 || stringLength > range.length) + return NO; + if (mask & NSAnchoredSearch) + return [self rangeOfString:string options:mask range:range].length > 0; + NSRange searchRange = range; + while (searchRange.length >= stringLength) { + NSRange r = [self rangeOfString:string options:mask range:searchRange]; + if (r.location == NSNotFound) + return NO; + if (r.location == 0 || [[NSCharacterSet letterCharacterSet] characterIsMember:[self characterAtIndex:r.location - 1]]) + return YES; + if (mask & NSBackwardsSearch) + searchRange = NSMakeRange(searchRange.location, NSMaxRange(r) - searchRange.location - 1); + else + searchRange = NSMakeRange(r.location + 1, NSMaxRange(searchRange) - r.location - 1); + if (mask & NSAnchoredSearch) + return NO; + } + return NO; +} + +@end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-21 23:13:32
|
Revision: 2696 http://skim-app.svn.sourceforge.net/skim-app/?rev=2696&view=rev Author: hofman Date: 2007-08-21 16:13:30 -0700 (Tue, 21 Aug 2007) Log Message: ----------- Rebuild type select search cache lazily. Modified Paths: -------------- trunk/SKTypeSelectHelper.m Modified: trunk/SKTypeSelectHelper.m =================================================================== --- trunk/SKTypeSelectHelper.m 2007-08-21 22:45:47 UTC (rev 2695) +++ trunk/SKTypeSelectHelper.m 2007-08-21 23:13:30 UTC (rev 2696) @@ -41,6 +41,7 @@ #define TIMEOUT 0.7 @interface SKTypeSelectHelper (SKPrivate) +- (NSArray *)searchCache; - (void)searchWithStickyMatch:(BOOL)allowUpdate; - (void)stopTimer; - (void)startTimerForSelector:(SEL)selector; @@ -156,6 +157,12 @@ @implementation SKTypeSelectHelper (SKPrivate) +- (NSArray *)searchCache { + if (searchCache == nil) + [self rebuildTypeSelectSearchCache]; + return searchCache; +} + - (void)stopTimer { [timer invalidate]; [timer release]; @@ -187,7 +194,7 @@ if (cycleResults) { selectedIndex = [dataSource typeSelectHelperCurrentlySelectedIndex:self]; - if (selectedIndex >= [searchCache count]) + if (selectedIndex >= [[self searchCache] count]) selectedIndex = NSNotFound; } else { selectedIndex = NSNotFound; @@ -195,7 +202,7 @@ startIndex = selectedIndex; if (sticky && selectedIndex != NSNotFound) - startIndex = startIndex > 0 ? startIndex - 1 : [searchCache count] - 1; + startIndex = startIndex > 0 ? startIndex - 1 : [[self searchCache] count] - 1; foundIndex = [self indexOfMatchedItemAfterIndex:startIndex]; @@ -206,11 +213,8 @@ } - (unsigned int)indexOfMatchedItemAfterIndex:(unsigned int)selectedIndex { - if (searchCache == nil) - [self rebuildTypeSelectSearchCache]; + unsigned int labelCount = [[self searchCache] count]; - unsigned int labelCount = [searchCache count]; - if (labelCount == NO) return NSNotFound; @@ -233,7 +237,7 @@ if (labelIndex == selectedIndex) looped = YES; - label = [searchCache objectAtIndex:labelIndex]; + label = [[self searchCache] objectAtIndex:labelIndex]; if (matchOption == SKFullStringMatch) { if ([label caseInsensitiveCompare:searchString] == NSOrderedSame) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-21 22:45:49
|
Revision: 2695 http://skim-app.svn.sourceforge.net/skim-app/?rev=2695&view=rev Author: hofman Date: 2007-08-21 15:45:47 -0700 (Tue, 21 Aug 2007) Log Message: ----------- Declare method in interface. Modified Paths: -------------- trunk/NSTableView_SKExtensions.m Modified: trunk/NSTableView_SKExtensions.m =================================================================== --- trunk/NSTableView_SKExtensions.m 2007-08-21 22:44:52 UTC (rev 2694) +++ trunk/NSTableView_SKExtensions.m 2007-08-21 22:45:47 UTC (rev 2695) @@ -40,7 +40,7 @@ #import "OBUtilities.h" -@implementation NSTableView (SKPrivateExtensions) +@interface NSTableView (SKPrivateExtensions) - (void)replacementKeyDown:(NSEvent *)theEvent; @end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-21 22:44:53
|
Revision: 2694 http://skim-app.svn.sourceforge.net/skim-app/?rev=2694&view=rev Author: hofman Date: 2007-08-21 15:44:52 -0700 (Tue, 21 Aug 2007) Log Message: ----------- Update dutch localization. Declare a method to silence compiler. Modified Paths: -------------- trunk/Dutch.lproj/BookmarksWindow.nib/info.nib trunk/Dutch.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/Dutch.lproj/Localizable.strings trunk/NSTableView_SKExtensions.m Modified: trunk/Dutch.lproj/BookmarksWindow.nib/info.nib =================================================================== --- trunk/Dutch.lproj/BookmarksWindow.nib/info.nib 2007-08-21 17:04:05 UTC (rev 2693) +++ trunk/Dutch.lproj/BookmarksWindow.nib/info.nib 2007-08-21 22:44:52 UTC (rev 2694) @@ -6,10 +6,6 @@ <string>69 58 356 240 0 0 1440 938 </string> <key>IBFramework Version</key> <string>446.1</string> - <key>IBOpenObjects</key> - <array> - <integer>5</integer> - </array> <key>IBSystem Version</key> <string>8R218</string> </dict> Modified: trunk/Dutch.lproj/BookmarksWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Dutch.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/NSTableView_SKExtensions.m =================================================================== --- trunk/NSTableView_SKExtensions.m 2007-08-21 17:04:05 UTC (rev 2693) +++ trunk/NSTableView_SKExtensions.m 2007-08-21 22:44:52 UTC (rev 2694) @@ -40,6 +40,10 @@ #import "OBUtilities.h" +@implementation NSTableView (SKPrivateExtensions) +- (void)replacementKeyDown:(NSEvent *)theEvent; +@end + @implementation NSTableView (SKExtensions) static IMP originalKeyDown = NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-21 17:04:10
|
Revision: 2693 http://skim-app.svn.sourceforge.net/skim-app/?rev=2693&view=rev Author: hofman Date: 2007-08-21 10:04:05 -0700 (Tue, 21 Aug 2007) Log Message: ----------- Rewrite type select, bit more modular. Allow to repeat a search by typing '/' (in the note table). Modified Paths: -------------- trunk/SKNoteOutlineView.m trunk/SKTypeSelectHelper.h trunk/SKTypeSelectHelper.m Modified: trunk/SKNoteOutlineView.m =================================================================== --- trunk/SKNoteOutlineView.m 2007-08-21 16:09:14 UTC (rev 2692) +++ trunk/SKNoteOutlineView.m 2007-08-21 17:04:05 UTC (rev 2693) @@ -89,6 +89,8 @@ [self delete:self]; else if (typeSelectHelper && modifiers == 0 && [[NSCharacterSet alphanumericCharacterSet] characterIsMember:eventChar]) [typeSelectHelper processKeyDownCharacter:eventChar]; + else if (typeSelectHelper && modifiers == 0 && eventChar == '/') + [typeSelectHelper repeatSearch]; else [super keyDown:theEvent]; } Modified: trunk/SKTypeSelectHelper.h =================================================================== --- trunk/SKTypeSelectHelper.h 2007-08-21 16:09:14 UTC (rev 2692) +++ trunk/SKTypeSelectHelper.h 2007-08-21 17:04:05 UTC (rev 2693) @@ -54,6 +54,7 @@ NSArray *searchCache; NSMutableString *searchString; NSTimer *timer; + BOOL processing; } - (id)dataSource; @@ -73,6 +74,7 @@ - (BOOL)isProcessing; - (void)processKeyDownCharacter:(unichar)character; +- (void)repeatSearch; @end Modified: trunk/SKTypeSelectHelper.m =================================================================== --- trunk/SKTypeSelectHelper.m 2007-08-21 16:09:14 UTC (rev 2692) +++ trunk/SKTypeSelectHelper.m 2007-08-21 17:04:05 UTC (rev 2693) @@ -38,9 +38,14 @@ #import "SKTypeSelectHelper.h" +#define TIMEOUT 0.7 @interface SKTypeSelectHelper (SKPrivate) -- (void)typeSelectSearchTimeout; +- (void)searchWithStickyMatch:(BOOL)allowUpdate; +- (void)stopTimer; +- (void)startTimerForSelector:(SEL)selector; +- (void)typeSelectSearchTimeout:(NSTimer *)aTimer; +- (void)typeSelectCleanTimeout:(NSTimer *)aTimer; - (unsigned int)indexOfMatchedItemAfterIndex:(unsigned int)selectedIndex; @end @@ -50,32 +55,32 @@ - (id)init { if (self = [super init]){ + searchString = [[NSMutableString alloc] init]; cycleResults = YES; - matchesImmediately = NO; + matchesImmediately = YES; matchOption = SKPrefixMatch; } return self; } - (void)dealloc { - [timer invalidate]; - [timer release]; + [self stopTimer]; [searchString release]; [searchCache release]; [super dealloc]; } -// API +#pragma mark Accessors + - (id)dataSource { return dataSource; } - (void)setDataSource:(id)newDataSource { - if (dataSource == newDataSource) - return; - - dataSource = newDataSource; - [self rebuildTypeSelectSearchCache]; + if (dataSource != newDataSource) { + dataSource = newDataSource; + [self rebuildTypeSelectSearchCache]; + } } - (BOOL)cyclesSimilarResults { @@ -102,6 +107,12 @@ matchOption = newValue; } +- (BOOL)isProcessing { + return processing; +} + +#pragma mark API + - (void)rebuildTypeSelectSearchCache { if (searchCache) [searchCache release]; @@ -110,13 +121,9 @@ } - (void)processKeyDownCharacter:(unichar)character { - NSString *selectedItem = nil; - unsigned int selectedIndex, foundIndex; + if (processing == NO) + [searchString setString:@""]; - // Create the search string the first time around - if (searchString == nil) - searchString = [[NSMutableString alloc] init]; - // Append the new character to the search string [searchString appendFormat:@"%C", character]; @@ -124,51 +131,59 @@ [dataSource typeSelectHelper:self updateSearchString:searchString]; // Reset the timer if it hasn't expired yet - NSDate *date = [NSDate dateWithTimeIntervalSinceNow:0.7]; + [self startTimerForSelector:@selector(typeSelectSearchTimeout:)]; + + if (matchesImmediately) + [self searchWithStickyMatch:processing]; + + processing = YES; +} + +- (void)repeatSearch { + [self searchWithStickyMatch:NO]; + + if ([searchString length] && [dataSource respondsToSelector:@selector(typeSelectHelper:updateSearchString:)]) + [dataSource typeSelectHelper:self updateSearchString:searchString]; + + [self startTimerForSelector:@selector(typeSelectCleanTimeout:)]; + + processing = NO; +} + +@end + +#pragma mark - + +@implementation SKTypeSelectHelper (SKPrivate) + +- (void)stopTimer { [timer invalidate]; [timer release]; timer = nil; - timer = [[NSTimer alloc] initWithFireDate:date interval:0 target:self selector:@selector(typeSelectSearchTimeout:) userInfo:NULL repeats:NO]; +} + +- (void)startTimerForSelector:(SEL)selector { + [self stopTimer]; + timer = [[NSTimer alloc] initWithFireDate:[NSDate dateWithTimeIntervalSinceNow:TIMEOUT] interval:0 target:self selector:selector userInfo:NULL repeats:NO]; [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSDefaultRunLoopMode]; - - if (matchesImmediately) { - if (cycleResults) { - selectedIndex = [dataSource typeSelectHelperCurrentlySelectedIndex:self]; - if (selectedIndex < [searchCache count]) - selectedItem = [searchCache objectAtIndex:selectedIndex]; - else - selectedIndex = NSNotFound; - - // Avoid flashing a selection all over the place while you're still typing the thing you have selected - if (matchOption == SKFullStringMatch) { - if ([selectedItem caseInsensitiveCompare:searchString] == NSOrderedSame) - return; - } else { - unsigned int searchStringLength = [searchString length]; - unsigned int selectedItemLength = [selectedItem length]; - NSRange range = NSMakeRange(0, matchOption == SKPrefixMatch ? searchStringLength : selectedItemLength); - if (searchStringLength > 1 && selectedItemLength >= searchStringLength && [selectedItem rangeOfString:searchString options:NSCaseInsensitiveSearch range:range].location != NSNotFound) - return; - } - - } else { - selectedIndex = NSNotFound; - } - - foundIndex = [self indexOfMatchedItemAfterIndex:selectedIndex]; - - if (foundIndex != NSNotFound) - [dataSource typeSelectHelper:self selectItemAtIndex:foundIndex]; - } } -- (BOOL)isProcessing { - return timer != nil; +- (void)typeSelectSearchTimeout:(NSTimer *)aTimer { + if (matchesImmediately == NO) + [self searchWithStickyMatch:NO]; + [self typeSelectCleanTimeout:aTimer]; } -- (void)typeSelectSearchTimeout:(NSTimer *)aTimer { - if (matchesImmediately == NO && [searchString length]) { - unsigned int selectedIndex, foundIndex; +- (void)typeSelectCleanTimeout:(NSTimer *)aTimer { + if ([dataSource respondsToSelector:@selector(typeSelectHelper:updateSearchString:)]) + [dataSource typeSelectHelper:self updateSearchString:nil]; + [self stopTimer]; + processing = NO; +} + +- (void)searchWithStickyMatch:(BOOL)sticky { + if ([searchString length]) { + unsigned int selectedIndex, startIndex, foundIndex; if (cycleResults) { selectedIndex = [dataSource typeSelectHelperCurrentlySelectedIndex:self]; @@ -177,18 +192,17 @@ } else { selectedIndex = NSNotFound; } - foundIndex = [self indexOfMatchedItemAfterIndex:selectedIndex]; - if (foundIndex != NSNotFound) + + startIndex = selectedIndex; + if (sticky && selectedIndex != NSNotFound) + startIndex = startIndex > 0 ? startIndex - 1 : [searchCache count] - 1; + + foundIndex = [self indexOfMatchedItemAfterIndex:startIndex]; + + // Avoid flashing a selection all over the place while you're still typing the thing you have selected + if (foundIndex != NSNotFound && foundIndex != selectedIndex) [dataSource typeSelectHelper:self selectItemAtIndex:foundIndex]; } - - if ([dataSource respondsToSelector:@selector(typeSelectHelper:updateSearchString:)]) - [dataSource typeSelectHelper:self updateSearchString:nil]; - [timer invalidate]; - [timer release]; - timer = nil; - [searchString release]; - searchString = nil; } - (unsigned int)indexOfMatchedItemAfterIndex:(unsigned int)selectedIndex { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-21 16:09:18
|
Revision: 2692 http://skim-app.svn.sourceforge.net/skim-app/?rev=2692&view=rev Author: hofman Date: 2007-08-21 09:09:14 -0700 (Tue, 21 Aug 2007) Log Message: ----------- fix delayed type select. Modified Paths: -------------- trunk/SKTypeSelectHelper.m Modified: trunk/SKTypeSelectHelper.m =================================================================== --- trunk/SKTypeSelectHelper.m 2007-08-21 14:33:23 UTC (rev 2691) +++ trunk/SKTypeSelectHelper.m 2007-08-21 16:09:14 UTC (rev 2692) @@ -171,11 +171,11 @@ unsigned int selectedIndex, foundIndex; if (cycleResults) { - selectedIndex = NSNotFound; - } else { selectedIndex = [dataSource typeSelectHelperCurrentlySelectedIndex:self]; if (selectedIndex >= [searchCache count]) selectedIndex = NSNotFound; + } else { + selectedIndex = NSNotFound; } foundIndex = [self indexOfMatchedItemAfterIndex:selectedIndex]; if (foundIndex != NSNotFound) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-21 14:33:24
|
Revision: 2691 http://skim-app.svn.sourceforge.net/skim-app/?rev=2691&view=rev Author: hofman Date: 2007-08-21 07:33:23 -0700 (Tue, 21 Aug 2007) Log Message: ----------- Show status message during type-select. Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-08-21 14:20:35 UTC (rev 2690) +++ trunk/SKMainWindowController.m 2007-08-21 14:33:23 UTC (rev 2691) @@ -3559,6 +3559,20 @@ } } +- (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper updateSearchString:(NSString *)searchString { + if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]]) { + if (searchString) + [statusBar setLeftStringValue:[NSString stringWithFormat:NSLocalizedString(@"Go to page: %@", @"Status message"), searchString]]; + else + [self updateLeftStatus]; + } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { + if (searchString) + [statusBar setRightStringValue:[NSString stringWithFormat:NSLocalizedString(@"Finding note: \"%@\"", @"Status message"), searchString]]; + else + [self updateRightStatus]; + } +} + #pragma mark Outline - (int)outlineRowForPageIndex:(unsigned int)pageIndex { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-21 14:20:44
|
Revision: 2690 http://skim-app.svn.sourceforge.net/skim-app/?rev=2690&view=rev Author: hofman Date: 2007-08-21 07:20:35 -0700 (Tue, 21 Aug 2007) Log Message: ----------- Implement type-select for thumbnail tableview and note outlineviews. Modified Paths: -------------- trunk/SKMainWindowController.m trunk/SKNoteOutlineView.h trunk/SKNoteOutlineView.m trunk/SKNotesDocument.m trunk/SKThumbnailTableView.h trunk/SKThumbnailTableView.m trunk/Skim.xcodeproj/project.pbxproj Added Paths: ----------- trunk/SKTypeSelectHelper.h trunk/SKTypeSelectHelper.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-08-20 18:21:29 UTC (rev 2689) +++ trunk/SKMainWindowController.m 2007-08-21 14:20:35 UTC (rev 2690) @@ -77,6 +77,7 @@ #import "SKColorSwatch.h" #import "SKStatusBar.h" #import "SKTransitionController.h" +#import "SKTypeSelectHelper.h" #define SEGMENTED_CONTROL_HEIGHT 25.0 #define WINDOW_X_DELTA 0.0 @@ -371,6 +372,18 @@ [self showSnapshotAtPageNumber:[[setup objectForKey:@"page"] unsignedIntValue] forRect:NSRectFromString([setup objectForKey:@"rect"]) factor:[[setup objectForKey:@"scaleFactor"] floatValue] autoFits:[[setup objectForKey:@"autoFits"] boolValue] display:[[setup objectForKey:@"hasWindow"] boolValue]]; } + // typeSelectHelpers + SKTypeSelectHelper *typeSelectHelper = [[[SKTypeSelectHelper alloc] init] autorelease]; + [typeSelectHelper setMatchesImmediately:NO]; + [typeSelectHelper setMatchOption:SKFullStringMatch]; + [typeSelectHelper setDataSource:self]; + [thumbnailTableView setTypeSelectHelper:typeSelectHelper]; + + typeSelectHelper = [[[SKTypeSelectHelper alloc] init] autorelease]; + [typeSelectHelper setMatchOption:SKSubstringMatch]; + [typeSelectHelper setDataSource:self]; + [noteOutlineView setTypeSelectHelper:typeSelectHelper]; + // This update toolbar item and other states [self handleChangedHistoryNotification:nil]; [self handlePageChangedNotification:nil]; @@ -780,6 +793,7 @@ [pageLabels addObject:label ? label : @""]; } [self didChangeValueForKey:@"pageLabels"]; + [[thumbnailTableView typeSelectHelper] rebuildTypeSelectSearchCache]; NSEnumerator *setupEnum = [snapshotDicts objectEnumerator]; NSDictionary *setup; @@ -3516,6 +3530,35 @@ return menu; } +#pragma mark SKTypeSelectHelper datasource protocol + +- (NSArray *)typeSelectHelperSelectionItems:(SKTypeSelectHelper *)typeSelectHelper { + if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]]) { + return pageLabels; + } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { + return [[noteArrayController arrangedObjects] valueForKey:@"contents"]; + } + return nil; +} + +- (unsigned int)typeSelectHelperCurrentlySelectedIndex:(SKTypeSelectHelper *)typeSelectHelper { + if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]]) { + return [[thumbnailTableView selectedRowIndexes] lastIndex]; + } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { + return [[noteArrayController arrangedObjects] indexOfObject:[self selectedNote]]; + } + return NSNotFound; +} + +- (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper selectItemAtIndex:(unsigned int)itemIndex { + if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]]) { + [self setPageNumber:itemIndex + 1]; + } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { + int row = [noteOutlineView rowForItem:[[noteArrayController arrangedObjects] objectAtIndex:itemIndex]]; + [noteOutlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; + } +} + #pragma mark Outline - (int)outlineRowForPageIndex:(unsigned int)pageIndex { Modified: trunk/SKNoteOutlineView.h =================================================================== --- trunk/SKNoteOutlineView.h 2007-08-20 18:21:29 UTC (rev 2689) +++ trunk/SKNoteOutlineView.h 2007-08-21 14:20:35 UTC (rev 2690) @@ -38,10 +38,12 @@ #import <Cocoa/Cocoa.h> +@class SKTypeSelectHelper; @interface SKNoteOutlineView : NSOutlineView { IBOutlet NSWindow *noteTypeSheet; IBOutlet NSMatrix *noteTypeMatrix; + SKTypeSelectHelper *typeSelectHelper; } - (NSArray *)noteTypes; @@ -53,6 +55,9 @@ - (IBAction)selectNoteTypes:(id)sender; - (IBAction)dismissNoteTypeSheet:(id)sender; +- (SKTypeSelectHelper *)typeSelectHelper; +- (void)setTypeSelectHelper:(SKTypeSelectHelper *)newTypeSelectHelper; + @end Modified: trunk/SKNoteOutlineView.m =================================================================== --- trunk/SKNoteOutlineView.m 2007-08-20 18:21:29 UTC (rev 2689) +++ trunk/SKNoteOutlineView.m 2007-08-21 14:20:35 UTC (rev 2690) @@ -39,11 +39,14 @@ #import "SKNoteOutlineView.h" #import <Quartz/Quartz.h> #import "NSString_SKExtensions.h" +#import "SKTypeSelectHelper.h" @implementation SKNoteOutlineView - (void)dealloc { + [typeSelectHelper setDataSource:nil]; + [typeSelectHelper release]; [noteTypeSheet release]; [super dealloc]; } @@ -52,6 +55,22 @@ [self noteTypeMenu]; // this sets the menu for the header view } +- (SKTypeSelectHelper *)typeSelectHelper { + return typeSelectHelper; +} + +- (void)setTypeSelectHelper:(SKTypeSelectHelper *)newTypeSelectHelper { + if (typeSelectHelper != newTypeSelectHelper) { + [typeSelectHelper release]; + typeSelectHelper = [newTypeSelectHelper retain]; + } +} + +- (void)reloadData{ + [super reloadData]; + [typeSelectHelper rebuildTypeSelectSearchCache]; +} + - (void)delete:(id)sender { if ([[self delegate] respondsToSelector:@selector(outlineViewDeleteSelectedRows:)]) { if ([[self selectedRowIndexes] count] == 0) @@ -68,6 +87,8 @@ if ((eventChar == NSDeleteCharacter || eventChar == NSDeleteFunctionKey) && modifiers == 0) [self delete:self]; + else if (typeSelectHelper && modifiers == 0 && [[NSCharacterSet alphanumericCharacterSet] characterIsMember:eventChar]) + [typeSelectHelper processKeyDownCharacter:eventChar]; else [super keyDown:theEvent]; } Modified: trunk/SKNotesDocument.m =================================================================== --- trunk/SKNotesDocument.m 2007-08-20 18:21:29 UTC (rev 2689) +++ trunk/SKNotesDocument.m 2007-08-21 14:20:35 UTC (rev 2690) @@ -45,6 +45,8 @@ #import "SKApplicationController.h" #import "NSValue_SKExtensions.h" #import "NSString_SKExtensions.h" +#import "SKTypeSelectHelper.h" +#import "SKPDFAnnotationNote.h" @implementation SKNotesDocument @@ -71,6 +73,11 @@ NSSortDescriptor *contentsSortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"contents" ascending:YES selector:@selector(localizedCaseInsensitiveNumericCompare:)] autorelease]; [arrayController setSortDescriptors:[NSArray arrayWithObjects:indexSortDescriptor, contentsSortDescriptor, nil]]; [outlineView reloadData]; + + SKTypeSelectHelper *typeSelectHelper = [[[SKTypeSelectHelper alloc] init] autorelease]; + [typeSelectHelper setMatchOption:SKSubstringMatch]; + [typeSelectHelper setDataSource:self]; + [outlineView setTypeSelectHelper:typeSelectHelper]; } - (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError { @@ -319,4 +326,28 @@ return [item valueForKey:@"type"] ? [item valueForKey:@"contents"] : [[item valueForKey:@"contents"] string]; } +#pragma mark SKTypeSelectHelper datasource protocol + +- (NSArray *)typeSelectHelperSelectionItems:(SKTypeSelectHelper *)typeSelectHelper { + return [[arrayController arrangedObjects] valueForKey:@"contents"]; +} + +- (unsigned int)typeSelectHelperCurrentlySelectedIndex:(SKTypeSelectHelper *)typeSelectHelper { + NSArray *arrangedNotes = [arrayController arrangedObjects]; + int row = [outlineView selectedRow]; + id item = nil; + if (row == -1) + return NSNotFound; + item = [outlineView itemAtRow:row]; + if ([item valueForKey:@"type"]) + return [arrangedNotes indexOfObject:item]; + else + return [[arrangedNotes valueForKey:@"child"] indexOfObject:item]; +} + +- (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper selectItemAtIndex:(unsigned int)itemIndex { + int row = [outlineView rowForItem:[[arrayController arrangedObjects] objectAtIndex:itemIndex]]; + [outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; +} + @end Modified: trunk/SKThumbnailTableView.h =================================================================== --- trunk/SKThumbnailTableView.h 2007-08-20 18:21:29 UTC (rev 2689) +++ trunk/SKThumbnailTableView.h 2007-08-21 14:20:35 UTC (rev 2690) @@ -39,12 +39,20 @@ #import <Cocoa/Cocoa.h> +@class SKTypeSelectHelper; + @interface SKThumbnailTableView : NSTableView { BOOL isScrolling; + SKTypeSelectHelper *typeSelectHelper; } + - (BOOL)isScrolling; - (BOOL)canCopy; + +- (SKTypeSelectHelper *)typeSelectHelper; +- (void)setTypeSelectHelper:(SKTypeSelectHelper *)newTypeSelectHelper; + @end Modified: trunk/SKThumbnailTableView.m =================================================================== --- trunk/SKThumbnailTableView.m 2007-08-20 18:21:29 UTC (rev 2689) +++ trunk/SKThumbnailTableView.m 2007-08-21 14:20:35 UTC (rev 2690) @@ -38,6 +38,7 @@ #import "SKThumbnailTableView.h" #import "OBUtilities.h" +#import "SKTypeSelectHelper.h" static NSString *SKScrollerWillScrollNotification = @"SKScrollerWillScrollNotification"; static NSString *SKScrollerDidScrollNotification = @"SKScrollerDidScrollNotification"; @@ -66,6 +67,8 @@ - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; + [typeSelectHelper setDataSource:nil]; + [typeSelectHelper release]; [super dealloc]; } @@ -122,6 +125,34 @@ [super highlightSelectionInClipRect:clipRect]; } +- (SKTypeSelectHelper *)typeSelectHelper { + return typeSelectHelper; +} + +- (void)setTypeSelectHelper:(SKTypeSelectHelper *)newTypeSelectHelper { + if (typeSelectHelper != newTypeSelectHelper) { + [typeSelectHelper release]; + typeSelectHelper = [newTypeSelectHelper retain]; + } +} + +- (void)reloadData{ + [super reloadData]; + [typeSelectHelper rebuildTypeSelectSearchCache]; +} + +- (void)keyDown:(NSEvent *)theEvent { + NSString *characters = [theEvent charactersIgnoringModifiers]; + unichar eventChar = [characters length] > 0 ? [characters characterAtIndex:0] : 0; + unsigned modifierFlags = [theEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask; + + if (typeSelectHelper && modifierFlags == 0 && [[NSCharacterSet alphanumericCharacterSet] characterIsMember:eventChar]) { + [typeSelectHelper processKeyDownCharacter:eventChar]; + } else { + [super keyDown:theEvent]; + } +} + - (void)mouseDown:(NSEvent *)theEvent { if (([theEvent modifierFlags] & NSCommandKeyMask) && [[self delegate] respondsToSelector:@selector(tableView:commandSelectRow:)]) { int row = [self rowAtPoint:[self convertPoint:[theEvent locationInWindow] fromView:nil]]; Added: trunk/SKTypeSelectHelper.h =================================================================== --- trunk/SKTypeSelectHelper.h (rev 0) +++ trunk/SKTypeSelectHelper.h 2007-08-21 14:20:35 UTC (rev 2690) @@ -0,0 +1,88 @@ +// +// SKTypeSelectHelper.h +// Skim +// +// Created by Christiaan Hofman on 8/21/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> + + +enum { + SKPrefixMatch, + SKSubstringMatch, + SKFullStringMatch +}; + +@interface SKTypeSelectHelper : NSObject { + id dataSource; + BOOL cycleResults; + int matchOption; + BOOL matchesImmediately; + + NSArray *searchCache; + NSMutableString *searchString; + NSTimer *timer; +} + +- (id)dataSource; +- (void)setDataSource:(id)anObject; + +- (BOOL)cyclesSimilarResults; +- (void)setCyclesSimilarResults:(BOOL)newValue; + +- (BOOL)matchesImmediately; +- (void)setMatchesImmediately:(BOOL)newValue; + +- (int)matchOption; +- (void)setMatchOption:(int)newValue; + +- (void)rebuildTypeSelectSearchCache; + +- (BOOL)isProcessing; + +- (void)processKeyDownCharacter:(unichar)character; + +@end + + +@interface NSObject (SKTypeSelectDataSource) + +- (NSArray *)typeSelectHelperSelectionItems:(SKTypeSelectHelper *)typeSelectHelper; // required +- (unsigned int)typeSelectHelperCurrentlySelectedIndex:(SKTypeSelectHelper *)typeSelectHelper; // required +- (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper selectItemAtIndex:(unsigned int)itemIndex; // required + +- (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper updateSearchString:(NSString *)searchString; // optional + +@end Added: trunk/SKTypeSelectHelper.m =================================================================== --- trunk/SKTypeSelectHelper.m (rev 0) +++ trunk/SKTypeSelectHelper.m 2007-08-21 14:20:35 UTC (rev 2690) @@ -0,0 +1,239 @@ +// +// SKTypeSelectHelper.m +// Skim +// +// Created by Christiaan Hofman on 8/21/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 "SKTypeSelectHelper.h" + + +@interface SKTypeSelectHelper (SKPrivate) +- (void)typeSelectSearchTimeout; +- (unsigned int)indexOfMatchedItemAfterIndex:(unsigned int)selectedIndex; +@end + +@implementation SKTypeSelectHelper + +// Init and dealloc + +- (id)init { + if (self = [super init]){ + cycleResults = YES; + matchesImmediately = NO; + matchOption = SKPrefixMatch; + } + return self; +} + +- (void)dealloc { + [timer invalidate]; + [timer release]; + [searchString release]; + [searchCache release]; + [super dealloc]; +} + +// API +- (id)dataSource { + return dataSource; +} + +- (void)setDataSource:(id)newDataSource { + if (dataSource == newDataSource) + return; + + dataSource = newDataSource; + [self rebuildTypeSelectSearchCache]; +} + +- (BOOL)cyclesSimilarResults { + return cycleResults; +} + +- (void)setCyclesSimilarResults:(BOOL)newValue { + cycleResults = newValue; +} + +- (BOOL)matchesImmediately { + return matchesImmediately; +} + +- (void)setMatchesImmediately:(BOOL)newValue { + matchesImmediately = newValue; +} + +- (int)matchOption { + return matchOption; +} + +- (void)setMatchOption:(int)newValue { + matchOption = newValue; +} + +- (void)rebuildTypeSelectSearchCache { + if (searchCache) + [searchCache release]; + + searchCache = [[dataSource typeSelectHelperSelectionItems:self] retain]; +} + +- (void)processKeyDownCharacter:(unichar)character { + NSString *selectedItem = nil; + unsigned int selectedIndex, foundIndex; + + // Create the search string the first time around + if (searchString == nil) + searchString = [[NSMutableString alloc] init]; + + // Append the new character to the search string + [searchString appendFormat:@"%C", character]; + + if ([dataSource respondsToSelector:@selector(typeSelectHelper:updateSearchString:)]) + [dataSource typeSelectHelper:self updateSearchString:searchString]; + + // Reset the timer if it hasn't expired yet + NSDate *date = [NSDate dateWithTimeIntervalSinceNow:0.7]; + [timer invalidate]; + [timer release]; + timer = nil; + timer = [[NSTimer alloc] initWithFireDate:date interval:0 target:self selector:@selector(typeSelectSearchTimeout:) userInfo:NULL repeats:NO]; + [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSDefaultRunLoopMode]; + + if (matchesImmediately) { + if (cycleResults) { + selectedIndex = [dataSource typeSelectHelperCurrentlySelectedIndex:self]; + if (selectedIndex < [searchCache count]) + selectedItem = [searchCache objectAtIndex:selectedIndex]; + else + selectedIndex = NSNotFound; + + // Avoid flashing a selection all over the place while you're still typing the thing you have selected + if (matchOption == SKFullStringMatch) { + if ([selectedItem caseInsensitiveCompare:searchString] == NSOrderedSame) + return; + } else { + unsigned int searchStringLength = [searchString length]; + unsigned int selectedItemLength = [selectedItem length]; + NSRange range = NSMakeRange(0, matchOption == SKPrefixMatch ? searchStringLength : selectedItemLength); + if (searchStringLength > 1 && selectedItemLength >= searchStringLength && [selectedItem rangeOfString:searchString options:NSCaseInsensitiveSearch range:range].location != NSNotFound) + return; + } + + } else { + selectedIndex = NSNotFound; + } + + foundIndex = [self indexOfMatchedItemAfterIndex:selectedIndex]; + + if (foundIndex != NSNotFound) + [dataSource typeSelectHelper:self selectItemAtIndex:foundIndex]; + } +} + +- (BOOL)isProcessing { + return timer != nil; +} + +- (void)typeSelectSearchTimeout:(NSTimer *)aTimer { + if (matchesImmediately == NO && [searchString length]) { + unsigned int selectedIndex, foundIndex; + + if (cycleResults) { + selectedIndex = NSNotFound; + } else { + selectedIndex = [dataSource typeSelectHelperCurrentlySelectedIndex:self]; + if (selectedIndex >= [searchCache count]) + selectedIndex = NSNotFound; + } + foundIndex = [self indexOfMatchedItemAfterIndex:selectedIndex]; + if (foundIndex != NSNotFound) + [dataSource typeSelectHelper:self selectItemAtIndex:foundIndex]; + } + + if ([dataSource respondsToSelector:@selector(typeSelectHelper:updateSearchString:)]) + [dataSource typeSelectHelper:self updateSearchString:nil]; + [timer invalidate]; + [timer release]; + timer = nil; + [searchString release]; + searchString = nil; +} + +- (unsigned int)indexOfMatchedItemAfterIndex:(unsigned int)selectedIndex { + if (searchCache == nil) + [self rebuildTypeSelectSearchCache]; + + unsigned int labelCount = [searchCache count]; + + if (labelCount == NO) + return NSNotFound; + + if (selectedIndex == NSNotFound) + selectedIndex = labelCount - 1; + + unsigned int labelIndex = selectedIndex; + BOOL looped = NO; + unsigned int searchStringLength = [searchString length]; + int options = NSCaseInsensitiveSearch; + + if (matchOption == SKPrefixMatch) + options |= NSAnchoredSearch; + + while (looped == NO) { + NSString *label; + + if (++labelIndex == labelCount) + labelIndex = 0; + if (labelIndex == selectedIndex) + looped = YES; + + label = [searchCache objectAtIndex:labelIndex]; + + if (matchOption == SKFullStringMatch) { + if ([label caseInsensitiveCompare:searchString] == NSOrderedSame) + return labelIndex; + } else { + int location = [label length] < searchStringLength ? NSNotFound : [label rangeOfString:searchString options:options].location; + if (location != NSNotFound) { + if (location == 0 || [[NSCharacterSet letterCharacterSet] characterIsMember:[label characterAtIndex:location - 1]] == NO) + return labelIndex; + } + } + } + + return NSNotFound; +} + +@end Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-08-20 18:21:29 UTC (rev 2689) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-08-21 14:20:35 UTC (rev 2690) @@ -128,6 +128,7 @@ CE54898F0B35D50E00F8AFB6 /* SKInfoWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE54898E0B35D50E00F8AFB6 /* SKInfoWindowController.m */; }; CE5BC5B10C79A27B00EBDCF7 /* NSTableView_SKExtensions.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE5BC5AF0C79A27B00EBDCF7 /* NSTableView_SKExtensions.h */; }; CE5BC5B20C79A27B00EBDCF7 /* NSTableView_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5BC5B00C79A27B00EBDCF7 /* NSTableView_SKExtensions.m */; }; + CE5BD6740C7ADF1500EBDCF7 /* SKTypeSelectHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5BD6720C7ADF1500EBDCF7 /* SKTypeSelectHelper.m */; }; CE5F42AF0BF89FE00069D89C /* AppleRemote.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5F42AD0BF89FE00069D89C /* AppleRemote.m */; }; CE5F43730BF8A3410069D89C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE5F42D30BF8A3400069D89C /* IOKit.framework */; }; CE67BB260BC44AC9007B6929 /* ZoomValues.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE67BB240BC44AC9007B6929 /* ZoomValues.strings */; }; @@ -485,6 +486,8 @@ CE54AA8E0BBC037400008750 /* ReleaseNotes.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = ReleaseNotes.rtf; sourceTree = "<group>"; }; CE5BC5AF0C79A27B00EBDCF7 /* NSTableView_SKExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSTableView_SKExtensions.h; sourceTree = "<group>"; }; CE5BC5B00C79A27B00EBDCF7 /* NSTableView_SKExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSTableView_SKExtensions.m; sourceTree = "<group>"; }; + CE5BD6710C7ADF1500EBDCF7 /* SKTypeSelectHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKTypeSelectHelper.h; sourceTree = "<group>"; }; + CE5BD6720C7ADF1500EBDCF7 /* SKTypeSelectHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKTypeSelectHelper.m; sourceTree = "<group>"; }; CE5F42AC0BF89FE00069D89C /* AppleRemote.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AppleRemote.h; path = vendorsrc/martinkahr/AppleRemoteSource_R80/AppleRemote.h; sourceTree = "<group>"; }; CE5F42AD0BF89FE00069D89C /* AppleRemote.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = AppleRemote.m; path = vendorsrc/martinkahr/AppleRemoteSource_R80/AppleRemote.m; sourceTree = "<group>"; }; CE5F42D30BF8A3400069D89C /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; }; @@ -979,6 +982,8 @@ CE1E2B270BDAB6180011D9DD /* SKPDFSynchronizer.m */, CE48BAD50C089EA300A166C6 /* SKTemplateParser.h */, CE48BAD60C089EA300A166C6 /* SKTemplateParser.m */, + CE5BD6710C7ADF1500EBDCF7 /* SKTypeSelectHelper.h */, + CE5BD6720C7ADF1500EBDCF7 /* SKTypeSelectHelper.m */, ); name = Miscellaneous; sourceTree = "<group>"; @@ -1468,6 +1473,7 @@ CEAA67260C70A882006BD633 /* NSURL_SKExtensions.m in Sources */, CEF839B30C77742A00A3AD51 /* Files_SKExtensions.m in Sources */, CE5BC5B20C79A27B00EBDCF7 /* NSTableView_SKExtensions.m in Sources */, + CE5BD6740C7ADF1500EBDCF7 /* SKTypeSelectHelper.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-08-20 18:21:30
|
Revision: 2689 http://skim-app.svn.sourceforge.net/skim-app/?rev=2689&view=rev Author: hofman Date: 2007-08-20 11:21:29 -0700 (Mon, 20 Aug 2007) Log Message: ----------- Implement undo, reordering, delete for bookmarks. Use custom data objects for bookmarks. Modified Paths: -------------- trunk/Dutch.lproj/BookmarksWindow.nib/classes.nib trunk/Dutch.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/English.lproj/BookmarksWindow.nib/classes.nib trunk/English.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/French.lproj/BookmarksWindow.nib/classes.nib trunk/French.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/Italian.lproj/BookmarksWindow.nib/classes.nib trunk/Italian.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/NSTableView_SKExtensions.h trunk/NSTableView_SKExtensions.m trunk/SKApplicationController.m trunk/SKBookmarkController.h trunk/SKBookmarkController.m trunk/SKThumbnailTableView.h trunk/SKThumbnailTableView.m Modified: trunk/Dutch.lproj/BookmarksWindow.nib/classes.nib =================================================================== --- trunk/Dutch.lproj/BookmarksWindow.nib/classes.nib 2007-08-20 10:51:17 UTC (rev 2688) +++ trunk/Dutch.lproj/BookmarksWindow.nib/classes.nib 2007-08-20 18:21:29 UTC (rev 2689) @@ -5,6 +5,7 @@ { CLASS = SKBookmarkController; LANGUAGE = ObjC; + OUTLETS = {tableView = NSTableView; }; SUPERCLASS = NSWindowController; } ); Modified: trunk/Dutch.lproj/BookmarksWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/BookmarksWindow.nib/classes.nib =================================================================== --- trunk/English.lproj/BookmarksWindow.nib/classes.nib 2007-08-20 10:51:17 UTC (rev 2688) +++ trunk/English.lproj/BookmarksWindow.nib/classes.nib 2007-08-20 18:21:29 UTC (rev 2689) @@ -5,6 +5,7 @@ { CLASS = SKBookmarkController; LANGUAGE = ObjC; + OUTLETS = {tableView = NSTableView; }; SUPERCLASS = NSWindowController; } ); Modified: trunk/English.lproj/BookmarksWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/French.lproj/BookmarksWindow.nib/classes.nib =================================================================== --- trunk/French.lproj/BookmarksWindow.nib/classes.nib 2007-08-20 10:51:17 UTC (rev 2688) +++ trunk/French.lproj/BookmarksWindow.nib/classes.nib 2007-08-20 18:21:29 UTC (rev 2689) @@ -5,6 +5,7 @@ { CLASS = SKBookmarkController; LANGUAGE = ObjC; + OUTLETS = {tableView = NSTableView; }; SUPERCLASS = NSWindowController; } ); Modified: trunk/French.lproj/BookmarksWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/BookmarksWindow.nib/classes.nib =================================================================== --- trunk/Italian.lproj/BookmarksWindow.nib/classes.nib 2007-08-20 10:51:17 UTC (rev 2688) +++ trunk/Italian.lproj/BookmarksWindow.nib/classes.nib 2007-08-20 18:21:29 UTC (rev 2689) @@ -5,6 +5,7 @@ { CLASS = SKBookmarkController; LANGUAGE = ObjC; + OUTLETS = {tableView = NSTableView; }; SUPERCLASS = NSWindowController; } ); Modified: trunk/Italian.lproj/BookmarksWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/NSTableView_SKExtensions.h =================================================================== --- trunk/NSTableView_SKExtensions.h 2007-08-20 10:51:17 UTC (rev 2688) +++ trunk/NSTableView_SKExtensions.h 2007-08-20 18:21:29 UTC (rev 2689) @@ -40,5 +40,12 @@ @interface NSTableView (SKExtensions) +- (BOOL)canDelete; +- (void)delete:(id)sender; +@end + +@interface NSObject (NSTableViewSKExtendedDelegate) +- (void)tableView:(NSTableView *)aTableView deleteRowsWithIndexes:(NSIndexSet *)rowIndexes; +- (BOOL)tableView:(NSTableView *)aTableView canDeleteRowsWithIndexes:(NSIndexSet *)rowIndexes; @end Modified: trunk/NSTableView_SKExtensions.m =================================================================== --- trunk/NSTableView_SKExtensions.m 2007-08-20 10:51:17 UTC (rev 2688) +++ trunk/NSTableView_SKExtensions.m 2007-08-20 18:21:29 UTC (rev 2689) @@ -63,7 +63,9 @@ unichar eventChar = [characters length] > 0 ? [characters characterAtIndex:0] : 0; unsigned modifierFlags = [theEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask; - if (eventChar == NSHomeFunctionKey && (modifierFlags & ~NSFunctionKeyMask) == 0) + if ((eventChar == NSDeleteCharacter || eventChar == NSDeleteFunctionKey) && modifierFlags == 0 && [self canDelete]) + [self delete:self]; + else if (eventChar == NSHomeFunctionKey && (modifierFlags & ~NSFunctionKeyMask) == 0) [self scrollToBeginningOfDocument:nil]; else if (eventChar == NSEndFunctionKey && (modifierFlags & ~NSFunctionKeyMask) == 0) [self scrollToEndOfDocument:nil]; @@ -71,4 +73,25 @@ originalKeyDown(self, _cmd, theEvent); } +- (BOOL)canDelete { + NSIndexSet *indexes = [self selectedRowIndexes]; + return [indexes count] && + [[self delegate] respondsToSelector:@selector(tableView:canDeleteRowsWithIndexes:)] && + [[self delegate] respondsToSelector:@selector(tableView:deleteRowsWithIndexes:)] && + [[self delegate] tableView:self canDeleteRowsWithIndexes:indexes]; +} + +- (void)delete:(id)sender { + if ([self canDelete]) + [[self delegate] tableView:self deleteRowsWithIndexes:[self selectedRowIndexes]]; + else + NSBeep(); +} + +- (BOOL)validateMenuItem:(NSMenuItem *)menuItem { + if ([menuItem action] == @selector(delete:)) + return [self canDelete]; + return YES; +} + @end Modified: trunk/SKApplicationController.m =================================================================== --- trunk/SKApplicationController.m 2007-08-20 10:51:17 UTC (rev 2688) +++ trunk/SKApplicationController.m 2007-08-20 18:21:29 UTC (rev 2689) @@ -212,11 +212,8 @@ } - (IBAction)openBookmark:(id)sender { - int i = [sender tag]; - NSArray *bookmarks = [[SKBookmarkController sharedBookmarkController] bookmarks]; - NSDictionary *bm = [bookmarks objectAtIndex:i]; - - [[SKBookmarkController sharedBookmarkController] openBookmarks:[NSArray arrayWithObjects:bm, nil]]; + SKBookmark *bookmark = [sender representedObject]; + [[SKBookmarkController sharedBookmarkController] openBookmarks:[NSArray arrayWithObjects:bookmark, nil]]; } #pragma mark Support @@ -229,10 +226,10 @@ if (iMax > 0) [menu addItem:[NSMenuItem separatorItem]]; for (i = 0; i < iMax; i++) { - NSDictionary *bm = [bookmarks objectAtIndex:i]; - NSMenuItem *item = [menu addItemWithTitle:[bm objectForKey:@"label"] action:@selector(openBookmark:) keyEquivalent:@""]; + SKBookmark *bm = [bookmarks objectAtIndex:i]; + NSMenuItem *item = [menu addItemWithTitle:[bm label] action:@selector(openBookmark:) keyEquivalent:@""]; [item setTarget:self]; - [item setTag:i]; + [item setRepresentedObject:bm]; } } Modified: trunk/SKBookmarkController.h =================================================================== --- trunk/SKBookmarkController.h 2007-08-20 10:51:17 UTC (rev 2688) +++ trunk/SKBookmarkController.h 2007-08-20 18:21:29 UTC (rev 2689) @@ -40,8 +40,10 @@ @interface SKBookmarkController : NSWindowController { + IBOutlet NSTableView *tableView; NSMutableArray *bookmarks; NSMutableArray *recentDocuments; + NSUndoManager *undoManager; } + (id)sharedBookmarkController; @@ -55,6 +57,7 @@ - (void)addBookmarkForPath:(NSString *)path pageIndex:(unsigned)pageIndex label:(NSString *)label; - (void)saveBookmarks; +- (void)handleBookmarkChangedNotification:(NSNotification *)notification; - (NSString *)bookmarksFilePath; - (void)openBookmarks:(NSArray *)items; @@ -63,10 +66,30 @@ - (unsigned int)pageIndexForRecentDocumentAtPath:(NSString *)path; - (NSArray *)snapshotsAtPath:(NSString *)path; -@end +- (NSUndoManager *)undoManager; -@interface SKPageIndexTransformer : NSValueTransformer @end -@interface SKAliasDataTransformer : NSValueTransformer + +@interface SKBookmark : NSObject <NSCopying> { + NSString *path; + NSData *aliasData; + NSString *label; + unsigned int pageIndex; +} + +- (id)initWithPath:(NSString *)aPath aliasData:(NSData *)aData pageIndex:(unsigned)aPageIndex label:(NSString *)aLabel; +- (id)initWithPath:(NSString *)aPath pageIndex:(unsigned)aPageIndex label:(NSString *)aLabel; +- (id)initWithDictionary:(NSDictionary *)dictionary; + +- (NSDictionary *)dictionaryValue; + +- (NSString *)path; +- (NSData *)aliasData; +- (NSString *)resolvedPath; +- (unsigned int)pageIndex; +- (NSNumber *)pageNumber; +- (NSString *)label; +- (void)setLabel:(NSString *)newLabel; + @end Modified: trunk/SKBookmarkController.m =================================================================== --- trunk/SKBookmarkController.m 2007-08-20 10:51:17 UTC (rev 2688) +++ trunk/SKBookmarkController.m 2007-08-20 18:21:29 UTC (rev 2689) @@ -41,15 +41,16 @@ #import "SKDocument.h" #import "SKMainWindowController.h" #import "Files_SKExtensions.h" +#import "NSTableView_SKExtensions.h" +static NSString *SKBookmarkRowsPboardType = @"SKBookmarkRowsPboardType"; +static NSString *SKBookmarkChangedNotification = @"SKBookmarkChangedNotification"; + @implementation SKBookmarkController static unsigned int maxRecentDocumentsCount = 0; + (void)initialize { - [NSValueTransformer setValueTransformer:[[[SKPageIndexTransformer alloc] init] autorelease] forName:@"SKPageIndexTransformer"]; - [NSValueTransformer setValueTransformer:[[[SKAliasDataTransformer alloc] init] autorelease] forName:@"SKAliasDataTransformer"]; - maxRecentDocumentsCount = [[NSUserDefaults standardUserDefaults] integerForKey:@"SKMaximumDocumentPageHistoryCount"]; if (maxRecentDocumentsCount == 0) maxRecentDocumentsCount = 50; @@ -80,10 +81,22 @@ NSLog(@"Error deserializing: %@", error); [error release]; } else if ([plist isKindOfClass:[NSDictionary class]]) { - [bookmarks addObjectsFromArray:[plist objectForKey:@"bookmarks"]]; [recentDocuments addObjectsFromArray:[plist objectForKey:@"recentDocuments"]]; + NSEnumerator *dictEnum = [[plist objectForKey:@"bookmarks"] objectEnumerator]; + NSDictionary *dict; + + while (dict = [dictEnum nextObject]) { + SKBookmark *bookmark = [[SKBookmark alloc] initWithDictionary:dict]; + [bookmarks addObject:bookmark]; + [bookmark release]; + } } } + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(handleBookmarkChangedNotification:) + name:SKBookmarkChangedNotification + object:nil]; } return self; } @@ -96,11 +109,19 @@ - (NSString *)windowNibName { return @"BookmarksWindow"; } +- (void)windowDidLoad { + [self setWindowFrameAutosaveName:@"SKBookmarksWindow"]; + [tableView registerForDraggedTypes:[NSArray arrayWithObjects:SKBookmarkRowsPboardType, nil]]; +} + +#pragma mark Bookmarks + - (NSArray *)bookmarks { return bookmarks; } - (void)setBookmarks:(NSArray *)newBookmarks { + [[[self undoManager] prepareWithInvocationTarget:self] setBookmarks:[[bookmarks copy] autorelease]]; return [bookmarks setArray:newBookmarks]; } @@ -113,11 +134,13 @@ } - (void)insertObject:(id)obj inBookmarksAtIndex:(unsigned)index { + [[[self undoManager] prepareWithInvocationTarget:self] removeObjectFromBookmarksAtIndex:index]; [bookmarks insertObject:obj atIndex:index]; [self saveBookmarks]; } - (void)removeObjectFromBookmarksAtIndex:(unsigned)index { + [[[self undoManager] prepareWithInvocationTarget:self] insertObject:[bookmarks objectAtIndex:index] inBookmarksAtIndex:index]; [bookmarks removeObjectAtIndex:index]; [self saveBookmarks]; } @@ -125,11 +148,13 @@ - (void)addBookmarkForPath:(NSString *)path pageIndex:(unsigned)pageIndex label:(NSString *)label { if (path == nil) return; - NSData *data = [[BDAlias aliasWithPath:path] aliasData]; - NSMutableDictionary *bm = [NSMutableDictionary dictionaryWithObjectsAndKeys:path, @"path", label, @"label", [NSNumber numberWithUnsignedInt:pageIndex], @"pageIndex", data, @"_BDAlias", nil]; - [[self mutableArrayValueForKey:@"bookmarks"] addObject:bm]; + SKBookmark *bookmark = [[SKBookmark alloc] initWithPath:path pageIndex:pageIndex label:label]; + [[self mutableArrayValueForKey:@"bookmarks"] addObject:bookmark]; + [bookmark release]; } +#pragma mark Recent Documents + - (NSArray *)recentDocuments { return recentDocuments; } @@ -182,7 +207,7 @@ } - (void)saveBookmarks { - NSDictionary *bookmarksDictionary = [NSDictionary dictionaryWithObjectsAndKeys:bookmarks, @"bookmarks", recentDocuments, @"recentDocuments", nil]; + NSDictionary *bookmarksDictionary = [NSDictionary dictionaryWithObjectsAndKeys:[bookmarks valueForKey:@"dictionaryValue"], @"bookmarks", recentDocuments, @"recentDocuments", nil]; NSString *error = nil; NSPropertyListFormat format = NSPropertyListXMLFormat_v1_0; NSData *data = [NSPropertyListSerialization dataFromPropertyList:bookmarksDictionary format:format errorDescription:&error]; @@ -195,6 +220,10 @@ } } +- (void)handleBookmarkChangedNotification:(NSNotification *)notification { + [self saveBookmarks]; +} + - (NSString *)bookmarksFilePath { static NSString *bookmarksPath = nil; @@ -225,24 +254,19 @@ return bookmarksPath; } -- (void)controlTextDidEndEditing:(NSNotification *)notification { - [self saveBookmarks]; -} - - (void)openBookmarks:(NSArray *)items { NSEnumerator *bmEnum = [items objectEnumerator]; - NSDictionary *bm; + SKBookmark *bm; while (bm = [bmEnum nextObject]) { id document = nil; - NSURL *fileURL = [[BDAlias aliasWithData:[bm objectForKey:@"_BDAlias"]] fileURL]; + NSString *path = [bm resolvedPath]; + NSURL *fileURL = path ? [NSURL fileURLWithPath:path] : nil; NSError *error; - if (fileURL == nil && [bm objectForKey:@"path"]) - fileURL = [NSURL fileURLWithPath:[bm objectForKey:@"path"]]; if (fileURL && NO == SKFileIsInTrash(fileURL)) { if (document = [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:fileURL display:YES error:&error]) { - [[document mainWindowController] setPageNumber:[[bm objectForKey:@"pageIndex"] unsignedIntValue] + 1]; + [[document mainWindowController] setPageNumber:[bm pageIndex] + 1]; } else { [NSApp presentError:error]; } @@ -250,41 +274,157 @@ } } -@end +#pragma mark Undo support +- (NSUndoManager *)undoManager { + if(undoManager == nil) + undoManager = [[NSUndoManager alloc] init]; + return undoManager; +} -@implementation SKPageIndexTransformer +- (NSUndoManager *)windowWillReturnUndoManager:(NSWindow *)sender { + return [self undoManager]; +} -+ (Class)transformedValueClass { - return [NSNumber class]; +#pragma mark NSTableView datasource methods + +- (int)numberOfRowsInTableView:(NSTableView *)tv { return 0; } + +- (id)tableView:(NSTableView *)tv objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row { return nil; } + +- (BOOL)tableView:(NSTableView *)tv writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard { + [pboard declareTypes:[NSArray arrayWithObjects:SKBookmarkRowsPboardType, nil] owner:nil]; + [pboard setPropertyList:[NSNumber numberWithUnsignedInt:[rowIndexes firstIndex]] forType:SKBookmarkRowsPboardType]; + return YES; } -+ (BOOL)allowsReverseTransformation { +- (NSDragOperation)tableView:(NSTableView *)tv validateDrop:(id <NSDraggingInfo>)info proposedRow:(int)row proposedDropOperation:(NSTableViewDropOperation)op { + NSPasteboard *pboard = [info draggingPasteboard]; + NSString *type = [pboard availableTypeFromArray:[NSArray arrayWithObjects:SKBookmarkRowsPboardType, nil]]; + + if (type) { + [tv setDropRow:row == -1 ? [tv numberOfRows] : row dropOperation:NSTableViewDropAbove]; + return NSDragOperationMove; + } + return NSDragOperationNone; +} + +- (BOOL)tableView:(NSTableView *)tv acceptDrop:(id <NSDraggingInfo>)info row:(int)row dropOperation:(NSTableViewDropOperation)op { + NSPasteboard *pboard = [info draggingPasteboard]; + NSString *type = [pboard availableTypeFromArray:[NSArray arrayWithObjects:SKBookmarkRowsPboardType, nil]]; + + if (type) { + int draggedRow = [[pboard propertyListForType:SKBookmarkRowsPboardType] intValue]; + SKBookmark *bookmark = [[bookmarks objectAtIndex:draggedRow] retain]; + [self removeObjectFromBookmarksAtIndex:draggedRow]; + [self insertObject:bookmark inBookmarksAtIndex:row < draggedRow ? row : row - 1]; + [bookmark release]; + [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; + return YES; + } return NO; } -- (id)transformedValue:(id)number { - return [NSNumber numberWithUnsignedInt:[number unsignedIntValue] + 1]; +#pragma mark NSTableView delegate methods + +- (NSString *)tableView:(NSTableView *)tv toolTipForCell:(NSCell *)cell rect:(NSRectPointer)rect tableColumn:(NSTableColumn *)tableColumn row:(int)row mouseLocation:(NSPoint)mouseLocation { + NSString *tcID = [tableColumn identifier]; + SKBookmark *bookmark = [self objectInBookmarksAtIndex:row]; + + if ([tcID isEqualToString:@"label"]) { + return [bookmark label]; + } else if ([tcID isEqualToString:@"file"]) { + return [bookmark resolvedPath]; + } else if ([tcID isEqualToString:@"page"]) { + return [[bookmark pageNumber] stringValue]; + } + return nil; } +- (void)tableView:(NSTableView *)aTableView deleteRowsWithIndexes:(NSIndexSet *)rowIndexes { + int row = [rowIndexes firstIndex]; + [self removeObjectFromBookmarksAtIndex:row]; +} + +- (BOOL)tableView:(NSTableView *)aTableView canDeleteRowsWithIndexes:(NSIndexSet *)rowIndexes { + return YES; +} + @end +#pragma mark - -@implementation SKAliasDataTransformer +@implementation SKBookmark -+ (Class)transformedValueClass { - return [NSString class]; +- (id)initWithPath:(NSString *)aPath aliasData:(NSData *)aData pageIndex:(unsigned)aPageIndex label:(NSString *)aLabel { + if (self = [super init]) { + path = [aPath copy]; + aliasData = [aData copy]; + pageIndex = aPageIndex; + label = [aLabel copy]; + } + return self; } -+ (BOOL)allowsReverseTransformation { - return NO; +- (id)initWithPath:(NSString *)aPath pageIndex:(unsigned)aPageIndex label:(NSString *)aLabel { + return [self initWithPath:aPath aliasData:[[BDAlias aliasWithPath:aPath] aliasData] pageIndex:aPageIndex label:aLabel]; } -- (id)transformedValue:(id)dictionary { - NSString *path = [[BDAlias aliasWithData:[dictionary valueForKey:@"_BDAlias"]] fullPathNoUI]; - if (path == nil) - path = [dictionary valueForKey:@"path"]; - return path; +- (id)initWithDictionary:(NSDictionary *)dictionary { + return [self initWithPath:[dictionary objectForKey:@"path"] aliasData:[dictionary objectForKey:@"_BDAlias"] pageIndex:[[dictionary objectForKey:@"pageIndex"] unsignedIntValue] label:[dictionary objectForKey:@"label"]]; } +- (id)copyWithZone:(NSZone *)aZone { + return [[[self class] allocWithZone:aZone] initWithPath:path aliasData:aliasData pageIndex:pageIndex label:label]; +} + +- (void)dealloc { + [[[SKBookmarkController sharedBookmarkController] undoManager] removeAllActionsWithTarget:self]; + [path release]; + [aliasData release]; + [label release]; + [super dealloc]; +} + +- (NSDictionary *)dictionaryValue { + return [NSDictionary dictionaryWithObjectsAndKeys:path, @"path", aliasData, @"_BDAlias", [NSNumber numberWithUnsignedInt:pageIndex], @"pageIndex", label, @"label", nil]; +} + +- (NSString *)path { + return [[path retain] autorelease]; +} + +- (NSData *)aliasData { + return aliasData; +} + +- (NSString *)resolvedPath { + NSString *resolvedPath = [[BDAlias aliasWithData:aliasData] fullPathNoUI]; + if (resolvedPath == nil) + resolvedPath = path; + return resolvedPath; +} + +- (unsigned int)pageIndex { + return pageIndex; +} + +- (NSNumber *)pageNumber { + return [NSNumber numberWithUnsignedInt:pageIndex + 1]; +} + +- (NSString *)label { + return label; +} + +- (void)setLabel:(NSString *)newLabel { + if (label != newLabel) { + NSUndoManager *undoManager = [[SKBookmarkController sharedBookmarkController] undoManager]; + [(SKBookmark *)[undoManager prepareWithInvocationTarget:self] setLabel:label]; + [label release]; + label = [newLabel retain]; + [[NSNotificationCenter defaultCenter] postNotificationName:SKBookmarkChangedNotification object:self]; + } +} + @end Modified: trunk/SKThumbnailTableView.h =================================================================== --- trunk/SKThumbnailTableView.h 2007-08-20 10:51:17 UTC (rev 2688) +++ trunk/SKThumbnailTableView.h 2007-08-20 18:21:29 UTC (rev 2689) @@ -49,7 +49,6 @@ @interface SKSnapshotTableView : SKThumbnailTableView -- (BOOL)canDelete; @end @@ -59,12 +58,6 @@ @end -@interface NSObject (SKSnapshotTableViewDelegate) -- (void)tableView:(NSTableView *)aTableView deleteRowsWithIndexes:(NSIndexSet *)rowIndexes; -- (BOOL)tableView:(NSTableView *)aTableView canDeleteRowsWithIndexes:(NSIndexSet *)rowIndexes; -@end - - @interface NSObject (SKThumbnailTableViewDelegate) - (NSArray *)tableViewHighlightedRows:(NSTableView *)tableView; - (BOOL)tableView:(NSTableView *)tableView commandSelectRow:(int)rowIndex; Modified: trunk/SKThumbnailTableView.m =================================================================== --- trunk/SKThumbnailTableView.m 2007-08-20 10:51:17 UTC (rev 2688) +++ trunk/SKThumbnailTableView.m 2007-08-20 18:21:29 UTC (rev 2689) @@ -176,38 +176,6 @@ @implementation SKSnapshotTableView -- (BOOL)canDelete { - NSIndexSet *indexes = [self selectedRowIndexes]; - return [indexes count] && - [[self delegate] respondsToSelector:@selector(tableView:canDeleteRowsWithIndexes:)] && - [[self delegate] respondsToSelector:@selector(tableView:deleteRowsWithIndexes:)] && - [[self delegate] tableView:self canDeleteRowsWithIndexes:indexes]; -} - -- (void)delete:(id)sender { - if ([self canDelete]) - [[self delegate] tableView:self deleteRowsWithIndexes:[self selectedRowIndexes]]; - else - NSBeep(); -} - -- (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 == NSDeleteCharacter || eventChar == NSDeleteFunctionKey) && modifiers == 0 && [self canDelete]) - [self delete:self]; - else - [super keyDown:theEvent]; -} - -- (BOOL)validateMenuItem:(NSMenuItem *)menuItem { - if ([menuItem action] == @selector(delete:)) - return [self canDelete]; - return [super validateMenuItem:menuItem]; -} - @end #pragma mark - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-20 10:51:19
|
Revision: 2688 http://skim-app.svn.sourceforge.net/skim-app/?rev=2688&view=rev Author: hofman Date: 2007-08-20 03:51:17 -0700 (Mon, 20 Aug 2007) Log Message: ----------- Implement Home/End function keys in tables. Modified Paths: -------------- trunk/Skim.xcodeproj/project.pbxproj Added Paths: ----------- trunk/NSTableView_SKExtensions.h trunk/NSTableView_SKExtensions.m Added: trunk/NSTableView_SKExtensions.h =================================================================== --- trunk/NSTableView_SKExtensions.h (rev 0) +++ trunk/NSTableView_SKExtensions.h 2007-08-20 10:51:17 UTC (rev 2688) @@ -0,0 +1,44 @@ +// +// NSTableView_SKExtensions.h +// Skim +// +// Created by Christiaan Hofman on 8/20/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> + + +@interface NSTableView (SKExtensions) + +@end Added: trunk/NSTableView_SKExtensions.m =================================================================== --- trunk/NSTableView_SKExtensions.m (rev 0) +++ trunk/NSTableView_SKExtensions.m 2007-08-20 10:51:17 UTC (rev 2688) @@ -0,0 +1,74 @@ +// +// NSTableView_SKExtensions.m +// Skim +// +// Created by Christiaan Hofman on 8/20/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 "NSTableView_SKExtensions.h" +#import "OBUtilities.h" + + +@implementation NSTableView (SKExtensions) + +static IMP originalKeyDown = NULL; + ++ (void)load { + originalKeyDown = OBReplaceMethodImplementationWithSelector(self, @selector(keyDown:), @selector(replacementKeyDown:)); +} + +- (void)scrollToBeginningOfDocument:(id)sender { + if ([self numberOfRows]) + [self scrollRowToVisible:0]; +} + +- (void)scrollToEndOfDocument:(id)sender { + if ([self numberOfRows]) + [self scrollRowToVisible:[self numberOfRows] - 1]; +} + +- (void)replacementKeyDown:(NSEvent *)theEvent { + NSString *characters = [theEvent charactersIgnoringModifiers]; + unichar eventChar = [characters length] > 0 ? [characters characterAtIndex:0] : 0; + unsigned modifierFlags = [theEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask; + + if (eventChar == NSHomeFunctionKey && (modifierFlags & ~NSFunctionKeyMask) == 0) + [self scrollToBeginningOfDocument:nil]; + else if (eventChar == NSEndFunctionKey && (modifierFlags & ~NSFunctionKeyMask) == 0) + [self scrollToEndOfDocument:nil]; + else + originalKeyDown(self, _cmd, theEvent); +} + +@end Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-08-19 17:06:04 UTC (rev 2687) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-08-20 10:51:17 UTC (rev 2688) @@ -126,6 +126,8 @@ CE5487BC0B35A20A00F8AFB6 /* NSFileManager_ExtendedAttributes.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5487BB0B35A20A00F8AFB6 /* NSFileManager_ExtendedAttributes.m */; }; CE54898C0B35D4EF00F8AFB6 /* InfoWindow.nib in Resources */ = {isa = PBXBuildFile; fileRef = CE54898A0B35D4EF00F8AFB6 /* InfoWindow.nib */; }; CE54898F0B35D50E00F8AFB6 /* SKInfoWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE54898E0B35D50E00F8AFB6 /* SKInfoWindowController.m */; }; + CE5BC5B10C79A27B00EBDCF7 /* NSTableView_SKExtensions.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE5BC5AF0C79A27B00EBDCF7 /* NSTableView_SKExtensions.h */; }; + CE5BC5B20C79A27B00EBDCF7 /* NSTableView_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5BC5B00C79A27B00EBDCF7 /* NSTableView_SKExtensions.m */; }; CE5F42AF0BF89FE00069D89C /* AppleRemote.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5F42AD0BF89FE00069D89C /* AppleRemote.m */; }; CE5F43730BF8A3410069D89C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE5F42D30BF8A3400069D89C /* IOKit.framework */; }; CE67BB260BC44AC9007B6929 /* ZoomValues.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE67BB240BC44AC9007B6929 /* ZoomValues.strings */; }; @@ -255,6 +257,7 @@ dstSubfolderSpec = 10; files = ( CE2BD8450BD4135600A5F4DB /* Sparkle.framework in CopyFiles */, + CE5BC5B10C79A27B00EBDCF7 /* NSTableView_SKExtensions.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -480,6 +483,8 @@ CE54898D0B35D50E00F8AFB6 /* SKInfoWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKInfoWindowController.h; sourceTree = "<group>"; }; CE54898E0B35D50E00F8AFB6 /* SKInfoWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKInfoWindowController.m; sourceTree = "<group>"; }; CE54AA8E0BBC037400008750 /* ReleaseNotes.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = ReleaseNotes.rtf; sourceTree = "<group>"; }; + CE5BC5AF0C79A27B00EBDCF7 /* NSTableView_SKExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSTableView_SKExtensions.h; sourceTree = "<group>"; }; + CE5BC5B00C79A27B00EBDCF7 /* NSTableView_SKExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSTableView_SKExtensions.m; sourceTree = "<group>"; }; CE5F42AC0BF89FE00069D89C /* AppleRemote.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AppleRemote.h; path = vendorsrc/martinkahr/AppleRemoteSource_R80/AppleRemote.h; sourceTree = "<group>"; }; CE5F42AD0BF89FE00069D89C /* AppleRemote.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = AppleRemote.m; path = vendorsrc/martinkahr/AppleRemoteSource_R80/AppleRemote.m; sourceTree = "<group>"; }; CE5F42D30BF8A3400069D89C /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; }; @@ -795,6 +800,8 @@ CE070EA10B89039700733CC8 /* NSScrollView_SKExtensions.m */, CE38ECD10B8093B200A1B779 /* NSString_SKExtensions.h */, CE38ECD20B8093B200A1B779 /* NSString_SKExtensions.m */, + CE5BC5AF0C79A27B00EBDCF7 /* NSTableView_SKExtensions.h */, + CE5BC5B00C79A27B00EBDCF7 /* NSTableView_SKExtensions.m */, CEAA67230C70A882006BD633 /* NSURL_SKExtensions.h */, CEAA67240C70A882006BD633 /* NSURL_SKExtensions.m */, CEF7119F0B90B714003A2771 /* NSUserDefaultsController_SKExtensions.h */, @@ -1460,6 +1467,7 @@ CEAA55B70C6DE452006BD633 /* SKProgressCell.m in Sources */, CEAA67260C70A882006BD633 /* NSURL_SKExtensions.m in Sources */, CEF839B30C77742A00A3AD51 /* Files_SKExtensions.m in Sources */, + CE5BC5B20C79A27B00EBDCF7 /* NSTableView_SKExtensions.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-08-19 17:10:51
|
Revision: 2687 http://skim-app.svn.sourceforge.net/skim-app/?rev=2687&view=rev Author: hofman Date: 2007-08-19 10:06:04 -0700 (Sun, 19 Aug 2007) Log Message: ----------- Add a sheet with preferences for the downloads window. Modified Paths: -------------- trunk/Dutch.lproj/DownloadsWindow.nib/classes.nib trunk/Dutch.lproj/DownloadsWindow.nib/info.nib trunk/Dutch.lproj/DownloadsWindow.nib/keyedobjects.nib trunk/English.lproj/DownloadsWindow.nib/classes.nib trunk/English.lproj/DownloadsWindow.nib/info.nib trunk/English.lproj/DownloadsWindow.nib/keyedobjects.nib trunk/French.lproj/DownloadsWindow.nib/classes.nib trunk/French.lproj/DownloadsWindow.nib/info.nib trunk/French.lproj/DownloadsWindow.nib/keyedobjects.nib trunk/Italian.lproj/DownloadsWindow.nib/classes.nib trunk/Italian.lproj/DownloadsWindow.nib/info.nib trunk/Italian.lproj/DownloadsWindow.nib/keyedobjects.nib trunk/SKDownloadController.h trunk/SKDownloadController.m trunk/Skim.xcodeproj/project.pbxproj Added Paths: ----------- trunk/Images/SmallPreferences.tiff Modified: trunk/Dutch.lproj/DownloadsWindow.nib/classes.nib =================================================================== --- trunk/Dutch.lproj/DownloadsWindow.nib/classes.nib 2007-08-19 12:19:32 UTC (rev 2686) +++ trunk/Dutch.lproj/DownloadsWindow.nib/classes.nib 2007-08-19 17:06:04 UTC (rev 2687) @@ -8,10 +8,20 @@ SUPERCLASS = NSObject; }, { - ACTIONS = {cancelDownload = id; clearDownloads = id; removeDownload = id; }; + ACTIONS = { + cancelDownload = id; + clearDownloads = id; + dismissDownloadsPreferences = id; + removeDownload = id; + showDownloadPreferences = id; + }; CLASS = SKDownloadController; LANGUAGE = ObjC; - OUTLETS = {clearButton = NSButton; tableView = NSTableView; }; + OUTLETS = { + clearButton = NSButton; + preferencesSheet = NSWindow; + tableView = NSTableView; + }; SUPERCLASS = NSWindowController; }, {CLASS = SKProgressCell; LANGUAGE = ObjC; SUPERCLASS = NSTextFieldCell; } Modified: trunk/Dutch.lproj/DownloadsWindow.nib/info.nib =================================================================== --- trunk/Dutch.lproj/DownloadsWindow.nib/info.nib 2007-08-19 12:19:32 UTC (rev 2686) +++ trunk/Dutch.lproj/DownloadsWindow.nib/info.nib 2007-08-19 17:06:04 UTC (rev 2687) @@ -8,7 +8,7 @@ <string>446.1</string> <key>IBOpenObjects</key> <array> - <integer>5</integer> + <integer>30</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/Dutch.lproj/DownloadsWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/DownloadsWindow.nib/classes.nib =================================================================== --- trunk/English.lproj/DownloadsWindow.nib/classes.nib 2007-08-19 12:19:32 UTC (rev 2686) +++ trunk/English.lproj/DownloadsWindow.nib/classes.nib 2007-08-19 17:06:04 UTC (rev 2687) @@ -8,10 +8,20 @@ SUPERCLASS = NSObject; }, { - ACTIONS = {cancelDownload = id; clearDownloads = id; removeDownload = id; }; + ACTIONS = { + cancelDownload = id; + clearDownloads = id; + dismissDownloadsPreferences = id; + removeDownload = id; + showDownloadPreferences = id; + }; CLASS = SKDownloadController; LANGUAGE = ObjC; - OUTLETS = {clearButton = NSButton; tableView = NSTableView; }; + OUTLETS = { + clearButton = NSButton; + preferencesSheet = NSWindow; + tableView = NSTableView; + }; SUPERCLASS = NSWindowController; }, {CLASS = SKProgressCell; LANGUAGE = ObjC; SUPERCLASS = NSTextFieldCell; } Modified: trunk/English.lproj/DownloadsWindow.nib/info.nib =================================================================== --- trunk/English.lproj/DownloadsWindow.nib/info.nib 2007-08-19 12:19:32 UTC (rev 2686) +++ trunk/English.lproj/DownloadsWindow.nib/info.nib 2007-08-19 17:06:04 UTC (rev 2687) @@ -9,6 +9,7 @@ <key>IBOpenObjects</key> <array> <integer>5</integer> + <integer>30</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/English.lproj/DownloadsWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/French.lproj/DownloadsWindow.nib/classes.nib =================================================================== --- trunk/French.lproj/DownloadsWindow.nib/classes.nib 2007-08-19 12:19:32 UTC (rev 2686) +++ trunk/French.lproj/DownloadsWindow.nib/classes.nib 2007-08-19 17:06:04 UTC (rev 2687) @@ -8,10 +8,20 @@ SUPERCLASS = NSObject; }, { - ACTIONS = {cancelDownload = id; clearDownloads = id; removeDownload = id; }; + ACTIONS = { + cancelDownload = id; + clearDownloads = id; + dismissDownloadsPreferences = id; + removeDownload = id; + showDownloadPreferences = id; + }; CLASS = SKDownloadController; LANGUAGE = ObjC; - OUTLETS = {clearButton = NSButton; tableView = NSTableView; }; + OUTLETS = { + clearButton = NSButton; + preferencesSheet = NSWindow; + tableView = NSTableView; + }; SUPERCLASS = NSWindowController; }, {CLASS = SKProgressCell; LANGUAGE = ObjC; SUPERCLASS = NSTextFieldCell; } Modified: trunk/French.lproj/DownloadsWindow.nib/info.nib =================================================================== --- trunk/French.lproj/DownloadsWindow.nib/info.nib 2007-08-19 12:19:32 UTC (rev 2686) +++ trunk/French.lproj/DownloadsWindow.nib/info.nib 2007-08-19 17:06:04 UTC (rev 2687) @@ -9,6 +9,7 @@ <key>IBOpenObjects</key> <array> <integer>5</integer> + <integer>30</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/French.lproj/DownloadsWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Added: trunk/Images/SmallPreferences.tiff =================================================================== (Binary files differ) Property changes on: trunk/Images/SmallPreferences.tiff ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/Italian.lproj/DownloadsWindow.nib/classes.nib =================================================================== --- trunk/Italian.lproj/DownloadsWindow.nib/classes.nib 2007-08-19 12:19:32 UTC (rev 2686) +++ trunk/Italian.lproj/DownloadsWindow.nib/classes.nib 2007-08-19 17:06:04 UTC (rev 2687) @@ -8,10 +8,20 @@ SUPERCLASS = NSObject; }, { - ACTIONS = {cancelDownload = id; clearDownloads = id; removeDownload = id; }; + ACTIONS = { + cancelDownload = id; + clearDownloads = id; + dismissDownloadsPreferences = id; + removeDownload = id; + showDownloadPreferences = id; + }; CLASS = SKDownloadController; LANGUAGE = ObjC; - OUTLETS = {clearButton = NSButton; tableView = NSTableView; }; + OUTLETS = { + clearButton = NSButton; + preferencesSheet = NSWindow; + tableView = NSTableView; + }; SUPERCLASS = NSWindowController; }, {CLASS = SKProgressCell; LANGUAGE = ObjC; SUPERCLASS = NSTextFieldCell; } Modified: trunk/Italian.lproj/DownloadsWindow.nib/info.nib =================================================================== --- trunk/Italian.lproj/DownloadsWindow.nib/info.nib 2007-08-19 12:19:32 UTC (rev 2686) +++ trunk/Italian.lproj/DownloadsWindow.nib/info.nib 2007-08-19 17:06:04 UTC (rev 2687) @@ -9,6 +9,7 @@ <key>IBOpenObjects</key> <array> <integer>5</integer> + <integer>30</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/Italian.lproj/DownloadsWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/SKDownloadController.h =================================================================== --- trunk/SKDownloadController.h 2007-08-19 12:19:32 UTC (rev 2686) +++ trunk/SKDownloadController.h 2007-08-19 17:06:04 UTC (rev 2687) @@ -42,6 +42,7 @@ @interface SKDownloadController : NSWindowController { IBOutlet NSTableView *tableView; IBOutlet NSButton *clearButton; + IBOutlet NSWindow *preferencesSheet; NSMutableArray *downloads; } @@ -53,4 +54,7 @@ - (IBAction)removeDownload:(id)sender; - (IBAction)cancelDownload:(id)sender; +- (IBAction)showDownloadPreferences:(id)sender; +- (IBAction)dismissDownloadsPreferences:(id)sender; + @end Modified: trunk/SKDownloadController.m =================================================================== --- trunk/SKDownloadController.m 2007-08-19 12:19:32 UTC (rev 2686) +++ trunk/SKDownloadController.m 2007-08-19 17:06:04 UTC (rev 2687) @@ -165,6 +165,15 @@ [self addDownloadForURL:theURL]; } +- (IBAction)showDownloadPreferences:(id)sender { + [NSApp beginSheet:preferencesSheet modalForWindow:[self window] modalDelegate:nil didEndSelector:NULL contextInfo:NULL]; +} + +- (IBAction)dismissDownloadsPreferences:(id)sender { + [NSApp endSheet:preferencesSheet returnCode:[sender tag]]; + [preferencesSheet orderOut:self]; +} + #pragma mark SKDownloadDelegate - (void)downloadDidStart:(SKDownload *)download { Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-08-19 12:19:32 UTC (rev 2686) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-08-19 17:06:04 UTC (rev 2687) @@ -177,6 +177,7 @@ CEF7175C0B90DEEF003A2771 /* ReleaseNotes.nib in Resources */ = {isa = PBXBuildFile; fileRef = CEF717560B90DEEF003A2771 /* ReleaseNotes.nib */; }; CEF7175F0B90DF10003A2771 /* SKReleaseNotesController.m in Sources */ = {isa = PBXBuildFile; fileRef = CEF7175E0B90DF10003A2771 /* SKReleaseNotesController.m */; }; CEF839B30C77742A00A3AD51 /* Files_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CEF839B10C77742A00A3AD51 /* Files_SKExtensions.m */; }; + CEF84C630C78A89A00A3AD51 /* SmallPreferences.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CEF84C620C78A89900A3AD51 /* SmallPreferences.tiff */; }; CEFD68740C01D4080027B933 /* SkimImporter.mdimporter in CopyFiles */ = {isa = PBXBuildFile; fileRef = CEFD68690C01D3BB0027B933 /* SkimImporter.mdimporter */; }; CEFDF8BE0B3848C40091C61A /* SKNavigationWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = CEFDF8BD0B3848C40091C61A /* SKNavigationWindow.m */; }; F92DB5AC0B36FE1F002A26E9 /* BDSKHeaderPopUpButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F92DB5A90B36FE1F002A26E9 /* BDSKHeaderPopUpButtonCell.m */; }; @@ -578,6 +579,7 @@ CEF7175E0B90DF10003A2771 /* SKReleaseNotesController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SKReleaseNotesController.m; sourceTree = "<group>"; }; CEF839B00C77742A00A3AD51 /* Files_SKExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Files_SKExtensions.h; sourceTree = "<group>"; }; CEF839B10C77742A00A3AD51 /* Files_SKExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Files_SKExtensions.m; sourceTree = "<group>"; }; + CEF84C620C78A89900A3AD51 /* SmallPreferences.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = SmallPreferences.tiff; path = Images/SmallPreferences.tiff; sourceTree = "<group>"; }; CEFD68610C01D3BB0027B933 /* SkimImporter.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SkimImporter.xcodeproj; path = SkimImporter/SkimImporter.xcodeproj; sourceTree = "<group>"; }; CEFDF8BC0B3848C40091C61A /* SKNavigationWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKNavigationWindow.h; sourceTree = "<group>"; }; CEFDF8BD0B3848C40091C61A /* SKNavigationWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKNavigationWindow.m; sourceTree = "<group>"; }; @@ -996,6 +998,7 @@ CEAA56D20C6DEE83006BD633 /* Cancel.tiff */, CEAA56D30C6DEE83006BD633 /* Delete.tiff */, CEAA68EA0C71242F006BD633 /* Resume.tiff */, + CEF84C620C78A89900A3AD51 /* SmallPreferences.tiff */, CE0715890B8A3D6300733CC8 /* NoteDocument.icns */, CE7C5D180BD8086C0011315D /* ToolbarLineNote.tiff */, CE4190C20B94963A00ECF819 /* ToolbarCircleNote.tiff */, @@ -1248,6 +1251,7 @@ CEAA56D40C6DEE83006BD633 /* Cancel.tiff in Resources */, CEAA56D50C6DEE83006BD633 /* Delete.tiff in Resources */, CEAA68EB0C71242F006BD633 /* Resume.tiff in Resources */, + CEF84C630C78A89A00A3AD51 /* SmallPreferences.tiff 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-08-19 12:19:34
|
Revision: 2686 http://skim-app.svn.sourceforge.net/skim-app/?rev=2686&view=rev Author: hofman Date: 2007-08-19 05:19:32 -0700 (Sun, 19 Aug 2007) Log Message: ----------- Update release notes. Modified Paths: -------------- trunk/ReleaseNotes.rtf Modified: trunk/ReleaseNotes.rtf =================================================================== --- trunk/ReleaseNotes.rtf 2007-08-19 11:49:17 UTC (rev 2685) +++ trunk/ReleaseNotes.rtf 2007-08-19 12:19:32 UTC (rev 2686) @@ -1,6 +1,7 @@ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 -{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fnil\fcharset77 LucidaGrande;\f2\fswiss\fcharset77 Helvetica-Bold; -\f3\fswiss\fcharset77 Helvetica-BoldOblique;\f4\fnil\fcharset77 LucidaGrande-Bold;} +{\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; +} {\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} @@ -101,41 +102,95 @@ {\list\listtemplateid97\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid97} {\list\listtemplateid98\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid98} {\list\listtemplateid99\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid99} -{\list\listtemplateid100\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid100}} -{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}{\listoverride\listid5\listoverridecount0\ls5}{\listoverride\listid6\listoverridecount0\ls6}{\listoverride\listid7\listoverridecount0\ls7}{\listoverride\listid8\listoverridecount0\ls8}{\listoverride\listid9\listoverridecount0\ls9}{\listoverride\listid10\listoverridecount0\ls10}{\listoverride\listid11\listoverridecount0\ls11}{\listoverride\listid12\listoverridecount0\ls12}{\listoverride\listid13\listoverridecount0\ls13}{\listoverride\listid14\listoverridecount0\ls14}{\listoverride\listid15\listoverridecount0\ls15}{\listoverride\listid16\listoverridecount0\ls16}{\listoverride\listid17\listoverridecount0\ls17}{\listoverride\listid18\listoverridecount0\ls18}{\listoverride\listid19\listoverridecount0\ls19}{\listoverride\listid20\listoverridecount0\ls20}{\listoverride\listid21\listoverridecount0\ls21}{\listoverride\listid22\listoverridecount0\ls22}{\listoverride\listid23\listoverridecount0\ls23}{\listoverride\listid24\listoverridecount0\ls24}{\listoverride\listid25\listoverridecount0\ls25}{\listoverride\listid26\listoverridecount0\ls26}{\listoverride\listid27\listoverridecount0\ls27}{\listoverride\listid28\listoverridecount0\ls28}{\listoverride\listid29\listoverridecount0\ls29}{\listoverride\listid30\listoverridecount0\ls30}{\listoverride\listid31\listoverridecount0\ls31}{\listoverride\listid32\listoverridecount0\ls32}{\listoverride\listid33\listoverridecount0\ls33}{\listoverride\listid34\listoverridecount0\ls34}{\listoverride\listid35\listoverridecount0\ls35}{\listoverride\listid36\listoverridecount0\ls36}{\listoverride\listid37\listoverridecount0\ls37}{\listoverride\listid38\listoverridecount0\ls38}{\listoverride\listid39\listoverridecount0\ls39}{\listoverride\listid40\listoverridecount0\ls40}{\listoverride\listid41\listoverridecount0\ls41}{\listoverride\listid42\listoverridecount0\ls42}{\listoverride\listid43\listoverridecount0\ls43}{\listoverride\listid44\listoverridecount0\ls44}{\listoverride\listid45\listoverridecount0\ls45}{\listoverride\listid46\listoverridecount0\ls46}{\listoverride\listid47\listoverridecount0\ls47}{\listoverride\listid48\listoverridecount0\ls48}{\listoverride\listid49\listoverridecount0\ls49}{\listoverride\listid50\listoverridecount0\ls50}{\listoverride\listid51\listoverridecount0\ls51}{\listoverride\listid52\listoverridecount0\ls52}{\listoverride\listid53\listoverridecount0\ls53}{\listoverride\listid54\listoverridecount0\ls54}{\listoverride\listid55\listoverridecount0\ls55}{\listoverride\listid56\listoverridecount0\ls56}{\listoverride\listid57\listoverridecount0\ls57}{\listoverride\listid58\listoverridecount0\ls58}{\listoverride\listid59\listoverridecount0\ls59}{\listoverride\listid60\listoverridecount0\ls60}{\listoverride\listid61\listoverridecount0\ls61}{\listoverride\listid62\listoverridecount0\ls62}{\listoverride\listid63\listoverridecount0\ls63}{\listoverride\listid64\listoverridecount0\ls64}{\listoverride\listid65\listoverridecount0\ls65}{\listoverride\listid66\listoverridecount0\ls66}{\listoverride\listid67\listoverridecount0\ls67}{\listoverride\listid68\listoverridecount0\ls68}{\listoverride\listid69\listoverridecount0\ls69}{\listoverride\listid70\listoverridecount0\ls70}{\listoverride\listid71\listoverridecount0\ls71}{\listoverride\listid72\listoverridecount0\ls72}{\listoverride\listid73\listoverridecount0\ls73}{\listoverride\listid74\listoverridecount0\ls74}{\listoverride\listid75\listoverridecount0\ls75}{\listoverride\listid76\listoverridecount0\ls76}{\listoverride\listid77\listoverridecount0\ls77}{\listoverride\listid78\listoverridecount0\ls78}{\listoverride\listid79\listoverridecount0\ls79}{\listoverride\listid80\listoverridecount0\ls80}{\listoverride\listid81\listoverridecount0\ls81}{\listoverride\listid82\listoverridecount0\ls82}{\listoverride\listid83\listoverridecount0\ls83}{\listoverride\listid84\listoverridecount0\ls84}{\listoverride\listid85\listoverridecount0\ls85}{\listoverride\listid86\listoverridecount0\ls86}{\listoverride\listid87\listoverridecount0\ls87}{\listoverride\listid88\listoverridecount0\ls88}{\listoverride\listid89\listoverridecount0\ls89}{\listoverride\listid90\listoverridecount0\ls90}{\listoverride\listid91\listoverridecount0\ls91}{\listoverride\listid92\listoverridecount0\ls92}{\listoverride\listid93\listoverridecount0\ls93}{\listoverride\listid94\listoverridecount0\ls94}{\listoverride\listid95\listoverridecount0\ls95}{\listoverride\listid96\listoverridecount0\ls96}{\listoverride\listid97\listoverridecount0\ls97}{\listoverride\listid98\listoverridecount0\ls98}{\listoverride\listid99\listoverridecount0\ls99}{\listoverride\listid100\listoverridecount0\ls100}} +{\list\listtemplateid100\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid100} +{\list\listtemplateid101\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid101} +{\list\listtemplateid102\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid102}} +{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}{\listoverride\listid5\listoverridecount0\ls5}{\listoverride\listid6\listoverridecount0\ls6}{\listoverride\listid7\listoverridecount0\ls7}{\listoverride\listid8\listoverridecount0\ls8}{\listoverride\listid9\listoverridecount0\ls9}{\listoverride\listid10\listoverridecount0\ls10}{\listoverride\listid11\listoverridecount0\ls11}{\listoverride\listid12\listoverridecount0\ls12}{\listoverride\listid13\listoverridecount0\ls13}{\listoverride\listid14\listoverridecount0\ls14}{\listoverride\listid15\listoverridecount0\ls15}{\listoverride\listid16\listoverridecount0\ls16}{\listoverride\listid17\listoverridecount0\ls17}{\listoverride\listid18\listoverridecount0\ls18}{\listoverride\listid19\listoverridecount0\ls19}{\listoverride\listid20\listoverridecount0\ls20}{\listoverride\listid21\listoverridecount0\ls21}{\listoverride\listid22\listoverridecount0\ls22}{\listoverride\listid23\listoverridecount0\ls23}{\listoverride\listid24\listoverridecount0\ls24}{\listoverride\listid25\listoverridecount0\ls25}{\listoverride\listid26\listoverridecount0\ls26}{\listoverride\listid27\listoverridecount0\ls27}{\listoverride\listid28\listoverridecount0\ls28}{\listoverride\listid29\listoverridecount0\ls29}{\listoverride\listid30\listoverridecount0\ls30}{\listoverride\listid31\listoverridecount0\ls31}{\listoverride\listid32\listoverridecount0\ls32}{\listoverride\listid33\listoverridecount0\ls33}{\listoverride\listid34\listoverridecount0\ls34}{\listoverride\listid35\listoverridecount0\ls35}{\listoverride\listid36\listoverridecount0\ls36}{\listoverride\listid37\listoverridecount0\ls37}{\listoverride\listid38\listoverridecount0\ls38}{\listoverride\listid39\listoverridecount0\ls39}{\listoverride\listid40\listoverridecount0\ls40}{\listoverride\listid41\listoverridecount0\ls41}{\listoverride\listid42\listoverridecount0\ls42}{\listoverride\listid43\listoverridecount0\ls43}{\listoverride\listid44\listoverridecount0\ls44}{\listoverride\listid45\listoverridecount0\ls45}{\listoverride\listid46\listoverridecount0\ls46}{\listoverride\listid47\listoverridecount0\ls47}{\listoverride\listid48\listoverridecount0\ls48}{\listoverride\listid49\listoverridecount0\ls49}{\listoverride\listid50\listoverridecount0\ls50}{\listoverride\listid51\listoverridecount0\ls51}{\listoverride\listid52\listoverridecount0\ls52}{\listoverride\listid53\listoverridecount0\ls53}{\listoverride\listid54\listoverridecount0\ls54}{\listoverride\listid55\listoverridecount0\ls55}{\listoverride\listid56\listoverridecount0\ls56}{\listoverride\listid57\listoverridecount0\ls57}{\listoverride\listid58\listoverridecount0\ls58}{\listoverride\listid59\listoverridecount0\ls59}{\listoverride\listid60\listoverridecount0\ls60}{\listoverride\listid61\listoverridecount0\ls61}{\listoverride\listid62\listoverridecount0\ls62}{\listoverride\listid63\listoverridecount0\ls63}{\listoverride\listid64\listoverridecount0\ls64}{\listoverride\listid65\listoverridecount0\ls65}{\listoverride\listid66\listoverridecount0\ls66}{\listoverride\listid67\listoverridecount0\ls67}{\listoverride\listid68\listoverridecount0\ls68}{\listoverride\listid69\listoverridecount0\ls69}{\listoverride\listid70\listoverridecount0\ls70}{\listoverride\listid71\listoverridecount0\ls71}{\listoverride\listid72\listoverridecount0\ls72}{\listoverride\listid73\listoverridecount0\ls73}{\listoverride\listid74\listoverridecount0\ls74}{\listoverride\listid75\listoverridecount0\ls75}{\listoverride\listid76\listoverridecount0\ls76}{\listoverride\listid77\listoverridecount0\ls77}{\listoverride\listid78\listoverridecount0\ls78}{\listoverride\listid79\listoverridecount0\ls79}{\listoverride\listid80\listoverridecount0\ls80}{\listoverride\listid81\listoverridecount0\ls81}{\listoverride\listid82\listoverridecount0\ls82}{\listoverride\listid83\listoverridecount0\ls83}{\listoverride\listid84\listoverridecount0\ls84}{\listoverride\listid85\listoverridecount0\ls85}{\listoverride\listid86\listoverridecount0\ls86}{\listoverride\listid87\listoverridecount0\ls87}{\listoverride\listid88\listoverridecount0\ls88}{\listoverride\listid89\listoverridecount0\ls89}{\listoverride\listid90\listoverridecount0\ls90}{\listoverride\listid91\listoverridecount0\ls91}{\listoverride\listid92\listoverridecount0\ls92}{\listoverride\listid93\listoverridecount0\ls93}{\listoverride\listid94\listoverridecount0\ls94}{\listoverride\listid95\listoverridecount0\ls95}{\listoverride\listid96\listoverridecount0\ls96}{\listoverride\listid97\listoverridecount0\ls97}{\listoverride\listid98\listoverridecount0\ls98}{\listoverride\listid99\listoverridecount0\ls99}{\listoverride\listid100\listoverridecount0\ls100}{\listoverride\listid101\listoverridecount0\ls101}{\listoverride\listid102\listoverridecount0\ls102}} \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f0\fs60 \cf0 Skim Release Notes\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\fs22 \cf0 \ +Last update: 19 August 2007 (rev +\f2\fs20 2685) +\f1\fs22 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f2\b\fs28 \cf0 Changes since 0.6\ +\f3\b\fs28 \cf0 \ +Changes since 0.6.1\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\i\fs26 \cf0 Bugs Fixed\ +\f4\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 resize all rows of the notes table to view the full text.\ +{\listtext \'a5 }PDFSync from the editor now shows an indication of the target location.\ +{\listtext \'a5 }The tool tip of the table of contents and the table of search results now shows a preview of the target location.\ +{\listtext \'a5 }New toolbar item to add new note and highlights.\ +{\listtext \'a5 }Added contextual menus for tables.\ +{\listtext \'a5 }New menu item to save a disk image with the saved file. Useful for protecting and sending files with a large number of notes.\ +{\listtext \'a5 }Choosing Auto for the zoom of a snapshot auto-resizes the currently shown area rather than the full page.\ +{\listtext \'a5 }PDF view can now provide selected PDF for services.\ +{\listtext \'a5 }Skim can now download PDFs from remote URLs, which can be provided on the clipboard, dropped on the Skim icon, or through Services.\ +{\listtext \'a5 }Added a service to open selected PDF in Skim.\ +{\listtext \'a5 }Hidden defaults to to automatically open or close the downloads window or remove a finished downloads.\ +{\listtext \'a5 }Added a new item in the page setup sheet to automatically rotate pages for printing. Choose Skim from the Settings popup.\ +{\listtext \'a5 }You can now drag the image from an anchored notes window.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural + +\f3\b\fs28 \cf0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural + +\f4\i\fs26 \cf0 Bugs Fixed\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls2\ilvl0 +\f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Fix spell checking freeze for single page PDFs.\ +{\listtext \'a5 }Selecting text is now completely disabled in presentation mode.\ +{\listtext \'a5 }Changed shortcuts of Search PDF and Presentation to be consistent with other application.\ +{\listtext \'a5 }Improvements to the Find panel. We now synchronize with the global find pasteboard.\ +{\listtext \'a5 }Fix searching for application support folder on computer or network domain.\ +{\listtext \'a5 }Fix automatic determination of landscape printing for rotated documents.\ +{\listtext \'a5 }Reset thumbnails, table of contents, page labels and snapshots after unlocking an encrypted document.\ +{\listtext \'a5 }Allow copying text from copy protected documents.\ +{\listtext \'a5 }Disable printing and export with embedded notes of print protected files, as it doesn't do anything anyway.\ +{\listtext \'a5 }Disable full screen modes when the document is unlocked, as it has side effects.\ +{\listtext \'a5 }Fix dragging end points of lines on rotated pages.\ +{\listtext \'a5 }Fix copying PDF selection from rotated pages.\ +{\listtext \'a5 }Hopefully fix some problems with the placement of fullscreen windows.\ +{\listtext \'a5 }Fix window title for single page documents.\ +{\listtext \'a5 }Fix rounding problems when joining highlights.\ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural + +\f3\b\fs28 \cf0 Changes since 0.6\ +\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 Bugs Fixed\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls3\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Fix updater.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls2\ilvl0\cf0 {\listtext \'a5 }Make sure side panes are opened at the saved widths.\ +\ls4\ilvl0\cf0 {\listtext \'a5 }Make sure side panes are opened at the saved widths.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls3\ilvl0\cf0 {\listtext \'a5 }Fix a typo in the scripting dictionary.\ +\ls5\ilvl0\cf0 {\listtext \'a5 }Fix a typo in the scripting dictionary.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f2\b\fs28 \cf0 Changes since 0.5.1\ +\f3\b\fs28 \cf0 Changes since 0.5.1\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\i\fs26 \cf0 New Features\ +\f4\i\fs26 \cf0 New Features\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls4\ilvl0 +\ls6\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Default print settings automatically choose landscape for wide pages.\ {\listtext \'a5 }Hidden preference for custom dvi conversion utilitiesto read DVI (e.g. dvips).\ {\listtext \'a5 }You can now spell-check a PDF.\ @@ -145,16 +200,16 @@ {\listtext \'a5 }New View menu item to show the file at the real size at which it would be printed.\ {\listtext \'a5 }Added a Speech menu to Edit menu.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls5\ilvl0\cf0 {\listtext \'a5 }Added keyboard shortcuts 'p' and 'a' to toggle pages and auto-resize in presentation mode.\ +\ls7\ilvl0\cf0 {\listtext \'a5 }Added keyboard shortcuts 'p' and 'a' to toggle pages and auto-resize in presentation mode.\ {\listtext \'a5 }Added French localization. (Thanks Corentin Cras-M\'8eneur!)\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\f2\b\fs28 \cf0 \ +\f3\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\i\fs26 \cf0 Bugs Fixed\ +\f4\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls6\ilvl0 +\ls8\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Correct display of zero line width in Line inspector panel.\ {\listtext \'a5 }Fix broken Note preferences in Italian localization.\ {\listtext \'a5 }Improved security for PDFSync, escape special shell characters.\ @@ -167,20 +222,20 @@ {\listtext \'a5 }Fix layout issues in main window.\ {\listtext \'a5 }Reopen snapshots after a reload at the correct zoom factor.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls7\ilvl0\cf0 {\listtext \'a5 }Notes sorted by contents ignores case and uses numeric compare.\ +\ls9\ilvl0\cf0 {\listtext \'a5 }Notes sorted by contents ignores case and uses numeric compare.\ {\listtext \'a5 }Ignore empty Spotlight search text.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\f2\b\fs28 \cf0 \ +\f3\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Changes since 0.5\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\i\fs26 \cf0 New Features\ +\f4\i\fs26 \cf0 New Features\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls8\ilvl0 +\ls10\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Added some more sorting keys for use in text export templates.\ {\listtext \'a5 }Reorganized document info window, with some new properties.\ {\listtext \'a5 }You can now navigate through a presentation using mouse clicks.\ @@ -188,17 +243,17 @@ {\listtext \'a5 }Added an optional status bar, displaying the page number, number and pages, as well as informatino about the tool mode, if it applies.\ {\listtext \'a5 }You can now print documents from AppleScript.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls9\ilvl0\cf0 {\listtext \'a5 }Pdfsync from AppleScript now goes separately through the go command instead of the open command.\ +\ls11\ilvl0\cf0 {\listtext \'a5 }Pdfsync from AppleScript now goes separately through the go command instead of the open command.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls10\ilvl0\cf0 {\listtext \'a5 }You can now quickly rotate through tool modes using Shift-modified arrow keys.\ +\ls12\ilvl0\cf0 {\listtext \'a5 }You can now quickly rotate through tool modes using Shift-modified arrow keys.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\f2\b\fs28 \cf0 \ +\f3\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\i\fs26 \cf0 Bugs Fixed\ +\f4\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls11\ilvl0 +\ls13\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Prevent chaching of update info for updater.\ {\listtext \'a5 }Fix the default text export templates.\ {\listtext \'a5 }Allow other active application windows in front of Skim in presentation mode.\ @@ -213,15 +268,15 @@ {\listtext \'a5 }Fix full screen window layout when the full screen window moves to another screen.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f2\b\fs28 \cf0 \ +\f3\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 -\f3\i\fs26 \cf0 New Features\ +\f4\i\fs26 \cf0 New Features\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls12\ilvl0 +\ls14\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }You can now hide all notes and highlights.\ {\listtext \'a5 }Remember last exported type.\ {\listtext \'a5 }Keyboard shortcut for Export.\ @@ -239,13 +294,13 @@ {\listtext \'a5 }You can now change the icon type of anchored notes from the note's window to some standard proofreader marks.\ {\listtext \'a5 }Hidden default for icon type of anchored notes (SKAnchoredNoteiconType).\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls13\ilvl0\cf0 {\listtext \'a5 }Skim now saves the file type and creator code.\ +\ls15\ilvl0\cf0 {\listtext \'a5 }Skim now saves the file type and creator code.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls14\ilvl0\cf0 {\listtext \'a5 }The reading bar is now shown on the thumbnails.\ +\ls16\ilvl0\cf0 {\listtext \'a5 }The reading bar is now shown on the thumbnails.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls15\ilvl0\cf0 {\listtext \'a5 }Add border/line properties to circle, box, text and line notes. Accessible through a new inspector panel and AppleScript.\ +\ls17\ilvl0\cf0 {\listtext \'a5 }Add border/line properties to circle, box, text and line notes. Accessible through a new inspector panel and AppleScript.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls16\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.\ +\ls18\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 }You can now reopen snapshots from a previous run.\ {\listtext \'a5 }New preferences for line styles and interior colors.\ @@ -255,12 +310,12 @@ {\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 -\f2\b\fs28 \cf0 \ +\f3\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\i\fs26 \cf0 Bugs Fixed\ +\f4\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls17\ilvl0 +\ls19\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.\ {\listtext \'a5 }Never add a new note on a click in note tool mode, because undoing such an addition can also remove a text edit in progress.\ {\listtext \'a5 }Update the window title when the document is reloaded; the number of pages can change. \ @@ -270,7 +325,7 @@ {\listtext \'a5 }Add help about cropping pages.\ {\listtext \'a5 }Start and end points for arrow notes in AppleScript are now relative to the page, and changing them automatically changes the bounds.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls18\ilvl0\cf0 {\listtext \'a5 }The side panels in full screen mode are now hidden when you switch to another application.\ +\ls20\ilvl0\cf0 {\listtext \'a5 }The side panels in full screen mode are now hidden when you switch to another application.\ {\listtext \'a5 }Renamed "Arrow" to "Line", as it now allows more general line styles. Also change some keyboard shortcuts.\ {\listtext \'a5 }Enable Password menu item for encrypted files that are flagged as unlocked, as the latter is unreliable in PDFKit.\ {\listtext \'a5 }Fix tab-loop for PDFs with fiallable forms. Also add some help about fillable forms.\ @@ -286,221 +341,221 @@ {\listtext \'a5 }The rotation of text notes is now saved.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f2\b\fs28 \cf0 \ +\f3\b\fs28 \cf0 \ Changes since 0.4\ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\i\fs26 \cf0 Bugs Fixed\ +\f4\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls19\ilvl0 +\ls21\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Fixed installation of new versions by updater.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f2\b\fs28 \cf0 \ +\f3\b\fs28 \cf0 \ Changes since 0.3\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\f3\i\fs26 \cf0 \ +\f4\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 -\ls20\ilvl0 +\ls22\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Add a menu item in the Help menu to visit the web site.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls21\ilvl0\cf0 {\listtext \'a5 }Add single-character shortcuts to change the note style in note mode (t, n, c, b, h, u, s, a).\ +\ls23\ilvl0\cf0 {\listtext \'a5 }Add single-character shortcuts to change the note style in note mode (t, n, c, b, h, u, s, a).\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls22\ilvl0\cf0 {\listtext \'a5 }Fix PDFSync support to work with file names containing spaces.\ +\ls24\ilvl0\cf0 {\listtext \'a5 }Fix PDFSync support to work with file names containing spaces.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls23\ilvl0\cf0 {\listtext \'a5 }Add hidden default for activation of navigation buttons in presentation mode (SKActivatePresentationNavigationAtBottom).\ +\ls25\ilvl0\cf0 {\listtext \'a5 }Add hidden default for activation of navigation buttons in presentation mode (SKActivatePresentationNavigationAtBottom).\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls24\ilvl0\cf0 {\listtext \'a5 }Start search using the find panel at the current page when there is no selection.\ +\ls26\ilvl0\cf0 {\listtext \'a5 }Start search using the find panel at the current page when there is no selection.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls25\ilvl0\cf0 {\listtext \'a5 }Wrap selection using the find panel.\ +\ls27\ilvl0\cf0 {\listtext \'a5 }Wrap selection using the find panel.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls26\ilvl0\cf0 {\listtext \'a5 }Add support for apple remote control. It can be disabled through the hidden default SKEnableAppleRemote.\ +\ls28\ilvl0\cf0 {\listtext \'a5 }Add support for apple remote control. It can be disabled through the hidden default SKEnableAppleRemote.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls27\ilvl0\cf0 {\listtext \'a5 }Hidden defaults for line ending style of arrows (SKLineNoteStartLineStyle, SKLineNoteEndLineStyle).\ +\ls29\ilvl0\cf0 {\listtext \'a5 }Hidden defaults for line ending style of arrows (SKLineNoteStartLineStyle, SKLineNoteEndLineStyle).\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls28\ilvl0\cf0 {\listtext \'a5 }Hidden pref option for reading missing notes from separate .skim file (SKReadMissingNotesFromSkimFileOption). \ +\ls30\ilvl0\cf0 {\listtext \'a5 }Hidden pref option for reading missing notes from separate .skim file (SKReadMissingNotesFromSkimFileOption). \ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls29\ilvl0\cf0 {\listtext \'a5 }You can now open the corresponding PDF from a Skim Notes document.\ +\ls31\ilvl0\cf0 {\listtext \'a5 }You can now open the corresponding PDF from a Skim Notes document.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls30\ilvl0\cf0 {\listtext \'a5 }Skim can now read TIFF images from the clipboard.\ +\ls32\ilvl0\cf0 {\listtext \'a5 }Skim can now read TIFF images from the clipboard.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls31\ilvl0\cf0 {\listtext \'a5 }New select tool. Allows you to copy PDF and TIFF images from a section of a page.\ +\ls33\ilvl0\cf0 {\listtext \'a5 }New select tool. Allows you to copy PDF and TIFF images from a section of a page.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls32\ilvl0\cf0 {\listtext \'a5 }You can now search Skim note files from Spotlight.\ +\ls34\ilvl0\cf0 {\listtext \'a5 }You can now search Skim note files from Spotlight.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls33\ilvl0\cf0 {\listtext \'a5 }New Crop menu items and toolbar button.\ +\ls35\ilvl0\cf0 {\listtext \'a5 }New Crop menu items and toolbar button.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls34\ilvl0\cf0 {\listtext \'a5 }Cropping and page rotation are now undoable.\ +\ls36\ilvl0\cf0 {\listtext \'a5 }Cropping and page rotation are now undoable.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls35\ilvl0\cf0 {\listtext \'a5 }Allow reverting a document when it has changed on disk.\ +\ls37\ilvl0\cf0 {\listtext \'a5 }Allow reverting a document when it has changed on disk.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls36\ilvl0\cf0 {\listtext \'a5 }New menu item to set the selection from the content of the page.\ +\ls38\ilvl0\cf0 {\listtext \'a5 }New menu item to set the selection from the content of the page.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls37\ilvl0\cf0 {\listtext \'a5 }Hidden defaults for automatic crop box margins (SKAutoCropBoxMarginWidth, SKAutoCropBoxMarginHeight).\ +\ls39\ilvl0\cf0 {\listtext \'a5 }Hidden defaults for automatic crop box margins (SKAutoCropBoxMarginWidth, SKAutoCropBoxMarginHeight).\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls38\ilvl0\cf0 {\listtext \'a5 }New Zoom To Selection menu item and toolbar button.\ +\ls40\ilvl0\cf0 {\listtext \'a5 }New Zoom To Selection menu item and toolbar button.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls39\ilvl0\cf0 {\listtext \'a5 }New preference option to open files fit to the PDF.\ +\ls41\ilvl0\cf0 {\listtext \'a5 }New preference option to open files fit to the PDF.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls40\ilvl0\cf0 {\listtext \'a5 }You can now join markup highlights using shift-click, or by selecting a highlight before adding a new one.\ +\ls42\ilvl0\cf0 {\listtext \'a5 }You can now join markup highlights using shift-click, or by selecting a highlight before adding a new one.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls41\ilvl0\cf0 {\listtext \'a5 }You can now supply templates for text export of notes. See the wiki for more information.\ +\ls43\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 -\f2\b\fs28 \cf0 \ +\f3\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\i\fs26 \cf0 Bugs Fixed\ +\f4\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls42\ilvl0 +\ls44\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Fix links in help.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls43\ilvl0\cf0 {\listtext \'a5 }Don't create a new note in note tool mode on mousedown outside a page.\ +\ls45\ilvl0\cf0 {\listtext \'a5 }Don't create a new note in note tool mode on mousedown outside a page.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls44\ilvl0\cf0 {\listtext \'a5 }Don't add new resizable notes in note tool mode when just clicking.\ +\ls46\ilvl0\cf0 {\listtext \'a5 }Don't add new resizable notes in note tool mode when just clicking.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls45\ilvl0\cf0 {\listtext \'a5 }You can now access links that are "hidden" by transparent highlights and arrows.\ +\ls47\ilvl0\cf0 {\listtext \'a5 }You can now access links that are "hidden" by transparent highlights and arrows.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls46\ilvl0\cf0 {\listtext \'a5 }Scroll reading bar to visible when it is shown.\ +\ls48\ilvl0\cf0 {\listtext \'a5 }Scroll reading bar to visible when it is shown.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls47\ilvl0\cf0 {\listtext \'a5 }Scroll to previous position on page when reloading PDF.\ +\ls49\ilvl0\cf0 {\listtext \'a5 }Scroll to previous position on page when reloading PDF.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls48\ilvl0\cf0 {\listtext \'a5 }Escape spaces in TeX editor command.\ +\ls50\ilvl0\cf0 {\listtext \'a5 }Escape spaces in TeX editor command.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls49\ilvl0\cf0 {\listtext \'a5 }Thumbnails now use the current display box.\ +\ls51\ilvl0\cf0 {\listtext \'a5 }Thumbnails now use the current display box.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls50\ilvl0\cf0 {\listtext \'a5 }Retry automatic reloading of files changed on disk a few times.\ +\ls52\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 -\ls50\ilvl0 -\f2\b\fs28 \cf0 \ +\ls52\ilvl0 +\f3\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 -\f3\i\fs26 \cf0 \ +\f4\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 -\ls51\ilvl0 +\ls53\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Add shortcuts for bigger/smaller font sizes.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls52\ilvl0\cf0 {\listtext \'a5 }Command-click a snapshot.\ +\ls54\ilvl0\cf0 {\listtext \'a5 }Command-click a snapshot.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls53\ilvl0\cf0 {\listtext \'a5 }We now print notes and highlights.\ +\ls55\ilvl0\cf0 {\listtext \'a5 }We now print notes and highlights.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls54\ilvl0\cf0 {\listtext \'a5 }Add copy/cut/paste items to the contextual menu, when they apply.\ +\ls56\ilvl0\cf0 {\listtext \'a5 }Add copy/cut/paste items to the contextual menu, when they apply.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls55\ilvl0\cf0 {\listtext \'a5 }You can now make a snapshot of a page by Command-clicking a thumbnail.\ +\ls57\ilvl0\cf0 {\listtext \'a5 }You can now make a snapshot of a page by Command-clicking a thumbnail.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls56\ilvl0\cf0 {\listtext \'a5 }Added Dutch localization.\ +\ls58\ilvl0\cf0 {\listtext \'a5 }Added Dutch localization.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls57\ilvl0\cf0 {\listtext \'a5 }We now do not leave Full Screen when switching to another application.\ +\ls59\ilvl0\cf0 {\listtext \'a5 }We now do not leave Full Screen when switching to another application.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls58\ilvl0\cf0 {\listtext \'a5 }Export notes as RTF.\ +\ls60\ilvl0\cf0 {\listtext \'a5 }Export notes as RTF.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls59\ilvl0\cf0 {\listtext \'a5 }Add preference options for default note/highlight colors and text note font.\ +\ls61\ilvl0\cf0 {\listtext \'a5 }Add preference options for default note/highlight colors and text note font.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls60\ilvl0\cf0 {\listtext \'a5 }Add menu item to save the current PDF display settings to be used for new documents.\ +\ls62\ilvl0\cf0 {\listtext \'a5 }Add menu item to save the current PDF display settings to be used for new documents.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls61\ilvl0\cf0 {\listtext \'a5 }Search results from the Find Panel are now also highlighted with a red oval.\ +\ls63\ilvl0\cf0 {\listtext \'a5 }Search results from the Find Panel are now also highlighted with a red oval.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls62\ilvl0\cf0 {\listtext \'a5 }Select search field when opening the Contents pane in full screen mode.\ +\ls64\ilvl0\cf0 {\listtext \'a5 }Select search field when opening the Contents pane in full screen mode.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls63\ilvl0\cf0 {\listtext \'a5 }You can now reset all preferences or all preferences in a pane.\ +\ls65\ilvl0\cf0 {\listtext \'a5 }You can now reset all preferences or all preferences in a pane.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls64\ilvl0\cf0 {\listtext \'a5 }Added Italian localization. (Thanks Andrea Bergia!)\ +\ls66\ilvl0\cf0 {\listtext \'a5 }Added Italian localization. (Thanks Andrea Bergia!)\ {\listtext \'a5 }Screensaver and sleep are now disabled in Presentation mode.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls65\ilvl0\cf0 {\listtext \'a5 }Skim can now return to the last page viewed in a document.\ +\ls67\ilvl0\cf0 {\listtext \'a5 }Skim can now return to the last page viewed in a document.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls66\ilvl0\cf0 {\listtext \'a5 }Link tool tips now show the top of the text when the link refers to the (empty) top of a page. \ +\ls68\ilvl0\cf0 {\listtext \'a5 }Link tool tips now show the top of the text when the link refers to the (empty) top of a page. \ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls67\ilvl0\cf0 {\listtext \'a5 }Skim can now also view separate Skim notes (.skim) files.\ +\ls69\ilvl0\cf0 {\listtext \'a5 }Skim can now also view separate Skim notes (.skim) files.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls68\ilvl0\cf0 {\listtext \'a5 }Using Sparkle for automatic updating. (Thanks Andy Matuschak!)\ +\ls70\ilvl0\cf0 {\listtext \'a5 }Using Sparkle for automatic updating. (Thanks Andy Matuschak!)\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls69\ilvl0\cf0 {\listtext \'a5 }Display the number of pages in the title bar.\ +\ls71\ilvl0\cf0 {\listtext \'a5 }Display the number of pages in the title bar.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls70\ilvl0\cf0 {\listtext \'a5 }Skim can now automatically backup a skim notes file whenever it saves a PDF file.\ +\ls72\ilvl0\cf0 {\listtext \'a5 }Skim can now automatically backup a skim notes file whenever it saves a PDF file.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls71\ilvl0\cf0 {\listtext \'a5 }You can now resize the current note using the arrow keys, when you hold down the Control key.\ +\ls73\ilvl0\cf0 {\listtext \'a5 }You can now resize the current note using the arrow keys, when you hold down the Control key.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls72\ilvl0\cf0 {\listtext \'a5 }Notes are now ordered according to page and location in page.\ +\ls74\ilvl0\cf0 {\listtext \'a5 }Notes are now ordered according to page and location in page.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls73\ilvl0\cf0 {\listtext \'a5 }Several improvements of Skim's custom tool-tips.\ +\ls75\ilvl0\cf0 {\listtext \'a5 }Several improvements of Skim's custom tool-tips.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls74\ilvl0\cf0 {\listtext \'a5 }Add a menu item to select the search field.\ +\ls76\ilvl0\cf0 {\listtext \'a5 }Add a menu item to select the search field.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls75\ilvl0\cf0 {\listtext \'a5 }You can now add arrows to a PDF document.\ +\ls77\ilvl0\cf0 {\listtext \'a5 }You can now add arrows to a PDF document.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls76\ilvl0\cf0 {\listtext \'a5 }You can now add notes from external .skim files rather than just overwriting them.\ +\ls78\ilvl0\cf0 {\listtext \'a5 }You can now add notes from external .skim files rather than just overwriting them.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls77\ilvl0\cf0 {\listtext \'a5 }PDFSync support. See the Wiki for more information.\ +\ls79\ilvl0\cf0 {\listtext \'a5 }PDFSync support. See the Wiki for more information.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls78\ilvl0\cf0 {\listtext \'a5 }You can now set transparent colors from the color panel. \ +\ls80\ilvl0\cf0 {\listtext \'a5 }You can now set transparent colors from the color panel. \ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls79\ilvl0\cf0 {\listtext \'a5 }You can now set separate PDF view settings for full screen mode. \ +\ls81\ilvl0\cf0 {\listtext \'a5 }You can now set separate PDF view settings for full screen mode. \ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls80\ilvl0\cf0 {\listtext \'a5 }Add a Look Up in Dictionary item to the contextual menu.\ +\ls82\ilvl0\cf0 {\listtext \'a5 }Add a Look Up in Dictionary item to the contextual menu.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls81\ilvl0\cf0 {\listtext \'a5 }You can now undo edits of notes and highlights.\ +\ls83\ilvl0\cf0 {\listtext \'a5 }You can now undo edits of notes and highlights.\ {\listtext \'a5 }Add a hidden preference (SKActivateFullScreenNavigationAtBottom) to show the navigation buttons in full screen mode only when moving the mouse at the bottom of the screen. \ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls82\ilvl0\cf0 {\listtext \'a5 }Add hidden preferences for the line widths of circles and boxes (SKCircleNoteLineWidth and SKSquareNoteLineWidth).\ +\ls84\ilvl0\cf0 {\listtext \'a5 }Add hidden preferences for the line widths of circles and boxes (SKCircleNoteLineWidth and SKSquareNoteLineWidth).\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls83\ilvl0\cf0 {\listtext \'a5 }New tool modes for ading notes or highlights.\ +\ls85\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 -\f2\b\fs28 \cf0 \ +\f3\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\i\fs26 \cf0 Bugs Fixed\ +\f4\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls84\ilvl0 +\ls86\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }We now don't edit new text notes, so they can be moved, resized or deleted.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls85\ilvl0\cf0 {\listtext \'a5 }We now make sure new notes are added to a visible page.\ +\ls87\ilvl0\cf0 {\listtext \'a5 }We now make sure new notes are added to a visible page.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls86\ilvl0\cf0 {\listtext \'a5 }Disable the TOC menu item when there is no TOC.\ +\ls88\ilvl0\cf0 {\listtext \'a5 }Disable the TOC menu item when there is no TOC.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls87\ilvl0\cf0 {\listtext \'a5 }Return to the location that was viewed when reloading a document.\ +\ls89\ilvl0\cf0 {\listtext \'a5 }Return to the location that was viewed when reloading a document.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls88\ilvl0\cf0 {\listtext \'a5 }Search text in a PDf file asynchronously, so it does not block Skim.\ +\ls90\ilvl0\cf0 {\listtext \'a5 }Search text in a PDf file asynchronously, so it does not block Skim.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls89\ilvl0\cf0 {\listtext \'a5 }Fix crashes that can appear for links with missing URLs.\ +\ls91\ilvl0\cf0 {\listtext \'a5 }Fix crashes that can appear for links with missing URLs.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls90\ilvl0\cf0 {\listtext \'a5 }Add separators in the Notes menu for categories.\ +\ls92\ilvl0\cf0 {\listtext \'a5 }Add separators in the Notes menu for categories.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls91\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting a PDF-document.\ +\ls93\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting a PDF-document.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls92\ilvl0\cf0 {\listtext \'a5 }Fix typos in the Help and update for new features.\ +\ls94\ilvl0\cf0 {\listtext \'a5 }Fix typos in the Help and update for new features.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls93\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting the document. Unfortunately this disabled tool tips.\ +\ls95\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting the document. Unfortunately this disabled tool tips.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls94\ilvl0\cf0 {\listtext \'a5 }Open the contents pane to display the search term when opening from Spotlight.\ +\ls96\ilvl0\cf0 {\listtext \'a5 }Open the contents pane to display the search term when opening from Spotlight.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls95\ilvl0\cf0 {\listtext \'a5 }Save notes when auto-saving and exporting as PDF.\ +\ls97\ilvl0\cf0 {\listtext \'a5 }Save notes when auto-saving and exporting as PDF.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls96\ilvl0\cf0 {\listtext \'a5 }Remember the width of notes pane.\ +\ls98\ilvl0\cf0 {\listtext \'a5 }Remember the width of notes pane.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls97\ilvl0\cf0 {\listtext \'a5 }Fix leaks leading to excessive memory use.\ +\ls99\ilvl0\cf0 {\listtext \'a5 }Fix leaks leading to excessive memory use.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls98\ilvl0\cf0 {\listtext \'a5 }Fix back-tabbing through notes and links.\ +\ls100\ilvl0\cf0 {\listtext \'a5 }Fix back-tabbing through notes and links.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls99\ilvl0\cf0 {\listtext \'a5 }Zooming using the scroll-wheel now only affects the current window.\ +\ls101\ilvl0\cf0 {\listtext \'a5 }Zooming using the scroll-wheel now only affects the current window.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls100\ilvl0\cf0 {\listtext \'a5 }Lazy updating of page thumbnails to avoid slowdown when opening a file.\ +\ls102\ilvl0\cf0 {\listtext \'a5 }Lazy updating of page thumbnails to avoid slowdown when opening a file.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f2\b\fs28 \cf0 \ +\f3\b\fs28 \cf0 \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f0\b0\fs48 \cf0 Colofon -\f2\b\fs28 \ +\f3\b\fs28 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural @@ -511,7 +566,7 @@ \fs22 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f2\b\fs28 \cf0 About Skim\ +\f3\b\fs28 \cf0 About Skim\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\b0\fs22 \cf0 \ @@ -519,7 +574,7 @@ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\i\b\fs26 \cf0 Web Site\ +\f4\i\b\fs26 \cf0 Web Site\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\i0\b0\fs22 \cf0 \ @@ -527,7 +582,7 @@ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\i\b\fs26 \cf0 Getting Help\ +\f4\i\b\fs26 \cf0 Getting Help\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\i0\b0\fs22 \cf0 \ @@ -535,11 +590,11 @@ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\i\b\fs26 \cf0 Reporting Bugs\ +\f4\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. -\f4\b Note: +\f5\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-08-19 11:49:18
|
Revision: 2685 http://skim-app.svn.sourceforge.net/skim-app/?rev=2685&view=rev Author: hofman Date: 2007-08-19 04:49:17 -0700 (Sun, 19 Aug 2007) Log Message: ----------- Small changes to error handling. Modified Paths: -------------- trunk/Files_SKExtensions.m Modified: trunk/Files_SKExtensions.m =================================================================== --- trunk/Files_SKExtensions.m 2007-08-19 11:28:18 UTC (rev 2684) +++ trunk/Files_SKExtensions.m 2007-08-19 11:49:17 UTC (rev 2685) @@ -226,14 +226,17 @@ FSRef container; Boolean isDirectory; + /* get FSRef for container */ result = FSPathMakeRef(containerPath, &container, &isDirectory); - if (isDirectory == false) - result = errFSNotAFolder; require_noerr(result, FSPathMakeRef); + + /* make sure container is a directory */ + require_action(isDirectory == false, ContainerNotDirectory, result = dirNFErr); /* delete the container recursively */ result = FSDeleteContainer(&container); +ContainerNotDirectory: FSPathMakeRef: return ( result ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-19 11:28:19
|
Revision: 2684 http://skim-app.svn.sourceforge.net/skim-app/?rev=2684&view=rev Author: hofman Date: 2007-08-19 04:28:18 -0700 (Sun, 19 Aug 2007) Log Message: ----------- Use carbon file manager to copy and delete items for disk image creation. Modified Paths: -------------- trunk/Files_SKExtensions.h trunk/Files_SKExtensions.m trunk/SKDocument.m Modified: trunk/Files_SKExtensions.h =================================================================== --- trunk/Files_SKExtensions.h 2007-08-18 19:40:05 UTC (rev 2683) +++ trunk/Files_SKExtensions.h 2007-08-19 11:28:18 UTC (rev 2684) @@ -43,4 +43,9 @@ extern BOOL SKFileIsInTrash(NSURL *fileURL); extern BOOL SKFileExistsAtPath(NSString *path); extern NSDate *SKFileModificationDateAtPath(NSString *path); -extern NSString *SKTemporaryDirectoryCreating(BOOL create); +extern NSString *SKUniqueDirectoryCreating(NSString *basePath, BOOL create); + +extern OSErr FSDeleteContainerContents(const FSRef *container); +extern OSErr FSDeleteContainer(const FSRef *container); +extern OSErr FSPathDeleteContainer(const UInt8 *containerPath); + \ No newline at end of file Modified: trunk/Files_SKExtensions.m =================================================================== --- trunk/Files_SKExtensions.m 2007-08-18 19:40:05 UTC (rev 2683) +++ trunk/Files_SKExtensions.m 2007-08-19 11:28:18 UTC (rev 2684) @@ -81,22 +81,160 @@ return nil; } -NSString *SKTemporaryDirectoryCreating(BOOL create) { - NSString *baseTmpDir = [NSTemporaryDirectory() stringByAppendingPathComponent:[[NSBundle mainBundle] bundleIdentifier]]; - NSString *tmpDir = baseTmpDir; - NSString *tmpDirName; - int i = 0; +NSString *SKUniqueDirectoryCreating(NSString *basePath, BOOL create) { + CFUUIDRef uuid = CFUUIDCreate(NULL); + NSString *tmpDirName = [(NSString *)CFUUIDCreateString(NULL, uuid) autorelease]; + CFRelease(uuid); + BOOL success = YES; - while (SKFileExistsAtPath(tmpDir)) - tmpDir = [baseTmpDir stringByAppendingFormat:@"-%i", ++i]; - - tmpDirName = [tmpDir lastPathComponent]; - if (success && create) { + if (create) { FSRef tmpRef; - success = noErr == FSPathMakeRef((UInt8 *)[NSTemporaryDirectory() fileSystemRepresentation], &tmpRef, NULL) && + success = noErr == FSPathMakeRef((UInt8 *)[basePath fileSystemRepresentation], &tmpRef, NULL) && noErr == FSCreateDirectoryUnicode(&tmpRef, [tmpDirName length], (const UniChar *)[tmpDirName cStringUsingEncoding:NSUnicodeStringEncoding], kFSCatInfoNone, NULL, NULL, NULL, NULL); } - return success ? tmpDir : nil; + return success ? [basePath stringByAppendingPathComponent:tmpDirName] : nil; } + +// These are taken from MoreFilesX + +struct FSDeleteContainerGlobals +{ + OSErr result; /* result */ + ItemCount actualObjects; /* number of objects returned */ + FSCatalogInfo catalogInfo; /* FSCatalogInfo */ +}; +typedef struct FSDeleteContainerGlobals FSDeleteContainerGlobals; + +static +void +FSDeleteContainerLevel( + const FSRef *container, + FSDeleteContainerGlobals *theGlobals) +{ + /* level locals */ + FSIterator iterator; + FSRef itemToDelete; + UInt16 nodeFlags; + + /* Open FSIterator for flat access and give delete optimization hint */ + theGlobals->result = FSOpenIterator(container, kFSIterateFlat + kFSIterateDelete, &iterator); + require_noerr(theGlobals->result, FSOpenIterator); + + /* delete the contents of the directory */ + do + { + /* get 1 item to delete */ + theGlobals->result = FSGetCatalogInfoBulk(iterator, 1, &theGlobals->actualObjects, + NULL, kFSCatInfoNodeFlags, &theGlobals->catalogInfo, + &itemToDelete, NULL, NULL); + if ( (noErr == theGlobals->result) && (1 == theGlobals->actualObjects) ) + { + /* save node flags in local in case we have to recurse */ + nodeFlags = theGlobals->catalogInfo.nodeFlags; + + /* is it a file or directory? */ + if ( 0 != (nodeFlags & kFSNodeIsDirectoryMask) ) + { + /* it's a directory -- delete its contents before attempting to delete it */ + FSDeleteContainerLevel(&itemToDelete, theGlobals); + } + /* are we still OK to delete? */ + if ( noErr == theGlobals->result ) + { + /* is item locked? */ + if ( 0 != (nodeFlags & kFSNodeLockedMask) ) + { + /* then attempt to unlock it (ignore result since FSDeleteObject will set it correctly) */ + theGlobals->catalogInfo.nodeFlags = nodeFlags & ~kFSNodeLockedMask; + (void) FSSetCatalogInfo(&itemToDelete, kFSCatInfoNodeFlags, &theGlobals->catalogInfo); + } + /* delete the item */ + theGlobals->result = FSDeleteObject(&itemToDelete); + } + } + } while ( noErr == theGlobals->result ); + + /* we found the end of the items normally, so return noErr */ + if ( errFSNoMoreItems == theGlobals->result ) + { + theGlobals->result = noErr; + } + + /* close the FSIterator (closing an open iterator should never fail) */ + verify_noerr(FSCloseIterator(iterator)); + +FSOpenIterator: + + return; +} + +OSErr +FSDeleteContainerContents( + const FSRef *container) +{ + FSDeleteContainerGlobals theGlobals; + + /* delete container's contents */ + FSDeleteContainerLevel(container, &theGlobals); + + return ( theGlobals.result ); +} + +OSErr +FSDeleteContainer( + const FSRef *container) +{ + OSErr result; + FSCatalogInfo catalogInfo; + + /* get nodeFlags for container */ + result = FSGetCatalogInfo(container, kFSCatInfoNodeFlags, &catalogInfo, NULL, NULL,NULL); + require_noerr(result, FSGetCatalogInfo); + + /* make sure container is a directory */ + require_action(0 != (catalogInfo.nodeFlags & kFSNodeIsDirectoryMask), ContainerNotDirectory, result = dirNFErr); + + /* delete container's contents */ + result = FSDeleteContainerContents(container); + require_noerr(result, FSDeleteContainerContents); + + /* is container locked? */ + if ( 0 != (catalogInfo.nodeFlags & kFSNodeLockedMask) ) + { + /* then attempt to unlock container (ignore result since FSDeleteObject will set it correctly) */ + catalogInfo.nodeFlags &= ~kFSNodeLockedMask; + (void) FSSetCatalogInfo(container, kFSCatInfoNodeFlags, &catalogInfo); + } + + /* delete the container */ + result = FSDeleteObject(container); + +FSDeleteContainerContents: +ContainerNotDirectory: +FSGetCatalogInfo: + + return ( result ); +} + +OSErr +FSPathDeleteContainer( + const UInt8 *containerPath) +{ + OSErr result; + FSRef container; + Boolean isDirectory; + + result = FSPathMakeRef(containerPath, &container, &isDirectory); + if (isDirectory == false) + result = errFSNotAFolder; + require_noerr(result, FSPathMakeRef); + + /* delete the container recursively */ + result = FSDeleteContainer(&container); + +FSPathMakeRef: + + return ( result ); +} Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-08-18 19:40:05 UTC (rev 2683) +++ trunk/SKDocument.m 2007-08-19 11:28:18 UTC (rev 2684) @@ -591,7 +591,7 @@ NSAutoreleasePool *pool = [NSAutoreleasePool new]; - NSString *tmpDir = SKTemporaryDirectoryCreating(YES); + NSString *tmpDir = SKUniqueDirectoryCreating(NSTemporaryDirectory(), YES); BOOL success = tmpDir != nil; NSString *sourcePath = [[[info objectForKey:@"sourcePath"] copy] autorelease]; @@ -599,9 +599,11 @@ NSString *name = [[targetPath lastPathComponent] stringByDeletingPathExtension]; NSString *tmpImagePath1 = [[tmpDir stringByAppendingPathComponent:name] stringByAppendingPathExtension:@"sparseimage"]; NSString *tmpImagePath2 = [[tmpDir stringByAppendingPathComponent:name] stringByAppendingPathExtension:@"dmg"]; - NSString *tmpMountPath = [tmpDir stringByAppendingPathComponent:name]; + NSString *tmpMountPath = SKUniqueDirectoryCreating(@"/tmp", NO); // we don't use tmpDir because the mountpath has a maximum length of 90 BOOL didAttach = NO; + + @try { if (success) { success = [NSTask runTaskWithLaunchPath:@"/usr/bin/hdiutil" @@ -619,10 +621,7 @@ } if (success) { - // we can't use NSFileManager because it's not thread safe, while FSPathCopyObjectSync complains about not enough space - success = [NSTask runTaskWithLaunchPath:@"/bin/cp" - arguments:[NSArray arrayWithObjects:@"-f", sourcePath, tmpMountPath, nil] - currentDirectoryPath:tmpDir]; + success = noErr == FSPathCopyObjectSync((const char *)[sourcePath fileSystemRepresentation], (const char *)[tmpMountPath fileSystemRepresentation], (CFStringRef)[sourcePath lastPathComponent], NULL, kFSFileOperationOverwrite); } if (didAttach) { @@ -638,13 +637,10 @@ } if (success) { - success = [NSTask runTaskWithLaunchPath:@"/bin/cp" - arguments:[NSArray arrayWithObjects:@"-f", tmpImagePath2, targetPath, nil] - currentDirectoryPath:tmpDir]; + success = noErr == FSPathCopyObjectSync((const char *)[tmpImagePath2 fileSystemRepresentation], (const char *)[[targetPath stringByDeletingLastPathComponent] fileSystemRepresentation], (CFStringRef)[targetPath lastPathComponent], NULL, kFSFileOperationOverwrite); } - // easier than FSDeleteObject, because that cannot delete the directory recursively - [NSTask launchedTaskWithLaunchPath:@"/bin/rm" arguments:[NSArray arrayWithObjects:@"-rf", tmpDir, nil]]; + FSPathDeleteContainer((const UInt8 *)[tmpDir fileSystemRepresentation]); } @catch(id exception) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-08-18 19:40:13
|
Revision: 2683 http://skim-app.svn.sourceforge.net/skim-app/?rev=2683&view=rev Author: hofman Date: 2007-08-18 12:40:05 -0700 (Sat, 18 Aug 2007) Log Message: ----------- Move some therad safe file functions to category file. Modified Paths: -------------- trunk/SKApplicationController.m trunk/SKBookmarkController.m trunk/SKDocument.m trunk/SKPDFSynchronizer.m trunk/Skim.xcodeproj/project.pbxproj Added Paths: ----------- trunk/Files_SKExtensions.h trunk/Files_SKExtensions.m Removed Paths: ------------- trunk/NSFileManager_SKExtensions.h trunk/NSFileManager_SKExtensions.m Copied: trunk/Files_SKExtensions.h (from rev 2682, trunk/NSFileManager_SKExtensions.h) =================================================================== --- trunk/Files_SKExtensions.h (rev 0) +++ trunk/Files_SKExtensions.h 2007-08-18 19:40:05 UTC (rev 2683) @@ -0,0 +1,46 @@ +// +// Files_SKExtensions.h +// Skim +// +// Created by Christiaan Hofman on 8/18/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> + +// These functions are thread safe + +extern BOOL SKFileIsInTrash(NSURL *fileURL); +extern BOOL SKFileExistsAtPath(NSString *path); +extern NSDate *SKFileModificationDateAtPath(NSString *path); +extern NSString *SKTemporaryDirectoryCreating(BOOL create); Copied: trunk/Files_SKExtensions.m (from rev 2682, trunk/NSFileManager_SKExtensions.m) =================================================================== --- trunk/Files_SKExtensions.m (rev 0) +++ trunk/Files_SKExtensions.m 2007-08-18 19:40:05 UTC (rev 2683) @@ -0,0 +1,102 @@ +// +// Files_SKExtensions.m +// Skim +// +// Created by Christiaan Hofman on 8/18/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 "Files_SKExtensions.h" +#import <Carbon/Carbon.h> + + +BOOL SKFileIsInTrash(NSURL *fileURL) { + NSCParameterAssert([fileURL isFileURL]); + FSRef parentRef; + CFURLRef parentURL = CFURLCreateCopyDeletingLastPathComponent(CFGetAllocator((CFURLRef)fileURL), (CFURLRef)fileURL); + [(id)parentURL autorelease]; + if (CFURLGetFSRef(parentURL, &parentRef)) { + OSStatus err; + FSRef fsRef; + err = FSFindFolder(kUserDomain, kTrashFolderType, TRUE, &fsRef); + if (noErr == err && noErr == FSCompareFSRefs(&fsRef, &parentRef)) + return YES; + + err = FSFindFolder(kOnAppropriateDisk, kSystemTrashFolderType, TRUE, &fsRef); + if (noErr == err && noErr == FSCompareFSRefs(&fsRef, &parentRef)) + return YES; + } + return NO; +} + +BOOL SKFileExistsAtPath(NSString *path) { + FSRef fileRef; + + if (path && noErr == FSPathMakeRef((UInt8 *)[path fileSystemRepresentation], &fileRef, NULL)) + return YES; + else + return NO; +} + +NSDate *SKFileModificationDateAtPath(NSString *path) { + FSRef fileRef; + FSCatalogInfo info; + CFAbsoluteTime absoluteTime; + + if (CFURLGetFSRef((CFURLRef)[NSURL fileURLWithPath:path], &fileRef) && + noErr == FSGetCatalogInfo(&fileRef, kFSCatInfoContentMod, &info, NULL, NULL, NULL) && + noErr == UCConvertUTCDateTimeToCFAbsoluteTime(&info.contentModDate, &absoluteTime)) + return [NSDate dateWithTimeIntervalSinceReferenceDate:(NSTimeInterval)absoluteTime]; + else + return nil; +} + +NSString *SKTemporaryDirectoryCreating(BOOL create) { + NSString *baseTmpDir = [NSTemporaryDirectory() stringByAppendingPathComponent:[[NSBundle mainBundle] bundleIdentifier]]; + NSString *tmpDir = baseTmpDir; + NSString *tmpDirName; + int i = 0; + BOOL success = YES; + + while (SKFileExistsAtPath(tmpDir)) + tmpDir = [baseTmpDir stringByAppendingFormat:@"-%i", ++i]; + + tmpDirName = [tmpDir lastPathComponent]; + if (success && create) { + FSRef tmpRef; + success = noErr == FSPathMakeRef((UInt8 *)[NSTemporaryDirectory() fileSystemRepresentation], &tmpRef, NULL) && + noErr == FSCreateDirectoryUnicode(&tmpRef, [tmpDirName length], (const UniChar *)[tmpDirName cStringUsingEncoding:NSUnicodeStringEncoding], kFSCatInfoNone, NULL, NULL, NULL, NULL); + } + + return success ? tmpDir : nil; +} Deleted: trunk/NSFileManager_SKExtensions.h =================================================================== --- trunk/NSFileManager_SKExtensions.h 2007-08-18 18:50:01 UTC (rev 2682) +++ trunk/NSFileManager_SKExtensions.h 2007-08-18 19:40:05 UTC (rev 2683) @@ -1,44 +0,0 @@ -// -// NSFileManager_SKExtensions.h -// Skim -// -// Created by Christiaan Hofman on 8/18/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> - - -@interface NSFileManager (SKExtensions) -- (BOOL)fileIsInTrash:(NSURL *)fileURL; -@end Deleted: trunk/NSFileManager_SKExtensions.m =================================================================== --- trunk/NSFileManager_SKExtensions.m 2007-08-18 18:50:01 UTC (rev 2682) +++ trunk/NSFileManager_SKExtensions.m 2007-08-18 19:40:05 UTC (rev 2683) @@ -1,63 +0,0 @@ -// -// NSFileManager_SKExtensions.m -// Skim -// -// Created by Christiaan Hofman on 8/18/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 "NSFileManager_SKExtensions.h" -#import <Carbon/Carbon.h> - -@implementation NSFileManager (SKExtensions) - -- (BOOL)fileIsInTrash:(NSURL *)fileURL { - NSCParameterAssert([fileURL isFileURL]); - FSRef parentRef; - CFURLRef parentURL = CFURLCreateCopyDeletingLastPathComponent(CFGetAllocator((CFURLRef)fileURL), (CFURLRef)fileURL); - [(id)parentURL autorelease]; - if (CFURLGetFSRef(parentURL, &parentRef)) { - OSStatus err; - FSRef fsRef; - err = FSFindFolder(kUserDomain, kTrashFolderType, TRUE, &fsRef); - if (noErr == err && noErr == FSCompareFSRefs(&fsRef, &parentRef)) - return YES; - - err = FSFindFolder(kOnAppropriateDisk, kSystemTrashFolderType, TRUE, &fsRef); - if (noErr == err && noErr == FSCompareFSRefs(&fsRef, &parentRef)) - return YES; - } - return NO; -} - -@end Modified: trunk/SKApplicationController.m =================================================================== --- trunk/SKApplicationController.m 2007-08-18 18:50:01 UTC (rev 2682) +++ trunk/SKApplicationController.m 2007-08-18 19:40:05 UTC (rev 2683) @@ -55,7 +55,7 @@ #import "SKDownloadController.h" #import "NSURL_SKExtensions.h" #import "SKDocumentController.h" -#import "NSFileManager_SKExtensions.h" +#import "Files_SKExtensions.h" @implementation SKApplicationController @@ -118,7 +118,7 @@ fileURL = [[BDAlias aliasWithData:[dict objectForKey:@"_BDAlias"]] fileURL]; if(fileURL == nil && [dict objectForKey:@"fileName"]) fileURL = [NSURL fileURLWithPath:[dict objectForKey:@"fileName"]]; - if(fileURL && NO == [[NSFileManager defaultManager] fileIsInTrash:fileURL]) { + if(fileURL && NO == SKFileIsInTrash(fileURL)) { if (document = [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:fileURL display:NO error:&error]) { [document makeWindowControllers]; if ([document respondsToSelector:@selector(mainWindowController)]) Modified: trunk/SKBookmarkController.m =================================================================== --- trunk/SKBookmarkController.m 2007-08-18 18:50:01 UTC (rev 2682) +++ trunk/SKBookmarkController.m 2007-08-18 19:40:05 UTC (rev 2683) @@ -40,7 +40,7 @@ #import "BDAlias.h" #import "SKDocument.h" #import "SKMainWindowController.h" -#import "NSFileManager_SKExtensions.h" +#import "Files_SKExtensions.h" @implementation SKBookmarkController @@ -240,7 +240,7 @@ if (fileURL == nil && [bm objectForKey:@"path"]) fileURL = [NSURL fileURLWithPath:[bm objectForKey:@"path"]]; - if (fileURL && NO == [[NSFileManager defaultManager] fileIsInTrash:fileURL]) { + if (fileURL && NO == SKFileIsInTrash(fileURL)) { if (document = [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:fileURL display:YES error:&error]) { [[document mainWindowController] setPageNumber:[[bm objectForKey:@"pageIndex"] unsignedIntValue] + 1]; } else { Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-08-18 18:50:01 UTC (rev 2682) +++ trunk/SKDocument.m 2007-08-18 19:40:05 UTC (rev 2683) @@ -59,6 +59,7 @@ #import "SKInfoWindowController.h" #import "SKLine.h" #import "SKApplicationController.h" +#import "Files_SKExtensions.h" // maximum length of xattr value recommended by Apple #define MAX_XATTR_LENGTH 2048 @@ -590,21 +591,9 @@ NSAutoreleasePool *pool = [NSAutoreleasePool new]; - NSString *baseTmpDir = [NSTemporaryDirectory() stringByAppendingPathComponent:[[NSBundle mainBundle] bundleIdentifier]]; - NSString *tmpDir = baseTmpDir; - NSString *tmpDirName; - FSRef tmpRef; - int i = 0; - BOOL success = YES; + NSString *tmpDir = SKTemporaryDirectoryCreating(YES); + BOOL success = tmpDir != nil; - while (fnfErr != FSPathMakeRef((UInt8 *)[tmpDir fileSystemRepresentation], &tmpRef, NULL)) - tmpDir = [baseTmpDir stringByAppendingFormat:@"-%i", ++i]; - - tmpDirName = [tmpDir lastPathComponent]; - success = noErr == FSPathMakeRef((UInt8 *)[NSTemporaryDirectory() fileSystemRepresentation], &tmpRef, NULL); - if (success) - success = noErr == FSCreateDirectoryUnicode(&tmpRef, [tmpDirName length], (const UniChar *)[tmpDirName cStringUsingEncoding:NSUnicodeStringEncoding], kFSCatInfoNone, NULL, NULL, NULL, NULL); - NSString *sourcePath = [[[info objectForKey:@"sourcePath"] copy] autorelease]; NSString *targetPath = [[[info objectForKey:@"targetPath"] copy] autorelease]; NSString *name = [[targetPath lastPathComponent] stringByDeletingPathExtension]; Modified: trunk/SKPDFSynchronizer.m =================================================================== --- trunk/SKPDFSynchronizer.m 2007-08-18 18:50:01 UTC (rev 2682) +++ trunk/SKPDFSynchronizer.m 2007-08-18 19:40:05 UTC (rev 2683) @@ -40,31 +40,9 @@ #import "NSCharacterSet_SKExtensions.h" #import "NSScanner_SKExtensions.h" #import <Carbon/Carbon.h> +#import "Files_SKExtensions.h" -// NSFileManager is not thread safe -static BOOL SKFileExistsAtPath(NSString *path) { - FSRef fileRef; - - if (path && noErr == FSPathMakeRef((UInt8 *)[path fileSystemRepresentation], &fileRef, NULL)) - return YES; - else - return NO; -} - -static NSDate *SKFileModificationDateAtPath(NSString *path) { - FSRef fileRef; - FSCatalogInfo info; - CFAbsoluteTime absoluteTime; - - if (CFURLGetFSRef((CFURLRef)[NSURL fileURLWithPath:path], &fileRef) && - noErr == FSGetCatalogInfo(&fileRef, kFSCatInfoContentMod, &info, NULL, NULL, NULL) && - noErr == UCConvertUTCDateTimeToCFAbsoluteTime(&info.contentModDate, &absoluteTime)) - return [NSDate dateWithTimeIntervalSinceReferenceDate:(NSTimeInterval)absoluteTime]; - else - return nil; -} - static NSString *SKTeXSourceFile(NSString *file, NSString *base) { if ([[file pathExtension] caseInsensitiveCompare:@"tex"] != NSOrderedSame) file = [file stringByAppendingPathExtension:@"tex"]; Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-08-18 18:50:01 UTC (rev 2682) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-08-18 19:40:05 UTC (rev 2683) @@ -176,7 +176,7 @@ CEF711A10B90B714003A2771 /* NSUserDefaultsController_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CEF711A00B90B714003A2771 /* NSUserDefaultsController_SKExtensions.m */; }; CEF7175C0B90DEEF003A2771 /* ReleaseNotes.nib in Resources */ = {isa = PBXBuildFile; fileRef = CEF717560B90DEEF003A2771 /* ReleaseNotes.nib */; }; CEF7175F0B90DF10003A2771 /* SKReleaseNotesController.m in Sources */ = {isa = PBXBuildFile; fileRef = CEF7175E0B90DF10003A2771 /* SKReleaseNotesController.m */; }; - CEF839B30C77742A00A3AD51 /* NSFileManager_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CEF839B10C77742A00A3AD51 /* NSFileManager_SKExtensions.m */; }; + CEF839B30C77742A00A3AD51 /* Files_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CEF839B10C77742A00A3AD51 /* Files_SKExtensions.m */; }; CEFD68740C01D4080027B933 /* SkimImporter.mdimporter in CopyFiles */ = {isa = PBXBuildFile; fileRef = CEFD68690C01D3BB0027B933 /* SkimImporter.mdimporter */; }; CEFDF8BE0B3848C40091C61A /* SKNavigationWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = CEFDF8BD0B3848C40091C61A /* SKNavigationWindow.m */; }; F92DB5AC0B36FE1F002A26E9 /* BDSKHeaderPopUpButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F92DB5A90B36FE1F002A26E9 /* BDSKHeaderPopUpButtonCell.m */; }; @@ -576,8 +576,8 @@ CEF717570B90DEEF003A2771 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/ReleaseNotes.nib; sourceTree = "<group>"; }; CEF7175D0B90DF10003A2771 /* SKReleaseNotesController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SKReleaseNotesController.h; sourceTree = "<group>"; }; CEF7175E0B90DF10003A2771 /* SKReleaseNotesController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SKReleaseNotesController.m; sourceTree = "<group>"; }; - CEF839B00C77742A00A3AD51 /* NSFileManager_SKExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSFileManager_SKExtensions.h; sourceTree = "<group>"; }; - CEF839B10C77742A00A3AD51 /* NSFileManager_SKExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSFileManager_SKExtensions.m; sourceTree = "<group>"; }; + CEF839B00C77742A00A3AD51 /* Files_SKExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Files_SKExtensions.h; sourceTree = "<group>"; }; + CEF839B10C77742A00A3AD51 /* Files_SKExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Files_SKExtensions.m; sourceTree = "<group>"; }; CEFD68610C01D3BB0027B933 /* SkimImporter.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SkimImporter.xcodeproj; path = SkimImporter/SkimImporter.xcodeproj; sourceTree = "<group>"; }; CEFDF8BC0B3848C40091C61A /* SKNavigationWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKNavigationWindow.h; sourceTree = "<group>"; }; CEFDF8BD0B3848C40091C61A /* SKNavigationWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKNavigationWindow.m; sourceTree = "<group>"; }; @@ -781,8 +781,8 @@ CE2DE4ED0B85DB6300D0DA12 /* NSCursor_SKExtensions.m */, CE5487BA0B35A20A00F8AFB6 /* NSFileManager_ExtendedAttributes.h */, CE5487BB0B35A20A00F8AFB6 /* NSFileManager_ExtendedAttributes.m */, - CEF839B00C77742A00A3AD51 /* NSFileManager_SKExtensions.h */, - CEF839B10C77742A00A3AD51 /* NSFileManager_SKExtensions.m */, + CEF839B00C77742A00A3AD51 /* Files_SKExtensions.h */, + CEF839B10C77742A00A3AD51 /* Files_SKExtensions.m */, CECDC4FC0C5966A80026AAEC /* NSImage_SKExtensions.h */, CECDC4FD0C5966A80026AAEC /* NSImage_SKExtensions.m */, CE6C03EE0BEDF759007BF0B5 /* NSParagraphStyle_SKExtensions.h */, @@ -1455,7 +1455,7 @@ CEAA559E0C6DE235006BD633 /* SKDownload.m in Sources */, CEAA55B70C6DE452006BD633 /* SKProgressCell.m in Sources */, CEAA67260C70A882006BD633 /* NSURL_SKExtensions.m in Sources */, - CEF839B30C77742A00A3AD51 /* NSFileManager_SKExtensions.m in Sources */, + CEF839B30C77742A00A3AD51 /* Files_SKExtensions.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-08-18 18:50:03
|
Revision: 2682 http://skim-app.svn.sourceforge.net/skim-app/?rev=2682&view=rev Author: hofman Date: 2007-08-18 11:50:01 -0700 (Sat, 18 Aug 2007) Log Message: ----------- Open bookmark by double-clicking on a row. Modified Paths: -------------- trunk/Dutch.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/English.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/French.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/Italian.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/SKApplicationController.m trunk/SKBookmarkController.h trunk/SKBookmarkController.m trunk/Skim.xcodeproj/project.pbxproj Added Paths: ----------- trunk/NSFileManager_SKExtensions.h trunk/NSFileManager_SKExtensions.m Modified: trunk/Dutch.lproj/BookmarksWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/BookmarksWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/French.lproj/BookmarksWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/BookmarksWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Added: trunk/NSFileManager_SKExtensions.h =================================================================== --- trunk/NSFileManager_SKExtensions.h (rev 0) +++ trunk/NSFileManager_SKExtensions.h 2007-08-18 18:50:01 UTC (rev 2682) @@ -0,0 +1,44 @@ +// +// NSFileManager_SKExtensions.h +// Skim +// +// Created by Christiaan Hofman on 8/18/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> + + +@interface NSFileManager (SKExtensions) +- (BOOL)fileIsInTrash:(NSURL *)fileURL; +@end Added: trunk/NSFileManager_SKExtensions.m =================================================================== --- trunk/NSFileManager_SKExtensions.m (rev 0) +++ trunk/NSFileManager_SKExtensions.m 2007-08-18 18:50:01 UTC (rev 2682) @@ -0,0 +1,63 @@ +// +// NSFileManager_SKExtensions.m +// Skim +// +// Created by Christiaan Hofman on 8/18/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 "NSFileManager_SKExtensions.h" +#import <Carbon/Carbon.h> + +@implementation NSFileManager (SKExtensions) + +- (BOOL)fileIsInTrash:(NSURL *)fileURL { + NSCParameterAssert([fileURL isFileURL]); + FSRef parentRef; + CFURLRef parentURL = CFURLCreateCopyDeletingLastPathComponent(CFGetAllocator((CFURLRef)fileURL), (CFURLRef)fileURL); + [(id)parentURL autorelease]; + if (CFURLGetFSRef(parentURL, &parentRef)) { + OSStatus err; + FSRef fsRef; + err = FSFindFolder(kUserDomain, kTrashFolderType, TRUE, &fsRef); + if (noErr == err && noErr == FSCompareFSRefs(&fsRef, &parentRef)) + return YES; + + err = FSFindFolder(kOnAppropriateDisk, kSystemTrashFolderType, TRUE, &fsRef); + if (noErr == err && noErr == FSCompareFSRefs(&fsRef, &parentRef)) + return YES; + } + return NO; +} + +@end Modified: trunk/SKApplicationController.m =================================================================== --- trunk/SKApplicationController.m 2007-08-18 17:05:16 UTC (rev 2681) +++ trunk/SKApplicationController.m 2007-08-18 18:50:01 UTC (rev 2682) @@ -55,6 +55,7 @@ #import "SKDownloadController.h" #import "NSURL_SKExtensions.h" #import "SKDocumentController.h" +#import "NSFileManager_SKExtensions.h" @implementation SKApplicationController @@ -88,26 +89,6 @@ [[NSUserDefaultsController sharedUserDefaultsController] setInitialValues:initialValuesDict]; } -static BOOL fileIsInTrash(NSURL *fileURL) -{ - NSCParameterAssert([fileURL isFileURL]); - FSRef parentRef; - CFURLRef parentURL = CFURLCreateCopyDeletingLastPathComponent(CFGetAllocator((CFURLRef)fileURL), (CFURLRef)fileURL); - [(id)parentURL autorelease]; - if (CFURLGetFSRef(parentURL, &parentRef)) { - OSStatus err; - FSRef fsRef; - err = FSFindFolder(kUserDomain, kTrashFolderType, TRUE, &fsRef); - if (noErr == err && noErr == FSCompareFSRefs(&fsRef, &parentRef)) - return YES; - - err = FSFindFolder(kOnAppropriateDisk, kSystemTrashFolderType, TRUE, &fsRef); - if (noErr == err && noErr == FSCompareFSRefs(&fsRef, &parentRef)) - return YES; - } - return NO; -} - - (void)awakeFromNib { NSMenu *viewMenu = [[[NSApp mainMenu] itemAtIndex:4] submenu]; int i, count = [viewMenu numberOfItems]; @@ -137,7 +118,7 @@ fileURL = [[BDAlias aliasWithData:[dict objectForKey:@"_BDAlias"]] fileURL]; if(fileURL == nil && [dict objectForKey:@"fileName"]) fileURL = [NSURL fileURLWithPath:[dict objectForKey:@"fileName"]]; - if(fileURL && NO == fileIsInTrash(fileURL)) { + if(fileURL && NO == [[NSFileManager defaultManager] fileIsInTrash:fileURL]) { if (document = [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:fileURL display:NO error:&error]) { [document makeWindowControllers]; if ([document respondsToSelector:@selector(mainWindowController)]) @@ -234,19 +215,8 @@ int i = [sender tag]; NSArray *bookmarks = [[SKBookmarkController sharedBookmarkController] bookmarks]; NSDictionary *bm = [bookmarks objectAtIndex:i]; - id document = nil; - NSURL *fileURL = [[BDAlias aliasWithData:[bm objectForKey:@"_BDAlias"]] fileURL]; - NSError *error; - if (fileURL == nil && [bm objectForKey:@"path"]) - fileURL = [NSURL fileURLWithPath:[bm objectForKey:@"path"]]; - if (fileURL && NO == fileIsInTrash(fileURL)) { - if (document = [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:fileURL display:YES error:&error]) { - [[document mainWindowController] setPageNumber:[[bm objectForKey:@"pageIndex"] unsignedIntValue] + 1]; - } else { - [NSApp presentError:error]; - } - } + [[SKBookmarkController sharedBookmarkController] openBookmarks:[NSArray arrayWithObjects:bm, nil]]; } #pragma mark Support Modified: trunk/SKBookmarkController.h =================================================================== --- trunk/SKBookmarkController.h 2007-08-18 17:05:16 UTC (rev 2681) +++ trunk/SKBookmarkController.h 2007-08-18 18:50:01 UTC (rev 2682) @@ -52,9 +52,11 @@ - (id)objectInBookmarksAtIndex:(unsigned)index; - (void)insertObject:(id)obj inBookmarksAtIndex:(unsigned)index; - (void)removeObjectFromBookmarksAtIndex:(unsigned)index; + - (void)addBookmarkForPath:(NSString *)path pageIndex:(unsigned)pageIndex label:(NSString *)label; - (void)saveBookmarks; - (NSString *)bookmarksFilePath; +- (void)openBookmarks:(NSArray *)items; - (NSArray *)recentDocuments; - (void)addRecentDocumentForPath:(NSString *)path pageIndex:(unsigned)pageIndex snapshots:(NSArray *)setups; Modified: trunk/SKBookmarkController.m =================================================================== --- trunk/SKBookmarkController.m 2007-08-18 17:05:16 UTC (rev 2681) +++ trunk/SKBookmarkController.m 2007-08-18 18:50:01 UTC (rev 2682) @@ -38,6 +38,9 @@ #import "SKBookmarkController.h" #import "BDAlias.h" +#import "SKDocument.h" +#import "SKMainWindowController.h" +#import "NSFileManager_SKExtensions.h" @implementation SKBookmarkController @@ -226,6 +229,27 @@ [self saveBookmarks]; } +- (void)openBookmarks:(NSArray *)items { + NSEnumerator *bmEnum = [items objectEnumerator]; + NSDictionary *bm; + + while (bm = [bmEnum nextObject]) { + id document = nil; + NSURL *fileURL = [[BDAlias aliasWithData:[bm objectForKey:@"_BDAlias"]] fileURL]; + NSError *error; + + if (fileURL == nil && [bm objectForKey:@"path"]) + fileURL = [NSURL fileURLWithPath:[bm objectForKey:@"path"]]; + if (fileURL && NO == [[NSFileManager defaultManager] fileIsInTrash:fileURL]) { + if (document = [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:fileURL display:YES error:&error]) { + [[document mainWindowController] setPageNumber:[[bm objectForKey:@"pageIndex"] unsignedIntValue] + 1]; + } else { + [NSApp presentError:error]; + } + } + } +} + @end Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-08-18 17:05:16 UTC (rev 2681) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-08-18 18:50:01 UTC (rev 2682) @@ -176,6 +176,7 @@ CEF711A10B90B714003A2771 /* NSUserDefaultsController_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CEF711A00B90B714003A2771 /* NSUserDefaultsController_SKExtensions.m */; }; CEF7175C0B90DEEF003A2771 /* ReleaseNotes.nib in Resources */ = {isa = PBXBuildFile; fileRef = CEF717560B90DEEF003A2771 /* ReleaseNotes.nib */; }; CEF7175F0B90DF10003A2771 /* SKReleaseNotesController.m in Sources */ = {isa = PBXBuildFile; fileRef = CEF7175E0B90DF10003A2771 /* SKReleaseNotesController.m */; }; + CEF839B30C77742A00A3AD51 /* NSFileManager_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CEF839B10C77742A00A3AD51 /* NSFileManager_SKExtensions.m */; }; CEFD68740C01D4080027B933 /* SkimImporter.mdimporter in CopyFiles */ = {isa = PBXBuildFile; fileRef = CEFD68690C01D3BB0027B933 /* SkimImporter.mdimporter */; }; CEFDF8BE0B3848C40091C61A /* SKNavigationWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = CEFDF8BD0B3848C40091C61A /* SKNavigationWindow.m */; }; F92DB5AC0B36FE1F002A26E9 /* BDSKHeaderPopUpButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F92DB5A90B36FE1F002A26E9 /* BDSKHeaderPopUpButtonCell.m */; }; @@ -575,6 +576,8 @@ CEF717570B90DEEF003A2771 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/ReleaseNotes.nib; sourceTree = "<group>"; }; CEF7175D0B90DF10003A2771 /* SKReleaseNotesController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SKReleaseNotesController.h; sourceTree = "<group>"; }; CEF7175E0B90DF10003A2771 /* SKReleaseNotesController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SKReleaseNotesController.m; sourceTree = "<group>"; }; + CEF839B00C77742A00A3AD51 /* NSFileManager_SKExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSFileManager_SKExtensions.h; sourceTree = "<group>"; }; + CEF839B10C77742A00A3AD51 /* NSFileManager_SKExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSFileManager_SKExtensions.m; sourceTree = "<group>"; }; CEFD68610C01D3BB0027B933 /* SkimImporter.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SkimImporter.xcodeproj; path = SkimImporter/SkimImporter.xcodeproj; sourceTree = "<group>"; }; CEFDF8BC0B3848C40091C61A /* SKNavigationWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKNavigationWindow.h; sourceTree = "<group>"; }; CEFDF8BD0B3848C40091C61A /* SKNavigationWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKNavigationWindow.m; sourceTree = "<group>"; }; @@ -778,6 +781,8 @@ CE2DE4ED0B85DB6300D0DA12 /* NSCursor_SKExtensions.m */, CE5487BA0B35A20A00F8AFB6 /* NSFileManager_ExtendedAttributes.h */, CE5487BB0B35A20A00F8AFB6 /* NSFileManager_ExtendedAttributes.m */, + CEF839B00C77742A00A3AD51 /* NSFileManager_SKExtensions.h */, + CEF839B10C77742A00A3AD51 /* NSFileManager_SKExtensions.m */, CECDC4FC0C5966A80026AAEC /* NSImage_SKExtensions.h */, CECDC4FD0C5966A80026AAEC /* NSImage_SKExtensions.m */, CE6C03EE0BEDF759007BF0B5 /* NSParagraphStyle_SKExtensions.h */, @@ -1450,6 +1455,7 @@ CEAA559E0C6DE235006BD633 /* SKDownload.m in Sources */, CEAA55B70C6DE452006BD633 /* SKProgressCell.m in Sources */, CEAA67260C70A882006BD633 /* NSURL_SKExtensions.m in Sources */, + CEF839B30C77742A00A3AD51 /* NSFileManager_SKExtensions.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |