This commit was manufactured by cvs2svn to create tag

'DEV_SNAP_06012001'.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/tags/DEV_SNAP_06012001@8479 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
GNUstep Maintainer 2001-01-06 16:44:39 +00:00
parent 05aab7c157
commit 925e61af48
94 changed files with 4770 additions and 3958 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?
============================

View file

@ -40,6 +40,7 @@ PACKAGE_NAME = ProjectCenter
SUBPROJECTS = \
PCLib \
PCAppProj \
PCBundleProj \
PCToolProj \
PCLibProj \
PCBaseFileTypes \

28
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
(or open the project in PB.app and compile it from there)
GNUstep: 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!
In order to do this successfully you must first install PCLib and the bundles and then the application itself!
Important!
==========
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,27 @@
* $Id$
*/
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
@interface AppController : NSObject
{
}
+ (void)initialize;
- (id)init;
- (void)dealloc;
- (void)awakeFromNib;
- (void)applicationDidFinishLaunching:(NSNotification *)notif;
- (BOOL)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
{
}
- (BOOL)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;
}

76
PCAppProj/ChangeLog Normal file
View file

@ -0,0 +1,76 @@
2000-11-04 13:41 robert
* PCAppProj.m, PCAppProject.h, PCAppProject.m: we do not use
gmodels, and the project is executable
2000-10-20 16:49 robert
* PCAppMakefileFactory.m, PCAppProj.m, PCAppProject.h,
PCAppProject.m: some more UI
2000-10-15 20:29 robert
* PCAppProject.m: some code improvements regarding the inspector
2000-10-15 14:36 robert
* AppController.h, AppController.m, main.m: fixed the info panel
issue
2000-10-15 14:25 robert
* PCAppProj.m: Added the plist file to "Other Resources"
2000-10-11 09:35 robert
* AppController.h, AppController.m: removed old method
2000-10-11 09:33 robert
* AppController.h, AppController.m, PCAppProj.m, main.m: new info
panel approach - uch simpler, thanks Nicola!
2000-09-20 17:51 robert
* ChangeLog: Added a changelog
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,6 +79,8 @@ static PCAppProj *_creator = nil;
NSString *_file;
NSString *_resourcePath;
NSMutableDictionary *dict;
NSDictionary *infoDict;
NSString *plistFileName;
project = [[[PCAppProject alloc] init] autorelease];
@ -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];
@ -114,9 +138,6 @@ static PCAppProj *_creator = nil;
[fm createDirectoryAtPath:[path stringByAppendingPathComponent:@"Images"] attributes:nil];
[fm createDirectoryAtPath:[path stringByAppendingPathComponent:@"Documentation"] attributes:nil];
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"Main" ofType:@"gmodel"];
[fm copyPath:_file toPath:[_resourcePath stringByAppendingPathComponent:@"Main.gmodel"] handler:nil];
// The path cannot be in the PC.project file!
[project setProjectPath:path];

View file

@ -38,8 +38,12 @@
@interface PCAppProject : PCProject
{
@private
BOOL _needsAdditionalReleasing;
NSTextField *appClassField;
NSTextField *appImageField;
NSButton *setAppIconButton;
NSButton *clearAppIconButton;
NSImageView *appIconView;
NSImage *icon;
}
//----------------------------------------------------------------------------
@ -63,4 +67,15 @@
- (NSArray *)buildTargets;
- (NSString *)projectDescription;
- (BOOL)isExecutable;
- (void)updateValuesFromProjectDict;
- (void)clearAppIcon:(id)sender;
- (void)setAppIcon:(id)sender;
- (BOOL)setAppIconWithImageAtPath:(NSString *)path;
@end

View file

@ -43,31 +43,73 @@
- (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];
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]];
projectProjectInspectorView = [[NSBox alloc] init];
[projectProjectInspectorView setTitlePosition:NSAtTop];
[projectProjectInspectorView setBorderType:NSGrooveBorder];
// [projectProjectInspectorView addSubview:projectTypePopup];
[projectProjectInspectorView sizeToFit];
[projectProjectInspectorView setAutoresizingMask:NSViewWidthSizable];
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];
projectFileInspectorView = [[NSBox alloc] init];
[projectFileInspectorView setTitlePosition:NSAtTop];
[projectFileInspectorView setBorderType:NSGrooveBorder];
// [projectFileInspectorView addSubview:projectTypePopup];
[projectFileInspectorView sizeToFit];
[projectFileInspectorView setAutoresizingMask:NSViewWidthSizable];
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]];
_needsAdditionalReleasing = YES;
appImageField =[[NSTextField alloc] initWithFrame:NSMakeRect(84,204,176,21)];
[appImageField setAlignment: NSLeftTextAlignment];
[appImageField setBordered: YES];
[appImageField setEditable: NO];
[appImageField setBezeled: YES];
[appImageField setDrawsBackground: YES];
[appImageField setStringValue:@""];
[projectProjectInspectorView addSubview:appImageField];
setAppIconButton =[[NSButton alloc] initWithFrame:NSMakeRect(220,180,40,21)];
[setAppIconButton setTitle:@"Set"];
[setAppIconButton setTarget:self];
[setAppIconButton setAction:@selector(setAppIcon:)];
[projectProjectInspectorView addSubview:setAppIconButton];
clearAppIconButton =[[NSButton alloc] initWithFrame:NSMakeRect(180,180,40,21)];
[clearAppIconButton setTitle:@"Clear"];
[clearAppIconButton setTarget:self];
[clearAppIconButton setAction:@selector(clearAppIcon:)];
[projectProjectInspectorView addSubview:clearAppIconButton];
_box = [[NSBox alloc] init];
[_box setFrame:frame];
[_box setTitlePosition:NSNoTitle];
[_box setBorderType:NSBezelBorder];
[projectProjectInspectorView addSubview:_box];
appIconView = [[NSImageView alloc] initWithFrame:frame];
[_box addSubview:appIconView];
RELEASE(_box);
RELEASE(setAppIconButton);
RELEASE(clearAppIconButton);
RELEASE(appIconView);
}
@end
@ -80,42 +122,31 @@
- (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];
if (_needsAdditionalReleasing) {
[projectAttributeInspectorView release];
[projectProjectInspectorView release];
[projectFileInspectorView release];
}
[super dealloc];
[super dealloc];
}
//----------------------------------------------------------------------------
@ -140,6 +171,7 @@
NSLog([NSString stringWithFormat:@"Couldn't build the GNUmakefile %@!",makefile]);
return NO;
}
if (![content writeToFile:makefile atomically:YES]) {
NSLog([NSString stringWithFormat:@"Couldn't write the GNUmakefile %@!",makefile]);
return NO;
@ -177,4 +209,71 @@
return @"Project that handles GNUstep/ObjC based applications.";
}
- (BOOL)isExecutable
{
return YES;
}
- (void)updateValuesFromProjectDict
{
[super updateValuesFromProjectDict];
[appClassField setStringValue:[projectDict objectForKey:PCAppClass]];
[appImageField setStringValue:[projectDict objectForKey:PCAppIcon]];
}
- (void)clearAppIcon:(id)sender
{
[projectDict setObject:@"" forKey:PCAppIcon];
[appImageField setStringValue:@"No Icon!"];
[appIconView setImage:nil];
[appIconView display];
[self writeMakefile];
}
- (void)setAppIcon:(id)sender
{
int result;
NSArray *fileTypes = [NSImage imageFileTypes];
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
[openPanel setAllowsMultipleSelection:NO];
result = [openPanel runModalForDirectory:NSHomeDirectory()
file:nil
types:fileTypes];
if (result == NSOKButton) {
NSArray *files = [openPanel filenames];
NSString *imageFilePath = [files objectAtIndex:0];
if (![self setAppIconWithImageAtPath:imageFilePath]) {
NSRunAlertPanel(@"Error while opening file!",
@"Couldn't open %@", @"OK", nil, nil,imageFilePath);
}
}
}
- (BOOL)setAppIconWithImageAtPath:(NSString *)path
{
NSRect frame = {{0,0}, {64, 64}};
NSImage *image;
if (!(image = [[NSImage alloc] initWithContentsOfFile:path])) {
return NO;
}
[self addFile:path forKey:PCImages copy:YES];
[projectDict setObject:[path lastPathComponent] forKey:PCAppIcon];
[appImageField setStringValue:[path lastPathComponent]];
frame.size = [image size];
[appIconView setFrame:frame];
[appIconView setImage:image];
[appIconView display];
RELEASE(image);
return YES;
}
@end

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];
}

33
PCBaseFileTypes/ChangeLog Normal file
View file

