Revision: 4706
http://skim-app.svn.sourceforge.net/skim-app/?rev=4706&view=rev
Author: hofman
Date: 2008-09-29 11:08:56 +0000 (Mon, 29 Sep 2008)
Log Message:
-----------
Allow choosing an associated notes document for presentations, which will be
navigated synchronously. It is required to have the same number of pages.
Remove the "all" menu items in the Go menu.
Separate presentation option sheet from the transition controller, and make the
controller a subclass of the sheet controller. Add a separate subclass for
sheets with a text field.
Remove ivars for sheet controllers, just create instances when required.
Modified Paths:
--------------
trunk/English.lproj/MainMenu.nib/classes.nib
trunk/English.lproj/MainMenu.nib/keyedobjects.nib
trunk/English.lproj/TransitionSheet.nib/classes.nib
trunk/English.lproj/TransitionSheet.nib/info.nib
trunk/English.lproj/TransitionSheet.nib/keyedobjects.nib
trunk/SKMainWindowController.h
trunk/SKMainWindowController.m
trunk/SKMainWindowController_UI.m
trunk/SKPDFDocument.h
trunk/SKPDFDocument.m
trunk/SKSheetController.h
trunk/SKSheetController.m
trunk/SKTransitionController.h
trunk/SKTransitionController.m
trunk/Skim.xcodeproj/project.pbxproj
Added Paths:
-----------
trunk/SKPresentationOptionsSheetController.h
trunk/SKPresentationOptionsSheetController.m
trunk/SKTextFieldSheetController.h
trunk/SKTextFieldSheetController.m
Modified: trunk/English.lproj/MainMenu.nib/classes.nib
===================================================================
--- trunk/English.lproj/MainMenu.nib/classes.nib 2008-09-28 18:06:41 UTC
(rev 4705)
+++ trunk/English.lproj/MainMenu.nib/classes.nib 2008-09-29 11:08:56 UTC
(rev 4706)
@@ -121,14 +121,6 @@
<string>NSObject</string>
</dict>
<dict>
- <key>CLASS</key>
- <string>NSWindowController</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- <key>SUPERCLASS</key>
- <string>NSResponder</string>
- </dict>
- <dict>
<key>ACTIONS</key>
<dict>
<key>addBookmark</key>
@@ -469,6 +461,14 @@
<string>NSWindowController</string>
</dict>
<dict>
+ <key>CLASS</key>
+ <string>NSWindowController</string>
+ <key>LANGUAGE</key>
+ <string>ObjC</string>
+ <key>SUPERCLASS</key>
+ <string>NSResponder</string>
+ </dict>
+ <dict>
<key>ACTIONS</key>
<dict>
<key>changeDashPattern</key>
@@ -489,19 +489,19 @@
</dict>
<dict>
<key>CLASS</key>
- <string>SKSplitView</string>
+ <string>SKSnapshotTableView</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
- <string>NSSplitView</string>
+ <string>SKThumbnailTableView</string>
</dict>
<dict>
<key>CLASS</key>
- <string>SKSnapshotTableView</string>
+ <string>SKSplitView</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
- <string>SKThumbnailTableView</string>
+ <string>NSSplitView</string>
</dict>
<dict>
<key>ACTIONS</key>
@@ -646,19 +646,19 @@
</dict>
<dict>
<key>CLASS</key>
- <string>SKBookmarkOutlineView</string>
+ <string>BDSKCollapsibleView</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
- <string>SKOutlineView</string>
+ <string>BDSKContainerView</string>
</dict>
<dict>
<key>CLASS</key>
- <string>BDSKCollapsibleView</string>
+ <string>SKBookmarkOutlineView</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
- <string>BDSKContainerView</string>
+ <string>SKOutlineView</string>
</dict>
<dict>
<key>CLASS</key>
Modified: trunk/English.lproj/TransitionSheet.nib/classes.nib
===================================================================
--- trunk/English.lproj/TransitionSheet.nib/classes.nib 2008-09-28 18:06:41 UTC
(rev 4705)
+++ trunk/English.lproj/TransitionSheet.nib/classes.nib 2008-09-29 11:08:56 UTC
(rev 4706)
@@ -5,7 +5,25 @@
<key>IBClasses</key>
<array>
<dict>
+ <key>ACTIONS</key>
+ <dict>
+ <key>dismiss</key>
+ <string>id</string>
+ </dict>
<key>CLASS</key>
+ <string>SKSheetController</string>
+ <key>LANGUAGE</key>
+ <string>ObjC</string>
+ <key>OUTLETS</key>
+ <dict>
+ <key>theModalDelegate</key>
+ <string>id</string>
+ </dict>
+ <key>SUPERCLASS</key>
+ <string>NSWindowController</string>
+ </dict>
+ <dict>
+ <key>CLASS</key>
<string>NSMenu</string>
<key>LANGUAGE</key>
<string>ObjC</string>
@@ -40,17 +58,22 @@
<string>ObjC</string>
</dict>
<dict>
- <key>ACTIONS</key>
- <dict>
- <key>dismissTransitionSheet</key>
- <string>id</string>
- </dict>
<key>CLASS</key>
- <string>SKTransitionController</string>
+ <string>NSWindow</string>
<key>LANGUAGE</key>
<string>ObjC</string>
+ <key>SUPERCLASS</key>
+ <string>NSResponder</string>
+ </dict>
+ <dict>
+ <key>CLASS</key>
+ <string>SKPresentationOptionsSheetController</string>
+ <key>LANGUAGE</key>
+ <string>ObjC</string>
<key>OUTLETS</key>
<dict>
+ <key>notesDocumentPopUpButton</key>
+ <string>NSPopUpButton</string>
<key>transitionDurationField</key>
<string>NSTextField</string>
<key>transitionDurationSlider</key>
@@ -59,24 +82,12 @@
<string>NSMatrix</string>
<key>transitionStylePopUpButton</key>
<string>NSPopUpButton</string>
- <key>transitionView</key>
- <string>SKTransitionView</string>
- <key>transitionWindow</key>
- <string>SKTransitionWindow</string>
</dict>
<key>SUPERCLASS</key>
- <string>NSWindowController</string>
+ <string>SKSheetController</string>
</dict>
<dict>
<key>CLASS</key>
- <string>NSWindow</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- <key>SUPERCLASS</key>
- <string>NSResponder</string>
- </dict>
- <dict>
- <key>CLASS</key>
<string>NSView</string>
<key>LANGUAGE</key>
<string>ObjC</string>
@@ -101,14 +112,6 @@
</dict>
<dict>
<key>CLASS</key>
- <string>SKTransitionWindow</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- <key>SUPERCLASS</key>
- <string>NSWindow</string>
- </dict>
- <dict>
- <key>CLASS</key>
<string>NSCell</string>
<key>LANGUAGE</key>
<string>ObjC</string>
@@ -117,14 +120,6 @@
</dict>
<dict>
<key>CLASS</key>
- <string>SKTransitionView</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- <key>SUPERCLASS</key>
- <string>NSOpenGLView</string>
- </dict>
- <dict>
- <key>CLASS</key>
<string>NSResponder</string>
<key>LANGUAGE</key>
<string>ObjC</string>
Modified: trunk/English.lproj/TransitionSheet.nib/info.nib
===================================================================
--- trunk/English.lproj/TransitionSheet.nib/info.nib 2008-09-28 18:06:41 UTC
(rev 4705)
+++ trunk/English.lproj/TransitionSheet.nib/info.nib 2008-09-29 11:08:56 UTC
(rev 4706)
@@ -7,14 +7,13 @@
<key>IBLastKnownRelativeProjectPath</key>
<string>../Skim.xcodeproj</string>
<key>IBOldestOS</key>
- <integer>5</integer>
+ <integer>4</integer>
<key>IBOpenObjects</key>
<array>
- <integer>42</integer>
- <integer>8</integer>
+ <integer>68</integer>
</array>
<key>IBSystem Version</key>
- <string>9E17</string>
+ <string>9F33</string>
<key>targetFramework</key>
<string>IBCocoaFramework</string>
</dict>
Modified: trunk/SKMainWindowController.h
===================================================================
--- trunk/SKMainWindowController.h 2008-09-28 18:06:41 UTC (rev 4705)
+++ trunk/SKMainWindowController.h 2008-09-29 11:08:56 UTC (rev 4706)
@@ -213,11 +213,6 @@
IBOutlet SKColorSwatch *colorSwatch;
NSMutableDictionary *toolbarItems;
- SKPageSheetController *pageSheetController;
- SKScaleSheetController *scaleSheetController;
- SKPasswordSheetController *passwordSheetController;
- SKBookmarkSheetController *bookmarkSheetController;
-
SKProgressController *progressController;
NSButton *colorAccessoryView;
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2008-09-28 18:06:41 UTC (rev 4705)
+++ trunk/SKMainWindowController.m 2008-09-29 11:08:56 UTC (rev 4706)
@@ -81,11 +81,13 @@
#import "SKLineInspector.h"
#import "SKStatusBar.h"
#import "SKTransitionController.h"
+#import "SKPresentationOptionsSheetController.h"
#import "SKTypeSelectHelper.h"
#import "NSGeometry_SKExtensions.h"
#import "SKProgressController.h"
#import "SKSecondaryPDFView.h"
#import "SKSheetController.h"
+#import "SKTextFieldSheetController.h"
#import "SKColorSwatch.h"
#import "SKRuntime.h"
#import "SKApplicationController.h"
@@ -294,10 +296,6 @@
[colorAccessoryView release];
[leftSideDrawer release];
[rightSideDrawer release];
- [pageSheetController release];
- [scaleSheetController release];
- [passwordSheetController release];
- [bookmarkSheetController release];
[secondaryPdfEdgeView release];
[super dealloc];
}
@@ -1492,8 +1490,7 @@
}
- (IBAction)doGoToPage:(id)sender {
- if (pageSheetController == nil)
- pageSheetController = [[SKPageSheetController alloc] init];
+ SKPageSheetController *pageSheetController = [[[SKPageSheetController
alloc] init] autorelease];
[pageSheetController setObjectValues:pageLabels];
[pageSheetController setStringValue:[self pageLabel]];
@@ -1886,8 +1883,7 @@
}
- (IBAction)chooseScale:(id)sender {
- if (scaleSheetController == nil)
- scaleSheetController = [[SKScaleSheetController alloc] init];
+ SKScaleSheetController *scaleSheetController = [[[SKScaleSheetController
alloc] init] autorelease];
[[scaleSheetController textField] setIntValue:[pdfView scaleFactor]];
@@ -1991,8 +1987,7 @@
}
- (IBAction)password:(id)sender {
- if (passwordSheetController == nil)
- passwordSheetController = [[SKPasswordSheetController alloc] init];
+ SKPasswordSheetController *passwordSheetController =
[[[SKPasswordSheetController alloc] init] autorelease];
[passwordSheetController beginSheetModalForWindow: [self window]
modalDelegate:self
@@ -2011,8 +2006,7 @@
}
- (IBAction)addBookmark:(id)sender {
- if (bookmarkSheetController == nil)
- bookmarkSheetController = [[SKBookmarkSheetController alloc] init];
+ SKBookmarkSheetController *bookmarkSheetController =
[[[SKBookmarkSheetController alloc] init] autorelease];
[bookmarkSheetController setStringValue:[[self document] displayName]];
@@ -2032,8 +2026,7 @@
}
- (IBAction)addSetupBookmark:(id)sender {
- if (bookmarkSheetController == nil)
- bookmarkSheetController = [[SKBookmarkSheetController alloc] init];
+ SKBookmarkSheetController *bookmarkSheetController =
[[[SKBookmarkSheetController alloc] init] autorelease];
[bookmarkSheetController setStringValue:[[self document] displayName]];
@@ -2053,8 +2046,7 @@
}
- (IBAction)addSessionBookmark:(id)sender {
- if (bookmarkSheetController == nil)
- bookmarkSheetController = [[SKBookmarkSheetController alloc] init];
+ SKBookmarkSheetController *bookmarkSheetController =
[[[SKBookmarkSheetController alloc] init] autorelease];
[bookmarkSheetController setStringValue:[[self document] displayName]];
@@ -2075,8 +2067,29 @@
[[NSUserDefaults standardUserDefaults] setObject:[self
currentPDFSettings] forKey:SKDefaultPDFDisplaySettingsKey];
}
+- (void)presentationSheetDidEnd:(SKPresentationOptionsSheetController
*)controller returnCode:(int)returnCode contextInfo:(void *)contextInfo {
+ if (returnCode == NSOKButton) {
+ SKTransitionController *transitions = [pdfView transitionController];
+ [transitions setTransitionStyle:[controller transitionStyle]];
+ [transitions setDuration:[controller duration]];
+ [transitions setShouldRestrict:[controller shouldRestrict]];
+ [(SKPDFDocument *)[self document]
setPresentationNotesDocument:[controller notesDocument]];
+ }
+}
+
- (IBAction)chooseTransition:(id)sender {
- [[[self pdfView] transitionController]
chooseTransitionModalForWindow:[self window]];
+ SKPresentationOptionsSheetController *presentationSheetController =
[[[SKPresentationOptionsSheetController alloc] initForDocument:(SKPDFDocument
*)[self document]] autorelease];
+
+ SKTransitionController *transitions = [pdfView transitionController];
+ [presentationSheetController setTransitionStyle:[transitions
transitionStyle]];
+ [presentationSheetController setDuration:[transitions duration]];
+ [presentationSheetController setShouldRestrict:[transitions
shouldRestrict]];
+ [presentationSheetController setNotesDocument:[(SKPDFDocument *)[self
document] presentationNotesDocument]];
+
+ [presentationSheetController beginSheetModalForWindow: [self window]
+ modalDelegate: self
+ didEndSelector:
@selector(presentationSheetDidEnd:returnCode:contextInfo:)
+ contextInfo: NULL];
}
- (IBAction)toggleCaseInsensitiveSearch:(id)sender {
@@ -2509,6 +2522,10 @@
[fullScreenWindow setBackgroundColor:backgroundColor];
[fullScreenWindow setLevel:NSPopUpMenuWindowLevel];
+ SKPDFView *notesPdfView = [[(SKPDFDocument *)[self document]
presentationNotesDocument] pdfView];
+ if (notesPdfView)
+ [notesPdfView goToPage:[[notesPdfView document] pageAtIndex:[[pdfView
currentPage] pageIndex]]];
+
// periodically send a 'user activity' to prevent sleep mode and
screensaver from being activated
activityTimer = [[NSTimer scheduledTimerWithTimeInterval:30 target:self
selector:@selector(activityTimerFired:) userInfo:NULL repeats:YES] retain];
Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m 2008-09-28 18:06:41 UTC (rev 4705)
+++ trunk/SKMainWindowController_UI.m 2008-09-29 11:08:56 UTC (rev 4706)
@@ -1391,6 +1391,12 @@
[self synchronizeWindowTitleWithDocumentName];
[self updateLeftStatus];
+
+ if ([self isPresentation]) {
+ SKPDFView *notesPdfView = [[(SKPDFDocument *)[self document]
presentationNotesDocument] pdfView];
+ if (notesPdfView)
+ [notesPdfView goToPage:[[notesPdfView document] pageAtIndex:[page
pageIndex]]];
+ }
}
- (void)handleScaleChangedNotification:(NSNotification *)notification {
Modified: trunk/SKPDFDocument.h
===================================================================
--- trunk/SKPDFDocument.h 2008-09-28 18:06:41 UTC (rev 4705)
+++ trunk/SKPDFDocument.h 2008-09-29 11:08:56 UTC (rev 4706)
@@ -77,6 +77,8 @@
SKProgressController *progressController;
+ SKPDFDocument *presentationNotesDocument;
+
SKPDFSynchronizer *synchronizer;
NSString *watchedFile;
BOOL autoUpdate;
@@ -106,6 +108,9 @@
- (SKPDFView *)pdfView;
+- (SKPDFDocument *)presentationNotesDocument;
+- (void)setPresentationNotesDocument:(SKPDFDocument *)aDocument;
+
- (NSData *)notesData;
- (NSString *)notesFDFString;
- (NSString *)notesFDFStringForFile:(NSString *)filename;
Modified: trunk/SKPDFDocument.m
===================================================================
--- trunk/SKPDFDocument.m 2008-09-28 18:06:41 UTC (rev 4705)
+++ trunk/SKPDFDocument.m 2008-09-29 11:08:56 UTC (rev 4706)
@@ -104,8 +104,9 @@
- (void)handleFileUpdateNotification:(NSNotification *)notification;
- (void)handleFileMoveNotification:(NSNotification *)notification;
- (void)handleFileDeleteNotification:(NSNotification *)notification;
+- (void)handleWindowDidEndSheetNotification:(NSNotification *)notification;
- (void)handleWindowWillCloseNotification:(NSNotification *)notification;
-- (void)handleWindowDidEndSheetNotification:(NSNotification *)notification;
+- (void)handleDidRemoveDocumentNotification:(NSNotification *)notification;
- (SKProgressController *)progressController;
@@ -119,6 +120,7 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
[synchronizer stopDOServer];
[synchronizer release];
+ [presentationNotesDocument release];
[watchedFile release];
[pdfData release];
[pdfDocument release];
@@ -167,6 +169,8 @@
[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self
forKey:SKAutoCheckFileUpdateKey
context:SKPDFDocumentDefaultsObservationContext];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleWindowWillCloseNotification:)
name:NSWindowWillCloseNotification object:[mainController window]];
+ [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleDidRemoveDocumentNotification:)
+
name:SKDocumentControllerDidRemoveDocumentNotification object:nil];
}
- (void)showWindows{
@@ -1359,6 +1363,15 @@
fileChangedOnDisk = YES;
}
+- (void)handleWindowDidEndSheetNotification:(NSNotification *)notification {
+ // This is only called to delay a file update handling
+ [[NSNotificationCenter defaultCenter] removeObserver:self
name:NSWindowDidEndSheetNotification object:[notification object]];
+ // Make sure we finish the sheet event first. E.g. the documentEdited
status may need to be updated.
+ [self performSelector:@selector(fileUpdated) withObject:nil
afterDelay:0.0];
+}
+
+#pragma mark Notification handlers
+
- (void)handleWindowWillCloseNotification:(NSNotification *)notification {
NSWindow *window = [notification object];
// ignore when we're switching fullscreen/main windows
@@ -1369,11 +1382,9 @@
}
}
-- (void)handleWindowDidEndSheetNotification:(NSNotification *)notification {
- // This is only called to delay a file update handling
- [[NSNotificationCenter defaultCenter] removeObserver:self
name:NSWindowDidEndSheetNotification object:[notification object]];
- // Make sure we finish the sheet event first. E.g. the documentEdited
status may need to be updated.
- [self performSelector:@selector(fileUpdated) withObject:nil
afterDelay:0.0];
+- (void)handleDidRemoveDocumentNotification:(NSNotification *)notification {
+ if ([[notification userInfo] objectForKey:@"document"] ==
presentationNotesDocument)
+ [self setPresentationNotesDocument:nil];
}
#pragma mark Notification observation
@@ -1553,6 +1564,17 @@
return [[self mainWindowController] pdfView];
}
+- (SKPDFDocument *)presentationNotesDocument {
+ return presentationNotesDocument;
+}
+
+- (void)setPresentationNotesDocument:(SKPDFDocument *)aDocument {
+ if (presentationNotesDocument != aDocument) {
+ [presentationNotesDocument release];
+ presentationNotesDocument = [aDocument retain];
+ }
+}
+
- (NSArray *)fileIDStrings {
if (pdfData == nil)
return nil;
Added: trunk/SKPresentationOptionsSheetController.h
===================================================================
--- trunk/SKPresentationOptionsSheetController.h
(rev 0)
+++ trunk/SKPresentationOptionsSheetController.h 2008-09-29 11:08:56 UTC
(rev 4706)
@@ -0,0 +1,70 @@
+//
+// SKPresentationOptionsSheetController.h
+// Skim
+//
+// Created by Christiaan Hofman on 9/28/08.
+/*
+ This software is Copyright (c) 2008
+ Christiaan Hofman. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ - Neither the name of Christiaan Hofman nor the names of any
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Cocoa/Cocoa.h>
+#import "SKSheetController.h"
+#import "SKTransitionController.h"
+
[EMAIL PROTECTED] SKPDFDocument;
+
[EMAIL PROTECTED] SKPresentationOptionsSheetController : SKSheetController {
+ IBOutlet NSPopUpButton *transitionStylePopUpButton;
+ IBOutlet NSTextField *transitionDurationField;
+ IBOutlet NSSlider *transitionDurationSlider;
+ IBOutlet NSMatrix *transitionExtentMatrix;
+ IBOutlet NSPopUpButton *notesDocumentPopUpButton;
+ SKPDFDocument *document;
+}
+
+- (id)initForDocument:(SKPDFDocument *)aDocument;
+
+- (SKPDFDocument *)document;
+
+- (SKAnimationTransitionStyle)transitionStyle;
+- (void)setTransitionStyle:(SKAnimationTransitionStyle)style;
+
+- (float)duration;
+- (void)setDuration:(float)newDuration;
+
+- (BOOL)shouldRestrict;
+- (void)setShouldRestrict:(BOOL)flag;
+
+- (SKPDFDocument *)notesDocument;
+- (void)setNotesDocument:(SKPDFDocument *)newNotesDocument;
+
[EMAIL PROTECTED]
Added: trunk/SKPresentationOptionsSheetController.m
===================================================================
--- trunk/SKPresentationOptionsSheetController.m
(rev 0)
+++ trunk/SKPresentationOptionsSheetController.m 2008-09-29 11:08:56 UTC
(rev 4706)
@@ -0,0 +1,154 @@
+//
+// SKPresentationOptionsSheetController.m
+// Skim
+//
+// Created by Christiaan Hofman on 9/28/08.
+/*
+ This software is Copyright (c) 2008
+ Christiaan Hofman. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ - Neither the name of Christiaan Hofman nor the names of any
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "SKPresentationOptionsSheetController.h"
+#import <Quartz/Quartz.h>
+#import "SKPDFDocument.h"
+#import "SKDocumentController.h"
+
+
[EMAIL PROTECTED] SKPresentationOptionsSheetController
+
+- (id)initForDocument:(SKPDFDocument *)aDocument {
+ if (self = [super init]) {
+ document = aDocument;
+ }
+ return self;
+}
+
+- (void)dealloc {
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+ [super dealloc];
+}
+
+- (void)handleDocumentsDidChangeNotification:(NSNotification *)note {
+ id currentDoc = [[[notesDocumentPopUpButton selectedItem]
representedObject] retain];
+
+ while ([notesDocumentPopUpButton numberOfItems] > 1)
+ [notesDocumentPopUpButton removeItemAtIndex:[notesDocumentPopUpButton
numberOfItems] - 1];
+
+ NSEnumerator *docEnum = [[[NSDocumentController sharedDocumentController]
documents] objectEnumerator];
+ id doc;
+ NSMutableArray *documents = [NSMutableArray array];
+ unsigned pageCount = [[document pdfDocument] pageCount];
+ while (doc = [docEnum nextObject]) {
+ if ([doc respondsToSelector:@selector(pdfDocument)] && doc != document
&& [[doc pdfDocument] pageCount] == pageCount)
+ [documents addObject:doc];
+ }
+ NSSortDescriptor *sortDescriptor = [[[NSSortDescriptor alloc]
initWithKey:@"displayName" ascending:YES] autorelease];
+ [documents sortUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]];
+
+ docEnum = [documents objectEnumerator];
+ while (doc = [docEnum nextObject]) {
+ [notesDocumentPopUpButton addItemWithTitle:[doc displayName]];
+ [[notesDocumentPopUpButton lastItem] setRepresentedObject:doc];
+ }
+
+ int docIndex = [notesDocumentPopUpButton
indexOfItemWithRepresentedObject:currentDoc];
+ [notesDocumentPopUpButton selectItemAtIndex:docIndex == -1 ? 0 : docIndex];
+ [currentDoc release];
+}
+
+- (void)windowDidLoad {
+ 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];
+ }
+
+ [self handleDocumentsDidChangeNotification:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleDocumentsDidChangeNotification:)
+
name:SKDocumentDidShowNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleDocumentsDidChangeNotification:)
+
name:SKDocumentControllerDidRemoveDocumentNotification object:nil];
+}
+
+- (NSString *)windowNibName {
+ return @"TransitionSheet";
+}
+
+- (SKPDFDocument *)document {
+ return document;
+}
+
+- (SKAnimationTransitionStyle)transitionStyle {
+ [self window];
+ return [[transitionStylePopUpButton selectedItem] tag];
+}
+
+- (void)setTransitionStyle:(SKAnimationTransitionStyle)style {
+ [self window];
+ [transitionStylePopUpButton selectItemWithTag:style];
+}
+
+- (float)duration {
+ [self window];
+ return fmaxf([transitionDurationField floatValue], 0.0);
+}
+
+- (void)setDuration:(float)newDuration {
+ [self window];
+ [transitionDurationField setFloatValue:newDuration];
+ [transitionDurationSlider setFloatValue:newDuration];
+}
+
+- (BOOL)shouldRestrict {
+ [self window];
+ return (BOOL)[[transitionExtentMatrix selectedCell] tag];
+}
+
+- (void)setShouldRestrict:(BOOL)flag {
+ [self window];
+ [transitionExtentMatrix selectCellWithTag:(int)flag];
+}
+
+- (SKPDFDocument *)notesDocument {
+ [self window];
+ return [[notesDocumentPopUpButton selectedItem] representedObject];
+}
+
+- (void)setNotesDocument:(SKPDFDocument *)newNotesDocument {
+ [self window];
+ int docIndex = [notesDocumentPopUpButton
indexOfItemWithRepresentedObject:newNotesDocument];
+ [notesDocumentPopUpButton selectItemAtIndex:docIndex > 0 ? docIndex : 0];
+}
+
[EMAIL PROTECTED]
Modified: trunk/SKSheetController.h
===================================================================
--- trunk/SKSheetController.h 2008-09-28 18:06:41 UTC (rev 4705)
+++ trunk/SKSheetController.h 2008-09-29 11:08:56 UTC (rev 4706)
@@ -40,8 +40,6 @@
@interface SKSheetController : NSWindowController {
- IBOutlet NSTextField *textField;
-
id theModalDelegate;
SEL theDidEndSelector;
void *theContextInfo;
@@ -54,38 +52,5 @@
- (void)didEndSheet:(NSWindow *)sheet returnCode:(int)returnCode
contextInfo:(void *)contextInfo;
- (void)endSheetWithReturnCode:(int)returnCode;
-- (NSTextField *)textField;
-
-- (NSString *)stringValue;
-- (void)setStringValue:(NSString *)string;
-
@end
-#pragma mark -
-
[EMAIL PROTECTED] SKPageSheetController : SKSheetController
-- (NSArray *)objectValues;
-- (void)setObjectValues:(NSArray *)objects;
[EMAIL PROTECTED]
-
-#pragma mark -
-
[EMAIL PROTECTED] SKScaleSheetController : SKSheetController
[EMAIL PROTECTED]
-
-#pragma mark -
-
[EMAIL PROTECTED] SKBookmark;
-
[EMAIL PROTECTED] SKBookmarkSheetController : SKSheetController {
- IBOutlet NSPopUpButton *folderPopUp;
-}
-
-- (SKBookmark *)selectedFolder;
-
[EMAIL PROTECTED]
-
-#pragma mark -
-
[EMAIL PROTECTED] SKPasswordSheetController : SKSheetController
[EMAIL PROTECTED]
Modified: trunk/SKSheetController.m
===================================================================
--- trunk/SKSheetController.m 2008-09-28 18:06:41 UTC (rev 4705)
+++ trunk/SKSheetController.m 2008-09-29 11:08:56 UTC (rev 4706)
@@ -37,8 +37,6 @@
*/
#import "SKSheetController.h"
-#import "SKBookmarkController.h"
-#import "SKBookmark.h"
#import "NSInvocation_SKExtensions.h"
@@ -85,84 +83,4 @@
theContextInfo = NULL;
}
-- (NSTextField *)textField {
- [self window];
- return textField;
-}
-
-- (NSString *)stringValue {
- return [[self textField] stringValue];
-}
-
-- (void)setStringValue:(NSString *)string {
- [[self textField] setStringValue:string];
-}
-
@end
-
-#pragma mark -
-
[EMAIL PROTECTED] SKPageSheetController : SKSheetController
-
-- (NSString *)windowNibName { return @"PageSheet"; }
-
-- (NSArray *)objectValues {
- return [(NSComboBox *)[self textField] objectValues];
-}
-
-- (void)setObjectValues:(NSArray *)objects {
- [(NSComboBox *)[self textField] removeAllItems];
- [(NSComboBox *)[self textField] addItemsWithObjectValues:objects];
-}
-
[EMAIL PROTECTED]
-
-#pragma mark -
-
[EMAIL PROTECTED] SKScaleSheetController : SKSheetController
-- (NSString *)windowNibName { return @"ScaleSheet"; }
[EMAIL PROTECTED]
-
-#pragma mark -
-
[EMAIL PROTECTED] SKBookmarkSheetController : SKSheetController
-
-- (NSString *)windowNibName { return @"BookmarkSheet"; }
-
-- (void)addMenuItemsForBookmarks:(NSArray *)bookmarks level:(int)level
toMenu:(NSMenu *)menu {
- int i, iMax = [bookmarks count];
- for (i = 0; i < iMax; i++) {
- SKBookmark *bm = [bookmarks objectAtIndex:i];
- if ([bm bookmarkType] == SKBookmarkTypeFolder) {
- NSString *label = [bm label];
- NSMenuItem *item = [menu addItemWithTitle:label ?: @"" action:NULL
keyEquivalent:@""];
- [item setImage:[bm icon]];
- [item setIndentationLevel:level];
- [item setRepresentedObject:bm];
- [self addMenuItemsForBookmarks:[bm children] level:level+1
toMenu:menu];
- }
- }
-}
-
-- (void)prepare {
- SKBookmarkController *bookmarkController = [SKBookmarkController
sharedBookmarkController];
- SKBookmark *root = [bookmarkController bookmarkRoot];
- [folderPopUp removeAllItems];
- NSMenuItem *item = [[folderPopUp menu]
addItemWithTitle:NSLocalizedString(@"Bookmarks Menu", @"Menu item title")
action:NULL keyEquivalent:@""];
- [item setImage:[NSImage imageNamed:@"SmallMenu"]];
- [item setRepresentedObject:root];
- [self addMenuItemsForBookmarks:[root children] level:1 toMenu:[folderPopUp
menu]];
- [folderPopUp selectItemAtIndex:0];
-}
-
-- (SKBookmark *)selectedFolder {
- return [[folderPopUp selectedItem] representedObject];
-}
-
[EMAIL PROTECTED]
-
-#pragma mark -
-
[EMAIL PROTECTED] SKPasswordSheetController : SKSheetController
-- (NSString *)windowNibName { return @"PasswordSheet"; }
[EMAIL PROTECTED]
Added: trunk/SKTextFieldSheetController.h
===================================================================
--- trunk/SKTextFieldSheetController.h (rev 0)
+++ trunk/SKTextFieldSheetController.h 2008-09-29 11:08:56 UTC (rev 4706)
@@ -0,0 +1,81 @@
+//
+// SKTextFieldSheetController.h
+// Skim
+//
+// Created by Christiaan Hofman on 9/29/08.
+/*
+ This software is Copyright (c) 2008
+ Christiaan Hofman. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ - Neither the name of Christiaan Hofman nor the names of any
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Cocoa/Cocoa.h>
+#import "SKSheetController.h"
+
+
[EMAIL PROTECTED] SKTextFieldSheetController : SKSheetController {
+ IBOutlet NSTextField *textField;
+}
+
+- (NSTextField *)textField;
+
+- (NSString *)stringValue;
+- (void)setStringValue:(NSString *)string;
+
[EMAIL PROTECTED]
+
+#pragma mark -
+
[EMAIL PROTECTED] SKPageSheetController : SKTextFieldSheetController
+- (NSArray *)objectValues;
+- (void)setObjectValues:(NSArray *)objects;
[EMAIL PROTECTED]
+
+#pragma mark -
+
[EMAIL PROTECTED] SKScaleSheetController : SKTextFieldSheetController
[EMAIL PROTECTED]
+
+#pragma mark -
+
[EMAIL PROTECTED] SKBookmark;
+
[EMAIL PROTECTED] SKBookmarkSheetController : SKTextFieldSheetController {
+ IBOutlet NSPopUpButton *folderPopUp;
+}
+
+- (SKBookmark *)selectedFolder;
+
[EMAIL PROTECTED]
+
+#pragma mark -
+
[EMAIL PROTECTED] SKPasswordSheetController : SKTextFieldSheetController
[EMAIL PROTECTED]
Added: trunk/SKTextFieldSheetController.m
===================================================================
--- trunk/SKTextFieldSheetController.m (rev 0)
+++ trunk/SKTextFieldSheetController.m 2008-09-29 11:08:56 UTC (rev 4706)
@@ -0,0 +1,126 @@
+//
+// SKTextFieldSheetController.m
+// Skim
+//
+// Created by Christiaan Hofman on 9/29/08.
+/*
+ This software is Copyright (c) 2008
+ Christiaan Hofman. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ - Neither the name of Christiaan Hofman nor the names of any
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "SKTextFieldSheetController.h"
+#import "SKBookmarkController.h"
+#import "SKBookmark.h"
+
+
[EMAIL PROTECTED] SKTextFieldSheetController
+
+- (NSTextField *)textField {
+ [self window];
+ return textField;
+}
+
+- (NSString *)stringValue {
+ return [[self textField] stringValue];
+}
+
+- (void)setStringValue:(NSString *)string {
+ [[self textField] setStringValue:string];
+}
+
[EMAIL PROTECTED]
+
+#pragma mark -
+
[EMAIL PROTECTED] SKPageSheetController
+
+- (NSString *)windowNibName { return @"PageSheet"; }
+
+- (NSArray *)objectValues {
+ return [(NSComboBox *)[self textField] objectValues];
+}
+
+- (void)setObjectValues:(NSArray *)objects {
+ [(NSComboBox *)[self textField] removeAllItems];
+ [(NSComboBox *)[self textField] addItemsWithObjectValues:objects];
+}
+
[EMAIL PROTECTED]
+
+#pragma mark -
+
[EMAIL PROTECTED] SKScaleSheetController
+- (NSString *)windowNibName { return @"ScaleSheet"; }
[EMAIL PROTECTED]
+
+#pragma mark -
+
[EMAIL PROTECTED] SKBookmarkSheetController
+
+- (NSString *)windowNibName { return @"BookmarkSheet"; }
+
+- (void)addMenuItemsForBookmarks:(NSArray *)bookmarks level:(int)level
toMenu:(NSMenu *)menu {
+ int i, iMax = [bookmarks count];
+ for (i = 0; i < iMax; i++) {
+ SKBookmark *bm = [bookmarks objectAtIndex:i];
+ if ([bm bookmarkType] == SKBookmarkTypeFolder) {
+ NSString *label = [bm label];
+ NSMenuItem *item = [menu addItemWithTitle:label ?: @"" action:NULL
keyEquivalent:@""];
+ [item setImage:[bm icon]];
+ [item setIndentationLevel:level];
+ [item setRepresentedObject:bm];
+ [self addMenuItemsForBookmarks:[bm children] level:level+1
toMenu:menu];
+ }
+ }
+}
+
+- (void)prepare {
+ SKBookmarkController *bookmarkController = [SKBookmarkController
sharedBookmarkController];
+ SKBookmark *root = [bookmarkController bookmarkRoot];
+ [folderPopUp removeAllItems];
+ NSMenuItem *item = [[folderPopUp menu]
addItemWithTitle:NSLocalizedString(@"Bookmarks Menu", @"Menu item title")
action:NULL keyEquivalent:@""];
+ [item setImage:[NSImage imageNamed:@"SmallMenu"]];
+ [item setRepresentedObject:root];
+ [self addMenuItemsForBookmarks:[root children] level:1 toMenu:[folderPopUp
menu]];
+ [folderPopUp selectItemAtIndex:0];
+}
+
+- (SKBookmark *)selectedFolder {
+ return [[folderPopUp selectedItem] representedObject];
+}
+
[EMAIL PROTECTED]
+
+#pragma mark -
+
[EMAIL PROTECTED] SKPasswordSheetController
+- (NSString *)windowNibName { return @"PasswordSheet"; }
[EMAIL PROTECTED]
Modified: trunk/SKTransitionController.h
===================================================================
--- trunk/SKTransitionController.h 2008-09-28 18:06:41 UTC (rev 4705)
+++ trunk/SKTransitionController.h 2008-09-29 11:08:56 UTC (rev 4706)
@@ -60,13 +60,8 @@
@class CIImage, SKTransitionWindow, SKTransitionView;
[EMAIL PROTECTED] SKTransitionController : NSWindowController {
- IBOutlet NSPopUpButton *transitionStylePopUpButton;
- IBOutlet NSTextField *transitionDurationField;
- IBOutlet NSSlider *transitionDurationSlider;
- IBOutlet NSMatrix *transitionExtentMatrix;
- IBOutlet SKTransitionWindow *transitionWindow;
- IBOutlet SKTransitionView *transitionView;
[EMAIL PROTECTED] SKTransitionController : NSObject {
+ SKTransitionWindow *transitionWindow;
NSView *view;
CIImage *initialImage;
@@ -98,9 +93,6 @@
- (void)prepareAnimationForRect:(NSRect)rect;
- (void)animateForRect:(NSRect)rect forward:(BOOL)forward;
-- (void)chooseTransitionModalForWindow:(NSWindow *)window;
-- (IBAction)dismissTransitionSheet:(id)sender;
-
@end
#pragma mark -
Modified: trunk/SKTransitionController.m
===================================================================
--- trunk/SKTransitionController.m 2008-09-28 18:06:41 UTC (rev 4705)
+++ trunk/SKTransitionController.m 2008-09-29 11:08:56 UTC (rev 4706)
@@ -137,7 +137,8 @@
}
- (id)initWithView:(NSView *)aView {
- if (self = [super initWithWindowNibName:@"TransitionSheet"]) {
+ if (self = [super init]) {
+ transitionWindow = [[SKTransitionWindow alloc] init];
view = aView; // don't retain as it may retain us
transitionStyle = SKNoTransition;
duration = 1.0;
@@ -147,22 +148,12 @@
}
- (void)dealloc {
+ [transitionWindow release];
[initialImage release];
[filters release];
[super dealloc];
}
-- (void)windowDidLoad {
- NSArray *filterNames = [[self class] 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];
- }
-}
-
- (NSView *)view {
return view;
}
@@ -309,15 +300,11 @@
}
- (NSWindow *)transitionWindow {
- if (transitionWindow == nil)
- [self window];
return transitionWindow;
}
- (SKTransitionView *)transitionView {
- if (transitionView == nil)
- [self window];
- return transitionView;
+ return (SKTransitionView *)[transitionWindow contentView];
}
- (void)prepareAnimationForRect:(NSRect)rect {
@@ -457,34 +444,6 @@
}
}
-#pragma mark Setup sheet
-
-- (void)transitionSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode
contextInfo:(void *)contextInfo {
- if (returnCode == NSOKButton) {
- [self setTransitionStyle:[[transitionStylePopUpButton selectedItem]
tag]];
- [self setDuration:fmaxf([transitionDurationField floatValue], 0.0)];
- [self setShouldRestrict:(BOOL)[[transitionExtentMatrix selectedCell]
tag]];
- }
-}
-
-- (void)chooseTransitionModalForWindow:(NSWindow *)window {
- [self window];
- [transitionStylePopUpButton selectItemWithTag:[self transitionStyle]];
- [transitionDurationField setFloatValue:[self duration]];
- [transitionDurationSlider setFloatValue:[self duration]];
- [transitionExtentMatrix selectCellWithTag:(int)[self shouldRestrict]];
- [NSApp beginSheet:[self window]
- modalForWindow:window
- modalDelegate:self
- didEndSelector:@selector(transitionSheetDidEnd:returnCode:contextInfo:)
- contextInfo:NULL];
-}
-
-- (IBAction)dismissTransitionSheet:(id)sender {
- [NSApp endSheet:[self window] returnCode:[sender tag]];
- [[self window] orderOut:self];
-}
-
@end
#pragma mark -
@@ -655,10 +614,13 @@
@implementation SKTransitionWindow
-- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned
int)styleMask backing:(NSBackingStoreType)bufferingType
defer:(BOOL)deferCreation {
- if (self = [super initWithContentRect:contentRect
styleMask:NSBorderlessWindowMask backing:bufferingType defer:deferCreation]) {
+- (id)init {
+ if (self = [super initWithContentRect:NSZeroRect
styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]) {
[self setReleasedWhenClosed:NO];
[self setIgnoresMouseEvents:YES];
+ SKTransitionView *view = [[SKTransitionView alloc] init];
+ [self setContentView:view];
+ [view release];
}
return self;
}
Modified: trunk/Skim.xcodeproj/project.pbxproj
===================================================================
--- trunk/Skim.xcodeproj/project.pbxproj 2008-09-28 18:06:41 UTC (rev
4705)
+++ trunk/Skim.xcodeproj/project.pbxproj 2008-09-29 11:08:56 UTC (rev
4706)
@@ -184,6 +184,10 @@
CE0461A60E8BA99F00253123 /* Skim_Prefix.pch in Headers */ =
{isa = PBXBuildFile; fileRef = 32DBCF750370BD2300C91783 /* Skim_Prefix.pch */;
};
CE0461AB0E8BA9F700253123 /* SKPrintAccessoryController.h in
Headers */ = {isa = PBXBuildFile; fileRef = CE816AA20D718C8C008D807D /*
SKPrintAccessoryController.h */; };
CE0463CB0B84D24300C11E4A /* SKApplication.m in Sources */ =
{isa = PBXBuildFile; fileRef = CE0463CA0B84D24300C11E4A /* SKApplication.m */;
};
+ CE05A7370E9024ED0060BB07 /*
SKPresentationOptionsSheetController.h in Headers */ = {isa = PBXBuildFile;
fileRef = CE05A7350E9024ED0060BB07 /* SKPresentationOptionsSheetController.h
*/; };
+ CE05A7380E9024ED0060BB07 /*
SKPresentationOptionsSheetController.m in Sources */ = {isa = PBXBuildFile;
fileRef = CE05A7360E9024ED0060BB07 /* SKPresentationOptionsSheetController.m
*/; };
+ CE05A86E0E90ED950060BB07 /* SKTextFieldSheetController.h in
Headers */ = {isa = PBXBuildFile; fileRef = CE05A86C0E90ED950060BB07 /*
SKTextFieldSheetController.h */; };
+ CE05A86F0E90ED950060BB07 /* SKTextFieldSheetController.m in
Sources */ = {isa = PBXBuildFile; fileRef = CE05A86D0E90ED950060BB07 /*
SKTextFieldSheetController.m */; };
CE070EA20B89039700733CC8 /* NSScrollView_SKExtensions.m in
Sources */ = {isa = PBXBuildFile; fileRef = CE070EA10B89039700733CC8 /*
NSScrollView_SKExtensions.m */; };
CE0710170B89BDD600733CC8 /* BDSKCollapsibleView.m in Sources */
= {isa = PBXBuildFile; fileRef = CE0710120B89BDD600733CC8 /*
BDSKCollapsibleView.m */; };
CE0710180B89BDD600733CC8 /* BDSKContainerView.m in Sources */ =
{isa = PBXBuildFile; fileRef = CE0710140B89BDD600733CC8 /* BDSKContainerView.m
*/; };
@@ -580,6 +584,10 @@
8D15AC370486D014006FF6A4 /* Skim.app */ = {isa =
PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0;
path = Skim.app; sourceTree = BUILT_PRODUCTS_DIR; };
CE0463C90B84D24300C11E4A /* SKApplication.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
SKApplication.h; sourceTree = "<group>"; };
CE0463CA0B84D24300C11E4A /* SKApplication.m */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path
= SKApplication.m; sourceTree = "<group>"; };
+ CE05A7350E9024ED0060BB07 /*
SKPresentationOptionsSheetController.h */ = {isa = PBXFileReference;
fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
SKPresentationOptionsSheetController.h; sourceTree = "<group>"; };
+ CE05A7360E9024ED0060BB07 /*
SKPresentationOptionsSheetController.m */ = {isa = PBXFileReference;
fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path =
SKPresentationOptionsSheetController.m; sourceTree = "<group>"; };
+ CE05A86C0E90ED950060BB07 /* SKTextFieldSheetController.h */ =
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h;
path = SKTextFieldSheetController.h; sourceTree = "<group>"; };
+ CE05A86D0E90ED950060BB07 /* SKTextFieldSheetController.m */ =
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType =
sourcecode.c.objc; path = SKTextFieldSheetController.m; sourceTree = "<group>";
};
CE070EA00B89039700733CC8 /* NSScrollView_SKExtensions.h */ =
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h;
path = NSScrollView_SKExtensions.h; sourceTree = "<group>"; };
CE070EA10B89039700733CC8 /* NSScrollView_SKExtensions.m */ =
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType =
sourcecode.c.objc; path = NSScrollView_SKExtensions.m; sourceTree = "<group>";
};
CE0710110B89BDD600733CC8 /* BDSKCollapsibleView.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
BDSKCollapsibleView.h; sourceTree = "<group>"; };
@@ -1337,6 +1345,8 @@
CEE54F6B0DA3FB060037169F /*
SKMainWindowController_Toolbar.m */,
CE4EC4F30B7E24490091F228 /*
SKPreferenceController.h */,
CE4EC4F40B7E24490091F228 /*
SKPreferenceController.m */,
+ CE05A7350E9024ED0060BB07 /*
SKPresentationOptionsSheetController.h */,
+ CE05A7360E9024ED0060BB07 /*
SKPresentationOptionsSheetController.m */,
CE209FA70C9D38C6007C72F9 /*
SKProgressController.h */,
CE209FA80C9D38C6007C72F9 /*
SKProgressController.m */,
F97751610B37461000DF673B /*
SKPSProgressController.h */,
@@ -1347,6 +1357,8 @@
CEAE39050CA43E7300849B0F /* SKSheetController.m
*/,
4530D7E60B27AAB9007C59F4 /*
SKSnapshotWindowController.h */,
4530D7E70B27AAB9007C59F4 /*
SKSnapshotWindowController.m */,
+ CE05A86C0E90ED950060BB07 /*
SKTextFieldSheetController.h */,
+ CE05A86D0E90ED950060BB07 /*
SKTextFieldSheetController.m */,
CEB72B890C4A189D000350F9 /*
SKTransitionController.h */,
CE1ADEBE0C4C341100071840 /*
SKTransitionController.m */,
);
@@ -1903,6 +1915,8 @@
CE0461A40E8BA98800253123 /* UKFileWatcher.h in
Headers */,
CE0461A50E8BA98900253123 /* UKKQueue.h in
Headers */,
CE0461A60E8BA99F00253123 /* Skim_Prefix.pch in
Headers */,
+ CE05A7370E9024ED0060BB07 /*
SKPresentationOptionsSheetController.h in Headers */,
+ CE05A86E0E90ED950060BB07 /*
SKTextFieldSheetController.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2404,6 +2418,8 @@
CEA450F40E47A87500D161AD /*
NSLayoutManager_SKExtensions.m in Sources */,
CE2896DA0E78948200031EEA /* SKPDFOutline.m in
Sources */,
CEEE7C520E7D3F2000B7B208 /*
PDFAnnotationInk_SKExtensions.m in Sources */,
+ CE05A7380E9024ED0060BB07 /*
SKPresentationOptionsSheetController.m in Sources */,
+ CE05A86F0E90ED950060BB07 /*
SKTextFieldSheetController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit