Compare commits

...

2 commits

Author SHA1 Message Date
GNUstep Maintainer
09f1c0417d This commit was manufactured by cvs2svn to create tag
'OLD_STYLE_INTERFACE'.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/tags/OLD_STYLE_INTERFACE@7924 72102866-910b-0410-8b05-ffd578937521
2000-10-29 12:16:46 +00:00
GNUstep Maintainer
05aab7c157 This commit was manufactured by cvs2svn to create branch 'phr'.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/branches/phr@7259 72102866-910b-0410-8b05-ffd578937521
2000-08-27 19:11:42 +00:00
76 changed files with 3164 additions and 3799 deletions

View file

@ -9,8 +9,8 @@ What is ProjectCenter?
The file `INSTALL' gives instructions for installing the package.
The GNUstep web site at `http://www.prjectcenter.ch' contains more
information.
The GNUstep web site at `http://www.projectcenter.ch' contains more
up-to-date information.
ProjectCenter is covered under the GNU Public License. This means if you
make changes to these programs, you cannot charge a fee, other than
@ -32,11 +32,8 @@ Machines
GNUstep ProjectCenter is known to compile on the following machines.
* OpenStep 4.x/m68k
* OpenStep 4.x/ix86
* Linux/GNUstep 0.6.5
* Linux x86, GNUstep 0.6.6 or newer
* Linux PPC, GNUstep 0.6.6 or newer
Where do I send bug reports?
============================

26
INSTALL
View file

@ -8,19 +8,27 @@ distribute, and modify it freely as long as you preserve this copyright
notice and permission notice.
Installing `ProjectCenter'
====================
=========================
The ProjectCenter tool runs on OpenStep 4.2 and GNUstep. It's
possible it will run on other versions of OPENSTEP, but it has not been
tried yet.
ProjectCenter requires GNUstep to be installed. Make sure that you have an
up to date version on your system installed!
In order to use apps built with ProjectCenter, you will need at least a
version not older than from October 2000.
Here is a quick-and-dirty example of installation commands:
Here is a quick-and-dirty example of installation commands:
GNUstep: make install;
OPENSTEP 4.2: make; make install
If you want to do make; make install, make sure that you
first make; make install PCLib, and *then* the rest of the
sources!
(or open the project in PB.app and compile it from there)
In order to do this successfully you must first install PCLib and the bundles and then the application itself!
GNUstep: make; make install;
Important!
==========
In order to do this successfully you must first install PCLib and the bundles and then the application itself!
When ProjectCenter fails to launch due to a missing bundle path, you can set it
using GNUstep's defaults tool:
opentool defaults write ProjectCenter BundlePaths /usr/GNUstep/Local/Library/ProjectCenter

View file

@ -8,15 +8,26 @@
* $Id$
*/
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
@interface AppController : NSObject
{
}
+ (void)initialize;
- (id)init;
- (void)dealloc;
- (void)awakeFromNib;
- (void)applicationDidFinishLaunching:(NSNotification *)notif;
- (void)applicationShouldTerminate:(id)sender;
- (void)applicationWillTerminate:(NSNotification *)notification;
- (BOOL)application:(NSApplication *)application openFile:(NSString *)fileName;
- (void)showPrefPanel:(id)sender;
- (void)showInfoPanel:(id)sender;
@end

View file

@ -12,6 +12,24 @@
@implementation AppController
static NSDictionary *infoDict = nil;
+ (void)initialize
{
NSMutableDictionary *defaults = [NSMutableDictionary dictionary];
/*
* Register your app's defaults here by adding objects to the
* dictionary, eg
*
* [defaults setObject:anObject forKey:keyForThatObject];
*
*/
[[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
[[NSUserDefaults standardUserDefaults] synchronize];
}
- (id)init
{
if ((self = [super init])) {
@ -28,4 +46,29 @@
{
}
- (void)applicationDidFinishLaunching:(NSNotification *)notif
{
}
- (void)applicationShouldTerminate:(id)sender
{
}
- (void)applicationWillTerminate:(NSNotification *)notification
{
}
- (BOOL)application:(NSApplication *)application openFile:(NSString *)fileName
{
}
- (void)showPrefPanel:(id)sender
{
}
- (void)showInfoPanel:(id)sender
{
[[NSApplication sharedApplication] orderFrontStandardInfoPanel:sender];
}
@end

View file

@ -1,133 +0,0 @@
{
"Object 1" = {elements = ("Object 2"); isa = NSMutableArray; };
"Object 2" = {className = PCAppProject; isa = IMCustomObject; realObject = "Object 3"; };
"Object 3" = {
delegate = nil;
isa = NSApplication;
keyWindow = nil;
mainMenu = nil;
mainWindow = nil;
windows = "Object 4";
};
"Object 4" = {
elements = ("Object 5", "Object 9", "Object 11");
isa = NSMutableArray;
};
"Object 5" = {
backgroundColor = "Object 8";
backingType = 0;
contentFrame = "{x = 0; y = 0; width = 256; height = 128}";
contentView = "Object 6";
frameAutosaveName = nil;
hidesOnDeactivate = NO;
initialFirstResponder = nil;
isAutodisplay = NO;
isReleasedWhenClosed = NO;
isVisible = NO;
isa = NSWindow;
level = 0;
maxSize = "{width = 3.40282e+38; height = 3.40282e+38}";
minSize = "{width = 0; height = 0}";
representedFilename = "";
styleMask = 0;
title = "";
};
"Object 6" = {
autoresizesSubviews = YES;
autoresizingMask = 0;
bounds = "{x = 0; y = 0; width = 256; height = 128}";
frame = "{x = 0; y = 0; width = 256; height = 128}";
interfaceStyle = 0;
isa = NSView;
nextKeyView = nil;
nextResponder = "Object 5";
postsBoundsChangedNotifications = YES;
postsFrameChangedNotifications = YES;
previousKeyView = nil;
subviews = "Object 7";
superview = nil;
};
"Object 7" = {elements = (); isa = NSMutableArray; };
"Object 8" = {
alpha = 1.000000;
blue = 0.666667;
brightness = 0.666667;
colorSpaceName = NSCalibratedRGBColorSpace;
green = 0.666667;
hue = 0.000000;
isa = NSColor;
red = 0.666667;
saturation = 0.000000;
};
"Object 9" = {
backgroundColor = "Object 8";
backingType = 0;
contentFrame = "{x = 0; y = 0; width = 193; height = 208}";
contentView = "Object 10";
frameAutosaveName = nil;
hidesOnDeactivate = NO;
initialFirstResponder = nil;
isAutodisplay = NO;
isReleasedWhenClosed = NO;
isVisible = NO;
isa = NSWindow;
level = 0;
maxSize = "{width = 3.40282e+38; height = 3.40282e+38}";
minSize = "{width = 0; height = 0}";
representedFilename = "";
styleMask = 0;
title = "";
};
"Object 10" = {
autoresizesSubviews = YES;
autoresizingMask = 0;
bounds = "{x = 0; y = 0; width = 193; height = 208}";
frame = "{x = 0; y = 0; width = 193; height = 208}";
interfaceStyle = 0;
isa = NSView;
nextKeyView = nil;
nextResponder = "Object 9";
postsBoundsChangedNotifications = YES;
postsFrameChangedNotifications = YES;
previousKeyView = nil;
subviews = "Object 7";
superview = nil;
};
"Object 11" = {
backgroundColor = "Object 8";
backingType = 2;
contentFrame = "{x = 221; y = 299; width = 512; height = 320}";
contentView = "Object 12";
frameAutosaveName = nil;
hidesOnDeactivate = NO;
initialFirstResponder = nil;
isAutodisplay = YES;
isReleasedWhenClosed = NO;
isVisible = NO;
isa = NSWindow;
level = 0;
maxSize = "{width = 3.40282e+38; height = 3.40282e+38}";
minSize = "{width = 514; height = 352}";
representedFilename = "";
styleMask = 14;
title = Window;
};
"Object 12" = {
autoresizesSubviews = NO;
autoresizingMask = 0;
bounds = "{x = 0; y = 0; width = 512; height = 320}";
frame = "{x = 1; y = 9; width = 512; height = 320}";
interfaceStyle = 0;
isa = NSView;
nextKeyView = nil;
nextResponder = "Object 11";
postsBoundsChangedNotifications = YES;
postsFrameChangedNotifications = YES;
previousKeyView = nil;
subviews = "Object 7";
superview = nil;
};
RootObject = {Connections = "Object 7"; Objects = "Object 1"; isa = GMModel; };
TopLevelObjects = (RootObject);
Version = 1;
}

40
PCAppProj/ChangeLog Normal file
View file

@ -0,0 +1,40 @@
2000-09-20 10:50 robert
* AppController.h, AppController.m, PCAppMakefileFactory.m,
PCAppProj.m, main.m: enhanced the created app to support GC and an
info panel and more ...
2000-09-17 14:14 robert
* PCAppProject.h, PCAppProject.m: daily work
2000-09-14 10:54 robert
* AppController.h, AppController.m, AppProject.gmodel, GNUmakefile,
Main.gmodel, PC.proj, PCAppMakefileFactory.m, main.m: apps now
don't use gmodels anymore
2000-09-03 22:10 robert
* GNUmakefile.preamble: renamed libPC into libProjectCenter
2000-08-27 21:11 robert
* Makefile.preamble, PB.project, PCAppProj.h, Makefile, h.template,
m.template, Info.table, PCAppProj.m, Makefile.postamble,
PCAppProject.h, PCAppProject.m, GNUmakefile.postamble,
GNUmakefile.preamble, PC.proj, main.m, PCAppMakefileFactory.h,
PCAppMakefileFactory.m, AppProject.gmodel, GNUmakefile,
AppController.h, AppController.m, Info-project.plist, Main.gmodel:
Initial revision
2000-08-27 21:11 robert
* Makefile.preamble, PB.project, PCAppProj.h, Makefile, h.template,
m.template, Info.table, PCAppProj.m, Makefile.postamble,
PCAppProject.h, PCAppProject.m, GNUmakefile.postamble,
GNUmakefile.preamble, PC.proj, main.m, PCAppMakefileFactory.h,
PCAppMakefileFactory.m, AppProject.gmodel, GNUmakefile,
AppController.h, AppController.m, Info-project.plist, Main.gmodel:
Initial import

View file

@ -40,9 +40,7 @@ PCAppProj_HEADERS= \
PCAppProj_PRINCIPAL_CLASS = PCAppProj
PCAppProj_RESOURCE_FILES = \
AppProject.gmodel \
PC.proj \
Main.gmodel \
main.m \
AppController.h \
AppController.m \

View file

@ -52,7 +52,7 @@ ADDITIONAL_CFLAGS +=
ADDITIONAL_INCLUDE_DIRS +=
# Additional LDFLAGS to pass to the linker
ADDITIONAL_LDFLAGS += -lPC
ADDITIONAL_LDFLAGS += -lProjectCenter
# Additional library directories the linker should search
ADDITIONAL_LIB_DIRS +=

View file

@ -1,436 +0,0 @@
{
"Object 1" = {elements = ("Object 2", "Object 37"); isa = NSMutableArray; };
"Object 2" = {className = NSApplication; isa = IMCustomObject; realObject = "Object 3"; };
"Object 3" = {
delegate = nil;
isa = NSApplication;
keyWindow = nil;
mainMenu = "Object 11";
mainWindow = nil;
windows = "Object 4";
};
"Object 4" = {elements = ("Object 5", "Object 9"); isa = NSMutableArray; };
"Object 5" = {
backgroundColor = "Object 8";
backingType = 0;
contentFrame = "{x = 0; y = 0; width = 256; height = 128}";
contentView = "Object 6";
frameAutosaveName = nil;
hidesOnDeactivate = NO;
initialFirstResponder = nil;
isAutodisplay = NO;
isReleasedWhenClosed = NO;
isVisible = NO;
isa = NSWindow;
level = 0;
maxSize = "{width = 3.40282e+38; height = 3.40282e+38}";
minSize = "{width = 0; height = 0}";
representedFilename = "";
styleMask = 0;
title = "";
};
"Object 6" = {
autoresizesSubviews = YES;
autoresizingMask = 0;
bounds = "{x = 0; y = 0; width = 256; height = 128}";
frame = "{x = 0; y = 0; width = 256; height = 128}";
interfaceStyle = 0;
isa = NSView;
nextKeyView = nil;
nextResponder = "Object 5";
postsBoundsChangedNotifications = YES;
postsFrameChangedNotifications = YES;
previousKeyView = nil;
subviews = "Object 7";
superview = nil;
};
"Object 7" = {elements = (); isa = NSMutableArray; };
"Object 8" = {
alpha = 1.000000;
blue = 0.666667;
brightness = 0.666667;
colorSpaceName = NSCalibratedRGBColorSpace;
green = 0.666667;
hue = 0.000000;
isa = NSColor;
red = 0.666667;
saturation = 0.000000;
};
"Object 9" = {
backgroundColor = "Object 8";
backingType = 0;
contentFrame = "{x = 0; y = 0; width = 193; height = 208}";
contentView = "Object 10";
frameAutosaveName = nil;
hidesOnDeactivate = NO;
initialFirstResponder = nil;
isAutodisplay = NO;
isReleasedWhenClosed = NO;
isVisible = NO;
isa = NSWindow;
level = 0;
maxSize = "{width = 3.40282e+38; height = 3.40282e+38}";
minSize = "{width = 0; height = 0}";
representedFilename = "";
styleMask = 0;
title = "";
};
"Object 10" = {
autoresizesSubviews = YES;
autoresizingMask = 0;
bounds = "{x = 0; y = 0; width = 193; height = 208}";
frame = "{x = 0; y = 0; width = 193; height = 208}";
interfaceStyle = 0;
isa = NSView;
nextKeyView = nil;
nextResponder = "Object 9";
postsBoundsChangedNotifications = YES;
postsFrameChangedNotifications = YES;
previousKeyView = nil;
subviews = "Object 7";
superview = nil;
};
"Object 11" = {
autoenablesItems = YES;
isa = NSMenu;
itemArray = "Object 12";
title = GNUstep;
};
"Object 12" = {
elements = (
"Object 13",
"Object 20",
"Object 27",
"Object 33",
"Object 35",
"Object 36"
);
isa = NSMutableArray;
};
"Object 13" = {
action = "submenuAction:";
image = "Object 14";
isEnabled = YES;
isa = NSMenuItem;
keyEquivalent = "";
representedObject = nil;
state = 0;
tag = 0;
target = "Object 15";
title = Info;
};
"Object 14" = {isa = NSImage; name = NSMenuArrow; size = "{width = 12; height = 9}"; };
"Object 15" = {
autoenablesItems = YES;
isa = NSMenu;
itemArray = "Object 16";
title = Info;
};
"Object 16" = {
elements = ("Object 17", "Object 18", "Object 19");
isa = NSMutableArray;
};
"Object 17" = {
action = nil;
image = nil;
isEnabled = NO;
isa = NSMenuItem;
keyEquivalent = "";
representedObject = nil;
state = 0;
tag = 0;
target = nil;
title = "Info Panel...";
};
"Object 18" = {
action = nil;
image = nil;
isEnabled = NO;
isa = NSMenuItem;
keyEquivalent = "";
representedObject = nil;
state = 0;
tag = 0;
target = nil;
title = Preferences...;
};
"Object 19" = {
action = nil;
image = nil;
isEnabled = YES;
isa = NSMenuItem;
keyEquivalent = "?";
representedObject = nil;
state = 0;
tag = 0;
target = nil;
title = Help...;
};
"Object 20" = {
action = "submenuAction:";
image = "Object 14";
isEnabled = YES;
isa = NSMenuItem;
keyEquivalent = "";
representedObject = nil;
state = 0;
tag = 0;
target = "Object 21";
title = Edit;
};
"Object 21" = {
autoenablesItems = YES;
isa = NSMenu;
itemArray = "Object 22";
title = Edit;
};
"Object 22" = {
elements = ("Object 23", "Object 24", "Object 25", "Object 26");
isa = NSMutableArray;
};
"Object 23" = {
action = nil;
image = nil;
isEnabled = YES;
isa = NSMenuItem;
keyEquivalent = x;
representedObject = nil;
state = 0;
tag = 0;
target = nil;
title = Cut;
};
"Object 24" = {
action = nil;
image = nil;
isEnabled = YES;
isa = NSMenuItem;
keyEquivalent = c;
representedObject = nil;
state = 0;
tag = 0;
target = nil;
title = Copy;
};
"Object 25" = {
action = nil;
image = nil;
isEnabled = YES;
isa = NSMenuItem;
keyEquivalent = v;
representedObject = nil;
state = 0;
tag = 0;
target = nil;
title = Paste;
};
"Object 26" = {
action = nil;
image = nil;
isEnabled = YES;
isa = NSMenuItem;
keyEquivalent = a;
representedObject = nil;
state = 0;
tag = 0;
target = nil;
title = "Select All";
};
"Object 27" = {
action = "submenuAction:";
image = "Object 14";
isEnabled = YES;
isa = NSMenuItem;
keyEquivalent = "";
representedObject = nil;
state = 0;
tag = 0;
target = "Object 28";
title = Windows;
};
"Object 28" = {
autoenablesItems = YES;
isa = NSMenu;
itemArray = "Object 29";
title = Windows;
};
"Object 29" = {
elements = ("Object 30", "Object 31", "Object 32");
isa = NSMutableArray;
};
"Object 30" = {
action = nil;
image = nil;
isEnabled = YES;
isa = NSMenuItem;
keyEquivalent = "";
representedObject = nil;
state = 0;
tag = 0;
target = nil;
title = "Arrange in Front";
};
"Object 31" = {
action = nil;
image = nil;
isEnabled = YES;
isa = NSMenuItem;
keyEquivalent = m;
representedObject = nil;
state = 0;
tag = 0;
target = nil;
title = "Miniaturize Window";
};
"Object 32" = {
action = nil;
image = nil;
isEnabled = YES;
isa = NSMenuItem;
keyEquivalent = w;
representedObject = nil;
state = 0;
tag = 0;
target = nil;
title = "Close Window";
};
"Object 33" = {
action = "submenuAction:";
image = "Object 14";
isEnabled = YES;
isa = NSMenuItem;
keyEquivalent = "";
representedObject = nil;
state = 0;
tag = 0;
target = "Object 34";
title = Services;
};
"Object 34" = {
autoenablesItems = YES;
isa = NSMenu;
itemArray = "Object 7";
title = Services;
};
"Object 35" = {
action = nil;
image = nil;
isEnabled = YES;
isa = NSMenuItem;
keyEquivalent = h;
representedObject = nil;
state = 0;
tag = 0;
target = nil;
title = Hide;
};
"Object 36" = {
action = nil;
image = nil;
isEnabled = YES;
isa = NSMenuItem;
keyEquivalent = q;
representedObject = nil;
state = 0;
tag = 0;
target = nil;
title = Quit;
};
"Object 37" = {className = AppController; isa = IMCustomObject; };
"Object 38" = {
elements = (
"Object 39",
"Object 41",
"Object 43",
"Object 45",
"Object 47",
"Object 49",
"Object 51",
"Object 53",
"Object 55",
"Object 57",
"Object 59"
);
isa = NSMutableArray;
};
"Object 39" = {
destination = nil;
isa = IMControlConnector;
label = "Object 40";
source = "Object 23";
};
"Object 40" = {isa = NSString; string = "cut:"; };
"Object 41" = {
destination = nil;
isa = IMControlConnector;
label = "Object 42";
source = "Object 24";
};
"Object 42" = {isa = NSString; string = "copy:"; };
"Object 43" = {
destination = nil;
isa = IMControlConnector;
label = "Object 44";
source = "Object 25";
};
"Object 44" = {isa = NSString; string = "paste:"; };
"Object 45" = {
destination = nil;
isa = IMControlConnector;
label = "Object 46";
source = "Object 26";
};
"Object 46" = {isa = NSString; string = "selectAll:"; };
"Object 47" = {
destination = "Object 2";
isa = IMControlConnector;
label = "Object 48";
source = "Object 36";
};
"Object 48" = {isa = NSString; string = "terminate:"; };
"Object 49" = {
destination = "Object 2";
isa = IMControlConnector;
label = "Object 50";
source = "Object 35";
};
"Object 50" = {isa = NSString; string = "hide:"; };
"Object 51" = {
destination = nil;
isa = IMControlConnector;
label = "Object 52";
source = "Object 19";
};
"Object 52" = {isa = NSString; string = "showHelp:"; };
"Object 53" = {
destination = nil;
isa = IMControlConnector;
label = "Object 54";
source = "Object 31";
};
"Object 54" = {isa = NSString; string = "performMiniaturize:"; };
"Object 55" = {
destination = nil;
isa = IMControlConnector;
label = "Object 56";
source = "Object 32";
};
"Object 56" = {isa = NSString; string = "performClose:"; };
"Object 57" = {
destination = nil;
isa = IMControlConnector;
label = "Object 58";
source = "Object 30";
};
"Object 58" = {isa = NSString; string = "arrangeInFront:"; };
"Object 59" = {
destination = "Object 37";
isa = IMOutletConnector;
label = "Object 60";
source = "Object 2";
};
"Object 60" = {isa = NSString; string = delegate; };
RootObject = {Connections = "Object 38"; Objects = "Object 1"; isa = GMModel; };
TopLevelObjects = (RootObject);
Version = 1;
}

View file

@ -10,12 +10,12 @@
FOUNDATION = "GNUSTEP-BASE";
FRAMEWORKS = ();
HEADER_FILES = ("AppController.h");
INTERFACES = ("Main.gmodel");
INTERFACES = ();
IMAGES = ();
LANGUAGE = "English";
LAST_EDITING = "";
LIBRARIES = ("gnustep-base","gnustep-gui");
MAININTERFACE = "Main.gmodel";
MAININTERFACE = "";
MAKEFILEDIR = "/usr/GNUstep/Makefiles";
INSTALLDIR = "$(HOME)/Apps";
OTHER_FILES = ();

View file

@ -77,8 +77,8 @@ static PCAppMakefileFactory *_factory = nil;
[string appendString:@"#\n\n"];
[string appendString:[NSString stringWithFormat:@"APP_NAME=%@\n",prName]];
// [string appendString:[NSString stringWithFormat:@"%@_PRINCIPAL_CLASS=%@\n",prName,[prDict objectForKey:PCPrincipalClass]]];
[string appendString:[NSString stringWithFormat:@"%@_MAIN_MODEL_FILE=%@\n",prName,[prDict objectForKey:PCMainGModelFile]]];
// [string appendString:[NSString stringWithFormat:@"%@_PRINCIPAL_CLASS=%@\n",prName,[prDict objectForKey:PCPrincipalClass]]];
//[string appendString:[NSString stringWithFormat:@"%@_MAIN_MODEL_FILE=%@\n",prName,[prDict objectForKey:PCMainGModelFile]]];
[string appendString:[NSString stringWithFormat:@"%@_APPLICATION_ICON=%@\n",prName, [prDict objectForKey:PCAppIcon]]];
[string appendString:@"#\n\n"];
@ -108,7 +108,7 @@ static PCAppMakefileFactory *_factory = nil;
enumerator = [[prDict objectForKey:k] objectEnumerator];
while (tmp = [enumerator nextObject]) {
[string appendString:[NSString stringWithFormat:@"\\\nEnglish.lproj/%@ ",tmp]];
[string appendString:[NSString stringWithFormat:@"\\\n%@ ",tmp]];
}
}

View file

@ -79,7 +79,9 @@ static PCAppProj *_creator = nil;
NSString *_file;
NSString *_resourcePath;
NSMutableDictionary *dict;
NSDictionary *infoDict;
NSString *plistFileName;
project = [[[PCAppProject alloc] init] autorelease];
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"PC" ofType:@"proj"];
@ -89,10 +91,32 @@ static PCAppProj *_creator = nil;
[dict setObject:[path lastPathComponent] forKey:PCProjectName];
[dict setObject:[project principalClass] forKey:PCProjType];
// Create the AppNameInfo.plist
infoDict = [NSDictionary dictionaryWithObjectsAndKeys:
@"Automatically generated!",@"NOTE",
[path lastPathComponent],@"ApplicationName",
@"",@"ApplicationDescription",
@"",@"ApplicationIcon",
@"0.1",@"ApplicationRelease",
@"0.1",@"FullVersionID",
@"",@"Authors",
@"",@"URL",
@"Copyright (C) 200x by ...",@"Copyright",
@"Released under ...",@"CopyrightDescription", nil];
plistFileName = [NSString stringWithFormat:@"%@Info.plist",[path lastPathComponent]];
[infoDict writeToFile:[path stringByAppendingPathComponent:plistFileName] atomically:YES];
[dict setObject:[NSArray arrayWithObjects:plistFileName,nil]
forKey:PCOtherResources];
// Save the project to disc
[dict writeToFile:[path stringByAppendingPathComponent:@"PC.project"] atomically:YES];
/*
* Copy the project files to the provided path
*
*/
// Copy the project files to the provided path
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"GNUmakefile" ofType:@"postamble"];
[fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"GNUmakefile.postamble"] handler:nil];

View file

@ -38,8 +38,11 @@
@interface PCAppProject : PCProject
{
@private
BOOL _needsAdditionalReleasing;
NSTextField *appClassField;
NSTextField *appImageField;
NSButton *setAppIconButton;
NSImageView *appIconView;
NSImage *icon;
}
//----------------------------------------------------------------------------

View file

@ -43,31 +43,63 @@
- (void)_initUI
{
// Always call super!!!
NSTextField *textField;
NSRect frame = {{84,120}, {80, 80}};
NSBox *box;
[super _initUI];
projectAttributeInspectorView = [[NSBox alloc] init];
[projectAttributeInspectorView setTitlePosition:NSAtTop];
[projectAttributeInspectorView setBorderType:NSGrooveBorder];
// [projectAttributeInspectorView addSubview:projectTypePopup];
[projectAttributeInspectorView sizeToFit];
[projectAttributeInspectorView setAutoresizingMask:NSViewWidthSizable];
projectProjectInspectorView = [[NSBox alloc] init];
[projectProjectInspectorView setTitlePosition:NSAtTop];
[projectProjectInspectorView setBorderType:NSGrooveBorder];
// [projectProjectInspectorView addSubview:projectTypePopup];
[projectProjectInspectorView sizeToFit];
[projectProjectInspectorView setAutoresizingMask:NSViewWidthSizable];
projectFileInspectorView = [[NSBox alloc] init];
[projectFileInspectorView setTitlePosition:NSAtTop];
[projectFileInspectorView setBorderType:NSGrooveBorder];
// [projectFileInspectorView addSubview:projectTypePopup];
[projectFileInspectorView sizeToFit];
[projectFileInspectorView setAutoresizingMask:NSViewWidthSizable];
_needsAdditionalReleasing = YES;
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,256,64,21)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setEditable: NO];
[textField setBezeled: NO];
[textField setDrawsBackground: NO];
[textField setStringValue:@"App class:"];
[projectProjectInspectorView addSubview:[textField autorelease]];
appClassField =[[NSTextField alloc] initWithFrame:NSMakeRect(84,256,176,21)];
[appClassField setAlignment: NSLeftTextAlignment];
[appClassField setBordered: YES];
[appClassField setEditable: YES];
[appClassField setBezeled: YES];
[appClassField setDrawsBackground: YES];
[appClassField setStringValue:@""];
[projectProjectInspectorView addSubview:appClassField];
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,204,64,21)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setEditable: NO];
[textField setBezeled: NO];
[textField setDrawsBackground: NO];
[textField setStringValue:@"App icon:"];
[projectProjectInspectorView addSubview:[textField autorelease]];
appImageField =[[NSTextField alloc] initWithFrame:NSMakeRect(84,204,176,21)];
[appImageField setAlignment: NSLeftTextAlignment];
[appImageField setBordered: YES];
[appImageField setEditable: YES];
[appImageField setBezeled: YES];
[appImageField setDrawsBackground: YES];
[appImageField setStringValue:@""];
[projectProjectInspectorView addSubview:appImageField];
setAppIconButton =[[NSButton alloc] initWithFrame:NSMakeRect(180,180,80,21)];
[setAppIconButton setTitle:@"Set..."];
[setAppIconButton setTarget:self];
[setAppIconButton setAction:@selector(setAppIcon:)];
[projectProjectInspectorView addSubview:setAppIconButton];
box = [[NSBox alloc] init];
[box setFrame:frame];
[box setTitlePosition:NSNoTitle];
//[box setBorderType:NSNoBorder];
[projectProjectInspectorView addSubview:box];
AUTORELEASE(box);
appIconView = [[NSImageView alloc] initWithFrame:frame];
[box addSubview:appIconView];
}
@end
@ -80,42 +112,33 @@
- (id)init
{
if ((self = [super init])) {
rootCategories = [[NSDictionary dictionaryWithObjectsAndKeys:
if ((self = [super init])) {
rootCategories = [[NSDictionary dictionaryWithObjectsAndKeys:
PCGModels,@"Interfaces",
PCImages,@"Images",
PCOtherResources,@"Other Resources",
PCSubprojects,@"Subprojects",
PCLibraries,@"Libraries",
PCDocuFiles,@"Documentation",
PCOtherSources,@"Other Sources",
PCHeaders,@"Headers",
PCClasses,@"Classes",
nil] retain];
PCImages,@"Images",
PCOtherResources,@"Other Resources",
PCSubprojects,@"Subprojects",
PCLibraries,@"Libraries",
PCDocuFiles,@"Documentation",
PCOtherSources,@"Other Sources",
PCHeaders,@"Headers",
PCClasses,@"Classes",
nil] retain];
#if defined(GNUSTEP)
[self _initUI];
#else
if(![NSBundle loadNibNamed:@"AppProject.nib" owner:self]) {
[[NSException exceptionWithName:NIB_NOT_FOUND_EXCEPTION reason:@"Could not load AppProject.gmodel" userInfo:nil] raise];
return nil;
}
#endif
}
return self;
[self _initUI];
}
return self;
}
- (void)dealloc
{
[rootCategories release];
[rootCategories release];
[appClassField release];
[appImageField release];
[setAppIconButton release];
[appIconView release];
if (_needsAdditionalReleasing) {
[projectAttributeInspectorView release];
[projectProjectInspectorView release];
[projectFileInspectorView release];
}
[super dealloc];
[super dealloc];
}
//----------------------------------------------------------------------------

View file

@ -1,5 +1,106 @@
/* $Id$ */
#import <AppKit/AppKit.h>
#import "AppController.h"
#define APP_NAME @"GNUstep"
/*
* Create the application's menu
*/
void createMenu();
/*
* Initialise and go!
*/
int main(int argc, const char *argv[]) {
return NSApplicationMain(argc, argv);
NSApplication *theApp;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
AppController *controller;
#ifndef NX_CURRENT_COMPILER_RELEASE
initialize_gnustep_backend();
#endif
theApp = [NSApplication sharedApplication];
createMenu();
controller = [[AppController alloc] init];
[theApp setDelegate:controller];
/*
* Go...
*/
[theApp run];
/*
* ...and finish!
*/
RELEASE(controller);
RELEASE(pool);
return 0;
}
void createMenu()
{
NSMenu *menu;
NSMenu *info;
NSMenu *edit;
NSMenu *services;
NSMenu *windows;
SEL action = @selector(method:);
menu = [[NSMenu alloc] initWithTitle:APP_NAME];
[menu addItemWithTitle:@"Info" action:@selector(showInfoPanel:) keyEquivalent:@""];
[menu addItemWithTitle:@"Edit" action:action keyEquivalent:@""];
[menu addItemWithTitle:@"Windows" action:action keyEquivalent:@""];
[menu addItemWithTitle:@"Services" action:action keyEquivalent:@""];
[menu addItemWithTitle:@"Hide" action:@selector(hide:) keyEquivalent:@"h"];
[menu addItemWithTitle:@"Quit" action:@selector(terminate:) keyEquivalent:@"q"];
info = AUTORELEASE([[NSMenu alloc] init]);
[menu setSubmenu:info forItem:[menu itemWithTitle:@"Info"]];
[info addItemWithTitle:@"Info Panel..." action:@selector(showInfoPanel:) keyEquivalent:@""];
[info addItemWithTitle:@"Preferences" action:@selector(showPrefPanel:) keyEquivalent:@""];
[info addItemWithTitle:@"Help" action:action keyEquivalent:@"?"];
edit = AUTORELEASE([[NSMenu alloc] init]);
[edit addItemWithTitle:@"Cut" action:action keyEquivalent:@"x"];
[edit addItemWithTitle:@"Copy" action:action keyEquivalent:@"c"];
[edit addItemWithTitle:@"Paste" action:action keyEquivalent:@"v"];
[edit addItemWithTitle:@"Delete" action:action keyEquivalent:@""];
[edit addItemWithTitle:@"Select All" action:action keyEquivalent:@"a"];
[menu setSubmenu:edit forItem:[menu itemWithTitle:@"Edit"]];
windows = AUTORELEASE([[NSMenu alloc] init]);
[windows addItemWithTitle:@"Arrange"
action:@selector(arrangeInFront:)
keyEquivalent:@""];
[windows addItemWithTitle:@"Miniaturize"
action:@selector(performMiniaturize:)
keyEquivalent:@"m"];
[windows addItemWithTitle:@"Close"
action:@selector(performClose:)
keyEquivalent:@"w"];
[menu setSubmenu:windows forItem:[menu itemWithTitle:@"Windows"]];
services = AUTORELEASE([[NSMenu alloc] init]);
[menu setSubmenu:services forItem:[menu itemWithTitle:@"Services"]];
[[NSApplication sharedApplication] setMainMenu:menu];
[[NSApplication sharedApplication] setServicesMenu: services];
[menu update];
[menu display];
}

19
PCBaseFileTypes/ChangeLog Normal file
View file

@ -0,0 +1,19 @@
2000-09-13 12:45 robert
* PCBaseFileType.m: removed the gmodels completely from
ProjectCenter.app
2000-08-27 21:12 robert
* Makefile, Makefile.postamble, Makefile.preamble, PB.project,
PCBaseFileType.h, PCBaseFileType.m, FileIcon_.m.tiff,
FileIcon_.h.tiff, FileIcon_.c.tiff, GNUmakefile, cfile.template,
cheader.template, class.template, header.template: Initial revision
2000-08-27 21:12 robert
* Makefile, Makefile.postamble, Makefile.preamble, PB.project,
PCBaseFileType.h, PCBaseFileType.m, FileIcon_.m.tiff,
FileIcon_.h.tiff, FileIcon_.c.tiff, GNUmakefile, cfile.template,
cheader.template, class.template, header.template: Initial import

View file

@ -38,7 +38,8 @@ PCBaseFileTypes_RESOURCE_FILES = \
cfile.template \
cheader.template \
class.template \
header.template
header.template \
protocol.template
-include GNUmakefile.preamble
@ -46,3 +47,4 @@ include $(GNUSTEP_MAKEFILES)/bundle.make
-include GNUmakefile.postamble

View file

@ -31,6 +31,7 @@
#define ObjCHeader @"ObjC Header"
#define CFile @"C File"
#define CHeaderFile @"C Header"
#define ProtocolFile @"ObjC Protocol"
@implementation PCBaseFileType
@ -40,124 +41,138 @@ static NSDictionary *dict = nil;
+ (id)sharedCreator
{
if (!_creator) {
NSDictionary *classDict;
NSDictionary *headerDict;
NSDictionary *ccDict;
NSDictionary *chDict;
_creator = [[[self class] alloc] init];
// Setting up the dictionary needed for registration!
classDict = [NSDictionary dictionaryWithObjectsAndKeys:_creator,@"Creator",PCClasses,@"ProjectKey",nil];
headerDict = [NSDictionary dictionaryWithObjectsAndKeys:_creator,@"Creator",PCHeaders,@"ProjectKey",nil];
ccDict = [NSDictionary dictionaryWithObjectsAndKeys:_creator,@"Creator",PCOtherSources,@"ProjectKey",nil];
chDict = [NSDictionary dictionaryWithObjectsAndKeys:_creator,@"Creator",PCHeaders,@"ProjectKey",nil];
dict = [[NSDictionary alloc] initWithObjectsAndKeys:classDict,ObjCClass,headerDict,ObjCHeader,ccDict,CFile,chDict,CHeaderFile,nil];
}
return _creator;
if (!_creator) {
NSDictionary *classDict;
NSDictionary *headerDict;
NSDictionary *ccDict;
NSDictionary *chDict;
NSDictionary *protocolDict;
_creator = [[[self class] alloc] init];
// Setting up the dictionary needed for registration!
classDict = [NSDictionary dictionaryWithObjectsAndKeys:_creator,@"Creator",PCClasses,@"ProjectKey",nil];
headerDict = [NSDictionary dictionaryWithObjectsAndKeys:_creator,@"Creator",PCHeaders,@"ProjectKey",nil];
ccDict = [NSDictionary dictionaryWithObjectsAndKeys:_creator,@"Creator",PCOtherSources,@"ProjectKey",nil];
chDict = [NSDictionary dictionaryWithObjectsAndKeys:_creator,@"Creator",PCHeaders,@"ProjectKey",nil];
protocolDict = [NSDictionary dictionaryWithObjectsAndKeys:_creator,@"Creator",PCHeaders,@"ProjectKey",nil];
dict = [[NSDictionary alloc] initWithObjectsAndKeys:classDict,ObjCClass,headerDict,ObjCHeader,ccDict,CFile,chDict,CHeaderFile,protocolDict,ProtocolFile,nil];
}
return _creator;
}
- (NSString *)name
{
return _name;
return _name;
}
- (NSDictionary *)creatorDictionary
{
return dict;
return dict;
}
- (NSDictionary *)createFileOfType:(NSString *)type path:(NSString *)path project:(PCProject *)aProject
{
NSFileManager *fm = [NSFileManager defaultManager];
NSString *_file;
NSString *newFile = nil;
NSMutableDictionary *files;
// A class and possibly a header
files = [NSMutableDictionary dictionaryWithCapacity:2];
NSLog(@"<%@ %x>: create %@ at %@",[self class],self,type,path);
/*
*
*/
NSFileManager *fm = [NSFileManager defaultManager];
NSString *_file;
NSString *newFile = nil;
NSMutableDictionary *files;
// A class and possibly a header
files = [NSMutableDictionary dictionaryWithCapacity:2];
NSLog(@"<%@ %x>: create %@ at %@",[self class],self,type,path);
/*
*
*/
if ([type isEqualToString:ObjCClass]) {
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"class" ofType:@"template"];
newFile = [path stringByAppendingPathExtension:@"m"];
[fm copyPath:_file toPath:newFile handler:nil];
[files setObject:ObjCClass forKey:newFile];
if ([type isEqualToString:ObjCClass]) {
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"class" ofType:@"template"];
newFile = [path stringByAppendingPathExtension:@"m"];
[fm copyPath:_file toPath:newFile handler:nil];
[files setObject:ObjCClass forKey:newFile];
[self replaceTagsInFileAtPath:newFile withProject:aProject type:type];
// Should a header be created as well?
newFile = [path stringByAppendingPathExtension:@"h"];
if (NSRunAlertPanel(@"Attention!",@"Should %@ be created and inserted in the project as well?",@"Yes",@"No",nil,[newFile lastPathComponent])) {
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"header" ofType:@"template"];
[fm copyPath:_file toPath:newFile handler:nil];
[self replaceTagsInFileAtPath:newFile withProject:aProject type:ObjCHeader];
[files setObject:ObjCHeader forKey:newFile];
}
[self replaceTagsInFileAtPath:newFile withProject:aProject type:type];
// Should a header be created as well?
newFile = [path stringByAppendingPathExtension:@"h"];
if (NSRunAlertPanel(@"Attention!",@"Should %@ be created and inserted in the project as well?",@"Yes",@"No",nil,[newFile lastPathComponent])) {
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"header" ofType:@"template"];
[fm copyPath:_file toPath:newFile handler:nil];
[self replaceTagsInFileAtPath:newFile withProject:aProject type:ObjCHeader];
[files setObject:ObjCHeader forKey:newFile];
}
}
/*
*
*/
else if ([type isEqualToString:CFile]) {
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"cfile" ofType:@"template"];
newFile = [path stringByAppendingPathExtension:@"c"];
[fm copyPath:_file toPath:newFile handler:nil];
[files setObject:CFile forKey:newFile];
[self replaceTagsInFileAtPath:newFile withProject:aProject type:type];
// Should a header be created as well?
newFile = [path stringByAppendingPathExtension:@"h"];
if (NSRunAlertPanel(@"Attention!",@"Should %@ be created and inserted in the project as well?",@"Yes",@"No",nil,[newFile lastPathComponent])) {
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"cheader" ofType:@"template"];
[fm copyPath:_file toPath:newFile handler:nil];
[self replaceTagsInFileAtPath:newFile withProject:aProject type:CHeaderFile];
[files setObject:CHeaderFile forKey:newFile];
}
}
/*
*
*/
else if ([type isEqualToString:ObjCHeader]) {
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"header" ofType:@"template"];
newFile = [path stringByAppendingPathExtension:@"h"];
[fm copyPath:_file toPath:newFile handler:nil];
[self replaceTagsInFileAtPath:newFile withProject:aProject type:type];
[files setObject:ObjCHeader forKey:newFile];
}
/*
*
*/
else if ([type isEqualToString:CHeaderFile]) {
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"cheader" ofType:@"template"];
newFile = [path stringByAppendingPathExtension:@"h"];
[fm copyPath:_file toPath:newFile handler:nil];
[self replaceTagsInFileAtPath:newFile withProject:aProject type:type];
[files setObject:CHeaderFile forKey:newFile];
}
/*
*
*/
else if ([type isEqualToString:CFile]) {
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"cfile" ofType:@"template"];
newFile = [path stringByAppendingPathExtension:@"c"];
[fm copyPath:_file toPath:newFile handler:nil];
[files setObject:CFile forKey:newFile];
[self replaceTagsInFileAtPath:newFile withProject:aProject type:type];
// Should a header be created as well?
newFile = [path stringByAppendingPathExtension:@"h"];
if (NSRunAlertPanel(@"Attention!",@"Should %@ be created and inserted in the project as well?",@"Yes",@"No",nil,[newFile lastPathComponent])) {
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"cheader" ofType:@"template"];
[fm copyPath:_file toPath:newFile handler:nil];
[self replaceTagsInFileAtPath:newFile withProject:aProject type:CHeaderFile];
[files setObject:CHeaderFile forKey:newFile];
}
}
/*
*
*/
else if ([type isEqualToString:ObjCHeader]) {
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"header" ofType:@"template"];
newFile = [path stringByAppendingPathExtension:@"h"];
[fm copyPath:_file toPath:newFile handler:nil];
[self replaceTagsInFileAtPath:newFile withProject:aProject type:type];
[files setObject:ObjCHeader forKey:newFile];
}
/*
*
*/
else if ([type isEqualToString:CHeaderFile]) {
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"cheader" ofType:@"template"];
newFile = [path stringByAppendingPathExtension:@"h"];
[fm copyPath:_file toPath:newFile handler:nil];
[self replaceTagsInFileAtPath:newFile withProject:aProject type:type];
[files setObject:ObjCHeader forKey:newFile];
}
/*
* Notify the browser!
*/
[[NSNotificationCenter defaultCenter] postNotificationName:@"ProjectDictDidChangeNotification" object:self];
return files;
/*
*
*/
else if ([type isEqualToString:ProtocolFile]) {
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"protocol" ofType:@"template"];
newFile = [path stringByAppendingPathExtension:@"h"];
[fm copyPath:_file toPath:newFile handler:nil];
[self replaceTagsInFileAtPath:newFile withProject:aProject type:type];
[files setObject:ProtocolFile forKey:newFile];
}
/*
* Notify the browser!
*/
[[NSNotificationCenter defaultCenter] postNotificationName:@"ProjectDictDidChangeNotification" object:self];
return files;
}
- (void)replaceTagsInFileAtPath:(NSString *)newFile withProject:(PCProject *)aProject type:(NSString *)aType
@ -166,7 +181,7 @@ static NSDictionary *dict = nil;
NSString *pname = [aProject projectName];
NSString *date = [[NSCalendarDate calendarDate] description];
NSString *aFile = [newFile lastPathComponent];
file = [[NSMutableString stringWithContentsOfFile:newFile] retain];
[file replaceCharactersInRange:
@ -183,6 +198,7 @@ static NSDictionary *dict = nil;
if ([aType isEqualToString:ObjCClass] ||
[aType isEqualToString:CFile] ||
[aType isEqualToString:ProtocolFile] ||
[aType isEqualToString:ObjCHeader]) {
NSString *name = [aFile stringByDeletingPathExtension];
@ -194,6 +210,7 @@ static NSDictionary *dict = nil;
[file rangeOfString:@"$FILENAMESANSEXTENSION$"] withString:name];
}
}
[file writeToFile:newFile atomically:YES];
[file autorelease];
}

View file

@ -0,0 +1,13 @@
/*
* $FILENAME$ created by $USERNAME$ on $DATE$
*
* Project $PROJECTNAME$
*
* Created with ProjectCenter - http://www.projectcenter.ch
*
* $Id$
*/
@protocol $FILENAMESANSEXTENSION$ <NSObject>
@end

65
PCLib/ChangeLog Normal file
View file

@ -0,0 +1,65 @@
2000-09-20 17:46 robert
* GNUmakefile, PCBrowserController.m, PCEditorView.h,
PCEditorView.m, PCProject.h, PCProject.m, PCServer.m,
ProjectCenter.h: Added a first editor with syntax highlighting
2000-09-20 11:59 robert
* PCProjectBuilder.m: daily work
2000-09-20 11:53 robert
* PCProject.m, PCProjectBuilder.m: minor UI changes (scrollers in
scrollviews)
2000-09-19 17:39 robert
* PCProject.m, PCProjectBuilder.m: sizeToCells was missing ...
2000-09-17 16:40 robert
* PCProject.h, PCProject.m, PCProjectBuilder.m: Basic preferences
handling
2000-09-17 14:13 robert
* PCBrowserController.h, PCBrowserController.m, PCFileManager.h,
PCFileManager.m, PCProject.h, PCProject.m, PCProjectBuilder.h,
PCProjectBuilder.m, PCProjectManager.h, PCProjectManager.m,
PCServer.h, PCServer.m, ProjectCenter.h, Server.h: Implemented a
first 'editor', UI enhancements and other nice things
2000-09-03 22:10 robert
* GNUmakefile: renamed libPC into libProjectCenter
2000-08-28 21:04 robert
* PCBrowserController.m, PCFileManager.h: The class and header
files are now being displayed
2000-08-27 21:12 robert
* Makefile.preamble, PB.project, h.template, m.template, Makefile,
Makefile.postamble, ProjectEditor.h, Server.h, PCServer.h,
PCServer.m, ProjectCenter.h, ProjectDebugger.h, ProjectType.h,
PCProjectManager.m, PCProjectManager.h, PCBundleLoader.h,
PCBundleLoader.m, PreferenceController.h, ProjectBuilder.h,
PCBrowserController.h, PCDataSource.h, PCDataSource.m, PCProject.h,
PCFileManager.h, PCProject.m, PCFileManager.m, FileCreator.h,
GNUmakefile, GNUmakefile.preamble, PCBrowserController.m,
PCProjectBuilder.h, PCProjectBuilder.m: Initial revision
2000-08-27 21:12 robert
* Makefile.preamble, PB.project, h.template, m.template, Makefile,
Makefile.postamble, ProjectEditor.h, Server.h, PCServer.h,
PCServer.m, ProjectCenter.h, ProjectDebugger.h, ProjectType.h,
PCProjectManager.m, PCProjectManager.h, PCBundleLoader.h,
PCBundleLoader.m, PreferenceController.h, ProjectBuilder.h,
PCBrowserController.h, PCDataSource.h, PCDataSource.m, PCProject.h,
PCFileManager.h, PCProject.m, PCFileManager.m, FileCreator.h,
GNUmakefile, GNUmakefile.preamble, PCBrowserController.m,
PCProjectBuilder.h, PCProjectBuilder.m: Initial import

View file

@ -36,7 +36,7 @@ PACKAGE_NAME = PCLib
LIBRARY_VAR = PCLIB
# The library to be compiled
LIBRARY_NAME=libPC
LIBRARY_NAME=libProjectCenter
PCLIB_INSTALL_PREFIX=$(GNUSTEP_LOCAL_ROOT)
@ -46,23 +46,25 @@ FILE_AUTHORS = \
# The source files
libPC_MFILES = \
libProjectCenter_MFILES = \
PCBrowserController.m \
PCBundleLoader.m \
PCDataSource.m \
PCEditorView.m \
PCFileManager.m \
PCProject.m \
PCProjectBuilder.m \
PCProjectManager.m \
PCServer.m
libPC_CFILES =
libProjectCenter_CFILES =
libPC_HFILES = \
libProjectCenter_HFILES = \
FileCreator.h \
PCBrowserController.h \
PCBundleLoader.h \
PCDataSource.h \
PCEditorView.h \
PCFileManager.h \
PCProject.h \
PCProjectBuilder.h \
@ -76,18 +78,18 @@ libPC_HFILES = \
ProjectType.h \
Server.h
HEADERS_INSTALL = $(libPC_HFILES)
HEADERS_INSTALL = $(libProjectCenter_HFILES)
# The Objective-C source files to be compiled
libPC_OBJC_FILES = $(libPC_MFILES)
libProjectCenter_OBJC_FILES = $(libProjectCenter_MFILES)
# The C source files to be compiled
libPC_C_FILES = $(libPC_CFILES)
libProjectCenter_C_FILES = $(libProjectCenter_CFILES)
# The headers
libPC_HEADER_FILES_DIR = .
libPC_HEADER_FILES_INSTALL_DIR = /ProjectCenter
libPC_HEADER_FILES = $(libPC_HFILES)
libProjectCenter_HEADER_FILES_DIR = .
libProjectCenter_HEADER_FILES_INSTALL_DIR = /ProjectCenter
libProjectCenter_HEADER_FILES = $(libProjectCenter_HFILES)
-include GNUmakefile.preamble

View file

@ -56,3 +56,6 @@
- (BOOL)browser:(NSBrowser *)sender selectCellWithString:(NSString *)title inColumn:(int)column;
@end
extern NSString *FileShouldOpenNotification;

View file