@ -0,0 +1,33 @@
2000-10-29 13:00 robert
* protocol.template: updated textfiles and new version coming
soon...
2000-10-20 17:18 robert
* GNUmakefile, PCBaseFileType.m, protocol.template: Support for
protocols in file creation
2000-09-20 17:51 robert
* ChangeLog: Added a changelog
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;
if (!_creator) {
NSDictionary *classDict;
NSDictionary *headerDict;
NSDictionary *ccDict;
NSDictionary *chDict;
NSDictionary *protocolDict;
_creator = [[[self class] alloc] init];
_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];
// 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,nil];
}
return _creator;
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;
NSFileManager *fm = [NSFileManager defaultManager];
NSString *_file;
NSString *newFile = nil;
NSMutableDictionary *files;
// A class and possibly a header
files = [NSMutableDictionary dictionaryWithCapacity:2];
// A class and possibly a header
files = [NSMutableDictionary dictionaryWithCapacity:2];
NSLog(@"<%@ %x>: create %@ at %@",[self class],self,type,path);
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];
[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];
// 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: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];
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];
[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];
// 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];
}
[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: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];
}
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];
}
/*
* Notify the browser!
*/
/*
*
*/
[[NSNotificationCenter defaultCenter] postNotificationName:@"ProjectDictDidChangeNotification" object:self];
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];
}
return files;
/*
* Notify the browser!
*/
[[NSNotificationCenter defaultCenter] postNotificationName:@"ProjectDictDidChangeNotification" object:self];
return files;
}
- (void)replaceTagsInFileAtPath:(NSString *)newFile withProject:(PCProject *)aProject type:(NSString *)aType
@ -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

8
PCBundleProj/ChangeLog Normal file
View file

@ -0,0 +1,8 @@
2000-11-04 14:22 robert
* GNUmakefile, GNUmakefile.postamble, GNUmakefile.preamble,
Info.table, PC.proj, PCBundleMakefileFactory.h,
PCBundleMakefileFactory.m, PCBundleProj.h, PCBundleProj.m,
PCBundleProject.h, PCBundleProject.m: the new bundle project type -
probably not 100% correct but working

50
PCBundleProj/GNUmakefile Normal file
View file

@ -0,0 +1,50 @@
# GNUmakefile
#
# Copyright (C) 2000 Philippe C.D. Robert
#
# Author: Philippe C.D. Robert <phr@projectcenter.ch>
# Date: 2000
#
# This file is part of ProjectCenter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include $(GNUSTEP_MAKEFILES)/common.make
BUNDLE_NAME = PCBundleProj
BUNDLE_EXTENSION =.bundle
BUNDLE_INSTALL_DIR =$(GNUSTEP_LOCAL_ROOT)/Library/ProjectCenter/
PCBundleProj_OBJC_FILES = \
PCBundleProj.m \
PCBundleMakefileFactory.m \
PCBundleProject.m
PCBundleProj_HEADERS= \
PCBundleMakefileFactory.h \
PCBundleProj.h \
PCBundleProject.h
PCBundleProj_PRINCIPAL_CLASS = PCBundleProj
PCBundleProj_RESOURCE_FILES = \
PC.proj
-include GNUmakefile.preamble
include $(GNUSTEP_MAKEFILES)/bundle.make
-include GNUmakefile.postamble

View file

@ -0,0 +1,30 @@
#
# Makefile.postamble
#
# Copyright (C) 1997 Free Software Foundation, Inc.
#
# Original Author: Scott Christley <scottc@net-community.com>
#
# This file is part of the GNUstep ProjectCenter.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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.
#
# If you are interested in a warranty or support for this source code,
# contact Scott Christley at scottc@net-community.com
#
# You should have received a copy of the GNU Library General Public
# License along with this library; see the file COPYING.LIB.
# If not, write to the Free Software Foundation,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

View file

@ -0,0 +1,74 @@
#
# Makefile.preamble
#
# Copyright (C) 1997 Free Software Foundation, Inc.
#
# Original Author: Scott Christley <scottc@net-community.com>
#
# This file is part of the GNUstep ProjectCenter.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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.
#
# If you are interested in a warranty or support for this source code,
# contact Scott Christley at scottc@net-community.com
#
# You should have received a copy of the GNU Library General Public
# License along with this library; see the file COPYING.LIB.
# If not, write to the Free Software Foundation,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Makefile.preamble
#
# Project specific makefile variables, and additional
#
# Do not put any Makefile rules in this file, instead they should
# be put into Makefile.postamble.
#
#
# Flags dealing with compiling and linking
#
# Additional flags to pass to the preprocessor
ADDITIONAL_CPPFLAGS +=
# Additional flags to pass to the Objective-C compiler
ADDITIONAL_OBJCFLAGS +=
# Additional flags to pass to the C compiler
ADDITIONAL_CFLAGS +=
#ADDITIONAL_CFLAGS +=
# Additional include directories the compiler should search
ADDITIONAL_INCLUDE_DIRS +=
# Additional LDFLAGS to pass to the linker
ADDITIONAL_LDFLAGS += -lProjectCenter
# Additional library directories the linker should search
ADDITIONAL_LIB_DIRS +=
ADDITIONAL_TOOL_LIBS +=
#
# Flags dealing with installing and uninstalling
#
# Additional directories to be created during installation
ADDITIONAL_INSTALL_DIRS +=
#
# Local configuration
#

29
PCBundleProj/Info.table Normal file
View file

@ -0,0 +1,29 @@
{
AdditionalAttributes = {
PrincipalClass = {ATTR_CLASS_NAME = "NSString";};
};
Allowable_SubprojectTypes = (Subproject, Bundle, Tool, Framework, Library, Palette);
AttributesInspector = ApplicationInspector;
DefaultExtension = "";
Default_Localizable_Keys = (INTERFACES);
GeneratedFiles = (Makefile, iconHeader);
INSTALLFLAGS = "-c -s -m 755";
InfoName = "";
Localizable_Keys = (INTERFACES, IMAGES, OTHER_RESOURCES, HELP_RESOURCES);
MAKEFILE = app.make;
MAKEFILEDIR = "$(MAKEFILEPATH)/pb_makefiles";
Other_Keys = (HELP_RESOURCES, OTHER_SOURCES, FRAMEWORKS, OTHER_LIBS);
PBProjectTypeSubClass = "PBApplicationProjectType";
ProvidesIcons = Yes;
Public_Keys = (H_FILES);
Resource_Keys = (INTERFACES, IMAGES, OTHER_RESOURCES);
SOURCEMODE = 444;
Source_Keys = (CLASSES, H_FILES, OTHER_LINKED);
Subproj_Keys = (SUBPROJECTS);
Targets = (app, debug, profile, install);
ExecutableResults = (
"$PROJECTNAME$.app/$PROJECTNAME$$EXECUTABLE_EXT$",
"$PROJECTNAME$.debug/$PROJECTNAME$$EXECUTABLE_EXT$",
"$PROJECTNAME$.profile/$PROJECTNAME$$EXECUTABLE_EXT$"
);
}

34
PCBundleProj/PC.proj Normal file
View file

@ -0,0 +1,34 @@
{
APPCLASS = "NSApplication";
APPKIT = "GNUSTEP-GUI";
APPLICATIONICON = "";
BUILDTOOL = "gnumake";
CLASS_FILES = ();
COMPILEROPTIONS = "";
CREATION_DATE = "";
DOCU_FILES = ();
FOUNDATION = "GNUSTEP-BASE";
FRAMEWORKS = ();
HEADER_FILES = ();
INTERFACES = ();
IMAGES = ();
LANGUAGE = "English";
LAST_EDITING = "";
LIBRARIES = ("gnustep-base");
MAININTERFACE = "";
MAKEFILEDIR = "/usr/GNUstep/System/Makefiles";
INSTALLDIR = "$(HOME)/Apps";
OTHER_FILES = ();
OTHER_RESOURCES = ();
OTHER_SOURCES = ();
PRINCIPAL_CLASS = "";
PROJECT_CREATOR = "";
PROJECT_DESCRIPTION = "No description avaliable!";
PROJECT_MAINTAINER = "";
PROJECT_NAME = "";
PROJECT_TYPE = "Bundle";
PROJECT_BUILDER = "PCBundleProj";
PROJECT_VERSION = 1.0;
SUBPROJECTS = ();
SUPPORTING_FILES = ("GNUmakefile.preamble", "GNUmakefile", "GNUmakefile.postamble");
}

View file

@ -0,0 +1,38 @@
/*
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 <Foundation/Foundation.h>
#import <ProjectCenter/PCProject.h>
@interface PCBundleMakefileFactory : NSObject
{
}
+ (PCBundleMakefileFactory *)sharedFactory;
- (NSData *)makefileForProject:(PCProject *)aProject;
@end

View file

@ -0,0 +1,161 @@
/*
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 "PCBundleMakefileFactory.h"
@implementation PCBundleMakefileFactory
static PCBundleMakefileFactory *_factory = nil;
+ (PCBundleMakefileFactory *)sharedFactory
{
if (!_factory) {
_factory = [[[self class] alloc] init];
}
return _factory;
}
- (NSData *)makefileForProject:(PCProject *)aProject;
{
NSMutableString *string = [NSMutableString string];
NSString *prName = [aProject projectName];
NSDictionary *prDict = [aProject projectDict];
NSString *tmp;
NSEnumerator *enumerator;
int i;
NSString *installDir = [NSString stringWithString:@"$(GNUSTEP_LOCAL_ROOT)/Library/Bundles"];
// Header information
[string appendString:@"#\n"];
[string appendString:@"# GNUmakefile - Generated by the ProjectCenter\n"];
[string appendString:@"# Written by Philippe C.D. Robert <phr@projectcenter.ch>\n"];
[string appendString:@"#\n"];
[string appendString:@"# NOTE: Do NOT change this file -- ProjectCenter maintains it!\n"];
[string appendString:@"#\n"];
[string appendString:@"# Put all of your customisations in GNUmakefile.preamble and\n"];
[string appendString:@"# GNUmakefile.postamble\n"];
[string appendString:@"#\n\n"];
// The 'real' thing
[string appendString:@"include $(GNUSTEP_MAKEFILES)/common.make\n"];
[string appendString:@"#\n\n"];
[string appendString:@"# Subprojects\n"];
[string appendString:@"#\n\n"];
if ([[aProject subprojects] count]) {
enumerator = [[prDict objectForKey:PCSubprojects] objectEnumerator];
while (tmp = [enumerator nextObject]) {
[string appendString:[NSString stringWithFormat:@"\\\n%@ ",tmp]];
}
}
[string appendString:@"#\n"];
[string appendString:@"# Bundle\n"];
[string appendString:@"#\n\n"];
[string appendString:[NSString stringWithFormat:@"BUNDLE_NAME=%@\n",prName]];
[string appendString:[NSString stringWithFormat:@"BUNDLE_EXTENSION=.bundle\n"]];
[string appendString:[NSString stringWithFormat:@"BUNDLE_INSTALL_DIR=%@\n",installDir]];
if ([prDict objectForKey:PCPrincipalClass]) {
[string appendString:[NSString stringWithFormat:@"%@_PRINCIPAL_CLASS=%@\n",prName,[prDict objectForKey:PCPrincipalClass]]];
}
[string appendString:@"#\n\n"];
[string appendString:@"# Additional libraries\n"];
[string appendString:@"#\n\n"];
[string appendString:[NSString stringWithFormat:@"%@_LIBRARIES_DEPEND_UPON += ",prName]];
if ([[prDict objectForKey:PCLibraries] count]) {
enumerator = [[prDict objectForKey:PCLibraries] objectEnumerator];
while (tmp = [enumerator nextObject]) {
if (![tmp isEqualToString:@"gnustep-base"] &&
![tmp isEqualToString:@"gnustep-gui"]) {
[string appendString:[NSString stringWithFormat:@"-l%@ ",tmp]];
}
}
}
[string appendString:@"\n\n#\n\n"];
[string appendString:@"# Resource files\n"];
[string appendString:@"#\n\n"];
[string appendString:[NSString stringWithFormat:@"%@_RESOURCE_FILES= ",prName]];
for (i=0;i<[[aProject resourceFileKeys] count];i++) {
NSString *k = [[aProject resourceFileKeys] objectAtIndex:i];
enumerator = [[prDict objectForKey:k] objectEnumerator];
while (tmp = [enumerator nextObject]) {
[string appendString:[NSString stringWithFormat:@"\\\n%@ ",tmp]];
}
}
[string appendString:@"\n\n#\n\n"];
[string appendString:@"# Header files\n"];
[string appendString:@"#\n\n"];
[string appendString:[NSString stringWithFormat:@"%@_HEADERS= ",prName]];
enumerator = [[prDict objectForKey:PCHeaders] objectEnumerator];
while (tmp = [enumerator nextObject]) {
[string appendString:[NSString stringWithFormat:@"\\\n%@ ",tmp]];
}
[string appendString:@"\n\n#\n\n"];
[string appendString:@"# Class files\n"];
[string appendString:@"#\n\n"];
[string appendString:[NSString stringWithFormat:@"%@_OBJC_FILES= ",prName]];
enumerator = [[prDict objectForKey:PCClasses] objectEnumerator];
while (tmp = [enumerator nextObject]) {
[string appendString:[NSString stringWithFormat:@"\\\n%@ ",tmp]];
}
[string appendString:@"\n\n#\n\n"];
[string appendString:@"# C files\n"];
[string appendString:@"#\n\n"];
[string appendString:[NSString stringWithFormat:@"%@_C_FILES= ",prName]];
enumerator = [[prDict objectForKey:PCOtherSources] objectEnumerator];
while (tmp = [enumerator nextObject]) {
[string appendString:[NSString stringWithFormat:@"\\\n%@ ",tmp]];
}
[string appendString:@"\n\n"];
[string appendString:@"-include GNUmakefile.preamble\n"];
[string appendString:@"-include GNUmakefile.local\n"];
[string appendString:@"include $(GNUSTEP_MAKEFILES)/bundle.make\n"];
[string appendString:@"-include GNUmakefile.postamble\n"];
return [string dataUsingEncoding:[NSString defaultCStringEncoding]];
}
@end

View file

@ -0,0 +1,49 @@
/*
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 <ProjectCenter/ProjectCenter.h>
@interface PCBundleProj : NSObject <ProjectType>
{
}
//----------------------------------------------------------------------------
// ProjectType
//----------------------------------------------------------------------------
+ (id)sharedCreator;
- (Class)projectClass;
- (NSString *)projectTypeName;
- (NSDictionary *)typeTable;
- (PCProject *)createProjectAt:(NSString *)path;
- (PCProject *)openProjectAt:(NSString *)path;
@end

145
PCBundleProj/PCBundleProj.m Normal file
View file

@ -0,0 +1,145 @@
/*
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$
*/
/*
Description:
PCBundleProj creates new project of the type Application!
*/
#import "PCBundleProj.h"
#import "PCBundleProject.h"
@implementation PCBundleProj
static NSString *_projTypeName = @"Bundle";
static PCBundleProj *_creator = nil;
//----------------------------------------------------------------------------
// ProjectType
//----------------------------------------------------------------------------
+ (id)sharedCreator
{
if (!_creator) {
_creator = [[[self class] alloc] init];
}
return _creator;
}
- (Class)projectClass
{
return [PCBundleProject class];
}
- (NSString *)projectTypeName
{
return _projTypeName;
}
- (NSDictionary *)typeTable
{
NSString *_path = [[NSBundle bundleForClass:[self class]]
pathForResource:@"Info" ofType:@"table"];
return [NSDictionary dictionaryWithContentsOfFile:_path];
}
- (PCProject *)createProjectAt:(NSString *)path
{
PCBundleProject *project = nil;
NSFileManager *fm = [NSFileManager defaultManager];
NSAssert(path,@"No valid project path provided!");
if ([fm createDirectoryAtPath:path attributes:nil]) {
NSString *_file;
NSString *_resourcePath;
NSMutableDictionary *dict;
project = [[[PCBundleProject alloc] init] autorelease];
_file = [[NSBundle bundleForClass:[self class]]
pathForResource:@"PC" ofType:@"proj"];
dict = [NSMutableDictionary dictionaryWithContentsOfFile:_file];
// Customise the project
[dict setObject:[path lastPathComponent] forKey:PCProjectName];
[dict setObject:[project principalClass] forKey:PCProjType];
// Save the project to disc
[dict writeToFile:[path stringByAppendingPathComponent:@"PC.project"]
atomically:YES];
/*
* 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];
_file = [[NSBundle bundleForClass:[self class]]
pathForResource:@"GNUmakefile" ofType:@"preamble"];
[fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"GNUmakefile.preamble"] handler:nil];
// Resources
_resourcePath = [path stringByAppendingPathComponent:@"English.lproj"];
[fm createDirectoryAtPath:_resourcePath attributes:nil];
[fm createDirectoryAtPath:[path stringByAppendingPathComponent:@"Images"] attributes:nil];
[fm createDirectoryAtPath:[path stringByAppendingPathComponent:@"Documentation"] attributes:nil];
// The path cannot be in the PC.project file!
[project setProjectPath:path];
// Set the new dictionary - this causes the GNUmakefile to be written
if(![project assignProjectDict:dict]) {
NSRunAlertPanel(@"Attention!",@"Could not load %@!",@"OK",nil,nil,path);
return nil;
}
}
return project;
}
- (PCProject *)openProjectAt:(NSString *)path
{
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path];
id obj;
#ifdef DEBUG
NSLog(@"<%@ %x>: opening project at %@",[self class],self,path);
#endif DEBUG
obj = [dict objectForKey:PCProjectBuilderClass];
if ([obj isEqualToString:@"PCBundleProj"]) {
return [[[PCBundleProject alloc] initWithProjectDictionary:dict path:[path stringByDeletingLastPathComponent]] autorelease];
}
return nil;
}
@end

View file

@ -0,0 +1,68 @@
/*
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$
*/
/*
Description:
This is the project type 'Application' for GNUstep. You never should create
it yourself but use PCBundleProj for doing this. Otherwise needed files don't
get copied to the right place.
*/
#import <AppKit/AppKit.h>
#import <ProjectCenter/PCProject.h>
@interface PCBundleProject : PCProject
{
NSTextField *principalClassField;
}
//----------------------------------------------------------------------------
// Init and free
//----------------------------------------------------------------------------
- (id)init;
- (void)dealloc;
//----------------------------------------------------------------------------
// Project
//----------------------------------------------------------------------------
- (BOOL)writeMakefile;
- (BOOL)isValidDictionary:(NSDictionary *)aDict;
- (NSArray *)sourceFileKeys;
- (NSArray *)resourceFileKeys;
- (NSArray *)otherKeys;
- (NSArray *)buildTargets;
- (NSString *)projectDescription;
- (void)updateValuesFromProjectDict;
@end

View file

@ -0,0 +1,170 @@
/*
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 "PCBundleProject.h"
#import "PCBundleMakefileFactory.h"
#import <ProjectCenter/ProjectCenter.h>
@interface PCBundleProject (CreateUI)
- (void)_initUI;
@end
@implementation PCBundleProject (CreateUI)
- (void)_initUI
{
NSTextField *textField;
NSRect frame = {{84,120}, {80, 80}};
NSBox *box;
[super _initUI];
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,240,88,21)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setEditable: NO];
[textField setBezeled: NO];
[textField setDrawsBackground: NO];
[textField setStringValue:@"Principal class:"];
[projectProjectInspectorView addSubview:[textField autorelease]];
principalClassField =[[NSTextField alloc] initWithFrame:NSMakeRect(106,240,144,21)];
[principalClassField setAlignment: NSLeftTextAlignment];
[principalClassField setBordered: YES];
[principalClassField setEditable: YES];
[principalClassField setBezeled: YES];
[principalClassField setDrawsBackground: YES];
[principalClassField setStringValue:@""];
[projectProjectInspectorView addSubview:principalClassField];
}
@end
@implementation PCBundleProject
//----------------------------------------------------------------------------
// Init and free
//----------------------------------------------------------------------------
- (id)init
{
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];
[self _initUI];
}
return self;
}
- (void)dealloc
{
[rootCategories release];
[principalClassField release];
[super dealloc];
}
//----------------------------------------------------------------------------
// Project
//----------------------------------------------------------------------------
- (BOOL)writeMakefile
{
NSFileManager *fm = [NSFileManager defaultManager];
NSString *makefile = [projectPath stringByAppendingPathComponent:@"GNUmakefile"];
NSData *content;
if (![super writeMakefile]) {
NSLog(@"Couldn't update PC.project...");
}
if (![fm movePath:makefile toPath:[projectPath stringByAppendingPathComponent:@"GNUmakefile~"] handler:nil]) {
NSLog(@"Couldn't write a backup GNUmakefile...");
}
if (!(content = [[PCBundleMakefileFactory sharedFactory] makefileForProject:self])) {
NSLog([NSString stringWithFormat:@"Couldn't build the GNUmakefile %@!",makefile]);
return NO;
}
if (![content writeToFile:makefile atomically:YES]) {
NSLog([NSString stringWithFormat:@"Couldn't write the GNUmakefile %@!",makefile]);
return NO;
}
return YES;
}
- (BOOL)isValidDictionary:(NSDictionary *)aDict
{
#warning No project check implemented, yet!
return YES;
}
- (NSArray *)sourceFileKeys
{
return [NSArray arrayWithObjects:PCClasses,PCOtherSources,nil];
}
- (NSArray *)resourceFileKeys
{
return [NSArray arrayWithObjects:PCGModels,PCOtherResources,PCImages,nil];
}
- (NSArray *)otherKeys
{
return [NSArray arrayWithObjects:PCDocuFiles,PCSupportingFiles,nil];
}
- (NSArray *)buildTargets
{
}
- (NSString *)projectDescription
{
return @"GNUstep Objective-C bundle project";
}
- (void)updateValuesFromProjectDict
{
[super updateValuesFromProjectDict];
[principalClassField setStringValue:[projectDict objectForKey:PCPrincipalClass]];
}
@end

161
PCLib/ChangeLog Normal file
View file

@ -0,0 +1,161 @@
2000-11-04 17:47 robert
* PCBundleLoader.m: the bundle path is now depending on the env
variable
2000-11-04 14:20 robert
* PCProject.h, PCProject.m: projects are by default not executable
2000-11-02 11:21 robert
* PCProject.m, PCProjectBuilder.m: 2 lines of information when
launching...
2000-11-01 11:38 robert
* PCBrowserController.m, PCProject.m: removed logs
2000-10-29 21:17 robert
* PCProjectDebugger.h, PCProjectDebugger.m: added the class which
will one day become a simple gdb frontend
2000-10-29 21:15 robert
* GNUmakefile, PCBrowserController.m, PCProject.h, PCProject.m,
PCProjectBuilder.h, PCProjectBuilder.m, ProjectCenter.h: new style
interface - simpler but hopefully more usable
2000-10-29 13:00 robert
* PCBundleLoader.m, PCProject.m, PCProjectBuilder.h,
PCProjectBuilder.m, PCServer.h, PCServer.m: build logging now
works, as well as some enhancements when using the internal
'editor'
2000-10-27 19:15 robert
* PCProject.h, PCProject.m: removed the 2 popups, which are not
needed on the top right side
2000-10-26 11:12 robert
* PCProject.m: more image files are allowed now
2000-10-20 20:13 robert
* PCProject.h, PCProjectBuilder.m: new build images in the build
panel
2000-10-20 17:18 robert
* PCEditorView.m, PCProject.m: Support for protocols in file
creation
2000-10-15 20:24 robert
* PCBrowserController.m, PCProject.h, PCProject.m,
PCProjectBuilder.m, PCProjectManager.m: More UI enhancements - not
really functional yet
2000-10-15 14:27 robert
* PCBrowserController.m, PCProject.m, PCProjectBuilder.h,
PCProjectBuilder.m, PCProjectManager.m: typo and note about GNUstep
version added
2000-09-22 19:11 robert
* PCProject.h, PCProject.m: minor UI changes
2000-09-22 12:33 robert
* PCBrowserController.m, PCProject.h, PCProject.m,
PCProjectBuilder.h, PCProjectBuilder.m: some UI modifications
2000-09-21 09:36 robert
* PCBundleLoader.m: bundle path issues
2000-09-21 07:42 robert
* PCProjectManager.h, PCProjectManager.m: daily work
2000-09-21 07:20 robert
* PCFileManager.m: daily work
2000-09-21 07:16 robert
* PCEditorView.m: @end is now highlighted, too
2000-09-20 17:50 robert
* ChangeLog: Added a changelog
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,26 +46,30 @@ FILE_AUTHORS = \
# The source files
libPC_MFILES = \
libProjectCenter_MFILES = \
PCBrowserController.m \
PCBundleLoader.m \
PCDataSource.m \
PCEditorView.m \
PCFileManager.m \
PCProject.m \
PCProjectBuilder.m \
PCProjectDebugger.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 \
PCProjectDebugger.h \
PCProjectManager.h \
PCServer.h \
PreferenceController.h \
@ -76,18 +80,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,49 @@
#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];
if ([ctitle isEqualToString:@"Classes"]) {
[pTextView setString:text];
}
NSString *ctitlef = [[project projectPath] stringByAppendingPathComponent:ltitle];
[project browserDidSelectFileNamed:ltitle];
}
}
- (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 ([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];
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"];
}
[[NSNotificationCenter defaultCenter] postNotificationName:FileShouldOpenNotification object:self userInfo:ui];
}
else {
}
*/
}
else {
[[PCFileManager fileManager] showAddFileWindow];
}
}
- (void)projectDictDidChange:(NSNotification *)aNotif
@ -101,14 +90,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,7 +128,9 @@
int count = [files count];
if (count == 0) {
NSLog(@"<%@ %x>: create rows for column aborted - 0 files!",[self class],self);
#ifdef DEBUG
NSLog(@"<%@ %x>: create rows for column in %@ (%x) aborted - 0 files!",[self class],self,[project class],project);
#endif
return;
}

