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-05-24 00:16:27
|
Revision: 2132 http://skim-app.svn.sourceforge.net/skim-app/?rev=2132&view=rev Author: hofman Date: 2007-05-23 17:16:26 -0700 (Wed, 23 May 2007) Log Message: ----------- Pass bytesPerRow to prevent padding row data. Modified Paths: -------------- trunk/NSBitmapImageRep_SKExtensions.m Modified: trunk/NSBitmapImageRep_SKExtensions.m =================================================================== --- trunk/NSBitmapImageRep_SKExtensions.m 2007-05-23 21:57:28 UTC (rev 2131) +++ trunk/NSBitmapImageRep_SKExtensions.m 2007-05-24 00:16:26 UTC (rev 2132) @@ -168,8 +168,8 @@ isPlanar:NO colorSpaceName:NSCalibratedRGBColorSpace bitmapFormat:0 - bytesPerRow:0 - bitsPerPixel:32]; + bytesPerRow:NSWidth(bounds) * NUMBER_OF_SAMPLES + bitsPerPixel:8 * NUMBER_OF_SAMPLES]; if (self) { [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithBitmapImageRep:self]]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Christiaan H. <cmh...@gm...> - 2007-05-23 22:05:14
|
This doesn't work. It gets a larger rect. Christiaan On 5/23/07, ama...@us... <ama...@us...> wrote: > > Revision: 2129 > http://skim-app.svn.sourceforge.net/skim-app/?rev=2129&view=rev > Author: amaxwell > Date: 2007-05-23 14:12:41 -0700 (Wed, 23 May 2007) > > Log Message: > ----------- > Access bitmap data directly to get pixel values instead of going through > -[NSBitmapImageRep getPixel:atX:y], which is slowed by caching and locking > overhead. > > Modified Paths: > -------------- > trunk/NSBitmapImageRep_SKExtensions.m > > Modified: trunk/NSBitmapImageRep_SKExtensions.m > =================================================================== > --- trunk/NSBitmapImageRep_SKExtensions.m 2007-05-23 20:39:46 UTC > (rev 2128) > +++ trunk/NSBitmapImageRep_SKExtensions.m 2007-05-23 21:12:41 UTC > (rev 2129) > @@ -55,34 +55,50 @@ > return NO; > } > > +static void getRGBAPixelFromBitmapData(const unsigned char *data, > unsigned int widthInPixels, int x, int y, unsigned int pixel[]) > +{ > + typedef struct _RGBAPixel { > + unsigned char redByte, greenByte, blueByte, alphaByte; > + } RGBAPixel; > + > + RGBAPixel *bitmapData = (RGBAPixel *)data; > + > + RGBAPixel *thisPixel = &(bitmapData[widthInPixels * y + x]); > + pixel[0] = thisPixel->redByte; > + pixel[1] = thisPixel->greenByte; > + pixel[2] = thisPixel->blueByte; > + pixel[3] = thisPixel->alphaByte; > +} > + > +// we're presently only using this with RGBA; if it ever needs to be > generalized, use samplesPerPixel and add a wrapper function and more > implementations; define instead of constant so the arrays show up in the > debugger > +#define NUMBER_OF_SAMPLES 4 > + > - (NSRect)foregroundRect; > { > int i, iMax = [self pixelsWide] - MARGIN; > int j, jMax = [self pixelsHigh] - MARGIN; > > - unsigned int samplesPerPixel = [self samplesPerPixel]; > - unsigned int pixel[samplesPerPixel]; > - memset(pixel, 0, samplesPerPixel); > + unsigned int samplesPerPixel = NUMBER_OF_SAMPLES; > + unsigned int pixel[NUMBER_OF_SAMPLES]; > + memset(pixel, 0, NUMBER_OF_SAMPLES); > > int iLeft = iMax; > int jTop = jMax; > int iRight = MARGIN - 1; > int jBottom = MARGIN - 1; > > - unsigned int backgroundPixel[samplesPerPixel]; > - [self getPixel:backgroundPixel atX:MIN(MARGIN, iMax) y:MIN(MARGIN, > jMax)]; > + const unsigned char *bitmapData = [self bitmapData]; > + unsigned widthInPixels = [self pixelsWide]; > + > + unsigned int backgroundPixel[NUMBER_OF_SAMPLES]; > + getRGBAPixelFromBitmapData(bitmapData, widthInPixels, MIN(MARGIN, > iMax), MIN(MARGIN, jMax), backgroundPixel); > > // basic idea borrowed from ImageMagick's statistics.c implementation > > - /* > - bitmap pixels appear to be ordered top to bottom; this is not > documented rdar://problem/5222982 > - http://www.cocoabuilder.com/archive/message/cocoa/2007/5/22/183540indicates that it may be image-dependent > - */ > - > // top margin > for (j = MARGIN; j < jTop; j++) { > for (i = MARGIN; i < iMax; i++) { > - [self getPixel:pixel atX:i y:j]; > + getRGBAPixelFromBitmapData(bitmapData, widthInPixels, i, j, > pixel); > if (differentPixels(pixel, backgroundPixel, samplesPerPixel)) > { > // keep in mind that we're manipulating corner points, > not height/width > jTop = j; // final > @@ -101,7 +117,7 @@ > // bottom margin > for (j = jMax - 1; j > jBottom; j--) { > for (i = MARGIN; i < iMax; i++) { > - [self getPixel:pixel atX:i y:j]; > + getRGBAPixelFromBitmapData(bitmapData, widthInPixels, i, j, > pixel); > if (differentPixels(pixel, backgroundPixel, samplesPerPixel)) > { > jBottom = j; // final > if (iLeft > i) > @@ -116,7 +132,7 @@ > // left margin > for (i = MARGIN; i < iLeft; i++) { > for (j = jTop; j <= jBottom; j++) { > - [self getPixel:pixel atX:i y:j]; > + getRGBAPixelFromBitmapData(bitmapData, widthInPixels, i, j, > pixel); > if (differentPixels(pixel, backgroundPixel, samplesPerPixel)) > { > iLeft = i; // final > break; > @@ -127,7 +143,7 @@ > // right margin > for (i = iMax - 1; i > iRight; i--) { > for (j = jTop; j <= jBottom; j++) { > - [self getPixel:pixel atX:i y:j]; > + getRGBAPixelFromBitmapData(bitmapData, widthInPixels, i, j, > pixel); > if (differentPixels(pixel, backgroundPixel, samplesPerPixel)) > { > iRight = i; // final > break; > @@ -147,7 +163,7 @@ > pixelsWide:NSWidth(bounds) > pixelsHigh:NSHeight(bounds) > bitsPerSample:8 > - samplesPerPixel:4 > + samplesPerPixel:NUMBER_OF_SAMPLES > hasAlpha:YES > isPlanar:NO > colorSpaceName:NSCalibratedRGBColorSpace > > > This was sent by the SourceForge.net collaborative development platform, > the world's largest Open Source development site. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Skim-app-commit mailing list > Ski...@li... > https://lists.sourceforge.net/lists/listinfo/skim-app-commit > |
From: <ho...@us...> - 2007-05-23 21:57:39
|
Revision: 2131 http://skim-app.svn.sourceforge.net/skim-app/?rev=2131&view=rev Author: hofman Date: 2007-05-23 14:57:28 -0700 (Wed, 23 May 2007) Log Message: ----------- Don't release imageRep too early. Modified Paths: -------------- trunk/PDFPage_SKExtensions.m Modified: trunk/PDFPage_SKExtensions.m =================================================================== --- trunk/PDFPage_SKExtensions.m 2007-05-23 21:14:15 UTC (rev 2130) +++ trunk/PDFPage_SKExtensions.m 2007-05-23 21:57:28 UTC (rev 2131) @@ -74,7 +74,6 @@ NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithPDFPage:self forBox:kPDFDisplayBoxMediaBox]; NSRect r = imageRep ? [imageRep foregroundRect] : NSZeroRect; NSRect b = [self boundsForBox:kPDFDisplayBoxMediaBox]; - [imageRep release]; if (imageRep == nil) { r = b; } else if (NSEqualRects(NSZeroRect, r)) { @@ -83,6 +82,7 @@ r.origin.x += NSMinX(b); r.origin.y += NSMinY(b); } + [imageRep release]; r = NSIntersectionRect(NSInsetRect(r, -FOREGROUND_BOX_MARGIN, -FOREGROUND_BOX_MARGIN), b); rectValue = [NSValue valueWithRect:r]; CFDictionarySetValue(_bboxCache, (void *)self, (void *)rectValue); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ama...@us...> - 2007-05-23 21:14:16
|
Revision: 2130 http://skim-app.svn.sourceforge.net/skim-app/?rev=2130&view=rev Author: amaxwell Date: 2007-05-23 14:14:15 -0700 (Wed, 23 May 2007) Log Message: ----------- Remove autoCrop and add functionality for cropping all pages automatically if the hidden default is set and nothing is selected. This gets rid of the annoying page layout problems, and is now reasonably fast. Modified Paths: -------------- trunk/PDFPage_SKExtensions.h trunk/PDFPage_SKExtensions.m trunk/SKMainWindowController.m trunk/SKPDFView.m Modified: trunk/PDFPage_SKExtensions.h =================================================================== --- trunk/PDFPage_SKExtensions.h 2007-05-23 21:12:41 UTC (rev 2129) +++ trunk/PDFPage_SKExtensions.h 2007-05-23 21:14:15 UTC (rev 2130) @@ -44,7 +44,6 @@ @interface PDFPage (SKExtensions) - (NSRect)foregroundBox; -- (void)autoCrop; - (NSImage *)image; - (NSImage *)imageForBox:(PDFDisplayBox)box; - (NSImage *)thumbnailWithSize:(float)size forBox:(PDFDisplayBox)box; Modified: trunk/PDFPage_SKExtensions.m =================================================================== --- trunk/PDFPage_SKExtensions.m 2007-05-23 21:12:41 UTC (rev 2129) +++ trunk/PDFPage_SKExtensions.m 2007-05-23 21:14:15 UTC (rev 2130) @@ -53,19 +53,16 @@ #define FOREGROUND_BOX_MARGIN 10.0 // A subclass with ivars would be nicer in some respects, but that would require subclassing PDFDocument and returning instances of the subclass for each page. -static CFMutableDictionaryRef _bboxTable = NULL; -static CFMutableSetRef _croppedPages = NULL; +static CFMutableDictionaryRef _bboxCache = NULL; static IMP originalDealloc = NULL; + (void)load { originalDealloc = OBReplaceMethodImplementationWithSelector(self, @selector(dealloc), @selector(replacementDealloc)); - _bboxTable = CFDictionaryCreateMutable(NULL, 0, NULL, &kCFTypeDictionaryValueCallBacks); - _croppedPages = CFSetCreateMutable(NULL, 0, NULL); + _bboxCache = CFDictionaryCreateMutable(NULL, 0, NULL, &kCFTypeDictionaryValueCallBacks); } - (void)replacementDealloc { - CFDictionaryRemoveValue(_bboxTable, self); - CFSetRemoveValue(_croppedPages, self); + CFDictionaryRemoveValue(_bboxCache, self); originalDealloc(self, _cmd); } @@ -73,7 +70,7 @@ - (NSRect)foregroundBox { NSValue *rectValue = nil; - if (FALSE == CFDictionaryGetValueIfPresent(_bboxTable, (void *)self, (const void **)&rectValue)) { + if (FALSE == CFDictionaryGetValueIfPresent(_bboxCache, (void *)self, (const void **)&rectValue)) { NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithPDFPage:self forBox:kPDFDisplayBoxMediaBox]; NSRect r = imageRep ? [imageRep foregroundRect] : NSZeroRect; NSRect b = [self boundsForBox:kPDFDisplayBoxMediaBox]; @@ -88,17 +85,10 @@ } r = NSIntersectionRect(NSInsetRect(r, -FOREGROUND_BOX_MARGIN, -FOREGROUND_BOX_MARGIN), b); rectValue = [NSValue valueWithRect:r]; - CFDictionarySetValue(_bboxTable, (void *)self, (void *)rectValue); + CFDictionarySetValue(_bboxCache, (void *)self, (void *)rectValue); } return [rectValue rectValue]; } - -- (void)autoCrop { - if (CFSetContainsValue(_croppedPages, (void *)self) == FALSE) { - [self setBounds:[self foregroundBox] forBox:kPDFDisplayBoxCropBox]; - CFSetAddValue(_croppedPages, (void *)self); - } -} - (NSImage *)image { return [self imageForBox:kPDFDisplayBoxCropBox]; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-05-23 21:12:41 UTC (rev 2129) +++ trunk/SKMainWindowController.m 2007-05-23 21:14:15 UTC (rev 2130) @@ -1019,8 +1019,23 @@ - (IBAction)cropAll:(id)sender { NSRect selRect = NSIntegralRect([pdfView currentSelectionRect]); - if (NSIsEmptyRect(selRect)) + if (NSIsEmptyRect(selRect)) { + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"SKAutomaticallyCropPages"]) { + int i, count = [[pdfView document] pageCount]; + NSMutableArray *rects = [NSMutableArray arrayWithCapacity:count]; + // use a local pool to avoid hitting the 32-bit limit when rendering all pages of a large doc + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + for (i = 0 ; i < count; ++ i ) { + PDFPage *page = [[pdfView document] pageAtIndex:i]; + [rects addObject:[NSValue valueWithRect:[page foregroundBox]]]; + [pool release]; + pool = [NSAutoreleasePool new]; + } + [pool release]; + [self cropPagesToRects:rects]; + } return; + } [self cropPagesToRects:nil]; [pdfView setCurrentSelectionRect:NSZeroRect]; @@ -3226,7 +3241,7 @@ } else if ([identifier isEqualToString:SKDocumentToolbarZoomActualItemIdentifier]) { return fabs([pdfView scaleFactor] - 1.0) > 0.01; } else if ([identifier isEqualToString:SKDocumentToolbarCropItemIdentifier]) { - return NO == NSIsEmptyRect([pdfView currentSelectionRect]); + return NO == NSIsEmptyRect([pdfView currentSelectionRect]) || [[NSUserDefaults standardUserDefaults] boolForKey:@"SKAutomaticallyCropPages"]; } else if ([identifier isEqualToString:SKDocumentToolbarFullScreenItemIdentifier]) { return YES; } else if ([identifier isEqualToString:SKDocumentToolbarPresentationItemIdentifier]) { @@ -3302,7 +3317,7 @@ [menuItem setState:[pdfView autoScales] ? NSOnState : NSOffState]; return YES; } else if (action == @selector(crop:) || action == @selector(cropAll:)) { - return NO == NSIsEmptyRect([pdfView currentSelectionRect]); + return NO == NSIsEmptyRect([pdfView currentSelectionRect]) || [[NSUserDefaults standardUserDefaults] boolForKey:@"SKAutomaticallyCropPages"]; } else if (action == @selector(autoSelectContent:)) { return [pdfView toolMode] == SKSelectToolMode; } else if (action == @selector(toggleLeftSidePane:)) { Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-05-23 21:12:41 UTC (rev 2129) +++ trunk/SKPDFView.m 2007-05-23 21:14:15 UTC (rev 2130) @@ -221,9 +221,6 @@ - (void)drawPage:(PDFPage *)pdfPage { - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"SKAutomaticallyCropPages"]) - [pdfPage autoCrop]; - // Let PDFView do most of the hard work. [super drawPage: pdfPage]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ama...@us...> - 2007-05-23 21:12:47
|
Revision: 2129 http://skim-app.svn.sourceforge.net/skim-app/?rev=2129&view=rev Author: amaxwell Date: 2007-05-23 14:12:41 -0700 (Wed, 23 May 2007) Log Message: ----------- Access bitmap data directly to get pixel values instead of going through -[NSBitmapImageRep getPixel:atX:y], which is slowed by caching and locking overhead. Modified Paths: -------------- trunk/NSBitmapImageRep_SKExtensions.m Modified: trunk/NSBitmapImageRep_SKExtensions.m =================================================================== --- trunk/NSBitmapImageRep_SKExtensions.m 2007-05-23 20:39:46 UTC (rev 2128) +++ trunk/NSBitmapImageRep_SKExtensions.m 2007-05-23 21:12:41 UTC (rev 2129) @@ -55,34 +55,50 @@ return NO; } +static void getRGBAPixelFromBitmapData(const unsigned char *data, unsigned int widthInPixels, int x, int y, unsigned int pixel[]) +{ + typedef struct _RGBAPixel { + unsigned char redByte, greenByte, blueByte, alphaByte; + } RGBAPixel; + + RGBAPixel *bitmapData = (RGBAPixel *)data; + + RGBAPixel *thisPixel = &(bitmapData[widthInPixels * y + x]); + pixel[0] = thisPixel->redByte; + pixel[1] = thisPixel->greenByte; + pixel[2] = thisPixel->blueByte; + pixel[3] = thisPixel->alphaByte; +} + +// we're presently only using this with RGBA; if it ever needs to be generalized, use samplesPerPixel and add a wrapper function and more implementations; define instead of constant so the arrays show up in the debugger +#define NUMBER_OF_SAMPLES 4 + - (NSRect)foregroundRect; { int i, iMax = [self pixelsWide] - MARGIN; int j, jMax = [self pixelsHigh] - MARGIN; - unsigned int samplesPerPixel = [self samplesPerPixel]; - unsigned int pixel[samplesPerPixel]; - memset(pixel, 0, samplesPerPixel); + unsigned int samplesPerPixel = NUMBER_OF_SAMPLES; + unsigned int pixel[NUMBER_OF_SAMPLES]; + memset(pixel, 0, NUMBER_OF_SAMPLES); int iLeft = iMax; int jTop = jMax; int iRight = MARGIN - 1; int jBottom = MARGIN - 1; - unsigned int backgroundPixel[samplesPerPixel]; - [self getPixel:backgroundPixel atX:MIN(MARGIN, iMax) y:MIN(MARGIN, jMax)]; + const unsigned char *bitmapData = [self bitmapData]; + unsigned widthInPixels = [self pixelsWide]; + + unsigned int backgroundPixel[NUMBER_OF_SAMPLES]; + getRGBAPixelFromBitmapData(bitmapData, widthInPixels, MIN(MARGIN, iMax), MIN(MARGIN, jMax), backgroundPixel); // basic idea borrowed from ImageMagick's statistics.c implementation - /* - bitmap pixels appear to be ordered top to bottom; this is not documented rdar://problem/5222982 - http://www.cocoabuilder.com/archive/message/cocoa/2007/5/22/183540 indicates that it may be image-dependent - */ - // top margin for (j = MARGIN; j < jTop; j++) { for (i = MARGIN; i < iMax; i++) { - [self getPixel:pixel atX:i y:j]; + getRGBAPixelFromBitmapData(bitmapData, widthInPixels, i, j, pixel); if (differentPixels(pixel, backgroundPixel, samplesPerPixel)) { // keep in mind that we're manipulating corner points, not height/width jTop = j; // final @@ -101,7 +117,7 @@ // bottom margin for (j = jMax - 1; j > jBottom; j--) { for (i = MARGIN; i < iMax; i++) { - [self getPixel:pixel atX:i y:j]; + getRGBAPixelFromBitmapData(bitmapData, widthInPixels, i, j, pixel); if (differentPixels(pixel, backgroundPixel, samplesPerPixel)) { jBottom = j; // final if (iLeft > i) @@ -116,7 +132,7 @@ // left margin for (i = MARGIN; i < iLeft; i++) { for (j = jTop; j <= jBottom; j++) { - [self getPixel:pixel atX:i y:j]; + getRGBAPixelFromBitmapData(bitmapData, widthInPixels, i, j, pixel); if (differentPixels(pixel, backgroundPixel, samplesPerPixel)) { iLeft = i; // final break; @@ -127,7 +143,7 @@ // right margin for (i = iMax - 1; i > iRight; i--) { for (j = jTop; j <= jBottom; j++) { - [self getPixel:pixel atX:i y:j]; + getRGBAPixelFromBitmapData(bitmapData, widthInPixels, i, j, pixel); if (differentPixels(pixel, backgroundPixel, samplesPerPixel)) { iRight = i; // final break; @@ -147,7 +163,7 @@ pixelsWide:NSWidth(bounds) pixelsHigh:NSHeight(bounds) bitsPerSample:8 - samplesPerPixel:4 + samplesPerPixel:NUMBER_OF_SAMPLES hasAlpha:YES isPlanar:NO colorSpaceName:NSCalibratedRGBColorSpace This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-05-23 20:39:47
|
Revision: 2128 http://skim-app.svn.sourceforge.net/skim-app/?rev=2128&view=rev Author: hofman Date: 2007-05-23 13:39:46 -0700 (Wed, 23 May 2007) Log Message: ----------- validate crop toolbar item. Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-05-23 17:38:07 UTC (rev 2127) +++ trunk/SKMainWindowController.m 2007-05-23 20:39:46 UTC (rev 2128) @@ -3225,6 +3225,8 @@ return [pdfView autoScales] == NO; } else if ([identifier isEqualToString:SKDocumentToolbarZoomActualItemIdentifier]) { return fabs([pdfView scaleFactor] - 1.0) > 0.01; + } else if ([identifier isEqualToString:SKDocumentToolbarCropItemIdentifier]) { + return NO == NSIsEmptyRect([pdfView currentSelectionRect]); } else if ([identifier isEqualToString:SKDocumentToolbarFullScreenItemIdentifier]) { return YES; } else if ([identifier isEqualToString:SKDocumentToolbarPresentationItemIdentifier]) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-05-23 17:38:35
|
Revision: 2127 http://skim-app.svn.sourceforge.net/skim-app/?rev=2127&view=rev Author: hofman Date: 2007-05-23 10:38:07 -0700 (Wed, 23 May 2007) Log Message: ----------- Remove unused accessor. Modified Paths: -------------- trunk/SKSnapshotWindowController.h trunk/SKSnapshotWindowController.m Modified: trunk/SKSnapshotWindowController.h =================================================================== --- trunk/SKSnapshotWindowController.h 2007-05-23 17:22:17 UTC (rev 2126) +++ trunk/SKSnapshotWindowController.h 2007-05-23 17:38:07 UTC (rev 2127) @@ -62,7 +62,6 @@ - (NSImage *)thumbnail; - (void)setThumbnail:(NSImage *)newThumbnail; -- (NSString *)pageLabel; - (unsigned int)pageIndex; - (NSDictionary *)pageAndWindow; Modified: trunk/SKSnapshotWindowController.m =================================================================== --- trunk/SKSnapshotWindowController.m 2007-05-23 17:22:17 UTC (rev 2126) +++ trunk/SKSnapshotWindowController.m 2007-05-23 17:38:07 UTC (rev 2127) @@ -265,18 +265,14 @@ } } -- (NSString *)pageLabel { - return [pdfView valueForKeyPath:@"currentPage.label"]; -} - - (unsigned int)pageIndex { return [[pdfView document] indexForPage:[pdfView currentPage]]; } - (NSDictionary *)pageAndWindow { - NSString *label = [self pageLabel] ? [self pageLabel] : @""; + NSString *label = [[pdfView currentPage] label]; NSNumber *hasWindow = [NSNumber numberWithBool:[[self window] isVisible]]; - return [NSDictionary dictionaryWithObjectsAndKeys:label, @"label", hasWindow, @"hasWindow", nil]; + return [NSDictionary dictionaryWithObjectsAndKeys:label ? label : @"", @"label", hasWindow, @"hasWindow", nil]; } - (BOOL)forceOnTop { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ama...@us...> - 2007-05-23 17:22:18
|
Revision: 2126 http://skim-app.svn.sourceforge.net/skim-app/?rev=2126&view=rev Author: amaxwell Date: 2007-05-23 10:22:17 -0700 (Wed, 23 May 2007) Log Message: ----------- Use KVO-compliant method; empty KVO notifications are discouraged Modified Paths: -------------- trunk/SKSnapshotWindowController.m Modified: trunk/SKSnapshotWindowController.m =================================================================== --- trunk/SKSnapshotWindowController.m 2007-05-23 17:18:35 UTC (rev 2125) +++ trunk/SKSnapshotWindowController.m 2007-05-23 17:22:17 UTC (rev 2126) @@ -94,8 +94,6 @@ - (void)handlePageChangedNotification:(NSNotification *)notification { [[self window] setTitle:[self windowTitleForDocumentDisplayName:[[self document] displayName]]]; - [self willChangeValueForKey:@"pageLabel"]; - [self didChangeValueForKey:@"pageLabel"]; [self willChangeValueForKey:@"pageIndex"]; [self didChangeValueForKey:@"pageIndex"]; [self willChangeValueForKey:@"pageAndWindow"]; @@ -268,7 +266,7 @@ } - (NSString *)pageLabel { - return [[pdfView currentPage] label]; + return [pdfView valueForKeyPath:@"currentPage.label"]; } - (unsigned int)pageIndex { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-05-23 17:18:43
|
Revision: 2125 http://skim-app.svn.sourceforge.net/skim-app/?rev=2125&view=rev Author: hofman Date: 2007-05-23 10:18:35 -0700 (Wed, 23 May 2007) Log Message: ----------- Remove selection after cropping all pages. Modified Paths: -------------- trunk/SKMainWindowController.m trunk/SKPDFView.h trunk/SKPDFView.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-05-23 17:18:09 UTC (rev 2124) +++ trunk/SKMainWindowController.m 2007-05-23 17:18:35 UTC (rev 2125) @@ -1023,6 +1023,7 @@ return; [self cropPagesToRects:nil]; + [pdfView setCurrentSelectionRect:NSZeroRect]; } - (IBAction)autoSelectContent:(id)sender { Modified: trunk/SKPDFView.h =================================================================== --- trunk/SKPDFView.h 2007-05-23 17:18:09 UTC (rev 2124) +++ trunk/SKPDFView.h 2007-05-23 17:18:35 UTC (rev 2125) @@ -116,6 +116,7 @@ - (void)setActiveAnnotation:(PDFAnnotation *)newAnnotation; - (NSRect)currentSelectionRect; +- (void)setCurrentSelectionRect:(NSRect)rect; - (BOOL)hasReadingBar; Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-05-23 17:18:09 UTC (rev 2124) +++ trunk/SKPDFView.m 2007-05-23 17:18:35 UTC (rev 2125) @@ -460,6 +460,14 @@ return NSZeroRect; } +- (void)setCurrentSelectionRect:(NSRect)rect { + if (toolMode == SKSelectToolMode) { + if (NSEqualRects(selectionRect, rect) == NO) + [self setNeedsDisplay:YES]; + selectionRect = rect; + } +} + #pragma mark Reading bar - (BOOL)hasReadingBar { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ama...@us...> - 2007-05-23 17:18:12
|
Revision: 2124 http://skim-app.svn.sourceforge.net/skim-app/?rev=2124&view=rev Author: amaxwell Date: 2007-05-23 10:18:09 -0700 (Wed, 23 May 2007) Log Message: ----------- Remove commented (incorrect) bytesPerRow. Use samplesPerPixel. Add to comment on pixel order. Modified Paths: -------------- trunk/NSBitmapImageRep_SKExtensions.m Modified: trunk/NSBitmapImageRep_SKExtensions.m =================================================================== --- trunk/NSBitmapImageRep_SKExtensions.m 2007-05-23 17:01:39 UTC (rev 2123) +++ trunk/NSBitmapImageRep_SKExtensions.m 2007-05-23 17:18:09 UTC (rev 2124) @@ -60,25 +60,30 @@ int i, iMax = [self pixelsWide] - MARGIN; int j, jMax = [self pixelsHigh] - MARGIN; - unsigned int pixel[4] = { 0, 0, 0, 255 }; + unsigned int samplesPerPixel = [self samplesPerPixel]; + unsigned int pixel[samplesPerPixel]; + memset(pixel, 0, samplesPerPixel); int iLeft = iMax; int jTop = jMax; int iRight = MARGIN - 1; int jBottom = MARGIN - 1; - unsigned int backgroundPixel[4]; + unsigned int backgroundPixel[samplesPerPixel]; [self getPixel:backgroundPixel atX:MIN(MARGIN, iMax) y:MIN(MARGIN, jMax)]; - + // basic idea borrowed from ImageMagick's statistics.c implementation - // bitmap pixels are ordered top to bottom + /* + bitmap pixels appear to be ordered top to bottom; this is not documented rdar://problem/5222982 + http://www.cocoabuilder.com/archive/message/cocoa/2007/5/22/183540 indicates that it may be image-dependent + */ // top margin for (j = MARGIN; j < jTop; j++) { for (i = MARGIN; i < iMax; i++) { [self getPixel:pixel atX:i y:j]; - if (differentPixels(pixel, backgroundPixel, 4)) { + if (differentPixels(pixel, backgroundPixel, samplesPerPixel)) { // keep in mind that we're manipulating corner points, not height/width jTop = j; // final jBottom = j; @@ -97,7 +102,7 @@ for (j = jMax - 1; j > jBottom; j--) { for (i = MARGIN; i < iMax; i++) { [self getPixel:pixel atX:i y:j]; - if (differentPixels(pixel, backgroundPixel, 4)) { + if (differentPixels(pixel, backgroundPixel, samplesPerPixel)) { jBottom = j; // final if (iLeft > i) iLeft = i; @@ -112,7 +117,7 @@ for (i = MARGIN; i < iLeft; i++) { for (j = jTop; j <= jBottom; j++) { [self getPixel:pixel atX:i y:j]; - if (differentPixels(pixel, backgroundPixel, 4)) { + if (differentPixels(pixel, backgroundPixel, samplesPerPixel)) { iLeft = i; // final break; } @@ -123,7 +128,7 @@ for (i = iMax - 1; i > iRight; i--) { for (j = jTop; j <= jBottom; j++) { [self getPixel:pixel atX:i y:j]; - if (differentPixels(pixel, backgroundPixel, 4)) { + if (differentPixels(pixel, backgroundPixel, samplesPerPixel)) { iRight = i; // final break; } @@ -137,8 +142,8 @@ - (NSBitmapImageRep *)initWithPDFPage:(PDFPage *)page forBox:(PDFDisplayBox)box; { - NSRect bounds = [page boundsForBox:box]; - self = [self initWithBitmapDataPlanes:NULL + NSRect bounds = [page boundsForBox:box]; + self = [self initWithBitmapDataPlanes:NULL pixelsWide:NSWidth(bounds) pixelsHigh:NSHeight(bounds) bitsPerSample:8 @@ -147,9 +152,9 @@ isPlanar:NO colorSpaceName:NSCalibratedRGBColorSpace bitmapFormat:0 - bytesPerRow:0 /*(4 * NSWidth(maskRect)) */ + bytesPerRow:0 bitsPerPixel:32]; - if (self) { + if (self) { [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithBitmapImageRep:self]]; [[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationNone]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-05-23 17:01:43
|
Revision: 2123 http://skim-app.svn.sourceforge.net/skim-app/?rev=2123&view=rev Author: hofman Date: 2007-05-23 10:01:39 -0700 (Wed, 23 May 2007) Log Message: ----------- Disable anti-alias to create bitmap for a page. Modified Paths: -------------- trunk/NSBitmapImageRep_SKExtensions.m Modified: trunk/NSBitmapImageRep_SKExtensions.m =================================================================== --- trunk/NSBitmapImageRep_SKExtensions.m 2007-05-23 14:34:43 UTC (rev 2122) +++ trunk/NSBitmapImageRep_SKExtensions.m 2007-05-23 17:01:39 UTC (rev 2123) @@ -153,6 +153,7 @@ [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithBitmapImageRep:self]]; [[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationNone]; + [[NSGraphicsContext currentContext] setShouldAntialias:NO]; int rotation = [page rotation]; if (rotation) { NSAffineTransform *transform = [NSAffineTransform transform]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-05-23 14:34:45
|
Revision: 2122 http://skim-app.svn.sourceforge.net/skim-app/?rev=2122&view=rev Author: hofman Date: 2007-05-23 07:34:43 -0700 (Wed, 23 May 2007) Log Message: ----------- Integral rects for copying images from selection. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-05-23 11:57:27 UTC (rev 2121) +++ trunk/SKPDFView.m 2007-05-23 14:34:43 UTC (rev 2122) @@ -505,10 +505,12 @@ } if (toolMode == SKSelectToolMode && NSIsEmptyRect(selectionRect) == NO) { + NSRect selRect = NSIntegralRect(selectionRect); + PDFDocument *pdfDoc = [[PDFDocument alloc] initWithData:[[self currentPage] dataRepresentation]]; PDFPage *page = [pdfDoc pageAtIndex:0]; [page setBounds:[[self currentPage] boundsForBox:kPDFDisplayBoxMediaBox] forBox:kPDFDisplayBoxMediaBox]; - [page setBounds:selectionRect forBox:kPDFDisplayBoxCropBox]; + [page setBounds:selRect forBox:kPDFDisplayBoxCropBox]; [page setBounds:NSZeroRect forBox:kPDFDisplayBoxBleedBox]; [page setBounds:NSZeroRect forBox:kPDFDisplayBoxTrimBox]; [page setBounds:NSZeroRect forBox:kPDFDisplayBoxArtBox]; @@ -518,7 +520,7 @@ [pdfDoc release]; NSRect bounds = [[self currentPage] boundsForBox:[self displayBox]]; - NSRect targetRect = NSZeroRect, sourceRect = selectionRect; + NSRect targetRect = NSZeroRect, sourceRect = selRect; NSImage *pageImage = [[self currentPage] imageForBox:[self displayBox]]; NSImage *image = nil; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-05-23 11:57:33
|
Revision: 2121 http://skim-app.svn.sourceforge.net/skim-app/?rev=2121&view=rev Author: hofman Date: 2007-05-23 04:57:27 -0700 (Wed, 23 May 2007) Log Message: ----------- Fix offset of bitmap foreground rect. Transform to page coordinates only at the end to avoid offset confusion. Return minimal foregroundBox for empty pages, rather than the full bounds. Modified Paths: -------------- trunk/NSBitmapImageRep_SKExtensions.m trunk/PDFPage_SKExtensions.m Modified: trunk/NSBitmapImageRep_SKExtensions.m =================================================================== --- trunk/NSBitmapImageRep_SKExtensions.m 2007-05-23 11:38:06 UTC (rev 2120) +++ trunk/NSBitmapImageRep_SKExtensions.m 2007-05-23 11:57:27 UTC (rev 2121) @@ -45,103 +45,93 @@ static const unsigned EPSILON = 2; -static inline BOOL similarPixels( const unsigned int *p1, const unsigned int *p2, unsigned count ) +static inline BOOL differentPixels( const unsigned int *p1, const unsigned int *p2, unsigned count ) { unsigned i; for (i = 0; i < count; i++) { if (abs(p2[i] - p1[i]) > EPSILON) - return NO; + return YES; } - return YES; + return NO; } - (NSRect)foregroundRect; { int i, iMax = [self pixelsWide] - MARGIN; int j, jMax = [self pixelsHigh] - MARGIN; - NSRect bounds = NSZeroRect; unsigned int pixel[4] = { 0, 0, 0, 255 }; - NSPoint lowerLeft = NSMakePoint(iMax, jMax); - NSPoint upperRight = NSMakePoint(MARGIN, MARGIN); + int iLeft = iMax; + int jTop = jMax; + int iRight = MARGIN - 1; + int jBottom = MARGIN - 1; unsigned int backgroundPixel[4]; [self getPixel:backgroundPixel atX:MIN(MARGIN, iMax) y:MIN(MARGIN, jMax)]; // basic idea borrowed from ImageMagick's statistics.c implementation + // bitmap pixels are ordered top to bottom + // top margin - for (j = MARGIN; j < lowerLeft.y; j++) { + for (j = MARGIN; j < jTop; j++) { for (i = MARGIN; i < iMax; i++) { - [self getPixel:pixel atX:i y:(jMax-j)]; - BOOL isForeground = similarPixels(pixel, backgroundPixel, 4) == NO; - // keep in mind that we're manipulating corner points, not height/width - if (isForeground) { - lowerLeft.y = j; - upperRight.y = j + 1; - lowerLeft.x = i; - upperRight.x = i + 1; + [self getPixel:pixel atX:i y:j]; + if (differentPixels(pixel, backgroundPixel, 4)) { + // keep in mind that we're manipulating corner points, not height/width + jTop = j; // final + jBottom = j; + iLeft = i; + iRight = i; break; } } } - if ((int)lowerLeft.y == jMax) { - - // no foreground pixel detected, we return NSZeroRect - lowerLeft = upperRight = NSZeroPoint; - - } else { - - // bottom margin - for (j = jMax - 1; j >= upperRight.y; j--) { - for (i = MARGIN; i < iMax; i++) { - [self getPixel:pixel atX:i y:(jMax-j)]; - BOOL isForeground = similarPixels(pixel, backgroundPixel, 4) == NO; - if (isForeground) { - upperRight.y = j; - if (lowerLeft.x > i) - lowerLeft.x = i; - if (upperRight.x <= i) - upperRight.x = i + 1; - break; - } + if (jTop == jMax) + // no foreground pixel detected + return NSZeroRect; + + // bottom margin + for (j = jMax - 1; j > jBottom; j--) { + for (i = MARGIN; i < iMax; i++) { + [self getPixel:pixel atX:i y:j]; + if (differentPixels(pixel, backgroundPixel, 4)) { + jBottom = j; // final + if (iLeft > i) + iLeft = i; + if (iRight < i) + iRight = i; + break; } } - - // left margin - for (i = MARGIN; i < lowerLeft.x; i++) { - for (j = lowerLeft.y; j <= upperRight.y; j++) { - [self getPixel:pixel atX:i y:(jMax-j)]; - BOOL isForeground = similarPixels(pixel, backgroundPixel, 4) == NO; - if (isForeground) { - lowerLeft.x = i; - break; - } + } + + // left margin + for (i = MARGIN; i < iLeft; i++) { + for (j = jTop; j <= jBottom; j++) { + [self getPixel:pixel atX:i y:j]; + if (differentPixels(pixel, backgroundPixel, 4)) { + iLeft = i; // final + break; } } - - // right margin - for (i = iMax - 1; i >= upperRight.x; i--) { - for (j = lowerLeft.y; j <= upperRight.y; j++) { - [self getPixel:pixel atX:i y:(jMax-j)]; - BOOL isForeground = similarPixels(pixel, backgroundPixel, 4) == NO; - if (isForeground) { - upperRight.x = i + 1; - break; - } + } + + // right margin + for (i = iMax - 1; i > iRight; i--) { + for (j = jTop; j <= jBottom; j++) { + [self getPixel:pixel atX:i y:j]; + if (differentPixels(pixel, backgroundPixel, 4)) { + iRight = i; // final + break; } } - } // finally, convert the corners to a bounding rect - bounds.origin = lowerLeft; - bounds.size.width = upperRight.x - lowerLeft.x; - bounds.size.height = upperRight.y - lowerLeft.y; - - return bounds; + return NSMakeRect(iLeft, jMax + MARGIN - jBottom - 1, iRight + 1 - iLeft, jBottom + 1 - jTop); } - (NSBitmapImageRep *)initWithPDFPage:(PDFPage *)page forBox:(PDFDisplayBox)box; Modified: trunk/PDFPage_SKExtensions.m =================================================================== --- trunk/PDFPage_SKExtensions.m 2007-05-23 11:38:06 UTC (rev 2120) +++ trunk/PDFPage_SKExtensions.m 2007-05-23 11:57:27 UTC (rev 2121) @@ -78,13 +78,15 @@ NSRect r = imageRep ? [imageRep foregroundRect] : NSZeroRect; NSRect b = [self boundsForBox:kPDFDisplayBoxMediaBox]; [imageRep release]; - if (NSEqualRects(NSZeroRect, r)) { + if (imageRep == nil) { r = b; + } else if (NSEqualRects(NSZeroRect, r)) { + r = NSMakeRect(NSMidX(b), NSMidY(b), 0.0, 0.0); } else { r.origin.x += NSMinX(b); r.origin.y += NSMinY(b); - r = NSIntersectionRect(NSInsetRect(r, -FOREGROUND_BOX_MARGIN, -FOREGROUND_BOX_MARGIN), b); } + r = NSIntersectionRect(NSInsetRect(r, -FOREGROUND_BOX_MARGIN, -FOREGROUND_BOX_MARGIN), b); rectValue = [NSValue valueWithRect:r]; CFDictionarySetValue(_bboxTable, (void *)self, (void *)rectValue); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-05-23 11:38:16
|
Revision: 2120 http://skim-app.svn.sourceforge.net/skim-app/?rev=2120&view=rev Author: hofman Date: 2007-05-23 04:38:06 -0700 (Wed, 23 May 2007) Log Message: ----------- Crop pages to integral rects. Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-05-23 00:47:58 UTC (rev 2119) +++ trunk/SKMainWindowController.m 2007-05-23 11:38:06 UTC (rev 2120) @@ -987,7 +987,7 @@ } - (IBAction)crop:(id)sender { - NSRect selRect = [pdfView currentSelectionRect]; + NSRect selRect = NSIntegralRect([pdfView currentSelectionRect]); if (NSIsEmptyRect(selRect)) return; @@ -995,7 +995,7 @@ } - (void)cropPagesToRects:(NSArray *)rects { - NSRect selRect = [pdfView currentSelectionRect]; + NSRect selRect = NSIntegralRect([pdfView currentSelectionRect]); int i, count = [[pdfView document] pageCount]; NSMutableArray *oldRects = [NSMutableArray arrayWithCapacity:count]; for (i = 0 ; i < count; ++ i ) { @@ -1018,7 +1018,7 @@ } - (IBAction)cropAll:(id)sender { - NSRect selRect = [pdfView currentSelectionRect]; + NSRect selRect = NSIntegralRect([pdfView currentSelectionRect]); if (NSIsEmptyRect(selRect)) return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-05-23 00:48:00
|
Revision: 2119 http://skim-app.svn.sourceforge.net/skim-app/?rev=2119&view=rev Author: hofman Date: 2007-05-22 17:47:58 -0700 (Tue, 22 May 2007) Log Message: ----------- Offset upper-right corner of foreground by one. Modified Paths: -------------- trunk/NSBitmapImageRep_SKExtensions.m Modified: trunk/NSBitmapImageRep_SKExtensions.m =================================================================== --- trunk/NSBitmapImageRep_SKExtensions.m 2007-05-23 00:28:39 UTC (rev 2118) +++ trunk/NSBitmapImageRep_SKExtensions.m 2007-05-23 00:47:58 UTC (rev 2119) @@ -79,9 +79,9 @@ // keep in mind that we're manipulating corner points, not height/width if (isForeground) { lowerLeft.y = j; - upperRight.y = j; + upperRight.y = j + 1; lowerLeft.x = i; - upperRight.x = i; + upperRight.x = i + 1; break; } } @@ -103,8 +103,8 @@ upperRight.y = j; if (lowerLeft.x > i) lowerLeft.x = i; - if (upperRight.x < i) - upperRight.x = i; + if (upperRight.x <= i) + upperRight.x = i + 1; break; } } @@ -128,7 +128,7 @@ [self getPixel:pixel atX:i y:(jMax-j)]; BOOL isForeground = similarPixels(pixel, backgroundPixel, 4) == NO; if (isForeground) { - upperRight.x = i; + upperRight.x = i + 1; break; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-05-23 00:28:41
|
Revision: 2118 http://skim-app.svn.sourceforge.net/skim-app/?rev=2118&view=rev Author: hofman Date: 2007-05-22 17:28:39 -0700 (Tue, 22 May 2007) Log Message: ----------- Speed up bbox selection. No use loopin over Modified Paths: -------------- trunk/NSBitmapImageRep_SKExtensions.m Modified: trunk/NSBitmapImageRep_SKExtensions.m =================================================================== --- trunk/NSBitmapImageRep_SKExtensions.m 2007-05-22 22:55:11 UTC (rev 2117) +++ trunk/NSBitmapImageRep_SKExtensions.m 2007-05-23 00:28:39 UTC (rev 2118) @@ -57,48 +57,89 @@ - (NSRect)foregroundRect; { - int i, imax = [self pixelsWide] - MARGIN; - int j, jmax = [self pixelsHigh] - MARGIN; + int i, iMax = [self pixelsWide] - MARGIN; + int j, jMax = [self pixelsHigh] - MARGIN; NSRect bounds = NSZeroRect; unsigned int pixel[4] = { 0, 0, 0, 255 }; - typedef struct _BoundingBox { - NSPoint lowerLeft; - NSPoint upperRight; - } BoundingBox; + NSPoint lowerLeft = NSMakePoint(iMax, jMax); + NSPoint upperRight = NSMakePoint(MARGIN, MARGIN); - BoundingBox bbox; - bbox.lowerLeft = NSMakePoint(imax, jmax); - bbox.upperRight = NSMakePoint(MARGIN, MARGIN); - unsigned int backgroundPixel[4]; - [self getPixel:backgroundPixel atX:MIN(MARGIN, imax) y:MIN(MARGIN, jmax)]; + [self getPixel:backgroundPixel atX:MIN(MARGIN, iMax) y:MIN(MARGIN, jMax)]; // basic idea borrowed from ImageMagick's statistics.c implementation - for (j = MARGIN; j < jmax; j++) - { - for (i = MARGIN; i < imax; i++) - { - [self getPixel:pixel atX:i y:(jmax-j)]; + + // top margin + for (j = MARGIN; j < lowerLeft.y; j++) { + for (i = MARGIN; i < iMax; i++) { + [self getPixel:pixel atX:i y:(jMax-j)]; BOOL isForeground = similarPixels(pixel, backgroundPixel, 4) == NO; - // keep in mind that we're manipulating corner points, not height/width - if (i < bbox.lowerLeft.x && isForeground) - bbox.lowerLeft.x = i; - if (i > bbox.upperRight.x && isForeground) - bbox.upperRight.x = i; - if (j < bbox.lowerLeft.y && isForeground) - bbox.lowerLeft.y = j; - if (j > bbox.upperRight.y && isForeground) - bbox.upperRight.y = j; + if (isForeground) { + lowerLeft.y = j; + upperRight.y = j; + lowerLeft.x = i; + upperRight.x = i; + break; + } } } + if ((int)lowerLeft.y == jMax) { + + // no foreground pixel detected, we return NSZeroRect + lowerLeft = upperRight = NSZeroPoint; + + } else { + + // bottom margin + for (j = jMax - 1; j >= upperRight.y; j--) { + for (i = MARGIN; i < iMax; i++) { + [self getPixel:pixel atX:i y:(jMax-j)]; + BOOL isForeground = similarPixels(pixel, backgroundPixel, 4) == NO; + if (isForeground) { + upperRight.y = j; + if (lowerLeft.x > i) + lowerLeft.x = i; + if (upperRight.x < i) + upperRight.x = i; + break; + } + } + } + + // left margin + for (i = MARGIN; i < lowerLeft.x; i++) { + for (j = lowerLeft.y; j <= upperRight.y; j++) { + [self getPixel:pixel atX:i y:(jMax-j)]; + BOOL isForeground = similarPixels(pixel, backgroundPixel, 4) == NO; + if (isForeground) { + lowerLeft.x = i; + break; + } + } + } + + // right margin + for (i = iMax - 1; i >= upperRight.x; i--) { + for (j = lowerLeft.y; j <= upperRight.y; j++) { + [self getPixel:pixel atX:i y:(jMax-j)]; + BOOL isForeground = similarPixels(pixel, backgroundPixel, 4) == NO; + if (isForeground) { + upperRight.x = i; + break; + } + } + } + + } + // finally, convert the corners to a bounding rect - bounds.origin = bbox.lowerLeft; - bounds.size.width = bbox.upperRight.x - bbox.lowerLeft.x; - bounds.size.height = bbox.upperRight.y - bbox.lowerLeft.y; + bounds.origin = lowerLeft; + bounds.size.width = upperRight.x - lowerLeft.x; + bounds.size.height = upperRight.y - lowerLeft.y; return bounds; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-05-22 22:55:14
|
Revision: 2117 http://skim-app.svn.sourceforge.net/skim-app/?rev=2117&view=rev Author: hofman Date: 2007-05-22 15:55:11 -0700 (Tue, 22 May 2007) Log Message: ----------- Selecting content extends current selection. Useful for 2-sided pages. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-05-22 22:51:41 UTC (rev 2116) +++ trunk/SKPDFView.m 2007-05-22 22:55:11 UTC (rev 2117) @@ -652,7 +652,7 @@ - (IBAction)autoSelectContent:(id)sender { if (toolMode == SKSelectToolMode) { PDFPage *page = [self currentPage]; - selectionRect = NSIntersectionRect([page foregroundBox], [page boundsForBox:[self displayBox]]); + selectionRect = NSIntersectionRect(NSUnionRect([page foregroundBox], selectionRect), [page boundsForBox:[self displayBox]]); [self setNeedsDisplay:YES]; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ama...@us...> - 2007-05-22 22:51:42
|
Revision: 2116 http://skim-app.svn.sourceforge.net/skim-app/?rev=2116&view=rev Author: amaxwell Date: 2007-05-22 15:51:41 -0700 (Tue, 22 May 2007) Log Message: ----------- Start enumerating pages/annotations at the current page instead of zero. Fixes a beachball with large files opening to the last-read page. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-05-22 20:46:27 UTC (rev 2115) +++ trunk/SKPDFView.m 2007-05-22 22:51:41 UTC (rev 2116) @@ -1770,7 +1770,7 @@ int i, iMax = NSMaxRange(range); NSRect visibleRect = [self visibleContentRect]; - for (i = 0; i < iMax; i++) { + for (i = range.location; i < iMax; i++) { PDFPage *page = [[self document] pageAtIndex:i]; NSArray *annotations = [page annotations]; unsigned j, jMax = [annotations count]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-05-22 20:46:28
|
Revision: 2115 http://skim-app.svn.sourceforge.net/skim-app/?rev=2115&view=rev Author: hofman Date: 2007-05-22 13:46:27 -0700 (Tue, 22 May 2007) Log Message: ----------- Add menu action to select the content of a page in select mode. Modified Paths: -------------- trunk/Dutch.lproj/MainMenu.nib/classes.nib trunk/Dutch.lproj/MainMenu.nib/keyedobjects.nib trunk/English.lproj/MainMenu.nib/classes.nib trunk/English.lproj/MainMenu.nib/keyedobjects.nib trunk/Italian.lproj/MainMenu.nib/classes.nib trunk/Italian.lproj/MainMenu.nib/keyedobjects.nib trunk/SKMainWindowController.h trunk/SKMainWindowController.m trunk/SKPDFView.h trunk/SKPDFView.m Modified: trunk/Dutch.lproj/MainMenu.nib/classes.nib =================================================================== --- trunk/Dutch.lproj/MainMenu.nib/classes.nib 2007-05-22 19:56:46 UTC (rev 2114) +++ trunk/Dutch.lproj/MainMenu.nib/classes.nib 2007-05-22 20:46:27 UTC (rev 2115) @@ -4,6 +4,7 @@ ACTIONS = { addBookmark = id; alternatePaste = id; + autoSelectContent = id; changeAnnotationMode = id; changeDisplayBox = id; changeLeftSidePaneState = id; Modified: trunk/Dutch.lproj/MainMenu.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/MainMenu.nib/classes.nib =================================================================== --- trunk/English.lproj/MainMenu.nib/classes.nib 2007-05-22 19:56:46 UTC (rev 2114) +++ trunk/English.lproj/MainMenu.nib/classes.nib 2007-05-22 20:46:27 UTC (rev 2115) @@ -4,6 +4,7 @@ ACTIONS = { addBookmark = id; alternatePaste = id; + autoSelectContent = id; changeAnnotationMode = id; changeDisplayBox = id; changeLeftSidePaneState = id; Modified: trunk/English.lproj/MainMenu.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/MainMenu.nib/classes.nib =================================================================== --- trunk/Italian.lproj/MainMenu.nib/classes.nib 2007-05-22 19:56:46 UTC (rev 2114) +++ trunk/Italian.lproj/MainMenu.nib/classes.nib 2007-05-22 20:46:27 UTC (rev 2115) @@ -4,6 +4,7 @@ ACTIONS = { addBookmark = id; alternatePaste = id; + autoSelectContent = id; changeAnnotationMode = id; changeDisplayBox = id; changeLeftSidePaneState = id; Modified: trunk/Italian.lproj/MainMenu.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2007-05-22 19:56:46 UTC (rev 2114) +++ trunk/SKMainWindowController.h 2007-05-22 20:46:27 UTC (rev 2115) @@ -203,6 +203,7 @@ - (IBAction)rotateAllLeft:(id)sender; - (IBAction)crop:(id)sender; - (IBAction)cropAll:(id)sender; +- (IBAction)autoSelectContent:(id)sender; - (IBAction)getInfo:(id)sender; - (void)displaySearchResultsForString:(NSString *)string; - (IBAction)search:(id)sender; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-05-22 19:56:46 UTC (rev 2114) +++ trunk/SKMainWindowController.m 2007-05-22 20:46:27 UTC (rev 2115) @@ -1025,6 +1025,10 @@ [self cropPagesToRects:nil]; } +- (IBAction)autoSelectContent:(id)sender { + [pdfView autoSelectContent:sender]; +} + - (IBAction)getInfo:(id)sender { SKInfoWindowController *infoController = [SKInfoWindowController sharedInstance]; [infoController fillInfoForDocument:[self document]]; @@ -3296,6 +3300,8 @@ return YES; } else if (action == @selector(crop:) || action == @selector(cropAll:)) { return NO == NSIsEmptyRect([pdfView currentSelectionRect]); + } else if (action == @selector(autoSelectContent:)) { + return [pdfView toolMode] == SKSelectToolMode; } else if (action == @selector(toggleLeftSidePane:)) { if ([self isFullScreen]) { if ([leftSideWindow state] == NSDrawerOpenState || [leftSideWindow state] == NSDrawerOpeningState) Modified: trunk/SKPDFView.h =================================================================== --- trunk/SKPDFView.h 2007-05-22 19:56:46 UTC (rev 2114) +++ trunk/SKPDFView.h 2007-05-22 20:46:27 UTC (rev 2115) @@ -122,6 +122,7 @@ - (void)toggleReadingBar; - (IBAction)delete:(id)sender; +- (IBAction)autoSelectContent:(id)sender; - (void)addAnnotationFromMenu:(id)sender; - (void)addAnnotationFromSelectionWithType:(SKNoteType)annotationType; Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-05-22 19:56:46 UTC (rev 2114) +++ trunk/SKPDFView.m 2007-05-22 20:46:27 UTC (rev 2115) @@ -649,6 +649,14 @@ [super selectAll:sender]; } +- (IBAction)autoSelectContent:(id)sender { + if (toolMode == SKSelectToolMode) { + PDFPage *page = [self currentPage]; + selectionRect = NSIntersectionRect([page foregroundBox], [page boundsForBox:[self displayBox]]); + [self setNeedsDisplay:YES]; + } +} + #pragma mark Event Handling - (void)keyDown:(NSEvent *)theEvent @@ -1621,6 +1629,8 @@ if (toolMode == SKSelectToolMode && NSIsEmptyRect(selectionRect) == NO) return YES; return NO; + } else if (action == @selector(autoSelectContent:)) { + return toolMode == SKSelectToolMode; } else { return [super validateMenuItem:menuItem]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-05-22 19:56:47
|
Revision: 2114 http://skim-app.svn.sourceforge.net/skim-app/?rev=2114&view=rev Author: hofman Date: 2007-05-22 12:56:46 -0700 (Tue, 22 May 2007) Log Message: ----------- Invert margin for foregroundRect. Modified Paths: -------------- trunk/PDFPage_SKExtensions.m Modified: trunk/PDFPage_SKExtensions.m =================================================================== --- trunk/PDFPage_SKExtensions.m 2007-05-22 19:50:37 UTC (rev 2113) +++ trunk/PDFPage_SKExtensions.m 2007-05-22 19:56:46 UTC (rev 2114) @@ -83,7 +83,7 @@ } else { r.origin.x += NSMinX(b); r.origin.y += NSMinY(b); - r = NSIntersectionRect(NSInsetRect(r, FOREGROUND_BOX_MARGIN, FOREGROUND_BOX_MARGIN), b); + r = NSIntersectionRect(NSInsetRect(r, -FOREGROUND_BOX_MARGIN, -FOREGROUND_BOX_MARGIN), b); } rectValue = [NSValue valueWithRect:r]; CFDictionarySetValue(_bboxTable, (void *)self, (void *)rectValue); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-05-22 19:50:38
|
Revision: 2113 http://skim-app.svn.sourceforge.net/skim-app/?rev=2113&view=rev Author: hofman Date: 2007-05-22 12:50:37 -0700 (Tue, 22 May 2007) Log Message: ----------- Shift foreground box by origin of media box. Modified Paths: -------------- trunk/PDFPage_SKExtensions.m Modified: trunk/PDFPage_SKExtensions.m =================================================================== --- trunk/PDFPage_SKExtensions.m 2007-05-22 19:07:56 UTC (rev 2112) +++ trunk/PDFPage_SKExtensions.m 2007-05-22 19:50:37 UTC (rev 2113) @@ -50,6 +50,8 @@ @implementation PDFPage (SKExtensions) +#define FOREGROUND_BOX_MARGIN 10.0 + // A subclass with ivars would be nicer in some respects, but that would require subclassing PDFDocument and returning instances of the subclass for each page. static CFMutableDictionaryRef _bboxTable = NULL; static CFMutableSetRef _croppedPages = NULL; @@ -74,11 +76,15 @@ if (FALSE == CFDictionaryGetValueIfPresent(_bboxTable, (void *)self, (const void **)&rectValue)) { NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithPDFPage:self forBox:kPDFDisplayBoxMediaBox]; NSRect r = imageRep ? [imageRep foregroundRect] : NSZeroRect; + NSRect b = [self boundsForBox:kPDFDisplayBoxMediaBox]; [imageRep release]; - if (NSEqualRects(NSZeroRect, r)) - r = [self boundsForBox:kPDFDisplayBoxMediaBox]; - else - r = NSInsetRect(r, -10, -10); + if (NSEqualRects(NSZeroRect, r)) { + r = b; + } else { + r.origin.x += NSMinX(b); + r.origin.y += NSMinY(b); + r = NSIntersectionRect(NSInsetRect(r, FOREGROUND_BOX_MARGIN, FOREGROUND_BOX_MARGIN), b); + } rectValue = [NSValue valueWithRect:r]; CFDictionarySetValue(_bboxTable, (void *)self, (void *)rectValue); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ama...@us...> - 2007-05-22 19:07:57
|
Revision: 2112 http://skim-app.svn.sourceforge.net/skim-app/?rev=2112&view=rev Author: amaxwell Date: 2007-05-22 12:07:56 -0700 (Tue, 22 May 2007) Log Message: ----------- Add support for automatically cropping PDF pages by determining an appropriate crop box. Currently requires a hidden preferences. Modified Paths: -------------- trunk/PDFPage_SKExtensions.h trunk/PDFPage_SKExtensions.m trunk/SKPDFView.m Modified: trunk/PDFPage_SKExtensions.h =================================================================== --- trunk/PDFPage_SKExtensions.h 2007-05-22 19:06:31 UTC (rev 2111) +++ trunk/PDFPage_SKExtensions.h 2007-05-22 19:07:56 UTC (rev 2112) @@ -43,6 +43,8 @@ @interface PDFPage (SKExtensions) +- (NSRect)foregroundBox; +- (void)autoCrop; - (NSImage *)image; - (NSImage *)imageForBox:(PDFDisplayBox)box; - (NSImage *)thumbnailWithSize:(float)size forBox:(PDFDisplayBox)box; Modified: trunk/PDFPage_SKExtensions.m =================================================================== --- trunk/PDFPage_SKExtensions.m 2007-05-22 19:06:31 UTC (rev 2111) +++ trunk/PDFPage_SKExtensions.m 2007-05-22 19:07:56 UTC (rev 2112) @@ -41,10 +41,57 @@ #import "SKDocument.h" #import "SKPDFView.h" #import "PDFSelection_SKExtensions.h" +#import "OBUtilities.h" +#import "NSBitmapImageRep_SKExtensions.h" +@interface PDFPage (SKReplacementMethods) +- (void)replacementDealloc; +@end @implementation PDFPage (SKExtensions) +// A subclass with ivars would be nicer in some respects, but that would require subclassing PDFDocument and returning instances of the subclass for each page. +static CFMutableDictionaryRef _bboxTable = NULL; +static CFMutableSetRef _croppedPages = NULL; +static IMP originalDealloc = NULL; + ++ (void)load { + originalDealloc = OBReplaceMethodImplementationWithSelector(self, @selector(dealloc), @selector(replacementDealloc)); + _bboxTable = CFDictionaryCreateMutable(NULL, 0, NULL, &kCFTypeDictionaryValueCallBacks); + _croppedPages = CFSetCreateMutable(NULL, 0, NULL); +} + +- (void)replacementDealloc { + CFDictionaryRemoveValue(_bboxTable, self); + CFSetRemoveValue(_croppedPages, self); + originalDealloc(self, _cmd); +} + +// mainly useful for drawing the box in a PDFView while debugging +- (NSRect)foregroundBox { + + NSValue *rectValue = nil; + if (FALSE == CFDictionaryGetValueIfPresent(_bboxTable, (void *)self, (const void **)&rectValue)) { + NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithPDFPage:self forBox:kPDFDisplayBoxMediaBox]; + NSRect r = imageRep ? [imageRep foregroundRect] : NSZeroRect; + [imageRep release]; + if (NSEqualRects(NSZeroRect, r)) + r = [self boundsForBox:kPDFDisplayBoxMediaBox]; + else + r = NSInsetRect(r, -10, -10); + rectValue = [NSValue valueWithRect:r]; + CFDictionarySetValue(_bboxTable, (void *)self, (void *)rectValue); + } + return [rectValue rectValue]; +} + +- (void)autoCrop { + if (CFSetContainsValue(_croppedPages, (void *)self) == FALSE) { + [self setBounds:[self foregroundBox] forBox:kPDFDisplayBoxCropBox]; + CFSetAddValue(_croppedPages, (void *)self); + } +} + - (NSImage *)image { return [self imageForBox:kPDFDisplayBoxCropBox]; } Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-05-22 19:06:31 UTC (rev 2111) +++ trunk/SKPDFView.m 2007-05-22 19:07:56 UTC (rev 2112) @@ -220,6 +220,10 @@ #pragma mark Drawing - (void)drawPage:(PDFPage *)pdfPage { + + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"SKAutomaticallyCropPages"]) + [pdfPage autoCrop]; + // Let PDFView do most of the hard work. [super drawPage: pdfPage]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ama...@us...> - 2007-05-22 19:06:53
|
Revision: 2111 http://skim-app.svn.sourceforge.net/skim-app/?rev=2111&view=rev Author: amaxwell Date: 2007-05-22 12:06:31 -0700 (Tue, 22 May 2007) Log Message: ----------- Add NSBitmapImageRep category for cropping background. Modified Paths: -------------- trunk/Skim.xcodeproj/project.pbxproj Added Paths: ----------- trunk/NSBitmapImageRep_SKExtensions.h trunk/NSBitmapImageRep_SKExtensions.m Added: trunk/NSBitmapImageRep_SKExtensions.h =================================================================== --- trunk/NSBitmapImageRep_SKExtensions.h (rev 0) +++ trunk/NSBitmapImageRep_SKExtensions.h 2007-05-22 19:06:31 UTC (rev 2111) @@ -0,0 +1,47 @@ +// +// NSBitmapImageRep_SKExtensions.h +// Skim +// +// Created by Adam Maxwell on 05/22/07. +/* + This software is Copyright (c) 2007 + Adam Maxwell. 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 Adam Maxwell nor the names of any + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import <Cocoa/Cocoa.h> +#import <Quartz/Quartz.h> + +@interface NSBitmapImageRep (SKExtensions) + +- (NSBitmapImageRep *)initWithPDFPage:(PDFPage *)page forBox:(PDFDisplayBox)box; +- (NSRect)foregroundRect; + +@end Added: trunk/NSBitmapImageRep_SKExtensions.m =================================================================== --- trunk/NSBitmapImageRep_SKExtensions.m (rev 0) +++ trunk/NSBitmapImageRep_SKExtensions.m 2007-05-22 19:06:31 UTC (rev 2111) @@ -0,0 +1,148 @@ +// +// NSBitmapImageRep_SKExtensions.m +// Skim +// +// Created by Adam Maxwell on 05/22/07. +/* + This software is Copyright (c) 2007 + Adam Maxwell. 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 Adam Maxwell 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 "NSBitmapImageRep_SKExtensions.h" + +@implementation NSBitmapImageRep (SKExtensions) + +// allow for a slight margin around the image; maybe caused by a shadow (found this in testing) +static const int MARGIN = 2; + +static const unsigned EPSILON = 2; + +static inline BOOL similarPixels( const unsigned int *p1, const unsigned int *p2, unsigned count ) +{ + unsigned i; + for (i = 0; i < count; i++) { + if (abs(p2[i] - p1[i]) > EPSILON) + return NO; + } + return YES; +} + +- (NSRect)foregroundRect; +{ + int i, imax = [self pixelsWide] - MARGIN; + int j, jmax = [self pixelsHigh] - MARGIN; + NSRect bounds = NSZeroRect; + + unsigned int pixel[4] = { 0, 0, 0, 255 }; + + typedef struct _BoundingBox { + NSPoint lowerLeft; + NSPoint upperRight; + } BoundingBox; + + BoundingBox bbox; + bbox.lowerLeft = NSMakePoint(imax, jmax); + bbox.upperRight = NSMakePoint(MARGIN, MARGIN); + + unsigned int backgroundPixel[4]; + [self getPixel:backgroundPixel atX:MIN(MARGIN, imax) y:MIN(MARGIN, jmax)]; + + // basic idea borrowed from ImageMagick's statistics.c implementation + for (j = MARGIN; j < jmax; j++) + { + for (i = MARGIN; i < imax; i++) + { + [self getPixel:pixel atX:i y:(jmax-j)]; + BOOL isForeground = similarPixels(pixel, backgroundPixel, 4) == NO; + + // keep in mind that we're manipulating corner points, not height/width + if (i < bbox.lowerLeft.x && isForeground) + bbox.lowerLeft.x = i; + if (i > bbox.upperRight.x && isForeground) + bbox.upperRight.x = i; + if (j < bbox.lowerLeft.y && isForeground) + bbox.lowerLeft.y = j; + if (j > bbox.upperRight.y && isForeground) + bbox.upperRight.y = j; + } + } + + // finally, convert the corners to a bounding rect + bounds.origin = bbox.lowerLeft; + bounds.size.width = bbox.upperRight.x - bbox.lowerLeft.x; + bounds.size.height = bbox.upperRight.y - bbox.lowerLeft.y; + + return bounds; +} + +- (NSBitmapImageRep *)initWithPDFPage:(PDFPage *)page forBox:(PDFDisplayBox)box; +{ + + NSRect bounds = [page boundsForBox:box]; + self = [self initWithBitmapDataPlanes:NULL + pixelsWide:NSWidth(bounds) + pixelsHigh:NSHeight(bounds) + bitsPerSample:8 + samplesPerPixel:4 + hasAlpha:YES + isPlanar:NO + colorSpaceName:NSCalibratedRGBColorSpace + bitmapFormat:0 + bytesPerRow:0 /*(4 * NSWidth(maskRect)) */ + bitsPerPixel:32]; + if (self) { + [NSGraphicsContext saveGraphicsState]; + [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithBitmapImageRep:self]]; + [[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationNone]; + int rotation = [page rotation]; + if (rotation) { + NSAffineTransform *transform = [NSAffineTransform transform]; + [transform rotateByDegrees:rotation]; + switch (rotation) { + case 90: + [transform translateXBy:0.0 yBy:-NSWidth(bounds)]; + break; + case 180: + [transform translateXBy:-NSWidth(bounds) yBy:-NSHeight(bounds)]; + break; + case 270: + [transform translateXBy:-NSHeight(bounds) yBy:0.0]; + break; + } + [transform concat]; + } + [page drawWithBox:box]; + [NSGraphicsContext restoreGraphicsState]; + } + return self; +} + +@end Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-05-22 17:52:55 UTC (rev 2110) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-05-22 19:06:31 UTC (rev 2111) @@ -178,6 +178,7 @@ F92DB5AC0B36FE1F002A26E9 /* BDSKHeaderPopUpButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F92DB5A90B36FE1F002A26E9 /* BDSKHeaderPopUpButtonCell.m */; }; F92DB5AD0B36FE1F002A26E9 /* BDSKZoomablePDFView.m in Sources */ = {isa = PBXBuildFile; fileRef = F92DB5AB0B36FE1F002A26E9 /* BDSKZoomablePDFView.m */; }; F92DB5B30B36FE5E002A26E9 /* BDSKHeaderPopUpButton.m in Sources */ = {isa = PBXBuildFile; fileRef = F92DB5B20B36FE5E002A26E9 /* BDSKHeaderPopUpButton.m */; }; + F968C5A30C036E9D000BD1B2 /* NSBitmapImageRep_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = F968C5A10C036E9D000BD1B2 /* NSBitmapImageRep_SKExtensions.m */; }; F977319F0B939B7D002A7823 /* libbz2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F977319E0B939B7D002A7823 /* libbz2.dylib */; }; F97751600B37460100DF673B /* ConversionProgressWindow.nib in Resources */ = {isa = PBXBuildFile; fileRef = F977515E0B37460100DF673B /* ConversionProgressWindow.nib */; }; F97751630B37461000DF673B /* SKPSProgressController.m in Sources */ = {isa = PBXBuildFile; fileRef = F97751620B37461000DF673B /* SKPSProgressController.m */; }; @@ -308,7 +309,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>"; }; @@ -526,6 +527,8 @@ F92DB5AB0B36FE1F002A26E9 /* BDSKZoomablePDFView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BDSKZoomablePDFView.m; sourceTree = "<group>"; }; F92DB5B10B36FE5E002A26E9 /* BDSKHeaderPopUpButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BDSKHeaderPopUpButton.h; sourceTree = "<group>"; }; F92DB5B20B36FE5E002A26E9 /* BDSKHeaderPopUpButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BDSKHeaderPopUpButton.m; sourceTree = "<group>"; }; + F968C5A00C036E9D000BD1B2 /* NSBitmapImageRep_SKExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSBitmapImageRep_SKExtensions.h; sourceTree = "<group>"; }; + F968C5A10C036E9D000BD1B2 /* NSBitmapImageRep_SKExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSBitmapImageRep_SKExtensions.m; sourceTree = "<group>"; }; F977319E0B939B7D002A7823 /* libbz2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libbz2.dylib; path = /usr/lib/libbz2.dylib; sourceTree = "<absolute>"; }; F977515F0B37460100DF673B /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/ConversionProgressWindow.nib; sourceTree = "<group>"; }; F97751610B37461000DF673B /* SKPSProgressController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKPSProgressController.h; sourceTree = "<group>"; }; @@ -693,6 +696,8 @@ CE3A45520B7A04A4006B64D3 /* NSBezierPath_BDSKExtensions.m */, CE4EC87D0B7E6E110091F228 /* NSBezierPath_CoreImageExtensions.h */, CE4EC87E0B7E6E110091F228 /* NSBezierPath_CoreImageExtensions.m */, + F968C5A00C036E9D000BD1B2 /* NSBitmapImageRep_SKExtensions.h */, + F968C5A10C036E9D000BD1B2 /* NSBitmapImageRep_SKExtensions.m */, CE1E30260BDB9D8E0011D9DD /* NSCharacterSet_SKExtensions.h */, CE1E30270BDB9D8E0011D9DD /* NSCharacterSet_SKExtensions.m */, CE2DE4EC0B85DB6300D0DA12 /* NSCursor_SKExtensions.h */, @@ -1309,6 +1314,7 @@ CE6C03F10BEDF759007BF0B5 /* NSParagraphStyle_SKExtensions.m in Sources */, CE5F42AF0BF89FE00069D89C /* AppleRemote.m in Sources */, CE31A6180C01FC45003612A9 /* SKDocumentController.m in Sources */, + F968C5A30C036E9D000BD1B2 /* NSBitmapImageRep_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-05-22 17:53:14
|
Revision: 2110 http://skim-app.svn.sourceforge.net/skim-app/?rev=2110&view=rev Author: hofman Date: 2007-05-22 10:52:55 -0700 (Tue, 22 May 2007) Log Message: ----------- Update release notes. Modified Paths: -------------- trunk/ReleaseNotes.rtf Modified: trunk/ReleaseNotes.rtf =================================================================== --- trunk/ReleaseNotes.rtf 2007-05-22 17:49:49 UTC (rev 2109) +++ trunk/ReleaseNotes.rtf 2007-05-22 17:52:55 UTC (rev 2110) @@ -70,16 +70,23 @@ {\list\listtemplateid65\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid65} {\list\listtemplateid66\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid66} {\list\listtemplateid67\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid67} -{\list\listtemplateid68\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid68}} -{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}{\listoverride\listid5\listoverridecount0\ls5}{\listoverride\listid6\listoverridecount0\ls6}{\listoverride\listid7\listoverridecount0\ls7}{\listoverride\listid8\listoverridecount0\ls8}{\listoverride\listid9\listoverridecount0\ls9}{\listoverride\listid10\listoverridecount0\ls10}{\listoverride\listid11\listoverridecount0\ls11}{\listoverride\listid12\listoverridecount0\ls12}{\listoverride\listid13\listoverridecount0\ls13}{\listoverride\listid14\listoverridecount0\ls14}{\listoverride\listid15\listoverridecount0\ls15}{\listoverride\listid16\listoverridecount0\ls16}{\listoverride\listid17\listoverridecount0\ls17}{\listoverride\listid18\listoverridecount0\ls18}{\listoverride\listid19\listoverridecount0\ls19}{\listoverride\listid20\listoverridecount0\ls20}{\listoverride\listid21\listoverridecount0\ls21}{\listoverride\listid22\listoverridecount0\ls22}{\listoverride\listid23\listoverridecount0\ls23}{\listoverride\listid24\listoverridecount0\ls24}{\listoverride\listid25\listoverridecount0\ls25}{\listoverride\listid26\listoverridecount0\ls26}{\listoverride\listid27\listoverridecount0\ls27}{\listoverride\listid28\listoverridecount0\ls28}{\listoverride\listid29\listoverridecount0\ls29}{\listoverride\listid30\listoverridecount0\ls30}{\listoverride\listid31\listoverridecount0\ls31}{\listoverride\listid32\listoverridecount0\ls32}{\listoverride\listid33\listoverridecount0\ls33}{\listoverride\listid34\listoverridecount0\ls34}{\listoverride\listid35\listoverridecount0\ls35}{\listoverride\listid36\listoverridecount0\ls36}{\listoverride\listid37\listoverridecount0\ls37}{\listoverride\listid38\listoverridecount0\ls38}{\listoverride\listid39\listoverridecount0\ls39}{\listoverride\listid40\listoverridecount0\ls40}{\listoverride\listid41\listoverridecount0\ls41}{\listoverride\listid42\listoverridecount0\ls42}{\listoverride\listid43\listoverridecount0\ls43}{\listoverride\listid44\listoverridecount0\ls44}{\listoverride\listid45\listoverridecount0\ls45}{\listoverride\listid46\listoverridecount0\ls46}{\listoverride\listid47\listoverridecount0\ls47}{\listoverride\listid48\listoverridecount0\ls48}{\listoverride\listid49\listoverridecount0\ls49}{\listoverride\listid50\listoverridecount0\ls50}{\listoverride\listid51\listoverridecount0\ls51}{\listoverride\listid52\listoverridecount0\ls52}{\listoverride\listid53\listoverridecount0\ls53}{\listoverride\listid54\listoverridecount0\ls54}{\listoverride\listid55\listoverridecount0\ls55}{\listoverride\listid56\listoverridecount0\ls56}{\listoverride\listid57\listoverridecount0\ls57}{\listoverride\listid58\listoverridecount0\ls58}{\listoverride\listid59\listoverridecount0\ls59}{\listoverride\listid60\listoverridecount0\ls60}{\listoverride\listid61\listoverridecount0\ls61}{\listoverride\listid62\listoverridecount0\ls62}{\listoverride\listid63\listoverridecount0\ls63}{\listoverride\listid64\listoverridecount0\ls64}{\listoverride\listid65\listoverridecount0\ls65}{\listoverride\listid66\listoverridecount0\ls66}{\listoverride\listid67\listoverridecount0\ls67}{\listoverride\listid68\listoverridecount0\ls68}} +{\list\listtemplateid68\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid68} +{\list\listtemplateid69\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid69} +{\list\listtemplateid70\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid70} +{\list\listtemplateid71\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid71} +{\list\listtemplateid72\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid72} +{\list\listtemplateid73\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid73} +{\list\listtemplateid74\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid74} +{\list\listtemplateid75\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid75}} +{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}{\listoverride\listid5\listoverridecount0\ls5}{\listoverride\listid6\listoverridecount0\ls6}{\listoverride\listid7\listoverridecount0\ls7}{\listoverride\listid8\listoverridecount0\ls8}{\listoverride\listid9\listoverridecount0\ls9}{\listoverride\listid10\listoverridecount0\ls10}{\listoverride\listid11\listoverridecount0\ls11}{\listoverride\listid12\listoverridecount0\ls12}{\listoverride\listid13\listoverridecount0\ls13}{\listoverride\listid14\listoverridecount0\ls14}{\listoverride\listid15\listoverridecount0\ls15}{\listoverride\listid16\listoverridecount0\ls16}{\listoverride\listid17\listoverridecount0\ls17}{\listoverride\listid18\listoverridecount0\ls18}{\listoverride\listid19\listoverridecount0\ls19}{\listoverride\listid20\listoverridecount0\ls20}{\listoverride\listid21\listoverridecount0\ls21}{\listoverride\listid22\listoverridecount0\ls22}{\listoverride\listid23\listoverridecount0\ls23}{\listoverride\listid24\listoverridecount0\ls24}{\listoverride\listid25\listoverridecount0\ls25}{\listoverride\listid26\listoverridecount0\ls26}{\listoverride\listid27\listoverridecount0\ls27}{\listoverride\listid28\listoverridecount0\ls28}{\listoverride\listid29\listoverridecount0\ls29}{\listoverride\listid30\listoverridecount0\ls30}{\listoverride\listid31\listoverridecount0\ls31}{\listoverride\listid32\listoverridecount0\ls32}{\listoverride\listid33\listoverridecount0\ls33}{\listoverride\listid34\listoverridecount0\ls34}{\listoverride\listid35\listoverridecount0\ls35}{\listoverride\listid36\listoverridecount0\ls36}{\listoverride\listid37\listoverridecount0\ls37}{\listoverride\listid38\listoverridecount0\ls38}{\listoverride\listid39\listoverridecount0\ls39}{\listoverride\listid40\listoverridecount0\ls40}{\listoverride\listid41\listoverridecount0\ls41}{\listoverride\listid42\listoverridecount0\ls42}{\listoverride\listid43\listoverridecount0\ls43}{\listoverride\listid44\listoverridecount0\ls44}{\listoverride\listid45\listoverridecount0\ls45}{\listoverride\listid46\listoverridecount0\ls46}{\listoverride\listid47\listoverridecount0\ls47}{\listoverride\listid48\listoverridecount0\ls48}{\listoverride\listid49\listoverridecount0\ls49}{\listoverride\listid50\listoverridecount0\ls50}{\listoverride\listid51\listoverridecount0\ls51}{\listoverride\listid52\listoverridecount0\ls52}{\listoverride\listid53\listoverridecount0\ls53}{\listoverride\listid54\listoverridecount0\ls54}{\listoverride\listid55\listoverridecount0\ls55}{\listoverride\listid56\listoverridecount0\ls56}{\listoverride\listid57\listoverridecount0\ls57}{\listoverride\listid58\listoverridecount0\ls58}{\listoverride\listid59\listoverridecount0\ls59}{\listoverride\listid60\listoverridecount0\ls60}{\listoverride\listid61\listoverridecount0\ls61}{\listoverride\listid62\listoverridecount0\ls62}{\listoverride\listid63\listoverridecount0\ls63}{\listoverride\listid64\listoverridecount0\ls64}{\listoverride\listid65\listoverridecount0\ls65}{\listoverride\listid66\listoverridecount0\ls66}{\listoverride\listid67\listoverridecount0\ls67}{\listoverride\listid68\listoverridecount0\ls68}{\listoverride\listid69\listoverridecount0\ls69}{\listoverride\listid70\listoverridecount0\ls70}{\listoverride\listid71\listoverridecount0\ls71}{\listoverride\listid72\listoverridecount0\ls72}{\listoverride\listid73\listoverridecount0\ls73}{\listoverride\listid74\listoverridecount0\ls74}{\listoverride\listid75\listoverridecount0\ls75}} \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f0\fs60 \cf0 Skim Release Notes\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\fs22 \cf0 \ -Last update: 18 May 2007 (rev -\f2\fs20 2076) +Last update: 22 May 2007 (rev +\f2\fs20 2109) \f1\fs22 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural @@ -116,102 +123,117 @@ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls12\ilvl0\cf0 {\listtext \'a5 }New select tool. Allows you to copy PDF and TIFF images from a section of a page.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls13\ilvl0\cf0 {\listtext \'a5 }You can now search Skim note files from Spotlight.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls14\ilvl0\cf0 {\listtext \'a5 }New Crop menu items and toolbar button.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls15\ilvl0\cf0 {\listtext \'a5 }Cropping and page rotation are now undoable.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls16\ilvl0\cf0 {\listtext \'a5 }Allow reverting a document when it has changed on disk.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \f3\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f4\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls13\ilvl0 +\ls17\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Fix links in help.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls14\ilvl0\cf0 {\listtext \'a5 }Don't create a new note in note tool mode on mousedown outside a page.\ +\ls18\ilvl0\cf0 {\listtext \'a5 }Don't create a new note in note tool mode on mousedown outside a page.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls15\ilvl0\cf0 {\listtext \'a5 }Don't add new resizable notes in note tool mode when just clicking.\ +\ls19\ilvl0\cf0 {\listtext \'a5 }Don't add new resizable notes in note tool mode when just clicking.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls16\ilvl0\cf0 {\listtext \'a5 }You can now access links that are "hidden" by transparent highlights and arrows.\ +\ls20\ilvl0\cf0 {\listtext \'a5 }You can now access links that are "hidden" by transparent highlights and arrows.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls17\ilvl0\cf0 {\listtext \'a5 }Scroll reading bar to visible when it is shown.\ +\ls21\ilvl0\cf0 {\listtext \'a5 }Scroll reading bar to visible when it is shown.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls18\ilvl0\cf0 {\listtext \'a5 }Scroll to previous position on page when reloading PDF.\ +\ls22\ilvl0\cf0 {\listtext \'a5 }Scroll to previous position on page when reloading PDF.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls23\ilvl0\cf0 {\listtext \'a5 }Escape spaces in TeX editor command.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls24\ilvl0\cf0 {\listtext \'a5 }Thumbnails now use the current display box.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls25\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 +\ls25\ilvl0 +\f3\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural - -\f3\b\fs28 \cf0 \ -Changes since 0.2\ +\cf0 Changes since 0.2\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \f4\i\fs26 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 New Features\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls19\ilvl0 +\ls26\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }Add shortcuts for bigger/smaller font sizes.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls20\ilvl0\cf0 {\listtext \'a5 }Command-click a snapshot.\ +\ls27\ilvl0\cf0 {\listtext \'a5 }Command-click a snapshot.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls21\ilvl0\cf0 {\listtext \'a5 }We now print notes and highlights.\ +\ls28\ilvl0\cf0 {\listtext \'a5 }We now print notes and highlights.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls22\ilvl0\cf0 {\listtext \'a5 }Add copy/cut/paste items to the contextual menu, when they apply.\ +\ls29\ilvl0\cf0 {\listtext \'a5 }Add copy/cut/paste items to the contextual menu, when they apply.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls23\ilvl0\cf0 {\listtext \'a5 }You can now make a snapshot of a page by Command-clicking a thumbnail.\ +\ls30\ilvl0\cf0 {\listtext \'a5 }You can now make a snapshot of a page by Command-clicking a thumbnail.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls24\ilvl0\cf0 {\listtext \'a5 }Added Dutch localization.\ +\ls31\ilvl0\cf0 {\listtext \'a5 }Added Dutch localization.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls25\ilvl0\cf0 {\listtext \'a5 }We now do not leave Full Screen when switching to another application.\ +\ls32\ilvl0\cf0 {\listtext \'a5 }We now do not leave Full Screen when switching to another application.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls26\ilvl0\cf0 {\listtext \'a5 }Export notes as RTF.\ +\ls33\ilvl0\cf0 {\listtext \'a5 }Export notes as RTF.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls27\ilvl0\cf0 {\listtext \'a5 }Add preference options for default note/highlight colors and text note font.\ +\ls34\ilvl0\cf0 {\listtext \'a5 }Add preference options for default note/highlight colors and text note font.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls28\ilvl0\cf0 {\listtext \'a5 }Add menu item to save the current PDF display settings to be used for new documents.\ +\ls35\ilvl0\cf0 {\listtext \'a5 }Add menu item to save the current PDF display settings to be used for new documents.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls29\ilvl0\cf0 {\listtext \'a5 }Search results from the Find Panel are now also highlighted with a red oval.\ +\ls36\ilvl0\cf0 {\listtext \'a5 }Search results from the Find Panel are now also highlighted with a red oval.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls30\ilvl0\cf0 {\listtext \'a5 }Select search field when opening the Contents pane in full screen mode.\ +\ls37\ilvl0\cf0 {\listtext \'a5 }Select search field when opening the Contents pane in full screen mode.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls31\ilvl0\cf0 {\listtext \'a5 }You can now reset all preferences or all preferences in a pane.\ +\ls38\ilvl0\cf0 {\listtext \'a5 }You can now reset all preferences or all preferences in a pane.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls32\ilvl0\cf0 {\listtext \'a5 }Added Italian localization. (Thanks Andrea Bergia!)\ +\ls39\ilvl0\cf0 {\listtext \'a5 }Added Italian localization. (Thanks Andrea Bergia!)\ {\listtext \'a5 }Screensaver and sleep are now disabled in Presentation mode.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls33\ilvl0\cf0 {\listtext \'a5 }Skim can now return to the last page viewed in a document.\ +\ls40\ilvl0\cf0 {\listtext \'a5 }Skim can now return to the last page viewed in a document.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls34\ilvl0\cf0 {\listtext \'a5 }Link tool tips now show the top of the text when the link refers to the (empty) top of a page. \ +\ls41\ilvl0\cf0 {\listtext \'a5 }Link tool tips now show the top of the text when the link refers to the (empty) top of a page. \ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls35\ilvl0\cf0 {\listtext \'a5 }Skim can now also view separate Skim notes (.skim) files.\ +\ls42\ilvl0\cf0 {\listtext \'a5 }Skim can now also view separate Skim notes (.skim) files.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls36\ilvl0\cf0 {\listtext \'a5 }Using Sparkle for automatic updating. (Thanks Andy Matuschak!)\ +\ls43\ilvl0\cf0 {\listtext \'a5 }Using Sparkle for automatic updating. (Thanks Andy Matuschak!)\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls37\ilvl0\cf0 {\listtext \'a5 }Display the number of pages in the title bar.\ +\ls44\ilvl0\cf0 {\listtext \'a5 }Display the number of pages in the title bar.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls38\ilvl0\cf0 {\listtext \'a5 }Skim can now automatically backup a skim notes file whenever it saves a PDF file.\ +\ls45\ilvl0\cf0 {\listtext \'a5 }Skim can now automatically backup a skim notes file whenever it saves a PDF file.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls39\ilvl0\cf0 {\listtext \'a5 }You can now resize the current note using the arrow keys, when you hold down the Control key.\ +\ls46\ilvl0\cf0 {\listtext \'a5 }You can now resize the current note using the arrow keys, when you hold down the Control key.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls40\ilvl0\cf0 {\listtext \'a5 }Notes are now ordered according to page and location in page.\ +\ls47\ilvl0\cf0 {\listtext \'a5 }Notes are now ordered according to page and location in page.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls41\ilvl0\cf0 {\listtext \'a5 }Several improvements of Skim's custom tool-tips.\ +\ls48\ilvl0\cf0 {\listtext \'a5 }Several improvements of Skim's custom tool-tips.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls42\ilvl0\cf0 {\listtext \'a5 }Add a menu item to select the search field.\ +\ls49\ilvl0\cf0 {\listtext \'a5 }Add a menu item to select the search field.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls43\ilvl0\cf0 {\listtext \'a5 }You can now add arrows to a PDF document.\ +\ls50\ilvl0\cf0 {\listtext \'a5 }You can now add arrows to a PDF document.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls44\ilvl0\cf0 {\listtext \'a5 }You can now add notes from external .skim files rather than just overwriting them.\ +\ls51\ilvl0\cf0 {\listtext \'a5 }You can now add notes from external .skim files rather than just overwriting them.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls45\ilvl0\cf0 {\listtext \'a5 }PDFSync support. See the Wiki for more information.\ +\ls52\ilvl0\cf0 {\listtext \'a5 }PDFSync support. See the Wiki for more information.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls46\ilvl0\cf0 {\listtext \'a5 }You can now set transparent colors from the color panel. \ +\ls53\ilvl0\cf0 {\listtext \'a5 }You can now set transparent colors from the color panel. \ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls47\ilvl0\cf0 {\listtext \'a5 }You can now set separate PDF view settigns for full screen mode. \ +\ls54\ilvl0\cf0 {\listtext \'a5 }You can now set separate PDF view settigns for full screen mode. \ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls48\ilvl0\cf0 {\listtext \'a5 }Add a Look Up in Dictionary item to the contextual menu.\ +\ls55\ilvl0\cf0 {\listtext \'a5 }Add a Look Up in Dictionary item to the contextual menu.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls49\ilvl0\cf0 {\listtext \'a5 }You can now undo edits of notes and highlights.\ +\ls56\ilvl0\cf0 {\listtext \'a5 }You can now undo edits of notes and highlights.\ {\listtext \'a5 }Add a hidden preference (SKActivateFullScreenNavigationAtBottom) to show the navigation buttons in full screen mode only when moving the mouse at the bottom of the screen. \ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls50\ilvl0\cf0 {\listtext \'a5 }Add hidden preferences for the line widths of circles and boxes (SKCircleNoteLineWidth and SKSquareNoteLineWidth).\ +\ls57\ilvl0\cf0 {\listtext \'a5 }Add hidden preferences for the line widths of circles and boxes (SKCircleNoteLineWidth and SKSquareNoteLineWidth).\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls51\ilvl0\cf0 {\listtext \'a5 }New tool modes for ading notes or highlights.\ +\ls58\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 \ @@ -219,40 +241,40 @@ \f4\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls52\ilvl0 +\ls59\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }We now don't edit new text notes, so they can be moved, resized or deleted.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls53\ilvl0\cf0 {\listtext \'a5 }We now make sure new notes are added to a visible page.\ +\ls60\ilvl0\cf0 {\listtext \'a5 }We now make sure new notes are added to a visible page.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls54\ilvl0\cf0 {\listtext \'a5 }Disable the TOC menu item when there is no TOC.\ +\ls61\ilvl0\cf0 {\listtext \'a5 }Disable the TOC menu item when there is no TOC.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls55\ilvl0\cf0 {\listtext \'a5 }Return to the location that was viewed when reloading a document.\ +\ls62\ilvl0\cf0 {\listtext \'a5 }Return to the location that was viewed when reloading a document.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls56\ilvl0\cf0 {\listtext \'a5 }Search text in a PDf file asynchronously, so it does not block Skim.\ +\ls63\ilvl0\cf0 {\listtext \'a5 }Search text in a PDf file asynchronously, so it does not block Skim.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls57\ilvl0\cf0 {\listtext \'a5 }Fix crashes that can appear for links with missing URLs.\ +\ls64\ilvl0\cf0 {\listtext \'a5 }Fix crashes that can appear for links with missing URLs.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls58\ilvl0\cf0 {\listtext \'a5 }Add separators in the Notes menu for categories.\ +\ls65\ilvl0\cf0 {\listtext \'a5 }Add separators in the Notes menu for categories.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls59\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting a PDF-document.\ +\ls66\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting a PDF-document.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls60\ilvl0\cf0 {\listtext \'a5 }Fix typos in the Help and update for new features.\ +\ls67\ilvl0\cf0 {\listtext \'a5 }Fix typos in the Help and update for new features.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls61\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting the document. Unfortunately this disabled tool tips.\ +\ls68\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting the document. Unfortunately this disabled tool tips.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls62\ilvl0\cf0 {\listtext \'a5 }Open the contents pane to display the search term when opening from Spotlight.\ +\ls69\ilvl0\cf0 {\listtext \'a5 }Open the contents pane to display the search term when opening from Spotlight.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls63\ilvl0\cf0 {\listtext \'a5 }Save notes when auto-saving and exporting as PDF.\ +\ls70\ilvl0\cf0 {\listtext \'a5 }Save notes when auto-saving and exporting as PDF.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls64\ilvl0\cf0 {\listtext \'a5 }Remember the width of notes pane.\ +\ls71\ilvl0\cf0 {\listtext \'a5 }Remember the width of notes pane.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls65\ilvl0\cf0 {\listtext \'a5 }Fix leaks leading to excessive memory use.\ +\ls72\ilvl0\cf0 {\listtext \'a5 }Fix leaks leading to excessive memory use.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls66\ilvl0\cf0 {\listtext \'a5 }Fix back-tabbing through notes and links.\ +\ls73\ilvl0\cf0 {\listtext \'a5 }Fix back-tabbing through notes and links.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls67\ilvl0\cf0 {\listtext \'a5 }Zooming using the scroll-wheel now only affects the current window.\ +\ls74\ilvl0\cf0 {\listtext \'a5 }Zooming using the scroll-wheel now only affects the current window.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls68\ilvl0\cf0 {\listtext \'a5 }Lazy updating of page thumbnails to avoid slowdown when opening a file.\ +\ls75\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 \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-05-22 17:49:50
|
Revision: 2109 http://skim-app.svn.sourceforge.net/skim-app/?rev=2109&view=rev Author: hofman Date: 2007-05-22 10:49:49 -0700 (Tue, 22 May 2007) Log Message: ----------- Only do custom revert when lastChangedDate was set. Modified Paths: -------------- trunk/SKDocument.m Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-05-22 17:34:56 UTC (rev 2108) +++ trunk/SKDocument.m 2007-05-22 17:49:49 UTC (rev 2109) @@ -507,7 +507,7 @@ if ([self fileName]) { if ([self isDocumentEdited]) { [super revertDocumentToSaved:sender]; - } else { + } else if (lastChangedDate) { BOOL shouldRevert = fileChangedOnDisk; if (shouldRevert == NO) { NSDate *fileChangedDate = [[[NSFileManager defaultManager] fileAttributesAtPath:[self fileName] traverseLink:YES] fileModificationDate]; @@ -540,6 +540,8 @@ return NO; if ([self isDocumentEdited] || fileChangedOnDisk) return YES; + if (lastChangedDate == nil) + return NO; NSDate *fileChangedDate = [[[NSFileManager defaultManager] fileAttributesAtPath:[self fileName] traverseLink:YES] fileModificationDate]; return [lastChangedDate compare:fileChangedDate] == NSOrderedAscending; } else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |