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-09-04 20:50:55
|
Revision: 2831 http://skim-app.svn.sourceforge.net/skim-app/?rev=2831&view=rev Author: hofman Date: 2007-09-04 13:50:18 -0700 (Tue, 04 Sep 2007) Log Message: ----------- Use simple change notifications rather than indexed one, as we replace all items. Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-09-04 18:43:49 UTC (rev 2830) +++ trunk/SKMainWindowController.m 2007-09-04 20:50:18 UTC (rev 2831) @@ -3760,7 +3760,7 @@ - (void)resetThumbnails { unsigned i, count = [pageLabels count]; - [self willChange:NSKeyValueChangeReplacement valuesAtIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, count)] forKey:@"thumbnails"]; + [self willChangeValueForKey:@"thumbnails"]; [thumbnails removeAllObjects]; if (count) { PDFPage *emptyPage = [[[PDFPage alloc] init] autorelease]; @@ -3782,7 +3782,7 @@ [thumbnail release]; } } - [self didChange:NSKeyValueChangeReplacement valuesAtIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, count)] forKey:@"thumbnails"]; + [self didChangeValueForKey:@"thumbnails"]; [self allThumbnailsNeedUpdate]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-04 18:43:50
|
Revision: 2830 http://skim-app.svn.sourceforge.net/skim-app/?rev=2830&view=rev Author: hofman Date: 2007-09-04 11:43:49 -0700 (Tue, 04 Sep 2007) Log Message: ----------- Reload notes table when page labels have changed. Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-09-04 18:24:30 UTC (rev 2829) +++ trunk/SKMainWindowController.m 2007-09-04 18:43:49 UTC (rev 2830) @@ -769,6 +769,7 @@ // these carry a label, moreover when this is called the thumbnails will also be invalid [self resetThumbnails]; [self allSnapshotsNeedUpdate]; + [noteOutlineView reloadData]; // update the outline [pdfOutline release]; @@ -843,12 +844,9 @@ [self registerForDocumentNotifications]; - [noteOutlineView reloadData]; - + [self updatePageLabelsAndOutline]; [self updateNoteSelection]; - [self updatePageLabelsAndOutline]; - NSEnumerator *setupEnum = [snapshotDicts objectEnumerator]; NSDictionary *setup; while (setup = [setupEnum nextObject]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-04 18:24:33
|
Revision: 2829 http://skim-app.svn.sourceforge.net/skim-app/?rev=2829&view=rev Author: hofman Date: 2007-09-04 11:24:30 -0700 (Tue, 04 Sep 2007) Log Message: ----------- Separate method to update page labels, page column widths, and the outline. This is also called when a document is unlocked, as not enough was updated in that case. Make sure the page labels are not nil to avoid a crash when loading an encrypted document. Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-09-04 17:16:38 UTC (rev 2828) +++ trunk/SKMainWindowController.m 2007-09-04 18:24:30 UTC (rev 2829) @@ -135,6 +135,8 @@ - (void)setupToolbar; +- (void)updatePageLabelsAndOutline; + - (void)showLeftSideWindowOnScreen:(NSScreen *)screen; - (void)showRightSideWindowOnScreen:(NSScreen *)screen; - (void)hideLeftSideWindow; @@ -282,6 +284,7 @@ [pdfView setFrame:[[pdfContentBox contentView] bounds]]; + [outlineView setAutoresizesOutlineColumn: NO]; [self displayOutlineView]; [self displayNoteView]; @@ -726,6 +729,61 @@ [statusBar setRightStringValue:message]; } +- (void)updatePageLabelsAndOutline { + PDFDocument *pdfDoc = [pdfView document]; + NSTableColumn *tableColumn = [[thumbnailTableView tableColumns] objectAtIndex:1]; + id cell = [tableColumn dataCell]; + float labelWidth = 0.0; + int i, count = [pdfDoc pageCount]; + + // update page labels, also update the size of the table columns displaying the labels + [self willChangeValueForKey:@"pageLabel"]; + [self willChangeValueForKey:@"pageLabels"]; + [pageLabels removeAllObjects]; + for (i = 0; i < count; i++) { + NSString *label = [[pdfDoc pageAtIndex:i] label]; + if (label == nil) + label = [NSString stringWithFormat:@"%i", i+1]; + [pageLabels addObject:label]; + [cell setStringValue:label]; + labelWidth = fmaxf(labelWidth, [cell cellSize].width); + } + [self didChangeValueForKey:@"pageLabels"]; + [self didChangeValueForKey:@"pageLabel"]; + + [tableColumn setMinWidth:labelWidth]; + [tableColumn setMaxWidth:labelWidth]; + [thumbnailTableView sizeToFit]; + tableColumn = [[outlineView tableColumns] objectAtIndex:1]; + [tableColumn setMinWidth:labelWidth]; + [tableColumn setMaxWidth:labelWidth]; + [outlineView sizeToFit]; + tableColumn = [[snapshotTableView tableColumns] objectAtIndex:1]; + [tableColumn setMinWidth:labelWidth]; + [tableColumn setMaxWidth:labelWidth]; + [snapshotTableView sizeToFit]; + + // this uses the pageLabels + [[thumbnailTableView typeSelectHelper] rebuildTypeSelectSearchCache]; + + // these carry a label, moreover when this is called the thumbnails will also be invalid + [self resetThumbnails]; + [self allSnapshotsNeedUpdate]; + + // update the outline + [pdfOutline release]; + pdfOutline = [[pdfDoc outlineRoot] retain]; + [pdfOutlineItems removeAllObjects]; + if (pdfOutline) { + [outlineView reloadData]; + + if ([outlineView numberOfRows] == 1) + [outlineView expandItem: [outlineView itemAtRow: 0] expandChildren: NO]; + [self updateOutlineSelection]; + } + [leftSideButton setEnabled:pdfOutline != nil forSegment:SKOutlineSidePaneState]; +} + #pragma mark Accessors - (void)setDocument:(NSDocument *)document { @@ -785,56 +843,12 @@ [self registerForDocumentNotifications]; - [pdfOutline release]; - pdfOutline = [[[pdfView document] outlineRoot] retain]; - [pdfOutlineItems removeAllObjects]; - if (pdfOutline && [[pdfView document] isLocked] == NO) { - [outlineView reloadData]; - [outlineView setAutoresizesOutlineColumn: NO]; - - if ([outlineView numberOfRows] == 1) - [outlineView expandItem: [outlineView itemAtRow: 0] expandChildren: NO]; - [self updateOutlineSelection]; - } - - [leftSideButton setEnabled:pdfOutline != nil forSegment:SKOutlineSidePaneState]; - [noteOutlineView reloadData]; [self updateNoteSelection]; - [self resetThumbnails]; - [self updateThumbnailSelection]; + [self updatePageLabelsAndOutline]; - NSTableColumn *tableColumn = [[thumbnailTableView tableColumns] objectAtIndex:1]; - id cell = [tableColumn dataCell]; - float labelWidth = 0.0; - int i, count = [document pageCount]; - - [self willChangeValueForKey:@"pageLabels"]; - [pageLabels removeAllObjects]; - for (i = 0; i < count; i++) { - NSString *label = [[document pageAtIndex:i] label]; - [pageLabels addObject:label ? label : @""]; - [cell setStringValue:label]; - labelWidth = fmaxf(labelWidth, [cell cellSize].width); - } - [self didChangeValueForKey:@"pageLabels"]; - - [tableColumn setMinWidth:labelWidth]; - [tableColumn setMaxWidth:labelWidth]; - [thumbnailTableView sizeToFit]; - tableColumn = [[outlineView tableColumns] objectAtIndex:1]; - [tableColumn setMinWidth:labelWidth]; - [tableColumn setMaxWidth:labelWidth]; - [outlineView sizeToFit]; - tableColumn = [[snapshotTableView tableColumns] objectAtIndex:1]; - [tableColumn setMinWidth:labelWidth]; - [tableColumn setMaxWidth:labelWidth]; - [snapshotTableView sizeToFit]; - - [[thumbnailTableView typeSelectHelper] rebuildTypeSelectSearchCache]; - NSEnumerator *setupEnum = [snapshotDicts objectEnumerator]; NSDictionary *setup; while (setup = [setupEnum nextObject]) @@ -2949,35 +2963,7 @@ } - (void)documentDidUnlock:(NSNotification *)notification { - PDFDocument *pdfDoc = [self pdfDocument]; - - [self willChangeValueForKey:@"pageLabel"]; - [self willChangeValueForKey:@"pageLabels"]; - [pageLabels removeAllObjects]; - int i, count = [pdfDoc pageCount]; - for (i = 0; i < count; i++) { - NSString *label = [[pdfDoc pageAtIndex:i] label]; - [pageLabels addObject:label ? label : @""]; - } - [self didChangeValueForKey:@"pageLabels"]; - [self didChangeValueForKey:@"pageLabel"]; - - [self resetThumbnails]; - [self allSnapshotsNeedUpdate]; - - if (pdfOutline == nil) { - pdfOutline = [[pdfDoc outlineRoot] retain]; - [pdfOutlineItems removeAllObjects]; - } - if (pdfOutline) { - [outlineView reloadData]; - [outlineView setAutoresizesOutlineColumn: NO]; - - if ([outlineView numberOfRows] == 1) - [outlineView expandItem: [outlineView itemAtRow: 0] expandChildren: NO]; - [self updateOutlineSelection]; - } - [leftSideButton setEnabled:pdfOutline != nil forSegment:SKOutlineSidePaneState]; + [self updatePageLabelsAndOutline]; } - (void)handleColorSwatchColorsChangedNotification:(NSNotification *)notification { @@ -3775,9 +3761,7 @@ } - (void)resetThumbnails { - - PDFDocument *pdfDoc = [pdfView document]; - unsigned i, count = [pdfDoc pageCount]; + unsigned i, count = [pageLabels count]; [self willChange:NSKeyValueChangeReplacement valuesAtIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, count)] forKey:@"thumbnails"]; [thumbnails removeAllObjects]; if (count) { @@ -3794,7 +3778,7 @@ [image unlockFocus]; for (i = 0; i < count; i++) { - SKThumbnail *thumbnail = [[SKThumbnail alloc] initWithImage:image label:[[pdfDoc pageAtIndex:i] label]]; + SKThumbnail *thumbnail = [[SKThumbnail alloc] initWithImage:image label:[pageLabels objectAtIndex:i]]; [thumbnail setDirty:YES]; [thumbnails addObject:thumbnail]; [thumbnail release]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-04 17:16:41
|
Revision: 2828 http://skim-app.svn.sourceforge.net/skim-app/?rev=2828&view=rev Author: hofman Date: 2007-09-04 10:16:38 -0700 (Tue, 04 Sep 2007) Log Message: ----------- Draw history highlights using transparent color. Make sure the whole table is updated when selection changes, to make sure history highlighting is updated. Modified Paths: -------------- trunk/SKThumbnailTableView.m trunk/SKTocOutlineView.m Modified: trunk/SKThumbnailTableView.m =================================================================== --- trunk/SKThumbnailTableView.m 2007-09-04 17:06:05 UTC (rev 2827) +++ trunk/SKThumbnailTableView.m 2007-09-04 17:16:38 UTC (rev 2828) @@ -99,8 +99,8 @@ row = [[rows objectAtIndex:i] intValue]; rect = [self rectOfRow:row]; if (NSIntersectsRect(rect, clipRect) && [rowIndexes containsIndex:row] == NO) { - [[[self backgroundColor] blendedColorWithFraction:0.5 - 0.1 * i ofColor:color] setFill]; - NSRectFill(rect); + [[color colorWithAlphaComponent:0.5 - 0.1 * i] setFill]; + [NSBezierPath fillRect:rect]; } [rowIndexes addIndex:row]; } @@ -118,6 +118,16 @@ [NSGraphicsContext restoreGraphicsState]; } +- (void)selectRowIndexes:(NSIndexSet *)indexes byExtendingSelection:(BOOL)extend { + [super selectRowIndexes:indexes byExtendingSelection:extend]; + [self setNeedsDisplay:YES]; +} + +- (void)deselectRow:(int)row { + [super deselectRow:row]; + [self setNeedsDisplay:YES]; +} + - (BOOL)isScrolling { return isScrolling; } - (void)handleScrollerWillScroll:(NSNotification *)note { Modified: trunk/SKTocOutlineView.m =================================================================== --- trunk/SKTocOutlineView.m 2007-09-04 17:06:05 UTC (rev 2827) +++ trunk/SKTocOutlineView.m 2007-09-04 17:16:38 UTC (rev 2828) @@ -76,8 +76,8 @@ row = [[rows objectAtIndex:i] intValue]; rect = [self rectOfRow:row]; if (NSIntersectsRect(rect, clipRect) && [rowIndexes containsIndex:row] == NO) { - [[[self backgroundColor] blendedColorWithFraction:0.5 - 0.1 * i ofColor:color] setFill]; - NSRectFill(rect); + [[color colorWithAlphaComponent:0.5 - 0.1 * i] setFill]; + [NSBezierPath fillRect:rect]; } [rowIndexes addIndex:row]; } @@ -88,13 +88,23 @@ rect = [self rectOfRow:row]; if (NSIntersectsRect(rect, clipRect)) { [color setFill]; - NSRectFill([self rectOfRow:row]); + [NSBezierPath fillRect:rect]; } } [NSGraphicsContext restoreGraphicsState]; } +- (void)selectRowIndexes:(NSIndexSet *)indexes byExtendingSelection:(BOOL)extend { + [super selectRowIndexes:indexes byExtendingSelection:extend]; + [self setNeedsDisplay:YES]; +} + +- (void)deselectRow:(int)row { + [super deselectRow:row]; + [self setNeedsDisplay:YES]; +} + - (void)removeTrackingRects { if (trackingRects) { CFIndex idx = CFArrayGetCount(trackingRects); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-04 17:06:06
|
Revision: 2827 http://skim-app.svn.sourceforge.net/skim-app/?rev=2827&view=rev Author: hofman Date: 2007-09-04 10:06:05 -0700 (Tue, 04 Sep 2007) Log Message: ----------- Check whether rect to highlight is visible before drawing. Modified Paths: -------------- trunk/SKThumbnailTableView.m trunk/SKTocOutlineView.m Modified: trunk/SKThumbnailTableView.m =================================================================== --- trunk/SKThumbnailTableView.m 2007-09-04 16:56:47 UTC (rev 2826) +++ trunk/SKThumbnailTableView.m 2007-09-04 17:06:05 UTC (rev 2827) @@ -85,6 +85,7 @@ - (void)highlightSelectionInClipRect:(NSRect)clipRect { NSColor *color = [self highlightColor]; int row; + NSRect rect; [NSGraphicsContext saveGraphicsState]; @@ -92,24 +93,26 @@ NSMutableIndexSet *rowIndexes = [[[self selectedRowIndexes] mutableCopy] autorelease]; NSArray *rows = [[self delegate] tableViewHighlightedRows:self]; - float factor = 0.5; - int i, count = [rows count]; + int i, count = MIN((int)[rows count], 5); - for (i = 0; i < count && factor > 0.0; i++) { + for (i = 0; i < count; i++) { row = [[rows objectAtIndex:i] intValue]; - [[[self backgroundColor] blendedColorWithFraction:factor ofColor:color] setFill]; - factor -= 0.1; - if ([rowIndexes containsIndex:row] == NO) { - NSRectFill([self rectOfRow:row]); - [rowIndexes addIndex:row]; + rect = [self rectOfRow:row]; + if (NSIntersectsRect(rect, clipRect) && [rowIndexes containsIndex:row] == NO) { + [[[self backgroundColor] blendedColorWithFraction:0.5 - 0.1 * i ofColor:color] setFill]; + NSRectFill(rect); } + [rowIndexes addIndex:row]; } } row = [self selectedRow]; if (row != -1) { - [color setFill]; - NSRectFill([self rectOfRow:row]); + rect = [self rectOfRow:row]; + if (NSIntersectsRect(rect, clipRect)) { + [color setFill]; + NSRectFill([self rectOfRow:row]); + } } [NSGraphicsContext restoreGraphicsState]; Modified: trunk/SKTocOutlineView.m =================================================================== --- trunk/SKTocOutlineView.m 2007-09-04 16:56:47 UTC (rev 2826) +++ trunk/SKTocOutlineView.m 2007-09-04 17:06:05 UTC (rev 2827) @@ -63,31 +63,33 @@ - (void)highlightSelectionInClipRect:(NSRect)clipRect { NSColor *color = [self highlightColor]; int row; + NSRect rect; [NSGraphicsContext saveGraphicsState]; if ([[self delegate] respondsToSelector:@selector(outlineViewHighlightedRows:)]) { NSMutableIndexSet *rowIndexes = [[[self selectedRowIndexes] mutableCopy] autorelease]; NSArray *rows = [[self delegate] outlineViewHighlightedRows:self]; - float factor = 0.5; - int i, count = [rows count]; + int i, count = MIN((int)[rows count], 5); for (i = 0; i < count; i++) { row = [[rows objectAtIndex:i] intValue]; - [[[self backgroundColor] blendedColorWithFraction:factor ofColor:color] set]; - factor -= 0.1; - if ([rowIndexes containsIndex:row] == NO) { - NSRectFill([self rectOfRow:row]); - [rowIndexes addIndex:row]; + rect = [self rectOfRow:row]; + if (NSIntersectsRect(rect, clipRect) && [rowIndexes containsIndex:row] == NO) { + [[[self backgroundColor] blendedColorWithFraction:0.5 - 0.1 * i ofColor:color] setFill]; + NSRectFill(rect); } - if (factor <= 0.0) break; + [rowIndexes addIndex:row]; } } row = [self selectedRow]; if (row != -1) { - [color setFill]; - NSRectFill([self rectOfRow:row]); + rect = [self rectOfRow:row]; + if (NSIntersectsRect(rect, clipRect)) { + [color setFill]; + NSRectFill([self rectOfRow:row]); + } } [NSGraphicsContext restoreGraphicsState]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-04 16:56:50
|
Revision: 2826 http://skim-app.svn.sourceforge.net/skim-app/?rev=2826&view=rev Author: hofman Date: 2007-09-04 09:56:47 -0700 (Tue, 04 Sep 2007) Log Message: ----------- Add a convenience method to get the index of a page. Don't allow empty selection in outline. Modified Paths: -------------- trunk/Dutch.lproj/MainWindow.nib/info.nib trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib trunk/English.lproj/MainWindow.nib/info.nib trunk/English.lproj/MainWindow.nib/keyedobjects.nib trunk/French.lproj/MainWindow.nib/info.nib trunk/French.lproj/MainWindow.nib/keyedobjects.nib trunk/Italian.lproj/MainWindow.nib/info.nib trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib trunk/PDFPage_SKExtensions.h trunk/PDFPage_SKExtensions.m trunk/PDFSelection_SKExtensions.m trunk/SKDocument.m trunk/SKMainWindowController.m trunk/SKPDFAnnotationNote.m trunk/SKPDFView.m trunk/SKReadingBar.m trunk/SKSnapshotWindowController.m Modified: trunk/Dutch.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-09-04 15:32:08 UTC (rev 2825) +++ trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-09-04 16:56:47 UTC (rev 2826) @@ -31,9 +31,9 @@ </array> <key>IBOpenObjects</key> <array> - <integer>502</integer> <integer>224</integer> <integer>256</integer> + <integer>502</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/English.lproj/MainWindow.nib/info.nib 2007-09-04 15:32:08 UTC (rev 2825) +++ trunk/English.lproj/MainWindow.nib/info.nib 2007-09-04 16:56:47 UTC (rev 2826) @@ -31,20 +31,20 @@ </array> <key>IBOpenObjects</key> <array> - <integer>633</integer> - <integer>502</integer> - <integer>314</integer> - <integer>224</integer> + <integer>553</integer> <integer>5</integer> - <integer>553</integer> <integer>694</integer> + <integer>208</integer> + <integer>314</integer> + <integer>502</integer> + <integer>633</integer> + <integer>687</integer> <integer>511</integer> - <integer>687</integer> - <integer>208</integer> + <integer>256</integer> + <integer>539</integer> <integer>585</integer> + <integer>224</integer> <integer>168</integer> - <integer>539</integer> - <integer>256</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/English.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/French.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/French.lproj/MainWindow.nib/info.nib 2007-09-04 15:32:08 UTC (rev 2825) +++ trunk/French.lproj/MainWindow.nib/info.nib 2007-09-04 16:56:47 UTC (rev 2826) @@ -32,9 +32,9 @@ <key>IBOpenObjects</key> <array> <integer>314</integer> - <integer>256</integer> <integer>502</integer> <integer>224</integer> + <integer>256</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/French.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Italian.lproj/MainWindow.nib/info.nib 2007-09-04 15:32:08 UTC (rev 2825) +++ trunk/Italian.lproj/MainWindow.nib/info.nib 2007-09-04 16:56:47 UTC (rev 2826) @@ -31,19 +31,19 @@ </array> <key>IBOpenObjects</key> <array> + <integer>676</integer> <integer>256</integer> - <integer>539</integer> - <integer>511</integer> + <integer>5</integer> <integer>208</integer> <integer>224</integer> - <integer>676</integer> <integer>677</integer> - <integer>5</integer> + <integer>168</integer> <integer>314</integer> + <integer>539</integer> + <integer>628</integer> + <integer>511</integer> <integer>502</integer> <integer>553</integer> - <integer>628</integer> - <integer>168</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/PDFPage_SKExtensions.h =================================================================== --- trunk/PDFPage_SKExtensions.h 2007-09-04 15:32:08 UTC (rev 2825) +++ trunk/PDFPage_SKExtensions.h 2007-09-04 16:56:47 UTC (rev 2826) @@ -55,6 +55,8 @@ - (NSArray *)lineBounds; +- (unsigned int)pageIndex; + - (NSScriptObjectSpecifier *)objectSpecifier; - (SKDocument *)containingDocument; - (unsigned int)index; Modified: trunk/PDFPage_SKExtensions.m =================================================================== --- trunk/PDFPage_SKExtensions.m 2007-09-04 15:32:08 UTC (rev 2825) +++ trunk/PDFPage_SKExtensions.m 2007-09-04 16:56:47 UTC (rev 2826) @@ -267,11 +267,15 @@ return fullLines; } +- (unsigned int)pageIndex { + return [[self document] indexForPage:self]; +} + #pragma mark Scripting support - (NSScriptObjectSpecifier *)objectSpecifier { SKDocument *document = [self containingDocument]; - unsigned index = [[self document] indexForPage:self]; + unsigned index = [self pageIndex]; if (document && index != NSNotFound) { NSScriptObjectSpecifier *containerRef = [document objectSpecifier]; @@ -294,7 +298,7 @@ } - (unsigned int)index { - return [[self document] indexForPage:self] + 1; + return [self pageIndex] + 1; } - (int)rotationAngle { Modified: trunk/PDFSelection_SKExtensions.m =================================================================== --- trunk/PDFSelection_SKExtensions.m 2007-09-04 15:32:08 UTC (rev 2825) +++ trunk/PDFSelection_SKExtensions.m 2007-09-04 16:56:47 UTC (rev 2826) @@ -459,7 +459,7 @@ if ([dPO isKindOfClass:[SKDocument class]]) { index = [[NSApp orderedDocuments] indexOfObjectIdenticalTo:dPO]; } else if ([dPO isKindOfClass:[PDFPage class]]) { - index = [[page document] indexForPage:dPO]; + index = [dPO pageIndex]; } else if ([dPO isKindOfClass:[PDFAnnotation class]]) { index = [[(page ? (id)page : (id)[page containingDocument]) valueForKey:@"notes"] indexOfObjectIdenticalTo:dPO]; } else { Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-09-04 15:32:08 UTC (rev 2825) +++ trunk/SKDocument.m 2007-09-04 16:56:47 UTC (rev 2826) @@ -1575,7 +1575,7 @@ point = NSMakePoint(NSMidX(bounds), NSMidY(bounds)); } if (page) { - unsigned int pageIndex = [[page document] indexForPage:page]; + unsigned int pageIndex = [page pageIndex]; PDFSelection *sel = [page selectionForLineAtPoint:point]; NSRect rect = sel ? [sel boundsForPage:page] : NSMakeRect(point.x - 20.0, point.y - 5.0, 40.0, 10.0); Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-09-04 15:32:08 UTC (rev 2825) +++ trunk/SKMainWindowController.m 2007-09-04 16:56:47 UTC (rev 2826) @@ -523,7 +523,7 @@ [setup setObject:NSStringFromRect([mainWindow frame]) forKey:@"windowFrame"]; [setup setObject:[NSNumber numberWithFloat:NSWidth([leftSideContentBox frame])] forKey:@"leftSidePaneWidth"]; [setup setObject:[NSNumber numberWithFloat:NSWidth([rightSideContentBox frame])] forKey:@"rightSidePaneWidth"]; - [setup setObject:[NSNumber numberWithUnsignedInt:[[pdfView document] indexForPage:[pdfView currentPage]]] forKey:@"pageIndex"]; + [setup setObject:[NSNumber numberWithUnsignedInt:[[pdfView currentPage] pageIndex]] forKey:@"pageIndex"]; if ([self isFullScreen] || [self isPresentation]) { [setup addEntriesFromDictionary:savedNormalSetup]; [setup removeObjectsForKeys:[NSArray arrayWithObjects:@"hasHorizontalScroller", @"hasVerticalScroller", @"autoHidesScrollers", nil]]; @@ -730,7 +730,7 @@ - (void)setDocument:(NSDocument *)document { if ([self document] && document == nil) { - unsigned int pageIndex = [[pdfView document] indexForPage:[pdfView currentPage]]; + unsigned int pageIndex = [[pdfView currentPage] pageIndex]; NSString *path = [[[self document] fileURL] path]; if (pageIndex != NSNotFound && path) [[SKBookmarkController sharedBookmarkController] addRecentDocumentForPath:path pageIndex:pageIndex snapshots:[snapshots valueForKey:@"currentSetup"]]; @@ -751,7 +751,7 @@ NSArray *snapshotDicts = nil; if ([pdfView document]) { - pageIndex = [[pdfView document] indexForPage:[pdfView currentPage]]; + pageIndex = [[pdfView currentPage] pageIndex]; visibleRect = [pdfView convertRect:[pdfView convertRect:[[pdfView documentView] visibleRect] fromView:[pdfView documentView]] toPage:[pdfView currentPage]]; [[pdfView document] cancelFindString]; @@ -906,7 +906,7 @@ } - (unsigned int)pageNumber { - return [[pdfView document] indexForPage:[pdfView currentPage]] + 1; + return [[pdfView currentPage] pageIndex] + 1; } - (void)setPageNumber:(unsigned int)pageNumber { @@ -1399,11 +1399,11 @@ } - (IBAction)rotateRight:(id)sender { - [self rotatePageAtIndex:[[pdfView document] indexForPage:[pdfView currentPage]] by:90]; + [self rotatePageAtIndex:[[pdfView currentPage] pageIndex] by:90]; } - (IBAction)rotateLeft:(id)sender { - [self rotatePageAtIndex:[[pdfView document] indexForPage:[pdfView currentPage]] by:-90]; + [self rotatePageAtIndex:[[pdfView currentPage] pageIndex] by:-90]; } - (IBAction)rotateAllRight:(id)sender { @@ -1455,7 +1455,7 @@ NSRect rect = NSIntegralRect([pdfView currentSelectionRect]); if (NSIsEmptyRect(rect)) rect = [[pdfView currentPage] foregroundBox]; - [self cropPageAtIndex:[[pdfView document] indexForPage:[pdfView currentPage]] toRect:rect]; + [self cropPageAtIndex:[[pdfView currentPage] pageIndex] toRect:rect]; } - (void)cropPagesToRects:(NSArray *)rects { @@ -2488,7 +2488,7 @@ - (void)findString:(NSString *)string options:(int)options{ PDFSelection *sel = [pdfView currentSelection]; - unsigned pageIndex = [[pdfView document] indexForPage:[pdfView currentPage]]; + unsigned pageIndex = [[pdfView currentPage] pageIndex]; while ([sel string] == nil && pageIndex-- > 0) { PDFPage *page = [[pdfView document] pageAtIndex:pageIndex]; sel = [page selectionForRect:[page boundsForBox:kPDFDisplayBoxCropBox]]; @@ -2661,7 +2661,7 @@ SKBookmarkController *bmController = [SKBookmarkController sharedBookmarkController]; NSString *path = [[self document] fileName]; NSString *label = [bookmarkField stringValue]; - unsigned int pageIndex = [[pdfView document] indexForPage:[pdfView currentPage]]; + unsigned int pageIndex = [[pdfView currentPage] pageIndex]; [bmController addBookmarkForPath:path pageIndex:pageIndex label:label]; } } @@ -2689,7 +2689,7 @@ } - (void)handlePageChangedNotification:(NSNotification *)notification { - [lastViewedPages insertObject:[NSNumber numberWithInt:[[pdfView document] indexForPage:[pdfView currentPage]]] atIndex:0]; + [lastViewedPages insertObject:[NSNumber numberWithInt:[[pdfView currentPage] pageIndex]] atIndex:0]; if ([lastViewedPages count] > 5) [lastViewedPages removeLastObject]; [thumbnailTableView setNeedsDisplay:YES]; @@ -2777,7 +2777,7 @@ updatingNoteSelection = NO; } if (page) { - [self updateThumbnailAtPageIndex:[[pdfView document] indexForPage:page]]; + [self updateThumbnailAtPageIndex:[page pageIndex]]; NSEnumerator *snapshotEnum = [snapshots objectEnumerator]; SKSnapshotWindowController *wc; while (wc = [snapshotEnum nextObject]) { @@ -2809,7 +2809,7 @@ [noteArrayController rearrangeObjects]; } if (page) { - [self updateThumbnailAtPageIndex:[[pdfView document] indexForPage:page]]; + [self updateThumbnailAtPageIndex:[page pageIndex]]; NSEnumerator *snapshotEnum = [snapshots objectEnumerator]; SKSnapshotWindowController *wc; while (wc = [snapshotEnum nextObject]) { @@ -2826,9 +2826,9 @@ if (oldPage || newPage) { if (oldPage) - [self updateThumbnailAtPageIndex:[[pdfView document] indexForPage:oldPage]]; + [self updateThumbnailAtPageIndex:[oldPage pageIndex]]; if (newPage) - [self updateThumbnailAtPageIndex:[[pdfView document] indexForPage:newPage]]; + [self updateThumbnailAtPageIndex:[newPage pageIndex]]; NSEnumerator *snapshotEnum = [snapshots objectEnumerator]; SKSnapshotWindowController *wc; while (wc = [snapshotEnum nextObject]) { @@ -2852,9 +2852,9 @@ PDFPage *oldPage = [userInfo objectForKey:@"oldPage"]; PDFPage *newPage = [userInfo objectForKey:@"newPage"]; if (oldPage) - [self updateThumbnailAtPageIndex:[[pdfView document] indexForPage:oldPage]]; + [self updateThumbnailAtPageIndex:[oldPage pageIndex]]; if (newPage && [newPage isEqual:oldPage] == NO) - [self updateThumbnailAtPageIndex:[[pdfView document] indexForPage:newPage]]; + [self updateThumbnailAtPageIndex:[newPage pageIndex]]; } - (void)handleAnnotationDidChangeNotification:(NSNotification *)notification { @@ -2900,7 +2900,7 @@ if (displayChanged) [pdfView layoutDocumentView]; if (page) { - unsigned int index = [[pdfView document] indexForPage:page]; + unsigned int index = [page pageIndex]; NSEnumerator *snapshotEnum = [snapshots objectEnumerator]; SKSnapshotWindowController *wc; while (wc = [snapshotEnum nextObject]) { @@ -3730,14 +3730,16 @@ // Get the destination of the given row.... PDFOutline *outlineItem = (PDFOutline *)[outlineView itemAtRow: i]; - if ([[pdfView document] indexForPage: [[outlineItem destination] page]] == pageIndex) { + if ([[[outlineItem destination] page ] pageIndex] == pageIndex) { break; - } else if ([[pdfView document] indexForPage: [[outlineItem destination] page]] > pageIndex) { + } else if ([[[outlineItem destination] page] pageIndex] > pageIndex) { if (i > 0) --i; break; } } - return i == numRows ? -1 : i; + if (i == numRows) + i--; + return i; } - (void)updateOutlineSelection{ @@ -3747,20 +3749,17 @@ return; // Get index of current page. - unsigned int pageIndex = [[pdfView document] indexForPage: [pdfView currentPage]]; - - // Test that the current selection is still valid. - PDFOutline *outlineItem = (PDFOutline *)[outlineView itemAtRow: [outlineView selectedRow]]; - - if ([[pdfView document] indexForPage: [[outlineItem destination] page]] == pageIndex) - return; - - int row = [self outlineRowForPageIndex:pageIndex]; + unsigned int pageIndex = [[pdfView currentPage] pageIndex]; - if (row != -1) { - updatingOutlineSelection = YES; - [outlineView selectRow:row byExtendingSelection: NO]; - updatingOutlineSelection = NO; + // Test that the current selection is still valid. + int row = [outlineView selectedRow]; + if (row == -1 || [[[[outlineView itemAtRow:row] destination] page] pageIndex] != pageIndex) { + row = [self outlineRowForPageIndex:pageIndex]; + if (row != -1) { + updatingOutlineSelection = YES; + [outlineView selectRow:row byExtendingSelection: NO]; + updatingOutlineSelection = NO; + } } } @@ -3768,7 +3767,7 @@ - (void)updateThumbnailSelection { // Get index of current page. - unsigned pageIndex = [[pdfView document] indexForPage: [pdfView currentPage]]; + unsigned pageIndex = [[pdfView currentPage] pageIndex]; updatingThumbnailSelection = YES; [thumbnailTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:pageIndex] byExtendingSelection:NO]; [thumbnailTableView scrollRowToVisible:pageIndex]; @@ -3838,7 +3837,7 @@ NSArray *orderedNotes = [noteArrayController arrangedObjects]; PDFAnnotation *annotation, *selAnnotation = nil; - unsigned int pageIndex = [[pdfView document] indexForPage: [pdfView currentPage]]; + unsigned int pageIndex = [[pdfView currentPage] pageIndex]; int i, count = [orderedNotes count]; unsigned int selPageIndex = [noteOutlineView selectedRow] != -1 ? [[self selectedNote] pageIndex] : NSNotFound; Modified: trunk/SKPDFAnnotationNote.m =================================================================== --- trunk/SKPDFAnnotationNote.m 2007-09-04 15:32:08 UTC (rev 2825) +++ trunk/SKPDFAnnotationNote.m 2007-09-04 16:56:47 UTC (rev 2826) @@ -230,7 +230,7 @@ - (unsigned int)pageIndex { PDFPage *page = [self page]; - return page ? [[page document] indexForPage:page] : NSNotFound; + return page ? [page pageIndex] : NSNotFound; } - (int)noteType { Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-09-04 15:32:08 UTC (rev 2825) +++ trunk/SKPDFView.m 2007-09-04 16:56:47 UTC (rev 2826) @@ -1388,7 +1388,7 @@ } - (void)checkSpellingStartingAtIndex:(int)index onPage:(PDFPage *)page { - unsigned int i, first = [[self document] indexForPage:page]; + unsigned int i, first = [page pageIndex]; unsigned int count = [[self document] pageCount]; BOOL didWrap = NO; i = first; @@ -1970,10 +1970,10 @@ if (activeAnnotation) { if (editAnnotation) [self endAnnotationEdit:self]; - pageIndex = [pdfDoc indexForPage:[activeAnnotation page]]; + pageIndex = [[activeAnnotation page] pageIndex]; i = [[[activeAnnotation page] annotations] indexOfObject:activeAnnotation]; } else { - pageIndex = [pdfDoc indexForPage:[self currentPage]]; + pageIndex = [[self currentPage] pageIndex]; } while (annotation == nil) { NSArray *annotations = [[pdfDoc pageAtIndex:pageIndex] annotations]; @@ -2015,10 +2015,10 @@ if (activeAnnotation) { if (editAnnotation) [self endAnnotationEdit:self]; - pageIndex = [pdfDoc indexForPage:[activeAnnotation page]]; + pageIndex = [[activeAnnotation page] pageIndex]; i = [[[activeAnnotation page] annotations] indexOfObject:activeAnnotation]; } else { - pageIndex = [pdfDoc indexForPage:[self currentPage]]; + pageIndex = [[self currentPage] pageIndex]; } while (annotation == nil) { NSArray *annotations = [[pdfDoc pageAtIndex:pageIndex] annotations]; @@ -2113,7 +2113,7 @@ SKMainWindowController *controller = [[self window] windowController]; - [controller showSnapshotAtPageNumber:[[self document] indexForPage:page] forRect:rect factor:1 autoFits:autoFits display:YES]; + [controller showSnapshotAtPageNumber:[page pageIndex] forRect:rect factor:1 autoFits:autoFits display:YES]; } #pragma mark Notification handling @@ -2307,9 +2307,9 @@ unsigned first, last; page = [self pageForPoint:SKTopLeftPoint(visibleRect) nearest:YES]; - first = [[self document] indexForPage:page]; + first = [page pageIndex]; page = [self pageForPoint:SKBottomRightPoint(visibleRect) nearest:YES]; - last = [[self document] indexForPage:page]; + last = [page pageIndex]; return NSMakeRange(first, last - first + 1); } @@ -3404,7 +3404,7 @@ SKMainWindowController *controller = [[self window] windowController]; - [controller showSnapshotAtPageNumber:[[self document] indexForPage:page] forRect:[self convertRect:rect toPage:page] factor:factor autoFits:autoFits display:YES]; + [controller showSnapshotAtPageNumber:[page pageIndex] forRect:[self convertRect:rect toPage:page] factor:factor autoFits:autoFits display:YES]; } - (void)magnifyWithEvent:(NSEvent *)theEvent { @@ -3543,7 +3543,7 @@ NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; PDFPage *page = [self pageForPoint:mouseLoc nearest:YES]; NSPoint location = [self convertPoint:mouseLoc toPage:page]; - unsigned int pageIndex = [[self document] indexForPage:page]; + unsigned int pageIndex = [page pageIndex]; PDFSelection *sel = [page selectionForLineAtPoint:location]; NSRect rect = sel ? [sel boundsForPage:page] : NSMakeRect(location.x - 20.0, location.y - 5.0, 40.0, 10.0); Modified: trunk/SKReadingBar.m =================================================================== --- trunk/SKReadingBar.m 2007-09-04 15:32:08 UTC (rev 2825) +++ trunk/SKReadingBar.m 2007-09-04 16:56:47 UTC (rev 2826) @@ -127,7 +127,7 @@ - (BOOL)goToNextPage { BOOL didMove = NO; PDFDocument *doc = [page document]; - int i = [doc indexForPage:page], iMax = [doc pageCount]; + int i = [page pageIndex], iMax = [doc pageCount]; while (++i < iMax) { PDFPage *nextPage = [doc pageAtIndex:i]; Modified: trunk/SKSnapshotWindowController.m =================================================================== --- trunk/SKSnapshotWindowController.m 2007-09-04 15:32:08 UTC (rev 2825) +++ trunk/SKSnapshotWindowController.m 2007-09-04 16:56:47 UTC (rev 2826) @@ -48,6 +48,7 @@ #import "SKStringConstants.h" #import "NSUserDefaultsController_SKExtensions.h" #import "NSGeometry_SKExtensions.h" +#import "PDFPage_SKExtensions.h" static NSString *SKSnapshotWindowFrameAutosaveName = @"SKSnapshotWindow"; static NSString *SKSnapshotViewChangedNotification = @"SKSnapshotViewChangedNotification"; @@ -230,10 +231,10 @@ NSView *clipView = [[[pdfView documentView] enclosingScrollView] contentView]; NSRect visibleRect = [clipView convertRect:[clipView visibleRect] toView:pdfView]; - unsigned first, last, index = [[pdfView document] indexForPage:page]; + unsigned first, last, index = [page pageIndex]; - first = [[pdfView document] indexForPage:[pdfView pageForPoint:SKTopLeftPoint(visibleRect) nearest:YES]]; - last = [[pdfView document] indexForPage:[pdfView pageForPoint:SKBottomRightPoint(visibleRect) nearest:YES]]; + first = [[pdfView pageForPoint:SKTopLeftPoint(visibleRect) nearest:YES] pageIndex]; + last = [[pdfView pageForPoint:SKBottomRightPoint(visibleRect) nearest:YES] pageIndex]; return index >= first && index <= last; } @@ -264,7 +265,7 @@ } - (unsigned int)pageIndex { - return [[pdfView document] indexForPage:[pdfView currentPage]]; + return [[pdfView currentPage] pageIndex]; } - (NSDictionary *)pageAndWindow { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-04 15:32:12
|
Revision: 2825 http://skim-app.svn.sourceforge.net/skim-app/?rev=2825&view=rev Author: hofman Date: 2007-09-04 08:32:08 -0700 (Tue, 04 Sep 2007) Log Message: ----------- Read PDF bundle data initially the way we write it, using the bundle's name for the content files. Modified Paths: -------------- trunk/SKDocument.m Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-09-04 12:24:29 UTC (rev 2824) +++ trunk/SKDocument.m 2007-09-04 15:32:08 UTC (rev 2825) @@ -520,37 +520,49 @@ } } else if ([docType isEqualToString:SKPDFBundleDocumentType]) { NSFileWrapper *fileWrapper = [[NSFileWrapper alloc] initWithPath:[absoluteURL path]]; + NSFileWrapper *pdfFW = nil; + NSFileWrapper *skimFW = nil; NSDictionary *fileWrappers = [fileWrapper fileWrappers]; NSArray *noteArray = nil; - NSFileWrapper *fw; + NSString *name = [[[absoluteURL path] lastPathComponent] stringByDeletingPathExtension]; + if ([name caseInsensitiveCompare:BUNDLE_DATA_FILENAME] == NSOrderedSame) + name = [name stringByAppendingString:@"1"]; - if ((fw = [fileWrappers objectForKey:BUNDLE_DATA_FILENAME]) && [fw isRegularFile]) { - data = [[fw regularFileContents] retain]; - pdfDoc = [[PDFDocument alloc] initWithURL:[NSURL fileURLWithPath:[[absoluteURL path] stringByAppendingPathComponent:[fw filename]]]]; - } - if ((fw = [fileWrappers objectForKey:BUNDLE_DATA_FILENAME]) && [fw isRegularFile]) { - if (noteArray = [NSKeyedUnarchiver unarchiveObjectWithData:[fw regularFileContents]]) - [self setNoteDicts:noteArray]; - } - if (data == nil || noteArray == nil) { + pdfFW = [fileWrappers objectForKey:[name stringByAppendingPathExtension:@"pdf"]]; + if ([pdfFW isRegularFile] == NO) + pdfFW = nil; + skimFW = [fileWrappers objectForKey:[name stringByAppendingPathExtension:@"skim"]]; + if ([skimFW isRegularFile] == NO) + skimFW = nil; + if (pdfFW == nil || skimFW == nil) { NSArray *fws = [fileWrappers allValues]; NSArray *extensions = [fws valueForKeyPath:@"filename.pathExtension.lowercaseString"]; unsigned int index; - if (data == nil) { + if (pdfFW == nil) { index = [extensions indexOfObject:@"pdf"]; - if ((index != NSNotFound) && (fw = [fws objectAtIndex:index]) && [fw isRegularFile]) { - data = [[fw regularFileContents] retain]; - pdfDoc = [[PDFDocument alloc] initWithURL:[NSURL fileURLWithPath:[[absoluteURL path] stringByAppendingPathComponent:[fw filename]]]]; + if (index != NSNotFound) { + pdfFW = [fws objectAtIndex:index]; + if ([pdfFW isRegularFile] == NO) + pdfFW = nil; } } - if (noteArray == nil) { + if (skimFW == nil) { index = [extensions indexOfObject:@"skim"]; - if ((index != NSNotFound) && (fw = [fws objectAtIndex:index]) && [fw isRegularFile]) { - if (noteArray = [NSKeyedUnarchiver unarchiveObjectWithData:[fw regularFileContents]]) - [self setNoteDicts:noteArray]; + if (index != NSNotFound) { + skimFW = [fws objectAtIndex:index]; + if ([skimFW isRegularFile] == NO) + skimFW = nil; } } } + if (pdfFW) { + data = [[pdfFW regularFileContents] retain]; + pdfDoc = [[PDFDocument alloc] initWithURL:[NSURL fileURLWithPath:[[absoluteURL path] stringByAppendingPathComponent:[pdfFW filename]]]]; + } + if (skimFW) { + if (noteArray = [NSKeyedUnarchiver unarchiveObjectWithData:[skimFW regularFileContents]]) + [self setNoteDicts:noteArray]; + } [fileWrapper release]; } else if ([docType isEqualToString:SKPostScriptDocumentType]) { if (data = [NSData dataWithContentsOfURL:absoluteURL options:NSUncachedRead error:&error]) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-04 14:03:50
|
Revision: 2742 http://skim-app.svn.sourceforge.net/skim-app/?rev=2742&view=rev Author: hofman Date: 2007-08-28 05:45:12 -0700 (Tue, 28 Aug 2007) Log Message: ----------- Add "PDF Bundle" in description of scripting save command. Modified Paths: -------------- trunk/Skim.sdef Modified: trunk/Skim.sdef =================================================================== --- trunk/Skim.sdef 2007-08-28 12:25:36 UTC (rev 2741) +++ trunk/Skim.sdef 2007-08-28 12:45:12 UTC (rev 2742) @@ -267,7 +267,7 @@ <cocoa key="File"/> </parameter> <parameter name="as" code="fltp" type="text" optional="yes" - description="The type of file to save. If this is set, this acts like Export. Should be one of "PDF", "PDF Without Notes", "PDF With Embedded Notes", "Skim Notes", "Notes as RTF", and "Notes as Text"."> + description="The type of file to save. If this is set, this acts like Export. Should be one of "PDF", "PDF Bundle", "PDF Without Notes", "PDF With Embedded Notes", "Skim Notes", "Notes as RTF", and "Notes as Text"."> <cocoa key="FileType"/> </parameter> </command> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-04 12:24:30
|
Revision: 2824 http://skim-app.svn.sourceforge.net/skim-app/?rev=2824&view=rev Author: hofman Date: 2007-09-04 05:24:29 -0700 (Tue, 04 Sep 2007) Log Message: ----------- Add size of directory contents to file size in info window. Modified Paths: -------------- trunk/SKInfoWindowController.m Modified: trunk/SKInfoWindowController.m =================================================================== --- trunk/SKInfoWindowController.m 2007-09-04 12:05:34 UTC (rev 2823) +++ trunk/SKInfoWindowController.m 2007-09-04 12:24:29 UTC (rev 2824) @@ -89,13 +89,14 @@ FSRef fileRef; FSCatalogInfo catalogInfo; unsigned long long size, logicalSize = 0; - BOOL gotSize = NO; + BOOL gotSize = NO, isDir = NO; NSMutableString *string = [NSMutableString string]; Boolean gotRef = CFURLGetFSRef((CFURLRef)fileURL, &fileRef); - if (gotRef && noErr == FSGetCatalogInfo(&fileRef, kFSCatInfoDataSizes | kFSCatInfoRsrcSizes, &catalogInfo, NULL, NULL, NULL)) { + if (gotRef && noErr == FSGetCatalogInfo(&fileRef, kFSCatInfoDataSizes | kFSCatInfoRsrcSizes | kFSCatInfoNodeFlags, &catalogInfo, NULL, NULL, NULL)) { size = catalogInfo.dataPhysicalSize + catalogInfo.rsrcPhysicalSize; logicalSize = catalogInfo.dataLogicalSize + catalogInfo.rsrcLogicalSize; + isDir = (catalogInfo.nodeFlags & kFSNodeIsDirectoryMask) != 0; gotSize = YES; } @@ -103,8 +104,22 @@ // this seems to give the logical size NSDictionary *fileAttrs = [[NSFileManager defaultManager] fileAttributesAtPath:[fileURL path] traverseLink:NO]; logicalSize = size = [[fileAttrs objectForKey:NSFileSize] unsignedLongLongValue]; + isDir = [[fileAttrs fileType] isEqualToString:NSFileTypeDirectory]; } + if (isDir) { + NSString *path = [fileURL path]; + NSEnumerator *fileEnum = [[[NSFileManager defaultManager] subpathsAtPath:path] objectEnumerator]; + NSString *file; + unsigned long long componentSize; + unsigned long long logicalComponentSize; + while (file = [fileEnum nextObject]) { + SKFileSizeStringForFileURL([NSURL fileURLWithPath:[path stringByAppendingPathComponent:file]], &componentSize, &logicalComponentSize); + size += componentSize; + logicalSize += logicalComponentSize; + } + } + if (physicalSizePtr) *physicalSizePtr = size; if (logicalSizePtr) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-04 12:05:35
|
Revision: 2823 http://skim-app.svn.sourceforge.net/skim-app/?rev=2823&view=rev Author: hofman Date: 2007-09-04 05:05:34 -0700 (Tue, 04 Sep 2007) Log Message: ----------- Save files in PDF bundle with filename derived from bundle filename, except for the spotlight data. Modified Paths: -------------- trunk/SKDocument.m Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-09-04 11:49:06 UTC (rev 2822) +++ trunk/SKDocument.m 2007-09-04 12:05:34 UTC (rev 2823) @@ -62,16 +62,8 @@ #import "Files_SKExtensions.h" #import "NSTask_SKExtensions.h" -// maximum length of xattr value recommended by Apple -#define MAX_XATTR_LENGTH 2048 +#define BUNDLE_DATA_FILENAME @"data" -#define WRAPPER_PDF_FILENAME @"data.pdf" -#define WRAPPER_TEXT_FILENAME @"data.txt" -#define WRAPPER_PLIST_FILENAME @"data.plist" -#define WRAPPER_SKIM_FILENAME @"notes.skim" -#define WRAPPER_TXT_FILENAME @"notes.txt" -#define WRAPPER_RTF_FILENAME @"notes.rtf" - NSString *SKDocumentErrorDomain = @"SKDocumentErrorDomain"; NSString *SKDocumentWillSaveNotification = @"SKDocumentWillSaveNotification"; @@ -330,25 +322,28 @@ didWrite = [pdfData writeToURL:absoluteURL options:NSAtomicWrite error:outError] && [self saveNotesToExtendedAttributesAtURL:absoluteURL error:outError]; } else if ([typeName isEqualToString:SKPDFBundleDocumentType]) { - NSData *textData = [[[self pdfDocument] string] dataUsingEncoding:NSUTF8StringEncoding]; NSData *notesData = [[self notes] count] ? [NSKeyedArchiver archivedDataWithRootObject:[[self notes] valueForKey:@"dictionaryValue"]] : nil; NSData *notesTextData = [[self notesString] dataUsingEncoding:NSUTF8StringEncoding]; NSData *notesRTFData = [self notesRTFData]; + NSData *textData = [[[self pdfDocument] string] dataUsingEncoding:NSUTF8StringEncoding]; NSDictionary *info = [[SKInfoWindowController sharedInstance] infoForDocument:self]; NSData *infoData = [NSPropertyListSerialization dataFromPropertyList:info format:NSPropertyListXMLFormat_v1_0 errorDescription:NULL]; NSFileWrapper *fileWrapper = [[NSFileWrapper alloc] initDirectoryWithFileWrappers:[NSDictionary dictionary]]; - [fileWrapper addRegularFileWithContents:pdfData preferredFilename:WRAPPER_PDF_FILENAME]; - if (textData) - [fileWrapper addRegularFileWithContents:textData preferredFilename:WRAPPER_TEXT_FILENAME]; - if (infoData) - [fileWrapper addRegularFileWithContents:infoData preferredFilename:WRAPPER_PLIST_FILENAME]; + NSString *name = [[[absoluteURL path] lastPathComponent] stringByDeletingPathExtension]; + if ([name caseInsensitiveCompare:BUNDLE_DATA_FILENAME] == NSOrderedSame) + name = [name stringByAppendingString:@"1"]; + [fileWrapper addRegularFileWithContents:pdfData preferredFilename:[name stringByAppendingPathExtension:@"pdf"]]; if (notesData) - [fileWrapper addRegularFileWithContents:notesData preferredFilename:WRAPPER_SKIM_FILENAME]; + [fileWrapper addRegularFileWithContents:notesData preferredFilename:[name stringByAppendingPathExtension:@"skim"]]; if (notesTextData) - [fileWrapper addRegularFileWithContents:notesTextData preferredFilename:WRAPPER_TXT_FILENAME]; + [fileWrapper addRegularFileWithContents:notesTextData preferredFilename:[name stringByAppendingPathExtension:@"txt"]]; if (notesRTFData) - [fileWrapper addRegularFileWithContents:notesRTFData preferredFilename:WRAPPER_RTF_FILENAME]; - didWrite = [fileWrapper writeToFile:[absoluteURL path] atomically:YES updateFilenames:NO]; + [fileWrapper addRegularFileWithContents:notesRTFData preferredFilename:[name stringByAppendingPathExtension:@"rtf"]]; + if (textData) + [fileWrapper addRegularFileWithContents:textData preferredFilename:[BUNDLE_DATA_FILENAME stringByAppendingPathExtension:@"txt"]]; + if (infoData) + [fileWrapper addRegularFileWithContents:infoData preferredFilename:[BUNDLE_DATA_FILENAME stringByAppendingPathExtension:@"plist"]]; + didWrite = [fileWrapper writeToFile:[absoluteURL path] atomically:NO updateFilenames:NO]; [fileWrapper release]; } else if ([typeName isEqualToString:SKEmbeddedPDFDocumentType]) { [[self mainWindowController] removeTemporaryAnnotations]; @@ -529,11 +524,11 @@ NSArray *noteArray = nil; NSFileWrapper *fw; - if ((fw = [fileWrappers objectForKey:WRAPPER_PDF_FILENAME]) && [fw isRegularFile]) { + if ((fw = [fileWrappers objectForKey:BUNDLE_DATA_FILENAME]) && [fw isRegularFile]) { data = [[fw regularFileContents] retain]; pdfDoc = [[PDFDocument alloc] initWithURL:[NSURL fileURLWithPath:[[absoluteURL path] stringByAppendingPathComponent:[fw filename]]]]; } - if ((fw = [fileWrappers objectForKey:WRAPPER_SKIM_FILENAME]) && [fw isRegularFile]) { + if ((fw = [fileWrappers objectForKey:BUNDLE_DATA_FILENAME]) && [fw isRegularFile]) { if (noteArray = [NSKeyedUnarchiver unarchiveObjectWithData:[fw regularFileContents]]) [self setNoteDicts:noteArray]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-04 11:49:08
|
Revision: 2822 http://skim-app.svn.sourceforge.net/skim-app/?rev=2822&view=rev Author: hofman Date: 2007-09-04 04:49:06 -0700 (Tue, 04 Sep 2007) Log Message: ----------- Allow SkimNotesAgent to find notes in bundles with different file names for the note files. Modified Paths: -------------- SkimNotesAgent/SkimNotesAgent.m Modified: SkimNotesAgent/SkimNotesAgent.m =================================================================== --- SkimNotesAgent/SkimNotesAgent.m 2007-09-04 11:30:21 UTC (rev 2821) +++ SkimNotesAgent/SkimNotesAgent.m 2007-09-04 11:49:06 UTC (rev 2822) @@ -83,6 +83,34 @@ [super dealloc]; } +- (NSString *)notesFileWithExtension:(NSString *)extension atPath:(NSString *)path error:(NSError **)error { + NSString *filePath = nil; + + if ([extension caseInsensitiveCompare:@"skim"] == NSOrderedSame) { + NSArray *files = [[NSFileManager defaultManager] subpathsAtPath:path]; + NSString *filename = @"notes.skim"; + if ([files containsObject:filename] == NO) { + filename = [[[path lastPathComponent] stringByDeletingPathExtension] stringByAppendingPathExtension:extension]; + if ([files containsObject:filename] == NO) { + unsigned index = [[files valueForKeyPath:@"pathExtension.lowercaseString"] indexOfObject:@"skim"]; + filename = index == NSNotFound ? nil : [files objectAtIndex:index]; + } + } + if (filename) + filePath = [path stringByAppendingPathComponent:filename]; + } else { + NSString *skimFile = [self notesFileWithExtension:@"skim" atPath:path error:error]; + if (skimFile) { + filePath = [[skimFile stringByDeletingPathExtension] stringByAppendingPathExtension:extension]; + if ([[NSFileManager defaultManager] fileExistsAtPath:filePath] == NO) + filePath = nil; + } + } + if (filePath == nil && error) + *error = [NSError errorWithDomain:NSPOSIXErrorDomain code:ENOENT userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Notes file note found", NSLocalizedDescriptionKey, nil]]; + return filePath; +} + - (bycopy NSData *)SkimNotesAtPath:(in bycopy NSString *)aFile; { NSError *error; @@ -90,7 +118,9 @@ NSString *extension = [[aFile pathExtension] lastPathComponent]; if ([extension caseInsensitiveCompare:@"pdfd"] == NSOrderedSame) { - data = [NSData dataWithContentsOfFile:[aFile stringByAppendingPathComponent:@"notes.skim"] options:0 error:&error]; + NSString *notePath = [self notesFileWithExtension:@"skim" atPath:aFile error:&error]; + if (notePath) + data = [NSData dataWithContentsOfFile:notePath options:0 error:&error]; if (nil == data) fprintf(stderr, "SkimNotesAgent pid %d: error getting Skim notes (%s)\n", getpid(), [[error description] UTF8String]); } else if ([extension caseInsensitiveCompare:@"skim"] == NSOrderedSame) { @@ -112,7 +142,9 @@ NSString *extension = [[aFile pathExtension] lastPathComponent]; if ([extension caseInsensitiveCompare:@"pdfd"] == NSOrderedSame) { - data = [NSData dataWithContentsOfFile:[aFile stringByAppendingPathComponent:@"notes.rtf"] options:0 error:&error]; + NSString *notePath = [self notesFileWithExtension:@"rtf" atPath:aFile error:&error]; + if (notePath) + data = [NSData dataWithContentsOfFile:notePath options:0 error:&error]; if (nil == data) fprintf(stderr, "SkimNotesAgent pid %d: error getting RTF notes (%s)\n", getpid(), [[error description] UTF8String]); } else { @@ -130,7 +162,9 @@ NSString *extension = [[aFile pathExtension] lastPathComponent]; if ([extension caseInsensitiveCompare:@"pdfd"] == NSOrderedSame) { - string = [NSString stringWithContentsOfFile:[aFile stringByAppendingPathComponent:@"notes.txt"] encoding:NSUTF8StringEncoding error:&error]; + NSString *notePath = [self notesFileWithExtension:@"txt" atPath:aFile error:&error]; + if (notePath) + string = [NSString stringWithContentsOfFile:notePath encoding:NSUTF8StringEncoding error:&error]; if (nil == string) fprintf(stderr, "SkimNotesAgent pid %d: error getting text notes (%s)\n", getpid(), [[error description] UTF8String]); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-04 11:30:25
|
Revision: 2821 http://skim-app.svn.sourceforge.net/skim-app/?rev=2821&view=rev Author: hofman Date: 2007-09-04 04:30:21 -0700 (Tue, 04 Sep 2007) Log Message: ----------- Allow spotlight indexing of PDF bundles whose .skim files have a different filename. Modified Paths: -------------- trunk/SkimImporter/GetMetadataForFile.m Modified: trunk/SkimImporter/GetMetadataForFile.m =================================================================== --- trunk/SkimImporter/GetMetadataForFile.m 2007-09-04 11:04:17 UTC (rev 2820) +++ trunk/SkimImporter/GetMetadataForFile.m 2007-09-04 11:30:21 UTC (rev 2821) @@ -58,7 +58,17 @@ notePath = (NSString *)pathToFile; sourcePath = [[(NSString *)pathToFile stringByDeletingPathExtension] stringByAppendingPathExtension:@"pdf"]; } else if (UTTypeEqual(contentTypeUTI, CFSTR("net.sourceforge.skim-app.pdfd"))) { - notePath = [(NSString *)pathToFile stringByAppendingPathComponent:@"notes.skim"]; + NSArray *files = [[NSFileManager defaultManager] subpathsAtPath:(NSString *)pathToFile]; + NSString *noteFilename = @"notes.skim"; + if ([files containsObject:noteFilename] == NO) { + noteFilename = [[[(NSString *)pathToFile lastPathComponent] stringByDeletingPathExtension] stringByAppendingPathExtension:@"skim"]; + if ([files containsObject:noteFilename] == NO) { + unsigned index = [[files valueForKeyPath:@"pathExtension.lowercaseString"] indexOfObject:@"skim"]; + noteFilename = index == NSNotFound ? nil : [files objectAtIndex:index]; + } + } + if (noteFilename) + notePath = [(NSString *)pathToFile stringByAppendingPathComponent:noteFilename]; } if (notePath && [[NSFileManager defaultManager] fileExistsAtPath:notePath]) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-04 11:04:30
|
Revision: 2820 http://skim-app.svn.sourceforge.net/skim-app/?rev=2820&view=rev Author: hofman Date: 2007-09-04 04:04:17 -0700 (Tue, 04 Sep 2007) Log Message: ----------- Fix error messages. Modified Paths: -------------- SkimNotesAgent/SkimNotesAgent.m Modified: SkimNotesAgent/SkimNotesAgent.m =================================================================== --- SkimNotesAgent/SkimNotesAgent.m 2007-09-04 09:02:54 UTC (rev 2819) +++ SkimNotesAgent/SkimNotesAgent.m 2007-09-04 11:04:17 UTC (rev 2820) @@ -92,11 +92,11 @@ if ([extension caseInsensitiveCompare:@"pdfd"] == NSOrderedSame) { data = [NSData dataWithContentsOfFile:[aFile stringByAppendingPathComponent:@"notes.skim"] options:0 error:&error]; if (nil == data) - fprintf(stderr, "SkimNotesAgent pid %d: error getting Skim notes\n", getpid(), [[error description] UTF8String]); + fprintf(stderr, "SkimNotesAgent pid %d: error getting Skim notes (%s)\n", getpid(), [[error description] UTF8String]); } else if ([extension caseInsensitiveCompare:@"skim"] == NSOrderedSame) { data = [NSData dataWithContentsOfFile:aFile options:0 error:&error]; if (nil == data) - fprintf(stderr, "SkimNotesAgent pid %d: error getting Skim notes\n", getpid(), [[error description] UTF8String]); + fprintf(stderr, "SkimNotesAgent pid %d: error getting Skim notes (%s)\n", getpid(), [[error description] UTF8String]); } else { data = [[NSFileManager defaultManager] extendedAttributeNamed:@"net_sourceforge_skim-app_notes" atPath:[aFile stringByStandardizingPath] traverseLink:YES error:&error]; if (nil == data && [error code] != ENOATTR) @@ -114,7 +114,7 @@ if ([extension caseInsensitiveCompare:@"pdfd"] == NSOrderedSame) { data = [NSData dataWithContentsOfFile:[aFile stringByAppendingPathComponent:@"notes.rtf"] options:0 error:&error]; if (nil == data) - fprintf(stderr, "SkimNotesAgent pid %d: error getting Skim notes\n", getpid(), [[error description] UTF8String]); + fprintf(stderr, "SkimNotesAgent pid %d: error getting RTF notes (%s)\n", getpid(), [[error description] UTF8String]); } else { data = [[NSFileManager defaultManager] extendedAttributeNamed:@"net_sourceforge_skim-app_rtf_notes" atPath:[aFile stringByStandardizingPath] traverseLink:YES error:&error]; if (nil == data && [error code] != ENOATTR) @@ -132,7 +132,7 @@ if ([extension caseInsensitiveCompare:@"pdfd"] == NSOrderedSame) { string = [NSString stringWithContentsOfFile:[aFile stringByAppendingPathComponent:@"notes.txt"] encoding:NSUTF8StringEncoding error:&error]; if (nil == string) - fprintf(stderr, "SkimNotesAgent pid %d: error getting Skim notes\n", getpid(), [[error description] UTF8String]); + fprintf(stderr, "SkimNotesAgent pid %d: error getting text notes (%s)\n", getpid(), [[error description] UTF8String]); } else { string = [[NSFileManager defaultManager] propertyListFromExtendedAttributeNamed:@"net_sourceforge_skim-app_text_notes" atPath:[aFile stringByStandardizingPath] traverseLink:YES error:&error]; if (nil == string && [[[error userInfo] objectForKey:NSUnderlyingErrorKey] code] != ENOATTR) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-04 09:02:56
|
Revision: 2819 http://skim-app.svn.sourceforge.net/skim-app/?rev=2819&view=rev Author: hofman Date: 2007-09-04 02:02:54 -0700 (Tue, 04 Sep 2007) Log Message: ----------- Use different color to highlight disabled tables with a blue background. Modified Paths: -------------- trunk/NSColor_SKExtensions.h trunk/NSColor_SKExtensions.m trunk/SKThumbnailTableView.m trunk/SKTocOutlineView.m trunk/Skim.xcodeproj/project.pbxproj Added Paths: ----------- trunk/NSCell_SKExtensions.h trunk/NSCell_SKExtensions.m Added: trunk/NSCell_SKExtensions.h =================================================================== --- trunk/NSCell_SKExtensions.h (rev 0) +++ trunk/NSCell_SKExtensions.h 2007-09-04 09:02:54 UTC (rev 2819) @@ -0,0 +1,45 @@ +// +// NSCell_SKExtensions.h +// Skim +// +// Created by Christiaan Hofman on 9/4/07. +// Copyright 2007 Christiaan Hofman. All rights reserved. +// +/* + 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 NSCell (SKExtensions) +@end Added: trunk/NSCell_SKExtensions.m =================================================================== --- trunk/NSCell_SKExtensions.m (rev 0) +++ trunk/NSCell_SKExtensions.m 2007-09-04 09:02:54 UTC (rev 2819) @@ -0,0 +1,60 @@ +// +// NSCell_SKExtensions.h +// Skim +// +// Created by Christiaan Hofman on 9/4/07. +// Copyright 2007 Christiaan Hofman. All rights reserved. +// +/* + 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 "NSCell_SKExtensions.h" +#import "OBUtilities.h" + + +@implementation NSCell (SKExtensions) + +static IMP originalHighlightColorWithFrameInView = NULL; + ++ (void)load { + originalHighlightColorWithFrameInView = OBReplaceMethodImplementationWithSelector(self, @selector(highlightColorWithFrame:inView:), @selector(replacementHighlightColorWithFrame:inView:)); +} + +- (NSColor *)replacementHighlightColorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { + if ([controlView respondsToSelector:@selector(highlightColor)]) + return [(id)controlView highlightColor]; + else + return originalHighlightColorWithFrameInView(self, _cmd, cellFrame, controlView); +} + +@end Modified: trunk/NSColor_SKExtensions.h =================================================================== --- trunk/NSColor_SKExtensions.h 2007-09-03 22:17:20 UTC (rev 2818) +++ trunk/NSColor_SKExtensions.h 2007-09-04 09:02:54 UTC (rev 2819) @@ -72,6 +72,7 @@ @interface NSColor (SKExtensions) + (NSColor *)tableBackgroundColor; ++ (NSColor *)secondarySelectedTableColor; + (id)scriptingRgbaColorWithDescriptor:(NSAppleEventDescriptor *)descriptor; - (id)scriptingRgbaColorDescriptor; Modified: trunk/NSColor_SKExtensions.m =================================================================== --- trunk/NSColor_SKExtensions.m 2007-09-03 22:17:20 UTC (rev 2818) +++ trunk/NSColor_SKExtensions.m 2007-09-04 09:02:54 UTC (rev 2819) @@ -44,12 +44,20 @@ + (NSColor *)tableBackgroundColor { static NSColor *tableBackgroundColor = nil; if (nil == tableBackgroundColor) { - // from Mail.app on 10.4; should be based on control tint? - tableBackgroundColor = [[NSColor colorWithCalibratedRed:231.0f/255.0f green:237.0f/255.0f blue:246.0f/255.0f alpha:1.0] retain]; + tableBackgroundColor = [[NSColor colorWithCalibratedRed:0.905882 green:0.929412 blue:0.964706 alpha:1.0] retain]; } return tableBackgroundColor; } ++ (NSColor *)secondarySelectedTableColor { + static NSColor *secondarySelectedTableColor = nil; + if (nil == secondarySelectedTableColor) { + secondarySelectedTableColor = [self tableBackgroundColor]; + secondarySelectedTableColor = [[NSColor colorWithCalibratedRed:0.724706 green:0.743529 blue:0.771765 alpha:1.0] retain]; + } + return secondarySelectedTableColor; +} + + (id)scriptingRgbaColorWithDescriptor:(NSAppleEventDescriptor *)descriptor { float red, green, blue, alpha = 1.0; switch ([descriptor numberOfItems]) { Modified: trunk/SKThumbnailTableView.m =================================================================== --- trunk/SKThumbnailTableView.m 2007-09-03 22:17:20 UTC (rev 2818) +++ trunk/SKThumbnailTableView.m 2007-09-04 09:02:54 UTC (rev 2819) @@ -75,42 +75,21 @@ return [NSColor tableBackgroundColor]; } -- (BOOL)isScrolling { return isScrolling; } - -- (void)handleScrollerWillScroll:(NSNotification *)note { - isScrolling = YES; +- (NSColor *)highlightColor { + if ([[self window] isKeyWindow] && [[self window] firstResponder] == self) + return [NSColor alternateSelectedControlColor]; + else + return [NSColor secondarySelectedTableColor]; } -- (void)handleScrollerDidScroll:(NSNotification *)note { - isScrolling = NO; - [self setNeedsDisplayInRect:[self visibleRect]]; -} - -- (void)awakeFromNib { - NSScroller *scroller = [[self enclosingScrollView] verticalScroller]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleScrollerWillScroll:) - name:SKScrollerWillScrollNotification object:scroller]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleScrollerDidScroll:) - name:SKScrollerDidScrollNotification object:scroller]; -} - -- (void)setFrame:(NSRect)frameRect { - [super setFrame:frameRect]; - [self noteHeightOfRowsWithIndexesChanged:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [self numberOfRows])]]; -} - -- (void)setFrameSize:(NSSize)frameSize { - [super setFrameSize:frameSize]; - [self noteHeightOfRowsWithIndexesChanged:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [self numberOfRows])]]; -} - - (void)highlightSelectionInClipRect:(NSRect)clipRect { - NSColor *color = ([[self window] isKeyWindow] && [[self window] firstResponder] == self) ? [NSColor alternateSelectedControlColor] : [NSColor secondarySelectedControlColor]; + NSColor *color = [self highlightColor]; int row; [NSGraphicsContext saveGraphicsState]; if ([[self delegate] respondsToSelector:@selector(tableViewHighlightedRows:)]) { + NSMutableIndexSet *rowIndexes = [[[self selectedRowIndexes] mutableCopy] autorelease]; NSArray *rows = [[self delegate] tableViewHighlightedRows:self]; float factor = 0.5; @@ -136,6 +115,35 @@ [NSGraphicsContext restoreGraphicsState]; } +- (BOOL)isScrolling { return isScrolling; } + +- (void)handleScrollerWillScroll:(NSNotification *)note { + isScrolling = YES; +} + +- (void)handleScrollerDidScroll:(NSNotification *)note { + isScrolling = NO; + [self setNeedsDisplayInRect:[self visibleRect]]; +} + +- (void)awakeFromNib { + NSScroller *scroller = [[self enclosingScrollView] verticalScroller]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleScrollerWillScroll:) + name:SKScrollerWillScrollNotification object:scroller]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleScrollerDidScroll:) + name:SKScrollerDidScrollNotification object:scroller]; +} + +- (void)setFrame:(NSRect)frameRect { + [super setFrame:frameRect]; + [self noteHeightOfRowsWithIndexesChanged:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [self numberOfRows])]]; +} + +- (void)setFrameSize:(NSSize)frameSize { + [super setFrameSize:frameSize]; + [self noteHeightOfRowsWithIndexesChanged:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [self numberOfRows])]]; +} + - (void)mouseDown:(NSEvent *)theEvent { if (([theEvent modifierFlags] & NSCommandKeyMask) && [[self delegate] respondsToSelector:@selector(tableView:commandSelectRow:)]) { int row = [self rowAtPoint:[self convertPoint:[theEvent locationInWindow] fromView:nil]]; Modified: trunk/SKTocOutlineView.m =================================================================== --- trunk/SKTocOutlineView.m 2007-09-03 22:17:20 UTC (rev 2818) +++ trunk/SKTocOutlineView.m 2007-09-04 09:02:54 UTC (rev 2819) @@ -53,8 +53,15 @@ return [NSColor tableBackgroundColor]; } +- (NSColor *)highlightColor { + if ([[self window] isKeyWindow] && [[self window] firstResponder] == self) + return [NSColor alternateSelectedControlColor]; + else + return [NSColor secondarySelectedTableColor]; +} + - (void)highlightSelectionInClipRect:(NSRect)clipRect { - NSColor *color = ([[self window] isKeyWindow] && [[self window] firstResponder] == self) ? [NSColor alternateSelectedControlColor] : [NSColor secondarySelectedControlColor]; + NSColor *color = [self highlightColor]; int row; [NSGraphicsContext saveGraphicsState]; Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-09-03 22:17:20 UTC (rev 2818) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-09-04 09:02:54 UTC (rev 2819) @@ -132,6 +132,7 @@ 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 */; }; + CE5F71560C8CDF9A008BE480 /* NSCell_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5F71540C8CDF9A008BE480 /* NSCell_SKExtensions.m */; }; CE67BB260BC44AC9007B6929 /* ZoomValues.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE67BB240BC44AC9007B6929 /* ZoomValues.strings */; }; CE6C03F10BEDF759007BF0B5 /* NSParagraphStyle_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE6C03EF0BEDF759007BF0B5 /* NSParagraphStyle_SKExtensions.m */; }; CE74686F0B7F3B1C00CBF969 /* ToolbarInfo.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CE7467330B7F2ED700CBF969 /* ToolbarInfo.tiff */; }; @@ -497,6 +498,8 @@ 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>"; }; + CE5F71530C8CDF9A008BE480 /* NSCell_SKExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSCell_SKExtensions.h; sourceTree = "<group>"; }; + CE5F71540C8CDF9A008BE480 /* NSCell_SKExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSCell_SKExtensions.m; sourceTree = "<group>"; }; CE67BB250BC44AC9007B6929 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/ZoomValues.strings; sourceTree = "<group>"; }; CE67BB290BC44AD5007B6929 /* Dutch */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = Dutch; path = Dutch.lproj/ZoomValues.strings; sourceTree = "<group>"; }; CE6C03EE0BEDF759007BF0B5 /* NSParagraphStyle_SKExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSParagraphStyle_SKExtensions.h; sourceTree = "<group>"; }; @@ -792,6 +795,8 @@ CE4EC87E0B7E6E110091F228 /* NSBezierPath_CoreImageExtensions.m */, F968C5A00C036E9D000BD1B2 /* NSBitmapImageRep_SKExtensions.h */, F968C5A10C036E9D000BD1B2 /* NSBitmapImageRep_SKExtensions.m */, + CE5F71530C8CDF9A008BE480 /* NSCell_SKExtensions.h */, + CE5F71540C8CDF9A008BE480 /* NSCell_SKExtensions.m */, CE1E30260BDB9D8E0011D9DD /* NSCharacterSet_SKExtensions.h */, CE1E30270BDB9D8E0011D9DD /* NSCharacterSet_SKExtensions.m */, CE7C204D0C259A5D0059E08C /* NSColor_SKExtensions.h */, @@ -1494,6 +1499,7 @@ CE5BF8010C7CBF6300EBDCF7 /* SKTableView.m in Sources */, CE5BF8430C7CC24A00EBDCF7 /* SKOutlineView.m in Sources */, CE820A220C8A0E310020E6B0 /* NSTask_SKExtensions.m in Sources */, + CE5F71560C8CDF9A008BE480 /* NSCell_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-09-03 22:17:21
|
Revision: 2818 http://skim-app.svn.sourceforge.net/skim-app/?rev=2818&view=rev Author: hofman Date: 2007-09-03 15:17:20 -0700 (Mon, 03 Sep 2007) Log Message: ----------- Use selection if present when command-clicking for snapshot. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-09-03 19:33:17 UTC (rev 2817) +++ trunk/SKPDFView.m 2007-09-03 22:17:20 UTC (rev 2818) @@ -3379,6 +3379,12 @@ autoFits = YES; + } else if (toolMode == SKSelectToolMode && NSIsEmptyRect(selectionRect) == NO) { + + rect = NSIntersectionRect(selectionRect, [page boundsForBox:kPDFDisplayBoxCropBox]); + rect = [self convertRect:rect fromPage:page]; + autoFits = YES; + } else { BOOL isLink = NO; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-03 19:33:23
|
Revision: 2817 http://skim-app.svn.sourceforge.net/skim-app/?rev=2817&view=rev Author: hofman Date: 2007-09-03 12:33:17 -0700 (Mon, 03 Sep 2007) Log Message: ----------- Show hover window on screen for mouse location, which may not be the main screen. Modified Paths: -------------- trunk/SKPDFHoverWindow.m Modified: trunk/SKPDFHoverWindow.m =================================================================== --- trunk/SKPDFHoverWindow.m 2007-09-03 17:52:53 UTC (rev 2816) +++ trunk/SKPDFHoverWindow.m 2007-09-03 19:33:17 UTC (rev 2817) @@ -50,6 +50,11 @@ #define TEXT_MARGIN_Y 2.0 #define ALPHA_VALUE 0.95 +@interface NSScreen (SKExtensions) ++ (NSScreen *)screenForPoint:(NSPoint)point; +@end + + @implementation SKPDFHoverWindow + (id)sharedHoverWindow { @@ -291,7 +296,7 @@ contentRect.size = [image size]; contentRect.origin.y -= NSHeight(contentRect); - contentRect = SKConstrainRect(contentRect, [[NSScreen mainScreen] visibleFrame]); + contentRect = SKConstrainRect(contentRect, [[NSScreen screenForPoint:thePoint] visibleFrame]); [self setFrame:[self frameRectForContentRect:contentRect] display:NO]; [[imageView enclosingScrollView] setBackgroundColor:color]; @@ -375,3 +380,51 @@ } @end + + +static inline float SKSquaredDistanceFromPointToRect(NSPoint point, NSRect rect) { + float dx, dy; + + if (point.x < NSMinX(rect)) + dx = NSMinX(rect) - point.x; + else if (point.x > NSMaxX(rect)) + dx = point.x - NSMaxX(rect); + else + dx = 0.0; + + if (point.y < NSMinY(rect)) + dy = NSMinY(rect) - point.y; + else if (point.y > NSMaxY(rect)) + dy = point.y - NSMaxY(rect); + else + dy = 0.0; + + return dx * dx + dy * dy; +} + + +@implementation NSScreen (SKExtensions) + ++ (NSScreen *)screenForPoint:(NSPoint)point { + NSEnumerator *screenEnum = [[NSScreen screens] objectEnumerator]; + NSScreen *aScreen; + NSScreen *screen = nil; + float distanceSquared = FLT_MAX; + + while (aScreen = [screenEnum nextObject]) { + NSRect frame = [aScreen frame]; + + if (NSPointInRect(point, frame)) + return aScreen; + + float aDistanceSquared = SKSquaredDistanceFromPointToRect(point, frame); + if (aDistanceSquared < distanceSquared) { + distanceSquared = aDistanceSquared; + screen = aScreen; + } + } + + return screen; +} + +@end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-03 17:53:03
|
Revision: 2816 http://skim-app.svn.sourceforge.net/skim-app/?rev=2816&view=rev Author: hofman Date: 2007-09-03 10:52:53 -0700 (Mon, 03 Sep 2007) Log Message: ----------- Use a blue background for some tables. Don't add a white line at the bottom of the selected row for those tables. Modified Paths: -------------- trunk/NSColor_SKExtensions.h trunk/NSColor_SKExtensions.m trunk/SKThumbnailTableView.m trunk/SKTocOutlineView.m Modified: trunk/NSColor_SKExtensions.h =================================================================== --- trunk/NSColor_SKExtensions.h 2007-09-03 15:23:18 UTC (rev 2815) +++ trunk/NSColor_SKExtensions.h 2007-09-03 17:52:53 UTC (rev 2816) @@ -71,6 +71,8 @@ @interface NSColor (SKExtensions) ++ (NSColor *)tableBackgroundColor; + + (id)scriptingRgbaColorWithDescriptor:(NSAppleEventDescriptor *)descriptor; - (id)scriptingRgbaColorDescriptor; Modified: trunk/NSColor_SKExtensions.m =================================================================== --- trunk/NSColor_SKExtensions.m 2007-09-03 15:23:18 UTC (rev 2815) +++ trunk/NSColor_SKExtensions.m 2007-09-03 17:52:53 UTC (rev 2816) @@ -41,6 +41,15 @@ @implementation NSColor (SKExtensions) ++ (NSColor *)tableBackgroundColor { + static NSColor *tableBackgroundColor = nil; + if (nil == tableBackgroundColor) { + // from Mail.app on 10.4; should be based on control tint? + tableBackgroundColor = [[NSColor colorWithCalibratedRed:231.0f/255.0f green:237.0f/255.0f blue:246.0f/255.0f alpha:1.0] retain]; + } + return tableBackgroundColor; +} + + (id)scriptingRgbaColorWithDescriptor:(NSAppleEventDescriptor *)descriptor { float red, green, blue, alpha = 1.0; switch ([descriptor numberOfItems]) { Modified: trunk/SKThumbnailTableView.m =================================================================== --- trunk/SKThumbnailTableView.m 2007-09-03 15:23:18 UTC (rev 2815) +++ trunk/SKThumbnailTableView.m 2007-09-03 17:52:53 UTC (rev 2816) @@ -39,6 +39,7 @@ #import "SKThumbnailTableView.h" #import "OBUtilities.h" #import "SKTypeSelectHelper.h" +#import "NSColor_SKExtensions.h" static NSString *SKScrollerWillScrollNotification = @"SKScrollerWillScrollNotification"; static NSString *SKScrollerDidScrollNotification = @"SKScrollerDidScrollNotification"; @@ -70,6 +71,10 @@ [super dealloc]; } +- (NSColor *)backgroundColor { + return [NSColor tableBackgroundColor]; +} + - (BOOL)isScrolling { return isScrolling; } - (void)handleScrollerWillScroll:(NSNotification *)note { @@ -100,27 +105,35 @@ } - (void)highlightSelectionInClipRect:(NSRect)clipRect { + NSColor *color = ([[self window] isKeyWindow] && [[self window] firstResponder] == self) ? [NSColor alternateSelectedControlColor] : [NSColor secondarySelectedControlColor]; + int row; + + [NSGraphicsContext saveGraphicsState]; + if ([[self delegate] respondsToSelector:@selector(tableViewHighlightedRows:)]) { NSMutableIndexSet *rowIndexes = [[[self selectedRowIndexes] mutableCopy] autorelease]; NSArray *rows = [[self delegate] tableViewHighlightedRows: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]; - NSColor *bgColor = [NSColor controlBackgroundColor]; for (i = 0; i < count && factor > 0.0; i++) { - int row = [[rows objectAtIndex:i] intValue]; - [[bgColor blendedColorWithFraction:factor ofColor:color] setFill]; + row = [[rows objectAtIndex:i] intValue]; + [[[self backgroundColor] blendedColorWithFraction:factor ofColor:color] setFill]; factor -= 0.1; if ([rowIndexes containsIndex:row] == NO) { NSRectFill([self rectOfRow:row]); [rowIndexes addIndex:row]; } } - [NSGraphicsContext restoreGraphicsState]; } - [super highlightSelectionInClipRect:clipRect]; + + row = [self selectedRow]; + if (row != -1) { + [color setFill]; + NSRectFill([self rectOfRow:row]); + } + + [NSGraphicsContext restoreGraphicsState]; } - (void)mouseDown:(NSEvent *)theEvent { Modified: trunk/SKTocOutlineView.m =================================================================== --- trunk/SKTocOutlineView.m 2007-09-03 15:23:18 UTC (rev 2815) +++ trunk/SKTocOutlineView.m 2007-09-03 17:52:53 UTC (rev 2816) @@ -38,6 +38,7 @@ #import "SKTocOutlineView.h" #import "SKTypeSelectHelper.h" +#import "NSColor_SKExtensions.h" @implementation SKTocOutlineView @@ -48,18 +49,25 @@ [super dealloc]; } +- (NSColor *)backgroundColor { + return [NSColor tableBackgroundColor]; +} + - (void)highlightSelectionInClipRect:(NSRect)clipRect { + NSColor *color = ([[self window] isKeyWindow] && [[self window] firstResponder] == self) ? [NSColor alternateSelectedControlColor] : [NSColor secondarySelectedControlColor]; + int row; + + [NSGraphicsContext saveGraphicsState]; + 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]; + row = [[rows objectAtIndex:i] intValue]; + [[[self backgroundColor] blendedColorWithFraction:factor ofColor:color] set]; factor -= 0.1; if ([rowIndexes containsIndex:row] == NO) { NSRectFill([self rectOfRow:row]); @@ -67,9 +75,15 @@ } if (factor <= 0.0) break; } - [NSGraphicsContext restoreGraphicsState]; } - [super highlightSelectionInClipRect:clipRect]; + + row = [self selectedRow]; + if (row != -1) { + [color setFill]; + NSRectFill([self rectOfRow:row]); + } + + [NSGraphicsContext restoreGraphicsState]; } - (void)removeTrackingRects { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-03 16:25:08
|
Revision: 2813 http://skim-app.svn.sourceforge.net/skim-app/?rev=2813&view=rev Author: hofman Date: 2007-09-03 04:05:21 -0700 (Mon, 03 Sep 2007) Log Message: ----------- Use full path for tools in disk image script. Modified Paths: -------------- trunk/Skim.xcodeproj/project.pbxproj Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-09-03 09:27:10 UTC (rev 2812) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-09-03 11:05:21 UTC (rev 2813) @@ -317,7 +317,7 @@ 45A3BD380B4F097D002B297F /* InitialUserDefaults.plist */ = {isa = PBXFileReference; explicitFileType = text.xml; fileEncoding = 4; path = InitialUserDefaults.plist; sourceTree = "<group>"; }; 45B113BF0B329A7E00DE0660 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; }; 8D15AC360486D014006FF6A4 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; }; - 8D15AC370486D014006FF6A4 /* Skim.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = Skim.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 8D15AC370486D014006FF6A4 /* Skim.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Skim.app; sourceTree = BUILT_PRODUCTS_DIR; }; A489FDBA0BC8E8D100BA14DD /* Italian */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Italian; path = Italian.lproj/InfoWindow.nib; sourceTree = "<group>"; }; A489FDBD0BC8E8DA00BA14DD /* Italian */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Italian; path = Italian.lproj/MainMenu.nib; sourceTree = "<group>"; }; A489FDC00BC8E8DF00BA14DD /* Italian */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Italian; path = Italian.lproj/MainWindow.nib; sourceTree = "<group>"; }; @@ -1324,7 +1324,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "rm -f /tmp/Skim.dmg\nunzip ${SOURCE_ROOT}/Skim.dmg.zip\n/bin/cp ${SOURCE_ROOT}/Skim.dmg /tmp\n/usr/bin/hdiutil attach /tmp/Skim.dmg\n${SYSTEM_DEVELOPER_TOOLS}/CpMac -r ${BUILT_PRODUCTS_DIR}/Skim.app /Volumes/Skim\nosascript -e \"tell application \\\"Finder\\\" to set the position of application file \\\"Skim.app\\\" of disk named \\\"Skim\\\" to {90, 206}\" && \\\nsleep 7; \\\n/usr/sbin/diskutil eject /Volumes/Skim\n/usr/bin/hdiutil resize -size `/usr/bin/hdiutil resize /tmp/Skim.dmg | cut -f -1 -d \" \" -`b /tmp/Skim.dmg\n/usr/bin/hdiutil convert /tmp/Skim.dmg -format UDZO -imagekey zlib-level=9 -o $HOME/Desktop/Skim.dmg\n/usr/bin/hdiutil internet-enable -YES $HOME/Desktop/Skim.dmg\nexit 0"; + shellScript = "/bin/rm -f /tmp/Skim.dmg\n/usr/bin/unzip ${SOURCE_ROOT}/Skim.dmg.zip\n/bin/cp ${SOURCE_ROOT}/Skim.dmg /tmp\n/usr/bin/hdiutil attach /tmp/Skim.dmg\n${SYSTEM_DEVELOPER_TOOLS}/CpMac -r ${BUILT_PRODUCTS_DIR}/Skim.app /Volumes/Skim\n/usr/bin/osascript -e \"tell application \\\"Finder\\\" to set the position of application file \\\"Skim.app\\\" of disk named \\\"Skim\\\" to {90, 206}\" && \\\nsleep 7; \\\n/usr/sbin/diskutil eject /Volumes/Skim\n/usr/bin/hdiutil resize -size `/usr/bin/hdiutil resize /tmp/Skim.dmg | cut -f -1 -d \" \" -`b /tmp/Skim.dmg\n/usr/bin/hdiutil convert /tmp/Skim.dmg -format UDZO -imagekey zlib-level=9 -o $HOME/Desktop/Skim.dmg\n/usr/bin/hdiutil internet-enable -YES $HOME/Desktop/Skim.dmg\nexit 0"; }; CEE1383C0BCEA63F00BF2D3E /* ShellScript */ = { isa = PBXShellScriptBuildPhase; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-03 15:23:25
|
Revision: 2815 http://skim-app.svn.sourceforge.net/skim-app/?rev=2815&view=rev Author: hofman Date: 2007-09-03 08:23:18 -0700 (Mon, 03 Sep 2007) Log Message: ----------- Simplification: add try/catch in a category method. Modified Paths: -------------- trunk/SKTemplateParser.h trunk/SKTemplateParser.m Modified: trunk/SKTemplateParser.h =================================================================== --- trunk/SKTemplateParser.h 2007-09-03 11:09:11 UTC (rev 2814) +++ trunk/SKTemplateParser.h 2007-09-03 15:23:18 UTC (rev 2815) @@ -60,6 +60,7 @@ @interface NSObject (SKTemplateParser) - (NSString *)stringDescription; - (BOOL)isNotEmpty; +- (id)safeValueForKeyPath:(NSString *)keyPath; @end Modified: trunk/SKTemplateParser.m =================================================================== --- trunk/SKTemplateParser.m 2007-09-03 11:09:11 UTC (rev 2814) +++ trunk/SKTemplateParser.m 2007-09-03 15:23:18 UTC (rev 2815) @@ -210,9 +210,7 @@ if ([scanner scanString:SINGLETAG_CLOSE_DELIM intoString:nil]) { // simple template tag - @try{ keyValue = [object valueForKeyPath:tag]; } - @catch (id exception) { keyValue = nil; } - if (keyValue != nil) + if (keyValue = [object safeValueForKeyPath:tag]) [result appendString:[keyValue stringDescription]]; } else if ([scanner scanString:MULTITAG_CLOSE_DELIM intoString:nil]) { @@ -249,8 +247,7 @@ lastItemTemplate = nil; } - @try{ keyValue = [object valueForKeyPath:tag]; } - @catch (id exception) { keyValue = nil; } + keyValue = [object safeValueForKeyPath:tag]; if ([keyValue respondsToSelector:@selector(objectEnumerator)]) { NSEnumerator *itemE = [keyValue objectEnumerator]; id nextItem, item = [itemE nextObject]; @@ -334,8 +331,7 @@ } [subTemplates addObject:subTemplate]; - @try{ keyValue = [object valueForKeyPath:tag]; } - @catch (id exception) { keyValue = nil; } + keyValue = [object safeValueForKeyPath:tag]; count = [matchStrings count]; subTemplate = nil; for (i = 0; i < count; i++) { @@ -415,9 +411,7 @@ if ([scanner scanString:SINGLETAG_CLOSE_DELIM intoString:nil]) { // simple template tag - @try{ keyValue = [object valueForKeyPath:tag]; } - @catch (id exception) { keyValue = nil; } - if (keyValue != nil) { + if (keyValue = [object safeValueForKeyPath:tag]) { if ([keyValue isKindOfClass:[NSAttributedString class]]) { tmpAttrStr = [[NSAttributedString alloc] initWithAttributedString:keyValue attributes:attr]; } else { @@ -461,8 +455,7 @@ lastItemTemplate = nil; } - @try{ keyValue = [object valueForKeyPath:tag]; } - @catch (id exception) { keyValue = nil; } + keyValue = [object safeValueForKeyPath:tag]; if ([keyValue respondsToSelector:@selector(objectEnumerator)]) { NSEnumerator *itemE = [keyValue objectEnumerator]; id nextItem, item = [itemE nextObject]; @@ -549,8 +542,7 @@ [subTemplates addObject:subTemplate]; - @try{ keyValue = [object valueForKeyPath:tag]; } - @catch (id exception) { keyValue = nil; } + keyValue = [object safeValueForKeyPath:tag]; count = [matchStrings count]; subTemplate = nil; for (i = 0; i < count; i++) { @@ -614,6 +606,13 @@ return YES; } +- (id)safeValueForKeyPath:(NSString *)keyPath { + id value = nil; + @try{ value = [self valueForKeyPath:keyPath]; } + @catch (id exception) { value = nil; } + return value; +} + @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-09-03 14:54:28
|
Revision: 2810 http://skim-app.svn.sourceforge.net/skim-app/?rev=2810&view=rev Author: hofman Date: 2007-09-03 02:25:46 -0700 (Mon, 03 Sep 2007) Log Message: ----------- Resize disk image Modified Paths: -------------- trunk/Skim.dmg.zip Modified: trunk/Skim.dmg.zip =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-03 14:37:04
|
Revision: 2814 http://skim-app.svn.sourceforge.net/skim-app/?rev=2814&view=rev Author: hofman Date: 2007-09-03 04:09:11 -0700 (Mon, 03 Sep 2007) Log Message: ----------- Update version number for help. Luckily this is not used. Note to self: don't use version control from Xcode for critical updates. Modified Paths: -------------- trunk/Dutch.lproj/Skim Help/version.texi trunk/French.lproj/Skim Help/version.texi trunk/Italian.lproj/Skim Help/version.texi Modified: trunk/Dutch.lproj/Skim Help/version.texi =================================================================== --- trunk/Dutch.lproj/Skim Help/version.texi 2007-09-03 11:05:21 UTC (rev 2813) +++ trunk/Dutch.lproj/Skim Help/version.texi 2007-09-03 11:09:11 UTC (rev 2814) @@ -1 +1 @@ -@set VERSION 0.7 +@set VERSION 0.8 Modified: trunk/French.lproj/Skim Help/version.texi =================================================================== --- trunk/French.lproj/Skim Help/version.texi 2007-09-03 11:05:21 UTC (rev 2813) +++ trunk/French.lproj/Skim Help/version.texi 2007-09-03 11:09:11 UTC (rev 2814) @@ -1 +1 @@ -@set VERSION 0.7 +@set VERSION 0.8 Modified: trunk/Italian.lproj/Skim Help/version.texi =================================================================== --- trunk/Italian.lproj/Skim Help/version.texi 2007-09-03 11:05:21 UTC (rev 2813) +++ trunk/Italian.lproj/Skim Help/version.texi 2007-09-03 11:09:11 UTC (rev 2814) @@ -1 +1 @@ -@set VERSION 0.7 +@set VERSION 0.8 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-03 11:46:28
|
Revision: 2812 http://skim-app.svn.sourceforge.net/skim-app/?rev=2812&view=rev Author: hofman Date: 2007-09-03 02:27:10 -0700 (Mon, 03 Sep 2007) Log Message: ----------- Tag for release Added Paths: ----------- tags/REL_0_8/ Copied: tags/REL_0_8 (from rev 2811, trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-03 10:10:15
|
Revision: 2811 http://skim-app.svn.sourceforge.net/skim-app/?rev=2811&view=rev Author: hofman Date: 2007-09-03 02:26:36 -0700 (Mon, 03 Sep 2007) Log Message: ----------- Bump version number and update release notes for release. Modified Paths: -------------- trunk/Dutch.lproj/InfoPlist.strings trunk/English.lproj/InfoPlist.strings trunk/English.lproj/Skim Help/version.texi trunk/French.lproj/InfoPlist.strings trunk/Info.plist trunk/Italian.lproj/InfoPlist.strings trunk/ReleaseNotes.rtf trunk/Skim.xcodeproj/project.pbxproj Modified: trunk/Dutch.lproj/InfoPlist.strings =================================================================== (Binary files differ) Modified: trunk/English.lproj/InfoPlist.strings =================================================================== (Binary files differ) Modified: trunk/English.lproj/Skim Help/version.texi =================================================================== --- trunk/English.lproj/Skim Help/version.texi 2007-09-03 09:25:46 UTC (rev 2810) +++ trunk/English.lproj/Skim Help/version.texi 2007-09-03 09:26:36 UTC (rev 2811) @@ -1 +1 @@ -@set VERSION 0.7 +@set VERSION 0.8 Modified: trunk/French.lproj/InfoPlist.strings =================================================================== (Binary files differ) Modified: trunk/Info.plist =================================================================== --- trunk/Info.plist 2007-09-03 09:25:46 UTC (rev 2810) +++ trunk/Info.plist 2007-09-03 09:26:36 UTC (rev 2811) @@ -357,11 +357,11 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>0.7</string> + <string>0.8</string> <key>CFBundleSignature</key> <string>SKim</string> <key>CFBundleVersion</key> - <string>v10</string> + <string>v11</string> <key>LSMinimumSystemVersion</key> <string>10.4.0</string> <key>NSAppleScriptEnabled</key> Modified: trunk/Italian.lproj/InfoPlist.strings =================================================================== (Binary files differ) Modified: trunk/ReleaseNotes.rtf =================================================================== --- trunk/ReleaseNotes.rtf 2007-09-03 09:25:46 UTC (rev 2810) +++ trunk/ReleaseNotes.rtf 2007-09-03 09:26:36 UTC (rev 2811) @@ -1,7 +1,6 @@ {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 -{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fnil\fcharset77 LucidaGrande;\f2\fnil\fcharset77 LucidaSans-Typewriter; -\f3\fswiss\fcharset77 Helvetica-Bold;\f4\fswiss\fcharset77 Helvetica-BoldOblique;\f5\fnil\fcharset77 LucidaGrande-Bold; -} +{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fnil\fcharset77 LucidaGrande;\f2\fswiss\fcharset77 Helvetica-Bold; +\f3\fswiss\fcharset77 Helvetica-BoldOblique;\f4\fnil\fcharset77 LucidaGrande-Bold;} {\colortbl;\red255\green255\blue255;} {\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid1} {\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid2} @@ -114,18 +113,14 @@ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\fs22 \cf0 \ -Last update: 2 September 2007 (rev -\f2\fs20 2806) -\f1\fs22 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\b\fs28 \cf0 \ -Changes since 0.7\ +\f2\b\fs28 \cf0 Changes since 0.7\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\fs26 \cf0 New Features\ +\f3\i\fs26 \cf0 New Features\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls1\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Hold down Shift key while moving the end points of a line to restrict the angle of a line to multiples of 45 degrees.\ @@ -140,12 +135,13 @@ {\listtext \'a5 }Added tool-tips in the note table.\ {\listtext \'a5 }Added a link to the Wiki in the Help menu.\ {\listtext \'a5 }New hidden default to add the Skim creator code to files it saves. Setting this can cause PDFs saved by Skim to be opened by Skim.\ +{\listtext \'a5 }New hidden defaults for the default size of new notes.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\f3\b\fs28 \cf0 \ +\f2\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\fs26 \cf0 Bugs Fixed\ +\f3\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls2\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Add white outline to magnify cursors so they are visible on a dark background.\ @@ -162,13 +158,13 @@ {\listtext \'a5 }The toolbar items to add notes now can be clicked using the spacebar when selected.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\b\fs28 \cf0 \ +\f2\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 -\f4\i\fs26 \cf0 New Features\ +\f3\i\fs26 \cf0 New Features\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls3\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }You can now resize all rows of the notes table to view the full text.\ @@ -189,10 +185,10 @@ {\listtext \'a5 }Some interface improvements.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\f3\b\fs28 \cf0 \ +\f2\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\fs26 \cf0 Bugs Fixed\ +\f3\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls4\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Fix spell checking freeze for single page PDFs.\ @@ -218,12 +214,12 @@ \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\b\fs28 \cf0 Changes since 0.6\ +\f2\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\ +\f3\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls5\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Fix updater.\ @@ -235,12 +231,12 @@ \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\b\fs28 \cf0 Changes since 0.5.1\ +\f2\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 -\f4\i\fs26 \cf0 New Features\ +\f3\i\fs26 \cf0 New Features\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls8\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Default print settings automatically choose landscape for wide pages.\ @@ -256,10 +252,10 @@ {\listtext \'a5 }Added French localization. (Thanks Corentin Cras-M\'8eneur!)\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\f3\b\fs28 \cf0 \ +\f2\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\fs26 \cf0 Bugs Fixed\ +\f3\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls10\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Correct display of zero line width in Line inspector panel.\ @@ -278,14 +274,14 @@ {\listtext \'a5 }Ignore empty Spotlight search text.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\f3\b\fs28 \cf0 \ +\f2\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \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 -\f4\i\fs26 \cf0 New Features\ +\f3\i\fs26 \cf0 New Features\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls12\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Added some more sorting keys for use in text export templates.\ @@ -300,10 +296,10 @@ \ls14\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 -\f3\b\fs28 \cf0 \ +\f2\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\fs26 \cf0 Bugs Fixed\ +\f3\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls15\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Prevent chaching of update info for updater.\ @@ -320,13 +316,13 @@ {\listtext \'a5 }Fix full screen window layout when the full screen window moves to another screen.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\b\fs28 \cf0 \ +\f2\b\fs28 \cf0 \ Changes since 0.4.1\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\fs26 \cf0 New Features\ +\f3\i\fs26 \cf0 New Features\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls16\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }You can now hide all notes and highlights.\ @@ -362,10 +358,10 @@ {\listtext \'a5 }New color swatch toolbar control to easily use a few default colors.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\f3\b\fs28 \cf0 \ +\f2\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\fs26 \cf0 Bugs Fixed\ +\f3\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls21\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.\ @@ -393,22 +389,22 @@ {\listtext \'a5 }The rotation of text notes is now saved.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\b\fs28 \cf0 \ +\f2\b\fs28 \cf0 \ Changes since 0.4\ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\fs26 \cf0 Bugs Fixed\ +\f3\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls23\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Fixed installation of new versions by updater.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\b\fs28 \cf0 \ +\f2\b\fs28 \cf0 \ Changes since 0.3\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\f4\i\fs26 \cf0 \ +\f3\i\fs26 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 New Features\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural @@ -458,10 +454,10 @@ \ls45\ilvl0\cf0 {\listtext \'a5 }You can now supply templates for text export of notes. See the wiki for more information.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\f3\b\fs28 \cf0 \ +\f2\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\fs26 \cf0 Bugs Fixed\ +\f3\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls46\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Fix links in help.\ @@ -483,12 +479,12 @@ \ls54\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 \ls54\ilvl0 -\f3\b\fs28 \cf0 \ +\f2\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 Changes since 0.2\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\f4\i\fs26 \cf0 \ +\f3\i\fs26 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 New Features\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural @@ -562,10 +558,10 @@ \ls87\ilvl0\cf0 {\listtext \'a5 }New tool modes for ading notes or highlights.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\f3\b\fs28 \cf0 \ +\f2\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\fs26 \cf0 Bugs Fixed\ +\f3\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls88\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }We now don't edit new text notes, so they can be moved, resized or deleted.\ @@ -603,11 +599,11 @@ \ls104\ilvl0\cf0 {\listtext \'a5 }Lazy updating of page thumbnails to avoid slowdown when opening a file.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\b\fs28 \cf0 \ +\f2\b\fs28 \cf0 \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f0\b0\fs48 \cf0 Colofon -\f3\b\fs28 \ +\f2\b\fs28 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural @@ -618,7 +614,7 @@ \fs22 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f3\b\fs28 \cf0 About Skim\ +\f2\b\fs28 \cf0 About Skim\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\b0\fs22 \cf0 \ @@ -626,7 +622,7 @@ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\b\fs26 \cf0 Web Site\ +\f3\i\b\fs26 \cf0 Web Site\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\i0\b0\fs22 \cf0 \ @@ -634,7 +630,7 @@ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\b\fs26 \cf0 Getting Help\ +\f3\i\b\fs26 \cf0 Getting Help\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\i0\b0\fs22 \cf0 \ @@ -642,11 +638,11 @@ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural -\f4\i\b\fs26 \cf0 Reporting Bugs\ +\f3\i\b\fs26 \cf0 Reporting Bugs\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\i0\b0\fs22 \cf0 \ Bug reports should be submitted to the {\field{\*\fldinst{HYPERLINK "http://sourceforge.net/tracker/?group_id=192583&atid=941981"}}{\fldrslt bug tracker}} on SourceForge. -\f5\b Note: +\f4\b Note: \f1\b0 If you can, please assign the bug report to someone - if you don't personally know any developers, assign the bug to Mike (username mmcc). If you don't assign the bug to someone, nobody may notice it for a long time. Assigning it to someone sends them an email notification.\ } \ No newline at end of file Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-09-03 09:25:46 UTC (rev 2810) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-09-03 09:26:36 UTC (rev 2811) @@ -317,7 +317,7 @@ 45A3BD380B4F097D002B297F /* InitialUserDefaults.plist */ = {isa = PBXFileReference; explicitFileType = text.xml; fileEncoding = 4; path = InitialUserDefaults.plist; sourceTree = "<group>"; }; 45B113BF0B329A7E00DE0660 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; }; 8D15AC360486D014006FF6A4 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; }; - 8D15AC370486D014006FF6A4 /* Skim.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Skim.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 8D15AC370486D014006FF6A4 /* Skim.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = Skim.app; sourceTree = BUILT_PRODUCTS_DIR; }; A489FDBA0BC8E8D100BA14DD /* Italian */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Italian; path = Italian.lproj/InfoWindow.nib; sourceTree = "<group>"; }; A489FDBD0BC8E8DA00BA14DD /* Italian */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Italian; path = Italian.lproj/MainMenu.nib; sourceTree = "<group>"; }; A489FDC00BC8E8DF00BA14DD /* Italian */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Italian; path = Italian.lproj/MainWindow.nib; sourceTree = "<group>"; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-02 20:10:54
|
Revision: 2809 http://skim-app.svn.sourceforge.net/skim-app/?rev=2809&view=rev Author: hofman Date: 2007-09-02 13:10:46 -0700 (Sun, 02 Sep 2007) Log Message: ----------- Fix typo in plist. Modified Paths: -------------- trunk/InitialUserDefaults.plist Modified: trunk/InitialUserDefaults.plist =================================================================== --- trunk/InitialUserDefaults.plist 2007-09-02 19:08:57 UTC (rev 2808) +++ trunk/InitialUserDefaults.plist 2007-09-02 20:10:46 UTC (rev 2809) @@ -201,11 +201,11 @@ BAt0eXBlZHN0cmVhbYED6IQBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWE AWMBhARmZmZmAQABAYY= </data> + </array> <key>SKDefaultNoteWidth</key> <real>128.0</real> <key>SKDefaultNoteHeight</key> <real>64.0</real> - </array> <key>SKActivateFullScreenNavigationAtBottom</key> <false/> <key>SKActivatePresentationNavigationAtBottom</key> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-09-02 19:09:05
|
Revision: 2808 http://skim-app.svn.sourceforge.net/skim-app/?rev=2808&view=rev Author: hofman Date: 2007-09-02 12:08:57 -0700 (Sun, 02 Sep 2007) Log Message: ----------- Add hidden defaults for default size of new notes. Modified Paths: -------------- trunk/InitialUserDefaults.plist trunk/SKPDFAnnotationNote.m trunk/SKPDFView.m trunk/SKStringConstants.h trunk/SKStringConstants.m Modified: trunk/InitialUserDefaults.plist =================================================================== --- trunk/InitialUserDefaults.plist 2007-09-02 18:47:52 UTC (rev 2807) +++ trunk/InitialUserDefaults.plist 2007-09-02 19:08:57 UTC (rev 2808) @@ -201,6 +201,10 @@ BAt0eXBlZHN0cmVhbYED6IQBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWE AWMBhARmZmZmAQABAYY= </data> + <key>SKDefaultNoteWidth</key> + <real>128.0</real> + <key>SKDefaultNoteHeight</key> + <real>64.0</real> </array> <key>SKActivateFullScreenNavigationAtBottom</key> <false/> Modified: trunk/SKPDFAnnotationNote.m =================================================================== --- trunk/SKPDFAnnotationNote.m 2007-09-02 18:47:52 UTC (rev 2807) +++ trunk/SKPDFAnnotationNote.m 2007-09-02 19:08:57 UTC (rev 2808) @@ -380,6 +380,8 @@ NSScriptCommand *currentCommand = [NSScriptCommand currentCommand]; if ([currentCommand isKindOfClass:[NSCreateCommand class]]) { unsigned long classCode = [[(NSCreateCommand *)currentCommand createClassDescription] appleEventCode]; + float defaultWidth = [[NSUserDefaults standardUserDefaults] floatForKey:SKDefaultNoteWidthKey]; + float defaultHeight = [[NSUserDefaults standardUserDefaults] floatForKey:SKDefaultNoteHeightKey]; if (classCode == 'Note') { @@ -411,15 +413,15 @@ } } } else if (type == SKASTextNote) { - self = [[SKPDFAnnotationFreeText alloc] initWithBounds:NSMakeRect(100.0, 100.0, 64.0, 64.0)]; + self = [[SKPDFAnnotationFreeText alloc] initWithBounds:NSMakeRect(100.0, 100.0, defaultWidth, defaultHeight)]; } else if (type == SKASAnchoredNote) { self = [[SKPDFAnnotationNote alloc] initWithBounds:NSMakeRect(100.0, 100.0, 16.0, 16.0)]; } else if (type == SKASCircleNote) { - self = [[SKPDFAnnotationCircle alloc] initWithBounds:NSMakeRect(100.0, 100.0, 64.0, 64.0)]; + self = [[SKPDFAnnotationCircle alloc] initWithBounds:NSMakeRect(100.0, 100.0, defaultWidth, defaultHeight)]; } else if (type == SKASSquareNote) { - self = [[SKPDFAnnotationSquare alloc] initWithBounds:NSMakeRect(100.0, 100.0, 64.0, 64.0)]; + self = [[SKPDFAnnotationSquare alloc] initWithBounds:NSMakeRect(100.0, 100.0, defaultWidth, defaultHeight)]; } else if (type == SKASLineNote) { - self = [[SKPDFAnnotationLine alloc] initWithBounds:NSMakeRect(100.0, 100.0, 16.0, 16.0)]; + self = [[SKPDFAnnotationLine alloc] initWithBounds:NSMakeRect(100.0, 100.0, defaultWidth, defaultHeight)]; } } } Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-09-02 18:47:52 UTC (rev 2807) +++ trunk/SKPDFView.m 2007-09-02 19:08:57 UTC (rev 2808) @@ -70,6 +70,8 @@ NSString *SKSkimNotePboardType = @"SKSkimNotePboardType"; +#define ANCHORED_NOTE_SIZE SKMakeSquareSize(16.0) + static CGMutablePathRef SKCGCreatePathWithRoundRectInRect(CGRect rect, float radius); static void SKCGContextDrawGrabHandle(CGContextRef context, CGPoint point, float radius); @@ -823,7 +825,9 @@ // Convert to "page space". center = SKIntegralPoint([self convertPoint: center toPage: page]); - NSSize defaultSize = isAlternate ? SKMakeSquareSize(16.0) : ([page rotation] % 180 == 90) ? NSMakeSize(64.0, 128.0) : NSMakeSize(128.0, 64.0); + float defaultWidth = [[NSUserDefaults standardUserDefaults] floatForKey:SKDefaultNoteWidthKey]; + float defaultHeight = [[NSUserDefaults standardUserDefaults] floatForKey:SKDefaultNoteHeightKey]; + NSSize defaultSize = isAlternate ? ANCHORED_NOTE_SIZE : ([page rotation] % 180 == 0) ? NSMakeSize(defaultWidth, defaultHeight) : NSMakeSize(defaultHeight, defaultWidth); NSRect bounds = SKRectFromCenterAndSize(center, defaultSize); bounds = SKConstrainRect(bounds, [page boundsForBox:[self displayBox]]); @@ -1689,10 +1693,12 @@ if (annotationType == SKCircleNote || annotationType == SKSquareNote) bounds = NSInsetRect(bounds, -5.0, -5.0); } else { - NSSize defaultSize = (annotationType == SKAnchoredNote) ? SKMakeSquareSize(16.0) : ([page rotation] % 180 == 90) ? NSMakeSize(64.0, 128.0) : NSMakeSize(128.0, 64.0); + float defaultWidth = [[NSUserDefaults standardUserDefaults] floatForKey:SKDefaultNoteWidthKey]; + float defaultHeight = [[NSUserDefaults standardUserDefaults] floatForKey:SKDefaultNoteHeightKey]; + NSSize defaultSize = (annotationType == SKAnchoredNote) ? ANCHORED_NOTE_SIZE : ([page rotation] % 180 == 0) ? NSMakeSize(defaultWidth, defaultHeight) : NSMakeSize(defaultHeight, defaultWidth); point = [self convertPoint:point toPage:page]; - bounds = NSMakeRect(point.x - 0.5 * defaultSize.width, point.y - 0.5 * defaultSize.height, defaultSize.width, defaultSize.height); + bounds = SKRectFromCenterAndSize(point, defaultSize); } // Make sure it fits in the page @@ -1721,7 +1727,7 @@ NSBeep(); return; } else { - NSSize defaultSize = (annotationType == SKAnchoredNote) ? SKMakeSquareSize(16.0) : NSMakeSize(128.0, 64.0); + // First try the current mouse position NSPoint center = [self convertPoint:[[self window] mouseLocationOutsideOfEventStream] fromView:nil]; @@ -1734,11 +1740,13 @@ center = SKCenterPoint(viewFrame); page = [self pageForPoint: center nearest: YES]; } + + float defaultWidth = [[NSUserDefaults standardUserDefaults] floatForKey:SKDefaultNoteWidthKey]; + float defaultHeight = [[NSUserDefaults standardUserDefaults] floatForKey:SKDefaultNoteHeightKey]; + NSSize defaultSize = (annotationType == SKAnchoredNote) ? ANCHORED_NOTE_SIZE : ([page rotation] % 180 == 0) ? NSMakeSize(defaultWidth, defaultHeight) : NSMakeSize(defaultHeight, defaultWidth); // Convert to "page space". center = SKIntegralPoint([self convertPoint: center toPage: page]); - if ([page rotation] % 180 == 90) - defaultSize = NSMakeSize(defaultSize.height, defaultSize.width); bounds = SKRectFromCenterAndSize(center, defaultSize); // Make sure it fits in the page @@ -2759,8 +2767,8 @@ NSPointInRect(pagePoint, [page boundsForBox:[self displayBox]])) { // add a new annotation immediately, unless this is just a click if (annotationMode == SKAnchoredNote || NSLeftMouseDragged == [[NSApp nextEventMatchingMask:(NSLeftMouseUpMask | NSLeftMouseDraggedMask) untilDate:[NSDate distantFuture] inMode:NSDefaultRunLoopMode dequeue:NO] type]) { - float width = annotationMode == SKAnchoredNote ? 16.0 : annotationMode == SKLineNote ? 4.0 : 8.0; - NSRect bounds = NSMakeRect(pagePoint.x - floorf(0.5 * width), pagePoint.y - floorf(0.5 * width), width, width); + NSSize size = annotationMode == SKAnchoredNote ? ANCHORED_NOTE_SIZE : annotationMode == SKLineNote ? SKMakeSquareSize(4.0) : SKMakeSquareSize(8.0); + NSRect bounds = SKRectFromCenterAndSize(pagePoint, size); [[self undoManager] beginUndoGrouping]; didBeginUndoGrouping = YES; [self addAnnotationWithType:annotationMode contents:nil page:page bounds:bounds]; Modified: trunk/SKStringConstants.h =================================================================== --- trunk/SKStringConstants.h 2007-09-02 18:47:52 UTC (rev 2807) +++ trunk/SKStringConstants.h 2007-09-02 19:08:57 UTC (rev 2808) @@ -91,6 +91,8 @@ extern NSString *SKLineNoteDashPatternKey; extern NSString *SKLineNoteStartLineStyleKey; extern NSString *SKLineNoteEndLineStyleKey; +extern NSString *SKDefaultNoteWidthKey; +extern NSString *SKDefaultNoteHeightKey; extern NSString *SKSwatchColorsKey; extern NSString *SKDefaultPDFDisplaySettingsKey; extern NSString *SKDefaultFullScreenPDFDisplaySettingsKey; Modified: trunk/SKStringConstants.m =================================================================== --- trunk/SKStringConstants.m 2007-09-02 18:47:52 UTC (rev 2807) +++ trunk/SKStringConstants.m 2007-09-02 19:08:57 UTC (rev 2808) @@ -92,6 +92,8 @@ NSString *SKLineNoteLineStyleKey = @"SKLineNoteLineStyle"; NSString *SKLineNoteStartLineStyleKey = @"SKLineNoteStartLineStyle"; NSString *SKLineNoteEndLineStyleKey = @"SKLineNoteEndLineStyle"; +NSString *SKDefaultNoteWidthKey = @"SKDefaultNoteWidth"; +NSString *SKDefaultNoteHeightKey = @"SKDefaultNoteHeight"; NSString *SKSwatchColorsKey = @"SKSwatchColors"; NSString *SKDefaultPDFDisplaySettingsKey = @"SKDefaultPDFDisplaySettings"; NSString *SKDefaultFullScreenPDFDisplaySettingsKey = @"SKDefaultFullScreenPDFDisplaySettings"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |