root / trunk / AcknowledgmentsController.m

Revision 2, 2.0 kB (checked in by stephen_booth, 3 years ago)

Initial checkin/migration

  • Property svn:keywords set to Id
Line 
1/*
2 *  $Id$
3 *
4 *  Copyright (C) 2005, 2006 Stephen F. Booth <me@sbooth.org>
5 *
6 *  This program is free software; you can redistribute it and/or modify
7 *  it under the terms of the GNU General Public License as published by
8 *  the Free Software Foundation; either version 2 of the License, or
9 *  (at your option) any later version.
10 *
11 *  This program is distributed in the hope that it will be useful,
12 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 *  GNU General Public License for more details.
15 *
16 *  You should have received a copy of the GNU General Public License
17 *  along with this program; if not, write to the Free Software
18 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20
21#import "AcknowledgmentsController.h"
22
23static AcknowledgmentsController *sharedController = nil;
24
25@implementation AcknowledgmentsController
26
27+ (AcknowledgmentsController *) sharedController
28{
29        @synchronized(self) {
30                if(nil == sharedController) {
31                        sharedController = [[self alloc] init];
32                }
33        }
34        return sharedController;
35}
36
37+ (id) allocWithZone:(NSZone *)zone
38{
39    @synchronized(self) {
40        if(nil == sharedController) {
41            return [super allocWithZone:zone];
42        }
43    }
44    return sharedController;
45}
46
47- (id)init
48{
49        if((self = [super initWithWindowNibName:@"Acknowledgments"])) {
50                return self;
51        }
52        return nil;
53}
54
55- (void) awakeFromNib
56{
57        NSBundle        *bundle         = [NSBundle bundleForClass:[self class]];
58        NSString        *path           = [bundle pathForResource:@"Acknowledgments" ofType:@"rtf"];
59        if(nil != path) {
60                [_text readRTFDFromFile:path];
61        }       
62}
63
64- (void) windowDidLoad
65{
66        [self setShouldCascadeWindows:NO];
67        [self setWindowFrameAutosaveName:@"Acknowledgments"];   
68}
69
70- (id)                          copyWithZone:(NSZone *)zone                                     { return self; }
71- (id)                          retain                                                                          { return self; }
72- (unsigned)            retainCount                                                                     { return UINT_MAX;  /* denotes an object that cannot be released */ }
73- (void)                        release                                                                         { /* do nothing */ }
74- (id)                          autorelease                                                                     { return self; }
75
76@end
Note: See TracBrowser for help on using the browser.