View file

@ -101,13 +101,30 @@
NSArray *dir;
NSString *path = [[NSUserDefaults standardUserDefaults] objectForKey:BundlePaths];
if (!path || path == @"" || ![[NSFileManager defaultManager] fileExistsAtPath:path]) {
if (!path || [path isEqualToString:@""]) {
NSDictionary *env = [[NSProcessInfo processInfo] environment];
NSString *prefix = [env objectForKey:@"GNUSTEP_LOCAL_ROOT"];
if (prefix && ![prefix isEqualToString:@""]) {
path =[prefix stringByAppendingPathComponent:@"Library/ProjectCenter"];
}
else {
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"];
key = [project selectedRootCategory];
title = [[[project rootCategories] allKeysForObject:key] objectAtIndex:0];
title = [NSString stringWithFormat:@"Add to %@...",title];
[addFileTypePopup removeAllItems];
[addFileTypePopup addItemsWithTitles:validTypes];
types = [project fileExtensionsForCategory:key];
openPanel = [NSOpenPanel openPanel];
[openPanel setAllowsMultipleSelection:YES];
[openPanel setCanChooseDirectories:NO];
[openPanel setCanChooseFiles:YES];
[openPanel setTitle:title];
[openPanel setTitle:@"Add File(s)..."];
[openPanel setAccessoryView:fileTypeAccessaryView];
retval = [openPanel runModalForDirectory:[[NSUserDefaults standardUserDefaults] objectForKey:@"LastOpenDirectory"] file:nil types:nil];
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];
}
}
}
@ -310,7 +328,9 @@
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) {
@ -345,7 +365,9 @@
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,16 +59,9 @@
typedef int PCProjInfoBits;
typedef enum {
defaultTarget = 0,
debug,
profile,
install
} btarget;
//===========================================================================================
//=============================================================================
// ==== Project keys
//===========================================================================================
//=============================================================================
static NSString * const PCClasses = @"CLASS_FILES";
static NSString * const PCHeaders = @"HEADER_FILES";
@ -72,56 +78,69 @@ static NSString * const PCProjectName = @"PROJECT_NAME";
static NSString * const PCProjType = @"PROJECT_TYPE";
static NSString * const PCPrincipalClass = @"PRINCIPAL_CLASS";
static NSString * const PCAppIcon = @"APPLICATIONICON";
static NSString * const PCAppClass = @"APPCLASS";
static NSString * const PCToolIcon = @"TOOLICON";
static NSString * const PCProjectBuilderClass = @"PROJECT_BUILDER";
static NSString * const PCMainGModelFile = @"MAININTERFACE";
static NSString * const PCPackageName = @"PACKAGE_NAME";
static NSString * const PCLibraryVar = @"LIBRARY_VAR";
@class PCProjectBuilder;
@class PCProjectDebugger;
@interface PCProject : NSObject
{
id projectWindow;
id delegate;
id projectBuilder;
id projectManager;
id browserController;
id textView;
PCProjectBuilder *projectBuilder;
PCProjectDebugger *projectDebugger;
NSBox *box;
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 buildStatusField;
id targetField;
id buildTargetHostField;
id buildTargetArgsField;
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;
}
//===========================================================================================
//=============================================================================
// ==== Init and free
//===========================================================================================
//=============================================================================
- (id)init;
- (id)initWithProjectDictionary:(NSDictionary *)dict path:(NSString *)path;
- (void)dealloc;
//===========================================================================================
//=============================================================================
// ==== Accessor methods
//===========================================================================================
//=============================================================================
- (id)browserController;
- (NSString *)selectedRootCategory;
- (NSArray *)fileExtensionsForCategory:(NSString *)key;
- (void)setProjectName:(NSString *)aName;
- (NSString *)projectName;
@ -129,9 +148,9 @@ static NSString * const PCLibraryVar = @"LIBRARY_VAR";
- (Class)principalClass;
//===========================================================================================
//=============================================================================
// ==== Delegate and manager
//===========================================================================================
//=============================================================================
- (id)delegate;
- (void)setDelegate:(id)aDelegate;
@ -139,9 +158,9 @@ static NSString * const PCLibraryVar = @"LIBRARY_VAR";
- (void)setProjectBuilder:(id<ProjectBuilder>)aBuilder;
- (id<ProjectBuilder>)projectBuilder;
//===========================================================================================
//=============================================================================
// ==== To be overriden!
//===========================================================================================
//=============================================================================
- (BOOL)writeMakefile;
// Writes the PC.project file to disc. Subclasses need to call this before doing sth else!
@ -156,18 +175,24 @@ static NSString * const PCLibraryVar = @"LIBRARY_VAR";
- (NSString *)projectDescription;
// Returns a string describing the project type
- (id)textView;
- (BOOL)isExecutable;
// Returns NO by default.
//===========================================================================================
// ==== Miscellaneous
//===========================================================================================
//=============================================================================
// ==== File Handling
//=============================================================================
- (void)browserDidSelectFileNamed:(NSString *)fileName;
- (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)addFile:(NSString *)file forKey:(NSString *)key copy:(BOOL)yn;
- (void)removeFile:(NSString *)file forKey:(NSString *)key;
- (BOOL)removeSelectedFilePermanently:(BOOL)yn;
- (void)renameFile:(NSString *)aFile;
- (BOOL)assignProjectDict:(NSDictionary *)aDict;
- (NSDictionary *)projectDict;
@ -185,6 +210,10 @@ static NSString * const PCLibraryVar = @"LIBRARY_VAR";
- (BOOL)saveAllFilesIfNeeded;
// Saves all the files that need to be saved.
//=============================================================================
// ==== Subprojects
//=============================================================================
- (NSArray *)subprojects;
- (void)addSubproject:(PCProject *)aSubproject;
- (PCProject *)superProject;
@ -194,22 +223,31 @@ static NSString * const PCLibraryVar = @"LIBRARY_VAR";
- (BOOL)isSubProject;
//=============================================================================
// ==== Project Handling
//=============================================================================
- (void)updateValuesFromProjectDict;
@end
@interface PCProject (ProjectBuilding)
- (void)topButtonsPressed:(id)sender;
- (void)showBuildView:(id)sender;
- (void)showRunView:(id)sender;
- (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

File diff suppressed because it is too large Load diff

View file

@ -24,37 +24,51 @@
$Id$
*/
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
@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;
@interface PCProjectBuilder : NSObject
{
NSWindow *buildWindow;
NSBox *componentView;
NSTextView *logOutput;
NSTextView *errorOutput;
NSMutableDictionary *buildTasks;
NSString *makePath;
id buildStatusField;
id targetField;
PCProject *currentProject;
NSDictionary *currentOptions;
NSFileHandle *readHandle;
NSFileHandle *errorReadHandle;
}
+ (id)sharedBuilder;
- (id)init;
- (id)initWithProject:(PCProject *)aProject;
- (void)dealloc;
- (BOOL)buildProject:(PCProject *)aProject options:(NSDictionary *)optionDict;
- (NSView *)componentView;
- (void)build:(id)sender;
- (void)logStdOut:(NSNotification *)aNotif;
- (void)logErrOut:(NSNotification *)aNotif;
- (void)buildDidTerminate:(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,57 +26,59 @@
#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;
- (void)_createComponentView;
@end
@implementation PCProjectBuilder (CreateUI)
- (void)_initUI
- (void)_createComponentView
{
NSView *_c_view;
unsigned int style = NSTitledWindowMask | NSClosableWindowMask |
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;
componentView = [[NSBox alloc] initWithFrame:NSMakeRect(0,0,544,248)];
[componentView setTitlePosition:NSNoTitle];
[componentView setBorderType:NSNoBorder];
[componentView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
/*
* Build Window
*
*/
_w_frame = NSMakeRect(100,100,512,320);
buildWindow = [[NSWindow alloc] initWithContentRect:_w_frame
styleMask:style
backing:NSBackingStoreBuffered
defer:NO];
[buildWindow setDelegate:self];
[buildWindow setReleasedWhenClosed:NO];
[buildWindow setMinSize:NSMakeSize(512,320)];
logOutput = [[NSTextView alloc] initWithFrame:NSMakeRect(0,0,472,88)];
logOutput = [[NSTextView alloc] initWithFrame:NSMakeRect(0,0,516,32)];
[logOutput setMaxSize:NSMakeSize(1e7, 1e7)];
[logOutput setVerticallyResizable:YES];
[logOutput setHorizontallyResizable:YES];
[logOutput setMinSize:NSMakeSize(516, 48)];
[logOutput setRichText:NO];
[logOutput setEditable:NO];
[logOutput setSelectable:YES];
[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 = [[NSScrollView alloc] initWithFrame:NSMakeRect (0,0,540,46)];
[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,143 +88,359 @@
*
*/
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,516,80)];
[errorOutput setMaxSize:NSMakeSize(1e7, 1e7)];
[errorOutput setMinSize:NSMakeSize(516, 48)];
[errorOutput setRichText:NO];
[errorOutput setEditable:NO];
[errorOutput setSelectable:YES];
[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 = [[NSScrollView alloc] initWithFrame:NSMakeRect (0,0,540,92)];
[scrollView2 setDocumentView:errorOutput];
[[errorOutput textContainer] setContainerSize:NSMakeSize([scrollView2 contentSize].width,1e7)];
[scrollView2 setHasHorizontalScroller:NO];
[scrollView2 setHasVerticalScroller:YES];
[scrollView2 setBorderType: NSBezelBorder];
[scrollView2 setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
[scrollView2 autorelease];
split = [[[NSSplitView alloc] initWithFrame:NSMakeRect(8,0,496,264)] autorelease];
split = [[NSSplitView alloc] initWithFrame:NSMakeRect(0,0,540,188)];
[split setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)];
[split addSubview: scrollView1];
[split addSubview: scrollView2];
[split adjustSubviews];
_c_view = [buildWindow contentView];
[_c_view addSubview:split];
[componentView addSubview:split];
[split autorelease];
/*
* 5 build Buttons
*/
_w_frame = NSMakeRect(0,194,224,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:)];
[componentView addSubview:matrix];
button = [matrix cellAtRow:0 column:0];
[button setTag:0];
[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:NSImageOnly];
[button setImage:IMAGE(@"ProjectCenter_clean")];
[button setButtonType:NSMomentaryPushButton];
[button setTitle:@"Clean"];
button = [matrix cellAtRow:0 column:2];
[button setTag:2];
[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:NSImageOnly];
[button setImage:IMAGE(@"ProjectCenter_profile")];
[button setButtonType:NSMomentaryPushButton];
[button setTitle:@"Profile"];
button = [matrix cellAtRow:0 column:4];
[button setTag:4];
[button setImagePosition:NSImageOnly];
[button setImage:IMAGE(@"ProjectCenter_install")];
[button setButtonType:NSMomentaryPushButton];
[button setTitle:@"Install"];
/*
* Status
*/
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(256,220,48,15)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setEditable: NO];
[textField setBezeled: NO];
[textField setDrawsBackground: NO];
[textField setStringValue:@"Status:"];
[textField setAutoresizingMask: (NSViewMaxXMargin |
NSViewMinYMargin)];
[componentView addSubview:[textField autorelease]];
/*
* Status message
*/
buildStatusField = [[NSTextField alloc] initWithFrame:NSMakeRect(308,220,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)];
[componentView addSubview:[buildStatusField autorelease]];
/*
* Target
*/
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(256,196,48,15)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setBezeled: NO];
[textField setEditable: NO];
[textField setDrawsBackground: NO];
[textField setStringValue:@"Target:"];
[textField setAutoresizingMask: (NSViewMaxXMargin |
NSViewMinYMargin)];
[componentView addSubview:[textField autorelease]];
/*
* Target message
*/
targetField = [[NSTextField alloc] initWithFrame:NSMakeRect(308,196,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)];
[componentView addSubview:[targetField autorelease]];
}
@end
@implementation PCProjectBuilder
static PCProjectBuilder *_builder;
+ (id)sharedBuilder
- (id)initWithProject:(PCProject *)aProject
{
if (!_builder) {
_builder = [[PCProjectBuilder alloc] init];
}
return _builder;
}
NSAssert(aProject,@"No project specified!");
- (id)init
{
if ((self = [super init])) {
[self _initUI];
makePath = [[NSString stringWithString:@"/usr/bin/make"] retain];
buildTasks = [[NSMutableDictionary dictionary] retain];
currentProject = aProject;
}
return self;
}
- (void)dealloc
{
[buildWindow release];
[componentView release];
[makePath release];
[buildTasks release];
[super dealloc];
}
- (BOOL)buildProject:(PCProject *)aProject options:(NSDictionary *)optionDict
- (NSView *)componentView;
{
if (!componentView) {
[self _createComponentView];
}
return componentView;
}
- (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;
logPipe = [NSPipe pipe];
readHandle = [logPipe fileHandleForReading];
readHandle = [[logPipe fileHandleForReading] retain];
NSAssert(aProject,@"No project provided!");
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;
}
return ret;
[buildStatusField setStringValue:status];
[targetField setStringValue:target];
[NOTIFICATION_CENTER addObserver:self
selector:@selector(logStdOut:)
name:NSFileHandleDataAvailableNotification
object:readHandle];
[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];
}
}
@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

44
PCLib/PCProjectDebugger.h Normal file
View file

@ -0,0 +1,44 @@
/*
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>
@class PCProject;
@interface PCProjectDebugger : NSObject
{
NSBox *componentView;
PCProject *currentProject;
NSDictionary *currentOptions;
}
- (id)initWithProject:(PCProject *)aProject;
- (void)dealloc;
- (NSView *)componentView;
@end

147
PCLib/PCProjectDebugger.m Normal file
View file

@ -0,0 +1,147 @@
/*
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 "PCProjectDebugger.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 PCProjectDebugger (CreateUI)
- (void)_createComponentView;
@end
@implementation PCProjectDebugger (CreateUI)
- (void)_createComponentView
{
NSSplitView *split;
NSScrollView *scrollView1;
NSScrollView *scrollView2;
NSMatrix* matrix;
NSRect _w_frame;
NSButtonCell* buttonCell = [[[NSButtonCell alloc] init] autorelease];
id button;
id textField;
componentView = [[NSBox alloc] initWithFrame:NSMakeRect(0,0,544,248)];
[componentView setTitlePosition:NSNoTitle];
[componentView setBorderType:NSNoBorder];
[componentView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
/*
*/
_w_frame = NSMakeRect(0,194,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:)];
[componentView addSubview:matrix];
button = [matrix cellAtRow:0 column:0];
[button setTag:0];
[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:NSImageOnly];
//[button setImage:IMAGE(@"ProjectCenter_clean")];
[button setButtonType:NSMomentaryPushButton];
[button setTitle:@"Clean"];
button = [matrix cellAtRow:0 column:2];
[button setTag:2];
[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:NSImageOnly];
//[button setImage:IMAGE(@"ProjectCenter_profile")];
[button setButtonType:NSMomentaryPushButton];
[button setTitle:@"Profile"];
button = [matrix cellAtRow:0 column:4];
[button setTag:4];
[button setImagePosition:NSImageOnly];
//[button setImage:IMAGE(@"ProjectCenter_install")];
[button setButtonType:NSMomentaryPushButton];
[button setTitle:@"Install"];
}
@end
@implementation PCProjectDebugger
- (id)initWithProject:(PCProject *)aProject
{
NSAssert(aProject,@"No project specified!");
if ((self = [super init])) {
currentProject = aProject;
}
return self;
}
- (void)dealloc
{
[componentView release];
[super dealloc];
}
- (NSView *)componentView;
{
if (!componentView) {
[self _createComponentView];
}
return componentView;
}
@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];
}
[[NSNotificationCenter defaultCenter] postNotificationName:ActiveProjectDidChangeNotification object:activeProject];
if ([inspector isVisible]) {
[self inspectorPopupDidChange:inspectorPopup];
}
//~ 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;
NSView *view = nil;
if (![self activeProject]) {
return;
}
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];
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"];
PCProject *currentProject;
NSString *key = [[aProject projectPath] stringByAppendingPathComponent:@"PC.project"];
currentProject = [[loadedProjects objectForKey:key] retain];
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];
[currentProject autorelease];
//~ Should I activate another project here?!
//~ 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
@ -425,7 +430,10 @@
- (void)fileManager:(id)sender didCreateFile:(NSString *)aFile withKey:(NSString *)key
{
#ifdef DEBUG
NSLog(@"<%@ %x>: did create file %@ for key %@",[self class],self,aFile,key);
#endif DEBUG
[activeProject addFile:aFile forKey:key];
}
@ -438,7 +446,9 @@
{
NSMutableString *fn = [NSMutableString stringWithString:[file lastPathComponent]];
#ifdef DEBUG
NSLog(@"<%@ %x>: should add file %@ for key %@",[self class],self,file,key);
#endif DEBUG
if ([key isEqualToString:PCLibraries]) {
[fn deleteCharactersInRange:NSMakeRange(1,3)];
@ -454,9 +464,14 @@
- (void)fileManager:(id)sender didAddFile:(NSString *)file forKey:(NSString *)key
{
#ifdef DEBUG
NSLog(@"<%@ %x>: did add file %@ for key %@",[self class],self,file,key);
#endif DEBUG
[activeProject addFile:file forKey:key];
}
@end

View file

@ -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"
@ -59,6 +60,8 @@
#import "PCProjectManager.h"
#import "PCServer.h"
#import "PCProject.h"
#import "PCProjectBuilder.h"
#import "PCProjectDebugger.h"
#import "PCFileManager.h"
#import "PCBrowserController.h"
#import "ProjectDebugger.h"
@ -68,4 +71,8 @@
#import "PreferenceController.h"
#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;

48
PCLibProj/ChangeLog Normal file
View file

@ -0,0 +1,48 @@
2000-10-15 20:29 robert
* PCLibProject.m: some code improvements regarding the inspector
2000-09-24 15:37 robert
* PCLibProject.m: minor UI issue
2000-09-23 17:45 robert
* PCLibMakefileFactory.m: another issue...
2000-09-23 16:24 robert
* PCLibMakefileFactory.m, PCLibProject.m: Fixed some makefile
issues
2000-09-21 09:07 robert
* PCLibMakefileFactory.m, PCLibProj.m: removed the English.lproj
stuff in libs
2000-09-20 17:51 robert
* ChangeLog: Added a changelog
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

@ -37,8 +37,6 @@
@interface PCLibProject : PCProject
{
@private
BOOL _needsAdditionalReleasing;
}
//----------------------------------------------------------------------------
@ -62,4 +60,6 @@
- (NSArray *)buildTargets;
- (NSString *)projectDescription;
- (void)updateValuesFromProjectDict;
@end

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];
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];
_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;
[self _initUI];
}
return self;
}
- (void)dealloc
{
[rootCategories release];
[rootCategories release];
if (_needsAdditionalReleasing) {
[projectAttributeInspectorView release];
[projectProjectInspectorView release];
[projectFileInspectorView release];
}
[super dealloc];
[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]) {
@ -169,4 +138,11 @@
return @"Project that handles GNUstep/ObjC based libraries.";
}
- (void)updateValuesFromProjectDict
{
[super updateValuesFromProjectDict];
//[appClassField setStringValue:[projectDict objectForKey:PCAppClass]];
}
@end

