Revision: 5779
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5779&view=rev
Author:   hofman
Date:     2009-09-22 16:27:53 +0000 (Tue, 22 Sep 2009)

Log Message:
-----------
move sheet controller methods to NSWindowController category

Modified Paths:
--------------
    trunk/NSWindowController_SKExtensions.h
    trunk/NSWindowController_SKExtensions.m
    trunk/SKMainDocument.m
    trunk/SKMainWindowController_Actions.m
    trunk/SKPresentationOptionsSheetController.h
    trunk/SKPresentationOptionsSheetController.m
    trunk/SKTextFieldSheetController.h
    trunk/SKTextFieldSheetController.m
    trunk/Skim.xcodeproj/project.pbxproj

Removed Paths:
-------------
    trunk/SKSheetController.h
    trunk/SKSheetController.m

Modified: trunk/NSWindowController_SKExtensions.h
===================================================================
--- trunk/NSWindowController_SKExtensions.h     2009-09-22 16:05:06 UTC (rev 
5778)
+++ trunk/NSWindowController_SKExtensions.h     2009-09-22 16:27:53 UTC (rev 
5779)
@@ -46,4 +46,8 @@
 - (BOOL)isNoteWindowController;
 - (BOOL)isSnapshotWindowController;
 
+- (void)beginSheetModalForWindow:(NSWindow *)window modalDelegate:(id)delegate 
didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo;
+
+- (IBAction)dismiss:(id)sender;
+
 @end

Modified: trunk/NSWindowController_SKExtensions.m
===================================================================
--- trunk/NSWindowController_SKExtensions.m     2009-09-22 16:05:06 UTC (rev 
5778)
+++ trunk/NSWindowController_SKExtensions.m     2009-09-22 16:27:53 UTC (rev 
5779)
@@ -37,6 +37,7 @@
  */
 
 #import "NSWindowController_SKExtensions.h"
+#import "NSInvocation_SKExtensions.h"
 
 
 @implementation NSWindowController (SKExtensions)
@@ -64,4 +65,34 @@
 
 - (BOOL)isSnapshotWindowController { return NO; }
 
+- (void)didEndSheet:(NSWindow *)sheet returnCode:(NSInteger)returnCode 
contextInfo:(void *)contextInfo {
+       NSInvocation *invocation = [(NSInvocation *)contextInfo autorelease];
+    if (invocation) {
+               [invocation setArgument:&returnCode atIndex:3];
+               [invocation invoke];
+    }
+}
+
+- (void)beginSheetModalForWindow:(NSWindow *)window modalDelegate:(id)delegate 
didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo {
+    NSInvocation *invocation = nil;
+    if (delegate != nil && didEndSelector != NULL) {
+        invocation = [NSInvocation invocationWithTarget:delegate 
selector:didEndSelector argument:&self];
+               [invocation setArgument:&contextInfo atIndex:4];
+       }
+    
+       [self retain]; // make sure we stay around long enough
+       
+       [NSApp beginSheet:[self window]
+          modalForWindow:window
+               modalDelegate:self
+          didEndSelector:@selector(didEndSheet:returnCode:contextInfo:)
+                 contextInfo:[invocation retain]];
+}
+
+- (IBAction)dismiss:(id)sender {
+    [NSApp endSheet:[self window] returnCode:[sender tag]];
+    [[self window] orderOut:self];
+    [self release];
+}
+
 @end

Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m      2009-09-22 16:05:06 UTC (rev 5778)
+++ trunk/SKMainDocument.m      2009-09-22 16:27:53 UTC (rev 5779)
@@ -78,6 +78,7 @@
 #import "SKRuntime.h"
 #import "SKTextFieldSheetController.h"
 #import "PDFAnnotationMarkup_SKExtensions.h"
+#import "NSWindowController_SKExtensions.h"
 
 #define BUNDLE_DATA_FILENAME @"data"
 #define PRESENTATION_OPTIONS_KEY 
@"net_sourceforge_skim-app_presentation_options"

Modified: trunk/SKMainWindowController_Actions.m
===================================================================
--- trunk/SKMainWindowController_Actions.m      2009-09-22 16:05:06 UTC (rev 
5778)
+++ trunk/SKMainWindowController_Actions.m      2009-09-22 16:27:53 UTC (rev 
5779)
@@ -62,6 +62,7 @@
 #import "SKSplitView.h"
 #import "SKLineInspector.h"
 #import "NSEvent_SKExtensions.h"
+#import "NSWindowController_SKExtensions.h"
 
 
 @implementation SKMainWindowController (Actions)

Modified: trunk/SKPresentationOptionsSheetController.h
===================================================================
--- trunk/SKPresentationOptionsSheetController.h        2009-09-22 16:05:06 UTC 
(rev 5778)
+++ trunk/SKPresentationOptionsSheetController.h        2009-09-22 16:27:53 UTC 
(rev 5779)
@@ -37,13 +37,12 @@
  */
 
 #import <Cocoa/Cocoa.h>