@ -26,60 +26,70 @@
#import "PCBrowserController.h"
#import "PCProject.h"
#import "PCFileManager.h"
NSString *FileShouldOpenNotification = @"FileShouldOpenNotification";
@implementation PCBrowserController
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
[super dealloc];
}
- (void)click:(id)sender
{
NSTextView *pTextView;
if ([[sender selectedCell] isLeaf]) {
NSString *ltitle = [[sender selectedCell] stringValue];
NSString *ctitle = [[sender selectedCellInColumn:0] stringValue];
NSString *text = [NSString stringWithFormat:@"Display File %@",[[sender selectedCell] stringValue]
];
pTextView = [project textView];
NSString *ctitlef = [[project projectPath] stringByAppendingPathComponent:ltitle];
[project browserDidSelectFileNamed:ltitle];
if ([ctitle isEqualToString:@"Classes"]) {
[pTextView setString:text];
}
NSString *f = [NSString stringWithContentsOfFile:ctitlef];
[project editSelectedFile:f];
}
else if ([ctitle isEqualToString:@"Headers"]) {
NSString *f = [NSString stringWithContentsOfFile:ctitlef];
[project editSelectedFile:f];
}
else if ([ctitle isEqualToString:@"Other Sources"]) {
NSString *f = [NSString stringWithContentsOfFile:ctitlef];
[project editSelectedFile:f];
}
else if ([ctitle isEqualToString:@"Other Resources"]) {
NSString *f = [NSString stringWithContentsOfFile:ctitlef];
[project editSelectedFile:f];
}
}
}
- (void)doubleClick:(id)sender
{
#warning No subproject support here yet!
/*
if ([sender selectedColumn] == 0) {
// Ask the project about the valid file types
//NSArray *types = [project typesForKeyPath:[sender pathToColumn:0]];
NSOpenPanel *openPanel;
int retval;
NSArray *types;
if ([sender selectedColumn] != 0) {
NSString *category = [[[browser path] componentsSeparatedByString:@"/"] objectAtIndex:1];
NSString *k = [[project rootCategories] objectForKey:category];
openPanel = [NSOpenPanel openPanel];
[openPanel setAllowsMultipleSelection:NO];
[openPanel setCanChooseDirectories:NO];
[openPanel setCanChooseFiles:YES];
if ((retval = [openPanel runModalForDirectory:[[NSUserDefaults standardUserDefaults] objectForKey:@"LastOpenDirectory"] file:nil types:types])) {
NSString *key = [project projectKeyForKeyPath:[sender path]];
[project addFile:[[openPanel filenames] objectAtIndex:0] forKey:key];
[[NSUserDefaults standardUserDefaults] setObject:[openPanel directory] forKey:@"LastOpenDirectory"];
}
if ([k isEqualToString:PCClasses] || [k isEqualToString:PCHeaders] || [k isEqualToString:PCOtherSources]) {
NSString *projectPath = [project projectPath];
NSString *fn = [self nameOfSelectedFile];
NSString *file = [projectPath stringByAppendingPathComponent:fn];
NSDictionary *ui =[NSDictionary dictionaryWithObjectsAndKeys:
file,@"FilePathKey",nil];
[[NSNotificationCenter defaultCenter] postNotificationName:FileShouldOpenNotification object:self userInfo:ui];
}
else {
}
*/
}
else {
[[PCFileManager fileManager] showAddFileWindow];
}
}
- (void)projectDictDidChange:(NSNotification *)aNotif
@ -101,14 +111,7 @@
- (NSString *)pathOfSelectedFile
{
NSString *path = nil;
// Doesn't work with subprojects!
if ([browser selectedColumn] != 0) {
path = [browser path];
}
return path;
return [browser path];
}
- (void)setBrowser:(NSBrowser *)aBrowser
@ -146,14 +149,14 @@
int count = [files count];
if (count == 0) {
NSLog(@"<%@ %x>: create rows for column aborted - 0 files!",[self class],self);
NSLog(@"<%@ %x>: create rows for column in %@ (%x) aborted - 0 files!",[self class],self,[project class],project);
return;
}
#ifdef DEBUG
NSLog(@"<%@ %x>: create rows for column %d in %x",[self class],self,column,sender);
#endif DEBUG
for (i = 0; i < count; ++i) {
NSMutableString *keyPath = [NSMutableString stringWithString:pathToCol];
id cell;

View file

@ -101,13 +101,21 @@
NSArray *dir;
NSString *path = [[NSUserDefaults standardUserDefaults] objectForKey:BundlePaths];
if (!path || path == @"" || ![[NSFileManager defaultManager] fileExistsAtPath:path]) {
if (!path || [path isEqualToString:@""]) {
path = [NSString stringWithString:@"/usr/GNUstep/Local/Library/ProjectCenter"];
[[NSUserDefaults standardUserDefaults] setObject:path forKey:BundlePaths];
[[NSUserDefaults standardUserDefaults] synchronize];
}
if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
[NSException raise:@"PCBundleLoaderPathException" format:@"No valid bundle path specified!"];
return;
}
#ifdef DEBUG
else {
NSLog([NSString stringWithFormat:@"Loading bundles at %@",path]);
}
#endif DEBUG
dir = [[NSFileManager defaultManager] directoryContentsAtPath:path];
enumerator = [dir objectEnumerator];

53
PCLib/PCEditorView.h Normal file
View file

@ -0,0 +1,53 @@
/*
GNUstep ProjectCenter - http://www.projectcenter.ch
Copyright (C) 2000 Philippe C.D. Robert
Author: Philippe C.D. Robert <phr@projectcenter.ch>
This file is part of ProjectCenter.
This application is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This application is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$Id$
*/
#import <AppKit/AppKit.h>
@interface PCEditorView : NSTextView
{
NSScanner *scanner;
@private
NSRange range;
NSArray *_keywords;
}
- (id)initWithFrame:(NSRect)frameRect;
- (void)dealloc;
- (void)setString:(NSString *)aString;
- (void)colourise:(id)sender;
- (void)colouriseKeyword:(NSString *)keyword;
- (void)colouriseKeywords:(NSArray *)keywords;
- (void)colouriseStrings;
- (void)colouriseCharStrings;
- (void)colouriseComments;
- (void)colouriseCPPComments;
@end

347
PCLib/PCEditorView.m Normal file
View file

@ -0,0 +1,347 @@
/*
GNUstep ProjectCenter - http://www.projectcenter.ch
Copyright (C) 2000 Philippe C.D. Robert
Author: Philippe C.D. Robert <phr@projectcenter.ch>
This file is part of ProjectCenter.
This application is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This application is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$Id$
*/
#import "PCEditorView.h"
#define SCANLOC [scanner scanLocation]
@implementation PCEditorView
static NSColor *commentColor = nil;
static NSColor *keywordColor = nil;
static NSColor *cppCommentColor = nil;
static NSColor *stringColor = nil;
static NSColor *cStringColor = nil;
static NSFont *editorFont = nil;
static BOOL isInitialised = NO;
- (id)initWithFrame:(NSRect)frameRect
{
if ((self = [super initWithFrame:frameRect])) {
/*
* Should move that to initialize...
*/
if (isInitialised == NO) {
commentColor = [[NSColor colorWithCalibratedRed: 0.0 green: 0.5 blue: 0.0 alpha: 1.0] retain];
cppCommentColor = [[NSColor colorWithCalibratedRed: 0.0 green: 0.5 blue: 0.0 alpha: 1.0] retain];
keywordColor = [[NSColor colorWithCalibratedRed: 0.8 green: 0.0 blue: 0.0 alpha: 1.0] retain];
stringColor = [[NSColor colorWithCalibratedRed: 0.0 green: 0.0 blue: 0.8 alpha: 1.0] retain];
cStringColor = [[NSColor colorWithCalibratedRed: 0.0 green: 0.0 blue: 0.8 alpha: 1.0] retain];
editorFont = [[NSFont userFixedPitchFontOfSize:12] retain];
isInitialised = YES;
}
_keywords = [[NSArray alloc] initWithObjects:@"@class",@"@selector",@"#import",@"#include",@"#define",@"#pragma",@"#warning",@"@interface",@"@implementation",@"@end",@"@protocol",nil];
}
return self;
}
- (void)dealloc
{
if (scanner) {
[scanner release];
}
[_keywords release];
[super dealloc];
}
- (void)setString:(NSString *)aString
{
[scanner autorelease];
scanner = [[NSScanner alloc] initWithString:aString];
[super setString:aString];
[self colourise:self];
}
- (void)colourise:(id)sender
{
NSRange aRange;
NSDictionary *aDict;
NSArray *keywords;
aRange = NSMakeRange(0,[_textStorage length]);
aDict = [NSDictionary dictionaryWithObjectsAndKeys:
editorFont, NSFontAttributeName,
@"UnknownCodeType", @"PCCodeTypeAttributeName",
nil];
[_textStorage beginEditing];
[_textStorage setAttributes:aDict range:aRange];
// Scan the CodeType first...
[self colouriseKeywords:_keywords];
[self colouriseStrings];
[self colouriseCharStrings];
[self colouriseComments];
[self colouriseCPPComments];
/*
* BIG HACK!
*/
NS_DURING
[_textStorage endEditing];
NS_HANDLER
NSLog(@"Excpetion: %@",[localException description]);
NS_ENDHANDLER
[self setNeedsDisplay:YES];
}
- (void)colouriseStrings
{
BOOL foundRange;
id aDict = [NSDictionary dictionaryWithObjectsAndKeys:
stringColor, NSForegroundColorAttributeName,
@"StringConstantCodeType", @"PCCodeTypeAttributeName", nil ];
[scanner setScanLocation:0];
while( ![scanner isAtEnd] ) {
foundRange = NO;
[scanner scanUpToString:@"\"" intoString:NULL];
range.location = SCANLOC;
[scanner scanString:@"\"" intoString:NULL];
if( ![scanner isAtEnd] &&
range.location > 0 &&
[[_textStorage string] characterAtIndex:(SCANLOC - 2)] == '@' ) {
range.location -= 1;
}
while( ![scanner isAtEnd] ) {
[scanner scanUpToString:@"\"" intoString:NULL];
[scanner scanString:@"\"" intoString:NULL];
// If there is no escape char before then we are done..
if( [[scanner string] characterAtIndex:(SCANLOC - 2)] != '\\' ||
[[scanner string] characterAtIndex:(SCANLOC - 3)] == '\\' ) {
range.length = SCANLOC - range.location;
foundRange = YES;
break;
}
}
if( foundRange ) {
NS_DURING
[_textStorage addAttributes:aDict range:range];
NS_HANDLER
NSLog(@"<%@ %x> raised (-scanForStrings):\n%@",[self class],self,[localException description]);
NS_ENDHANDLER
}
}
}
- (void)colouriseCharStrings
{
NSRange tmpRange;
BOOL foundRange;
id aDict = [NSDictionary dictionaryWithObjectsAndKeys:
cStringColor,NSForegroundColorAttributeName,
@"StringConstantCodeType", @"PCCodeTypeAttributeName", nil ];
[scanner setScanLocation:0];
while( ![scanner isAtEnd] ) {
foundRange = NO;
[scanner scanUpToString:@"'" intoString:NULL];
range.location = SCANLOC;
[scanner scanString:@"'" intoString:NULL];
while( ![scanner isAtEnd] ) {
[scanner scanUpToString:@"'" intoString:NULL];
[scanner scanString:@"'" intoString:NULL];
// No escape => we are done! (ugly hack...)
if( [[scanner string] characterAtIndex:(SCANLOC - 2)] != '\\' ||
[[scanner string] characterAtIndex:(SCANLOC - 3)] == '\\' ) {
range.length = SCANLOC - range.location;
// Ranges are not longer than 8 chars! (ugly hack...)
if( range.length > 8 ) {
[scanner setScanLocation:SCANLOC - 1];
}
else {
foundRange = YES;
}
break;
}
}
if( foundRange ) {
NS_DURING
[_textStorage addAttributes:aDict range:range];
NS_HANDLER
NSLog(@"<%@ %x> raised (-colouriseCharStrings):\n%@",[self class],self,[localException description]);
NS_ENDHANDLER
}
}
}
- (void)colouriseComments
{
NSRange tmpRange;
BOOL foundRange;
id anObject;
id aDict = [NSDictionary dictionaryWithObjectsAndKeys:
commentColor,NSForegroundColorAttributeName,
@"CommentCodeType", @"PCCodeTypeAttributeName",
nil ];
[scanner setScanLocation:0];
while( ![scanner isAtEnd] ) {
foundRange = NO;
while( ![scanner isAtEnd] ) {
[scanner scanUpToString:@"/*" intoString:NULL];
range.location = SCANLOC;
[scanner scanString:@"/*" intoString:NULL];
if(![scanner isAtEnd] &&
[[_textStorage attribute:@"PCCodeTypeAttributeName"
atIndex:range.location
effectiveRange:&tmpRange] isEqual:@"UnknownCodeType"]){
foundRange = YES;
break;
}
}
[scanner scanUpToString:@"*/" intoString:NULL];
[scanner scanString:@"*/" intoString:NULL];
range.length = SCANLOC - range.location;
if( foundRange ) {
NS_DURING
/*
* BIG HACK!!!
*/
if (range.location == 0) {range.location = 1;range.length--;}
[_textStorage addAttributes:aDict range:range];
NS_HANDLER
NSLog(@"<%@ %x> raised (-colouriseComments):\n%@",[self class],self,[localException description]);
NS_ENDHANDLER
}
}
}
- (void)colouriseCPPComments
{
NSRange tmpRange;
BOOL foundRange;
id anObject;
id aDict = [NSDictionary dictionaryWithObjectsAndKeys:
cppCommentColor, NSForegroundColorAttributeName,
@"CommentCodeType", @"PCCodeTypeAttributeName", nil ];
[scanner setScanLocation:0];
while( ![scanner isAtEnd] ) {
foundRange = NO;
while( ![scanner isAtEnd] ) {
[scanner scanUpToString:@"//" intoString:NULL];
range.location = SCANLOC;
[scanner scanString:@"//" intoString:NULL];
if( ![scanner isAtEnd] &&
[[_textStorage attribute:@"PCCodeTypeAttributeName"
atIndex:range.location
effectiveRange:&tmpRange] isEqual:@"UnknownCodeType"]){
foundRange = YES;
break;
}
}
[scanner scanUpToString:@"\n" intoString:NULL];
[scanner scanString:@"\n" intoString:NULL];
range.length = SCANLOC - range.location;
if( foundRange ) {
NS_DURING
[_textStorage addAttributes:aDict range:range];
NS_HANDLER
NSLog(@"<%@ %x> raised (-colouriseCPPComments):\n%@",[self class],self,[localException description]);
NS_ENDHANDLER
}
}
}
- (void)colouriseKeyword:(NSString *)keyword
{
NSRange tmpRange;
BOOL foundRange;
id anObject;
id keywordDict = [NSDictionary dictionaryWithObjectsAndKeys:
keywordColor,NSForegroundColorAttributeName,
@"KeywordCodeType", @"PCCodeTypeAttributeName", nil ];
// First scan for docu style comments
[scanner setScanLocation:0];
while( ![scanner isAtEnd] ) {
[scanner scanUpToString:keyword intoString:NULL];
range.location = SCANLOC;
if( ![scanner isAtEnd] &&
[[_textStorage attribute:@"PCCodeTypeAttributeName"
atIndex:range.location
effectiveRange:&tmpRange] isEqual:@"UnknownCodeType"] ) {
NS_DURING
[_textStorage addAttributes:keywordDict range:NSMakeRange( range.location, [keyword length])];
NS_HANDLER
NSLog(@"<%@ %x> raised (-colouriseKeyword:):\n%@",[self class],self,[localException description]);
NS_ENDHANDLER
}
[scanner scanString:keyword intoString:NULL];
}
}
- (void)colouriseKeywords:(NSArray *)keywords
{
NSEnumerator *enumerator = [keywords objectEnumerator];
id object;
while ((object = [enumerator nextObject])) {
[self colouriseKeyword:object];
}
}
@end

View file

@ -32,16 +32,17 @@
id fileTypePopup;
id newFileName;
id delegate;
id fileTypeAccessaryView;
id addFileTypePopup;
id delegate; // PCProjectManager
NSMutableDictionary *creators;
BOOL _needsAdditionalReleasing;
}
//===========================================================================================
// ==== Class methods
//===========================================================================================
+ (PCFileManager *)fileManager;
//===========================================================================================
// ==== Init and free
//===========================================================================================
@ -62,7 +63,6 @@
// ==== File stuff
// ===========================================================================
- (void)fileTypePopupChanged:(id)sender;
- (void)showAddFileWindow;
- (void)showNewFileWindow;
@ -88,3 +88,6 @@
- (void)fileManager:(id)sender didAddFile:(NSString *)file forKey:(NSString *)key;
@end

View file

