You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
(23) |
Apr
(254) |
May
(252) |
Jun
(209) |
Jul
(198) |
Aug
(192) |
Sep
(207) |
Oct
(120) |
Nov
(179) |
Dec
(52) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(48) |
Feb
(69) |
Mar
(129) |
Apr
(250) |
May
(113) |
Jun
(177) |
Jul
(228) |
Aug
(155) |
Sep
(218) |
Oct
(185) |
Nov
(109) |
Dec
(88) |
2009 |
Jan
(83) |
Feb
(39) |
Mar
(70) |
Apr
(47) |
May
(48) |
Jun
(67) |
Jul
(61) |
Aug
(97) |
Sep
(221) |
Oct
(141) |
Nov
(70) |
Dec
(61) |
2010 |
Jan
(45) |
Feb
(76) |
Mar
(178) |
Apr
(106) |
May
(57) |
Jun
(32) |
Jul
(64) |
Aug
(98) |
Sep
(96) |
Oct
(19) |
Nov
(34) |
Dec
(117) |
2011 |
Jan
(55) |
Feb
(48) |
Mar
(64) |
Apr
(21) |
May
(39) |
Jun
(53) |
Jul
(99) |
Aug
(56) |
Sep
(39) |
Oct
(26) |
Nov
(19) |
Dec
(69) |
2012 |
Jan
(17) |
Feb
(40) |
Mar
(17) |
Apr
|
May
(2) |
Jun
(8) |
Jul
(2) |
Aug
(10) |
Sep
(10) |
Oct
(38) |
Nov
(48) |
Dec
(70) |
2013 |
Jan
(43) |
Feb
(47) |
Mar
(39) |
Apr
(37) |
May
(25) |
Jun
(6) |
Jul
(20) |
Aug
(49) |
Sep
(33) |
Oct
(34) |
Nov
(75) |
Dec
(6) |
2014 |
Jan
(32) |
Feb
(10) |
Mar
(17) |
Apr
|
May
|
Jun
(26) |
Jul
(5) |
Aug
|
Sep
(4) |
Oct
(23) |
Nov
(80) |
Dec
(48) |
2015 |
Jan
(80) |
Feb
(50) |
Mar
(58) |
Apr
(20) |
May
(11) |
Jun
(16) |
Jul
(24) |
Aug
(27) |
Sep
(56) |
Oct
(30) |
Nov
(16) |
Dec
(6) |
2016 |
Jan
(31) |
Feb
(14) |
Mar
(23) |
Apr
(17) |
May
(40) |
Jun
(12) |
Jul
(17) |
Aug
(9) |
Sep
(32) |
Oct
(36) |
Nov
(23) |
Dec
(9) |
2017 |
Jan
(37) |
Feb
(23) |
Mar
(65) |
Apr
(22) |
May
(6) |
Jun
(3) |
Jul
|
Aug
|
Sep
(3) |
Oct
(22) |
Nov
(63) |
Dec
(71) |
2018 |
Jan
(83) |
Feb
(21) |
Mar
(35) |
Apr
(44) |
May
(14) |
Jun
(12) |
Jul
(8) |
Aug
(18) |
Sep
(10) |
Oct
(145) |
Nov
(144) |
Dec
(76) |
2019 |
Jan
(18) |
Feb
(28) |
Mar
(5) |
Apr
(208) |
May
(291) |
Jun
(158) |
Jul
(27) |
Aug
(8) |
Sep
(10) |
Oct
(83) |
Nov
(41) |
Dec
(31) |
2020 |
Jan
(16) |
Feb
(46) |
Mar
(100) |
Apr
(78) |
May
(69) |
Jun
(71) |
Jul
(28) |
Aug
(131) |
Sep
(176) |
Oct
(89) |
Nov
(147) |
Dec
(19) |
2021 |
Jan
(19) |
Feb
(25) |
Mar
(91) |
Apr
(98) |
May
(14) |
Jun
(44) |
Jul
(8) |
Aug
(3) |
Sep
(38) |
Oct
(57) |
Nov
(97) |
Dec
(74) |
2022 |
Jan
(89) |
Feb
(47) |
Mar
(15) |
Apr
(50) |
May
(54) |
Jun
(56) |
Jul
(80) |
Aug
(12) |
Sep
(11) |
Oct
(60) |
Nov
(48) |
Dec
(4) |
2023 |
Jan
(75) |
Feb
(49) |
Mar
(84) |
Apr
(24) |
May
(13) |
Jun
(74) |
Jul
(32) |
Aug
(66) |
Sep
(50) |
Oct
(38) |
Nov
(105) |
Dec
(181) |
2024 |
Jan
(21) |
Feb
(49) |
Mar
(77) |
Apr
(84) |
May
(20) |
Jun
(71) |
Jul
(53) |
Aug
(33) |
Sep
(54) |
Oct
(124) |
Nov
(151) |
Dec
(73) |
2025 |
Jan
(61) |
Feb
(17) |
Mar
(136) |
Apr
(72) |
May
(200) |
Jun
(238) |
Jul
(91) |
Aug
(8) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <ho...@us...> - 2007-07-19 13:22:41
|
Revision: 2532 http://skim-app.svn.sourceforge.net/skim-app/?rev=2532&view=rev Author: hofman Date: 2007-07-19 06:22:31 -0700 (Thu, 19 Jul 2007) Log Message: ----------- Give up on setting up splitview in IB, it's too buggy. Insert subviews programatically. Also cut off side border of tableviews at the edge of the screen. Modified Paths: -------------- trunk/Dutch.lproj/MainWindow.nib/classes.nib trunk/Dutch.lproj/MainWindow.nib/info.nib trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib Modified: trunk/Dutch.lproj/MainWindow.nib/classes.nib =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/classes.nib 2007-07-19 13:13:20 UTC (rev 2531) +++ trunk/Dutch.lproj/MainWindow.nib/classes.nib 2007-07-19 13:22:31 UTC (rev 2532) @@ -121,10 +121,10 @@ findEdgeView = BDSKEdgeView; findTableView = NSTableView; findView = NSView; - leftSideBox = NSBox; leftSideButton = NSSegmentedControl; leftSideCollapsibleView = BDSKCollapsibleView; leftSideContentBox = NSBox; + leftSideContentView = NSView; leftSideEdgeView = BDSKEdgeView; markupPopUpButton = BDSKImagePopUpButton; noteArrayController = NSArrayController; @@ -144,10 +144,10 @@ progressBar = NSProgressIndicator; progressField = NSTextField; progressSheet = NSWindow; - rightSideBox = NSBox; rightSideButton = NSSegmentedControl; rightSideCollapsibleView = BDSKCollapsibleView; rightSideContentBox = NSBox; + rightSideContentView = NSView; rightSideEdgeView = BDSKEdgeView; scaleField = NSTextField; searchField = NSSearchField; Modified: trunk/Dutch.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-07-19 13:13:20 UTC (rev 2531) +++ trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-07-19 13:22:31 UTC (rev 2532) @@ -3,7 +3,7 @@ <plist version="1.0"> <dict> <key>IBDocumentLocation</key> - <string>86 76 564 296 0 0 1440 938 </string> + <string>180 125 582 462 0 0 1440 938 </string> <key>IBEditorPositions</key> <dict> <key>168</key> @@ -18,6 +18,10 @@ <string>610 420 220 442 0 0 1440 938 </string> <key>511</key> <string>610 420 220 442 0 0 1440 938 </string> + <key>687</key> + <string>610 420 220 442 0 0 1440 938 </string> + <key>694</key> + <string>610 420 220 442 0 0 1440 938 </string> </dict> <key>IBFramework Version</key> <string>446.1</string> @@ -25,10 +29,6 @@ <array> <integer>208</integer> </array> - <key>IBOpenObjects</key> - <array> - <integer>5</integer> - </array> <key>IBSystem Version</key> <string>8R218</string> </dict> Modified: trunk/Dutch.lproj/MainWindow.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-07-19 13:13:23
|
Revision: 2531 http://skim-app.svn.sourceforge.net/skim-app/?rev=2531&view=rev Author: hofman Date: 2007-07-19 06:13:20 -0700 (Thu, 19 Jul 2007) Log Message: ----------- Give up on setting up splitview in IB, it's too buggy. Insert subviews programatically. Also cut off side border of tableviews at the edge of the screen. Modified Paths: -------------- trunk/English.lproj/MainWindow.nib/classes.nib trunk/English.lproj/MainWindow.nib/info.nib trunk/English.lproj/MainWindow.nib/keyedobjects.nib trunk/Italian.lproj/MainWindow.nib/classes.nib trunk/Italian.lproj/MainWindow.nib/info.nib trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib trunk/SKMainWindowController.h trunk/SKMainWindowController.m Modified: trunk/English.lproj/MainWindow.nib/classes.nib =================================================================== --- trunk/English.lproj/MainWindow.nib/classes.nib 2007-07-19 10:06:06 UTC (rev 2530) +++ trunk/English.lproj/MainWindow.nib/classes.nib 2007-07-19 13:13:20 UTC (rev 2531) @@ -121,10 +121,10 @@ findEdgeView = BDSKEdgeView; findTableView = NSTableView; findView = NSView; - leftSideBox = NSBox; leftSideButton = NSSegmentedControl; leftSideCollapsibleView = BDSKCollapsibleView; leftSideContentBox = NSBox; + leftSideContentView = NSView; leftSideEdgeView = BDSKEdgeView; markupPopUpButton = BDSKImagePopUpButton; noteArrayController = NSArrayController; @@ -144,10 +144,10 @@ progressBar = NSProgressIndicator; progressField = NSTextField; progressSheet = NSWindow; - rightSideBox = NSBox; rightSideButton = NSSegmentedControl; rightSideCollapsibleView = BDSKCollapsibleView; rightSideContentBox = NSBox; + rightSideContentView = NSView; rightSideEdgeView = BDSKEdgeView; scaleField = NSTextField; searchField = NSSearchField; Modified: trunk/English.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/English.lproj/MainWindow.nib/info.nib 2007-07-19 10:06:06 UTC (rev 2530) +++ trunk/English.lproj/MainWindow.nib/info.nib 2007-07-19 13:13:20 UTC (rev 2531) @@ -3,7 +3,7 @@ <plist version="1.0"> <dict> <key>IBDocumentLocation</key> - <string>206 62 564 296 0 0 1440 938 </string> + <string>180 125 582 462 0 0 1440 938 </string> <key>IBEditorPositions</key> <dict> <key>168</key> @@ -18,6 +18,10 @@ <string>610 420 220 442 0 0 1440 938 </string> <key>511</key> <string>610 420 220 442 0 0 1440 938 </string> + <key>687</key> + <string>590 400 260 482 0 0 1440 938 </string> + <key>694</key> + <string>590 400 260 482 0 0 1440 938 </string> </dict> <key>IBFramework Version</key> <string>446.1</string> @@ -27,18 +31,20 @@ </array> <key>IBOpenObjects</key> <array> + <integer>256</integer> <integer>511</integer> - <integer>539</integer> + <integer>5</integer> + <integer>687</integer> + <integer>208</integer> + <integer>314</integer> + <integer>502</integer> <integer>585</integer> - <integer>314</integer> <integer>224</integer> - <integer>256</integer> + <integer>694</integer> + <integer>633</integer> <integer>168</integer> - <integer>208</integer> - <integer>633</integer> <integer>553</integer> - <integer>5</integer> - <integer>502</integer> + <integer>539</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/English.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/MainWindow.nib/classes.nib =================================================================== --- trunk/Italian.lproj/MainWindow.nib/classes.nib 2007-07-19 10:06:06 UTC (rev 2530) +++ trunk/Italian.lproj/MainWindow.nib/classes.nib 2007-07-19 13:13:20 UTC (rev 2531) @@ -121,10 +121,10 @@ findEdgeView = BDSKEdgeView; findTableView = NSTableView; findView = NSView; - leftSideBox = NSBox; leftSideButton = NSSegmentedControl; leftSideCollapsibleView = BDSKCollapsibleView; leftSideContentBox = NSBox; + leftSideContentView = NSView; leftSideEdgeView = BDSKEdgeView; markupPopUpButton = BDSKImagePopUpButton; noteArrayController = NSArrayController; @@ -144,10 +144,10 @@ progressBar = NSProgressIndicator; progressField = NSTextField; progressSheet = NSWindow; - rightSideBox = NSBox; rightSideButton = NSSegmentedControl; rightSideCollapsibleView = BDSKCollapsibleView; rightSideContentBox = NSBox; + rightSideContentView = NSView; rightSideEdgeView = BDSKEdgeView; scaleField = NSTextField; searchField = NSSearchField; Modified: trunk/Italian.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Italian.lproj/MainWindow.nib/info.nib 2007-07-19 10:06:06 UTC (rev 2530) +++ trunk/Italian.lproj/MainWindow.nib/info.nib 2007-07-19 13:13:20 UTC (rev 2531) @@ -3,21 +3,25 @@ <plist version="1.0"> <dict> <key>IBDocumentLocation</key> - <string>32 110 564 296 0 0 1440 938 </string> + <string>49 101 539 409 0 0 1440 938 </string> <key>IBEditorPositions</key> <dict> <key>168</key> <string>601 521 237 239 0 0 1440 938 </string> <key>224</key> - <string>402 294 220 442 0 0 1024 746 </string> + <string>610 420 220 442 0 0 1440 938 </string> <key>256</key> <string>402 294 220 442 0 0 1024 746 </string> <key>314</key> - <string>402 294 220 442 0 0 1024 746 </string> + <string>610 420 220 442 0 0 1440 938 </string> <key>502</key> - <string>402 294 220 442 0 0 1024 746 </string> + <string>610 420 220 442 0 0 1440 938 </string> <key>511</key> <string>610 420 220 442 0 0 1440 938 </string> + <key>676</key> + <string>610 420 220 442 0 0 1440 938 </string> + <key>677</key> + <string>610 420 220 442 0 0 1440 938 </string> </dict> <key>IBFramework Version</key> <string>446.1</string> @@ -27,13 +31,18 @@ </array> <key>IBOpenObjects</key> <array> - <integer>168</integer> - <integer>628</integer> + <integer>502</integer> <integer>5</integer> - <integer>208</integer> + <integer>539</integer> + <integer>676</integer> + <integer>314</integer> <integer>553</integer> - <integer>539</integer> + <integer>677</integer> <integer>511</integer> + <integer>628</integer> + <integer>168</integer> + <integer>224</integer> + <integer>208</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2007-07-19 10:06:06 UTC (rev 2530) +++ trunk/SKMainWindowController.h 2007-07-19 13:13:20 UTC (rev 2531) @@ -68,14 +68,14 @@ IBOutlet BDSKEdgeView *pdfContentBox; IBOutlet NSBox *leftSideContentBox; - IBOutlet NSBox *leftSideBox; + IBOutlet NSView *leftSideContentView; IBOutlet BDSKEdgeView *leftSideEdgeView; IBOutlet BDSKCollapsibleView *leftSideCollapsibleView; IBOutlet NSSegmentedControl *leftSideButton; IBOutlet NSSearchField *searchField; IBOutlet NSBox *rightSideContentBox; - IBOutlet NSBox *rightSideBox; + IBOutlet NSView *rightSideContentView; IBOutlet BDSKEdgeView *rightSideEdgeView; IBOutlet BDSKCollapsibleView *rightSideCollapsibleView; IBOutlet NSSegmentedControl *rightSideButton; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-07-19 10:06:06 UTC (rev 2530) +++ trunk/SKMainWindowController.m 2007-07-19 13:13:20 UTC (rev 2531) @@ -241,34 +241,10 @@ [pdfContentBox setEdges:BDSKMinXEdgeMask | BDSKMaxXEdgeMask | BDSKMinYEdgeMask]; [findEdgeView setEdges:BDSKMaxXEdgeMask]; - [leftSideEdgeView setEdges:BDSKMaxXEdgeMask]; - [rightSideEdgeView setEdges:BDSKMinXEdgeMask]; + [leftSideEdgeView setEdges:BDSKMinXEdgeMask | BDSKMaxXEdgeMask]; + [rightSideEdgeView setEdges:BDSKMinXEdgeMask | BDSKMaxXEdgeMask]; - [pdfView setFrame:[[pdfContentBox contentView] bounds]]; - - float width = NSWidth([leftSideContentBox frame]); - NSRect frame = [leftSideBox frame]; - frame.size.width = width; - [leftSideBox setFrame:frame]; - frame = [leftSideEdgeView frame]; - frame.size.width = width; - [leftSideEdgeView setFrame:frame]; - frame = [currentLeftSideView frame]; - frame.size.width = width; - [currentLeftSideView setFrame:frame]; - - width = NSWidth([rightSideContentBox frame]); - frame = [rightSideBox frame]; - frame.size.width = width; - [rightSideBox setFrame:frame]; - frame = [rightSideEdgeView frame]; - frame.size.width = width; - [rightSideEdgeView setFrame:frame]; - frame = [currentRightSideView frame]; - frame.size.width = width; - [currentRightSideView setFrame:frame]; - - frame = [leftSideButton frame]; + NSRect frame = [leftSideButton frame]; frame.size.height = SEGMENTED_CONTROL_HEIGHT; [leftSideButton setFrame:frame]; [[leftSideButton cell] setToolTip:NSLocalizedString(@"View Thumbnails", @"Tool tip message") forSegment:SKThumbnailSidePaneState]; @@ -280,6 +256,17 @@ [[rightSideButton cell] setToolTip:NSLocalizedString(@"View Notes", @"Tool tip message") forSegment:SKNoteSidePaneState]; [[rightSideButton cell] setToolTip:NSLocalizedString(@"View Snapshots", @"Tool tip message") forSegment:SKSnapshotSidePaneState]; + [leftSideContentView retain]; + [leftSideContentView setFrame:[leftSideContentBox bounds]]; + [leftSideContentBox addSubview:leftSideContentView]; + [leftSideContentView release]; + [rightSideContentView retain]; + [rightSideContentView setFrame:[rightSideContentBox bounds]]; + [rightSideContentBox addSubview:rightSideContentView]; + [rightSideContentView release]; + + [pdfView setFrame:[[pdfContentBox contentView] bounds]]; + [self displayOutlineView]; [self displayNoteView]; @@ -1855,9 +1842,9 @@ [leftSideWindow moveToScreen:screen]; } - if ([[mainWindow firstResponder] isDescendantOf:leftSideBox]) + if ([[mainWindow firstResponder] isDescendantOf:leftSideContentView]) [mainWindow makeFirstResponder:nil]; - [leftSideWindow setMainView:leftSideBox]; + [leftSideWindow setMainView:leftSideContentView]; [leftSideWindow setInitialFirstResponder:searchField]; [leftSideEdgeView setEdges:BDSKNoEdgeMask]; @@ -1888,9 +1875,9 @@ [rightSideWindow moveToScreen:screen]; } - if ([[mainWindow firstResponder] isDescendantOf:rightSideBox]) + if ([[mainWindow firstResponder] isDescendantOf:rightSideContentView]) [mainWindow makeFirstResponder:nil]; - [rightSideWindow setMainView:rightSideBox]; + [rightSideWindow setMainView:rightSideContentView]; [rightSideEdgeView setEdges:BDSKNoEdgeMask]; @@ -1907,18 +1894,18 @@ } - (void)hideLeftSideWindow { - if ([[leftSideBox window] isEqual:leftSideWindow]) { + if ([[leftSideContentView window] isEqual:leftSideWindow]) { [leftSideWindow orderOut:self]; - if ([[leftSideWindow firstResponder] isDescendantOf:leftSideBox]) + if ([[leftSideWindow firstResponder] isDescendantOf:leftSideContentView]) [leftSideWindow makeFirstResponder:nil]; - [leftSideBox retain]; // leftSideBox is removed from its old superview in the process - [leftSideBox setFrame:[leftSideContentBox bounds]]; - [leftSideContentBox addSubview:leftSideBox]; - [leftSideBox release]; + [leftSideContentView retain]; // leftSideContentView is removed from its old superview in the process + [leftSideContentView setFrame:[leftSideContentBox bounds]]; + [leftSideContentBox addSubview:leftSideContentView]; + [leftSideContentView release]; - [leftSideEdgeView setEdges:BDSKMaxXEdgeMask]; - [findEdgeView setEdges:BDSKMaxXEdgeMask]; + [leftSideEdgeView setEdges:BDSKMinXEdgeMask | BDSKMaxXEdgeMask]; + [findEdgeView setEdges:BDSKMinXEdgeMask | BDSKMaxXEdgeMask]; if ([self isPresentation]) { [self setLeftSidePaneState:savedLeftSidePaneState]; @@ -1930,17 +1917,17 @@ } - (void)hideRightSideWindow { - if ([[rightSideBox window] isEqual:rightSideWindow]) { + if ([[rightSideContentView window] isEqual:rightSideWindow]) { [rightSideWindow orderOut:self]; - if ([[rightSideWindow firstResponder] isDescendantOf:rightSideBox]) + if ([[rightSideWindow firstResponder] isDescendantOf:rightSideContentView]) [rightSideWindow makeFirstResponder:nil]; - [rightSideBox retain]; // rightSideBox is removed from its old superview in the process - [rightSideBox setFrame:[rightSideContentBox bounds]]; - [rightSideContentBox addSubview:rightSideBox]; - [rightSideBox release]; + [rightSideContentView retain]; // rightSideContentView is removed from its old superview in the process + [rightSideContentView setFrame:[rightSideContentBox bounds]]; + [rightSideContentBox addSubview:rightSideContentView]; + [rightSideContentView release]; - [rightSideEdgeView setEdges:BDSKMinXEdgeMask]; + [rightSideEdgeView setEdges:BDSKMinXEdgeMask | BDSKMaxXEdgeMask]; if ([self isPresentation]) { [rightSideWindow setLevel:NSFloatingWindowLevel]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-19 10:06:10
|
Revision: 2530 http://skim-app.svn.sourceforge.net/skim-app/?rev=2530&view=rev Author: hofman Date: 2007-07-19 03:06:06 -0700 (Thu, 19 Jul 2007) Log Message: ----------- Correct some more layout messed up by nib-loading of the splitview. Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-07-19 09:37:36 UTC (rev 2529) +++ trunk/SKMainWindowController.m 2007-07-19 10:06:06 UTC (rev 2530) @@ -246,12 +246,27 @@ [pdfView setFrame:[[pdfContentBox contentView] bounds]]; + float width = NSWidth([leftSideContentBox frame]); NSRect frame = [leftSideBox frame]; - frame.size.width = NSWidth([leftSideContentBox frame]); + frame.size.width = width; [leftSideBox setFrame:frame]; + frame = [leftSideEdgeView frame]; + frame.size.width = width; + [leftSideEdgeView setFrame:frame]; + frame = [currentLeftSideView frame]; + frame.size.width = width; + [currentLeftSideView setFrame:frame]; + + width = NSWidth([rightSideContentBox frame]); frame = [rightSideBox frame]; - frame.size.width = NSWidth([rightSideContentBox frame]); + frame.size.width = width; [rightSideBox setFrame:frame]; + frame = [rightSideEdgeView frame]; + frame.size.width = width; + [rightSideEdgeView setFrame:frame]; + frame = [currentRightSideView frame]; + frame.size.width = width; + [currentRightSideView setFrame:frame]; frame = [leftSideButton frame]; frame.size.height = SEGMENTED_CONTROL_HEIGHT; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-19 09:37:38
|
Revision: 2529 http://skim-app.svn.sourceforge.net/skim-app/?rev=2529&view=rev Author: hofman Date: 2007-07-19 02:37:36 -0700 (Thu, 19 Jul 2007) Log Message: ----------- Fix layout of main window. Some boxes had the wrong height and the new search field was not correctly placed. Also nib loading can mess up subviews of splitviews with custom divider widths, so we have to correct that. Modified Paths: -------------- trunk/Dutch.lproj/MainWindow.nib/data.dependency trunk/Dutch.lproj/MainWindow.nib/info.nib trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib trunk/English.lproj/MainWindow.nib/info.nib trunk/English.lproj/MainWindow.nib/keyedobjects.nib trunk/Italian.lproj/MainWindow.nib/info.nib trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib trunk/SKMainWindowController.m Modified: trunk/Dutch.lproj/MainWindow.nib/data.dependency =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/data.dependency 2007-07-18 22:21:54 UTC (rev 2528) +++ trunk/Dutch.lproj/MainWindow.nib/data.dependency 2007-07-19 09:37:36 UTC (rev 2529) @@ -4,7 +4,6 @@ <dict> <key>IBPaletteDependency</key> <array> - <string>Controllers</string> <string>PDFKit</string> </array> </dict> Modified: trunk/Dutch.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-07-18 22:21:54 UTC (rev 2528) +++ trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-07-19 09:37:36 UTC (rev 2529) @@ -3,7 +3,7 @@ <plist version="1.0"> <dict> <key>IBDocumentLocation</key> - <string>110 52 564 296 0 0 1440 938 </string> + <string>86 76 564 296 0 0 1440 938 </string> <key>IBEditorPositions</key> <dict> <key>168</key> @@ -25,6 +25,10 @@ <array> <integer>208</integer> </array> + <key>IBOpenObjects</key> + <array> + <integer>5</integer> + </array> <key>IBSystem Version</key> <string>8R218</string> </dict> Modified: trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/English.lproj/MainWindow.nib/info.nib 2007-07-18 22:21:54 UTC (rev 2528) +++ trunk/English.lproj/MainWindow.nib/info.nib 2007-07-19 09:37:36 UTC (rev 2529) @@ -3,7 +3,7 @@ <plist version="1.0"> <dict> <key>IBDocumentLocation</key> - <string>110 52 564 296 0 0 1440 938 </string> + <string>206 62 564 296 0 0 1440 938 </string> <key>IBEditorPositions</key> <dict> <key>168</key> @@ -27,18 +27,18 @@ </array> <key>IBOpenObjects</key> <array> + <integer>511</integer> + <integer>539</integer> <integer>585</integer> <integer>314</integer> - <integer>553</integer> - <integer>502</integer> - <integer>539</integer> + <integer>224</integer> + <integer>256</integer> <integer>168</integer> <integer>208</integer> - <integer>511</integer> - <integer>256</integer> - <integer>224</integer> <integer>633</integer> + <integer>553</integer> <integer>5</integer> + <integer>502</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/English.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Italian.lproj/MainWindow.nib/info.nib 2007-07-18 22:21:54 UTC (rev 2528) +++ trunk/Italian.lproj/MainWindow.nib/info.nib 2007-07-19 09:37:36 UTC (rev 2529) @@ -27,13 +27,13 @@ </array> <key>IBOpenObjects</key> <array> - <integer>539</integer> + <integer>168</integer> + <integer>628</integer> + <integer>5</integer> <integer>208</integer> - <integer>168</integer> <integer>553</integer> - <integer>5</integer> + <integer>539</integer> <integer>511</integer> - <integer>628</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-07-18 22:21:54 UTC (rev 2528) +++ trunk/SKMainWindowController.m 2007-07-19 09:37:36 UTC (rev 2529) @@ -246,7 +246,14 @@ [pdfView setFrame:[[pdfContentBox contentView] bounds]]; - NSRect frame = [leftSideButton frame]; + NSRect frame = [leftSideBox frame]; + frame.size.width = NSWidth([leftSideContentBox frame]); + [leftSideBox setFrame:frame]; + frame = [rightSideBox frame]; + frame.size.width = NSWidth([rightSideContentBox frame]); + [rightSideBox setFrame:frame]; + + frame = [leftSideButton frame]; frame.size.height = SEGMENTED_CONTROL_HEIGHT; [leftSideButton setFrame:frame]; [[leftSideButton cell] setToolTip:NSLocalizedString(@"View Thumbnails", @"Tool tip message") forSegment:SKThumbnailSidePaneState]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-18 22:22:04
|
Revision: 2528 http://skim-app.svn.sourceforge.net/skim-app/?rev=2528&view=rev Author: hofman Date: 2007-07-18 15:21:54 -0700 (Wed, 18 Jul 2007) Log Message: ----------- Add search field to filter notes table. Modified Paths: -------------- trunk/Dutch.lproj/MainWindow.nib/classes.nib trunk/Dutch.lproj/MainWindow.nib/data.dependency trunk/Dutch.lproj/MainWindow.nib/info.nib trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib trunk/English.lproj/MainWindow.nib/classes.nib trunk/English.lproj/MainWindow.nib/info.nib trunk/English.lproj/MainWindow.nib/keyedobjects.nib trunk/Italian.lproj/MainWindow.nib/classes.nib trunk/Italian.lproj/MainWindow.nib/info.nib trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib trunk/SKMainWindowController.h trunk/SKMainWindowController.m Modified: trunk/Dutch.lproj/MainWindow.nib/classes.nib =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/classes.nib 2007-07-18 18:53:36 UTC (rev 2527) +++ trunk/Dutch.lproj/MainWindow.nib/classes.nib 2007-07-18 22:21:54 UTC (rev 2528) @@ -84,6 +84,7 @@ rotateRight = id; savePDFSettingToDefaults = id; search = id; + searchNotes = id; searchPDF = id; selectColor = id; smartAutoCropAll = id; @@ -129,6 +130,7 @@ noteArrayController = NSArrayController; noteOutlineView = SKNoteOutlineView; notePopUpButton = BDSKImagePopUpButton; + noteSearchField = NSSearchField; noteView = NSView; outlineView = NSOutlineView; ownerController = NSObjectController; @@ -144,6 +146,7 @@ progressSheet = NSWindow; rightSideBox = NSBox; rightSideButton = NSSegmentedControl; + rightSideCollapsibleView = BDSKCollapsibleView; rightSideContentBox = NSBox; rightSideEdgeView = BDSKEdgeView; scaleField = NSTextField; Modified: trunk/Dutch.lproj/MainWindow.nib/data.dependency =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/data.dependency 2007-07-18 18:53:36 UTC (rev 2527) +++ trunk/Dutch.lproj/MainWindow.nib/data.dependency 2007-07-18 22:21:54 UTC (rev 2528) @@ -4,6 +4,7 @@ <dict> <key>IBPaletteDependency</key> <array> + <string>Controllers</string> <string>PDFKit</string> </array> </dict> Modified: trunk/Dutch.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-07-18 18:53:36 UTC (rev 2527) +++ trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-07-18 22:21:54 UTC (rev 2528) @@ -3,7 +3,7 @@ <plist version="1.0"> <dict> <key>IBDocumentLocation</key> - <string>115 30 564 296 0 0 1440 938 </string> + <string>110 52 564 296 0 0 1440 938 </string> <key>IBEditorPositions</key> <dict> <key>168</key> @@ -25,10 +25,6 @@ <array> <integer>208</integer> </array> - <key>IBOpenObjects</key> - <array> - <integer>633</integer> - </array> <key>IBSystem Version</key> <string>8R218</string> </dict> Modified: trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/MainWindow.nib/classes.nib =================================================================== --- trunk/English.lproj/MainWindow.nib/classes.nib 2007-07-18 18:53:36 UTC (rev 2527) +++ trunk/English.lproj/MainWindow.nib/classes.nib 2007-07-18 22:21:54 UTC (rev 2528) @@ -84,6 +84,7 @@ rotateRight = id; savePDFSettingToDefaults = id; search = id; + searchNotes = id; searchPDF = id; selectColor = id; smartAutoCropAll = id; @@ -129,6 +130,7 @@ noteArrayController = NSArrayController; noteOutlineView = SKNoteOutlineView; notePopUpButton = BDSKImagePopUpButton; + noteSearchField = NSSearchField; noteView = NSView; outlineView = NSOutlineView; ownerController = NSObjectController; @@ -144,6 +146,7 @@ progressSheet = NSWindow; rightSideBox = NSBox; rightSideButton = NSSegmentedControl; + rightSideCollapsibleView = BDSKCollapsibleView; rightSideContentBox = NSBox; rightSideEdgeView = BDSKEdgeView; scaleField = NSTextField; Modified: trunk/English.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/English.lproj/MainWindow.nib/info.nib 2007-07-18 18:53:36 UTC (rev 2527) +++ trunk/English.lproj/MainWindow.nib/info.nib 2007-07-18 22:21:54 UTC (rev 2528) @@ -3,7 +3,7 @@ <plist version="1.0"> <dict> <key>IBDocumentLocation</key> - <string>115 30 564 296 0 0 1440 938 </string> + <string>110 52 564 296 0 0 1440 938 </string> <key>IBEditorPositions</key> <dict> <key>168</key> @@ -27,18 +27,18 @@ </array> <key>IBOpenObjects</key> <array> - <integer>633</integer> + <integer>585</integer> + <integer>314</integer> <integer>553</integer> + <integer>502</integer> <integer>539</integer> - <integer>314</integer> - <integer>5</integer> <integer>168</integer> + <integer>208</integer> + <integer>511</integer> + <integer>256</integer> <integer>224</integer> - <integer>256</integer> - <integer>585</integer> - <integer>511</integer> - <integer>502</integer> - <integer>208</integer> + <integer>633</integer> + <integer>5</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/English.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/MainWindow.nib/classes.nib =================================================================== --- trunk/Italian.lproj/MainWindow.nib/classes.nib 2007-07-18 18:53:36 UTC (rev 2527) +++ trunk/Italian.lproj/MainWindow.nib/classes.nib 2007-07-18 22:21:54 UTC (rev 2528) @@ -84,6 +84,7 @@ rotateRight = id; savePDFSettingToDefaults = id; search = id; + searchNotes = id; searchPDF = id; selectColor = id; smartAutoCropAll = id; @@ -129,6 +130,7 @@ noteArrayController = NSArrayController; noteOutlineView = SKNoteOutlineView; notePopUpButton = BDSKImagePopUpButton; + noteSearchField = NSSearchField; noteView = NSView; outlineView = NSOutlineView; ownerController = NSObjectController; @@ -144,6 +146,7 @@ progressSheet = NSWindow; rightSideBox = NSBox; rightSideButton = NSSegmentedControl; + rightSideCollapsibleView = BDSKCollapsibleView; rightSideContentBox = NSBox; rightSideEdgeView = BDSKEdgeView; scaleField = NSTextField; Modified: trunk/Italian.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Italian.lproj/MainWindow.nib/info.nib 2007-07-18 18:53:36 UTC (rev 2527) +++ trunk/Italian.lproj/MainWindow.nib/info.nib 2007-07-18 22:21:54 UTC (rev 2528) @@ -27,13 +27,13 @@ </array> <key>IBOpenObjects</key> <array> + <integer>539</integer> <integer>208</integer> - <integer>539</integer> + <integer>168</integer> + <integer>553</integer> + <integer>5</integer> <integer>511</integer> - <integer>5</integer> <integer>628</integer> - <integer>553</integer> - <integer>168</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2007-07-18 18:53:36 UTC (rev 2527) +++ trunk/SKMainWindowController.h 2007-07-18 22:21:54 UTC (rev 2528) @@ -77,7 +77,9 @@ IBOutlet NSBox *rightSideContentBox; IBOutlet NSBox *rightSideBox; IBOutlet BDSKEdgeView *rightSideEdgeView; + IBOutlet BDSKCollapsibleView *rightSideCollapsibleView; IBOutlet NSSegmentedControl *rightSideButton; + IBOutlet NSSearchField *noteSearchField; IBOutlet NSView *currentLeftSideView; IBOutlet NSView *currentRightSideView; @@ -231,6 +233,7 @@ - (IBAction)getInfo:(id)sender; - (void)displaySearchResultsForString:(NSString *)string; - (IBAction)search:(id)sender; +- (IBAction)searchNotes:(id)sender; - (IBAction)changeScaleFactor:(id)sender; - (IBAction)chooseScale:(id)sender; - (IBAction)dismissChooseScaleSheet:(id)sender; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-07-18 18:53:36 UTC (rev 2527) +++ trunk/SKMainWindowController.m 2007-07-18 22:21:54 UTC (rev 2528) @@ -141,6 +141,8 @@ - (void)exitPresentationMode; - (void)activityTimerFired:(NSTimer *)timer; +- (void)updateNoteFilterPredicate; + - (void)replaceSideView:(NSView *)oldView withView:(NSView *)newView animate:(BOOL)animate; - (void)handleApplicationWillTerminateNotification:(NSNotification *)notification; @@ -234,6 +236,9 @@ [findCollapsibleView setCollapseEdges:BDSKMaxXEdgeMask | BDSKMinYEdgeMask]; [findCollapsibleView setMinSize:NSMakeSize(50.0, 25.0)]; + [rightSideCollapsibleView setCollapseEdges:BDSKMaxXEdgeMask | BDSKMinYEdgeMask]; + [rightSideCollapsibleView setMinSize:NSMakeSize(100.0, 42.0)]; + [pdfContentBox setEdges:BDSKMinXEdgeMask | BDSKMaxXEdgeMask | BDSKMinYEdgeMask]; [findEdgeView setEdges:BDSKMaxXEdgeMask]; [leftSideEdgeView setEdges:BDSKMaxXEdgeMask]; @@ -2409,6 +2414,12 @@ } } +- (IBAction)searchNotes:(id)sender { + if ([[sender stringValue] length] && rightSidePaneState != SKNoteSidePaneState) + [self setRightSidePaneState:SKNoteSidePaneState]; + [self updateNoteFilterPredicate]; +} + #pragma mark Sub- and note- windows - (void)showSnapshotAtPageNumber:(int)pageNum forRect:(NSRect)rect factor:(int)factor display:(BOOL)display{ @@ -3168,23 +3179,7 @@ - (void)outlineViewNoteTypesDidChange:(NSOutlineView *)ov { if ([ov isEqual:noteOutlineView]) { - NSArray *types = [noteOutlineView noteTypes]; - if ([types count] == 8) { - [noteArrayController setFilterPredicate:nil]; - } else { - NSExpression *lhs = [NSExpression expressionForKeyPath:@"type"]; - NSMutableArray *predicateArray = [NSMutableArray array]; - NSEnumerator *typeEnum = [types objectEnumerator]; - NSString *type; - - while (type = [typeEnum nextObject]) { - NSExpression *rhs = [NSExpression expressionForConstantValue:type]; - NSPredicate *predicate = [NSComparisonPredicate predicateWithLeftExpression:lhs rightExpression:rhs modifier:NSDirectPredicateModifier type:NSEqualToPredicateOperatorType options:0]; - [predicateArray addObject:predicate]; - } - [noteArrayController setFilterPredicate:[NSCompoundPredicate orPredicateWithSubpredicates:predicateArray]]; - } - [noteOutlineView reloadData]; + [self updateNoteFilterPredicate]; } } @@ -3507,6 +3502,45 @@ } } +- (void)updateNoteFilterPredicate { + NSPredicate *filterPredicate = nil; + NSPredicate *typePredicate = nil; + NSPredicate *searchPredicate = nil; + NSArray *types = [noteOutlineView noteTypes]; + NSString *searchString = [noteSearchField stringValue]; + if ([types count] < 8) { + NSExpression *lhs = [NSExpression expressionForKeyPath:@"type"]; + NSMutableArray *predicateArray = [NSMutableArray array]; + NSEnumerator *typeEnum = [types objectEnumerator]; + NSString *type; + + while (type = [typeEnum nextObject]) { + NSExpression *rhs = [NSExpression expressionForConstantValue:type]; + NSPredicate *predicate = [NSComparisonPredicate predicateWithLeftExpression:lhs rightExpression:rhs modifier:NSDirectPredicateModifier type:NSEqualToPredicateOperatorType options:0]; + [predicateArray addObject:predicate]; + } + typePredicate = [NSCompoundPredicate orPredicateWithSubpredicates:predicateArray]; + } + if (searchString && [searchString isEqualToString:@""] == NO) { + NSExpression *lhs = [NSExpression expressionForConstantValue:searchString]; + NSExpression *rhs = [NSExpression expressionForKeyPath:@"contents"]; + NSPredicate *contentsPredicate = [NSComparisonPredicate predicateWithLeftExpression:lhs rightExpression:rhs modifier:NSDirectPredicateModifier type:NSInPredicateOperatorType options:NSCaseInsensitivePredicateOption | NSDiacriticInsensitivePredicateOption]; + rhs = [NSExpression expressionForKeyPath:@"text.string"]; + NSPredicate *textPredicate = [NSComparisonPredicate predicateWithLeftExpression:lhs rightExpression:rhs modifier:NSDirectPredicateModifier type:NSInPredicateOperatorType options:NSCaseInsensitivePredicateOption | NSDiacriticInsensitivePredicateOption]; + searchPredicate = [NSCompoundPredicate orPredicateWithSubpredicates:[NSArray arrayWithObjects:contentsPredicate, textPredicate, nil]]; + } + if (typePredicate) { + if (searchPredicate) + filterPredicate = [NSCompoundPredicate andPredicateWithSubpredicates:[NSArray arrayWithObjects:typePredicate, searchPredicate, nil]]; + else + filterPredicate = typePredicate; + } else if (searchPredicate) { + filterPredicate = searchPredicate; + } + [noteArrayController setFilterPredicate:filterPredicate]; + [noteOutlineView reloadData]; +} + #pragma mark Snapshots - (void)resetSnapshotSizeIfNeeded { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-18 18:53:38
|
Revision: 2527 http://skim-app.svn.sourceforge.net/skim-app/?rev=2527&view=rev Author: hofman Date: 2007-07-18 11:53:36 -0700 (Wed, 18 Jul 2007) Log Message: ----------- Pass pdfsync command through osascript when it is an applescript file. Modified Paths: -------------- trunk/SKDocument.m Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-07-18 18:19:48 UTC (rev 2526) +++ trunk/SKDocument.m 2007-07-18 18:53:36 UTC (rev 2527) @@ -38,6 +38,7 @@ #import "SKDocument.h" #import <Quartz/Quartz.h> +#import <Carbon/Carbon.h> #import "SKMainWindowController.h" #import "NSFileManager_ExtendedAttributes.h" #import "SKPDFAnnotationNote.h" @@ -926,6 +927,14 @@ [cmdString insertString:@"\" " atIndex:0]; [cmdString insertString:editorCmd atIndex:0]; [cmdString insertString:@"\"" atIndex:0]; + + NSString *extension = [editorCmd pathExtension]; + if (extension) { + NSString *theUTI = [(id)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (CFStringRef)extension, NULL) autorelease]; + if (theUTI && UTTypeConformsTo((CFStringRef)theUTI, CFSTR("com.apple.applescript.script")) || UTTypeConformsTo((CFStringRef)theUTI, CFSTR("com.apple.applescript.text"))) + [cmdString insertString:@"/usr/bin/osascript " atIndex:0]; + } + NSTask *task = [[[NSTask alloc] init] autorelease]; [task setLaunchPath:@"/bin/sh"]; [task setArguments:[NSArray arrayWithObjects:@"-c", cmdString, nil]]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-18 18:19:56
|
Revision: 2526 http://skim-app.svn.sourceforge.net/skim-app/?rev=2526&view=rev Author: hofman Date: 2007-07-18 11:19:48 -0700 (Wed, 18 Jul 2007) Log Message: ----------- Add appsupport path to PATH environment variable for pdfsync support. Modified Paths: -------------- trunk/SKDocument.m Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-07-18 11:43:08 UTC (rev 2525) +++ trunk/SKDocument.m 2007-07-18 18:19:48 UTC (rev 2526) @@ -57,6 +57,7 @@ #import "PDFSelection_SKExtensions.h" #import "SKInfoWindowController.h" #import "SKLine.h" +#import "SKApplicationController.h" // maximum length of xattr value recommended by Apple #define MAX_XATTR_LENGTH 2048 @@ -854,6 +855,7 @@ NSString *editorPreset = [[NSUserDefaults standardUserDefaults] objectForKey:SKTeXEditorPresetKey]; NSString *editorCmd = [[NSUserDefaults standardUserDefaults] objectForKey:SKTeXEditorCommandKey]; NSMutableString *cmdString = [[[[NSUserDefaults standardUserDefaults] objectForKey:SKTeXEditorArgumentsKey] mutableCopy] autorelease]; + NSMutableDictionary *environment = [[[[NSProcessInfo processInfo] environment] mutableCopy] autorelease]; if ([editorPreset isEqualToString:@""] == NO) { NSString *appPath = [[NSWorkspace sharedWorkspace] fullPathForApplication:editorPreset]; @@ -875,6 +877,25 @@ editorCmd = toolPath; } } + } else { + NSString *path = [environment objectForKey:@"PATH"]; + NSMutableArray *paths = [NSMutableArray arrayWithObjects:@"/usr/local/bin", nil]; + NSString *appSupportPath; + if ([path length]) + [paths insertObject:path atIndex:0]; + if (appSupportPath = [[NSApp delegate] applicationSupportPathForDomain:kUserDomain create:NO]) { + [paths addObject:appSupportPath]; + [paths addObject:[appSupportPath stringByAppendingPathComponent:@"Scripts"]]; + } + if (appSupportPath = [[NSApp delegate] applicationSupportPathForDomain:kLocalDomain create:NO]) { + [paths addObject:appSupportPath]; + [paths addObject:[appSupportPath stringByAppendingPathComponent:@"Scripts"]]; + } + if (appSupportPath = [[NSApp delegate] applicationSupportPathForDomain:kNetworkDomain create:NO]) { + [paths addObject:appSupportPath]; + [paths addObject:[appSupportPath stringByAppendingPathComponent:@"Scripts"]]; + } + [environment setObject:[paths componentsJoinedByString:@":"] forKey:@"PATH"]; } NSRange range = NSMakeRange(0, 0); @@ -901,6 +922,7 @@ [cmdString replaceCharactersInRange:range withString:[file stringByEscapingShellChars]]; } + [cmdString insertString:@"\" " atIndex:0]; [cmdString insertString:editorCmd atIndex:0]; [cmdString insertString:@"\"" atIndex:0]; @@ -908,6 +930,7 @@ [task setLaunchPath:@"/bin/sh"]; [task setArguments:[NSArray arrayWithObjects:@"-c", cmdString, nil]]; [task setCurrentDirectoryPath:[file stringByDeletingLastPathComponent]]; + [task setEnvironment:environment]; [task launch]; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-18 11:43:16
|
Revision: 2525 http://skim-app.svn.sourceforge.net/skim-app/?rev=2525&view=rev Author: hofman Date: 2007-07-18 04:43:08 -0700 (Wed, 18 Jul 2007) Log Message: ----------- Load transition filter names dynamically. This allows adding custom transition filters in the standard locations (Library/Graphics/Image Units). Add an extra option for the extent of the transition. Modified Paths: -------------- trunk/Dutch.lproj/MainWindow.nib/classes.nib trunk/Dutch.lproj/MainWindow.nib/data.dependency trunk/Dutch.lproj/MainWindow.nib/info.nib trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib trunk/English.lproj/MainWindow.nib/classes.nib trunk/English.lproj/MainWindow.nib/info.nib trunk/English.lproj/MainWindow.nib/keyedobjects.nib trunk/Italian.lproj/MainWindow.nib/classes.nib trunk/Italian.lproj/MainWindow.nib/info.nib trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib trunk/SKMainWindowController.h trunk/SKMainWindowController.m trunk/SKPDFView.h trunk/SKPDFView.m trunk/SKTransitionController.h trunk/SKTransitionController.m Modified: trunk/Dutch.lproj/MainWindow.nib/classes.nib =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/classes.nib 2007-07-18 08:44:28 UTC (rev 2524) +++ trunk/Dutch.lproj/MainWindow.nib/classes.nib 2007-07-18 11:43:08 UTC (rev 2525) @@ -160,6 +160,7 @@ toolModeButton = NSSegmentedControl; transitionDurationField = NSTextField; transitionDurationSlider = NSSlider; + transitionExtentMatrix = NSMatrix; transitionSheet = NSWindow; transitionStylePopUpButton = NSPopUpButton; }; Modified: trunk/Dutch.lproj/MainWindow.nib/data.dependency =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/data.dependency 2007-07-18 08:44:28 UTC (rev 2524) +++ trunk/Dutch.lproj/MainWindow.nib/data.dependency 2007-07-18 11:43:08 UTC (rev 2525) @@ -5,7 +5,6 @@ <key>IBPaletteDependency</key> <array> <string>PDFKit</string> - <string>Controllers</string> </array> </dict> </plist> Modified: trunk/Dutch.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-07-18 08:44:28 UTC (rev 2524) +++ trunk/Dutch.lproj/MainWindow.nib/info.nib 2007-07-18 11:43:08 UTC (rev 2525) @@ -25,6 +25,10 @@ <array> <integer>208</integer> </array> + <key>IBOpenObjects</key> + <array> + <integer>633</integer> + </array> <key>IBSystem Version</key> <string>8R218</string> </dict> Modified: trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/MainWindow.nib/classes.nib =================================================================== --- trunk/English.lproj/MainWindow.nib/classes.nib 2007-07-18 08:44:28 UTC (rev 2524) +++ trunk/English.lproj/MainWindow.nib/classes.nib 2007-07-18 11:43:08 UTC (rev 2525) @@ -160,6 +160,7 @@ toolModeButton = NSSegmentedControl; transitionDurationField = NSTextField; transitionDurationSlider = NSSlider; + transitionExtentMatrix = NSMatrix; transitionSheet = NSWindow; transitionStylePopUpButton = NSPopUpButton; }; Modified: trunk/English.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/English.lproj/MainWindow.nib/info.nib 2007-07-18 08:44:28 UTC (rev 2524) +++ trunk/English.lproj/MainWindow.nib/info.nib 2007-07-18 11:43:08 UTC (rev 2525) @@ -27,18 +27,18 @@ </array> <key>IBOpenObjects</key> <array> - <integer>168</integer> - <integer>256</integer> - <integer>5</integer> - <integer>208</integer> - <integer>502</integer> <integer>633</integer> + <integer>553</integer> <integer>539</integer> - <integer>511</integer> + <integer>314</integer> + <integer>5</integer> + <integer>168</integer> <integer>224</integer> - <integer>553</integer> - <integer>314</integer> + <integer>256</integer> <integer>585</integer> + <integer>511</integer> + <integer>502</integer> + <integer>208</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/English.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/MainWindow.nib/classes.nib =================================================================== --- trunk/Italian.lproj/MainWindow.nib/classes.nib 2007-07-18 08:44:28 UTC (rev 2524) +++ trunk/Italian.lproj/MainWindow.nib/classes.nib 2007-07-18 11:43:08 UTC (rev 2525) @@ -160,6 +160,7 @@ toolModeButton = NSSegmentedControl; transitionDurationField = NSTextField; transitionDurationSlider = NSSlider; + transitionExtentMatrix = NSMatrix; transitionSheet = NSWindow; transitionStylePopUpButton = NSPopUpButton; }; Modified: trunk/Italian.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Italian.lproj/MainWindow.nib/info.nib 2007-07-18 08:44:28 UTC (rev 2524) +++ trunk/Italian.lproj/MainWindow.nib/info.nib 2007-07-18 11:43:08 UTC (rev 2525) @@ -27,12 +27,12 @@ </array> <key>IBOpenObjects</key> <array> + <integer>208</integer> + <integer>539</integer> + <integer>511</integer> + <integer>5</integer> <integer>628</integer> - <integer>5</integer> - <integer>511</integer> <integer>553</integer> - <integer>539</integer> - <integer>208</integer> <integer>168</integer> </array> <key>IBSystem Version</key> Modified: trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2007-07-18 08:44:28 UTC (rev 2524) +++ trunk/SKMainWindowController.h 2007-07-18 11:43:08 UTC (rev 2525) @@ -167,6 +167,7 @@ IBOutlet NSPopUpButton *transitionStylePopUpButton; IBOutlet NSTextField *transitionDurationField; IBOutlet NSSlider *transitionDurationSlider; + IBOutlet NSMatrix *transitionExtentMatrix; NSButton *colorAccessoryView; BOOL updatingColor; Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-07-18 08:44:28 UTC (rev 2524) +++ trunk/SKMainWindowController.m 2007-07-18 11:43:08 UTC (rev 2525) @@ -74,6 +74,7 @@ #import "SKLineInspector.h" #import "SKColorSwatch.h" #import "SKStatusBar.h" +#import "SKTransitionController.h" #define SEGMENTED_CONTROL_HEIGHT 25.0 #define WINDOW_X_DELTA 0.0 @@ -1693,13 +1694,25 @@ if (returnCode == NSOKButton) { [pdfView setTransitionStyle:[[transitionStylePopUpButton selectedItem] tag]]; [pdfView setTransitionDuration:fmax([transitionDurationField floatValue], 0.0)]; + [pdfView setTransitionShouldRestrict:(BOOL)[[transitionExtentMatrix selectedCell] tag]]; } } - (IBAction)chooseTransition:(id)sender { + if ([transitionStylePopUpButton numberOfItems] == SKCoreImageTransition) { + NSArray *filterNames = [SKTransitionController transitionFilterNames]; + int i, count = [filterNames count]; + for (i = 0; i < count; i++) { + NSString *name = [filterNames objectAtIndex:i]; + [transitionStylePopUpButton addItemWithTitle:[CIFilter localizedNameForFilterName:name]]; + NSMenuItem *item = [transitionStylePopUpButton lastItem]; + [item setTag:SKCoreImageTransition + i]; + } + } [transitionStylePopUpButton selectItemWithTag:[pdfView transitionStyle]]; [transitionDurationField setFloatValue:[pdfView transitionDuration]]; [transitionDurationSlider setFloatValue:[pdfView transitionDuration]]; + [transitionExtentMatrix selectCellWithTag:(int)[pdfView transitionShouldRestrict]]; [NSApp beginSheet:transitionSheet modalForWindow:[self window] modalDelegate:self Modified: trunk/SKPDFView.h =================================================================== --- trunk/SKPDFView.h 2007-07-18 08:44:28 UTC (rev 2524) +++ trunk/SKPDFView.h 2007-07-18 11:43:08 UTC (rev 2525) @@ -93,6 +93,7 @@ SKAnimationTransitionStyle transitionStyle; float transitionDuration; + BOOL transitionShouldRestrict; PDFAnnotation *activeAnnotation; PDFAnnotation *highlightAnnotation; @@ -149,6 +150,9 @@ - (float)transitionDuration; - (void)setTransitionDuration:(float)duration; +- (BOOL)transitionShouldRestrict; +- (void)setTransitionShouldRestrict:(BOOL)flag; + - (IBAction)delete:(id)sender; - (IBAction)autoSelectContent:(id)sender; Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-07-18 08:44:28 UTC (rev 2524) +++ trunk/SKPDFView.m 2007-07-18 11:43:08 UTC (rev 2525) @@ -153,6 +153,7 @@ transitionController = nil; transitionStyle = SKNoTransition; transitionDuration = 1.0; + transitionShouldRestrict = NO; spellingTag = [NSSpellChecker uniqueSpellDocumentTag]; @@ -548,6 +549,14 @@ transitionDuration = duration; } +- (BOOL)transitionShouldRestrict { + return transitionShouldRestrict; +} + +- (void)setTransitionShouldRestrict:(BOOL)flag { + transitionShouldRestrict = flag; +} + #pragma mark Reading bar - (BOOL)hasReadingBar { @@ -587,7 +596,7 @@ else [super goToPreviousPage:self]; rect = [self convertRect:[[self currentPage] boundsForBox:[self displayBox]] fromPage:[self currentPage]]; - [transitionController animateWithTransitionStyle:[self transitionStyle] direction:next ? CGSLeft : CGSRight duration:[self transitionDuration] fromRect:rect]; + [transitionController animateWithTransitionStyle:[self transitionStyle] direction:next ? CGSLeft : CGSRight duration:[self transitionDuration] fromRect:rect shouldRestrict:transitionShouldRestrict]; } - (void)goToNextPage:(id)sender { Modified: trunk/SKTransitionController.h =================================================================== --- trunk/SKTransitionController.h 2007-07-18 08:44:28 UTC (rev 2524) +++ trunk/SKTransitionController.h 2007-07-18 11:43:08 UTC (rev 2525) @@ -107,6 +107,8 @@ SKWarpSwitchTransition = CGSWarpSwitch, SKWarpFlipTransition = CGSFlip, // Core Image transitions + SKCoreImageTransition + /* SKCopyMachineTransition, SKDisintegrateTransition, SKDissolveTransition, @@ -114,7 +116,7 @@ SKModTransition, SKPageCurlTransition, SKRippleTransition, - SKSwipeTransition + SKSwipeTransition*/ } SKAnimationTransitionStyle; @class SKTransitionView; @@ -127,12 +129,14 @@ NSRect imageRect; } ++ (NSArray *)transitionFilterNames; + - (id)initWithView:(NSView *)aView; - (NSView *)view; - (void)setView:(NSView *)newView; - (void)prepareForAnimationWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle fromRect:(NSRect)rect; -- (void)animateWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle direction:(CGSTransitionOption)direction duration:(float)duration fromRect:(NSRect)rect; +- (void)animateWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle direction:(CGSTransitionOption)direction duration:(float)duration fromRect:(NSRect)rect shouldRestrict:(BOOL)shouldRestrict; @end Modified: trunk/SKTransitionController.m =================================================================== --- trunk/SKTransitionController.m 2007-07-18 08:44:28 UTC (rev 2524) +++ trunk/SKTransitionController.m 2007-07-18 11:43:08 UTC (rev 2525) @@ -74,6 +74,18 @@ @implementation SKTransitionController ++ (NSArray *)transitionFilterNames { + static NSMutableArray *transitionFilterNames = nil; + + if(transitionFilterNames == nil) { + // get all the transition filters + [CIPlugIn loadAllPlugIns]; + transitionFilterNames = [[CIFilter filterNamesInCategories:[NSArray arrayWithObject:kCICategoryTransition]] copy]; + } + + return transitionFilterNames; +} + - (id)initWithView:(NSView *)aView { if (self = [super init]) { view = aView; @@ -126,71 +138,48 @@ return inputMaskImage; } -- (CIFilter *)transitionFilter:(SKAnimationTransitionStyle)transitionStyle forRect:(NSRect)rect inBounds:(NSRect)bounds initialCIImage:(CIImage *)initialCIImage finalCIImage:(CIImage *)finalCIImage { - CIFilter *transitionFilter = nil; +- (CIFilter *)transitionFilter:(SKAnimationTransitionStyle)transitionStyle forRect:(NSRect)rect inBounds:(NSRect)bounds shouldRestrict:(BOOL)shouldRestrict initialCIImage:(CIImage *)initialCIImage finalCIImage:(CIImage *)finalCIImage { + NSString *filterName = [[[self class] transitionFilterNames] objectAtIndex:transitionStyle - SKCoreImageTransition]; + CIFilter *transitionFilter = [self filterWithName:filterName]; - switch (transitionStyle) { - case SKCopyMachineTransition: - transitionFilter = [self filterWithName:@"CICopyMachineTransition"]; - [transitionFilter setValue:[CIVector vectorWithX:NSMinX(rect) Y:NSMinY(rect) Z:NSWidth(rect) W:NSHeight(rect)] forKey:@"inputExtent"]; - break; - - case SKDisintegrateTransition: - { - transitionFilter = [self filterWithName:@"CIDisintegrateWithMaskTransition"]; - - // Scale and translate our mask image to match the transition area size. - CIFilter *maskScalingFilter = [self filterWithName:@"CILanczosScaleTransform"]; - CGRect maskExtent = [[self inputMaskImage] extent]; - float xScale = NSWidth(rect) / CGRectGetWidth(maskExtent); - float yScale = NSHeight(rect) / CGRectGetHeight(maskExtent); - [maskScalingFilter setValue:[NSNumber numberWithFloat:yScale] forKey:@"inputScale"]; - [maskScalingFilter setValue:[NSNumber numberWithFloat:xScale / yScale] forKey:@"inputAspectRatio"]; - [maskScalingFilter setValue:[self inputMaskImage] forKey:@"inputImage"]; - CIFilter *maskTranslationFilter = [self filterWithName:@"CIAffineTransform"]; - NSAffineTransform *affineTransform = [NSAffineTransform transform]; - [affineTransform translateXBy:NSMinX(rect) - NSMinX(bounds) yBy:NSMinY(rect) - NSMinY(bounds)]; - [maskTranslationFilter setValue:affineTransform forKey:@"inputTransform"]; - [maskTranslationFilter setValue:[maskScalingFilter valueForKey:@"outputImage"] forKey:@"inputImage"]; - - [transitionFilter setValue:[maskTranslationFilter valueForKey:@"outputImage"] forKey:@"inputMaskImage"]; - break; - } - case SKDissolveTransition: - transitionFilter = [self filterWithName:@"CIDissolveTransition"]; - break; - - case SKFlashTransition: - transitionFilter = [self filterWithName:@"CIFlashTransition"]; - [transitionFilter setValue:[CIVector vectorWithX:NSMidX(rect) Y:NSMidY(rect)] forKey:@"inputCenter"]; - [transitionFilter setValue:[CIVector vectorWithX:NSMinX(bounds) Y:NSMinY(bounds) Z:NSWidth(bounds) W:NSHeight(bounds)] forKey:@"inputExtent"]; - break; - - case SKModTransition: - transitionFilter = [self filterWithName:@"CIModTransition"]; - [transitionFilter setValue:[CIVector vectorWithX:NSMidX(rect) Y:NSMidY(rect)] forKey:@"inputCenter"]; - break; - - case SKPageCurlTransition: - transitionFilter = [self filterWithName:@"CIPageCurlTransition"]; + NSEnumerator *keyEnum = [[transitionFilter inputKeys] objectEnumerator]; + NSString *key; + + while (key = [keyEnum nextObject]) { + if([key isEqualToString:@"inputExtent"]) { + NSRect extent = shouldRestrict ? rect : bounds; + [transitionFilter setValue:[CIVector vectorWithX:NSMinX(extent) Y:NSMinY(extent) Z:NSWidth(extent) W:NSHeight(extent)] forKey:key]; + } else if([key isEqualToString:@"inputAngle"] && [filterName isEqualToString:@"CIPageCurlTransition"]) { [transitionFilter setValue:[NSNumber numberWithFloat:-M_PI_4] forKey:@"inputAngle"]; - [transitionFilter setValue:initialCIImage forKey:@"inputBacksideImage"]; - [transitionFilter setValue:[self inputShadingImage] forKey:@"inputShadingImage"]; - [transitionFilter setValue:[CIVector vectorWithX:NSMinX(rect) Y:NSMinY(rect) Z:NSWidth(rect) W:NSHeight(rect)] forKey:@"inputExtent"]; - break; + } else if([key isEqualToString:@"inputCenter"]) { + [transitionFilter setValue:[CIVector vectorWithX:NSMidX(rect) Y:NSMidY(rect)] forKey:key]; + } else { + NSString *classType = [[[transitionFilter attributes] objectForKey:key] objectForKey:kCIAttributeClass]; - case SKSwipeTransition: - transitionFilter = [self filterWithName:@"CISwipeTransition"]; - [transitionFilter setValue:[CIVector vectorWithX:NSMinX(rect) Y:NSMinY(rect) Z:NSWidth(rect) W:NSHeight(rect)] forKey:@"inputExtent"]; - break; - - case SKRippleTransition: - default: - transitionFilter = [self filterWithName:@"CIRippleTransition"]; - [transitionFilter setValue:[CIVector vectorWithX:NSMidX(rect) Y:NSMidY(rect)] forKey:@"inputCenter"]; - [transitionFilter setValue:[CIVector vectorWithX:NSMinX(bounds) Y:NSMinY(bounds) Z:NSWidth(bounds) W:NSHeight(bounds)] forKey:@"inputExtent"]; - [transitionFilter setValue:[self inputShadingImage] forKey:@"inputShadingImage"]; - break; + if([classType isEqualToString:@"CIImage"]) { + if([key isEqualToString:@"inputShadingImage"]) { + [transitionFilter setValue:[self inputShadingImage] forKey:key]; + } else if ([key isEqualToString:@"inputBacksideImage"]) { + [transitionFilter setValue:initialCIImage forKey:key]; + } else { + // Scale and translate our mask image to match the transition area size. + CIFilter *maskScalingFilter = [self filterWithName:@"CILanczosScaleTransform"]; + CGRect maskExtent = [[self inputMaskImage] extent]; + float xScale = NSWidth(rect) / CGRectGetWidth(maskExtent); + float yScale = NSHeight(rect) / CGRectGetHeight(maskExtent); + [maskScalingFilter setValue:[NSNumber numberWithFloat:yScale] forKey:@"inputScale"]; + [maskScalingFilter setValue:[NSNumber numberWithFloat:xScale / yScale] forKey:@"inputAspectRatio"]; + [maskScalingFilter setValue:[self inputMaskImage] forKey:@"inputImage"]; + CIFilter *maskTranslationFilter = [self filterWithName:@"CIAffineTransform"]; + NSAffineTransform *affineTransform = [NSAffineTransform transform]; + [affineTransform translateXBy:NSMinX(rect) - NSMinX(bounds) yBy:NSMinY(rect) - NSMinY(bounds)]; + [maskTranslationFilter setValue:affineTransform forKey:@"inputTransform"]; + [maskTranslationFilter setValue:[maskScalingFilter valueForKey:@"outputImage"] forKey:@"inputImage"]; + + [transitionFilter setValue:[maskTranslationFilter valueForKey:@"outputImage"] forKey:key]; + } + } + } } if (NSEqualRects(rect, bounds) == NO) { @@ -211,7 +200,7 @@ - (void)prepareForAnimationWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle fromRect:(NSRect)rect { if (transitionStyle == SKNoTransition) { - } else if (transitionStyle < SKCopyMachineTransition) { + } else if (transitionStyle < SKCoreImageTransition) { // We don't want the window to draw the next state before the animation is run [[view window] disableFlushWindow]; } else { @@ -228,10 +217,10 @@ } } -- (void)animateWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle direction:(CGSTransitionOption)direction duration:(float)duration fromRect:(NSRect)rect { +- (void)animateWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle direction:(CGSTransitionOption)direction duration:(float)duration fromRect:(NSRect)rect shouldRestrict:(BOOL)shouldRestrict { if (transitionStyle == SKNoTransition) { - } else if (transitionStyle < SKCopyMachineTransition) { + } else if (transitionStyle < SKCoreImageTransition) { // declare our variables int handle = -1; @@ -257,7 +246,7 @@ [[view window] flushWindow]; CGSInvokeTransition(cgs, handle, duration); - // We need to wait for the transition to finish before we get rid of it, otherwise we’ll get all sorts of nasty errors... or maybe not. + // We need to wait for the transition to finish before we get rid of it, otherwise we'll get all sorts of nasty errors... or maybe not. usleep((useconds_t)(duration * 1000000)); CGSReleaseTransition(cgs, handle); @@ -275,7 +264,7 @@ [view cacheDisplayInRect:bounds toBitmapImageRep:finalContentBitmap]; CIImage *finalImage = [[CIImage alloc] initWithBitmapImageRep:finalContentBitmap]; - CIFilter *transitionFilter = [self transitionFilter:transitionStyle forRect:imageRect inBounds:[view bounds] initialCIImage:initialImage finalCIImage:finalImage]; + CIFilter *transitionFilter = [self transitionFilter:transitionStyle forRect:imageRect inBounds:[view bounds] shouldRestrict:shouldRestrict initialCIImage:initialImage finalCIImage:finalImage]; [finalImage release]; [initialImage release]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-18 08:44:29
|
Revision: 2524 http://skim-app.svn.sourceforge.net/skim-app/?rev=2524&view=rev Author: hofman Date: 2007-07-18 01:44:28 -0700 (Wed, 18 Jul 2007) Log Message: ----------- Also disable flushing during CG transition animations. Modified Paths: -------------- trunk/SKTransitionController.m Modified: trunk/SKTransitionController.m =================================================================== --- trunk/SKTransitionController.m 2007-07-18 00:10:34 UTC (rev 2523) +++ trunk/SKTransitionController.m 2007-07-18 08:44:28 UTC (rev 2524) @@ -209,7 +209,12 @@ } - (void)prepareForAnimationWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle fromRect:(NSRect)rect { - if (transitionStyle >= SKCopyMachineTransition) { + if (transitionStyle == SKNoTransition) { + + } else if (transitionStyle < SKCopyMachineTransition) { + // We don't want the window to draw the next state before the animation is run + [[view window] disableFlushWindow]; + } else { NSRect bounds = [view bounds]; [initialImage release]; NSBitmapImageRep *initialContentBitmap = [view bitmapImageRepForCachingDisplayInRect:bounds]; @@ -239,7 +244,7 @@ spec.backColour = NULL; spec.wid = [[view window] windowNumber]; - // Let’s get a connection + // Let's get a connection CGSConnection cgs = _CGSDefaultConnection(); // Create a transition @@ -247,6 +252,9 @@ // Redraw the window [[view window] display]; + // Remember we disabled flushing in the previous method, we need to balance that. + [[view window] enableFlushWindow]; + [[view window] flushWindow]; CGSInvokeTransition(cgs, handle, duration); // We need to wait for the transition to finish before we get rid of it, otherwise we’ll get all sorts of nasty errors... or maybe not. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-18 00:10:36
|
Revision: 2523 http://skim-app.svn.sourceforge.net/skim-app/?rev=2523&view=rev Author: hofman Date: 2007-07-17 17:10:34 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Fix PostScript header. Modified Paths: -------------- trunk/SKDocumentController.m Modified: trunk/SKDocumentController.m =================================================================== --- trunk/SKDocumentController.m 2007-07-17 23:35:02 UTC (rev 2522) +++ trunk/SKDocumentController.m 2007-07-18 00:10:34 UTC (rev 2523) @@ -75,7 +75,7 @@ } static NSData *psHeaderData = nil; if (nil == psHeaderData) { - char *h = "%PS-"; + char *h = "%!PS-"; psHeaderData = [[NSData alloc] initWithBytes:h length:strlen(h)]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-17 23:35:07
|
Revision: 2522 http://skim-app.svn.sourceforge.net/skim-app/?rev=2522&view=rev Author: hofman Date: 2007-07-17 16:35:02 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Override method to determine the document type from a file. If it's a type we can't open, try to check for the file header, it might be PDF or PS with the wrong extension. Modified Paths: -------------- trunk/SKDocumentController.m Modified: trunk/SKDocumentController.m =================================================================== --- trunk/SKDocumentController.m 2007-07-17 21:19:16 UTC (rev 2521) +++ trunk/SKDocumentController.m 2007-07-17 23:35:02 UTC (rev 2522) @@ -67,6 +67,39 @@ return type; } +- (NSString *)typeForContentsOfURL:(NSURL *)inAbsoluteURL error:(NSError **)outError { + static NSData *pdfHeaderData = nil; + if (nil == pdfHeaderData) { + char *h = "%PDF-"; + pdfHeaderData = [[NSData alloc] initWithBytes:h length:strlen(h)]; + } + static NSData *psHeaderData = nil; + if (nil == psHeaderData) { + char *h = "%PS-"; + psHeaderData = [[NSData alloc] initWithBytes:h length:strlen(h)]; + } + + NSError *error = nil; + NSString *type = [super typeForContentsOfURL:inAbsoluteURL error:&error]; + + if (type == nil || [type isEqualToString:SKNotesRTFDocumentType] || [type isEqualToString:SKNotesTextDocumentType]) { + if ([inAbsoluteURL isFileURL]) { + NSString *fileName = [inAbsoluteURL path]; + NSFileHandle *fh = [NSFileHandle fileHandleForReadingAtPath:fileName]; + NSData *leadingData = [fh readDataOfLength:5]; + if ([leadingData length] >= [pdfHeaderData length] && [pdfHeaderData isEqual:[leadingData subdataWithRange:NSMakeRange(0, [pdfHeaderData length])]]) { + type = SKPDFDocumentType; + } else if ([leadingData length] >= [psHeaderData length] && [psHeaderData isEqual:[leadingData subdataWithRange:NSMakeRange(0, [psHeaderData length])]]) { + type = SKPostScriptDocumentType; + } + } + if (type == nil && outError) + *outError = error; + } + + return type; +} + static NSData *convertTIFFDataToPDF(NSData *tiffData) { // this should accept any image data types we're likely to run across, but PICT returns a zero size image This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-17 21:19:19
|
Revision: 2521 http://skim-app.svn.sourceforge.net/skim-app/?rev=2521&view=rev Author: hofman Date: 2007-07-17 14:19:16 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Change tab name in prefs from LaTeX to Sync. Fix help on prefs. Modified Paths: -------------- trunk/Dutch.lproj/PreferenceWindow.nib/info.nib 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/Italian.lproj/PreferenceWindow.nib/keyedobjects.nib trunk/Italian.lproj/Skim Help/skim.texi Modified: trunk/Dutch.lproj/PreferenceWindow.nib/info.nib =================================================================== --- trunk/Dutch.lproj/PreferenceWindow.nib/info.nib 2007-07-17 21:12:36 UTC (rev 2520) +++ trunk/Dutch.lproj/PreferenceWindow.nib/info.nib 2007-07-17 21:19:16 UTC (rev 2521) @@ -8,10 +8,6 @@ <string>446.1</string> <key>IBLockedObjects</key> <array/> - <key>IBOpenObjects</key> - <array> - <integer>5</integer> - </array> <key>IBSystem Version</key> <string>8R218</string> </dict> 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-07-17 21:12:36 UTC (rev 2520) +++ trunk/Dutch.lproj/Skim Help/skim.texi 2007-07-17 21:19:16 UTC (rev 2521) @@ -911,7 +911,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. +@item Om de kleur van de leesbalk of de transparantie te wijzigen, kies Skim > Voorkeuren, klik op Weergave, en selecteer Kleur onder Leesbalk. @end itemize @endbox @@ -995,7 +995,7 @@ @box{taskbox} @itemize -@item Om zoekresultaten te markeren met een cirkel, kies Skim > Voorkeuren, klik op Kleuren, en selecteer "Markeer zoekresultaten met kleur". +@item Om zoekresultaten te markeren met een cirkel, kies Skim > Voorkeuren, klik op Weergave, en selecteer "Markeer zoekresultaten met kleur". @item Om de kleur die gebruikt wordt voor zoekresultaten te wijzigen, klik op 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-07-17 21:12:36 UTC (rev 2520) +++ trunk/English.lproj/Skim Help/skim.texi 2007-07-17 21:19:16 UTC (rev 2521) @@ -906,7 +906,7 @@ @box{taskbox} @itemize -@item To change the color or transparency of the reading bar, choose Skim > Preferences, click Colors, and select Color. +@item To change the color or transparency of the reading bar, choose Skim > Preferences, click Display, and select Color below "Reading bar". @end itemize @endbox @@ -990,7 +990,7 @@ @box{taskbox} @itemize -@item To highlight Find results using a circle, choose Skim > Preferences, click Colors, and select "Highlight search results with color". +@item To highlight Find results using a circle, choose Skim > Preferences, click Display, and select "Highlight search results with color". @item To change the color used for the Find highlights, click the color. @end itemize @endbox Modified: trunk/Italian.lproj/PreferenceWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/Skim Help/skim.texi =================================================================== --- trunk/Italian.lproj/Skim Help/skim.texi 2007-07-17 21:12:36 UTC (rev 2520) +++ trunk/Italian.lproj/Skim Help/skim.texi 2007-07-17 21:19:16 UTC (rev 2521) @@ -906,7 +906,7 @@ @box{taskbox} @itemize -@item To change the color or transparency of the reading bar, choose Skim > Preferences, click Colors, and select Color. +@item To change the color or transparency of the reading bar, choose Skim > Preferences, click Display, and select Color below "Reading bar". @end itemize @endbox @@ -990,7 +990,7 @@ @box{taskbox} @itemize -@item To highlight Find results using a circle, choose Skim > Preferences, click Colors, and select "Highlight search results with color". +@item To highlight Find results using a circle, choose Skim > Preferences, click Display, and select "Highlight search results with color". @item To change the color used for the Find highlights, click the color. @end itemize @endbox This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-17 21:13:10
|
Revision: 2520 http://skim-app.svn.sourceforge.net/skim-app/?rev=2520&view=rev Author: hofman Date: 2007-07-17 14:12:36 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Fix selectors. Modified Paths: -------------- trunk/SKSideWindow.m Modified: trunk/SKSideWindow.m =================================================================== --- trunk/SKSideWindow.m 2007-07-17 19:36:58 UTC (rev 2519) +++ trunk/SKSideWindow.m 2007-07-17 21:12:36 UTC (rev 2520) @@ -211,9 +211,9 @@ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { SEL action = [menuItem action]; - if (action == @selector(toggleLeftSidePane) || action == @selector(toggleRightSidePane) || - action == @selector(changeLeftSidePaneState) || action == @selector(changeRightSidePaneState) || - action == @selector(toggleFullScreen) || action == @selector(togglePresentation)) { + if (action == @selector(toggleLeftSidePane:) || action == @selector(toggleRightSidePane:) || + action == @selector(changeLeftSidePaneState:) || action == @selector(changeRightSidePaneState:) || + action == @selector(toggleFullScreen:) || action == @selector(togglePresentation:)) { return [controller validateMenuItem:menuItem]; } else { return [super validateMenuItem:menuItem]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-17 19:37:17
|
Revision: 2519 http://skim-app.svn.sourceforge.net/skim-app/?rev=2519&view=rev Author: hofman Date: 2007-07-17 12:36:58 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Mark transition view for redisplay when setting the animation. Display only the view for animation as it is opaque. Modified Paths: -------------- trunk/SKTransitionController.m Modified: trunk/SKTransitionController.m =================================================================== --- trunk/SKTransitionController.m 2007-07-17 19:02:37 UTC (rev 2518) +++ trunk/SKTransitionController.m 2007-07-17 19:36:58 UTC (rev 2519) @@ -295,7 +295,6 @@ [transitionWindow setFrame:frame display:NO]; [transitionWindow orderBack:nil]; - [transitionWindow display]; [window addChildWindow:transitionWindow ordered:NSWindowAbove]; [animation startAnimation]; @@ -334,7 +333,7 @@ - (void)setCurrentProgress:(NSAnimationProgress)progress { [filter setValue:[NSNumber numberWithFloat:[self currentValue]] forKey:@"inputTime"]; [super setCurrentProgress:progress]; - [[[self delegate] window] display]; + [[self delegate] display]; } - (CIImage *)currentImage { @@ -406,6 +405,7 @@ [animation release]; animation = [newAnimation retain]; [animation setDelegate:self]; + [self setNeedsDisplay:YES]; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-17 19:02:42
|
Revision: 2518 http://skim-app.svn.sourceforge.net/skim-app/?rev=2518&view=rev Author: hofman Date: 2007-07-17 12:02:37 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Shortcut for transition effect. Modified Paths: -------------- trunk/Dutch.lproj/MainMenu.nib/info.nib trunk/Dutch.lproj/MainMenu.nib/keyedobjects.nib trunk/English.lproj/MainMenu.nib/keyedobjects.nib trunk/Italian.lproj/MainMenu.nib/keyedobjects.nib Modified: trunk/Dutch.lproj/MainMenu.nib/info.nib =================================================================== --- trunk/Dutch.lproj/MainMenu.nib/info.nib 2007-07-17 17:23:14 UTC (rev 2517) +++ trunk/Dutch.lproj/MainMenu.nib/info.nib 2007-07-17 19:02:37 UTC (rev 2518) @@ -7,10 +7,14 @@ <key>IBEditorPositions</key> <dict> <key>29</key> - <string>140 614 542 44 0 0 1440 938 </string> + <string>140 614 635 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>8R218</string> </dict> Modified: trunk/Dutch.lproj/MainMenu.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/MainMenu.nib/keyedobjects.nib =================================================================== (Binary files differ) 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-07-17 17:23:16
|
Revision: 2517 http://skim-app.svn.sourceforge.net/skim-app/?rev=2517&view=rev Author: hofman Date: 2007-07-17 10:23:14 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Partly revert an earlier commit: don't use class methods for mask/shading images and filters, as there may be several presentations on different screens (really). Set default value for (cached) filter. In particular the start time should be reset to 0. Shift the location of the mask image and of the swipe extent. Disable flushWindow of the fullscreen window during animation, so we can be sure the next state is not shown on screen too early. Modified Paths: -------------- trunk/SKTransitionController.m Modified: trunk/SKTransitionController.m =================================================================== --- trunk/SKTransitionController.m 2007-07-17 17:20:53 UTC (rev 2516) +++ trunk/SKTransitionController.m 2007-07-17 17:23:14 UTC (rev 2517) @@ -74,19 +74,39 @@ @implementation SKTransitionController -+ (CIFilter *)filterWithName:(NSString *)name { +- (id)initWithView:(NSView *)aView { + if (self = [super init]) { + view = aView; + } + return self; +} + +- (void)dealloc { + [transitionWindow release]; + [initialImage release]; + [super dealloc]; +} + +- (NSView *)view { + return view; +} + +- (void)setView:(NSView *)newView { + view = newView; +} + +- (CIFilter *)filterWithName:(NSString *)name { static NSMutableDictionary *filters = nil; if (filters == nil) filters = [[NSMutableDictionary alloc] init]; CIFilter *filter = [filters objectForKey:name]; - if (filter == nil && (filter = [CIFilter filterWithName:name])) { - [filter setDefaults]; + if (filter == nil && (filter = [CIFilter filterWithName:name])) [filters setObject:filter forKey:name]; - } + [filter setDefaults]; return filter; } -+ (CIImage *)inputShadingImage { +- (CIImage *)inputShadingImage { static CIImage *inputShadingImage = nil; if (inputShadingImage == nil) { NSData *shadingBitmapData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"TransitionShading" ofType:@"tiff"]]; @@ -96,7 +116,7 @@ return inputShadingImage; } -+ (CIImage *)inputMaskImage { +- (CIImage *)inputMaskImage { static CIImage *inputMaskImage = nil; if (inputMaskImage == nil) { NSData *maskBitmapData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"TransitionMask" ofType:@"jpg"]]; @@ -106,69 +126,75 @@ return inputMaskImage; } -+ (CIFilter *)transitionFilter:(SKAnimationTransitionStyle)transitionStyle forRect:(NSRect)rect inBounds:(NSRect)bounds initialCIImage:(CIImage *)initialCIImage finalCIImage:(CIImage *)finalCIImage { +- (CIFilter *)transitionFilter:(SKAnimationTransitionStyle)transitionStyle forRect:(NSRect)rect inBounds:(NSRect)bounds initialCIImage:(CIImage *)initialCIImage finalCIImage:(CIImage *)finalCIImage { CIFilter *transitionFilter = nil; switch (transitionStyle) { case SKCopyMachineTransition: - transitionFilter = [[self class] filterWithName:@"CICopyMachineTransition"]; + transitionFilter = [self filterWithName:@"CICopyMachineTransition"]; [transitionFilter setValue:[CIVector vectorWithX:NSMinX(rect) Y:NSMinY(rect) Z:NSWidth(rect) W:NSHeight(rect)] forKey:@"inputExtent"]; break; case SKDisintegrateTransition: { - transitionFilter = [[self class] filterWithName:@"CIDisintegrateWithMaskTransition"]; + transitionFilter = [self filterWithName:@"CIDisintegrateWithMaskTransition"]; - // Scale our mask image to match the transition area size, and set the scaled result as the "inputMaskImage" to the transitionFilter. - CIFilter *maskScalingFilter = [[self class] filterWithName:@"CILanczosScaleTransform"]; - CGRect maskExtent = [[[self class] inputMaskImage] extent]; + // Scale and translate our mask image to match the transition area size. + CIFilter *maskScalingFilter = [self filterWithName:@"CILanczosScaleTransform"]; + CGRect maskExtent = [[self inputMaskImage] extent]; float xScale = NSWidth(rect) / CGRectGetWidth(maskExtent); float yScale = NSHeight(rect) / CGRectGetHeight(maskExtent); [maskScalingFilter setValue:[NSNumber numberWithFloat:yScale] forKey:@"inputScale"]; [maskScalingFilter setValue:[NSNumber numberWithFloat:xScale / yScale] forKey:@"inputAspectRatio"]; - [maskScalingFilter setValue:[[self class] inputMaskImage] forKey:@"inputImage"]; + [maskScalingFilter setValue:[self inputMaskImage] forKey:@"inputImage"]; + CIFilter *maskTranslationFilter = [self filterWithName:@"CIAffineTransform"]; + NSAffineTransform *affineTransform = [NSAffineTransform transform]; + [affineTransform translateXBy:NSMinX(rect) - NSMinX(bounds) yBy:NSMinY(rect) - NSMinY(bounds)]; + [maskTranslationFilter setValue:affineTransform forKey:@"inputTransform"]; + [maskTranslationFilter setValue:[maskScalingFilter valueForKey:@"outputImage"] forKey:@"inputImage"]; - [transitionFilter setValue:[maskScalingFilter valueForKey:@"outputImage"] forKey:@"inputMaskImage"]; + [transitionFilter setValue:[maskTranslationFilter valueForKey:@"outputImage"] forKey:@"inputMaskImage"]; break; } case SKDissolveTransition: - transitionFilter = [[self class] filterWithName:@"CIDissolveTransition"]; + transitionFilter = [self filterWithName:@"CIDissolveTransition"]; break; case SKFlashTransition: - transitionFilter = [[self class] filterWithName:@"CIFlashTransition"]; + transitionFilter = [self filterWithName:@"CIFlashTransition"]; [transitionFilter setValue:[CIVector vectorWithX:NSMidX(rect) Y:NSMidY(rect)] forKey:@"inputCenter"]; [transitionFilter setValue:[CIVector vectorWithX:NSMinX(bounds) Y:NSMinY(bounds) Z:NSWidth(bounds) W:NSHeight(bounds)] forKey:@"inputExtent"]; break; case SKModTransition: - transitionFilter = [[self class] filterWithName:@"CIModTransition"]; + transitionFilter = [self filterWithName:@"CIModTransition"]; [transitionFilter setValue:[CIVector vectorWithX:NSMidX(rect) Y:NSMidY(rect)] forKey:@"inputCenter"]; break; case SKPageCurlTransition: - transitionFilter = [[self class] filterWithName:@"CIPageCurlTransition"]; + transitionFilter = [self filterWithName:@"CIPageCurlTransition"]; [transitionFilter setValue:[NSNumber numberWithFloat:-M_PI_4] forKey:@"inputAngle"]; [transitionFilter setValue:initialCIImage forKey:@"inputBacksideImage"]; - [transitionFilter setValue:[[self class] inputShadingImage] forKey:@"inputShadingImage"]; + [transitionFilter setValue:[self inputShadingImage] forKey:@"inputShadingImage"]; [transitionFilter setValue:[CIVector vectorWithX:NSMinX(rect) Y:NSMinY(rect) Z:NSWidth(rect) W:NSHeight(rect)] forKey:@"inputExtent"]; break; case SKSwipeTransition: - transitionFilter = [[self class] filterWithName:@"CISwipeTransition"]; + transitionFilter = [self filterWithName:@"CISwipeTransition"]; + [transitionFilter setValue:[CIVector vectorWithX:NSMinX(rect) Y:NSMinY(rect) Z:NSWidth(rect) W:NSHeight(rect)] forKey:@"inputExtent"]; break; case SKRippleTransition: default: - transitionFilter = [[self class] filterWithName:@"CIRippleTransition"]; + transitionFilter = [self filterWithName:@"CIRippleTransition"]; [transitionFilter setValue:[CIVector vectorWithX:NSMidX(rect) Y:NSMidY(rect)] forKey:@"inputCenter"]; [transitionFilter setValue:[CIVector vectorWithX:NSMinX(bounds) Y:NSMinY(bounds) Z:NSWidth(bounds) W:NSHeight(bounds)] forKey:@"inputExtent"]; - [transitionFilter setValue:[[self class] inputShadingImage] forKey:@"inputShadingImage"]; + [transitionFilter setValue:[self inputShadingImage] forKey:@"inputShadingImage"]; break; } if (NSEqualRects(rect, bounds) == NO) { - CIFilter *cropFilter = [[self class] filterWithName:@"CICrop"]; + CIFilter *cropFilter = [self filterWithName:@"CICrop"]; [cropFilter setValue:[CIVector vectorWithX:NSMinX(rect) Y:NSMinY(rect) Z:NSWidth(rect) W:NSHeight(rect)] forKey:@"inputRectangle"]; [cropFilter setValue:initialCIImage forKey:@"inputImage"]; initialCIImage = [cropFilter valueForKey:@"outputImage"]; @@ -182,27 +208,6 @@ return transitionFilter; } -- (id)initWithView:(NSView *)aView { - if (self = [super init]) { - view = aView; - } - return self; -} - -- (void)dealloc { - [transitionWindow release]; - [initialImage release]; - [super dealloc]; -} - -- (NSView *)view { - return view; -} - -- (void)setView:(NSView *)newView { - view = newView; -} - - (void)prepareForAnimationWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle fromRect:(NSRect)rect { if (transitionStyle >= SKCopyMachineTransition) { NSRect bounds = [view bounds]; @@ -212,6 +217,9 @@ [view cacheDisplayInRect:bounds toBitmapImageRep:initialContentBitmap]; initialImage = [[CIImage alloc] initWithBitmapImageRep:initialContentBitmap]; imageRect = rect; + + // We don't want the window to draw the next state before the animation is run + [[view window] disableFlushWindow]; } } @@ -259,7 +267,7 @@ [view cacheDisplayInRect:bounds toBitmapImageRep:finalContentBitmap]; CIImage *finalImage = [[CIImage alloc] initWithBitmapImageRep:finalContentBitmap]; - CIFilter *transitionFilter = [[self class] transitionFilter:transitionStyle forRect:imageRect inBounds:[view bounds] initialCIImage:initialImage finalCIImage:finalImage]; + CIFilter *transitionFilter = [self transitionFilter:transitionStyle forRect:imageRect inBounds:[view bounds] initialCIImage:initialImage finalCIImage:finalImage]; [finalImage release]; [initialImage release]; @@ -281,6 +289,7 @@ } SKTransitionAnimation *animation = [[SKTransitionAnimation alloc] initWithFilter:transitionFilter duration:duration animationCurve:NSAnimationEaseInOut]; + [transitionView setAnimation:animation]; [animation release]; @@ -291,11 +300,15 @@ [animation startAnimation]; + // Update the view and its window, so it shows the correct state when it is shown. [view display]; + // Remember we disabled flushing in the previous method, we need to balance that. + [[view window] enableFlushWindow]; + [[view window] flushWindow]; - [transitionView setAnimation:nil]; [window removeChildWindow:transitionWindow]; [transitionWindow orderOut:nil]; + [transitionView setAnimation:nil]; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-17 17:20:54
|
Revision: 2516 http://skim-app.svn.sourceforge.net/skim-app/?rev=2516&view=rev Author: hofman Date: 2007-07-17 10:20:53 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Remove comment. Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-07-17 16:19:36 UTC (rev 2515) +++ trunk/SKPDFView.m 2007-07-17 17:20:53 UTC (rev 2516) @@ -582,7 +582,6 @@ transitionController = [[SKTransitionController alloc] initWithView:self]; NSRect rect = [self convertRect:[[self currentPage] boundsForBox:[self displayBox]] fromPage:[self currentPage]]; [transitionController prepareForAnimationWithTransitionStyle:[self transitionStyle] fromRect:rect]; - // @@ I think going to the next/previous page before animating a transition may relay on implementation details that have a very high probability of breaking in future. If goToNextPage: displays the next page before the transition, things will look a bit odd... if (next) [super goToNextPage:self]; else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ama...@us...> - 2007-07-17 16:19:37
|
Revision: 2515 http://skim-app.svn.sourceforge.net/skim-app/?rev=2515&view=rev Author: amaxwell Date: 2007-07-17 09:19:36 -0700 (Tue, 17 Jul 2007) Log Message: ----------- pass pointer without casting Modified Paths: -------------- trunk/SKTransitionController.m Modified: trunk/SKTransitionController.m =================================================================== --- trunk/SKTransitionController.m 2007-07-17 16:18:33 UTC (rev 2514) +++ trunk/SKTransitionController.m 2007-07-17 16:19:36 UTC (rev 2515) @@ -338,14 +338,14 @@ static NSOpenGLPixelFormat *pf; if (pf == nil) { - static const NSOpenGLPixelFormatAttribute attr[] = { + NSOpenGLPixelFormatAttribute attr[] = { NSOpenGLPFAAccelerated, NSOpenGLPFANoRecovery, NSOpenGLPFAColorSize, 32, 0 }; - pf = [[NSOpenGLPixelFormat alloc] initWithAttributes:(void *)&attr]; + pf = [[NSOpenGLPixelFormat alloc] initWithAttributes:attr]; } return pf; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ama...@us...> - 2007-07-17 16:18:42
|
Revision: 2514 http://skim-app.svn.sourceforge.net/skim-app/?rev=2514&view=rev Author: amaxwell Date: 2007-07-17 09:18:33 -0700 (Tue, 17 Jul 2007) Log Message: ----------- add comment Modified Paths: -------------- trunk/SKPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-07-17 15:35:38 UTC (rev 2513) +++ trunk/SKPDFView.m 2007-07-17 16:18:33 UTC (rev 2514) @@ -582,6 +582,7 @@ transitionController = [[SKTransitionController alloc] initWithView:self]; NSRect rect = [self convertRect:[[self currentPage] boundsForBox:[self displayBox]] fromPage:[self currentPage]]; [transitionController prepareForAnimationWithTransitionStyle:[self transitionStyle] fromRect:rect]; + // @@ I think going to the next/previous page before animating a transition may relay on implementation details that have a very high probability of breaking in future. If goToNextPage: displays the next page before the transition, things will look a bit odd... if (next) [super goToNextPage:self]; else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-17 15:35:41
|
Revision: 2513 http://skim-app.svn.sourceforge.net/skim-app/?rev=2513&view=rev Author: hofman Date: 2007-07-17 08:35:38 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Pass some actions from side windows to main controller (in particular related to fullscreen modes and side pane states). Modified Paths: -------------- trunk/SKSideWindow.m Modified: trunk/SKSideWindow.m =================================================================== --- trunk/SKSideWindow.m 2007-07-17 13:52:14 UTC (rev 2512) +++ trunk/SKSideWindow.m 2007-07-17 15:35:38 UTC (rev 2513) @@ -176,17 +176,50 @@ unichar ch = [characters length] > 0 ? [characters characterAtIndex:0] : 0; unsigned modifierFlags = [theEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask; - if (modifierFlags == 0) { - if (ch == 0x1B) { - [controller exitFullScreen:self]; - } else { - [super keyDown:theEvent]; - } + if (ch == 0x1B && modifierFlags == 0) { + [controller exitFullScreen:self]; + } else if (ch == 't' && modifierFlags == 0 && [controller isPresentation]) { + [controller toggleLeftSidePane:self]; } else { [super keyDown:theEvent]; } } +- (IBAction)toggleLeftSidePane:(id)sender { + [controller toggleLeftSidePane:sender]; +} + +- (IBAction)toggleRightSidePane:(id)sender { + [controller toggleRightSidePane:sender]; +} + +- (IBAction)changeLeftSidePaneState:(id)sender { + [controller changeLeftSidePaneState:sender]; +} + +- (IBAction)changeRightSidePaneState:(id)sender { + [controller changeRightSidePaneState:sender]; +} + +- (IBAction)toggleFullScreen:(id)sender { + [controller toggleFullScreen:sender]; +} + +- (IBAction)togglePresentation:(id)sender { + [controller togglePresentation:sender]; +} + +- (BOOL)validateMenuItem:(NSMenuItem *)menuItem { + SEL action = [menuItem action]; + if (action == @selector(toggleLeftSidePane) || action == @selector(toggleRightSidePane) || + action == @selector(changeLeftSidePaneState) || action == @selector(changeRightSidePaneState) || + action == @selector(toggleFullScreen) || action == @selector(togglePresentation)) { + return [controller validateMenuItem:menuItem]; + } else { + return [super validateMenuItem:menuItem]; + } +} + @end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-17 13:52:16
|
Revision: 2512 http://skim-app.svn.sourceforge.net/skim-app/?rev=2512&view=rev Author: hofman Date: 2007-07-17 06:52:14 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Cache filters for transition animation. Make shading/mask/filter methods class methods. Modified Paths: -------------- trunk/SKTransitionController.m Modified: trunk/SKTransitionController.m =================================================================== --- trunk/SKTransitionController.m 2007-07-17 13:11:25 UTC (rev 2511) +++ trunk/SKTransitionController.m 2007-07-17 13:52:14 UTC (rev 2512) @@ -74,28 +74,19 @@ @implementation SKTransitionController -- (id)initWithView:(NSView *)aView { - if (self = [super init]) { - view = aView; ++ (CIFilter *)filterWithName:(NSString *)name { + static NSMutableDictionary *filters = nil; + if (filters == nil) + filters = [[NSMutableDictionary alloc] init]; + CIFilter *filter = [filters objectForKey:name]; + if (filter == nil && (filter = [CIFilter filterWithName:name])) { + [filter setDefaults]; + [filters setObject:filter forKey:name]; } - return self; + return filter; } -- (void)dealloc { - [transitionWindow release]; - [initialImage release]; - [super dealloc]; -} - -- (NSView *)view { - return view; -} - -- (void)setView:(NSView *)newView { - view = newView; -} - -- (CIImage *)inputShadingImage { ++ (CIImage *)inputShadingImage { static CIImage *inputShadingImage = nil; if (inputShadingImage == nil) { NSData *shadingBitmapData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"TransitionShading" ofType:@"tiff"]]; @@ -105,7 +96,7 @@ return inputShadingImage; } -- (CIImage *)inputMaskImage { ++ (CIImage *)inputMaskImage { static CIImage *inputMaskImage = nil; if (inputMaskImage == nil) { NSData *maskBitmapData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"TransitionMask" ofType:@"jpg"]]; @@ -115,93 +106,103 @@ return inputMaskImage; } -- (CIFilter *)transitionFilter:(SKAnimationTransitionStyle)transitionStyle forRect:(NSRect)rect initialCIImage:(CIImage *)initialCIImage finalCIImage:(CIImage *)finalCIImage { ++ (CIFilter *)transitionFilter:(SKAnimationTransitionStyle)transitionStyle forRect:(NSRect)rect inBounds:(NSRect)bounds initialCIImage:(CIImage *)initialCIImage finalCIImage:(CIImage *)finalCIImage { CIFilter *transitionFilter = nil; - CIFilter *maskScalingFilter = nil; - CGRect maskExtent; - NSRect bounds = [view bounds]; - - if (NSEqualRects(rect, bounds) == NO) { - CIFilter *cropFilter = [CIFilter filterWithName:@"CICrop"]; - [cropFilter setValue:[CIVector vectorWithX:NSMinX(imageRect) Y:NSMinY(imageRect) Z:NSWidth(imageRect) W:NSHeight(imageRect)] forKey:@"inputRectangle"]; - [cropFilter setValue:initialCIImage forKey:@"inputImage"]; - initialCIImage = [cropFilter valueForKey:@"outputImage"]; - [cropFilter setValue:finalCIImage forKey:@"inputImage"]; - finalCIImage = [cropFilter valueForKey:@"outputImage"]; - } - switch (transitionStyle) { case SKCopyMachineTransition: - transitionFilter = [CIFilter filterWithName:@"CICopyMachineTransition"]; - [transitionFilter setDefaults]; + transitionFilter = [[self class] filterWithName:@"CICopyMachineTransition"]; [transitionFilter setValue:[CIVector vectorWithX:NSMinX(rect) Y:NSMinY(rect) Z:NSWidth(rect) W:NSHeight(rect)] forKey:@"inputExtent"]; break; - + case SKDisintegrateTransition: - transitionFilter = [CIFilter filterWithName:@"CIDisintegrateWithMaskTransition"]; - [transitionFilter setDefaults]; - + { + transitionFilter = [[self class] filterWithName:@"CIDisintegrateWithMaskTransition"]; + // Scale our mask image to match the transition area size, and set the scaled result as the "inputMaskImage" to the transitionFilter. - maskScalingFilter = [CIFilter filterWithName:@"CILanczosScaleTransform"]; - [maskScalingFilter setDefaults]; - maskExtent = [[self inputMaskImage] extent]; + CIFilter *maskScalingFilter = [[self class] filterWithName:@"CILanczosScaleTransform"]; + CGRect maskExtent = [[[self class] inputMaskImage] extent]; float xScale = NSWidth(rect) / CGRectGetWidth(maskExtent); float yScale = NSHeight(rect) / CGRectGetHeight(maskExtent); [maskScalingFilter setValue:[NSNumber numberWithFloat:yScale] forKey:@"inputScale"]; [maskScalingFilter setValue:[NSNumber numberWithFloat:xScale / yScale] forKey:@"inputAspectRatio"]; - [maskScalingFilter setValue:[self inputMaskImage] forKey:@"inputImage"]; - + [maskScalingFilter setValue:[[self class] inputMaskImage] forKey:@"inputImage"]; + [transitionFilter setValue:[maskScalingFilter valueForKey:@"outputImage"] forKey:@"inputMaskImage"]; break; - + } case SKDissolveTransition: - transitionFilter = [CIFilter filterWithName:@"CIDissolveTransition"]; - [transitionFilter setDefaults]; + transitionFilter = [[self class] filterWithName:@"CIDissolveTransition"]; break; - + case SKFlashTransition: - transitionFilter = [CIFilter filterWithName:@"CIFlashTransition"]; - [transitionFilter setDefaults]; + transitionFilter = [[self class] filterWithName:@"CIFlashTransition"]; [transitionFilter setValue:[CIVector vectorWithX:NSMidX(rect) Y:NSMidY(rect)] forKey:@"inputCenter"]; [transitionFilter setValue:[CIVector vectorWithX:NSMinX(bounds) Y:NSMinY(bounds) Z:NSWidth(bounds) W:NSHeight(bounds)] forKey:@"inputExtent"]; break; - + case SKModTransition: - transitionFilter = [CIFilter filterWithName:@"CIModTransition"]; - [transitionFilter setDefaults]; + transitionFilter = [[self class] filterWithName:@"CIModTransition"]; [transitionFilter setValue:[CIVector vectorWithX:NSMidX(rect) Y:NSMidY(rect)] forKey:@"inputCenter"]; break; - + case SKPageCurlTransition: - transitionFilter = [CIFilter filterWithName:@"CIPageCurlTransition"]; - [transitionFilter setDefaults]; + transitionFilter = [[self class] filterWithName:@"CIPageCurlTransition"]; [transitionFilter setValue:[NSNumber numberWithFloat:-M_PI_4] forKey:@"inputAngle"]; [transitionFilter setValue:initialCIImage forKey:@"inputBacksideImage"]; - [transitionFilter setValue:[self inputShadingImage] forKey:@"inputShadingImage"]; + [transitionFilter setValue:[[self class] inputShadingImage] forKey:@"inputShadingImage"]; [transitionFilter setValue:[CIVector vectorWithX:NSMinX(rect) Y:NSMinY(rect) Z:NSWidth(rect) W:NSHeight(rect)] forKey:@"inputExtent"]; break; - + case SKSwipeTransition: - transitionFilter = [CIFilter filterWithName:@"CISwipeTransition"]; - [transitionFilter setDefaults]; + transitionFilter = [[self class] filterWithName:@"CISwipeTransition"]; break; - + case SKRippleTransition: default: - transitionFilter = [CIFilter filterWithName:@"CIRippleTransition"]; - [transitionFilter setDefaults]; + transitionFilter = [[self class] filterWithName:@"CIRippleTransition"]; [transitionFilter setValue:[CIVector vectorWithX:NSMidX(rect) Y:NSMidY(rect)] forKey:@"inputCenter"]; [transitionFilter setValue:[CIVector vectorWithX:NSMinX(bounds) Y:NSMinY(bounds) Z:NSWidth(bounds) W:NSHeight(bounds)] forKey:@"inputExtent"]; - [transitionFilter setValue:[self inputShadingImage] forKey:@"inputShadingImage"]; + [transitionFilter setValue:[[self class] inputShadingImage] forKey:@"inputShadingImage"]; break; } + + if (NSEqualRects(rect, bounds) == NO) { + CIFilter *cropFilter = [[self class] filterWithName:@"CICrop"]; + [cropFilter setValue:[CIVector vectorWithX:NSMinX(rect) Y:NSMinY(rect) Z:NSWidth(rect) W:NSHeight(rect)] forKey:@"inputRectangle"]; + [cropFilter setValue:initialCIImage forKey:@"inputImage"]; + initialCIImage = [cropFilter valueForKey:@"outputImage"]; + [cropFilter setValue:finalCIImage forKey:@"inputImage"]; + finalCIImage = [cropFilter valueForKey:@"outputImage"]; + } + [transitionFilter setValue:initialCIImage forKey:@"inputImage"]; [transitionFilter setValue:finalCIImage forKey:@"inputTargetImage"]; return transitionFilter; } +- (id)initWithView:(NSView *)aView { + if (self = [super init]) { + view = aView; + } + return self; +} + +- (void)dealloc { + [transitionWindow release]; + [initialImage release]; + [super dealloc]; +} + +- (NSView *)view { + return view; +} + +- (void)setView:(NSView *)newView { + view = newView; +} + - (void)prepareForAnimationWithTransitionStyle:(SKAnimationTransitionStyle)transitionStyle fromRect:(NSRect)rect { if (transitionStyle >= SKCopyMachineTransition) { NSRect bounds = [view bounds]; @@ -258,7 +259,7 @@ [view cacheDisplayInRect:bounds toBitmapImageRep:finalContentBitmap]; CIImage *finalImage = [[CIImage alloc] initWithBitmapImageRep:finalContentBitmap]; - CIFilter *transitionFilter = [self transitionFilter:transitionStyle forRect:imageRect initialCIImage:initialImage finalCIImage:finalImage]; + CIFilter *transitionFilter = [[self class] transitionFilter:transitionStyle forRect:imageRect inBounds:[view bounds] initialCIImage:initialImage finalCIImage:finalImage]; [finalImage release]; [initialImage release]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-17 13:11:30
|
Revision: 2511 http://skim-app.svn.sourceforge.net/skim-app/?rev=2511&view=rev Author: hofman Date: 2007-07-17 06:11:25 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Add another CoreGraphics transition type. Modified Paths: -------------- trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib trunk/English.lproj/MainWindow.nib/info.nib trunk/English.lproj/MainWindow.nib/keyedobjects.nib trunk/Italian.lproj/MainWindow.nib/info.nib trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib trunk/SKTransitionController.h Modified: trunk/Dutch.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/English.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/English.lproj/MainWindow.nib/info.nib 2007-07-17 13:04:04 UTC (rev 2510) +++ trunk/English.lproj/MainWindow.nib/info.nib 2007-07-17 13:11:25 UTC (rev 2511) @@ -27,18 +27,18 @@ </array> <key>IBOpenObjects</key> <array> + <integer>168</integer> + <integer>256</integer> + <integer>5</integer> + <integer>208</integer> + <integer>502</integer> <integer>633</integer> - <integer>502</integer> <integer>539</integer> - <integer>168</integer> + <integer>511</integer> + <integer>224</integer> <integer>553</integer> + <integer>314</integer> <integer>585</integer> - <integer>5</integer> - <integer>256</integer> - <integer>224</integer> - <integer>314</integer> - <integer>511</integer> - <integer>208</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/English.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/Italian.lproj/MainWindow.nib/info.nib =================================================================== --- trunk/Italian.lproj/MainWindow.nib/info.nib 2007-07-17 13:04:04 UTC (rev 2510) +++ trunk/Italian.lproj/MainWindow.nib/info.nib 2007-07-17 13:11:25 UTC (rev 2511) @@ -27,13 +27,13 @@ </array> <key>IBOpenObjects</key> <array> - <integer>168</integer> + <integer>628</integer> + <integer>5</integer> <integer>511</integer> - <integer>5</integer> + <integer>553</integer> + <integer>539</integer> <integer>208</integer> - <integer>539</integer> - <integer>553</integer> - <integer>628</integer> + <integer>168</integer> </array> <key>IBSystem Version</key> <string>8R218</string> Modified: trunk/Italian.lproj/MainWindow.nib/keyedobjects.nib =================================================================== (Binary files differ) Modified: trunk/SKTransitionController.h =================================================================== --- trunk/SKTransitionController.h 2007-07-17 13:04:04 UTC (rev 2510) +++ trunk/SKTransitionController.h 2007-07-17 13:11:25 UTC (rev 2511) @@ -37,6 +37,7 @@ */ #import <Cocoa/Cocoa.h> +#import <Carbon/Carbon.h> #pragma mark Private Core Graphics types and functions @@ -52,7 +53,8 @@ CGSWarpFade, CGSSwap, CGSCube, - CGSWarpSwitch + CGSWarpSwitch, + CGSFlip } CGSTransitionType; typedef enum _CGSTransitionOption { @@ -103,6 +105,7 @@ SKSwapTransition = CGSSwap, SKCubeTransition = CGSCube, SKWarpSwitchTransition = CGSWarpSwitch, + SKWarpFlipTransition = CGSFlip, // Core Image transitions SKCopyMachineTransition, SKDisintegrateTransition, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-17 13:04:10
|
Revision: 2510 http://skim-app.svn.sourceforge.net/skim-app/?rev=2510&view=rev Author: hofman Date: 2007-07-17 06:04:04 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Declare a selector to shut up compiler. Modified Paths: -------------- trunk/SKNavigationWindow.h Modified: trunk/SKNavigationWindow.h =================================================================== --- trunk/SKNavigationWindow.h 2007-07-17 12:22:00 UTC (rev 2509) +++ trunk/SKNavigationWindow.h 2007-07-17 13:04:04 UTC (rev 2510) @@ -101,6 +101,7 @@ @interface SKNavigationZoomButton : SKNavigationButton +- (void)handleScaleChangedNotification:(NSNotification *)notification; @end @interface SKNavigationZoomButtonCell : SKNavigationButtonCell This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-17 12:22:06
|
Revision: 2509 http://skim-app.svn.sourceforge.net/skim-app/?rev=2509&view=rev Author: hofman Date: 2007-07-17 05:22:00 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Hide content side window after selecting a page, depending on a hidden pref. Reorganize full screen code a bit. Modified Paths: -------------- trunk/InitialUserDefaults.plist trunk/SKMainWindowController.h trunk/SKMainWindowController.m trunk/SKPDFView.m trunk/SKSideWindow.h trunk/SKSideWindow.m trunk/SKStringConstants.h trunk/SKStringConstants.m Modified: trunk/InitialUserDefaults.plist =================================================================== --- trunk/InitialUserDefaults.plist 2007-07-17 09:56:12 UTC (rev 2508) +++ trunk/InitialUserDefaults.plist 2007-07-17 12:22:00 UTC (rev 2509) @@ -202,6 +202,8 @@ <false/> <key>SKActivatePresentationNavigationAtBottom</key> <true/> + <key>SKAutoHidePresentationContents</key> + <true/> <key>SKEnableAppleRemote</key> <true/> <key>SKAppleRemoteSwitchIndicationTimeout</key> Modified: trunk/SKMainWindowController.h =================================================================== --- trunk/SKMainWindowController.h 2007-07-17 09:56:12 UTC (rev 2508) +++ trunk/SKMainWindowController.h 2007-07-17 12:22:00 UTC (rev 2509) @@ -83,6 +83,7 @@ IBOutlet NSView *currentRightSideView; SKLeftSidePaneState leftSidePaneState; SKRightSidePaneState rightSidePaneState; + SKLeftSidePaneState savedLeftSidePaneState; SKStatusBar *statusBar; @@ -335,29 +336,6 @@ - (void)registerAsObserver; - (void)unregisterAsObserver; -- (void)handleApplicationWillTerminateNotification:(NSNotification *)notification; -- (void)handleApplicationDidResignActiveNotification:(NSNotification *)notification; -- (void)handleApplicationWillBecomeActiveNotification:(NSNotification *)notification; -- (void)handlePageChangedNotification:(NSNotification *)notification; -- (void)handleScaleChangedNotification:(NSNotification *)notification; -- (void)handleToolModeChangedNotification:(NSNotification *)notification; -- (void)handleAnnotationModeChangedNotification:(NSNotification *)notification; -- (void)handleSelectionChangedNotification:(NSNotification *)notification; -- (void)handleMagnificationChangedNotification:(NSNotification *)notification; -- (void)handleChangedHistoryNotification:(NSNotification *)notification; -- (void)handleDidChangeActiveAnnotationNotification:(NSNotification *)notification; -- (void)handleDidAddAnnotationNotification:(NSNotification *)notification; -- (void)handleDidRemoveAnnotationNotification:(NSNotification *)notification; -- (void)handleDidMoveAnnotationNotification:(NSNotification *)notification; -- (void)handleDoubleClickedAnnotationNotification:(NSNotification *)notification; -- (void)handleReadingBarDidChangeNotification:(NSNotification *)notification; -- (void)handleAnnotationDidChangeNotification:(NSNotification *)notification; -- (void)handlePageBoundsDidChangeNotification:(NSNotification *)notification; -- (void)handleDocumentBeginWrite:(NSNotification *)notification; -- (void)handleDocumentEndWrite:(NSNotification *)notification; -- (void)handleDocumentEndPageWrite:(NSNotification *)notification; -- (void)handleColorSwatchColorsChangedNotification:(NSNotification *)notification; - - (void)addAnnotationsFromDictionaries:(NSArray *)noteDicts; - (void)setAnnotationsFromDictionaries:(NSArray *)noteDicts; @@ -366,6 +344,4 @@ - (void)applyPDFSettings:(NSDictionary *)setup; - (NSDictionary *)currentPDFSettings; -- (void)setupToolbar; - @end Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2007-07-17 09:56:12 UTC (rev 2508) +++ trunk/SKMainWindowController.m 2007-07-17 12:22:00 UTC (rev 2509) @@ -123,6 +123,50 @@ - (BOOL)isDescendantOf:(NSView *)aView { return NO; } @end +@interface SKMainWindowController (Private) + +- (void)setupToolbar; + +- (void)showLeftSideWindow; +- (void)showRightSideWindow; +- (void)hideLeftSideWindow; +- (void)hideRightSideWindow; +- (void)showSideWindows; +- (void)hideSideWindows; +- (void)goFullScreen; +- (void)removeFullScreen; +- (void)saveNormalSetup; +- (void)enterPresentationMode; +- (void)exitPresentationMode; +- (void)activityTimerFired:(NSTimer *)timer; + +- (void)replaceSideView:(NSView *)oldView withView:(NSView *)newView animate:(BOOL)animate; + +- (void)handleApplicationWillTerminateNotification:(NSNotification *)notification; +- (void)handleApplicationDidResignActiveNotification:(NSNotification *)notification; +- (void)handleApplicationWillBecomeActiveNotification:(NSNotification *)notification; +- (void)handlePageChangedNotification:(NSNotification *)notification; +- (void)handleScaleChangedNotification:(NSNotification *)notification; +- (void)handleToolModeChangedNotification:(NSNotification *)notification; +- (void)handleAnnotationModeChangedNotification:(NSNotification *)notification; +- (void)handleSelectionChangedNotification:(NSNotification *)notification; +- (void)handleMagnificationChangedNotification:(NSNotification *)notification; +- (void)handleChangedHistoryNotification:(NSNotification *)notification; +- (void)handleDidChangeActiveAnnotationNotification:(NSNotification *)notification; +- (void)handleDidAddAnnotationNotification:(NSNotification *)notification; +- (void)handleDidRemoveAnnotationNotification:(NSNotification *)notification; +- (void)handleDidMoveAnnotationNotification:(NSNotification *)notification; +- (void)handleDoubleClickedAnnotationNotification:(NSNotification *)notification; +- (void)handleReadingBarDidChangeNotification:(NSNotification *)notification; +- (void)handleAnnotationDidChangeNotification:(NSNotification *)notification; +- (void)handlePageBoundsDidChangeNotification:(NSNotification *)notification; +- (void)handleDocumentBeginWrite:(NSNotification *)notification; +- (void)handleDocumentEndWrite:(NSNotification *)notification; +- (void)handleDocumentEndPageWrite:(NSNotification *)notification; +- (void)handleColorSwatchColorsChangedNotification:(NSNotification *)notification; + +@end + @implementation SKMainWindowController + (void)initialize { @@ -1531,12 +1575,154 @@ [pdfView setAnnotationMode:[sender tag]]; } +- (IBAction)statusBarClicked:(id)sender { + [self updateRightStatus]; +} + +- (IBAction)toggleStatusBar:(id)sender { + if (statusBar == nil) { + statusBar = [[SKStatusBar alloc] initWithFrame:NSMakeRect(0.0, 0.0, NSWidth([splitView frame]), 20.0)]; + [statusBar setAutoresizingMask:NSViewWidthSizable | NSViewMaxYMargin]; + [self updateLeftStatus]; + [self updateRightStatus]; + [statusBar setAction:@selector(statusBarClicked:)]; + [statusBar setTarget:self]; + } + [statusBar toggleBelowView:splitView offset:1.0]; + [[NSUserDefaults standardUserDefaults] setBool:[statusBar isVisible] forKey:SKShowStatusBarKey]; +} + +- (IBAction)searchPDF:(id)sender { + if ([self isFullScreen]) { + if ([leftSideWindow state] == NSDrawerClosedState || [leftSideWindow state] == NSDrawerClosingState) + [leftSideWindow showSideWindow]; + } else if (NSWidth([leftSideContentBox frame]) <= 0.0) { + [self toggleLeftSidePane:sender]; + } + [searchField selectText:self]; +} + +- (IBAction)performFit:(id)sender { + if ([self isFullScreen] || [self isPresentation]) { + NSBeep(); + return; + } + + PDFDisplayMode displayMode = [pdfView displayMode]; + NSRect screenFrame = [[[self window] screen] visibleFrame]; + NSRect frame = [splitView frame]; + NSRect documentRect = [[[self pdfView] documentView] convertRect:[[[self pdfView] documentView] bounds] toView:nil]; + float bottomOffset = -1.0; + + if ([[self pdfView] autoScales]) { + documentRect.size.width /= [[self pdfView] scaleFactor]; + documentRect.size.height /= [[self pdfView] scaleFactor]; + } + + frame.size.width = NSWidth([leftSideContentBox frame]) + NSWidth([rightSideContentBox frame]) + NSWidth(documentRect) + 2 * [splitView dividerThickness] + 2.0; + if (displayMode == kPDFDisplaySinglePage || displayMode == kPDFDisplayTwoUp) { + frame.size.height = NSHeight(documentRect) + 1.0; + } else { + NSRect pageBounds = [[self pdfView] convertRect:[[[self pdfView] currentPage] boundsForBox:[[self pdfView] displayBox]] fromPage:[[self pdfView] currentPage]]; + if ([[self pdfView] autoScales]) { + pageBounds.size.width /= [[self pdfView] scaleFactor]; + pageBounds.size.height /= [[self pdfView] scaleFactor]; + } + frame.size.height = NSHeight(pageBounds) + NSWidth(documentRect) - NSWidth(pageBounds) + 1.0; + frame.size.width += [NSScroller scrollerWidth]; + } + + if ([statusBar isVisible]) + bottomOffset = NSHeight([statusBar frame]); + frame.origin.y -= bottomOffset; + frame.size.height += bottomOffset; + + frame.origin = [[self window] convertBaseToScreen:[[[self window] contentView] convertPoint:frame.origin toView:nil]]; + frame = [[self window] frameRectForContentRect:frame]; + if (frame.size.width > NSWidth(screenFrame)) + frame.size.width = NSWidth(screenFrame); + if (frame.size.height > NSHeight(screenFrame)) + frame.size.height = NSHeight(screenFrame); + if (NSMaxX(frame) > NSMaxX(screenFrame)) + frame.origin.x = NSMaxX(screenFrame) - NSWidth(frame); + if (NSMaxY(frame) > NSMaxY(screenFrame)) + frame.origin.y = NSMaxY(screenFrame) - NSHeight(frame); + + [[self window] setFrame:frame display:[[self window] isVisible]]; +} + +- (void)passwordSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { + if (returnCode == NSOKButton) { + [pdfView takePasswordFrom:passwordField]; + if (pdfOutline && [[pdfView document] isLocked] == NO) { + [outlineView reloadData]; + [outlineView setAutoresizesOutlineColumn: NO]; + + if ([outlineView numberOfRows] == 1) + [outlineView expandItem: [outlineView itemAtRow: 0] expandChildren: NO]; + [self updateOutlineSelection]; + } + } +} + +- (IBAction)password:(id)sender { + [NSApp beginSheet:passwordSheet + modalForWindow:[self window] + modalDelegate:self + didEndSelector:@selector(passwordSheetDidEnd:returnCode:contextInfo:) + contextInfo:NULL]; +} + +- (IBAction)dismissPasswordSheet:(id)sender { + [NSApp endSheet:passwordSheet returnCode:[sender tag]]; + [passwordSheet orderOut:self]; +} + +- (IBAction)toggleReadingBar:(id)sender { + [pdfView toggleReadingBar]; +} + +- (IBAction)savePDFSettingToDefaults:(id)sender { + if ([self isFullScreen]) + [[NSUserDefaults standardUserDefaults] setObject:[self currentPDFSettings] forKey:SKDefaultFullScreenPDFDisplaySettingsKey]; + else if ([self isPresentation] == NO) + [[NSUserDefaults standardUserDefaults] setObject:[self currentPDFSettings] forKey:SKDefaultPDFDisplaySettingsKey]; +} + +- (void)transitionSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { + if (returnCode == NSOKButton) { + [pdfView setTransitionStyle:[[transitionStylePopUpButton selectedItem] tag]]; + [pdfView setTransitionDuration:fmax([transitionDurationField floatValue], 0.0)]; + } +} + +- (IBAction)chooseTransition:(id)sender { + [transitionStylePopUpButton selectItemWithTag:[pdfView transitionStyle]]; + [transitionDurationField setFloatValue:[pdfView transitionDuration]]; + [transitionDurationSlider setFloatValue:[pdfView transitionDuration]]; + [NSApp beginSheet:transitionSheet + modalForWindow:[self window] + modalDelegate:self + didEndSelector:@selector(transitionSheetDidEnd:returnCode:contextInfo:) + contextInfo:NULL]; +} + +- (IBAction)dismissTransitionSheet:(id)sender { + [NSApp endSheet:transitionSheet returnCode:[sender tag]]; + [transitionSheet orderOut:self]; +} + - (IBAction)toggleLeftSidePane:(id)sender { if ([self isFullScreen]) { if ([leftSideWindow state] == NSDrawerOpenState || [leftSideWindow state] == NSDrawerOpeningState) [leftSideWindow hideSideWindow]; else [leftSideWindow showSideWindow]; + } else if ([self isPresentation]) { + if ([leftSideWindow isVisible]) + [self hideLeftSideWindow]; + else + [self showLeftSideWindow]; } else { NSRect sideFrame = [leftSideContentBox frame]; NSRect pdfFrame = [pdfContentBox frame]; @@ -1603,33 +1789,142 @@ [self setRightSidePaneState:[sender tag]]; } -- (IBAction)statusBarClicked:(id)sender { - [self updateRightStatus]; +- (IBAction)toggleFullScreen:(id)sender { + if ([self isFullScreen]) + [self exitFullScreen:sender]; + else + [self enterFullScreen:sender]; } -- (IBAction)toggleStatusBar:(id)sender { - if (statusBar == nil) { - statusBar = [[SKStatusBar alloc] initWithFrame:NSMakeRect(0.0, 0.0, NSWidth([splitView frame]), 20.0)]; - [statusBar setAutoresizingMask:NSViewWidthSizable | NSViewMaxYMargin]; - [self updateLeftStatus]; - [self updateRightStatus]; - [statusBar setAction:@selector(statusBarClicked:)]; - [statusBar setTarget:self]; +- (IBAction)togglePresentation:(id)sender { + if ([self isPresentation]) + [self exitFullScreen:sender]; + else + [self enterPresentation:sender]; +} + +#pragma mark Full Screen support + +- (void)showLeftSideWindow { + NSScreen *screen = [[self window] screen]; + if (screen == nil) + screen = [NSScreen mainScreen]; + if (leftSideWindow == nil) { + leftSideWindow = [[SKSideWindow alloc] initWithMainController:self edge:NSMinXEdge]; + } else if (screen != [leftSideWindow screen]) { + [leftSideWindow moveToScreen:screen]; } - [statusBar toggleBelowView:splitView offset:1.0]; - [[NSUserDefaults standardUserDefaults] setBool:[statusBar isVisible] forKey:SKShowStatusBarKey]; + + if ([[mainWindow firstResponder] isDescendantOf:leftSideBox]) + [mainWindow makeFirstResponder:nil]; + [leftSideWindow setMainView:leftSideBox]; + [leftSideWindow setInitialFirstResponder:searchField]; + + [leftSideEdgeView setEdges:BDSKNoEdgeMask]; + [findEdgeView setEdges:BDSKNoEdgeMask]; + + if ([self isPresentation]) { + savedLeftSidePaneState = [self leftSidePaneState]; + [self setLeftSidePaneState:SKThumbnailSidePaneState]; + [leftSideWindow showSideWindow]; + [leftSideWindow setLevel:[[self window] level] + 1]; + [leftSideWindow setAlphaValue:0.95]; + [leftSideWindow setEnabled:NO]; + [leftSideWindow makeFirstResponder:thumbnailTableView]; + } else { + [leftSideWindow hideSideWindow]; + } + + [leftSideWindow orderFront:self]; } -- (IBAction)searchPDF:(id)sender { - if ([self isFullScreen]) { - if ([leftSideWindow state] == NSDrawerClosedState || [leftSideWindow state] == NSDrawerClosingState) - [leftSideWindow showSideWindow]; - } else if (NSWidth([leftSideContentBox frame]) <= 0.0) { - [self toggleLeftSidePane:sender]; +- (void)showRightSideWindow { + NSScreen *screen = [[self window] screen]; // @@ or should we use the main screen? + if (screen == nil) + screen = [NSScreen mainScreen]; + if (rightSideWindow == nil) { + rightSideWindow = [[SKSideWindow alloc] initWithMainController:self edge:NSMaxXEdge]; + } else if (screen != [rightSideWindow screen]) { + [rightSideWindow moveToScreen:screen]; } - [searchField selectText:self]; + + if ([[mainWindow firstResponder] isDescendantOf:rightSideBox]) + [mainWindow makeFirstResponder:nil]; + [rightSideWindow setMainView:rightSideBox]; + + [rightSideEdgeView setEdges:BDSKNoEdgeMask]; + + if ([self isPresentation]) { + [rightSideWindow showSideWindow]; + [leftSideWindow setLevel:[[self window] level] + 1]; + [leftSideWindow setAlphaValue:0.95]; + [leftSideWindow setEnabled:NO]; + } else { + [rightSideWindow hideSideWindow]; + } + + [rightSideWindow orderFront:self]; } +- (void)hideLeftSideWindow { + if ([[leftSideBox window] isEqual:leftSideWindow]) { + [leftSideWindow orderOut:self]; + + if ([[leftSideWindow firstResponder] isDescendantOf:leftSideBox]) + [leftSideWindow makeFirstResponder:nil]; + [leftSideBox retain]; // leftSideBox is removed from its old superview in the process + [leftSideBox setFrame:[leftSideContentBox bounds]]; + [leftSideContentBox addSubview:leftSideBox]; + [leftSideBox release]; + + [leftSideEdgeView setEdges:BDSKMaxXEdgeMask]; + [findEdgeView setEdges:BDSKMaxXEdgeMask]; + + if ([self isPresentation]) { + [self setLeftSidePaneState:savedLeftSidePaneState]; + [leftSideWindow setLevel:NSFloatingWindowLevel]; + [leftSideWindow setAlphaValue:1.0]; + [leftSideWindow setEnabled:YES]; + } + } +} + +- (void)hideRightSideWindow { + if ([[rightSideBox window] isEqual:rightSideWindow]) { + [rightSideWindow orderOut:self]; + + if ([[rightSideWindow firstResponder] isDescendantOf:rightSideBox]) + [rightSideWindow makeFirstResponder:nil]; + [rightSideBox retain]; // rightSideBox is removed from its old superview in the process + [rightSideBox setFrame:[rightSideContentBox bounds]]; + [rightSideContentBox addSubview:rightSideBox]; + [rightSideBox release]; + + [rightSideEdgeView setEdges:BDSKMinXEdgeMask]; + + if ([self isPresentation]) { + [rightSideWindow setLevel:NSFloatingWindowLevel]; + [rightSideWindow setAlphaValue:1.0]; + [rightSideWindow setEnabled:YES]; + } + } +} + +- (void)showSideWindows { + [self showLeftSideWindow]; + [self showRightSideWindow]; + + [pdfView setFrame:NSInsetRect([[pdfView superview] bounds], 9.0, 0.0)]; + [[pdfView superview] setNeedsDisplay:YES]; +} + +- (void)hideSideWindows { + [self hideLeftSideWindow]; + [self hideRightSideWindow]; + + [pdfView setFrame:[[pdfView superview] bounds]]; +} + - (void)goFullScreen { NSScreen *screen = [[self window] screen]; // @@ screen: or should we use the main screen? NSColor *backgroundColor = [self isPresentation] ? [NSColor blackColor] : [NSUnarchiver unarchiveObjectWithData:[[NSUserDefaults standardUserDefaults] dataForKey:SKFullScreenBackgroundColorKey]]; @@ -1742,73 +2037,6 @@ } } -- (void)showSideWindows { - NSScreen *screen = [[self window] screen]; // @@ or should we use the main screen? - if (screen == nil) - screen = [NSScreen mainScreen]; - if (leftSideWindow == nil) { - leftSideWindow = [[SKSideWindow alloc] initWithMainController:self edge:NSMinXEdge]; - } else if (screen != [leftSideWindow screen]) { - [leftSideWindow moveToScreen:screen]; - } - if (rightSideWindow == nil) { - rightSideWindow = [[SKSideWindow alloc] initWithMainController:self edge:NSMaxXEdge]; - } else if (screen != [rightSideWindow screen]) { - [rightSideWindow moveToScreen:screen]; - } - - if ([[mainWindow firstResponder] isDescendantOf:leftSideBox]) - [mainWindow makeFirstResponder:nil]; - [leftSideWindow setMainView:leftSideBox]; - [leftSideWindow setInitialFirstResponder:searchField]; - - if ([[mainWindow firstResponder] isDescendantOf:rightSideBox]) - [mainWindow makeFirstResponder:nil]; - [rightSideWindow setMainView:rightSideBox]; - - [leftSideEdgeView setEdges:BDSKNoEdgeMask]; - [rightSideEdgeView setEdges:BDSKNoEdgeMask]; - [findEdgeView setEdges:BDSKNoEdgeMask]; - - [leftSideWindow hideSideWindow]; - [rightSideWindow hideSideWindow]; - - [leftSideWindow orderFront:self]; - [rightSideWindow orderFront:self]; - - [pdfView setFrame:NSInsetRect([[pdfView superview] bounds], 9.0, 0.0)]; - [[pdfView superview] setNeedsDisplay:YES]; -} - -- (void)hideSideWindows { - [leftSideWindow orderOut:self]; - [rightSideWindow orderOut:self]; - - if ([[leftSideWindow firstResponder] isDescendantOf:leftSideBox]) - [leftSideWindow makeFirstResponder:nil]; - [leftSideBox retain]; // leftSideBox is removed from its old superview in the process - [leftSideBox setFrame:[leftSideContentBox bounds]]; - [leftSideContentBox addSubview:leftSideBox]; - [leftSideBox release]; - - if ([[rightSideWindow firstResponder] isDescendantOf:rightSideBox]) - [rightSideWindow makeFirstResponder:nil]; - [rightSideBox retain]; // rightSideBox is removed from its old superview in the process - [rightSideBox setFrame:[rightSideContentBox bounds]]; - [rightSideContentBox addSubview:rightSideBox]; - [rightSideBox release]; - - [leftSideEdgeView setEdges:BDSKMaxXEdgeMask]; - [rightSideEdgeView setEdges:BDSKMinXEdgeMask]; - [findEdgeView setEdges:BDSKMaxXEdgeMask]; - - [pdfView setFrame:[[pdfView superview] bounds]]; -} - -- (void)activityTimerFired:(NSTimer *)timer { - UpdateSystemActivity(UsrActivity); -} - - (void)saveNormalSetup { if ([self isPresentation] == NO && [self isFullScreen] == NO) { NSScrollView *scrollView = [[pdfView documentView] enclosingScrollView]; @@ -1823,6 +2051,10 @@ [self applyPDFSettings:fullScreenSetup]; } +- (void)activityTimerFired:(NSTimer *)timer { + UpdateSystemActivity(UsrActivity); +} + - (void)enterPresentationMode { NSScrollView *scrollView = [[pdfView documentView] enclosingScrollView]; [self saveNormalSetup]; @@ -1867,6 +2099,8 @@ [fullScreenWindow setBackgroundColor:backgroundColor]; [fullScreenWindow setLevel:NSNormalWindowLevel]; + [self hideLeftSideWindow]; + isPresentation = NO; } @@ -1940,130 +2174,6 @@ [self removeFullScreen]; } -- (IBAction)toggleFullScreen:(id)sender { - if ([self isFullScreen]) - [self exitFullScreen:sender]; - else - [self enterFullScreen:sender]; -} - -- (IBAction)togglePresentation:(id)sender { - if ([self isPresentation]) - [self exitFullScreen:sender]; - else - [self enterPresentation:sender]; -} - -- (IBAction)performFit:(id)sender { - if ([self isFullScreen] || [self isPresentation]) { - NSBeep(); - return; - } - - PDFDisplayMode displayMode = [pdfView displayMode]; - NSRect screenFrame = [[[self window] screen] visibleFrame]; - NSRect frame = [splitView frame]; - NSRect documentRect = [[[self pdfView] documentView] convertRect:[[[self pdfView] documentView] bounds] toView:nil]; - float bottomOffset = -1.0; - - if ([[self pdfView] autoScales]) { - documentRect.size.width /= [[self pdfView] scaleFactor]; - documentRect.size.height /= [[self pdfView] scaleFactor]; - } - - frame.size.width = NSWidth([leftSideContentBox frame]) + NSWidth([rightSideContentBox frame]) + NSWidth(documentRect) + 2 * [splitView dividerThickness] + 2.0; - if (displayMode == kPDFDisplaySinglePage || displayMode == kPDFDisplayTwoUp) { - frame.size.height = NSHeight(documentRect) + 1.0; - } else { - NSRect pageBounds = [[self pdfView] convertRect:[[[self pdfView] currentPage] boundsForBox:[[self pdfView] displayBox]] fromPage:[[self pdfView] currentPage]]; - if ([[self pdfView] autoScales]) { - pageBounds.size.width /= [[self pdfView] scaleFactor]; - pageBounds.size.height /= [[self pdfView] scaleFactor]; - } - frame.size.height = NSHeight(pageBounds) + NSWidth(documentRect) - NSWidth(pageBounds) + 1.0; - frame.size.width += [NSScroller scrollerWidth]; - } - - if ([statusBar isVisible]) - bottomOffset = NSHeight([statusBar frame]); - frame.origin.y -= bottomOffset; - frame.size.height += bottomOffset; - - frame.origin = [[self window] convertBaseToScreen:[[[self window] contentView] convertPoint:frame.origin toView:nil]]; - frame = [[self window] frameRectForContentRect:frame]; - if (frame.size.width > NSWidth(screenFrame)) - frame.size.width = NSWidth(screenFrame); - if (frame.size.height > NSHeight(screenFrame)) - frame.size.height = NSHeight(screenFrame); - if (NSMaxX(frame) > NSMaxX(screenFrame)) - frame.origin.x = NSMaxX(screenFrame) - NSWidth(frame); - if (NSMaxY(frame) > NSMaxY(screenFrame)) - frame.origin.y = NSMaxY(screenFrame) - NSHeight(frame); - - [[self window] setFrame:frame display:[[self window] isVisible]]; -} - -- (void)passwordSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { - if (returnCode == NSOKButton) { - [pdfView takePasswordFrom:passwordField]; - if (pdfOutline && [[pdfView document] isLocked] == NO) { - [outlineView reloadData]; - [outlineView setAutoresizesOutlineColumn: NO]; - - if ([outlineView numberOfRows] == 1) - [outlineView expandItem: [outlineView itemAtRow: 0] expandChildren: NO]; - [self updateOutlineSelection]; - } - } -} - -- (IBAction)password:(id)sender { - [NSApp beginSheet:passwordSheet - modalForWindow:[self window] - modalDelegate:self - didEndSelector:@selector(passwordSheetDidEnd:returnCode:contextInfo:) - contextInfo:NULL]; -} - -- (IBAction)dismissPasswordSheet:(id)sender { - [NSApp endSheet:passwordSheet returnCode:[sender tag]]; - [passwordSheet orderOut:self]; -} - -- (IBAction)toggleReadingBar:(id)sender { - [pdfView toggleReadingBar]; -} - -- (IBAction)savePDFSettingToDefaults:(id)sender { - if ([self isFullScreen]) - [[NSUserDefaults standardUserDefaults] setObject:[self currentPDFSettings] forKey:SKDefaultFullScreenPDFDisplaySettingsKey]; - else if ([self isPresentation] == NO) - [[NSUserDefaults standardUserDefaults] setObject:[self currentPDFSettings] forKey:SKDefaultPDFDisplaySettingsKey]; -} - -- (void)transitionSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { - if (returnCode == NSOKButton) { - [pdfView setTransitionStyle:[[transitionStylePopUpButton selectedItem] tag]]; - [pdfView setTransitionDuration:fmax([transitionDurationField floatValue], 0.0)]; - } -} - -- (IBAction)chooseTransition:(id)sender { - [transitionStylePopUpButton selectItemWithTag:[pdfView transitionStyle]]; - [transitionDurationField setFloatValue:[pdfView transitionDuration]]; - [transitionDurationSlider setFloatValue:[pdfView transitionDuration]]; - [NSApp beginSheet:transitionSheet - modalForWindow:[self window] - modalDelegate:self - didEndSelector:@selector(transitionSheetDidEnd:returnCode:contextInfo:) - contextInfo:NULL]; -} - -- (IBAction)dismissTransitionSheet:(id)sender { - [NSApp endSheet:transitionSheet returnCode:[sender tag]]; - [transitionSheet orderOut:self]; -} - #pragma mark Swapping tables - (void)replaceSideView:(NSView *)oldView withView:(NSView *)newView animate:(BOOL)animate { @@ -3016,6 +3126,8 @@ // Get the destination associated with the search result list. Tell the PDFView to go there. if ([[notification object] isEqual:outlineView] && (updatingOutlineSelection == NO)){ [pdfView goToDestination: [[outlineView itemAtRow: [outlineView selectedRow]] destination]]; + if ([self isPresentation] && [[NSUserDefaults standardUserDefaults] boolForKey:SKAutoHidePresentationContentsKey]) + [self hideLeftSideWindow]; } } @@ -3143,11 +3255,17 @@ [self addAnnotationsForSelection:sel]; } + if ([self isPresentation] && [[NSUserDefaults standardUserDefaults] boolForKey:SKAutoHidePresentationContentsKey]) + [self hideLeftSideWindow]; + } else if ([[aNotification object] isEqual:thumbnailTableView]) { if (updatingThumbnailSelection == NO) { int row = [thumbnailTableView selectedRow]; if (row != -1) [pdfView goToPage:[[pdfView document] pageAtIndex:row]]; + + if ([self isPresentation] && [[NSUserDefaults standardUserDefaults] boolForKey:SKAutoHidePresentationContentsKey]) + [self hideLeftSideWindow]; } } else if ([[aNotification object] isEqual:snapshotTableView]) { int row = [snapshotTableView selectedRow]; @@ -4082,7 +4200,7 @@ else [menuItem setTitle:NSLocalizedString(@"Show Contents Pane", @"Menu item title")]; } - return [self isPresentation] == NO; + return YES; } else if (action == @selector(toggleRightSidePane:)) { if ([self isFullScreen]) { if ([rightSideWindow state] == NSDrawerOpenState || [rightSideWindow state] == NSDrawerOpeningState) @@ -4098,7 +4216,7 @@ return [self isPresentation] == NO; } else if (action == @selector(changeLeftSidePaneState:)) { [menuItem setState:(int)leftSidePaneState == [menuItem tag] ? ([findTableView window] ? NSMixedState : NSOnState) : NSOffState]; - return [self isPresentation] == NO && ([menuItem tag] == SKThumbnailSidePaneState || pdfOutline); + return [menuItem tag] == SKThumbnailSidePaneState || pdfOutline; } else if (action == @selector(changeRightSidePaneState:)) { [menuItem setState:(int)rightSidePaneState == [menuItem tag] ? NSOnState : NSOffState]; return [self isPresentation] == NO; Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2007-07-17 09:56:12 UTC (rev 2508) +++ trunk/SKPDFView.m 2007-07-17 12:22:00 UTC (rev 2509) @@ -831,6 +831,8 @@ [self goToNextPage:self]; } else if (isPresentation && (eventChar == NSLeftArrowFunctionKey) && (modifiers == 0)) { [self goToPreviousPage:self]; + } else if (isPresentation && (eventChar == 't') && (modifiers == 0)) { + [(SKMainWindowController *)[[self window] windowController] toggleLeftSidePane:self]; } else if ((eventChar == NSDeleteCharacter || eventChar == NSDeleteFunctionKey) && (modifiers == 0)) { [self delete:self]; } else if (isPresentation == NO && ([self toolMode] == SKTextToolMode || [self toolMode] == SKNoteToolMode) && (eventChar == NSEnterCharacter || eventChar == NSFormFeedCharacter || eventChar == NSNewlineCharacter || eventChar == NSCarriageReturnCharacter) && (modifiers == 0)) { Modified: trunk/SKSideWindow.h =================================================================== --- trunk/SKSideWindow.h 2007-07-17 09:56:12 UTC (rev 2508) +++ trunk/SKSideWindow.h 2007-07-17 12:22:00 UTC (rev 2509) @@ -57,6 +57,8 @@ - (void)setMainView:(NSView *)newContentView; - (NSRectEdge)edge; - (int)state; +- (BOOL)isEnabled; +- (void)setEnabled:(BOOL)flag; @end @@ -66,6 +68,7 @@ NSTrackingRectTag trackingRect; NSTimer *timer; NSRectEdge edge; + BOOL enabled; BOOL resizing; BOOL isStatic; } @@ -73,4 +76,6 @@ - (void)showWindow; - (void)hideWindow; - (void)trackMouseOvers; +- (BOOL)isEnabled; +- (void)setEnabled:(BOOL)flag; @end Modified: trunk/SKSideWindow.m =================================================================== --- trunk/SKSideWindow.m 2007-07-17 09:56:12 UTC (rev 2508) +++ trunk/SKSideWindow.m 2007-07-17 12:22:00 UTC (rev 2509) @@ -163,6 +163,14 @@ [[self contentView] hideWindow]; } +- (BOOL)isEnabled { + return [(SKSideWindowContentView *)[self contentView] isEnabled]; +} + +- (void)setEnabled:(BOOL)flag { + [(SKSideWindowContentView *)[self contentView] setEnabled:flag]; +} + - (void)keyDown:(NSEvent *)theEvent { NSString *characters = [theEvent charactersIgnoringModifiers]; unichar ch = [characters length] > 0 ? [characters characterAtIndex:0] : 0; @@ -191,6 +199,7 @@ contentView = [[[NSView alloc] initWithFrame:contentRect] autorelease]; [contentView setAutoresizingMask:(anEdge == NSMaxXEdge ? NSViewMaxXMargin : NSViewMinXMargin) | NSViewHeightSizable]; [self addSubview:contentView]; + enabled = YES; edge = anEdge; } return self; @@ -203,6 +212,16 @@ [super dealloc]; } +- (BOOL)isEnabled { + return enabled; +} + +- (void)setEnabled:(BOOL)flag { + if (enabled != flag) { + enabled = flag; + } +} + - (NSRect)resizeHandleRect { NSRect rect, ignored; NSDivideRect([self bounds], &rect, &ignored, CONTENT_INSET, edge == NSMaxXEdge ? NSMinXEdge : NSMaxXEdge); @@ -352,7 +371,7 @@ NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; NSRect resizeHandleRect = [self resizeHandleRect]; if (NSPointInRect(mouseLoc, resizeHandleRect) && [(SKSideWindow *)[self window] state] == NSDrawerOpenState) { - if ([theEvent clickCount] == 2) + if (enabled && [theEvent clickCount] == 2) [self hideWindow]; else [self resizeWithEvent:theEvent]; Modified: trunk/SKStringConstants.h =================================================================== --- trunk/SKStringConstants.h 2007-07-17 09:56:12 UTC (rev 2508) +++ trunk/SKStringConstants.h 2007-07-17 12:22:00 UTC (rev 2509) @@ -99,3 +99,4 @@ extern NSString *SKBlankAllScreensInFullScreenKey; extern NSString *SKActivateFullScreenNavigationAtBottomKey; extern NSString *SKActivatePresentationNavigationAtBottomKey; +extern NSString *SKAutoHidePresentationContentsKey; Modified: trunk/SKStringConstants.m =================================================================== --- trunk/SKStringConstants.m 2007-07-17 09:56:12 UTC (rev 2508) +++ trunk/SKStringConstants.m 2007-07-17 12:22:00 UTC (rev 2509) @@ -100,3 +100,4 @@ NSString *SKBlankAllScreensInFullScreenKey = @"SKBlankAllScreensInFullScreen"; NSString *SKActivateFullScreenNavigationAtBottomKey = @"SKActivateFullScreenNavigationAtBottom"; NSString *SKActivatePresentationNavigationAtBottomKey = @"SKActivatePresentationNavigationAtBottom"; +NSString *SKAutoHidePresentationContentsKey = @"SKAutoHidePresentationContents"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2007-07-17 09:56:13
|
Revision: 2508 http://skim-app.svn.sourceforge.net/skim-app/?rev=2508&view=rev Author: hofman Date: 2007-07-17 02:56:12 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Exit fullscreen using Escape key also from the side windows. Modified Paths: -------------- trunk/SKSideWindow.m Modified: trunk/SKSideWindow.m =================================================================== --- trunk/SKSideWindow.m 2007-07-17 08:23:28 UTC (rev 2507) +++ trunk/SKSideWindow.m 2007-07-17 09:56:12 UTC (rev 2508) @@ -163,6 +163,22 @@ [[self contentView] hideWindow]; } +- (void)keyDown:(NSEvent *)theEvent { + NSString *characters = [theEvent charactersIgnoringModifiers]; + unichar ch = [characters length] > 0 ? [characters characterAtIndex:0] : 0; + unsigned modifierFlags = [theEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask; + + if (modifierFlags == 0) { + if (ch == 0x1B) { + [controller exitFullScreen:self]; + } else { + [super keyDown:theEvent]; + } + } else { + [super keyDown:theEvent]; + } +} + @end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |