PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Tools/nib2cib/NSObjectController.j

http://github.com/cacaodev/cappuccino
Unknown | 67 lines | 53 code | 14 blank | 0 comment | 0 complexity | dd4c264c84ab2bb8f132e796f13de916 MD5 | raw file
 1/*
 2 * NSObjectController.j
 3 * nib2cib
 4 *
 5 * Created by Ross Boucher.
 6 * Copyright 2010, 280 North, Inc.
 7 *
 8 * This library is free software; you can redistribute it and/or
 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23@import <AppKit/CPObjectController.j>
24
25@global CP_NSMapClassName
26
27
28@implementation CPObjectController (NSCoding)
29
30- (id)NS_initWithCoder:(CPCoder)aCoder
31{
32    self = [super init];
33
34    if (self)
35    {
36        _declaredKeys = [aCoder decodeObjectForKey:@"NSDeclaredKeys"];
37
38        var className = [aCoder decodeObjectForKey:@"NSObjectClassName"];
39        if (className)
40            _objectClassName = CP_NSMapClassName(className);
41        else
42            _objectClass = [CPMutableDictionary class];
43
44        _isEditable = [aCoder decodeBoolForKey:@"NSEditable"];
45        _automaticallyPreparesContent = [aCoder decodeBoolForKey:@"NSAutomaticallyPreparesContent"];
46    }
47
48    return self;
49}
50
51@end
52
53@implementation NSObjectController : CPObjectController
54{
55}
56
57- (id)initWithCoder:(CPCoder)aCoder
58{
59    return [self NS_initWithCoder:aCoder];
60}
61
62- (Class)classForKeyedArchiver
63{
64    return [CPObjectController class];
65}
66
67@end