@ -68,7 +68,7 @@
[box setFrame:NSMakeRect(16,96,224,56)];
fileTypePopup = [[[NSPopUpButton alloc] initWithFrame:NSMakeRect(32,2,160,20)
pullsDown:NO] autorelease];
[fileTypePopup addItemWithTitle:@"No type available!"];
//[fileTypePopup addItemWithTitle:@"No type available!"];
[fileTypePopup setAutoresizingMask: (NSViewWidthSizable)];
[box setTitle:@"Type"];
[box setTitlePosition:NSAtTop];
@ -135,33 +135,26 @@
[newFileName setStringValue:@""];
[newFileName setAutoresizingMask: (NSViewWidthSizable | NSViewMinYMargin)];
[_c_view addSubview:[newFileName autorelease]];
/*
* the accessory view needed for adding files
*
*/
fileTypeAccessaryView = [[NSBox alloc] init];
addFileTypePopup = [[[NSPopUpButton alloc] initWithFrame:NSMakeRect(20,30,160,20) pullsDown:NO] autorelease];
[addFileTypePopup addItemWithTitle:@"No type available!"];
[fileTypeAccessaryView setTitle:@"Add to category"];
[fileTypeAccessaryView setTitlePosition:NSAtTop];
[fileTypeAccessaryView setBorderType:NSGrooveBorder];
[fileTypeAccessaryView addSubview:addFileTypePopup];
[fileTypeAccessaryView sizeToFit];
[fileTypeAccessaryView setAutoresizingMask: NSViewWidthSizable];
[fileTypePopup setTarget:self];
[fileTypePopup setAction:@selector(fileTypePopupChanged:)];
_needsAdditionalReleasing = YES;
}
@end
@implementation PCFileManager
//===========================================================================================
// ==== Class methods
//===========================================================================================
static PCFileManager *_mgr = nil;
+ (PCFileManager *)fileManager
{
if (!_mgr) {
_mgr = [[PCFileManager alloc] init];
}
return _mgr;
}
//===========================================================================================
// ==== Init and free
//===========================================================================================
@ -170,15 +163,7 @@
{
if ((self = [super init])) {
creators = [[NSMutableDictionary alloc] init];
#if defined(GNUSTEP)
[self _initUI];
#else
if(![NSBundle loadNibNamed:@"FileCreation.nib" owner:self]) {
[[NSException exceptionWithName:NIB_NOT_FOUND_EXCEPTION reason:@"Could not load FileCreation.gmodel" userInfo:nil] raise];
return nil;
}
#endif
}
return self;
}
@ -186,18 +171,14 @@
- (void)dealloc
{
[creators release];
if (_needsAdditionalReleasing) {
[fileTypeAccessaryView release];
[newFileWindow release];
}
[newFileWindow release];
[super dealloc];
}
- (void)awakeFromNib
{
[fileTypePopup removeAllItems];
[fileTypePopup removeAllItems];
}
// ===========================================================================
@ -206,56 +187,53 @@
- (id)delegate
{
return delegate;
return delegate;
}
- (void)setDelegate:(id)aDelegate
{
delegate = aDelegate;
delegate = aDelegate;
}
// ===========================================================================
// ==== File stuff
// ===========================================================================
- (void)fileTypePopupChanged:(id)sender
{
}
- (void)showAddFileWindow
{
NSOpenPanel *openPanel;
int retval;
NSOpenPanel *openPanel;
int retval;
NSMutableArray *validTypes = nil;
NSDictionary *categories = nil;
PCProject *project = nil;
NSString *key = nil;
NSString *title = nil;
NSArray *types = nil;
if (delegate && [delegate respondsToSelector:@selector(fileManagerWillAddFiles:)]) {
if (!(project = [delegate fileManagerWillAddFiles:self])) {
NSLog(@"No project to add files available...");
return;
}
}
// Ask the active project for the valid file types first!
categories = [project rootCategories];
validTypes = [NSMutableArray arrayWithArray:[categories allKeys]];
[validTypes removeObject:@"Subprojects"];
[addFileTypePopup removeAllItems];
[addFileTypePopup addItemsWithTitles:validTypes];
key = [project selectedRootCategory];
title = [[[project rootCategories] allKeysForObject:key] objectAtIndex:0];
title = [NSString stringWithFormat:@"Add to %@...",title];
types = [project fileExtensionsForCategory:key];
openPanel = [NSOpenPanel openPanel];
[openPanel setAllowsMultipleSelection:YES];
[openPanel setCanChooseDirectories:NO];
[openPanel setCanChooseFiles:YES];
[openPanel setTitle:@"Add File(s)..."];
[openPanel setAccessoryView:fileTypeAccessaryView];
retval = [openPanel runModalForDirectory:[[NSUserDefaults standardUserDefaults] objectForKey:@"LastOpenDirectory"] file:nil types:nil];
[openPanel setTitle:title];
retval = [openPanel runModalForDirectory:[[NSUserDefaults standardUserDefaults] objectForKey:@"LastOpenDirectory"] file:nil types:types];
if (retval == NSOKButton) {
NSString *key = [categories objectForKey:[addFileTypePopup titleOfSelectedItem]];
NSEnumerator *enumerator;
NSString *file;
@ -263,17 +241,57 @@
enumerator = [[openPanel filenames] objectEnumerator];
while (file = [enumerator nextObject]) {
NSString *otherKey;
NSString *ext;
BOOL ret = NO;
NSString *fn;
NSString *fileName;
NSString *pth;
if ([delegate fileManager:self shouldAddFile:file forKey:key]) {
NSString *fileName = [file lastPathComponent];
NSString *pth = [[project projectPath] stringByAppendingPathComponent:fileName];
fileName = [file lastPathComponent];
pth = [[project projectPath] stringByAppendingPathComponent:fileName];
if (![key isEqualToString:PCLibraries]) {
if ([[NSFileManager defaultManager] copyPath:file toPath:pth handler:nil]) {
[delegate fileManager:self didAddFile:pth forKey:key];
if (![[NSFileManager defaultManager] fileExistsAtPath:pth]) {
[[NSFileManager defaultManager] copyPath:file toPath:pth handler:nil];
}
}
else {
[delegate fileManager:self didAddFile:pth forKey:key];
[project addFile:pth forKey:key];
}
if ([key isEqualToString:PCClasses]) {
otherKey = PCHeaders;
ext = [NSString stringWithString:@"h"];
fn = [file stringByDeletingPathExtension];
fn = [fn stringByAppendingPathExtension:ext];
if ([[NSFileManager defaultManager] fileExistsAtPath:fn]) {
ret = NSRunAlertPanel(@"Adding Header?",@"Should %@ be added to project %@ as well?",@"Yes",@"No",nil,fn,[project projectName]);
}
}
else if ([key isEqualToString:PCHeaders]) {
otherKey = PCClasses;
ext = [NSString stringWithString:@"m"];
fn = [file stringByDeletingPathExtension];
fn = [fn stringByAppendingPathExtension:ext];
if ([[NSFileManager defaultManager] fileExistsAtPath:fn]) {
ret = NSRunAlertPanel(@"Adding Class?",@"Should %@ be added to project %@ as well?",@"Yes",@"No",nil,fn,[project projectName]);
}
}
if (ret) {
if ([delegate fileManager:self shouldAddFile:fn forKey:otherKey]) {
NSString *pp = [project projectPath];
fileName = [fn lastPathComponent];
pth = [pp stringByAppendingPathComponent:fileName];
[[NSFileManager defaultManager] copyPath:fn toPath:pth handler:nil];
[project addFile:pth forKey:otherKey];
}
}
}
@ -309,9 +327,11 @@
if (delegate) {
path = [delegate fileManager:self willCreateFile:fileName withKey:key];
}
#ifdef DEBUG
NSLog(@"<%@ %x>: creating file at %@",[self class],self,path);
#endif DEBUG
// Create file
if (path) {
NSDictionary *newFiles;
@ -344,9 +364,11 @@
{
NSEnumerator *enumerator = [dict keyEnumerator];
id type;
#ifdef DEBUG
NSLog(@"<%@ %x>: Registering creators...",[self class],self);
#endif DEBUG
while (type = [enumerator nextObject]) {
id creator = [[dict objectForKey:type] objectForKey:@"Creator"];
@ -367,3 +389,6 @@
}
@end

View file

@ -28,6 +28,19 @@
#import "ProjectBuilder.h"
#ifndef IMAGE
#define IMAGE(X) [[[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:(X)]] autorelease]
#endif
#define BUILD_ARGS_KEY @"BuildArgsKey"
#define BUILD_HOST_KEY @"BuildHostKey"
#define TARGET_MAKE @"Make"
#define TARGET_MAKE_DEBUG @"MakeDebug"
#define TARGET_MAKE_PROFILE @"MakeProfile"
#define TARGET_MAKE_INSTALL @"MakeInstall"
#define TARGET_MAKE_CLEAN @"MakeClean"
#define TOUCHED_NOTHING (0)
#define TOUCHED_EVERYTHING (1 << 0)
#define TOUCHED_PROJECT_NAME (1 << 1)
@ -46,13 +59,6 @@
typedef int PCProjInfoBits;
typedef enum {
defaultTarget = 0,
debug,
profile,
install
} btarget;
//===========================================================================================
// ==== Project keys
//===========================================================================================
@ -82,30 +88,34 @@ static NSString * const PCLibraryVar = @"LIBRARY_VAR";
{
id projectWindow;
id delegate;
id projectBuilder;
id projectManager;
id browserController;
id textView;
id projectAttributeInspectorView;
NSTextField *installPathField;
NSTextField *toolField;
NSTextField *ccOptField;
NSTextField *ldOptField;
id projectProjectInspectorView;
NSTextField *projectTypeField;
id projectFileInspectorView;
NSTextField *fileNameField;
NSButton *changeFileNameButton;
id buildTargetPanel;
id buildTargetPopup;
id buildTargetHostField;
id buildTargetArgsField;
id buildStatusField;
id targetField;
NSString *projectName;
NSString *projectPath;
NSMutableDictionary *projectDict;
NSDictionary *rootCategories; // Needs to be initialised by subclasses!
@private
BOOL _needsReleasing;
btarget _buildTarget;
NSDictionary *rootCategories; // Needs to be initialised by subclasses!
NSMutableDictionary *buildOptions;
}
//===========================================================================================
@ -122,6 +132,9 @@ static NSString * const PCLibraryVar = @"LIBRARY_VAR";
//===========================================================================================
- (id)browserController;
- (NSString *)selectedRootCategory;
- (NSArray *)fileExtensionsForCategory:(NSString *)key;
- (void)setProjectName:(NSString *)aName;
- (NSString *)projectName;
@ -162,12 +175,18 @@ static NSString * const PCLibraryVar = @"LIBRARY_VAR";
// ==== Miscellaneous
//===========================================================================================
- (void)browserDidSelectFileNamed:(NSString *)fileName;
- (void)editSelectedFile:(NSString *)file;
- (void)structureEditedFile:(id)sender;
- (BOOL)doesAcceptFile:(NSString *)file forKey:(NSString *)key;
// Returns YES if type is a valid key and file is not contained in the project already
- (void)addFile:(NSString *)file forKey:(NSString *)key;
- (void)removeFile:(NSString *)file forKey:(NSString *)key;
- (BOOL)removeSelectedFilePermanently:(BOOL)yn;
- (void)renameFile:(NSString *)aFile;
- (BOOL)assignProjectDict:(NSDictionary *)aDict;
- (NSDictionary *)projectDict;
@ -199,17 +218,18 @@ static NSString * const PCLibraryVar = @"LIBRARY_VAR";
@interface PCProject (ProjectBuilding)
- (void)showInspector:(id)sender;
- (id)updatedAttributeView;
- (id)updatedProjectView;
- (id)updatedFilesView;
- (void)showBuildTargetPanel:(id)sender;
- (void)setTarget:(id)sender;
- (void)setHost:(id)sender;
- (void)setArguments:(id)sender;
- (void)build:(id)sender;
- (void)clean:(id)sender;
- (NSDictionary *)buildOptions;
@end
@ -228,3 +248,9 @@ static NSString * const PCLibraryVar = @"LIBRARY_VAR";
- (void)windowWillClose:(NSNotification *)aNotification;
@end
@interface PCProject (TextDelegate)
- (void)textDidEndEditing:(NSNotification *)aNotification;
@end

View file

@ -61,15 +61,15 @@
*
*/
_w_frame = NSMakeRect(100,100,512,320);
_w_frame = NSMakeRect(100,100,560,360);
projectWindow = [[NSWindow alloc] initWithContentRect:_w_frame
styleMask:style
backing:NSBackingStoreBuffered
defer:NO];
defer:YES];
[projectWindow setDelegate:self];
[projectWindow setMinSize:NSMakeSize(512,320)];
browser = [[[NSBrowser alloc] initWithFrame:NSMakeRect(30,30,280,400)] autorelease];
browser = [[[NSBrowser alloc] initWithFrame:NSMakeRect(30,30,288,128)] autorelease];
[browser setDelegate:browserController];
[browser setMaxVisibleColumns:3];
[browser setAllowsMultipleSelection:NO];
@ -77,25 +77,28 @@
[browserController setBrowser:browser];
[browserController setProject:self];
textView = [[NSTextView alloc] initWithFrame:NSMakeRect(0,0,472,88)];
textView = [[PCEditorView alloc] initWithFrame:NSMakeRect(0,0,520,168)];
[textView setMaxSize:NSMakeSize(1e7, 1e7)];
[textView setRichText:NO];
[textView setEditable:NO];
[textView setSelectable:YES];
[textView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
[textView setVerticallyResizable:YES];
[textView setHorizontallyResizable:YES];
[textView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
[textView setBackgroundColor:[NSColor whiteColor]];
[[textView textContainer] setWidthTracksTextView:YES];
scrollView = [[NSScrollView alloc] initWithFrame:NSMakeRect (0,0,496,92)];
scrollView = [[NSScrollView alloc] initWithFrame:NSMakeRect (0,0,544,172)];
[scrollView setDocumentView:textView];
[textView setMinSize:NSMakeSize(0.0,[scrollView contentSize].height)];
[[textView textContainer] setContainerSize:NSMakeSize([scrollView contentSize].width,1e7)];
[scrollView setHasHorizontalScroller: YES];
[scrollView setHasHorizontalScroller: NO];
[scrollView setHasVerticalScroller: YES];
[scrollView setBorderType: NSBezelBorder];
[scrollView setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)];
[scrollView autorelease];
split = [[[NSSplitView alloc] initWithFrame:NSMakeRect(8,0,496,264)] autorelease];
split = [[[NSSplitView alloc] initWithFrame:NSMakeRect(8,0,544,304)] autorelease];
[split setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)];
[split addSubview: browser];
[split addSubview: scrollView];
@ -103,156 +106,76 @@
_c_view = [projectWindow contentView];
[_c_view addSubview:split];
// Left button matrix
_w_frame = NSMakeRect(8,268,144,48);
/*
* Left button matrix
*/
_w_frame = NSMakeRect(8,308,330,48);
matrix = [[[NSMatrix alloc] initWithFrame: _w_frame
mode: NSHighlightModeMatrix
prototype: buttonCell
numberOfRows: 1
numberOfColumns: 3] autorelease];
numberOfColumns: 7] autorelease];
[matrix sizeToCells];
[matrix setSelectionByRect:YES];
[matrix setAutoresizingMask: (NSViewMaxXMargin | NSViewMinYMargin)];
[_c_view addSubview:matrix];
button = [matrix cellAtRow:0 column:0];
[button setImagePosition:NSImageOnly];
[button setImage:[[[NSImage alloc] initWithContentsOfFile:@"ProjectCentre_build.tiff"] autorelease]];
[button setImage:IMAGE(@"ProjectCentre_build")];
[button setButtonType:NSMomentaryPushButton];
[button setTarget:self];
[button setAction:@selector(build:)];
button = [matrix cellAtRow:0 column:1];
[button setImagePosition:NSImageOnly];
[button setImage:[[[NSImage alloc] initWithContentsOfFile:@"ProjectCentre_clean.tiff"] autorelease]];
[button setImage:IMAGE(@"ProjectCentre_settings.tiff")];
[button setButtonType:NSMomentaryPushButton];
[button setTarget:self];
[button setAction:@selector(clean:)];
[button setAction:@selector(showInspector:)];
button = [matrix cellAtRow:0 column:2];
[button setImagePosition:NSImageOnly];
[button setImage:[[[NSImage alloc] initWithContentsOfFile:@"ProjectCentre_prefs.tiff"] autorelease]];
[button setTarget:self];
[button setAction:@selector(showBuildTarget:)];
[button setImage:IMAGE(@"ProjectCentre_prefs.tiff")];
[button setButtonType:NSMomentaryPushButton];
[button setTarget:self];
[button setAction:@selector(showBuildTargetPanel:)];
// Right button matrix
_w_frame = NSMakeRect(304,268,192,48);
matrix = [[[NSMatrix alloc] initWithFrame: _w_frame
mode: NSHighlightModeMatrix
prototype: buttonCell
numberOfRows: 1
numberOfColumns: 4] autorelease];
[matrix setSelectionByRect:YES];
[matrix setAutoresizingMask: (NSViewMinXMargin | NSViewMinYMargin)];
[_c_view addSubview:matrix];
button = [matrix cellAtRow:0 column:0];
[button setImagePosition:NSImageOnly];
[button setImage:[[[NSImage alloc] initWithContentsOfFile:@"ProjectCentre_run.tiff"] autorelease]];
[button setButtonType:NSMomentaryPushButton];
button = [matrix cellAtRow:0 column:1];
[button setImagePosition:NSImageOnly];
[button setImage:[[[NSImage alloc] initWithContentsOfFile:@"ProjectCentre_uml.tiff"] autorelease]];
[button setButtonType:NSMomentaryPushButton];
button = [matrix cellAtRow:0 column:2];
[button setImagePosition:NSImageOnly];
[button setImage:[[[NSImage alloc] initWithContentsOfFile:@"ProjectCentre_documentation.tiff"] autorelease]];
[button setButtonType:NSMomentaryPushButton];
button = [matrix cellAtRow:0 column:3];
[button setImagePosition:NSImageOnly];
[button setImage:[[[NSImage alloc] initWithContentsOfFile:@"ProjectCentre_find.tiff"] autorelease]];
[button setImage:IMAGE(@"ProjectCentre_run.tiff")];
[button setButtonType:NSMomentaryPushButton];
// Status
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(152,296,48,15)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setEditable: NO];
[textField setBezeled: NO];
[textField setDrawsBackground: NO];
[textField setStringValue:@"Status:"];
[textField setAutoresizingMask: (NSViewMaxXMargin |
NSViewMinYMargin)];
[_c_view addSubview:[textField autorelease]];
button = [matrix cellAtRow:0 column:4];
[button setImagePosition:NSImageOnly];
[button setImage:IMAGE(@"ProjectCentre_uml.tiff")];
[button setButtonType:NSMomentaryPushButton];
// Status message
buildStatusField = [[NSTextField alloc] initWithFrame:NSMakeRect(204,296,104,15)];
[buildStatusField setAlignment: NSLeftTextAlignment];
[buildStatusField setBordered: NO];
[buildStatusField setEditable: NO];
[buildStatusField setBezeled: NO];
[buildStatusField setDrawsBackground: NO];
[buildStatusField setStringValue:@"waiting..."];
[buildStatusField setAutoresizingMask: (NSViewMaxXMargin |
NSViewWidthSizable |
NSViewMinYMargin)];
[_c_view addSubview:[buildStatusField autorelease]];
button = [matrix cellAtRow:0 column:5];
[button setImagePosition:NSImageOnly];
[button setImage:IMAGE(@"ProjectCentre_documentation.tiff")];
[button setButtonType:NSMomentaryPushButton];
// Target
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(152,272,48,15)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setBezeled: NO];
[textField setEditable: NO];
[textField setDrawsBackground: NO];
[textField setStringValue:@"Target:"];
[textField setAutoresizingMask: (NSViewMaxXMargin |
NSViewMinYMargin)];
[_c_view addSubview:[textField autorelease]];
// Target message
targetField = [[NSTextField alloc] initWithFrame:NSMakeRect(204,272,104,15)];
[targetField setAlignment: NSLeftTextAlignment];
[targetField setBordered: NO];
[targetField setEditable: NO];
[targetField setBezeled: NO];
[targetField setDrawsBackground: NO];
[targetField setStringValue:@"Default..."];
[targetField setAutoresizingMask: (NSViewMaxXMargin |
NSViewWidthSizable |
NSViewMinYMargin)];
[_c_view addSubview:[targetField autorelease]];
button = [matrix cellAtRow:0 column:6];
[button setImagePosition:NSImageOnly];
[button setImage:IMAGE(@"ProjectCentre_find.tiff")];
[button setButtonType:NSMomentaryPushButton];
/*
* Build Panel
* Build Options Panel
*
*/
_w_frame = NSMakeRect(100,100,272,104);
_w_frame = NSMakeRect(100,100,272,80);
buildTargetPanel = [[NSWindow alloc] initWithContentRect:_w_frame styleMask:style backing:NSBackingStoreBuffered defer:NO];
[buildTargetPanel setDelegate:self];
[buildTargetPanel setReleasedWhenClosed:NO];
[buildTargetPanel setTitle:@"Build Options"];
_c_view = [buildTargetPanel contentView];
buildTargetPopup = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(72,24,184,20)];
[buildTargetPopup addItemWithTitle:@"Default"];
[buildTargetPopup addItemWithTitle:@"Debug"];
[buildTargetPopup addItemWithTitle:@"Profile"];
[buildTargetPopup addItemWithTitle:@"Install"];
[buildTargetPopup autorelease];
[buildTargetPopup setTarget:self];
[buildTargetPopup setAction:@selector(setTarget:)];
[_c_view addSubview:buildTargetPopup];
// Target (popup)
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(16,24,56,21)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setEditable: NO];
[textField setBezeled: NO];
[textField setDrawsBackground: NO];
[textField setStringValue:@"Target:"];
[_c_view addSubview:[textField autorelease]];
// Host
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(16,48,56,21)];
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(16,24,56,21)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setEditable: NO];
@ -262,17 +185,20 @@
[_c_view addSubview:[textField autorelease]];
// Host message
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,48,184,21)];
[textField setAlignment: NSLeftTextAlignment];
[textField setBordered: NO];
[textField setEditable: YES];
[textField setBezeled: YES];
[textField setDrawsBackground: YES];
[textField setStringValue:@"localhost"];
[_c_view addSubview:[textField autorelease]];
buildTargetHostField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,24,184,21)];
[buildTargetHostField setAlignment: NSLeftTextAlignment];
[buildTargetHostField setBordered: NO];
[buildTargetHostField setEditable: YES];
[buildTargetHostField setBezeled: YES];
[buildTargetHostField setDrawsBackground: YES];
[buildTargetHostField setStringValue:@"localhost"];
[buildTargetHostField setDelegate:self];
[buildTargetHostField setTarget:self];
[buildTargetHostField setAction:@selector(setHost:)];
[_c_view addSubview:[buildTargetHostField autorelease]];
// Args
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,68,60,21)];
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,44,60,21)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setEditable: NO];
@ -282,19 +208,161 @@
[_c_view addSubview:[textField autorelease]];
// Args message
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,68,184,21)];
[textField setAlignment: NSLeftTextAlignment];
buildTargetArgsField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,44,184,21)];
[buildTargetArgsField setAlignment: NSLeftTextAlignment];
[buildTargetArgsField setBordered: NO];
[buildTargetArgsField setEditable: YES];
[buildTargetArgsField setBezeled: YES];
[buildTargetArgsField setDrawsBackground: YES];
[buildTargetArgsField setStringValue:@""];
[buildTargetArgsField setDelegate:self];
[buildTargetArgsField setTarget:self];
[buildTargetArgsField setAction:@selector(setArguments:)];
[_c_view addSubview:[buildTargetArgsField autorelease]];
/*
* Model the standard inspector UI
*
*/
projectAttributeInspectorView = [[NSBox alloc] init];
[projectAttributeInspectorView setFrame:NSMakeRect(-2,-2,284,334)];
[projectAttributeInspectorView setTitlePosition:NSNoTitle];
[projectAttributeInspectorView setBorderType:NSNoBorder];
[projectAttributeInspectorView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,280,64,21)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setEditable: YES];
[textField setBezeled: YES];
[textField setDrawsBackground: YES];
[textField setStringValue:@""];
[_c_view addSubview:[textField autorelease]];
[textField setEditable: NO];
[textField setBezeled: NO];
[textField setDrawsBackground: NO];
[textField setStringValue:@"Install in:"];
[projectAttributeInspectorView addSubview:[textField autorelease]];
installPathField =[[NSTextField alloc] initWithFrame:NSMakeRect(84,280,176,21)];
[installPathField setAlignment: NSLeftTextAlignment];
[installPathField setBordered: YES];
[installPathField setEditable: YES];
[installPathField setBezeled: YES];
[installPathField setDrawsBackground: YES];
[installPathField setStringValue:@""];
[projectAttributeInspectorView addSubview:installPathField];
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,256,64,21)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setEditable: NO];
[textField setBezeled: NO];
[textField setDrawsBackground: NO];
[textField setStringValue:@"Build tool:"];
[projectAttributeInspectorView addSubview:[textField autorelease]];
toolField =[[NSTextField alloc] initWithFrame:NSMakeRect(84,256,176,21)];
[toolField setAlignment: NSLeftTextAlignment];
[toolField setBordered: YES];
[toolField setEditable: YES];
[toolField setBezeled: YES];
[toolField setDrawsBackground: YES];
[toolField setStringValue:@""];
[projectAttributeInspectorView addSubview:toolField];
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,232,64,21)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setEditable: NO];
[textField setBezeled: NO];
[textField setDrawsBackground: NO];
[textField setStringValue:@"CC options:"];
[projectAttributeInspectorView addSubview:[textField autorelease]];
ccOptField =[[NSTextField alloc] initWithFrame:NSMakeRect(84,232,176,21)];
[ccOptField setAlignment: NSLeftTextAlignment];
[ccOptField setBordered: YES];
[ccOptField setEditable: YES];
[ccOptField setBezeled: YES];
[ccOptField setDrawsBackground: YES];
[ccOptField setStringValue:@""];
[projectAttributeInspectorView addSubview:ccOptField];
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,204,64,21)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setEditable: NO];
[textField setBezeled: NO];
[textField setDrawsBackground: NO];
[textField setStringValue:@"LD options:"];
[projectAttributeInspectorView addSubview:[textField autorelease]];
ldOptField =[[NSTextField alloc] initWithFrame:NSMakeRect(84,204,176,21)];
[ldOptField setAlignment: NSLeftTextAlignment];
[ldOptField setBordered: YES];
[ldOptField setEditable: YES];
[ldOptField setBezeled: YES];
[ldOptField setDrawsBackground: YES];
[ldOptField setStringValue:@""];
[projectAttributeInspectorView addSubview:ldOptField];
projectProjectInspectorView = [[NSBox alloc] init];
[projectProjectInspectorView setFrame:NSMakeRect(-2,-2,284,334)];
[projectProjectInspectorView setTitlePosition:NSNoTitle];
[projectProjectInspectorView setBorderType:NSNoBorder];
[projectProjectInspectorView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,280,64,21)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setEditable: NO];
[textField setBezeled: NO];
[textField setDrawsBackground: NO];
[textField setStringValue:@"Type:"];
[projectProjectInspectorView addSubview:[textField autorelease]];
projectTypeField =[[NSTextField alloc] initWithFrame:NSMakeRect(84,280,176,21)];
[projectTypeField setAlignment: NSLeftTextAlignment];
[projectTypeField setBordered: NO];
[projectTypeField setEditable: NO];
[projectTypeField setBezeled: NO];
[projectTypeField setDrawsBackground: NO];
[projectTypeField setStringValue:@""];
[projectProjectInspectorView addSubview:projectTypeField];
projectFileInspectorView = [[NSBox alloc] init];
[projectFileInspectorView setFrame:NSMakeRect(-2,-2,284,334)];
[projectFileInspectorView setTitlePosition:NSNoTitle];
[projectFileInspectorView setBorderType:NSNoBorder];
[projectFileInspectorView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,280,64,21)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setEditable: NO];
[textField setBezeled: NO];
[textField setDrawsBackground: NO];
[textField setStringValue:@"Filename:"];
[projectFileInspectorView addSubview:[textField autorelease]];
fileNameField =[[NSTextField alloc] initWithFrame:NSMakeRect(84,280,176,21)];
[fileNameField setAlignment: NSLeftTextAlignment];
[fileNameField setBordered: NO];
[fileNameField setEditable: NO];
[fileNameField setBezeled: NO];
[fileNameField setDrawsBackground: NO];
[fileNameField setStringValue:@""];
[projectFileInspectorView addSubview:fileNameField];
changeFileNameButton = [[NSButton alloc] initWithFrame:NSMakeRect(84,240,104,21)];
[changeFileNameButton setTitle:@"Rename..."];
[changeFileNameButton setTarget:self];
[changeFileNameButton setAction:@selector(renameFile:)];
[projectFileInspectorView addSubview:changeFileNameButton];
/*
*
*/
// Redisplay!
[browser loadColumnZero];
_needsReleasing = YES;
}
@end
@ -308,18 +376,8 @@
- (id)init
{
if ((self = [super init])) {
_buildTarget = defaultTarget;
_needsReleasing = NO;
#if defined(GNUSTEP)
buildOptions = [[NSMutableDictionary alloc] init];
[self _initUI];
#else
if(![NSBundle loadNibNamed:@"Project.nib" owner:self]) {
[[NSException exceptionWithName:NIB_NOT_FOUND_EXCEPTION reason:@"Could not load Project.gmodel" userInfo:nil] raise];
return nil;
}
#endif
}
return self;
}
@ -347,17 +405,29 @@
- (void)dealloc
{
[projectName release];
[projectPath release];
[projectDict release];
[projectName release];
[projectPath release];
[projectDict release];
[browserController release];
[projectWindow release];
[buildTargetPanel release];
[buildOptions release];
[projectAttributeInspectorView release];
[installPathField release];
[toolField release];
[ccOptField release];
[ldOptField release];
[projectTypeField release];
if (_needsReleasing) {
[browserController release];
[projectWindow release];
[buildTargetPanel release];
}
[super dealloc];
[projectProjectInspectorView release];
[projectFileInspectorView release];
[fileNameField release];
[changeFileNameButton release];
[super dealloc];
}
//===========================================================================================
@ -369,6 +439,39 @@
return browserController;
}
- (NSString *)selectedRootCategory
{
return [self projectKeyForKeyPath:[browserController pathOfSelectedFile]];
}
- (NSArray *)fileExtensionsForCategory:(NSString *)key
{
if ([key isEqualToString:PCGModels]) {
return [NSArray arrayWithObjects:@"gmodel",@"gorm",nil];
}
else if ([key isEqualToString:PCClasses]) {
return [NSArray arrayWithObjects:@"m",nil];
}
else if ([key isEqualToString:PCHeaders]) {
return [NSArray arrayWithObjects:@"h",nil];
}
else if ([key isEqualToString:PCOtherSources]) {
return [NSArray arrayWithObjects:@"c",@"C",nil];
}
else if ([key isEqualToString:PCLibraries]) {
return [NSArray arrayWithObjects:@"so",@"a",@"lib",nil];
}
else if ([key isEqualToString:PCSubprojects]) {
return [NSArray arrayWithObjects:@"subproj",nil];
}
else if ([key isEqualToString:PCImages]) {
return [NSImage imageFileTypes];
//return [NSArray arrayWithObjects:@"tiff",@"TIFF",@"jpg",@"JPG",@"jpeg",@"JPEG",@"bmp",@"BMP",nil];
}
return nil;
}
- (void)setProjectName:(NSString *)aName
{
[projectName autorelease];
@ -398,23 +501,23 @@
- (id)delegate
{
return delegate;
return delegate;
}
- (void)setDelegate:(id)aDelegate
{
delegate = aDelegate;
delegate = aDelegate;
}
- (void)setProjectBuilder:(id<ProjectBuilder>)aBuilder
{
[projectBuilder autorelease];
projectBuilder = [aBuilder retain];
[projectManager autorelease];
projectManager = [aBuilder retain];
}
- (id<ProjectBuilder>)projectBuilder
{
return projectBuilder;
return projectManager;
}
//===========================================================================================
@ -465,6 +568,39 @@
// ==== Miscellaneous
//===========================================================================================
- (void)browserDidSelectFileNamed:(NSString *)fileName
{
[fileNameField setStringValue:fileName];
}
- (void)editSelectedFile:(NSString *)file
{
// NSLayoutManager *_lm = [textView layoutManager];
// NSTextStorage *_ts = [[NSTextStorage alloc] initWithString:file];
/*
[_ts beginEditing];
[[_ts mutableString] setString:file];
[_ts endEditing];
*/
/*
if (_lm) {
[_lm replaceTextStorage:_ts];
}
*/
[textView setString:file];
// [textView structure:self];
[textView display];
// [_ts autorelease];
}
- (void)structureEditedFile:(id)sender
{
// [textView structure:self];
}
- (BOOL)doesAcceptFile:(NSString *)file forKey:(NSString *)type
{
if ([[projectDict allKeys] containsObject:type]) {
@ -489,7 +625,7 @@
}
if ([files containsObject:newFile]) {
NSRunAlertPanel(@"Attention!",@"The file %@ is already contained in this project!",@"OK",nil,nil,newFile);
NSRunAlertPanel(@"Attention!",@"The file %@ is already part of this project!",@"OK",nil,nil,newFile);
return;
}
@ -522,6 +658,10 @@
NSString *file = [browserController nameOfSelectedFile];
NSMutableArray *array;
NSString *key;
NSString *otherKey;
NSString *ext;
NSString *fn;
BOOL ret = NO;
if (!file) {
return NO;
@ -530,16 +670,52 @@
key = [self projectKeyForKeyPath:[browserController pathOfSelectedFile]];
[self removeFile:file forKey:key];
if ([key isEqualToString:PCClasses]) {
otherKey = PCHeaders;
ext = [NSString stringWithString:@"h"];
fn = [file stringByDeletingPathExtension];
fn = [fn stringByAppendingPathExtension:ext];
if ([self doesAcceptFile:fn forKey:otherKey] == NO) {
ret = NSRunAlertPanel(@"Removing Header?",@"Should %@ be removed from the project %@ as well?",@"Yes",@"No",nil,fn,[self projectName]);
}
}
else if ([key isEqualToString:PCHeaders]) {
otherKey = PCClasses;
ext = [NSString stringWithString:@"m"];
fn = [file stringByDeletingPathExtension];
fn = [fn stringByAppendingPathExtension:ext];
if ([self doesAcceptFile:fn forKey:otherKey] == NO) {
ret = NSRunAlertPanel(@"Removing Class?",@"Should %@ be removed from the project %@ as well?",@"Yes",@"No",nil,fn,[self projectName]);
}
}
if (ret) {
[self removeFile:fn forKey:otherKey];
}
// Remove the file permanently?!
if (yn) {
NSString *pth = [projectPath stringByAppendingPathComponent:file];
[[NSFileManager defaultManager] removeFileAtPath:pth handler:nil];
if (ret) {
pth = [projectPath stringByAppendingPathComponent:fn];
[[NSFileManager defaultManager] removeFileAtPath:pth handler:nil];
}
}
return YES;
}
- (void)renameFile:(NSString *)aFile
{
}
- (BOOL)assignProjectDict:(NSDictionary *)aDict
{
NSAssert(aDict,@"No valid project dictionary!");
@ -641,7 +817,7 @@
- (void)showInspector:(id)sender
{
[projectBuilder showInspectorForProject:self];
[projectManager showInspectorForProject:self];
}
- (id)updatedAttributeView
@ -661,74 +837,34 @@
- (void)showBuildTargetPanel:(id)sender
{
[buildTargetPanel center];
if (![buildTargetPanel isVisible]) {
[buildTargetPanel center];
}
[buildTargetPanel makeKeyAndOrderFront:self];
}
- (void)setTarget:(id)sender
{
_buildTarget = [buildTargetPopup indexOfSelectedItem];
}
- (void)setHost:(id)sender
{
NSLog(@"Setting host...");
NSString *host = [buildTargetHostField stringValue];
[buildOptions setObject:host forKey:BUILD_HOST_KEY];
NSLog(@"New host %@",host);
}
- (void)setArguments:(id)sender
{
NSLog(@"Setting args...");
NSString *args = [buildTargetArgsField stringValue];
[buildOptions setObject:args forKey:BUILD_ARGS_KEY];
}
- (void)build:(id)sender
{
BOOL ret = YES;
NSString *target = [buildTargetPopup titleOfSelectedItem];
NSMutableDictionary *optionDict = [NSMutableDictionary dictionary];
[buildStatusField setStringValue:@"Building..."];
// Check the panel for this option!
if ([target isEqualToString:@"Debug"]) {
[optionDict setObject:TARGET_MAKE_DEBUG forKey:BUILD_KEY];
}
if ([target isEqualToString:@"Profile"]) {
[optionDict setObject:TARGET_MAKE_PROFILE forKey:BUILD_KEY];
}
if ([target isEqualToString:@"Install"]) {
[optionDict setObject:TARGET_MAKE_INSTALL forKey:BUILD_KEY];
}
else {
[optionDict setObject:TARGET_MAKE forKey:BUILD_KEY];
}
[[PCProjectBuilder sharedBuilder] buildProject:self options:optionDict];
if (ret) {
[buildStatusField setStringValue:@"Build completed!"];
}
else {
[buildStatusField setStringValue:@"Build failed!"];
}
[[PCProjectBuilder sharedBuilder] showPanelWithProject:self options:buildOptions];
}
- (void)clean:(id)sender
- (NSDictionary *)buildOptions
{
BOOL ret = YES;
NSMutableDictionary *optionDict = [NSMutableDictionary dictionary];
[buildStatusField setStringValue:@"Cleaning..."];
// Check the panel for this option!
[optionDict setObject:TARGET_MAKE_CLEAN forKey:BUILD_KEY];
[[PCProjectBuilder sharedBuilder] buildProject:self options:optionDict];
if (ret) {
[buildStatusField setStringValue:@"Cleaning completed!"];
}
else {
[buildStatusField setStringValue:@"Cleaning failed!"];
}
return (NSDictionary *)buildOptions;
}
@end
@ -758,7 +894,8 @@
}
key = [[keyPath componentsSeparatedByString:@"/"] lastObject];
if ([[rootCategories allKeys] containsObject:key] || [[projectDict objectForKey:PCSubprojects] containsObject:key]) {
if ([[rootCategories allKeys] containsObject:key] ||
[[projectDict objectForKey:PCSubprojects] containsObject:key]) {
return YES;
}
@ -767,9 +904,9 @@
- (NSString *)projectKeyForKeyPath:(NSString *)kp
{
NSString *type = [[kp componentsSeparatedByString:@"/"] objectAtIndex:1];
return [rootCategories objectForKey:type];
NSString *type = [[kp componentsSeparatedByString:@"/"] objectAtIndex:1];
return [rootCategories objectForKey:type];
}
@end
@ -778,23 +915,40 @@
- (void)windowDidBecomeKey:(NSNotification *)aNotification
{
[projectBuilder setActiveProject:self];
[projectManager setActiveProject:self];
}
- (void)windowDidBecomeMain:(NSNotification *)aNotification
{
[projectBuilder setActiveProject:self];
[projectManager setActiveProject:self];
}
- (void)windowWillClose:(NSNotification *)aNotification
{
id object = [aNotification object];
if (object == buildTargetPanel) {
}
else if (object == [self projectWindow]) {
if ([[self projectWindow] isDocumentEdited]) {
if (NSRunAlertPanel(@"Project changed!",@"The project %@ has unsaved files! Should they be saved before closing it?",@"Yes",@"No",nil,[self projectName])) {
[self save];
}
if (NSRunAlertPanel(@"Project changed!",@"The project %@ has unsaved files! Should they be saved before closing it?",@"Yes",@"No",nil,[self projectName])) {
[self save];
}
}
// The PCProjectController is our delegate!
[projectBuilder closeProject:self];
[projectManager closeProject:self];
}
}
@end
@implementation PCProject (TextDelegate)
- (void)textDidEndEditing:(NSNotification *)aNotification
{
}
@end

View file

@ -28,15 +28,6 @@
@class PCProject;
#define BUILD_KEY @"BuildKey"
#define BUILD_OPTIONS_KEY @"BuildOptionsKey"
#define TARGET_MAKE @"Make"
#define TARGET_MAKE_DEBUG @"MakeDebug"
#define TARGET_MAKE_PROFILE @"MakeProfile"
#define TARGET_MAKE_INSTALL @"MakeInstall"
#define TARGET_MAKE_CLEAN @"MakeClean"
@class NSWindow;
@class NSTextView;
@ -45,9 +36,19 @@
NSWindow *buildWindow;
NSTextView *logOutput;
NSTextView *errorOutput;
NSMutableDictionary *buildTasks;
NSString *makePath;
id buildStatusField;
id targetField;
PCProject *currentProject;
NSDictionary *currentOptions;
NSFileHandle *readHandle;
NSFileHandle *errorReadHandle;
}
+ (id)sharedBuilder;
@ -55,6 +56,27 @@
- (id)init;
- (void)dealloc;
- (BOOL)buildProject:(PCProject *)aProject options:(NSDictionary *)optionDict;
- (void)showPanelWithProject:(PCProject *)proj options:(NSDictionary *)options;
- (void)build:(id)sender;
- (void)logStdOut:(NSNotification *)aNotif;
- (void)logErrOut:(NSNotification *)aNotif;
- (void)buildDidTerminate:(NSNotification *)aNotif;
- (void)projectDidChange:(NSNotification *)aNotif;
@end
@interface PCProjectBuilder (BuildLogging)
- (void)logString:(NSString *)string error:(BOOL)yn;
- (void)logString:(NSString *)string error:(BOOL)yn newLine:(BOOL)newLine;
- (void)logData:(NSData *)data error:(BOOL)yn;
@end

View file

@ -26,9 +26,18 @@
#import "PCProjectBuilder.h"
#import "PCProject.h"
#import "PCProjectManager.h"
#import <AppKit/AppKit.h>
#ifndef IMAGE
#define IMAGE(X) [[[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:(X)]] autorelease]
#endif
#ifndef NOTIFICATION_CENTER
#define NOTIFICATION_CENTER [NSNotificationCenter defaultCenter]
#endif
@interface PCProjectBuilder (CreateUI)
- (void)_initUI;
@ -44,11 +53,12 @@
NSMiniaturizableWindowMask | NSResizableWindowMask;
NSSplitView *split;
NSScrollView *scrollView1;
NSScrollView *scrollView2;
NSTextView *textView2;
NSMatrix* matrix;
NSRect _w_frame;
NSButtonCell* buttonCell = [[[NSButtonCell alloc] init] autorelease];
id button;
id textField;
/*
* Build Window
@ -63,20 +73,24 @@
[buildWindow setDelegate:self];
[buildWindow setReleasedWhenClosed:NO];
[buildWindow setMinSize:NSMakeSize(512,320)];
[buildWindow setFrameAutosaveName:@"Builder"];
logOutput = [[NSTextView alloc] initWithFrame:NSMakeRect(0,0,472,88)];
logOutput = [[NSTextView alloc] initWithFrame:NSMakeRect(0,0,472,80)];
[logOutput setMaxSize:NSMakeSize(1e7, 1e7)];
[logOutput setRichText:NO];
[logOutput setEditable:NO];
[logOutput setSelectable:YES];
[logOutput setVerticallyResizable:YES];
[logOutput setHorizontallyResizable:YES];
[logOutput setHorizontallyResizable:NO];
[logOutput setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
[logOutput setBackgroundColor:[NSColor whiteColor]];
[logOutput setBackgroundColor:[NSColor lightGrayColor]];
[[logOutput textContainer] setWidthTracksTextView:YES];
scrollView1 = [[NSScrollView alloc] initWithFrame:NSMakeRect (0,0,496,92)];
[scrollView1 setDocumentView:logOutput];
[logOutput setMinSize:NSMakeSize(0.0,[scrollView1 contentSize].height)];
[[logOutput textContainer] setContainerSize:NSMakeSize([scrollView1 contentSize].width,1e7)];
[scrollView1 setHasHorizontalScroller: YES];
[scrollView1 setHasHorizontalScroller: NO];
[scrollView1 setHasVerticalScroller: YES];
[scrollView1 setBorderType: NSBezelBorder];
[scrollView1 setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
@ -86,20 +100,23 @@
*
*/
textView2 = [[NSTextView alloc] initWithFrame:NSMakeRect(0,0,472,88)];
[textView2 setMaxSize:NSMakeSize(1e7, 1e7)];
[textView2 setVerticallyResizable:YES];
[textView2 setHorizontallyResizable:YES];
[textView2 setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
[textView2 setBackgroundColor:[NSColor whiteColor]];
[[textView2 textContainer] setWidthTracksTextView:YES];
errorOutput = [[NSTextView alloc] initWithFrame:NSMakeRect(0,0,472,80)];
[errorOutput setMaxSize:NSMakeSize(1e7, 1e7)];
[errorOutput setRichText:NO];
[errorOutput setEditable:NO];
[errorOutput setSelectable:YES];
[errorOutput setVerticallyResizable:YES];
[errorOutput setHorizontallyResizable:NO];
[errorOutput setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
[errorOutput setBackgroundColor:[NSColor whiteColor]];
[[errorOutput textContainer] setWidthTracksTextView:YES];
scrollView2 = [[NSScrollView alloc] initWithFrame:NSMakeRect (0,0,496,92)];
[scrollView2 setDocumentView:textView2];
[textView2 setMinSize:NSMakeSize(0.0,[scrollView2 contentSize].height)];
[[textView2 textContainer] setContainerSize:NSMakeSize([scrollView2 contentSize].width,1e7)];
[scrollView2 setHasHorizontalScroller: YES];
[scrollView2 setHasVerticalScroller: YES];
[scrollView2 setDocumentView:errorOutput];
[errorOutput setMinSize:NSMakeSize(0.0,[scrollView2 contentSize].height)];
[[errorOutput textContainer] setContainerSize:NSMakeSize([scrollView2 contentSize].width,1e7)];
[scrollView2 setHasHorizontalScroller:NO];
[scrollView2 setHasVerticalScroller:YES];
[scrollView2 setBorderType: NSBezelBorder];
[scrollView2 setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
[scrollView2 autorelease];
@ -111,6 +128,125 @@
_c_view = [buildWindow contentView];
[_c_view addSubview:split];
/*
* 5 build Buttons
*/
_w_frame = NSMakeRect(8,272,244,44);
matrix = [[[NSMatrix alloc] initWithFrame: _w_frame
mode: NSHighlightModeMatrix
prototype: buttonCell
numberOfRows: 1
numberOfColumns: 5] autorelease];
[matrix sizeToCells];
[matrix setSelectionByRect:YES];
[matrix setAutoresizingMask: (NSViewMaxXMargin | NSViewMinYMargin)];
[matrix setTarget:self];
[matrix setAction:@selector(build:)];
[_c_view addSubview:matrix];
button = [matrix cellAtRow:0 column:0];
[button setTag:0];
//[button setImagePosition:NSNoImage];
[button setImagePosition:NSImageOnly];
[button setImage:IMAGE(@"ProjectCenter_make")];
[button setButtonType:NSMomentaryPushButton];
[button setTitle:@"Build"];
button = [matrix cellAtRow:0 column:1];
[button setTag:1];
//[button setImagePosition:NSNoImage];
[button setImagePosition:NSImageOnly];
[button setImage:IMAGE(@"ProjectCenter_clean")];
[button setButtonType:NSMomentaryPushButton];
[button setTitle:@"Clean"];
button = [matrix cellAtRow:0 column:2];
[button setTag:2];
//[button setImagePosition:NSNoImage];
[button setImagePosition:NSImageOnly];
[button setImage:IMAGE(@"ProjectCenter_debug")];
[button setButtonType:NSMomentaryPushButton];
[button setTitle:@"Debug"];
button = [matrix cellAtRow:0 column:3];
[button setTag:3];
//[button setImagePosition:NSNoImage];
[button setImagePosition:NSImageOnly];
[button setImage:IMAGE(@"ProjectCenter_profile")];
[button setButtonType:NSMomentaryPushButton];
[button setTitle:@"Profile"];
button = [matrix cellAtRow:0 column:4];
[button setTag:4];
//[button setImagePosition:NSNoImage];
[button setImagePosition:NSImageOnly];
[button setImage:IMAGE(@"ProjectCenter_install")];
[button setButtonType:NSMomentaryPushButton];
[button setTitle:@"Install"];
/*
* Status
*/
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(256,296,48,15)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setEditable: NO];
[textField setBezeled: NO];
[textField setDrawsBackground: NO];
[textField setStringValue:@"Status:"];
[textField setAutoresizingMask: (NSViewMaxXMargin |
NSViewMinYMargin)];
[_c_view addSubview:[textField autorelease]];
/*
* Status message
*/
buildStatusField = [[NSTextField alloc] initWithFrame:NSMakeRect(308,296,104,15)];
[buildStatusField setAlignment: NSLeftTextAlignment];
[buildStatusField setBordered: NO];
[buildStatusField setEditable: NO];
[buildStatusField setBezeled: NO];
[buildStatusField setDrawsBackground: NO];
[buildStatusField setStringValue:@"waiting..."];
[buildStatusField setAutoresizingMask: (NSViewMaxXMargin |
NSViewWidthSizable |
NSViewMinYMargin)];
[_c_view addSubview:[buildStatusField autorelease]];
/*
* Target
*/
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(256,272,48,15)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setBezeled: NO];
[textField setEditable: NO];
[textField setDrawsBackground: NO];
[textField setStringValue:@"Target:"];
[textField setAutoresizingMask: (NSViewMaxXMargin |
NSViewMinYMargin)];
[_c_view addSubview:[textField autorelease]];
/*
* Target message
*/
targetField = [[NSTextField alloc] initWithFrame:NSMakeRect(308,272,104,15)];
[targetField setAlignment: NSLeftTextAlignment];
[targetField setBordered: NO];
[targetField setEditable: NO];
[targetField setBezeled: NO];
[targetField setDrawsBackground: NO];
[targetField setStringValue:@"Default..."];
[targetField setAutoresizingMask: (NSViewMaxXMargin |
NSViewWidthSizable |
NSViewMinYMargin)];
[_c_view addSubview:[targetField autorelease]];
}
@end
@ -133,12 +269,16 @@ static PCProjectBuilder *_builder;
[self _initUI];
makePath = [[NSString stringWithString:@"/usr/bin/make"] retain];
buildTasks = [[NSMutableDictionary dictionary] retain];
[NOTIFICATION_CENTER addObserver:self selector:@selector(projectDidChange:) name:ActiveProjectDidChangeNotification object:nil];
}
return self;
}
- (void)dealloc
{
[NOTIFICATION_CENTER removeObserver:self];
[buildWindow release];
[makePath release];
[buildTasks release];
@ -146,83 +286,214 @@ static PCProjectBuilder *_builder;
[super dealloc];
}
- (BOOL)buildProject:(PCProject *)aProject options:(NSDictionary *)optionDict
- (void)showPanelWithProject:(PCProject *)proj options:(NSDictionary *)options;
{
if (![buildWindow isVisible]) {
[buildWindow setFrameUsingName:@"Builder"];
}
[buildWindow makeKeyAndOrderFront:self];
currentProject = proj;
currentOptions = options;
[buildWindow setTitle:[proj projectName]];
}
- (void)build:(id)sender
{
BOOL ret = NO;
NSString *tg = nil;
NSTask *makeTask;
NSMutableArray *args;
NSString *output = nil;
NSPipe *logPipe;
NSFileHandle *readHandle;
NSData *inData = nil;
NSPipe *errorPipe;
NSDictionary *optionDict;
NSString *status;
NSString *target;
if (!currentProject) {
return;
}
logPipe = [NSPipe pipe];
readHandle = [logPipe fileHandleForReading];
NSAssert(aProject,@"No project provided!");
readHandle = [[logPipe fileHandleForReading] retain];
errorPipe = [NSPipe pipe];
errorReadHandle = [[errorPipe fileHandleForReading] retain];
makeTask = [[NSTask alloc] init];
if ((tg = [optionDict objectForKey:BUILD_KEY])) {
if ([tg isEqualToString:TARGET_MAKE_DEBUG]) {
args = [NSMutableArray array];
[args addObject:@"debug=yes"];
[makeTask setArguments:args];
optionDict = [currentProject buildOptions];
args = [NSMutableArray array];
switch ([[sender selectedCell] tag]) {
case 0:
status = [NSString stringWithString:@"Building..."];
target = [NSString stringWithString:@"Default"];
break;
case 1:
if (NSRunAlertPanel(@"Clean Project?",@"Really clean %@?",@"Yes",@"No",nil,[currentProject projectName]) == NSAlertAlternateReturn) {
return;
}
else if ([tg isEqualToString:TARGET_MAKE_PROFILE]) {
args = [NSMutableArray array];
[args addObject:@"profile=YES"];
[args addObject:@"static=YES"];
[makeTask setArguments:args];
}
else if ([tg isEqualToString:TARGET_MAKE_INSTALL]) {
args = [NSMutableArray array];
[args addObject:@"install"];
[makeTask setArguments:args];
}
else if ([tg isEqualToString:TARGET_MAKE_CLEAN]) {
args = [NSMutableArray array];
[args addObject:@"clean"];
[makeTask setArguments:args];
}
[makeTask setCurrentDirectoryPath:[aProject projectPath]];
[makeTask setLaunchPath:makePath];
[makeTask setStandardOutput:logPipe];
[makeTask setStandardError:logPipe];
if (![buildWindow isVisible]) {
[buildWindow center];
[buildWindow makeKeyAndOrderFront:self];
}
[makeTask launch];
/*
* This is just a quick hack for now...
*/
while ((inData = [readHandle availableData]) && [inData length]) {
output = [[NSString alloc] initWithData:inData encoding:NSASCIIStringEncoding];
[logOutput setString:[NSString stringWithFormat:@"%@%@\n", [logOutput string], output]];
[logOutput scrollRangeToVisible:NSMakeRange([[logOutput textStorage] length], 0)];
[output release];
}
[makeTask waitUntilExit];
ret = [makeTask terminationStatus];
#ifdef DEBUG
NSLog(@"Task terminated %@...",(ret)?@"successfully":@"not successfully");
#endif DEBUG
[makeTask autorelease];
status = [NSString stringWithString:@"Cleaning..."];
target = [NSString stringWithString:@"Clean"];
[args addObject:@"clean"];
break;
case 2:
status = [NSString stringWithString:@"Building..."];
target = [NSString stringWithString:@"Debug"];
[args addObject:@"debug=yes"];
break;
case 3:
status = [NSString stringWithString:@"Building..."];
target = [NSString stringWithString:@"Profile"];
[args addObject:@"profile=yes"];
[args addObject:@"static=yes"];
break;
case 4:
status = [NSString stringWithString:@"Installing..."];
target = [NSString stringWithString:@"Install"];
[args addObject:@"install"];
break;
}
[buildStatusField setStringValue:status];
[targetField setStringValue:target];
[NOTIFICATION_CENTER addObserver:self
selector:@selector(logStdOut:)
name:NSFileHandleDataAvailableNotification
object:readHandle];
return ret;
[NOTIFICATION_CENTER addObserver:self
selector:@selector(logErrOut:)
name:NSFileHandleDataAvailableNotification
object:errorReadHandle];
[NOTIFICATION_CENTER addObserver: self
selector: @selector(buildDidTerminate:)
name: NSTaskDidTerminateNotification
object: makeTask];
[makeTask setArguments:args];
[makeTask setCurrentDirectoryPath:[currentProject projectPath]];
[makeTask setLaunchPath:makePath];
[makeTask setStandardOutput:logPipe];
[makeTask setStandardError:errorPipe];
[logOutput setString:@""];
[readHandle waitForDataInBackgroundAndNotify];
[errorOutput setString:@""];
[errorReadHandle waitForDataInBackgroundAndNotify];
[makeTask launch];
[makeTask waitUntilExit];
[buildStatusField setStringValue:@"Waiting..."];
[targetField setStringValue:@""];
[NOTIFICATION_CENTER removeObserver:self
name:NSFileHandleDataAvailableNotification
object:readHandle];
[NOTIFICATION_CENTER removeObserver:self
name:NSFileHandleDataAvailableNotification
object:errorReadHandle];
[NOTIFICATION_CENTER removeObserver:self
name:NSTaskDidTerminateNotification
object:makeTask];
[readHandle release];
[errorReadHandle release];
[makeTask autorelease];
}
- (void)logStdOut:(NSNotification *)aNotif
{
NSData *data;
if ((data = [readHandle availableData])) {
[self logData:data error:NO];
}
[readHandle waitForDataInBackgroundAndNotifyForModes:nil];
}
- (void)logErrOut:(NSNotification *)aNotif
{
NSData *data;
if ((data = [errorReadHandle availableData])) {
[self logData:data error:YES];
}
[errorReadHandle waitForDataInBackgroundAndNotifyForModes:nil];
}
- (void)buildDidTerminate:(NSNotification *)aNotif
{
int status = [[aNotif object] terminationStatus];
if (status == 0) {
[self logString:@"*** Build Succeeded!\n" error:NO newLine:YES];
}
else {
[self logString:@"*** Build Failed!" error:YES newLine:YES];
[[logOutput window] orderFront:self];
}
}
- (void)projectDidChange:(NSNotification *)aNotif
{
PCProject *project = [aNotif object];
if (project) {
currentProject = project;
[buildWindow setTitle:[project projectName]];
}
else {
currentProject = nil;
[buildWindow orderOut:self];
}
}
@end
@implementation PCProjectBuilder (BuildLogging)
- (void)logString:(NSString *)string error:(BOOL)yn
{
[self logString:string error:yn newLine:YES];
}
- (void)logString:(NSString *)str error:(BOOL)yn newLine:(BOOL)newLine
{
NSTextView *out = (yn)?errorOutput:logOutput;
[out replaceCharactersInRange:NSMakeRange([[out string] length],0) withString:str];
if (newLine) {
[out replaceCharactersInRange:NSMakeRange([[out string] length], 0) withString:@"\n"];
}
else {
[out replaceCharactersInRange:NSMakeRange([[out string] length], 0) withString:@" "];
}
[out scrollRangeToVisible:NSMakeRange([[out string] length], 0)];
}
- (void)logData:(NSData *)data error:(BOOL)yn
{
NSString *s = [[NSString alloc] initWithData:data
encoding:[NSString defaultCStringEncoding]];
[self logString:s error:yn newLine:YES];
[s autorelease];
}
@end

View file

@ -131,8 +131,7 @@
// ===========================================================================
- (BOOL)openFile:(NSString *)path;
- (BOOL)addFile:(NSString *)path;
- (BOOL)newFile:(NSString *)path;
- (BOOL)saveFile;
- (BOOL)saveFileAs:(NSString *)path;
- (BOOL)revertFile;
@ -167,3 +166,7 @@
- (BOOL)projectManager:(id)sender shouldOpenProject:(PCProject *)aProject;
@end
extern NSString *ActiveProjectDidChangeNotification;

View file

@ -31,6 +31,8 @@
#import <AppKit/IMLoading.h>
#endif
NSString *ActiveProjectDidChangeNotification = @"ActiveProjectDidChange";
@interface PCProjectManager (CreateUI)
- (void)_initUI;
@ -42,8 +44,7 @@
- (void)_initUI
{
NSView *_c_view;
unsigned int style = NSTitledWindowMask | NSClosableWindowMask |
NSResizableWindowMask;
unsigned int style = NSTitledWindowMask | NSClosableWindowMask;
NSRect _w_frame;
NSBox *line;
@ -59,9 +60,12 @@
defer:NO];
[inspector setMinSize:NSMakeSize(280,384)];
[inspector setTitle:@"Inspector"];
[inspector setReleasedWhenClosed:NO];
[inspector setFrameAutosaveName:@"Inspector"];
_c_view = [inspector contentView];
inspectorPopup = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(80,352,128,20)];
_w_frame = NSMakeRect(80,352,128,20);
inspectorPopup = [[NSPopUpButton alloc] initWithFrame:_w_frame];
[inspectorPopup addItemWithTitle:@"None"];
[inspectorPopup setTarget:self];
[inspectorPopup setAction:@selector(inspectorPopupDidChange:)];
@ -69,12 +73,12 @@
line = [[[NSBox alloc] init] autorelease];
[line setTitlePosition:NSNoTitle];
[line setFrameFromContentFrame:NSMakeRect(0,336,280,2)];
[line setFrame:NSMakeRect(0,336,280,2)];
[_c_view addSubview:line];
inspectorView = [[NSBox alloc] init];
[inspectorView setTitlePosition:NSNoTitle];
[inspectorView setFrameFromContentFrame:NSMakeRect(2,2,276,330)];
[inspectorView setFrame:NSMakeRect(-2,-2,284,334)];
[inspectorView setBorderType:NSNoBorder];
[_c_view addSubview:inspectorView];
@ -155,18 +159,20 @@
- (void)setActiveProject:(PCProject *)aProject
{
if (aProject != activeProject) {
activeProject = aProject;
if (aProject != activeProject) {
activeProject = aProject;
//~ Is this needed?
if (activeProject) {
[[activeProject projectWindow] makeKeyAndOrderFront:self];
}
if ([inspector isVisible]) {
[self inspectorPopupDidChange:inspectorPopup];
}
[[NSNotificationCenter defaultCenter] postNotificationName:ActiveProjectDidChangeNotification object:activeProject];
//~ Is this needed?
if (activeProject) {
[[activeProject projectWindow] makeKeyAndOrderFront:self];
}
if ([inspector isVisible]) {
[self inspectorPopupDidChange:inspectorPopup];
}
}
}
- (void)saveAllProjects
@ -198,6 +204,8 @@
concretBuilder = [NSClassFromString([builders objectForKey:builderKey]) sharedCreator];
if ((project = [concretBuilder openProjectAt:aPath])) {
[[project projectWindow] center];
return project;
}
}
@ -250,6 +258,8 @@
return NO;
}
[[project projectWindow] center];
[project setProjectBuilder:self];
[loadedProjects setObject:project forKey:aPath];
[self setActiveProject:project];
@ -271,38 +281,31 @@
- (void)inspectorPopupDidChange:(id)sender
{
NSView *view = nil;
if (![self activeProject]) {
return;
}
switch([sender indexOfSelectedItem]) {
case 0:
view = [[[self activeProject] updatedAttributeView] retain];
break;
case 1:
view = [[[self activeProject] updatedProjectView] retain];
break;
case 2:
view = [[[self activeProject] updatedFilesView] retain];
break;
}
[(NSBox *)inspectorView setContentView:view];
[inspectorView display];
NSView *view = nil;
if (![self activeProject]) {
return;
}
switch([sender indexOfSelectedItem]) {
case 0:
view = [[[self activeProject] updatedAttributeView] retain];
break;
case 1:
view = [[[self activeProject] updatedProjectView] retain];
break;
case 2:
view = [[[self activeProject] updatedFilesView] retain];
break;
}
[(NSBox *)inspectorView setContentView:view];
[inspectorView display];
}
- (void)showInspectorForProject:(PCProject *)aProject
{
if (!inspectorPopup) {
#if defined(GNUSTEP)
[self _initUI];
#else
if(![NSBundle loadNibNamed:@"Inspector.nib" owner:self]) {
[[NSException exceptionWithName:NIB_NOT_FOUND_EXCEPTION reason:@"Could not load Inspector.gmodel" userInfo:nil] raise];
return nil;
}
#endif
[inspectorPopup removeAllItems];
[inspectorPopup addItemWithTitle:@"Build Attributes"];
@ -311,6 +314,10 @@
}
[self inspectorPopupDidChange:inspectorPopup];
if (![inspector isVisible]) {
[inspector setFrameUsingName:@"Inspector"];
}
[inspector makeKeyAndOrderFront:self];
}
@ -340,23 +347,23 @@
- (void)closeProject:(PCProject *)aProject
{
PCProject *currentProject;
NSString *key = [[aProject projectPath] stringByAppendingPathComponent:@"PC.project"];
currentProject = [[loadedProjects objectForKey:key] retain];
PCProject *currentProject;
NSString *key = [[aProject projectPath] stringByAppendingPathComponent:@"PC.project"];
currentProject = [[loadedProjects objectForKey:key] retain];
// Remove it from the loaded projects!
[loadedProjects removeObjectForKey:key];
[self setActiveProject:[[loadedProjects allValues] lastObject]];
// Remove it from the loaded projects!
[loadedProjects removeObjectForKey:key];
[self setActiveProject:[[loadedProjects allValues] lastObject]];
[currentProject autorelease];
//~ Should I activate another project here?!
[currentProject autorelease];
//~ Should I activate another project here?!
}
- (void)closeProject
{
[[[self activeProject] projectWindow] performClose:self];
[[[self activeProject] projectWindow] performClose:self];
}
// ===========================================================================
@ -365,20 +372,18 @@
- (BOOL)openFile:(NSString *)path
{
id<ProjectEditor> editor = [[[delegate prefController] preferencesDict] objectForKey:Editor];
BOOL isDir;
NSFileManager *fm = [NSFileManager defaultManager];
NSDictionary *ui =[NSDictionary dictionaryWithObjectsAndKeys:
path,@"FilePathKey",
nil];
if (!editor) {
}
if ([fm fileExistsAtPath:path isDirectory:&isDir] && !isDir) {
[[NSNotificationCenter defaultCenter] postNotificationName:FileShouldOpenNotification object:self userInfo:ui];
return YES;
}
[editor openFile:path];
}
- (BOOL)addFile:(NSString *)path
{
}
- (BOOL)newFile:(NSString *)path
{
return NO;
}
- (BOOL)saveFile
@ -460,3 +465,5 @@
@end