36
PCToolProj/ChangeLog Normal file
View file

@ -0,0 +1,36 @@
2000-11-04 13:41 robert
* PCToolProject.h, PCToolProject.m: The project type is executable
2000-10-15 20:29 robert
* PCToolProject.m: some code improvements regarding the inspector
2000-10-11 15:15 robert
* PCToolProject.m: daily work
2000-09-22 11:24 robert
* PCToolMakefileFactory.m: Fix in the makefile generation section
2000-09-03 22:10 robert
* GNUmakefile.preamble: renamed libPC into libProjectCenter
2000-08-27 21:13 robert
* PCToolProj.h, PCToolProj.m, h.template, m.template, Info.table,
PCToolProject.m, GNUmakefile.postamble, GNUmakefile.preamble,
PCToolProject.h, main.m, PCToolMakefileFactory.m, GNUmakefile,
Info-project.plist, PC.proj, PCToolMakefileFactory.h: Initial
revision
2000-08-27 21:13 robert
* PCToolProj.h, PCToolProj.m, h.template, m.template, Info.table,
PCToolProject.m, GNUmakefile.postamble, GNUmakefile.preamble,
PCToolProject.h, main.m, PCToolMakefileFactory.m, GNUmakefile,
Info-project.plist, PC.proj, PCToolMakefileFactory.h: Initial
import

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

