From ab99ab06c6a9ed972eb7fe34ec56cedf1482e9ea Mon Sep 17 00:00:00 2001 From: dwetzel Date: Mon, 31 May 2010 03:46:35 +0000 Subject: [PATCH] new Files NSViewController.h and NSViewController.m. Fixes #29822 git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30506 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 ++ Headers/AppKit/AppKit.h | 1 + Headers/AppKit/NSViewController.h | 76 ++++++++++++++++++++ Source/GNUmakefile | 2 + Source/NSViewController.m | 116 ++++++++++++++++++++++++++++++ 5 files changed, 200 insertions(+) create mode 100644 Headers/AppKit/NSViewController.h create mode 100644 Source/NSViewController.m diff --git a/ChangeLog b/ChangeLog index baf5b5988..42148f5d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-05-31 David Wetzel + * Source/NSViewController.m + * Headers/AppKit/NSViewController.h + New files fixes #29822 + 2010-05-31 Wolfgang Lux * Source/NSWindowController.m (-setDocumentEdited:, -setWindow:): diff --git a/Headers/AppKit/AppKit.h b/Headers/AppKit/AppKit.h index d40826c47..ddaefe918 100644 --- a/Headers/AppKit/AppKit.h +++ b/Headers/AppKit/AppKit.h @@ -178,6 +178,7 @@ #import #import #import +#import #import #endif diff --git a/Headers/AppKit/NSViewController.h b/Headers/AppKit/NSViewController.h new file mode 100644 index 000000000..b2ba01056 --- /dev/null +++ b/Headers/AppKit/NSViewController.h @@ -0,0 +1,76 @@ +/* + NSViewController.h + + Copyright (C) 2010 Free Software Foundation, Inc. + +This file is part of the GNUstep GUI Library. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; see the file COPYING.LIB. +If not, see or write to the +Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. +*/ + +#ifndef _GNUstep_H_NSViewController +#define _GNUstep_H_NSViewController + +#import +#import + +@class NSArray, NSBundle, NSPointerArray, NSView; + + +@interface NSViewController : NSResponder +{ +@private + NSString *_nibName; + NSBundle *_nibBundle; + id _representedObject; + NSString *_title; + IBOutlet NSView *view; + NSArray *_topLevelObjects; + NSPointerArray *_editors; + id _autounbinder; + NSString *_designNibBundleIdentifier; + id _reserved[2]; +} + + +- (id)initWithNibName:(NSString *)nibNameOrNil + bundle:(NSBundle *)nibBundleOrNil; + +- (void)setRepresentedObject:(id)representedObject; + +- (id)representedObject; + +- (void)setTitle:(NSString *)title; +- (NSString *)title; + +- (NSView *)view; + +- (NSString *)nibName; +- (NSBundle *)nibBundle; + +- (void)setView:(NSView *)aView; + +- (void)commitEditingWithDelegate:(id)delegate + didCommitSelector:(SEL)didCommitSelector + contextInfo:(void *)contextInfo; + +- (BOOL)commitEditing; +- (void)discardEditing; + +@end + +#endif /* _GNUstep_H_NSViewController */ diff --git a/Source/GNUmakefile b/Source/GNUmakefile index 5fcc2cb74..181285fc7 100644 --- a/Source/GNUmakefile +++ b/Source/GNUmakefile @@ -183,6 +183,7 @@ NSTokenField.m \ NSTokenFieldCell.m \ NSUserDefaultsController.m \ NSView.m \ +NSViewController.m \ NSWindow.m \ NSWindowController.m \ NSWorkspace.m \ @@ -386,6 +387,7 @@ NSTokenField.h \ NSTokenFieldCell.h \ NSUserDefaultsController.h \ NSView.h \ +NSViewController.h \ NSWindow.h \ NSWindowController.h \ NSWorkspace.h \ diff --git a/Source/NSViewController.m b/Source/NSViewController.m new file mode 100644 index 000000000..e7d96cb63 --- /dev/null +++ b/Source/NSViewController.m @@ -0,0 +1,116 @@ +/* + NSViewController.m + + Copyright (C) 2010 Free Software Foundation, Inc. + + This file is part of the GNUstep GUI Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; see the file COPYING.LIB. + If not, see or write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + */ + +#import "AppKit/NSViewController.h" + + +@implementation NSViewController + +- (void) dealloc +{ + DESTROY(_nibName); + DESTROY(_nibBundle); + DESTROY(_representedObject); + DESTROY(_title); + DESTROY(_topLevelObjects); + DESTROY(_editors); + DESTROY(_autounbinder); + DESTROY(_designNibBundleIdentifier); + + [super dealloc]; +} + +- (id)initWithNibName:(NSString *)nibNameOrNil + bundle:(NSBundle *)nibBundleOrNil +{ + [super init]; + + ASSIGN(_nibName, nibNameOrNil); + ASSIGN(_nibBundle, nibBundleOrNil); + + return self; +} + +- (void)setRepresentedObject:(id)representedObject +{ + ASSIGN(_representedObject, representedObject); +} + +- (id)representedObject +{ + return _representedObject; +} + +- (void)setTitle:(NSString *)title +{ + ASSIGN(_title, title); +} + +- (NSString *)title +{ + return _title; +} + +- (NSView *)view +{ + return view; +} + +- (void)setView:(NSView *)aView +{ + view = aView; +} + +- (NSString *)nibName +{ + return _nibName; +} + +- (NSBundle *)nibBundle +{ + return _nibBundle; +} + + +- (void)commitEditingWithDelegate:(id)delegate + didCommitSelector:(SEL)didCommitSelector + contextInfo:(void *)contextInfo +{ + [self notImplemented: _cmd]; +} + +- (BOOL)commitEditing +{ + [self notImplemented: _cmd]; + + return NO; +} + +- (void)discardEditing +{ + [self notImplemented: _cmd]; +} + + +@end