View file

@ -42,7 +42,7 @@ extern NSString *PCProjectDidUpdateNotification;
extern NSString *PCFileAddedToProjectNotification;
extern NSString *PCFileRemovedFromProjectNotification;
extern NSString *PCFileWillOpenNotification;
extern NSString *PCFileDidOpenNotification;
extern NSString *PCFileDidOpenNotification;
extern NSString *PCFileWillCloseNotification;
extern NSString *PCFileDidCloseNotification;
@ -64,11 +64,28 @@ extern NSString *PCProjectBuildDidStopNotification;
@interface PCServer : NSObject <Server>
{
NSMutableArray *clients;
NSMutableDictionary *openDocuments;
}
//----------------------------------------------------------------------------
// Init and free
//----------------------------------------------------------------------------
- (id)init;
- (void)dealloc;
//----------------------------------------------------------------------------
// Miscellaneous
//----------------------------------------------------------------------------
- (void)fileShouldBeOpened:(NSNotification *)aNotif;
- (void)openFileInExternalEditor:(NSString *)file;
- (void)openFileInInternalEditor:(NSString *)file;
- (NSWindow *)editorForFile:(NSString *)aFile;
- (void)windowDidClose:(NSNotification *)aNotif;
//----------------------------------------------------------------------------
// Server
//----------------------------------------------------------------------------
@ -90,7 +107,7 @@ extern NSString *PCProjectBuildDidStopNotification;
- (NSArray*)touchedFiles;
// Both methods return full paths!
- (BOOL)querTouchedFiles;
- (BOOL)queryTouchedFiles;
// Prompts user to save all files and projects with dirtied buffers.
- (BOOL)addFileAt:(NSString*)filePath toProject:(PCProject *)projectPath;

