General clean up. Moved some constants. added the beginnings of a new

inspector.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@16829 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2003-05-29 05:40:28 +00:00
parent f5f3d2a5f4
commit 8fef77ed94
30 changed files with 274 additions and 67 deletions

View file

@ -1,3 +1,21 @@
2003-05-29 Gregory John Casamento <greg_casamento@yahoo.com>
* Resources/GormScrollViewAttributesInspector.gorm: new
* GormScrollViewAttributesInspector.h: new
* GormScrollViewAttributesInspector.m: new
* Palettes/0Menu/GNUmakefile.preamble: new
* Palettes/1Windows/GNUmakefile.preamble: new
* Palettes/2Controls/GNUmakefile.preamble: new
* Palettes/3Containers/GNUmakefile.preamble: new
* Palettes/4Data/GNUmakefile.preamble: new
* Gorm.m: Removed some constants and moved them to GormLib.
* GormDocument.m: Removed some constants and moved them to
GormLib.
* Palettes/(all files): Cleaned up includes.
Got rid of "../.." style of includes by using GNUmakefile
settings. Also corrected the category that some of the
classes are implementing to provide inspector names to Gorm.
2003-05-24 Gregory John Casamento <greg_casamento@yahoo.com>
* GormDocument.m: Prevent subclassing of FirstResponder.

View file

@ -117,6 +117,7 @@ Gorm_RESOURCE_FILES = \
Resources/GormPreferences.gorm \
Resources/GormPrefHeaders.gorm \
Resources/GormPrefGeneral.gorm \
Resources/GormScrollViewAttributesInspector.gorm \
Resources/Gorm.gorm
Gorm_HEADERS = \
@ -125,6 +126,7 @@ Gorm_HEADERS = \
GormCustomView.h \
GormOutlineView.h \
GormCustomClassInspector.h \
GormScrollViewAttributesInspector.h \
GormSoundInspector.h \
GormMatrixEditor.h \
GormPalettesManager.h \
@ -160,6 +162,7 @@ Gorm_OBJC_FILES = \
GormObjectEditor.m \
GormObjectInspector.m \
GormViewSizeInspector.m \
GormScrollViewAttributesInspector.m \
GormWindowEditor.m \
GormClassManager.m \
GormInspectorsManager.m \

1
Gorm.m
View file

@ -31,7 +31,6 @@
#include <AppKit/NSButton.h>
NSDate *startDate;
NSString *GormLinkPboardType = @"GormLinkPboardType";
NSString *GormToggleGuidelineNotification = @"GormToggleGuidelineNotification";
@class InfoPanel;

View file