@ -38,8 +38,6 @@
@interface PCToolProject : PCProject
{
@private
BOOL _needsAdditionalReleasing;
}
//----------------------------------------------------------------------------
@ -63,5 +61,9 @@
- (NSArray *)buildTargets;
- (NSString *)projectDescription;
- (BOOL)isExecutable;
- (void)updateValuesFromProjectDict;
@end

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];
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;
[self _initUI];
}
return self;
}
- (void)dealloc
{
[rootCategories release];
[rootCategories release];
if (_needsAdditionalReleasing) {
[projectAttributeInspectorView release];
[projectProjectInspectorView release];
[projectFileInspectorView release];
}
[super dealloc];
[super dealloc];
}
//----------------------------------------------------------------------------
@ -176,4 +139,16 @@
return @"Project that handles GNUstep/ObjC based tools.";
}
- (BOOL)isExecutable
{
return YES;
}
- (void)updateValuesFromProjectDict
{
[super updateValuesFromProjectDict];
//[appClassField setStringValue:[projectDict objectForKey:PCAppClass]];
}
@end

142
ProjectCenter/ChangeLog Normal file
View file

@ -0,0 +1,142 @@
2000-11-04 18:11 robert
* PCPrefController.m: some interface changes
2000-11-04 17:48 robert
* PCAppController.m, PCPrefController.m: the bundle path is now
depending on the GNUSTEP_LOCAL_ROOT env variable
2000-10-29 13:16 robert
* Info-project.plist: some GWorkspace additions
2000-10-29 13:01 robert
* Info-project.plist: 0.2 coming soon
2000-10-20 20:20 robert
* Makefile, Makefile.postamble, Makefile.preamble, PB.project:
remove old PB support
2000-10-20 20:18 robert
* PC.project: updated project file
2000-10-20 20:13 robert
* GNUmakefile, ProjectCenter_clean.tiff, ProjectCenter_debug.tiff,
ProjectCenter_install.tiff, ProjectCenter_make.tiff,
ProjectCenter_profile.tiff: added build images
2000-10-20 17:18 robert
* PCAppController.m: Support for protocols in file creation
2000-10-15 20:23 robert
* PCAppController.h, PCAppController.m: modified launching
behaviour
2000-10-15 14:25 robert
* PCPrefController.m: UI improvement
2000-09-21 09:32 robert
* PCPrefController.m: bundle path issue now fixed, hopefully...
2000-09-21 07:42 robert
* PCAppController.m, PCPrefController.m: open file now works, too
2000-09-20 17:50 robert
* ChangeLog: Added a changelog
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;
PCPrefController *prefController;
PCFindController *finder;
PCInfoController *infoController;
PCLogController *logger;
PCProjectManager *projectManager;
PCFileManager *fileManager;
PCMenuController *menuController;
PCBundleLoader *bundleLoader;
PCServer *doServer;
NSConnection *doConnection;
PCBundleLoader *bundleLoader;
PCServer *doServer;
NSConnection *doConnection;
id delegate;
id delegate;
NSMutableDictionary *projectTypes;
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

View file

@ -38,12 +38,16 @@
+ (void)initialize
{
NSMutableDictionary *defaults = [NSMutableDictionary dictionary];
NSDictionary *env = [[NSProcessInfo processInfo] environment];
NSString *prefix = [env objectForKey:@"GNUSTEP_LOCAL_ROOT"];
NSString *_bundlePath;
#if defined(GNUSTEP)
NSString *_bundlePath = @"/usr/GNUstep/Local/Library/ProjectCenter";
#else
NSString *_bundlePath = @"/LocalLibrary/ProjectCenter";
#endif
if (prefix && ![prefix isEqualToString:@""]) {
_bundlePath = [prefix stringByAppendingPathComponent:@"Library/ProjectCenter"];
}
else {
_bundlePath = [NSString stringWithString:@"/usr/GNUstep/Local/Library/ProjectCenter"];
}
[defaults setObject:_bundlePath forKey:BundlePaths];
@ -51,6 +55,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 +81,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];
}
if (doConnection) {
[doConnection invalidate];
[doConnection release];
}
[projectManager release];
[bundleLoader release];
[doServer release];
[projectTypes release];
[prefController release];
[finder release];
[infoController release];
[logger release];
[projectManager release];
[fileManager release];
[menuController release];
[super dealloc];
[bundleLoader release];
[doServer release];
[projectTypes release];
[super dealloc];
}
//============================================================================
@ -100,12 +128,12 @@
- (id)delegate
{
return delegate;
return delegate;
}
- (void)setDelegate:(id)aDelegate
{
delegate = aDelegate;
delegate = aDelegate;
}
//============================================================================
@ -114,74 +142,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];
// 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];
NS_DURING
[[NSNotificationCenter defaultCenter] postNotificationName:PCAppDidInitNotification object:nil];
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];
[[NSNotificationCenter defaultCenter] postNotificationName:PCAppDidInitNotification object:nil];
}
- (BOOL)applicationShouldTerminate:(id)sender
@ -213,18 +250,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 +272,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;
PCProjectManager *projectManager;
PCFileManager *fileManager;
PCAppController *appController;
NSBox *projectTypeAccessaryView;
id projectTypePopup;
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
//============================================================================
@ -243,20 +261,20 @@
- (void)removeFile:(id)sender
{
NSString *file = nil;
PCProject *proj = [projectManager activeProject];
NSString *file = nil;
PCProject *proj = [projectManager activeProject];
if ((file = [[proj browserController] nameOfSelectedFile])) {
int ret;
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]);
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;
if (ret == NSAlertAlternateReturn || ret == NSAlertOtherReturn) {
BOOL flag = (ret == NSAlertOtherReturn) ? YES : NO;
[projectManager removeFilePermanently:flag];
}
[projectManager removeFilePermanently:flag];
}
}
}
//============================================================================