View file

@ -26,23 +26,143 @@
#import "PCServer.h"
#import "ProjectCenter.h"
#import "PCBrowserController.h"
@implementation PCServer
//----------------------------------------------------------------------------
// Init and free
//----------------------------------------------------------------------------
- (id)init
{
if ((self = [super init])) {
clients = [[NSMutableArray alloc] init];
}
return self;
if ((self = [super init])) {
clients = [[NSMutableArray alloc] init];
openDocuments = [[NSMutableDictionary alloc] init];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fileShouldBeOpened:) name:FileShouldOpenNotification object:nil];
}
return self;
}
- (void)dealloc
{
[clients release];
[super dealloc];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[openDocuments release];
[clients release];
[super dealloc];
}
//----------------------------------------------------------------------------
// Miscellaneous
//----------------------------------------------------------------------------
- (void)fileShouldBeOpened:(NSNotification *)aNotif
{
NSString *file = [[aNotif userInfo] objectForKey:@"FilePathKey"];
if ([[[NSUserDefaults standardUserDefaults] objectForKey:ExternalEditor] isEqualToString:@"YES"]) {
[self openFileInExternalEditor:file];
}
else {
[self openFileInInternalEditor:file];
}
}
- (void)openFileInExternalEditor:(NSString *)file
{
NSTask *editorTask;
NSMutableArray *args = [NSMutableArray array];
NSUserDefaults *udef = [NSUserDefaults standardUserDefaults];
NSString *editor = [udef objectForKey:Editor];
editorTask = [[[NSTask alloc] init] autorelease];
[editorTask setLaunchPath:editor];
[args addObject:file];
[editorTask setArguments:args];
[editorTask launch];
}
- (void)openFileInInternalEditor:(NSString *)file
{
if ([openDocuments objectForKey:file]) {
[[openDocuments objectForKey:file] makeKeyAndOrderFront:self];
}
else {
NSWindow *editorWindow = [self editorForFile:file];
[editorWindow setDelegate:self];
[editorWindow center];
[editorWindow makeKeyAndOrderFront:self];
[openDocuments setObject:editorWindow forKey:file];
}
}
- (NSWindow *)editorForFile:(NSString *)aFile
{
unsigned int style = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask;
NSRect rect = NSMakeRect(100,100,512,320);
NSWindow *window = [[NSWindow alloc] initWithContentRect:rect
styleMask:style
backing:NSBackingStoreBuffered
defer:YES];
PCEditorView *textView;
NSScrollView *scrollView;
NSString *text = [NSString stringWithContentsOfFile:aFile];
[window setMinSize:NSMakeSize(512,320)];
[window setTitle:aFile];
textView = [[PCEditorView alloc] initWithFrame:NSMakeRect(0,0,498,306)];
[textView setMaxSize:NSMakeSize(1e7, 1e7)];
[textView setRichText:NO];
[textView setEditable:NO];
[textView setSelectable:YES];
[textView setVerticallyResizable:YES];
[textView setHorizontallyResizable:NO];
[textView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
[textView setBackgroundColor:[NSColor whiteColor]];
[[textView textContainer] setWidthTracksTextView:YES];
[textView autorelease];
scrollView = [[NSScrollView alloc] initWithFrame:NSMakeRect (-1,-1,514,322)];
[scrollView setDocumentView:textView];
[textView setMinSize:NSMakeSize(0.0,[scrollView contentSize].height)];
[[textView textContainer] setContainerSize:NSMakeSize([scrollView contentSize].width,1e7)];
[scrollView setHasHorizontalScroller: YES];
[scrollView setHasVerticalScroller: YES];
[scrollView setBorderType: NSBezelBorder];
[scrollView setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)];
[scrollView autorelease];
[[window contentView] addSubview:scrollView];
/*
* Will be replaced when a real editor is available...
*/
[textView setText:text];
return [window autorelease];
}
- (void)windowDidClose:(NSNotification *)aNotif
{
NSWindow *window = [aNotif object];
[openDocuments removeObjectForKey:[window title]];
}
//----------------------------------------------------------------------------
// Server
//----------------------------------------------------------------------------
- (BOOL)registerProjectSubmenu:(NSMenu *)menu
{
}
@ -91,7 +211,7 @@
{
}
- (BOOL)querTouchedFiles
- (BOOL)queryTouchedFiles
{
}

View file

@ -42,6 +42,7 @@
#define BundlePaths @"BundlePaths"
#define SuccessSound @"SuccessSound"
#define FailureSound @"FailureSound"
#define ExternalEditor @"ExternalEditor"
#define PCAppDidInitNotification @"PCAppDidInit"
#define PCAppWillTerminateNotification @"PCAppWillTerminate"
@ -69,3 +70,8 @@
#import "ProjectBuilder.h"
#import "FileCreator.h"
#import "PCProjectBuilder.h"
#import "PCEditorView.h"

View file

@ -50,7 +50,7 @@
- (NSArray*)touchedFiles;
// Returns array of paths of files that are "unsaved" or nil if none.
- (BOOL)querTouchedFiles;
- (BOOL)queryTouchedFiles;
// Prompts user to save all files and projects with dirtied buffers.
- (BOOL)addFileAt:(NSString*)filePath toProject:(PCProject *)projectPath;

22
PCLibProj/ChangeLog Normal file
View file

@ -0,0 +1,22 @@
2000-09-17 14:13 robert
* PCLibMakefileFactory.m: makefile improvements
2000-08-27 21:13 robert
* PCLibMakefileFactory.h, PCLibProj.h, GNUmakefile,
GNUmakefile.postamble, GNUmakefile.preamble, Info.table,
PCLibProj.m, Makefile, Makefile.postamble, Makefile.preamble,
PB.project, PC.proj, PCLibMakefileFactory.m, PCLibProject.h,
PCLibProject.m, h.template, m.template, LibProject.gmodel, Version:
Initial revision
2000-08-27 21:13 robert
* PCLibMakefileFactory.h, PCLibProj.h, GNUmakefile,
GNUmakefile.postamble, GNUmakefile.preamble, Info.table,
PCLibProj.m, Makefile, Makefile.postamble, Makefile.preamble,
PB.project, PC.proj, PCLibMakefileFactory.m, PCLibProject.h,
PCLibProject.m, h.template, m.template, LibProject.gmodel, Version:
Initial import

View file

@ -60,7 +60,7 @@ static PCLibMakefileFactory *_factory = nil;
// The 'real' thing
[string appendString:@"include $(GNUSTEP_MAKEFILES)/common.make\n"];
[string appendString:@"include English.lproj/Version\n"];
[string appendString:@"include Version\n"];
[string appendString:@"#\n\n"];
[string appendString:@"# Subprojects\n"];
@ -83,13 +83,18 @@ static PCLibMakefileFactory *_factory = nil;
[string appendString:[NSString stringWithFormat:@"LIBRARY_NAME=%@\n",libName]];
// Install path
[string appendString:[NSString stringWithFormat:@"%@_INSTALL_PREFIX=$(GNUSTEP_SYSTEM_ROOT)\n",[prName uppercaseString]]];
[string appendString:[NSString stringWithFormat:@"%@_HEADER_FILES_DIR=.\n",libName]];
[string appendString:[NSString stringWithFormat:@"%@_HEADER_FILES_INSTALL_DIR=/%@\n",libName,prName]];
[string appendString:[NSString stringWithFormat:@"%@_INSTALLATION_DIR=$(GNUSTEP_LOCAL_ROOT)\n",[prName uppercaseString]]];
[string appendString:[NSString stringWithFormat:@"%@_INSTALL_PREFIX=$(GNUSTEP_LOCAL_ROOT)\n",[prName uppercaseString]]];
[string appendString:@"ADDITIONAL_INCLUDE_DIRS = -I..\n"];
[string appendString:@"srcdir = .\n"];
[string appendString:@"#\n\n"];
[string appendString:@"# Additional libraries\n"];
[string appendString:@"#\n\n"];
[string appendString:[NSString stringWithFormat:@"%@_ADDITIONAL_TOOL_LIBS += ",prName]];
[string appendString:[NSString stringWithFormat:@"%@_LIBRARIES_DEPEND_UPON += ",libName]];
if ([[prDict objectForKey:PCLibraries] count]) {
enumerator = [[prDict objectForKey:PCLibraries] objectEnumerator];
@ -104,7 +109,7 @@ static PCLibMakefileFactory *_factory = nil;
[string appendString:@"# Header files\n"];
[string appendString:@"#\n\n"];
[string appendString:[NSString stringWithFormat:@"%@_HEADERS= ",libName]];
[string appendString:[NSString stringWithFormat:@"%@_HEADER_FILES= ",libName]];
enumerator = [[prDict objectForKey:PCHeaders] objectEnumerator];
while (tmp = [enumerator nextObject]) {
@ -135,7 +140,7 @@ static PCLibMakefileFactory *_factory = nil;
[string appendString:@"\n\n"];
[string appendString:[NSString stringWithFormat:@"%@_HEADER_FILES_INSTALL_DIR=/%@\n",libName,prName]];
[string appendFormat:@"HEADERS_INSTALL = $(%@_HEADER_FILES)\n\n",libName];
[string appendString:@"-include GNUmakefile.preamble\n"];
[string appendString:@"-include GNUmakefile.local\n"];

View file

@ -103,11 +103,14 @@ static PCLibProj *_creator = nil;
[fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"main.m"] handler:nil];
// Resources
/*
_resourcePath = [path stringByAppendingPathComponent:@"English.lproj"];
[fm createDirectoryAtPath:_resourcePath attributes:nil];
*/
[fm createDirectoryAtPath:[path stringByAppendingPathComponent:@"Documentation"] attributes:nil];
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"Version" ofType:@""];
[fm copyPath:_file toPath:[_resourcePath stringByAppendingPathComponent:@"Version"] handler:nil];
[fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"Version"] handler:nil];
// The path cannot be in the PC.project file!
[project setProjectPath:path];

View file