@ -774,9 +774,10 @@ static NSImage *classesImage = nil;
GormClassManager *cm = [self classManager];
NSCharacterSet *superClassStopSet = [NSCharacterSet characterSetWithCharactersInString: @" \n"];
NSCharacterSet *classStopSet = [NSCharacterSet characterSetWithCharactersInString: @" :"];
NSCharacterSet *typeStopSet = [NSCharacterSet characterSetWithCharactersInString: @" "];
NSCharacterSet *actionStopSet = [NSCharacterSet characterSetWithCharactersInString: @";:"];
NSCharacterSet *outletStopSet = [NSCharacterSet characterSetWithCharactersInString: @";,"];
NSArray *outletTokens = [NSArray arrayWithObjects: @"id", @"IBOutlet id", nil];
NSArray *outletTokens = [NSArray arrayWithObjects: @"id", @"IBOutlet", nil];
NSArray *actionTokens = [NSArray arrayWithObjects: @"(void)", @"(IBAction)", @"(id)", nil];
while (![headerScanner isAtEnd])
@ -837,6 +838,7 @@ static NSImage *classesImage = nil;
while (![ivarScanner isAtEnd])
{
NSString *outlet = nil;
NSString *type = nil;
if (delimiter == nil || [delimiter isEqualToString: @";"])
{
@ -845,6 +847,20 @@ static NSImage *classesImage = nil;
[ivarScanner scanString: outletToken
intoString: NULL];
}
// if using the IBOutlet token in the header, scan in the outlet type
// as well.
if([outletToken isEqualToString: @"IBOutlet"])
{
[ivarScanner scanUpToCharactersFromSet: typeStopSet
intoString: NULL];
[ivarScanner scanCharactersFromSet: typeStopSet
intoString: NULL];
[ivarScanner scanUpToCharactersFromSet: typeStopSet
intoString: &type];
NSLog(@"outlet type = %@",type);
}
[ivarScanner scanUpToCharactersFromSet: outletStopSet
intoString: &outlet];
[ivarScanner scanCharactersFromSet: outletStopSet

View file

@ -24,8 +24,6 @@
#include "GormPrivate.h"
NSString *GormImagePboardType = @"GormImagePboardType";
/*
* Method to return the image that should be used to display objects within
* the matrix containing the objects in a document.

View file

@ -199,8 +199,9 @@
}
else if ([name isEqual: IBWillCloseDocumentNotification] == YES)
{
// FIXME
// show an empty selection of the document closes
[self setEmptyInspector];
// [self setEmptyInspector];
// [panel orderOut: self];
}
}

View file

@ -40,4 +40,9 @@ extern NSString *IBDidEndTestingInterfaceNotification;
- (id) selectedObject;
@end
@interface NSApplication (GormSpecific)
- (NSImage *) linkImage;
- (void) startConnecting;
@end
#endif

View file

@ -54,6 +54,7 @@ extern NSString *IBFormatterPboardType;
* NOTE: These are specific to Gorm... */
extern NSString *GormImagePboardType;
extern NSString *GormSoundPboardType;
extern NSString *GormLinkPboardType;
@interface IBPalette : NSObject
{

View file

@ -34,6 +34,11 @@ NSString *IBViewPboardType = @"IBViewPboardType";
NSString *IBWindowPboardType = @"IBWindowPboardType";
NSString *IBFormatterPboardType = @"IBFormatterPboardType";
// Gorm specific paste board types..
NSString *GormImagePboardType = @"GormImagePboardType";
NSString *GormSoundPboardType = @"GormSoundPboardType";
NSString *GormLinkPboardType = @"GormLinkPboardType";
@implementation IBPalette
static NSMapTable *viewToObject = 0;

View file

@ -118,8 +118,6 @@ extern NSString *GormToggleGuidelineNotification;
@interface NSApplication (Gorm)
- (GormClassManager*) classManager;
- (NSImage*) linkImage;
- (void) startConnecting;
@end
@interface Gorm : NSApplication <IB>

View file

@ -23,9 +23,7 @@
*/
#include <AppKit/AppKit.h>
#include "GormPrivate.h"
#include "GormBoxEditor.h"
#define _EO ((NSScrollView *)_editedObject)

View file

@ -25,8 +25,6 @@
#include "GormPrivate.h"
#include <AppKit/NSSound.h>
NSString *GormSoundPboardType = @"GormSoundPboardType";
/*
* Method to return the image that should be used to display objects within
* the matrix containing the objects in a document.

View file

@ -0,0 +1,2 @@
# Additional include directories the compiler should search
ADDITIONAL_INCLUDE_DIRS += -I../../

View file

@ -22,9 +22,10 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "../../GormPrivate.h"
#include <AppKit/AppKit.h>
#include <InterfaceBuilder/InterfaceBuilder.h>
@implementation NSMenu (GormObjectAdditions)
@implementation NSMenu (IBObjectAdditions)
- (NSString*) editorClassName
{
return @"GormMenuEditor";
@ -46,12 +47,19 @@
}
return image;
}
- (NSString*) inspectorClassName
{
return @"GormMenuAttributesInspector";
}
@end
/*
@interface NSButtonCell (GormObjectAdditions)
- (NSRect) gormTitleRectForFrame: (NSRect) cellFrame
inView: (NSView *)controlView;
@end
*/
@ -912,6 +920,8 @@ NSLog(@"Link at index: %d (%@)", pos, NSStringFromPoint(loc));
{
[document setSelectionFromEditor: self];
}
/*
else
{
id ed = nil;
@ -920,6 +930,7 @@ NSLog(@"Link at index: %d (%@)", pos, NSStringFromPoint(loc));
ed = [GormObjectEditor editorForDocument: document];
[ed selectObjects: [NSArray arrayWithObject: edited]];
}
*/
}
- (NSArray*) selection

View file

@ -22,14 +22,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "../../GormPrivate.h"
@implementation NSMenu (IBInspectorClassNames)
- (NSString*) inspectorClassName
{
return @"GormMenuAttributesInspector";
}
@end
#include <AppKit/AppKit.h>
#include <InterfaceBuilder/InterfaceBuilder.h>
@interface GormMenuAttributesInspector : IBInspector
{
@ -92,7 +86,7 @@
@implementation NSMenuItem (IBInspectorClassNames)
@implementation NSMenuItem (IBObjectAdditions)
- (NSString*) inspectorClassName
{
return @"GormMenuItemAttributesInspector";

View file

@ -24,7 +24,6 @@
#include <Foundation/Foundation.h>
#include <AppKit/AppKit.h>
#include <InterfaceBuilder/InterfaceBuilder.h>
#include "../../GormPrivate.h"
#include "GormNSMenu.h"
@interface MenusPalette: IBPalette

View file

@ -23,7 +23,7 @@
*/
#include <Foundation/Foundation.h>
#include <AppKit/AppKit.h>
#include "../../GormPrivate.h"
#include "GormPrivate.h"
#include "GormNSWindow.h"
#include "GormNSPanel.h"

View file

@ -0,0 +1,2 @@
# Additional include directories the compiler should search
ADDITIONAL_INCLUDE_DIRS += -I../../

View file

@ -1,14 +1,10 @@
#include <AppKit/AppKit.h>
#include "../../GormPrivate.h"
#include "../../GormControlEditor.h"
#include "../../GormViewWithSubviewsEditor.h"
#include "GormPrivate.h"
#include "GormControlEditor.h"
#include "GormViewWithSubviewsEditor.h"
#define _EO ((NSPopUpButton *)_editedObject)
@class GormNSPopUpButtonCell;
Class _gormnspopupbuttonCellClass = 0;

View file

@ -24,7 +24,7 @@
*/
#include <Foundation/Foundation.h>
#include <AppKit/AppKit.h>
#include "../../GormPrivate.h"
#include <InterfaceBuilder/InterfaceBuilder.h>
/* This macro makes sure that the string contains a value, even if @"" */
#define VSTR(str) ({id _str = str; (_str) ? _str : @"";})
@ -32,7 +32,7 @@
/*----------------------------------------------------------------------------
* NSBox
*/
@implementation NSBox (IBInspectorClassNames)
@implementation NSBox (IBObjectAdditions)
- (NSString*) inspectorClassName
{
@ -124,7 +124,7 @@
/*----------------------------------------------------------------------------
* NSButton
*/
@implementation NSButton (IBInspectorClassNames)
@implementation NSButton (IBObjectAdditions)
- (NSString*) inspectorClassName
{
@ -383,7 +383,7 @@
/*----------------------------------------------------------------------------
* NSButtonCell
*/
@implementation NSButtonCell (IBInspectorClassNames)
@implementation NSButtonCell (IBObjectAdditions)
- (NSString*) inspectorClassName
{
@ -403,7 +403,7 @@
/*----------------------------------------------------------------------------
* NSCell
*/
@implementation NSCell (IBInspectorClassNames)
@implementation NSCell (IBObjectAdditions)
- (NSString*) inspectorClassName
{
@ -472,7 +472,7 @@
/*----------------------------------------------------------------------------
* NSForm
*/
@implementation NSForm (IBInspectorClassNames)
@implementation NSForm (IBObjectAdditions)
- (NSString*) inspectorClassName
{
@ -636,7 +636,7 @@
/*----------------------------------------------------------------------------
* NSMatrix
*/
@implementation NSMatrix (IBInspectorClassNames)
@implementation NSMatrix (IBObjectAdditions)
- (NSString*) inspectorClassName
{
@ -794,7 +794,7 @@
/*----------------------------------------------------------------------------
* NSPopUpButton
*/
@implementation NSPopUpButton (IBInspectorClassNames)
@implementation NSPopUpButton (IBObjectAdditions)
- (NSString*) inspectorClassName
{
@ -877,7 +877,7 @@
/*----------------------------------------------------------------------------
* NSSlider
*/
@implementation NSSlider (IBInspectorClassNames)
@implementation NSSlider (IBObjectAdditions)
- (NSString*) inspectorClassName
{
@ -990,7 +990,7 @@
/*----------------------------------------------------------------------------
* NSStepper
*/
@implementation NSStepper (IBInspectorClassNames)
@implementation NSStepper (IBObjectAdditions)
- (NSString*) inspectorClassName
{
@ -1116,7 +1116,7 @@
/*----------------------------------------------------------------------------
* NSStepperCell
*/
@implementation NSStepperCell (IBInspectorClassNames)
@implementation NSStepperCell (IBObjectAdditions)
- (NSString*) inspectorClassName
{
@ -1136,7 +1136,7 @@
/*----------------------------------------------------------------------------
* NSTextField
*/
@implementation NSTextField (IBInspectorClassNames)
@implementation NSTextField (IBObjectAdditions)
- (NSString*) inspectorClassName
{

View file

@ -24,7 +24,7 @@
#include <Foundation/Foundation.h>
#include <AppKit/AppKit.h>
#include <InterfaceBuilder/IBPalette.h>
#include "../../GormCustomView.h"
#include "GormCustomView.h"
// @class GormPopUpNSMenu;
@class GormNSPopUpButton;

View file

@ -0,0 +1,2 @@
# Additional include directories the compiler should search
ADDITIONAL_INCLUDE_DIRS += -I../../

View file

@ -24,7 +24,7 @@
#ifndef INCLUDED_GormTableViewEditor_h
#define INCLUDED_GormTableViewEditor_h
#include "../../GormViewWithSubviewsEditor.h"
#include "GormViewWithSubviewsEditor.h"
@class GormNSTableView;

View file

@ -22,8 +22,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "../../GormPrivate.h"
#include <AppKit/AppKit.h>
#include <InterfaceBuilder/InterfaceBuilder.h>
#include "GormTableViewEditor.h"
#include "GormNSTableView.h"

View file

@ -24,17 +24,17 @@
#include <Foundation/Foundation.h>
#include <AppKit/AppKit.h>
#include "../../GormPrivate.h"
#include "GormNSTableView.h"
#include "../../GormInternalViewEditor.h"
#include <InterfaceBuilder/IBInspector.h>
#include <InterfaceBuilder/IBObjectAdditions.h>
/* This macro makes sure that the string contains a value, even if @"" */
#define VSTR(str) ({id _str = str; (_str) ? _str : @"";})
/*----------------------------------------------------------------------------
* NSBrowser
*/
@implementation NSBrowser (IBInspectorClassNames)
@implementation NSBrowser (IBObjectAdditions)
- (NSString*) inspectorClassName
{
@ -164,7 +164,7 @@
/*----------------------------------------------------------------------------
* NSTableColumn
*/
@implementation NSTableColumn (IBInspectorClassNames)
@implementation NSTableColumn (IBObjectAdditions)
- (NSString *) inspectorClassName
{
return @"GormTableColumnAttributesInspector";
@ -376,7 +376,7 @@
/*----------------------------------------------------------------------------
* NSTableView (possibly embedded in a Scroll view)
*/
@implementation NSTableView (IBInspectorClassNames)
@implementation NSTableView (IBObjectAdditions)
- (NSString*) inspectorClassName
{
@ -564,7 +564,7 @@
* (like horizontal and vertical scrollbar)
*/
@implementation NSScrollView (IBInspectorClassNames)
@implementation NSScrollView (IBObjectAdditions)
- (NSString*) inspectorClassName
{
@ -588,20 +588,13 @@
static NSString *ITEM=@"item";
@implementation NSTabView (IBInspectorClassNames)
@implementation NSTabView (IBObjectAdditions)
- (NSString*) inspectorClassName
{
return @"GormTabViewInspector";
}
/*
- (NSString*) sizeInspectorClassName
{
// return @"GormTableViewSizeInspector";
}
*/
@end
@interface GormTabViewInspector : IBInspector

View file

@ -0,0 +1,2 @@
# Additional include directories the compiler should search
ADDITIONAL_INCLUDE_DIRS += -I../../

View file

@ -21,10 +21,11 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <Foundation/Foundation.h>
#include <AppKit/AppKit.h>
#include "../../GormPrivate.h"
#include "../../GormViewEditor.h"
#include "GormPrivate.h"
#include "GormViewEditor.h"
/* This macro makes sure that the string contains a value, even if @"" */
#define VSTR(str) ({id _str = str; (_str) ? _str : @"";})

View file

@ -21,11 +21,10 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <Foundation/Foundation.h>
#include <AppKit/AppKit.h>
#include <InterfaceBuilder/IBPalette.h>
#include "../../GormPrivate.h"
#include <InterfaceBuilder/InterfaceBuilder.h>
/* -----------------------------------------------------------
* Some additions to the NSNumberFormatter Class specific to Gorm

View file

@ -0,0 +1,166 @@
{
FirstResponder = {
Actions = (
"activateContextHelpMode:",
"alignCenter:",
"alignJustified:",
"alignLeft:",
"alignRight:",
"arrangeInFront:",
"cancel:",
"capitalizeWord:",
"changeColor:",
"changeFont:",
"checkSpelling:",
"close:",
"complete:",
"copy:",
"copyFont:",
"copyRuler:",
"cut:",
"delete:",
"deleteBackward:",
"deleteForward:",
"deleteToBeginningOfLine:",
"deleteToBeginningOfParagraph:",
"deleteToEndOfLine:",
"deleteToEndOfParagraph:",
"deleteToMark:",
"deleteWordBackward:",
"deleteWordForward:",
"deminiaturize:",
"deselectAll:",
"fax:",
"hide:",
"hideOtherApplications:",
"indent:",
"loosenKerning:",
"lowerBaseline:",
"lowercaseWord:",
"makeKeyAndOrderFront:",
"miniaturize:",
"miniaturizeAll:",
"moveBackward:",
"moveBackwardAndModifySelection:",
"moveDown:",
"moveDownAndModifySelection:",
"moveForward:",
"moveForwardAndModifySelection:",
"moveLeft:",
"moveRight:",
"moveToBeginningOfDocument:",
"moveToBeginningOfLine:",
"moveToBeginningOfParagraph:",
"moveToEndOfDocument:",
"moveToEndOfLine:",
"moveToEndOfParagraph:",
"moveUp:",
"moveUpAndModifySelection:",
"moveWordBackward:",
"moveWordBackwardAndModifySelection:",
"moveWordForward:",
"moveWordForwardAndModifySelection:",
"newDocument:",
"ok:",
"openDocument:",
"orderBack:",
"orderFront:",
"orderFrontColorPanel:",
"orderFrontDataLinkPanel:",
"orderFrontFontPanel:",
"orderFrontHelpPanel:",
"orderFrontStandardAboutPanel:",
"orderFrontStandardInfoPanel:",
"orderOut:",
"pageDown:",
"pageUp:",
"paste:",
"pasteAsPlainText:",
"pasteAsRichText:",
"pasteFont:",
"pasteRuler:",
"performClose:",
"performMiniaturize:",
"performZoom:",
"print:",
"raiseBaseline:",
"revertDocumentToSaved:",
"runPageLayout:",
"runToolbarCustomizationPalette:",
"saveAllDocuments:",
"saveDocument:",
"saveDocumentAs:",
"saveDocumentTo:",
"scrollLineDown:",
"scrollLineUp:",
"scrollPageDown:",
"scrollPageUp:",
"scrollViaScroller:",
"selectAll:",
"selectLine:",
"selectNextKeyView:",
"selectParagraph:",
"selectPreviousKeyView:",
"selectText:",
"selectText:",
"selectToMark:",
"selectWord:",
"showContextHelp:",
"showGuessPanel:",
"showHelp:",
"showWindow:",
"stop:",
"subscript:",
"superscript:",
"swapWithMark:",
"takeDoubleValueFrom:",
"takeFloatValueFrom:",
"takeIntValueFrom:",
"takeObjectValueFrom:",
"takeStringValueFrom:",
"terminate:",
"tightenKerning:",
"toggle:",
"toggleContinuousSpellChecking:",
"toggleRuler:",
"toggleToolbarShown:",
"toggleTraditionalCharacterShape:",
"transpose:",
"transposeWords:",
"turnOffKerning:",
"turnOffLigatures:",
"underline:",
"unhide:",
"unhideAllApplications:",
"unscript:",
"uppercaseWord:",
"useAllLigatures:",
"useStandardKerning:",
"useStandardLigatures:",
"yank:",
"zoom:",
"borderSelected:",
"horizontalSelected:",
"verticalSelected:",
"colorSelected:"
);
Super = NSObject;
};
GormScrollViewAttributesInspector = {
Actions = (
"borderSelected:",
"horizontalSelected:",
"verticalSelected:",
"colorSelected:"
);
Outlets = (
borderMatrix,
horizontalScroll,
verticalScroll,
color,
lineAmount,
pageContext
);
Super = IBInspector;
};
}