Start of Font Manager changes, and correction to code which makes connections.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@18860 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2004-03-21 15:33:28 +00:00
parent 52db475527
commit edd54b35db
6 changed files with 75 additions and 18 deletions

View file

@ -1,3 +1,17 @@
2004-03-21 10:27 Gregory John Casamento <greg_casamento@yahoo.com>
* GormDocument.[hm]: Initial code changes for new FontManager.
Added code in [GormDocument attachObject:] to update the connection
correctly. Previously the connection were not being created correctly
which require the user to disconnect the existing connection and
reconnect.
* GormObjectEditor.m: Removed the check for NSFont as an object which
can't be removed. It will be possible to remove it once it has no
connections.
* Palettes/0Menus/main.m: Updated some of the connections here so
that they are made properly when added to the document. More work
to come for the new FontManager implementation in Gorm.
2004-03-20 12:07 Gregory John Casamento <greg_casamento@yahoo.com>
* ClassInformation.plist: Removed some methods which should

5
Gorm.m
View file

@ -202,6 +202,7 @@ NSString *GormResizeCellNotification = @"GormResizeCellNotification";
return @"GormNotApplicableInspector";
}
@end
@implementation Gorm
- (id<IBDocuments>) activeDocument
@ -530,9 +531,9 @@ NSString *GormResizeCellNotification = @"GormResizeCellNotification";
forKey: @"ApplicationName"];
[dict setObject: @"[GNUstep | Graphical] Object Relationship Modeller"
forKey: @"ApplicationDescription"];
[dict setObject: @"Gorm 0.7.0 (Beta)"
[dict setObject: @"Gorm 0.7.5 (Beta)"
forKey: @"ApplicationRelease"];
[dict setObject: @"0.7.0 Feb 09 2004"
[dict setObject: @"0.7.5 Mar 21 2004"
forKey: @"FullVersionID"];
[dict setObject: [NSArray arrayWithObjects: @"Gregory John Casamento <greg_casamento@yahoo.com>",
@"Richard Frith-Macdonald <rfm@gnu.org>",

View file

@ -45,17 +45,20 @@
* Each document may have a GormFontManager object that is used as a
* placeholder for the current font manager.
*/
/*
@interface GormFontManager : NSObject
{
}
@end
*/
@interface GormDocument : GSNibContainer <IBDocuments>
{
GormClassManager *classManager;
GormFilesOwner *filesOwner;
GormFirstResponder *firstResponder;
GormFontManager *fontManager;
id *fontManager;
GormClassEditor *classEditor; // perhaps should not be here...
NSString *documentPath;
NSMapTable *objToName;
@ -171,6 +174,10 @@
+ (NSString*) identifierString: (NSString*)str;
+ (NSString *)formatAction: (NSString *)action;
+ (NSString *)formatOutlet: (NSString *)outlet;
// first responder/font manager
- (id) fontManager;
- (id) firstResponder;
@end
@interface GormDocument (MenuValidation)

View file

@ -33,6 +33,7 @@
#include <Foundation/NSUserDefaults.h>
#include <AppKit/NSNibConnector.h>
#include <GNUstepGUI/GSNibTemplates.h>
#include "GormFunctions.h"
@interface GormDisplayCell : NSButtonCell
@end
@ -106,6 +107,7 @@ NSString *GSCustomClassMap = @"GSCustomClassMap";
}
@end
/*
@implementation GormFontManager
- (NSImage*) imageForViewer
{
@ -136,7 +138,12 @@ NSString *GSCustomClassMap = @"GSCustomClassMap";
{
return @"GormNotApplicableInspector";
}
- (NSString *)className
{
return @"NSFontManager";
}
@end
*/
@ -338,13 +345,25 @@ static NSImage *classesImage = nil;
id destination = [anObject target];
NSArray *sourceConnections = [self connectorsForSource: source];
/*
if(destination == nil)
{
if(aParent == nil)
destination = firstResponder;
else
if(aParent != nil)
destination = aParent;
}
*/
// if it's a menu item we want to connect it to it's parent...
if([anObject isKindOfClass: [NSMenuItem class]] &&
[label isEqual: @"submenuAction:"])
{
destination = aParent;
}
// if the destination is still nil, back off to the first responder.
if(destination == nil)
{
destination = firstResponder;
}
// build the connection
[con setSource: source];
@ -442,11 +461,13 @@ static NSImage *classesImage = nil;
[nameTable removeObjectForKey: @"NSOwner"];
NSMapRemove(objToName, (void*)[nameTable objectForKey: @"NSFirst"]);
[nameTable removeObjectForKey: @"NSFirst"];
/*
if (fontManager != nil)
{
NSMapRemove(objToName, (void*)[nameTable objectForKey: @"NSFont"]);
[nameTable removeObjectForKey: @"NSFont"];
}
*/
/* Add information about the NSOwner to the archive */
NSMapInsert(objToName, (void*)[filesOwner className], (void*)@"NSOwner");
@ -743,7 +764,7 @@ static NSImage *classesImage = nil;
RELEASE(hidden);
RELEASE(filesOwner);
RELEASE(firstResponder);
RELEASE(fontManager);
// RELEASE(fontManager);
if (objToName != 0)
{
NSFreeMapTable(objToName);
@ -1400,11 +1421,13 @@ static NSImage *classesImage = nil;
[nameTable setObject: firstResponder forKey: @"NSFirst"];
NSMapInsert(objToName, (void*)firstResponder, (void*)@"NSFirst");
/*
if (fontManager != nil)
{
[nameTable setObject: fontManager forKey: @"NSFont"];
NSMapInsert(objToName, (void*)fontManager, (void*)@"NSFont");
}
*/
/*
* Map all connector source and destination names to their objects.
@ -1826,8 +1849,8 @@ static NSImage *classesImage = nil;
firstResponder = [GormFirstResponder new];
[self setName: @"NSFirst" forObject: firstResponder];
[objectsView addObject: firstResponder];
fontManager = [GormFontManager new];
[self setName: @"NSFont" forObject: fontManager];
// fontManager = [GormFontManager new];
// [self setName: @"NSFont" forObject: fontManager];
// [objectsView addObject: fontManager];
/*
@ -3781,6 +3804,16 @@ shouldEditTableColumn: (NSTableColumn *)tableColumn
return result;
}
- (id) firstResponder
{
return firstResponder;
}
- (id) fontManager
{
return fontManager;
}
@end
@implementation GormDocument (MenuValidation)

View file

@ -127,12 +127,14 @@ static NSMapTable *docMap = 0;
- (void) deleteSelection
{
if (selected != nil
&& [[document nameForObject: selected] isEqualToString: @"NSOwner"] == NO
&& [[document nameForObject: selected] isEqualToString: @"NSFirst"] == NO
&& [[document nameForObject: selected] isEqualToString: @"NSFont"] == NO)
&& [[document nameForObject: selected] isEqualToString: @"NSOwner"] == NO
&& [[document nameForObject: selected] isEqualToString: @"NSFirst"] == NO)
{
NSNotificationCenter *nc;
// && [[document nameForObject: selected] isEqualToString: @"NSFont"] == NO)
// we need to check to see if the NSFont object has any connections...
nc = [NSNotificationCenter defaultCenter];
if ([selected isKindOfClass: [NSMenu class]] &&

View file

@ -53,14 +53,14 @@
*/
m = [GormNSMenu new];
[m addItemWithTitle: @"Info Panel..."
action: @selector(orderFrontStandardInfoPanel:)
keyEquivalent: @""];
action: @selector(orderFrontStandardInfoPanel:)
keyEquivalent: @""];
[m addItemWithTitle: @"Preferences..."
action: NULL
keyEquivalent: @""];
action: NULL
keyEquivalent: @""];
[m addItemWithTitle: @"Help..."
action: NULL
keyEquivalent: @"?"];
action: @selector(orderFrontHelpPanel:)
keyEquivalent: @"?"];
[m setTitle: @"Info"];
i = [[NSMenuItem alloc] initWithTitle: @"Info"
action: @selector(submenuAction:)