Cleanup classes.

This commit is contained in:
Gregory John Casamento 2023-10-01 07:47:05 -04:00
parent 4bb0270759
commit 791a5d0aaf
3 changed files with 114 additions and 114 deletions

View file

@ -1,29 +1,29 @@
/*
/*
NSViewController.m
Copyright (C) 2010 Free Software Foundation, Inc.
Author: David Wetzel <dave@turbocat.de>
Date: 2010
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 <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSBundle.h>
@ -42,16 +42,16 @@
@implementation NSViewController
- (id)initWithNibName:(NSString *)nibNameOrNil
bundle:(NSBundle *)nibBundleOrNil
- (id)initWithNibName:(NSString *)nibNameOrNil
bundle:(NSBundle *)nibBundleOrNil
{
self = [super init];
if (self == nil)
return nil;
ASSIGN(_nibName, nibNameOrNil);
ASSIGN(_nibBundle, nibBundleOrNil);
return self;
}
@ -69,7 +69,7 @@
DESTROY(_designNibBundleIdentifier);
DESTROY(view);
DESTROY(_segueMap);
[super dealloc];
}
@ -155,9 +155,9 @@
[self viewWillLoad];
[self viewWillAppear: NO];
nib = [[NSNib alloc] initWithNibNamed: [self nibName]
bundle: [self nibBundle]];
bundle: [self nibBundle]];
if ((nib != nil) && [nib instantiateNibWithOwner: self
topLevelObjects: &_topLevelObjects])
topLevelObjects: &_topLevelObjects])
{
_vcFlags.nib_is_loaded = YES;
// FIXME: Need to resolve possible retain cycles here
@ -167,9 +167,9 @@
else
{
if (_nibName != nil)
{
NSLog(@"%@: could not load nib named %@.nib",
[self class], _nibName);
{
NSLog(@"%@: could not load nib named %@.nib",
[self class], _nibName);
}
}
RETAIN(_topLevelObjects);
@ -198,23 +198,23 @@
}
// NSSeguePerforming methods...
- (void)performSegueWithIdentifier: (NSStoryboardSegueIdentifier)identifier
sender: (id)sender
- (void)performSegueWithIdentifier: (NSStoryboardSegueIdentifier)identifier
sender: (id)sender
{
NSStoryboardSegue *segue = [_segueMap objectForKey: identifier];
[self prepareForSegue: segue
sender: sender];
sender: sender];
[segue perform];
}
- (void)prepareForSegue: (NSStoryboardSegue *)segue
sender: (id)sender
- (void)prepareForSegue: (NSStoryboardSegue *)segue
sender: (id)sender
{
// do nothing in base class method...
}
- (BOOL)shouldPerformSegueWithIdentifier: (NSStoryboardSegueIdentifier)identifier
sender: (id)sender
- (BOOL)shouldPerformSegueWithIdentifier: (NSStoryboardSegueIdentifier)identifier
sender: (id)sender
{
return YES;
}
@ -248,7 +248,7 @@
}
return self;
}
- (void) encodeWithCoder: (NSCoder *)aCoder
{
[super encodeWithCoder: aCoder];
@ -279,9 +279,9 @@
@end
@implementation NSViewController (NSEditor)
- (void)commitEditingWithDelegate:(id)delegate
didCommitSelector:(SEL)didCommitSelector
contextInfo:(void *)contextInfo
- (void)commitEditingWithDelegate:(id)delegate
didCommitSelector:(SEL)didCommitSelector
contextInfo:(void *)contextInfo
{
// Loop over all elements of _editors
id editor = nil;
@ -291,11 +291,11 @@
{
void (*didCommit)(id, SEL, id, BOOL, void*);
didCommit = (void (*)(id, SEL, id, BOOL, void*))[delegate methodForSelector:
didCommit = (void (*)(id, SEL, id, BOOL, void*))[delegate methodForSelector:
didCommitSelector];
didCommit(delegate, didCommitSelector, editor, res, contextInfo);
}
}
- (BOOL)commitEditing
@ -312,4 +312,3 @@
[self notImplemented: _cmd];
}
@end