You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
(23) |
Apr
(254) |
May
(252) |
Jun
(209) |
Jul
(198) |
Aug
(192) |
Sep
(207) |
Oct
(120) |
Nov
(179) |
Dec
(52) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(48) |
Feb
(69) |
Mar
(129) |
Apr
(250) |
May
(113) |
Jun
(177) |
Jul
(228) |
Aug
(155) |
Sep
(218) |
Oct
(185) |
Nov
(109) |
Dec
(88) |
2009 |
Jan
(83) |
Feb
(39) |
Mar
(70) |
Apr
(47) |
May
(48) |
Jun
(67) |
Jul
(61) |
Aug
(97) |
Sep
(221) |
Oct
(141) |
Nov
(70) |
Dec
(61) |
2010 |
Jan
(45) |
Feb
(76) |
Mar
(178) |
Apr
(106) |
May
(57) |
Jun
(32) |
Jul
(64) |
Aug
(98) |
Sep
(96) |
Oct
(19) |
Nov
(34) |
Dec
(117) |
2011 |
Jan
(55) |
Feb
(48) |
Mar
(64) |
Apr
(21) |
May
(39) |
Jun
(53) |
Jul
(99) |
Aug
(56) |
Sep
(39) |
Oct
(26) |
Nov
(19) |
Dec
(69) |
2012 |
Jan
(17) |
Feb
(40) |
Mar
(17) |
Apr
|
May
(2) |
Jun
(8) |
Jul
(2) |
Aug
(10) |
Sep
(10) |
Oct
(38) |
Nov
(48) |
Dec
(70) |
2013 |
Jan
(43) |
Feb
(47) |
Mar
(39) |
Apr
(37) |
May
(25) |
Jun
(6) |
Jul
(20) |
Aug
(49) |
Sep
(33) |
Oct
(34) |
Nov
(75) |
Dec
(6) |
2014 |
Jan
(32) |
Feb
(10) |
Mar
(17) |
Apr
|
May
|
Jun
(26) |
Jul
(5) |
Aug
|
Sep
(4) |
Oct
(23) |
Nov
(80) |
Dec
(48) |
2015 |
Jan
(80) |
Feb
(50) |
Mar
(58) |
Apr
(20) |
May
(11) |
Jun
(16) |
Jul
(24) |
Aug
(27) |
Sep
(56) |
Oct
(30) |
Nov
(16) |
Dec
(6) |
2016 |
Jan
(31) |
Feb
(14) |
Mar
(23) |
Apr
(17) |
May
(40) |
Jun
(12) |
Jul
(17) |
Aug
(9) |
Sep
(32) |
Oct
(36) |
Nov
(23) |
Dec
(9) |
2017 |
Jan
(37) |
Feb
(23) |
Mar
(65) |
Apr
(22) |
May
(6) |
Jun
(3) |
Jul
|
Aug
|
Sep
(3) |
Oct
(22) |
Nov
(63) |
Dec
(71) |
2018 |
Jan
(83) |
Feb
(21) |
Mar
(35) |
Apr
(44) |
May
(14) |
Jun
(12) |
Jul
(8) |
Aug
(18) |
Sep
(10) |
Oct
(145) |
Nov
(144) |
Dec
(76) |
2019 |
Jan
(18) |
Feb
(28) |
Mar
(5) |
Apr
(208) |
May
(291) |
Jun
(158) |
Jul
(27) |
Aug
(8) |
Sep
(10) |
Oct
(83) |
Nov
(41) |
Dec
(31) |
2020 |
Jan
(16) |
Feb
(46) |
Mar
(100) |
Apr
(78) |
May
(69) |
Jun
(71) |
Jul
(28) |
Aug
(131) |
Sep
(176) |
Oct
(89) |
Nov
(147) |
Dec
(19) |
2021 |
Jan
(19) |
Feb
(25) |
Mar
(91) |
Apr
(98) |
May
(14) |
Jun
(44) |
Jul
(8) |
Aug
(3) |
Sep
(38) |
Oct
(57) |
Nov
(97) |
Dec
(74) |
2022 |
Jan
(89) |
Feb
(47) |
Mar
(15) |
Apr
(50) |
May
(54) |
Jun
(56) |
Jul
(80) |
Aug
(12) |
Sep
(11) |
Oct
(60) |
Nov
(48) |
Dec
(4) |
2023 |
Jan
(75) |
Feb
(49) |
Mar
(84) |
Apr
(24) |
May
(13) |
Jun
(74) |
Jul
(32) |
Aug
(66) |
Sep
(50) |
Oct
(38) |
Nov
(105) |
Dec
(181) |
2024 |
Jan
(21) |
Feb
(49) |
Mar
(77) |
Apr
(84) |
May
(20) |
Jun
(71) |
Jul
(53) |
Aug
(33) |
Sep
(54) |
Oct
(124) |
Nov
(151) |
Dec
(73) |
2025 |
Jan
(61) |
Feb
(17) |
Mar
(136) |
Apr
(72) |
May
(200) |
Jun
(238) |
Jul
(91) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ho...@us...> - 2007-04-24 17:41:42
|
Revision: 1900 http://skim-app.svn.sourceforge.net/skim-app/?rev=1900&view=rev Author: hofman Date: 2007-04-24 10:41:37 -0700 (Tue, 24 Apr 2007) Log Message: ----------- Modify help on saving default pdf view settings. Modified Paths: -------------- trunk/Dutch.lproj/Skim Help/skim.texi trunk/English.lproj/Skim Help/skim.texi Modified: trunk/Dutch.lproj/Skim Help/skim.texi =================================================================== --- trunk/Dutch.lproj/Skim Help/skim.texi 2007-04-24 17:26:16 UTC (rev 1899) +++ trunk/Dutch.lproj/Skim Help/skim.texi 2007-04-24 17:41:37 UTC (rev 1900) @@ -447,8 +447,13 @@ @itemize @item Om de huidige weergave-opties van een PDF-document te bewaren, kies Weergave > 'Gebruik de huidige weergaveinstellingen als standaard'. @end itemize +@itemize +@item Om de initi\x91le weergave-opties tot hun oorspronkelijke waarden te herstellen, kies Skim > Voorkeuren, kies Algemeen, en druk op de knop onder 'Herstel init\x91le weergaveinstellingen voor:'. +@end itemize @endbox +Standaard gebruikt de beeldvullende modus dezelfde weergave-instellingen als de normale modus. U kunt echter ook aparte weergave-opties voor beeldvullende modus gebruiken. Volg eenvoudigweg de instructies hierboven terwijl u in beeldschermvullende modus bent. Om de menubalk te zien, beweegt u de muis naar de bovenzijde van het scherm. + @heading Zie ook @menu * Pagina's in een PDF-bestand naast elkaar weergeven:: Modified: trunk/English.lproj/Skim Help/skim.texi =================================================================== --- trunk/English.lproj/Skim Help/skim.texi 2007-04-24 17:26:16 UTC (rev 1899) +++ trunk/English.lproj/Skim Help/skim.texi 2007-04-24 17:41:37 UTC (rev 1900) @@ -443,10 +443,15 @@ @box{taskbox} @itemize -@item To save the current display options of a document as the default to use for newly opened documents, select View > Use Current View Settings as Default +@item To save the current display options of a document as the default to use for newly opened documents, select View > Use Current View Settings as Default. @end itemize +@itemize +@item To revert the initial display settings to their original default values, choose Skim > Preferences, choose General, and press the button below 'Revert initial PDF view settings for:'. +@end itemize @endbox +By default, full screen mode uses the same view settings as normal mode. You can however also use separate PDF display options for full screen mode. Simply follow the instructions above while you are in full screen mode. To see the menu bar, move the mouse to the top of the screen. + @heading See also @menu * Viewing pages side-by-side:: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-24 17:27:06
|
Revision: 1899 http://skim-app.svn.sourceforge.net/skim-app/?rev=1899&view=rev Author: hofman Date: 2007-04-24 10:26:16 -0700 (Tue, 24 Apr 2007) Log Message: ----------- Allow setting separate initial view settings for full screen mode. By default the same settings as normal mode are used. Add buttons to pref pane to revert initial view settings. Modified Paths: -------------- trunk/Dutch.lproj/Localizable.strings trunk/Dutch.lproj/PreferenceWindow.nib/classes.nib trunk/Dutch.lproj/PreferenceWindow.nib/keyedobjects.nib trunk/English.lproj/Localizable.strings trunk/English.lproj/PreferenceWindow.nib/classes.nib trunk/English.lproj/PreferenceWindow.nib/keyedobjects.nib trunk/InitialUserDefaults.plist trunk/SKMainWindowController.h trunk/SKMainWindowController.m trunk/SKPreferenceController.h trunk/SKPreferenceController.m trunk/SKStringConstants.h trunk/SKStringConstants.m trunk/Skim.xcodeproj/project.pbxproj Modified: trunk/Dutch.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/Dutch.lproj/PreferenceWindow.nib/classes.nib =================================================================== --- trunk/Dutch.lproj/PreferenceWindow.nib/classes.nib 2007-04-24 15:09:56 UTC (rev 1898) +++ trunk/Dutch.lproj/PreferenceWindow.nib/classes.nib 2007-04-24 17:26:16 UTC (rev 1899) @@ -13,10 +13,14 @@ changeUpdateInterval = id; resetAll = id; resetCurrent = id; + revertFullScreenPDFViewSettings = id; + revertPDFViewSettings = id; }; CLASS = SKPreferenceController; LANGUAGE = ObjC; OUTLETS = { + revertFullScreenPDFSettingsButton = NSButton; + revertPDFSettingsButton = NSButton; snapshotSizeSlider = NSSlider; tabView = NSTabView; texEditorPopUpButton = NSPopUpButton; Modified: trunk/Dutch.lproj/PreferenceWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/Localizable.strings =================================================================== (Binary files differ) Modified: trunk/English.lproj/PreferenceWindow.nib/classes.nib =================================================================== --- trunk/English.lproj/PreferenceWindow.nib/classes.nib 2007-04-24 15:09:56 UTC (rev 1898) +++ trunk/English.lproj/PreferenceWindow.nib/classes.nib 2007-04-24 17:26:16 UTC (rev 1899) @@ -13,10 +13,14 @@ changeUpdateInterval = id; resetAll = id; resetCurrent = id; + revertFullScreenPDFViewSettings = id; + revertPDFViewSettings = id; }; CLASS = SKPreferenceController; LANGUAGE = ObjC; OUTLETS = { + revertFullScreenPDFSettingsButton = NSButton; + revertPDFSettingsButton = NSButton; snapshotSizeSlider = NSSlider; tabView = NSTabView; texEditorPopUpButton = NSPopUpButton; Modified: trunk/English.lproj/PreferenceWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/InitialUserDefaults.plist =================================================================== --- trunk/InitialUserDefaults.plist 2007-04-24 15:09:56 UTC (rev 1898) +++ trunk/InitialUserDefaults.plist 2007-04-24 17:26:16 UTC (rev 1899) @@ -24,6 +24,23 @@ <false/> <key>SKRememberLastPageViewed</key> <false/> + <key>SKDefaultPDFDisplaySettings</key> + <dict> + <key>scaleFactor</key> + <real>1.0</real> + <key>autoScales</key> + <false/> + <key>displaysPageBreaks</key> + <true/> + <key>displaysAsBook</key> + <false/> + <key>displayMode</key> + <integer>1</integer> + <key>displayBox</key> + <integer>1</integer> + </dict> + <key>SKDefaultFullScreenPDFDisplaySettings</key> + <dict/> <key>SKAutoSaveSkimNotes</key> <false/> <key>SKSearchHighlightColor</key> @@ -62,21 +79,6 @@ <string>LucidaGrande</string> <key>SKTextNoteFontSize</key> <real>11.0</real> - <key>SKDefaultPDFDisplaySettings</key> - <dict> - <key>scaleFactor</key> - <real>1.0</real> - <key>autoScales</key> - <false/> - <key>displaysPageBreaks</key> - <true/> - <key>displaysAsBook</key> - <false/> - <key>displayMode</key> - <integer>1</integer> - <key>displayBox</key> - <integer>1</integer> - </dict> <key>SKFreeTextNoteColor</key> <data> BAt0eXBlZHN0cmVhbYED6IQBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm @@ -136,6 +138,8 @@ <string>SKOpenFilesMaximized</string> <string>SKOpenContentsPaneOnlyForTOC</string> <string>SKRememberLastPageViewed</string> + <string>SKDefaultPDFDisplaySettings</string> + <string>SKDefaultFullScreenPDFDisplaySettings</string> <string>SKAutoSaveSkimNotes</string> <string>SKSnapshotsOnTop</string> <string>SUCheckAtStartup</string> @@ -181,7 +185,6 @@ <string>SKLastOpenFileNames</string> <string>SKLastToolMode</string> <string>SKBlankAllWindows</string> - <string>SKDefaultPDFDisplaySettings</string> </array> </dict> </dict> Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2007-04-24 15:09:56 UTC (rev 1898) +++ trunk/SKMainWindowController.h 2007-04-24 17:26:16 UTC (rev 1899) @@ -162,7 +162,7 @@ NSTimer *activityTimer; BOOL isPresentation; - SKPDFViewState savedState; + NSMutableDictionary *savedNormalSetup; float lastLeftSidePaneWidth; float lastRightSidePaneWidth; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-04-24 15:09:56 UTC (rev 1898) +++ trunk/SKMainWindowController.m 2007-04-24 17:26:16 UTC (rev 1899) @@ -126,6 +126,7 @@ lastViewedPages = [[NSMutableArray alloc] init]; // @@ remove or set to nil for Leopard? pdfOutlineItems = [[NSMutableArray alloc] init]; + savedNormalSetup = [[NSMutableDictionary alloc] init]; leftSidePaneState = SKOutlineSidePaneState; rightSidePaneState = SKNoteSidePaneState; temporaryAnnotations = CFSetCreateMutable(kCFAllocatorDefault, 0, &kCFTypeSetCallBacks); @@ -153,6 +154,7 @@ [mainWindow release]; [toolbarItems release]; [pdfOutlineItems release]; + [savedNormalSetup release]; [super dealloc]; } @@ -381,14 +383,13 @@ - (NSDictionary *)currentPDFSettings { NSMutableDictionary *setup = [NSMutableDictionary dictionary]; - [setup setObject:[NSNumber numberWithBool:[pdfView displaysPageBreaks]] forKey:@"displaysPageBreaks"]; - [setup setObject:[NSNumber numberWithBool:[pdfView displaysAsBook]] forKey:@"displaysAsBook"]; - [setup setObject:[NSNumber numberWithInt:[pdfView displayBox]] forKey:@"displayBox"]; if ([self isPresentation]) { - [setup setObject:[NSNumber numberWithFloat:savedState.scaleFactor] forKey:@"scaleFactor"]; - [setup setObject:[NSNumber numberWithBool:savedState.autoScales] forKey:@"autoScales"]; - [setup setObject:[NSNumber numberWithInt:savedState.displayMode] forKey:@"displayMode"]; + [setup setDictionary:savedNormalSetup]; + [setup removeObjectsForKeys:[NSArray arrayWithObjects:@"hasHorizontalScroller", @"hasVerticalScroller", @"autoHidesScrollers", nil]]; } else { + [setup setObject:[NSNumber numberWithBool:[pdfView displaysPageBreaks]] forKey:@"displaysPageBreaks"]; + [setup setObject:[NSNumber numberWithBool:[pdfView displaysAsBook]] forKey:@"displaysAsBook"]; + [setup setObject:[NSNumber numberWithInt:[pdfView displayBox]] forKey:@"displayBox"]; [setup setObject:[NSNumber numberWithFloat:[pdfView scaleFactor]] forKey:@"scaleFactor"]; [setup setObject:[NSNumber numberWithBool:[pdfView autoScales]] forKey:@"autoScales"]; [setup setObject:[NSNumber numberWithInt:[pdfView displayMode]] forKey:@"displayMode"]; @@ -1204,19 +1205,30 @@ UpdateSystemActivity(UsrActivity); } +- (void)saveNormalSetup { + if ([self isPresentation] == NO && [self isFullScreen] == NO) { + NSScrollView *scrollView = [[pdfView documentView] enclosingScrollView]; + [savedNormalSetup setDictionary:[self currentSetup]]; + [savedNormalSetup setObject:[NSNumber numberWithBool:[scrollView hasHorizontalScroller]] forKey:@"hasHorizontalScroller"]; + [savedNormalSetup setObject:[NSNumber numberWithBool:[scrollView hasVerticalScroller]] forKey:@"hasVerticalScroller"]; + [savedNormalSetup setObject:[NSNumber numberWithBool:[scrollView autohidesScrollers]] forKey:@"autohidesScrollers"]; + } + + NSDictionary *fullScreenSetup = [[NSUserDefaults standardUserDefaults] objectForKey:SKDefaultFullScreenPDFDisplaySettingsKey]; + if ([fullScreenSetup count]) + [self applyPDFSettings:fullScreenSetup]; +} + - (void)enterPresentationMode { NSScrollView *scrollView = [[pdfView documentView] enclosingScrollView]; + [self saveNormalSetup]; // Set up presentation mode - savedState.displayMode = [pdfView displayMode]; + [pdfView setAutoScales:YES]; [pdfView setDisplayMode:kPDFDisplaySinglePage]; - savedState.autoScales = [pdfView autoScales]; - savedState.scaleFactor = [pdfView scaleFactor]; - [pdfView setAutoScales:YES]; - savedState.hasHorizontalScroller = [scrollView hasHorizontalScroller]; + [pdfView setDisplayBox:kPDFDisplayBoxCropBox]; + [pdfView setDisplaysPageBreaks:YES]; [scrollView setNeverHasHorizontalScroller:YES]; - savedState.hasVerticalScroller = [scrollView hasVerticalScroller]; [scrollView setNeverHasVerticalScroller:YES]; - savedState.autoHidesScrollers = [scrollView autohidesScrollers]; [scrollView setAutohidesScrollers:YES]; if ([pdfView hasReadingBar]) @@ -1239,18 +1251,12 @@ activityTimer = nil; NSScrollView *scrollView = [[pdfView documentView] enclosingScrollView]; - [pdfView setDisplayMode:savedState.displayMode]; - if (savedState.autoScales) { - [pdfView setAutoScales:YES]; - } else { - [pdfView setAutoScales:NO]; - [pdfView setScaleFactor:savedState.scaleFactor]; - } - [scrollView setNeverHasHorizontalScroller:NO]; - [scrollView setHasHorizontalScroller:savedState.hasHorizontalScroller]; - [scrollView setNeverHasVerticalScroller:NO]; - [scrollView setHasVerticalScroller:savedState.hasVerticalScroller]; - [scrollView setAutohidesScrollers:savedState.autoHidesScrollers]; + [self applyPDFSettings:savedNormalSetup]; + [scrollView setNeverHasHorizontalScroller:NO]; + [scrollView setHasHorizontalScroller:[[savedNormalSetup objectForKey:@"hasHorizontalScroller"] boolValue]]; + [scrollView setNeverHasVerticalScroller:NO]; + [scrollView setHasVerticalScroller:[[savedNormalSetup objectForKey:@"hasVerticalScroller"] boolValue]]; + [scrollView setAutohidesScrollers:[[savedNormalSetup objectForKey:@"autoHidesScrollers"] boolValue]]; NSColor *backgroundColor = [NSUnarchiver unarchiveObjectWithData:[[NSUserDefaults standardUserDefaults] dataForKey:SKFullScreenBackgroundColorKey]]; [pdfView setBackgroundColor:backgroundColor]; @@ -1270,11 +1276,17 @@ if ([screen isEqual:[[NSScreen screens] objectAtIndex:0]]) SetSystemUIMode(kUIModeAllHidden, kUIOptionAutoShowMenuBar); + [self saveNormalSetup]; + if ([self isPresentation]) [self exitPresentationMode]; else [self goFullScreen]; + NSDictionary *fullScreenSetup = [[NSUserDefaults standardUserDefaults] dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey]; + if ([fullScreenSetup count]) + [self applyPDFSettings:fullScreenSetup]; + [pdfView setHasNavigation:YES autohidesCursor:NO]; [self showSideWindows]; } @@ -1316,7 +1328,9 @@ if ([self isPresentation]) [self exitPresentationMode]; - + else + [self applyPDFSettings:savedNormalSetup]; + SetSystemUIMode(kUIModeNormal, 0); [self removeFullScreen]; @@ -1411,7 +1425,10 @@ } - (IBAction)savePDFSettingToDefaults:(id)sender { - [[NSUserDefaults standardUserDefaults] setObject:[self currentPDFSettings] forKey:SKDefaultPDFDisplaySettingsKey]; + if ([self isFullScreen]) + [[NSUserDefaults standardUserDefaults] setObject:[self currentPDFSettings] forKey:SKDefaultFullScreenPDFDisplaySettingsKey]; + else if ([self isPresentation] == NO) + [[NSUserDefaults standardUserDefaults] setObject:[self currentPDFSettings] forKey:SKDefaultPDFDisplaySettingsKey]; } - (IBAction)printDocument:(id)sender{ @@ -3161,6 +3178,12 @@ else [menuItem setTitle:NSLocalizedString(@"Show Reading Bar", @"Menu item title")]; return YES; + } else if (action == @selector(savePDFSettingToDefaults:)) { + if ([self isFullScreen]) + [menuItem setTitle:NSLocalizedString(@"Use Current View Settings as Default for Full Screen", @"Menu item title")]; + else + [menuItem setTitle:NSLocalizedString(@"Use Current View Settings as Default", @"Menu item title")]; + return [self isPresentation] == NO; } return YES; } Modified: trunk/SKPreferenceController.h =================================================================== --- trunk/SKPreferenceController.h 2007-04-24 15:09:56 UTC (rev 1898) +++ trunk/SKPreferenceController.h 2007-04-24 17:26:16 UTC (rev 1899) @@ -44,6 +44,8 @@ IBOutlet NSSlider *thumbnailSizeSlider; IBOutlet NSSlider *snapshotSizeSlider; IBOutlet NSPopUpButton *texEditorPopUpButton; + IBOutlet NSButton *revertPDFSettingsButton; + IBOutlet NSButton *revertFullScreenPDFSettingsButton; NSMutableArray *fonts; NSMutableArray *sizes; NSMutableArray *texEditorCommands; @@ -63,6 +65,9 @@ - (IBAction)changeUpdateInterval:(id)sender; - (IBAction)changeTeXEditorPreset:(id)sender; +- (IBAction)revertPDFViewSettings:(id)sender; +- (IBAction)revertFullScreenPDFViewSettings:(id)sender; + - (IBAction)resetAll:(id)sender; - (IBAction)resetCurrent:(id)sender; Modified: trunk/SKPreferenceController.m =================================================================== --- trunk/SKPreferenceController.m 2007-04-24 15:09:56 UTC (rev 1898) +++ trunk/SKPreferenceController.m 2007-04-24 17:26:16 UTC (rev 1899) @@ -78,11 +78,16 @@ isCustomTeXEditor = [texEditorCommands containsObject:[[NSUserDefaults standardUserDefaults] stringForKey:SKTeXEditorCommandKey]] == NO || [texEditorArguments containsObject:[[NSUserDefaults standardUserDefaults] stringForKey:SKTeXEditorArgumentsKey]] == NO; + + [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKey:SKDefaultPDFDisplaySettingsKey]; + [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self forKey:SKDefaultFullScreenPDFDisplaySettingsKey]; } return self; } - (void)dealloc { + [[NSUserDefaultsController sharedUserDefaultsController] removeObserver:self forKey:SKDefaultPDFDisplaySettingsKey]; + [[NSUserDefaultsController sharedUserDefaultsController] removeObserver:self forKey:SKDefaultFullScreenPDFDisplaySettingsKey]; [resettableKeys release]; [fonts release]; [sizes release]; @@ -95,7 +100,15 @@ return @"PreferenceWindow"; } +- (void)updateRevertButtons { + NSDictionary *initialValues = [[NSUserDefaultsController sharedUserDefaultsController] initialValues]; + NSUserDefaults *sud = [NSUserDefaults standardUserDefaults]; + [revertPDFSettingsButton setEnabled:[[initialValues objectForKey:SKDefaultPDFDisplaySettingsKey] isEqual:[sud dictionaryForKey:SKDefaultPDFDisplaySettingsKey]] == NO]; + [revertFullScreenPDFSettingsButton setEnabled:[[initialValues objectForKey:SKDefaultFullScreenPDFDisplaySettingsKey] isEqual:[sud dictionaryForKey:SKDefaultFullScreenPDFDisplaySettingsKey]] == NO]; +} + - (void)windowDidLoad { + [self updateRevertButtons]; if (isCustomTeXEditor) { [texEditorPopUpButton selectItem:[texEditorPopUpButton lastItem]]; } else { @@ -154,6 +167,14 @@ } } +- (IBAction)revertPDFViewSettings:(id)sender { + [[NSUserDefaultsController sharedUserDefaultsController] revertToInitialValueForKey:SKDefaultPDFDisplaySettingsKey]; +} + +- (IBAction)revertFullScreenPDFViewSettings:(id)sender { + [[NSUserDefaultsController sharedUserDefaultsController] revertToInitialValueForKey:SKDefaultFullScreenPDFDisplaySettingsKey]; +} + - (void)resetSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { if (returnCode == NSAlertDefaultReturn) { NSString *tabID = (NSString *)contextInfo; @@ -195,4 +216,17 @@ contextInfo:[[tabView selectedTabViewItem] identifier]]; } +#pragma mark KVO + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { + if (object == [NSUserDefaultsController sharedUserDefaultsController] && [keyPath hasPrefix:@"values."]) { + NSString *key = [keyPath substringFromIndex:7]; + if ([key isEqualToString:SKDefaultPDFDisplaySettingsKey] || [key isEqualToString:SKDefaultFullScreenPDFDisplaySettingsKey]) { + [self updateRevertButtons]; + } + } else { + [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; + } +} + @end Modified: trunk/SKStringConstants.h =================================================================== --- trunk/SKStringConstants.h 2007-04-24 15:09:56 UTC (rev 1898) +++ trunk/SKStringConstants.h 2007-04-24 17:26:16 UTC (rev 1899) @@ -71,3 +71,4 @@ extern NSString *SKStrikeOutNoteColorKey; extern NSString *SKArrowNoteColorKey; extern NSString *SKDefaultPDFDisplaySettingsKey; +extern NSString *SKDefaultFullScreenPDFDisplaySettingsKey; Modified: trunk/SKStringConstants.m =================================================================== --- trunk/SKStringConstants.m 2007-04-24 15:09:56 UTC (rev 1898) +++ trunk/SKStringConstants.m 2007-04-24 17:26:16 UTC (rev 1899) @@ -72,3 +72,4 @@ NSString *SKStrikeOutNoteColorKey = @"SKStrikeOutNoteColor"; NSString *SKArrowNoteColorKey = @"SKArrowNoteColor"; NSString *SKDefaultPDFDisplaySettingsKey = @"SKDefaultPDFDisplaySettings"; +NSString *SKDefaultFullScreenPDFDisplaySettingsKey = @"SKDefaultFullScreenPDFDisplaySettings"; Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-04-24 15:09:56 UTC (rev 1898) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-04-24 17:26:16 UTC (rev 1899) @@ -64,14 +64,10 @@ CE15832E0BA0740000D5B03F /* ToolbarUnderlineNote.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CE15832A0BA073FF00D5B03F /* ToolbarUnderlineNote.tiff */; }; CE15832F0BA0740000D5B03F /* UnderlineNoteAdorn.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CE15832B0BA073FF00D5B03F /* UnderlineNoteAdorn.tiff */; }; CE1E25680BDA61E80011D9DD /* ReadNotesAccessoryView.nib in Resources */ = {isa = PBXBuildFile; fileRef = CE1E25660BDA61E80011D9DD /* ReadNotesAccessoryView.nib */; }; - CE1E2B280BDAB6180011D9DD /* SKPDFSynchronizer.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE1E2B260BDAB6180011D9DD /* SKPDFSynchronizer.h */; }; CE1E2B290BDAB6180011D9DD /* SKPDFSynchronizer.m in Sources */ = {isa = PBXBuildFile; fileRef = CE1E2B270BDAB6180011D9DD /* SKPDFSynchronizer.m */; }; - CE1E2E5F0BDB6C1F0011D9DD /* SKDisplayTeXLineCommand.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE1E2E5D0BDB6C1F0011D9DD /* SKDisplayTeXLineCommand.h */; }; CE1E2E600BDB6C1F0011D9DD /* SKDisplayTeXLineCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = CE1E2E5E0BDB6C1F0011D9DD /* SKDisplayTeXLineCommand.m */; }; CE1E2F130BDB86A20011D9DD /* displayline.sh in Resources */ = {isa = PBXBuildFile; fileRef = CE1E2F120BDB86A10011D9DD /* displayline.sh */; }; - CE1E301C0BDB9D5C0011D9DD /* NSScanner_SKExtensions.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE1E301A0BDB9D5C0011D9DD /* NSScanner_SKExtensions.h */; }; CE1E301D0BDB9D5C0011D9DD /* NSScanner_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE1E301B0BDB9D5C0011D9DD /* NSScanner_SKExtensions.m */; }; - CE1E30280BDB9D8E0011D9DD /* NSCharacterSet_SKExtensions.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE1E30260BDB9D8E0011D9DD /* NSCharacterSet_SKExtensions.h */; }; CE1E30290BDB9D8E0011D9DD /* NSCharacterSet_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE1E30270BDB9D8E0011D9DD /* NSCharacterSet_SKExtensions.m */; }; CE1E39E10BDBD6AC0011D9DD /* skimnotes in Resources */ = {isa = PBXBuildFile; fileRef = CEF3BF750B99CA2900E12E3D /* skimnotes */; }; CE2BD83E0BD4132B00A5F4DB /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE2BD82A0BD4132B00A5F4DB /* Sparkle.framework */; }; @@ -227,10 +223,6 @@ dstSubfolderSpec = 10; files = ( CE2BD8450BD4135600A5F4DB /* Sparkle.framework in CopyFiles */, - CE1E2B280BDAB6180011D9DD /* SKPDFSynchronizer.h in CopyFiles */, - CE1E2E5F0BDB6C1F0011D9DD /* SKDisplayTeXLineCommand.h in CopyFiles */, - CE1E301C0BDB9D5C0011D9DD /* NSScanner_SKExtensions.h in CopyFiles */, - CE1E30280BDB9D8E0011D9DD /* NSCharacterSet_SKExtensions.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-24 15:09:58
|
Revision: 1898 http://skim-app.svn.sourceforge.net/skim-app/?rev=1898&view=rev Author: hofman Date: 2007-04-24 08:09:56 -0700 (Tue, 24 Apr 2007) Log Message: ----------- Use full path for default tex editor command. Modified Paths: -------------- trunk/InitialUserDefaults.plist Modified: trunk/InitialUserDefaults.plist =================================================================== --- trunk/InitialUserDefaults.plist 2007-04-24 11:53:17 UTC (rev 1897) +++ trunk/InitialUserDefaults.plist 2007-04-24 15:09:56 UTC (rev 1898) @@ -120,7 +120,7 @@ <key>SKAutoCheckFileUpdate</key> <false/> <key>SKTeXEditorCommand</key> - <string>mate</string> + <string>/Applications/TextMate.app/Contents/Resources/mate</string> <key>SKTeXEditorArguments</key> <string>-l %line "%file"</string> <key>SUCheckAtStartup</key> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-24 11:53:19
|
Revision: 1897 http://skim-app.svn.sourceforge.net/skim-app/?rev=1897&view=rev Author: hofman Date: 2007-04-24 04:53:17 -0700 (Tue, 24 Apr 2007) Log Message: ----------- Consolidate and clean pdfsync code. Modified Paths: -------------- trunk/SKDisplayTeXLineCommand.m trunk/SKDocument.h trunk/SKDocument.m trunk/SKPDFSynchronizer.h trunk/SKPDFSynchronizer.m trunk/SKPDFView.h trunk/SKPDFView.m Modified: trunk/SKDisplayTeXLineCommand.m =================================================================== --- trunk/SKDisplayTeXLineCommand.m 2007-04-23 23:03:55 UTC (rev 1896) +++ trunk/SKDisplayTeXLineCommand.m 2007-04-24 11:53:17 UTC (rev 1897) @@ -38,6 +38,8 @@ #import "SKDisplayTeXLineCommand.h" #import "SKDocument.h" +#import "SKPDFSynchronizer.h" +#import "SKPDFView.h" @implementation SKDisplayTeXLineCommand @@ -81,14 +83,17 @@ else if ([[file pathExtension] caseInsensitiveCompare:@"pdf"] != NSOrderedSame) fileURL = [NSURL fileURLWithPath:[[file stringByDeletingPathExtension] stringByAppendingPathExtension:@"pdf"]]; - if (source == nil || fileURL == nil) - return nil; - NSLog(@"%@ %@ %@",lineNumber,fileURL,source); - SKDocument *document = [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:fileURL display:YES error:NULL]; - - [document displayTeXLine:[lineNumber intValue] fromFile:source]; + if (fileURL && source && [[NSFileManager defaultManager] fileExistsAtPath:source]) { + SKDocument *document = [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:fileURL display:YES error:NULL]; + SKPDFSynchronizer *synchronizer = [document synchronizer]; + unsigned int pageIndex; + NSPoint point; + + if ([synchronizer getPageIndex:&pageIndex location:&point forLine:[lineNumber intValue] inFile:source]) + [[document pdfView] displayLineAtPoint:point inPageAtIndex:pageIndex]; + } - return nil; + return nil; } @end Modified: trunk/SKDocument.h =================================================================== --- trunk/SKDocument.h 2007-04-23 23:03:55 UTC (rev 1896) +++ trunk/SKDocument.h 2007-04-24 11:53:17 UTC (rev 1897) @@ -91,8 +91,6 @@ - (void)checkFileUpdateStatus:(NSTimer *)timer; - (SKPDFSynchronizer *)synchronizer; -- (void)displayTeXLine:(int)line fromFile:(NSString *)file; -- (void)displayTeXEditorForLocation:(NSPoint)location inRect:(NSRect)rect atPageIndex:(unsigned int)pageIndex; - (void)handleApplicationWillTerminateNotification:(NSNotification *)notification; - (void)handleWindowWillCloseNotification:(NSNotification *)notification; Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-04-23 23:03:55 UTC (rev 1896) +++ trunk/SKDocument.m 2007-04-24 11:53:17 UTC (rev 1897) @@ -588,94 +588,22 @@ #pragma mark Pdfsync support +- (void)setFileURL:(NSURL *)absoluteURL { + [super setFileURL:absoluteURL]; + if ([absoluteURL isFileURL]) + [synchronizer setFileName:[[[absoluteURL path] stringByDeletingPathExtension] stringByAppendingPathExtension:@"pdfsync"]]; + else + [synchronizer setFileName:nil]; +} + - (SKPDFSynchronizer *)synchronizer { - if (synchronizer == nil) + if (synchronizer == nil) { synchronizer = [[SKPDFSynchronizer alloc] init]; + [synchronizer setFileName:[[[self fileName] stringByDeletingPathExtension] stringByAppendingPathExtension:@"pdfsync"]]; + } return synchronizer; } -- (void)displayTeXLine:(int)line fromFile:(NSString *)file { - NSString *pdfsyncFile = [[[self fileName] stringByDeletingPathExtension] stringByAppendingPathExtension:@"pdfsync"]; - NSString *texFile = file; - NSFileManager *fm = [NSFileManager defaultManager]; - - if ([[file pathExtension] length] == 0) - texFile = [file stringByAppendingPathExtension:@"tex"]; - else if ([[file pathExtension] caseInsensitiveCompare:@"tex"] != NSOrderedSame) - texFile = [[file stringByDeletingPathExtension] stringByAppendingPathExtension:@"tex"]; - - if ([fm fileExistsAtPath:pdfsyncFile] == NO || [fm fileExistsAtPath:texFile] == NO) { - NSBeep(); - return; - } - - if ([[self synchronizer] parsePdfsyncFileIfNeeded:pdfsyncFile]) { - unsigned int pageIndex; - NSPoint point; - - if ([[self synchronizer] getPageIndex:&pageIndex location:&point forLine:line inFile:texFile]) { - PDFPage *page = [[[self pdfView] document] pageAtIndex:pageIndex]; - PDFSelection *sel = [page selectionForLineAtPoint:point]; - NSRect rect = sel ? [sel boundsForPage:page] : NSMakeRect(point.x - 5.0, point.y - 5.0, 10.0, 10.0); - - if (sel) - [[self pdfView] setCurrentSelection:sel]; - [[self pdfView] scrollRect:rect inPageToVisible:page]; - } else NSBeep(); - } else NSBeep(); -} - -- (void)showEditorForFile:(NSString *)file atLine:(unsigned int)line { - NSTask *task = [[[NSTask alloc] init] autorelease]; - NSString *editorCmd = [[NSUserDefaults standardUserDefaults] objectForKey:SKTeXEditorCommandKey]; - NSMutableString *argString = [[[NSUserDefaults standardUserDefaults] objectForKey:SKTeXEditorArgumentsKey] mutableCopy]; - NSArray *arguments; - - [argString replaceOccurrencesOfString:@"%file" withString:file options:NSLiteralSearch range: NSMakeRange(0, [argString length] )]; - [argString replaceOccurrencesOfString:@"%line" withString:[NSString stringWithFormat:@"%d", line] options:NSLiteralSearch range:NSMakeRange(0, [argString length])]; - arguments = [argString shellScriptArgumentsArray]; - [argString release]; - - [task setCurrentDirectoryPath:[file stringByDeletingLastPathComponent]]; - [task setLaunchPath:editorCmd]; - [task setArguments:arguments]; - [task launch]; -} - -- (void)displayTeXEditorForLocation:(NSPoint)location inRect:(NSRect)rect atPageIndex:(unsigned int)pageIndex { - NSString *fileBase = [[self fileName] stringByDeletingPathExtension]; - NSString *pdfsyncFile = [fileBase stringByAppendingPathExtension:@"pdfsync"]; - NSFileManager *fm = [NSFileManager defaultManager]; - - if ([fm fileExistsAtPath:pdfsyncFile] == NO) { - NSLog(@"pdfsync file %@ doesn't exist", pdfsyncFile); - NSBeep(); - return; - } - - if ([[self synchronizer] parsePdfsyncFileIfNeeded:pdfsyncFile]) { - NSString *file; - int line; - - if ([[self synchronizer] getLine:&line file:&file forLocation:location inRect:rect atPageIndex:pageIndex]) { - if ([fm fileExistsAtPath:file] == NO) { - NSLog(@"tex file %@ doesn't exist", file); - NSBeep(); - return; - } - - [self showEditorForFile:file atLine:line]; - - } else { - NSLog(@"Couldn't find file and line"); - NSBeep(); - } - } else { - NSLog(@"Parsing pdfsync file %@ failed", pdfsyncFile); - NSBeep(); - } -} - #pragma mark Accessors - (SKMainWindowController *)mainWindowController { Modified: trunk/SKPDFSynchronizer.h =================================================================== --- trunk/SKPDFSynchronizer.h 2007-04-23 23:03:55 UTC (rev 1896) +++ trunk/SKPDFSynchronizer.h 2007-04-24 11:53:17 UTC (rev 1897) @@ -41,17 +41,24 @@ @interface SKPDFSynchronizer : NSObject { NSString *fileName; + NSDate *lastModDate; NSMutableArray *pages; NSMutableDictionary *lines; - NSMutableDictionary *records; - int version; - NSDate *lastModDate; } -- (BOOL)parsePdfsyncFile:(NSString *)filePath; -- (BOOL)parsePdfsyncFileIfNeeded:(NSString *)path; +- (NSString *)fileName; +- (void)setFileName:(NSString *)newFileName; +- (BOOL)parsePdfsyncFile; +- (BOOL)parsePdfsyncFileIfNeeded; + - (BOOL)getLine:(int *)line file:(NSString **)file forLocation:(NSPoint)point inRect:(NSRect)rect atPageIndex:(unsigned int)pageIndex; - (BOOL)getPageIndex:(unsigned int *)pageIndex location:(NSPoint *)point forLine:(int)line inFile:(NSString *)file; @end + + +@interface NSMutableDictionary (SKExtensions) +- (void)setIntValue:(int)value forKey:(id)key; +- (void)setFloatValue:(float)value forKey:(id)key; +@end Modified: trunk/SKPDFSynchronizer.m =================================================================== --- trunk/SKPDFSynchronizer.m 2007-04-23 23:03:55 UTC (rev 1896) +++ trunk/SKPDFSynchronizer.m 2007-04-24 11:53:17 UTC (rev 1897) @@ -50,8 +50,6 @@ if (self = [super init]) { pages = [[NSMutableArray alloc] init]; lines = [[NSMutableDictionary alloc] init]; - records = [[NSMutableDictionary alloc] init]; - version = 0; fileName = nil; lastModDate = nil; } @@ -61,61 +59,88 @@ - (void)dealloc { [pages release]; [lines release]; - [records release]; [fileName release]; [lastModDate release]; [super dealloc]; } +- (NSString *)fileName { + return [[fileName retain] autorelease]; +} -- (BOOL)parsePdfsyncFileIfNeeded:(NSString *)path { +- (void)setFileName:(NSString *)newFileName { + if (fileName != newFileName) { + if ([fileName isEqualToString:newFileName] == NO && lastModDate) { + [lastModDate release]; + lastModDate = nil; + } + [fileName release]; + fileName = [newFileName retain]; + } +} + +- (BOOL)parsePdfsyncFileIfNeeded { NSFileManager *fm = [NSFileManager defaultManager]; - NSDate *modDate = [[fm fileAttributesAtPath:path traverseLink:NO] fileModificationDate]; - if ([fm fileExistsAtPath:path] == NO) + if (fileName == nil || [fm fileExistsAtPath:fileName] == NO) return NO; - if (lastModDate == nil || [path isEqualToString:fileName] == NO || [modDate compare:lastModDate] == NSOrderedDescending) - return [self parsePdfsyncFile:path]; + NSDate *modDate = [[fm fileAttributesAtPath:fileName traverseLink:NO] fileModificationDate]; + + if (lastModDate == nil || [modDate compare:lastModDate] == NSOrderedDescending) + return [self parsePdfsyncFile]; return YES; } -- (BOOL)parsePdfsyncFile:(NSString *)path { +static NSString *SKTeXSourceFile(NSString *file, NSString *base) { + if ([[file pathExtension] caseInsensitiveCompare:@"tex"] != NSOrderedSame) + file = [file stringByAppendingPathExtension:@"tex"]; + if ([file hasPrefix:@"/"] == NO) + file = [base stringByAppendingPathComponent:file]; + return file; +} + +static NSMutableDictionary *SKRecordForRecordIndex(NSMutableDictionary *records, int recordIndex) { + NSNumber *recordNumber = [[NSNumber alloc] initWithInt:recordIndex]; + NSMutableDictionary *record = [records objectForKey:recordNumber]; + if (record == nil) { + record = [[NSMutableDictionary alloc] initWithObjectsAndKeys:recordNumber, @"recordIndex", nil]; + [records setObject:record forKey:recordNumber]; + [record release]; + } + [recordNumber release]; + return record; +} + +- (BOOL)parsePdfsyncFile { NSFileManager *fm = [NSFileManager defaultManager]; [pages removeAllObjects]; [lines removeAllObjects]; - if ([fm fileExistsAtPath:path] == NO) + if ([fm fileExistsAtPath:fileName] == NO) return NO; [lastModDate release]; - lastModDate = [[[fm fileAttributesAtPath:path traverseLink:NO] fileModificationDate] retain]; + lastModDate = [[[fm fileAttributesAtPath:fileName traverseLink:NO] fileModificationDate] retain]; - [fileName release]; - fileName = [path retain]; - NSString *basePath = [fileName stringByDeletingLastPathComponent]; + NSMutableDictionary *records = [NSMutableDictionary dictionary]; NSMutableArray *files = [NSMutableArray array]; NSString *pdfsyncString = [NSString stringWithContentsOfFile:fileName encoding:NSUTF8StringEncoding error:NULL]; NSString *file; - int recordIndex, line, column; + int recordIndex, line; float x, y; NSMutableDictionary *record; NSMutableArray *array; - NSNumber *recordNumber; - NSNumber *lineNumber; - NSNumber *pageNumber; - NSNumber *xNumber; - NSNumber *yNumber; + NSScanner *scanner; + unichar ch; if ([pdfsyncString length] == 0) return NO; - NSScanner *scanner = [[NSScanner alloc] initWithString:pdfsyncString]; - unichar ch; - + scanner = [[NSScanner alloc] initWithString:pdfsyncString]; [scanner setCharactersToBeSkipped:[NSCharacterSet whitespaceCharacterSet]]; if ([scanner scanUpToCharactersFromSet:[NSCharacterSet newlineCharacterSet] intoString:&file] == NO || @@ -124,18 +149,16 @@ return NO; } - if ([[file pathExtension] caseInsensitiveCompare:@"tex"] != NSOrderedSame) - file = [file stringByAppendingPathExtension:@"tex"]; - - file = [basePath stringByAppendingPathComponent:file]; + file = SKTeXSourceFile(file, basePath); [files addObject:file]; array = [[NSMutableArray alloc] init]; [lines setObject:array forKey:file]; [array release]; + // we ignore the version if ([scanner scanString:@"version" intoString:NULL] == NO || - [scanner scanInt:&version] == NO) { + [scanner scanInt:NULL] == NO) { [scanner release]; return NO; } @@ -148,64 +171,46 @@ if (ch == 'l') { if ([scanner scanInt:&recordIndex] && [scanner scanInt:&line]) { - [scanner scanInt:&column]; - recordNumber = [[NSNumber alloc] initWithInt:recordIndex]; - lineNumber = [[NSNumber alloc] initWithInt:line]; - record = [records objectForKey:recordNumber]; - if (record == nil) { - record = [[NSMutableDictionary alloc] init]; - [records setObject:record forKey:recordNumber]; - [record release]; - } + // we ignore the column + [scanner scanInt:NULL]; + record = SKRecordForRecordIndex(records, recordIndex); [record setObject:file forKey:@"file"]; - [record setObject:lineNumber forKey:@"line"]; + [record setIntValue:line forKey:@"line"]; [[lines objectForKey:file] addObject:record]; - [lineNumber release]; - [recordNumber release]; } } else if (ch == 'p') { + // we ignore * and + modifiers [scanner scanString:@"*" intoString:NULL] || [scanner scanString:@"+" intoString:NULL]; if ([scanner scanInt:&recordIndex] && [scanner scanFloat:&x] && [scanner scanFloat:&y]) { - recordNumber = [[NSNumber alloc] initWithInt:recordIndex]; - pageNumber = [[NSNumber alloc] initWithUnsignedInt:[pages count] - 1]; - xNumber = [[NSNumber alloc] initWithFloat:x / 65536 + pdfOffset.x]; - yNumber = [[NSNumber alloc] initWithFloat:y / 65536 + pdfOffset.y]; - record = [records objectForKey:recordNumber]; - if (record == nil) { - record = [[NSMutableDictionary alloc] initWithObjectsAndKeys:recordNumber, @"recordIndex", nil]; - [records setObject:record forKey:recordNumber]; - [record release]; - } - [record setObject:pageNumber forKey:@"page"]; - [record setObject:xNumber forKey:@"x"]; - [record setObject:yNumber forKey:@"y"]; + record = SKRecordForRecordIndex(records, recordIndex); + [record setIntValue:[pages count] - 1 forKey:@"page"]; + [record setFloatValue:x / 65536 + pdfOffset.x forKey:@"x"]; + [record setFloatValue:y / 65536 + pdfOffset.y forKey:@"y"]; [[pages lastObject] addObject:record]; - [pageNumber release]; - [xNumber release]; - [yNumber release]; - [recordNumber release]; } } else if (ch == 's') { + // start of a new page, the scanned integer should always equal [pages count]+1 [scanner scanInt:NULL]; array = [[NSMutableArray alloc] init]; [pages addObject:array]; [array release]; } else if (ch == '(') { + // start of a new source file if ([scanner scanUpToCharactersFromSet:[NSCharacterSet newlineCharacterSet] intoString:&file]) { - if ([[file pathExtension] caseInsensitiveCompare:@"tex"] != NSOrderedSame) - file = [file stringByAppendingPathExtension:@"tex"]; - file = [basePath stringByAppendingPathComponent:file]; + file = SKTeXSourceFile(file, basePath); [files addObject:file]; - record = [lines objectForKey:file]; - if (record == nil) { + if ([lines objectForKey:file] == nil) { array = [[NSMutableArray alloc] init]; [lines setObject:array forKey:file]; [array release]; } } } else if (ch == ')') { - [files removeLastObject]; - file = [files lastObject]; + // closing of a source file + if ([files count]) { + [files removeLastObject]; + file = [files lastObject]; + } } [scanner scanUpToCharactersFromSet:[NSCharacterSet newlineCharacterSet] intoString:NULL]; @@ -217,23 +222,18 @@ NSSortDescriptor *lineSortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"line" ascending:YES] autorelease]; NSSortDescriptor *xSortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"x" ascending:YES] autorelease]; NSSortDescriptor *ySortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"y" ascending:NO] autorelease]; - NSEnumerator *e; - NSArray *sortDescriptors; - e = [lines objectEnumerator]; - sortDescriptors = [NSArray arrayWithObjects:lineSortDescriptor, nil]; - while (array = [e nextObject]) - [array sortUsingDescriptors:sortDescriptors]; + [[lines allValues] makeObjectsPerformSelector:@selector(sortUsingDescriptors:) + withObject:[NSArray arrayWithObjects:lineSortDescriptor, nil]]; + [pages makeObjectsPerformSelector:@selector(sortUsingDescriptors:) + withObject:[NSArray arrayWithObjects:ySortDescriptor, xSortDescriptor, nil]]; - e = [pages objectEnumerator]; - sortDescriptors = [NSArray arrayWithObjects:ySortDescriptor, xSortDescriptor, nil]; - while (array = [e nextObject]) - [array sortUsingDescriptors:sortDescriptors]; - return YES; } - (BOOL)getLine:(int *)line file:(NSString **)file forLocation:(NSPoint)point inRect:(NSRect)rect atPageIndex:(unsigned int)pageIndex { + if ([self parsePdfsyncFileIfNeeded] == NO) + return NO; if (pageIndex >= [pages count]) return NO; @@ -290,9 +290,9 @@ if (record) { if (line) - *line = [record objectForKey:@"line"] ? [[record objectForKey:@"line"] intValue] : -1; + *line = [[record objectForKey:@"line"] intValue]; if (file) - *file = [record objectForKey:@"file"] ? [record objectForKey:@"file"] : nil; + *file = [record objectForKey:@"file"]; return YES; } else { if (line) @@ -304,6 +304,8 @@ } - (BOOL)getPageIndex:(unsigned int *)pageIndex location:(NSPoint *)point forLine:(int)line inFile:(NSString *)file { + if ([self parsePdfsyncFileIfNeeded] == NO) + return NO; if (line < 0 || file == nil || [lines objectForKey:file] == nil) return NO; @@ -347,9 +349,9 @@ if (record) { if (pageIndex) - *pageIndex = [record objectForKey:@"page"] ? [[record objectForKey:@"page"] unsignedIntValue] : NSNotFound; + *pageIndex = [[record objectForKey:@"page"] unsignedIntValue]; if (point) - *point = [record objectForKey:@"x"] ? NSMakePoint([[record objectForKey:@"x"] floatValue], [[record objectForKey:@"y"] floatValue]) : NSZeroPoint; + *point = NSMakePoint([[record objectForKey:@"x"] floatValue], [[record objectForKey:@"y"] floatValue]); return YES; } else { if (pageIndex) @@ -361,3 +363,20 @@ } @end + + +@implementation NSMutableDictionary (SKExtensions) + +- (void)setIntValue:(int)value forKey:(id)key { + NSNumber *number = [[NSNumber alloc] initWithInt:value]; + [self setValue:number forKey:key]; + [number release]; +} + +- (void)setFloatValue:(float)value forKey:(id)key { + NSNumber *number = [[NSNumber alloc] initWithFloat:value]; + [self setValue:number forKey:key]; + [number release]; +} + +@end Modified: trunk/SKPDFView.h =================================================================== --- trunk/SKPDFView.h 2007-04-23 23:03:55 UTC (rev 1896) +++ trunk/SKPDFView.h 2007-04-24 11:53:17 UTC (rev 1897) @@ -119,6 +119,7 @@ - (void)selectPreviousActiveAnnotation:(id)sender; - (void)scrollAnnotationToVisible:(PDFAnnotation *)annotation; - (void)scrollRect:(NSRect)rect inPageToVisible:(PDFPage *)page; +- (void)displayLineAtPoint:(NSPoint)point inPageAtIndex:(unsigned int)pageIndex; - (void)takeSnapshot:(id)sender; Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-23 23:03:55 UTC (rev 1896) +++ trunk/SKPDFView.m 2007-04-24 11:53:17 UTC (rev 1897) @@ -1282,6 +1282,18 @@ [self scrollRect:[annotation bounds] inPageToVisible:[annotation page]]; } +- (void)displayLineAtPoint:(NSPoint)point inPageAtIndex:(unsigned int)pageIndex { + if (pageIndex < [[self document] pageCount]) { + PDFPage *page = [[self document] pageAtIndex:pageIndex]; + PDFSelection *sel = [page selectionForLineAtPoint:point]; + NSRect rect = sel ? [sel boundsForPage:page] : NSMakeRect(point.x - 5.0, point.y - 5.0, 10.0, 10.0); + + if (sel) + [self setCurrentSelection:sel]; + [self scrollRect:rect inPageToVisible:page]; + } +} + #pragma mark Snapshots - (void)takeSnapshot:(id)sender { @@ -1315,6 +1327,8 @@ [controller showSnapshotAtPageNumber:[[self document] indexForPage:page] forRect:[self convertRect:rect toPage:page] factor:1]; } +#pragma mark Notification handling + - (void)handleAnnotationWillChangeNotification:(NSNotification *)notification { PDFAnnotation *annotation = [notification object]; if ([[[annotation page] document] isEqual:[self document]] && [[[notification userInfo] objectForKey:@"key"] isEqualToString:@"bounds"]) @@ -1353,7 +1367,7 @@ [self doAutohide:autohidesCursor || hasNavigation]; } -#pragma mark FullScreen navigation and autohide +#pragma mark Menu validation - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { SEL action = [menuItem action]; @@ -2595,14 +2609,40 @@ } - (void)pdfsyncWithEvent:(NSEvent *)theEvent { - NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - PDFPage *page = [self pageForPoint:mouseLoc nearest:YES]; - NSPoint location = [self convertPoint:mouseLoc toPage:page]; - unsigned int pageIndex = [[self document] indexForPage:page]; - PDFSelection *sel = [page selectionForLineAtPoint:location]; - NSRect rect = sel ? [sel boundsForPage:page] : NSMakeRect(location.x - 20.0, location.y - 5.0, 40.0, 10.0); + SKDocument *document = (SKDocument *)[[[self window] windowController] document]; - [(SKDocument *)[[[self window] windowController] document] displayTeXEditorForLocation:location inRect:rect atPageIndex:pageIndex]; + if ([document respondsToSelector:@selector(synchronizer)]) { + + SKPDFSynchronizer *synchronizer = [document synchronizer]; + NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; + PDFPage *page = [self pageForPoint:mouseLoc nearest:YES]; + NSPoint location = [self convertPoint:mouseLoc toPage:page]; + unsigned int pageIndex = [[self document] indexForPage:page]; + PDFSelection *sel = [page selectionForLineAtPoint:location]; + NSRect rect = sel ? [sel boundsForPage:page] : NSMakeRect(location.x - 20.0, location.y - 5.0, 40.0, 10.0); + NSString *file = nil; + int line = -1; + + if ([synchronizer getLine:&line file:&file forLocation:location inRect:rect atPageIndex:pageIndex] && + [[NSFileManager defaultManager] fileExistsAtPath:file]) { + + NSTask *task = [[[NSTask alloc] init] autorelease]; + NSString *editorCmd = [[NSUserDefaults standardUserDefaults] objectForKey:SKTeXEditorCommandKey]; + NSMutableString *argString = [[[NSUserDefaults standardUserDefaults] objectForKey:SKTeXEditorArgumentsKey] mutableCopy]; + NSArray *arguments; + + [argString replaceOccurrencesOfString:@"%file" withString:file options:NSLiteralSearch range: NSMakeRange(0, [argString length] )]; + [argString replaceOccurrencesOfString:@"%line" withString:[NSString stringWithFormat:@"%d", line] options:NSLiteralSearch range:NSMakeRange(0, [argString length])]; + arguments = [argString shellScriptArgumentsArray]; + [argString release]; + + [task setCurrentDirectoryPath:[file stringByDeletingLastPathComponent]]; + [task setLaunchPath:editorCmd]; + [task setArguments:arguments]; + [task launch]; + + } else NSBeep(); + } } @end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-23 23:03:56
|
Revision: 1896 http://skim-app.svn.sourceforge.net/skim-app/?rev=1896&view=rev Author: hofman Date: 2007-04-23 16:03:55 -0700 (Mon, 23 Apr 2007) Log Message: ----------- Revert back to using full path to bundle for tex editors, because it does not require an installation of the editor tools. Modified Paths: -------------- trunk/SKPreferenceController.m Modified: trunk/SKPreferenceController.m =================================================================== --- trunk/SKPreferenceController.m 2007-04-23 21:16:57 UTC (rev 1895) +++ trunk/SKPreferenceController.m 2007-04-23 23:03:55 UTC (rev 1896) @@ -73,7 +73,7 @@ [NSNumber numberWithFloat:14.0], [NSNumber numberWithFloat:16.0], [NSNumber numberWithFloat:18.0], [NSNumber numberWithFloat:20.0], [NSNumber numberWithFloat:24.0], [NSNumber numberWithFloat:28.0], [NSNumber numberWithFloat:32.0], [NSNumber numberWithFloat:48.0], [NSNumber numberWithFloat:64.0], nil]; - texEditorCommands = [[NSMutableArray alloc] initWithObjects:@"mate", @"bbedit", @"edit", @"/Applications/Emacs.app/Contents/MacOS/bin/emacsclient", nil]; + texEditorCommands = [[NSMutableArray alloc] initWithObjects:@"/Applications/TextMate.app/Contents/Resources/mate", @"/Applications/BBEdit.app/Contents/Resources/bbedit", @"/Applications/TextWrangler.app/Contents/Resources/edit", @"/Applications/Emacs.app/Contents/MacOS/bin/emacsclient", nil]; texEditorArguments = [[NSMutableArray alloc] initWithObjects:@"-l %line \"%file\"", @"+%line \"%file\"", @"+%line \"%file\"", @"--no-wait +%line \"%file\"", nil]; isCustomTeXEditor = [texEditorCommands containsObject:[[NSUserDefaults standardUserDefaults] stringForKey:SKTeXEditorCommandKey]] == NO || This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-23 21:16:58
|
Revision: 1895 http://skim-app.svn.sourceforge.net/skim-app/?rev=1895&view=rev Author: hofman Date: 2007-04-23 14:16:57 -0700 (Mon, 23 Apr 2007) Log Message: ----------- No need to use script from some tex editor bundles. Modified Paths: -------------- trunk/InitialUserDefaults.plist trunk/SKPreferenceController.m Modified: trunk/InitialUserDefaults.plist =================================================================== --- trunk/InitialUserDefaults.plist 2007-04-23 20:06:27 UTC (rev 1894) +++ trunk/InitialUserDefaults.plist 2007-04-23 21:16:57 UTC (rev 1895) @@ -120,7 +120,7 @@ <key>SKAutoCheckFileUpdate</key> <false/> <key>SKTeXEditorCommand</key> - <string>/Applications/TextMate.app/Contents/SharedSupport/Support/bin/mate</string> + <string>mate</string> <key>SKTeXEditorArguments</key> <string>-l %line "%file"</string> <key>SUCheckAtStartup</key> Modified: trunk/SKPreferenceController.m =================================================================== --- trunk/SKPreferenceController.m 2007-04-23 20:06:27 UTC (rev 1894) +++ trunk/SKPreferenceController.m 2007-04-23 21:16:57 UTC (rev 1895) @@ -73,7 +73,7 @@ [NSNumber numberWithFloat:14.0], [NSNumber numberWithFloat:16.0], [NSNumber numberWithFloat:18.0], [NSNumber numberWithFloat:20.0], [NSNumber numberWithFloat:24.0], [NSNumber numberWithFloat:28.0], [NSNumber numberWithFloat:32.0], [NSNumber numberWithFloat:48.0], [NSNumber numberWithFloat:64.0], nil]; - texEditorCommands = [[NSMutableArray alloc] initWithObjects:@"/Applications/TextMate.app/Contents/SharedSupport/Support/bin/mate", @"/Applications/BBEdit.app/Contents/Resources/bbedit", @"/Applications/TextWrangler.app/Contents/Resources/edit", @"/Applications/Emacs.app/Contents/MacOS/bin/emacsclient", nil]; + texEditorCommands = [[NSMutableArray alloc] initWithObjects:@"mate", @"bbedit", @"edit", @"/Applications/Emacs.app/Contents/MacOS/bin/emacsclient", nil]; texEditorArguments = [[NSMutableArray alloc] initWithObjects:@"-l %line \"%file\"", @"+%line \"%file\"", @"+%line \"%file\"", @"--no-wait +%line \"%file\"", nil]; isCustomTeXEditor = [texEditorCommands containsObject:[[NSUserDefaults standardUserDefaults] stringForKey:SKTeXEditorCommandKey]] == NO || This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-23 20:06:33
|
Revision: 1894 http://skim-app.svn.sourceforge.net/skim-app/?rev=1894&view=rev Author: hofman Date: 2007-04-23 13:06:27 -0700 (Mon, 23 Apr 2007) Log Message: ----------- Only track rects for anchored notes and links for hover window. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-23 19:41:52 UTC (rev 1893) +++ trunk/SKPDFView.m 2007-04-23 20:06:27 UTC (rev 1894) @@ -1500,10 +1500,13 @@ unsigned j, jMax = [annotations count]; for (j = 0; j < jMax; j++) { PDFAnnotation *annotation = [annotations objectAtIndex:j]; - NSRect rect = NSIntersectionRect([self convertRect:[annotation bounds] fromPage:page], visibleRect); - if (NSIsEmptyRect(rect)) continue; - NSTrackingRectTag tag = [self addTrackingRect:rect owner:self userData:annotation assumeInside:NO]; - [hoverRects addObject:(id)tag]; + if ([[annotation type] isEqualToString:@"Note"] || [[annotation type] isEqualToString:@"Link"]) { + NSRect rect = NSIntersectionRect([self convertRect:[annotation bounds] fromPage:page], visibleRect); + if (NSIsEmptyRect(rect) == NO) { + NSTrackingRectTag tag = [self addTrackingRect:rect owner:self userData:annotation assumeInside:NO]; + [hoverRects addObject:(id)tag]; + } + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-23 19:41:54
|
Revision: 1893 http://skim-app.svn.sourceforge.net/skim-app/?rev=1893&view=rev Author: hofman Date: 2007-04-23 12:41:52 -0700 (Mon, 23 Apr 2007) Log Message: ----------- Fit new annotation in page. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-23 18:34:59 UTC (rev 1892) +++ trunk/SKPDFView.m 2007-04-23 19:41:52 UTC (rev 1893) @@ -967,6 +967,17 @@ bounds = NSMakeRect(point.x - 0.5 * defaultSize.width, point.y - 0.5 * defaultSize.height, defaultSize.width, defaultSize.height); } + // Make sure it fits in the page + NSRect pageBounds = [page boundsForBox:[self displayBox]]; + if (NSMaxX(bounds) > NSMaxX(pageBounds)) + bounds.origin.x = NSMaxX(pageBounds) - NSWidth(bounds); + if (NSMinX(bounds) < NSMinX(pageBounds)) + bounds.origin.x = NSMinX(pageBounds); + if (NSMaxY(bounds) > NSMaxY(pageBounds)) + bounds.origin.y = NSMaxY(pageBounds) - NSHeight(bounds); + if (NSMinY(bounds) < NSMinY(pageBounds)) + bounds.origin.y = NSMinY(pageBounds); + [self addAnnotationWithType:annotationType contents:text page:page bounds:bounds]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-23 18:35:30
|
Revision: 1892 http://skim-app.svn.sourceforge.net/skim-app/?rev=1892&view=rev Author: hofman Date: 2007-04-23 11:34:59 -0700 (Mon, 23 Apr 2007) Log Message: ----------- fix typo Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-23 18:34:40 UTC (rev 1891) +++ trunk/SKPDFView.m 2007-04-23 18:34:59 UTC (rev 1892) @@ -1727,7 +1727,7 @@ if (NSWidth(newBounds) < 7.0) { newBounds.size.width = 7.0; - newBounds.origin.x = floorf(0.5 * ((startPoint.x + endPoint.x) - 3.5); + newBounds.origin.x = floorf(0.5 * (startPoint.x + endPoint.x) - 3.5); } if (NSHeight(newBounds) < 7.0) { newBounds.size.height = 7.0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-23 18:34:48
|
Revision: 1891 http://skim-app.svn.sourceforge.net/skim-app/?rev=1891&view=rev Author: hofman Date: 2007-04-23 11:34:40 -0700 (Mon, 23 Apr 2007) Log Message: ----------- fix typo Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-23 18:23:01 UTC (rev 1890) +++ trunk/SKPDFView.m 2007-04-23 18:34:40 UTC (rev 1891) @@ -1727,7 +1727,7 @@ if (NSWidth(newBounds) < 7.0) { newBounds.size.width = 7.0; - newBounds.origin.x = floorf(0.5 * (startPoint.x + endPoint.x) - 3.5); + newBounds.origin.x = floorf(0.5 * ((startPoint.x + endPoint.x) - 3.5); } if (NSHeight(newBounds) < 7.0) { newBounds.size.height = 7.0; @@ -2106,7 +2106,7 @@ newBounds.origin.x = floorf(fmin(startPoint.x, endPoint.x)); newBounds.size.width = ceilf(fmax(endPoint.x, startPoint.x)) - NSMinX(newBounds); newBounds.origin.y = floorf(fmin(startPoint.y, endPoint.y)); - newBounds.size.height = ceilf(fmax(endPoint.y, startPoint.y)) - NSMinX(newBounds); + newBounds.size.height = ceilf(fmax(endPoint.y, startPoint.y)) - NSMinY(newBounds); if (NSWidth(newBounds) < 7.0) { newBounds.size.width = 7.0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-23 18:23:02
|
Revision: 1890 http://skim-app.svn.sourceforge.net/skim-app/?rev=1890&view=rev Author: hofman Date: 2007-04-23 11:23:01 -0700 (Mon, 23 Apr 2007) Log Message: ----------- Fix rounding issue when moving arrow end points. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-23 18:11:35 UTC (rev 1889) +++ trunk/SKPDFView.m 2007-04-23 18:23:01 UTC (rev 1890) @@ -1716,8 +1716,8 @@ break; } - endPoint.x = ceilf(endPoint.x) + 0.5; - endPoint.y = ceilf(endPoint.y) + 0.5; + endPoint.x = floorf(endPoint.x) + 0.5; + endPoint.y = floorf(endPoint.y) + 0.5; if (NSEqualPoints(endPoint, oldEndPoint) == NO) { newBounds.origin.x = floorf(fmin(startPoint.x, endPoint.x)); @@ -1725,13 +1725,13 @@ newBounds.origin.y = floorf(fmin(startPoint.y, endPoint.y)); newBounds.size.height = ceilf(fmax(endPoint.y, startPoint.y)) - NSMinY(newBounds); - if (NSWidth(newBounds) < 8.0) { - newBounds.size.width = 8.0; - newBounds.origin.x = floorf(0.5 * (startPoint.x + endPoint.x)) - 4.0; + if (NSWidth(newBounds) < 7.0) { + newBounds.size.width = 7.0; + newBounds.origin.x = floorf(0.5 * (startPoint.x + endPoint.x) - 3.5); } - if (NSHeight(newBounds) < 8.0) { - newBounds.size.height = 8.0; - newBounds.origin.y = floorf(0.5 * (startPoint.y + endPoint.y)) - 4.0; + if (NSHeight(newBounds) < 7.0) { + newBounds.size.height = 7.0; + newBounds.origin.y = floorf(0.5 * (startPoint.y + endPoint.y) - 3.5); } startPoint.x -= NSMinX(newBounds); @@ -2088,8 +2088,8 @@ startPoint.y = NSMaxY(pageBounds) - 0.5; else if (startPoint.y < NSMinY(pageBounds)) startPoint.y = NSMinY(pageBounds) + 0.5; - startPoint.x = ceilf(startPoint.x) + 0.5; - startPoint.y = ceilf(startPoint.y) + 0.5; + startPoint.x = floorf(startPoint.x) + 0.5; + startPoint.y = floorf(startPoint.y) + 0.5; } else { if (endPoint.x > NSMaxX(pageBounds)) endPoint.x = NSMaxX(pageBounds) - 0.5; @@ -2099,8 +2099,8 @@ endPoint.y = NSMaxY(pageBounds) - 0.5; else if (endPoint.y < NSMinY(pageBounds)) endPoint.y = NSMinY(pageBounds) + 0.5; - endPoint.x = ceilf(endPoint.x) + 0.5; - endPoint.y = ceilf(endPoint.y) + 0.5; + endPoint.x = floorf(endPoint.x) + 0.5; + endPoint.y = floorf(endPoint.y) + 0.5; } newBounds.origin.x = floorf(fmin(startPoint.x, endPoint.x)); @@ -2108,13 +2108,13 @@ newBounds.origin.y = floorf(fmin(startPoint.y, endPoint.y)); newBounds.size.height = ceilf(fmax(endPoint.y, startPoint.y)) - NSMinX(newBounds); - if (NSWidth(newBounds) < 8.0) { - newBounds.size.width = 8.0; - newBounds.origin.x = floorf(0.5 * (startPoint.x + endPoint.x)) - 4.0; + if (NSWidth(newBounds) < 7.0) { + newBounds.size.width = 7.0; + newBounds.origin.x = floorf(0.5 * (startPoint.x + endPoint.x) - 3.5); } - if (NSHeight(newBounds) < 8.0) { - newBounds.size.height = 8.0; - newBounds.origin.y = floorf(0.5 * (startPoint.y + endPoint.y)) - 4.0; + if (NSHeight(newBounds) < 7.0) { + newBounds.size.height = 7.0; + newBounds.origin.y = floorf(0.5 * (startPoint.y + endPoint.y) - 3.5); } startPoint.x -= NSMinX(newBounds); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-23 18:11:37
|
Revision: 1889 http://skim-app.svn.sourceforge.net/skim-app/?rev=1889&view=rev Author: hofman Date: 2007-04-23 11:11:35 -0700 (Mon, 23 Apr 2007) Log Message: ----------- Use half-integral positions for endpoint and startpoint of of line annotations. Modified Paths: -------------- trunk/SKPDFAnnotationNote.m trunk/SKPDFView.m Modified: trunk/SKPDFAnnotationNote.m =================================================================== --- trunk/SKPDFAnnotationNote.m 2007-04-23 17:17:39 UTC (rev 1888) +++ trunk/SKPDFAnnotationNote.m 2007-04-23 18:11:35 UTC (rev 1889) @@ -844,8 +844,8 @@ [self setColor:[NSUnarchiver unarchiveObjectWithData:[[NSUserDefaults standardUserDefaults] objectForKey:SKArrowNoteColorKey]]]; [self setStartLineStyle:kPDFLineStyleNone]; [self setEndLineStyle:kPDFLineStyleOpenArrow]; - [self setStartPoint:NSZeroPoint]; - [self setEndPoint:NSMakePoint(NSWidth(bounds), NSHeight(bounds))]; + [self setStartPoint:NSMakePoint(0.5, 0.5)]; + [self setEndPoint:NSMakePoint(NSWidth(bounds) - 0.5, NSHeight(bounds) - 0.5)]; } return self; } @@ -917,8 +917,8 @@ point.x -= NSMinX(bounds); point.y -= NSMinY(bounds); - return (fabs(point.x - startPoint.x) < 4.0 && fabs(point.y - startPoint.y) < 4.0) || - (fabs(point.x - endPoint.x) < 4.0 && fabs(point.y - endPoint.y) < 4.0); + return (fabs(point.x - startPoint.x) < 3.5 && fabs(point.y - startPoint.y) < 3.5) || + (fabs(point.x - endPoint.x) < 3.5 && fabs(point.y - endPoint.y) < 3.5); } } @@ -929,6 +929,16 @@ const Point *qdPoint = (const Point *)[inQDPointAsData bytes]; SKPDFView *pdfView = [[[self page] containingDocument] pdfView]; NSPoint newPoint = NSPointFromPoint(*qdPoint); + newPoint.x += 0.5; + newPoint.y += 0.5; + if (newPoint.x < 0.0) + newPoint.x = 0.5; + else if (newPoint.x > NSWidth([self bounds])) + newPoint.x = NSWidth([self bounds]) - 0.5; + if (newPoint.y < 0.0) + newPoint.y = 0.5; + else if (newPoint.y > NSHeight([self bounds])) + newPoint.y = NSHeight([self bounds]) - 0.5; [pdfView setNeedsDisplayForAnnotation:self]; [self setStartPoint:newPoint]; [pdfView setNeedsDisplayForAnnotation:self]; @@ -946,6 +956,16 @@ const Point *qdPoint = (const Point *)[inQDPointAsData bytes]; SKPDFView *pdfView = [[[self page] containingDocument] pdfView]; NSPoint newPoint = NSPointFromPoint(*qdPoint); + newPoint.x += 0.5; + newPoint.y += 0.5; + if (newPoint.x < 0.0) + newPoint.x = 0.5; + else if (newPoint.x > NSWidth([self bounds])) + newPoint.x = NSWidth([self bounds]) - 0.5; + if (newPoint.y < 0.0) + newPoint.y = 0.5; + else if (newPoint.y > NSHeight([self bounds])) + newPoint.y = NSHeight([self bounds]) - 0.5; [pdfView setNeedsDisplayForAnnotation:self]; [self setEndPoint:newPoint]; [pdfView setNeedsDisplayForAnnotation:self]; Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-23 17:17:39 UTC (rev 1888) +++ trunk/SKPDFView.m 2007-04-23 18:11:35 UTC (rev 1889) @@ -1374,8 +1374,7 @@ @implementation SKPDFView (Private) -- (NSRect)resizeThumbForRect:(NSRect) rect rotation:(int)rotation -{ +- (NSRect)resizeThumbForRect:(NSRect)rect rotation:(int)rotation { NSRect thumb = rect; float size = 8.0; @@ -1400,16 +1399,18 @@ return thumb; } -- (NSRect)resizeThumbForRect:(NSRect) rect point:(NSPoint)point -{ +- (NSRect)resizeThumbForRect:(NSRect)rect point:(NSPoint)point { NSRect thumb = rect; - float size = 8.0; + float size = 7.0; thumb.size = NSMakeSize(size, size); thumb.origin.x = NSMinX(rect) + point.x - 0.5 * size; thumb.origin.y = NSMinY(rect) + point.y - 0.5 * size; + thumb.origin.x = point.x > 0.5 * NSWidth(rect) ? floorf(NSMinX(thumb)) : ceilf(NSMinX(thumb)); + thumb.origin.y = point.y > 0.5 * NSHeight(rect) ? floorf(NSMinY(thumb)) : ceilf(NSMinY(thumb)); + return thumb; } @@ -1641,26 +1642,26 @@ if (eventChar == NSRightArrowFunctionKey) { endPoint.x += delta; if (endPoint.x > NSMaxX(pageBounds)) - endPoint.x = NSMaxX(pageBounds); + endPoint.x = NSMaxX(pageBounds) - 0.5; } else if (eventChar == NSLeftArrowFunctionKey) { endPoint.x -= delta; if (endPoint.x < NSMinX(pageBounds)) - endPoint.x = NSMinX(pageBounds); + endPoint.x = NSMinX(pageBounds) + 0.5; } else if (eventChar == NSUpArrowFunctionKey) { endPoint.y += delta; if (endPoint.y > NSMaxY(pageBounds)) - endPoint.y = NSMaxY(pageBounds); + endPoint.y = NSMaxY(pageBounds) - 0.5; } else if (eventChar == NSDownArrowFunctionKey) { endPoint.y -= delta; if (endPoint.y < NSMinY(pageBounds)) - endPoint.y = NSMinY(pageBounds); + endPoint.y = NSMinY(pageBounds) + 0.5; } break; case 90: if (eventChar == NSRightArrowFunctionKey) { endPoint.y += delta; if (endPoint.y > NSMaxY(pageBounds)) - endPoint.y = NSMaxY(pageBounds); + endPoint.y = NSMaxY(pageBounds) - 0.5; } else if (eventChar == NSLeftArrowFunctionKey) { endPoint.y -= delta; if (endPoint.y < NSMinY(pageBounds)) @@ -1672,57 +1673,57 @@ } else if (eventChar == NSDownArrowFunctionKey) { endPoint.x += delta; if (endPoint.x > NSMaxX(pageBounds)) - endPoint.x = NSMaxX(pageBounds); + endPoint.x = NSMaxX(pageBounds) - 0.5; } break; case 180: if (eventChar == NSRightArrowFunctionKey) { endPoint.x -= delta; - if (endPoint.x < NSMinX(bounds)) - endPoint.x = NSMinX(bounds); + if (endPoint.x < NSMinX(pageBounds)) + endPoint.x = NSMinX(pageBounds) + 0.5; } else if (eventChar == NSLeftArrowFunctionKey) { endPoint.x += delta; - if (endPoint.x > NSMaxX(bounds)) - endPoint.x = NSMaxX(bounds); + if (endPoint.x > NSMaxX(pageBounds)) + endPoint.x = NSMaxX(pageBounds) - 0.5; } else if (eventChar == NSUpArrowFunctionKey) { endPoint.y -= delta; - if (endPoint.y < NSMinY(bounds)) - endPoint.y = NSMinY(bounds); + if (endPoint.y < NSMinY(pageBounds)) + endPoint.y = NSMinY(pageBounds) + 0.5; } else if (eventChar == NSDownArrowFunctionKey) { endPoint.y += delta; - if (endPoint.y > NSMaxY(bounds)) - endPoint.y = NSMaxY(bounds); + if (endPoint.y > NSMaxY(pageBounds)) + endPoint.y = NSMaxY(pageBounds) - 0.5; } break; case 270: if (eventChar == NSRightArrowFunctionKey) { endPoint.y -= delta; - if (endPoint.y < NSMinY(bounds)) - endPoint.y = NSMinY(bounds); + if (endPoint.y < NSMinY(pageBounds)) + endPoint.y = NSMinY(pageBounds) + 0.5; } else if (eventChar == NSLeftArrowFunctionKey) { endPoint.y += delta; - if (endPoint.y > NSMaxY(bounds)) - endPoint.y = NSMaxY(bounds); + if (endPoint.y > NSMaxY(pageBounds)) + endPoint.y = NSMaxY(pageBounds) - 0.5; } else if (eventChar == NSUpArrowFunctionKey) { endPoint.x += delta; - if (endPoint.x > NSMaxX(bounds)) - endPoint.x = NSMaxX(bounds); + if (endPoint.x > NSMaxX(pageBounds)) + endPoint.x = NSMaxX(pageBounds) - 0.5; } else if (eventChar == NSDownArrowFunctionKey) { endPoint.x -= delta; - if (endPoint.x < NSMinX(bounds)) - endPoint.x = NSMinX(bounds); + if (endPoint.x < NSMinX(pageBounds)) + endPoint.x = NSMinX(pageBounds) + 0.5; } break; } - endPoint.x = roundf(endPoint.x); - endPoint.y = roundf(endPoint.y); + endPoint.x = ceilf(endPoint.x) + 0.5; + endPoint.y = ceilf(endPoint.y) + 0.5; if (NSEqualPoints(endPoint, oldEndPoint) == NO) { - newBounds.origin.x = fmin(startPoint.x, endPoint.x); - newBounds.size.width = fabs(endPoint.x - startPoint.x); - newBounds.origin.y = fmin(startPoint.y, endPoint.y); - newBounds.size.height = fabs(endPoint.y - startPoint.y); + newBounds.origin.x = floorf(fmin(startPoint.x, endPoint.x)); + newBounds.size.width = ceilf(fmax(endPoint.x, startPoint.x)) - NSMinX(newBounds); + newBounds.origin.y = floorf(fmin(startPoint.y, endPoint.y)); + newBounds.size.height = ceilf(fmax(endPoint.y, startPoint.y)) - NSMinY(newBounds); if (NSWidth(newBounds) < 8.0) { newBounds.size.width = 8.0; @@ -2080,32 +2081,32 @@ if (draggingStartPoint) { if (startPoint.x > NSMaxX(pageBounds)) - startPoint.x = NSMaxX(pageBounds); + startPoint.x = NSMaxX(pageBounds) - 0.5; else if (startPoint.x < NSMinX(pageBounds)) - startPoint.x = NSMinX(pageBounds); + startPoint.x = NSMinX(pageBounds) + 0.5; if (startPoint.y > NSMaxY(pageBounds)) - startPoint.y = NSMaxY(pageBounds); + startPoint.y = NSMaxY(pageBounds) - 0.5; else if (startPoint.y < NSMinY(pageBounds)) - startPoint.y = NSMinY(pageBounds); - startPoint.x = roundf(startPoint.x); - startPoint.y = roundf(startPoint.y); + startPoint.y = NSMinY(pageBounds) + 0.5; + startPoint.x = ceilf(startPoint.x) + 0.5; + startPoint.y = ceilf(startPoint.y) + 0.5; } else { if (endPoint.x > NSMaxX(pageBounds)) - endPoint.x = NSMaxX(pageBounds); + endPoint.x = NSMaxX(pageBounds) - 0.5; else if (endPoint.x < NSMinX(pageBounds)) - endPoint.x = NSMinX(pageBounds); + endPoint.x = NSMinX(pageBounds) + 0.5; if (endPoint.y > NSMaxY(pageBounds)) - endPoint.y = NSMaxY(pageBounds); + endPoint.y = NSMaxY(pageBounds) - 0.5; else if (endPoint.y < NSMinY(pageBounds)) - endPoint.y = NSMinY(pageBounds); - endPoint.x = roundf(endPoint.x); - endPoint.y = roundf(endPoint.y); + endPoint.y = NSMinY(pageBounds) + 0.5; + endPoint.x = ceilf(endPoint.x) + 0.5; + endPoint.y = ceilf(endPoint.y) + 0.5; } - newBounds.origin.x = fmin(startPoint.x, endPoint.x); - newBounds.size.width = fabs(endPoint.x - startPoint.x); - newBounds.origin.y = fmin(startPoint.y, endPoint.y); - newBounds.size.height = fabs(endPoint.y - startPoint.y); + newBounds.origin.x = floorf(fmin(startPoint.x, endPoint.x)); + newBounds.size.width = ceilf(fmax(endPoint.x, startPoint.x)) - NSMinX(newBounds); + newBounds.origin.y = floorf(fmin(startPoint.y, endPoint.y)); + newBounds.size.height = ceilf(fmax(endPoint.y, startPoint.y)) - NSMinX(newBounds); if (NSWidth(newBounds) < 8.0) { newBounds.size.width = 8.0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-23 17:17:44
|
Revision: 1888 http://skim-app.svn.sourceforge.net/skim-app/?rev=1888&view=rev Author: hofman Date: 2007-04-23 10:17:39 -0700 (Mon, 23 Apr 2007) Log Message: ----------- Update release notes. Modified Paths: -------------- trunk/Dutch.lproj/ReleaseNotes.rtf trunk/English.lproj/ReleaseNotes.rtf trunk/Italian.lproj/ReleaseNotes.rtf Modified: trunk/Dutch.lproj/ReleaseNotes.rtf =================================================================== --- trunk/Dutch.lproj/ReleaseNotes.rtf 2007-04-23 16:30:47 UTC (rev 1887) +++ trunk/Dutch.lproj/ReleaseNotes.rtf 2007-04-23 17:17:39 UTC (rev 1888) @@ -41,16 +41,21 @@ {\list\listtemplateid36\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid36} {\list\listtemplateid37\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid37} {\list\listtemplateid38\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid38} -{\list\listtemplateid39\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid39}} -{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}{\listoverride\listid5\listoverridecount0\ls5}{\listoverride\listid6\listoverridecount0\ls6}{\listoverride\listid7\listoverridecount0\ls7}{\listoverride\listid8\listoverridecount0\ls8}{\listoverride\listid9\listoverridecount0\ls9}{\listoverride\listid10\listoverridecount0\ls10}{\listoverride\listid11\listoverridecount0\ls11}{\listoverride\listid12\listoverridecount0\ls12}{\listoverride\listid13\listoverridecount0\ls13}{\listoverride\listid14\listoverridecount0\ls14}{\listoverride\listid15\listoverridecount0\ls15}{\listoverride\listid16\listoverridecount0\ls16}{\listoverride\listid17\listoverridecount0\ls17}{\listoverride\listid18\listoverridecount0\ls18}{\listoverride\listid19\listoverridecount0\ls19}{\listoverride\listid20\listoverridecount0\ls20}{\listoverride\listid21\listoverridecount0\ls21}{\listoverride\listid22\listoverridecount0\ls22}{\listoverride\listid23\listoverridecount0\ls23}{\listoverride\listid24\listoverridecount0\ls24}{\listoverride\listid25\listoverridecount0\ls25}{\listoverride\listid26\listoverridecount0\ls26}{\listoverride\listid27\listoverridecount0\ls27}{\listoverride\listid28\listoverridecount0\ls28}{\listoverride\listid29\listoverridecount0\ls29}{\listoverride\listid30\listoverridecount0\ls30}{\listoverride\listid31\listoverridecount0\ls31}{\listoverride\listid32\listoverridecount0\ls32}{\listoverride\listid33\listoverridecount0\ls33}{\listoverride\listid34\listoverridecount0\ls34}{\listoverride\listid35\listoverridecount0\ls35}{\listoverride\listid36\listoverridecount0\ls36}{\listoverride\listid37\listoverridecount0\ls37}{\listoverride\listid38\listoverridecount0\ls38}{\listoverride\listid39\listoverridecount0\ls39}} +{\list\listtemplateid39\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid39} +{\list\listtemplateid40\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid40} +{\list\listtemplateid41\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid41} +{\list\listtemplateid42\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid42} +{\list\listtemplateid43\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid43} +{\list\listtemplateid44\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid44}} +{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}{\listoverride\listid5\listoverridecount0\ls5}{\listoverride\listid6\listoverridecount0\ls6}{\listoverride\listid7\listoverridecount0\ls7}{\listoverride\listid8\listoverridecount0\ls8}{\listoverride\listid9\listoverridecount0\ls9}{\listoverride\listid10\listoverridecount0\ls10}{\listoverride\listid11\listoverridecount0\ls11}{\listoverride\listid12\listoverridecount0\ls12}{\listoverride\listid13\listoverridecount0\ls13}{\listoverride\listid14\listoverridecount0\ls14}{\listoverride\listid15\listoverridecount0\ls15}{\listoverride\listid16\listoverridecount0\ls16}{\listoverride\listid17\listoverridecount0\ls17}{\listoverride\listid18\listoverridecount0\ls18}{\listoverride\listid19\listoverridecount0\ls19}{\listoverride\listid20\listoverridecount0\ls20}{\listoverride\listid21\listoverridecount0\ls21}{\listoverride\listid22\listoverridecount0\ls22}{\listoverride\listid23\listoverridecount0\ls23}{\listoverride\listid24\listoverridecount0\ls24}{\listoverride\listid25\listoverridecount0\ls25}{\listoverride\listid26\listoverridecount0\ls26}{\listoverride\listid27\listoverridecount0\ls27}{\listoverride\listid28\listoverridecount0\ls28}{\listoverride\listid29\listoverridecount0\ls29}{\listoverride\listid30\listoverridecount0\ls30}{\listoverride\listid31\listoverridecount0\ls31}{\listoverride\listid32\listoverridecount0\ls32}{\listoverride\listid33\listoverridecount0\ls33}{\listoverride\listid34\listoverridecount0\ls34}{\listoverride\listid35\listoverridecount0\ls35}{\listoverride\listid36\listoverridecount0\ls36}{\listoverride\listid37\listoverridecount0\ls37}{\listoverride\listid38\listoverridecount0\ls38}{\listoverride\listid39\listoverridecount0\ls39}{\listoverride\listid40\listoverridecount0\ls40}{\listoverride\listid41\listoverridecount0\ls41}{\listoverride\listid42\listoverridecount0\ls42}{\listoverride\listid43\listoverridecount0\ls43}{\listoverride\listid44\listoverridecount0\ls44}} \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f0\fs60 \cf0 Skim Release Notes\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\fs22 \cf0 \ -Last update: 19 April 2007 (rev -\f2\fs20 1859 +Last update: 23 April 2007 (rev +\f2\fs20 1887 \f1\fs22 )\ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural @@ -110,46 +115,56 @@ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls22\ilvl0\cf0 {\listtext \'a5 }Notes are now ordered according to page and location in page.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls23\ilvl0\cf0 {\listtext \'a5 }Several improvements of tool tips.\ +\ls23\ilvl0\cf0 {\listtext \'a5 }Several improvements of Skim's custom tool-tips.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls24\ilvl0\cf0 {\listtext \'a5 }Add a menu item to select the search field.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls25\ilvl0\cf0 {\listtext \'a5 }You can now add arrows to a PDF document.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls26\ilvl0\cf0 {\listtext \'a5 }You can now add notes from external .skim files rather than just overwriting them.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls27\ilvl0\cf0 {\listtext \'a5 }PDFSync support.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls28\ilvl0\cf0 {\listtext \'a5 }You can now set transparent colors from the color panel. \ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \f3\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f4\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls25\ilvl0 +\ls29\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }We now don't edit new text notes, so they can be moved, resized or deleted.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls26\ilvl0\cf0 {\listtext \'a5 }We now make sure new notes are added to a visible page.\ +\ls30\ilvl0\cf0 {\listtext \'a5 }We now make sure new notes are added to a visible page.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls27\ilvl0\cf0 {\listtext \'a5 }Disable the TOC menu item when there is no TOC.\ +\ls31\ilvl0\cf0 {\listtext \'a5 }Disable the TOC menu item when there is no TOC.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls28\ilvl0\cf0 {\listtext \'a5 }Return to the location that was viewed when reloading a document.\ +\ls32\ilvl0\cf0 {\listtext \'a5 }Return to the location that was viewed when reloading a document.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls29\ilvl0\cf0 {\listtext \'a5 }Search text in a PDf file asynchronously, so it does not block Skim.\ +\ls33\ilvl0\cf0 {\listtext \'a5 }Search text in a PDf file asynchronously, so it does not block Skim.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls30\ilvl0\cf0 {\listtext \'a5 }Fix crashes that can appear for links with missing URLs.\ +\ls34\ilvl0\cf0 {\listtext \'a5 }Fix crashes that can appear for links with missing URLs.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls31\ilvl0\cf0 {\listtext \'a5 }Add separators in the Notes menu for categories.\ +\ls35\ilvl0\cf0 {\listtext \'a5 }Add separators in the Notes menu for categories.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls32\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting a PDF-document.\ +\ls36\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting a PDF-document.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls33\ilvl0\cf0 {\listtext \'a5 }Fix typos in the Help and update for new features.\ +\ls37\ilvl0\cf0 {\listtext \'a5 }Fix typos in the Help and update for new features.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls34\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting the document. Unfortunately this disabled tool tips.\ +\ls38\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting the document. Unfortunately this disabled tool tips.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls35\ilvl0\cf0 {\listtext \'a5 }Open the contents pane to display the search term when opening from Spotlight.\ +\ls39\ilvl0\cf0 {\listtext \'a5 }Open the contents pane to display the search term when opening from Spotlight.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls36\ilvl0\cf0 {\listtext \'a5 }Save notes when auto-saving and exporting as PDF.\ +\ls40\ilvl0\cf0 {\listtext \'a5 }Save notes when auto-saving and exporting as PDF.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls37\ilvl0\cf0 {\listtext \'a5 }Remember the width of notes pane.\ +\ls41\ilvl0\cf0 {\listtext \'a5 }Remember the width of notes pane.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls38\ilvl0\cf0 {\listtext \'a5 }Fix leaks leading to excessive memory use.\ +\ls42\ilvl0\cf0 {\listtext \'a5 }Fix leaks leading to excessive memory use.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls39\ilvl0\cf0 {\listtext \'a5 }Fix back-tabbing through notes and links.\ +\ls43\ilvl0\cf0 {\listtext \'a5 }Fix back-tabbing through notes and links.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls44\ilvl0\cf0 {\listtext \'a5 }Zooming using the scroll-wheel now only affects the current window.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f3\b\fs28 \cf0 \ Modified: trunk/English.lproj/ReleaseNotes.rtf =================================================================== --- trunk/English.lproj/ReleaseNotes.rtf 2007-04-23 16:30:47 UTC (rev 1887) +++ trunk/English.lproj/ReleaseNotes.rtf 2007-04-23 17:17:39 UTC (rev 1888) @@ -41,16 +41,21 @@ {\list\listtemplateid36\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid36} {\list\listtemplateid37\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid37} {\list\listtemplateid38\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid38} -{\list\listtemplateid39\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid39}} -{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}{\listoverride\listid5\listoverridecount0\ls5}{\listoverride\listid6\listoverridecount0\ls6}{\listoverride\listid7\listoverridecount0\ls7}{\listoverride\listid8\listoverridecount0\ls8}{\listoverride\listid9\listoverridecount0\ls9}{\listoverride\listid10\listoverridecount0\ls10}{\listoverride\listid11\listoverridecount0\ls11}{\listoverride\listid12\listoverridecount0\ls12}{\listoverride\listid13\listoverridecount0\ls13}{\listoverride\listid14\listoverridecount0\ls14}{\listoverride\listid15\listoverridecount0\ls15}{\listoverride\listid16\listoverridecount0\ls16}{\listoverride\listid17\listoverridecount0\ls17}{\listoverride\listid18\listoverridecount0\ls18}{\listoverride\listid19\listoverridecount0\ls19}{\listoverride\listid20\listoverridecount0\ls20}{\listoverride\listid21\listoverridecount0\ls21}{\listoverride\listid22\listoverridecount0\ls22}{\listoverride\listid23\listoverridecount0\ls23}{\listoverride\listid24\listoverridecount0\ls24}{\listoverride\listid25\listoverridecount0\ls25}{\listoverride\listid26\listoverridecount0\ls26}{\listoverride\listid27\listoverridecount0\ls27}{\listoverride\listid28\listoverridecount0\ls28}{\listoverride\listid29\listoverridecount0\ls29}{\listoverride\listid30\listoverridecount0\ls30}{\listoverride\listid31\listoverridecount0\ls31}{\listoverride\listid32\listoverridecount0\ls32}{\listoverride\listid33\listoverridecount0\ls33}{\listoverride\listid34\listoverridecount0\ls34}{\listoverride\listid35\listoverridecount0\ls35}{\listoverride\listid36\listoverridecount0\ls36}{\listoverride\listid37\listoverridecount0\ls37}{\listoverride\listid38\listoverridecount0\ls38}{\listoverride\listid39\listoverridecount0\ls39}} +{\list\listtemplateid39\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid39} +{\list\listtemplateid40\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid40} +{\list\listtemplateid41\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid41} +{\list\listtemplateid42\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid42} +{\list\listtemplateid43\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid43} +{\list\listtemplateid44\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid44}} +{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}{\listoverride\listid5\listoverridecount0\ls5}{\listoverride\listid6\listoverridecount0\ls6}{\listoverride\listid7\listoverridecount0\ls7}{\listoverride\listid8\listoverridecount0\ls8}{\listoverride\listid9\listoverridecount0\ls9}{\listoverride\listid10\listoverridecount0\ls10}{\listoverride\listid11\listoverridecount0\ls11}{\listoverride\listid12\listoverridecount0\ls12}{\listoverride\listid13\listoverridecount0\ls13}{\listoverride\listid14\listoverridecount0\ls14}{\listoverride\listid15\listoverridecount0\ls15}{\listoverride\listid16\listoverridecount0\ls16}{\listoverride\listid17\listoverridecount0\ls17}{\listoverride\listid18\listoverridecount0\ls18}{\listoverride\listid19\listoverridecount0\ls19}{\listoverride\listid20\listoverridecount0\ls20}{\listoverride\listid21\listoverridecount0\ls21}{\listoverride\listid22\listoverridecount0\ls22}{\listoverride\listid23\listoverridecount0\ls23}{\listoverride\listid24\listoverridecount0\ls24}{\listoverride\listid25\listoverridecount0\ls25}{\listoverride\listid26\listoverridecount0\ls26}{\listoverride\listid27\listoverridecount0\ls27}{\listoverride\listid28\listoverridecount0\ls28}{\listoverride\listid29\listoverridecount0\ls29}{\listoverride\listid30\listoverridecount0\ls30}{\listoverride\listid31\listoverridecount0\ls31}{\listoverride\listid32\listoverridecount0\ls32}{\listoverride\listid33\listoverridecount0\ls33}{\listoverride\listid34\listoverridecount0\ls34}{\listoverride\listid35\listoverridecount0\ls35}{\listoverride\listid36\listoverridecount0\ls36}{\listoverride\listid37\listoverridecount0\ls37}{\listoverride\listid38\listoverridecount0\ls38}{\listoverride\listid39\listoverridecount0\ls39}{\listoverride\listid40\listoverridecount0\ls40}{\listoverride\listid41\listoverridecount0\ls41}{\listoverride\listid42\listoverridecount0\ls42}{\listoverride\listid43\listoverridecount0\ls43}{\listoverride\listid44\listoverridecount0\ls44}} \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f0\fs60 \cf0 Skim Release Notes\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\fs22 \cf0 \ -Last update: 19 April 2007 (rev -\f2\fs20 1859 +Last update: 23 April 2007 (rev +\f2\fs20 1887 \f1\fs22 )\ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural @@ -110,46 +115,56 @@ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls22\ilvl0\cf0 {\listtext \'a5 }Notes are now ordered according to page and location in page.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls23\ilvl0\cf0 {\listtext \'a5 }Several improvements of tool tips.\ +\ls23\ilvl0\cf0 {\listtext \'a5 }Several improvements of Skim's custom tool-tips.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls24\ilvl0\cf0 {\listtext \'a5 }Add a menu item to select the search field.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls25\ilvl0\cf0 {\listtext \'a5 }You can now add arrows to a PDF document.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls26\ilvl0\cf0 {\listtext \'a5 }You can now add notes from external .skim files rather than just overwriting them.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls27\ilvl0\cf0 {\listtext \'a5 }PDFSync support.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls28\ilvl0\cf0 {\listtext \'a5 }You can now set transparent colors from the color panel. \ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \f3\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f4\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls25\ilvl0 +\ls29\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }We now don't edit new text notes, so they can be moved, resized or deleted.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls26\ilvl0\cf0 {\listtext \'a5 }We now make sure new notes are added to a visible page.\ +\ls30\ilvl0\cf0 {\listtext \'a5 }We now make sure new notes are added to a visible page.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls27\ilvl0\cf0 {\listtext \'a5 }Disable the TOC menu item when there is no TOC.\ +\ls31\ilvl0\cf0 {\listtext \'a5 }Disable the TOC menu item when there is no TOC.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls28\ilvl0\cf0 {\listtext \'a5 }Return to the location that was viewed when reloading a document.\ +\ls32\ilvl0\cf0 {\listtext \'a5 }Return to the location that was viewed when reloading a document.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls29\ilvl0\cf0 {\listtext \'a5 }Search text in a PDf file asynchronously, so it does not block Skim.\ +\ls33\ilvl0\cf0 {\listtext \'a5 }Search text in a PDf file asynchronously, so it does not block Skim.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls30\ilvl0\cf0 {\listtext \'a5 }Fix crashes that can appear for links with missing URLs.\ +\ls34\ilvl0\cf0 {\listtext \'a5 }Fix crashes that can appear for links with missing URLs.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls31\ilvl0\cf0 {\listtext \'a5 }Add separators in the Notes menu for categories.\ +\ls35\ilvl0\cf0 {\listtext \'a5 }Add separators in the Notes menu for categories.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls32\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting a PDF-document.\ +\ls36\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting a PDF-document.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls33\ilvl0\cf0 {\listtext \'a5 }Fix typos in the Help and update for new features.\ +\ls37\ilvl0\cf0 {\listtext \'a5 }Fix typos in the Help and update for new features.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls34\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting the document. Unfortunately this disabled tool tips.\ +\ls38\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting the document. Unfortunately this disabled tool tips.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls35\ilvl0\cf0 {\listtext \'a5 }Open the contents pane to display the search term when opening from Spotlight.\ +\ls39\ilvl0\cf0 {\listtext \'a5 }Open the contents pane to display the search term when opening from Spotlight.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls36\ilvl0\cf0 {\listtext \'a5 }Save notes when auto-saving and exporting as PDF.\ +\ls40\ilvl0\cf0 {\listtext \'a5 }Save notes when auto-saving and exporting as PDF.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls37\ilvl0\cf0 {\listtext \'a5 }Remember the width of notes pane.\ +\ls41\ilvl0\cf0 {\listtext \'a5 }Remember the width of notes pane.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls38\ilvl0\cf0 {\listtext \'a5 }Fix leaks leading to excessive memory use.\ +\ls42\ilvl0\cf0 {\listtext \'a5 }Fix leaks leading to excessive memory use.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls39\ilvl0\cf0 {\listtext \'a5 }Fix back-tabbing through notes and links.\ +\ls43\ilvl0\cf0 {\listtext \'a5 }Fix back-tabbing through notes and links.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls44\ilvl0\cf0 {\listtext \'a5 }Zooming using the scroll-wheel now only affects the current window.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f3\b\fs28 \cf0 \ Modified: trunk/Italian.lproj/ReleaseNotes.rtf =================================================================== --- trunk/Italian.lproj/ReleaseNotes.rtf 2007-04-23 16:30:47 UTC (rev 1887) +++ trunk/Italian.lproj/ReleaseNotes.rtf 2007-04-23 17:17:39 UTC (rev 1888) @@ -41,16 +41,21 @@ {\list\listtemplateid36\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid36} {\list\listtemplateid37\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid37} {\list\listtemplateid38\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid38} -{\list\listtemplateid39\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid39}} -{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}{\listoverride\listid5\listoverridecount0\ls5}{\listoverride\listid6\listoverridecount0\ls6}{\listoverride\listid7\listoverridecount0\ls7}{\listoverride\listid8\listoverridecount0\ls8}{\listoverride\listid9\listoverridecount0\ls9}{\listoverride\listid10\listoverridecount0\ls10}{\listoverride\listid11\listoverridecount0\ls11}{\listoverride\listid12\listoverridecount0\ls12}{\listoverride\listid13\listoverridecount0\ls13}{\listoverride\listid14\listoverridecount0\ls14}{\listoverride\listid15\listoverridecount0\ls15}{\listoverride\listid16\listoverridecount0\ls16}{\listoverride\listid17\listoverridecount0\ls17}{\listoverride\listid18\listoverridecount0\ls18}{\listoverride\listid19\listoverridecount0\ls19}{\listoverride\listid20\listoverridecount0\ls20}{\listoverride\listid21\listoverridecount0\ls21}{\listoverride\listid22\listoverridecount0\ls22}{\listoverride\listid23\listoverridecount0\ls23}{\listoverride\listid24\listoverridecount0\ls24}{\listoverride\listid25\listoverridecount0\ls25}{\listoverride\listid26\listoverridecount0\ls26}{\listoverride\listid27\listoverridecount0\ls27}{\listoverride\listid28\listoverridecount0\ls28}{\listoverride\listid29\listoverridecount0\ls29}{\listoverride\listid30\listoverridecount0\ls30}{\listoverride\listid31\listoverridecount0\ls31}{\listoverride\listid32\listoverridecount0\ls32}{\listoverride\listid33\listoverridecount0\ls33}{\listoverride\listid34\listoverridecount0\ls34}{\listoverride\listid35\listoverridecount0\ls35}{\listoverride\listid36\listoverridecount0\ls36}{\listoverride\listid37\listoverridecount0\ls37}{\listoverride\listid38\listoverridecount0\ls38}{\listoverride\listid39\listoverridecount0\ls39}} +{\list\listtemplateid39\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid39} +{\list\listtemplateid40\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid40} +{\list\listtemplateid41\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid41} +{\list\listtemplateid42\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid42} +{\list\listtemplateid43\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid43} +{\list\listtemplateid44\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid44}} +{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}{\listoverride\listid4\listoverridecount0\ls4}{\listoverride\listid5\listoverridecount0\ls5}{\listoverride\listid6\listoverridecount0\ls6}{\listoverride\listid7\listoverridecount0\ls7}{\listoverride\listid8\listoverridecount0\ls8}{\listoverride\listid9\listoverridecount0\ls9}{\listoverride\listid10\listoverridecount0\ls10}{\listoverride\listid11\listoverridecount0\ls11}{\listoverride\listid12\listoverridecount0\ls12}{\listoverride\listid13\listoverridecount0\ls13}{\listoverride\listid14\listoverridecount0\ls14}{\listoverride\listid15\listoverridecount0\ls15}{\listoverride\listid16\listoverridecount0\ls16}{\listoverride\listid17\listoverridecount0\ls17}{\listoverride\listid18\listoverridecount0\ls18}{\listoverride\listid19\listoverridecount0\ls19}{\listoverride\listid20\listoverridecount0\ls20}{\listoverride\listid21\listoverridecount0\ls21}{\listoverride\listid22\listoverridecount0\ls22}{\listoverride\listid23\listoverridecount0\ls23}{\listoverride\listid24\listoverridecount0\ls24}{\listoverride\listid25\listoverridecount0\ls25}{\listoverride\listid26\listoverridecount0\ls26}{\listoverride\listid27\listoverridecount0\ls27}{\listoverride\listid28\listoverridecount0\ls28}{\listoverride\listid29\listoverridecount0\ls29}{\listoverride\listid30\listoverridecount0\ls30}{\listoverride\listid31\listoverridecount0\ls31}{\listoverride\listid32\listoverridecount0\ls32}{\listoverride\listid33\listoverridecount0\ls33}{\listoverride\listid34\listoverridecount0\ls34}{\listoverride\listid35\listoverridecount0\ls35}{\listoverride\listid36\listoverridecount0\ls36}{\listoverride\listid37\listoverridecount0\ls37}{\listoverride\listid38\listoverridecount0\ls38}{\listoverride\listid39\listoverridecount0\ls39}{\listoverride\listid40\listoverridecount0\ls40}{\listoverride\listid41\listoverridecount0\ls41}{\listoverride\listid42\listoverridecount0\ls42}{\listoverride\listid43\listoverridecount0\ls43}{\listoverride\listid44\listoverridecount0\ls44}} \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f0\fs60 \cf0 Skim Release Notes\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f1\fs22 \cf0 \ -Last update: 19 April 2007 (rev -\f2\fs20 1859 +Last update: 23 April 2007 (rev +\f2\fs20 1887 \f1\fs22 )\ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural @@ -110,46 +115,56 @@ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls22\ilvl0\cf0 {\listtext \'a5 }Notes are now ordered according to page and location in page.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls23\ilvl0\cf0 {\listtext \'a5 }Several improvements of tool tips.\ +\ls23\ilvl0\cf0 {\listtext \'a5 }Several improvements of Skim's custom tool-tips.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \ls24\ilvl0\cf0 {\listtext \'a5 }Add a menu item to select the search field.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls25\ilvl0\cf0 {\listtext \'a5 }You can now add arrows to a PDF document.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls26\ilvl0\cf0 {\listtext \'a5 }You can now add notes from external .skim files rather than just overwriting them.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls27\ilvl0\cf0 {\listtext \'a5 }PDFSync support.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls28\ilvl0\cf0 {\listtext \'a5 }You can now set transparent colors from the color panel. \ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural \f3\b\fs28 \cf0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f4\i\fs26 \cf0 Bugs Fixed\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls25\ilvl0 +\ls29\ilvl0 \f1\i0\b0\fs22 \cf0 {\listtext \'a5 }We now don't edit new text notes, so they can be moved, resized or deleted.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls26\ilvl0\cf0 {\listtext \'a5 }We now make sure new notes are added to a visible page.\ +\ls30\ilvl0\cf0 {\listtext \'a5 }We now make sure new notes are added to a visible page.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls27\ilvl0\cf0 {\listtext \'a5 }Disable the TOC menu item when there is no TOC.\ +\ls31\ilvl0\cf0 {\listtext \'a5 }Disable the TOC menu item when there is no TOC.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls28\ilvl0\cf0 {\listtext \'a5 }Return to the location that was viewed when reloading a document.\ +\ls32\ilvl0\cf0 {\listtext \'a5 }Return to the location that was viewed when reloading a document.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls29\ilvl0\cf0 {\listtext \'a5 }Search text in a PDf file asynchronously, so it does not block Skim.\ +\ls33\ilvl0\cf0 {\listtext \'a5 }Search text in a PDf file asynchronously, so it does not block Skim.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls30\ilvl0\cf0 {\listtext \'a5 }Fix crashes that can appear for links with missing URLs.\ +\ls34\ilvl0\cf0 {\listtext \'a5 }Fix crashes that can appear for links with missing URLs.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls31\ilvl0\cf0 {\listtext \'a5 }Add separators in the Notes menu for categories.\ +\ls35\ilvl0\cf0 {\listtext \'a5 }Add separators in the Notes menu for categories.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls32\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting a PDF-document.\ +\ls36\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting a PDF-document.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls33\ilvl0\cf0 {\listtext \'a5 }Fix typos in the Help and update for new features.\ +\ls37\ilvl0\cf0 {\listtext \'a5 }Fix typos in the Help and update for new features.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls34\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting the document. Unfortunately this disabled tool tips.\ +\ls38\ilvl0\cf0 {\listtext \'a5 }Fix a crasher when reverting the document. Unfortunately this disabled tool tips.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls35\ilvl0\cf0 {\listtext \'a5 }Open the contents pane to display the search term when opening from Spotlight.\ +\ls39\ilvl0\cf0 {\listtext \'a5 }Open the contents pane to display the search term when opening from Spotlight.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls36\ilvl0\cf0 {\listtext \'a5 }Save notes when auto-saving and exporting as PDF.\ +\ls40\ilvl0\cf0 {\listtext \'a5 }Save notes when auto-saving and exporting as PDF.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls37\ilvl0\cf0 {\listtext \'a5 }Remember the width of notes pane.\ +\ls41\ilvl0\cf0 {\listtext \'a5 }Remember the width of notes pane.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls38\ilvl0\cf0 {\listtext \'a5 }Fix leaks leading to excessive memory use.\ +\ls42\ilvl0\cf0 {\listtext \'a5 }Fix leaks leading to excessive memory use.\ \pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural -\ls39\ilvl0\cf0 {\listtext \'a5 }Fix back-tabbing through notes and links.\ +\ls43\ilvl0\cf0 {\listtext \'a5 }Fix back-tabbing through notes and links.\ +\pard\tx220\tx720\tx1440\tx2880\tx4320\tx5760\tx7200\li720\fi-720\ql\qnatural +\ls44\ilvl0\cf0 {\listtext \'a5 }Zooming using the scroll-wheel now only affects the current window.\ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \f3\b\fs28 \cf0 \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-23 16:30:48
|
Revision: 1887 http://skim-app.svn.sourceforge.net/skim-app/?rev=1887&view=rev Author: hofman Date: 2007-04-23 09:30:47 -0700 (Mon, 23 Apr 2007) Log Message: ----------- Enable setting transparency in color panel, so you can use transprency in note colors. Makes transparency slider for reading bar obsolete. Modified Paths: -------------- trunk/Dutch.lproj/PreferenceWindow.nib/keyedobjects.nib trunk/Dutch.lproj/Skim Help/skim.texi trunk/English.lproj/PreferenceWindow.nib/keyedobjects.nib trunk/English.lproj/Skim Help/skim.texi trunk/InitialUserDefaults.plist trunk/SKApplicationController.m trunk/SKPDFView.m trunk/Skim.xcodeproj/project.pbxproj Modified: trunk/Dutch.lproj/PreferenceWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Dutch.lproj/Skim Help/skim.texi =================================================================== --- trunk/Dutch.lproj/Skim Help/skim.texi 2007-04-23 10:21:54 UTC (rev 1886) +++ trunk/Dutch.lproj/Skim Help/skim.texi 2007-04-23 16:30:47 UTC (rev 1887) @@ -874,7 +874,7 @@ @box{taskbox} @heading Om de kleur van de leesbalk of de transparantie te wijzigen: @itemize -@item Om de kleur van de leesbalk of de transparantie te wijzigen, kies Skim > Voorkeuren, klik op Kleuren, en selecteer Kleur of verschuif de Transparentie schuifknop naar de juiste waarde. +@item Om de kleur van de leesbalk of de transparantie te wijzigen, kies Skim > Voorkeuren, klik op Kleuren, en selecteer Kleur. @end itemize @endbox Modified: trunk/English.lproj/PreferenceWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/Skim Help/skim.texi =================================================================== --- trunk/English.lproj/Skim Help/skim.texi 2007-04-23 10:21:54 UTC (rev 1886) +++ trunk/English.lproj/Skim Help/skim.texi 2007-04-23 16:30:47 UTC (rev 1887) @@ -869,7 +869,7 @@ @box{taskbox} @itemize -@item To change the color or transparency of the reading bar, choose Skim > Preferences, click Colors, and select Color or move the Transparency slider. +@item To change the color or transparency of the reading bar, choose Skim > Preferences, click Colors, and select Color. @end itemize @endbox Modified: trunk/InitialUserDefaults.plist =================================================================== --- trunk/InitialUserDefaults.plist 2007-04-23 10:21:54 UTC (rev 1886) +++ trunk/InitialUserDefaults.plist 2007-04-23 16:30:47 UTC (rev 1887) @@ -56,10 +56,8 @@ BAt0eXBlZHN0cmVhbYED6IQBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm ZmZmAQEAAYY= </data> - <key>SKReadingBarTransparency</key> - <real>0.7</real> <key>SKReadingBarInvert</key> - <true/> + <false/> <key>SKTextNoteFontName</key> <string>LucidaGrande</string> <key>SKTextNoteFontSize</key> @@ -157,7 +155,6 @@ <string>SKShouldHighlightSearchResults</string> <string>SKSearchHighlightColor</string> <string>SKReadingBarColor</string> - <string>SKReadingBarTransparency</string> <string>SKReadingBarInvert</string> </array> <key>notes</key> Modified: trunk/SKApplicationController.m =================================================================== --- trunk/SKApplicationController.m 2007-04-23 10:21:54 UTC (rev 1886) +++ trunk/SKApplicationController.m 2007-04-23 16:30:47 UTC (rev 1887) @@ -111,6 +111,8 @@ if ([menuItem action] == @selector(changeLeftSidePaneState:) || [menuItem action] == @selector(changeRightSidePaneState:)) [menuItem setIndentationLevel:1]; } + + [[NSColorPanel sharedColorPanel] setShowsAlpha:YES]; } - (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender{ Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-23 10:21:54 UTC (rev 1886) +++ trunk/SKPDFView.m 2007-04-23 16:30:47 UTC (rev 1887) @@ -276,8 +276,7 @@ NSRect rect = [readingBar currentBoundsForBox:[self displayBox]]; BOOL invert = [[NSUserDefaults standardUserDefaults] boolForKey:SKReadingBarInvertKey]; NSColor *nsColor = [NSUnarchiver unarchiveObjectWithData:[[NSUserDefaults standardUserDefaults] dataForKey:SKReadingBarColorKey]]; - float alpha = 1.0 - [[NSUserDefaults standardUserDefaults] floatForKey:SKReadingBarTransparencyKey]; - float color[4] = { [nsColor redComponent], [nsColor greenComponent], [nsColor blueComponent], alpha }; + float color[4] = { [nsColor redComponent], [nsColor greenComponent], [nsColor blueComponent], [nsColor alphaComponent] }; CGContextSetFillColor(context, color); Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-04-23 10:21:54 UTC (rev 1886) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-04-23 16:30:47 UTC (rev 1887) @@ -186,7 +186,7 @@ isa = PBXContainerItemProxy; containerPortal = 2A37F4A9FDCFA73011CA2CEA /* Project object */; proxyType = 1; - remoteGlobalIDString = CEF3BF740B99CA2900E12E3D /* skimnotes */; + remoteGlobalIDString = CEF3BF740B99CA2900E12E3D; remoteInfo = skimnotes; }; CE2BD81F0BD4127A00A5F4DB /* PBXContainerItemProxy */ = { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-23 10:27:43
|
Revision: 1886 http://skim-app.svn.sourceforge.net/skim-app/?rev=1886&view=rev Author: hofman Date: 2007-04-23 03:21:54 -0700 (Mon, 23 Apr 2007) Log Message: ----------- Use correct arguments to pass to applescript for displaying tex line. Modified Paths: -------------- trunk/displayline.sh Modified: trunk/displayline.sh =================================================================== --- trunk/displayline.sh 2007-04-23 09:28:12 UTC (rev 1885) +++ trunk/displayline.sh 2007-04-23 10:21:54 UTC (rev 1886) @@ -1,10 +1,15 @@ #!/bin/sh +# displayline.sh (Skim) +# +# Usage: displayline.sh LINE PDFFILE [TEXSOURCEFILE] + line=$1 file="$2" -project="$2" if [ $# -gt 3 ]; then -project="$2" +source="$3" +else +source="$2" fi -/usr/bin/osascript -e "tell application \"Skim\"" -e "activate" -e "display TeX line "${line}" in \""${file}"\" from source \""${project}"\"" -e "end tell" +/usr/bin/osascript -e "tell application \"Skim\"" -e "activate" -e "display TeX line "${line}" in \""${file}"\" from source \""${source}"\"" -e "end tell" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-23 09:29:32
|
Revision: 1885 http://skim-app.svn.sourceforge.net/skim-app/?rev=1885&view=rev Author: hofman Date: 2007-04-23 02:28:12 -0700 (Mon, 23 Apr 2007) Log Message: ----------- Improve pdfsync support. Select line from point in pdfsync in pdf. Go to page instead of scrolling to a destination, as the destination would end up at the edge of the view. Use more sensible applescript command arguments. Modified Paths: -------------- trunk/SKDisplayTeXLineCommand.m trunk/SKDocument.m trunk/SKPDFView.h trunk/SKPDFView.m trunk/Skim.sdef trunk/displayline.sh Modified: trunk/SKDisplayTeXLineCommand.m =================================================================== --- trunk/SKDisplayTeXLineCommand.m 2007-04-22 23:48:52 UTC (rev 1884) +++ trunk/SKDisplayTeXLineCommand.m 2007-04-23 09:28:12 UTC (rev 1885) @@ -46,36 +46,47 @@ id lineNumber = [self directParameter]; NSDictionary *args = [self evaluatedArguments]; id file = [args objectForKey:@"file"]; - id project = [args objectForKey:@"project"]; - NSURL *projectURL = nil; + id source = [args objectForKey:@"source"]; + NSURL *fileURL = nil; - if (project == nil) - project = file; + if (source == nil) + source = file; - if ([project isKindOfClass:[NSURL class]]) { - projectURL = project; - } else if ([project isKindOfClass:[NSString class]]) { - if ([project hasPrefix:@"file://"]) - projectURL = [NSURL URLWithString:project]; + if ([source isKindOfClass:[NSURL class]]) { + source = [source path]; + } else if ([source isKindOfClass:[NSString class]]) { + if ([source hasPrefix:@"file://"]) + source = [[NSURL URLWithString:source] path]; else - projectURL = [NSURL fileURLWithPath:[project stringByStandardizingPath]]; + source = [source stringByStandardizingPath]; } + if ([[source pathExtension] length] == 0) + source = [source stringByAppendingPathExtension:@"tex"]; + else if ([[source pathExtension] caseInsensitiveCompare:@"tex"] != NSOrderedSame) + source = [[source stringByDeletingPathExtension] stringByAppendingPathExtension:@"tex"]; + if ([file isKindOfClass:[NSURL class]]) { - file = [file path]; - } else if ([file isKindOfClass:[NSString class]]) { + fileURL = file; + } else if ([source isKindOfClass:[NSString class]]) { if ([file hasPrefix:@"file://"]) - file = [[NSURL URLWithString:file] path]; + fileURL = [NSURL URLWithString:file]; else - file = [file stringByStandardizingPath]; + fileURL = [NSURL fileURLWithPath:[file stringByStandardizingPath]]; } - if (file == nil || projectURL == nil) + file = [fileURL path]; + if ([[file pathExtension] length] == 0) + fileURL = [NSURL fileURLWithPath:[file stringByAppendingPathExtension:@"pdf"]]; + else if ([[file pathExtension] caseInsensitiveCompare:@"pdf"] != NSOrderedSame) + fileURL = [NSURL fileURLWithPath:[[file stringByDeletingPathExtension] stringByAppendingPathExtension:@"pdf"]]; + + if (source == nil || fileURL == nil) return nil; + NSLog(@"%@ %@ %@",lineNumber,fileURL,source); + SKDocument *document = [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:fileURL display:YES error:NULL]; - SKDocument *document = [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:projectURL display:YES error:NULL]; - - [document displayTeXLine:[lineNumber intValue] fromFile:file]; + [document displayTeXLine:[lineNumber intValue] fromFile:source]; return nil; } Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-04-22 23:48:52 UTC (rev 1884) +++ trunk/SKDocument.m 2007-04-23 09:28:12 UTC (rev 1885) @@ -594,13 +594,14 @@ return synchronizer; } -- (void)displayTeXLine:(int)line fromFile:(NSString *)file{ - NSString *fileBase = [[self fileName] stringByDeletingPathExtension]; - NSString *pdfsyncFile = [fileBase stringByAppendingPathExtension:@"pdfsync"]; +- (void)displayTeXLine:(int)line fromFile:(NSString *)file { + NSString *pdfsyncFile = [[[self fileName] stringByDeletingPathExtension] stringByAppendingPathExtension:@"pdfsync"]; NSString *texFile = file; NSFileManager *fm = [NSFileManager defaultManager]; - if ([[file pathExtension] length]) + if ([[file pathExtension] length] == 0) + texFile = [file stringByAppendingPathExtension:@"tex"]; + else if ([[file pathExtension] caseInsensitiveCompare:@"tex"] != NSOrderedSame) texFile = [[file stringByDeletingPathExtension] stringByAppendingPathExtension:@"tex"]; if ([fm fileExistsAtPath:pdfsyncFile] == NO || [fm fileExistsAtPath:texFile] == NO) { @@ -614,9 +615,12 @@ if ([[self synchronizer] getPageIndex:&pageIndex location:&point forLine:line inFile:texFile]) { PDFPage *page = [[[self pdfView] document] pageAtIndex:pageIndex]; - PDFDestination *dest = [[PDFDestination alloc] initWithPage:page atPoint:point]; + PDFSelection *sel = [page selectionForLineAtPoint:point]; + NSRect rect = sel ? [sel boundsForPage:page] : NSMakeRect(point.x - 5.0, point.y - 5.0, 10.0, 10.0); - [[self pdfView] goToDestination:dest]; + if (sel) + [[self pdfView] setCurrentSelection:sel]; + [[self pdfView] scrollRect:rect inPageToVisible:page]; } else NSBeep(); } else NSBeep(); } Modified: trunk/SKPDFView.h =================================================================== --- trunk/SKPDFView.h 2007-04-22 23:48:52 UTC (rev 1884) +++ trunk/SKPDFView.h 2007-04-23 09:28:12 UTC (rev 1885) @@ -118,6 +118,7 @@ - (void)selectNextActiveAnnotation:(id)sender; - (void)selectPreviousActiveAnnotation:(id)sender; - (void)scrollAnnotationToVisible:(PDFAnnotation *)annotation; +- (void)scrollRect:(NSRect)rect inPageToVisible:(PDFPage *)page; - (void)takeSnapshot:(id)sender; Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-22 23:48:52 UTC (rev 1884) +++ trunk/SKPDFView.m 2007-04-23 09:28:12 UTC (rev 1885) @@ -1262,11 +1262,16 @@ } } -- (void)scrollAnnotationToVisible:(PDFAnnotation *)annotation { - NSRect rect = [self convertRect:[self convertRect:[annotation bounds] fromPage:[annotation page]] toView:[self documentView]]; +- (void)scrollRect:(NSRect)rect inPageToVisible:(PDFPage *)page { + rect = [self convertRect:[self convertRect:rect fromPage:page] toView:[self documentView]]; + [self goToPage:page]; [[self documentView] scrollRectToVisible:rect]; } +- (void)scrollAnnotationToVisible:(PDFAnnotation *)annotation { + [self scrollRect:[annotation bounds] inPageToVisible:[annotation page]]; +} + #pragma mark Snapshots - (void)takeSnapshot:(id)sender { Modified: trunk/Skim.sdef =================================================================== --- trunk/Skim.sdef 2007-04-22 23:48:52 UTC (rev 1884) +++ trunk/Skim.sdef 2007-04-23 09:28:12 UTC (rev 1885) @@ -595,17 +595,17 @@ <direct-parameter type="integer" description="The line number in the TeX file."> </direct-parameter> - <parameter name="of file" code="File" optional="no" - description="The file name"> + <parameter name="in" code="File" optional="no" + description="The PDF file"> <type type="text"/> <type type="file"/> <cocoa key="file"/> </parameter> - <parameter name="in project" code="Proj" optional="yes" - description="The base TeX file name, if the file is included."> + <parameter name="from source" code="SrcF" optional="yes" + description="The TeX source file. By default this is derived from the pdf file."> <type type="text"/> <type type="file"/> - <cocoa key="project"/> + <cocoa key="source"/> </parameter> </command> Modified: trunk/displayline.sh =================================================================== --- trunk/displayline.sh 2007-04-22 23:48:52 UTC (rev 1884) +++ trunk/displayline.sh 2007-04-23 09:28:12 UTC (rev 1885) @@ -7,4 +7,4 @@ project="$2" fi -/usr/bin/osascript -e "tell application \"Skim\"" -e "activate" -e "display TeX line "${line}" of file \""${file}"\" in project \""${project}"\"" -e "end tell" +/usr/bin/osascript -e "tell application \"Skim\"" -e "activate" -e "display TeX line "${line}" in \""${file}"\" from source \""${project}"\"" -e "end tell" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-22 23:48:53
|
Revision: 1884 http://skim-app.svn.sourceforge.net/skim-app/?rev=1884&view=rev Author: hofman Date: 2007-04-22 16:48:52 -0700 (Sun, 22 Apr 2007) Log Message: ----------- Don't check string of selection. That can be buggy. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-22 20:10:27 UTC (rev 1883) +++ trunk/SKPDFView.m 2007-04-22 23:48:52 UTC (rev 1884) @@ -2581,7 +2581,7 @@ NSPoint location = [self convertPoint:mouseLoc toPage:page]; unsigned int pageIndex = [[self document] indexForPage:page]; PDFSelection *sel = [page selectionForLineAtPoint:location]; - NSRect rect = [sel string] ? [sel boundsForPage:page] : NSMakeRect(location.x - 20.0, location.y - 5.0, 40.0, 10.0); + NSRect rect = sel ? [sel boundsForPage:page] : NSMakeRect(location.x - 20.0, location.y - 5.0, 40.0, 10.0); [(SKDocument *)[[[self window] windowController] document] displayTeXEditorForLocation:location inRect:rect atPageIndex:pageIndex]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-22 20:10:27
|
Revision: 1883 http://skim-app.svn.sourceforge.net/skim-app/?rev=1883&view=rev Author: hofman Date: 2007-04-22 13:10:27 -0700 (Sun, 22 Apr 2007) Log Message: ----------- Don't show camera cursor for pdfsync modifier (shift-cmd-click) also for flag changes. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-22 20:07:21 UTC (rev 1882) +++ trunk/SKPDFView.m 2007-04-22 20:10:27 UTC (rev 1883) @@ -787,7 +787,10 @@ NSCursor *cursor = nil; if ([theEvent modifierFlags] & NSCommandKeyMask) { - cursor = [NSCursor cameraCursor]; + if ([theEvent modifierFlags] & NSShiftKeyMask) + cursor = [NSCursor arrowCursor]; + else + cursor = [NSCursor cameraCursor]; } else { switch (toolMode) { case SKTextToolMode: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-22 20:07:23
|
Revision: 1882 http://skim-app.svn.sourceforge.net/skim-app/?rev=1882&view=rev Author: hofman Date: 2007-04-22 13:07:21 -0700 (Sun, 22 Apr 2007) Log Message: ----------- Don't show camera cursor for pdfsync modifier (shift-cmd-click) Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-22 19:54:34 UTC (rev 1881) +++ trunk/SKPDFView.m 2007-04-22 20:07:21 UTC (rev 1882) @@ -726,7 +726,10 @@ if (NSPointInRect(p, [clipView visibleRect]) == NO || ([navWindow isVisible] && NSPointInRect([NSEvent mouseLocation], [navWindow frame]))) { cursor = [NSCursor arrowCursor]; } else if ([theEvent modifierFlags] & NSCommandKeyMask) { - cursor = [NSCursor cameraCursor]; + if ([theEvent modifierFlags] & NSShiftKeyMask) + cursor = [NSCursor arrowCursor]; + else + cursor = [NSCursor cameraCursor]; } else { switch (toolMode) { case SKTextToolMode: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-22 19:54:38
|
Revision: 1881 http://skim-app.svn.sourceforge.net/skim-app/?rev=1881&view=rev Author: hofman Date: 2007-04-22 12:54:34 -0700 (Sun, 22 Apr 2007) Log Message: ----------- Make side window key after sliding in view. Modified Paths: -------------- trunk/SKSideWindow.m Modified: trunk/SKSideWindow.m =================================================================== --- trunk/SKSideWindow.m 2007-04-22 19:35:46 UTC (rev 1880) +++ trunk/SKSideWindow.m 2007-04-22 19:54:34 UTC (rev 1881) @@ -123,6 +123,7 @@ [animation setDuration:[self animationResizeTime:endFrame]]; [animation startAnimation]; [animation release]; + [self makeKeyAndOrderFront:nil]; state = NSDrawerOpenState; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-22 19:35:50
|
Revision: 1880 http://skim-app.svn.sourceforge.net/skim-app/?rev=1880&view=rev Author: hofman Date: 2007-04-22 12:35:46 -0700 (Sun, 22 Apr 2007) Log Message: ----------- Pdfsync support. Parse pdfsync files and translate between tex lines and pdf pages and locations in a custom synchronizer object. Use applescript and a bundled script to let editors display a line from a tex file. Add preferences for tex editors to use, with a few preset editor settings. Modified Paths: -------------- trunk/Dutch.lproj/PreferenceWindow.nib/classes.nib trunk/Dutch.lproj/PreferenceWindow.nib/info.nib trunk/Dutch.lproj/PreferenceWindow.nib/keyedobjects.nib trunk/English.lproj/PreferenceWindow.nib/classes.nib trunk/English.lproj/PreferenceWindow.nib/keyedobjects.nib trunk/InitialUserDefaults.plist trunk/NSString_SKExtensions.h trunk/NSString_SKExtensions.m trunk/SKDocument.h trunk/SKDocument.m trunk/SKPDFView.m trunk/SKPreferenceController.h trunk/SKPreferenceController.m trunk/SKStringConstants.h trunk/SKStringConstants.m trunk/Skim.sdef trunk/Skim.xcodeproj/project.pbxproj Added Paths: ----------- trunk/NSCharacterSet_SKExtensions.h trunk/NSCharacterSet_SKExtensions.m trunk/NSScanner_SKExtensions.h trunk/NSScanner_SKExtensions.m trunk/SKDisplayTeXLineCommand.h trunk/SKDisplayTeXLineCommand.m trunk/SKPDFSynchronizer.h trunk/SKPDFSynchronizer.m trunk/displayline.sh Modified: trunk/Dutch.lproj/PreferenceWindow.nib/classes.nib =================================================================== --- trunk/Dutch.lproj/PreferenceWindow.nib/classes.nib 2007-04-21 16:53:39 UTC (rev 1879) +++ trunk/Dutch.lproj/PreferenceWindow.nib/classes.nib 2007-04-22 19:35:46 UTC (rev 1880) @@ -9,6 +9,7 @@ { ACTIONS = { changeDiscreteThumbnailSizes = id; + changeTeXEditorPreset = id; changeUpdateInterval = id; resetAll = id; resetCurrent = id; @@ -18,6 +19,7 @@ OUTLETS = { snapshotSizeSlider = NSSlider; tabView = NSTabView; + texEditorPopUpButton = NSPopUpButton; thumbnailSizeSlider = NSSlider; }; SUPERCLASS = NSWindowController; Modified: trunk/Dutch.lproj/PreferenceWindow.nib/info.nib =================================================================== --- trunk/Dutch.lproj/PreferenceWindow.nib/info.nib 2007-04-21 16:53:39 UTC (rev 1879) +++ trunk/Dutch.lproj/PreferenceWindow.nib/info.nib 2007-04-22 19:35:46 UTC (rev 1880) @@ -8,6 +8,10 @@ <string>446.1</string> <key>IBLockedObjects</key> <array/> + <key>IBOpenObjects</key> + <array> + <integer>5</integer> + </array> <key>IBSystem Version</key> <string>8P135</string> </dict> Modified: trunk/Dutch.lproj/PreferenceWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/PreferenceWindow.nib/classes.nib =================================================================== --- trunk/English.lproj/PreferenceWindow.nib/classes.nib 2007-04-21 16:53:39 UTC (rev 1879) +++ trunk/English.lproj/PreferenceWindow.nib/classes.nib 2007-04-22 19:35:46 UTC (rev 1880) @@ -9,6 +9,7 @@ { ACTIONS = { changeDiscreteThumbnailSizes = id; + changeTeXEditorPreset = id; changeUpdateInterval = id; resetAll = id; resetCurrent = id; @@ -18,6 +19,7 @@ OUTLETS = { snapshotSizeSlider = NSSlider; tabView = NSTabView; + texEditorPopUpButton = NSPopUpButton; thumbnailSizeSlider = NSSlider; }; SUPERCLASS = NSWindowController; Modified: trunk/English.lproj/PreferenceWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/InitialUserDefaults.plist =================================================================== --- trunk/InitialUserDefaults.plist 2007-04-21 16:53:39 UTC (rev 1879) +++ trunk/InitialUserDefaults.plist 2007-04-22 19:35:46 UTC (rev 1880) @@ -4,8 +4,6 @@ <dict> <key>RegisteredDefaults</key> <dict> - <key>SKAutoCheckFileUpdate</key> - <false/> <key>SKBackgroundColor</key> <data> BAt0eXBlZHN0cmVhbYED6IQBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMDhAJm @@ -121,6 +119,12 @@ BAt0eXBlZHN0cmVhbYED6IQBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm ZmZmAAABAYY= </data> + <key>SKAutoCheckFileUpdate</key> + <false/> + <key>SKTeXEditorCommand</key> + <string>/Applications/TextMate.app/Contents/SharedSupport/Support/bin/mate</string> + <key>SKTeXEditorArguments</key> + <string>-l %line "%file"</string> <key>SUCheckAtStartup</key> <false/> <key>SUScheduledCheckInterval</key> @@ -138,7 +142,6 @@ <string>SKSnapshotsOnTop</string> <string>SUCheckAtStartup</string> <string>SUScheduledCheckInterval</string> - <string>SKAutoCheckFileUpdate</string> </array> <key>display</key> <array> @@ -170,6 +173,12 @@ <string>SKTextNoteFontName</string> <string>SKTextNoteFontSize</string> </array> + <key>sync</key> + <array> + <string>SKAutoCheckFileUpdate</string> + <string>SKTeXEditorCommand</string> + <string>SKTeXEditorArguments</string> + </array> <key>other</key> <array> <string>SKLastOpenFileNames</string> Added: trunk/NSCharacterSet_SKExtensions.h =================================================================== --- trunk/NSCharacterSet_SKExtensions.h (rev 0) +++ trunk/NSCharacterSet_SKExtensions.h 2007-04-22 19:35:46 UTC (rev 1880) @@ -0,0 +1,44 @@ +// +// NSCharacterSet_SKExtensions.h +// Skim +// +// Created by Christiaan Hofman on 4/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> + + +@interface NSCharacterSet (SKExtensions) ++ (NSCharacterSet *)newlineCharacterSet; +@end Added: trunk/NSCharacterSet_SKExtensions.m =================================================================== --- trunk/NSCharacterSet_SKExtensions.m (rev 0) +++ trunk/NSCharacterSet_SKExtensions.m 2007-04-22 19:35:46 UTC (rev 1880) @@ -0,0 +1,56 @@ +// +// NSCharacterSet_SKExtensions.m +// Skim +// +// Created by Christiaan Hofman on 4/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 "NSCharacterSet_SKExtensions.h" + + +@implementation NSCharacterSet (SKExtensions) + ++ (NSCharacterSet *)newlineCharacterSet { + static NSCharacterSet *newlineCharacterSet = nil; + if (newlineCharacterSet == nil) { + NSMutableCharacterSet *tmpSet = [[NSCharacterSet whitespaceCharacterSet] mutableCopy]; + [tmpSet invert]; + [tmpSet formIntersectionWithCharacterSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + newlineCharacterSet = [tmpSet copy]; + [tmpSet release]; + } + return newlineCharacterSet; +} + +@end Added: trunk/NSScanner_SKExtensions.h =================================================================== --- trunk/NSScanner_SKExtensions.h (rev 0) +++ trunk/NSScanner_SKExtensions.h 2007-04-22 19:35:46 UTC (rev 1880) @@ -0,0 +1,44 @@ +// +// NSScanner_SKExtensions.h +// Skim +// +// Created by Christiaan Hofman on 4/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> + + +@interface NSScanner (SKExtensions) +- (BOOL)scanCharacter:(unichar *)ch; +@end Added: trunk/NSScanner_SKExtensions.m =================================================================== --- trunk/NSScanner_SKExtensions.m (rev 0) +++ trunk/NSScanner_SKExtensions.m 2007-04-22 19:35:46 UTC (rev 1880) @@ -0,0 +1,54 @@ +// +// NSScanner_SKExtensions.m +// Skim +// +// Created by Christiaan Hofman on 4/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 "NSScanner_SKExtensions.h" + + +@implementation NSScanner (SKExtensions) + +- (BOOL)scanCharacter:(unichar *)ch { + if ([self isAtEnd]) + return NO; + int location = [self scanLocation]; + if (ch != NULL) + *ch = [[self string] characterAtIndex:location]; + [self setScanLocation:location + 1]; + return YES; +} + +@end Modified: trunk/NSString_SKExtensions.h =================================================================== --- trunk/NSString_SKExtensions.h 2007-04-21 16:53:39 UTC (rev 1879) +++ trunk/NSString_SKExtensions.h 2007-04-22 19:35:46 UTC (rev 1880) @@ -43,5 +43,6 @@ - (NSString *)stringByCollapsingWhitespaceAndNewlinesAndRemovingSurroundingWhitespaceAndNewlines; - (NSString *)stringByAppendingEllipsis; +- (NSArray *)shellScriptArgumentsArray; @end Modified: trunk/NSString_SKExtensions.m =================================================================== --- trunk/NSString_SKExtensions.m 2007-04-21 16:53:39 UTC (rev 1879) +++ trunk/NSString_SKExtensions.m 2007-04-22 19:35:46 UTC (rev 1880) @@ -37,6 +37,8 @@ */ #import "NSString_SKExtensions.h" +#import "NSScanner_SKExtensions.h" +#import "NSCharacterSet_SKExtensions.h" #import <Carbon/Carbon.h> @@ -110,4 +112,60 @@ return [self stringByAppendingFormat:@"%C", 0x2026]; } +// parses a space separated list of shell script argments +// allows quoting parts of an argument and escaped characters outside quotes, according to shell rules +- (NSArray *)shellScriptArgumentsArray; +{ + static NSCharacterSet *specialChars = nil; + static NSCharacterSet *quoteChars = nil; + + if (specialChars == nil) { + NSMutableCharacterSet *tmpSet = [[NSCharacterSet whitespaceAndNewlineCharacterSet] mutableCopy]; + [tmpSet addCharactersInString:@"\\\"'`"]; + specialChars = [tmpSet copy]; + [tmpSet release]; + quoteChars = [[NSCharacterSet characterSetWithCharactersInString:@"\"'`"] retain]; + } + + NSScanner *scanner = [NSScanner scannerWithString:self]; + NSString *s = nil; + unichar ch = 0; + NSMutableString *currArg = [scanner isAtEnd] ? nil : [NSMutableString string]; + NSMutableArray *arguments = [NSMutableArray array]; + + [scanner setCharactersToBeSkipped:nil]; + [scanner scanCharactersFromSet:[NSCharacterSet whitespaceAndNewlineCharacterSet] intoString:NULL]; + + while ([scanner isAtEnd] == NO) { + if ([scanner scanUpToCharactersFromSet:specialChars intoString:&s]) + [currArg appendString:s]; + if ([scanner scanCharacter:&ch] == NO) + break; + if ([[NSCharacterSet whitespaceAndNewlineCharacterSet] characterIsMember:ch]) { + // argument separator, add the last one we found and ignore more whitespaces + [scanner scanCharactersFromSet:[NSCharacterSet whitespaceAndNewlineCharacterSet] intoString:NULL]; + [arguments addObject:currArg]; + currArg = [scanner isAtEnd] ? nil : [NSMutableString string]; + } else if (ch == '\\') { + // escaped character + if ([scanner scanCharacter:&ch] == NO) + [NSException raise:NSInternalInconsistencyException format:@"Missing character"]; + if ([currArg length] == 0 && [[NSCharacterSet newlineCharacterSet] characterIsMember:ch]) + // ignore escaped newlines between arguments, as they should be considered whitespace + [scanner scanCharactersFromSet:[NSCharacterSet newlineCharacterSet] intoString:NULL]; + else // real escaped character, just add the character, so we can ignore it if it is a special character + [currArg appendFormat:@"%C", ch]; + } else if ([quoteChars characterIsMember:ch]) { + // quoted part of an argument, scan up to the matching quote + if ([scanner scanUpToCharactersFromSet:[NSCharacterSet characterSetWithRange:NSMakeRange(ch, 1)] intoString:&s]) + [currArg appendString:s]; + if ([scanner scanCharacter:NULL] == NO) + [NSException raise:NSInternalInconsistencyException format:@"Unmatched %C", ch]; + } + } + if (currArg) + [arguments addObject:currArg]; + return arguments; +} + @end Added: trunk/SKDisplayTeXLineCommand.h =================================================================== --- trunk/SKDisplayTeXLineCommand.h (rev 0) +++ trunk/SKDisplayTeXLineCommand.h 2007-04-22 19:35:46 UTC (rev 1880) @@ -0,0 +1,43 @@ +// +// SKDisplayLineCommand.h +// Skim +// +// Created by Christiaan Hofman on 4/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> + + +@interface SKDisplayTeXLineCommand : NSScriptCommand +@end Added: trunk/SKDisplayTeXLineCommand.m =================================================================== --- trunk/SKDisplayTeXLineCommand.m (rev 0) +++ trunk/SKDisplayTeXLineCommand.m 2007-04-22 19:35:46 UTC (rev 1880) @@ -0,0 +1,83 @@ +// +// SKDisplayLineCommand.m +// Skim +// +// Created by Christiaan Hofman on 4/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 "SKDisplayTeXLineCommand.h" +#import "SKDocument.h" + + +@implementation SKDisplayTeXLineCommand + +- (id)performDefaultImplementation { + id lineNumber = [self directParameter]; + NSDictionary *args = [self evaluatedArguments]; + id file = [args objectForKey:@"file"]; + id project = [args objectForKey:@"project"]; + NSURL *projectURL = nil; + + if (project == nil) + project = file; + + if ([project isKindOfClass:[NSURL class]]) { + projectURL = project; + } else if ([project isKindOfClass:[NSString class]]) { + if ([project hasPrefix:@"file://"]) + projectURL = [NSURL URLWithString:project]; + else + projectURL = [NSURL fileURLWithPath:[project stringByStandardizingPath]]; + } + + if ([file isKindOfClass:[NSURL class]]) { + file = [file path]; + } else if ([file isKindOfClass:[NSString class]]) { + if ([file hasPrefix:@"file://"]) + file = [[NSURL URLWithString:file] path]; + else + file = [file stringByStandardizingPath]; + } + + if (file == nil || projectURL == nil) + return nil; + + SKDocument *document = [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:projectURL display:YES error:NULL]; + + [document displayTeXLine:[lineNumber intValue] fromFile:file]; + + return nil; +} + +@end Modified: trunk/SKDocument.h =================================================================== --- trunk/SKDocument.h 2007-04-21 16:53:39 UTC (rev 1879) +++ trunk/SKDocument.h 2007-04-22 19:35:46 UTC (rev 1880) @@ -50,7 +50,7 @@ extern NSString *SKPostScriptDocumentType; -@class PDFDocument, SKMainWindowController, SKPDFView; +@class PDFDocument, SKMainWindowController, SKPDFView, SKPDFSynchronizer; @interface SKDocument : NSDocument { @@ -64,6 +64,8 @@ PDFDocument *pdfDocument; NSMutableArray *noteDicts; + SKPDFSynchronizer *synchronizer; + NSTimer *fileUpdateTimer; NSDate *lastChangedDate; NSDate *previousCheckedDate; @@ -88,6 +90,10 @@ - (void)checkFileUpdatesIfNeeded; - (void)checkFileUpdateStatus:(NSTimer *)timer; +- (SKPDFSynchronizer *)synchronizer; +- (void)displayTeXLine:(int)line fromFile:(NSString *)file; +- (void)displayTeXEditorForLocation:(NSPoint)location inRect:(NSRect)rect atPageIndex:(unsigned int)pageIndex; + - (void)handleApplicationWillTerminateNotification:(NSNotification *)notification; - (void)handleWindowWillCloseNotification:(NSNotification *)notification; Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-04-21 16:53:39 UTC (rev 1879) +++ trunk/SKDocument.m 2007-04-22 19:35:46 UTC (rev 1880) @@ -48,6 +48,8 @@ #import "SKStringConstants.h" #import "SKPDFView.h" #import "SKNoteWindowController.h" +#import "SKPDFSynchronizer.h" +#import "NSString_SKExtensions.h" // maximum length of xattr value recommended by Apple #define MAX_XATTR_LENGTH 2048 @@ -81,6 +83,7 @@ [pdfData release]; [noteDicts release]; [readNotesAccessoryView release]; + [synchronizer release]; [super dealloc]; } @@ -583,6 +586,92 @@ fileUpdateTimer = nil; } +#pragma mark Pdfsync support + +- (SKPDFSynchronizer *)synchronizer { + if (synchronizer == nil) + synchronizer = [[SKPDFSynchronizer alloc] init]; + return synchronizer; +} + +- (void)displayTeXLine:(int)line fromFile:(NSString *)file{ + NSString *fileBase = [[self fileName] stringByDeletingPathExtension]; + NSString *pdfsyncFile = [fileBase stringByAppendingPathExtension:@"pdfsync"]; + NSString *texFile = file; + NSFileManager *fm = [NSFileManager defaultManager]; + + if ([[file pathExtension] length]) + texFile = [[file stringByDeletingPathExtension] stringByAppendingPathExtension:@"tex"]; + + if ([fm fileExistsAtPath:pdfsyncFile] == NO || [fm fileExistsAtPath:texFile] == NO) { + NSBeep(); + return; + } + + if ([[self synchronizer] parsePdfsyncFileIfNeeded:pdfsyncFile]) { + unsigned int pageIndex; + NSPoint point; + + if ([[self synchronizer] getPageIndex:&pageIndex location:&point forLine:line inFile:texFile]) { + PDFPage *page = [[[self pdfView] document] pageAtIndex:pageIndex]; + PDFDestination *dest = [[PDFDestination alloc] initWithPage:page atPoint:point]; + + [[self pdfView] goToDestination:dest]; + } else NSBeep(); + } else NSBeep(); +} + +- (void)showEditorForFile:(NSString *)file atLine:(unsigned int)line { + NSTask *task = [[[NSTask alloc] init] autorelease]; + NSString *editorCmd = [[NSUserDefaults standardUserDefaults] objectForKey:SKTeXEditorCommandKey]; + NSMutableString *argString = [[[NSUserDefaults standardUserDefaults] objectForKey:SKTeXEditorArgumentsKey] mutableCopy]; + NSArray *arguments; + + [argString replaceOccurrencesOfString:@"%file" withString:file options:NSLiteralSearch range: NSMakeRange(0, [argString length] )]; + [argString replaceOccurrencesOfString:@"%line" withString:[NSString stringWithFormat:@"%d", line] options:NSLiteralSearch range:NSMakeRange(0, [argString length])]; + arguments = [argString shellScriptArgumentsArray]; + [argString release]; + + [task setCurrentDirectoryPath:[file stringByDeletingLastPathComponent]]; + [task setLaunchPath:editorCmd]; + [task setArguments:arguments]; + [task launch]; +} + +- (void)displayTeXEditorForLocation:(NSPoint)location inRect:(NSRect)rect atPageIndex:(unsigned int)pageIndex { + NSString *fileBase = [[self fileName] stringByDeletingPathExtension]; + NSString *pdfsyncFile = [fileBase stringByAppendingPathExtension:@"pdfsync"]; + NSFileManager *fm = [NSFileManager defaultManager]; + + if ([fm fileExistsAtPath:pdfsyncFile] == NO) { + NSLog(@"pdfsync file %@ doesn't exist", pdfsyncFile); + NSBeep(); + return; + } + + if ([[self synchronizer] parsePdfsyncFileIfNeeded:pdfsyncFile]) { + NSString *file; + int line; + + if ([[self synchronizer] getLine:&line file:&file forLocation:location inRect:rect atPageIndex:pageIndex]) { + if ([fm fileExistsAtPath:file] == NO) { + NSLog(@"tex file %@ doesn't exist", file); + NSBeep(); + return; + } + + [self showEditorForFile:file atLine:line]; + + } else { + NSLog(@"Couldn't find file and line"); + NSBeep(); + } + } else { + NSLog(@"Parsing pdfsync file %@ failed", pdfsyncFile); + NSBeep(); + } +} + #pragma mark Accessors - (SKMainWindowController *)mainWindowController { Added: trunk/SKPDFSynchronizer.h =================================================================== --- trunk/SKPDFSynchronizer.h (rev 0) +++ trunk/SKPDFSynchronizer.h 2007-04-22 19:35:46 UTC (rev 1880) @@ -0,0 +1,57 @@ +// +// SKPDFSynchronizer.h +// Skim +// +// Created by Christiaan Hofman on 4/21/07. +/* + This software is Copyright (c) 2007 + Christiaan Hofman. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of Christiaan Hofman nor the names of any + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import <Cocoa/Cocoa.h> + + +@interface SKPDFSynchronizer : NSObject { + NSString *fileName; + NSMutableArray *pages; + NSMutableDictionary *lines; + NSMutableDictionary *records; + int version; + NSDate *lastModDate; +} + +- (BOOL)parsePdfsyncFile:(NSString *)filePath; +- (BOOL)parsePdfsyncFileIfNeeded:(NSString *)path; + +- (BOOL)getLine:(int *)line file:(NSString **)file forLocation:(NSPoint)point inRect:(NSRect)rect atPageIndex:(unsigned int)pageIndex; +- (BOOL)getPageIndex:(unsigned int *)pageIndex location:(NSPoint *)point forLine:(int)line inFile:(NSString *)file; + +@end Added: trunk/SKPDFSynchronizer.m =================================================================== --- trunk/SKPDFSynchronizer.m (rev 0) +++ trunk/SKPDFSynchronizer.m 2007-04-22 19:35:46 UTC (rev 1880) @@ -0,0 +1,363 @@ +// +// SKPDFSynchronizer.m +// Skim +// +// Created by Christiaan Hofman on 4/21/07. +/* + This software is Copyright (c) 2007 + Christiaan Hofman. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of Christiaan Hofman nor the names of any + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "SKPDFSynchronizer.h" +#import "NSCharacterSet_SKExtensions.h" +#import "NSScanner_SKExtensions.h" + + +@implementation SKPDFSynchronizer + +// Offset of coordinates in PDFKit and what pdfsync tells us. Don't know what they are; is this implementation dependent? +static NSPoint pdfOffset = {0.0, 0.0}; + +- (id)init { + if (self = [super init]) { + pages = [[NSMutableArray alloc] init]; + lines = [[NSMutableDictionary alloc] init]; + records = [[NSMutableDictionary alloc] init]; + version = 0; + fileName = nil; + lastModDate = nil; + } + return self; +} + +- (void)dealloc { + [pages release]; + [lines release]; + [records release]; + [fileName release]; + [lastModDate release]; + [super dealloc]; +} + + +- (BOOL)parsePdfsyncFileIfNeeded:(NSString *)path { + NSFileManager *fm = [NSFileManager defaultManager]; + NSDate *modDate = [[fm fileAttributesAtPath:path traverseLink:NO] fileModificationDate]; + + if ([fm fileExistsAtPath:path] == NO) + return NO; + + if (lastModDate == nil || [path isEqualToString:fileName] == NO || [modDate compare:lastModDate] == NSOrderedDescending) + return [self parsePdfsyncFile:path]; + + return YES; +} + +- (BOOL)parsePdfsyncFile:(NSString *)path { + NSFileManager *fm = [NSFileManager defaultManager]; + + [pages removeAllObjects]; + [lines removeAllObjects]; + + if ([fm fileExistsAtPath:path] == NO) + return NO; + + [lastModDate release]; + lastModDate = [[[fm fileAttributesAtPath:path traverseLink:NO] fileModificationDate] retain]; + + [fileName release]; + fileName = [path retain]; + + NSString *basePath = [fileName stringByDeletingLastPathComponent]; + NSMutableArray *files = [NSMutableArray array]; + NSString *pdfsyncString = [NSString stringWithContentsOfFile:fileName encoding:NSUTF8StringEncoding error:NULL]; + NSString *file; + int recordIndex, line, column; + float x, y; + NSMutableDictionary *record; + NSMutableArray *array; + NSNumber *recordNumber; + NSNumber *lineNumber; + NSNumber *pageNumber; + NSNumber *xNumber; + NSNumber *yNumber; + + if ([pdfsyncString length] == 0) + return NO; + + NSScanner *scanner = [[NSScanner alloc] initWithString:pdfsyncString]; + unichar ch; + + [scanner setCharactersToBeSkipped:[NSCharacterSet whitespaceCharacterSet]]; + + if ([scanner scanUpToCharactersFromSet:[NSCharacterSet newlineCharacterSet] intoString:&file] == NO || + [scanner scanCharactersFromSet:[NSCharacterSet newlineCharacterSet] intoString:NULL] == NO) { + [scanner release]; + return NO; + } + + if ([[file pathExtension] caseInsensitiveCompare:@"tex"] != NSOrderedSame) + file = [file stringByAppendingPathExtension:@"tex"]; + + file = [basePath stringByAppendingPathComponent:file]; + [files addObject:file]; + + array = [[NSMutableArray alloc] init]; + [lines setObject:array forKey:file]; + [array release]; + + if ([scanner scanString:@"version" intoString:NULL] == NO || + [scanner scanInt:&version] == NO) { + [scanner release]; + return NO; + } + + [scanner scanCharactersFromSet:[NSCharacterSet newlineCharacterSet] intoString:NULL]; + + while ([scanner isAtEnd] == NO) { + + [scanner scanCharacter:&ch]; + + if (ch == 'l') { + if ([scanner scanInt:&recordIndex] && [scanner scanInt:&line]) { + [scanner scanInt:&column]; + recordNumber = [[NSNumber alloc] initWithInt:recordIndex]; + lineNumber = [[NSNumber alloc] initWithInt:line]; + record = [records objectForKey:recordNumber]; + if (record == nil) { + record = [[NSMutableDictionary alloc] init]; + [records setObject:record forKey:recordNumber]; + [record release]; + } + [record setObject:file forKey:@"file"]; + [record setObject:lineNumber forKey:@"line"]; + [[lines objectForKey:file] addObject:record]; + [lineNumber release]; + [recordNumber release]; + } + } else if (ch == 'p') { + [scanner scanString:@"*" intoString:NULL] || [scanner scanString:@"+" intoString:NULL]; + if ([scanner scanInt:&recordIndex] && [scanner scanFloat:&x] && [scanner scanFloat:&y]) { + recordNumber = [[NSNumber alloc] initWithInt:recordIndex]; + pageNumber = [[NSNumber alloc] initWithUnsignedInt:[pages count] - 1]; + xNumber = [[NSNumber alloc] initWithFloat:x / 65536 + pdfOffset.x]; + yNumber = [[NSNumber alloc] initWithFloat:y / 65536 + pdfOffset.y]; + record = [records objectForKey:recordNumber]; + if (record == nil) { + record = [[NSMutableDictionary alloc] initWithObjectsAndKeys:recordNumber, @"recordIndex", nil]; + [records setObject:record forKey:recordNumber]; + [record release]; + } + [record setObject:pageNumber forKey:@"page"]; + [record setObject:xNumber forKey:@"x"]; + [record setObject:yNumber forKey:@"y"]; + [[pages lastObject] addObject:record]; + [pageNumber release]; + [xNumber release]; + [yNumber release]; + [recordNumber release]; + } + } else if (ch == 's') { + [scanner scanInt:NULL]; + array = [[NSMutableArray alloc] init]; + [pages addObject:array]; + [array release]; + } else if (ch == '(') { + if ([scanner scanUpToCharactersFromSet:[NSCharacterSet newlineCharacterSet] intoString:&file]) { + if ([[file pathExtension] caseInsensitiveCompare:@"tex"] != NSOrderedSame) + file = [file stringByAppendingPathExtension:@"tex"]; + file = [basePath stringByAppendingPathComponent:file]; + [files addObject:file]; + record = [lines objectForKey:file]; + if (record == nil) { + array = [[NSMutableArray alloc] init]; + [lines setObject:array forKey:file]; + [array release]; + } + } + } else if (ch == ')') { + [files removeLastObject]; + file = [files lastObject]; + } + + [scanner scanUpToCharactersFromSet:[NSCharacterSet newlineCharacterSet] intoString:NULL]; + [scanner scanCharactersFromSet:[NSCharacterSet newlineCharacterSet] intoString:NULL]; + } + + [scanner release]; + + NSSortDescriptor *lineSortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"line" ascending:YES] autorelease]; + NSSortDescriptor *xSortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"x" ascending:YES] autorelease]; + NSSortDescriptor *ySortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"y" ascending:NO] autorelease]; + NSEnumerator *e; + NSArray *sortDescriptors; + + e = [lines objectEnumerator]; + sortDescriptors = [NSArray arrayWithObjects:lineSortDescriptor, nil]; + while (array = [e nextObject]) + [array sortUsingDescriptors:sortDescriptors]; + + e = [pages objectEnumerator]; + sortDescriptors = [NSArray arrayWithObjects:ySortDescriptor, xSortDescriptor, nil]; + while (array = [e nextObject]) + [array sortUsingDescriptors:sortDescriptors]; + + return YES; +} + +- (BOOL)getLine:(int *)line file:(NSString **)file forLocation:(NSPoint)point inRect:(NSRect)rect atPageIndex:(unsigned int)pageIndex { + if (pageIndex >= [pages count]) + return NO; + + NSDictionary *beforeRecord = nil; + NSDictionary *afterRecord = nil; + NSMutableDictionary *atRecords = [NSMutableDictionary dictionary]; + NSEnumerator *recordEnum = [[pages objectAtIndex:pageIndex] objectEnumerator]; + NSDictionary *record = nil; + + while (record = [recordEnum nextObject]) { + if ([record objectForKey:@"line"] == nil) + continue; + float x = [[record objectForKey:@"x"] floatValue]; + float y = [[record objectForKey:@"y"] floatValue]; + if (y > NSMaxY(rect)) { + beforeRecord = record; + } else if (y < NSMinY(rect)) { + afterRecord = record; + break; + } else if (x < NSMinX(rect)) { + beforeRecord = record; + } else if (x > NSMaxX(rect)) { + afterRecord = record; + break; + } else { + [atRecords setObject:record forKey:[NSNumber numberWithFloat:fabs(x - point.x)]]; + } + } + + record = nil; + if ([atRecords count]) { + NSNumber *nearest = [[[atRecords allKeys] sortedArrayUsingSelector:@selector(compare:)] objectAtIndex:0]; + record = [atRecords objectForKey:nearest]; + } else if (beforeRecord && afterRecord) { + float beforeX = [[beforeRecord objectForKey:@"x"] floatValue]; + float beforeY = [[beforeRecord objectForKey:@"y"] floatValue]; + float afterX = [[afterRecord objectForKey:@"x"] floatValue]; + float afterY = [[afterRecord objectForKey:@"y"] floatValue]; + if (beforeY - point.y < point.y - afterY) + record = beforeRecord; + else if (beforeY - point.y > point.y - afterY) + record = afterRecord; + else if (beforeX - point.x < point.x - afterX) + record = beforeRecord; + else if (beforeX - point.x > point.x - afterX) + record = afterRecord; + else + record = beforeRecord; + } else if (beforeRecord) { + record = beforeRecord; + } else if (afterRecord) { + record = afterRecord; + } + + if (record) { + if (line) + *line = [record objectForKey:@"line"] ? [[record objectForKey:@"line"] intValue] : -1; + if (file) + *file = [record objectForKey:@"file"] ? [record objectForKey:@"file"] : nil; + return YES; + } else { + if (line) + *line = -1; + if (file) + *file = nil; + return NO; + } +} + +- (BOOL)getPageIndex:(unsigned int *)pageIndex location:(NSPoint *)point forLine:(int)line inFile:(NSString *)file { + if (line < 0 || file == nil || [lines objectForKey:file] == nil) + return NO; + + NSDictionary *beforeRecord = nil; + NSDictionary *afterRecord = nil; + NSDictionary *atRecord = nil; + NSEnumerator *recordEnum = [[lines objectForKey:file] objectEnumerator]; + NSDictionary *record = nil; + + while (record = [recordEnum nextObject]) { + if ([record objectForKey:@"page"] == nil) + continue; + int l = [[record objectForKey:@"line"] intValue]; + if (l < line) { + beforeRecord = record; + } else if (l > line) { + afterRecord = record; + break; + } else { + atRecord = record; + break; + } + } + + if (atRecord) { + record = atRecord; + } else if (beforeRecord && afterRecord) { + int beforeLine = [[beforeRecord objectForKey:@"line"] intValue]; + int afterLine = [[afterRecord objectForKey:@"line"] intValue]; + if (beforeLine - line < line - afterLine) + record = beforeRecord; + else if (beforeLine - line > line - afterLine) + record = afterRecord; + else + record = beforeRecord; + } else if (beforeRecord) { + record = beforeRecord; + } else if (afterRecord) { + record = afterRecord; + } + + if (record) { + if (pageIndex) + *pageIndex = [record objectForKey:@"page"] ? [[record objectForKey:@"page"] unsignedIntValue] : NSNotFound; + if (point) + *point = [record objectForKey:@"x"] ? NSMakePoint([[record objectForKey:@"x"] floatValue], [[record objectForKey:@"y"] floatValue]) : NSZeroPoint; + return YES; + } else { + if (pageIndex) + *pageIndex = NSNotFound; + if (point) + *point = NSZeroPoint; + return NO; + } +} + +@end Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-21 16:53:39 UTC (rev 1879) +++ trunk/SKPDFView.m 2007-04-22 19:35:46 UTC (rev 1880) @@ -48,6 +48,8 @@ #import "SKStringConstants.h" #import "NSUserDefaultsController_SKExtensions.h" #import "SKReadingBar.h" +#import "SKDocument.h" +#import "SKPDFSynchronizer.h" NSString *SKPDFViewToolModeChangedNotification = @"SKPDFViewToolModeChangedNotification"; NSString *SKPDFViewAnnotationModeChangedNotification = @"SKPDFViewAnnotationModeChangedNotification"; @@ -93,6 +95,7 @@ - (void)magnifyWithEvent:(NSEvent *)theEvent; - (void)dragWithEvent:(NSEvent *)theEvent; - (void)dragReadingBarWithEvent:(NSEvent *)theEvent; +- (void)pdfsyncWithEvent:(NSEvent *)theEvent; @end @@ -600,7 +603,10 @@ mouseDownLoc = [theEvent locationInWindow]; if ([theEvent modifierFlags] & NSCommandKeyMask) { - [self selectSnapshotWithEvent:theEvent]; + if ([theEvent modifierFlags] & NSShiftKeyMask) + [self pdfsyncWithEvent:theEvent]; + else + [self selectSnapshotWithEvent:theEvent]; } else { switch (toolMode) { case SKTextToolMode: @@ -2563,6 +2569,17 @@ [self flagsChanged:theEvent]; // update cursor } +- (void)pdfsyncWithEvent:(NSEvent *)theEvent { + NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; + PDFPage *page = [self pageForPoint:mouseLoc nearest:YES]; + NSPoint location = [self convertPoint:mouseLoc toPage:page]; + unsigned int pageIndex = [[self document] indexForPage:page]; + PDFSelection *sel = [page selectionForLineAtPoint:location]; + NSRect rect = [sel string] ? [sel boundsForPage:page] : NSMakeRect(location.x - 20.0, location.y - 5.0, 40.0, 10.0); + + [(SKDocument *)[[[self window] windowController] document] displayTeXEditorForLocation:location inRect:rect atPageIndex:pageIndex]; +} + @end #pragma mark Core Graphics extension Modified: trunk/SKPreferenceController.h =================================================================== --- trunk/SKPreferenceController.h 2007-04-21 16:53:39 UTC (rev 1879) +++ trunk/SKPreferenceController.h 2007-04-22 19:35:46 UTC (rev 1880) @@ -43,18 +43,25 @@ IBOutlet NSTabView *tabView; IBOutlet NSSlider *thumbnailSizeSlider; IBOutlet NSSlider *snapshotSizeSlider; + IBOutlet NSPopUpButton *texEditorPopUpButton; NSMutableArray *fonts; NSMutableArray *sizes; + NSMutableArray *texEditorCommands; + NSMutableArray *texEditorArguments; NSDictionary *resettableKeys; + BOOL isCustomTeXEditor; } + (id)sharedPrefenceController; - (NSArray *)fonts; - (NSArray *)sizes; +- (BOOL)isCustomTeXEditor; +- (void)setCustomTeXEditor:(BOOL)flag; - (IBAction)changeDiscreteThumbnailSizes:(id)sender; - (IBAction)changeUpdateInterval:(id)sender; +- (IBAction)changeTeXEditorPreset:(id)sender; - (IBAction)resetAll:(id)sender; - (IBAction)resetCurrent:(id)sender; Modified: trunk/SKPreferenceController.m =================================================================== --- trunk/SKPreferenceController.m 2007-04-21 16:53:39 UTC (rev 1879) +++ trunk/SKPreferenceController.m 2007-04-22 19:35:46 UTC (rev 1880) @@ -73,6 +73,11 @@ [NSNumber numberWithFloat:14.0], [NSNumber numberWithFloat:16.0], [NSNumber numberWithFloat:18.0], [NSNumber numberWithFloat:20.0], [NSNumber numberWithFloat:24.0], [NSNumber numberWithFloat:28.0], [NSNumber numberWithFloat:32.0], [NSNumber numberWithFloat:48.0], [NSNumber numberWithFloat:64.0], nil]; + texEditorCommands = [[NSMutableArray alloc] initWithObjects:@"/Applications/TextMate.app/Contents/SharedSupport/Support/bin/mate", @"/Applications/BBEdit.app/Contents/Resources/bbedit", @"/Applications/TextWrangler.app/Contents/Resources/edit", @"/Applications/Emacs.app/Contents/MacOS/bin/emacsclient", nil]; + texEditorArguments = [[NSMutableArray alloc] initWithObjects:@"-l %line \"%file\"", @"+%line \"%file\"", @"+%line \"%file\"", @"--no-wait +%line \"%file\"", nil]; + + isCustomTeXEditor = [texEditorCommands containsObject:[[NSUserDefaults standardUserDefaults] stringForKey:SKTeXEditorCommandKey]] == NO || + [texEditorArguments containsObject:[[NSUserDefaults standardUserDefaults] stringForKey:SKTeXEditorArgumentsKey]] == NO; } return self; } @@ -81,6 +86,8 @@ [resettableKeys release]; [fonts release]; [sizes release]; + [texEditorCommands release]; + [texEditorArguments release]; [super dealloc]; } @@ -88,6 +95,14 @@ return @"PreferenceWindow"; } +- (void)windowDidLoad { + if (isCustomTeXEditor) { + [texEditorPopUpButton selectItem:[texEditorPopUpButton lastItem]]; + } else { + [texEditorPopUpButton selectItemAtIndex:[texEditorCommands indexOfObject:[[NSUserDefaults standardUserDefaults] stringForKey:SKTeXEditorCommandKey]]]; + } +} + - (NSArray *)fonts { return fonts; } @@ -96,6 +111,14 @@ return sizes; } +- (BOOL)isCustomTeXEditor { + return isCustomTeXEditor; +} + +- (void)setCustomTeXEditor:(BOOL)flag { + isCustomTeXEditor = flag; +} + - (IBAction)changeDiscreteThumbnailSizes:(id)sender { if ([sender state] == NSOnState) { [thumbnailSizeSlider setNumberOfTickMarks:8]; @@ -120,6 +143,17 @@ [[[NSApp delegate] updater] scheduleCheckWithInterval:checkInterval]; } +- (IBAction)changeTeXEditorPreset:(id)sender { + unsigned int index = [sender indexOfSelectedItem]; + if (index < [texEditorCommands count]) { + [[NSUserDefaults standardUserDefaults] setObject:[texEditorCommands objectAtIndex:index] forKey:SKTeXEditorCommandKey]; + [[NSUserDefaults standardUserDefaults] setObject:[texEditorArguments objectAtIndex:index] forKey:SKTeXEditorArgumentsKey]; + [self setCustomTeXEditor:NO]; + } else { + [self setCustomTeXEditor:YES]; + } +} + - (void)resetSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { if (returnCode == NSAlertDefaultReturn) { NSString *tabID = (NSString *)contextInfo; Modified: trunk/SKStringConstants.h =================================================================== --- trunk/SKStringConstants.h 2007-04-21 16:53:39 UTC (rev 1879) +++ trunk/SKStringConstants.h 2007-04-22 19:35:46 UTC (rev 1880) @@ -38,6 +38,8 @@ extern NSString *SKAutoCheckFileUpdateKey; +extern NSString *SKTeXEditorArgumentsKey; +extern NSString *SKTeXEditorCommandKey; extern NSString *SKBackgroundColorKey; extern NSString *SKFullScreenBackgroundColorKey; extern NSString *SKLastOpenFileNamesKey; Modified: trunk/SKStringConstants.m =================================================================== --- trunk/SKStringConstants.m 2007-04-21 16:53:39 UTC (rev 1879) +++ trunk/SKStringConstants.m 2007-04-22 19:35:46 UTC (rev 1880) @@ -39,6 +39,8 @@ #import "SKStringConstants.h" NSString *SKAutoCheckFileUpdateKey = @"SKAutoCheckFileUpdate"; +NSString *SKTeXEditorArgumentsKey = @"SKTeXEditorArguments"; +NSString *SKTeXEditorCommandKey = @"SKTeXEditorCommand"; NSString *SKBackgroundColorKey = @"SKBackgroundColor"; NSString *SKFullScreenBackgroundColorKey = @"SKFullScreenBackgroundColor"; NSString *SKLastOpenFileNamesKey = @"SKLastOpenFileNames"; Modified: trunk/Skim.sdef =================================================================== --- trunk/Skim.sdef 2007-04-21 16:53:39 UTC (rev 1879) +++ trunk/Skim.sdef 2007-04-22 19:35:46 UTC (rev 1880) @@ -589,6 +589,26 @@ </direct-parameter> </command> + <command name="display TeX line" code="SKIMDTLn" + description="Open the file, and go to a location in the PDF corresponding to the line in a TeX file."> + <cocoa class="SKDisplayTeXLineCommand"/> + <direct-parameter type="integer" + description="The line number in the TeX file."> + </direct-parameter> + <parameter name="of file" code="File" optional="no" + description="The file name"> + <type type="text"/> + <type type="file"/> + <cocoa key="file"/> + </parameter> + <parameter name="in project" code="Proj" optional="yes" + description="The base TeX file name, if the file is included."> + <type type="text"/> + <type type="file"/> + <cocoa key="project"/> + </parameter> + </command> + </suite> </dictionary> Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-04-21 16:53:39 UTC (rev 1879) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-04-22 19:35:46 UTC (rev 1880) @@ -64,6 +64,16 @@ CE15832E0BA0740000D5B03F /* ToolbarUnderlineNote.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CE15832A0BA073FF00D5B03F /* ToolbarUnderlineNote.tiff */; }; CE15832F0BA0740000D5B03F /* UnderlineNoteAdorn.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CE15832B0BA073FF00D5B03F /* UnderlineNoteAdorn.tiff */; }; CE1E25680BDA61E80011D9DD /* ReadNotesAccessoryView.nib in Resources */ = {isa = PBXBuildFile; fileRef = CE1E25660BDA61E80011D9DD /* ReadNotesAccessoryView.nib */; }; + CE1E2B280BDAB6180011D9DD /* SKPDFSynchronizer.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE1E2B260BDAB6180011D9DD /* SKPDFSynchronizer.h */; }; + CE1E2B290BDAB6180011D9DD /* SKPDFSynchronizer.m in Sources */ = {isa = PBXBuildFile; fileRef = CE1E2B270BDAB6180011D9DD /* SKPDFSynchronizer.m */; }; + CE1E2E5F0BDB6C1F0011D9DD /* SKDisplayTeXLineCommand.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE1E2E5D0BDB6C1F0011D9DD /* SKDisplayTeXLineCommand.h */; }; + CE1E2E600BDB6C1F0011D9DD /* SKDisplayTeXLineCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = CE1E2E5E0BDB6C1F0011D9DD /* SKDisplayTeXLineCommand.m */; }; + CE1E2F130BDB86A20011D9DD /* displayline.sh in Resources */ = {isa = PBXBuildFile; fileRef = CE1E2F120BDB86A10011D9DD /* displayline.sh */; }; + CE1E301C0BDB9D5C0011D9DD /* NSScanner_SKExtensions.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE1E301A0BDB9D5C0011D9DD /* NSScanner_SKExtensions.h */; }; + CE1E301D0BDB9D5C0011D9DD /* NSScanner_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE1E301B0BDB9D5C0011D9DD /* NSScanner_SKExtensions.m */; }; + CE1E30280BDB9D8E0011D9DD /* NSCharacterSet_SKExtensions.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE1E30260BDB9D8E0011D9DD /* NSCharacterSet_SKExtensions.h */; }; + CE1E30290BDB9D8E0011D9DD /* NSCharacterSet_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CE1E30270BDB9D8E0011D9DD /* NSCharacterSet_SKExtensions.m */; }; + CE1E39E10BDBD6AC0011D9DD /* skimnotes in Resources */ = {isa = PBXBuildFile; fileRef = CEF3BF750B99CA2900E12E3D /* skimnotes */; }; CE2BD83E0BD4132B00A5F4DB /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE2BD82A0BD4132B00A5F4DB /* Sparkle.framework */; }; CE2BD8450BD4135600A5F4DB /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE2BD82A0BD4132B00A5F4DB /* Sparkle.framework */; }; CE2DE4920B85D48F00D0DA12 /* SKThumbnail.m in Sources */ = {isa = PBXBuildFile; fileRef = CE2DE4910B85D48F00D0DA12 /* SKThumbnail.m */; }; @@ -172,6 +182,13 @@ remoteGlobalIDString = CE4DA8D60B9E16100039E89C; remoteInfo = "Skim Help"; }; + CE1E39870BDBCC930011D9DD /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 2A37F4A9FDCFA73011CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = CEF3BF740B99CA2900E12E3D /* skimnotes */; + remoteInfo = skimnotes; + }; CE2BD81F0BD4127A00A5F4DB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = CE2BD8170BD4127A00A5F4DB /* Sparkle.xcodeproj */; @@ -210,6 +227,10 @@ dstSubfolderSpec = 10; files = ( CE2BD8450BD4135600A5F4DB /* Sparkle.framework in CopyFiles */, + CE1E2B280BDAB6180011D9DD /* SKPDFSynchronizer.h in CopyFiles */, + CE1E2E5F0BDB6C1F0011D9DD /* SKDisplayTeXLineCommand.h in CopyFiles */, + CE1E301C0BDB9D5C0011D9DD /* NSScanner_SKExtensions.h in CopyFiles */, + CE1E30280BDB9D8E0011D9DD /* NSCharacterSet_SKExtensions.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -284,6 +305,15 @@ CE1E25670BDA61E80011D9DD /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/ReadNotesAccessoryView.nib; sourceTree = "<group>"; }; CE1E259E0BDA6E4D0011D9DD /* Dutch */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Dutch; path = Dutch.lproj/ReadNotesAccessoryView.nib; sourceTree = "<group>"; }; CE1E259F0BDA6E570011D9DD /* Italian */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Italian; path = Italian.lproj/ReadNotesAccessoryView.nib; sourceTree = "<group>"; }; + CE1E2B260BDAB6180011D9DD /* SKPDFSynchronizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKPDFSynchronizer.h; sourceTree = "<group>"; }; + CE1E2B270BDAB6180011D9DD /* SKPDFSynchronizer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKPDFSynchronizer.m; sourceTree = "<group>"; }; + CE1E2E5D0BDB6C1F0011D9DD /* SKDisplayTeXLineCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKDisplayTeXLineCommand.h; sourceTree = "<group>"; }; + CE1E2E5E0BDB6C1F0011D9DD /* SKDisplayTeXLineCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKDisplayTeXLineCommand.m; sourceTree = "<group>"; }; + CE1E2F120BDB86A10011D9DD /* displayline.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = displayline.sh; sourceTree = "<group>"; }; + CE1E301A0BDB9D5C0011D9DD /* NSScanner_SKExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSScanner_SKExtensions.h; sourceTree = "<group>"; };... [truncated message content] |
From: <ho...@us...> - 2007-04-21 16:53:42
|
Revision: 1879 http://skim-app.svn.sourceforge.net/skim-app/?rev=1879&view=rev Author: hofman Date: 2007-04-21 09:53:39 -0700 (Sat, 21 Apr 2007) Log Message: ----------- Fix menu item. Modified Paths: -------------- trunk/Dutch.lproj/MainMenu.nib/keyedobjects.nib trunk/Dutch.lproj/ReadNotesAccessoryView.nib/info.nib trunk/Dutch.lproj/ReadNotesAccessoryView.nib/keyedobjects.nib trunk/English.lproj/MainMenu.nib/keyedobjects.nib trunk/Italian.lproj/MainMenu.nib/info.nib trunk/Italian.lproj/MainMenu.nib/keyedobjects.nib Modified: trunk/Dutch.lproj/MainMenu.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Dutch.lproj/ReadNotesAccessoryView.nib/info.nib =================================================================== --- trunk/Dutch.lproj/ReadNotesAccessoryView.nib/info.nib 2007-04-21 16:21:13 UTC (rev 1878) +++ trunk/Dutch.lproj/ReadNotesAccessoryView.nib/info.nib 2007-04-21 16:53:39 UTC (rev 1879) @@ -7,7 +7,7 @@ <key>IBEditorPositions</key> <dict> <key>5</key> - <string>560 603 320 76 0 0 1440 938 </string> + <string>532 603 376 76 0 0 1440 938 </string> </dict> <key>IBFramework Version</key> <string>446.1</string> Modified: trunk/Dutch.lproj/ReadNotesAccessoryView.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/MainMenu.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/MainMenu.nib/info.nib =================================================================== --- trunk/Italian.lproj/MainMenu.nib/info.nib 2007-04-21 16:21:13 UTC (rev 1878) +++ trunk/Italian.lproj/MainMenu.nib/info.nib 2007-04-21 16:53:39 UTC (rev 1879) @@ -7,10 +7,14 @@ <key>IBEditorPositions</key> <dict> <key>29</key> - <string>140 614 542 44 0 0 1440 938 </string> + <string>140 614 654 44 0 0 1440 938 </string> </dict> <key>IBFramework Version</key> <string>446.1</string> + <key>IBOpenObjects</key> + <array> + <integer>29</integer> + </array> <key>IBSystem Version</key> <string>8P135</string> </dict> Modified: trunk/Italian.lproj/MainMenu.nib/keyedobjects.nib =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-21 16:21:14
|
Revision: 1878 http://skim-app.svn.sourceforge.net/skim-app/?rev=1878&view=rev Author: hofman Date: 2007-04-21 09:21:13 -0700 (Sat, 21 Apr 2007) Log Message: ----------- Add accessory view to open panel for reading notes from .skim file, to add or replace notes. Modified Paths: -------------- trunk/SKDocument.h trunk/SKDocument.m trunk/SKMainWindowController.h trunk/SKMainWindowController.m trunk/Skim.xcodeproj/project.pbxproj Added Paths: ----------- trunk/Dutch.lproj/ReadNotesAccessoryView.nib/ trunk/Dutch.lproj/ReadNotesAccessoryView.nib/classes.nib trunk/Dutch.lproj/ReadNotesAccessoryView.nib/info.nib trunk/Dutch.lproj/ReadNotesAccessoryView.nib/keyedobjects.nib trunk/English.lproj/ReadNotesAccessoryView.nib/ trunk/English.lproj/ReadNotesAccessoryView.nib/classes.nib trunk/English.lproj/ReadNotesAccessoryView.nib/info.nib trunk/English.lproj/ReadNotesAccessoryView.nib/keyedobjects.nib trunk/Italian.lproj/ReadNotesAccessoryView.nib/ trunk/Italian.lproj/ReadNotesAccessoryView.nib/classes.nib trunk/Italian.lproj/ReadNotesAccessoryView.nib/info.nib trunk/Italian.lproj/ReadNotesAccessoryView.nib/keyedobjects.nib Added: trunk/Dutch.lproj/ReadNotesAccessoryView.nib/classes.nib =================================================================== --- trunk/Dutch.lproj/ReadNotesAccessoryView.nib/classes.nib (rev 0) +++ trunk/Dutch.lproj/ReadNotesAccessoryView.nib/classes.nib 2007-04-21 16:21:13 UTC (rev 1878) @@ -0,0 +1,13 @@ +{ + IBClasses = ( + {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + { + ACTIONS = {readNotes = id; saveArchive = id; }; + CLASS = SKDocument; + LANGUAGE = ObjC; + OUTLETS = {readNotesAccessoryView = NSView; replaceNotesCheckButton = NSButton; }; + SUPERCLASS = NSDocument; + } + ); + IBVersion = 1; +} \ No newline at end of file Added: trunk/Dutch.lproj/ReadNotesAccessoryView.nib/info.nib =================================================================== --- trunk/Dutch.lproj/ReadNotesAccessoryView.nib/info.nib (rev 0) +++ trunk/Dutch.lproj/ReadNotesAccessoryView.nib/info.nib 2007-04-21 16:21:13 UTC (rev 1878) @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IBDocumentLocation</key> + <string>69 58 356 240 0 0 1440 938 </string> + <key>IBEditorPositions</key> + <dict> + <key>5</key> + <string>560 603 320 76 0 0 1440 938 </string> + </dict> + <key>IBFramework Version</key> + <string>446.1</string> + <key>IBOpenObjects</key> + <array> + <integer>5</integer> + </array> + <key>IBSystem Version</key> + <string>8P135</string> +</dict> +</plist> Added: trunk/Dutch.lproj/ReadNotesAccessoryView.nib/keyedobjects.nib =================================================================== (Binary files differ) Property changes on: trunk/Dutch.lproj/ReadNotesAccessoryView.nib/keyedobjects.nib ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/English.lproj/ReadNotesAccessoryView.nib/classes.nib =================================================================== --- trunk/English.lproj/ReadNotesAccessoryView.nib/classes.nib (rev 0) +++ trunk/English.lproj/ReadNotesAccessoryView.nib/classes.nib 2007-04-21 16:21:13 UTC (rev 1878) @@ -0,0 +1,13 @@ +{ + IBClasses = ( + {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + { + ACTIONS = {readNotes = id; saveArchive = id; }; + CLASS = SKDocument; + LANGUAGE = ObjC; + OUTLETS = {readNotesAccessoryView = NSView; replaceNotesCheckButton = NSButton; }; + SUPERCLASS = NSDocument; + } + ); + IBVersion = 1; +} \ No newline at end of file Added: trunk/English.lproj/ReadNotesAccessoryView.nib/info.nib =================================================================== --- trunk/English.lproj/ReadNotesAccessoryView.nib/info.nib (rev 0) +++ trunk/English.lproj/ReadNotesAccessoryView.nib/info.nib 2007-04-21 16:21:13 UTC (rev 1878) @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IBDocumentLocation</key> + <string>69 58 356 240 0 0 1440 938 </string> + <key>IBEditorPositions</key> + <dict> + <key>5</key> + <string>532 603 376 76 0 0 1440 938 </string> + </dict> + <key>IBFramework Version</key> + <string>446.1</string> + <key>IBOpenObjects</key> + <array> + <integer>5</integer> + </array> + <key>IBSystem Version</key> + <string>8P135</string> +</dict> +</plist> Added: trunk/English.lproj/ReadNotesAccessoryView.nib/keyedobjects.nib =================================================================== (Binary files differ) Property changes on: trunk/English.lproj/ReadNotesAccessoryView.nib/keyedobjects.nib ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/Italian.lproj/ReadNotesAccessoryView.nib/classes.nib =================================================================== --- trunk/Italian.lproj/ReadNotesAccessoryView.nib/classes.nib (rev 0) +++ trunk/Italian.lproj/ReadNotesAccessoryView.nib/classes.nib 2007-04-21 16:21:13 UTC (rev 1878) @@ -0,0 +1,13 @@ +{ + IBClasses = ( + {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + { + ACTIONS = {readNotes = id; saveArchive = id; }; + CLASS = SKDocument; + LANGUAGE = ObjC; + OUTLETS = {readNotesAccessoryView = NSView; replaceNotesCheckButton = NSButton; }; + SUPERCLASS = NSDocument; + } + ); + IBVersion = 1; +} \ No newline at end of file Added: trunk/Italian.lproj/ReadNotesAccessoryView.nib/info.nib =================================================================== --- trunk/Italian.lproj/ReadNotesAccessoryView.nib/info.nib (rev 0) +++ trunk/Italian.lproj/ReadNotesAccessoryView.nib/info.nib 2007-04-21 16:21:13 UTC (rev 1878) @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IBDocumentLocation</key> + <string>69 58 356 240 0 0 1440 938 </string> + <key>IBEditorPositions</key> + <dict> + <key>5</key> + <string>532 603 376 76 0 0 1440 938 </string> + </dict> + <key>IBFramework Version</key> + <string>446.1</string> + <key>IBOpenObjects</key> + <array> + <integer>5</integer> + </array> + <key>IBSystem Version</key> + <string>8P135</string> +</dict> +</plist> Added: trunk/Italian.lproj/ReadNotesAccessoryView.nib/keyedobjects.nib =================================================================== (Binary files differ) Property changes on: trunk/Italian.lproj/ReadNotesAccessoryView.nib/keyedobjects.nib ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/SKDocument.h =================================================================== --- trunk/SKDocument.h 2007-04-21 12:32:13 UTC (rev 1877) +++ trunk/SKDocument.h 2007-04-21 16:21:13 UTC (rev 1878) @@ -54,6 +54,9 @@ @interface SKDocument : NSDocument { + IBOutlet NSView *readNotesAccessoryView; + IBOutlet NSButton *replaceNotesCheckButton; + // variables to be saved: NSData *pdfData; Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-04-21 12:32:13 UTC (rev 1877) +++ trunk/SKDocument.m 2007-04-21 16:21:13 UTC (rev 1878) @@ -80,6 +80,7 @@ [previousCheckedDate release]; [pdfData release]; [noteDicts release]; + [readNotesAccessoryView release]; [super dealloc]; } @@ -400,7 +401,10 @@ NSArray *array = [NSKeyedUnarchiver unarchiveObjectWithFile:[notesURL path]]; if (array) { - [[self mainWindowController] setAnnotationsFromDictionaries:array]; + if ([[oPanel accessoryView] isEqual:readNotesAccessoryView] && [replaceNotesCheckButton state] == NSOnState) + [[self mainWindowController] setAnnotationsFromDictionaries:array]; + else + [[self mainWindowController] addAnnotationsFromDictionaries:array]; [self updateChangeCount:NSChangeDone]; } @@ -410,6 +414,17 @@ - (IBAction)readNotes:(id)sender{ NSOpenPanel *oPanel = [NSOpenPanel openPanel]; NSString *path = [[self fileURL] path]; + + if ([[[self mainWindowController] notes] count]) { + if (readNotesAccessoryView == nil) { + if (NO == [NSBundle loadNibNamed:@"ReadNotesAccessoryView" owner:self]) + NSLog(@"Failed to load ReadNotesAccessoryView.nib"); + [readNotesAccessoryView retain]; + } + [oPanel setAccessoryView:readNotesAccessoryView]; + [replaceNotesCheckButton setState:NSOnState]; + } + [oPanel beginSheetForDirectory:[path stringByDeletingLastPathComponent] file:[[[path lastPathComponent] stringByDeletingPathExtension] stringByAppendingPathExtension:@"skim"] types:[NSArray arrayWithObject:@"skim"] Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2007-04-21 12:32:13 UTC (rev 1877) +++ trunk/SKMainWindowController.h 2007-04-21 16:21:13 UTC (rev 1878) @@ -323,6 +323,7 @@ - (void)handleDocumentEndWrite:(NSNotification *)notification; - (void)handleDocumentEndPageWrite:(NSNotification *)notification; +- (void)addAnnotationsFromDictionaries:(NSArray *)noteDicts; - (void)setAnnotationsFromDictionaries:(NSArray *)noteDicts; - (void)setupWindow:(NSDictionary *)setup; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-04-21 12:32:13 UTC (rev 1877) +++ trunk/SKMainWindowController.m 2007-04-21 16:21:13 UTC (rev 1878) @@ -498,25 +498,15 @@ } } } - -- (void)setAnnotationsFromDictionaries:(NSArray *)noteDicts{ - NSEnumerator *e = [notes objectEnumerator]; + +- (void)addAnnotationsFromDictionaries:(NSArray *)noteDicts{ + NSEnumerator *e = [noteDicts objectEnumerator]; PDFAnnotation *annotation; NSDictionary *dict; PDFDocument *pdfDoc = [pdfView document]; - - // remove the current anotations - [pdfView endAnnotationEdit:self]; - while (annotation = [e nextObject]) { - [pdfView setNeedsDisplayForAnnotation:annotation]; - [[annotation page] removeAnnotation:annotation]; - } - NSMutableArray *observedNotes = [self mutableArrayValueForKey:@"notes"]; - [observedNotes removeAllObjects]; // create new annotations from the dictionary and add them to their page and to the document - e = [noteDicts objectEnumerator]; while (dict = [e nextObject]) { unsigned pageIndex = [[dict objectForKey:@"pageIndex"] unsignedIntValue]; if (annotation = [[PDFAnnotation alloc] initWithDictionary:dict]) { @@ -535,6 +525,23 @@ [self allThumbnailsNeedUpdate]; } +- (void)setAnnotationsFromDictionaries:(NSArray *)noteDicts{ + NSEnumerator *e = [notes objectEnumerator]; + PDFAnnotation *annotation; + + // remove the current anotations + [pdfView endAnnotationEdit:self]; + [pdfView setActiveAnnotation:nil]; + while (annotation = [e nextObject]) { + [pdfView setNeedsDisplayForAnnotation:annotation]; + [[annotation page] removeAnnotation:annotation]; + } + + [[self mutableArrayValueForKey:@"notes"] removeAllObjects]; + + [self addAnnotationsFromDictionaries:noteDicts]; +} + - (SKPDFView *)pdfView { return pdfView; } Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2007-04-21 12:32:13 UTC (rev 1877) +++ trunk/Skim.xcodeproj/project.pbxproj 2007-04-21 16:21:13 UTC (rev 1878) @@ -63,6 +63,7 @@ CE15832D0BA0740000D5B03F /* ToolbarStrikeOutNote.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CE1583290BA073FF00D5B03F /* ToolbarStrikeOutNote.tiff */; }; CE15832E0BA0740000D5B03F /* ToolbarUnderlineNote.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CE15832A0BA073FF00D5B03F /* ToolbarUnderlineNote.tiff */; }; CE15832F0BA0740000D5B03F /* UnderlineNoteAdorn.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CE15832B0BA073FF00D5B03F /* UnderlineNoteAdorn.tiff */; }; + CE1E25680BDA61E80011D9DD /* ReadNotesAccessoryView.nib in Resources */ = {isa = PBXBuildFile; fileRef = CE1E25660BDA61E80011D9DD /* ReadNotesAccessoryView.nib */; }; CE2BD83E0BD4132B00A5F4DB /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE2BD82A0BD4132B00A5F4DB /* Sparkle.framework */; }; CE2BD8450BD4135600A5F4DB /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = CE2BD82A0BD4132B00A5F4DB /* Sparkle.framework */; }; CE2DE4920B85D48F00D0DA12 /* SKThumbnail.m in Sources */ = {isa = PBXBuildFile; fileRef = CE2DE4910B85D48F00D0DA12 /* SKThumbnail.m */; }; @@ -280,6 +281,9 @@ CE1583290BA073FF00D5B03F /* ToolbarStrikeOutNote.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = ToolbarStrikeOutNote.tiff; path = Images/ToolbarStrikeOutNote.tiff; sourceTree = "<group>"; }; CE15832A0BA073FF00D5B03F /* ToolbarUnderlineNote.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = ToolbarUnderlineNote.tiff; path = Images/ToolbarUnderlineNote.tiff; sourceTree = "<group>"; }; CE15832B0BA073FF00D5B03F /* UnderlineNoteAdorn.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = UnderlineNoteAdorn.tiff; path = Images/UnderlineNoteAdorn.tiff; sourceTree = "<group>"; }; + CE1E25670BDA61E80011D9DD /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/ReadNotesAccessoryView.nib; sourceTree = "<group>"; }; + CE1E259E0BDA6E4D0011D9DD /* Dutch */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Dutch; path = Dutch.lproj/ReadNotesAccessoryView.nib; sourceTree = "<group>"; }; + CE1E259F0BDA6E570011D9DD /* Italian */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Italian; path = Italian.lproj/ReadNotesAccessoryView.nib; sourceTree = "<group>"; }; CE2BD8170BD4127A00A5F4DB /* Sparkle.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Sparkle.xcodeproj; path = vendorsrc/andymatuschak/Sparkle/Sparkle.xcodeproj; sourceTree = "<group>"; }; CE2BD82A0BD4132B00A5F4DB /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Sparkle.framework; sourceTree = BUILT_PRODUCTS_DIR; }; CE2DE4900B85D48F00D0DA12 /* SKThumbnail.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKThumbnail.h; sourceTree = "<group>"; }; @@ -546,6 +550,7 @@ CEF7071D0B8F8EFC003A2771 /* SnapshotWindow.nib */, CE9C42360B8B5633004AD8CF /* PreferenceWindow.nib */, CE2DEB900B86206400D0DA12 /* FindPanel.nib */, + CE1E25660BDA61E80011D9DD /* ReadNotesAccessoryView.nib */, CEF717560B90DEEF003A2771 /* ReleaseNotes.nib */, F977515E0B37460100DF673B /* ConversionProgressWindow.nib */, CE2DEA9D0B860A7000D0DA12 /* SaveProgressSheet.nib */, @@ -974,6 +979,7 @@ CEE1065E0BCBBE1300BF2D3E /* NotesDocument.nib in Resources */, CE7C5D050BD8062C0011315D /* ArrowNoteAdorn.tiff in Resources */, CE7C5D190BD8086C0011315D /* ToolbarArrowNote.tiff in Resources */, + CE1E25680BDA61E80011D9DD /* ReadNotesAccessoryView.nib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1172,6 +1178,16 @@ name = MainWindow.nib; sourceTree = "<group>"; }; + CE1E25660BDA61E80011D9DD /* ReadNotesAccessoryView.nib */ = { + isa = PBXVariantGroup; + children = ( + CE1E25670BDA61E80011D9DD /* English */, + CE1E259E0BDA6E4D0011D9DD /* Dutch */, + CE1E259F0BDA6E570011D9DD /* Italian */, + ); + name = ReadNotesAccessoryView.nib; + sourceTree = "<group>"; + }; CE2DEA9D0B860A7000D0DA12 /* SaveProgressSheet.nib */ = { isa = PBXVariantGroup; children = ( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-21 12:49:09
|
Revision: 1877 http://skim-app.svn.sourceforge.net/skim-app/?rev=1877&view=rev Author: hofman Date: 2007-04-21 05:32:13 -0700 (Sat, 21 Apr 2007) Log Message: ----------- Use only shortVersionString for display to user rather than shortVersionString/version, if it is available. Modified Paths: -------------- trunk/vendorsrc/andymatuschak/Sparkle/SUAppcastItem.m trunk/vendorsrc/andymatuschak/Sparkle/SUUtilities.m Modified: trunk/vendorsrc/andymatuschak/Sparkle/SUAppcastItem.m =================================================================== --- trunk/vendorsrc/andymatuschak/Sparkle/SUAppcastItem.m 2007-04-21 12:15:16 UTC (rev 1876) +++ trunk/vendorsrc/andymatuschak/Sparkle/SUAppcastItem.m 2007-04-21 12:32:13 UTC (rev 1877) @@ -60,8 +60,8 @@ NSString *shortVersionString = [enclosure objectForKey:@"sparkle:shortVersionString"]; if (shortVersionString) { - if (![[self fileVersion] isEqualToString:shortVersionString]) - shortVersionString = [shortVersionString stringByAppendingFormat:@"/%@", [self fileVersion]]; + //if (![[self fileVersion] isEqualToString:shortVersionString]) + // shortVersionString = [shortVersionString stringByAppendingFormat:@"/%@", [self fileVersion]]; [self setVersionString:shortVersionString]; } else Modified: trunk/vendorsrc/andymatuschak/Sparkle/SUUtilities.m =================================================================== --- trunk/vendorsrc/andymatuschak/Sparkle/SUUtilities.m 2007-04-21 12:15:16 UTC (rev 1876) +++ trunk/vendorsrc/andymatuschak/Sparkle/SUUtilities.m 2007-04-21 12:32:13 UTC (rev 1877) @@ -39,8 +39,8 @@ NSString *shortVersionString = SUInfoValueForKey(@"CFBundleShortVersionString"); if (shortVersionString) { - if (![shortVersionString isEqualToString:SUHostAppVersion()]) - shortVersionString = [shortVersionString stringByAppendingFormat:@"/%@", SUHostAppVersion()]; + //if (![shortVersionString isEqualToString:SUHostAppVersion()]) + // shortVersionString = [shortVersionString stringByAppendingFormat:@"/%@", SUHostAppVersion()]; return shortVersionString; } else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-04-21 12:15:17
|
Revision: 1876 http://skim-app.svn.sourceforge.net/skim-app/?rev=1876&view=rev Author: hofman Date: 2007-04-21 05:15:16 -0700 (Sat, 21 Apr 2007) Log Message: ----------- Don't drag notes outside page bounds when resizing. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-04-21 11:37:20 UTC (rev 1875) +++ trunk/SKPDFView.m 2007-04-21 12:15:16 UTC (rev 1876) @@ -2003,6 +2003,7 @@ PDFPage *activePage = [activeAnnotation page]; NSRect newBounds; NSRect currentBounds = [activeAnnotation bounds]; + NSRect pageBounds = [activePage boundsForBox:[self displayBox]]; if (resizingAnnotation) { NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; @@ -2062,9 +2063,25 @@ } if (draggingStartPoint) { + if (startPoint.x > NSMaxX(pageBounds)) + startPoint.x = NSMaxX(pageBounds); + else if (startPoint.x < NSMinX(pageBounds)) + startPoint.x = NSMinX(pageBounds); + if (startPoint.y > NSMaxY(pageBounds)) + startPoint.y = NSMaxY(pageBounds); + else if (startPoint.y < NSMinY(pageBounds)) + startPoint.y = NSMinY(pageBounds); startPoint.x = roundf(startPoint.x); startPoint.y = roundf(startPoint.y); } else { + if (endPoint.x > NSMaxX(pageBounds)) + endPoint.x = NSMaxX(pageBounds); + else if (endPoint.x < NSMinX(pageBounds)) + endPoint.x = NSMinX(pageBounds); + if (endPoint.y > NSMaxY(pageBounds)) + endPoint.y = NSMaxY(pageBounds); + else if (endPoint.y < NSMinY(pageBounds)) + endPoint.y = NSMinY(pageBounds); endPoint.x = roundf(endPoint.x); endPoint.y = roundf(endPoint.y); } @@ -2098,6 +2115,13 @@ newBounds.origin.y += relPoint.y; newBounds.size.width += relPoint.x; newBounds.size.height -= relPoint.y; + if (NSMaxX(newBounds) > NSMaxX(pageBounds)) { + newBounds.size.width = NSMaxX(pageBounds) - NSMinX(newBounds); + } + if (NSMinY(newBounds) < NSMinY(pageBounds)) { + newBounds.size.height = NSMaxY(newBounds) - NSMinY(pageBounds); + newBounds.origin.y = NSMinY(pageBounds); + } if (NSWidth(newBounds) < 8.0) { newBounds.size.width = 8.0; } @@ -2109,6 +2133,12 @@ case 90: newBounds.size.width += relPoint.x; newBounds.size.height += relPoint.y; + if (NSMaxX(newBounds) > NSMaxX(pageBounds)) { + newBounds.size.width = NSMaxX(pageBounds) - NSMinX(newBounds); + } + if (NSMaxY(newBounds) > NSMaxY(pageBounds)) { + newBounds.size.height = NSMaxY(pageBounds) - NSMinY(newBounds); + } if (NSWidth(newBounds) < 8.0) { newBounds.size.width = 8.0; } @@ -2120,6 +2150,13 @@ newBounds.origin.x += relPoint.x; newBounds.size.width -= relPoint.x; newBounds.size.height += relPoint.y; + if (NSMinX(newBounds) < NSMinX(pageBounds)) { + newBounds.size.width = NSMaxX(newBounds) - NSMinX(pageBounds); + newBounds.origin.x = NSMinX(pageBounds); + } + if (NSMaxY(newBounds) > NSMaxY(pageBounds)) { + newBounds.size.height = NSMaxY(pageBounds) - NSMinY(newBounds); + } if (NSWidth(newBounds) < 8.0) { newBounds.origin.x += NSWidth(newBounds) - 8.0; newBounds.size.width = 8.0; @@ -2133,6 +2170,14 @@ newBounds.origin.y += relPoint.y; newBounds.size.width -= relPoint.x; newBounds.size.height -= relPoint.y; + if (NSMinX(newBounds) < NSMinX(pageBounds)) { + newBounds.size.width = NSMaxX(newBounds) - NSMinX(pageBounds); + newBounds.origin.x = NSMinX(pageBounds); + } + if (NSMinY(newBounds) < NSMinY(pageBounds)) { + newBounds.size.height = NSMaxY(newBounds) - NSMinY(pageBounds); + newBounds.origin.y = NSMinY(pageBounds); + } if (NSWidth(newBounds) < 8.0) { newBounds.origin.x += NSWidth(newBounds) - 8.0; newBounds.size.width = 8.0; @@ -2154,8 +2199,9 @@ NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; PDFPage *newActivePage = [self pageForPoint:mouseLoc nearest:YES]; - NSRect pageBounds = [newActivePage boundsForBox:[self displayBox]]; + pageBounds = [newActivePage boundsForBox:[self displayBox]]; + if (newActivePage == nil) { // this should never happen, but just to be sure newBounds = wasBounds; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |