Merge branch 'master' into implement_bindings

This commit is contained in:
Gregory John Casamento 2023-12-17 14:12:08 -05:00
commit ef2e4d9336
107 changed files with 1636 additions and 1094 deletions

View file

@ -50,7 +50,7 @@ SVN_MODULE_NAME = gorm
SVN_BASE_URL = svn+ssh://svn.gna.org/svn/gnustep/apps
include ./Version
include ../../Version
#
# Each palette is a subproject

View file

@ -118,7 +118,7 @@
if(active != nil)
{
cm = [active classManager];
s = [selectionOwner selection];
s = [_selectionOwner selection];
}
if(sel_isEqual(action, @selector(loadPalette:)))
@ -156,7 +156,7 @@
}
}
return [selectionOwner respondsToSelector: @selector(copySelection)];
return [_selectionOwner respondsToSelector: @selector(copySelection)];
}
else if (sel_isEqual(action, @selector(cut:)))
{
@ -174,8 +174,8 @@
}
}
return ([selectionOwner respondsToSelector: @selector(copySelection)]
&& [selectionOwner respondsToSelector: @selector(deleteSelection)]);
return ([_selectionOwner respondsToSelector: @selector(copySelection)]
&& [_selectionOwner respondsToSelector: @selector(deleteSelection)]);
}
else if (sel_isEqual(action, @selector(delete:)))
{
@ -193,7 +193,7 @@
}
}
return [selectionOwner respondsToSelector: @selector(deleteSelection)];
return [_selectionOwner respondsToSelector: @selector(deleteSelection)];
}
else if (sel_isEqual(action, @selector(paste:)))
{
@ -212,7 +212,7 @@
}
}
return [selectionOwner respondsToSelector: @selector(pasteInSelection)];
return [_selectionOwner respondsToSelector: @selector(pasteInSelection)];
}
else if (sel_isEqual(action, @selector(setName:)))
{
@ -259,7 +259,7 @@
if(sel_isEqual(action, @selector(createSubclass:)))
{
NSArray *s = [selectionOwner selection];
NSArray *s = [_selectionOwner selection];
id o = nil;
NSString *name = nil;
@ -345,7 +345,7 @@
- (IBAction) stop: (id)sender
{
if(isTesting == NO)
if(_isTesting == NO)
{
// [super stop: sender];
}
@ -365,12 +365,12 @@
/** Info Menu Actions */
- (IBAction) preferencesPanel: (id) sender
{
if(! preferencesController)
if(! _preferencesController)
{
preferencesController = [[GormPrefController alloc] init];
_preferencesController = [[GormPrefController alloc] init];
}
[[preferencesController panel] makeKeyAndOrderFront:nil];
[[_preferencesController panel] makeKeyAndOrderFront:nil];
}
/** Document Menu Actions */
@ -403,8 +403,8 @@
- (IBAction) copy: (id)sender
{
if ([[selectionOwner selection] count] == 0
|| [selectionOwner respondsToSelector: @selector(copySelection)] == NO)
if ([[_selectionOwner selection] count] == 0
|| [_selectionOwner respondsToSelector: @selector(copySelection)] == NO)
return;
if([self isConnecting])
@ -412,15 +412,15 @@
[self stopConnecting];
}
[(id<IBSelectionOwners,IBEditors>)selectionOwner copySelection];
[(id<IBSelectionOwners,IBEditors>)_selectionOwner copySelection];
}
- (IBAction) cut: (id)sender
{
if ([[selectionOwner selection] count] == 0
|| [selectionOwner respondsToSelector: @selector(copySelection)] == NO
|| [selectionOwner respondsToSelector: @selector(deleteSelection)] == NO)
if ([[_selectionOwner selection] count] == 0
|| [_selectionOwner respondsToSelector: @selector(copySelection)] == NO
|| [_selectionOwner respondsToSelector: @selector(deleteSelection)] == NO)
return;
if([self isConnecting])
@ -428,13 +428,13 @@
[self stopConnecting];
}
[(id<IBSelectionOwners,IBEditors>)selectionOwner copySelection];
[(id<IBSelectionOwners,IBEditors>)selectionOwner deleteSelection];
[(id<IBSelectionOwners,IBEditors>)_selectionOwner copySelection];
[(id<IBSelectionOwners,IBEditors>)_selectionOwner deleteSelection];
}
- (IBAction) paste: (id)sender
{
if ([selectionOwner respondsToSelector: @selector(pasteInSelection)] == NO)
if ([_selectionOwner respondsToSelector: @selector(pasteInSelection)] == NO)
return;
if([self isConnecting])
@ -442,14 +442,14 @@
[self stopConnecting];
}
[(id<IBSelectionOwners,IBEditors>)selectionOwner pasteInSelection];
[(id<IBSelectionOwners,IBEditors>)_selectionOwner pasteInSelection];
}
- (IBAction) delete: (id)sender
{
if ([[selectionOwner selection] count] == 0
|| [selectionOwner respondsToSelector: @selector(deleteSelection)] == NO)
if ([[_selectionOwner selection] count] == 0
|| [_selectionOwner respondsToSelector: @selector(deleteSelection)] == NO)
return;
if([self isConnecting])
@ -457,13 +457,13 @@
[self stopConnecting];
}
[(id<IBSelectionOwners,IBEditors>)selectionOwner deleteSelection];
[(id<IBSelectionOwners,IBEditors>)_selectionOwner deleteSelection];
}
- (IBAction) selectAll: (id)sender
{
if ([[selectionOwner selection] count] == 0
|| [selectionOwner respondsToSelector: @selector(deleteSelection)] == NO)
if ([[_selectionOwner selection] count] == 0
|| [_selectionOwner respondsToSelector: @selector(deleteSelection)] == NO)
return;
if([self isConnecting])
@ -471,7 +471,7 @@
[self stopConnecting];
}
[(id<IBSelectionOwners,IBEditors>)selectionOwner deleteSelection];
[(id<IBSelectionOwners,IBEditors>)_selectionOwner deleteSelection];
}
- (IBAction) selectAllItems: (id)sender
@ -483,47 +483,47 @@
- (IBAction) groupSelectionInSplitView: (id)sender
{
if ([[selectionOwner selection] count] < 2
|| [selectionOwner respondsToSelector: @selector(groupSelectionInSplitView)] == NO)
if ([[_selectionOwner selection] count] < 2
|| [_selectionOwner respondsToSelector: @selector(groupSelectionInSplitView)] == NO)
return;
[(GormGenericEditor *)selectionOwner groupSelectionInSplitView];
[(GormGenericEditor *)_selectionOwner groupSelectionInSplitView];
}
- (IBAction) groupSelectionInBox: (id)sender
{
if ([selectionOwner respondsToSelector: @selector(groupSelectionInBox)] == NO)
if ([_selectionOwner respondsToSelector: @selector(groupSelectionInBox)] == NO)
return;
[(GormGenericEditor *)selectionOwner groupSelectionInBox];
[(GormGenericEditor *)_selectionOwner groupSelectionInBox];
}
- (IBAction) groupSelectionInView: (id)sender
{
if ([selectionOwner respondsToSelector: @selector(groupSelectionInView)] == NO)
if ([_selectionOwner respondsToSelector: @selector(groupSelectionInView)] == NO)
return;
[(GormGenericEditor *)selectionOwner groupSelectionInView];
[(GormGenericEditor *)_selectionOwner groupSelectionInView];
}
- (IBAction) groupSelectionInScrollView: (id)sender
{
if ([selectionOwner respondsToSelector: @selector(groupSelectionInScrollView)] == NO)
if ([_selectionOwner respondsToSelector: @selector(groupSelectionInScrollView)] == NO)
return;
[(GormGenericEditor *)selectionOwner groupSelectionInScrollView];
[(GormGenericEditor *)_selectionOwner groupSelectionInScrollView];
}
- (IBAction) groupSelectionInMatrix: (id)sender
{
if ([selectionOwner respondsToSelector: @selector(groupSelectionInMatrix)] == NO)
if ([_selectionOwner respondsToSelector: @selector(groupSelectionInMatrix)] == NO)
return;
[(GormGenericEditor *)selectionOwner groupSelectionInMatrix];
[(GormGenericEditor *)_selectionOwner groupSelectionInMatrix];
}
- (IBAction) ungroup: (id)sender
{
// NSLog(@"ungroup: selectionOwner %@", selectionOwner);
if ([selectionOwner respondsToSelector: @selector(ungroup)] == NO)
// NSLog(@"ungroup: _selectionOwner %@", _selectionOwner);
if ([_selectionOwner respondsToSelector: @selector(ungroup)] == NO)
return;
[(GormGenericEditor *)selectionOwner ungroup];
[(GormGenericEditor *)_selectionOwner ungroup];
}
/** Classes actions */

View file

@ -3,17 +3,17 @@ ADDITIONAL_INCLUDE_DIRS += -I../../../..
ifeq ($(GNUSTEP_TARGET_OS),mingw32)
ADDITIONAL_LIB_DIRS += \
-L../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../GormCore/GormCore.framework
-L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../../GormCore/GormCore.framework
ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormCore
endif
ifeq ($(GNUSTEP_TARGET_OS),cygwin)
ADDITIONAL_LIB_DIRS += \
-L../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../GormCore/GormCore.framework
-L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../../GormCore/GormCore.framework
$(PALETTE_NAME)_LIBRARIES_DEPEND_UPON += -lInterfaceBuilder -lGormCore
endif

View file

@ -3,17 +3,17 @@ ADDITIONAL_INCLUDE_DIRS += -I../../../..
ifeq ($(GNUSTEP_TARGET_OS),mingw32)
ADDITIONAL_LIB_DIRS += \
-L../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../GormCore/GormCore.framework
-L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../../GormCore/GormCore.framework
ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormCore
endif
ifeq ($(GNUSTEP_TARGET_OS),cygwin)
ADDITIONAL_LIB_DIRS += \
-L../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../GormCore/GormCore.framework
-L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../../GormCore/GormCore.framework
$(PALETTE_NAME)_LIBRARIES_DEPEND_UPON += -lInterfaceBuilder -lGormCore
endif

View file

@ -3,17 +3,17 @@ ADDITIONAL_INCLUDE_DIRS += -I../../../..
ifeq ($(GNUSTEP_TARGET_OS),mingw32)
ADDITIONAL_LIB_DIRS += \
-L../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../GormCore/GormCore.framework
-L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../../GormCore/GormCore.framework
ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormCore
endif
ifeq ($(GNUSTEP_TARGET_OS),cygwin)
ADDITIONAL_LIB_DIRS += \
-L../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../GormCore/GormCore.framework
-L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../../GormCore/GormCore.framework
$(PALETTE_NAME)_LIBRARIES_DEPEND_UPON += -lInterfaceBuilder -lGormCore
endif

View file

@ -3,17 +3,17 @@ ADDITIONAL_INCLUDE_DIRS += -I../../../..
ifeq ($(GNUSTEP_TARGET_OS),mingw32)
ADDITIONAL_LIB_DIRS += \
-L../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../GormCore/GormCore.framework
-L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../../GormCore/GormCore.framework
ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormCore
endif
ifeq ($(GNUSTEP_TARGET_OS),cygwin)
ADDITIONAL_LIB_DIRS += \
-L../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../GormCore/GormCore.framework
-L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../../GormCore/GormCore.framework
$(PALETTE_NAME)_LIBRARIES_DEPEND_UPON += -lInterfaceBuilder -lGormCore
endif

View file

@ -3,17 +3,17 @@ ADDITIONAL_INCLUDE_DIRS += -I../../../..
ifeq ($(GNUSTEP_TARGET_OS),mingw32)
ADDITIONAL_LIB_DIRS += \
-L../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../GormCore/GormCore.framework
-L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../../GormCore/GormCore.framework
ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormCore
endif
ifeq ($(GNUSTEP_TARGET_OS),cygwin)
ADDITIONAL_LIB_DIRS += \
-L../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../GormCore/GormCore.framework
-L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../../GormCore/GormCore.framework
$(PALETTE_NAME)_LIBRARIES_DEPEND_UPON += -lInterfaceBuilder -lGormCore
endif

View file

@ -15,15 +15,11 @@ before-all:: version.texi
autogsdoc -MakeFrames YES \
-DocumentationDirectory InterfaceBuilder \
-Declared InterfaceBuilder \
../GormLib/*.h 2> /dev/null
../InterfaceBuilder/*.h 2> /dev/null
autogsdoc -MakeFrames YES \
-DocumentationDirectory GormCore \
-Declared GormCore \
../GormCore/*.h 2> /dev/null
autogsdoc -MakeFrames YES \
-DocumentationDirectory GormPrefs \
-Declared GormPrefs \
../GormPrefs/*.h 2> /dev/null
autogsdoc -MakeFrames YES \
-DocumentationDirectory GormObjCHeaderParser \
-Declared GormObjCHeaderParser \
@ -53,7 +49,6 @@ after-clean::
rm -f version.texi
rm -rf InterfaceBuilder
rm -rf GormCore
rm -rf GormPrefs
rm -rf GormObjCHeaderParser
# Things to do before distcleaning
@ -79,5 +74,3 @@ version.texi: ../Version
regenerate:
mv ANNOUNCE README INSTALL NEWS ..

3
Documentation/README.md Normal file
View file

@ -0,0 +1,3 @@
# Documentation directory
This directory contains documentation for the Gorm application as well as the frameworks used in it's functionality.

View file

@ -54,8 +54,9 @@ SVN_BASE_URL = svn+ssh://svn.gna.org/svn/gnustep/apps
#
SUBPROJECTS = \
InterfaceBuilder \
GormCore \
GormObjCHeaderParser \
GormCore \
Plugins \
Applications \
Tools

8
GNUmakefile.postamble Normal file
View file

@ -0,0 +1,8 @@
# GNUmakefile -- copy all plugins
after-all::
echo "Copying Plugins..."
cp -r Plugins/GModel/*.plugin GormCore/GormCore.framework/Resources
cp -r Plugins/Gorm/*.plugin GormCore/GormCore.framework/Resources
cp -r Plugins/Nib/*.plugin GormCore/GormCore.framework/Resources
cp -r Plugins/Xib/*.plugin GormCore/GormCore.framework/Resources

View file

@ -28,18 +28,18 @@
"selectAction:"
);
Outlets = (
classField,
tabView,
removeOutlet,
addAction,
actionTable,
outletTable,
removeAction,
addOutlet,
selectClass,
parentClass,
search,
searchText
"_classField",
"_tabView",
"_removeOutlet",
"_addAction",
"_actionTable",
"_outletTable",
"_removeAction",
"_addOutlet",
"_selectClass",
"_parentClass",
"_search",
"_searchText"
);
Super = IBInspector;
};

View file

@ -31,12 +31,10 @@ include $(GNUSTEP_MAKEFILES)/common.make
PACKAGE_NAME=GormCore
FRAMEWORK_VAR=GORMCORE
FRAMEWORK_NAME=GormCore
GormCore_HEADER_FILES_DIR=.
GormCore_HEADER_FILES_INSTALL_DIR=/GormCore
ADDITIONAL_INCLUDE_DIRS = -I..
srcdir = .
SUBPROJECTS = Plugins
SUBPROJECTS =
GormCore_HEADER_FILES = \
GormCore.h \
@ -190,10 +188,6 @@ GormCore_OBJC_FILES = \
GormXLIFFDocument.m
GormCore_RESOURCE_FILES = \
Plugins/Gorm/Gorm.plugin \
Plugins/Nib/Nib.plugin \
Plugins/Xib/Xib.plugin \
Plugins/GModel/GModel.plugin \
Images/GormActionSelected.tiff \
Images/GormAction.tiff \
Images/GormClass.tiff \

View file

@ -22,11 +22,19 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
#
ADDITIONAL_INCLUDE_DIRS += \
-I../InterfaceBuilder
ADDITIONAL_INCLUDE_DIRS += -I../..
# ADDITIONAL_GUI_LIBS += \
# -lInterfaceBuilder
ifeq ($(GNUSTEP_TARGET_OS),mingw32)
ADDITIONAL_LIB_DIRS += \
-L../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
#ADDITIONAL_LIB_DIRS += \
# -L../InterfaceBuilder/$(GNUSTEP_OBJ_DIR)
ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormObjCHeaderParser
endif
ifeq ($(GNUSTEP_TARGET_OS),cygwin)
ADDITIONAL_LIB_DIRS += \
-L../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
$(BUNDLE_NAME)_LIBRARIES_DEPEND_UPON += -lInterfaceBuilder -lGormObjCHeaderParser
endif

View file

@ -45,32 +45,32 @@
@interface GormAbstractDelegate : NSObject <IB, GormAppDelegate, GormServer>
{
IBOutlet id gormMenu;
IBOutlet id guideLineMenuItem;
IBOutlet id _gormMenu;
IBOutlet id _guideLineMenuItem;
GormPrefController *preferencesController;
GormClassManager *classManager;
GormInspectorsManager *inspectorsManager;
GormPalettesManager *palettesManager;
GormPluginManager *pluginManager;
id<IBSelectionOwners> selectionOwner;
BOOL isConnecting;
BOOL isTesting;
id testContainer;
NSMenu *mainMenu; // saves the main menu...
NSMenu *servicesMenu; // saves the services menu...
NSMenu *classMenu; // so we can set it for the class view
NSDictionary *menuLocations;
NSImage *linkImage;
NSImage *sourceImage;
NSImage *targetImage;
NSImage *gormImage;
NSImage *testingImage;
id connectSource;
id connectDestination;
NSMutableArray *testingWindows;
NSSet *topObjects;
NSDockTile *dockTile;
GormPrefController *_preferencesController;
GormClassManager *_classManager;
GormInspectorsManager *_inspectorsManager;
GormPalettesManager *_palettesManager;
GormPluginManager *_pluginManager;
id<IBSelectionOwners> _selectionOwner;
BOOL _isConnecting;
BOOL _isTesting;
id _testContainer;
NSMenu *_mainMenu; // saves the main menu...
NSMenu *_servicesMenu; // saves the services menu...
NSMenu *_classMenu; // so we can set it for the class view
NSDictionary *_menuLocations;
NSImage *_linkImage;
NSImage *_sourceImage;
NSImage *_targetImage;
NSImage *_gormImage;
NSImage *_testingImage;
id _connectSource;
id _connectDestination;
NSMutableArray *_testingWindows;
NSSet *_topObjects;
NSDockTile *_dockTile;
}
// testing the interface
@ -78,6 +78,10 @@
- (IBAction) testInterface: (id)sender;
- (IBAction) endTesting: (id)sender;
// Testing...
- (void) setTestingInterface: (BOOL)testing;
- (BOOL) isTestingInterface;
@end
#endif // import guard

View file

@ -61,16 +61,19 @@
if ([self isInTool] == NO)
{
path = [bundle pathForImageResource: @"GormLinkImage"];
linkImage = [[NSImage alloc] initWithContentsOfFile: path];
_linkImage = [[NSImage alloc] initWithContentsOfFile: path];
path = [bundle pathForImageResource: @"GormSourceTag"];
sourceImage = [[NSImage alloc] initWithContentsOfFile: path];
_sourceImage = [[NSImage alloc] initWithContentsOfFile: path];
path = [bundle pathForImageResource: @"GormTargetTag"];
targetImage = [[NSImage alloc] initWithContentsOfFile: path];
_targetImage = [[NSImage alloc] initWithContentsOfFile: path];
path = [bundle pathForImageResource: @"Gorm"];
gormImage = [[NSImage alloc] initWithContentsOfFile: path];
_gormImage = [[NSImage alloc] initWithContentsOfFile: path];
path = [bundle pathForImageResource: @"GormTesting"];
testingImage = [[NSImage alloc] initWithContentsOfFile: path];
_testingImage = [[NSImage alloc] initWithContentsOfFile: path];
}
// Initialize ivars
_isTesting = NO;
// regular notifications...
[nc addObserver: self
@ -143,9 +146,9 @@
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc removeObserver: self];
RELEASE(inspectorsManager);
RELEASE(palettesManager);
RELEASE(classManager);
RELEASE(_inspectorsManager);
RELEASE(_palettesManager);
RELEASE(_classManager);
[super dealloc];
}
@ -274,22 +277,22 @@
if (document != nil) return [document classManager];
/* kept in the case one want access to the classManager without document */
else if (classManager == nil)
else if (_classManager == nil)
{
classManager = [[GormClassManager alloc] init];
_classManager = [[GormClassManager alloc] init];
}
return classManager;
return _classManager;
}
- (id) connectDestination
{
return connectDestination;
return _connectDestination;
}
- (id) connectSource
{
return connectSource;
return _connectSource;
}
- (void) displayConnectionBetween: (id)source
@ -299,12 +302,12 @@
NSRect rect;
if (source != connectSource)
if (source != _connectSource)
{
if (connectSource != nil)
if (_connectSource != nil)
{
window = [(GormDocument *)[self activeDocument] windowAndRect: &rect
forObject: connectSource];
forObject: _connectSource];
if (window != nil)
{
NSView *view = [[window contentView] superview];
@ -321,14 +324,14 @@
[window flushWindow];
}
}
connectSource = source;
_connectSource = source;
}
if (destination != connectDestination)
if (destination != _connectDestination)
{
if (connectDestination != nil)
if (_connectDestination != nil)
{
window = [(GormDocument *)[self activeDocument] windowAndRect: &rect
forObject: connectDestination];
forObject: _connectDestination];
if (window != nil)
{
NSView *view = [[window contentView] superview];
@ -346,11 +349,11 @@
[window flushWindow];
}
}
connectDestination = destination;
_connectDestination = destination;
}
if (connectSource != nil)
if (_connectSource != nil)
{
window = [(GormDocument *)[self activeDocument] windowAndRect: &rect forObject: connectSource];
window = [(GormDocument *)[self activeDocument] windowAndRect: &rect forObject: _connectSource];
if (window != nil)
{
NSView *view = [[window contentView] superview];
@ -363,16 +366,16 @@
[[NSColor greenColor] set];
NSFrameRectWithWidth(rect, 1);
[sourceImage compositeToPoint: imageRect.origin
operation: NSCompositeSourceOver];
[_sourceImage compositeToPoint: imageRect.origin
operation: NSCompositeSourceOver];
[view unlockFocus];
[window flushWindow];
}
}
if (connectDestination != nil && connectDestination == connectSource)
if (_connectDestination != nil && _connectDestination == _connectSource)
{
window = [(GormDocument *)[self activeDocument] windowAndRect: &rect
forObject: connectDestination];
forObject: _connectDestination];
if (window != nil)
{
NSView *view = [[window contentView] superview];
@ -386,17 +389,17 @@
[[NSColor purpleColor] set];
NSFrameRectWithWidth(rect, 1);
imageRect.origin.x += [targetImage size].width;
[targetImage compositeToPoint: imageRect.origin
operation: NSCompositeSourceOver];
imageRect.origin.x += [_targetImage size].width;
[_targetImage compositeToPoint: imageRect.origin
operation: NSCompositeSourceOver];
[view unlockFocus];
[window flushWindow];
}
}
else if (connectDestination != nil)
else if (_connectDestination != nil)
{
window = [(GormDocument *)[self activeDocument] windowAndRect: &rect
forObject: connectDestination];
forObject: _connectDestination];
if (window != nil)
{
NSView *view = [[window contentView] superview];
@ -409,8 +412,8 @@
[[NSColor purpleColor] set];
NSFrameRectWithWidth(rect, 1);
[targetImage compositeToPoint: imageRect.origin
operation: NSCompositeSourceOver];
[_targetImage compositeToPoint: imageRect.origin
operation: NSCompositeSourceOver];
[view unlockFocus];
[window flushWindow];
}
@ -419,7 +422,7 @@
- (IBAction) testInterface: (id)sender
{
if (isTesting == NO)
if (_isTesting == NO || [self isInTool])
{
// top level objects
NS_DURING
@ -430,7 +433,7 @@
NSData *data;
NSArchiver *archiver;
NSEnumerator *en;
NSDictionary *substituteClasses = [palettesManager substituteClasses];
NSDictionary *substituteClasses = [_palettesManager substituteClasses];
NSString *subClassName;
id obj;
id savedDelegate = [NSApp delegate];
@ -438,46 +441,53 @@
// which windows were open when testing started...
testingWindows = [[NSMutableArray alloc] init];
_testingWindows = [[NSMutableArray alloc] init];
en = [[NSApp windows] objectEnumerator];
while((obj = [en nextObject]) != nil)
{
if([obj isVisible])
{
[testingWindows addObject: obj];
[_testingWindows addObject: obj];
if ([activeDoc window] != obj)
{
[obj close]; // close the visible windows...
}
}
}
// set here, so that beginArchiving and endArchiving do not use templates.
isTesting = YES;
// [NSApp setApplicationIconImage: testingImage];
_isTesting = YES;
// [NSApp setApplicationIconImage: _testingImage];
// Set up the dock tile...
dockTile = [[NSDockTile alloc] init];
[dockTile setShowsApplicationBadge: YES];
[dockTile setBadgeLabel: @"Test!"];
_dockTile = [[NSDockTile alloc] init];
[_dockTile setShowsApplicationBadge: YES];
[_dockTile setBadgeLabel: @"Test!"];
// Encode palette classes with their equivalent substitutes
archiver = [[NSArchiver alloc] init];
[activeDoc deactivateEditors];
[archiver encodeClassName: @"GormCustomView"
intoClassName: @"GormTestCustomView"];
// substitute classes from palettes.
en = [substituteClasses keyEnumerator];
while((subClassName = [en nextObject]) != nil)
if ([self isInTool] == NO)
{
NSString *realClassName = [substituteClasses objectForKey: subClassName];
[archiver encodeClassName: @"GormCustomView"
intoClassName: @"GormTestCustomView"];
if([realClassName isEqualToString: @"NSTableView"] ||
[realClassName isEqualToString: @"NSOutlineView"] ||
[realClassName isEqualToString: @"NSBrowser"])
// substitute classes from palettes.
en = [substituteClasses keyEnumerator];
while((subClassName = [en nextObject]) != nil)
{
continue;
NSString *realClassName = [substituteClasses objectForKey: subClassName];
if([realClassName isEqualToString: @"NSTableView"] ||
[realClassName isEqualToString: @"NSOutlineView"] ||
[realClassName isEqualToString: @"NSBrowser"])
{
continue;
}
[archiver encodeClassName: subClassName
intoClassName: realClassName];
}
[archiver encodeClassName: subClassName
intoClassName: realClassName];
}
// do not allow custom classes during testing.
@ -492,45 +502,55 @@
[notifCenter postNotificationName: IBWillBeginTestingInterfaceNotification
object: self];
if ([selectionOwner conformsToProtocol: @protocol(IBEditors)] == YES)
if ([_selectionOwner conformsToProtocol: @protocol(IBEditors)] == YES)
{
[selectionOwner makeSelectionVisible: NO];
[_selectionOwner makeSelectionVisible: NO];
}
defaults = [NSUserDefaults standardUserDefaults];
menuLocations = [[defaults objectForKey: @"NSMenuLocations"] copy];
_menuLocations = [[defaults objectForKey: @"NSMenuLocations"] copy];
[defaults removeObjectForKey: @"NSMenuLocations"];
servicesMenu = [NSApp servicesMenu];
_servicesMenu = [NSApp servicesMenu];
testContainer = [NSUnarchiver unarchiveObjectWithData: data];
if (testContainer != nil)
_testContainer = [NSUnarchiver unarchiveObjectWithData: data];
if (_testContainer != nil)
{
NSMutableDictionary *nameTable = [testContainer nameTable];
NSMutableDictionary *nameTable = [_testContainer nameTable];
NSMenu *aMenu = [nameTable objectForKey: @"NSMenu"];
mainMenu = [NSApp mainMenu]; // save the menu before testing...
_mainMenu = [NSApp mainMenu]; // save the menu before testing...
[[NSApp mainMenu] close];
[NSApp setMainMenu: aMenu];
// initialize the context.
RETAIN(testContainer);
topObjects = [testContainer topLevelObjects];
RETAIN(_testContainer);
_topObjects = [_testContainer topLevelObjects];
[nameTable removeObjectForKey: @"NSServicesMenu"];
[nameTable removeObjectForKey: @"NSWindowsMenu"];
[testContainer awakeWithContext: nil];
[_testContainer awakeWithContext: nil];
[NSApp setDelegate: savedDelegate]; // makes sure the delegate isn't reset.
/*
* If the model didn't have a main menu, create one,
* otherwise, ensure that 'quit' ends testing mode.
*/
SEL endSelector = NULL;
endSelector = @selector(deferredEndTesting:);
if ([self isInTool])
{
endSelector = @selector(endTestingNow:);
}
if (aMenu == nil)
{
NSMenu *testMenu;
testMenu = [[NSMenu alloc] initWithTitle: _(@"Test Menu (Gorm)")];
[testMenu addItemWithTitle: _(@"Quit Test")
action: @selector(deferredEndTesting:)
action: endSelector
keyEquivalent: @"q"];
[NSApp setMainMenu: testMenu]; // released, when the menu is reset in endTesting.
}
@ -553,7 +573,7 @@
found = YES;
[item setTitle: _(@"Quit Test")];
[item setTarget: self];
[item setAction: @selector(deferredEndTesting:)];
[item setAction: endSelector];
}
}
}
@ -566,8 +586,8 @@
if(found == NO)
{
[testMenu addItemWithTitle: _(@"Quit Test")
action: @selector(deferredEndTesting:)
keyEquivalent: @"q"];
action: endSelector
keyEquivalent: @"q"];
}
}
@ -615,7 +635,7 @@
GormSetNameController *panel;
int returnPanel;
NSTextField *textField;
NSArray *selectionArray = [selectionOwner selection];
NSArray *selectionArray = [_selectionOwner selection];
id obj = [selectionArray objectAtIndex: 0];
NSString *name;
@ -641,15 +661,15 @@
{
[[NSNotificationCenter defaultCenter] postNotificationName: GormToggleGuidelineNotification
object:nil];
if ( [guideLineMenuItem tag] == 0 )
if ( [_guideLineMenuItem tag] == 0 )
{
[guideLineMenuItem setTitle:_(@"Turn GuideLine On")];
[guideLineMenuItem setTag:1];
[_guideLineMenuItem setTitle:_(@"Turn GuideLine On")];
[_guideLineMenuItem setTag:1];
}
else if ( [guideLineMenuItem tag] == 1)
else if ( [_guideLineMenuItem tag] == 1)
{
[guideLineMenuItem setTitle:_(@"Turn GuideLine Off")];
[guideLineMenuItem setTag:0];
[_guideLineMenuItem setTitle:_(@"Turn GuideLine Off")];
[_guideLineMenuItem setTag:0];
}
}
@ -663,6 +683,10 @@
}
/** Testing methods... */
- (IBAction) endTestingNow: (id)sender
{
[NSApp terminate: self];
}
- (IBAction) deferredEndTesting: (id) sender
{
@ -679,7 +703,7 @@
- (IBAction) endTesting: (id)sender
{
if (isTesting)
if (_isTesting)
{
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
NSUserDefaults *defaults;
@ -692,7 +716,7 @@
/*
* Make sure windows will go away when the container is destroyed.
*/
e = [topObjects objectEnumerator];
e = [_topObjects objectEnumerator];
while ((val = [e nextObject]) != nil)
{
if ([val isKindOfClass: [NSWindow class]] == YES)
@ -708,7 +732,7 @@
e = [[NSApp windows] objectEnumerator];
while ((val = [e nextObject]) != nil)
{
if ([testingWindows containsObject: val] == NO &&
if ([_testingWindows containsObject: val] == NO &&
[val isKindOfClass: [NSWindow class]] &&
[val isVisible])
{
@ -716,21 +740,22 @@
}
}
// prevent saving of this, if the menuLocations have not previously been set.
if(menuLocations != nil)
// prevent saving of this, if the _menuLocations have not previously been set.
if(_menuLocations != nil)
{
defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject: menuLocations forKey: @"NSMenuLocations"];
DESTROY(menuLocations);
[defaults setObject: _menuLocations forKey: @"NSMenuLocations"];
DESTROY(_menuLocations);
}
// Restore windows and menus...
[NSApp setMainMenu: mainMenu];
[NSApp setApplicationIconImage: gormImage];
[NSApp setMainMenu: _mainMenu];
[NSApp setApplicationIconImage: _gormImage];
[[NSApp mainMenu] display];
RELEASE(dockTile);
RELEASE(_dockTile);
e = [testingWindows objectEnumerator];
e = [_testingWindows objectEnumerator];
while ((val = [e nextObject]) != nil)
{
[val orderFront: self];
@ -738,7 +763,7 @@
NS_DURING
{
[NSApp setServicesMenu: servicesMenu];
[NSApp setServicesMenu: _servicesMenu];
}
NS_HANDLER
{
@ -746,20 +771,20 @@
}
NS_ENDHANDLER
isTesting = NO;
_isTesting = NO;
if ([selectionOwner conformsToProtocol: @protocol(IBEditors)] == YES)
if ([_selectionOwner conformsToProtocol: @protocol(IBEditors)] == YES)
{
[selectionOwner makeSelectionVisible: YES];
[_selectionOwner makeSelectionVisible: YES];
}
[nc postNotificationName: IBDidEndTestingInterfaceNotification
object: self];
DESTROY(testingWindows);
DESTROY(_testingWindows);
// deallocate
RELEASE(testContainer);
RELEASE(_testContainer);
}
}
@ -780,13 +805,13 @@
{
[self stopConnecting];
}
[selectionOwner makeSelectionVisible: NO];
selectionOwner = obj;
[_selectionOwner makeSelectionVisible: NO];
_selectionOwner = obj;
[[self inspectorsManager] updateSelection];
}
else if ([name isEqual: IBWillCloseDocumentNotification])
{
selectionOwner = nil;
_selectionOwner = nil;
}
else if ([name isEqual: @"GormAddClassNotification"])
{
@ -809,59 +834,64 @@
- (void) awakeFromNib
{
// set the menu...
mainMenu = (NSMenu *)gormMenu;
_mainMenu = (NSMenu *)_gormMenu;
}
- (GormInspectorsManager*) inspectorsManager
{
if (inspectorsManager == nil)
if (_inspectorsManager == nil)
{
inspectorsManager = (GormInspectorsManager *)[GormInspectorsManager sharedInspectorManager];
_inspectorsManager = (GormInspectorsManager *)[GormInspectorsManager sharedInspectorManager];
}
return inspectorsManager;
return _inspectorsManager;
}
- (BOOL) isConnecting
{
return isConnecting;
return _isConnecting;
}
- (BOOL) isTestingInterface
{
return isTesting;
return _isTesting;
}
- (void) setTestingInterface: (BOOL)testing
{
_isTesting = testing;
}
- (NSImage*) linkImage
{
return linkImage;
return _linkImage;
}
- (GormPalettesManager*) palettesManager
{
if (palettesManager == nil)
if (_palettesManager == nil)
{
palettesManager = [[GormPalettesManager alloc] init];
_palettesManager = [[GormPalettesManager alloc] init];
}
return palettesManager;
return _palettesManager;
}
- (GormPluginManager*) pluginManager
{
if (pluginManager == nil)
if (_pluginManager == nil)
{
pluginManager = [[GormPluginManager alloc] init];
_pluginManager = [[GormPluginManager alloc] init];
}
return pluginManager;
return _pluginManager;
}
- (id<IBSelectionOwners>) selectionOwner
{
return (id<IBSelectionOwners>)selectionOwner;
return (id<IBSelectionOwners>)_selectionOwner;
}
- (id) selectedObject
{
return [[selectionOwner selection] lastObject];
return [[_selectionOwner selection] lastObject];
}
- (id<IBDocuments>) documentForObject: (id)object
@ -886,40 +916,40 @@
- (void) startConnecting
{
if (isConnecting == YES)
if (_isConnecting == YES)
{
return;
}
if (connectSource == nil)
if (_connectSource == nil)
{
return;
}
if (connectDestination
&& [[self activeDocument] containsObject: connectDestination] == NO)
if (_connectDestination
&& [[self activeDocument] containsObject: _connectDestination] == NO)
{
NSLog(@"Oops - connectDestination not in active document");
NSLog(@"Oops - _connectDestination not in active document");
return;
}
if ([[self activeDocument] containsObject: connectSource] == NO)
if ([[self activeDocument] containsObject: _connectSource] == NO)
{
NSLog(@"Oops - connectSource not in active document");
NSLog(@"Oops - _connectSource not in active document");
return;
}
isConnecting = YES;
_isConnecting = YES;
[[self inspectorsManager] updateSelection];
}
- (void) stopConnecting
{
[self displayConnectionBetween: nil and: nil];
isConnecting = NO;
connectSource = nil;
connectDestination = nil;
_isConnecting = NO;
_connectSource = nil;
_connectDestination = nil;
}
- (NSMenu*) classMenu
{
return classMenu;
return _classMenu;
}
// Methods to support external apps adding and deleting
@ -954,4 +984,11 @@
[cm removeClassNamed: className];
}
- (void) exceptionWhileLoadingModel: (NSString *)errorMessage
{
NSRunAlertPanel(_(@"Exception"),
errorMessage,
nil, nil, nil);
}
@end

View file

@ -73,7 +73,7 @@ NSImage *browserImage = nil;
{
NSBundle *bundle = [NSBundle bundleForClass: [self class]];
if([bundle loadNibNamed: @"GormClassEditor" owner: self topLevelObjects: nil])
if([bundle loadNibNamed: @"GormClassEditor" owner: self topLevelObjects: NULL])
{
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
NSRect scrollRect = [classesView frame]; // = {{0, 0}, {340, 188}};
@ -153,7 +153,7 @@ NSImage *browserImage = nil;
RELEASE(tableColumn);
// expand all of the items in the classesView...
[outlineView expandItem: @"NSObject"];
// [outlineView expandItem: @"NSObject"];
[outlineView setFrame: scrollRect];
// allocate the NSBrowser view.
@ -859,73 +859,14 @@ NSImage *browserImage = nil;
*/
- (id) instantiateClass: (id)sender
{
NSString *object = [self selectedClassName];
GSNibItem *item = nil;
NSString *className = [self selectedClassName];
NSString *theName = nil;
if([object isEqualToString: @"FirstResponder"])
theName = [document instantiateClassNamed: className];
if (theName == nil)
{
return nil;
}
if([classManager canInstantiateClassNamed: object] == NO)
{
return nil;
}
if([classManager isSuperclass: @"NSView" linkedToClass: object] ||
[object isEqual: @"NSView"])
{
Class cls;
NSString *className = object;
BOOL isCustom = [classManager isCustomClass: object];
id instance;
if(isCustom)
{
className = [classManager nonCustomSuperClassOf: object];
}
// instantiate the object or it's substitute...
cls = NSClassFromString(className);
if([cls respondsToSelector: @selector(allocSubstitute)])
{
instance = [cls allocSubstitute];
}
else
{
instance = [cls alloc];
}
// give it some initial dimensions...
if([instance respondsToSelector: @selector(initWithFrame:)])
{
instance = [instance initWithFrame: NSMakeRect(10,10,380,280)];
}
else
{
instance = [instance init];
}
// add it to the top level objects...
[document attachObject: instance toParent: nil];
// we want to record if it's custom or not and act appropriately...
if(isCustom)
{
NSString *name = [document nameForObject: instance];
[classManager setCustomClass: object
forName: name];
}
[document changeToViewWithTag: 0];
NSLog(@"Instantiate NSView subclass %@",object);
}
else
{
item = [[GormObjectProxy alloc] initWithClassName: object];
[document attachObject: item toParent: nil];
[document changeToViewWithTag: 0];
}
return self;
}

View file

@ -35,28 +35,28 @@
@interface GormClassInspector : IBInspector
{
// outlets
id actionTable;
id addAction;
id addOutlet;
id classField;
id outletTable;
id parentClass;
id removeAction;
id removeOutlet;
id selectClass;
id search;
id searchText;
id tabView;
id _actionTable;
id _addAction;
id _addOutlet;
id _classField;
id _outletTable;
id _parentClass;
id _removeAction;
id _removeOutlet;
id _selectClass;
id _search;
id _searchText;
id _tabView;
// internal vars
NSString *currentClass;
id theobject;
id actionData;
id outletData;
id parentClassData;
NSString *_currentClass;
id _theobject;
id _actionData;
id _outletData;
id _parentClassData;
// class manager..
GormClassManager *classManager;
GormClassManager *_classManager;
}
- (void) addAction: (id)sender;
- (void) removeAction: (id)sender;

View file

@ -258,23 +258,23 @@ objectValueForTableColumn: (NSTableColumn *)tc
NSBundle *bundle = [NSBundle bundleForClass: [self class]];
// initialize all member variables...
actionTable = nil;
addAction = nil;
addOutlet = nil;
classField = nil;
outletTable = nil;
removeAction = nil;
removeOutlet = nil;
tabView = nil;
currentClass = nil;
actionData = nil;
outletData = nil;
parentClassData = nil;
_actionTable = nil;
_addAction = nil;
_addOutlet = nil;
_classField = nil;
_outletTable = nil;
_removeAction = nil;
_removeOutlet = nil;
_tabView = nil;
_currentClass = nil;
_actionData = nil;
_outletData = nil;
_parentClassData = nil;
// load the gui...
if (![bundle loadNibNamed: @"GormClassInspector"
owner: self
topLevelObjects: nil])
topLevelObjects: NULL])
{
NSLog(@"Could not open gorm GormClassInspector");
return nil;
@ -289,52 +289,61 @@ objectValueForTableColumn: (NSTableColumn *)tc
return self;
}
- (void) dealloc
{
RELEASE(_actionData);
RELEASE(_outletData);
RELEASE(_parentClassData);
[super dealloc];
}
- (void) awakeFromNib
{
// instantiate..
actionData = [[GormActionDataSource alloc] init];
outletData = [[GormOutletDataSource alloc] init];
parentClassData = [[GormClassesDataSource alloc] init];
_actionData = [[GormActionDataSource alloc] init];
_outletData = [[GormOutletDataSource alloc] init];
_parentClassData = [[GormClassesDataSource alloc] init];
// initialize..
[actionData setInspector: self];
[outletData setInspector: self];
[parentClassData setInspector: self];
[_actionData setInspector: self];
[_outletData setInspector: self];
[_parentClassData setInspector: self];
// use..
[actionTable setDataSource: actionData];
[outletTable setDataSource: outletData];
[parentClass setDataSource: parentClassData];
[parentClass setDoubleAction: @selector(selectClass:)];
[parentClass setTarget: self];
[_actionTable setDataSource: _actionData];
[_outletTable setDataSource: _outletData];
[_parentClass setDataSource: _parentClassData];
[_parentClass setDoubleAction: @selector(selectClass:)];
[_parentClass setTarget: self];
// delegate...
[actionTable setDelegate: self];
[outletTable setDelegate: self];
[parentClass setDelegate: self];
[_actionTable setDelegate: self];
[_outletTable setDelegate: self];
[_parentClass setDelegate: self];
}
- (void) _refreshView
{
id addActionCell = [addAction cell];
id removeActionCell = [removeAction cell];
id addOutletCell = [addOutlet cell];
id removeOutletCell = [removeOutlet cell];
id selectClassCell = [selectClass cell];
id searchCell = [search cell];
BOOL isEditable = [classManager isCustomClass: [self _currentClass]];
id addActionCell = [_addAction cell];
id removeActionCell = [_removeAction cell];
id addOutletCell = [_addOutlet cell];
id removeOutletCell = [_removeOutlet cell];
id selectClassCell = [_selectClass cell];
id searchCell = [_search cell];
BOOL isEditable = [_classManager isCustomClass: [self _currentClass]];
BOOL isFirstResponder = [[self _currentClass] isEqualToString: @"FirstResponder"];
NSArray *list = [classManager allClassNames];
NSString *superClass = [classManager parentOfClass: [self _currentClass]];
NSArray *list = [_classManager allClassNames];
NSString *superClass = [_classManager parentOfClass: [self _currentClass]];
NSUInteger index = [list indexOfObject: superClass];
[classField setStringValue: [self _currentClass]];
[outletTable reloadData];
[actionTable reloadData];
[parentClass reloadData];
// [outletTable deselectAll: self];
// [actionTable deselectAll: self];
[_classField setStringValue: [self _currentClass]];
[_outletTable reloadData];
[_actionTable reloadData];
[_parentClass reloadData];
// [_outletTable deselectAll: self];
// [_actionTable deselectAll: self];
// activate for actions...
[addActionCell setEnabled: YES];
@ -346,16 +355,16 @@ objectValueForTableColumn: (NSTableColumn *)tc
// activate select class...
[selectClassCell setEnabled: (isEditable && !isFirstResponder)];
[parentClass setEnabled: (isEditable && !isFirstResponder)];
[_parentClass setEnabled: (isEditable && !isFirstResponder)];
[searchCell setEnabled: (isEditable && !isFirstResponder)];
[classField setEditable: (isEditable && !isFirstResponder)];
[classField setBackgroundColor: ((isEditable && !isFirstResponder)?[NSColor textBackgroundColor]:[NSColor selectedTextBackgroundColor])];
[_classField setEditable: (isEditable && !isFirstResponder)];
[_classField setBackgroundColor: ((isEditable && !isFirstResponder)?[NSColor textBackgroundColor]:[NSColor selectedTextBackgroundColor])];
// select the parent class
if(index != NSNotFound && list != nil)
{
[parentClass selectRow: index byExtendingSelection: NO];
[parentClass scrollRowToVisible: index];
[_parentClass selectRow: index byExtendingSelection: NO];
[_parentClass scrollRowToVisible: index];
}
}
@ -367,17 +376,17 @@ objectValueForTableColumn: (NSTableColumn *)tc
if(document != nil)
{
NSString *className = [self _currentClass];
NSString *newAction = [classManager addNewActionToClassNamed: className];
NSArray *list = [classManager allActionsForClassNamed: className];
NSString *newAction = [_classManager addNewActionToClassNamed: className];
NSArray *list = [_classManager allActionsForClassNamed: className];
NSInteger row = [list indexOfObject: newAction];
[document collapseClass: className];
[document reloadClasses];
[nc postNotificationName: IBInspectorDidModifyObjectNotification
object: classManager];
[actionTable reloadData];
[actionTable scrollRowToVisible: row];
[actionTable selectRow: row byExtendingSelection: NO];
object: _classManager];
[_actionTable reloadData];
[_actionTable scrollRowToVisible: row];
[_actionTable selectRow: row byExtendingSelection: NO];
[document selectClass: className];
[super ok: sender];
}
@ -397,17 +406,17 @@ objectValueForTableColumn: (NSTableColumn *)tc
if(document != nil)
{
NSString *className = [self _currentClass];
NSString *newOutlet = [classManager addNewOutletToClassNamed: className];
NSArray *list = [classManager allOutletsForClassNamed: className];
NSString *newOutlet = [_classManager addNewOutletToClassNamed: className];
NSArray *list = [_classManager allOutletsForClassNamed: className];
NSInteger row = [list indexOfObject: newOutlet];
[document collapseClass: className];
[document reloadClasses];
[nc postNotificationName: IBInspectorDidModifyObjectNotification
object: classManager];
[outletTable reloadData];
[outletTable scrollRowToVisible: row];
[outletTable selectRow: row byExtendingSelection: NO];
object: _classManager];
[_outletTable reloadData];
[_outletTable scrollRowToVisible: row];
[_outletTable selectRow: row byExtendingSelection: NO];
[document selectClass: className];
[super ok: sender];
}
@ -423,28 +432,28 @@ objectValueForTableColumn: (NSTableColumn *)tc
{
NS_DURING
{
NSInteger i = [actionTable selectedRow];
NSInteger i = [_actionTable selectedRow];
NSString *className = [self _currentClass];
NSArray *list = [classManager allActionsForClassNamed: className];
NSArray *list = [_classManager allActionsForClassNamed: className];
BOOL removed = NO;
BOOL isCustom = [classManager isCustomClass: className];
BOOL isCustom = [_classManager isCustomClass: className];
NSString *name = nil;
GormDocument *document = (GormDocument *)[(id <IB>)[NSApp delegate] activeDocument];
if(document != nil)
{
// check the count...
if(isCustom || [classManager isCategoryForClass: className])
if(isCustom || [_classManager isCategoryForClass: className])
{
if([list count] > 0 && i >= 0 && i < [list count])
{
[actionTable deselectAll: self];
[_actionTable deselectAll: self];
name = [list objectAtIndex: i];
if(isCustom || [classManager isAction: name onCategoryForClassNamed: className])
if(isCustom || [_classManager isAction: name onCategoryForClassNamed: className])
{
removed = [document
removeConnectionsWithLabel: name
forClassNamed: currentClass
forClassNamed: _currentClass
isAction: YES];
}
}
@ -454,10 +463,10 @@ objectValueForTableColumn: (NSTableColumn *)tc
[super ok: sender];
[document collapseClass: className];
[document reloadClasses];
[classManager removeAction: name fromClassNamed: className];
[_classManager removeAction: name fromClassNamed: className];
[nc postNotificationName: IBInspectorDidModifyObjectNotification
object: classManager];
[actionTable reloadData];
object: _classManager];
[_actionTable reloadData];
[document selectClass: className];
}
}
@ -474,9 +483,9 @@ objectValueForTableColumn: (NSTableColumn *)tc
{
NS_DURING
{
NSInteger i = [outletTable selectedRow];
NSInteger i = [_outletTable selectedRow];
NSString *className = [self _currentClass];
NSArray *list = [classManager allOutletsForClassNamed: className];
NSArray *list = [_classManager allOutletsForClassNamed: className];
BOOL removed = NO;
NSString *name = nil;
GormDocument *document = (GormDocument *)[(id <IB>)[NSApp delegate] activeDocument];
@ -486,11 +495,11 @@ objectValueForTableColumn: (NSTableColumn *)tc
// check the count...
if([list count] > 0 && i >= 0 && i < [list count])
{
[outletTable deselectAll: self];
[_outletTable deselectAll: self];
name = [list objectAtIndex: i];
removed = [document
removeConnectionsWithLabel: name
forClassNamed: currentClass
forClassNamed: _currentClass
isAction: NO];
}
@ -499,10 +508,10 @@ objectValueForTableColumn: (NSTableColumn *)tc
[super ok: sender];
[document collapseClass: className];
[document reloadClasses];
[classManager removeOutlet: name fromClassNamed: className];
[_classManager removeOutlet: name fromClassNamed: className];
[nc postNotificationName: IBInspectorDidModifyObjectNotification
object: classManager];
[outletTable reloadData];
object: _classManager];
[_outletTable reloadData];
[document selectClass: className];
}
}
@ -521,24 +530,24 @@ objectValueForTableColumn: (NSTableColumn *)tc
- (void) searchForClass: (id)sender
{
NSArray *list = [classManager allClassNames];
NSString *stringValue = [searchText stringValue];
NSArray *list = [_classManager allClassNames];
NSString *stringValue = [_searchText stringValue];
NSInteger index = [list indexOfObject: stringValue];
NSLog(@"Search... %@",[searchText stringValue]);
NSLog(@"Search... %@",[_searchText stringValue]);
if(index != NSNotFound && list != nil &&
[stringValue isEqualToString: @"FirstResponder"] == NO)
{
// select the parent class
[parentClass selectRow: index byExtendingSelection: NO];
[parentClass scrollRowToVisible: index];
[_parentClass selectRow: index byExtendingSelection: NO];
[_parentClass scrollRowToVisible: index];
}
}
- (void) selectClass: (id)sender
{
NSArray *list = [classManager allClassNames];
NSInteger row = [parentClass selectedRow];
NSArray *list = [_classManager allClassNames];
NSInteger row = [_parentClass selectedRow];
NS_DURING
{
@ -551,7 +560,7 @@ objectValueForTableColumn: (NSTableColumn *)tc
// if it's a custom class, let it go, if not do nothing.
if(document != nil)
{
if([classManager isCustomClass: name])
if([_classManager isCustomClass: name])
{
NSString *title = _(@"Modifying/Reparenting Class");
NSString *msg = [NSString stringWithFormat: _(@"This action may break existing connections "
@ -576,12 +585,12 @@ objectValueForTableColumn: (NSTableColumn *)tc
// if removed, move the class and notify...
if(removed)
{
NSString *oldSuper = [classManager superClassNameForClassNamed: name];
NSString *oldSuper = [_classManager superClassNameForClassNamed: name];
[classManager setSuperClassNamed: newParent forClassNamed: name];
[_classManager setSuperClassNamed: newParent forClassNamed: name];
[document refreshConnectionsForClassNamed: name];
[nc postNotificationName: IBInspectorDidModifyObjectNotification
object: classManager];
object: _classManager];
[document collapseClass: oldSuper];
[document collapseClass: name];
[document reloadClasses];
@ -612,10 +621,10 @@ objectValueForTableColumn: (NSTableColumn *)tc
if(flag)
{
[document collapseClass: name];
[classManager renameClassNamed: name
[_classManager renameClassNamed: name
newName: newName];
[nc postNotificationName: IBInspectorDidModifyObjectNotification
object: classManager];
object: _classManager];
[document reloadClasses];
[document selectClass: newName];
[super ok: sender];
@ -625,14 +634,14 @@ objectValueForTableColumn: (NSTableColumn *)tc
- (void) selectAction: (id)sender
{
NSInteger row = [sender selectedRow];
NSArray *actions = [classManager allActionsForClassNamed: currentClass];
NSArray *actions = [_classManager allActionsForClassNamed: _currentClass];
if(row <= [actions count])
{
BOOL isCustom = [classManager isCustomClass: currentClass];
id cell = [removeAction cell];
BOOL isCustom = [_classManager isCustomClass: _currentClass];
id cell = [_removeAction cell];
NSString *action = [actions objectAtIndex: row];
BOOL isAction = [classManager isAction: action ofClass: currentClass];
BOOL isActionOnCategory = [classManager isAction: action onCategoryForClassNamed: currentClass];
BOOL isAction = [_classManager isAction: action ofClass: _currentClass];
BOOL isActionOnCategory = [_classManager isAction: action onCategoryForClassNamed: _currentClass];
[cell setEnabled: ((isCustom && isAction) || isActionOnCategory)];
}
}
@ -640,14 +649,14 @@ objectValueForTableColumn: (NSTableColumn *)tc
- (void) selectOutlet: (id)sender
{
NSInteger row = [sender selectedRow];
NSArray *outlets = [classManager allOutletsForClassNamed: currentClass];
NSArray *outlets = [_classManager allOutletsForClassNamed: _currentClass];
if(row <= [outlets count])
{
BOOL isCustom = [classManager isCustomClass: currentClass];
BOOL isFirstResponder = [currentClass isEqualToString: @"FirstResponder"];
id cell = [removeOutlet cell];
BOOL isCustom = [_classManager isCustomClass: _currentClass];
BOOL isFirstResponder = [_currentClass isEqualToString: @"FirstResponder"];
id cell = [_removeOutlet cell];
NSString *outlet = [outlets objectAtIndex: row];
BOOL isOutlet = [classManager isOutlet: outlet ofClass: currentClass];
BOOL isOutlet = [_classManager isOutlet: outlet ofClass: _currentClass];
[cell setEnabled: (isOutlet && isCustom && !isFirstResponder)];
}
}
@ -666,17 +675,17 @@ objectValueForTableColumn: (NSTableColumn *)tc
if([anObject isKindOfClass: [GormClassProxy class]])
{
[super setObject: anObject];
ASSIGN(classManager, [(id<GormAppDelegate>)[NSApp delegate] classManager]);
ASSIGN(currentClass, [object className]);
ASSIGN(_classManager, [(id<GormAppDelegate>)[NSApp delegate] classManager]);
ASSIGN(_currentClass, [object className]);
outletsCount = [[classManager allOutletsForClassNamed: currentClass] count];
actionsCount = [[classManager allActionsForClassNamed: currentClass] count];
outletsCount = [[_classManager allOutletsForClassNamed: _currentClass] count];
actionsCount = [[_classManager allActionsForClassNamed: _currentClass] count];
item = [tabView tabViewItemAtIndex: 1]; // actions;
item = [_tabView tabViewItemAtIndex: 1]; // actions;
[item setLabel: [NSString stringWithFormat: @"Actions (%ld)",(long)actionsCount]];
item = [tabView tabViewItemAtIndex: 0]; // outlets;
item = [_tabView tabViewItemAtIndex: 0]; // outlets;
[item setLabel: [NSString stringWithFormat: @"Outlets (%ld)",(long)outletsCount]];
[tabView setNeedsDisplay: YES];
[_tabView setNeedsDisplay: YES];
[self _refreshView];
}
@ -693,7 +702,7 @@ objectValueForTableColumn: (NSTableColumn *)tc
- (void) handleNotification: (NSNotification *)notification
{
if([notification object] == classManager &&
if([notification object] == _classManager &&
(id<IB>)[[NSApp delegate] activeDocument] != nil)
{
[self _refreshView];
@ -707,39 +716,39 @@ shouldEditTableColumn: (NSTableColumn *)aTableColumn
{
BOOL result = NO;
if(tableView != parentClass)
if(tableView != _parentClass)
{
NSArray *list = nil;
NSString *name = nil;
NSString *className = [self _currentClass];
if(tableView == actionTable)
if(tableView == _actionTable)
{
list = [classManager allActionsForClassNamed: className];
list = [_classManager allActionsForClassNamed: className];
name = [list objectAtIndex: rowIndex];
}
else if(tableView == outletTable)
else if(tableView == _outletTable)
{
list = [classManager allOutletsForClassNamed: className];
list = [_classManager allOutletsForClassNamed: className];
name = [list objectAtIndex: rowIndex];
}
if([classManager isCustomClass: className])
if([_classManager isCustomClass: className])
{
if(tableView == actionTable)
if(tableView == _actionTable)
{
result = [classManager isAction: name
result = [_classManager isAction: name
ofClass: className];
}
else if(tableView == outletTable)
else if(tableView == _outletTable)
{
result = [classManager isOutlet: name
result = [_classManager isOutlet: name
ofClass: className];
}
}
else
{
result = [classManager isAction: name onCategoryForClassNamed: className];
result = [_classManager isAction: name onCategoryForClassNamed: className];
}
}
@ -754,15 +763,15 @@ shouldEditTableColumn: (NSTableColumn *)aTableColumn
NSString *name = [aCell stringValue];
NSString *className = [self _currentClass];
if (tableView == parentClass)
if (tableView == _parentClass)
{
[aCell setTextColor: [NSColor textColor]];
}
else if (tableView == actionTable)
else if (tableView == _actionTable)
{
if(([classManager isCustomClass: className] &&
[classManager isAction: name ofClass: className]) ||
[classManager isAction: name onCategoryForClassNamed: className])
if(([_classManager isCustomClass: className] &&
[_classManager isAction: name ofClass: className]) ||
[_classManager isAction: name onCategoryForClassNamed: className])
{
[aCell setTextColor: [NSColor textColor]];
}
@ -771,10 +780,10 @@ shouldEditTableColumn: (NSTableColumn *)aTableColumn
[aCell setTextColor: [NSColor selectedTextColor]];
}
}
else if( tableView == outletTable)
else if( tableView == _outletTable)
{
if([classManager isCustomClass: className] &&
[classManager isOutlet: name ofClass: className])
if([_classManager isCustomClass: className] &&
[_classManager isOutlet: name ofClass: className])
{
[aCell setTextColor: [NSColor textColor]];
}
@ -791,14 +800,14 @@ shouldEditTableColumn: (NSTableColumn *)aTableColumn
shouldSelectRow: (NSInteger)rowIndex
{
BOOL result = YES;
if(tv == parentClass)
if(tv == _parentClass)
{
NSArray *list = [classManager allClassNames];
NSArray *list = [_classManager allClassNames];
NSString *className = [list objectAtIndex: rowIndex];
NSString *name = [self _currentClass];
BOOL isFirstResponder = [className isEqualToString: @"FirstResponder"];
BOOL isCurrentClass = [className isEqualToString: name];
BOOL isSubClass = [classManager isSuperclass: name linkedToClass: className];
BOOL isSubClass = [_classManager isSuperclass: name linkedToClass: className];
if(isFirstResponder || isCurrentClass || isSubClass)
{
NSBeep();

View file

@ -345,6 +345,13 @@
NSEnumerator *en = [subClasses objectEnumerator];
NSString *subclassName = nil;
if (action == nil
|| className == nil)
{
NSLog(@"Attempt to add nil action = %@ or className = %@ to class manager", action, className);
return;
}
// check all
if ([allActions containsObject: anAction])
{
@ -2270,6 +2277,8 @@
return result;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpointer-to-int-cast"
- (NSString *) description
{
return [NSString stringWithFormat: @"<%s: %lx> = %@",
@ -2277,6 +2286,7 @@
(unsigned long)self,
_customClassMap];
}
#pragma GCC diagnostic pop
/** Helpful for debugging */
- (NSString *) dumpClassInformation

View file

@ -38,7 +38,7 @@
{
NSBundle *bundle = [NSBundle bundleForClass: [self class]];
if ( ![bundle loadNibNamed:@"GormClassPanel" owner:self topLevelObjects: nil] )
if ( ![bundle loadNibNamed:@"GormClassPanel" owner:self topLevelObjects: NULL] )
{
NSLog(@"Can not load bundle GormClassPanel");
return nil;

View file

@ -92,7 +92,7 @@
{
NSBundle *bundle = [NSBundle bundleForClass: [self class]];
if([bundle loadNibNamed: @"GormConnectionInspector" owner: self topLevelObjects: nil] == NO)
if([bundle loadNibNamed: @"GormConnectionInspector" owner: self topLevelObjects: NULL] == NO)
{
NSLog(@"Couldn't load GormConnectionInsector");
return nil;

View file

@ -58,7 +58,7 @@
// load the gui...
if (![bundle loadNibNamed: @"GormCustomClassInspector"
owner: self
topLevelObjects: nil])
topLevelObjects: NULL])
{
NSLog(@"Could not open gorm GormCustomClassInspector");
return nil;

View file

@ -238,6 +238,12 @@
*/
- (id) instantiateClass: (id)sender;
/**
* Instantiate the class specified by the parameter className and
* returns the reference name within the document
*/
- (NSString *) instantiateClassNamed: (NSString *)className;
/**
* Generate the class files for the selected class
*/
@ -516,6 +522,11 @@
*/
- (NSMutableSet *) topLevelObjects;
/**
* Returns an array of issues. If document is valid the array should be empty.
*/
- (NSArray *) validate;
@end
@interface GormDocument (MenuValidation)

View file

@ -518,28 +518,35 @@ static NSImage *fileImage = nil;
*/
- (void) _instantiateFontManager
{
GSNibItem *item = nil;
NSMenu *fontMenu = nil;
item = [[GormObjectProxy alloc] initWithClassName: @"NSFontManager"];
[self setName: @"NSFont" forObject: item];
[self attachObject: item toParent: nil];
RELEASE(item);
// set the holder in the document.
fontManager = (GormObjectProxy *)item;
[self changeToViewWithTag: 0];
// Add the connection to the menu from the font manager, if the NSFontMenu exists...
fontMenu = [self fontMenu];
if (fontMenu != nil)
if (fontManager != nil)
{
NSNibOutletConnector *con = [[NSNibOutletConnector alloc] init];
[con setSource: item];
[con setDestination: fontMenu];
[con setLabel: @"menu"];
[self addConnector: con];
return;
}
else
{
GSNibItem *item = nil;
NSMenu *fontMenu = nil;
item = [[GormObjectProxy alloc] initWithClassName: @"NSFontManager"];
[self setName: @"NSFont" forObject: item];
[self attachObject: item toParent: nil];
RELEASE(item);
// set the holder in the document.
fontManager = (GormObjectProxy *)item;
[self changeToViewWithTag: 0];
// Add the connection to the menu from the font manager, if the NSFontMenu exists...
fontMenu = [self fontMenu];
if (fontMenu != nil)
{
NSNibOutletConnector *con = [[NSNibOutletConnector alloc] init];
[con setSource: item];
[con setDestination: fontMenu];
[con setLabel: @"menu"];
[self addConnector: con];
}
}
}
@ -1436,7 +1443,7 @@ static NSImage *fileImage = nil;
/**
* Detach every object in anArray from the document. Optionally closing editors.
*/
- (void) detachObjects: (NSArray*)anArray closeEditors: (BOOL)close_editors
- (void) detachObjects: (/* NSArray* */ id)anArray closeEditors: (BOOL)close_editors
{
NSEnumerator *enumerator = [anArray objectEnumerator];
NSObject *obj;
@ -1488,6 +1495,84 @@ static NSImage *fileImage = nil;
return [classesView instantiateClass: sender];
}
/**
* Instantiate the class specified by the parameter className
*/
- (NSString *) instantiateClassNamed: (NSString *)className
{
NSString *theName = nil;
GSNibItem *item = nil;
if([className isEqualToString: @"FirstResponder"])
{
return nil;
}
if([classManager canInstantiateClassNamed: className] == NO)
{
return nil;
}
if([classManager isSuperclass: @"NSView" linkedToClass: className] ||
[className isEqualToString: @"NSView"])
{
Class cls;
BOOL isCustom = [classManager isCustomClass: className];
id instance;
// Replace with NON custom class, since we don't have the compiled version
// of the custom class available to us in Gorm.
if(isCustom)
{
className = [classManager nonCustomSuperClassOf: className];
}
// instantiate the object or it's substitute...
cls = NSClassFromString(className);
if([cls respondsToSelector: @selector(allocSubstitute)])
{
instance = [cls allocSubstitute];
}
else
{
instance = [cls alloc];
}
// give it some initial dimensions...
if([instance respondsToSelector: @selector(initWithFrame:)])
{
instance = [instance initWithFrame: NSMakeRect(10,10,380,280)];
}
else
{
instance = [instance init];
}
// add it to the top level objects...
[self attachObject: instance toParent: nil];
// we want to record if it's custom or not and act appropriately...
if(isCustom)
{
theName = [self nameForObject: instance];
[classManager setCustomClass: className
forName: theName];
}
[self changeToViewWithTag: 0];
NSDebugLog(@"Instantiate NSView subclass %@",className);
}
else
{
item = [[GormObjectProxy alloc] initWithClassName: className];
[self attachObject: item toParent: nil];
[self changeToViewWithTag: 0];
theName = [self nameForObject: item];
}
return theName;
}
/**
* Remove a class from the classes view
*/
@ -1735,7 +1820,8 @@ static void _real_close(GormDocument *self,
}
else if ([name isEqual: IBWillBeginTestingInterfaceNotification] && isDocumentOpen)
{
if ([(id<IB>)[NSApp delegate] activeDocument] == self)
id delegate = [NSApp delegate];
if ([delegate activeDocument] == self && [delegate isInTool] == NO)
{
NSEnumerator *enumerator;
id obj;
@ -2924,6 +3010,8 @@ static void _real_close(GormDocument *self,
/**
* Return a text description of the document.
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpointer-to-int-cast"
- (NSString *) description
{
return [NSString stringWithFormat: @"<%s: %lx> = <<name table: %@, connections: %@>>",
@ -2931,6 +3019,7 @@ static void _real_close(GormDocument *self,
(unsigned long)self,
nameTable, connections];
}
#pragma GCC diagnostic pop
/**
* Returns YES, if obj is a top level object.
@ -3641,6 +3730,56 @@ static void _real_close(GormDocument *self,
{
return [classManager allOutletsForClassNamed: className];
}
//// Document Validation
- (NSArray *) validate
{
NSMutableArray *results = [NSMutableArray array];
NSEnumerator *en = [topLevelObjects objectEnumerator];
id o = nil;
NSLog(@"Validating topLevelObjects: %@", topLevelObjects);
while ((o = [en nextObject]) != nil)
{
// check the type of o...
if ([o isKindOfClass: [NSWindow class]]
|| [o isKindOfClass: [NSMenu class]]
|| [o isKindOfClass: [NSView class]]
|| [o isKindOfClass: [GormObjectProxy class]])
{
continue;
}
else
{
NSString *className = NSStringFromClass([o class]);
NSString *error = [NSString stringWithFormat: @"%@ has an invalid class of type %@", o, className];
[results addObject: error];
}
}
/*
NSLog(@"Checking connections..."); // %@", connections);
en = [connections objectEnumerator];
o = nil;
while ((o = [en nextObject]) != nil)
{
id src = [o source];
id dst = [o destination];
NSString *label = [o label];
if ([o isKindOfClass: [NSNibControlConnector class]])
{
}
else if ([o isKindOfClass: [NSNibOutletConnector class]])
{
}
}
*/
return results;
}
@end
@implementation GormDocument (MenuValidation)

View file

@ -24,10 +24,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
*/
#include "GormPrivate.h"
#include <GormCore/GormDocument.h>
#include <GormCore/GormDocumentController.h>
#include "GormPrivate.h"
@implementation GormDocumentController
- (id) currentDocument

View file

@ -27,7 +27,7 @@ static GormFontViewController *gorm_font_cont = nil;
// load the gui...
if (![bundle loadNibNamed: @"GormFontView"
owner: self
topLevelObjects: nil])
topLevelObjects: NULL])
{
NSLog(@"Could not open gorm GormFontView");
return nil;

View file

@ -16,7 +16,7 @@
return nil;
}
if ([bundle loadNibNamed: @"GormHelpInspector" owner: self topLevelObjects: nil] == NO)
if ([bundle loadNibNamed: @"GormHelpInspector" owner: self topLevelObjects: NULL] == NO)
{
NSLog(@"Could not gorm GormHelpInspector");
return nil;

View file

@ -24,7 +24,7 @@
// load the gui...
if (![bundle loadNibNamed: @"GormImageInspector"
owner: self
topLevelObjects: nil])
topLevelObjects: NULL])
{
NSLog(@"Could not open gorm GormImageInspector");
return nil;

View file

@ -50,7 +50,7 @@
{
NSBundle *bundle = [NSBundle bundleForClass: [self class]];
if([bundle loadNibNamed: @"GormDummyInspector" owner: self topLevelObjects: nil])
if([bundle loadNibNamed: @"GormDummyInspector" owner: self topLevelObjects: NULL])
{
[button setStringValue: [self title]];
}

View file

@ -27,7 +27,7 @@
if ([bundle loadNibNamed: @"GormNSSplitViewInspector"
owner: self
topLevelObjects: nil] == NO)
topLevelObjects: NULL] == NO)
{
NSLog(@"Could not open gorm GormNSSplitViewInspector");
NSLog(@"self %@", self);

View file

@ -27,6 +27,8 @@
#include "GormPrivate.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
static NSString *typeId = @"Object";
static NSString *typeChar = @"Character or Boolean";
static NSString *typeUChar = @"Unsigned character/bool";
@ -34,7 +36,7 @@ static NSString *typeInt = @"Integer";
static NSString *typeUInt = @"Unsigned integer";
static NSString *typeFloat = @"Float";
static NSString *typeDouble = @"Double";
#pragma GCC diagnostic pop
@interface GormObjectInspector : IBInspector
{

View file

@ -33,7 +33,7 @@
{
NSBundle *bundle = [NSBundle bundleForClass: [self class]];
if([bundle loadNibNamed: @"GormObjectInspector" owner: self topLevelObjects: nil] == NO)
if([bundle loadNibNamed: @"GormObjectInspector" owner: self topLevelObjects: NULL] == NO)
{
NSLog(@"Couldn't load GormObjectInsector");
return nil;

View file

@ -39,6 +39,8 @@
#include <GormCore/GormProtocol.h>
#include <GormCore/GormClassEditor.h>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wattributes"
extern NSString *GormLinkPboardType;
extern NSString *GormToggleGuidelineNotification;
extern NSString *GormDidModifyClassNotification;
@ -47,6 +49,7 @@ extern NSString *GormDidDeleteClassNotification;
extern NSString *GormWillDetachObjectFromDocumentNotification;
extern NSString *GormDidDetachObjectFromDocumentNotification;
extern NSString *GormResizeCellNotification;
#pragma GCC diagnostic pop
@class GormDocument;
@class GormInspectorsManager;

View file

@ -76,19 +76,10 @@ static BOOL _isInInterfaceBuilder = NO;
@end
@interface NSObject (GormPrivate)
// + (void) poseAsClass: (Class)aClassObject;
+ (BOOL) canSubstituteForClass: (Class)origClass;
@end
@implementation NSObject (GormPrivate)
/*
+ (void) poseAsClass: (Class)aClassObject
{
// disable poseAs: while in Gorm.
class_pose_as(self, aClassObject);
NSLog(@"WARNING: poseAs: called in Gorm.");
}
*/
+ (BOOL) canSubstituteForClass: (Class)origClass
{
@ -113,6 +104,7 @@ static BOOL _isInInterfaceBuilder = NO;
return NO;
}
@end
@implementation GormObjectProxy

View file

@ -64,6 +64,7 @@
- (void) couldNotParseClassAtPath: (NSString *)path;
- (void) exceptionWhileParsingClass: (NSException *)localException;
- (BOOL) shouldBreakConnectionsReparsingClass: (NSString *)className;
- (void) exceptionWhileLoadingModel: (NSString *)errorMessage;
@end

View file

@ -40,7 +40,7 @@
if ([bundle loadNibNamed: @"GormScrollViewAttributesInspector"
owner: self
topLevelObjects: nil] == NO)
topLevelObjects: NULL] == NO)
{
NSLog(@"Could not open gorm GormScrollViewAttributesInspector");
NSLog(@"self %@", self);

View file

@ -14,7 +14,7 @@
{
NSBundle *bundle = [NSBundle bundleForClass: [self class]];
if (![bundle loadNibNamed: @"GormSetName" owner: self topLevelObjects: nil])
if (![bundle loadNibNamed: @"GormSetName" owner: self topLevelObjects: NULL])
{
return NSAlertAlternateReturn;
}

View file

@ -55,7 +55,7 @@
// load the gui...
if (![bundle loadNibNamed: @"GormSoundInspector"
owner: self
topLevelObjects: nil])
topLevelObjects: NULL])
{
NSLog(@"Could not open gorm GormSoundInspector");
return nil;

View file

@ -81,7 +81,7 @@ NSImage *mVLine = nil;
NSBundle *bundle = [NSBundle bundleForClass: [self class]];
if ([bundle loadNibNamed: @"GormViewSizeInspector"
owner: self
topLevelObjects: nil] == NO)
topLevelObjects: NULL] == NO)
{
NSLog(@"Could not open gorm GormViewSizeInspector");
NSLog(@"self %@", self);
@ -152,16 +152,7 @@ NSImage *mVLine = nil;
if (anObject != object)
return;
/*
if([[anObject window] isKindOfClass: [GormViewWindow class]])
{
[sizeForm setEnabled: NO];
}
else
*/
{
[sizeForm setEnabled: YES];
}
[sizeForm setEnabled: YES];
// stop editing so that the new values can be populated.
[sizeForm abortEditing];

View file

@ -1,19 +0,0 @@
# Additional include directories the compiler should search
ADDITIONAL_INCLUDE_DIRS += -I../../..
ifeq ($(GNUSTEP_TARGET_OS),mingw32)
ADDITIONAL_LIB_DIRS += \
-L../../../GormLib/$(GNUSTEP_OBJ_DIR) \
-L../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../GormCore/$(GNUSTEP_OBJ_DIR)
ADDITIONAL_GUI_LIBS += -lGorm -lGormCore
endif
ifeq ($(GNUSTEP_TARGET_OS),cygwin)
ADDITIONAL_LIB_DIRS += \
-L../../../GormLib/$(GNUSTEP_OBJ_DIR) \
-L../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../GormCore/$(GNUSTEP_OBJ_DIR)
$(BUNDLE_NAME)_LIBRARIES_DEPEND_UPON += -lGorm -lGormCore
endif

View file

@ -1,19 +0,0 @@
# Additional include directories the compiler should search
ADDITIONAL_INCLUDE_DIRS += -I../../..
ifeq ($(GNUSTEP_TARGET_OS),mingw32)
ADDITIONAL_LIB_DIRS += \
-L../../../GormLib/$(GNUSTEP_OBJ_DIR) \
-L../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../GormCore/$(GNUSTEP_OBJ_DIR)
ADDITIONAL_GUI_LIBS += -lGorm -lGormCore
endif
ifeq ($(GNUSTEP_TARGET_OS),cygwin)
ADDITIONAL_LIB_DIRS += \
-L../../../GormLib/$(GNUSTEP_OBJ_DIR) \
-L../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../GormCore/$(GNUSTEP_OBJ_DIR)
$(BUNDLE_NAME)_LIBRARIES_DEPEND_UPON += -lGorm -lGormCore
endif

View file

@ -1,19 +0,0 @@
# Additional include directories the compiler should search
ADDITIONAL_INCLUDE_DIRS += -I../../..
ifeq ($(GNUSTEP_TARGET_OS),mingw32)
ADDITIONAL_LIB_DIRS += \
-L../../../GormLib/$(GNUSTEP_OBJ_DIR) \
-L../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../GormCore/$(GNUSTEP_OBJ_DIR)
ADDITIONAL_GUI_LIBS += -lGorm -lGormCore
endif
ifeq ($(GNUSTEP_TARGET_OS),cygwin)
ADDITIONAL_LIB_DIRS += \
-L../../../GormLib/$(GNUSTEP_OBJ_DIR) \
-L../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../GormCore/$(GNUSTEP_OBJ_DIR)
$(BUNDLE_NAME)_LIBRARIES_DEPEND_UPON += -lGorm -lGormCore
endif

View file

@ -1,19 +0,0 @@
# Additional include directories the compiler should search
ADDITIONAL_INCLUDE_DIRS += -I../../.. -I../.. -I..
ifeq ($(GNUSTEP_TARGET_OS),mingw32)
ADDITIONAL_LIB_DIRS += \
-L../../../GormLib/$(GNUSTEP_OBJ_DIR) \
-L../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../GormCore/$(GNUSTEP_OBJ_DIR)
ADDITIONAL_GUI_LIBS += -lGorm -lGormCore
endif
ifeq ($(GNUSTEP_TARGET_OS),cygwin)
ADDITIONAL_LIB_DIRS += \
-L../../../GormLib/$(GNUSTEP_OBJ_DIR) \
-L../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../../GormCore/$(GNUSTEP_OBJ_DIR)
$(BUNDLE_NAME)_LIBRARIES_DEPEND_UPON += -lGorm -lGormCore
endif

View file

@ -420,5 +420,4 @@
Outlets = ();
Super = NSArrayController;
};
Object = {};
}

View file

@ -29,7 +29,7 @@
#ifdef GNUSTEP_WITH_DLL
#if BUILD_libGorm_DLL
#if BUILD_libInterfaceBuilder_DLL
# if defined(__MINGW32__)
/* On Mingw, the compiler will export all symbols automatically, so
* __declspec(dllexport) is not needed.

View file

@ -0,0 +1,19 @@
# Additional include directories the compiler should search
ADDITIONAL_INCLUDE_DIRS += -I../../
ifeq ($(GNUSTEP_TARGET_OS),mingw32)
ADDITIONAL_LIB_DIRS += \
-L../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../GormCore/GormCore.framework
ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormCore
endif
ifeq ($(GNUSTEP_TARGET_OS),cygwin)
ADDITIONAL_LIB_DIRS += \
-L../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../GormCore/GormCore.framework
$(BUNDLE_NAME)_LIBRARIES_DEPEND_UPON += -lInterfaceBuilder -lGormCore
endif

View file

@ -58,10 +58,10 @@ static BOOL gormFileOwnerDecoded;
@interface GModelApplication : NSObject
{
id mainMenu;
id windowMenu;
id delegate;
NSArray *windows;
id _mainMenu;
id _windowMenu;
id _delegate;
NSArray *_windows;
}
+ (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver;
@ -81,10 +81,10 @@ static BOOL gormFileOwnerDecoded;
NSEnumerator *enumerator;
NSWindow *win;
mainMenu = [unarchiver decodeObjectWithName:@"mainMenu"];
_mainMenu = [unarchiver decodeObjectWithName:@"mainMenu"];
windows = [unarchiver decodeObjectWithName:@"windows"];
enumerator = [windows objectEnumerator];
_windows = [unarchiver decodeObjectWithName:@"windows"];
enumerator = [_windows objectEnumerator];
while ((win = [enumerator nextObject]) != nil)
{
/* Fix up window frames */
@ -98,29 +98,29 @@ static BOOL gormFileOwnerDecoded;
[win setBackgroundColor: [NSColor windowBackgroundColor]];
}
delegate = [unarchiver decodeObjectWithName:@"delegate"];
_delegate = [unarchiver decodeObjectWithName:@"delegate"];
return self;
}
- (NSArray *) windows
{
return windows;
return _windows;
}
- mainMenu
{
return mainMenu;
return _mainMenu;
}
- windowMenu
{
return windowMenu;
return _windowMenu;
}
- delegate
{
return delegate;
return _delegate;
}
+ (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver
@ -163,11 +163,11 @@ static BOOL gormFileOwnerDecoded;
- (id)initWithModelUnarchiver: (GMUnarchiver*)unarchiver
{
id extension;
// id extension;
id realObject;
theClass = RETAIN([unarchiver decodeStringWithName: @"className"]);
extension = [unarchiver decodeObjectWithName: @"extension"];
// extension = [unarchiver decodeObjectWithName: @"extension"];
realObject = [unarchiver decodeObjectWithName: @"realObject"];
//real = [unarchiver representationForName: @"realObject" isLabeled: &label];
@ -193,10 +193,10 @@ static BOOL gormFileOwnerDecoded;
{
NSString *cn;
id realObject;
id extension;
// id extension;
cn = [unarchiver decodeStringWithName: @"className"];
extension = [unarchiver decodeObjectWithName: @"extension"];
// extension = [unarchiver decodeObjectWithName: @"extension"];
realObject = [unarchiver decodeObjectWithName: @"realObject"];
[self setFrame: [unarchiver decodeRectWithName: @"frame"]];
[self setClassName: cn];

View file

@ -0,0 +1,19 @@
# Additional include directories the compiler should search
ADDITIONAL_INCLUDE_DIRS += -I../../
ifeq ($(GNUSTEP_TARGET_OS),mingw32)
ADDITIONAL_LIB_DIRS += \
-L../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../GormCore/GormCore.framework
ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormCore
endif
ifeq ($(GNUSTEP_TARGET_OS),cygwin)
ADDITIONAL_LIB_DIRS += \
-L../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../GormCore/GormCore.framework
$(BUNDLE_NAME)_LIBRARIES_DEPEND_UPON += -lInterfaceBuilder -lGormCore
endif

View file

@ -31,9 +31,9 @@
@interface GormGormWrapperLoader : GormWrapperLoader
{
NSMutableArray *_repairLog;
id message;
id textField;
id panel;
id _message;
id _textField;
id _panel;
}
@end
@ -81,14 +81,14 @@
}
else
{
[message setStringValue: msg];
[_message setStringValue: msg];
while((m = [en nextObject]) != nil)
{
[textField insertText: m];
[_textField insertText: m];
}
[panel orderFront: self];
[_panel orderFront: self];
}
[_repairLog removeAllObjects];
@ -646,9 +646,10 @@
}
NS_HANDLER
{
NSRunAlertPanel(_(@"Problem Loading"),
[NSString stringWithFormat: @"Failed to load file. Exception: %@",[localException reason]],
_(@"OK"), nil, nil);
id delegate = [NSApp delegate];
NSString *errorMessage = [NSString stringWithFormat: @"Failed to load file. Exception: %@",[localException reason]];
[delegate exceptionWhileLoadingModel: errorMessage];
result = NO;
}
NS_ENDHANDLER;

View file

@ -0,0 +1,19 @@
# Additional include directories the compiler should search
ADDITIONAL_INCLUDE_DIRS += -I../../
ifeq ($(GNUSTEP_TARGET_OS),mingw32)
ADDITIONAL_LIB_DIRS += \
-L../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../GormCore/GormCore.framework
ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormCore
endif
ifeq ($(GNUSTEP_TARGET_OS),cygwin)
ADDITIONAL_LIB_DIRS += \
-L../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../GormCore/GormCore.framework
$(BUNDLE_NAME)_LIBRARIES_DEPEND_UPON += -lInterfaceBuilder -lGormCore
endif

View file

@ -33,8 +33,8 @@
@interface GormNibWrapperLoader : GormWrapperLoader
{
NSIBObjectData *container;
id nibFilesOwner;
NSIBObjectData *_container;
id _nibFilesOwner;
}
- (BOOL) isTopLevelObject: (id)obj;
@end

View file

@ -45,11 +45,11 @@
- (BOOL) isTopLevelObject: (id)obj
{
NSMapTable *objects = [container objects];
NSMapTable *objects = [_container objects];
id val = NSMapGet(objects,obj);
BOOL result = NO;
if(val == nibFilesOwner || val == nil)
if(val == _nibFilesOwner || val == nil)
{
result = YES;
}
@ -167,17 +167,17 @@
//
// decode
//
container = [u decodeObjectForKey: @"IB.objectdata"];
if (container == nil || [container isKindOfClass: [NSIBObjectData class]] == NO)
_container = [u decodeObjectForKey: @"IB.objectdata"];
if (_container == nil || [_container isKindOfClass: [NSIBObjectData class]] == NO)
{
result = NO;
}
else
{
nibFilesOwner = [container objectForName: @"File's Owner"];
_nibFilesOwner = [_container objectForName: @"File's Owner"];
docFilesOwner = [document filesOwner];
objects = [container names];
objects = [_container names];
objs = NSAllMapTableKeys(objects);
en = [objs objectEnumerator];
o = nil;
@ -185,9 +185,9 @@
//
// set the current class on the File's owner...
//
if([nibFilesOwner isKindOfClass: [GormObjectProxy class]])
if([_nibFilesOwner isKindOfClass: [GormObjectProxy class]])
{
[docFilesOwner setClassName: [nibFilesOwner className]];
[docFilesOwner setClassName: [_nibFilesOwner className]];
}
//
@ -200,7 +200,7 @@
NSString *objName = nil;
// skip the file's owner, it is handled above...
if(o == nibFilesOwner)
if(o == _nibFilesOwner)
continue;
//
@ -210,7 +210,7 @@
{
NSString *className = [o className];
BOOL isDeferred = [o isDeferred];
BOOL isVisible = [[container visibleWindows]
BOOL isVisible = [[_container visibleWindows]
containsObject: o];
// make the object deferred/visible...
@ -243,7 +243,7 @@
//
// Add custom classes...
//
classesTable = [container classes];
classesTable = [_container classes];
classKeys = NSAllMapTableKeys(classesTable);
en = [classKeys objectEnumerator];
while((o = [en nextObject]) != nil)
@ -263,7 +263,7 @@
//
// add connections...
//
en = [[container connections] objectEnumerator];
en = [[_container connections] objectEnumerator];
o = nil;
while((o = [en nextObject]) != nil)
{
@ -285,7 +285,7 @@
}
}
if(dest == nibFilesOwner)
if(dest == _nibFilesOwner)
{
[o setDestination: [document filesOwner]];
}
@ -294,7 +294,7 @@
[o setDestination: [document firstResponder]];
}
if(src == nibFilesOwner)
if(src == _nibFilesOwner)
{
[o setSource: [document filesOwner]];
}

View file

@ -0,0 +1,19 @@
# Additional include directories the compiler should search
ADDITIONAL_INCLUDE_DIRS += -I../../
ifeq ($(GNUSTEP_TARGET_OS),mingw32)
ADDITIONAL_LIB_DIRS += \
-L../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../GormCore/GormCore.framework
ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormCore
endif
ifeq ($(GNUSTEP_TARGET_OS),cygwin)
ADDITIONAL_LIB_DIRS += \
-L../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
-L../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
-L../../GormCore/GormCore.framework
$(BUNDLE_NAME)_LIBRARIES_DEPEND_UPON += -lInterfaceBuilder -lGormCore
endif

Some files were not shown because too many files have changed in this diff Show more