@ -43,31 +43,7 @@
- (void)_initUI
{
// Always call super!!!
[super _initUI];
projectAttributeInspectorView = [[NSBox alloc] init];
[projectAttributeInspectorView setTitlePosition:NSAtTop];
[projectAttributeInspectorView setBorderType:NSGrooveBorder];
// [projectAttributeInspectorView addSubview:projectTypePopup];
[projectAttributeInspectorView sizeToFit];
[projectAttributeInspectorView setAutoresizingMask:NSViewWidthSizable];
projectProjectInspectorView = [[NSBox alloc] init];
[projectProjectInspectorView setTitlePosition:NSAtTop];
[projectProjectInspectorView setBorderType:NSGrooveBorder];
// [projectProjectInspectorView addSubview:projectTypePopup];
[projectProjectInspectorView sizeToFit];
[projectProjectInspectorView setAutoresizingMask:NSViewWidthSizable];
projectFileInspectorView = [[NSBox alloc] init];
[projectFileInspectorView setTitlePosition:NSAtTop];
[projectFileInspectorView setBorderType:NSGrooveBorder];
// [projectFileInspectorView addSubview:projectTypePopup];
[projectFileInspectorView sizeToFit];
[projectFileInspectorView setAutoresizingMask:NSViewWidthSizable];
_needsAdditionalReleasing = YES;
}
@end
@ -80,34 +56,27 @@
- (id)init
{
if ((self = [super init])) {
rootCategories = [[NSDictionary dictionaryWithObjectsAndKeys:PCClasses,@"Classes",PCHeaders,@"Headers",PCOtherSources,@"Other Sources",PCOtherResources,@"Other Resources", PCSubprojects, @"Subprojects", PCLibraries, @"Libraries",PCDocuFiles,@"Documentation",nil] retain];
_needsAdditionalReleasing = NO;
#if defined(GNUSTEP)
[self _initUI];
#else
if(![NSBundle loadNibNamed:@"LibProject.nib" owner:self]) {
[[NSException exceptionWithName:NIB_NOT_FOUND_EXCEPTION reason:@"Could not load LibProject.gmodel" userInfo:nil] raise];
return nil;
}
#endif
}
return self;
if ((self = [super init])) {
rootCategories = [[NSDictionary dictionaryWithObjectsAndKeys:
PCSubprojects, @"Subprojects",
PCLibraries, @"Libraries",
PCDocuFiles,@"Documentation",
PCOtherResources,@"Other Resources",
PCOtherSources,@"Other Sources",
PCHeaders,@"Headers",
PCClasses,@"Classes",
nil] retain];
[self _initUI];
}
return self;
}
- (void)dealloc
{
[rootCategories release];
if (_needsAdditionalReleasing) {
[projectAttributeInspectorView release];
[projectProjectInspectorView release];
[projectFileInspectorView release];
}
[super dealloc];
[rootCategories release];
[super dealloc];
}
//----------------------------------------------------------------------------
@ -117,7 +86,7 @@
- (BOOL)writeMakefile
{
NSFileManager *fm = [NSFileManager defaultManager];
NSString *makefile = [projectPath stringByAppendingPathComponent:@"GNUmakefile"];
NSString *makefile = [[self projectPath] stringByAppendingPathComponent:@"GNUmakefile"];
NSData *content;
if (![super writeMakefile]) {

View file

@ -52,7 +52,7 @@ ADDITIONAL_CFLAGS +=
ADDITIONAL_INCLUDE_DIRS +=
# Additional LDFLAGS to pass to the linker
ADDITIONAL_LDFLAGS += -lPC
ADDITIONAL_LDFLAGS += -lProjectCenter
# Additional library directories the linker should search
ADDITIONAL_LIB_DIRS +=

View file

@ -84,7 +84,7 @@ static PCToolMakefileFactory *_factory = nil;
[string appendString:@"# Additional libraries\n"];
[string appendString:@"#\n\n"];
[string appendString:[NSString stringWithFormat:@"%@_ADDITIONAL_TOOL_LIBS += ",prName]];
[string appendString:[NSString stringWithFormat:@"%@_TOOL_LIBS += ",prName]];
if ([[prDict objectForKey:PCLibraries] count]) {
enumerator = [[prDict objectForKey:PCLibraries] objectEnumerator];

View file

@ -43,31 +43,7 @@
- (void)_initUI
{
// Always call super!!!
[super _initUI];
projectAttributeInspectorView = [[NSBox alloc] init];
[projectAttributeInspectorView setTitlePosition:NSAtTop];
[projectAttributeInspectorView setBorderType:NSGrooveBorder];
// [projectAttributeInspectorView addSubview:projectTypePopup];
[projectAttributeInspectorView sizeToFit];
[projectAttributeInspectorView setAutoresizingMask:NSViewWidthSizable];
projectProjectInspectorView = [[NSBox alloc] init];
[projectProjectInspectorView setTitlePosition:NSAtTop];
[projectProjectInspectorView setBorderType:NSGrooveBorder];
// [projectProjectInspectorView addSubview:projectTypePopup];
[projectProjectInspectorView sizeToFit];
[projectProjectInspectorView setAutoresizingMask:NSViewWidthSizable];
projectFileInspectorView = [[NSBox alloc] init];
[projectFileInspectorView setTitlePosition:NSAtTop];
[projectFileInspectorView setBorderType:NSGrooveBorder];
// [projectFileInspectorView addSubview:projectTypePopup];
[projectFileInspectorView sizeToFit];
[projectFileInspectorView setAutoresizingMask:NSViewWidthSizable];
_needsAdditionalReleasing = YES;
}
@end
@ -80,41 +56,28 @@
- (id)init
{
if ((self = [super init])) {
rootCategories = [[NSDictionary dictionaryWithObjectsAndKeys:
if ((self = [super init])) {
rootCategories = [[NSDictionary dictionaryWithObjectsAndKeys:
PCImages,@"Images",
PCOtherResources,@"Other Resources",
PCSubprojects,@"Subprojects",
PCLibraries,@"Libraries",
PCDocuFiles,@"Documentation",
PCOtherSources,@"Other Sources",
PCHeaders,@"Headers",
PCClasses,@"Classes",
nil] retain];
#if defined(GNUSTEP)
[self _initUI];
#else
if(![NSBundle loadNibNamed:@"ToolProject.nib" owner:self]) {
[[NSException exceptionWithName:NIB_NOT_FOUND_EXCEPTION reason:@"Could not load ToolProject.gmodel" userInfo:nil] raise];
return nil;
}
#endif
}
return self;
PCOtherResources,@"Other Resources",
PCSubprojects,@"Subprojects",
PCLibraries,@"Libraries",
PCDocuFiles,@"Documentation",
PCOtherSources,@"Other Sources",
PCHeaders,@"Headers",
PCClasses,@"Classes",
nil] retain];
[self _initUI];
}
return self;
}
- (void)dealloc
{
[rootCategories release];
if (_needsAdditionalReleasing) {
[projectAttributeInspectorView release];
[projectProjectInspectorView release];
[projectFileInspectorView release];
}
[super dealloc];
[rootCategories release];
[super dealloc];
}
//----------------------------------------------------------------------------

85
ProjectCenter/ChangeLog Normal file
View file

@ -0,0 +1,85 @@
2000-09-20 17:46 robert
* ProjectCenter_main.m: Added the font panel stuff
2000-09-20 12:35 robert
* PCPrefController.m: some more work on the preferences
2000-09-17 16:40 robert
* PCPrefController.h, PCPrefController.m: Basic preferences
handling
2000-09-17 14:12 robert
* GNUmakefile, Info-project.plist, PCAppController+MenuHandling.h,
PCAppController+MenuHandling.m, PCAppController.m,
PCMenuController.m, ProjectCenter_main.m, ProjectCentre_build.tiff,
ProjectCentre_find.tiff, ProjectCentre_prefs.tiff,
ProjectCentre_settings.tiff, ProjectCentre_uml.tiff: Updated some
images, fixed some bugs and enhanced the featurelist...
2000-09-14 11:04 robert
* PCAppController.m: another minor flaw
2000-09-14 10:28 robert
* PCAppController.m: fixed some bugs introduced by removing the
gmodel
2000-09-13 12:45 robert
* GNUmakefile, PCAppController+MenuHandling.h,
PCAppController+MenuHandling.m, PCAppController.h,
PCAppController.m, PCMenuController.h, PCMenuController.m,
ProjectCenter_main.m, English.lproj/ProjectCenter.gmodel: removed
the gmodels completely from ProjectCenter.app
2000-09-03 21:59 robert
* GNUmakefile.preamble, PC.project, PCAppController.m: minor stuff
2000-09-03 21:15 robert
* PCAppController.m: New DO code
2000-08-27 21:12 robert
* Makefile.preamble, PB.project, h.template, m.template, Makefile,
ProjectCenter_main.m, Makefile.postamble, PCAppController.h,
PCAppController.m, PCPrefController.h, PCPrefController.m,
PCFindController.h, PCFindController.m, PCInfoController.h,
PCInfoController.m, PCLogController.h, PCLogController.m,
PCMenuController.h, ProjectCenter.tiff, PCMenuController.m,
GNUmakefile, GNUmakefile.postamble, GNUmakefile.preamble,
PC.project, FileIcon_.m.tiff, ProjectCentre_documentation.tiff,
ProjectCentre_cvs.tiff, ProjectCentre_prefs.tiff,
ProjectCenter.app.tiff, FileIcon_rtf.tiff,
ProjectCentre_files.tiff, FileIcon_.c.tiff,
ProjectCentre_clean.tiff, ProjectCentre_find.tiff,
FileIcon_.h.tiff, Info-project.plist, ProjectCentre_add.tiff,
ProjectCentre_build.tiff, ProjectCentre_run.tiff,
ProjectCentre_uml.tiff, English.lproj/ProjectCenter.gmodel: Initial
revision
2000-08-27 21:12 robert
* Makefile.preamble, PB.project, h.template, m.template, Makefile,
ProjectCenter_main.m, Makefile.postamble, PCAppController.h,
PCAppController.m, PCPrefController.h, PCPrefController.m,
PCFindController.h, PCFindController.m, PCInfoController.h,
PCInfoController.m, PCLogController.h, PCLogController.m,
PCMenuController.h, ProjectCenter.tiff, PCMenuController.m,
GNUmakefile, GNUmakefile.postamble, GNUmakefile.preamble,
PC.project, FileIcon_.m.tiff, ProjectCentre_documentation.tiff,
ProjectCentre_cvs.tiff, ProjectCentre_prefs.tiff,
ProjectCenter.app.tiff, FileIcon_rtf.tiff,
ProjectCentre_files.tiff, FileIcon_.c.tiff,
ProjectCentre_clean.tiff, ProjectCentre_find.tiff,
FileIcon_.h.tiff, Info-project.plist, ProjectCentre_add.tiff,
ProjectCentre_build.tiff, ProjectCentre_run.tiff,
ProjectCentre_uml.tiff, English.lproj/ProjectCenter.gmodel: Initial
import

File diff suppressed because it is too large Load diff

View file

@ -19,12 +19,10 @@ include $(GNUSTEP_MAKEFILES)/common.make
APP_NAME=ProjectCenter
ProjectCenter_LDFLAGS = -lPC
ProjectCenter_MAIN_MODEL_FILE = ProjectCenter.gmodel
ProjectCenter_LDFLAGS = -lProjectCenter
ProjectCenter_APPLICATION_ICON = ProjectCenter.tiff
ProjectCenter_RESOURCE_FILES= \
English.lproj/ProjectCenter.gmodel \
ProjectCenter.tiff \
ProjectCenter.app.tiff \
ProjectCentre_add.tiff \
@ -37,10 +35,16 @@ ProjectCenter_RESOURCE_FILES= \
ProjectCentre_prefs.tiff \
ProjectCentre_run.tiff \
ProjectCentre_uml.tiff \
ProjectCentre_settings.tiff \
FileIcon_.c.tiff \
FileIcon_.h.tiff \
FileIcon_.m.tiff \
FileIcon_rtf.tiff \
ProjectCenter_make.tiff \
ProjectCenter_clean.tiff \
ProjectCenter_debug.tiff \
ProjectCenter_profile.tiff \
ProjectCenter_install.tiff \
Info-project.plist
# Header files
@ -48,6 +52,7 @@ ProjectCenter_RESOURCE_FILES= \
ProjectCenter_HEADERS= \
PCAppController.h \
PCAppController+MenuHandling.h \
PCFindController.h \
PCInfoController.h \
PCLogController.h \
@ -60,6 +65,7 @@ ProjectCenter_HEADERS= \
ProjectCenter_OBJC_FILES= \
PCAppController.m \
PCAppController+MenuHandling.m \
PCFindController.m \
PCInfoController.m \
PCLogController.m \

View file

@ -52,7 +52,7 @@ ADDITIONAL_CFLAGS +=
ADDITIONAL_INCLUDE_DIRS +=
# Additional LDFLAGS to pass to the linker
ADDITIONAL_LDFLAGS += -lPC
ADDITIONAL_LDFLAGS += -lProjectCenter
# Additional library directories the linker should search
ADDITIONAL_LIB_DIRS +=

View file

@ -1,10 +1,30 @@
{
NSIcon = "ProjectCenter.tiff";
NSRole = "Editor";
NSTypes = (
{
NSUnixExtensions = ( "project" );
NSIcon = "ProjectCenter.tiff";
},
{
NSUnixExtensions = ( "m" );
NSIcon = "FileIcon_.m.tiff";
},
{
NSUnixExtensions = ( "h" );
NSIcon = "FileIcon_.h.tiff";
},
{
NSUnixExtensions = ( "c" );
NSIcon = "FileIcon_.c.tiff";
}
);
NOTE = "Automatically generated, do not edit!";
ApplicationName = "ProjectCenter";
ApplicationDescription = "GNUstep IDE";
ApplicationIcon = "ProjectCenter.tiff";
ApplicationRelease = "ProjectCenter 0.1";
FullVersionID = "0.1 pre pre pre pre epsilon";
ApplicationRelease = "ProjectCenter 0.2";
FullVersionID = "0.2";
Authors = ("Philippe C.D. Robert <phr@projectcenter.ch>");
URL = "http://www.projectcenter.ch";
Copyright = "Copyright (C) 2000 Philippe C.D. Robert";

View file

@ -1,67 +0,0 @@
#
# Generated by the NeXT Project Builder.
#
# NOTE: Do NOT change this file -- Project Builder maintains it.
#
# Put all of your customizations in files called Makefile.preamble
# and Makefile.postamble (both optional), and Makefile will include them.
#
NAME = ProjectCenter
PROJECTVERSION = 2.6
PROJECT_TYPE = Application
LANGUAGE = English
NEXTSTEP_APPICON = ProjectCenter.app.tiff
ICONSECTIONS = -sectcreate __ICON app ProjectCenter.app.tiff
LOCAL_RESOURCES = FileCreation.nib Info.nib Inspector.nib\
NEXTSTEP_ProjectCenter.nib Preferences.nib Project.nib\
TypePopup.nib
GLOBAL_RESOURCES = FileIcon_.c.tiff FileIcon_.h.tiff FileIcon_.m.tiff\
FileIcon_rtf.tiff ProjectCenter.app.tiff\
ProjectCenter.tiff ProjectCentre_add.tiff\
ProjectCentre_build.tiff ProjectCentre_clean.tiff\
ProjectCentre_cvs.tiff\
ProjectCentre_documentation.tiff\
ProjectCentre_files.tiff ProjectCentre_find.tiff\
ProjectCentre_prefs.tiff ProjectCentre_run.tiff\
ProjectCentre_uml.tiff
CLASSES = PCAppController.m PCPrefController.m PCInfoController.m\
PCFindController.m PCLogController.m PCMenuController.m
HFILES = PCAppController.h PCPrefController.h PCInfoController.h\
PCFindController.h PCLogController.h PCMenuController.h
MFILES = ProjectCenter_main.m
OTHERSRCS = Makefile.preamble Makefile Makefile.postamble m.template\
h.template
MAKEFILEDIR = $(NEXT_ROOT)/NextDeveloper/Makefiles/pb_makefiles
CODE_GEN_STYLE = DYNAMIC
MAKEFILE = app.make
NEXTSTEP_INSTALLDIR = $(HOME)/Apps
WINDOWS_INSTALLDIR = /MyApps
LIBS = -lPCLib
DEBUG_LIBS = $(LIBS)
PROF_LIBS = $(LIBS)
HEADER_PATHS = -I/LocalDeveloper/Headers/PCLib
FRAMEWORKS = -framework AppKit -framework Foundation
include $(MAKEFILEDIR)/platform.make
-include Makefile.preamble
include $(MAKEFILEDIR)/$(MAKEFILE)
-include Makefile.postamble
-include Makefile.dependencies

View file

@ -1,122 +0,0 @@
###############################################################################
# NeXT Makefile.postamble
# Copyright 1996, NeXT Software, Inc.
#
# This Makefile is used for configuring the standard app makefiles associated
# with ProjectBuilder.
#
# Use this template to set attributes for a project, sub-project, bundle, or
# palette. Each node in the project's tree of sub-projects and bundles
# should have it's own Makefile.preamble and Makefile.postamble. Additional
# rules (e.g., after_install) that are defined by the developer should be
# defined in this file.
#
###############################################################################
#
# Here are the variables exported by the common "app" makefiles that can be
# used in any customizations you make to the template below:
#
# PRODUCT_ROOT - Name of the directory to which resources are copied.
# OFILE_DIR - Directory into which .o object files are generated.
# (Note that this name is calculated based on the target
# architectures specified in Project Builder).
# DERIVED_SRC_DIR - Directory used for all other derived files
# ALL_CFLAGS - All the flags passed to the cc(1) driver for compilations
#
# NAME - name of application, bundle, subproject, palette, etc.
# LANGUAGE - langage in which the project is written (default "English")
# LOCAL_RESOURCES - localized resources (e.g. nib's, images) of project
# GLOBAL_RESOURCES - non-localized resources of project
# PROJECTVERSION - version of ProjectBuilder project (NS3.X = 1.1, NS4.0 = 2.0)
# ICONSECTIONS - Specifies icon sections when linking executable
#
# CLASSES - Class implementation files in project.
# HFILES - Header files in project.
# MFILES - Other Objective-C source files in project.
# CFILES - Other C source files in project.
# PSWFILES - .psw files in the project
# PSWMFILES - .pswm files in the project
# SUBPROJECTS - Subprojects of this project
# BUNDLES - Bundle subprojects of this project
# OTHERSRCS - Other miscellaneous sources of this project
# OTHERLINKED - Source files not matching a standard source extention
#
# LIBS - Libraries to link with when making app target
# DEBUG_LIBS - Libraries to link with when making debug target
# PROF_LIBS - Libraries to link with when making profile target
# OTHERLINKEDOFILES - Other relocatable files to (always) link in.
#
# APP_MAKEFILE_DIR - Directory in which to find generic set of Makefiles
# MAKEFILEDIR - Directory in which to find $(MAKEFILE)
# MAKEFILE - Top level mechanism Makefile (e.g., app.make, bundle.make)
# INSTALLDIR - Directory app will be installed into by 'install' target
#
###############################################################################
# Change defaults assumed by the standard makefiles here. Edit the
# following default values as appropriate. (Note that if no Makefile.postamble
# exists, these values will have defaults set in common.make).
# Versioning of frameworks, libraries, bundles, and palettes:
#CURRENTLY_ACTIVE_VERSION = YES
# Set to "NO" to produce a compatibility binary
#DEPLOY_WITH_VERSION_NAME = A
# This should be incremented as your API changes.
#COMPATIBILITY_PROJECT_VERSION = 1
# This should be incremented as your API grows.
#CURRENT_PROJECT_VERSION = 1
# Defaults to using the "vers_string" hack.
# Some compiler flags can be easily overridden here, but onlytake effect at
# the top-level:
#OPTIMIZATION_CFLAG = -O
#DEBUG_SYMBOLS_CFLAG = -g
#WARNING_CFLAGS = -Wmost
#DEBUG_BUILD_CFLAGS = -DDEBUG
#PROFILE_BUILD_CFLAGS = -pg -DPROFILE
# This definition will suppress stripping of debug symbols when an executable
# is installed. By default it is YES.
# STRIP_ON_INSTALL = NO
# Flags passed to yacc
#YFLAGS = -d
# Library and Framework projects only:
# 1. If you want something other than the default .dylib name, override it here
#DYLIB_INSTALL_NAME = lib$(NAME).dylib
# 2. If you want to change the -install_name flag from the absolute path to the development area, change it here. One good choice is the installation directory. Another one might be none at all.
#DYLIB_INSTALL_DIR = $(INSTALLDIR)
# Ownership and permissions of files installed by 'install' target
#INSTALL_AS_USER = root
# User/group ownership
#INSTALL_AS_GROUP = wheel
# (probably want to set both of these)
#INSTALL_PERMISSIONS =
# If set, 'install' chmod's executable to this
# Options to strip for various project types. Note: -S strips debugging symbols
# (executables can be stripped down further with -x or, if they load no bundles, with no
# options at all).
#APP_STRIP_OPTS = -S
#TOOL_STRIP_OPTS = -S
#LIBRARY_STRIP_OPTS = -S
# for .a archives
#DYNAMIC_STRIP_OPTS = -S
# for bundles and shared libraries
#########################################################################
# Put rules to extend the behavior of the standard Makefiles here. "Official"
# user-defined rules are:
# * before_install
# * after_install
# * after_installhdrs
# You should avoid redefining things like "install" or "app", as they are
# owned by the top-level Makefile API and no context has been set up for where
# derived files should go.
#
# Note: on MS Windows, executables, have an extension, so rules and dependencies
# for generated tools should use $(EXECUTABLE_EXT) on the end.

View file

@ -1,130 +0,0 @@
###############################################################################
# NeXT Makefile.preamble
# Copyright 1996, NeXT Software, Inc.
#
# This Makefile is used for configuring the standard app makefiles associated
# with ProjectBuilder.
#
# Use this template to set attributes for a project. Each node in a project
# tree of sub-projects, tools, etc. should have its own Makefile.preamble and
# Makefile.postamble.
#
###############################################################################
## Configure the flags passed to $(CC) here. These flags will also be
## inherited by all nested sub-projects and bundles. Put your -I, -D, -U, and
## -L flags in ProjectBuilder's Build Options inspector if at all possible.
## To change the default flags that get passed to ${CC}
## (e.g. change -O to -O2), see Makefile.postamble.
# Flags passed to compiler (in addition to -g, -O, etc)
OTHER_CFLAGS =
# Flags passed to ld (in addition to -ObjC, etc.)
OTHER_LDFLAGS =
# Flags passed to libtool when building libraries
OTHER_LIBTOOL_FLAGS =
# For ordering named sections on NEXTSTEP (see ld(1))
SECTORDER_FLAGS =
# If you do not want any headers exported before compilations begin,
# uncomment the following line. This can be a big time saver.
#SKIP_EXPORTING_HEADERS = YES
# Stuff related to exporting headers from this project that isn't already
# handled by PB.
OTHER_PUBLIC_HEADERS =
OTHER_PROJECT_HEADERS =
OTHER_PRIVATE_HEADERS =
# Set these two macros if you want a precomp to be built as part of
# installation. The cc -precomp will be run in the public header directory
# on the specified public header files with the specified additional flags.
PUBLIC_PRECOMPILED_HEADERS =
PUBLIC_PRECOMPILED_HEADERS_CFLAGS =
# Set this for library projects if you want to publish header files. If your
# app or tool project exports headers Don't
# include $(DSTROOT); this is added for you automatically.
PUBLIC_HEADER_DIR =
PRIVATE_HEADER_DIR =
# If, in a subproject, you want to append to the parent's PUBLIC_HEADER_DIR#
# (say, to add a subdirectory like "/sys"), you can use:
PUBLIC_HEADER_DIR_SUFFIX =
PRIVATE_HEADER_DIR_SUFFIX =
# Set this for dynamic library projects on platforms where code which references
# a dynamic library must link against an import library (i.e., Windows NT)
# Don't include $(DSTROOT); this is added for you automatically.
IMPORT_LIBRARY_DIR =
# Additional (non-localized) resources for this project, which can be generated
OTHER_RESOURCES =
# Uncomment this to produce a static archive-style (.a) library
#LIBRARY_STYLE = STATIC
# Set this to YES if you don't want a final libtool call for a library/framework.
BUILD_OFILES_LIST_ONLY =
# Additional relocatables to be linked into this project
OTHER_OFILES =
# Additional libraries to link against
OTHER_LIBS =
# To include a version string, project source must exist in a directory named
# $(NAME).%d[.%d][.%d] and the following line must be uncommented.
# OTHER_GENERATED_OFILES = $(VERS_OFILE)
## Configure how things get built here. Additional dependencies, source files,
## derived files, and build order should be specified here.
# Other dependencies of this project
OTHER_PRODUCT_DEPENDS =
# Built *before* building subprojects/bundles
OTHER_INITIAL_TARGETS =
# Other source files maintained by .pre/postamble
OTHER_SOURCEFILES =
# Additional files to be removed by `make clean'
OTHER_GARBAGE =
# Targets to build before installation
OTHER_INSTALL_DEPENDS =
# More obscure flags you might want to set for pswrap, yacc, lex, etc.
PSWFLAGS =
YFLAGS =
LFLAGS =
## Delete this line if you want fast and loose cleans that will not remove
## things like precomps and user-defined OTHER_GARBAGE in subprojects.
CLEAN_ALL_SUBPROJECTS = YES
## Add more obscure source files here to cause them to be automatically
## processed by the appropriate tool. Note that these files should also be
## added to "Supporting Files" in ProjectBuilder. The desired .o files that
## result from these files should also be added to OTHER_OFILES above so they
## will be linked in.
# .msg files that should have msgwrap run on them
MSGFILES =
# .defs files that should have mig run on them
DEFSFILES =
# .mig files (no .defs files) that should have mig run on them
MIGFILES =
# .x files that should have rpcgen run on them
RPCFILES =
## Add additional Help directories here (add them to the project as "Other
## Resources" in Project Builder) so that they will be compressed into .store
## files and copied into the app wrapper. If the help directories themselves
## need to also be in the app wrapper, then a cp command will need to be added
## in an after_install target.
OTHER_HELP_DIRS =
# After you have saved your project using the 4.0 PB, you will automatically
# start using the makefiles in /NextDeveloper/Makefiles/project. If you should
# need to revert back to the old 3.3 Makefile behavior, override MAKEFILEDIR to
# be /NextDeveloper/Makefiles/app.
# Don't add more rules here unless you want the first one to be the default
# target for make! Put all your targets in Makefile.postamble.

View file

@ -1,77 +0,0 @@
{
APPCLASS = NSApplication;
DYNAMIC_CODE_GEN = YES;
FILESTABLE = {
CLASSES = (
PCAppController.m,
PCPrefController.m,
PCInfoController.m,
PCFindController.m,
PCLogController.m,
PCMenuController.m
);
FRAMEWORKS = (AppKit.framework, Foundation.framework);
HEADERSEARCH = (/LocalDeveloper/Headers/PCLib);
H_FILES = (
PCAppController.h,
PCPrefController.h,
PCInfoController.h,
PCFindController.h,
PCLogController.h,
PCMenuController.h
);
IMAGES = (
FileIcon_.c.tiff,
FileIcon_.h.tiff,
FileIcon_.m.tiff,
FileIcon_rtf.tiff,
ProjectCenter.app.tiff,
ProjectCenter.tiff,
ProjectCentre_add.tiff,
ProjectCentre_build.tiff,
ProjectCentre_clean.tiff,
ProjectCentre_cvs.tiff,
ProjectCentre_documentation.tiff,
ProjectCentre_files.tiff,
ProjectCentre_find.tiff,
ProjectCentre_prefs.tiff,
ProjectCentre_run.tiff,
ProjectCentre_uml.tiff
);
INTERFACES = (
FileCreation.nib,
Info.nib,
Inspector.nib,
NEXTSTEP_ProjectCenter.nib,
Preferences.nib,
Project.nib,
TypePopup.nib
);
OTHER_LIBS = (PCLib);
OTHER_LINKED = (ProjectCenter_main.m);
OTHER_SOURCES = (Makefile.preamble, Makefile, Makefile.postamble, m.template, h.template);
};
LANGUAGE = English;
LOCALIZABLE_FILES = {
FileCreation.nib = FileCreation.nib;
Info.nib = Info.nib;
Inspector.nib = Inspector.nib;
NEXTSTEP_ProjectCenter.nib = NEXTSTEP_ProjectCenter.nib;
Preferences.nib = Preferences.nib;
Project.nib = Project.nib;
TypePopup.nib = TypePopup.nib;
};
MAKEFILEDIR = "$(NEXT_ROOT)/NextDeveloper/Makefiles/pb_makefiles";
NEXTSTEP_APPICON = ProjectCenter.app.tiff;
NEXTSTEP_BUILDTOOL = /bin/gnumake;
NEXTSTEP_DOCUMENTEXTENSIONS = ();
NEXTSTEP_INSTALLDIR = "$(HOME)/Apps";
NEXTSTEP_MAINNIB = NEXTSTEP_ProjectCenter.nib;
PDO_UNIX_BUILDTOOL = $NEXT_ROOT/NextDeveloper/bin/make;
PROJECTNAME = ProjectCenter;
PROJECTTYPE = Application;
PROJECTVERSION = 2.6;
WINDOWS_BUILDTOOL = $NEXT_ROOT/NextDeveloper/Executables/make;
WINDOWS_INSTALLDIR = /MyApps;
WINDOWS_MAINNIB = WINDOWS_ProjectCenter.nib;
}

View file

@ -3,69 +3,77 @@
APPKIT = "GNUSTEP-GUI";
APPLICATIONICON = "";
BUILDTOOL = gnumake;
"CLASS_FILES" = (
"PCAppController.m",
"PCFindController.m",
"PCInfoController.m",
"PCLogController.m",
"PCMenuController.m",
"ProjectCenter_main.m"
CLASS_FILES = (
PCAppController.m,
PCFindController.m,
PCInfoController.m,
PCLogController.m,
PCMenuController.m,
PCPrefController.m,
ProjectCenter_main.m,
"PCAppController+MenuHandling.m"
);
COMPILEROPTIONS = "";
"CREATION_DATE" = "";
"DOCU_FILES" = (
CREATION_DATE = "";
DOCU_FILES = (
);
FOUNDATION = "GNUSTEP-BASE";
FRAMEWORKS = (
);
"HEADER_FILES" = (
"PCAppController.h",
"PCFindController.h",
"PCInfoController.h",
"PCLogController.h",
"PCMenuController.h",
"PCPrefController.h"
HEADER_FILES = (
PCAppController.h,
PCFindController.h,
PCInfoController.h,
PCLogController.h,
PCMenuController.h,
PCPrefController.h,
"PCAppController+MenuHandling.h"
);
IMAGES = (
"build.tiff"
FileIcon_.c.tiff,
FileIcon_.h.tiff,
FileIcon_.m.tiff,
FileIcon_rtf.tiff,
ProjectCenter.app.tiff,
ProjectCenter.tiff,
ProjectCenter_clean.tiff,
ProjectCenter_debug.tiff,
ProjectCenter_install.tiff,
ProjectCenter_make.tiff,
ProjectCenter_profile.tiff
);
INSTALLDIR = "$(HOME)/Apps";
INTERFACES = (
"main.gmodel",
"FileCreation.gmodel",
"Info.gmodel",
"Preferences.gmodel",
"Project.gmodel",
"ProjectCenter.gmodel",
"PCPrefController.m"
ProjectCenter.gmodel
);
LANGUAGE = English;
"LAST_EDITING" = "";
LAST_EDITING = "";
LIBRARIES = (
"gnustep-base",
"gnustep-gui"
"gnustep-gui",
ProjectCenter
);
MAININTERFACE = "main.gmodel";
MAKEFILEDIR = "/usr/GNUstep/Makefiles";
"OTHER_FILES" = (
MAININTERFACE = main.gmodel;
MAKEFILEDIR = /usr/GNUstep/Makefiles;
OTHER_FILES = (
);
"OTHER_RESOURCES" = (
OTHER_RESOURCES = (
);
"OTHER_SOURCES" = (
OTHER_SOURCES = (
);
"PRINCIPAL_CLASS" = "ProjectCenter_main.m";
"PROJECT_BUILDER" = PCAppProj;
"PROJECT_CREATOR" = "";
"PROJECT_DESCRIPTION" = "No description avaliable!";
"PROJECT_MAINTAINER" = "";
"PROJECT_NAME" = PC;
"PROJECT_TYPE" = PCAppProject;
"PROJECT_VERSION" = "1.0";
PRINCIPAL_CLASS = ProjectCenter_main.m;
PROJECT_BUILDER = PCAppProj;
PROJECT_CREATOR = "";
PROJECT_DESCRIPTION = "No description avaliable!";
PROJECT_MAINTAINER = "";
PROJECT_NAME = ProjectCenter;
PROJECT_TYPE = PCAppProject;
PROJECT_VERSION = 1.0;
SUBPROJECTS = (
);
"SUPPORTING_FILES" = (
"GNUmakefile.preamble",
SUPPORTING_FILES = (
GNUmakefile.preamble,
GNUmakefile,
"GNUmakefile.postamble"
GNUmakefile.postamble
);
}

View file

@ -0,0 +1,64 @@
/*
GNUstep ProjectCenter - http://www.projectcenter.ch
Copyright (C) 2000 Philippe C.D. Robert
Author: Philippe C.D. Robert <phr@projectcenter.ch>
This file is part of ProjectCenter.
This application is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This application is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$Id$
*/
#import <AppKit/AppKit.h>
#import "PCAppController.h"
@interface PCAppController (MenuHandling)
- (void)showPrefWindow:(id)sender;
- (void)showInfoPanel:(id)sender;
- (void)showInspector:(id)sender;
- (void)showBuildPanel:(id)sender;
- (void)openProject:(id)sender;
- (void)newProject:(id)sender;
- (void)saveProject:(id)sender;
- (void)saveProjectAs:(id)sender;
- (void)showLoadedProjects:(id)sender;
- (void)saveFiles:(id)sender;
- (void)revertToSaved:(id)sender;
- (void)newSubproject:(id)sender;
- (void)addSubproject:(id)sender;
- (void)removeSubproject:(id)sender;
- (void)closeProject:(id)sender;
- (void)newFile:(id)sender;
- (void)addFile:(id)sender;
- (void)openFile:(id)sender;
- (void)saveFile:(id)sender;
- (void)saveFileAs:(id)sender;
- (void)revertFile:(id)sender;
- (void)renameFile:(id)sender;
- (void)removeFile:(id)sender;
@end

View file

@ -0,0 +1,150 @@
/*
GNUstep ProjectCenter - http://www.projectcenter.ch
Copyright (C) 2000 Philippe C.D. Robert
Author: Philippe C.D. Robert <phr@projectcenter.ch>
This file is part of ProjectCenter.
This application is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This application is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
$Id$
*/
#import "PCAppController+MenuHandling.h"
#import "PCMenuController.h"
#import "PCPrefController.h"
#import "PCInfoController.h"
#import <ProjectCenter/PCProjectManager.h>
@implementation PCAppController (MenuHandling)
- (void)showPrefWindow:(id)sender
{
[prefController showPrefWindow:sender];
}
- (void)showInfoPanel:(id)sender
{
[infoController showInfoWindow:sender];
}
- (void)showInspector:(id)sender
{
[projectManager showInspectorForProject:[projectManager activeProject]];
}
- (void)showBuildPanel:(id)sender;
{
[[projectManager activeProject] build:self];
}
- (void)openProject:(id)sender
{
[menuController openProject:sender];
}
- (void)newProject:(id)sender
{
[menuController newProject:sender];
}
- (void)saveProject:(id)sender
{
[menuController saveProject:sender];
}
- (void)saveProjectAs:(id)sender
{
[menuController saveProjectAs:sender];
}
- (void)showLoadedProjects:(id)sender
{
[menuController showLoadedProjects:sender];
}
- (void)saveFiles:(id)sender
{
[menuController saveFiles:sender];
}
- (void)revertToSaved:(id)sender
{
[menuController revertToSaved:sender];
}
- (void)newSubproject:(id)sender
{
[menuController newSubproject:sender];
}
- (void)addSubproject:(id)sender
{
[menuController addSubproject:sender];
}
- (void)removeSubproject:(id)sender
{
[menuController removeSubproject:sender];
}
- (void)closeProject:(id)sender
{
[menuController closeProject:sender];
}
- (void)newFile:(id)sender
{
[menuController newFile:sender];
}
- (void)addFile:(id)sender
{
[menuController addFile:sender];
}
- (void)openFile:(id)sender
{
[menuController openFile:sender];
}
- (void)saveFile:(id)sender
{
[menuController saveFile:sender];
}
- (void)saveFileAs:(id)sender
{
[menuController saveFileAs:sender];
}
- (void)revertFile:(id)sender
{
[menuController revertFile:sender];
}
- (void)renameFile:(id)sender
{
[menuController renameFile:sender];
}
- (void)removeFile:(id)sender
{
[menuController removeFile:sender];
}
@end

View file

@ -39,21 +39,21 @@
@interface PCAppController : NSObject
{
IBOutlet PCPrefController *prefController;
IBOutlet PCFindController *finder;
IBOutlet PCInfoController *infoController;
IBOutlet PCLogController *logger;
IBOutlet PCProjectManager *projectManager;
IBOutlet PCFileManager *fileManager;
IBOutlet PCMenuController *menuController;
PCBundleLoader *bundleLoader;
PCServer *doServer;
NSConnection *doConnection;
id delegate;
NSMutableDictionary *projectTypes;
PCPrefController *prefController;
PCFindController *finder;
PCInfoController *infoController;
PCLogController *logger;
PCProjectManager *projectManager;
PCFileManager *fileManager;
PCMenuController *menuController;
PCBundleLoader *bundleLoader;
PCServer *doServer;
NSConnection *doConnection;
id delegate;
NSMutableDictionary *projectTypes;
}
//============================================================================
@ -89,7 +89,11 @@
//==== Misc...
//============================================================================
- (BOOL)application:(NSApplication *)application openFile:(NSString *)fileName;
- (void)applicationWillFinishLaunching:(NSNotification *)notification;
- (void)applicationDidFinishLaunching:(NSNotification *)notification;
- (BOOL)applicationShouldTerminate:(id)sender;
- (void)applicationWillTerminate:(NSNotification *)notification;
@ -97,8 +101,6 @@
//==== Delegate stuff
//============================================================================
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename;
- (void)bundleLoader:(id)sender didLoadBundle:(NSBundle *)aBundle;
@end
@ -108,4 +110,4 @@
- (BOOL)registerProjectCreator:(NSString *)className forKey:(NSString *)aKey;
// Returns YES upon successfully registering a new projecttype.
@end
@end

View file

@ -38,12 +38,7 @@
+ (void)initialize
{
NSMutableDictionary *defaults = [NSMutableDictionary dictionary];
#if defined(GNUSTEP)
NSString *_bundlePath = @"/usr/GNUstep/Local/Library/ProjectCenter";
#else
NSString *_bundlePath = @"/LocalLibrary/ProjectCenter";
#endif
[defaults setObject:_bundlePath forKey:BundlePaths];
@ -51,6 +46,8 @@
[defaults setObject:@"/usr/bin/gdb" forKey:Debugger];
[defaults setObject:@"/usr/bin/gcc" forKey:Compiler];
[defaults setObject:@"YES" forKey:ExternalEditor];
[defaults setObject:[NSString stringWithFormat:@"%@/ProjectCenterBuildDir",NSTemporaryDirectory()] forKey:RootBuildDirectory];
/*
@ -75,23 +72,45 @@
// They are registered by the bundleLoader
projectTypes = [[NSMutableDictionary alloc] init];
prefController = [[PCPrefController alloc] init];
finder = [[PCFindController alloc] init];
infoController = [[PCInfoController alloc] init];
logger = [[PCLogController alloc] init];
projectManager = [[PCProjectManager alloc] init];
fileManager = [PCFileManager fileManager];
menuController = [[PCMenuController alloc] init];
[projectManager setDelegate:self];
[fileManager setDelegate:projectManager];
[menuController setAppController:self];
[menuController setFileManager:fileManager];
[menuController setProjectManager:projectManager];
}
return self;
}
- (void)dealloc
{
if (doConnection) {
[doConnection invalidate];
[doConnection release];
}
[projectManager release];
[bundleLoader release];
[doServer release];
[projectTypes release];
[super dealloc];
if (doConnection) {
[doConnection invalidate];
[doConnection release];
}
[prefController release];
[finder release];
[infoController release];
[logger release];
[projectManager release];
[fileManager release];
[menuController release];
[bundleLoader release];
[doServer release];
[projectTypes release];
[super dealloc];
}
//============================================================================
@ -100,12 +119,12 @@
- (id)delegate
{
return delegate;
return delegate;
}
- (void)setDelegate:(id)aDelegate
{
delegate = aDelegate;
delegate = aDelegate;
}
//============================================================================
@ -114,74 +133,83 @@
- (PCBundleLoader *)bundleLoader
{
return bundleLoader;
return bundleLoader;
}
- (PCProjectManager *)projectManager
{
return projectManager;
return projectManager;
}
- (PCPrefController *)prefController
{
return prefController;
return prefController;
}
- (PCServer *)doServer
{
return doServer;
return doServer;
}
- (PCFindController *)finder
{
return finder;
return finder;
}
- (PCLogController *)logger
{
return logger;
return logger;
}
- (NSDictionary *)projectTypes
{
return projectTypes;
return projectTypes;
}
//============================================================================
//==== Misc...
//============================================================================
- (BOOL)application:(NSApplication *)application openFile:(NSString *)fileName
{
if ([[fileName lastPathComponent] isEqualToString:@"PC.project"] == NO) {
return NO;
}
return [projectManager openProjectAt:fileName];
}
- (void)applicationWillFinishLaunching:(NSNotification *)notification
{
[bundleLoader loadBundles];
}
- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
[logger logMessage:@"Loading additional subsystems..." tag:INFORMATION];
NSString *h = [[NSProcessInfo processInfo] hostName];
NSString *connectionName = [NSString stringWithFormat:@"ProjectCenter:%@",h];
[logger logMessage:@"Loading additional subsystems..." tag:INFORMATION];
[bundleLoader loadBundles];
//[bundleLoader loadBundles];
// The DO server
doServer = [[PCServer alloc] init];
NS_DURING
doConnection = [[NSConnection alloc] init];
[doConnection registerName:connectionName];
NS_HANDLER
NSRunAlertPanel(@"Warning!",@"Could not register the DO connection %@",@"OK",nil,nil,nil,connectionName);
NS_ENDHANDLER
[[NSNotificationCenter defaultCenter] addObserver:doServer selector:@selector(connectionDidDie:) name:NSConnectionDidDieNotification object:doConnection];
[doConnection setDelegate:doServer];
// The DO server
doServer = [[PCServer alloc] init];
#if defined(GNUSTEP)
NS_DURING
doConnection = [NSConnection newRegisteringAtName:@"ProjectCenter" withRootObject:doServer];
[logger logMessage:@"Successful initialisation of the DO connection 'ProjectCenter'." tag:INFORMATION];
NS_HANDLER
[logger logMessage:@"Could not initialise the DO connection 'ProjectCenter'!" tag:WARNING];
NSRunAlertPanel(@"Warning!",@"Could not register the DO connection 'ProjectCenter'",@"OK",nil,nil,nil);
NS_ENDHANDLER
#else
doConnection = [NSConnection defaultConnection];
[doConnection setRootObject:doServer];
if (![doConnection registerName:@"ProjectCenter"]) {
[logger logMessage:@"Could not initialise the DO connection 'ProjectCenter'!" tag:WARNING];
}
else {
[logger logMessage:@"Successful initialisation of the DO connection 'ProjectCenter'." tag:INFORMATION];
}
#endif
[[NSNotificationCenter defaultCenter] addObserver:doServer selector:@selector(connectionDidDie:) name:NSConnectionDidDieNotification object:doConnection];
[doConnection setDelegate:doServer];
[[NSNotificationCenter defaultCenter] postNotificationName:PCAppDidInitNotification object:nil];
[[NSNotificationCenter defaultCenter] postNotificationName:PCAppDidInitNotification object:nil];
}
- (BOOL)applicationShouldTerminate:(id)sender
@ -213,18 +241,6 @@
//==== Delegate stuff
//============================================================================
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
{
BOOL success = NO;
if (([[filename lastPathComponent] isEqualToString:@"PC.proj"])) {
[projectManager openProjectAt:filename];
success = YES;
}
return success;
}
- (void)bundleLoader:(id)sender didLoadBundle:(NSBundle *)aBundle
{
Class principalClass;
@ -247,7 +263,7 @@
[fileManager registerCreatorsWithObjectsAndKeys:[[principalClass sharedCreator] creatorDictionary]];
// In objc.h there is already th like (char *)name...
// [logger logMessage:[NSString stringWithFormat:@"FileCreator %@ successfully loaded!",(NSString *)[[principalClass sharedCreator] name]] tag:INFORMATION];
// [logger logMessage:[NSString stringWithFormat:@"FileCreator %@ successfully loaded!",(NSString *)[[principalClass sharedCreator] name]] tag:INFORMATION];
}
}

View file

@ -32,17 +32,25 @@
@interface PCMenuController : NSObject
{
IBOutlet PCProjectManager *projectManager;
IBOutlet PCFileManager *fileManager;
IBOutlet PCAppController *appController;
NSBox *projectTypeAccessaryView;
id projectTypePopup;
PCProjectManager *projectManager;
PCFileManager *fileManager;
PCAppController *appController;
NSBox *projectTypeAccessaryView;
id projectTypePopup;
}
//============================================================================
//==== Init and free
//============================================================================
- (id)init;
- (void)dealloc;
- (void)setAppController:(id)anObject;
- (void)setFileManager:(id)anObject;
- (void)setProjectManager:(id)anObject;
//============================================================================
//==== Menu stuff
//============================================================================

View file

@ -71,6 +71,24 @@
[projectTypePopup addItemWithTitle:name];
}
- (void)setAppController:(id)anObject
{
[appController autorelease];
appController = [anObject retain];
}
- (void)setFileManager:(id)anObject
{
[fileManager autorelease];
fileManager = [anObject retain];
}
- (void)setProjectManager:(id)anObject
{
[projectManager autorelease];
projectManager = [anObject retain];
}
//============================================================================
//==== Menu stuff
//============================================================================
@ -184,21 +202,21 @@
- (void)openFile:(id)sender
{
NSString *filePath;
NSOpenPanel *openPanel;
int retval;
openPanel = [NSOpenPanel openPanel];
[openPanel setAllowsMultipleSelection:NO];
[openPanel setCanChooseDirectories:NO];
[openPanel setCanChooseFiles:YES];
retval = [openPanel runModalForDirectory:[[NSUserDefaults standardUserDefaults] objectForKey:@"LastOpenDirectory"] file:nil types:nil];
NSOpenPanel *openPanel;
int retval;
openPanel = [NSOpenPanel openPanel];
[openPanel setAllowsMultipleSelection:NO];
[openPanel setCanChooseDirectories:NO];
[openPanel setCanChooseFiles:YES];
retval = [openPanel runModalForDirectory:[[NSUserDefaults standardUserDefaults] objectForKey:@"LastOpenDirectory"] file:nil types:nil];
if (retval == NSOKButton) {
BOOL isDir;
[[NSUserDefaults standardUserDefaults] setObject:[openPanel directory] forKey:@"LastOpenDirectory"];
filePath = [[openPanel filenames] objectAtIndex:0];
[[NSUserDefaults standardUserDefaults] setObject:[openPanel directory] forKey:@"LastOpenDirectory"];
filePath = [[openPanel filenames] objectAtIndex:0];
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath isDirectory:&isDir] && !isDir) {
if (![projectManager openFile:filePath]) {
@ -243,20 +261,20 @@
- (void)removeFile:(id)sender
{
NSString *file = nil;
PCProject *proj = [projectManager activeProject];
if ((file = [[proj browserController] nameOfSelectedFile])) {
int ret;
ret = NSRunAlertPanel(@"Remove File!",@"Really remove %@ in project %@?",@"Cancel",@"...from Project only",@"...from Project and Disk",file,[proj projectName]);
if (ret == NSAlertAlternateReturn || ret == NSAlertOtherReturn) {
BOOL flag = (ret == NSAlertOtherReturn) ? YES : NO;
[projectManager removeFilePermanently:flag];
}
}
NSString *file = nil;
PCProject *proj = [projectManager activeProject];
if ((file = [[proj browserController] nameOfSelectedFile])) {
int ret;
ret = NSRunAlertPanel(@"Remove File!",@"Really remove %@ in project %@?",@"Cancel",@"...from Project only",@"...from Project and Disk",file,[proj projectName]);
if (ret == NSAlertAlternateReturn || ret == NSAlertOtherReturn) {
BOOL flag = (ret == NSAlertOtherReturn) ? YES : NO;
[projectManager removeFilePermanently:flag];
}
}
}
//============================================================================

View file

@ -40,6 +40,8 @@
id failureField;
id autoSaveField;;
id useExternalEditor;
id editorField;
id debuggerField;
@ -47,9 +49,6 @@
id bundlePathField;
NSMutableDictionary *preferencesDict;
@private
BOOL _needsReleasing;
}
- (id)init;
@ -66,6 +65,8 @@
- (void)setRemoveBackup:(id)sender;
- (void)setSavePeriod:(id)sender;
- (void)setUseExternalEditor:(id)sender;
- (void)setEditor:(id)sender;
- (void)setCompiler:(id)sender;
- (void)setDebugger:(id)sender;

View file

@ -42,12 +42,12 @@
- (void)_initUI
{
NSView *_c_view;
unsigned int style = NSTitledWindowMask | NSClosableWindowMask |
NSResizableWindowMask;
unsigned int style = NSTitledWindowMask | NSClosableWindowMask;
NSRect _w_frame;
NSBox *line;
NSBox *v;
NSButton *b;
NSTextField *textField;
/*
* Pref Window
@ -62,6 +62,8 @@
[prefWindow setMinSize:NSMakeSize(268,365)];
[prefWindow setTitle:@"Preferences"];
[prefWindow setDelegate:self];
[prefWindow setReleasedWhenClosed:NO];
[prefWindow setFrameAutosaveName:@"Preferences"];
_c_view = [prefWindow contentView];
prefPopup = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(72,328,120,20)];
@ -104,6 +106,7 @@
[b setAction:@selector(setPromptOnClean:)];
[b setContinuous:NO];
[prefBuildingView addSubview:b];
[b sizeToFit];
/*
* Misc view
@ -116,23 +119,125 @@
[prefMiscView setBorderType:NSNoBorder];
v = [[[NSBox alloc] init] autorelease];
[v setTitle:@"External"];
[v setTitle:@"External Tools"];
[v setFrameFromContentFrame:NSMakeRect(16,184,228,96)];
[prefMiscView addSubview:v];
/*
* Editor
*/
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,24,60,21)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setEditable: NO];
[textField setBezeled: NO];
[textField setDrawsBackground: NO];
[textField setStringValue:@"Editor:"];
[v addSubview:[textField autorelease]];
editorField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,24,144,21)];
[editorField setAlignment: NSLeftTextAlignment];
[editorField setBordered: NO];
[editorField setEditable: YES];
[editorField setBezeled: YES];
[editorField setDrawsBackground: YES];
[editorField setTarget:self];
[editorField setAction:@selector(setEditor:)];
[v addSubview:[editorField autorelease]];
/*
* Compiler
*/
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,48,60,21)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setEditable: NO];
[textField setBezeled: NO];
[textField setDrawsBackground: NO];
[textField setStringValue:@"Compiler:"];
[v addSubview:[textField autorelease]];
compilerField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,48,144,21)];
[compilerField setAlignment: NSLeftTextAlignment];
[compilerField setBordered: NO];
[compilerField setEditable: YES];
[compilerField setBezeled: YES];
[compilerField setDrawsBackground: YES];
[compilerField setTarget:self];
[compilerField setAction:@selector(setCompiler:)];
[v addSubview:[compilerField autorelease]];
/*
* Debugger
*/
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,72,60,21)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setEditable: NO];
[textField setBezeled: NO];
[textField setDrawsBackground: NO];
[textField setStringValue:@"Debugger:"];
[v addSubview:[textField autorelease]];
debuggerField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,72,144,21)];
[debuggerField setAlignment: NSLeftTextAlignment];
[debuggerField setBordered: NO];
[debuggerField setEditable: YES];
[debuggerField setBezeled: YES];
[debuggerField setDrawsBackground: YES];
[debuggerField setTarget:self];
[debuggerField setAction:@selector(setDebugger:)];
[v addSubview:[debuggerField autorelease]];
/*
* Bundles Box
*/
v = [[[NSBox alloc] init] autorelease];
[v setTitle:@"Bundles"];
[v setFrameFromContentFrame:NSMakeRect(16,120,228,48)];
[v setTitle:@"Bundle Path"];
[v setFrameFromContentFrame:NSMakeRect(16,96,228,48)];
[prefMiscView addSubview:v];
b = [[[NSButton alloc] initWithFrame:NSMakeRect(32,80,144,15)] autorelease];
/*
* Bundle path
*/
bundlePathField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,24,212,21)];
[bundlePathField setAlignment: NSLeftTextAlignment];
[bundlePathField setBordered: NO];
[bundlePathField setEditable: YES];
[bundlePathField setBezeled: YES];
[bundlePathField setDrawsBackground: YES];
[bundlePathField setTarget:self];
[bundlePathField setAction:@selector(setBundlePath:)];
[v addSubview:[bundlePathField autorelease]];
/*
* Some buttons
*/
useExternalEditor = [[[NSButton alloc] initWithFrame:NSMakeRect(32,24,204,15)] autorelease];
[useExternalEditor setTitle:@"use external Editor"];
[useExternalEditor setButtonType:NSSwitchButton];
[useExternalEditor setBordered:NO];
[useExternalEditor setTarget:self];
[useExternalEditor setAction:@selector(setUseExternalEditor:)];
[useExternalEditor setContinuous:NO];
[prefMiscView addSubview:useExternalEditor];
[useExternalEditor sizeToFit];
b = [[[NSButton alloc] initWithFrame:NSMakeRect(32,44,204,15)] autorelease];
[b setTitle:@"Prompt when quitting"];
[b setButtonType:NSSwitchButton];
[b setBordered:NO];
[b setTarget:self];
// [b setAction:@selector(setPromptOnClean:)];
// [b setAction:@selector()];
[b setContinuous:NO];
[prefMiscView addSubview:b];
[b sizeToFit];
/*
* Saving view
@ -149,7 +254,7 @@
[v setFrameFromContentFrame:NSMakeRect(16,208,228,72)];
[prefSavingView addSubview:v];
b = [[[NSButton alloc] initWithFrame:NSMakeRect(13,32,124,15)] autorelease];
b = [[[NSButton alloc] initWithFrame:NSMakeRect(24,32,124,15)] autorelease];
[b setTitle:@"Save Automatically"];
[b setButtonType:NSSwitchButton];
[b setBordered:NO];
@ -157,22 +262,22 @@
[b setAction:@selector(setSaveAutomatically:)];
[b setContinuous:NO];
[v addSubview:b];
[b sizeToFit];
b = [[[NSButton alloc] initWithFrame:NSMakeRect(13,13,124,15)] autorelease];
[b setTitle:@"Remoe Backup"];
b = [[[NSButton alloc] initWithFrame:NSMakeRect(24,12,124,15)] autorelease];
[b setTitle:@"Remove Backup"];
[b setButtonType:NSSwitchButton];
[b setBordered:NO];
[b setTarget:self];
[b setAction:@selector(setRemoveBackup:)];
[b setContinuous:NO];
[v addSubview:b];
[b sizeToFit];
v = [[[NSBox alloc] init] autorelease];
[v setTitle:@"Auto-Save"];
[v setFrameFromContentFrame:NSMakeRect(16,104,228,80)];
[v setFrameFromContentFrame:NSMakeRect(16,104,228,48)];
[prefSavingView addSubview:v];
_needsReleasing = YES;
}
@end
@ -195,39 +300,28 @@
{
[preferencesDict release];
if (_needsReleasing) {
[prefWindow release];
[prefPopup release];
[prefEmptyView release];
[prefBuildingView release];
[prefMiscView release];
[prefSavingView release];
}
[prefWindow release];
[prefPopup release];
[prefEmptyView release];
[prefBuildingView release];
[prefMiscView release];
[prefSavingView release];
[[NSUserDefaults standardUserDefaults] synchronize];
[super dealloc];
}
- (void)showPrefWindow:(id)sender
{
NSDictionary *prefs;
NSString *val;
if (!prefWindow) {
id view;
NSString *val;
#if defined(GNUSTEP)
[self _initUI];
#else
if(![NSBundle loadNibNamed:@"Preferences.nib" owner:self]) {
[[NSException exceptionWithName:NIB_NOT_FOUND_EXCEPTION reason:@"Could not load Preferences.gmodel" userInfo:nil] raise];
return;
}
#endif
// Fill in the defaults
[compilerField setStringValue:(val=[preferencesDict objectForKey:Compiler]) ? val : @""];
[debuggerField setStringValue:(val=[preferencesDict objectForKey:Debugger]) ? val : @""];
[editorField setStringValue:(val=[preferencesDict objectForKey:Editor]) ? val : @""];
[bundlePathField setStringValue:(val=[preferencesDict objectForKey:BundlePaths]) ? val : @""];
// The popup and selected view
[prefPopup removeAllItems];
@ -241,8 +335,21 @@
[(NSBox *)prefEmptyView setContentView:view];
[prefEmptyView display];
}
prefs = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];
[preferencesDict addEntriesFromDictionary:prefs];
[prefWindow center];
// Fill in the defaults
[compilerField setStringValue:(val=[preferencesDict objectForKey:Compiler]) ? val : @""];
[debuggerField setStringValue:(val=[preferencesDict objectForKey:Debugger]) ? val : @""];
[editorField setStringValue:(val=[preferencesDict objectForKey:Editor]) ? val : @""];
[bundlePathField setStringValue:(val=[preferencesDict objectForKey:BundlePaths]) ? val : @""];
[useExternalEditor setState:([[preferencesDict objectForKey:ExternalEditor] isEqualToString:@"YES"])?NSOnState:NSOffState];
if (![prefWindow isVisible]) {
[prefWindow setFrameUsingName:@"Preferences"];
}
[prefWindow makeKeyAndOrderFront:self];
}
@ -305,52 +412,58 @@
{
}
- (void)setUseExternalEditor:(id)sender
{
NSUserDefaults *def = [NSUserDefaults standardUserDefaults];
switch ([[sender selectedCell] state]) {
case 0:
[def setObject:@"NO" forKey:ExternalEditor];
break;
case 1:
[def setObject:@"YES" forKey:ExternalEditor];
break;
}
[def synchronize];
}
- (void)setEditor:(id)sender
{
NSString *path = [self selectFileWithTypes:[NSArray arrayWithObjects:@"app",nil]];
if (path) {
[editorField setStringValue:path];
[[NSUserDefaults standardUserDefaults] setObject:path forKey:Editor];
[preferencesDict setObject:path forKey:Editor];
}
NSString *path = [editorField stringValue];
if (path) {
[[NSUserDefaults standardUserDefaults] setObject:path forKey:Editor];
[preferencesDict setObject:path forKey:Editor];
}
}
- (void)setCompiler:(id)sender
{
NSString *path = [self selectFileWithTypes:nil];
NSString *path = [compilerField stringValue];
if (path) {
[compilerField setStringValue:path];
[[NSUserDefaults standardUserDefaults] setObject:path forKey:Compiler];
[preferencesDict setObject:path forKey:Compiler];
}
if (path) {
[[NSUserDefaults standardUserDefaults] setObject:path forKey:Compiler];
[preferencesDict setObject:path forKey:Compiler];
}
}
- (void)setDebugger:(id)sender
{
NSString *path = [self selectFileWithTypes:nil];
if (path) {
[debuggerField setStringValue:path];
[[NSUserDefaults standardUserDefaults] setObject:path forKey:Debugger];
[preferencesDict setObject:path forKey:Debugger];
}
NSString *path = [debuggerField stringValue];
if (path) {
[[NSUserDefaults standardUserDefaults] setObject:path forKey:Debugger];
[preferencesDict setObject:path forKey:Debugger];
}
}
- (void)setBundlePath:(id)sender
{
NSString *path = [self selectFileWithTypes:[NSArray arrayWithObjects:@"bundle",nil]];
if (path) {
[bundlePathField setStringValue:path];
[[NSUserDefaults standardUserDefaults] setObject:path forKey:BundlePaths];
[preferencesDict setObject:path forKey:BundlePaths];
}
NSString *path = [bundlePathField stringValue];
if (path) {
[[NSUserDefaults standardUserDefaults] setObject:path forKey:BundlePaths];
[preferencesDict setObject:path forKey:BundlePaths];
}
}
- (void)promptWhenQuitting:(id)sender
@ -364,23 +477,23 @@
- (NSString *)selectFileWithTypes:(NSArray *)types
{
NSString *file = nil;
NSOpenPanel *openPanel;
int retval;
openPanel = [NSOpenPanel openPanel];
[openPanel setAllowsMultipleSelection:NO];
[openPanel setCanChooseDirectories:YES];
[openPanel setCanChooseFiles:YES];
retval = [openPanel runModalForDirectory:[[NSUserDefaults standardUserDefaults] objectForKey:@"LastOpenDirectory"] file:nil types:types];
if (retval == NSOKButton) {
[[NSUserDefaults standardUserDefaults] setObject:[openPanel directory] forKey:@"LastOpenDirectory"];
file = [[openPanel filenames] objectAtIndex:0];
NSString *file = nil;
NSOpenPanel *openPanel;
int retval;
}
return file;
openPanel = [NSOpenPanel openPanel];
[openPanel setAllowsMultipleSelection:NO];
[openPanel setCanChooseDirectories:YES];
[openPanel setCanChooseFiles:YES];
retval = [openPanel runModalForDirectory:[[NSUserDefaults standardUserDefaults] objectForKey:@"LastOpenDirectory"] file:nil types:types];
if (retval == NSOKButton) {
[[NSUserDefaults standardUserDefaults] setObject:[openPanel directory] forKey:@"LastOpenDirectory"];
file = [[openPanel filenames] objectAtIndex:0];
}
return file;
}
@end

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -25,7 +25,183 @@
*/
#import <AppKit/AppKit.h>
#import"PCAppController.h"
int main(int argc, const char *argv[]) {
return NSApplicationMain(argc, argv);
void createMenu();
int main(int argc, const char **argv)
{
id theApp;
PCAppController *controller;
id pool = [[NSAutoreleasePool alloc] init];
#ifndef NX_CURRENT_COMPILER_RELEASE
initialize_gnustep_backend();
#endif
theApp = [NSApplication sharedApplication];
createMenu();
controller = [[PCAppController alloc] init];
[theApp setDelegate:controller];
[theApp run];
[controller release];
[pool release];
return 0;
}
void createMenu()
{
NSMenu *menu;
NSMenu *info;
NSMenu *subprojects;
NSMenu *project;
NSMenu *file;
NSMenu *edit;
NSMenu *format;
NSMenu *fontmenu;
NSMenu *tools;
NSMenu *services;
NSMenu *windows;
SEL action = @selector(method:);
menu = [[NSMenu alloc] initWithTitle:@"ProjectCenter"];
/*
* The main menu
*/
[menu addItemWithTitle:@"Info" action:action keyEquivalent:@""];
[menu addItemWithTitle:@"Project" action:action keyEquivalent:@""];
[menu addItemWithTitle:@"File" action:action keyEquivalent:@""];
[menu addItemWithTitle:@"Edit" action:action keyEquivalent:@""];
[menu addItemWithTitle:@"Format" action:action keyEquivalent:@""];
[menu addItemWithTitle:@"Tools" action:action keyEquivalent:@""];
[menu addItemWithTitle:@"Windows" action:action keyEquivalent:@""];
[menu addItemWithTitle:@"Services" action:action keyEquivalent:@""];
[menu addItemWithTitle:@"Hide" action:@selector(hide:) keyEquivalent:@"h"];
[menu addItemWithTitle:@"Quit" action:@selector(terminate:)
keyEquivalent:@"q"];
/*
* Info submenu
*/
info = [[[NSMenu alloc] init] autorelease];
[menu setSubmenu:info forItem:[menu itemWithTitle:@"Info"]];
[info addItemWithTitle:@"Info Panel..." action:@selector(showInfoPanel:) keyEquivalent:@""];
[info addItemWithTitle:@"Preferences" action:@selector(showPrefWindow:) keyEquivalent:@""];
[info addItemWithTitle:@"Help" action:action keyEquivalent:@"?"];
/*
* Project submenu
*/
project = [[[NSMenu alloc] init] autorelease];
[menu setSubmenu:project forItem:[menu itemWithTitle:@"Project"]];
[project addItemWithTitle:@"Open" action:@selector(openProject:) keyEquivalent:@"o"];
[project addItemWithTitle:@"New" action:@selector(newProject:) keyEquivalent:@"n"];
[project addItemWithTitle:@"Save" action:@selector(saveProject:) keyEquivalent:@"s"];
[project addItemWithTitle:@"Save As" action:@selector(saveProjectAs:) keyEquivalent:@""];
[project addItemWithTitle:@"Subprojects" action:action keyEquivalent:@""];
[project addItemWithTitle:@"Close" action:@selector(closeProject:) keyEquivalent:@""];
subprojects = [[[NSMenu alloc] init] autorelease];
[project setSubmenu:subprojects forItem:[project itemWithTitle:@"Subprojects"]];
[subprojects addItemWithTitle:@"New..." action:@selector(newSubproject:) keyEquivalent:@""];
[subprojects addItemWithTitle:@"Add..." action:@selector(addSubproject:) keyEquivalent:@""];
[subprojects addItemWithTitle:@"Remove..." action:@selector(removeSubproject:) keyEquivalent:@""];
/*
* File submenu
*/
file = [[[NSMenu alloc] init] autorelease];
[menu setSubmenu:file forItem:[menu itemWithTitle:@"File"]];
[file addItemWithTitle:@"Open..." action:@selector(openFile:) keyEquivalent:@"O"];
[file addItemWithTitle:@"Add..." action:@selector(addFile:) keyEquivalent:@"A"];
[file addItemWithTitle:@"New in Project" action:@selector(newFile:) keyEquivalent:@"N"];
[file addItemWithTitle:@"Remove File" action:@selector(removeFile:) keyEquivalent:@""];
[file addItemWithTitle:@"Save..." action:@selector(saveFile:) keyEquivalent:@""];
[file addItemWithTitle:@"Save as..." action:@selector(saveFileAs:) keyEquivalent:@""];
[file addItemWithTitle:@"Revert" action:@selector(revertFile:) keyEquivalent:@""];
[file addItemWithTitle:@"Rename" action:@selector(renameFile:) keyEquivalent:@""];
/*
* Edit submenu
*/
edit = [[[NSMenu alloc] init] autorelease];
[menu setSubmenu:edit forItem:[menu itemWithTitle:@"Edit"]];
[edit addItemWithTitle: @"Cut"
action: @selector(cut:)
keyEquivalent: @"x"];
[edit addItemWithTitle: @"Copy"
action: @selector(copy:)
keyEquivalent: @"c"];
[edit addItemWithTitle: @"Paste"
action: @selector(paste:)
keyEquivalent: @"v"];
[edit addItemWithTitle: @"Delete"
action: @selector(delete:)
keyEquivalent: @""];
[edit addItemWithTitle: @"Select All"
action: @selector(selectAll:)
keyEquivalent: @"a"];
/*
* Format submenu
*/
format = [[[NSMenu alloc] init] autorelease];
[menu setSubmenu:format forItem:[menu itemWithTitle:@"Format"]];
[format addItemWithTitle:@"Fonts" action:NULL keyEquivalent:@""];
fontmenu = [[[NSMenu alloc] init] autorelease];
[format setSubmenu:[[NSFontManager sharedFontManager] fontMenu: YES] forItem:[format itemWithTitle:@"Fonts"]];
/*
* Tools submenu
*/
tools = [[[NSMenu alloc] init] autorelease];
[menu setSubmenu:tools forItem:[menu itemWithTitle:@"Tools"]];
[tools addItemWithTitle:@"Loaded Projects..." action:@selector(showLoadedProjects:) keyEquivalent:@""];
[tools addItemWithTitle:@"Build Panel" action:@selector(showBuildPanel:) keyEquivalent:@""];
[tools addItemWithTitle:@"Find Panel" action:@selector(showFindPanel:) keyEquivalent:@"F"];
[tools addItemWithTitle:@"Inspector Panel" action:@selector(showInspector:) keyEquivalent:@""];
/*
* Windows submenu
*/
windows = [[[NSMenu alloc] init] autorelease];
[menu setSubmenu:windows forItem:[menu itemWithTitle:@"Windows"]];
[windows addItemWithTitle:@"Arrange"
action:@selector(arrangeInFront:)
keyEquivalent:@""];
[windows addItemWithTitle:@"Miniaturize"
action:@selector(performMiniaturize:)
keyEquivalent:@"m"];
[windows addItemWithTitle:@"Close"
action:@selector(performClose:)
keyEquivalent:@"w"];
/*
* Services submenu
*/
services = [[[NSMenu alloc] init] autorelease];
[menu setSubmenu:services forItem:[menu itemWithTitle:@"Services"]];
[[NSApplication sharedApplication] setMainMenu:menu];
[[NSApplication sharedApplication] setServicesMenu: services];
[menu update];
[menu display];
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

11
README
View file

@ -1,9 +1,10 @@
README
******
THIS IS A DEVELOPER 'PRE RELEASE RELEASE' ONLY! It is meant to give a
sneak peak for those who want to help, it is not meant as a usable
application right now!
This is an early release of ProjectCenter, the GNUstep IDE. Some
features are already implemented while a lot are not yet even
designed. The application is already usable for simple makefile
management and project building, though.
If you want to volunteer, please contact me!
@ -19,5 +20,5 @@ TODOs
Overall code improvements
... and a lot more!
Philippe C.D. Robert, 21.3.2000
Philippe C.D. Robert, 27.10.2000
<phr@projectcenter.ch>

View file

@ -6,7 +6,7 @@ GCC_VERSION=2.8.0
# The version number of this release.
MAJOR_VERSION=0
MINOR_VERSION=0
SUBMINOR_VERSION=1
MINOR_VERSION=2
SUBMINOR_VERSION=0
PC_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${SUBMINOR_VERSION}
VERSION=${PC_VERSION}