* Plugins/Nib/GNUmakefile: Add new class to makefile.
	* Plugins/Nib/GormNibWrapperLoader.m: Modified to use 
	GormWindowTemplate.
	* Plugins/Nib/GormWindowTemplate.[hm]: Replace flags
	used only at runtime when the template is loaded. This is
	so, for example, the released when closed flag will not cause
	issues when editing the window.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@29168 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2009-12-27 06:16:54 +00:00
parent 07750a7f5f
commit 63a656b958
6 changed files with 106 additions and 15 deletions

View file

@ -1,3 +1,14 @@
2009-12-27 01:17-EST Gregory John Casamento <greg.casamento@gmail.com>
* Gorm.m
* Plugins/Nib/GNUmakefile: Add new class to makefile.
* Plugins/Nib/GormNibWrapperLoader.m: Modified to use
GormWindowTemplate.
* Plugins/Nib/GormWindowTemplate.[hm]: Replace flags
used only at runtime when the template is loaded. This is
so, for example, the released when closed flag will not cause
issues when editing the window.
2009-12-01 Riccardo Mottola <rmottola@users.sf.net>
* Gorm.m: do not open untitled document on application start

2
Gorm.m
View file

@ -177,7 +177,7 @@
- (BOOL)applicationShouldOpenUntitledFile: (NSApplication *)sender
{
return NO;
return YES;
}
- (void) applicationDidFinishLaunching: (NSApplication*)sender

View file

@ -30,7 +30,8 @@ Nib_PRINCIPAL_CLASS = GormNibPlugin
Nib_OBJC_FILES = GormNibPlugin.m \
GormNibWrapperBuilder.m \
GormNibWrapperLoader.m
GormNibWrapperLoader.m \
GormWindowTemplate.m
Nib_RESOURCE_FILES =

View file

@ -1,6 +1,4 @@
/* GormNibWrapperLoader
*
* This class is a subclass of the NSDocumentController
*
* Copyright (C) 2006 Free Software Foundation, Inc.
*
@ -35,17 +33,7 @@
#include <GormCore/GormFunctions.h>
#include <GormCore/GormCustomView.h>
#include "GormNibWrapperLoader.h"
@interface NSWindowTemplate (Private)
- (void) setBaseWindowClass: (Class) clz;
@end
@implementation NSWindowTemplate (Private)
- (void) setBaseWindowClass: (Class) clz
{
_baseWindowClass = clz;
}
@end
#include "GormWindowTemplate.h"
@implementation GormNibWrapperLoader
+ (NSString *) fileType
@ -148,6 +136,8 @@
forClassName: @"NSCustomObject"];
[u setClass: [GormCustomView class]
forClassName: @"NSCustomView"];
[u setClass: [GormWindowTemplate class]
forClassName: @"NSWindowTemplate"];
/*
* Substitute any classes specified by the palettes...

View file

@ -0,0 +1,39 @@
/* GormWindowTemplate
*
* Copyright (C) 2009 Free Software Foundation, Inc.
*
* Author: Gregory John Casamento <greg_casamento@yahoo.com>
* Date: 2009
*
* This file is part of GNUstep.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
*/
#include <Foundation/Foundation.h>
#include <AppKit/AppKit.h>
#include <GNUstepGUI/GSNibLoading.h>
@interface NSWindowTemplate (Private)
- (void) setBaseWindowClass: (Class) clz;
@end
@interface GormWindowTemplate : NSWindowTemplate
{
BOOL _tempFlag;
}
@end

View file

@ -0,0 +1,50 @@
/* GormWindowTemplate
*
* Copyright (C) 2009 Free Software Foundation, Inc.
*
* Author: Gregory John Casamento <greg_casamento@yahoo.com>
* Date: 2009
*
* This file is part of GNUstep.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
*/
#include "GormWindowTemplate.h"
@interface NSWindow (Private)
- (void) _setReleasedWhenClosed: (BOOL)flags;
@end
@implementation NSWindowTemplate (Private)
- (void) setBaseWindowClass: (Class) clz
{
_baseWindowClass = clz;
}
@end
@implementation GormWindowTemplate
- (id) nibInstantiate
{
id object = [super nibInstantiate];
BOOL flag = [object isReleasedWhenClosed];
[object setReleasedWhenClosed: NO];
[object _setReleasedWhenClosed: flag];
return object;
}
@end