View file

@ -41,15 +41,14 @@
id autoSaveField;;
id useExternalEditor;
id editorField;
id debuggerField;
id compilerField;
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
@ -58,10 +58,13 @@
prefWindow = [[NSWindow alloc] initWithContentRect:_w_frame
styleMask:style
backing:NSBackingStoreBuffered
defer:NO];
defer:YES];
[prefWindow setMinSize:NSMakeSize(268,365)];
[prefWindow setTitle:@"Preferences"];
[prefWindow setDelegate:self];
[prefWindow setReleasedWhenClosed:NO];
[prefWindow center];
[prefWindow setFrameAutosaveName:@"Preferences"];
_c_view = [prefWindow contentView];
prefPopup = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(72,328,120,20)];
@ -104,6 +107,7 @@
[b setAction:@selector(setPromptOnClean:)];
[b setContinuous:NO];
[prefBuildingView addSubview:b];
[b sizeToFit];
/*
* Misc view
@ -116,23 +120,130 @@
[prefMiscView setBorderType:NSNoBorder];
v = [[[NSBox alloc] init] autorelease];
[v setTitle:@"External"];
[v setFrameFromContentFrame:NSMakeRect(16,184,228,96)];
[v setTitle:@"External Tools"];
[v setFrameFromContentFrame:NSMakeRect(16,192,228,88)];
[prefMiscView addSubview:v];
/*
* Editor
*/
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,16,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,16,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,40,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,40,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,64,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,64,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,104,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
*/
v = [[[NSBox alloc] init] autorelease];
[v setTitle:@"Misc"];
[v setFrameFromContentFrame:NSMakeRect(16,16,228,48)];
[prefMiscView addSubview:v];
b = [[[NSButton alloc] initWithFrame:NSMakeRect(16,28,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];
[v addSubview:b];
[b sizeToFit];
useExternalEditor =[[NSButton alloc] initWithFrame:NSMakeRect(16,8,220,15)];
[useExternalEditor setTitle:@"Use external Editor"];
[useExternalEditor setButtonType:NSSwitchButton];
[useExternalEditor setBordered:NO];
[useExternalEditor setTarget:self];
[useExternalEditor setAction:@selector(setUseExternalEditor:)];
[useExternalEditor setContinuous:NO];
[v addSubview:[useExternalEditor autorelease]];
[useExternalEditor sizeToFit];
/*
* Saving view
@ -149,7 +260,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 +268,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
@ -182,7 +293,7 @@
- (id)init
{
if ((self = [super init])) {
NSDictionary *prefs;
NSDictionary *prefs;
// The prefs from the defaults
prefs = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];
@ -195,39 +306,28 @@
{
[preferencesDict release];
if (_needsReleasing) {
[prefWindow release];
[prefPopup release];
[prefWindow release];
[prefPopup release];
[prefEmptyView release];
[prefBuildingView release];
[prefMiscView release];
[prefSavingView 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;
id view;
#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];
@ -242,51 +342,65 @@
[prefEmptyView display];
}
[prefWindow center];
prefs = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];
[preferencesDict addEntriesFromDictionary:prefs];
// 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];
}
- (void)popupChanged:(id)sender
{
NSView *view = nil;
NSView *view = nil;
switch([sender indexOfSelectedItem]) {
case 0:
view = [prefBuildingView retain];
break;
case 1:
view = [prefSavingView retain];
break;
case 2:
view = [prefMiscView retain];
break;
}
[(NSBox *)prefEmptyView setContentView:view];
[prefEmptyView display];
switch([sender indexOfSelectedItem]) {
case 0:
view = [prefBuildingView retain];
break;
case 1:
view = [prefSavingView retain];
break;
case 2:
view = [prefMiscView retain];
break;
}
[(NSBox *)prefEmptyView setContentView:view];
[prefEmptyView display];
}
- (void)setSuccessSound:(id)sender
{
NSString *path = [self selectFileWithTypes:[NSArray arrayWithObjects:@"snd",@"au",nil]];
NSString *path = [self selectFileWithTypes:[NSArray arrayWithObjects:@"snd",@"au",nil]];
if (path) {
[successField setStringValue:path];
if (path) {
[successField setStringValue:path];
[[NSUserDefaults standardUserDefaults] setObject:path forKey:SuccessSound];
[preferencesDict setObject:path forKey:SuccessSound];
}
[[NSUserDefaults standardUserDefaults] setObject:path forKey:SuccessSound];
[preferencesDict setObject:path forKey:SuccessSound];
}
}
- (void)setFailureSound:(id)sender
{
NSString *path = [self selectFileWithTypes:[NSArray arrayWithObjects:@"snd",@"au",nil]];
NSString *path = [self selectFileWithTypes:[NSArray arrayWithObjects:@"snd",@"au",nil]];
if (path) {
[failureField setStringValue:path];
if (path) {
[failureField setStringValue:path];
[[NSUserDefaults standardUserDefaults] setObject:path forKey:FailureSound];
[preferencesDict setObject:path forKey:FailureSound];
}
[[NSUserDefaults standardUserDefaults] setObject:path forKey:FailureSound];
[preferencesDict setObject:path forKey:FailureSound];
}
}
- (void)setPromptOnClean:(id)sender
@ -305,52 +419,59 @@
{
}
- (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]];
NSString *path = [editorField stringValue];
if (path) {
[editorField setStringValue:path];
[[NSUserDefaults standardUserDefaults] setObject:path forKey:Editor];
[preferencesDict setObject:path forKey:Editor];
}
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];
NSString *path = [debuggerField stringValue];
if (path) {
[debuggerField setStringValue:path];
[[NSUserDefaults standardUserDefaults] setObject:path forKey:Debugger];
[preferencesDict setObject:path forKey:Debugger];
}
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]];
NSString *path = [bundlePathField stringValue];
if (path) {
[bundlePathField setStringValue:path];
[[NSUserDefaults standardUserDefaults] setObject:path forKey:BundlePaths];
[preferencesDict setObject:path forKey:BundlePaths];
}
if (path) {
[[NSUserDefaults standardUserDefaults] setObject:path forKey:BundlePaths];
[preferencesDict setObject:path forKey:BundlePaths];
}
}
- (void)promptWhenQuitting:(id)sender
@ -364,23 +485,24 @@
- (NSString *)selectFileWithTypes:(NSArray *)types
{
NSString *file = nil;
NSOpenPanel *openPanel;
int retval;
NSString *file = nil;
NSOpenPanel *openPanel;
int retval;
openPanel = [NSOpenPanel openPanel];
[openPanel setAllowsMultipleSelection:NO];
[openPanel setCanChooseDirectories:YES];
[openPanel setCanChooseFiles:YES];
openPanel = [NSOpenPanel openPanel];
[openPanel setAllowsMultipleSelection:NO];
[openPanel setCanChooseDirectories:YES];
[openPanel setCanChooseFiles:YES];
retval = [openPanel runModalForDirectory:[[NSUserDefaults standardUserDefaults] objectForKey:@"LastOpenDirectory"] file:nil types:types];
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];
if (retval == NSOKButton) {
[[NSUserDefaults standardUserDefaults] setObject:[openPanel directory]
forKey:@"LastOpenDirectory"];
file = [[openPanel filenames] objectAtIndex:0];
}
return file;
}
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.

9
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}