-#import "SKSheetController.h"
 #import "SKTransitionController.h"
 #import "SKThumbnailTableView.h"
 
 @class SKMainWindowController, SKMainDocument, SKThumbnail, SKTransitionInfo;
 
-...@interface SKPresentationOptionsSheetController : SKSheetController 
<NSWindowDelegate, SKThumbnailTableViewDelegate, NSTableViewDataSource> {
+...@interface SKPresentationOptionsSheetController : NSWindowController 
<NSWindowDelegate, SKThumbnailTableViewDelegate, NSTableViewDataSource> {
     IBOutlet NSPopUpButton *transitionStylePopUpButton;
     IBOutlet NSTextField *transitionDurationField;
     IBOutlet NSSlider *transitionDurationSlider;

Modified: trunk/SKPresentationOptionsSheetController.m
===================================================================
--- trunk/SKPresentationOptionsSheetController.m        2009-09-22 16:05:06 UTC 
(rev 5778)
+++ trunk/SKPresentationOptionsSheetController.m        2009-09-22 16:27:53 UTC 
(rev 5779)
@@ -48,6 +48,7 @@
 #import "SKMainWindowController.h"
 #import "SKPDFView.h"
 #import "SKPDFToolTipWindow.h"
+#import "NSWindowController_SKExtensions.h"
 
 #define RIGHTARROW_CHARACTER 0x2192
 

Deleted: trunk/SKSheetController.h
===================================================================
--- trunk/SKSheetController.h   2009-09-22 16:05:06 UTC (rev 5778)
+++ trunk/SKSheetController.h   2009-09-22 16:27:53 UTC (rev 5779)
@@ -1,49 +0,0 @@
-//
-//  SKSheetController.h
-//  Skim
-//
-//  Created by Christiaan Hofman on 9/21/07.
-/*
- This software is Copyright (c) 2007-2009
- Christiaan Hofman. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- - Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in
-    the documentation and/or other materials provided with the
-    distribution.
-
- - Neither the name of Christiaan Hofman nor the names of any
-    contributors may be used to endorse or promote products derived
-    from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <Cocoa/Cocoa.h>
-
-
-...@interface SKSheetController : NSWindowController
-
-- (void)beginSheetModalForWindow:(NSWindow *)window modalDelegate:(id)delegate 
didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo;
-
-- (IBAction)dismiss:(id)sender;
-
-...@end
-

Deleted: trunk/SKSheetController.m
===================================================================
--- trunk/SKSheetController.m   2009-09-22 16:05:06 UTC (rev 5778)
+++ trunk/SKSheetController.m   2009-09-22 16:27:53 UTC (rev 5779)
@@ -1,75 +0,0 @@
-//
-//  SKSheetController.m
-//  Skim
-//
-//  Created by Christiaan Hofman on 9/21/07.
-/*
- This software is Copyright (c) 2007-2009
- 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 "SKSheetController.h"
-#import "NSInvocation_SKExtensions.h"
-
-
-...@implementation SKSheetController
-
-- (void)didEndSheet:(NSWindow *)sheet returnCode:(NSInteger)returnCode 
contextInfo:(void *)contextInfo {
-       NSInvocation *invocation = [(NSInvocation *)contextInfo autorelease];
-    if (invocation) {
-               [invocation setArgument:&returnCode atIndex:3];
-               [invocation invoke];
-    }
-}
-
-- (void)beginSheetModalForWindow:(NSWindow *)window modalDelegate:(id)delegate 
didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo {
-    NSInvocation *invocation = nil;
-    if (delegate != nil && didEndSelector != NULL) {
-        invocation = [NSInvocation invocationWithTarget:delegate 
selector:didEndSelector argument:&self];
-               [invocation setArgument:&contextInfo atIndex:4];
-       }
-    
-       [self retain]; // make sure we stay around long enough
-       
-       [NSApp beginSheet:[self window]
-          modalForWindow:window
-               modalDelegate:self
-          didEndSelector:@selector(didEndSheet:returnCode:contextInfo:)
-                 contextInfo:[invocation retain]];
-}
-
-- (IBAction)dismiss:(id)sender {
-    [NSApp endSheet:[self window] returnCode:[sender tag]];
-    [[self window] orderOut:self];
-    [self release];
-}
-
-...@end

Modified: trunk/SKTextFieldSheetController.h
===================================================================
--- trunk/SKTextFieldSheetController.h  2009-09-22 16:05:06 UTC (rev 5778)
+++ trunk/SKTextFieldSheetController.h  2009-09-22 16:27:53 UTC (rev 5779)
@@ -37,10 +37,9 @@
  */
 
 #import <Cocoa/Cocoa.h>
-#import "SKSheetController.h"
 
 
-...@interface SKTextFieldSheetController : SKSheetController {
+...@interface SKTextFieldSheetController : NSWindowController {
     IBOutlet NSTextField *textField;
 }
 

Modified: trunk/SKTextFieldSheetController.m
===================================================================
--- trunk/SKTextFieldSheetController.m  2009-09-22 16:05:06 UTC (rev 5778)
+++ trunk/SKTextFieldSheetController.m  2009-09-22 16:27:53 UTC (rev 5779)
@@ -39,6 +39,7 @@
 #import "SKTextFieldSheetController.h"
 #import "SKBookmarkController.h"
 #import "SKBookmark.h"
+#import "NSWindowController_SKExtensions.h"
 
 
 @implementation SKTextFieldSheetController

Modified: trunk/Skim.xcodeproj/project.pbxproj
===================================================================
--- trunk/Skim.xcodeproj/project.pbxproj        2009-09-22 16:05:06 UTC (rev 
5778)
+++ trunk/Skim.xcodeproj/project.pbxproj        2009-09-22 16:27:53 UTC (rev 
5779)
@@ -188,7 +188,6 @@
                CEAA8EF80EA2A14700C16FE4 /* SKNote.m in Sources */ = {isa = 
PBXBuildFile; fileRef = CEAA8EF60EA2A14700C16FE4 /* SKNote.m */; };
                CEAA8F2F0EA2A86200C16FE4 /* SKNoteText.m in Sources */ = {isa = 
PBXBuildFile; fileRef = CEAA8F2D0EA2A86200C16FE4 /* SKNoteText.m */; };
                CEAE1C480CA1877F00849B0F /* SKSecondaryPDFView.m in Sources */ 
= {isa = PBXBuildFile; fileRef = CEAE1C460CA1877F00849B0F /* 
SKSecondaryPDFView.m */; };
-               CEAE39070CA43E7300849B0F /* SKSheetController.m in Sources */ = 
{isa = PBXBuildFile; fileRef = CEAE39050CA43E7300849B0F /* SKSheetController.m 
*/; };
                CEAF079D0C4139EB00C3ECBB /* SKStatusBar.m in Sources */ = {isa 
= PBXBuildFile; fileRef = CEAF079B0C4139EB00C3ECBB /* SKStatusBar.m */; };
                CEAF2E5A0C45414100C3ECBB /* SKLine.m in Sources */ = {isa = 
PBXBuildFile; fileRef = CEAF2E580C45414100C3ECBB /* SKLine.m */; };
                CEAFFD7C0C40ED5400C3ECBB /* ToolbarColors.tiff in Resources */ 
= {isa = PBXBuildFile; fileRef = CEAFFD7A0C40ED5400C3ECBB /* ToolbarColors.tiff 
*/; };
@@ -833,8 +832,6 @@
                CEAA8F2D0EA2A86200C16FE4 /* SKNoteText.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= SKNoteText.m; sourceTree = "<group>"; };
                CEAE1C450CA1877F00849B0F /* SKSecondaryPDFView.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
SKSecondaryPDFView.h; sourceTree = "<group>"; };
                CEAE1C460CA1877F00849B0F /* SKSecondaryPDFView.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= SKSecondaryPDFView.m; sourceTree = "<group>"; };
-               CEAE39040CA43E7300849B0F /* SKSheetController.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
SKSheetController.h; sourceTree = "<group>"; };
-               CEAE39050CA43E7300849B0F /* SKSheetController.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= SKSheetController.m; sourceTree = "<group>"; };
                CEAF079A0C4139EB00C3ECBB /* SKStatusBar.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
SKStatusBar.h; sourceTree = "<group>"; };
                CEAF079B0C4139EB00C3ECBB /* SKStatusBar.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= SKStatusBar.m; sourceTree = "<group>"; };
                CEAF2E570C45414100C3ECBB /* SKLine.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
SKLine.h; sourceTree = "<group>"; };
@@ -1246,8 +1243,6 @@
                                F97751620B37461000DF673B /* 
SKConversionProgressController.m */,
                                CEF7175D0B90DF10003A2771 /* 
SKReleaseNotesController.h */,
                                CEF7175E0B90DF10003A2771 /* 
SKReleaseNotesController.m */,
-                               CEAE39040CA43E7300849B0F /* SKSheetController.h 
*/,
-                               CEAE39050CA43E7300849B0F /* SKSheetController.m 
*/,
                                4530D7E60B27AAB9007C59F4 /* 
SKSnapshotWindowController.h */,
                                4530D7E70B27AAB9007C59F4 /* 
SKSnapshotWindowController.m */,
                                CE05A86C0E90ED950060BB07 /* 
SKTextFieldSheetController.h */,
@@ -2058,7 +2053,6 @@
                                CE209FAA0C9D38C6007C72F9 /* 
SKProgressController.m in Sources */,
                                CE20B1950C9F23CC007C72F9 /* 
NSView_SKExtensions.m in Sources */,
                                CEAE1C480CA1877F00849B0F /* 
SKSecondaryPDFView.m in Sources */,
-                               CEAE39070CA43E7300849B0F /* SKSheetController.m 
in Sources */,
                                CE8978CE0CBFC70B00EA2D98 /* SKTemplateTag.m in 
Sources */,
                                CEBF85E20CCE2DE70057A050 /* 
NSAffineTransform_SKExtensions.m in Sources */,
                                CE6C96B20CD925550022D69F /* 
SKNotesPanelController.m in Sources */,


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to