[Skim-app-commit] SF.net SVN: skim-app: [2602] trunk/Skim.xcodeproj/project.pbxproj
Revision: 2602 http://skim-app.svn.sourceforge.net/skim-app/?rev=2602view=rev Author: hofman Date: 2007-08-02 01:50:10 -0700 (Thu, 02 Aug 2007) Log Message: --- Fix xcode annoyance Modified Paths: -- trunk/Skim.xcodeproj/project.pbxproj Modified: trunk/Skim.xcodeproj/project.pbxproj === --- trunk/Skim.xcodeproj/project.pbxproj2007-08-02 08:48:39 UTC (rev 2601) +++ trunk/Skim.xcodeproj/project.pbxproj2007-08-02 08:50:10 UTC (rev 2602) @@ -555,8 +555,6 @@ CECDD2970C5B68580026AAEC /* SKCenteredTextFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKCenteredTextFieldCell.m; sourceTree = group; }; CECDDBAB0C5BB95F0026AAEC /* SKFindTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKFindTableView.h; sourceTree = group; }; CECDDBAC0C5BB95F0026AAEC /* SKFindTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKFindTableView.m; sourceTree = group; }; - CEDD421E0C61D1770022856C /* NSImage_BDSKExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSImage_BDSKExtensions.m; sourceTree = group; }; - CEDD421F0C61D1840022856C /* NSImage_BDSKExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSImage_BDSKExtensions.m; sourceTree = group; }; CEE106130BCBB72C00BF2D3E /* SKNotesDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKNotesDocument.h; sourceTree = group; }; CEE106140BCBB72C00BF2D3E /* SKNotesDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKNotesDocument.m; sourceTree = group; }; CEE106590BCBBE1200BF2D3E /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/NotesDocument.nib; sourceTree = group; }; @@ -775,8 +773,6 @@ CE5487BA0B35A20A00F8AFB6 /* NSFileManager_ExtendedAttributes.h */, CE5487BB0B35A20A00F8AFB6 /* NSFileManager_ExtendedAttributes.m */, CECDC4FC0C5966A80026AAEC /* NSImage_SKExtensions.h */, - CEDD421E0C61D1770022856C /* NSImage_BDSKExtensions.m */, - CEDD421F0C61D1840022856C /* NSImage_BDSKExtensions.m */, CECDC4FD0C5966A80026AAEC /* NSImage_SKExtensions.m */, CE6C03EE0BEDF759007BF0B5 /* NSParagraphStyle_SKExtensions.h */, CE6C03EF0BEDF759007BF0B5 /* NSParagraphStyle_SKExtensions.m */, 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2603] trunk/SKDocument.m
Revision: 2603 http://skim-app.svn.sourceforge.net/skim-app/?rev=2603view=rev Author: hofman Date: 2007-08-03 09:40:12 -0700 (Fri, 03 Aug 2007) Log Message: --- Take page rotation into account to decide for prinitng landscape. Modified Paths: -- trunk/SKDocument.m Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-08-02 08:50:10 UTC (rev 2602) +++ trunk/SKDocument.m 2007-08-03 16:40:12 UTC (rev 2603) @@ -108,11 +108,13 @@ SKMainWindowController *mainController = (SKMainWindowController *)aController; if ([pdfDocument pageCount]) { +PDFPage *page = [pdfDocument pageAtIndex:0]; NSPrintInfo *printInfo = [self printInfo]; NSSize paperSize = [printInfo paperSize]; -NSSize pageSize = [[pdfDocument pageAtIndex:0] boundsForBox:kPDFDisplayBoxMediaBox].size; -if ((pageSize.width pageSize.height) != (paperSize.width paperSize.height)) -[printInfo setOrientation:NSLandscapeOrientation]; +NSSize pageSize = [page boundsForBox:kPDFDisplayBoxMediaBox].size; +BOOL isRotated = [page rotation] % 180 == 90; +BOOL isWide = (pageSize.width pageSize.height) != (paperSize.width paperSize.height); +[printInfo setOrientation:isRotated == isWide ? NSPortraitOrientation : NSLandscapeOrientation]; } [mainController setPdfDocument:pdfDocument]; 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2604] trunk/SKPDFAnnotationNote.m
Revision: 2604 http://skim-app.svn.sourceforge.net/skim-app/?rev=2604view=rev Author: hofman Date: 2007-08-05 05:58:57 -0700 (Sun, 05 Aug 2007) Log Message: --- Remove border when a note was saved with zero line width. Modified Paths: -- trunk/SKPDFAnnotationNote.m Modified: trunk/SKPDFAnnotationNote.m === --- trunk/SKPDFAnnotationNote.m 2007-08-03 16:40:12 UTC (rev 2603) +++ trunk/SKPDFAnnotationNote.m 2007-08-05 12:58:57 UTC (rev 2604) @@ -189,14 +189,19 @@ originalSetContents(self, @selector(setContents:), contents); if (color) originalSetColor(self, @selector(setColor:), color); -if ((lineWidth || borderStyle || dashPattern) [self border] == nil) -originalSetBorder(self, @selector(setBorder:), [[[PDFBorder alloc] init] autorelease]); -if (lineWidth) -[[self border] setLineWidth:[lineWidth floatValue]]; -if (borderStyle) -[[self border] setStyle:[lineWidth intValue]]; -if (dashPattern) -[[self border] setDashPattern:dashPattern]; +if (lineWidth == nil borderStyle == nil dashPattern == nil) { +if ([self border]) +originalSetBorder(self, @selector(setBorder:), nil); +} else { +if ([self border] == nil) +originalSetBorder(self, @selector(setBorder:), [[[PDFBorder alloc] init] autorelease]); +if (lineWidth) +[[self border] setLineWidth:[lineWidth floatValue]]; +if (borderStyle) +[[self border] setStyle:[lineWidth intValue]]; +if (dashPattern) +[[self border] setDashPattern:dashPattern]; +} } return self; } 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2605] trunk
Revision: 2605 http://skim-app.svn.sourceforge.net/skim-app/?rev=2605view=rev Author: hofman Date: 2007-08-05 09:45:53 -0700 (Sun, 05 Aug 2007) Log Message: --- Add new toolbar item to add new notes in a single segmentedControl. Add contextual menus for thumbnail table views. Validate custom menu items for those tables. Hard code the superclass for checking wether super responds to a selector, as the class of super is implicitly also hard coded. Otherwise it may check the wrong (sub)class. Modified Paths: -- trunk/BDSKZoomablePDFView.m trunk/Dutch.lproj/Localizable.strings trunk/Dutch.lproj/MainWindow.nib/classes.nib trunk/Dutch.lproj/MainWindow.nib/data.dependency trunk/Dutch.lproj/MainWindow.nib/info.nib trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib trunk/Dutch.lproj/NoteWindow.nib/info.nib trunk/Dutch.lproj/NoteWindow.nib/keyedobjects.nib trunk/English.lproj/MainWindow.nib/classes.nib trunk/English.lproj/MainWindow.nib/info.nib trunk/English.lproj/MainWindow.nib/keyedobjects.nib trunk/French.lproj/Localizable.strings trunk/French.lproj/MainWindow.nib/classes.nib trunk/French.lproj/MainWindow.nib/info.nib trunk/French.lproj/MainWindow.nib/keyedobjects.nib trunk/Italian.lproj/Localizable.strings trunk/Italian.lproj/MainWindow.nib/classes.nib trunk/Italian.lproj/MainWindow.nib/info.nib trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib trunk/NSImage_SKExtensions.m trunk/SKApplication.m trunk/SKMainWindowController.h trunk/SKMainWindowController.m trunk/SKPDFView.m trunk/SKThumbnailTableView.h trunk/SKThumbnailTableView.m Modified: trunk/BDSKZoomablePDFView.m === --- trunk/BDSKZoomablePDFView.m 2007-08-05 12:58:57 UTC (rev 2604) +++ trunk/BDSKZoomablePDFView.m 2007-08-05 16:45:53 UTC (rev 2605) @@ -88,7 +88,7 @@ id document = [[[self window] windowController] document]; if ([document respondsToSelector:_cmd]) [document printDocument:sender]; -else if ([[self superclass] instancesRespondToSelector:_cmd]) +else if ([PDFView instancesRespondToSelector:_cmd]) [(id)super printDocument:sender]; } Modified: trunk/Dutch.lproj/Localizable.strings === (Binary files differ) Modified: trunk/Dutch.lproj/MainWindow.nib/classes.nib === --- trunk/Dutch.lproj/MainWindow.nib/classes.nib2007-08-05 12:58:57 UTC (rev 2604) +++ trunk/Dutch.lproj/MainWindow.nib/classes.nib2007-08-05 16:45:53 UTC (rev 2605) @@ -134,6 +134,7 @@ leftSideGradientView = BDSKGradientView; markupPopUpButton = BDSKImagePopUpButton; noteArrayController = NSArrayController; +noteButton = NSSegmentedControl; noteOutlineView = SKNoteOutlineView; notePopUpButton = BDSKImagePopUpButton; noteSearchField = NSSearchField; Modified: trunk/Dutch.lproj/MainWindow.nib/data.dependency === --- trunk/Dutch.lproj/MainWindow.nib/data.dependency2007-08-05 12:58:57 UTC (rev 2604) +++ trunk/Dutch.lproj/MainWindow.nib/data.dependency2007-08-05 16:45:53 UTC (rev 2605) @@ -4,6 +4,7 @@ dict keyIBPaletteDependency/key array + stringControllers/string stringPDFKit/string /array /dict Modified: trunk/Dutch.lproj/MainWindow.nib/info.nib === --- trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-08-05 12:58:57 UTC (rev 2604) +++ trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-08-05 16:45:53 UTC (rev 2605) @@ -7,7 +7,7 @@ keyIBEditorPositions/key dict key168/key - string601 521 237 239 0 0 1440 938 /string + string601 495 237 265 0 0 1440 938 /string key224/key string610 420 220 442 0 0 1440 938 /string key256/key @@ -29,11 +29,6 @@ array integer208/integer /array - keyIBOpenObjects/key - array - integer687/integer - integer694/integer - /array keyIBSystem Version/key string8R218/string /dict Modified: trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/Dutch.lproj/NoteWindow.nib/info.nib === --- trunk/Dutch.lproj/NoteWindow.nib/info.nib 2007-08-05 12:58:57 UTC (rev 2604) +++ trunk/Dutch.lproj/NoteWindow.nib/info.nib 2007-08-05 16:45:53 UTC (rev 2605) @@ -6,10 +6,6 @@ string69 58 356 240 0 0
[Skim-app-commit] SF.net SVN: skim-app: [2606] trunk
Revision: 2606 http://skim-app.svn.sourceforge.net/skim-app/?rev=2606view=rev Author: hofman Date: 2007-08-05 13:29:27 -0700 (Sun, 05 Aug 2007) Log Message: --- Remove copying and contextual menu code from BDSKZoomablePDFView as this is not relevant here. Modified Paths: -- trunk/BDSKZoomablePDFView.h trunk/BDSKZoomablePDFView.m Modified: trunk/BDSKZoomablePDFView.h === --- trunk/BDSKZoomablePDFView.h 2007-08-05 16:45:53 UTC (rev 2605) +++ trunk/BDSKZoomablePDFView.h 2007-08-05 20:29:27 UTC (rev 2606) @@ -42,7 +42,6 @@ @interface BDSKZoomablePDFView : PDFView { NSPopUpButton *scalePopUpButton; -NSDictionary *pasteboardInfo; } - (void)setScaleFactor:(float)factor adjustPopup:(BOOL)flag; Modified: trunk/BDSKZoomablePDFView.m === --- trunk/BDSKZoomablePDFView.m 2007-08-05 16:45:53 UTC (rev 2605) +++ trunk/BDSKZoomablePDFView.m 2007-08-05 20:29:27 UTC (rev 2606) @@ -63,170 +63,6 @@ static float BDSKDefaultScaleMenuFactors[] = {/* 0.0, */ 0, 0.1, 0.25, 0.5, 0.75, 1.0, 1.28, 1.5, 2.0, 4.0, 8.0}; static float BDSKScaleMenuFontSize = 11.0; -#pragma mark Instance methods - -- (id)initWithFrame:(NSRect)rect { -if (self = [super initWithFrame:rect]) { -pasteboardInfo = [[NSMutableDictionary alloc] initWithCapacity:2]; -} -return self; -} - -- (id)initWithCoder:(NSCoder *)coder { -if (self = [super initWithCoder:coder]) { -pasteboardInfo = [[NSMutableDictionary alloc] initWithCapacity:2]; -} -return self; -} - -- (void)dealloc{ -[pasteboardInfo release]; -[super dealloc]; -} - -- (void)printDocument:(id)sender{ -id document = [[[self window] windowController] document]; -if ([document respondsToSelector:_cmd]) -[document printDocument:sender]; -else if ([PDFView instancesRespondToSelector:_cmd]) -[(id)super printDocument:sender]; -} - -#pragma mark Copying - -// used to cache the selection info and document for lazy copying -- (void)updatePasteboardInfo; -{ -PDFSelection *theSelection = [self currentSelection]; -if(!theSelection) -theSelection = [[self document] selectionForEntireDocument]; - -// @@ copy selection since it's mutable; may eliminate exceptions when providing data, but I've never been able to reproduce the problem -[pasteboardInfo setValue:[[theSelection copy] autorelease] forKey:@selection]; -[pasteboardInfo setValue:[self document] forKey:@document]; -[pasteboardInfo setValue:[self currentPage] forKey:@page]; -} - -// override so we can put the entire document on the pasteboard if there is no selection -- (void)copy:(id)sender; -{ -NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSGeneralPboard]; -[pboard declareTypes:[NSArray arrayWithObjects:NSPDFPboardType, NSStringPboardType, NSRTFPboardType, nil] owner:self]; -[self updatePasteboardInfo]; -} - -- (void)pasteboard:(NSPasteboard *)sender provideDataForType:(NSString *)type; -{ -PDFSelection *theSelection = [pasteboardInfo valueForKey:@selection]; -PDFDocument *theDocument = [pasteboardInfo valueForKey:@document]; -PDFPage *thePage = [pasteboardInfo valueForKey:@page]; - -// use a private type to signal that we need to provide a page as PDF -if([type isEqualToString:NSPDFPboardType] [[sender types] containsObject:@BDSKPrivatePDFPageDataPboardType]){ -[sender setData:[thePage dataRepresentation] forType:type]; -} else if([type isEqualToString:NSPDFPboardType]){ -// write the whole document -[sender setData:[theDocument dataRepresentation] forType:type]; -} else if([type isEqualToString:NSStringPboardType]){ -[sender setString:[theSelection string] forType:type]; -} else if([type isEqualToString:NSRTFPboardType]){ -NSAttributedString *attrString = [theSelection attributedString]; -[sender setData:[attrString RTFFromRange:NSMakeRange(0, [attrString length]) documentAttributes:nil] forType:type]; -} else NSBeep(); -} - -- (void)copyAsPDF:(id)sender; -{ -NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSGeneralPboard]; -// don't add the private page pboard type here -[pboard declareTypes:[NSArray arrayWithObjects:NSPDFPboardType, nil] owner:self]; -[self updatePasteboardInfo]; -} - -- (void)copyAsText:(id)sender; -{ -NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSGeneralPboard]; -[pboard declareTypes:[NSArray arrayWithObjects:NSStringPboardType, NSRTFPboardType, nil] owner:self]; -[self updatePasteboardInfo]; -} - -- (void)copyPDFPage:(id)sender; -{ -NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSGeneralPboard]; -[pboard declareTypes:[NSArray arrayWithObjects:NSPDFPboardType, @BDSKPrivatePDFPageDataPboardType, nil] owner:self]; -[self updatePasteboardInfo
[Skim-app-commit] SF.net SVN: skim-app: [2607] trunk/SKDocument.m
Revision: 2607 http://skim-app.svn.sourceforge.net/skim-app/?rev=2607view=rev Author: hofman Date: 2007-08-06 01:39:54 -0700 (Mon, 06 Aug 2007) Log Message: --- Change a copy of the printInfo for landscape documents, as the printInfo can be the shared copy. Modified Paths: -- trunk/SKDocument.m Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-08-05 20:29:27 UTC (rev 2606) +++ trunk/SKDocument.m 2007-08-06 08:39:54 UTC (rev 2607) @@ -114,7 +114,12 @@ NSSize pageSize = [page boundsForBox:kPDFDisplayBoxMediaBox].size; BOOL isRotated = [page rotation] % 180 == 90; BOOL isWide = (pageSize.width pageSize.height) != (paperSize.width paperSize.height); -[printInfo setOrientation:isRotated == isWide ? NSPortraitOrientation : NSLandscapeOrientation]; +if (isRotated != isWide) { +printInfo = [printInfo copy]; +[printInfo setOrientation:NSLandscapeOrientation]; +[self setPrintInfo:printInfo]; +[printInfo release]; +} } [mainController setPdfDocument:pdfDocument]; 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2609] trunk/vendorsrc/andymatuschak/Sparkle/ SUUpdater.m
Revision: 2609 http://skim-app.svn.sourceforge.net/skim-app/?rev=2609view=rev Author: hofman Date: 2007-08-06 03:31:23 -0700 (Mon, 06 Aug 2007) Log Message: --- Wait the remaining time before doing an update check rather than the time we've already been waiting. Modified Paths: -- trunk/vendorsrc/andymatuschak/Sparkle/SUUpdater.m Modified: trunk/vendorsrc/andymatuschak/Sparkle/SUUpdater.m === --- trunk/vendorsrc/andymatuschak/Sparkle/SUUpdater.m 2007-08-06 09:35:34 UTC (rev 2608) +++ trunk/vendorsrc/andymatuschak/Sparkle/SUUpdater.m 2007-08-06 10:31:23 UTC (rev 2609) @@ -98,8 +98,8 @@ if (intervalSinceCheck interval) { // Hasn't been long enough; schedule a check for the future. - [self performSelector:@selector(checkForUpdatesInBackground) withObject:nil afterDelay:intervalSinceCheck]; - [self performSelector:@selector(scheduleCheckWithIntervalObject:) withObject:[NSNumber numberWithLong:interval] afterDelay:intervalSinceCheck]; + [self performSelector:@selector(checkForUpdatesInBackground) withObject:nil afterDelay:interval - intervalSinceCheck]; + [self performSelector:@selector(scheduleCheckWithIntervalObject:) withObject:[NSNumber numberWithLong:interval] afterDelay:interval - intervalSinceCheck]; } else { 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2610] trunk
Revision: 2610 http://skim-app.svn.sourceforge.net/skim-app/?rev=2610view=rev Author: hofman Date: 2007-08-06 04:33:26 -0700 (Mon, 06 Aug 2007) Log Message: --- Allow copying text also in copy protected documents. Validate copy and print menu items. Modified Paths: -- trunk/SKDocument.m trunk/SKPDFView.m Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-08-06 10:31:23 UTC (rev 2609) +++ trunk/SKDocument.m 2007-08-06 11:33:26 UTC (rev 2610) @@ -623,6 +623,8 @@ if (fileName == nil || [[NSFileManager defaultManager] fileExistsAtPath:fileName] == NO) return NO; return [self isDocumentEdited] || fileChangedOnDisk; +} else if ([anItem action] == @selector(printDocument:)) { +return [[self pdfDocument] allowsPrinting]; } return [super validateUserInterfaceItem:anItem]; } Modified: trunk/SKPDFView.m === --- trunk/SKPDFView.m 2007-08-06 10:31:23 UTC (rev 2609) +++ trunk/SKPDFView.m 2007-08-06 11:33:26 UTC (rev 2610) @@ -632,7 +632,17 @@ - (void)copy:(id)sender { -[super copy:sender]; +if ([[self document] allowsCopying]) { +[super copy:sender]; +} else if ([self currentSelection]) { +NSPasteboard *pboard = [NSPasteboard generalPasteboard]; +NSString *string = [[self currentSelection] string]; +NSAttributedString *attrString = [[self currentSelection] attributedString]; + +[pboard declareTypes:[NSArray arrayWithObjects:NSStringPboardType, NSRTFPboardType, nil] owner:nil]; +[pboard setString:string forType:NSStringPboardType]; +[pboard setData:[attrString RTFFromRange:NSMakeRange(0, [attrString length]) documentAttributes:nil] forType:NSRTFPboardType]; +} NSMutableArray *types = [NSMutableArray array]; NSData *noteData = nil; @@ -2010,13 +2020,17 @@ [menuItem setState:[self annotationMode] == (unsigned)[menuItem tag] ? NSOnState : NSOffState]; return YES; } else if (action == @selector(copy:)) { -if ([super validateMenuItem:menuItem]) +if ([self currentSelection]) return YES; if ([activeAnnotation isNoteAnnotation] [activeAnnotation isMovable]) return YES; if (toolMode == SKSelectToolMode NSIsEmptyRect(selectionRect) == NO) return YES; return NO; +} else if (action == @selector(delete:)) { +return [activeAnnotation isNoteAnnotation]; +} else if (action == @selector(printDocument:)) { +return [[self document] allowsPrinting]; } else if (action == @selector(autoSelectContent:)) { return toolMode == SKSelectToolMode; } else { 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2611] trunk/SKDocument.m
Revision: 2611 http://skim-app.svn.sourceforge.net/skim-app/?rev=2611view=rev Author: hofman Date: 2007-08-06 06:23:51 -0700 (Mon, 06 Aug 2007) Log Message: --- Remove PDF With Embedded Notes from format popup when exporting a PDF that cannot be printed, as that is not supported by PDFKit. Modified Paths: -- trunk/SKDocument.m Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-08-06 11:33:26 UTC (rev 2610) +++ trunk/SKDocument.m 2007-08-06 13:23:51 UTC (rev 2611) @@ -166,9 +166,13 @@ - (BOOL)prepareSavePanel:(NSSavePanel *)savePanel { NSPopUpButton *formatPopup = popUpButtonSubview([savePanel accessoryView]); NSString *lastExportedType = [[NSUserDefaults standardUserDefaults] stringForKey:@SKLastExportedType]; +if ([[self pdfDocument] allowsPrinting] == NO) { +int index = [formatPopup indexOfItemWithRepresentedObject:SKEmbeddedPDFDocumentType]; +if (index != -1) +[formatPopup removeItemAtIndex:index]; +} if (formatPopup lastExportedType) { -NSString *title = [[NSDocumentController sharedDocumentController] displayNameForType:lastExportedType]; -int index = [formatPopup indexOfItemWithTitle:title]; +int index = [formatPopup indexOfItemWithRepresentedObject:lastExportedType]; if (index != -1 index != [formatPopup indexOfSelectedItem]) { [formatPopup selectItemAtIndex:index]; [formatPopup sendAction:[formatPopup action] to:[formatPopup target]]; 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2612] trunk/SKMainWindowController.m
Revision: 2612 http://skim-app.svn.sourceforge.net/skim-app/?rev=2612view=rev Author: hofman Date: 2007-08-06 06:33:48 -0700 (Mon, 06 Aug 2007) Log Message: --- Dirty snapshots after unlocking documents. Modified Paths: -- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m === --- trunk/SKMainWindowController.m 2007-08-06 13:23:51 UTC (rev 2611) +++ trunk/SKMainWindowController.m 2007-08-06 13:33:48 UTC (rev 2612) @@ -2896,6 +2896,7 @@ [self didChangeValueForKey:@pageLabel]; [self resetThumbnails]; +[self allSnapshotsNeedUpdate]; if (pdfOutline == nil) { pdfOutline = [[pdfDoc outlineRoot] retain]; 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2613] trunk
Revision: 2613 http://skim-app.svn.sourceforge.net/skim-app/?rev=2613view=rev Author: hofman Date: 2007-08-06 08:01:22 -0700 (Mon, 06 Aug 2007) Log Message: --- Create table contextual menus in controller and some more menu items. Modified Paths: -- trunk/Dutch.lproj/Localizable.strings trunk/French.lproj/Localizable.strings trunk/Italian.lproj/Localizable.strings trunk/SKMainWindowController.m trunk/SKNoteOutlineView.h trunk/SKNoteOutlineView.m trunk/SKThumbnailTableView.h trunk/SKThumbnailTableView.m Modified: trunk/Dutch.lproj/Localizable.strings === (Binary files differ) Modified: trunk/French.lproj/Localizable.strings === (Binary files differ) Modified: trunk/Italian.lproj/Localizable.strings === (Binary files differ) Modified: trunk/SKMainWindowController.m === --- trunk/SKMainWindowController.m 2007-08-06 13:33:48 UTC (rev 2612) +++ trunk/SKMainWindowController.m 2007-08-06 15:01:22 UTC (rev 2613) @@ -3262,6 +3262,47 @@ [[SKPDFHoverWindow sharedHoverWindow] hide]; } +- (void)deleteNote:(id)sender { +PDFAnnotation *annotation = [sender representedObject]; +[pdfView removeAnnotation:annotation]; +[[[self document] undoManager] setActionName:NSLocalizedString(@Remove Note, @Undo action name)]; +} + +- (void)selectNote:(id)sender { +PDFAnnotation *annotation = [sender representedObject]; +[pdfView setActiveAnnotation:annotation]; +} + +- (void)deselectNote:(id)sender { +[pdfView setActiveAnnotation:nil]; +} + +- (NSMenu *)outlineView:(NSOutlineView *)ov menuForTableColumn:(NSTableColumn *)tableColumn item:(id)item { +NSMenu *menu = nil; +if ([ov isEqual:noteOutlineView]) { +if ([item type] == nil) +item = [(SKNoteText *)item annotation]; +menu = [[[NSMenu allocWithZone:[NSMenu menuZone]] init] autorelease]; +NSMenuItem *menuItem = [menu addItemWithTitle:NSLocalizedString(@Delete, @Menu item title) action:@selector(deleteNote:) keyEquivalent:@]; +[menuItem setTarget:self]; +[menuItem setRepresentedObject:item]; +if ([pdfView hideNotes] == NO) { +if ([item isEditable]) { +menuItem = [menu addItemWithTitle:NSLocalizedString(@Edit, @Menu item title) action:@selector(editThisAnnotation:) keyEquivalent:@]; +[menuItem setTarget:pdfView]; +[menuItem setRepresentedObject:item]; +} +if ([pdfView activeAnnotation] == item) +menuItem = [menu addItemWithTitle:NSLocalizedString(@Deselect, @Menu item title) action:@selector(deselectNote:) keyEquivalent:@]; +else +menuItem = [menu addItemWithTitle:NSLocalizedString(@Select, @Menu item title) action:@selector(selectNote:) keyEquivalent:@]; +[menuItem setTarget:self]; +[menuItem setRepresentedObject:item]; +} +} +return menu; +} + #pragma mark NSTableView delegate protocol - (void)tableViewSelectionDidChange:(NSNotification *)aNotification { @@ -3423,6 +3464,61 @@ } } +- (void)copyPage:(id)sender { +PDFPage *page = [sender representedObject]; +NSData *pdfData = [page dataRepresentation]; +NSData *tiffData = [[page imageForBox:[pdfView displayBox]] TIFFRepresentation]; +NSPasteboard *pboard = [NSPasteboard generalPasteboard]; +[pboard declareTypes:[NSArray arrayWithObjects:NSPDFPboardType, NSTIFFPboardType, nil] owner:nil]; +[pboard setData:pdfData forType:NSPDFPboardType]; +[pboard setData:tiffData forType:NSTIFFPboardType]; +} + +- (void)deleteSnapshot:(id)sender { +SKSnapshotWindowController *controller = [sender representedObject]; +[[controller window] orderOut:self]; +[[self mutableArrayValueForKey:@snapshots] removeObject:controller]; +} + +- (void)showSnapshot:(id)sender { +SKSnapshotWindowController *controller = [sender representedObject]; +if ([[controller window] isVisible]) +[[controller window] orderFront:self]; +else +[controller deminiaturize]; +} + +- (void)hideSnapshot:(id)sender { +SKSnapshotWindowController *controller = [sender representedObject]; +if ([[controller window] isVisible]) +[controller miniaturize]; +} + +- (NSMenu *)tableView:(NSTableView *)tv menuForTableColumn:(NSTableColumn *)tableColumn row:(int)row { +NSMenu *menu = nil; +if ([tv isEqual:thumbnailTableView]) { +menu = [[[NSMenu allocWithZone:[NSMenu menuZone]] init] autorelease]; +NSMenuItem *menuItem = [menu addItemWithTitle:NSLocalizedString(@Copy, @Menu item title) action:@selector(copyPage:) keyEquivalent:@]; +[menuItem setTarget:self
[Skim-app-commit] SF.net SVN: skim-app: [2614] trunk/SKMainWindowController.m
Revision: 2614 http://skim-app.svn.sourceforge.net/skim-app/?rev=2614view=rev Author: hofman Date: 2007-08-06 09:10:44 -0700 (Mon, 06 Aug 2007) Log Message: --- Don't generate thumbnails when the PDF is locked, as it won't have content. Modified Paths: -- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m === --- trunk/SKMainWindowController.m 2007-08-06 15:01:22 UTC (rev 2613) +++ trunk/SKMainWindowController.m 2007-08-06 16:10:44 UTC (rev 2614) @@ -965,7 +965,7 @@ - (id)objectInThumbnailsAtIndex:(unsigned)theIndex { SKThumbnail *thumbnail = [thumbnails objectAtIndex:theIndex]; -if ([thumbnail isDirty] NO == isAnimating NO == [thumbnailTableView isScrolling]) { +if ([thumbnail isDirty] NO == isAnimating NO == [thumbnailTableView isScrolling] [[pdfView document] isLocked] == NO) { NSSize newSize, oldSize = [[thumbnail image] size]; PDFDocument *pdfDoc = [pdfView document]; 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2615] trunk/SKPDFView.m
Revision: 2615 http://skim-app.svn.sourceforge.net/skim-app/?rev=2615view=rev Author: hofman Date: 2007-08-06 09:43:36 -0700 (Mon, 06 Aug 2007) Log Message: --- Don't set the graphics context for temporary event to get the current cursor. This won't be used and may not be valid (e.g. for locked PDFs). Modified Paths: -- trunk/SKPDFView.m Modified: trunk/SKPDFView.m === --- trunk/SKPDFView.m 2007-08-06 16:10:44 UTC (rev 2614) +++ trunk/SKPDFView.m 2007-08-06 16:43:36 UTC (rev 2615) @@ -3521,7 +3521,7 @@ modifierFlags:flags timestamp:0 windowNumber:[[self window] windowNumber] - context:[[self window] graphicsContext] + context:nil eventNumber:0 clickCount:1 pressure:0.0]; 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2616] trunk/SKPDFView.m
Revision: 2616 http://skim-app.svn.sourceforge.net/skim-app/?rev=2616view=rev Author: hofman Date: 2007-08-07 02:07:29 -0700 (Tue, 07 Aug 2007) Log Message: --- Don't override mouse events when the document is locked. Modified Paths: -- trunk/SKPDFView.m Modified: trunk/SKPDFView.m === --- trunk/SKPDFView.m 2007-08-06 16:43:36 UTC (rev 2615) +++ trunk/SKPDFView.m 2007-08-07 09:07:29 UTC (rev 2616) @@ -907,7 +907,10 @@ mouseDownLoc = [theEvent locationInWindow]; unsigned int modifiers = [theEvent modifierFlags] NSDeviceIndependentModifierFlagsMask; -if (hasNavigation autohidesCursor) { +if ([[self document] isLocked]) { +[super mouseDown:theEvent]; +return; +} else if (hasNavigation autohidesCursor) { if ([self areaOfInterestForMouse:theEvent] kPDFLinkArea) { [super mouseDown:theEvent]; } else { @@ -973,6 +976,11 @@ } - (void)mouseUp:(NSEvent *)theEvent{ +if ([[self document] isLocked]) { +[super mouseUp:theEvent]; +return; +} + switch (toolMode) { case SKTextToolMode: case SKNoteToolMode: @@ -1024,6 +1032,11 @@ } - (void)mouseDragged:(NSEvent *)theEvent { +if ([[self document] isLocked]) { +[super mouseDragged:theEvent]; +return; +} + switch (toolMode) { case SKTextToolMode: case SKNoteToolMode: @@ -1053,7 +1066,6 @@ } - (void)mouseMoved:(NSEvent *)theEvent { - NSCursor *cursor = [self cursorForEvent:theEvent]; if (cursor) [cursor set]; @@ -3430,7 +3442,8 @@ NSPoint p = [self convertPoint:[theEvent locationInWindow] fromView:nil]; NSCursor *cursor = nil; -if (hasNavigation autohidesCursor) { +if ([[self document] isLocked]) { +} else if (hasNavigation autohidesCursor) { if ([self areaOfInterestForMouse:theEvent] kPDFLinkArea) cursor = [NSCursor pointingHandCursor]; else 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2617] trunk/SKMainWindowController.m
Revision: 2617 http://skim-app.svn.sourceforge.net/skim-app/?rev=2617view=rev Author: hofman Date: 2007-08-07 03:09:03 -0700 (Tue, 07 Aug 2007) Log Message: --- Disable fullscreen and presentation mode when the document is locked as it has weird side effects. Modified Paths: -- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m === --- trunk/SKMainWindowController.m 2007-08-07 09:07:29 UTC (rev 2616) +++ trunk/SKMainWindowController.m 2007-08-07 10:09:03 UTC (rev 2617) @@ -2089,7 +2089,7 @@ - (void)saveNormalSetup { if ([self isPresentation] == NO [self isFullScreen] == NO) { NSScrollView *scrollView = [[pdfView documentView] enclosingScrollView]; -[savedNormalSetup setDictionary:[self currentSetup]]; +[savedNormalSetup setDictionary:[self currentPDFSettings]]; [savedNormalSetup setObject:[NSNumber numberWithBool:[scrollView hasHorizontalScroller]] forKey:@hasHorizontalScroller]; [savedNormalSetup setObject:[NSNumber numberWithBool:[scrollView hasVerticalScroller]] forKey:@hasVerticalScroller]; [savedNormalSetup setObject:[NSNumber numberWithBool:[scrollView autohidesScrollers]] forKey:@autohidesScrollers]; @@ -4507,13 +4507,13 @@ [menuItem setTitle:NSLocalizedString(@Remove Full Screen, @Menu item title)]; else [menuItem setTitle:NSLocalizedString(@Full Screen, @Menu item title)]; -return YES; +return [[self pdfDocument] isLocked] == NO; } else if (action == @selector(togglePresentation:)) { if ([self isPresentation]) [menuItem setTitle:NSLocalizedString(@Remove Presentation, @Menu item title)]; else [menuItem setTitle:NSLocalizedString(@Presentation, @Menu item title)]; -return YES; +return [[self pdfDocument] isLocked] == NO; } else if (action == @selector(getInfo:)) { return [self isPresentation] == NO; } else if (action == @selector(performFit:)) { 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2618] trunk/SKPDFView.m
Revision: 2618 http://skim-app.svn.sourceforge.net/skim-app/?rev=2618view=rev Author: hofman Date: 2007-08-07 04:32:34 -0700 (Tue, 07 Aug 2007) Log Message: --- Don't correct dragging line endpoints for rotation, as we use page coordinates. Modified Paths: -- trunk/SKPDFView.m Modified: trunk/SKPDFView.m === --- trunk/SKPDFView.m 2007-08-07 10:09:03 UTC (rev 2617) +++ trunk/SKPDFView.m 2007-08-07 11:32:34 UTC (rev 2618) @@ -2727,26 +2727,8 @@ startPoint.y = roundf(startPoint.y + NSMinY(wasBounds)); NSPoint *draggedPoint = draggingStartPoint ? startPoint : endPoint; -// Resize the annotation. -switch ([page rotation]) { -case 0: -draggedPoint-x += relPoint.x; -draggedPoint-y += relPoint.y; -break; -case 90: -draggedPoint-x += relPoint.y; -draggedPoint-y -= relPoint.x; -break; -case 180: -draggedPoint-x -= relPoint.x; -draggedPoint-y -= relPoint.y; -break; -case 270: -draggedPoint-x -= relPoint.y; -draggedPoint-y += relPoint.x; -break; -} - +draggedPoint-x += relPoint.x; +draggedPoint-y += relPoint.y; if (draggedPoint-x NSMaxX(pageBounds)) draggedPoint-x = NSMaxX(pageBounds); else if (draggedPoint-x NSMinX(pageBounds)) 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2619] trunk
Revision: 2619 http://skim-app.svn.sourceforge.net/skim-app/?rev=2619view=rev Author: hofman Date: 2007-08-07 10:10:39 -0700 (Tue, 07 Aug 2007) Log Message: --- Add a menu item to create a disk image. Useful for files with a lot of notes, as tar may loose those. Do some more work to avoid asr bug, which loses EAs. 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/French.lproj/MainMenu.nib/classes.nib trunk/French.lproj/MainMenu.nib/keyedobjects.nib trunk/Italian.lproj/MainMenu.nib/classes.nib trunk/Italian.lproj/MainMenu.nib/keyedobjects.nib trunk/SKDocument.h trunk/SKDocument.m Modified: trunk/Dutch.lproj/MainMenu.nib/classes.nib === --- trunk/Dutch.lproj/MainMenu.nib/classes.nib 2007-08-07 11:32:34 UTC (rev 2618) +++ trunk/Dutch.lproj/MainMenu.nib/classes.nib 2007-08-07 17:10:39 UTC (rev 2619) @@ -44,6 +44,7 @@ rotateLeft = id; rotateRight = id; saveArchive = id; +saveDiskImage = id; savePDFSettingToDefaults = id; searchPDF = id; smartAutoCropAll = 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.nib2007-08-07 11:32:34 UTC (rev 2618) +++ trunk/English.lproj/MainMenu.nib/classes.nib2007-08-07 17:10:39 UTC (rev 2619) @@ -44,6 +44,7 @@ rotateLeft = id; rotateRight = id; saveArchive = id; +saveDiskImage = id; savePDFSettingToDefaults = id; searchPDF = id; smartAutoCropAll = id; Modified: trunk/English.lproj/MainMenu.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/French.lproj/MainMenu.nib/classes.nib === --- trunk/French.lproj/MainMenu.nib/classes.nib 2007-08-07 11:32:34 UTC (rev 2618) +++ trunk/French.lproj/MainMenu.nib/classes.nib 2007-08-07 17:10:39 UTC (rev 2619) @@ -44,6 +44,7 @@ rotateLeft = id; rotateRight = id; saveArchive = id; +saveDiskImage = id; savePDFSettingToDefaults = id; searchPDF = id; smartAutoCropAll = id; Modified: trunk/French.lproj/MainMenu.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/Italian.lproj/MainMenu.nib/classes.nib === --- trunk/Italian.lproj/MainMenu.nib/classes.nib2007-08-07 11:32:34 UTC (rev 2618) +++ trunk/Italian.lproj/MainMenu.nib/classes.nib2007-08-07 17:10:39 UTC (rev 2619) @@ -42,6 +42,7 @@ rotateLeft = id; rotateRight = id; saveArchive = id; +saveDiskImage = id; savePDFSettingToDefaults = id; searchPDF = id; smartAutoCropAll = id; Modified: trunk/Italian.lproj/MainMenu.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/SKDocument.h === --- trunk/SKDocument.h 2007-08-07 11:32:34 UTC (rev 2618) +++ trunk/SKDocument.h 2007-08-07 17:10:39 UTC (rev 2619) @@ -82,6 +82,7 @@ - (IBAction)readNotes:(id)sender; - (IBAction)saveArchive:(id)sender; +- (IBAction)saveDiskImage:(id)sender; - (BOOL)saveNotesToExtendedAttributesAtURL:(NSURL *)aURL error:(NSError **)outError; - (BOOL)readNotesFromExtendedAttributesAtURL:(NSURL *)aURL error:(NSError **)outError; @@ -130,3 +131,8 @@ - (NSDictionary *)AppleScriptPDFViewSettingsFromPDFViewSettings; - (NSDictionary *)PDFViewSettingsFromAppleScriptPDFViewSettings; @end + + [EMAIL PROTECTED] NSTask (SKExtensions) ++ (BOOL)runTaskWithLaunchPath:(NSString *)launchPath arguments:(NSArray *)arguments currentDirectoryPath:(NSString *)directoryPath; [EMAIL PROTECTED] Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-08-07 11:32:34 UTC (rev 2618) +++ trunk/SKDocument.m 2007-08-07 17:10:39 UTC (rev 2619) @@ -548,20 +548,28 @@ contextInfo:NULL]; } +#define RUN_TASK(cmd, args, curDir) \ +do
[Skim-app-commit] SF.net SVN: skim-app: [2620] trunk/SKDocument.m
Revision: 2620 http://skim-app.svn.sourceforge.net/skim-app/?rev=2620view=rev Author: hofman Date: 2007-08-07 11:53:43 -0700 (Tue, 07 Aug 2007) Log Message: --- Hide temporarily mounted disk image from Finder. Modified Paths: -- trunk/SKDocument.m Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-08-07 17:10:39 UTC (rev 2619) +++ trunk/SKDocument.m 2007-08-07 18:53:43 UTC (rev 2620) @@ -630,7 +630,7 @@ if (success) { success = [NSTask runTaskWithLaunchPath:@/usr/bin/hdiutil - arguments:[NSArray arrayWithObjects:@attach, @-mountpoint, tmpMountPath, tmpDmgPath1, nil] + arguments:[NSArray arrayWithObjects:@attach, @-nobrowse, @-mountpoint, tmpMountPath, tmpDmgPath1, nil] currentDirectoryPath:tmpDir]; didAttach = success; } 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2621] trunk
Revision: 2621 http://skim-app.svn.sourceforge.net/skim-app/?rev=2621view=rev Author: hofman Date: 2007-08-07 11:58:06 -0700 (Tue, 07 Aug 2007) Log Message: --- Return UINT_MAX from countOfLines, as this may otherwise suppress returning an actual line object. It has no meaning anyway, it's just implemented to satisfy scripting support. Modified Paths: -- trunk/SKApplicationController.m trunk/SKDocument.m Modified: trunk/SKApplicationController.m === --- trunk/SKApplicationController.m 2007-08-07 18:53:43 UTC (rev 2620) +++ trunk/SKApplicationController.m 2007-08-07 18:58:06 UTC (rev 2621) @@ -519,7 +519,7 @@ } - (unsigned int)countOfLines { -return 0; +return UINT_MAX; } - (SKLine *)objectInLinesAtIndex:(unsigned int)index { Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-08-07 18:53:43 UTC (rev 2620) +++ trunk/SKDocument.m 2007-08-07 18:58:06 UTC (rev 2621) @@ -1163,7 +1163,7 @@ } - (unsigned int)countOfLines { -return 0; +return UINT_MAX; } - (SKLine *)objectInLinesAtIndex:(unsigned int)index { 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2622] trunk/SKStatusBar.m
Revision: 2622 http://skim-app.svn.sourceforge.net/skim-app/?rev=2622view=rev Author: hofman Date: 2007-08-07 13:26:01 -0700 (Tue, 07 Aug 2007) Log Message: --- Use threaded animation for status bar progress indicator. Modified Paths: -- trunk/SKStatusBar.m Modified: trunk/SKStatusBar.m === --- trunk/SKStatusBar.m 2007-08-07 18:58:06 UTC (rev 2621) +++ trunk/SKStatusBar.m 2007-08-07 20:26:01 UTC (rev 2622) @@ -267,6 +267,7 @@ [progressIndicator setControlSize:NSSmallControlSize]; [progressIndicator setIndeterminate:style == NSProgressIndicatorSpinningStyle]; [progressIndicator setDisplayedWhenStopped:style == NSProgressIndicatorBarStyle]; +[progressIndicator setUsesThreadedAnimation:YES]; [progressIndicator sizeToFit]; NSRect rect, ignored; 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2624] trunk/SKDocument.m
Revision: 2624 http://skim-app.svn.sourceforge.net/skim-app/?rev=2624view=rev Author: hofman Date: 2007-08-08 02:31:47 -0700 (Wed, 08 Aug 2007) Log Message: --- Save disk image in the background, as we don't need any access to the app. Modified Paths: -- trunk/SKDocument.m Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-08-07 21:01:10 UTC (rev 2623) +++ trunk/SKDocument.m 2007-08-08 09:31:47 UTC (rev 2624) @@ -549,19 +549,6 @@ contextInfo:NULL]; } -#define RUN_TASK(cmd, args, curDir) \ -do { \ -NSTask *task = [[[NSTask alloc] init] autorelease]; \ -[task setLaunchPath:cmd]; \ -[task setCurrentDirectoryPath:curDir]; \ -[task setArguments:args]; \ -[task setStandardOutput:[NSFileHandle fileHandleWithNullDevice]]; \ -[task setStandardError:[NSFileHandle fileHandleWithNullDevice]]; \ -[task launch]; \ -if ([task isRunning]) [task waitUntilExit]; \ -success = success 0 == [task terminationStatus]; \ -} while (0); - - (void)archiveSavePanelDidEnd:(NSSavePanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { if (NSOKButton == returnCode [self fileURL]) { @@ -596,46 +583,36 @@ } } -- (void)diskImageSavePanelDidEnd:(NSSavePanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { - -if (NSOKButton == returnCode [self fileURL]) { +- (void)saveDiskImageWithInfo:(NSDictionary *)info { -if (progressSheet == nil) { -if ([NSBundle loadNibNamed:@ProgressSheet owner:self]) { -[progressBar setUsesThreadedAnimation:YES]; -} else { -NSLog(@Failed to load ProgressSheet.nib); -return; -} -} +NSAutoreleasePool *pool = [NSAutoreleasePool new]; -[progressField setStringValue:[NSLocalizedString(@Saving Disk Image, @Message for progress sheet) stringByAppendingEllipsis]]; -[progressBar setIndeterminate:YES]; -[progressBar startAnimation:self]; - -[sheet orderOut:self]; -[NSApp beginSheet:progressSheet modalForWindow:[[self mainWindowController] window] modalDelegate:nil didEndSelector:NULL contextInfo:NULL]; - -NSFileManager *fm = [NSFileManager defaultManager]; NSString *baseTmpDir = [NSTemporaryDirectory() stringByAppendingPathComponent:@net.sourceforge.skim-app.skim]; NSString *tmpDir = baseTmpDir; +NSString *tmpDirName; +FSRef tmpRef; +FSRef tmpDirRef; int i = 0; -while ([fm fileExistsAtPath:tmpDir]) +BOOL success = YES; + +while (fnfErr != FSPathMakeRef((UInt8 *)[tmpDir fileSystemRepresentation], tmpDirRef, NULL)) tmpDir = [baseTmpDir stringByAppendingFormat:@%i, ++i]; -NSString *sourcePath = [[self fileURL] path]; -NSString *path = [sheet filename]; +tmpDirName = [tmpDir lastPathComponent]; +success = noErr == FSPathMakeRef((UInt8 *)[NSTemporaryDirectory() fileSystemRepresentation], tmpRef, NULL); +if (success) +success = noErr == FSCreateDirectoryUnicode(tmpRef, [tmpDirName length], (const UniChar *)[tmpDirName cStringUsingEncoding:NSUnicodeStringEncoding], kFSCatInfoNone, NULL, tmpDirRef, NULL, NULL); + +NSString *sourcePath = [info objectForKey:@sourcePath]; +NSString *path = [info objectForKey:@targetPath]; NSString *name = [[path lastPathComponent] stringByDeletingPathExtension]; NSString *tmpName = [name caseInsensitiveCompare:@tmp] == NSOrderedSame ? @tmp1 : @tmp; NSString *tmpDmgPath1 = [[tmpDir stringByAppendingPathComponent:tmpName] stringByAppendingPathExtension:@dmg]; NSString *tmpDmgPath2 = [[tmpDir stringByAppendingPathComponent:name] stringByAppendingPathExtension:@dmg]; NSString *tmpMountPath = [tmpDir stringByAppendingPathComponent:tmpName]; NSString *tmpPath = [tmpMountPath stringByAppendingPathComponent:[sourcePath lastPathComponent]]; -BOOL success = YES; BOOL didAttach = NO; -success = [fm createDirectoryAtPath:tmpDir attributes:nil]; - @try { if (success) { success = [NSTask runTaskWithLaunchPath:@/usr/bin/hdiutil @@ -653,10 +630,9 @@ } if (success) { -if ([fm fileExistsAtPath:tmpPath]) -success = [fm removeFileAtPath:tmpPath handler:nil]; -if (success) -success = [fm copyPath:sourcePath toPath:tmpPath handler:nil]; +success = [NSTask runTaskWithLaunchPath:@/bin/cp + arguments:[NSArray arrayWithObjects:@-f, sourcePath, tmpPath
[Skim-app-commit] SF.net SVN: skim-app: [2625] trunk/SKDocument.m
Revision: 2625 http://skim-app.svn.sourceforge.net/skim-app/?rev=2625view=rev Author: hofman Date: 2007-08-08 10:35:13 -0700 (Wed, 08 Aug 2007) Log Message: --- Create a temporary sparse image for saving to disk image, because using -srcfolder does not create enough room for the EAs. Modified Paths: -- trunk/SKDocument.m Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-08-08 09:31:47 UTC (rev 2624) +++ trunk/SKDocument.m 2007-08-08 17:35:13 UTC (rev 2625) @@ -587,77 +587,82 @@ NSAutoreleasePool *pool = [NSAutoreleasePool new]; -NSString *baseTmpDir = [NSTemporaryDirectory() stringByAppendingPathComponent:@net.sourceforge.skim-app.skim]; +NSString *baseTmpDir = [NSTemporaryDirectory() stringByAppendingPathComponent:[[NSBundle mainBundle] bundleIdentifier]]; NSString *tmpDir = baseTmpDir; NSString *tmpDirName; FSRef tmpRef; -FSRef tmpDirRef; int i = 0; BOOL success = YES; -while (fnfErr != FSPathMakeRef((UInt8 *)[tmpDir fileSystemRepresentation], tmpDirRef, NULL)) -tmpDir = [baseTmpDir stringByAppendingFormat:@%i, ++i]; +while (fnfErr != FSPathMakeRef((UInt8 *)[tmpDir fileSystemRepresentation], tmpRef, NULL)) +tmpDir = [baseTmpDir stringByAppendingFormat:@-%i, ++i]; tmpDirName = [tmpDir lastPathComponent]; success = noErr == FSPathMakeRef((UInt8 *)[NSTemporaryDirectory() fileSystemRepresentation], tmpRef, NULL); if (success) -success = noErr == FSCreateDirectoryUnicode(tmpRef, [tmpDirName length], (const UniChar *)[tmpDirName cStringUsingEncoding:NSUnicodeStringEncoding], kFSCatInfoNone, NULL, tmpDirRef, NULL, NULL); +success = noErr == FSCreateDirectoryUnicode(tmpRef, [tmpDirName length], (const UniChar *)[tmpDirName cStringUsingEncoding:NSUnicodeStringEncoding], kFSCatInfoNone, NULL, NULL, NULL, NULL); -NSString *sourcePath = [info objectForKey:@sourcePath]; -NSString *path = [info objectForKey:@targetPath]; -NSString *name = [[path lastPathComponent] stringByDeletingPathExtension]; -NSString *tmpName = [name caseInsensitiveCompare:@tmp] == NSOrderedSame ? @tmp1 : @tmp; -NSString *tmpDmgPath1 = [[tmpDir stringByAppendingPathComponent:tmpName] stringByAppendingPathExtension:@dmg]; -NSString *tmpDmgPath2 = [[tmpDir stringByAppendingPathComponent:name] stringByAppendingPathExtension:@dmg]; -NSString *tmpMountPath = [tmpDir stringByAppendingPathComponent:tmpName]; -NSString *tmpPath = [tmpMountPath stringByAppendingPathComponent:[sourcePath lastPathComponent]]; +NSString *sourcePath = [[[info objectForKey:@sourcePath] copy] autorelease]; +NSString *targetPath = [[[info objectForKey:@targetPath] copy] autorelease]; +NSString *name = [[targetPath lastPathComponent] stringByDeletingPathExtension]; +NSString *tmpImagePath1 = [[tmpDir stringByAppendingPathComponent:name] stringByAppendingPathExtension:@sparseimage]; +NSString *tmpImagePath2 = [[tmpDir stringByAppendingPathComponent:name] stringByAppendingPathExtension:@dmg]; +NSString *tmpMountPath = [tmpDir stringByAppendingPathComponent:name]; BOOL didAttach = NO; @try { if (success) { success = [NSTask runTaskWithLaunchPath:@/usr/bin/hdiutil - arguments:[NSArray arrayWithObjects:@create, @-format, @UDRW, @-volname, name, @-srcfolder, sourcePath, tmpDmgPath1, nil] + arguments:[NSArray arrayWithObjects:@create, @-type, @SPARSE, @-fs, @HFS+, @-volname, name, tmpImagePath1, nil] currentDirectoryPath:tmpDir]; } -// asr (used by hdiutil create) has a bug in Tiger: it loses the EAs, so we need to copy another copy with the EAs +// asr (used by hdiutil create) has a bug in Tiger: it loses the EAs, so we need to copy another version with the EAs if (success) { success = [NSTask runTaskWithLaunchPath:@/usr/bin/hdiutil - arguments:[NSArray arrayWithObjects:@attach, @-nobrowse, @-mountpoint, tmpMountPath, tmpDmgPath1, nil] + arguments:[NSArray arrayWithObjects:@attach, @-nobrowse, @-mountpoint, tmpMountPath, tmpImagePath1, nil] currentDirectoryPath:tmpDir]; didAttach = success; } if (success) { +// we can't use NSFileManager because it's not thread safe, while FSPathCopyObjectSync complains about not enough space
[Skim-app-commit] SF.net SVN: skim-app: [2626] trunk/SKMainWindowController.m
Revision: 2626 http://skim-app.svn.sourceforge.net/skim-app/?rev=2626view=rev Author: hofman Date: 2007-08-08 12:33:39 -0700 (Wed, 08 Aug 2007) Log Message: --- Update enabled of TOC button when reloading or unlocking the PDF document. Modified Paths: -- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m === --- trunk/SKMainWindowController.m 2007-08-08 17:35:13 UTC (rev 2625) +++ trunk/SKMainWindowController.m 2007-08-08 19:33:39 UTC (rev 2626) @@ -760,6 +760,8 @@ [self updateOutlineSelection]; } +[leftSideButton setEnabled:pdfOutline != nil forSegment:SKOutlineSidePaneState]; + [noteOutlineView reloadData]; [self updateNoteSelection]; @@ -2910,6 +2912,7 @@ [outlineView expandItem: [outlineView itemAtRow: 0] expandChildren: NO]; [self updateOutlineSelection]; } +[leftSideButton setEnabled:pdfOutline != nil forSegment:SKOutlineSidePaneState]; } - (void)handleColorSwatchColorsChangedNotification:(NSNotification *)notification { 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2627] trunk/SKDocument.m
Revision: 2627 http://skim-app.svn.sourceforge.net/skim-app/?rev=2627view=rev Author: hofman Date: 2007-08-08 13:01:46 -0700 (Wed, 08 Aug 2007) Log Message: --- Remove comment Modified Paths: -- trunk/SKDocument.m Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-08-08 19:33:39 UTC (rev 2626) +++ trunk/SKDocument.m 2007-08-08 20:01:46 UTC (rev 2627) @@ -1496,7 +1496,7 @@ [task setCurrentDirectoryPath:directoryPath]; [task setArguments:arguments]; [task setStandardOutput:[NSFileHandle fileHandleWithNullDevice]]; -//[task setStandardError:[NSFileHandle fileHandleWithNullDevice]]; +[task setStandardError:[NSFileHandle fileHandleWithNullDevice]]; [task launch]; if ([task isRunning]) [task waitUntilExit]; 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2628] trunk/SKDocument.m
Revision: 2628 http://skim-app.svn.sourceforge.net/skim-app/?rev=2628view=rev Author: hofman Date: 2007-08-08 13:13:28 -0700 (Wed, 08 Aug 2007) Log Message: --- Don't compact disk image, it makes no difference. Modified Paths: -- trunk/SKDocument.m Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-08-08 20:01:46 UTC (rev 2627) +++ trunk/SKDocument.m 2007-08-08 20:13:28 UTC (rev 2628) @@ -639,12 +639,6 @@ currentDirectoryPath:tmpDir] success; } -if (didAttach) { -success = [NSTask runTaskWithLaunchPath:@/usr/bin/hdiutil - arguments:[NSArray arrayWithObjects:@compact, tmpImagePath1, nil] - currentDirectoryPath:tmpDir]; -} - if (success) { success = [NSTask runTaskWithLaunchPath:@/usr/bin/hdiutil arguments:[NSArray arrayWithObjects:@convert, @-format, @UDZO, @-o, tmpImagePath2, tmpImagePath1, nil] 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2629] trunk/SKPDFView.m
Revision: 2629 http://skim-app.svn.sourceforge.net/skim-app/?rev=2629view=rev Author: hofman Date: 2007-08-09 02:04:07 -0700 (Thu, 09 Aug 2007) Log Message: --- Correct cursor for selection on rotated pages. Modified Paths: -- trunk/SKPDFView.m Modified: trunk/SKPDFView.m === --- trunk/SKPDFView.m 2007-08-08 20:13:28 UTC (rev 2628) +++ trunk/SKPDFView.m 2007-08-09 09:04:07 UTC (rev 2629) @@ -3468,24 +3468,40 @@ p = [self convertPoint:p toPage:page]; if (NSIsEmptyRect(selectionRect) || NSPointInRect(p, NSInsetRect(selectionRect, -margin, -margin)) == NO) { cursor = [NSCursor crosshairCursor]; -} else if (p.x NSMaxX(selectionRect) - margin) { -if (p.y NSMaxY(selectionRect) - margin) -cursor = [NSCursor resizeRightUpCursor]; -else if (p.y NSMinY(selectionRect) + margin) -cursor = [NSCursor resizeRightDownCursor]; -else -cursor = [NSCursor resizeLeftRightCursor]; -} else if (p.x NSMinX(selectionRect) + margin) { -if (p.y NSMaxY(selectionRect) - margin) -cursor = [NSCursor resizeLeftUpCursor]; -else if (p.y NSMinY(selectionRect) + margin) -cursor = [NSCursor resizeLeftDownCursor]; -else -cursor = [NSCursor resizeLeftRightCursor]; -} else if (p.y NSMaxY(selectionRect) - margin || p.y NSMinY(selectionRect) + margin) { -cursor = [NSCursor resizeUpDownCursor]; } else { -cursor = [NSCursor openHandCursor]; +int angle = 360; +if (p.x NSMaxX(selectionRect) - margin) { +if (p.y NSMinY(selectionRect) + margin) +angle = 45; +else if (p.y NSMaxY(selectionRect) - margin) +angle = 315; +else +angle = 0; +} else if (p.x NSMinX(selectionRect) + margin) { +if (p.y NSMinY(selectionRect) + margin) +angle = 135; +else if (p.y NSMaxY(selectionRect) - margin) +angle = 225; +else +angle = 180; +} else if (p.y NSMinY(selectionRect) + margin) { +angle = 90; +} else if (p.y NSMaxY(selectionRect) - margin) { +angle = 270; +} else { +cursor = [NSCursor openHandCursor]; +} +if (angle != 360) { +angle = (360 + angle + [page rotation]) % 360; +switch (angle) { +case 0: case 180: cursor = [NSCursor resizeLeftRightCursor]; break; +case 45: cursor = [NSCursor resizeRightDownCursor]; break; +case 90: case 270: cursor = [NSCursor resizeUpDownCursor]; break; +case 135: cursor = [NSCursor resizeLeftDownCursor]; break; +case 225: cursor = [NSCursor resizeLeftUpCursor]; break; +case 315: cursor = [NSCursor resizeRightUpCursor]; break; +} +} } } break; 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2630] trunk/SKPDFView.m
Revision: 2630 http://skim-app.svn.sourceforge.net/skim-app/?rev=2630view=rev Author: hofman Date: 2007-08-09 02:39:08 -0700 (Thu, 09 Aug 2007) Log Message: --- Rotate selection rect for copying PDF from a selection when the page is rotated. Modified Paths: -- trunk/SKPDFView.m Modified: trunk/SKPDFView.m === --- trunk/SKPDFView.m 2007-08-09 09:04:07 UTC (rev 2629) +++ trunk/SKPDFView.m 2007-08-09 09:39:08 UTC (rev 2630) @@ -656,11 +656,39 @@ if (toolMode == SKSelectToolMode NSIsEmptyRect(selectionRect) == NO) { NSRect selRect = NSIntegralRect(selectionRect); +NSRect targetRect = selRect; +PDFPage *page = [self currentPage]; -PDFDocument *pdfDoc = [[PDFDocument alloc] initWithData:[[self currentPage] dataRepresentation]]; -PDFPage *page = [pdfDoc pageAtIndex:0]; -[page setBounds:[[self currentPage] boundsForBox:kPDFDisplayBoxMediaBox] forBox:kPDFDisplayBoxMediaBox]; -[page setBounds:selRect forBox:kPDFDisplayBoxCropBox]; +if ([page rotation]) { +NSAffineTransform *transform = [NSAffineTransform transform]; +NSRect bounds = [page boundsForBox:kPDFDisplayBoxMediaBox]; +switch ([page 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 rotateByDegrees:-[page rotation]]; +targetRect.origin = [transform transformPoint:targetRect.origin]; +targetRect.size = [transform transformSize:targetRect.size]; +if (NSWidth(targetRect) 0.0) { +targetRect.origin.x += NSWidth(targetRect); +targetRect.size.width *= -1.0; +} +if (NSHeight(targetRect) 0.0) { +targetRect.origin.y += NSHeight(targetRect); +targetRect.size.height *= -1.0; +} +} + +PDFDocument *pdfDoc = [[PDFDocument alloc] initWithData:[page dataRepresentation]]; +page = [pdfDoc pageAtIndex:0]; +[page setBounds:targetRect forBox:kPDFDisplayBoxCropBox]; [page setBounds:NSZeroRect forBox:kPDFDisplayBoxBleedBox]; [page setBounds:NSZeroRect forBox:kPDFDisplayBoxTrimBox]; [page setBounds:NSZeroRect forBox:kPDFDisplayBoxArtBox]; @@ -670,12 +698,13 @@ [pdfDoc release]; NSRect bounds = [[self currentPage] boundsForBox:[self displayBox]]; -NSRect targetRect = NSZeroRect, sourceRect = selRect; +NSRect sourceRect = selRect; NSImage *pageImage = [[self currentPage] imageForBox:[self displayBox]]; NSImage *image = nil; sourceRect.origin.x -= NSMinX(bounds); sourceRect.origin.y -= NSMinY(bounds); +targetRect.origin = NSZeroPoint; targetRect.size = sourceRect.size; image = [[NSImage alloc] initWithSize:targetRect.size]; [image lockFocus]; 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2631] trunk/SKDocument.m
Revision: 2631 http://skim-app.svn.sourceforge.net/skim-app/?rev=2631view=rev Author: hofman Date: 2007-08-09 04:40:55 -0700 (Thu, 09 Aug 2007) Log Message: --- Mark file as changed on disk when file is deleted, so the Revert menu item can be activated if the file is restored. Modified Paths: -- trunk/SKDocument.m Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-08-09 09:39:08 UTC (rev 2630) +++ trunk/SKDocument.m 2007-08-09 11:40:55 UTC (rev 2631) @@ -77,6 +77,7 @@ - (void)stopCheckingFileUpdates; - (void)handleFileUpdateNotification:(NSNotification *)notification; - (void)handleFileMoveNotification:(NSNotification *)notification; +- (void)handleFileDeleteNotification:(NSNotification *)notification; - (void)handleWindowWillCloseNotification:(NSNotification *)notification; - (void)handleWindowDidEndSheetNotification:(NSNotification *)notification; @@ -822,7 +823,7 @@ NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc addObserver:self selector:@selector(handleFileUpdateNotification:) name:UKFileWatcherWriteNotification object:kQueue]; [nc addObserver:self selector:@selector(handleFileMoveNotification:) name:UKFileWatcherRenameNotification object:kQueue]; -[nc addObserver:self selector:@selector(handleFileMoveNotification:) name:UKFileWatcherDeleteNotification object:kQueue]; +[nc addObserver:self selector:@selector(handleFileDeleteNotification:) name:UKFileWatcherDeleteNotification object:kQueue]; } else if (nil == fileUpdateTimer) { // Let the runloop retain the timer; timer retains us. Use a fairly long delay since this is likely a network volume. fileUpdateTimer = [NSTimer scheduledTimerWithTimeInterval:(double)2.0 target:self selector:@selector(checkForFileModification:) userInfo:nil repeats:YES]; @@ -928,6 +929,12 @@ // If the file is moved, NSDocument will notice and will call setFileURL, where we start watching again } +- (void)handleFileDeleteNotification:(NSNotification *)notification { +if ([watchedFile isEqualToString:[[notification userInfo] objectForKey:@path]]) +[self stopCheckingFileUpdates]; +fileChangedOnDisk = YES; +} + - (void)handleWindowWillCloseNotification:(NSNotification *)notification { NSWindow *window = [notification object]; // ignore when we're switching fullscreen/main windows 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2632] trunk
Revision: 2632 http://skim-app.svn.sourceforge.net/skim-app/?rev=2632view=rev Author: hofman Date: 2007-08-09 07:36:05 -0700 (Thu, 09 Aug 2007) Log Message: --- Add a zoom option to the popup to automatically adjust the scale factor to fit the currently displayed rect. Modified Paths: -- trunk/BDSKZoomablePDFView.h trunk/BDSKZoomablePDFView.m Modified: trunk/BDSKZoomablePDFView.h === --- trunk/BDSKZoomablePDFView.h 2007-08-09 11:40:55 UTC (rev 2631) +++ trunk/BDSKZoomablePDFView.h 2007-08-09 14:36:05 UTC (rev 2632) @@ -42,13 +42,21 @@ @interface BDSKZoomablePDFView : PDFView { NSPopUpButton *scalePopUpButton; +PDFPage *page; +NSRect fitRect; +BOOL fits; } +- (BOOL)fits; +- (void)setFits:(BOOL)newFits; +- (void)setFits:(BOOL)newFits adjustPopup:(BOOL)flag; +- (void)setAutoScales:(BOOL)newAuto adjustPopup:(BOOL)flag; - (void)setScaleFactor:(float)factor adjustPopup:(BOOL)flag; - (void)scalePopUpAction:(id)sender; - (NSScrollView *)scrollView; - (void)layoutScrollView; - (void)setScrollerSize:(NSControlSize)controlSize; - (void)dragWithEvent:(NSEvent *)theEvent; +- (void)handlePDFViewFrameChangedNotification:(NSNotification *)notification; @end Modified: trunk/BDSKZoomablePDFView.m === --- trunk/BDSKZoomablePDFView.m 2007-08-09 11:40:55 UTC (rev 2631) +++ trunk/BDSKZoomablePDFView.m 2007-08-09 14:36:05 UTC (rev 2632) @@ -48,6 +48,7 @@ @implementation BDSKZoomablePDFView /* For genstrings: +NSLocalizedStringFromTable(@Fit, @ZoomValues, @Zoom popup entry) NSLocalizedStringFromTable(@Auto, @ZoomValues, @Zoom popup entry) NSLocalizedStringFromTable(@10%, @ZoomValues, @Zoom popup entry) NSLocalizedStringFromTable(@25%, @ZoomValues, @Zoom popup entry) @@ -59,12 +60,43 @@ NSLocalizedStringFromTable(@400%, @ZoomValues, @Zoom popup entry) NSLocalizedStringFromTable(@800%, @ZoomValues, @Zoom popup entry) */ -static NSString *BDSKDefaultScaleMenuLabels[] = {/* @Set..., */ @Auto, @10%, @25%, @50%, @75%, @100%, @128%, @150%, @200%, @400%, @800%}; -static float BDSKDefaultScaleMenuFactors[] = {/* 0.0, */ 0, 0.1, 0.25, 0.5, 0.75, 1.0, 1.28, 1.5, 2.0, 4.0, 8.0}; +static NSString *BDSKDefaultScaleMenuLabels[] = {/* @Set..., */ @Fit, @Auto, @10%, @25%, @50%, @75%, @100%, @128%, @150%, @200%, @400%, @800%}; +static float BDSKDefaultScaleMenuFactors[] = {/* 0.0, */ -1, 0, 0.1, 0.25, 0.5, 0.75, 1.0, 1.28, 1.5, 2.0, 4.0, 8.0}; static float BDSKScaleMenuFontSize = 11.0; #pragma mark Popup button +- (id)initWithFrame:(NSRect)frameRect { +if (self = [super initWithFrame:frameRect]) { +scalePopUpButton = nil; +page = nil; +fitRect = NSZeroRect; +[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handlePDFViewFrameChangedNotification:) + name:NSViewFrameDidChangeNotification object:self]; +[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handlePDFViewFrameChangedNotification:) + name:NSViewBoundsDidChangeNotification object:self]; +} +return self; +} + +- (id)initWithCoder:(NSCoder *)decoder { +if (self = [super initWithCoder:decoder]) { +scalePopUpButton = nil; +page = nil; +fitRect = NSZeroRect; +[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handlePDFViewFrameChangedNotification:) + name:NSViewFrameDidChangeNotification object:self]; +[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handlePDFViewFrameChangedNotification:) + name:NSViewBoundsDidChangeNotification object:self]; +} +return self; +} + +- (void)dealloc { +[[NSNotificationCenter defaultCenter] removeObserver:self]; +[super dealloc]; +} + - (void)makeScalePopUpButton { if (scalePopUpButton == nil) { @@ -130,14 +162,55 @@ } } +- (void)handlePDFViewFrameChangedNotification:(NSNotification *)notification { +if (fits) { +NSView *clipView = [[[self documentView] enclosingScrollView] contentView]; +NSRect rect = [self convertRect:[clipView visibleRect] fromView:clipView]; +BOOL scaleWidth = NSWidth(rect) / NSHeight(rect) NSWidth(fitRect) / NSHeight(fitRect); +float factor = scaleWidth ? NSWidth(rect) / NSWidth(fitRect) : NSHeight(rect) / NSHeight(fitRect); +NSRect viewRect = scaleWidth ? NSInsetRect(fitRect, 0.0, 0.5 * (NSHeight(fitRect) - NSHeight(rect) / factor)) : NSInsetRect(fitRect, 0.5 * (NSWidth(fitRect) - NSWidth(rect) / factor), 0.0); +[super setScaleFactor:factor]; +viewRect = [self convertRect:[self
[Skim-app-commit] SF.net SVN: skim-app: [2633] trunk
Revision: 2633 http://skim-app.svn.sourceforge.net/skim-app/?rev=2633view=rev Author: hofman Date: 2007-08-09 08:30:11 -0700 (Thu, 09 Aug 2007) Log Message: --- Automatically fit new snapshot that were created from an explicit selection. Keep autoscales/fits in reverted snapshots. Modified Paths: -- trunk/BDSKZoomablePDFView.h trunk/BDSKZoomablePDFView.m trunk/SKMainWindowController.h trunk/SKMainWindowController.m trunk/SKPDFView.m trunk/SKSnapshotWindowController.h trunk/SKSnapshotWindowController.m Modified: trunk/BDSKZoomablePDFView.h === --- trunk/BDSKZoomablePDFView.h 2007-08-09 14:36:05 UTC (rev 2632) +++ trunk/BDSKZoomablePDFView.h 2007-08-09 15:30:11 UTC (rev 2633) @@ -58,5 +58,6 @@ - (void)setScrollerSize:(NSControlSize)controlSize; - (void)dragWithEvent:(NSEvent *)theEvent; - (void)handlePDFViewFrameChangedNotification:(NSNotification *)notification; +- (void)resetFitRectIfNeeded; @end Modified: trunk/BDSKZoomablePDFView.m === --- trunk/BDSKZoomablePDFView.m 2007-08-09 14:36:05 UTC (rev 2632) +++ trunk/BDSKZoomablePDFView.m 2007-08-09 15:30:11 UTC (rev 2633) @@ -175,6 +175,14 @@ } } +- (void)resetFitRectIfNeeded { +if ([self fits]) { +NSView *clipView = [[[self documentView] enclosingScrollView] contentView]; +page = [self currentPage]; +fitRect = [self convertRect:[self convertRect:[clipView visibleRect] fromView:clipView] toPage:page]; +} +} + - (void)scalePopUpAction:(id)sender { int index = [sender indexOfSelectedItem]; NSNumber *selectedFactorObject = [[sender selectedCell] representedObject]; @@ -198,10 +206,8 @@ if (fits != newFits) { fits = newFits; if (fits) { -NSView *clipView = [[[self documentView] enclosingScrollView] contentView]; -page = [self currentPage]; -fitRect = [self convertRect:[self convertRect:[clipView visibleRect] fromView:clipView] toPage:page]; [self setAutoScales:NO adjustPopup:NO]; +[self resetFitRectIfNeeded]; if (flag) [scalePopUpButton selectItemAtIndex:0]; } else { @@ -259,9 +265,7 @@ - (IBAction)zoomIn:(id)sender{ if([self fits]){ [super zoomIn:sender]; -NSView *clipView = [[[self documentView] enclosingScrollView] contentView]; -page = [self currentPage]; -fitRect = [self convertRect:[self convertRect:[clipView visibleRect] fromView:clipView] toPage:page]; +[self resetFitRectIfNeeded]; }else if([self autoScales]){ [super zoomIn:sender]; }else{ @@ -279,9 +283,7 @@ - (IBAction)zoomOut:(id)sender{ if([self fits]){ [super zoomOut:sender]; -NSView *clipView = [[[self documentView] enclosingScrollView] contentView]; -page = [self currentPage]; -fitRect = [self convertRect:[self convertRect:[clipView visibleRect] fromView:clipView] toPage:page]; +[self resetFitRectIfNeeded]; }else if([self autoScales]){ [super zoomOut:sender]; }else{ @@ -320,6 +322,16 @@ return cnt 0; } +- (void)goToPage:(PDFPage *)aPage { +[super goToPage:aPage]; +[self resetFitRectIfNeeded]; +} + +- (void)goToDestination:(PDFDestination *)destination { +[super goToDestination:destination]; +[self resetFitRectIfNeeded]; +} + #pragma mark Scrollview - (NSScrollView *)scrollView; Modified: trunk/SKMainWindowController.h === --- trunk/SKMainWindowController.h 2007-08-09 14:36:05 UTC (rev 2632) +++ trunk/SKMainWindowController.h 2007-08-09 15:30:11 UTC (rev 2633) @@ -264,7 +264,7 @@ - (IBAction)chooseTransition:(id)sender; - (IBAction)dismissTransitionSheet:(id)sender; -- (void)showSnapshotAtPageNumber:(int)pageNum forRect:(NSRect)rect factor:(int)factor display:(BOOL)display; +- (void)showSnapshotAtPageNumber:(int)pageNum forRect:(NSRect)rect factor:(int)factor fits:(BOOL)fits display:(BOOL)display; - (void)toggleSnapshots:(NSArray *)snapshotArray; - (void)showNote:(PDFAnnotation *)annotation; Modified: trunk/SKMainWindowController.m === --- trunk/SKMainWindowController.m 2007-08-09 14:36:05 UTC (rev 2632) +++ trunk/SKMainWindowController.m 2007-08-09 15:30:11 UTC (rev 2633) @@ -368,7 +368,7 @@ NSEnumerator *setupEnum = [[[SKBookmarkController sharedBookmarkController] snapshotsAtPath:[[[self document] fileURL] path]] objectEnumerator]; NSDictionary *setup; if (setup = [setupEnum nextObject]) -[self showSnapshotAtPageNumber:[[setup objectForKey:@page] unsignedIntValue] forRect:NSRectFromString([setup objectForKey:@rect]) factor:[[setup objectForKey:@scaleFactor
[Skim-app-commit] SF.net SVN: skim-app: [2634] trunk
Revision: 2634 http://skim-app.svn.sourceforge.net/skim-app/?rev=2634view=rev Author: hofman Date: 2007-08-09 11:31:27 -0700 (Thu, 09 Aug 2007) Log Message: --- Remove Fit popup item from zoomable PDF view, and instead redefine the Auto item to automatically fit the content. Rename flag. Modified Paths: -- trunk/BDSKZoomablePDFView.h trunk/BDSKZoomablePDFView.m trunk/SKMainWindowController.h trunk/SKMainWindowController.m trunk/SKPDFView.m trunk/SKSnapshotWindowController.h trunk/SKSnapshotWindowController.m Modified: trunk/BDSKZoomablePDFView.h === --- trunk/BDSKZoomablePDFView.h 2007-08-09 15:30:11 UTC (rev 2633) +++ trunk/BDSKZoomablePDFView.h 2007-08-09 18:31:27 UTC (rev 2634) @@ -42,15 +42,14 @@ @interface BDSKZoomablePDFView : PDFView { NSPopUpButton *scalePopUpButton; -PDFPage *page; -NSRect fitRect; -BOOL fits; +PDFPage *autoFitPage; +NSRect autoFitRect; +BOOL autoFits; } -- (BOOL)fits; -- (void)setFits:(BOOL)newFits; -- (void)setFits:(BOOL)newFits adjustPopup:(BOOL)flag; -- (void)setAutoScales:(BOOL)newAuto adjustPopup:(BOOL)flag; +- (BOOL)autoFits; +- (void)setAutoFits:(BOOL)newAuto; +- (void)setAutoFits:(BOOL)newAuto adjustPopup:(BOOL)flag; - (void)setScaleFactor:(float)factor adjustPopup:(BOOL)flag; - (void)scalePopUpAction:(id)sender; - (NSScrollView *)scrollView; @@ -58,6 +57,6 @@ - (void)setScrollerSize:(NSControlSize)controlSize; - (void)dragWithEvent:(NSEvent *)theEvent; - (void)handlePDFViewFrameChangedNotification:(NSNotification *)notification; -- (void)resetFitRectIfNeeded; +- (void)resetAutoFitRectIfNeeded; @end Modified: trunk/BDSKZoomablePDFView.m === --- trunk/BDSKZoomablePDFView.m 2007-08-09 15:30:11 UTC (rev 2633) +++ trunk/BDSKZoomablePDFView.m 2007-08-09 18:31:27 UTC (rev 2634) @@ -48,7 +48,6 @@ @implementation BDSKZoomablePDFView /* For genstrings: -NSLocalizedStringFromTable(@Fit, @ZoomValues, @Zoom popup entry) NSLocalizedStringFromTable(@Auto, @ZoomValues, @Zoom popup entry) NSLocalizedStringFromTable(@10%, @ZoomValues, @Zoom popup entry) NSLocalizedStringFromTable(@25%, @ZoomValues, @Zoom popup entry) @@ -60,8 +59,8 @@ NSLocalizedStringFromTable(@400%, @ZoomValues, @Zoom popup entry) NSLocalizedStringFromTable(@800%, @ZoomValues, @Zoom popup entry) */ -static NSString *BDSKDefaultScaleMenuLabels[] = {/* @Set..., */ @Fit, @Auto, @10%, @25%, @50%, @75%, @100%, @128%, @150%, @200%, @400%, @800%}; -static float BDSKDefaultScaleMenuFactors[] = {/* 0.0, */ -1, 0, 0.1, 0.25, 0.5, 0.75, 1.0, 1.28, 1.5, 2.0, 4.0, 8.0}; +static NSString *BDSKDefaultScaleMenuLabels[] = {/* @Set..., */ @Auto, @10%, @25%, @50%, @75%, @100%, @128%, @150%, @200%, @400%, @800%}; +static float BDSKDefaultScaleMenuFactors[] = {/* 0.0, */ 0, 0.1, 0.25, 0.5, 0.75, 1.0, 1.28, 1.5, 2.0, 4.0, 8.0}; static float BDSKScaleMenuFontSize = 11.0; #pragma mark Popup button @@ -69,8 +68,8 @@ - (id)initWithFrame:(NSRect)frameRect { if (self = [super initWithFrame:frameRect]) { scalePopUpButton = nil; -page = nil; -fitRect = NSZeroRect; +autoFitPage = nil; +autoFitRect = NSZeroRect; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handlePDFViewFrameChangedNotification:) name:NSViewFrameDidChangeNotification object:self]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handlePDFViewFrameChangedNotification:) @@ -82,8 +81,8 @@ - (id)initWithCoder:(NSCoder *)decoder { if (self = [super initWithCoder:decoder]) { scalePopUpButton = nil; -page = nil; -fitRect = NSZeroRect; +autoFitPage = nil; +autoFitRect = NSZeroRect; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handlePDFViewFrameChangedNotification:) name:NSViewFrameDidChangeNotification object:self]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handlePDFViewFrameChangedNotification:) @@ -163,56 +162,55 @@ } - (void)handlePDFViewFrameChangedNotification:(NSNotification *)notification { -if (fits) { +if ([self autoFits]) { NSView *clipView = [[[self documentView] enclosingScrollView] contentView]; NSRect rect = [self convertRect:[clipView visibleRect] fromView:clipView]; -BOOL scaleWidth = NSWidth(rect) / NSHeight(rect) NSWidth(fitRect) / NSHeight(fitRect); -float factor = scaleWidth ? NSWidth(rect) / NSWidth(fitRect) : NSHeight(rect) / NSHeight(fitRect); -NSRect viewRect = scaleWidth ? NSInsetRect(fitRect, 0.0, 0.5 * (NSHeight(fitRect) - NSHeight(rect) / factor)) : NSInsetRect
[Skim-app-commit] SF.net SVN: skim-app: [2635] trunk/SKPDFView.m
Revision: 2635 http://skim-app.svn.sourceforge.net/skim-app/?rev=2635view=rev Author: hofman Date: 2007-08-09 12:22:36 -0700 (Thu, 09 Aug 2007) Log Message: --- Temporarily disable flushing while selecting a snapshot area for smoother drawing. Modified Paths: -- trunk/SKPDFView.m Modified: trunk/SKPDFView.m === --- trunk/SKPDFView.m 2007-08-09 18:31:27 UTC (rev 2634) +++ trunk/SKPDFView.m 2007-08-09 19:22:36 UTC (rev 2635) @@ -3212,11 +3212,14 @@ while (YES) { theEvent = [[self window] nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSFlagsChangedMask]; +[[self window] disableFlushWindow]; [[self window] restoreCachedImage]; -[[self window] flushWindow]; -if ([theEvent type] == NSLeftMouseUp) +if ([theEvent type] == NSLeftMouseUp) { +[[self window] enableFlushWindow]; +[[self window] flushWindow]; break; +} if ([theEvent type] == NSLeftMouseDragged) { // change mouseLoc @@ -3260,6 +3263,7 @@ [NSBezierPath strokeRect:NSInsetRect(NSIntegralRect([self convertRect:selRect fromView:[self documentView]]), 0.5, 0.5)]; [NSGraphicsContext restoreGraphicsState]; [self unlockFocus]; +[[self window] enableFlushWindow]; [[self window] flushWindow]; } 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2636] trunk
Revision: 2636 http://skim-app.svn.sourceforge.net/skim-app/?rev=2636view=rev Author: hofman Date: 2007-08-09 13:25:11 -0700 (Thu, 09 Aug 2007) Log Message: --- Shade secondary copies of the selection rect in select tool mode. Modified Paths: -- trunk/SKPDFView.h trunk/SKPDFView.m Modified: trunk/SKPDFView.h === --- trunk/SKPDFView.h 2007-08-09 19:22:36 UTC (rev 2635) +++ trunk/SKPDFView.h 2007-08-09 20:25:11 UTC (rev 2636) @@ -177,6 +177,7 @@ - (void)handleAnnotationWillChangeNotification:(NSNotification *)notification; - (void)handleAnnotationDidChangeNotification:(NSNotification *)notification; +- (void)handlePageChangedNotification:(NSNotification *)notification; - (void)handleWindowWillCloseNotification:(NSNotification *)notification; - (void)resetHoverRects; Modified: trunk/SKPDFView.m === --- trunk/SKPDFView.m 2007-08-09 19:22:36 UTC (rev 2635) +++ trunk/SKPDFView.m 2007-08-09 20:25:11 UTC (rev 2636) @@ -190,6 +190,8 @@ name:SKAnnotationWillChangeNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAnnotationDidChangeNotification:) name:SKAnnotationDidChangeNotification object:nil]; +[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handlePageChangedNotification:) + name:PDFViewPageChangedNotification object:self]; [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKeys: [NSArray arrayWithObjects:SKReadingBarColorKey, SKReadingBarInvertKey, nil]]; } @@ -383,6 +385,11 @@ CGContextAddRect(context, *(CGRect *)selectionRect); CGContextSetFillColor(context, color); CGContextEOFillPath(context); +if ([pdfPage isEqual:[self currentPage]] == NO) { +color[3] = 0.3; +CGContextSetFillColor(context, color); +CGContextFillRect(context, *(CGRect *)selectionRect); +} SKCGContextDrawGrabHandle(context, CGPointMake(NSMinX(selectionRect), NSMinY(selectionRect)), radius); SKCGContextDrawGrabHandle(context, CGPointMake(NSMinX(selectionRect), NSMaxY(selectionRect)), radius); SKCGContextDrawGrabHandle(context, CGPointMake(NSMaxX(selectionRect), NSMinY(selectionRect)), radius); @@ -2022,6 +2029,11 @@ } } +- (void)handlePageChangedNotification:(NSNotification *)notification { +if ([self toolMode] == SKSelectToolMode NSIsEmptyRect(selectionRect) == NO) +[self setNeedsDisplay:YES]; +} + #pragma mark FullScreen navigation and autohide - (void)handleWindowWillCloseNotification:(NSNotification *)notification { 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2640] trunk
Revision: 2640 http://skim-app.svn.sourceforge.net/skim-app/?rev=2640view=rev Author: hofman Date: 2007-08-12 16:12:01 -0700 (Sun, 12 Aug 2007) Log Message: --- Allow URL or path as a string on the pasteboard. Modified Paths: -- trunk/SKDocumentController.m trunk/SKDownloadController.m Modified: trunk/SKDocumentController.m === --- trunk/SKDocumentController.m2007-08-12 14:44:55 UTC (rev 2639) +++ trunk/SKDocumentController.m2007-08-12 23:12:01 UTC (rev 2640) @@ -138,7 +138,7 @@ - (id)openDocumentWithContentsOfPasteboard:(NSPasteboard *)pboard error:(NSError **)outError { // allow any filter services to convert to TIFF data if we can't get PDF or PS directly pboard = [NSPasteboard pasteboardByFilteringTypesInPasteboard:pboard]; -NSString *pboardType = [pboard availableTypeFromArray:[NSArray arrayWithObjects:NSPDFPboardType, NSPostScriptPboardType, NSTIFFPboardType, NSURLPboardType, SKWeblocFilePboardType, nil]]; +NSString *pboardType = [pboard availableTypeFromArray:[NSArray arrayWithObjects:NSPDFPboardType, NSPostScriptPboardType, NSTIFFPboardType, NSURLPboardType, SKWeblocFilePboardType, NSStringPboardType, nil]]; id document = nil; if ([pboardType isEqualToString:NSPDFPboardType] || [pboardType isEqualToString:NSPostScriptPboardType] || [pboardType isEqualToString:NSTIFFPboardType]) { @@ -166,13 +166,18 @@ *outError = error; } -} else if ([pboardType isEqualToString:NSURLPboardType] || [pboardType isEqualToString:SKWeblocFilePboardType]) { +} else if ([pboardType isEqualToString:NSURLPboardType] || [pboardType isEqualToString:SKWeblocFilePboardType] || [pboardType isEqualToString:NSStringPboardType]) { NSURL *theURL = nil; if ([pboardType isEqualToString:NSURLPboardType]) { theURL = [NSURL URLFromPasteboard:pboard]; } else if ([pboardType isEqualToString:SKWeblocFilePboardType]) { theURL = [NSURL URLWithString:[pboard stringForType:SKWeblocFilePboardType]]; +} else if ([pboardType isEqualToString:NSStringPboardType]) { +NSString *string = [pboard stringForType:NSStringPboardType]; +theURL = [NSURL URLWithString:string]; +if (theURL == nil [[NSFileManager defaultManager] fileExistsAtPath:string]) +theURL = [NSURL fileURLWithPath:string]; } if ([theURL isFileURL]) { document = [self openDocumentWithContentsOfURL:theURL display:YES error:outError]; @@ -217,7 +222,7 @@ - (BOOL)validateUserInterfaceItem:(id NSValidatedUserInterfaceItem)anItem { if ([anItem action] == @selector(newDocumentFromClipboard:)) { NSPasteboard *pboard = [NSPasteboard pasteboardByFilteringTypesInPasteboard:[NSPasteboard generalPasteboard]]; -return ([[pboard types] firstObjectCommonWithArray:[NSArray arrayWithObjects:NSPDFPboardType, NSPostScriptPboardType, NSTIFFPboardType, nil]] != nil); +return ([pboard availableTypeFromArray:[NSArray arrayWithObjects:NSPDFPboardType, NSPostScriptPboardType, NSTIFFPboardType, NSURLPboardType, SKWeblocFilePboardType, NSStringPboardType, nil]] != nil); } else if ([super respondsToSelector:_cmd]) { return [super validateUserInterfaceItem:anItem]; } else Modified: trunk/SKDownloadController.m === --- trunk/SKDownloadController.m2007-08-12 14:44:55 UTC (rev 2639) +++ trunk/SKDownloadController.m2007-08-12 23:12:01 UTC (rev 2640) @@ -186,7 +186,7 @@ - (NSDragOperation)tableView:(NSTableView*)tv validateDrop:(id NSDraggingInfo)info proposedRow:(int)row proposedDropOperation:(NSTableViewDropOperation)op { NSPasteboard *pboard = [info draggingPasteboard]; -NSString *type = [pboard availableTypeFromArray:[NSArray arrayWithObjects:NSURLPboardType, SKWeblocFilePboardType, nil]]; +NSString *type = [pboard availableTypeFromArray:[NSArray arrayWithObjects:NSURLPboardType, SKWeblocFilePboardType, NSStringPboardType, nil]]; if (type) { [tv setDropRow:-1 dropOperation:NSTableViewDropOn]; @@ -197,13 +197,18 @@ - (BOOL)tableView:(NSTableView*)tv acceptDrop:(id NSDraggingInfo)info row:(int)row dropOperation:(NSTableViewDropOperation)op { NSPasteboard *pboard = [info draggingPasteboard]; -NSString *type = [pboard availableTypeFromArray:[NSArray arrayWithObjects:NSURLPboardType, SKWeblocFilePboardType, nil]]; +NSString *type = [pboard availableTypeFromArray:[NSArray arrayWithObjects:NSURLPboardType, SKWeblocFilePboardType, NSStringPboardType, nil]]; NSURL *theURL; if ([type isEqualToString:NSURLPboardType]) { theURL = [NSURL URLFromPasteboard:pboard]; } else if ([type isEqualToString:SKWeblocFilePboardType
[Skim-app-commit] SF.net SVN: skim-app: [2647] trunk/SKDownloadController.m
Revision: 2647 http://skim-app.svn.sourceforge.net/skim-app/?rev=2647view=rev Author: hofman Date: 2007-08-13 11:17:20 -0700 (Mon, 13 Aug 2007) Log Message: --- Set filename of downloaded files to just the file name, as the temporary file is deleted. Modified Paths: -- trunk/SKDownloadController.m Modified: trunk/SKDownloadController.m === --- trunk/SKDownloadController.m2007-08-13 18:16:35 UTC (rev 2646) +++ trunk/SKDownloadController.m2007-08-13 18:17:20 UTC (rev 2647) @@ -159,7 +159,10 @@ if ([download status] == SKDownloadStatusFinished) { NSURL *URL = [NSURL fileURLWithPath:[download filePath]]; NSError *error = nil; -if (NO == [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:URL display:YES error:error]) +id document = [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:URL display:YES error:error]; +if (document) +[document setFileName:[[URL path] lastPathComponent]]; +else [NSApp presentError:error]; } 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2649] trunk/SKDownloadController.m
Revision: 2649 http://skim-app.svn.sourceforge.net/skim-app/?rev=2649view=rev Author: hofman Date: 2007-08-13 14:15:25 -0700 (Mon, 13 Aug 2007) Log Message: --- Implement paste for download window Modified Paths: -- trunk/SKDownloadController.m Modified: trunk/SKDownloadController.m === --- trunk/SKDownloadController.m2007-08-13 21:11:36 UTC (rev 2648) +++ trunk/SKDownloadController.m2007-08-13 21:15:25 UTC (rev 2649) @@ -140,6 +140,16 @@ } } +- (IBAction)paste:(id)sender { +NSPasteboard *pboard = [NSPasteboard generalPasteboard]; +NSURL *theURL = [NSURL URLFromPasteboardAnyType:pboard]; + +if ([theURL isFileURL]) +[[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:theURL display:YES error:NULL]; +else if (theURL) +[self addDownloadForURL:theURL]; +} + #pragma mark SKDownloadDelegate - (void)downloadDidStart:(SKDownload *)download { 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2652] trunk
Revision: 2652 http://skim-app.svn.sourceforge.net/skim-app/?rev=2652view=rev Author: hofman Date: 2007-08-14 02:21:28 -0700 (Tue, 14 Aug 2007) Log Message: --- Add resume button to downloads window. Remove successfully finished downloads. Modified Paths: -- trunk/Dutch.lproj/DownloadsWindow.nib/info.nib trunk/Dutch.lproj/DownloadsWindow.nib/keyedobjects.nib trunk/English.lproj/DownloadsWindow.nib/info.nib trunk/English.lproj/DownloadsWindow.nib/keyedobjects.nib trunk/French.lproj/DownloadsWindow.nib/info.nib trunk/French.lproj/DownloadsWindow.nib/keyedobjects.nib trunk/Italian.lproj/DownloadsWindow.nib/info.nib trunk/Italian.lproj/DownloadsWindow.nib/keyedobjects.nib trunk/SKDownload.h trunk/SKDownload.m trunk/SKDownloadController.m trunk/Skim.xcodeproj/project.pbxproj Added Paths: --- trunk/Images/Resume.tiff Modified: trunk/Dutch.lproj/DownloadsWindow.nib/info.nib === --- trunk/Dutch.lproj/DownloadsWindow.nib/info.nib 2007-08-14 01:12:06 UTC (rev 2651) +++ trunk/Dutch.lproj/DownloadsWindow.nib/info.nib 2007-08-14 09:21:28 UTC (rev 2652) @@ -3,7 +3,7 @@ plist version=1.0 dict keyIBDocumentLocation/key - string115 82 356 240 0 0 1600 1178 /string + string100 77 356 240 0 0 1440 938 /string keyIBFramework Version/key string446.1/string keyIBOpenObjects/key Modified: trunk/Dutch.lproj/DownloadsWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/English.lproj/DownloadsWindow.nib/info.nib === --- trunk/English.lproj/DownloadsWindow.nib/info.nib2007-08-14 01:12:06 UTC (rev 2651) +++ trunk/English.lproj/DownloadsWindow.nib/info.nib2007-08-14 09:21:28 UTC (rev 2652) @@ -3,7 +3,7 @@ plist version=1.0 dict keyIBDocumentLocation/key - string115 103 356 240 0 0 1600 1178 /string + string100 77 356 240 0 0 1440 938 /string keyIBFramework Version/key string446.1/string keyIBOpenObjects/key Modified: trunk/English.lproj/DownloadsWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/French.lproj/DownloadsWindow.nib/info.nib === --- trunk/French.lproj/DownloadsWindow.nib/info.nib 2007-08-14 01:12:06 UTC (rev 2651) +++ trunk/French.lproj/DownloadsWindow.nib/info.nib 2007-08-14 09:21:28 UTC (rev 2652) @@ -3,7 +3,7 @@ plist version=1.0 dict keyIBDocumentLocation/key - string115 103 356 240 0 0 1600 1178 /string + string100 77 356 240 0 0 1440 938 /string keyIBFramework Version/key string446.1/string keyIBOpenObjects/key Modified: trunk/French.lproj/DownloadsWindow.nib/keyedobjects.nib === (Binary files differ) Added: trunk/Images/Resume.tiff === (Binary files differ) Property changes on: trunk/Images/Resume.tiff ___ Name: svn:mime-type + application/octet-stream Modified: trunk/Italian.lproj/DownloadsWindow.nib/info.nib === --- trunk/Italian.lproj/DownloadsWindow.nib/info.nib2007-08-14 01:12:06 UTC (rev 2651) +++ trunk/Italian.lproj/DownloadsWindow.nib/info.nib2007-08-14 09:21:28 UTC (rev 2652) @@ -3,7 +3,7 @@ plist version=1.0 dict keyIBDocumentLocation/key - string115 103 356 240 0 0 1600 1178 /string + string100 77 356 240 0 0 1440 938 /string keyIBFramework Version/key string446.1/string keyIBOpenObjects/key Modified: trunk/Italian.lproj/DownloadsWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/SKDownload.h === --- trunk/SKDownload.h 2007-08-14 01:12:06 UTC (rev 2651) +++ trunk/SKDownload.h 2007-08-14 09:21:28 UTC (rev 2652) @@ -85,9 +85,11 @@ - (void)startDownload; - (void)cancelDownload; +- (void)resumeDownload; - (void)cleanupDownload; - (BOOL)canCancel; +- (BOOL)canResume; @end Modified: trunk/SKDownload.m === --- trunk/SKDownload.m 2007-08-14 01:12:06 UTC (rev 2651) +++ trunk/SKDownload.m 2007-08-14 09:21:28 UTC (rev 2652) @@ -63,7 +63,7 @@ } - (void)dealloc { -[self cancelDownload]; +[self cleanupDownload]; [URL release]; [URLDownload release]; [filePath release]; @@ -198,10 +198,10 @@ return; } -[self
[Skim-app-commit] SF.net SVN: skim-app: [2653] trunk
Revision: 2653 http://skim-app.svn.sourceforge.net/skim-app/?rev=2653view=rev Author: hofman Date: 2007-08-14 02:56:09 -0700 (Tue, 14 Aug 2007) Log Message: --- Use documentcontroller method for URL service. Add a service to open selected PDF. Modified Paths: -- trunk/Info.plist trunk/SKApplicationController.m trunk/SKDocumentController.h trunk/SKDocumentController.m Modified: trunk/Info.plist === --- trunk/Info.plist2007-08-14 09:21:28 UTC (rev 2652) +++ trunk/Info.plist2007-08-14 09:56:09 UTC (rev 2653) @@ -365,10 +365,28 @@ stringSkim/string keyNSSendTypes/key array + stringNSURLPboardType/string stringNSStringPboardType/string - stringNSURLPboardType/string + stringCorePasteboardFlavorType 0x75726C20/string /array /dict + dict +keyNSMenuItem/key +dict + keydefault/key + stringOpen Selected PDF/string +/dict +keyNSMessage/key +stringopenDocumentFromDataOnPboard/string +keyNSPortName/key +stringSkim/string +keyNSSendTypes/key +array + stringNSPDFPboardType/string + stringNSPostScriptPboardType/string + stringNSTIFFPboardType/string +/array + /dict /array /dict Modified: trunk/SKApplicationController.m === --- trunk/SKApplicationController.m 2007-08-14 09:21:28 UTC (rev 2652) +++ trunk/SKApplicationController.m 2007-08-14 09:56:09 UTC (rev 2653) @@ -53,6 +53,8 @@ #import SKLine.h #import NSImage_SKExtensions.h #import SKDownloadController.h +#import NSURL_SKExtensions.h +#import SKDocumentController.h @implementation SKApplicationController @@ -189,54 +191,20 @@ #pragma mark Services Support -- (void)openDocumentFromURLOnPboard:(NSPasteboard *)pboard - userData:(NSString *)userData - error:(NSString **)error{ - -NSArray *types = [pboard types]; +- (void)openDocumentFromURLOnPboard:(NSPasteboard *)pboard userData:(NSString *)userData error:(NSString **)error { +NSError *outError; +id document = [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfPasteboard:pboard typesMask:SKURLPboardTypesMask error:outError]; -bool pbHasStringType = [types containsObject:NSStringPboardType]; -bool pbHasURLType = [types containsObject:NSURLPboardType]; - -if (!pbHasStringType !pbHasURLType) { -*error = NSLocalizedString(@Error: couldn't get a URL., - @pboard couldn't give string or URL.); -return; -} - -NSURL *pdfURL = nil; - -if (pbHasURLType){ -pdfURL = [NSURL URLFromPasteboard:pboard]; -} - -if (pdfURL == nil pbHasStringType){ -NSString *pboardString = [pboard stringForType:NSStringPboardType]; - -if (!pboardString) { -*error = NSLocalizedString(@Error: couldn't get a URL., - @pboard couldn't give string.); -return; -} -pdfURL = [NSURL URLWithString:pboardString]; -} - -if (!pdfURL){ -*error = NSLocalizedString(@Error: couldn't get a URL, - @nothing worked.); -return; -} +if (document == nil outError error) +*error = [outError localizedDescription]; +} -if([pdfURL isFileURL]){ -NSError *newError; -[[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:pdfURL - display:YES - error:newError]; -}else{ -[[SKDownloadController sharedDownloadController] addDownloadForURL:pdfURL]; -} +- (void)openDocumentFromDataOnPboard:(NSPasteboard *)pboard userData:(NSString *)userData error:(NSString **)error { +NSError *outError; +id document = [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfPasteboard:pboard typesMask:SKImagePboardTypesMask error:outError]; -return; +if (document == nil outError error) +*error = [outError localizedDescription]; } #pragma mark Actions Modified: trunk/SKDocumentController.h === --- trunk/SKDocumentController.h2007-08-14 09:21:28 UTC (rev 2652) +++ trunk/SKDocumentController.h2007-08-14 09:56:09 UTC (rev 2653) @@ -47,8 +47,12 @@ extern NSString *SKPostScriptDocumentType; extern NSString *SKDVIDocumentType; +enum { +SKImagePboardTypesMask = 1, +SKURLPboardTypesMask = 2 +}; @interface SKDocumentController
[Skim-app-commit] SF.net SVN: skim-app: [2655] trunk/Info.plist
Revision: 2655 http://skim-app.svn.sourceforge.net/skim-app/?rev=2655view=rev Author: hofman Date: 2007-08-14 03:26:52 -0700 (Tue, 14 Aug 2007) Log Message: --- Add services in Skim submenu. Modified Paths: -- trunk/Info.plist Modified: trunk/Info.plist === --- trunk/Info.plist2007-08-14 10:09:59 UTC (rev 2654) +++ trunk/Info.plist2007-08-14 10:26:52 UTC (rev 2655) @@ -357,7 +357,7 @@ keyNSMenuItem/key dict keydefault/key - stringOpen PDF at URL/string + stringSkim/Open PDF at URL/string /dict keyNSMessage/key stringopenDocumentFromURLOnPboard/string @@ -374,7 +374,7 @@ keyNSMenuItem/key dict keydefault/key - stringOpen Selected PDF/string + stringSkim/Open Selected PDF/string /dict keyNSMessage/key stringopenDocumentFromDataOnPboard/string 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2657] trunk
Revision: 2657 http://skim-app.svn.sourceforge.net/skim-app/?rev=2657view=rev Author: hofman Date: 2007-08-14 05:16:13 -0700 (Tue, 14 Aug 2007) Log Message: --- Add hidden default to automatically remove finished downloads. Set progress bar value when finished. Modified Paths: -- trunk/InitialUserDefaults.plist trunk/SKDownload.m trunk/SKDownloadController.m trunk/SKStringConstants.h trunk/SKStringConstants.m Modified: trunk/InitialUserDefaults.plist === --- trunk/InitialUserDefaults.plist 2007-08-14 11:09:16 UTC (rev 2656) +++ trunk/InitialUserDefaults.plist 2007-08-14 12:16:13 UTC (rev 2657) @@ -226,6 +226,8 @@ real600.0/real keySKAutoOpenDownloadsWindow/key true/ +keySKAutoRemoveFinishedDownloads/key +true/ keySUScheduledCheckInterval/key integer86400/integer /dict Modified: trunk/SKDownload.m === --- trunk/SKDownload.m 2007-08-14 11:09:16 UTC (rev 2656) +++ trunk/SKDownload.m 2007-08-14 12:16:13 UTC (rev 2657) @@ -48,6 +48,8 @@ URLDownload = nil; filePath = nil; fileIcon = nil; +expectedContentLength = -1; +receivedContentLength = 0; progressIndicator = nil; status = SKDownloadStatusUndefined; delegate = aDelegate; @@ -294,6 +296,8 @@ } - (void)downloadDidFinish:(NSURLDownload *)theDownload { +if (expectedContentLength 0) + [progressIndicator setDoubleValue:(double)expectedContentLength]; [self setStatus:SKDownloadStatusFinished]; if ([delegate respondsToSelector:@selector(downloadDidEnd:)]) [delegate downloadDidEnd:self]; Modified: trunk/SKDownloadController.m === --- trunk/SKDownloadController.m2007-08-14 11:09:16 UTC (rev 2656) +++ trunk/SKDownloadController.m2007-08-14 12:16:13 UTC (rev 2657) @@ -40,6 +40,7 @@ #import SKDownload.h #import SKProgressCell.h #import NSURL_SKExtensions.h +#import SKStringConstants.h @implementation SKDownloadController @@ -190,8 +191,10 @@ else [NSApp presentError:error]; -[download cleanupDownload]; -[downloads removeObject:download]; +if ([[NSUserDefaults standardUserDefaults] boolForKey:SKAutoRemoveFinishedDownloadsKey]) { +[download cleanupDownload]; +[downloads removeObject:download]; +} } [self reloadTableView]; Modified: trunk/SKStringConstants.h === --- trunk/SKStringConstants.h 2007-08-14 11:09:16 UTC (rev 2656) +++ trunk/SKStringConstants.h 2007-08-14 12:16:13 UTC (rev 2657) @@ -101,3 +101,4 @@ extern NSString *SKActivatePresentationNavigationAtBottomKey; extern NSString *SKAutoHidePresentationContentsKey; extern NSString *SKAutoOpenDownloadsWindowKey; +extern NSString *SKAutoRemoveFinishedDownloadsKey; Modified: trunk/SKStringConstants.m === --- trunk/SKStringConstants.m 2007-08-14 11:09:16 UTC (rev 2656) +++ trunk/SKStringConstants.m 2007-08-14 12:16:13 UTC (rev 2657) @@ -102,3 +102,4 @@ NSString *SKActivatePresentationNavigationAtBottomKey = @SKActivatePresentationNavigationAtBottom; NSString *SKAutoHidePresentationContentsKey = @SKAutoHidePresentationContents; NSString *SKAutoOpenDownloadsWindowKey = @SKAutoOpenDownloadsWindow; +NSString *SKAutoRemoveFinishedDownloadsKey = @SKAutoRemoveFinishedDownloads; 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2658] trunk/NSURL_SKExtensions.m
Revision: 2658 http://skim-app.svn.sourceforge.net/skim-app/?rev=2658view=rev Author: hofman Date: 2007-08-14 05:46:24 -0700 (Tue, 14 Aug 2007) Log Message: --- check for webloc files before URLs, otherwise webloc files will give their file's URL rather than the represented URL. Modified Paths: -- trunk/NSURL_SKExtensions.m Modified: trunk/NSURL_SKExtensions.m === --- trunk/NSURL_SKExtensions.m 2007-08-14 12:16:13 UTC (rev 2657) +++ trunk/NSURL_SKExtensions.m 2007-08-14 12:46:24 UTC (rev 2658) @@ -43,7 +43,7 @@ @implementation NSURL (SKExtensions) + (NSURL *)URLFromPasteboardAnyType:(NSPasteboard *)pasteboard { -NSString *pboardType = [pasteboard availableTypeFromArray:[NSArray arrayWithObjects:NSURLPboardType, SKWeblocFilePboardType, NSStringPboardType, nil]]; +NSString *pboardType = [pasteboard availableTypeFromArray:[NSArray arrayWithObjects:SKWeblocFilePboardType, NSURLPboardType, NSStringPboardType, nil]]; NSURL *theURL = nil; if ([pboardType isEqualToString:NSURLPboardType]) { theURL = [NSURL URLFromPasteboard:pasteboard]; 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2661] trunk
Revision: 2661 http://skim-app.svn.sourceforge.net/skim-app/?rev=2661view=rev Author: hofman Date: 2007-08-14 11:22:41 -0700 (Tue, 14 Aug 2007) Log Message: --- Make some setters for download object private. Cleanup download when app terminates in the download object. Modified Paths: -- trunk/SKDownload.h trunk/SKDownload.m trunk/SKDownloadController.h trunk/SKDownloadController.m Modified: trunk/SKDownload.h === --- trunk/SKDownload.h 2007-08-14 17:50:41 UTC (rev 2660) +++ trunk/SKDownload.h 2007-08-14 18:22:41 UTC (rev 2661) @@ -64,18 +64,13 @@ - (id)delegate; - (void)setDelegate:(id)newDelegate; -- (int)status; -- (void)setStatus:(int)newStatus; - - (NSURL *)URL; - (void)setURL:(NSURL *)newURL; +- (int)status; - (NSString *)filePath; -- (void)setFilePath:(NSString *)newFilePath; - - (NSString *)fileName; - (NSImage *)fileIcon; - - (long long)expectedContentLength; - (long long)receivedContentLength; Modified: trunk/SKDownload.m === --- trunk/SKDownload.m 2007-08-14 17:50:41 UTC (rev 2660) +++ trunk/SKDownload.m 2007-08-14 18:22:41 UTC (rev 2661) @@ -40,6 +40,15 @@ #import ApplicationServices/ApplicationServices.h [EMAIL PROTECTED] SKDownload (Private) +- (void)setStatus:(int)newStatus; +- (void)setFilePath:(NSString *)newFilePath; +- (void)setExpectedContentLength:(long long)newExpectedContentLength; +- (void)setReceivedContentLength:(long long)newReceivedContentLength; +- (void)handleApplicationWillTerminateNotification:(NSNotification *)notification; [EMAIL PROTECTED] + + @implementation SKDownload - (id)initWithURL:(NSURL *)aURL delegate:(id)aDelegate { @@ -56,6 +65,9 @@ if (URL) [self startDownload]; + +[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleApplicationWillTerminateNotification:) + name:NSApplicationWillTerminateNotification object:NSApp]; } return self; } @@ -65,6 +77,7 @@ } - (void)dealloc { +[[NSNotificationCenter defaultCenter] removeObserver:self]; [self cleanupDownload]; [URL release]; [URLDownload release]; @@ -74,6 +87,10 @@ [super dealloc]; } +- (void)handleApplicationWillTerminateNotification:(NSNotification *)notification { +[self cleanupDownload]; +} + #pragma mark Accessors - (id)delegate { @@ -150,7 +167,7 @@ expectedContentLength = newExpectedContentLength; if (expectedContentLength 0) { [progressIndicator setIndeterminate:NO]; -[progressIndicator setMaxValue:expectedContentLength]; +[progressIndicator setMaxValue:(double)expectedContentLength]; } else { [progressIndicator setIndeterminate:YES]; [progressIndicator setMaxValue:1.0]; @@ -181,13 +198,13 @@ [progressIndicator sizeToFit]; if (expectedContentLength 0) { [progressIndicator setIndeterminate:NO]; -[progressIndicator setMaxValue:expectedContentLength]; +[progressIndicator setMaxValue:(double)expectedContentLength]; +[progressIndicator setDoubleValue:(double)receivedContentLength]; } else { [progressIndicator setIndeterminate:YES]; [progressIndicator setMaxValue:1.0]; } -if ([self status] == SKDownloadStatusDownloading) -[progressIndicator startAnimation:self]; +[progressIndicator startAnimation:self]; } return progressIndicator; } Modified: trunk/SKDownloadController.h === --- trunk/SKDownloadController.h2007-08-14 17:50:41 UTC (rev 2660) +++ trunk/SKDownloadController.h2007-08-14 18:22:41 UTC (rev 2661) @@ -53,6 +53,4 @@ - (IBAction)removeDownload:(id)sender; - (IBAction)cancelDownload:(id)sender; -- (void)handleApplicationWillTerminateNotification:(NSNotification *)notification; - @end Modified: trunk/SKDownloadController.m === --- trunk/SKDownloadController.m2007-08-14 17:50:41 UTC (rev 2660) +++ trunk/SKDownloadController.m2007-08-14 18:22:41 UTC (rev 2661) @@ -55,8 +55,6 @@ - (id)init { if (self = [super init]) { downloads = [[NSMutableArray alloc] init]; -[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleApplicationWillTerminateNotification:) - name:NSApplicationWillTerminateNotification object:NSApp]; } return self; } @@ -68,10 +66,6 @@ - (NSString *)windowNibName { return @DownloadsWindow; } -- (void)handleApplicationWillTerminateNotification:(NSNotification *)notification { -[downloads
[Skim-app-commit] SF.net SVN: skim-app: [2662] trunk/SKDownload.m
Revision: 2662 http://skim-app.svn.sourceforge.net/skim-app/?rev=2662view=rev Author: hofman Date: 2007-08-15 06:13:44 -0700 (Wed, 15 Aug 2007) Log Message: --- Resume download restarts when there is no resume data or the download failed. Allows reloading for restored internet connection. Modified Paths: -- trunk/SKDownload.m Modified: trunk/SKDownload.m === --- trunk/SKDownload.m 2007-08-14 18:22:41 UTC (rev 2661) +++ trunk/SKDownload.m 2007-08-15 13:13:44 UTC (rev 2662) @@ -195,6 +195,7 @@ progressIndicator = [[NSProgressIndicator alloc] init]; [progressIndicator setStyle:NSProgressIndicatorBarStyle]; [progressIndicator setControlSize:NSSmallControlSize]; +[progressIndicator setUsesThreadedAnimation:YES]; [progressIndicator sizeToFit]; if (expectedContentLength 0) { [progressIndicator setIndeterminate:NO]; @@ -239,14 +240,27 @@ - (void)resumeDownload { if ([self canResume]) { -NSData *resumeData = [[[URLDownload resumeData] retain] autorelease]; +NSData *resumeData = nil; +if ([self status] == SKDownloadStatusCanceled) +resumeData = [[[URLDownload resumeData] retain] autorelease]; + if (resumeData) { + [URLDownload release]; URLDownload = [[NSURLDownload alloc] initWithResumeData:resumeData delegate:self path:[self filePath]]; [URLDownload setDeletesFileUponFailure:NO]; [self setStatus:SKDownloadStatusDownloading]; if ([delegate respondsToSelector:@selector(downloadDidUpdate:)]) [delegate downloadDidUpdate:self]; + +} else { + +[self cleanupDownload]; +[self setFilePath:nil]; +[URLDownload release]; +URLDownload = nil; +[self startDownload]; + } } } @@ -262,7 +276,7 @@ } - (BOOL)canResume { -return [self status] == SKDownloadStatusCanceled; +return ([self status] == SKDownloadStatusCanceled || [self status] == SKDownloadStatusFailed) [self URL]; } #pragma mark NSURLDownloadDelegate protocol 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2663] trunk/SKDocument.m
Revision: 2663 http://skim-app.svn.sourceforge.net/skim-app/?rev=2663view=rev Author: hofman Date: 2007-08-15 10:36:38 -0700 (Wed, 15 Aug 2007) Log Message: --- Always set the print orientation, as the user may have landscape set as default. Modified Paths: -- trunk/SKDocument.m Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-08-15 13:13:44 UTC (rev 2662) +++ trunk/SKDocument.m 2007-08-15 17:36:38 UTC (rev 2663) @@ -112,13 +112,14 @@ if ([pdfDocument pageCount]) { PDFPage *page = [pdfDocument pageAtIndex:0]; NSPrintInfo *printInfo = [self printInfo]; -NSSize paperSize = [printInfo paperSize]; NSSize pageSize = [page boundsForBox:kPDFDisplayBoxMediaBox].size; +BOOL isWide = pageSize.width pageSize.height; BOOL isRotated = [page rotation] % 180 == 90; -BOOL isWide = (pageSize.width pageSize.height) != (paperSize.width paperSize.height); -if (isRotated != isWide) { +NSPrintingOrientation requiredOrientation = isWide == isRotated ? NSPortraitOrientation : NSLandscapeOrientation; +NSPrintingOrientation currentOrientation = [printInfo orientation]; +if (requiredOrientation != currentOrientation) { printInfo = [printInfo copy]; -[printInfo setOrientation:NSLandscapeOrientation]; +[printInfo setOrientation:requiredOrientation]; [self setPrintInfo:printInfo]; [printInfo release]; } 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2671] trunk
Revision: 2671 http://skim-app.svn.sourceforge.net/skim-app/?rev=2671view=rev Author: hofman Date: 2007-08-16 10:35:12 -0700 (Thu, 16 Aug 2007) Log Message: --- Add hidden default to close downloads window when all downloads have finished. Modified Paths: -- trunk/InitialUserDefaults.plist trunk/SKDownloadController.m trunk/SKStringConstants.h trunk/SKStringConstants.m Modified: trunk/InitialUserDefaults.plist === --- trunk/InitialUserDefaults.plist 2007-08-16 17:28:46 UTC (rev 2670) +++ trunk/InitialUserDefaults.plist 2007-08-16 17:35:12 UTC (rev 2671) @@ -228,6 +228,8 @@ true/ keySKAutoRemoveFinishedDownloads/key true/ +keySKAutoCloseDownloadsWindow/key +false/ keySUScheduledCheckInterval/key integer86400/integer /dict Modified: trunk/SKDownloadController.m === --- trunk/SKDownloadController.m2007-08-16 17:28:46 UTC (rev 2670) +++ trunk/SKDownloadController.m2007-08-16 17:35:12 UTC (rev 2671) @@ -190,6 +190,8 @@ [downloads removeObject:download]; // for the document to note that the file has been deleted [document setFileURL:[NSURL fileURLWithPath:[download filePath]]]; +if ([downloads count] == 0 [[NSUserDefaults standardUserDefaults] boolForKey:SKAutoCloseDownloadsWindowKey]) +[[self window] close]; } } Modified: trunk/SKStringConstants.h === --- trunk/SKStringConstants.h 2007-08-16 17:28:46 UTC (rev 2670) +++ trunk/SKStringConstants.h 2007-08-16 17:35:12 UTC (rev 2671) @@ -102,3 +102,4 @@ extern NSString *SKAutoHidePresentationContentsKey; extern NSString *SKAutoOpenDownloadsWindowKey; extern NSString *SKAutoRemoveFinishedDownloadsKey; +extern NSString *SKAutoCloseDownloadsWindowKey; Modified: trunk/SKStringConstants.m === --- trunk/SKStringConstants.m 2007-08-16 17:28:46 UTC (rev 2670) +++ trunk/SKStringConstants.m 2007-08-16 17:35:12 UTC (rev 2671) @@ -103,3 +103,4 @@ NSString *SKAutoHidePresentationContentsKey = @SKAutoHidePresentationContents; NSString *SKAutoOpenDownloadsWindowKey = @SKAutoOpenDownloadsWindow; NSString *SKAutoRemoveFinishedDownloadsKey = @SKAutoRemoveFinishedDownloads; +NSString *SKAutoCloseDownloadsWindowKey = @SKAutoCloseDownloadsWindow; 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2672] trunk/SKSideWindow.m
Revision: 2672 http://skim-app.svn.sourceforge.net/skim-app/?rev=2672view=rev Author: hofman Date: 2007-08-16 12:44:24 -0700 (Thu, 16 Aug 2007) Log Message: --- Make sure side windows start off in the right state. Modified Paths: -- trunk/SKSideWindow.m Modified: trunk/SKSideWindow.m === --- trunk/SKSideWindow.m2007-08-16 17:35:12 UTC (rev 2671) +++ trunk/SKSideWindow.m2007-08-16 19:44:24 UTC (rev 2672) @@ -89,6 +89,8 @@ frame.origin.x = NSMaxX(screenFrame) - WINDOW_OFFSET; frame = NSInsetRect(frame, 0.0, WINDOW_INSET); [self setFrame:frame display:NO]; +state = NSDrawerClosedState; +[[self contentView] setAcceptsMouseOver:YES]; } - (void)slideOut { 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2673] trunk/SKPDFAnnotationNote.m
Revision: 2673 http://skim-app.svn.sourceforge.net/skim-app/?rev=2673view=rev Author: hofman Date: 2007-08-16 12:55:35 -0700 (Thu, 16 Aug 2007) Log Message: --- Use 1px outset for the line rects to build the selection for a highlight, to avoid rounding errors. Modified Paths: -- trunk/SKPDFAnnotationNote.m Modified: trunk/SKPDFAnnotationNote.m === --- trunk/SKPDFAnnotationNote.m 2007-08-16 19:44:24 UTC (rev 2672) +++ trunk/SKPDFAnnotationNote.m 2007-08-16 19:55:35 UTC (rev 2673) @@ -943,7 +943,8 @@ unsigned i; for (i = 0; i numberOfLines; i++) { -if (sel = [[self page] selectionForRect:lineRects[i]]) { +// slightly outset the rect to avoid rounding errors, as selectionForRect is pretty strict +if (sel = [[self page] selectionForRect:NSInsetRect(lineRects[i], -1.0, -1.0)]) { if (selection == nil) selection = sel; else 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2674] trunk
Revision: 2674 http://skim-app.svn.sourceforge.net/skim-app/?rev=2674view=rev Author: hofman Date: 2007-08-17 03:18:26 -0700 (Fri, 17 Aug 2007) Log Message: --- Use mainScreen for fullscreen windows if the passed in screen is nil. Modified Paths: -- trunk/SKFullScreenWindow.m trunk/SKNavigationWindow.m trunk/SKSideWindow.m Modified: trunk/SKFullScreenWindow.m === --- trunk/SKFullScreenWindow.m 2007-08-16 19:55:35 UTC (rev 2673) +++ trunk/SKFullScreenWindow.m 2007-08-17 10:18:26 UTC (rev 2674) @@ -44,6 +44,8 @@ @implementation SKFullScreenWindow - (id)initWithScreen:(NSScreen *)screen { +if (screen == nil) +screen = [NSScreen mainScreen]; if (self = [self initWithContentRect:[screen frame] styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO screen:screen]) { [self setReleasedWhenClosed:NO]; [self setDisplaysWhenScreenProfileChanges:YES]; Modified: trunk/SKNavigationWindow.m === --- trunk/SKNavigationWindow.m 2007-08-16 19:55:35 UTC (rev 2673) +++ trunk/SKNavigationWindow.m 2007-08-17 10:18:26 UTC (rev 2674) @@ -53,6 +53,8 @@ - (id)initWithPDFView:(PDFView *)pdfView { NSScreen *screen = [[pdfView window] screen]; +if (screen == nil) +screen = [NSScreen mainScreen]; float width = 4 * BUTTON_WIDTH + 2 * SEP_WIDTH + 2 * MARGIN; NSRect contentRect = NSMakeRect(NSMidX([screen frame]) - 0.5 * width, NSMinY([screen frame]) + OFFSET, width, BUTTON_WIDTH + 2 * MARGIN); if (self = [super initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO screen:screen]) { Modified: trunk/SKSideWindow.m === --- trunk/SKSideWindow.m2007-08-16 19:55:35 UTC (rev 2673) +++ trunk/SKSideWindow.m2007-08-17 10:18:26 UTC (rev 2674) @@ -55,6 +55,8 @@ - (id)initWithMainController:(SKMainWindowController *)aController edge:(NSRectEdge)anEdge { NSScreen *screen = [[aController window] screen]; +if (screen == nil) +screen = [NSScreen mainScreen]; NSRect contentRect = [screen frame]; if (anEdge == NSMaxXEdge) contentRect.origin.x = NSMaxX(contentRect) - DEFAULT_WINDOW_WIDTH; 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2678] trunk
Revision: 2678 http://skim-app.svn.sourceforge.net/skim-app/?rev=2678view=rev Author: hofman Date: 2007-08-17 16:26:25 -0700 (Fri, 17 Aug 2007) Log Message: --- Explicitly pass the screen for sidewindows and navigation windows, rather than getting it from the current window. The screen may not be set yet, as it is changed asynchronously when the window is displayed, not when the window frame is set. Modified Paths: -- trunk/SKMainWindowController.m trunk/SKPDFView.h trunk/SKPDFView.m Modified: trunk/SKMainWindowController.m === --- trunk/SKMainWindowController.m 2007-08-17 18:41:25 UTC (rev 2677) +++ trunk/SKMainWindowController.m 2007-08-17 23:26:25 UTC (rev 2678) @@ -133,11 +133,11 @@ - (void)setupToolbar; -- (void)showLeftSideWindow; -- (void)showRightSideWindow; +- (void)showLeftSideWindowOnScreen:(NSScreen *)screen; +- (void)showRightSideWindowOnScreen:(NSScreen *)screen; - (void)hideLeftSideWindow; - (void)hideRightSideWindow; -- (void)showSideWindows; +- (void)showSideWindowsOnScreen:(NSScreen *)screen; - (void)hideSideWindows; - (void)goFullScreen; - (void)removeFullScreen; @@ -1777,7 +1777,7 @@ if ([leftSideWindow isVisible]) [self hideLeftSideWindow]; else -[self showLeftSideWindow]; +[self showLeftSideWindowOnScreen:[[self window] screen]]; } else { NSRect sideFrame = [leftSideContentBox frame]; NSRect pdfFrame = [pdfContentBox frame]; @@ -1862,10 +1862,7 @@ #pragma mark Full Screen support -- (void)showLeftSideWindow { -NSScreen *screen = [[self window] screen]; -if (screen == nil) -screen = [NSScreen mainScreen]; +- (void)showLeftSideWindowOnScreen:(NSScreen *)screen { if (leftSideWindow == nil) leftSideWindow = [[SKSideWindow alloc] initWithMainController:self edge:NSMinXEdge]; @@ -1893,10 +1890,7 @@ } } -- (void)showRightSideWindow { -NSScreen *screen = [[self window] screen]; // @@ or should we use the main screen? -if (screen == nil) -screen = [NSScreen mainScreen]; +- (void)showRightSideWindowOnScreen:(NSScreen *)screen { if (rightSideWindow == nil) rightSideWindow = [[SKSideWindow alloc] initWithMainController:self edge:NSMaxXEdge]; @@ -1962,9 +1956,9 @@ } } -- (void)showSideWindows { -[self showLeftSideWindow]; -[self showRightSideWindow]; +- (void)showSideWindowsOnScreen:(NSScreen *)screen { +[self showLeftSideWindowOnScreen:screen]; +[self showRightSideWindowOnScreen:screen]; [pdfView setFrame:NSInsetRect([[pdfView superview] bounds], 9.0, 0.0)]; [[pdfView superview] setNeedsDisplay:YES]; @@ -2176,8 +2170,8 @@ if ([fullScreenSetup count]) [self applyPDFSettings:fullScreenSetup]; -[pdfView setHasNavigation:YES activateAtBottom:[[NSUserDefaults standardUserDefaults] boolForKey:SKActivateFullScreenNavigationAtBottomKey] autohidesCursor:NO]; -[self showSideWindows]; +[pdfView setHasNavigation:YES activateAtBottom:[[NSUserDefaults standardUserDefaults] boolForKey:SKActivateFullScreenNavigationAtBottomKey] autohidesCursor:NO screen:screen]; +[self showSideWindowsOnScreen:screen]; } - (IBAction)enterPresentation:(id)sender { @@ -2199,7 +2193,7 @@ else [self goFullScreen]; -[pdfView setHasNavigation:YES activateAtBottom:[[NSUserDefaults standardUserDefaults] boolForKey:SKActivatePresentationNavigationAtBottomKey] autohidesCursor:YES]; +[pdfView setHasNavigation:YES activateAtBottom:[[NSUserDefaults standardUserDefaults] boolForKey:SKActivatePresentationNavigationAtBottomKey] autohidesCursor:YES screen:nil]; } - (IBAction)exitFullScreen:(id)sender { @@ -2211,7 +2205,7 @@ if ([[fullScreenWindow firstResponder] isDescendantOf:pdfView]) [fullScreenWindow makeFirstResponder:nil]; -[pdfView setHasNavigation:NO activateAtBottom:NO autohidesCursor:NO]; +[pdfView setHasNavigation:NO activateAtBottom:NO autohidesCursor:NO screen:nil]; [pdfView setFrame:[[pdfContentBox contentView] bounds]]; [pdfContentBox addSubview:pdfView]; // this should be done before exitPresentationMode to get a smooth transition Modified: trunk/SKPDFView.h === --- trunk/SKPDFView.h 2007-08-17 18:41:25 UTC (rev 2677) +++ trunk/SKPDFView.h 2007-08-17 23:26:25 UTC (rev 2678) @@ -170,7 +170,7 @@ - (void)takeSnapshot:(id)sender; -- (void)setHasNavigation:(BOOL)hasNav activateAtBottom:(BOOL)atBottom autohidesCursor:(BOOL)hideCursor; +- (void)setHasNavigation:(BOOL)hasNav activateAtBottom:(BOOL)atBottom autohidesCursor:(BOOL)hideCursor screen:(NSScreen *)screen; - (void)setNeedsDisplayInRect:(NSRect)rect ofPage:(PDFPage *)page; - (void)setNeedsDisplayForAnnotation:(PDFAnnotation *)annotation
[Skim-app-commit] SF.net SVN: skim-app: [2681] trunk/Skim.xcodeproj/project.pbxproj
Revision: 2681 http://skim-app.svn.sourceforge.net/skim-app/?rev=2681view=rev Author: hofman Date: 2007-08-18 10:05:16 -0700 (Sat, 18 Aug 2007) Log Message: --- Echo build comment after setting variable. Modified Paths: -- trunk/Skim.xcodeproj/project.pbxproj Modified: trunk/Skim.xcodeproj/project.pbxproj === --- trunk/Skim.xcodeproj/project.pbxproj2007-08-18 16:42:03 UTC (rev 2680) +++ trunk/Skim.xcodeproj/project.pbxproj2007-08-18 17:05:16 UTC (rev 2681) @@ -1339,7 +1339,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = TARGET=\${DERIVED_FILE_DIR}/Skim Help\\n\nINPUT=\Skim Help/skim.texi\\nTOOLS=\Skim Help\\nDEST=\Skim Help\\nPREFIX=\Skim Help\;\n\ncd \${SOURCE_ROOT}\\n\n[ -d \${TARGET}\ ] || /bin/mkdir -p \${TARGET}\;\n\nfor LOC_DIR in *.lproj; do \\\n\tLOC_TARGET=\${TARGET}/${LOC_DIR}/${DEST}\; \\\n\t[ -d \${LOC_TARGET}\ ] /bin/rm -rf \${LOC_TARGET}\/* || /bin/mkdir -p \${LOC_TARGET}\; \\\n\techo \*** Creating help files in ${LOC_TARGET} ***\; \\\n\t\${TOOLS}/texi2html\ \${LOC_DIR}/${INPUT}\ --init-file=\${TOOLS}/applehelp.init\ --prefix=\${PREFIX}\ --output=\${LOC_TARGET}\ --split=node --nonumber \\\n\tpython \${TOOLS}/postprocess-nontitle.py\ \${LOC_TARGET}/${PREFIX}_\*.html; \\\ndone;\n; + shellScript = HELP_NAME=\Skim Help\\n\nINPUT=\${HELP_NAME}/skim.texi\\nTOOLS=\${HELP_NAME}\\nDEST=\${HELP_NAME}\\nPREFIX=\${HELP_NAME}\;\n\nTARGET=\${DERIVED_FILE_DIR}/${HELP_NAME}\\n\ncd \${SOURCE_ROOT}\\n\n[ -d \${TARGET}\ ] || /bin/mkdir -p \${TARGET}\;\n\nfor LOC_DIR in *.lproj; do \\\n\tLOC_TARGET=\${TARGET}/${LOC_DIR}/${DEST}\; \\\n\t[ -d \${LOC_TARGET}\ ] /bin/rm -rf \${LOC_TARGET}\/* || /bin/mkdir -p \${LOC_TARGET}\; \\\n\techo \*** Creating help files in ${LOC_TARGET} ***\; \\\n\t\${TOOLS}/texi2html\ \${LOC_DIR}/${INPUT}\ --init-file=\${TOOLS}/applehelp.init\ --prefix=\${PREFIX}\ --output=\${LOC_TARGET}\ --split=node --nonumber \\\n\tpython \${TOOLS}/postprocess-nontitle.py\ \${LOC_TARGET}/${PREFIX}_\*.html; \\\ndone;\n; }; CEF82CAD0C772A4200A3AD51 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -1360,7 +1360,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = TARGET=\${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}\;\nDEST=\Skim Help\;\n\ncd \${DERIVED_FILE_DIR}/Skim Help\;\n\nfor LOC_DIR in *.lproj; do \\\n\techo \*** Copying help files from ${LOC_DIR}/${DEST} to ${LOC_TARGET} ***\; \\\n\tLOC_TARGET=\${TARGET}/${LOC_DIR}/${DEST}\; \\\n\t/bin/rm -rf \${LOC_TARGET}/\*.html; \\\n\t/bin/cp -Rf \${LOC_DIR}/${DEST}/\*.html \${LOC_TARGET}\; \\\ndone;\n; + shellScript = HELP_NAME=\Skim Help\\n\nSOURCE=\${DERIVED_FILE_DIR}/${HELP_NAME}\;\nTARGET=\${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}\;\nDEST=\${HELP_NAME}\;\n\ncd \${SOURCE}\;\n\nfor LOC_DIR in *.lproj; do \\\n\tLOC_TARGET=\${TARGET}/${LOC_DIR}/${DEST}\; \\\n\techo \*** Copying help files from ${SOURCE}/${LOC_DIR}/${DEST} to ${LOC_TARGET} ***\; \\\n\t/bin/rm -rf \${LOC_TARGET}/\*.html; \\\n\t/bin/cp -Rf \${LOC_DIR}/${DEST}/\*.html \${LOC_TARGET}\; \\\ndone;\n; }; /* End PBXShellScriptBuildPhase section */ 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2682] trunk
Revision: 2682 http://skim-app.svn.sourceforge.net/skim-app/?rev=2682view=rev Author: hofman Date: 2007-08-18 11:50:01 -0700 (Sat, 18 Aug 2007) Log Message: --- Open bookmark by double-clicking on a row. Modified Paths: -- trunk/Dutch.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/English.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/French.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/Italian.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/SKApplicationController.m trunk/SKBookmarkController.h trunk/SKBookmarkController.m trunk/Skim.xcodeproj/project.pbxproj Added Paths: --- trunk/NSFileManager_SKExtensions.h trunk/NSFileManager_SKExtensions.m Modified: trunk/Dutch.lproj/BookmarksWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/English.lproj/BookmarksWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/French.lproj/BookmarksWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/Italian.lproj/BookmarksWindow.nib/keyedobjects.nib === (Binary files differ) Added: trunk/NSFileManager_SKExtensions.h === --- trunk/NSFileManager_SKExtensions.h (rev 0) +++ trunk/NSFileManager_SKExtensions.h 2007-08-18 18:50:01 UTC (rev 2682) @@ -0,0 +1,44 @@ +// +// NSFileManager_SKExtensions.h +// Skim +// +// Created by Christiaan Hofman on 8/18/07. +/* + This software is Copyright (c) 2007 + Christiaan Hofman. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in +the documentation and/or other materials provided with the +distribution. + + - Neither the name of Christiaan Hofman nor the names of any +contributors may be used to endorse or promote products derived +from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import Cocoa/Cocoa.h + + [EMAIL PROTECTED] NSFileManager (SKExtensions) +- (BOOL)fileIsInTrash:(NSURL *)fileURL; [EMAIL PROTECTED] Added: trunk/NSFileManager_SKExtensions.m === --- trunk/NSFileManager_SKExtensions.m (rev 0) +++ trunk/NSFileManager_SKExtensions.m 2007-08-18 18:50:01 UTC (rev 2682) @@ -0,0 +1,63 @@ +// +// NSFileManager_SKExtensions.m +// Skim +// +// Created by Christiaan Hofman on 8/18/07. +/* + This software is Copyright (c) 2007 + Christiaan Hofman. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in +the documentation and/or other materials provided with the +distribution. + + - Neither the name of Christiaan Hofman nor the names of any +contributors may be used to endorse or promote products derived +from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL
[Skim-app-commit] SF.net SVN: skim-app: [2683] trunk
Revision: 2683 http://skim-app.svn.sourceforge.net/skim-app/?rev=2683view=rev Author: hofman Date: 2007-08-18 12:40:05 -0700 (Sat, 18 Aug 2007) Log Message: --- Move some therad safe file functions to category file. Modified Paths: -- trunk/SKApplicationController.m trunk/SKBookmarkController.m trunk/SKDocument.m trunk/SKPDFSynchronizer.m trunk/Skim.xcodeproj/project.pbxproj Added Paths: --- trunk/Files_SKExtensions.h trunk/Files_SKExtensions.m Removed Paths: - trunk/NSFileManager_SKExtensions.h trunk/NSFileManager_SKExtensions.m Copied: trunk/Files_SKExtensions.h (from rev 2682, trunk/NSFileManager_SKExtensions.h) === --- trunk/Files_SKExtensions.h (rev 0) +++ trunk/Files_SKExtensions.h 2007-08-18 19:40:05 UTC (rev 2683) @@ -0,0 +1,46 @@ +// +// Files_SKExtensions.h +// Skim +// +// Created by Christiaan Hofman on 8/18/07. +/* + This software is Copyright (c) 2007 + Christiaan Hofman. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in +the documentation and/or other materials provided with the +distribution. + + - Neither the name of Christiaan Hofman nor the names of any +contributors may be used to endorse or promote products derived +from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import Cocoa/Cocoa.h + +// These functions are thread safe + +extern BOOL SKFileIsInTrash(NSURL *fileURL); +extern BOOL SKFileExistsAtPath(NSString *path); +extern NSDate *SKFileModificationDateAtPath(NSString *path); +extern NSString *SKTemporaryDirectoryCreating(BOOL create); Copied: trunk/Files_SKExtensions.m (from rev 2682, trunk/NSFileManager_SKExtensions.m) === --- trunk/Files_SKExtensions.m (rev 0) +++ trunk/Files_SKExtensions.m 2007-08-18 19:40:05 UTC (rev 2683) @@ -0,0 +1,102 @@ +// +// Files_SKExtensions.m +// Skim +// +// Created by Christiaan Hofman on 8/18/07. +/* + This software is Copyright (c) 2007 + Christiaan Hofman. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in +the documentation and/or other materials provided with the +distribution. + + - Neither the name of Christiaan Hofman nor the names of any +contributors may be used to endorse or promote products derived +from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import Files_SKExtensions.h +#import Carbon/Carbon.h + + +BOOL SKFileIsInTrash(NSURL *fileURL) { +NSCParameterAssert([fileURL
[Skim-app-commit] SF.net SVN: skim-app: [2684] trunk
Revision: 2684 http://skim-app.svn.sourceforge.net/skim-app/?rev=2684view=rev Author: hofman Date: 2007-08-19 04:28:18 -0700 (Sun, 19 Aug 2007) Log Message: --- Use carbon file manager to copy and delete items for disk image creation. Modified Paths: -- trunk/Files_SKExtensions.h trunk/Files_SKExtensions.m trunk/SKDocument.m Modified: trunk/Files_SKExtensions.h === --- trunk/Files_SKExtensions.h 2007-08-18 19:40:05 UTC (rev 2683) +++ trunk/Files_SKExtensions.h 2007-08-19 11:28:18 UTC (rev 2684) @@ -43,4 +43,9 @@ extern BOOL SKFileIsInTrash(NSURL *fileURL); extern BOOL SKFileExistsAtPath(NSString *path); extern NSDate *SKFileModificationDateAtPath(NSString *path); -extern NSString *SKTemporaryDirectoryCreating(BOOL create); +extern NSString *SKUniqueDirectoryCreating(NSString *basePath, BOOL create); + +extern OSErr FSDeleteContainerContents(const FSRef *container); +extern OSErr FSDeleteContainer(const FSRef *container); +extern OSErr FSPathDeleteContainer(const UInt8 *containerPath); + \ No newline at end of file Modified: trunk/Files_SKExtensions.m === --- trunk/Files_SKExtensions.m 2007-08-18 19:40:05 UTC (rev 2683) +++ trunk/Files_SKExtensions.m 2007-08-19 11:28:18 UTC (rev 2684) @@ -81,22 +81,160 @@ return nil; } -NSString *SKTemporaryDirectoryCreating(BOOL create) { -NSString *baseTmpDir = [NSTemporaryDirectory() stringByAppendingPathComponent:[[NSBundle mainBundle] bundleIdentifier]]; -NSString *tmpDir = baseTmpDir; -NSString *tmpDirName; -int i = 0; +NSString *SKUniqueDirectoryCreating(NSString *basePath, BOOL create) { +CFUUIDRef uuid = CFUUIDCreate(NULL); +NSString *tmpDirName = [(NSString *)CFUUIDCreateString(NULL, uuid) autorelease]; +CFRelease(uuid); + BOOL success = YES; -while (SKFileExistsAtPath(tmpDir)) -tmpDir = [baseTmpDir stringByAppendingFormat:@-%i, ++i]; - -tmpDirName = [tmpDir lastPathComponent]; -if (success create) { +if (create) { FSRef tmpRef; -success = noErr == FSPathMakeRef((UInt8 *)[NSTemporaryDirectory() fileSystemRepresentation], tmpRef, NULL) +success = noErr == FSPathMakeRef((UInt8 *)[basePath fileSystemRepresentation], tmpRef, NULL) noErr == FSCreateDirectoryUnicode(tmpRef, [tmpDirName length], (const UniChar *)[tmpDirName cStringUsingEncoding:NSUnicodeStringEncoding], kFSCatInfoNone, NULL, NULL, NULL, NULL); } -return success ? tmpDir : nil; +return success ? [basePath stringByAppendingPathComponent:tmpDirName] : nil; } + +// These are taken from MoreFilesX + +struct FSDeleteContainerGlobals +{ + OSErr result; /* result */ + ItemCount actualObjects; /* number of objects returned */ + FSCatalogInfo catalogInfo;/* FSCatalogInfo */ +}; +typedef struct FSDeleteContainerGlobals FSDeleteContainerGlobals; + +static +void +FSDeleteContainerLevel( + const FSRef *container, + FSDeleteContainerGlobals *theGlobals) +{ + /* level locals */ + FSIterator iterator; + FSRef itemToDelete; + UInt16 nodeFlags; + + /* Open FSIterator for flat access and give delete optimization hint */ + theGlobals-result = FSOpenIterator(container, kFSIterateFlat + kFSIterateDelete, iterator); + require_noerr(theGlobals-result, FSOpenIterator); + + /* delete the contents of the directory */ + do + { + /* get 1 item to delete */ + theGlobals-result = FSGetCatalogInfoBulk(iterator, 1, theGlobals-actualObjects, + NULL, kFSCatInfoNodeFlags, theGlobals-catalogInfo, + itemToDelete, NULL, NULL); + if ( (noErr == theGlobals-result) (1 == theGlobals-actualObjects) ) + { + /* save node flags in local in case we have to recurse */ + nodeFlags = theGlobals-catalogInfo.nodeFlags; + + /* is it a file or directory? */ + if ( 0 != (nodeFlags kFSNodeIsDirectoryMask) ) + { + /* it's a directory -- delete its contents before attempting to delete it */ + FSDeleteContainerLevel(itemToDelete, theGlobals); + } + /* are we still OK to delete? */ + if ( noErr == theGlobals
[Skim-app-commit] SF.net SVN: skim-app: [2686] trunk/ReleaseNotes.rtf
Revision: 2686 http://skim-app.svn.sourceforge.net/skim-app/?rev=2686view=rev Author: hofman Date: 2007-08-19 05:19:32 -0700 (Sun, 19 Aug 2007) Log Message: --- Update release notes. Modified Paths: -- trunk/ReleaseNotes.rtf Modified: trunk/ReleaseNotes.rtf === --- trunk/ReleaseNotes.rtf 2007-08-19 11:49:17 UTC (rev 2685) +++ trunk/ReleaseNotes.rtf 2007-08-19 12:19:32 UTC (rev 2686) @@ -1,6 +1,7 @@ {\rtf1\mac\ansicpg1\cocoartf824\cocoasubrtf410 -{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fnil\fcharset77 LucidaGrande;\f2\fswiss\fcharset77 Helvetica-Bold; -\f3\fswiss\fcharset77 Helvetica-BoldOblique;\f4\fnil\fcharset77 LucidaGrande-Bold;} +{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fnil\fcharset77 LucidaGrande;\f2\fnil\fcharset77 LucidaSans-Typewriter; +\f3\fswiss\fcharset77 Helvetica-Bold;\f4\fswiss\fcharset77 Helvetica-BoldOblique;\f5\fnil\fcharset77 LucidaGrande-Bold; +} {\colortbl;\red255\green255\blue255;} {\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid1} {\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid2} @@ -101,41 +102,95 @@ {\list\listtemplateid97\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid97} {\list\listtemplateid98\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid98} {\list\listtemplateid99\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid99} -{\list\listtemplateid100\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid100}} -{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}{\listoverride\listid5\listoverridecount0\ls5}{\listoverride\listid6\listoverridecount0\ls6}{\listoverride\listid7\listoverridecount0\ls7}{\listoverride\listid8\listoverridecount0\ls8}{\listoverride\listid9\listoverridecount0\ls9}{\listoverride\listid10\listoverridecount0\ls10}{\listoverride\listid11\listoverridecount0\ls11}{\listoverride\listid12\listoverridecount0\ls12}{\listoverride\listid13\listoverridecount0\ls13}{\listoverride\listid14\listoverridecount0\ls14}{\listoverride\listid15\listoverridecount0\ls15}{\listoverride\listid16\listoverridecount0\ls16}{\listoverride\listid17\listoverridecount0\ls17}{\listoverride\listid18\listoverridecount0\ls18}{\listoverride\listid19\listoverridecount0\ls19}{\listoverride\listid20\listoverridecount0\ls20}{\listoverride\listid21\li stoverridecount0\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}{\listo verride\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
[Skim-app-commit] SF.net SVN: skim-app: [2687] trunk
Revision: 2687 http://skim-app.svn.sourceforge.net/skim-app/?rev=2687view=rev Author: hofman Date: 2007-08-19 10:06:04 -0700 (Sun, 19 Aug 2007) Log Message: --- Add a sheet with preferences for the downloads window. Modified Paths: -- trunk/Dutch.lproj/DownloadsWindow.nib/classes.nib trunk/Dutch.lproj/DownloadsWindow.nib/info.nib trunk/Dutch.lproj/DownloadsWindow.nib/keyedobjects.nib trunk/English.lproj/DownloadsWindow.nib/classes.nib trunk/English.lproj/DownloadsWindow.nib/info.nib trunk/English.lproj/DownloadsWindow.nib/keyedobjects.nib trunk/French.lproj/DownloadsWindow.nib/classes.nib trunk/French.lproj/DownloadsWindow.nib/info.nib trunk/French.lproj/DownloadsWindow.nib/keyedobjects.nib trunk/Italian.lproj/DownloadsWindow.nib/classes.nib trunk/Italian.lproj/DownloadsWindow.nib/info.nib trunk/Italian.lproj/DownloadsWindow.nib/keyedobjects.nib trunk/SKDownloadController.h trunk/SKDownloadController.m trunk/Skim.xcodeproj/project.pbxproj Added Paths: --- trunk/Images/SmallPreferences.tiff Modified: trunk/Dutch.lproj/DownloadsWindow.nib/classes.nib === --- trunk/Dutch.lproj/DownloadsWindow.nib/classes.nib 2007-08-19 12:19:32 UTC (rev 2686) +++ trunk/Dutch.lproj/DownloadsWindow.nib/classes.nib 2007-08-19 17:06:04 UTC (rev 2687) @@ -8,10 +8,20 @@ SUPERCLASS = NSObject; }, { -ACTIONS = {cancelDownload = id; clearDownloads = id; removeDownload = id; }; +ACTIONS = { +cancelDownload = id; +clearDownloads = id; +dismissDownloadsPreferences = id; +removeDownload = id; +showDownloadPreferences = id; +}; CLASS = SKDownloadController; LANGUAGE = ObjC; -OUTLETS = {clearButton = NSButton; tableView = NSTableView; }; +OUTLETS = { +clearButton = NSButton; +preferencesSheet = NSWindow; +tableView = NSTableView; +}; SUPERCLASS = NSWindowController; }, {CLASS = SKProgressCell; LANGUAGE = ObjC; SUPERCLASS = NSTextFieldCell; } Modified: trunk/Dutch.lproj/DownloadsWindow.nib/info.nib === --- trunk/Dutch.lproj/DownloadsWindow.nib/info.nib 2007-08-19 12:19:32 UTC (rev 2686) +++ trunk/Dutch.lproj/DownloadsWindow.nib/info.nib 2007-08-19 17:06:04 UTC (rev 2687) @@ -8,7 +8,7 @@ string446.1/string keyIBOpenObjects/key array - integer5/integer + integer30/integer /array keyIBSystem Version/key string8R218/string Modified: trunk/Dutch.lproj/DownloadsWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/English.lproj/DownloadsWindow.nib/classes.nib === --- trunk/English.lproj/DownloadsWindow.nib/classes.nib 2007-08-19 12:19:32 UTC (rev 2686) +++ trunk/English.lproj/DownloadsWindow.nib/classes.nib 2007-08-19 17:06:04 UTC (rev 2687) @@ -8,10 +8,20 @@ SUPERCLASS = NSObject; }, { -ACTIONS = {cancelDownload = id; clearDownloads = id; removeDownload = id; }; +ACTIONS = { +cancelDownload = id; +clearDownloads = id; +dismissDownloadsPreferences = id; +removeDownload = id; +showDownloadPreferences = id; +}; CLASS = SKDownloadController; LANGUAGE = ObjC; -OUTLETS = {clearButton = NSButton; tableView = NSTableView; }; +OUTLETS = { +clearButton = NSButton; +preferencesSheet = NSWindow; +tableView = NSTableView; +}; SUPERCLASS = NSWindowController; }, {CLASS = SKProgressCell; LANGUAGE = ObjC; SUPERCLASS = NSTextFieldCell; } Modified: trunk/English.lproj/DownloadsWindow.nib/info.nib === --- trunk/English.lproj/DownloadsWindow.nib/info.nib2007-08-19 12:19:32 UTC (rev 2686) +++ trunk/English.lproj/DownloadsWindow.nib/info.nib2007-08-19 17:06:04 UTC (rev 2687) @@ -9,6 +9,7 @@ keyIBOpenObjects/key array integer5/integer + integer30/integer /array keyIBSystem Version/key string8R218/string Modified: trunk/English.lproj/DownloadsWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/French.lproj/DownloadsWindow.nib/classes.nib
[Skim-app-commit] SF.net SVN: skim-app: [2689] trunk
Revision: 2689 http://skim-app.svn.sourceforge.net/skim-app/?rev=2689view=rev Author: hofman Date: 2007-08-20 11:21:29 -0700 (Mon, 20 Aug 2007) Log Message: --- Implement undo, reordering, delete for bookmarks. Use custom data objects for bookmarks. Modified Paths: -- trunk/Dutch.lproj/BookmarksWindow.nib/classes.nib trunk/Dutch.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/English.lproj/BookmarksWindow.nib/classes.nib trunk/English.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/French.lproj/BookmarksWindow.nib/classes.nib trunk/French.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/Italian.lproj/BookmarksWindow.nib/classes.nib trunk/Italian.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/NSTableView_SKExtensions.h trunk/NSTableView_SKExtensions.m trunk/SKApplicationController.m trunk/SKBookmarkController.h trunk/SKBookmarkController.m trunk/SKThumbnailTableView.h trunk/SKThumbnailTableView.m Modified: trunk/Dutch.lproj/BookmarksWindow.nib/classes.nib === --- trunk/Dutch.lproj/BookmarksWindow.nib/classes.nib 2007-08-20 10:51:17 UTC (rev 2688) +++ trunk/Dutch.lproj/BookmarksWindow.nib/classes.nib 2007-08-20 18:21:29 UTC (rev 2689) @@ -5,6 +5,7 @@ { CLASS = SKBookmarkController; LANGUAGE = ObjC; +OUTLETS = {tableView = NSTableView; }; SUPERCLASS = NSWindowController; } ); Modified: trunk/Dutch.lproj/BookmarksWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/English.lproj/BookmarksWindow.nib/classes.nib === --- trunk/English.lproj/BookmarksWindow.nib/classes.nib 2007-08-20 10:51:17 UTC (rev 2688) +++ trunk/English.lproj/BookmarksWindow.nib/classes.nib 2007-08-20 18:21:29 UTC (rev 2689) @@ -5,6 +5,7 @@ { CLASS = SKBookmarkController; LANGUAGE = ObjC; +OUTLETS = {tableView = NSTableView; }; SUPERCLASS = NSWindowController; } ); Modified: trunk/English.lproj/BookmarksWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/French.lproj/BookmarksWindow.nib/classes.nib === --- trunk/French.lproj/BookmarksWindow.nib/classes.nib 2007-08-20 10:51:17 UTC (rev 2688) +++ trunk/French.lproj/BookmarksWindow.nib/classes.nib 2007-08-20 18:21:29 UTC (rev 2689) @@ -5,6 +5,7 @@ { CLASS = SKBookmarkController; LANGUAGE = ObjC; +OUTLETS = {tableView = NSTableView; }; SUPERCLASS = NSWindowController; } ); Modified: trunk/French.lproj/BookmarksWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/Italian.lproj/BookmarksWindow.nib/classes.nib === --- trunk/Italian.lproj/BookmarksWindow.nib/classes.nib 2007-08-20 10:51:17 UTC (rev 2688) +++ trunk/Italian.lproj/BookmarksWindow.nib/classes.nib 2007-08-20 18:21:29 UTC (rev 2689) @@ -5,6 +5,7 @@ { CLASS = SKBookmarkController; LANGUAGE = ObjC; +OUTLETS = {tableView = NSTableView; }; SUPERCLASS = NSWindowController; } ); Modified: trunk/Italian.lproj/BookmarksWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/NSTableView_SKExtensions.h === --- trunk/NSTableView_SKExtensions.h2007-08-20 10:51:17 UTC (rev 2688) +++ trunk/NSTableView_SKExtensions.h2007-08-20 18:21:29 UTC (rev 2689) @@ -40,5 +40,12 @@ @interface NSTableView (SKExtensions) +- (BOOL)canDelete; +- (void)delete:(id)sender; [EMAIL PROTECTED] + [EMAIL PROTECTED] NSObject (NSTableViewSKExtendedDelegate) +- (void)tableView:(NSTableView *)aTableView deleteRowsWithIndexes:(NSIndexSet *)rowIndexes; +- (BOOL)tableView:(NSTableView *)aTableView canDeleteRowsWithIndexes:(NSIndexSet *)rowIndexes; @end Modified: trunk/NSTableView_SKExtensions.m === --- trunk/NSTableView_SKExtensions.m2007-08-20 10:51:17 UTC (rev 2688) +++ trunk/NSTableView_SKExtensions.m2007-08-20 18:21:29 UTC (rev 2689) @@ -63,7 +63,9 @@ unichar eventChar = [characters length] 0 ? [characters characterAtIndex:0] : 0; unsigned modifierFlags = [theEvent modifierFlags] NSDeviceIndependentModifierFlagsMask; -if (eventChar == NSHomeFunctionKey (modifierFlags ~NSFunctionKeyMask) == 0
[Skim-app-commit] SF.net SVN: skim-app: [2691] trunk/SKMainWindowController.m
Revision: 2691 http://skim-app.svn.sourceforge.net/skim-app/?rev=2691view=rev Author: hofman Date: 2007-08-21 07:33:23 -0700 (Tue, 21 Aug 2007) Log Message: --- Show status message during type-select. Modified Paths: -- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m === --- trunk/SKMainWindowController.m 2007-08-21 14:20:35 UTC (rev 2690) +++ trunk/SKMainWindowController.m 2007-08-21 14:33:23 UTC (rev 2691) @@ -3559,6 +3559,20 @@ } } +- (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper updateSearchString:(NSString *)searchString { +if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]]) { +if (searchString) +[statusBar setLeftStringValue:[NSString stringWithFormat:NSLocalizedString(@Go to page: %@, @Status message), searchString]]; +else +[self updateLeftStatus]; +} else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { +if (searchString) +[statusBar setRightStringValue:[NSString stringWithFormat:NSLocalizedString(@Finding note: \[EMAIL PROTECTED], @Status message), searchString]]; +else +[self updateRightStatus]; +} +} + #pragma mark Outline - (int)outlineRowForPageIndex:(unsigned int)pageIndex { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2692] trunk/SKTypeSelectHelper.m
Revision: 2692 http://skim-app.svn.sourceforge.net/skim-app/?rev=2692view=rev Author: hofman Date: 2007-08-21 09:09:14 -0700 (Tue, 21 Aug 2007) Log Message: --- fix delayed type select. Modified Paths: -- trunk/SKTypeSelectHelper.m Modified: trunk/SKTypeSelectHelper.m === --- trunk/SKTypeSelectHelper.m 2007-08-21 14:33:23 UTC (rev 2691) +++ trunk/SKTypeSelectHelper.m 2007-08-21 16:09:14 UTC (rev 2692) @@ -171,11 +171,11 @@ unsigned int selectedIndex, foundIndex; if (cycleResults) { -selectedIndex = NSNotFound; -} else { selectedIndex = [dataSource typeSelectHelperCurrentlySelectedIndex:self]; if (selectedIndex = [searchCache count]) selectedIndex = NSNotFound; +} else { +selectedIndex = NSNotFound; } foundIndex = [self indexOfMatchedItemAfterIndex:selectedIndex]; if (foundIndex != NSNotFound) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2693] trunk
Revision: 2693 http://skim-app.svn.sourceforge.net/skim-app/?rev=2693view=rev Author: hofman Date: 2007-08-21 10:04:05 -0700 (Tue, 21 Aug 2007) Log Message: --- Rewrite type select, bit more modular. Allow to repeat a search by typing '/' (in the note table). Modified Paths: -- trunk/SKNoteOutlineView.m trunk/SKTypeSelectHelper.h trunk/SKTypeSelectHelper.m Modified: trunk/SKNoteOutlineView.m === --- trunk/SKNoteOutlineView.m 2007-08-21 16:09:14 UTC (rev 2692) +++ trunk/SKNoteOutlineView.m 2007-08-21 17:04:05 UTC (rev 2693) @@ -89,6 +89,8 @@ [self delete:self]; else if (typeSelectHelper modifiers == 0 [[NSCharacterSet alphanumericCharacterSet] characterIsMember:eventChar]) [typeSelectHelper processKeyDownCharacter:eventChar]; +else if (typeSelectHelper modifiers == 0 eventChar == '/') +[typeSelectHelper repeatSearch]; else [super keyDown:theEvent]; } Modified: trunk/SKTypeSelectHelper.h === --- trunk/SKTypeSelectHelper.h 2007-08-21 16:09:14 UTC (rev 2692) +++ trunk/SKTypeSelectHelper.h 2007-08-21 17:04:05 UTC (rev 2693) @@ -54,6 +54,7 @@ NSArray *searchCache; NSMutableString *searchString; NSTimer *timer; +BOOL processing; } - (id)dataSource; @@ -73,6 +74,7 @@ - (BOOL)isProcessing; - (void)processKeyDownCharacter:(unichar)character; +- (void)repeatSearch; @end Modified: trunk/SKTypeSelectHelper.m === --- trunk/SKTypeSelectHelper.m 2007-08-21 16:09:14 UTC (rev 2692) +++ trunk/SKTypeSelectHelper.m 2007-08-21 17:04:05 UTC (rev 2693) @@ -38,9 +38,14 @@ #import SKTypeSelectHelper.h +#define TIMEOUT 0.7 @interface SKTypeSelectHelper (SKPrivate) -- (void)typeSelectSearchTimeout; +- (void)searchWithStickyMatch:(BOOL)allowUpdate; +- (void)stopTimer; +- (void)startTimerForSelector:(SEL)selector; +- (void)typeSelectSearchTimeout:(NSTimer *)aTimer; +- (void)typeSelectCleanTimeout:(NSTimer *)aTimer; - (unsigned int)indexOfMatchedItemAfterIndex:(unsigned int)selectedIndex; @end @@ -50,32 +55,32 @@ - (id)init { if (self = [super init]){ +searchString = [[NSMutableString alloc] init]; cycleResults = YES; -matchesImmediately = NO; +matchesImmediately = YES; matchOption = SKPrefixMatch; } return self; } - (void)dealloc { -[timer invalidate]; -[timer release]; +[self stopTimer]; [searchString release]; [searchCache release]; [super dealloc]; } -// API +#pragma mark Accessors + - (id)dataSource { return dataSource; } - (void)setDataSource:(id)newDataSource { -if (dataSource == newDataSource) -return; - -dataSource = newDataSource; -[self rebuildTypeSelectSearchCache]; +if (dataSource != newDataSource) { +dataSource = newDataSource; +[self rebuildTypeSelectSearchCache]; +} } - (BOOL)cyclesSimilarResults { @@ -102,6 +107,12 @@ matchOption = newValue; } +- (BOOL)isProcessing { +return processing; +} + +#pragma mark API + - (void)rebuildTypeSelectSearchCache { if (searchCache) [searchCache release]; @@ -110,13 +121,9 @@ } - (void)processKeyDownCharacter:(unichar)character { -NSString *selectedItem = nil; -unsigned int selectedIndex, foundIndex; +if (processing == NO) +[searchString setString:@]; -// Create the search string the first time around -if (searchString == nil) -searchString = [[NSMutableString alloc] init]; - // Append the new character to the search string [searchString appendFormat:@%C, character]; @@ -124,51 +131,59 @@ [dataSource typeSelectHelper:self updateSearchString:searchString]; // Reset the timer if it hasn't expired yet -NSDate *date = [NSDate dateWithTimeIntervalSinceNow:0.7]; +[self startTimerForSelector:@selector(typeSelectSearchTimeout:)]; + +if (matchesImmediately) +[self searchWithStickyMatch:processing]; + +processing = YES; +} + +- (void)repeatSearch { +[self searchWithStickyMatch:NO]; + +if ([searchString length] [dataSource respondsToSelector:@selector(typeSelectHelper:updateSearchString:)]) +[dataSource typeSelectHelper:self updateSearchString:searchString]; + +[self startTimerForSelector:@selector(typeSelectCleanTimeout:)]; + +processing = NO; +} + [EMAIL PROTECTED] + +#pragma mark - + [EMAIL PROTECTED] SKTypeSelectHelper (SKPrivate) + +- (void)stopTimer { [timer invalidate]; [timer release]; timer = nil; -timer = [[NSTimer alloc] initWithFireDate:date interval:0 target:self selector:@selector(typeSelectSearchTimeout:) userInfo:NULL repeats:NO]; +} + +- (void)startTimerForSelector
[Skim-app-commit] SF.net SVN: skim-app: [2694] trunk
Revision: 2694 http://skim-app.svn.sourceforge.net/skim-app/?rev=2694view=rev Author: hofman Date: 2007-08-21 15:44:52 -0700 (Tue, 21 Aug 2007) Log Message: --- Update dutch localization. Declare a method to silence compiler. Modified Paths: -- trunk/Dutch.lproj/BookmarksWindow.nib/info.nib trunk/Dutch.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/Dutch.lproj/Localizable.strings trunk/NSTableView_SKExtensions.m Modified: trunk/Dutch.lproj/BookmarksWindow.nib/info.nib === --- trunk/Dutch.lproj/BookmarksWindow.nib/info.nib 2007-08-21 17:04:05 UTC (rev 2693) +++ trunk/Dutch.lproj/BookmarksWindow.nib/info.nib 2007-08-21 22:44:52 UTC (rev 2694) @@ -6,10 +6,6 @@ string69 58 356 240 0 0 1440 938 /string keyIBFramework Version/key string446.1/string - keyIBOpenObjects/key - array - integer5/integer - /array keyIBSystem Version/key string8R218/string /dict Modified: trunk/Dutch.lproj/BookmarksWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/Dutch.lproj/Localizable.strings === (Binary files differ) Modified: trunk/NSTableView_SKExtensions.m === --- trunk/NSTableView_SKExtensions.m2007-08-21 17:04:05 UTC (rev 2693) +++ trunk/NSTableView_SKExtensions.m2007-08-21 22:44:52 UTC (rev 2694) @@ -40,6 +40,10 @@ #import OBUtilities.h [EMAIL PROTECTED] NSTableView (SKPrivateExtensions) +- (void)replacementKeyDown:(NSEvent *)theEvent; [EMAIL PROTECTED] + @implementation NSTableView (SKExtensions) static IMP originalKeyDown = NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2695] trunk/NSTableView_SKExtensions.m
Revision: 2695 http://skim-app.svn.sourceforge.net/skim-app/?rev=2695view=rev Author: hofman Date: 2007-08-21 15:45:47 -0700 (Tue, 21 Aug 2007) Log Message: --- Declare method in interface. Modified Paths: -- trunk/NSTableView_SKExtensions.m Modified: trunk/NSTableView_SKExtensions.m === --- trunk/NSTableView_SKExtensions.m2007-08-21 22:44:52 UTC (rev 2694) +++ trunk/NSTableView_SKExtensions.m2007-08-21 22:45:47 UTC (rev 2695) @@ -40,7 +40,7 @@ #import OBUtilities.h [EMAIL PROTECTED] NSTableView (SKPrivateExtensions) [EMAIL PROTECTED] NSTableView (SKPrivateExtensions) - (void)replacementKeyDown:(NSEvent *)theEvent; @end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2697] trunk/SKTypeSelectHelper.m
Revision: 2697 http://skim-app.svn.sourceforge.net/skim-app/?rev=2697view=rev Author: hofman Date: 2007-08-21 16:55:47 -0700 (Tue, 21 Aug 2007) Log Message: --- Better determination of substring match for type-select. Modified Paths: -- trunk/SKTypeSelectHelper.m Modified: trunk/SKTypeSelectHelper.m === --- trunk/SKTypeSelectHelper.m 2007-08-21 23:13:30 UTC (rev 2696) +++ trunk/SKTypeSelectHelper.m 2007-08-21 23:55:47 UTC (rev 2697) @@ -40,6 +40,12 @@ #define TIMEOUT 0.7 [EMAIL PROTECTED] NSString (BDSKTypeAheadHelperExtensions) +- (BOOL)containsStringStartingAtWord:(NSString *)string options:(int)mask range:(NSRange)range; [EMAIL PROTECTED] + +#pragma mark - + @interface SKTypeSelectHelper (SKPrivate) - (NSArray *)searchCache; - (void)searchWithStickyMatch:(BOOL)allowUpdate; @@ -223,7 +229,6 @@ unsigned int labelIndex = selectedIndex; BOOL looped = NO; -unsigned int searchStringLength = [searchString length]; int options = NSCaseInsensitiveSearch; if (matchOption == SKPrefixMatch) @@ -243,11 +248,8 @@ if ([label caseInsensitiveCompare:searchString] == NSOrderedSame) return labelIndex; } else { -int location = [label length] searchStringLength ? NSNotFound : [label rangeOfString:searchString options:options].location; -if (location != NSNotFound) { -if (location == 0 || [[NSCharacterSet letterCharacterSet] characterIsMember:[label characterAtIndex:location - 1]] == NO) -return labelIndex; -} +if ([label containsStringStartingAtWord:searchString options:options range:NSMakeRange(0, [label length])]) +return labelIndex; } } @@ -255,3 +257,32 @@ } @end + +#pragma mark - + [EMAIL PROTECTED] NSString (BDSKTypeAheadHelperExtensions) + +- (BOOL)containsStringStartingAtWord:(NSString *)string options:(int)mask range:(NSRange)range { +unsigned int stringLength = [string length]; +if (stringLength == 0 || stringLength range.length) +return NO; +if (mask NSAnchoredSearch) +return [self rangeOfString:string options:mask range:range].length 0; +NSRange searchRange = range; +while (searchRange.length = stringLength) { +NSRange r = [self rangeOfString:string options:mask range:searchRange]; +if (r.location == NSNotFound) +return NO; +if (r.location == 0 || [[NSCharacterSet letterCharacterSet] characterIsMember:[self characterAtIndex:r.location - 1]]) +return YES; +if (mask NSBackwardsSearch) +searchRange = NSMakeRange(searchRange.location, NSMaxRange(r) - searchRange.location - 1); +else +searchRange = NSMakeRange(r.location + 1, NSMaxRange(searchRange) - r.location - 1); +if (mask NSAnchoredSearch) +return NO; +} +return NO; +} + [EMAIL PROTECTED] 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2698] trunk/SKTypeSelectHelper.m
Revision: 2698 http://skim-app.svn.sourceforge.net/skim-app/?rev=2698view=rev Author: hofman Date: 2007-08-22 02:56:30 -0700 (Wed, 22 Aug 2007) Log Message: --- Fix matching of substring for type select. Add some comments. Modified Paths: -- trunk/SKTypeSelectHelper.m Modified: trunk/SKTypeSelectHelper.m === --- trunk/SKTypeSelectHelper.m 2007-08-21 23:55:47 UTC (rev 2697) +++ trunk/SKTypeSelectHelper.m 2007-08-22 09:56:30 UTC (rev 2698) @@ -266,21 +266,21 @@ unsigned int stringLength = [string length]; if (stringLength == 0 || stringLength range.length) return NO; -if (mask NSAnchoredSearch) -return [self rangeOfString:string options:mask range:range].length 0; -NSRange searchRange = range; -while (searchRange.length = stringLength) { -NSRange r = [self rangeOfString:string options:mask range:searchRange]; +while (range.length = stringLength) { +NSRange r = [self rangeOfString:string options:mask range:range]; if (r.location == NSNotFound) return NO; -if (r.location == 0 || [[NSCharacterSet letterCharacterSet] characterIsMember:[self characterAtIndex:r.location - 1]]) +// see if we start at a word boundary +if (r.location == 0 || [[NSCharacterSet alphanumericCharacterSet] characterIsMember:[self characterAtIndex:r.location - 1]] == NO) return YES; +// if it's anchored, we only should search once +if (mask NSAnchoredSearch) +return NO; +// get the new range, shifted by one from the last match if (mask NSBackwardsSearch) -searchRange = NSMakeRange(searchRange.location, NSMaxRange(r) - searchRange.location - 1); +range = NSMakeRange(range.location, NSMaxRange(r) - range.location - 1); else -searchRange = NSMakeRange(r.location + 1, NSMaxRange(searchRange) - r.location - 1); -if (mask NSAnchoredSearch) -return NO; +range = NSMakeRange(r.location + 1, NSMaxRange(range) - r.location - 1); } return NO; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2702] trunk
Revision: 2702 http://skim-app.svn.sourceforge.net/skim-app/?rev=2702view=rev Author: hofman Date: 2007-08-22 09:40:50 -0700 (Wed, 22 Aug 2007) Log Message: --- Implement type-select for the TOC outlineView. Don't update outline selection when the outline selection changes. Reset tracking rects in outline views when items expand or collapse, as Apple does not call resetCursorRects in those cases. Modified Paths: -- trunk/SKMainWindowController.h trunk/SKMainWindowController.m trunk/SKNoteOutlineView.m trunk/SKOutlineView.h trunk/SKOutlineView.m trunk/SKTypeSelectHelper.m Modified: trunk/SKMainWindowController.h === --- trunk/SKMainWindowController.h 2007-08-22 15:02:59 UTC (rev 2701) +++ trunk/SKMainWindowController.h 2007-08-22 16:40:50 UTC (rev 2702) @@ -97,7 +97,7 @@ SKStatusBar *statusBar; -IBOutlet NSOutlineView *outlineView; +IBOutlet SKOutlineView *outlineView; IBOutlet NSView *tocView; PDFOutline *pdfOutline; NSMutableArray *pdfOutlineItems; Modified: trunk/SKMainWindowController.m === --- trunk/SKMainWindowController.m 2007-08-22 15:02:59 UTC (rev 2701) +++ trunk/SKMainWindowController.m 2007-08-22 16:40:50 UTC (rev 2702) @@ -385,6 +385,11 @@ [typeSelectHelper setDataSource:self]; [noteOutlineView setTypeSelectHelper:typeSelectHelper]; +typeSelectHelper = [[[SKTypeSelectHelper alloc] init] autorelease]; +[typeSelectHelper setMatchOption:SKSubstringMatch]; +[typeSelectHelper setDataSource:self]; +[outlineView setTypeSelectHelper:typeSelectHelper]; + // This update toolbar item and other states [self handleChangedHistoryNotification:nil]; [self handlePageChangedNotification:nil]; @@ -3169,7 +3174,9 @@ - (void)outlineViewSelectionDidChange:(NSNotification *)notification{ // Get the destination associated with the search result list. Tell the PDFView to go there. if ([[notification object] isEqual:outlineView] (updatingOutlineSelection == NO)){ +updatingOutlineSelection = YES; [pdfView goToDestination: [[outlineView itemAtRow: [outlineView selectedRow]] destination]]; +updatingOutlineSelection = NO; if ([self isPresentation] [[NSUserDefaults standardUserDefaults] boolForKey:SKAutoHidePresentationContentsKey]) [self hideLeftSideWindow]; } @@ -3523,6 +3530,12 @@ return pageLabels; } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { return [[noteArrayController arrangedObjects] valueForKey:@contents]; +} else if ([typeSelectHelper isEqual:[outlineView typeSelectHelper]]) { +int i, count = [outlineView numberOfRows]; +NSMutableArray *array = [NSMutableArray arrayWithCapacity:count]; +for (i = 0; i count; i++) +[array addObject:[(PDFOutline *)[outlineView itemAtRow:i] label]]; +return array; } return nil; } @@ -3532,6 +3545,9 @@ return [[thumbnailTableView selectedRowIndexes] lastIndex]; } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { return [[noteArrayController arrangedObjects] indexOfObject:[self selectedNote]]; +} else if ([typeSelectHelper isEqual:[outlineView typeSelectHelper]]) { +int row = [outlineView selectedRow]; +return row == -1 ? NSNotFound : row; } return NSNotFound; } @@ -3542,6 +3558,8 @@ } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { int row = [noteOutlineView rowForItem:[[noteArrayController arrangedObjects] objectAtIndex:itemIndex]]; [noteOutlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; +} else if ([typeSelectHelper isEqual:[outlineView typeSelectHelper]]) { +[outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:itemIndex] byExtendingSelection:NO]; } } @@ -3556,6 +3574,11 @@ [statusBar setRightStringValue:[NSString stringWithFormat:NSLocalizedString(@Finding note: \[EMAIL PROTECTED], @Status message), searchString]]; else [self updateRightStatus]; +} else if ([typeSelectHelper isEqual:[outlineView typeSelectHelper]]) { +if (searchString) +[statusBar setLeftStringValue:[NSString stringWithFormat:NSLocalizedString(@Finding: %@, @Status message), searchString]]; +else +[self updateLeftStatus]; } } @@ -3580,7 +3603,7 @@ - (void)updateOutlineSelection{ // Skip out if this PDF has no outline. - if (pdfOutline == nil) + if (pdfOutline == nil || updatingOutlineSelection) return; // Get index
[Skim-app-commit] SF.net SVN: skim-app: [2704] trunk
Revision: 2704 http://skim-app.svn.sourceforge.net/skim-app/?rev=2704view=rev Author: hofman Date: 2007-08-22 12:50:59 -0700 (Wed, 22 Aug 2007) Log Message: --- Add files for outlineView base class. Added Paths: --- trunk/SKOutlineView.h trunk/SKOutlineView.m Added: trunk/SKOutlineView.h === --- trunk/SKOutlineView.h (rev 0) +++ trunk/SKOutlineView.h 2007-08-22 19:50:59 UTC (rev 2704) @@ -0,0 +1,53 @@ +// +// SKOutlineView.h +// Skim +// +// Created by Christiaan Hofman on 8/22/07. +/* + This software is Copyright (c) 2007 + Christiaan Hofman. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in +the documentation and/or other materials provided with the +distribution. + + - Neither the name of Christiaan Hofman nor the names of any +contributors may be used to endorse or promote products derived +from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import Cocoa/Cocoa.h + [EMAIL PROTECTED] SKTypeSelectHelper; + [EMAIL PROTECTED] SKOutlineView : NSOutlineView { +SKTypeSelectHelper *typeSelectHelper; +} + +- (SKTypeSelectHelper *)typeSelectHelper; +- (void)setTypeSelectHelper:(SKTypeSelectHelper *)newTypeSelectHelper; + +- (void)scrollToBeginningOfDocument:(id)sender; +- (void)scrollToEndOfDocument:(id)sender; + [EMAIL PROTECTED] Added: trunk/SKOutlineView.m === --- trunk/SKOutlineView.m (rev 0) +++ trunk/SKOutlineView.m 2007-08-22 19:50:59 UTC (rev 2704) @@ -0,0 +1,104 @@ +// +// SKOutlineView.m +// Skim +// +// Created by Christiaan Hofman on 8/22/07. +/* + This software is Copyright (c) 2007 + Christiaan Hofman. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in +the documentation and/or other materials provided with the +distribution. + + - Neither the name of Christiaan Hofman nor the names of any +contributors may be used to endorse or promote products derived +from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import SKOutlineView.h +#import SKTypeSelectHelper.h + + [EMAIL PROTECTED] SKOutlineView + +- (void)dealloc { +[typeSelectHelper setDataSource:nil]; +[typeSelectHelper release]; +[super dealloc]; +} + +- (SKTypeSelectHelper *)typeSelectHelper { +return typeSelectHelper; +} + +- (void)setTypeSelectHelper:(SKTypeSelectHelper *)newTypeSelectHelper { +if (typeSelectHelper != newTypeSelectHelper) { +[typeSelectHelper release]; +typeSelectHelper
[Skim-app-commit] SF.net SVN: skim-app: [2705] trunk/Skim.xcodeproj/project.pbxproj
Revision: 2705 http://skim-app.svn.sourceforge.net/skim-app/?rev=2705view=rev Author: hofman Date: 2007-08-22 12:53:29 -0700 (Wed, 22 Aug 2007) Log Message: --- Remove header file from target. Modified Paths: -- trunk/Skim.xcodeproj/project.pbxproj Modified: trunk/Skim.xcodeproj/project.pbxproj === --- trunk/Skim.xcodeproj/project.pbxproj2007-08-22 19:50:59 UTC (rev 2704) +++ trunk/Skim.xcodeproj/project.pbxproj2007-08-22 19:53:29 UTC (rev 2705) @@ -129,7 +129,6 @@ CE5BD6740C7ADF1500EBDCF7 /* SKTypeSelectHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5BD6720C7ADF1500EBDCF7 /* SKTypeSelectHelper.m */; }; CE5BEA190C7C635400EBDCF7 /* NSGeometry_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5BEA170C7C635400EBDCF7 /* NSGeometry_SKExtensions.m */; }; CE5BF8010C7CBF6300EBDCF7 /* SKTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5BF7FF0C7CBF6300EBDCF7 /* SKTableView.m */; }; - CE5BF8420C7CC24A00EBDCF7 /* SKOutlineView.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE5BF8400C7CC24A00EBDCF7 /* SKOutlineView.h */; }; CE5BF8430C7CC24A00EBDCF7 /* SKOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5BF8410C7CC24A00EBDCF7 /* SKOutlineView.m */; }; CE5F42AF0BF89FE00069D89C /* AppleRemote.m in Sources */ = {isa = PBXBuildFile; fileRef = CE5F42AD0BF89FE00069D89C /* AppleRemote.m */; }; CE5F43730BF8A3410069D89C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE5F42D30BF8A3400069D89C /* IOKit.framework */; }; @@ -260,7 +259,6 @@ dstSubfolderSpec = 10; files = ( CE2BD8450BD4135600A5F4DB /* Sparkle.framework in CopyFiles */, - CE5BF8420C7CC24A00EBDCF7 /* SKOutlineView.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2708] trunk
Revision: 2708 http://skim-app.svn.sourceforge.net/skim-app/?rev=2708view=rev Author: hofman Date: 2007-08-22 16:42:16 -0700 (Wed, 22 Aug 2007) Log Message: --- Add type-select helper to pdfview to quickly switch pages. Share the one from the thumbnail table, as it does exactly the same thing, and cannot be used at the same time. Modified Paths: -- trunk/SKMainWindowController.m trunk/SKPDFView.h trunk/SKPDFView.m Modified: trunk/SKMainWindowController.m === --- trunk/SKMainWindowController.m 2007-08-22 22:40:31 UTC (rev 2707) +++ trunk/SKMainWindowController.m 2007-08-22 23:42:16 UTC (rev 2708) @@ -380,6 +380,7 @@ [typeSelectHelper setMatchOption:SKFullStringMatch]; [typeSelectHelper setDataSource:self]; [thumbnailTableView setTypeSelectHelper:typeSelectHelper]; +[pdfView setTypeSelectHelper:typeSelectHelper]; typeSelectHelper = [[[SKTypeSelectHelper alloc] init] autorelease]; [typeSelectHelper setMatchOption:SKSubstringMatch]; @@ -3527,7 +3528,7 @@ #pragma mark SKTypeSelectHelper datasource protocol - (NSArray *)typeSelectHelperSelectionItems:(SKTypeSelectHelper *)typeSelectHelper { -if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]]) { +if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]] || [typeSelectHelper isEqual:[pdfView typeSelectHelper]]) { return pageLabels; } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { return [[noteArrayController arrangedObjects] valueForKey:@contents]; @@ -3542,7 +3543,7 @@ } - (unsigned int)typeSelectHelperCurrentlySelectedIndex:(SKTypeSelectHelper *)typeSelectHelper { -if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]]) { +if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]] || [typeSelectHelper isEqual:[pdfView typeSelectHelper]]) { return [[thumbnailTableView selectedRowIndexes] lastIndex]; } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { return [[noteArrayController arrangedObjects] indexOfObject:[self selectedNote]]; @@ -3554,7 +3555,7 @@ } - (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper selectItemAtIndex:(unsigned int)itemIndex { -if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]]) { +if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]] || [typeSelectHelper isEqual:[pdfView typeSelectHelper]]) { [self setPageNumber:itemIndex + 1]; } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { int row = [noteOutlineView rowForItem:[[noteArrayController arrangedObjects] objectAtIndex:itemIndex]]; @@ -3565,7 +3566,7 @@ } - (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper updateSearchString:(NSString *)searchString { -if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]]) { +if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]] || [typeSelectHelper isEqual:[pdfView typeSelectHelper]]) { if (searchString) [statusBar setLeftStringValue:[NSString stringWithFormat:NSLocalizedString(@Go to page: %@, @Status message), searchString]]; else Modified: trunk/SKPDFView.h === --- trunk/SKPDFView.h 2007-08-22 22:40:31 UTC (rev 2707) +++ trunk/SKPDFView.h 2007-08-22 23:42:16 UTC (rev 2708) @@ -73,7 +73,7 @@ SKLineNote } SKNoteType; [EMAIL PROTECTED] SKReadingBar, SKTransitionController; [EMAIL PROTECTED] SKReadingBar, SKTransitionController, SKTypeSelectHelper; @interface SKPDFView : PDFView { SKToolMode toolMode; @@ -91,6 +91,8 @@ SKTransitionController *transitionController; +SKTypeSelectHelper *typeSelectHelper; + PDFAnnotation *activeAnnotation; PDFAnnotation *highlightAnnotation; PDFAnnotationTextWidget *editAnnotation; @@ -149,6 +151,9 @@ - (BOOL)transitionShouldRestrict; - (void)setTransitionShouldRestrict:(BOOL)flag; +- (SKTypeSelectHelper *)typeSelectHelper; +- (void)setTypeSelectHelper:(SKTypeSelectHelper *)newTypeSelectHelper; + - (IBAction)delete:(id)sender; - (IBAction)autoSelectContent:(id)sender; Modified: trunk/SKPDFView.m === --- trunk/SKPDFView.m 2007-08-22 22:40:31 UTC (rev 2707) +++ trunk/SKPDFView.m 2007-08-22 23:42:16 UTC (rev 2708) @@ -55,6 +55,7 @@ #import SKLineWell.h #import Carbon/Carbon.h #import NSGeometry_SKExtensions.h +#import SKTypeSelectHelper.h NSString *SKPDFViewToolModeChangedNotification = @SKPDFViewToolModeChangedNotification; NSString *SKPDFViewAnnotationModeChangedNotification = @SKPDFViewAnnotationModeChangedNotification; @@ -162,6 +163,8 @@ transitionController = nil
[Skim-app-commit] SF.net SVN: skim-app: [2709] trunk/SKDownloadController.m
Revision: 2709 http://skim-app.svn.sourceforge.net/skim-app/?rev=2709view=rev Author: hofman Date: 2007-08-23 01:51:51 -0700 (Thu, 23 Aug 2007) Log Message: --- implement delete for downloads table. Modified Paths: -- trunk/SKDownloadController.m Modified: trunk/SKDownloadController.m === --- trunk/SKDownloadController.m2007-08-22 23:42:16 UTC (rev 2708) +++ trunk/SKDownloadController.m2007-08-23 08:51:51 UTC (rev 2709) @@ -306,6 +306,24 @@ return toolTip; } +- (void)tableView:(NSTableView *)aTableView deleteRowsWithIndexes:(NSIndexSet *)rowIndexes { +unsigned int row = [rowIndexes firstIndex]; +SKDownload *download = [downloads objectAtIndex:row]; + +if ([download canCancel]) { +[download cancelDownload]; +} else { +[download cleanupDownload]; +[downloads removeObjectAtIndex:row]; +[self reloadTableView]; +[self updateButtons]; +} +} + +- (BOOL)tableView:(NSTableView *)aTableView canDeleteRowsWithIndexes:(NSIndexSet *)rowIndexes { +return YES; +} + #pragma mark SKTypeSelectHelper datasource protocol - (NSArray *)typeSelectHelperSelectionItems:(SKTypeSelectHelper *)typeSelectHelper { 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2711] trunk
Revision: 2711 http://skim-app.svn.sourceforge.net/skim-app/?rev=2711view=rev Author: hofman Date: 2007-08-23 05:53:21 -0700 (Thu, 23 Aug 2007) Log Message: --- Allow typing non-control and non-alphanumeric characters for type-select, just not as the initial character. Add some convenience accessors for those. Scroll row found by type-select to visible. Modified Paths: -- trunk/SKBookmarkController.m trunk/SKDownloadController.m trunk/SKMainWindowController.m trunk/SKNotesDocument.m trunk/SKOutlineView.m trunk/SKTableView.m trunk/SKTypeSelectHelper.h trunk/SKTypeSelectHelper.m Modified: trunk/SKBookmarkController.m === --- trunk/SKBookmarkController.m2007-08-23 11:08:50 UTC (rev 2710) +++ trunk/SKBookmarkController.m2007-08-23 12:53:21 UTC (rev 2711) @@ -368,6 +368,7 @@ - (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper selectItemAtIndex:(unsigned int)itemIndex { [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:itemIndex] byExtendingSelection:NO]; +[tableView scrollRowToVisible:itemIndex]; } @end Modified: trunk/SKDownloadController.m === --- trunk/SKDownloadController.m2007-08-23 11:08:50 UTC (rev 2710) +++ trunk/SKDownloadController.m2007-08-23 12:53:21 UTC (rev 2711) @@ -336,6 +336,7 @@ - (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper selectItemAtIndex:(unsigned int)itemIndex { [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:itemIndex] byExtendingSelection:NO]; +[tableView scrollRowToVisible:itemIndex]; } @end Modified: trunk/SKMainWindowController.m === --- trunk/SKMainWindowController.m 2007-08-23 11:08:50 UTC (rev 2710) +++ trunk/SKMainWindowController.m 2007-08-23 12:53:21 UTC (rev 2711) @@ -3633,8 +3633,10 @@ } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { int row = [noteOutlineView rowForItem:[[noteArrayController arrangedObjects] objectAtIndex:itemIndex]]; [noteOutlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; +[noteOutlineView scrollRowToVisible:row]; } else if ([typeSelectHelper isEqual:[outlineView typeSelectHelper]]) { [outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:itemIndex] byExtendingSelection:NO]; +[noteOutlineView scrollRowToVisible:itemIndex]; } } Modified: trunk/SKNotesDocument.m === --- trunk/SKNotesDocument.m 2007-08-23 11:08:50 UTC (rev 2710) +++ trunk/SKNotesDocument.m 2007-08-23 12:53:21 UTC (rev 2711) @@ -348,6 +348,7 @@ - (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper selectItemAtIndex:(unsigned int)itemIndex { int row = [outlineView rowForItem:[[arrayController arrangedObjects] objectAtIndex:itemIndex]]; [outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; +[outlineView scrollRowToVisible:row]; } @end Modified: trunk/SKOutlineView.m === --- trunk/SKOutlineView.m 2007-08-23 11:08:50 UTC (rev 2710) +++ trunk/SKOutlineView.m 2007-08-23 12:53:21 UTC (rev 2711) @@ -91,9 +91,9 @@ unichar eventChar = [characters length] 0 ? [characters characterAtIndex:0] : 0; unsigned modifierFlags = [theEvent modifierFlags] NSDeviceIndependentModifierFlagsMask; -if (typeSelectHelper modifierFlags == 0 [[NSCharacterSet alphanumericCharacterSet] characterIsMember:eventChar]) +if ([typeSelectHelper isTypeSelectCharacter:eventChar] typeSelectHelper modifierFlags == 0) [typeSelectHelper processKeyDownCharacter:eventChar]; -else if (typeSelectHelper modifierFlags == 0 eventChar == '/') +else if ([typeSelectHelper isRepeatCharacter:eventChar] modifierFlags == 0) [typeSelectHelper repeatSearch]; else if (eventChar == NSHomeFunctionKey (modifierFlags ~NSFunctionKeyMask) == 0) [self scrollToBeginningOfDocument:nil]; Modified: trunk/SKTableView.m === --- trunk/SKTableView.m 2007-08-23 11:08:50 UTC (rev 2710) +++ trunk/SKTableView.m 2007-08-23 12:53:21 UTC (rev 2711) @@ -69,9 +69,9 @@ unichar eventChar = [characters length] 0 ? [characters characterAtIndex:0] : 0; unsigned modifierFlags = [theEvent modifierFlags] NSDeviceIndependentModifierFlagsMask; -if (typeSelectHelper modifierFlags == 0 [[NSCharacterSet alphanumericCharacterSet] characterIsMember:eventChar]) +if ([typeSelectHelper isTypeSelectCharacter:eventChar] typeSelectHelper modifierFlags == 0) [typeSelectHelper
[Skim-app-commit] SF.net SVN: skim-app: [2712] trunk/SKTypeSelectHelper.m
Revision: 2712 http://skim-app.svn.sourceforge.net/skim-app/?rev=2712view=rev Author: hofman Date: 2007-08-23 05:59:11 -0700 (Thu, 23 Aug 2007) Log Message: --- Invert check for control characters. Modified Paths: -- trunk/SKTypeSelectHelper.m Modified: trunk/SKTypeSelectHelper.m === --- trunk/SKTypeSelectHelper.m 2007-08-23 12:53:21 UTC (rev 2711) +++ trunk/SKTypeSelectHelper.m 2007-08-23 12:59:11 UTC (rev 2712) @@ -161,7 +161,7 @@ - (BOOL)isTypeSelectCharacter:(unichar)character { if ([[NSCharacterSet alphanumericCharacterSet] characterIsMember:character]) return YES; -if ([self isProcessing] [[NSCharacterSet controlCharacterSet] characterIsMember:character]) +if ([self isProcessing] [[NSCharacterSet controlCharacterSet] characterIsMember:character] == NO) return YES; return NO; } 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2713] trunk/SKMainWindowController.m
Revision: 2713 http://skim-app.svn.sourceforge.net/skim-app/?rev=2713view=rev Author: hofman Date: 2007-08-23 07:54:57 -0700 (Thu, 23 Aug 2007) Log Message: --- Return nothing for outlineRowForPageIndex: when there is no outline, as the outlineView may perhaps be stale when the document is reloading. Modified Paths: -- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m === --- trunk/SKMainWindowController.m 2007-08-23 12:59:11 UTC (rev 2712) +++ trunk/SKMainWindowController.m 2007-08-23 14:54:57 UTC (rev 2713) @@ -3662,6 +3662,9 @@ #pragma mark Outline - (int)outlineRowForPageIndex:(unsigned int)pageIndex { +if (pdfOutline == nil) +return -1; + int i, numRows = [outlineView numberOfRows]; for (i = 0; i numRows; i++) { // Get the destination of the given row 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2714] trunk
Revision: 2714 http://skim-app.svn.sourceforge.net/skim-app/?rev=2714view=rev Author: hofman Date: 2007-08-23 08:31:23 -0700 (Thu, 23 Aug 2007) Log Message: --- Use SKStatusBar in bookmarks window. Show status message while type select is processing. Modified Paths: -- trunk/Dutch.lproj/BookmarksWindow.nib/classes.nib trunk/Dutch.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/English.lproj/BookmarksWindow.nib/classes.nib trunk/English.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/French.lproj/BookmarksWindow.nib/classes.nib trunk/French.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/Italian.lproj/BookmarksWindow.nib/classes.nib trunk/Italian.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/SKBookmarkController.h trunk/SKBookmarkController.m Modified: trunk/Dutch.lproj/BookmarksWindow.nib/classes.nib === --- trunk/Dutch.lproj/BookmarksWindow.nib/classes.nib 2007-08-23 14:54:57 UTC (rev 2713) +++ trunk/Dutch.lproj/BookmarksWindow.nib/classes.nib 2007-08-23 15:31:23 UTC (rev 2714) @@ -1,14 +1,20 @@ { IBClasses = ( -{CLASS = BDSKGradientView; LANGUAGE = ObjC; SUPERCLASS = NSView; }, {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, {CLASS = SKBookmark; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { CLASS = SKBookmarkController; LANGUAGE = ObjC; -OUTLETS = {tableView = SKTableView; }; +OUTLETS = {statusBar = SKStatusBar; tableView = SKTableView; }; SUPERCLASS = NSWindowController; }, +{ +ACTIONS = {startAnimation = id; stopAnimation = id; }; +CLASS = SKStatusBar; +LANGUAGE = ObjC; +OUTLETS = {leftCell = id; rightCell = id; }; +SUPERCLASS = NSControl; +}, {CLASS = SKTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; } ); IBVersion = 1; Modified: trunk/Dutch.lproj/BookmarksWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/English.lproj/BookmarksWindow.nib/classes.nib === --- trunk/English.lproj/BookmarksWindow.nib/classes.nib 2007-08-23 14:54:57 UTC (rev 2713) +++ trunk/English.lproj/BookmarksWindow.nib/classes.nib 2007-08-23 15:31:23 UTC (rev 2714) @@ -1,14 +1,20 @@ { IBClasses = ( -{CLASS = BDSKGradientView; LANGUAGE = ObjC; SUPERCLASS = NSView; }, {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, {CLASS = SKBookmark; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { CLASS = SKBookmarkController; LANGUAGE = ObjC; -OUTLETS = {tableView = SKTableView; }; +OUTLETS = {statusBar = SKStatusBar; tableView = SKTableView; }; SUPERCLASS = NSWindowController; }, +{ +ACTIONS = {startAnimation = id; stopAnimation = id; }; +CLASS = SKStatusBar; +LANGUAGE = ObjC; +OUTLETS = {leftCell = id; rightCell = id; }; +SUPERCLASS = NSControl; +}, {CLASS = SKTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; } ); IBVersion = 1; Modified: trunk/English.lproj/BookmarksWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/French.lproj/BookmarksWindow.nib/classes.nib === --- trunk/French.lproj/BookmarksWindow.nib/classes.nib 2007-08-23 14:54:57 UTC (rev 2713) +++ trunk/French.lproj/BookmarksWindow.nib/classes.nib 2007-08-23 15:31:23 UTC (rev 2714) @@ -1,14 +1,20 @@ { IBClasses = ( -{CLASS = BDSKGradientView; LANGUAGE = ObjC; SUPERCLASS = NSView; }, {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, {CLASS = SKBookmark; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { CLASS = SKBookmarkController; LANGUAGE = ObjC; -OUTLETS = {tableView = SKTableView; }; +OUTLETS = {statusBar = SKStatusBar; tableView = SKTableView; }; SUPERCLASS = NSWindowController; }, +{ +ACTIONS = {startAnimation = id; stopAnimation = id; }; +CLASS = SKStatusBar; +LANGUAGE = ObjC; +OUTLETS = {leftCell = id; rightCell = id; }; +SUPERCLASS = NSControl; +}, {CLASS = SKTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; } ); IBVersion = 1; Modified: trunk/French.lproj/BookmarksWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk
[Skim-app-commit] SF.net SVN: skim-app: [2715] trunk
Revision: 2715 http://skim-app.svn.sourceforge.net/skim-app/?rev=2715view=rev Author: hofman Date: 2007-08-23 10:39:40 -0700 (Thu, 23 Aug 2007) Log Message: --- Separate methods to enable and disable navigation window. Modified Paths: -- trunk/SKMainWindowController.m trunk/SKPDFView.h trunk/SKPDFView.m Modified: trunk/SKMainWindowController.m === --- trunk/SKMainWindowController.m 2007-08-23 15:31:23 UTC (rev 2714) +++ trunk/SKMainWindowController.m 2007-08-23 17:39:40 UTC (rev 2715) @@ -2177,7 +2177,7 @@ if ([fullScreenSetup count]) [self applyPDFSettings:fullScreenSetup]; -[pdfView setHasNavigation:YES activateAtBottom:[[NSUserDefaults standardUserDefaults] boolForKey:SKActivateFullScreenNavigationAtBottomKey] autohidesCursor:NO screen:screen]; +[pdfView enableNavigationActivatedAtBottom:[[NSUserDefaults standardUserDefaults] boolForKey:SKActivateFullScreenNavigationAtBottomKey] autohidesCursor:NO screen:screen]; [self showSideWindowsOnScreen:screen]; } @@ -2200,7 +2200,7 @@ else [self goFullScreen]; -[pdfView setHasNavigation:YES activateAtBottom:[[NSUserDefaults standardUserDefaults] boolForKey:SKActivatePresentationNavigationAtBottomKey] autohidesCursor:YES screen:nil]; +[pdfView enableNavigationActivatedAtBottom:[[NSUserDefaults standardUserDefaults] boolForKey:SKActivatePresentationNavigationAtBottomKey] autohidesCursor:YES screen:screen]; } - (IBAction)exitFullScreen:(id)sender { @@ -2212,7 +2212,7 @@ if ([[fullScreenWindow firstResponder] isDescendantOf:pdfView]) [fullScreenWindow makeFirstResponder:nil]; -[pdfView setHasNavigation:NO activateAtBottom:NO autohidesCursor:NO screen:nil]; +[pdfView disableNavigation]; [pdfView setFrame:[[pdfContentBox contentView] bounds]]; [pdfContentBox addSubview:pdfView]; // this should be done before exitPresentationMode to get a smooth transition Modified: trunk/SKPDFView.h === --- trunk/SKPDFView.h 2007-08-23 15:31:23 UTC (rev 2714) +++ trunk/SKPDFView.h 2007-08-23 17:39:40 UTC (rev 2715) @@ -175,7 +175,8 @@ - (void)takeSnapshot:(id)sender; -- (void)setHasNavigation:(BOOL)hasNav activateAtBottom:(BOOL)atBottom autohidesCursor:(BOOL)hideCursor screen:(NSScreen *)screen; +- (void)enableNavigationActivatedAtBottom:(BOOL)atBottom autohidesCursor:(BOOL)hideCursor screen:(NSScreen *)screen; +- (void)disableNavigation; - (void)setNeedsDisplayInRect:(NSRect)rect ofPage:(PDFPage *)page; - (void)setNeedsDisplayForAnnotation:(PDFAnnotation *)annotation; Modified: trunk/SKPDFView.m === --- trunk/SKPDFView.m 2007-08-23 15:31:23 UTC (rev 2714) +++ trunk/SKPDFView.m 2007-08-23 17:39:40 UTC (rev 2715) @@ -2125,27 +2125,32 @@ [navWindow orderOut:self]; } -- (void)setHasNavigation:(BOOL)hasNav activateAtBottom:(BOOL)atBottom autohidesCursor:(BOOL)hideCursor screen:(NSScreen *)screen { -hasNavigation = hasNav; +- (void)enableNavigationActivatedAtBottom:(BOOL)atBottom autohidesCursor:(BOOL)hideCursor screen:(NSScreen *)screen { +hasNavigation = YES; autohidesCursor = hideCursor; activateNavigationAtBottom = atBottom; -if (hasNavigation) { -// always recreate the navWindow, since moving between screens of different resolution can mess up the location (in spite of moveToScreen:) -if (navWindow != nil) -[navWindow release]; -else -[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(handleWindowWillCloseNotification:) - name: NSWindowWillCloseNotification object: [self window]]; -navWindow = [[SKNavigationWindow alloc] initWithPDFView:self]; -[navWindow moveToScreen:screen]; -[navWindow setLevel:[[self window] level] + 1]; -} else if ([navWindow isVisible]) { -[navWindow orderOut:self]; -} -[self doAutohide:autohidesCursor || hasNavigation]; +// always recreate the navWindow, since moving between screens of different resolution can mess up the location (in spite of moveToScreen:) +if (navWindow != nil) +[navWindow release]; +else +[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(handleWindowWillCloseNotification:) + name: NSWindowWillCloseNotification object: [self window]]; +navWindow = [[SKNavigationWindow alloc] initWithPDFView:self]; +[navWindow moveToScreen:screen]; +[navWindow setLevel:[[self window] level] + 1]; + +[self doAutohide:YES]; } +- (void)disableNavigation { +hasNavigation = NO; +autohidesCursor
[Skim-app-commit] SF.net SVN: skim-app: [2725] trunk/Images
Revision: 2725 http://skim-app.svn.sourceforge.net/skim-app/?rev=2725view=rev Author: hofman Date: 2007-08-27 05:00:17 -0700 (Mon, 27 Aug 2007) Log Message: --- Add some white to the zoom cursors so they are visible on dark backgrounds. Modified Paths: -- trunk/Images/zoomInCursor.tiff trunk/Images/zoomOutCursor.tiff Modified: trunk/Images/zoomInCursor.tiff === (Binary files differ) Modified: trunk/Images/zoomOutCursor.tiff === (Binary files differ) 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2729] trunk
Revision: 2729 http://skim-app.svn.sourceforge.net/skim-app/?rev=2729view=rev Author: hofman Date: 2007-08-27 08:39:41 -0700 (Mon, 27 Aug 2007) Log Message: --- Do saving of current documents in application delegate rather than the application. Somehow the application does not know when it opens the saved files. Modified Paths: -- trunk/SKApplication.h trunk/SKApplication.m trunk/SKApplicationController.h trunk/SKApplicationController.m Modified: trunk/SKApplication.h === --- trunk/SKApplication.h 2007-08-27 15:09:12 UTC (rev 2728) +++ trunk/SKApplication.h 2007-08-27 15:39:41 UTC (rev 2729) @@ -38,15 +38,18 @@ #import Cocoa/Cocoa.h -extern NSString *SKApplicationWillTerminateNotification; +extern NSString *SKApplicationStartsTerminatingNotification; [EMAIL PROTECTED] SKApplication : NSApplication { -NSTimer *currentDocumentsTimer; -} [EMAIL PROTECTED] SKApplication : NSApplication - (IBAction)orderFrontLineInspector:(id)sender; @end [EMAIL PROTECTED] NSObject (SKApplicationDelegate) +- (void)applicationStartsTerminating:(NSNotification *)aNotification; [EMAIL PROTECTED] + + @interface NSResponder (SKMagnifyWheel) - (void)magnifyWheel:(NSEvent *)theEvent; @end Modified: trunk/SKApplication.m === --- trunk/SKApplication.m 2007-08-27 15:09:12 UTC (rev 2728) +++ trunk/SKApplication.m 2007-08-27 15:39:41 UTC (rev 2729) @@ -37,14 +37,13 @@ */ #import SKApplication.h -#import SKStringConstants.h #import SKDocument.h #import SKPDFSynchronizer.h #import SKPDFView.h #import SKLineInspector.h #import NSString_SKExtensions.h -NSString *SKApplicationWillTerminateNotification = @SKApplicationWillTerminateNotification; +NSString *SKApplicationStartsTerminatingNotification = @SKApplicationStartsTerminatingNotification; @interface NSApplication (NSApplicationPrivateDeclarations) - (id)handleOpenScriptCommand:(NSScriptCommand *)command; @@ -90,21 +89,11 @@ [super sendEvent:anEvent]; } -- (void)saveCurrentOpenDocuments:(NSTimer *)timer { -[[NSUserDefaults standardUserDefaults] setObject:[[[NSDocumentController sharedDocumentController] documents] valueForKey:@currentDocumentSetup] forKey:SKLastOpenFileNamesKey]; -} - -- (void)finishLaunching { -[super finishLaunching]; -currentDocumentsTimer = [[NSTimer scheduledTimerWithTimeInterval:10.0 target:self selector:@selector(saveCurrentOpenDocuments:) userInfo:nil repeats:YES] retain]; -} - - (IBAction)terminate:(id)sender { -[[NSNotificationCenter defaultCenter] postNotificationName:SKApplicationWillTerminateNotification object:self]; -[currentDocumentsTimer invalidate]; -[currentDocumentsTimer release]; -currentDocumentsTimer = nil; -[self saveCurrentOpenDocuments:nil]; +NSNotification *notification = [NSNotification notificationWithName:SKApplicationStartsTerminatingNotification object:self]; +[[NSNotificationCenter defaultCenter] postNotification:notification]; +if ([[self delegate] respondsToSelector:@selector(applicationStartsTerminating:)]) +[[self delegate] applicationStartsTerminating:notification]; [super terminate:sender]; } Modified: trunk/SKApplicationController.h === --- trunk/SKApplicationController.h 2007-08-27 15:09:12 UTC (rev 2728) +++ trunk/SKApplicationController.h 2007-08-27 15:39:41 UTC (rev 2729) @@ -41,8 +41,8 @@ @class SUUpdater, SKLine, SKDownloadController; @interface SKApplicationController : NSObject { +NSTimer *currentDocumentsTimer; BOOL remoteScrolling; - } + (void)setupDefaults; @@ -58,6 +58,8 @@ - (void)doSpotlightImportIfNeeded; +- (void)saveCurrentOpenDocuments:(id)sender; + - (NSString *)applicationSupportPathForDomain:(int)domain create:(BOOL)create; - (NSString *)pathForApplicationSupportFile:(NSString *)file ofType:(NSString *)extension; Modified: trunk/SKApplicationController.m === --- trunk/SKApplicationController.m 2007-08-27 15:09:12 UTC (rev 2728) +++ trunk/SKApplicationController.m 2007-08-27 15:39:41 UTC (rev 2729) @@ -141,6 +141,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification{ [NSApp setServicesProvider:self]; + NSString *versionString = [[[NSBundle mainBundle] infoDictionary] objectForKey:@CFBundleShortVersionString]; SKVersionNumber *versionNumber = versionString ? [[[SKVersionNumber alloc] initWithVersionString:versionString] autorelease] : nil; NSString *lastVersionString = [[NSUserDefaults standardUserDefaults] stringForKey:SKLastVersionLaunchedKey]; @@ -149,9 +150,13 @@ [self showReleaseNotes:nil]; [[NSUserDefaults standardUserDefaults] setObject:versionString
[Skim-app-commit] SF.net SVN: skim-app: [2736] trunk
Revision: 2736 http://skim-app.svn.sourceforge.net/skim-app/?rev=2736view=rev Author: hofman Date: 2007-08-27 12:57:17 -0700 (Mon, 27 Aug 2007) Log Message: --- Make lines for applescript always contained in the application. Simplification, and the container is not relevant anyway. Modified Paths: -- trunk/SKApplicationController.m trunk/SKDocument.m trunk/SKLine.h trunk/SKLine.m Modified: trunk/SKApplicationController.m === --- trunk/SKApplicationController.m 2007-08-27 19:36:07 UTC (rev 2735) +++ trunk/SKApplicationController.m 2007-08-27 19:57:17 UTC (rev 2736) @@ -533,7 +533,7 @@ } - (SKLine *)objectInLinesAtIndex:(unsigned int)index { -return [[[SKLine alloc] initWithContainer:nil line:index] autorelease]; +return [[[SKLine alloc] initWithLine:index] autorelease]; } @end Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-08-27 19:36:07 UTC (rev 2735) +++ trunk/SKDocument.m 2007-08-27 19:57:17 UTC (rev 2736) @@ -1198,7 +1198,7 @@ } - (SKLine *)objectInLinesAtIndex:(unsigned int)index { -return [[[SKLine alloc] initWithContainer:self line:index] autorelease]; +return [[[SKLine alloc] initWithLine:index] autorelease]; } - (PDFPage *)currentPage { Modified: trunk/SKLine.h === --- trunk/SKLine.h 2007-08-27 19:36:07 UTC (rev 2735) +++ trunk/SKLine.h 2007-08-27 19:57:17 UTC (rev 2736) @@ -40,9 +40,8 @@ @interface SKLine : NSObject { -id container; int line; } -- (id)initWithContainer:(id)aContainer line:(int)aLine; +- (id)initWithLine:(int)aLine; - (int)line; @end Modified: trunk/SKLine.m === --- trunk/SKLine.m 2007-08-27 19:36:07 UTC (rev 2735) +++ trunk/SKLine.m 2007-08-27 19:57:17 UTC (rev 2736) @@ -41,18 +41,16 @@ @implementation SKLine -- (id)initWithContainer:(id)aContainer line:(int)aLine { +- (id)initWithLine:(int)aLine { if (self = [super init]) { -container = aContainer; line = aLine; } return self; } - (NSScriptObjectSpecifier *)objectSpecifier { -NSScriptObjectSpecifier *containerRef = [container objectSpecifier]; -NSScriptClassDescription *containerClassDescription = container ? [containerRef keyClassDescription] : (NSScriptClassDescription *)[NSClassDescription classDescriptionForClass:[NSApp class]]; -return [[[NSIndexSpecifier allocWithZone:[self zone]] initWithContainerClassDescription:containerClassDescription containerSpecifier:containerRef key:@lines index:line] autorelease]; +NSScriptClassDescription *containerClassDescription = (NSScriptClassDescription *)[NSClassDescription classDescriptionForClass:[NSApp class]]; +return [[[NSIndexSpecifier allocWithZone:[self zone]] initWithContainerClassDescription:containerClassDescription containerSpecifier:nil key:@lines index:line] autorelease]; } - (int)line { 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2738] trunk
Revision: 2738 http://skim-app.svn.sourceforge.net/skim-app/?rev=2738view=rev Author: hofman Date: 2007-08-27 13:21:25 -0700 (Mon, 27 Aug 2007) Log Message: --- Use float math functions for float arguments. Modified Paths: -- trunk/NSBezierPath_BDSKExtensions.m trunk/SKMainWindowController.m trunk/SKPDFView.m Modified: trunk/NSBezierPath_BDSKExtensions.m === --- trunk/NSBezierPath_BDSKExtensions.m 2007-08-27 20:17:28 UTC (rev 2737) +++ trunk/NSBezierPath_BDSKExtensions.m 2007-08-27 20:21:25 UTC (rev 2738) @@ -60,7 +60,7 @@ + (NSBezierPath*)bezierPathWithRoundRectInRect:(NSRect)rect radius:(float)radius { // Make sure radius doesn't exceed a maximum size to avoid artifacts: -radius = MIN(radius, 0.5f * MIN(NSHeight(rect), NSWidth(rect))); +radius = fminf(radius, 0.5f * fminf(NSHeight(rect), NSWidth(rect))); // Make sure silly values simply lead to un-rounded corners: if( radius = 0 ) Modified: trunk/SKMainWindowController.m === --- trunk/SKMainWindowController.m 2007-08-27 20:17:28 UTC (rev 2737) +++ trunk/SKMainWindowController.m 2007-08-27 20:21:25 UTC (rev 2738) @@ -3480,23 +3480,23 @@ if ([tv isEqual:thumbnailTableView]) { NSSize thumbSize = [[[thumbnails objectAtIndex:row] image] size]; NSSize cellSize = NSMakeSize([[[tv tableColumns] objectAtIndex:0] width], - MIN(thumbSize.height, roundedThumbnailSize)); + fminf(thumbSize.height, roundedThumbnailSize)); if (thumbSize.height 1.0) return 1.0; else if (thumbSize.width / thumbSize.height cellSize.width / cellSize.height) return cellSize.height; else -return MAX(1.0, MIN(cellSize.width, thumbSize.width) * thumbSize.height / thumbSize.width); +return fmaxf(1.0, fminf(cellSize.width, thumbSize.width) * thumbSize.height / thumbSize.width); } else if ([tv isEqual:snapshotTableView]) { NSSize thumbSize = snapshotArrayController arrangedObjects] objectAtIndex:row] thumbnail] size]; NSSize cellSize = NSMakeSize([[[tv tableColumns] objectAtIndex:0] width], - MIN(thumbSize.height, roundedSnapshotThumbnailSize)); + fminf(thumbSize.height, roundedSnapshotThumbnailSize)); if (thumbSize.height 1.0) return 1.0; else if (thumbSize.width / thumbSize.height cellSize.width / cellSize.height) return cellSize.height; else -return MAX(32.0, MIN(cellSize.width, thumbSize.width) * thumbSize.height / thumbSize.width); +return fmaxf(32.0, fminf(cellSize.width, thumbSize.width) * thumbSize.height / thumbSize.width); } return 17.0; } Modified: trunk/SKPDFView.m === --- trunk/SKPDFView.m 2007-08-27 20:17:28 UTC (rev 2737) +++ trunk/SKPDFView.m 2007-08-27 20:21:25 UTC (rev 2738) @@ -1346,7 +1346,7 @@ - (void)magnifyWheel:(NSEvent *)theEvent { float dy = [theEvent deltaY]; -dy = dy 0 ? MIN(0.2, dy) : MAX(-0.2, dy); +dy = dy 0 ? fminf(0.2, dy) : fmaxf(-0.2, dy); [self setScaleFactor:[self scaleFactor] + 0.5 * dy]; } 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2739] trunk/skimnotes.m
Revision: 2739 http://skim-app.svn.sourceforge.net/skim-app/?rev=2739view=rev Author: hofman Date: 2007-08-28 02:24:37 -0700 (Tue, 28 Aug 2007) Log Message: --- Fix skimnotes command line tool: unarchive text, which is saved as an archived plist rather than string data. Modified Paths: -- trunk/skimnotes.m Modified: trunk/skimnotes.m === --- trunk/skimnotes.m 2007-08-27 20:21:25 UTC (rev 2738) +++ trunk/skimnotes.m 2007-08-28 09:24:37 UTC (rev 2739) @@ -65,8 +65,9 @@ data = [NSData data]; } else if ([[notesPath pathExtension] caseInsensitiveCompare:@txt] == NSOrderedSame || [[notesPath pathExtension] caseInsensitiveCompare:@text] == NSOrderedSame) { NSError *error = nil; -data = [fm extendedAttributeNamed:SKIM_TEXT_NOTES_KEY atPath:pdfPath traverseLink:YES error:error]; -if (data == nil [error code] == ENOATTR) +NSString *string = [fm propertyListFromExtendedAttributeNamed:SKIM_TEXT_NOTES_KEY atPath:pdfPath traverseLink:YES error:error]; +data = [string dataUsingEncoding:NSUTF8StringEncoding]; +if (string == nil [error code] == ENOATTR) data = [NSData data]; } else { NSError *error = nil; 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2745] trunk/SKDocument.m
Revision: 2745 http://skim-app.svn.sourceforge.net/skim-app/?rev=2745view=rev Author: hofman Date: 2007-08-28 08:34:11 -0700 (Tue, 28 Aug 2007) Log Message: --- fix typos. Modified Paths: -- trunk/SKDocument.m Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-08-28 13:48:16 UTC (rev 2744) +++ trunk/SKDocument.m 2007-08-28 15:34:11 UTC (rev 2745) @@ -207,52 +207,94 @@ [[NSUserDefaults standardUserDefaults] setObject:typeName forKey:@SKLastExportedType]; } -BOOL success = [super saveToURL:absoluteURL ofType:typeName forSaveOperation:saveOperation error:outError]; +BOOL success = NO; + // we check for notes and may save a .skim as well: -if (success [typeName isEqualToString:SKPDFDocumentType]) { +if ([typeName isEqualToString:SKPDFDocumentType]) { NSFileManager *fm = [NSFileManager defaultManager]; -[self saveNotesToExtendedAttributesAtURL:absoluteURL error:NULL]; - -if ([[NSUserDefaults standardUserDefaults] boolForKey:SKAutoSaveSkimNotesKey]) { -NSString *notesPath = [[absoluteURL path] stringByReplacingPathExtension:@skim]; -BOOL canMove = YES; -BOOL fileExists = [fm fileExistsAtPath:notesPath]; +if (success = [super saveToURL:absoluteURL ofType:typeName forSaveOperation:saveOperation error:outError]) { -if (fileExists (saveOperation == NSSaveAsOperation || saveOperation == NSSaveToOperation)) { -NSAlert *alert = [NSAlert alertWithMessageText:[NSString stringWithFormat:NSLocalizedString(@\[EMAIL PROTECTED] already exists. Do you want to replace it?, @Message in alert dialog), [notesPath lastPathComponent]] - defaultButton:NSLocalizedString(@Save, @Button title) - alternateButton:NSLocalizedString(@Cancel, @Button title) - otherButton:nil - informativeTextWithFormat:NSLocalizedString(@A file or folder with the same name already exists in [EMAIL PROTECTED] Replacing it will overwrite its current contents., @Informative text in alert dialog), [[notesPath stringByDeletingLastPathComponent] lastPathComponent]]; +[self saveNotesToExtendedAttributesAtURL:absoluteURL error:NULL]; + +if ([[NSUserDefaults standardUserDefaults] boolForKey:SKAutoSaveSkimNotesKey]) { +NSString *notesPath = [[absoluteURL path] stringByReplacingPathExtension:@skim]; +BOOL canMove = YES; +BOOL fileExists = [fm fileExistsAtPath:notesPath]; -canMove = NSAlertDefaultReturn == [alert runModal]; +if (fileExists (saveOperation == NSSaveAsOperation || saveOperation == NSSaveToOperation)) { +NSAlert *alert = [NSAlert alertWithMessageText:[NSString stringWithFormat:NSLocalizedString(@\[EMAIL PROTECTED] already exists. Do you want to replace it?, @Message in alert dialog), [notesPath lastPathComponent]] + defaultButton:NSLocalizedString(@Save, @Button title) + alternateButton:NSLocalizedString(@Cancel, @Button title) + otherButton:nil + informativeTextWithFormat:NSLocalizedString(@A file or folder with the same name already exists in [EMAIL PROTECTED] Replacing it will overwrite its current contents., @Informative text in alert dialog), [[notesPath stringByDeletingLastPathComponent] lastPathComponent]]; + +canMove = NSAlertDefaultReturn == [alert runModal]; +} + +if (canMove) { +NSString *tmpPath = [NSTemporaryDirectory() stringByAppendingPathComponent:[[NSProcessInfo processInfo] globallyUniqueString]]; +if ([self writeToURL:[NSURL fileURLWithPath:tmpPath] ofType:SKNotesDocumentType error:NULL]) { +if (fileExists) +canMove = [fm removeFileAtPath:notesPath handler:nil]; +if (canMove) +[fm movePath:tmpPath toPath:notesPath handler:nil]; +else +[fm removeFileAtPath:tmpPath handler:nil]; +} +} } +} + +} else if ([typeName isEqualToString:SKPDFBundleDocumentType]) { +NSFileManager *fm = [NSFileManager defaultManager]; +NSString *path = [absoluteURL path]; +BOOL isDir = NO; +BOOL fileExists = [fm fileExistsAtPath:path
[Skim-app-commit] SF.net SVN: skim-app: [2747] SkimNotesAgent/SkimNotesAgent.m
Revision: 2747 http://skim-app.svn.sourceforge.net/skim-app/?rev=2747view=rev Author: hofman Date: 2007-08-28 09:25:19 -0700 (Tue, 28 Aug 2007) Log Message: --- Read skim notes from PDF bundles. Modified Paths: -- SkimNotesAgent/SkimNotesAgent.m Modified: SkimNotesAgent/SkimNotesAgent.m === --- SkimNotesAgent/SkimNotesAgent.m 2007-08-28 16:12:35 UTC (rev 2746) +++ SkimNotesAgent/SkimNotesAgent.m 2007-08-28 16:25:19 UTC (rev 2747) @@ -86,27 +86,58 @@ - (bycopy NSData *)SkimNotesAtPath:(in bycopy NSString *)aFile; { NSError *error; -NSData *data = [[NSFileManager defaultManager] extendedAttributeNamed:@net_sourceforge_skim-app_notes atPath:[aFile stringByStandardizingPath] traverseLink:YES error:error]; -if (nil == data [error code] != ENOATTR) -fprintf(stderr, SkimNotesAgent pid %d: error getting Skim notes (%s)\n, getpid(), [[error description] UTF8String]); +NSData *data = nil; +NSString *extension = [[aFile pathExtension] lastPathComponent]; + +if ([extension caseInsensitiveCompare:@pdfd] == NSOrderedSame) { +data = [NSData dataWithContentsOfFile:[aFile stringByAppendingPathComponent:@data.skim] options:0 error:error]; +if (nil == data) +fprintf(stderr, SkimNotesAgent pid %d: error getting Skim notes\n, getpid(), [[error description] UTF8String]); +} else if ([extension caseInsensitiveCompare:@skim] == NSOrderedSame) { +data = [NSData dataWithContentsOfFile:aFile options:0 error:error]; +if (nil == data) +fprintf(stderr, SkimNotesAgent pid %d: error getting Skim notes\n, getpid(), [[error description] UTF8String]); +} else { +data = [[NSFileManager defaultManager] extendedAttributeNamed:@net_sourceforge_skim-app_notes atPath:[aFile stringByStandardizingPath] traverseLink:YES error:error]; +if (nil == data [error code] != ENOATTR) +fprintf(stderr, SkimNotesAgent pid %d: error getting Skim notes (%s)\n, getpid(), [[error description] UTF8String]); +} return data; } - (bycopy NSData *)RTFNotesAtPath:(in bycopy NSString *)aFile; { NSError *error; -NSData *data = [[NSFileManager defaultManager] extendedAttributeNamed:@net_sourceforge_skim-app_rtf_notes atPath:[aFile stringByStandardizingPath] traverseLink:YES error:error]; -if (nil == data [error code] != ENOATTR) -fprintf(stderr, SkimNotesAgent pid %d: error getting RTF notes (%s)\n, getpid(), [[error description] UTF8String]); +NSData *data = nil; +NSString *extension = [[aFile pathExtension] lastPathComponent]; + +if ([extension caseInsensitiveCompare:@pdfd] == NSOrderedSame) { +data = [NSData dataWithContentsOfFile:[aFile stringByAppendingPathComponent:@data.rtf] options:0 error:error]; +if (nil == data) +fprintf(stderr, SkimNotesAgent pid %d: error getting Skim notes\n, getpid(), [[error description] UTF8String]); +} else { +data = [[NSFileManager defaultManager] extendedAttributeNamed:@net_sourceforge_skim-app_rtf_notes atPath:[aFile stringByStandardizingPath] traverseLink:YES error:error]; +if (nil == data [error code] != ENOATTR) +fprintf(stderr, SkimNotesAgent pid %d: error getting RTF notes (%s)\n, getpid(), [[error description] UTF8String]); +} return data; } - (bycopy NSString *)textNotesAtPath:(in bycopy NSString *)aFile; { NSError *error; -NSString *string = [[NSFileManager defaultManager] propertyListFromExtendedAttributeNamed:@net_sourceforge_skim-app_text_notes atPath:[aFile stringByStandardizingPath] traverseLink:YES error:error]; -if (nil == string [[[error userInfo] objectForKey:NSUnderlyingErrorKey] code] != ENOATTR) -fprintf(stderr, SkimNotesAgent pid %d: error getting text notes (%s)\n, getpid(), [[error description] UTF8String]); +NSString *string = nil; +NSString *extension = [[aFile pathExtension] lastPathComponent]; + +if ([extension caseInsensitiveCompare:@pdfd] == NSOrderedSame) { +string = [NSString stringWithContentsOfFile:[aFile stringByAppendingPathComponent:@data.txt] encoding:NSUTF8StringEncoding error:error]; +if (nil == string) +fprintf(stderr, SkimNotesAgent pid %d: error getting Skim notes\n, getpid(), [[error description] UTF8String]); +} else { +string = [[NSFileManager defaultManager] propertyListFromExtendedAttributeNamed:@net_sourceforge_skim-app_text_notes atPath:[aFile stringByStandardizingPath] traverseLink:YES error:error]; +if (nil == string [[[error userInfo] objectForKey:NSUnderlyingErrorKey] code] != ENOATTR) +fprintf(stderr, SkimNotesAgent pid %d: error getting text notes (%s)\n, getpid(), [[error description] UTF8String]); +} return string; } This was sent by the SourceForge.net collaborative
[Skim-app-commit] SF.net SVN: skim-app: [2758] trunk
Revision: 2758 http://skim-app.svn.sourceforge.net/skim-app/?rev=2758view=rev Author: hofman Date: 2007-08-28 12:50:49 -0700 (Tue, 28 Aug 2007) Log Message: --- Add a remark about showing the contents of a bundle in the help. Modified Paths: -- trunk/Dutch.lproj/Skim Help/skim.texi trunk/English.lproj/Skim Help/skim.texi trunk/French.lproj/Skim Help/skim.texi trunk/Italian.lproj/Skim Help/skim.texi Modified: trunk/Dutch.lproj/Skim Help/skim.texi === --- trunk/Dutch.lproj/Skim Help/skim.texi 2007-08-28 19:33:56 UTC (rev 2757) +++ trunk/Dutch.lproj/Skim Help/skim.texi 2007-08-28 19:50:49 UTC (rev 2758) @@ -1106,6 +1106,8 @@ @end enumerate @endbox +Een PDF bundel bevat het overanderde PDF-bestand en bestanden voor de notities. U kunt deze bestanden in de Finder zien door 'Toon pakketinhoud' van het contextuele menu te kiezen. + @heading Zie ook @menu * Als ik een PDF-bestand email verlies ik de notities en markeringen:: Modified: trunk/English.lproj/Skim Help/skim.texi === --- trunk/English.lproj/Skim Help/skim.texi 2007-08-28 19:33:56 UTC (rev 2757) +++ trunk/English.lproj/Skim Help/skim.texi 2007-08-28 19:50:49 UTC (rev 2758) @@ -1100,6 +1100,8 @@ @end enumerate @endbox +A PDF bundle contains the unmodified PDF file and files containing the notes. You can see those file in the Finder using the 'Show package Contents' contextual menu item. + @heading See also @menu * Emailing a PDF file loses notes or highlights:: Modified: trunk/French.lproj/Skim Help/skim.texi === --- trunk/French.lproj/Skim Help/skim.texi 2007-08-28 19:33:56 UTC (rev 2757) +++ trunk/French.lproj/Skim Help/skim.texi 2007-08-28 19:50:49 UTC (rev 2758) @@ -1100,6 +1100,8 @@ @end enumerate @endbox +A PDF bundle contains the unmodified PDF file and files containing the notes. You can see those file in the Finder using the 'Show package Contents' contextual menu item. + @heading See also @menu * Emailing a PDF file loses notes or highlights:: Modified: trunk/Italian.lproj/Skim Help/skim.texi === --- trunk/Italian.lproj/Skim Help/skim.texi 2007-08-28 19:33:56 UTC (rev 2757) +++ trunk/Italian.lproj/Skim Help/skim.texi 2007-08-28 19:50:49 UTC (rev 2758) @@ -1100,6 +1100,8 @@ @end enumerate @endbox +A PDF bundle contains the unmodified PDF file and files containing the notes. You can see those file in the Finder using the 'Show package Contents' contextual menu item. + @heading See also @menu * Emailing a PDF file loses notes or highlights:: 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2763] trunk/French.lproj
Revision: 2763 http://skim-app.svn.sourceforge.net/skim-app/?rev=2763view=rev Author: hofman Date: 2007-08-28 16:02:12 -0700 (Tue, 28 Aug 2007) Log Message: --- Update French localization. Modified Paths: -- trunk/French.lproj/BookmarksWindow.nib/info.nib trunk/French.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/French.lproj/DownloadsWindow.nib/info.nib trunk/French.lproj/DownloadsWindow.nib/keyedobjects.nib trunk/French.lproj/FindPanel.nib/info.nib trunk/French.lproj/FindPanel.nib/keyedobjects.nib trunk/French.lproj/LineInspector.nib/classes.nib trunk/French.lproj/LineInspector.nib/info.nib trunk/French.lproj/LineInspector.nib/keyedobjects.nib trunk/French.lproj/Localizable.strings trunk/French.lproj/MainMenu.nib/keyedobjects.nib trunk/French.lproj/MainWindow.nib/info.nib trunk/French.lproj/MainWindow.nib/keyedobjects.nib trunk/French.lproj/NoteWindow.nib/info.nib trunk/French.lproj/NoteWindow.nib/keyedobjects.nib trunk/French.lproj/NotesDocument.nib/classes.nib trunk/French.lproj/NotesDocument.nib/info.nib trunk/French.lproj/NotesDocument.nib/keyedobjects.nib trunk/French.lproj/PreferenceWindow.nib/keyedobjects.nib Modified: trunk/French.lproj/BookmarksWindow.nib/info.nib === --- trunk/French.lproj/BookmarksWindow.nib/info.nib 2007-08-28 21:54:02 UTC (rev 2762) +++ trunk/French.lproj/BookmarksWindow.nib/info.nib 2007-08-28 23:02:12 UTC (rev 2763) @@ -3,14 +3,10 @@ plist version=1.0 dict keyIBDocumentLocation/key - string69 58 356 240 0 0 1440 938 /string + string79 78 356 240 0 0 1600 1178 /string keyIBFramework Version/key string446.1/string - keyIBOpenObjects/key - array - integer5/integer - /array keyIBSystem Version/key - string8R218/string + string8R2218/string /dict /plist Modified: trunk/French.lproj/BookmarksWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/French.lproj/DownloadsWindow.nib/info.nib === --- trunk/French.lproj/DownloadsWindow.nib/info.nib 2007-08-28 21:54:02 UTC (rev 2762) +++ trunk/French.lproj/DownloadsWindow.nib/info.nib 2007-08-28 23:02:12 UTC (rev 2763) @@ -3,15 +3,10 @@ plist version=1.0 dict keyIBDocumentLocation/key - string100 77 356 240 0 0 1440 938 /string + string115 103 356 240 0 0 1600 1178 /string keyIBFramework Version/key string446.1/string - keyIBOpenObjects/key - array - integer30/integer - integer5/integer - /array keyIBSystem Version/key - string8R218/string + string8R2218/string /dict /plist Modified: trunk/French.lproj/DownloadsWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/French.lproj/FindPanel.nib/info.nib === --- trunk/French.lproj/FindPanel.nib/info.nib 2007-08-28 21:54:02 UTC (rev 2762) +++ trunk/French.lproj/FindPanel.nib/info.nib 2007-08-28 23:02:12 UTC (rev 2763) @@ -3,14 +3,10 @@ plist version=1.0 dict keyIBDocumentLocation/key - string69 58 356 240 0 0 1440 938 /string + string79 78 356 240 0 0 1600 1178 /string keyIBFramework Version/key string446.1/string - keyIBOpenObjects/key - array - integer5/integer - /array keyIBSystem Version/key - string8R218/string + string8R2218/string /dict /plist Modified: trunk/French.lproj/FindPanel.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/French.lproj/LineInspector.nib/classes.nib === --- trunk/French.lproj/LineInspector.nib/classes.nib2007-08-28 21:54:02 UTC (rev 2762) +++ trunk/French.lproj/LineInspector.nib/classes.nib2007-08-28 23:02:12 UTC (rev 2763) @@ -1,44 +1,56 @@ { -IBClasses = ( -{ -ACTIONS = { = id; }; -CLASS = FirstResponder; -LANGUAGE = ObjC; -SUPERCLASS = NSObject; -}, -{ -ACTIONS = { -changeDashPattern = id; -changeEndLineStyle = id; -changeLineStyle = id; -changeLineWidth = id; -changeStartLineStyle = id; -}; -CLASS = NSObject; -LANGUAGE = ObjC; -}, -{CLASS = NSSegmentedControl; LANGUAGE = ObjC; SUPERCLASS = NSControl; }, -{ -CLASS = SKLineInspector; -LANGUAGE = ObjC
[Skim-app-commit] SF.net SVN: skim-app: [2764] trunk/SKDocument.m
Revision: 2764 http://skim-app.svn.sourceforge.net/skim-app/?rev=2764view=rev Author: hofman Date: 2007-08-28 16:57:57 -0700 (Tue, 28 Aug 2007) Log Message: --- Save the text of the PDF in the PDF bundle. Will be used to index for Spotlight. Modified Paths: -- trunk/SKDocument.m Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-08-28 23:02:12 UTC (rev 2763) +++ trunk/SKDocument.m 2007-08-28 23:57:57 UTC (rev 2764) @@ -65,9 +65,10 @@ #define MAX_XATTR_LENGTH2048 #define WRAPPER_PDF_FILENAME@data.pdf -#define WRAPPER_SKIM_FILENAME @data.skim -#define WRAPPER_TXT_FILENAME@data.txt -#define WRAPPER_RTF_FILENAME@data.rtf +#define WRAPPER_TEXT_FILENAME @data.txt +#define WRAPPER_SKIM_FILENAME @notes.skim +#define WRAPPER_TXT_FILENAME@notes.txt +#define WRAPPER_RTF_FILENAME@notes.rtf NSString *SKDocumentErrorDomain = @SKDocumentErrorDomain; @@ -327,11 +328,14 @@ didWrite = [pdfData writeToURL:absoluteURL options:NSAtomicWrite error:outError] [self saveNotesToExtendedAttributesAtURL:absoluteURL error:outError]; } else if ([typeName isEqualToString:SKPDFBundleDocumentType]) { +NSData *textData = [[[self pdfDocument] string] dataUsingEncoding:NSUTF8StringEncoding]; NSData *notesData = [[self notes] count] ? [NSKeyedArchiver archivedDataWithRootObject:[[self notes] valueForKey:@dictionaryValue]] : nil; NSData *notesTextData = [[self notesString] dataUsingEncoding:NSUTF8StringEncoding]; NSData *notesRTFData = [self notesRTFData]; NSFileWrapper *fileWrapper = [[NSFileWrapper alloc] initDirectoryWithFileWrappers:[NSDictionary dictionary]]; [fileWrapper addRegularFileWithContents:pdfData preferredFilename:WRAPPER_PDF_FILENAME]; +if (textData) +[fileWrapper addRegularFileWithContents:textData preferredFilename:WRAPPER_TEXT_FILENAME]; if (notesData) [fileWrapper addRegularFileWithContents:notesData preferredFilename:WRAPPER_SKIM_FILENAME]; if (notesTextData) 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2765] trunk/SkimImporter/GetMetadataForFile.m
Revision: 2765 http://skim-app.svn.sourceforge.net/skim-app/?rev=2765view=rev Author: hofman Date: 2007-08-28 16:59:10 -0700 (Tue, 28 Aug 2007) Log Message: --- Add the text of the PDF to the text for indexing. Modified Paths: -- trunk/SkimImporter/GetMetadataForFile.m Modified: trunk/SkimImporter/GetMetadataForFile.m === --- trunk/SkimImporter/GetMetadataForFile.m 2007-08-28 23:57:57 UTC (rev 2764) +++ trunk/SkimImporter/GetMetadataForFile.m 2007-08-28 23:59:10 UTC (rev 2765) @@ -58,19 +58,19 @@ notePath = (NSString *)pathToFile; sourcePath = [[(NSString *)pathToFile stringByDeletingPathExtension] stringByAppendingPathExtension:@pdf]; } else if (UTTypeEqual(contentTypeUTI, CFSTR(net.sourceforge.skim-app.pdfd))) { -notePath = [(NSString *)pathToFile stringByAppendingPathComponent:@data.skim]; +notePath = [(NSString *)pathToFile stringByAppendingPathComponent:@notes.skim]; } if (notePath [[NSFileManager defaultManager] fileExistsAtPath:notePath]) { NSData *data = [[NSData alloc] initWithContentsOfFile:notePath options:NSUncachedRead error:NULL]; if (data) { +NSMutableString *textContent = [[NSMutableString alloc] init]; NSArray *array = [NSKeyedUnarchiver unarchiveObjectWithData:data]; [data release]; if (array) { NSEnumerator *noteEnum = [array objectEnumerator]; NSDictionary *note; -NSMutableString *textContent = [[NSMutableString alloc] init]; NSMutableArray *notes = [[NSMutableArray alloc] init]; while (note = [noteEnum nextObject]) { NSString *contents = [note objectForKey:@contents]; @@ -87,11 +87,21 @@ [textContent appendString:text]; } } -[(NSMutableDictionary *)attributes setObject:textContent forKey:(NSString *)kMDItemTextContent]; [(NSMutableDictionary *)attributes setObject:notes forKey:@net_sourceforge_skim_app_notes]; [textContent release]; [notes release]; } + +if (UTTypeEqual(contentTypeUTI, CFSTR(net.sourceforge.skim-app.pdfd))) { +NSString *textPath = [(NSString *)pathToFile stringByAppendingPathComponent:@data.txt]; +NSString *string = [NSString stringWithContentsOfFile:textPath]; +if ([string length]) { +if ([textContent length]) +[textContent appendString:@\n\n]; +[textContent appendString:string]; +} +} +[(NSMutableDictionary *)attributes setObject:textContent forKey:(NSString *)kMDItemTextContent]; } [(NSMutableDictionary *)attributes setObject:@Skim forKey:(NSString *)kMDItemCreator]; 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2768] trunk
Revision: 2768 http://skim-app.svn.sourceforge.net/skim-app/?rev=2768view=rev Author: hofman Date: 2007-08-29 02:49:32 -0700 (Wed, 29 Aug 2007) Log Message: --- Only failing to copy pdf or skim file is an error when creating a PDF bundle. Make sure there is always an error returned. Add page width and height to document info. Modified Paths: -- trunk/SKDocument.m trunk/SKInfoWindowController.m Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-08-29 00:06:07 UTC (rev 2767) +++ trunk/SKDocument.m 2007-08-29 09:49:32 UTC (rev 2768) @@ -266,9 +266,11 @@ if (success = [self writeToURL:tmpURL ofType:typeName error:outError]) { -NSSet *ourExtensions = [NSSet setWithObjects:@pdf, @skim, @txt, @text, @rtf, nil]; +NSSet *ourExtensions = [NSSet setWithObjects:@pdf, @skim, @txt, @text, @rtf, @plist, nil]; +NSSet *ourImportantExtensions = [NSSet setWithObjects:@pdf, @skim, nil]; NSEnumerator *fileEnum; NSString *file; +BOOL didMove; NSMutableDictionary *attributes = [[fm fileAttributesAtPath:path traverseLink:YES] mutableCopy]; unsigned long permissions = [[attributes objectForKey:NSFilePosixPermissions] unsignedLongValue]; @@ -285,8 +287,11 @@ } fileEnum = [[fm directoryContentsAtPath:tmpPath] objectEnumerator]; -while (success (file = [fileEnum nextObject])) -success = [fm movePath:[tmpPath stringByAppendingPathComponent:file] toPath:[path stringByAppendingPathComponent:file] handler:nil]; +while (success (file = [fileEnum nextObject])) { +didMove = [fm movePath:[tmpPath stringByAppendingPathComponent:file] toPath:[path stringByAppendingPathComponent:file] handler:nil]; +if (didMove == NO [ourImportantExtensions containsObject:[[file pathExtension] lowercaseString]]) +success = NO; +} if (success) [NSTask launchedTaskWithLaunchPath:@/usr/bin/touch arguments:[NSArray arrayWithObjects:@-fm, path, nil]]; @@ -318,6 +323,9 @@ exportUsingPanel = NO; +if (success == NO outError != NULL *outError == nil) +*outError = [NSError errorWithDomain:SKDocumentErrorDomain code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@Unable to write file, @Error description), NSLocalizedDescriptionKey, nil]]; + return success; } Modified: trunk/SKInfoWindowController.m === --- trunk/SKInfoWindowController.m 2007-08-29 00:06:07 UTC (rev 2767) +++ trunk/SKInfoWindowController.m 2007-08-29 09:49:32 UTC (rev 2768) @@ -170,8 +170,13 @@ [dictionary addEntriesFromDictionary:[pdfDoc documentAttributes]]; [dictionary setValue:[NSString stringWithFormat: @%d.%d, [pdfDoc majorVersion], [pdfDoc minorVersion]] forKey:@Version]; [dictionary setValue:[NSNumber numberWithInt:[pdfDoc pageCount]] forKey:@PageCount]; -if ([pdfDoc pageCount]) -[dictionary setValue:SKSizeString([[pdfDoc pageAtIndex:0] boundsForBox:kPDFDisplayBoxCropBox].size, [[pdfDoc pageAtIndex:0] boundsForBox:kPDFDisplayBoxMediaBox].size) forKey:@PageSize]; +if ([pdfDoc pageCount]) { +NSSize cropSize = [[pdfDoc pageAtIndex:0] boundsForBox:kPDFDisplayBoxCropBox].size; +NSSize mediaSize = [[pdfDoc pageAtIndex:0] boundsForBox:kPDFDisplayBoxMediaBox].size; +[dictionary setValue:SKSizeString(cropSize, mediaSize) forKey:@PageSize]; +[dictionary setValue:[NSNumber numberWithFloat:cropSize.width] forKey:@PageWidth]; +[dictionary setValue:[NSNumber numberWithFloat:cropSize.height] forKey:@PageHeight]; +} [dictionary setValue:[[dictionary valueForKey:@Keywords] componentsJoinedByString:@\n] forKey:@KeywordsString]; [dictionary setValue:[NSNumber numberWithBool:[pdfDoc isEncrypted]] forKey:@Encrypted]; [dictionary setValue:[NSNumber numberWithBool:[pdfDoc allowsPrinting]] forKey:@AllowsPrinting]; 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2769] trunk/SkimImporter
Revision: 2769 http://skim-app.svn.sourceforge.net/skim-app/?rev=2769view=rev Author: hofman Date: 2007-08-29 02:51:52 -0700 (Wed, 29 Aug 2007) Log Message: --- Add document attributes to spotlight values for PDFD bundle. Modified Paths: -- trunk/SkimImporter/Dutch.lproj/schema.strings trunk/SkimImporter/English.lproj/schema.strings trunk/SkimImporter/French.lproj/schema.strings trunk/SkimImporter/GetMetadataForFile.m trunk/SkimImporter/Italian.lproj/schema.strings trunk/SkimImporter/schema.xml Modified: trunk/SkimImporter/Dutch.lproj/schema.strings === (Binary files differ) Modified: trunk/SkimImporter/English.lproj/schema.strings === (Binary files differ) Modified: trunk/SkimImporter/French.lproj/schema.strings === (Binary files differ) Modified: trunk/SkimImporter/GetMetadataForFile.m === --- trunk/SkimImporter/GetMetadataForFile.m 2007-08-29 09:49:32 UTC (rev 2768) +++ trunk/SkimImporter/GetMetadataForFile.m 2007-08-29 09:51:52 UTC (rev 2769) @@ -62,9 +62,10 @@ } if (notePath [[NSFileManager defaultManager] fileExistsAtPath:notePath]) { +NSMutableString *textContent = [[NSMutableString alloc] init]; + NSData *data = [[NSData alloc] initWithContentsOfFile:notePath options:NSUncachedRead error:NULL]; if (data) { -NSMutableString *textContent = [[NSMutableString alloc] init]; NSArray *array = [NSKeyedUnarchiver unarchiveObjectWithData:data]; [data release]; @@ -88,22 +89,50 @@ } } [(NSMutableDictionary *)attributes setObject:notes forKey:@net_sourceforge_skim_app_notes]; -[textContent release]; [notes release]; } - -if (UTTypeEqual(contentTypeUTI, CFSTR(net.sourceforge.skim-app.pdfd))) { -NSString *textPath = [(NSString *)pathToFile stringByAppendingPathComponent:@data.txt]; -NSString *string = [NSString stringWithContentsOfFile:textPath]; -if ([string length]) { -if ([textContent length]) -[textContent appendString:@\n\n]; -[textContent appendString:string]; +} + +if (UTTypeEqual(contentTypeUTI, CFSTR(net.sourceforge.skim-app.pdfd))) { +NSString *textPath = [(NSString *)pathToFile stringByAppendingPathComponent:@data.txt]; +NSString *string = [NSString stringWithContentsOfFile:textPath]; +if ([string length]) { +if ([textContent length]) +[textContent appendString:@\n\n]; +[textContent appendString:string]; +} + +NSString *plistPath = [(NSString *)pathToFile stringByAppendingPathComponent:@data.plist]; +NSData *plistData = [NSData dataWithContentsOfFile:plistPath]; +NSDictionary *info = plistData ? [NSPropertyListSerialization propertyListFromData:plistData mutabilityOption:NSPropertyListImmutable format:NULL errorDescription:NULL] : nil; +if (info) { +id value; +id pageWidth = [info objectForKey:@PageWidth], pageHeight = [info objectForKey:@PageHeight]; +if (value = [info objectForKey:@Title]) +[(NSMutableDictionary *)attributes setObject:value forKey:(NSString *)kMDItemTitle]; +if (value = [info objectForKey:@Author]) +[(NSMutableDictionary *)attributes setObject:value forKey:(NSString *)kMDItemAuthors]; +if (value = [info objectForKey:@Keywords]) +[(NSMutableDictionary *)attributes setObject:value forKey:(NSString *)kMDItemKeywords]; +if (value = [info objectForKey:@Producer]) +[(NSMutableDictionary *)attributes setObject:value forKey:(NSString *)kMDItemEncodingApplications]; +if (value = [info objectForKey:@Version]) +[(NSMutableDictionary *)attributes setObject:value forKey:(NSString *)kMDItemVersion]; +if (value = [info objectForKey:@Encrypted]) +[(NSMutableDictionary *)attributes setObject:[value boolValue] ? @Password Encrypted : @None forKey:(NSString *)kMDItemSecurityMethod]; +if (value = [info objectForKey:@PageCount]) +[(NSMutableDictionary *)attributes setObject:value forKey:(NSString *)kMDItemNumberOfPages]; +if (pageWidth pageHeight) { +[(NSMutableDictionary *)attributes setObject:pageWidth forKey:(NSString
[Skim-app-commit] SF.net SVN: skim-app: [2770] trunk
Revision: 2770 http://skim-app.svn.sourceforge.net/skim-app/?rev=2770view=rev Author: hofman Date: 2007-08-29 05:30:28 -0700 (Wed, 29 Aug 2007) Log Message: --- Add new preferences for default anchored note font. Update Dutch localization. Modified Paths: -- trunk/Dutch.lproj/BookmarksWindow.nib/info.nib trunk/Dutch.lproj/BookmarksWindow.nib/keyedobjects.nib trunk/Dutch.lproj/Localizable.strings trunk/Dutch.lproj/MainMenu.nib/info.nib trunk/Dutch.lproj/MainMenu.nib/keyedobjects.nib trunk/Dutch.lproj/MainWindow.nib/data.dependency trunk/Dutch.lproj/MainWindow.nib/info.nib trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib trunk/Dutch.lproj/NoteWindow.nib/classes.nib trunk/Dutch.lproj/NoteWindow.nib/info.nib trunk/Dutch.lproj/NoteWindow.nib/keyedobjects.nib trunk/Dutch.lproj/PreferenceWindow.nib/info.nib trunk/Dutch.lproj/PreferenceWindow.nib/keyedobjects.nib trunk/English.lproj/NoteWindow.nib/classes.nib trunk/English.lproj/NoteWindow.nib/info.nib trunk/English.lproj/NoteWindow.nib/keyedobjects.nib trunk/English.lproj/PreferenceWindow.nib/keyedobjects.nib trunk/French.lproj/NoteWindow.nib/classes.nib trunk/French.lproj/NoteWindow.nib/info.nib trunk/French.lproj/NoteWindow.nib/keyedobjects.nib trunk/French.lproj/PreferenceWindow.nib/keyedobjects.nib trunk/InitialUserDefaults.plist trunk/Italian.lproj/NoteWindow.nib/classes.nib trunk/Italian.lproj/NoteWindow.nib/info.nib trunk/Italian.lproj/NoteWindow.nib/keyedobjects.nib trunk/Italian.lproj/PreferenceWindow.nib/keyedobjects.nib trunk/SKNoteWindowController.h trunk/SKNoteWindowController.m trunk/SKStringConstants.h trunk/SKStringConstants.m Modified: trunk/Dutch.lproj/BookmarksWindow.nib/info.nib === --- trunk/Dutch.lproj/BookmarksWindow.nib/info.nib 2007-08-29 09:51:52 UTC (rev 2769) +++ trunk/Dutch.lproj/BookmarksWindow.nib/info.nib 2007-08-29 12:30:28 UTC (rev 2770) @@ -6,10 +6,6 @@ string69 58 356 240 0 0 1440 938 /string keyIBFramework Version/key string446.1/string - keyIBOpenObjects/key - array - integer5/integer - /array keyIBSystem Version/key string8R218/string /dict Modified: trunk/Dutch.lproj/BookmarksWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/Dutch.lproj/Localizable.strings === (Binary files differ) Modified: trunk/Dutch.lproj/MainMenu.nib/info.nib === --- trunk/Dutch.lproj/MainMenu.nib/info.nib 2007-08-29 09:51:52 UTC (rev 2769) +++ trunk/Dutch.lproj/MainMenu.nib/info.nib 2007-08-29 12:30:28 UTC (rev 2770) @@ -7,14 +7,10 @@ keyIBEditorPositions/key dict key29/key - string140 614 635 44 0 0 1440 938 /string + string140 614 542 44 0 0 1440 938 /string /dict keyIBFramework Version/key string446.1/string - keyIBOpenObjects/key - array - integer29/integer - /array keyIBSystem Version/key string8R218/string /dict Modified: trunk/Dutch.lproj/MainMenu.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/Dutch.lproj/MainWindow.nib/data.dependency === --- trunk/Dutch.lproj/MainWindow.nib/data.dependency2007-08-29 09:51:52 UTC (rev 2769) +++ trunk/Dutch.lproj/MainWindow.nib/data.dependency2007-08-29 12:30:28 UTC (rev 2770) @@ -5,6 +5,7 @@ keyIBPaletteDependency/key array stringPDFKit/string + stringControllers/string /array /dict /plist Modified: trunk/Dutch.lproj/MainWindow.nib/info.nib === --- trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-08-29 09:51:52 UTC (rev 2769) +++ trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-08-29 12:30:28 UTC (rev 2770) @@ -7,7 +7,7 @@ keyIBEditorPositions/key dict key168/key - string601 495 237 265 0 0 1440 938 /string + string601 508 237 265 0 0 1440 938 /string key224/key string610 420 220 442 0 0 1440 938 /string key256/key @@ -29,12 +29,6 @@ array integer208/integer /array - keyIBOpenObjects/key - array - integer314/integer - integer502/integer - integer224/integer - /array keyIBSystem Version/key string8R218/string /dict Modified: trunk/Dutch.lproj/MainWindow.nib
[Skim-app-commit] SF.net SVN: skim-app: [2771] trunk/SKDocument.m
Revision: 2771 http://skim-app.svn.sourceforge.net/skim-app/?rev=2771view=rev Author: hofman Date: 2007-08-29 08:27:36 -0700 (Wed, 29 Aug 2007) Log Message: --- Check enclosed PDF file for file changes of a PDF bundle. Modified Paths: -- trunk/SKDocument.m Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-08-29 12:30:28 UTC (rev 2770) +++ trunk/SKDocument.m 2007-08-29 15:27:36 UTC (rev 2771) @@ -989,6 +989,25 @@ return; } +NSString *extension = [fileName pathExtension]; +if (extension) { +NSString *theUTI = [(id)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (CFStringRef)extension, NULL) autorelease]; +if (theUTI UTTypeConformsTo((CFStringRef)theUTI, CFSTR(application/x-dvi))) { +return; +} if (theUTI UTTypeConformsTo((CFStringRef)theUTI, CFSTR(net.sourceforge.skim-app.pdfd))) { +NSString *pdfFile = [fileName stringByAppendingPathComponent:@data.pdf]; +if ([[NSFileManager defaultManager] fileExistsAtPath:pdfFile]) { +fileName = pdfFile; +} else { +NSArray *subfiles = [[NSFileManager defaultManager] subpathsAtPath:fileName]; +unsigned int index = [[subfiles valueForKeyPath:@pathExtension.lowercaseString] indexOfObject:@pdf]; +if (index == NSNotFound) +return; +fileName = [fileName stringByAppendingPathComponent:[subfiles objectAtIndex:index]]; +} +} +} + NSFileHandle *fh = [NSFileHandle fileHandleForReadingAtPath:fileName]; // read the last 1024 bytes of the file (or entire file); Adobe's spec says they allow %%EOF anywhere in that range 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2772] trunk/SKDocument.m
Revision: 2772 http://skim-app.svn.sourceforge.net/skim-app/?rev=2772view=rev Author: hofman Date: 2007-08-29 09:23:04 -0700 (Wed, 29 Aug 2007) Log Message: --- First look at standard locations when reading a PDF bundle. Modified Paths: -- trunk/SKDocument.m Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-08-29 15:27:36 UTC (rev 2771) +++ trunk/SKDocument.m 2007-08-29 16:23:04 UTC (rev 2772) @@ -521,24 +521,29 @@ } else if ([docType isEqualToString:SKPDFBundleDocumentType]) { NSFileWrapper *fileWrapper = [[NSFileWrapper alloc] initWithPath:[absoluteURL path]]; NSDictionary *fileWrappers = [fileWrapper fileWrappers]; -NSData *notesData = nil; -NSEnumerator *nameEnum = [fileWrappers keyEnumerator]; -NSString *name; +NSArray *noteArray = nil; +NSFileWrapper *fw; -while (name = [nameEnum nextObject]) { -NSFileWrapper *fw = [fileWrappers objectForKey:name]; -if ([fw isRegularFile] == NO) -continue; -NSString *extension = [[fw filename] pathExtension]; -if ([name caseInsensitiveCompare:WRAPPER_PDF_FILENAME] == NSOrderedSame || (data == nil [extension caseInsensitiveCompare:@pdf] == NSOrderedSame)) { -if (data = [[fw regularFileContents] retain]) -pdfDoc = [[PDFDocument alloc] initWithData:data]; -} else if ([name caseInsensitiveCompare:WRAPPER_SKIM_FILENAME] == NSOrderedSame || (notesData == nil [extension caseInsensitiveCompare:@skim] == NSOrderedSame)) { -notesData = [fw regularFileContents]; -NSArray *array = [NSKeyedUnarchiver unarchiveObjectWithData:notesData]; -if (array) -[self setNoteDicts:array]; +if ((fw = [fileWrappers objectForKey:WRAPPER_PDF_FILENAME]) [fw isRegularFile]) +data = [[fw regularFileContents] retain]; +if ((fw = [fileWrappers objectForKey:WRAPPER_SKIM_FILENAME]) [fw isRegularFile] +(noteArray = [NSKeyedUnarchiver unarchiveObjectWithData:[fw regularFileContents]])) +[self setNoteDicts:noteArray]; +if (data == nil || noteArray == nil) { +NSArray *fws = [fileWrappers allValues]; +NSArray *extensions = [fws valueForKeyPath:@filename.pathExtension.lowercaseString]; +unsigned int index; +if (data == nil) { +index = [extensions indexOfObject:@pdf]; +if ((index != NSNotFound) (fw = [fws objectAtIndex:index]) [fw isRegularFile]) +data = [[fw regularFileContents] retain]; } +if (noteArray == nil) { +index = [extensions indexOfObject:@skim]; +if ((index != NSNotFound) (fw = [fws objectAtIndex:index]) [fw isRegularFile] +(noteArray = [NSKeyedUnarchiver unarchiveObjectWithData:[fw regularFileContents]])) +[self setNoteDicts:noteArray]; +} } [fileWrapper release]; } else if ([docType isEqualToString:SKPostScriptDocumentType]) { 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2773] trunk/SKDocument.m
Revision: 2773 http://skim-app.svn.sourceforge.net/skim-app/?rev=2773view=rev Author: hofman Date: 2007-08-29 09:47:30 -0700 (Wed, 29 Aug 2007) Log Message: --- Set PDFDocument when reading from a bundle. Also make sure the PDFData, PDFDocument and notes dictionaries are set to nil before loading. Modified Paths: -- trunk/SKDocument.m Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-08-29 16:23:04 UTC (rev 2772) +++ trunk/SKDocument.m 2007-08-29 16:47:30 UTC (rev 2773) @@ -452,6 +452,10 @@ PDFDocument *pdfDoc = nil; NSError *error = nil; +[self setPDFData:nil]; +[self setPDFDoc:nil]; +[self setNoteDicts:nil]; + if ([docType isEqualToString:SKPostScriptDocumentType]) { SKPSProgressController *progressController = [[[SKPSProgressController alloc] init] autorelease]; data = [progressController PDFDataWithPostScriptData:data]; @@ -481,6 +485,10 @@ PDFDocument *pdfDoc = nil; NSError *error = nil; +[self setPDFData:nil]; +[self setPDFDoc:nil]; +[self setNoteDicts:nil]; + if ([docType isEqualToString:SKPDFDocumentType]) { if ((data = [[NSData alloc] initWithContentsOfURL:absoluteURL options:NSUncachedRead error:error]) (pdfDoc = [[PDFDocument alloc] initWithURL:absoluteURL])) { @@ -524,25 +532,31 @@ NSArray *noteArray = nil; NSFileWrapper *fw; -if ((fw = [fileWrappers objectForKey:WRAPPER_PDF_FILENAME]) [fw isRegularFile]) +if ((fw = [fileWrappers objectForKey:WRAPPER_PDF_FILENAME]) [fw isRegularFile]) { data = [[fw regularFileContents] retain]; -if ((fw = [fileWrappers objectForKey:WRAPPER_SKIM_FILENAME]) [fw isRegularFile] -(noteArray = [NSKeyedUnarchiver unarchiveObjectWithData:[fw regularFileContents]])) -[self setNoteDicts:noteArray]; +pdfDoc = [[PDFDocument alloc] initWithURL:[NSURL fileURLWithPath:[[absoluteURL path] stringByAppendingPathComponent:[fw filename; +} +if ((fw = [fileWrappers objectForKey:WRAPPER_SKIM_FILENAME]) [fw isRegularFile]) { +if (noteArray = [NSKeyedUnarchiver unarchiveObjectWithData:[fw regularFileContents]]) +[self setNoteDicts:noteArray]; +} if (data == nil || noteArray == nil) { NSArray *fws = [fileWrappers allValues]; NSArray *extensions = [fws valueForKeyPath:@filename.pathExtension.lowercaseString]; unsigned int index; if (data == nil) { index = [extensions indexOfObject:@pdf]; -if ((index != NSNotFound) (fw = [fws objectAtIndex:index]) [fw isRegularFile]) +if ((index != NSNotFound) (fw = [fws objectAtIndex:index]) [fw isRegularFile]) { data = [[fw regularFileContents] retain]; +pdfDoc = [[PDFDocument alloc] initWithURL:[NSURL fileURLWithPath:[[absoluteURL path] stringByAppendingPathComponent:[fw filename; +} } if (noteArray == nil) { index = [extensions indexOfObject:@skim]; -if ((index != NSNotFound) (fw = [fws objectAtIndex:index]) [fw isRegularFile] -(noteArray = [NSKeyedUnarchiver unarchiveObjectWithData:[fw regularFileContents]])) -[self setNoteDicts:noteArray]; +if ((index != NSNotFound) (fw = [fws objectAtIndex:index]) [fw isRegularFile]) { +if (noteArray = [NSKeyedUnarchiver unarchiveObjectWithData:[fw regularFileContents]]) +[self setNoteDicts:noteArray]; +} } } [fileWrapper release]; 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2741] trunk/SKPDFView.m
Revision: 2741 http://skim-app.svn.sourceforge.net/skim-app/?rev=2741view=rev Author: hofman Date: 2007-08-28 05:25:36 -0700 (Tue, 28 Aug 2007) Log Message: --- Separate keydown events in code of SKPDFView for presentation and other modes. Modified Paths: -- trunk/SKPDFView.m Modified: trunk/SKPDFView.m === --- trunk/SKPDFView.m 2007-08-28 11:43:08 UTC (rev 2740) +++ trunk/SKPDFView.m 2007-08-28 12:25:36 UTC (rev 2741) @@ -888,62 +888,68 @@ NSString *characters = [theEvent charactersIgnoringModifiers]; unichar eventChar = [characters length] 0 ? [characters characterAtIndex:0] : 0; unsigned int modifiers = [theEvent modifierFlags] (NSCommandKeyMask | NSAlternateKeyMask | NSShiftKeyMask | NSControlKeyMask); -BOOL isPresentation = hasNavigation autohidesCursor; - if (isPresentation (eventChar == NSRightArrowFunctionKey) (modifiers == 0)) { -[self goToNextPage:self]; -} else if (isPresentation (eventChar == NSLeftArrowFunctionKey) (modifiers == 0)) { - [self goToPreviousPage:self]; -} else if (isPresentation (eventChar == 'p') (modifiers == 0)) { -[(SKMainWindowController *)[[self window] windowController] toggleLeftSidePane:self]; -} else if (isPresentation (eventChar == 'a') (modifiers == 0)) { -[(SKMainWindowController *)[[self window] windowController] toggleAutoActualSize:self]; - } else if ((eventChar == NSDeleteCharacter || eventChar == NSDeleteFunctionKey) (modifiers == 0)) { - [self delete:self]; -} else if (isPresentation == NO ([self toolMode] == SKTextToolMode || [self toolMode] == SKNoteToolMode) (eventChar == NSEnterCharacter || eventChar == NSFormFeedCharacter || eventChar == NSNewlineCharacter || eventChar == NSCarriageReturnCharacter) (modifiers == 0)) { -if (activeAnnotation activeAnnotation != editAnnotation) +if (hasNavigation autohidesCursor) { +// Presentation mode +if (eventChar == NSRightArrowFunctionKey modifiers == 0) { +[self goToNextPage:self]; +} else if ((eventChar == NSLeftArrowFunctionKey) (modifiers == 0)) { +[self goToPreviousPage:self]; +} else if ((eventChar == 'p') (modifiers == 0)) { +[(SKMainWindowController *)[[self window] windowController] toggleLeftSidePane:self]; +} else if ((eventChar == 'a') (modifiers == 0)) { +[(SKMainWindowController *)[[self window] windowController] toggleAutoActualSize:self]; +} else { +[super keyDown:theEvent]; +} +} else { +// Normal or fullscreen mode +if ((eventChar == NSDeleteCharacter || eventChar == NSDeleteFunctionKey) (modifiers == 0)) { +[self delete:self]; +} else if (([self toolMode] == SKTextToolMode || [self toolMode] == SKNoteToolMode) (eventChar == NSEnterCharacter || eventChar == NSFormFeedCharacter || eventChar == NSNewlineCharacter || eventChar == NSCarriageReturnCharacter) (modifiers == 0) activeAnnotation activeAnnotation != editAnnotation) { [self editActiveAnnotation:self]; -} else if (isPresentation == NO ([self toolMode] == SKTextToolMode || [self toolMode] == SKNoteToolMode) (eventChar == NSTabCharacter) (modifiers == NSAlternateKeyMask)) { -[self selectNextActiveAnnotation:self]; -// backtab is a bit inconsistent, it seems Shift+Tab gives a Shift-BackTab key event, I would have expected either Shift-Tab (as for the raw event) or BackTab (as for most shift-modified keys) -} else if (isPresentation == NO ([self toolMode] == SKTextToolMode || [self toolMode] == SKNoteToolMode) (((eventChar == NSBackTabCharacter) (modifiers == (NSAlternateKeyMask | NSShiftKeyMask))) || ((eventChar == NSBackTabCharacter) (modifiers == NSAlternateKeyMask)) || ((eventChar == NSTabCharacter) (modifiers == NSAlternateKeyMask { -[self selectPreviousActiveAnnotation:self]; - } else if (isPresentation == NO [activeAnnotation isNoteAnnotation] [activeAnnotation isMovable] (eventChar == NSRightArrowFunctionKey || eventChar == NSLeftArrowFunctionKey || eventChar == NSUpArrowFunctionKey || eventChar == NSDownArrowFunctionKey) (modifiers == 0 || modifiers == NSShiftKeyMask)) { -[self moveActiveAnnotationForKey:eventChar byAmount:(modifiers NSShiftKeyMask) ? 10.0 : 1.0]; - } else if (isPresentation == NO [activeAnnotation isNoteAnnotation] [activeAnnotation isResizable] (eventChar == NSRightArrowFunctionKey || eventChar == NSLeftArrowFunctionKey || eventChar == NSUpArrowFunctionKey || eventChar == NSDownArrowFunctionKey) (modifiers == NSControlKeyMask || modifiers == (NSControlKeyMask | NSShiftKeyMask))) { -[self resizeActiveAnnotationForKey:eventChar byAmount:(modifiers NSShiftKeyMask) ? 10.0 : 1.0]; -} else
[Skim-app-commit] SF.net SVN: skim-app: [2774] trunk/skimnotes.m
Revision: 2774 http://skim-app.svn.sourceforge.net/skim-app/?rev=2774view=rev Author: hofman Date: 2007-08-29 13:40:12 -0700 (Wed, 29 Aug 2007) Log Message: --- Don't write empty notes from command line tool. Write an error message to stderr when it fails. Modified Paths: -- trunk/skimnotes.m Modified: trunk/skimnotes.m === --- trunk/skimnotes.m 2007-08-29 16:47:30 UTC (rev 2773) +++ trunk/skimnotes.m 2007-08-29 20:40:12 UTC (rev 2774) @@ -89,6 +89,7 @@ NSString *pdfPath = SKNNormalizedPath([args objectAtIndex:offset], currentDir); NSString *notesPath = argc offset + 2 ? nil : SKNNormalizedPath([args objectAtIndex:offset + 1], currentDir); BOOL isDir = NO; +NSError *error = nil; if (action != SKNActionRemove notesPath == nil) { notesPath = [[pdfPath stringByDeletingPathExtension] stringByAppendingPathExtension:format == SKNFormatText ? @txt : format == SKNFormatRTF ? @rtf : @skim]; @@ -99,8 +100,8 @@ pdfPath = [pdfPath stringByAppendingPathExtension:@pdf]; if ([fm fileExistsAtPath:pdfPath isDirectory:isDir] == NO || isDir) { +error = [NSError errorWithDomain:NSPOSIXErrorDomain code:ENOENT userInfo:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@PDF file does not exist, @Error description), NSLocalizedDescriptionKey, nil]]; } else if (action == SKNActionGet) { -NSError *error = nil; NSData *data = nil; if (format == SKNFormatAuto) { NSString *extension = [notesPath pathExtension]; @@ -115,7 +116,7 @@ NSError *error = nil; data = [fm extendedAttributeNamed:SKIM_NOTES_KEY atPath:pdfPath traverseLink:YES error:error]; if (data == nil [error code] == ENOATTR) -data = [NSKeyedArchiver archivedDataWithRootObject:[NSArray array]]; +data = [NSData data]; } else if (format == SKNFormatText) { NSError *error = nil; NSString *string = [fm propertyListFromExtendedAttributeNamed:SKIM_TEXT_NOTES_KEY atPath:pdfPath traverseLink:YES error:error]; @@ -133,10 +134,15 @@ [(NSFileHandle *)[NSFileHandle fileHandleWithStandardOutput] writeData:data]; success = YES; } else { -if ([data length] || ([fm fileExistsAtPath:notesPath isDirectory:isDir] isDir == NO)) -success = [data writeToFile:notesPath atomically:YES]; -else +if ([data length]) { +success = [data writeToFile:notesPath options:NSAtomicWrite error:error]; +} else if ([fm fileExistsAtPath:notesPath isDirectory:isDir] isDir == NO) { +success = [fm removeFileAtPath:notesPath handler:nil]; +if (success = NO) +error = [NSError errorWithDomain:NSPOSIXErrorDomain code:EACCES userInfo:[NSDictionary dictionaryWithObjectsAndKeys:NSLocalizedString(@Unable to remove file, @Error description), NSLocalizedDescriptionKey, nil]]; +} else { success = YES; +} } } } else if (action == SKNActionSet notesPath ([notesPath isEqualToString:@-] || ([fm fileExistsAtPath:notesPath isDirectory:isDir] isDir == NO))) { @@ -147,9 +153,9 @@ else data = [NSData dataWithContentsOfFile:notesPath]; if (data) { -success = [fm removeExtendedAttribute:SKIM_NOTES_KEY atPath:pdfPath traverseLink:YES error:error]; -if ((success || [error code] == ENOATTR) [data length]) -success = [fm setExtendedAttributeNamed:SKIM_NOTES_KEY toValue:data atPath:pdfPath options:0 error:NULL]; +success = [fm removeExtendedAttribute:SKIM_NOTES_KEY atPath:pdfPath traverseLink:YES error:error] || [error code] == ENOATTR; +if (success [data length]) +success = [fm setExtendedAttributeNamed:SKIM_NOTES_KEY toValue:data atPath:pdfPath options:0 error:error]; } } else if (action == SKNActionRemove) { NSError *error = nil; @@ -165,6 +171,9 @@ success = success1 success2 success3; } +if (success == NO error) +[(NSFileHandle *)[NSFileHandle fileHandleWithStandardError] writeData:[[error localizedDescription] dataUsingEncoding:NSUTF8StringEncoding]]; + [pool release]; return success ? 0 : 1; 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy
[Skim-app-commit] SF.net SVN: skim-app: [2782] trunk
Revision: 2782 http://skim-app.svn.sourceforge.net/skim-app/?rev=2782view=rev Author: hofman Date: 2007-08-30 06:05:10 -0700 (Thu, 30 Aug 2007) Log Message: --- Implement double-click in find table, so you can go back to a selected item after manually moving in the document. Modified Paths: -- trunk/Dutch.lproj/MainWindow.nib/data.dependency trunk/Dutch.lproj/MainWindow.nib/info.nib trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib trunk/English.lproj/MainWindow.nib/info.nib trunk/English.lproj/MainWindow.nib/keyedobjects.nib trunk/French.lproj/MainWindow.nib/info.nib trunk/French.lproj/MainWindow.nib/keyedobjects.nib trunk/Italian.lproj/MainWindow.nib/info.nib trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib trunk/SKMainWindowController.m Modified: trunk/Dutch.lproj/MainWindow.nib/data.dependency === --- trunk/Dutch.lproj/MainWindow.nib/data.dependency2007-08-30 12:25:13 UTC (rev 2781) +++ trunk/Dutch.lproj/MainWindow.nib/data.dependency2007-08-30 13:05:10 UTC (rev 2782) @@ -5,7 +5,6 @@ keyIBPaletteDependency/key array stringPDFKit/string - stringControllers/string /array /dict /plist Modified: trunk/Dutch.lproj/MainWindow.nib/info.nib === --- trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-08-30 12:25:13 UTC (rev 2781) +++ trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-08-30 13:05:10 UTC (rev 2782) @@ -29,6 +29,10 @@ array integer208/integer /array + keyIBOpenObjects/key + array + integer224/integer + /array keyIBSystem Version/key string8R218/string /dict Modified: trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/English.lproj/MainWindow.nib/info.nib === --- trunk/English.lproj/MainWindow.nib/info.nib 2007-08-30 12:25:13 UTC (rev 2781) +++ trunk/English.lproj/MainWindow.nib/info.nib 2007-08-30 13:05:10 UTC (rev 2782) @@ -31,20 +31,20 @@ /array keyIBOpenObjects/key array + integer687/integer integer256/integer + integer314/integer + integer208/integer + integer553/integer integer633/integer - integer5/integer - integer224/integer - integer553/integer - integer694/integer - integer687/integer + integer585/integer + integer539/integer integer502/integer integer168/integer - integer539/integer - integer208/integer + integer5/integer integer511/integer - integer585/integer - integer314/integer + integer694/integer + integer224/integer /array keyIBSystem Version/key string8R218/string Modified: trunk/English.lproj/MainWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/French.lproj/MainWindow.nib/info.nib === --- trunk/French.lproj/MainWindow.nib/info.nib 2007-08-30 12:25:13 UTC (rev 2781) +++ trunk/French.lproj/MainWindow.nib/info.nib 2007-08-30 13:05:10 UTC (rev 2782) @@ -31,9 +31,10 @@ /array keyIBOpenObjects/key array - integer314/integer + integer224/integer integer256/integer integer502/integer + integer314/integer /array keyIBSystem Version/key string8R218/string Modified: trunk/French.lproj/MainWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/Italian.lproj/MainWindow.nib/info.nib === --- trunk/Italian.lproj/MainWindow.nib/info.nib 2007-08-30 12:25:13 UTC (rev 2781) +++ trunk/Italian.lproj/MainWindow.nib/info.nib 2007-08-30 13:05:10 UTC (rev 2782) @@ -31,19 +31,19 @@ /array keyIBOpenObjects/key array - integer168/integer + integer553/integer + integer208/integer integer314/integer integer511/integer - integer677/integer integer5/integer + integer168/integer + integer676/integer + integer224/integer + integer628/integer + integer256/integer integer539/integer
[Skim-app-commit] SF.net SVN: skim-app: [2783] trunk
Revision: 2783 http://skim-app.svn.sourceforge.net/skim-app/?rev=2783view=rev Author: hofman Date: 2007-08-30 06:24:18 -0700 (Thu, 30 Aug 2007) Log Message: --- Implement double-click in outline table, so you can go back to a selected item after manually moving in the document. Modified Paths: -- trunk/Dutch.lproj/MainWindow.nib/info.nib trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib trunk/English.lproj/MainWindow.nib/info.nib trunk/English.lproj/MainWindow.nib/keyedobjects.nib trunk/French.lproj/MainWindow.nib/info.nib trunk/French.lproj/MainWindow.nib/keyedobjects.nib trunk/Italian.lproj/MainWindow.nib/info.nib trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib trunk/SKMainWindowController.m Modified: trunk/Dutch.lproj/MainWindow.nib/info.nib === --- trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-08-30 13:05:10 UTC (rev 2782) +++ trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-08-30 13:24:18 UTC (rev 2783) @@ -32,6 +32,7 @@ keyIBOpenObjects/key array integer224/integer + integer502/integer /array keyIBSystem Version/key string8R218/string Modified: trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/English.lproj/MainWindow.nib/info.nib === --- trunk/English.lproj/MainWindow.nib/info.nib 2007-08-30 13:05:10 UTC (rev 2782) +++ trunk/English.lproj/MainWindow.nib/info.nib 2007-08-30 13:24:18 UTC (rev 2783) @@ -31,20 +31,20 @@ /array keyIBOpenObjects/key array - integer687/integer - integer256/integer - integer314/integer - integer208/integer + integer585/integer + integer511/integer integer553/integer - integer633/integer - integer585/integer - integer539/integer - integer502/integer integer168/integer + integer694/integer + integer314/integer integer5/integer - integer511/integer - integer694/integer + integer539/integer + integer687/integer + integer633/integer + integer208/integer + integer256/integer integer224/integer + integer502/integer /array keyIBSystem Version/key string8R218/string Modified: trunk/English.lproj/MainWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/French.lproj/MainWindow.nib/info.nib === --- trunk/French.lproj/MainWindow.nib/info.nib 2007-08-30 13:05:10 UTC (rev 2782) +++ trunk/French.lproj/MainWindow.nib/info.nib 2007-08-30 13:24:18 UTC (rev 2783) @@ -31,10 +31,10 @@ /array keyIBOpenObjects/key array - integer224/integer + integer314/integer integer256/integer integer502/integer - integer314/integer + integer224/integer /array keyIBSystem Version/key string8R218/string Modified: trunk/French.lproj/MainWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/Italian.lproj/MainWindow.nib/info.nib === --- trunk/Italian.lproj/MainWindow.nib/info.nib 2007-08-30 13:05:10 UTC (rev 2782) +++ trunk/Italian.lproj/MainWindow.nib/info.nib 2007-08-30 13:24:18 UTC (rev 2783) @@ -31,19 +31,19 @@ /array keyIBOpenObjects/key array - integer553/integer - integer208/integer + integer676/integer + integer511/integer integer314/integer - integer511/integer - integer5/integer - integer168/integer - integer676/integer integer224/integer + integer502/integer + integer539/integer + integer208/integer + integer677/integer integer628/integer + integer5/integer integer256/integer - integer539/integer - integer502/integer - integer677/integer + integer553/integer + integer168/integer /array keyIBSystem Version/key string8R218/string Modified: trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib
[Skim-app-commit] SF.net SVN: skim-app: [2802] trunk
Revision: 2802 http://skim-app.svn.sourceforge.net/skim-app/?rev=2802view=rev Author: hofman Date: 2007-09-01 10:45:59 -0700 (Sat, 01 Sep 2007) Log Message: --- Define method to find format popup in an NSView category. Modified Paths: -- trunk/SKDocument.h trunk/SKDocument.m trunk/SKPreferenceController.m Modified: trunk/SKDocument.h === --- trunk/SKDocument.h 2007-09-01 17:02:12 UTC (rev 2801) +++ trunk/SKDocument.h 2007-09-01 17:45:59 UTC (rev 2802) @@ -141,6 +141,11 @@ @end [EMAIL PROTECTED] NSView (SKExtensions) +- (id)subviewOfClass:(Class)aClass; [EMAIL PROTECTED] + + @interface NSTask (SKExtensions) + (BOOL)runTaskWithLaunchPath:(NSString *)launchPath arguments:(NSArray *)arguments currentDirectoryPath:(NSString *)directoryPath; @end Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-09-01 17:02:12 UTC (rev 2801) +++ trunk/SKDocument.m 2007-09-01 17:45:59 UTC (rev 2802) @@ -159,37 +159,23 @@ #pragma mark Document read/write -static NSPopUpButton *popUpButtonSubview(NSView *view) -{ - if ([view isKindOfClass:[NSPopUpButton class]]) - return (NSPopUpButton *)view; - - NSEnumerator *viewEnum = [[view subviews] objectEnumerator]; - NSView *subview; - NSPopUpButton *popup; - - while (subview = [viewEnum nextObject]) { - if (popup = popUpButtonSubview(subview)) - return popup; - } - return nil; -} - - (BOOL)prepareSavePanel:(NSSavePanel *)savePanel { if (exportUsingPanel) { -NSPopUpButton *formatPopup = popUpButtonSubview([savePanel accessoryView]); -NSString *lastExportedType = [[NSUserDefaults standardUserDefaults] stringForKey:@SKLastExportedType]; -if ([[self pdfDocument] allowsPrinting] == NO) { -int index = [formatPopup indexOfItemWithRepresentedObject:SKEmbeddedPDFDocumentType]; -if (index != -1) -[formatPopup removeItemAtIndex:index]; -} -if (formatPopup lastExportedType) { -int index = [formatPopup indexOfItemWithRepresentedObject:lastExportedType]; -if (index != -1 index != [formatPopup indexOfSelectedItem]) { -[formatPopup selectItemAtIndex:index]; -[formatPopup sendAction:[formatPopup action] to:[formatPopup target]]; +NSPopUpButton *formatPopup = [[savePanel accessoryView] subviewOfClass:[NSPopUpButton class]]; +if (formatPopup) { +NSString *lastExportedType = [[NSUserDefaults standardUserDefaults] stringForKey:@SKLastExportedType]; +if ([[self pdfDocument] allowsPrinting] == NO) { +int index = [formatPopup indexOfItemWithRepresentedObject:SKEmbeddedPDFDocumentType]; +if (index != -1) +[formatPopup removeItemAtIndex:index]; } +if (lastExportedType) { +int index = [formatPopup indexOfItemWithRepresentedObject:lastExportedType]; +if (index != -1 index != [formatPopup indexOfSelectedItem]) { +[formatPopup selectItemAtIndex:index]; +[formatPopup sendAction:[formatPopup action] to:[formatPopup target]]; +} +} } } return YES; @@ -1668,6 +1654,25 @@ @end [EMAIL PROTECTED] NSView (SKExtensions) + +- (id)subviewOfClass:(Class)aClass { + if ([self isKindOfClass:aClass]) + return self; + + NSEnumerator *viewEnum = [[self subviews] objectEnumerator]; + NSView *view, *subview; + + while (subview = [viewEnum nextObject]) { + if (view = [subview subviewOfClass:aClass]) + return view; + } + return nil; +} + [EMAIL PROTECTED] + + @implementation NSTask (SKExtensions) + (BOOL)runTaskWithLaunchPath:(NSString *)launchPath arguments:(NSArray *)arguments currentDirectoryPath:(NSString *)directoryPath { Modified: trunk/SKPreferenceController.m === --- trunk/SKPreferenceController.m 2007-09-01 17:02:12 UTC (rev 2801) +++ trunk/SKPreferenceController.m 2007-09-01 17:45:59 UTC (rev 2802) @@ -49,27 +49,27 @@ static NSString *SKTeXEditorArguments[] = {@-l %line \%file\, @+%line \%file\, @+%line \%file\, @--no-wait +%line \%file\, @--no-wait +%line \%file\, @\%file\ %line}; [EMAIL PROTECTED] NSView (SKExtensions) [EMAIL PROTECTED] NSView (SKPreferenceControllerExtensions) - (void)deactivateColorAndLineWells; @end [EMAIL PROTECTED] NSView (SKExtensions) [EMAIL PROTECTED] NSView (SKPreferenceControllerExtensions) - (void)deactivateColorAndLineWells { [[self subviews] makeObjectsPerformSelector:_cmd]; } @end [EMAIL PROTECTED
[Skim-app-commit] SF.net SVN: skim-app: [2825] trunk/SKDocument.m
Revision: 2825 http://skim-app.svn.sourceforge.net/skim-app/?rev=2825view=rev Author: hofman Date: 2007-09-04 08:32:08 -0700 (Tue, 04 Sep 2007) Log Message: --- Read PDF bundle data initially the way we write it, using the bundle's name for the content files. Modified Paths: -- trunk/SKDocument.m Modified: trunk/SKDocument.m === --- trunk/SKDocument.m 2007-09-04 12:24:29 UTC (rev 2824) +++ trunk/SKDocument.m 2007-09-04 15:32:08 UTC (rev 2825) @@ -520,37 +520,49 @@ } } else if ([docType isEqualToString:SKPDFBundleDocumentType]) { NSFileWrapper *fileWrapper = [[NSFileWrapper alloc] initWithPath:[absoluteURL path]]; +NSFileWrapper *pdfFW = nil; +NSFileWrapper *skimFW = nil; NSDictionary *fileWrappers = [fileWrapper fileWrappers]; NSArray *noteArray = nil; -NSFileWrapper *fw; +NSString *name = [[[absoluteURL path] lastPathComponent] stringByDeletingPathExtension]; +if ([name caseInsensitiveCompare:BUNDLE_DATA_FILENAME] == NSOrderedSame) +name = [name stringByAppendingString:@1]; -if ((fw = [fileWrappers objectForKey:BUNDLE_DATA_FILENAME]) [fw isRegularFile]) { -data = [[fw regularFileContents] retain]; -pdfDoc = [[PDFDocument alloc] initWithURL:[NSURL fileURLWithPath:[[absoluteURL path] stringByAppendingPathComponent:[fw filename; -} -if ((fw = [fileWrappers objectForKey:BUNDLE_DATA_FILENAME]) [fw isRegularFile]) { -if (noteArray = [NSKeyedUnarchiver unarchiveObjectWithData:[fw regularFileContents]]) -[self setNoteDicts:noteArray]; -} -if (data == nil || noteArray == nil) { +pdfFW = [fileWrappers objectForKey:[name stringByAppendingPathExtension:@pdf]]; +if ([pdfFW isRegularFile] == NO) +pdfFW = nil; +skimFW = [fileWrappers objectForKey:[name stringByAppendingPathExtension:@skim]]; +if ([skimFW isRegularFile] == NO) +skimFW = nil; +if (pdfFW == nil || skimFW == nil) { NSArray *fws = [fileWrappers allValues]; NSArray *extensions = [fws valueForKeyPath:@filename.pathExtension.lowercaseString]; unsigned int index; -if (data == nil) { +if (pdfFW == nil) { index = [extensions indexOfObject:@pdf]; -if ((index != NSNotFound) (fw = [fws objectAtIndex:index]) [fw isRegularFile]) { -data = [[fw regularFileContents] retain]; -pdfDoc = [[PDFDocument alloc] initWithURL:[NSURL fileURLWithPath:[[absoluteURL path] stringByAppendingPathComponent:[fw filename; +if (index != NSNotFound) { +pdfFW = [fws objectAtIndex:index]; +if ([pdfFW isRegularFile] == NO) +pdfFW = nil; } } -if (noteArray == nil) { +if (skimFW == nil) { index = [extensions indexOfObject:@skim]; -if ((index != NSNotFound) (fw = [fws objectAtIndex:index]) [fw isRegularFile]) { -if (noteArray = [NSKeyedUnarchiver unarchiveObjectWithData:[fw regularFileContents]]) -[self setNoteDicts:noteArray]; +if (index != NSNotFound) { +skimFW = [fws objectAtIndex:index]; +if ([skimFW isRegularFile] == NO) +skimFW = nil; } } } +if (pdfFW) { +data = [[pdfFW regularFileContents] retain]; +pdfDoc = [[PDFDocument alloc] initWithURL:[NSURL fileURLWithPath:[[absoluteURL path] stringByAppendingPathComponent:[pdfFW filename; +} +if (skimFW) { +if (noteArray = [NSKeyedUnarchiver unarchiveObjectWithData:[skimFW regularFileContents]]) +[self setNoteDicts:noteArray]; +} [fileWrapper release]; } else if ([docType isEqualToString:SKPostScriptDocumentType]) { if (data = [NSData dataWithContentsOfURL:absoluteURL options:NSUncachedRead error:error]) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit
[Skim-app-commit] SF.net SVN: skim-app: [2826] trunk
Revision: 2826 http://skim-app.svn.sourceforge.net/skim-app/?rev=2826view=rev Author: hofman Date: 2007-09-04 09:56:47 -0700 (Tue, 04 Sep 2007) Log Message: --- Add a convenience method to get the index of a page. Don't allow empty selection in outline. Modified Paths: -- trunk/Dutch.lproj/MainWindow.nib/info.nib trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib trunk/English.lproj/MainWindow.nib/info.nib trunk/English.lproj/MainWindow.nib/keyedobjects.nib trunk/French.lproj/MainWindow.nib/info.nib trunk/French.lproj/MainWindow.nib/keyedobjects.nib trunk/Italian.lproj/MainWindow.nib/info.nib trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib trunk/PDFPage_SKExtensions.h trunk/PDFPage_SKExtensions.m trunk/PDFSelection_SKExtensions.m trunk/SKDocument.m trunk/SKMainWindowController.m trunk/SKPDFAnnotationNote.m trunk/SKPDFView.m trunk/SKReadingBar.m trunk/SKSnapshotWindowController.m Modified: trunk/Dutch.lproj/MainWindow.nib/info.nib === --- trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-09-04 15:32:08 UTC (rev 2825) +++ trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-09-04 16:56:47 UTC (rev 2826) @@ -31,9 +31,9 @@ /array keyIBOpenObjects/key array - integer502/integer integer224/integer integer256/integer + integer502/integer /array keyIBSystem Version/key string8R218/string Modified: trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/English.lproj/MainWindow.nib/info.nib === --- trunk/English.lproj/MainWindow.nib/info.nib 2007-09-04 15:32:08 UTC (rev 2825) +++ trunk/English.lproj/MainWindow.nib/info.nib 2007-09-04 16:56:47 UTC (rev 2826) @@ -31,20 +31,20 @@ /array keyIBOpenObjects/key array - integer633/integer - integer502/integer - integer314/integer - integer224/integer + integer553/integer integer5/integer - integer553/integer integer694/integer + integer208/integer + integer314/integer + integer502/integer + integer633/integer + integer687/integer integer511/integer - integer687/integer - integer208/integer + integer256/integer + integer539/integer integer585/integer + integer224/integer integer168/integer - integer539/integer - integer256/integer /array keyIBSystem Version/key string8R218/string Modified: trunk/English.lproj/MainWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/French.lproj/MainWindow.nib/info.nib === --- trunk/French.lproj/MainWindow.nib/info.nib 2007-09-04 15:32:08 UTC (rev 2825) +++ trunk/French.lproj/MainWindow.nib/info.nib 2007-09-04 16:56:47 UTC (rev 2826) @@ -32,9 +32,9 @@ keyIBOpenObjects/key array integer314/integer - integer256/integer integer502/integer integer224/integer + integer256/integer /array keyIBSystem Version/key string8R218/string Modified: trunk/French.lproj/MainWindow.nib/keyedobjects.nib === (Binary files differ) Modified: trunk/Italian.lproj/MainWindow.nib/info.nib === --- trunk/Italian.lproj/MainWindow.nib/info.nib 2007-09-04 15:32:08 UTC (rev 2825) +++ trunk/Italian.lproj/MainWindow.nib/info.nib 2007-09-04 16:56:47 UTC (rev 2826) @@ -31,19 +31,19 @@ /array keyIBOpenObjects/key array + integer676/integer integer256/integer - integer539/integer - integer511/integer + integer5/integer integer208/integer integer224/integer - integer676/integer integer677/integer - integer5/integer + integer168/integer integer314/integer + integer539/integer + integer628/integer + integer511/integer integer502/integer integer553/integer - integer628/integer - integer168/integer /array keyIBSystem Version/key string8R218/string Modified
[Skim-app-commit] SF.net SVN: skim-app: [2833] trunk
Revision: 2833 http://skim-app.svn.sourceforge.net/skim-app/?rev=2833view=rev Author: hofman Date: 2007-09-05 05:51:37 -0700 (Wed, 05 Sep 2007) Log Message: --- Show a different message when type-select fails. Modified Paths: -- trunk/SKBookmarkController.m trunk/SKMainWindowController.m trunk/SKTypeSelectHelper.h trunk/SKTypeSelectHelper.m Modified: trunk/SKBookmarkController.m === --- trunk/SKBookmarkController.m2007-09-05 08:57:31 UTC (rev 2832) +++ trunk/SKBookmarkController.m2007-09-05 12:51:37 UTC (rev 2833) @@ -372,6 +372,10 @@ [tableView scrollRowToVisible:itemIndex]; } +- (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper didFailToFindMatchForSearchString:(NSString *)searchString { +[statusBar setLeftStringValue:[NSString stringWithFormat:NSLocalizedString(@No match: \[EMAIL PROTECTED], @Status message), searchString]]; +} + - (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper updateSearchString:(NSString *)searchString { NSString *message = @; if (searchString) Modified: trunk/SKMainWindowController.m === --- trunk/SKMainWindowController.m 2007-09-05 08:57:31 UTC (rev 2832) +++ trunk/SKMainWindowController.m 2007-09-05 12:51:37 UTC (rev 2833) @@ -3684,6 +3684,16 @@ } } +- (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper didFailToFindMatchForSearchString:(NSString *)searchString { +if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]] || [typeSelectHelper isEqual:[pdfView typeSelectHelper]]) { +[statusBar setLeftStringValue:[NSString stringWithFormat:NSLocalizedString(@No match: %@, @Status message), searchString]]; +} else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { +[statusBar setRightStringValue:[NSString stringWithFormat:NSLocalizedString(@No match: \[EMAIL PROTECTED], @Status message), searchString]]; +} else if ([typeSelectHelper isEqual:[outlineView typeSelectHelper]]) { +[statusBar setLeftStringValue:[NSString stringWithFormat:NSLocalizedString(@No match: \[EMAIL PROTECTED], @Status message), searchString]]; +} +} + - (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper updateSearchString:(NSString *)searchString { if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]] || [typeSelectHelper isEqual:[pdfView typeSelectHelper]]) { if (searchString) Modified: trunk/SKTypeSelectHelper.h === --- trunk/SKTypeSelectHelper.h 2007-09-05 08:57:31 UTC (rev 2832) +++ trunk/SKTypeSelectHelper.h 2007-09-05 12:51:37 UTC (rev 2833) @@ -88,6 +88,7 @@ - (unsigned int)typeSelectHelperCurrentlySelectedIndex:(SKTypeSelectHelper *)typeSelectHelper; // required - (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper selectItemAtIndex:(unsigned int)itemIndex; // required +- (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper didFailToFindMatchForSearchString:(NSString *)searchString; // optional - (void)typeSelectHelper:(SKTypeSelectHelper *)typeSelectHelper updateSearchString:(NSString *)searchString; // optional @end Modified: trunk/SKTypeSelectHelper.m === --- trunk/SKTypeSelectHelper.m 2007-09-05 08:57:31 UTC (rev 2832) +++ trunk/SKTypeSelectHelper.m 2007-09-05 12:51:37 UTC (rev 2833) @@ -234,9 +234,13 @@ foundIndex = [self indexOfMatchedItemAfterIndex:startIndex]; -// Avoid flashing a selection all over the place while you're still typing the thing you have selected -if (foundIndex != NSNotFound foundIndex != selectedIndex) +if (foundIndex == NSNotFound) { +if ([dataSource respondsToSelector:@selector(typeSelectHelper:didFailToFindMatchForSearchString:)]) +[dataSource typeSelectHelper:self didFailToFindMatchForSearchString:searchString]; +} else if (foundIndex != selectedIndex) { +// Avoid flashing a selection all over the place while you're still typing the thing you have selected [dataSource typeSelectHelper:self selectItemAtIndex:foundIndex]; +} } } 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https
[Skim-app-commit] SF.net SVN: skim-app: [2834] trunk
Revision: 2834 http://skim-app.svn.sourceforge.net/skim-app/?rev=2834view=rev Author: hofman Date: 2007-09-05 06:52:22 -0700 (Wed, 05 Sep 2007) Log Message: --- Allow non-ascii characters for type-select. Use the current keyWindow's field editor to compose text. Modified Paths: -- trunk/SKBookmarkController.m trunk/SKMainWindowController.m trunk/SKNotesDocument.m trunk/SKOutlineView.m trunk/SKPDFView.m trunk/SKTableView.m trunk/SKTypeSelectHelper.h trunk/SKTypeSelectHelper.m Modified: trunk/SKBookmarkController.m === --- trunk/SKBookmarkController.m2007-09-05 12:51:37 UTC (rev 2833) +++ trunk/SKBookmarkController.m2007-09-05 13:52:22 UTC (rev 2834) @@ -360,7 +360,7 @@ #pragma mark SKTypeSelectHelper datasource protocol - (NSArray *)typeSelectHelperSelectionItems:(SKTypeSelectHelper *)typeSelectHelper { -return [bookmarks valueForKeyPath:@label.lossyASCIIString]; +return [bookmarks valueForKey:@label]; } - (unsigned int)typeSelectHelperCurrentlySelectedIndex:(SKTypeSelectHelper *)typeSelectHelper { Modified: trunk/SKMainWindowController.m === --- trunk/SKMainWindowController.m 2007-09-05 12:51:37 UTC (rev 2833) +++ trunk/SKMainWindowController.m 2007-09-05 13:52:22 UTC (rev 2834) @@ -3648,7 +3648,7 @@ if ([typeSelectHelper isEqual:[thumbnailTableView typeSelectHelper]] || [typeSelectHelper isEqual:[pdfView typeSelectHelper]]) { return pageLabels; } else if ([typeSelectHelper isEqual:[noteOutlineView typeSelectHelper]]) { -return [[noteArrayController arrangedObjects] valueForKeyPath:@contents.lossyASCIIString]; +return [[noteArrayController arrangedObjects] valueForKey:@contents]; } else if ([typeSelectHelper isEqual:[outlineView typeSelectHelper]]) { int i, count = [outlineView numberOfRows]; NSMutableArray *array = [NSMutableArray arrayWithCapacity:count]; Modified: trunk/SKNotesDocument.m === --- trunk/SKNotesDocument.m 2007-09-05 12:51:37 UTC (rev 2833) +++ trunk/SKNotesDocument.m 2007-09-05 13:52:22 UTC (rev 2834) @@ -332,7 +332,7 @@ #pragma mark SKTypeSelectHelper datasource protocol - (NSArray *)typeSelectHelperSelectionItems:(SKTypeSelectHelper *)typeSelectHelper { -return [[arrayController arrangedObjects] valueForKeyPath:@contents.lossyASCIIString]; +return [[arrayController arrangedObjects] valueForKey:@contents]; } - (unsigned int)typeSelectHelperCurrentlySelectedIndex:(SKTypeSelectHelper *)typeSelectHelper { Modified: trunk/SKOutlineView.m === --- trunk/SKOutlineView.m 2007-09-05 12:51:37 UTC (rev 2833) +++ trunk/SKOutlineView.m 2007-09-05 13:52:22 UTC (rev 2834) @@ -91,9 +91,9 @@ unichar eventChar = [characters length] 0 ? [characters characterAtIndex:0] : 0; unsigned modifierFlags = [theEvent modifierFlags] NSDeviceIndependentModifierFlagsMask; -if ([typeSelectHelper isTypeSelectCharacter:eventChar] typeSelectHelper modifierFlags == 0) -[typeSelectHelper processKeyDownCharacter:eventChar]; -else if ([typeSelectHelper isRepeatCharacter:eventChar] modifierFlags == 0) +if ([typeSelectHelper isTypeSelectEvent:theEvent]) +[typeSelectHelper processKeyDownEvent:theEvent]; +else if ([typeSelectHelper isRepeatEvent:theEvent]) [typeSelectHelper repeatSearch]; else if (eventChar == NSHomeFunctionKey (modifierFlags ~NSFunctionKeyMask) == 0) [self scrollToBeginningOfDocument:nil]; @@ -103,6 +103,13 @@ [super keyDown:theEvent]; } +- (BOOL)resignFirstResponder { +BOOL shouldResign = [super resignFirstResponder]; +if (shouldResign) +[typeSelectHelper stopSearch]; +return shouldResign; +} + - (void)scrollToBeginningOfDocument:(id)sender { if ([self numberOfRows]) [self scrollRowToVisible:0]; Modified: trunk/SKPDFView.m === --- trunk/SKPDFView.m 2007-09-05 12:51:37 UTC (rev 2833) +++ trunk/SKPDFView.m 2007-09-05 13:52:22 UTC (rev 2834) @@ -952,9 +952,9 @@ [self setAnnotationMode:SKStrikeOutNote]; } else if ([self toolMode] == SKNoteToolMode modifiers == 0 eventChar == 'l') { [self setAnnotationMode:SKLineNote]; -} else if ([typeSelectHelper isTypeSelectCharacter:eventChar] modifiers == 0) { -[typeSelectHelper processKeyDownCharacter:eventChar]; -} else if ([typeSelectHelper isRepeatCharacter:eventChar] modifiers == 0) { +} else if ([typeSelectHelper isTypeSelectEvent:theEvent]) { +[typeSelectHelper processKeyDownEvent:theEvent]; +} else
[Skim-app-commit] SF.net SVN: skim-app: [2836] trunk
Revision: 2836 http://skim-app.svn.sourceforge.net/skim-app/?rev=2836view=rev Author: hofman Date: 2007-09-05 09:50:17 -0700 (Wed, 05 Sep 2007) Log Message: --- Revert last commit, as it disables type-select in the PDFView. Modified Paths: -- trunk/SKOutlineView.m trunk/SKPDFView.m trunk/SKTableView.m trunk/SKTypeSelectHelper.h trunk/SKTypeSelectHelper.m Modified: trunk/SKOutlineView.m === --- trunk/SKOutlineView.m 2007-09-05 16:11:40 UTC (rev 2835) +++ trunk/SKOutlineView.m 2007-09-05 16:50:17 UTC (rev 2836) @@ -91,9 +91,9 @@ unichar eventChar = [characters length] 0 ? [characters characterAtIndex:0] : 0; unsigned modifierFlags = [theEvent modifierFlags] NSDeviceIndependentModifierFlagsMask; -if ([typeSelectHelper isTypeSelectEvent:theEvent forView:self]) -[typeSelectHelper processKeyDownEvent:theEvent forView:self]; -else if ([typeSelectHelper isRepeatEvent:theEvent forView:self]) +if ([typeSelectHelper isTypeSelectEvent:theEvent]) +[typeSelectHelper processKeyDownEvent:theEvent]; +else if ([typeSelectHelper isRepeatEvent:theEvent]) [typeSelectHelper repeatSearch]; else if (eventChar == NSHomeFunctionKey (modifierFlags ~NSFunctionKeyMask) == 0) [self scrollToBeginningOfDocument:nil]; Modified: trunk/SKPDFView.m === --- trunk/SKPDFView.m 2007-09-05 16:11:40 UTC (rev 2835) +++ trunk/SKPDFView.m 2007-09-05 16:50:17 UTC (rev 2836) @@ -952,9 +952,9 @@ [self setAnnotationMode:SKStrikeOutNote]; } else if ([self toolMode] == SKNoteToolMode modifiers == 0 eventChar == 'l') { [self setAnnotationMode:SKLineNote]; -} else if ([typeSelectHelper isTypeSelectEvent:theEvent forView:self]) { -[typeSelectHelper processKeyDownEvent:theEvent forView:self]; -} else if ([typeSelectHelper isRepeatEvent:theEvent forView:self]) { +} else if ([typeSelectHelper isTypeSelectEvent:theEvent]) { +[typeSelectHelper processKeyDownEvent:theEvent]; +} else if ([typeSelectHelper isRepeatEvent:theEvent]) { [typeSelectHelper repeatSearch]; } else { [super keyDown:theEvent]; Modified: trunk/SKTableView.m === --- trunk/SKTableView.m 2007-09-05 16:11:40 UTC (rev 2835) +++ trunk/SKTableView.m 2007-09-05 16:50:17 UTC (rev 2836) @@ -69,9 +69,9 @@ unichar eventChar = [characters length] 0 ? [characters characterAtIndex:0] : 0; unsigned modifierFlags = [theEvent modifierFlags] NSDeviceIndependentModifierFlagsMask; -if ([typeSelectHelper isTypeSelectEvent:theEvent forView:self]) -[typeSelectHelper processKeyDownEvent:theEvent forView:self]; -else if ([typeSelectHelper isRepeatEvent:theEvent forView:self]) +if ([typeSelectHelper isTypeSelectEvent:theEvent]) +[typeSelectHelper processKeyDownEvent:theEvent]; +else if ([typeSelectHelper isRepeatEvent:theEvent]) [typeSelectHelper repeatSearch]; else if ((eventChar == NSDeleteCharacter || eventChar == NSDeleteFunctionKey) modifierFlags == 0 [self canDelete]) [self delete:self]; Modified: trunk/SKTypeSelectHelper.h === --- trunk/SKTypeSelectHelper.h 2007-09-05 16:11:40 UTC (rev 2835) +++ trunk/SKTypeSelectHelper.h 2007-09-05 16:50:17 UTC (rev 2836) @@ -76,12 +76,12 @@ - (void)rebuildTypeSelectSearchCache; -- (void)processKeyDownEvent:(NSEvent *)keyEvent forView:(NSView *)view; +- (void)processKeyDownEvent:(NSEvent *)keyEvent; - (void)repeatSearch; - (void)stopSearch; -- (BOOL)isTypeSelectEvent:(NSEvent *)keyEvent forView:(NSView *)view; -- (BOOL)isRepeatEvent:(NSEvent *)keyEvent forView:(NSView *)view; +- (BOOL)isTypeSelectEvent:(NSEvent *)keyEvent; +- (BOOL)isRepeatEvent:(NSEvent *)keyEvent; @end Modified: trunk/SKTypeSelectHelper.m === --- trunk/SKTypeSelectHelper.m 2007-09-05 16:11:40 UTC (rev 2835) +++ trunk/SKTypeSelectHelper.m 2007-09-05 16:50:17 UTC (rev 2836) @@ -139,28 +139,26 @@ searchCache = [[dataSource typeSelectHelperSelectionItems:self] retain]; } -- (void)processKeyDownEvent:(NSEvent *)keyEvent forView:(NSView *)view { -if ([self isTypeSelectEvent:keyEvent forView:view]) { -NSText *fieldEditor = [[view window] fieldEditor:YES forObject:self]; - -if (processing == NO) -[fieldEditor setString:@]; - -// Append the new character to the search string -[fieldEditor interpretKeyEvents:[NSArray arrayWithObject:keyEvent]]; -[self setSearchString:[fieldEditor string]]; - -if ([dataSource respondsToSelector