diff --git a/PCAppProj/AppController.h b/PCAppProj/AppController.h index 619b67b..9ec13d6 100644 --- a/PCAppProj/AppController.h +++ b/PCAppProj/AppController.h @@ -8,15 +8,26 @@ * $Id$ */ -#import +#import @interface AppController : NSObject { } ++ (void)initialize; + - (id)init; - (void)dealloc; - (void)awakeFromNib; +- (void)applicationDidFinishLaunching:(NSNotification *)notif; + +- (void)applicationShouldTerminate:(id)sender; +- (void)applicationWillTerminate:(NSNotification *)notification; +- (BOOL)application:(NSApplication *)application openFile:(NSString *)fileName; + +- (void)showPrefPanel:(id)sender; +- (void)showInfoPanel:(id)sender; + @end diff --git a/PCAppProj/AppController.m b/PCAppProj/AppController.m index 3829677..eb97a6d 100644 --- a/PCAppProj/AppController.m +++ b/PCAppProj/AppController.m @@ -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,37 @@ { } +- (void)applicationDidFinishLaunching:(NSNotification *)notif +{ +} + +- (void)applicationShouldTerminate:(id)sender +{ +} + +- (void)applicationWillTerminate:(NSNotification *)notification +{ +} + +- (BOOL)application:(NSApplication *)application openFile:(NSString *)fileName +{ +} + +- (void)showPrefPanel:(id)sender +{ +} + +- (void)showInfoPanel:(id)sender +{ + if (!infoDict) { + NSString *fp; + NSBundle *bundle = [NSBundle mainBundle]; + + fp = [bundle pathForResource:@"Info-project" ofType:@"plist"]; + infoDict = [[NSDictionary dictionaryWithContentsOfFile:fp] retain]; + } + + [[NSApplication sharedApplication] orderFrontStandardInfoPanelWithOptions:infoDict]; +} + @end diff --git a/PCAppProj/AppProject.gmodel b/PCAppProj/AppProject.gmodel deleted file mode 100644 index 5dd296b..0000000 --- a/PCAppProj/AppProject.gmodel +++ /dev/null @@ -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; -} diff --git a/PCAppProj/ChangeLog b/PCAppProj/ChangeLog new file mode 100644 index 0000000..a6be39e --- /dev/null +++ b/PCAppProj/ChangeLog @@ -0,0 +1,40 @@ +2000-09-20 10:50 robert + + * AppController.h, AppController.m, PCAppMakefileFactory.m, + PCAppProj.m, main.m: enhanced the created app to support GC and an + info panel and more ... + +2000-09-17 14:14 robert + + * PCAppProject.h, PCAppProject.m: daily work + +2000-09-14 10:54 robert + + * AppController.h, AppController.m, AppProject.gmodel, GNUmakefile, + Main.gmodel, PC.proj, PCAppMakefileFactory.m, main.m: apps now + don't use gmodels anymore + +2000-09-03 22:10 robert + + * GNUmakefile.preamble: renamed libPC into libProjectCenter + +2000-08-27 21:11 robert + + * Makefile.preamble, PB.project, PCAppProj.h, Makefile, h.template, + m.template, Info.table, PCAppProj.m, Makefile.postamble, + PCAppProject.h, PCAppProject.m, GNUmakefile.postamble, + GNUmakefile.preamble, PC.proj, main.m, PCAppMakefileFactory.h, + PCAppMakefileFactory.m, AppProject.gmodel, GNUmakefile, + AppController.h, AppController.m, Info-project.plist, Main.gmodel: + Initial revision + +2000-08-27 21:11 robert + + * Makefile.preamble, PB.project, PCAppProj.h, Makefile, h.template, + m.template, Info.table, PCAppProj.m, Makefile.postamble, + PCAppProject.h, PCAppProject.m, GNUmakefile.postamble, + GNUmakefile.preamble, PC.proj, main.m, PCAppMakefileFactory.h, + PCAppMakefileFactory.m, AppProject.gmodel, GNUmakefile, + AppController.h, AppController.m, Info-project.plist, Main.gmodel: + Initial import + diff --git a/PCAppProj/GNUmakefile b/PCAppProj/GNUmakefile index 2bca6e5..7be9c50 100644 --- a/PCAppProj/GNUmakefile +++ b/PCAppProj/GNUmakefile @@ -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 \ diff --git a/PCAppProj/GNUmakefile.preamble b/PCAppProj/GNUmakefile.preamble index f61a96d..49b00fc 100644 --- a/PCAppProj/GNUmakefile.preamble +++ b/PCAppProj/GNUmakefile.preamble @@ -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 += diff --git a/PCAppProj/Main.gmodel b/PCAppProj/Main.gmodel deleted file mode 100644 index ec0303c..0000000 --- a/PCAppProj/Main.gmodel +++ /dev/null @@ -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; -} diff --git a/PCAppProj/PC.proj b/PCAppProj/PC.proj index e78336c..cd0f3b9 100644 --- a/PCAppProj/PC.proj +++ b/PCAppProj/PC.proj @@ -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 = (); diff --git a/PCAppProj/PCAppMakefileFactory.m b/PCAppProj/PCAppMakefileFactory.m index 9e5e694..be99b37 100644 --- a/PCAppProj/PCAppMakefileFactory.m +++ b/PCAppProj/PCAppMakefileFactory.m @@ -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"]; @@ -112,6 +112,8 @@ static PCAppMakefileFactory *_factory = nil; } } + [string appendString:[NSString stringWithFormat:@"\\\nInfo-project.plist "]]; + [string appendString:@"\n\n#\n\n"]; [string appendString:@"# Header files\n"]; [string appendString:@"#\n\n"]; diff --git a/PCAppProj/PCAppProj.m b/PCAppProj/PCAppProj.m index f74d3b3..51ab172 100644 --- a/PCAppProj/PCAppProj.m +++ b/PCAppProj/PCAppProj.m @@ -79,7 +79,8 @@ static PCAppProj *_creator = nil; NSString *_file; NSString *_resourcePath; NSMutableDictionary *dict; - + NSDictionary *infoDict; + project = [[[PCAppProject alloc] init] autorelease]; _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"PC" ofType:@"proj"]; @@ -91,6 +92,20 @@ static PCAppProj *_creator = nil; // Save the project to disc [dict writeToFile:[path stringByAppendingPathComponent:@"PC.project"] atomically:YES]; + + // Create the Info-project.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]; + [infoDict writeToFile:[path stringByAppendingPathComponent:@"Info-project.plist"] atomically:YES]; // Copy the project files to the provided path _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"GNUmakefile" ofType:@"postamble"]; diff --git a/PCAppProj/PCAppProject.h b/PCAppProj/PCAppProject.h index 0214a94..c777aeb 100644 --- a/PCAppProj/PCAppProject.h +++ b/PCAppProj/PCAppProject.h @@ -38,8 +38,6 @@ @interface PCAppProject : PCProject { - @private - BOOL _needsAdditionalReleasing; } //---------------------------------------------------------------------------- diff --git a/PCAppProj/PCAppProject.m b/PCAppProj/PCAppProject.m index 25e1282..0c1b99d 100644 --- a/PCAppProj/PCAppProject.m +++ b/PCAppProj/PCAppProject.m @@ -66,8 +66,6 @@ // [projectFileInspectorView addSubview:projectTypePopup]; [projectFileInspectorView sizeToFit]; [projectFileInspectorView setAutoresizingMask:NSViewWidthSizable]; - - _needsAdditionalReleasing = YES; } @end @@ -80,42 +78,33 @@ - (id)init { - if ((self = [super init])) { - rootCategories = [[NSDictionary dictionaryWithObjectsAndKeys: + if ((self = [super init])) { + rootCategories = [[NSDictionary dictionaryWithObjectsAndKeys: PCGModels,@"Interfaces", - PCImages,@"Images", - PCOtherResources,@"Other Resources", - PCSubprojects,@"Subprojects", - PCLibraries,@"Libraries", - PCDocuFiles,@"Documentation", - PCOtherSources,@"Other Sources", - PCHeaders,@"Headers", - PCClasses,@"Classes", - nil] retain]; + PCImages,@"Images", + PCOtherResources,@"Other Resources", + PCSubprojects,@"Subprojects", + PCLibraries,@"Libraries", + PCDocuFiles,@"Documentation", + PCOtherSources,@"Other Sources", + PCHeaders,@"Headers", + PCClasses,@"Classes", + nil] retain]; -#if defined(GNUSTEP) - [self _initUI]; -#else - if(![NSBundle loadNibNamed:@"AppProject.nib" owner:self]) { - [[NSException exceptionWithName:NIB_NOT_FOUND_EXCEPTION reason:@"Could not load AppProject.gmodel" userInfo:nil] raise]; - return nil; - } -#endif - } - return self; + [self _initUI]; + } + return self; } - (void)dealloc { - [rootCategories release]; - - if (_needsAdditionalReleasing) { - [projectAttributeInspectorView release]; - [projectProjectInspectorView release]; - [projectFileInspectorView release]; - } - - [super dealloc]; + [rootCategories release]; + + [projectAttributeInspectorView release]; + [projectProjectInspectorView release]; + [projectFileInspectorView release]; + + [super dealloc]; } //---------------------------------------------------------------------------- diff --git a/PCAppProj/main.m b/PCAppProj/main.m index 1ef1c5b..1b7f56e 100644 --- a/PCAppProj/main.m +++ b/PCAppProj/main.m @@ -1,5 +1,106 @@ +/* $Id$ */ + #import +#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:action 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]; +} + + + diff --git a/PCBaseFileTypes/ChangeLog b/PCBaseFileTypes/ChangeLog new file mode 100644 index 0000000..7434982 --- /dev/null +++ b/PCBaseFileTypes/ChangeLog @@ -0,0 +1,19 @@ +2000-09-13 12:45 robert + + * PCBaseFileType.m: removed the gmodels completely from + ProjectCenter.app + +2000-08-27 21:12 robert + + * Makefile, Makefile.postamble, Makefile.preamble, PB.project, + PCBaseFileType.h, PCBaseFileType.m, FileIcon_.m.tiff, + FileIcon_.h.tiff, FileIcon_.c.tiff, GNUmakefile, cfile.template, + cheader.template, class.template, header.template: Initial revision + +2000-08-27 21:12 robert + + * Makefile, Makefile.postamble, Makefile.preamble, PB.project, + PCBaseFileType.h, PCBaseFileType.m, FileIcon_.m.tiff, + FileIcon_.h.tiff, FileIcon_.c.tiff, GNUmakefile, cfile.template, + cheader.template, class.template, header.template: Initial import + diff --git a/PCBaseFileTypes/PCBaseFileType.m b/PCBaseFileTypes/PCBaseFileType.m index 66b6c1b..e62d841 100644 --- a/PCBaseFileTypes/PCBaseFileType.m +++ b/PCBaseFileTypes/PCBaseFileType.m @@ -194,6 +194,7 @@ static NSDictionary *dict = nil; [file rangeOfString:@"$FILENAMESANSEXTENSION$"] withString:name]; } } + [file writeToFile:newFile atomically:YES]; [file autorelease]; } diff --git a/PCLib/ChangeLog b/PCLib/ChangeLog new file mode 100644 index 0000000..a27dfd1 --- /dev/null +++ b/PCLib/ChangeLog @@ -0,0 +1,65 @@ +2000-09-20 17:46 robert + + * GNUmakefile, PCBrowserController.m, PCEditorView.h, + PCEditorView.m, PCProject.h, PCProject.m, PCServer.m, + ProjectCenter.h: Added a first editor with syntax highlighting + +2000-09-20 11:59 robert + + * PCProjectBuilder.m: daily work + +2000-09-20 11:53 robert + + * PCProject.m, PCProjectBuilder.m: minor UI changes (scrollers in + scrollviews) + +2000-09-19 17:39 robert + + * PCProject.m, PCProjectBuilder.m: sizeToCells was missing ... + +2000-09-17 16:40 robert + + * PCProject.h, PCProject.m, PCProjectBuilder.m: Basic preferences + handling + +2000-09-17 14:13 robert + + * PCBrowserController.h, PCBrowserController.m, PCFileManager.h, + PCFileManager.m, PCProject.h, PCProject.m, PCProjectBuilder.h, + PCProjectBuilder.m, PCProjectManager.h, PCProjectManager.m, + PCServer.h, PCServer.m, ProjectCenter.h, Server.h: Implemented a + first 'editor', UI enhancements and other nice things + +2000-09-03 22:10 robert + + * GNUmakefile: renamed libPC into libProjectCenter + +2000-08-28 21:04 robert + + * PCBrowserController.m, PCFileManager.h: The class and header + files are now being displayed + +2000-08-27 21:12 robert + + * Makefile.preamble, PB.project, h.template, m.template, Makefile, + Makefile.postamble, ProjectEditor.h, Server.h, PCServer.h, + PCServer.m, ProjectCenter.h, ProjectDebugger.h, ProjectType.h, + PCProjectManager.m, PCProjectManager.h, PCBundleLoader.h, + PCBundleLoader.m, PreferenceController.h, ProjectBuilder.h, + PCBrowserController.h, PCDataSource.h, PCDataSource.m, PCProject.h, + PCFileManager.h, PCProject.m, PCFileManager.m, FileCreator.h, + GNUmakefile, GNUmakefile.preamble, PCBrowserController.m, + PCProjectBuilder.h, PCProjectBuilder.m: Initial revision + +2000-08-27 21:12 robert + + * Makefile.preamble, PB.project, h.template, m.template, Makefile, + Makefile.postamble, ProjectEditor.h, Server.h, PCServer.h, + PCServer.m, ProjectCenter.h, ProjectDebugger.h, ProjectType.h, + PCProjectManager.m, PCProjectManager.h, PCBundleLoader.h, + PCBundleLoader.m, PreferenceController.h, ProjectBuilder.h, + PCBrowserController.h, PCDataSource.h, PCDataSource.m, PCProject.h, + PCFileManager.h, PCProject.m, PCFileManager.m, FileCreator.h, + GNUmakefile, GNUmakefile.preamble, PCBrowserController.m, + PCProjectBuilder.h, PCProjectBuilder.m: Initial import + diff --git a/PCLib/GNUmakefile b/PCLib/GNUmakefile index 159db9e..1ff4909 100644 --- a/PCLib/GNUmakefile +++ b/PCLib/GNUmakefile @@ -36,7 +36,7 @@ PACKAGE_NAME = PCLib LIBRARY_VAR = PCLIB # The library to be compiled -LIBRARY_NAME=libPC +LIBRARY_NAME=libProjectCenter PCLIB_INSTALL_PREFIX=$(GNUSTEP_LOCAL_ROOT) @@ -46,23 +46,25 @@ FILE_AUTHORS = \ # The source files -libPC_MFILES = \ +libProjectCenter_MFILES = \ PCBrowserController.m \ PCBundleLoader.m \ PCDataSource.m \ + PCEditorView.m \ PCFileManager.m \ PCProject.m \ PCProjectBuilder.m \ PCProjectManager.m \ PCServer.m -libPC_CFILES = +libProjectCenter_CFILES = -libPC_HFILES = \ +libProjectCenter_HFILES = \ FileCreator.h \ PCBrowserController.h \ PCBundleLoader.h \ PCDataSource.h \ + PCEditorView.h \ PCFileManager.h \ PCProject.h \ PCProjectBuilder.h \ @@ -76,18 +78,18 @@ libPC_HFILES = \ ProjectType.h \ Server.h -HEADERS_INSTALL = $(libPC_HFILES) +HEADERS_INSTALL = $(libProjectCenter_HFILES) # The Objective-C source files to be compiled -libPC_OBJC_FILES = $(libPC_MFILES) +libProjectCenter_OBJC_FILES = $(libProjectCenter_MFILES) # The C source files to be compiled -libPC_C_FILES = $(libPC_CFILES) +libProjectCenter_C_FILES = $(libProjectCenter_CFILES) # The headers -libPC_HEADER_FILES_DIR = . -libPC_HEADER_FILES_INSTALL_DIR = /ProjectCenter -libPC_HEADER_FILES = $(libPC_HFILES) +libProjectCenter_HEADER_FILES_DIR = . +libProjectCenter_HEADER_FILES_INSTALL_DIR = /ProjectCenter +libProjectCenter_HEADER_FILES = $(libProjectCenter_HFILES) -include GNUmakefile.preamble diff --git a/PCLib/PCBrowserController.h b/PCLib/PCBrowserController.h index 39a130e..bc023a8 100644 --- a/PCLib/PCBrowserController.h +++ b/PCLib/PCBrowserController.h @@ -56,3 +56,6 @@ - (BOOL)browser:(NSBrowser *)sender selectCellWithString:(NSString *)title inColumn:(int)column; @end + +extern NSString *FileShouldOpenNotification; + diff --git a/PCLib/PCBrowserController.m b/PCLib/PCBrowserController.m index 6bbc578..0fac011 100644 --- a/PCLib/PCBrowserController.m +++ b/PCLib/PCBrowserController.m @@ -26,60 +26,63 @@ #import "PCBrowserController.h" #import "PCProject.h" +#import "PCFileManager.h" + +NSString *FileShouldOpenNotification = @"FileShouldOpenNotification"; @implementation PCBrowserController - (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; - [super dealloc]; + [super dealloc]; } - (void)click:(id)sender { - NSTextView *pTextView; - if ([[sender selectedCell] isLeaf]) { + NSString *ltitle = [[sender selectedCell] stringValue]; NSString *ctitle = [[sender selectedCellInColumn:0] stringValue]; - NSString *text = [NSString stringWithFormat:@"Display File %@",[[sender selectedCell] stringValue] -]; - pTextView = [project textView]; + NSString *ctitlef = [[project projectPath] stringByAppendingPathComponent:ltitle]; if ([ctitle isEqualToString:@"Classes"]) { - [pTextView setString:text]; - } + NSString *f = [NSString stringWithContentsOfFile:ctitlef]; + [project editSelectedFile:f]; + } + else if ([ctitle isEqualToString:@"Headers"]) { + NSString *f = [NSString stringWithContentsOfFile:ctitlef]; + + [project editSelectedFile:f]; + } + else if ([ctitle isEqualToString:@"Other Sources"]) { + NSString *f = [NSString stringWithContentsOfFile:ctitlef]; + + [project editSelectedFile:f]; + } } } - (void)doubleClick:(id)sender { -#warning No subproject support here yet! - /* - if ([sender selectedColumn] == 0) { - // Ask the project about the valid file types - //NSArray *types = [project typesForKeyPath:[sender pathToColumn:0]]; - NSOpenPanel *openPanel; - int retval; - NSArray *types; + if ([sender selectedColumn] != 0) { + NSString *category = [[[browser path] componentsSeparatedByString:@"/"] objectAtIndex:1]; + NSString *k = [[project rootCategories] objectForKey:category]; - openPanel = [NSOpenPanel openPanel]; - [openPanel setAllowsMultipleSelection:NO]; - [openPanel setCanChooseDirectories:NO]; - [openPanel setCanChooseFiles:YES]; - - if ((retval = [openPanel runModalForDirectory:[[NSUserDefaults standardUserDefaults] objectForKey:@"LastOpenDirectory"] file:nil types:types])) { - NSString *key = [project projectKeyForKeyPath:[sender path]]; - - [project addFile:[[openPanel filenames] objectAtIndex:0] forKey:key]; - - [[NSUserDefaults standardUserDefaults] setObject:[openPanel directory] forKey:@"LastOpenDirectory"]; - } + if ([k isEqualToString:PCClasses] || [k isEqualToString:PCHeaders] || [k isEqualToString:PCOtherSources]) { + NSString *projectPath = [project projectPath]; + NSString *fn = [self nameOfSelectedFile]; + NSString *file = [projectPath stringByAppendingPathComponent:fn]; + NSDictionary *ui =[NSDictionary dictionaryWithObjectsAndKeys: + file,@"FilePathKey",nil]; + + [[NSNotificationCenter defaultCenter] postNotificationName:FileShouldOpenNotification object:self userInfo:ui]; } - else { - } - */ + } + else { + [[PCFileManager fileManager] showAddFileWindow]; + } } - (void)projectDictDidChange:(NSNotification *)aNotif @@ -101,14 +104,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 diff --git a/PCLib/PCEditorView.h b/PCLib/PCEditorView.h new file mode 100644 index 0000000..af11126 --- /dev/null +++ b/PCLib/PCEditorView.h @@ -0,0 +1,53 @@ +/* + GNUstep ProjectCenter - http://www.projectcenter.ch + + Copyright (C) 2000 Philippe C.D. Robert + + Author: Philippe C.D. Robert + + 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 + +@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 diff --git a/PCLib/PCEditorView.m b/PCLib/PCEditorView.m new file mode 100644 index 0000000..dd9ad36 --- /dev/null +++ b/PCLib/PCEditorView.m @@ -0,0 +1,347 @@ +/* + GNUstep ProjectCenter - http://www.projectcenter.ch + + Copyright (C) 2000 Philippe C.D. Robert + + Author: Philippe C.D. Robert + + 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",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 + + + + diff --git a/PCLib/PCFileManager.h b/PCLib/PCFileManager.h index 08f61b0..66ea2ec 100644 --- a/PCLib/PCFileManager.h +++ b/PCLib/PCFileManager.h @@ -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 + + + diff --git a/PCLib/PCFileManager.m b/PCLib/PCFileManager.m index 7a9df44..2b5ec6c 100644 --- a/PCLib/PCFileManager.m +++ b/PCLib/PCFileManager.m @@ -135,33 +135,26 @@ [newFileName setStringValue:@""]; [newFileName setAutoresizingMask: (NSViewWidthSizable | NSViewMinYMargin)]; [_c_view addSubview:[newFileName autorelease]]; - - /* - * the accessory view needed for adding files - * - */ - - fileTypeAccessaryView = [[NSBox alloc] init]; - addFileTypePopup = [[[NSPopUpButton alloc] initWithFrame:NSMakeRect(20,30,160,20) pullsDown:NO] autorelease]; - [addFileTypePopup addItemWithTitle:@"No type available!"]; - - [fileTypeAccessaryView setTitle:@"Add to category"]; - [fileTypeAccessaryView setTitlePosition:NSAtTop]; - [fileTypeAccessaryView setBorderType:NSGrooveBorder]; - [fileTypeAccessaryView addSubview:addFileTypePopup]; - [fileTypeAccessaryView sizeToFit]; - [fileTypeAccessaryView setAutoresizingMask: NSViewWidthSizable]; - - [fileTypePopup setTarget:self]; - [fileTypePopup setAction:@selector(fileTypePopupChanged:)]; - - _needsAdditionalReleasing = YES; } @end @implementation PCFileManager +//=========================================================================================== +// ==== Class methods +//=========================================================================================== + +static PCFileManager *_mgr = nil; + ++ (PCFileManager *)fileManager +{ + if (!_mgr) { + _mgr = [[PCFileManager alloc] init]; + } + return _mgr; +} + //=========================================================================================== // ==== Init and free //=========================================================================================== @@ -170,15 +163,7 @@ { if ((self = [super init])) { creators = [[NSMutableDictionary alloc] init]; - -#if defined(GNUSTEP) [self _initUI]; -#else - if(![NSBundle loadNibNamed:@"FileCreation.nib" owner:self]) { - [[NSException exceptionWithName:NIB_NOT_FOUND_EXCEPTION reason:@"Could not load FileCreation.gmodel" userInfo:nil] raise]; - return nil; - } -#endif } return self; } @@ -186,18 +171,14 @@ - (void)dealloc { [creators release]; - - if (_needsAdditionalReleasing) { - [fileTypeAccessaryView release]; - [newFileWindow release]; - } + [newFileWindow release]; [super dealloc]; } - (void)awakeFromNib { - [fileTypePopup removeAllItems]; + [fileTypePopup removeAllItems]; } // =========================================================================== @@ -206,56 +187,53 @@ - (id)delegate { - return delegate; + return delegate; } - (void)setDelegate:(id)aDelegate { - delegate = aDelegate; + delegate = aDelegate; } // =========================================================================== // ==== File stuff // =========================================================================== -- (void)fileTypePopupChanged:(id)sender -{ -} - - (void)showAddFileWindow { - NSOpenPanel *openPanel; - int retval; + NSOpenPanel *openPanel; + int retval; + NSMutableArray *validTypes = nil; NSDictionary *categories = nil; + PCProject *project = nil; - + NSString *key = nil; + NSString *title = nil; + NSArray *types = nil; + if (delegate && [delegate respondsToSelector:@selector(fileManagerWillAddFiles:)]) { if (!(project = [delegate fileManagerWillAddFiles:self])) { NSLog(@"No project to add files available..."); + return; } } - - // Ask the active project for the valid file types first! - categories = [project rootCategories]; - validTypes = [NSMutableArray arrayWithArray:[categories allKeys]]; - [validTypes removeObject:@"Subprojects"]; - - [addFileTypePopup removeAllItems]; - [addFileTypePopup addItemsWithTitles:validTypes]; - + + key = [project selectedRootCategory]; + title = [[[project rootCategories] allKeysForObject:key] objectAtIndex:0]; + title = [NSString stringWithFormat:@"Add to %@...",title]; + + types = [project fileExtensionsForCategory:key]; + openPanel = [NSOpenPanel openPanel]; [openPanel setAllowsMultipleSelection:YES]; [openPanel setCanChooseDirectories:NO]; [openPanel setCanChooseFiles:YES]; - - [openPanel setTitle:@"Add File(s)..."]; - [openPanel setAccessoryView:fileTypeAccessaryView]; - - retval = [openPanel runModalForDirectory:[[NSUserDefaults standardUserDefaults] objectForKey:@"LastOpenDirectory"] file:nil types:nil]; - + [openPanel setTitle:title]; + + retval = [openPanel runModalForDirectory:[[NSUserDefaults standardUserDefaults] objectForKey:@"LastOpenDirectory"] file:nil types:types]; + if (retval == NSOKButton) { - NSString *key = [categories objectForKey:[addFileTypePopup titleOfSelectedItem]]; NSEnumerator *enumerator; NSString *file; @@ -263,17 +241,57 @@ enumerator = [[openPanel filenames] objectEnumerator]; while (file = [enumerator nextObject]) { + NSString *otherKey; + NSString *ext; + BOOL ret = NO; + NSString *fn; + NSString *fileName; + NSString *pth; + if ([delegate fileManager:self shouldAddFile:file forKey:key]) { - NSString *fileName = [file lastPathComponent]; - NSString *pth = [[project projectPath] stringByAppendingPathComponent:fileName]; + fileName = [file lastPathComponent]; + pth = [[project projectPath] stringByAppendingPathComponent:fileName]; if (![key isEqualToString:PCLibraries]) { - if ([[NSFileManager defaultManager] copyPath:file toPath:pth handler:nil]) { - [delegate fileManager:self didAddFile:pth forKey:key]; + if (![[NSFileManager defaultManager] fileExistsAtPath:pth]) { + [[NSFileManager defaultManager] copyPath:file toPath:pth handler:nil]; } } - else { - [delegate fileManager:self didAddFile:pth forKey:key]; + [project addFile:pth forKey:key]; + } + + if ([key isEqualToString:PCClasses]) { + otherKey = PCHeaders; + ext = [NSString stringWithString:@"h"]; + + fn = [file stringByDeletingPathExtension]; + fn = [fn stringByAppendingPathExtension:ext]; + + if ([[NSFileManager defaultManager] fileExistsAtPath:fn]) { + ret = NSRunAlertPanel(@"Adding Header?",@"Should %@ be added to project %@ as well?",@"Yes",@"No",nil,fn,[project projectName]); + } + } + else if ([key isEqualToString:PCHeaders]) { + otherKey = PCClasses; + ext = [NSString stringWithString:@"m"]; + + fn = [file stringByDeletingPathExtension]; + fn = [fn stringByAppendingPathExtension:ext]; + + if ([[NSFileManager defaultManager] fileExistsAtPath:fn]) { + ret = NSRunAlertPanel(@"Adding Class?",@"Should %@ be added to project %@ as well?",@"Yes",@"No",nil,fn,[project projectName]); + } + } + + if (ret) { + if ([delegate fileManager:self shouldAddFile:fn forKey:otherKey]) { + NSString *pp = [project projectPath]; + fileName = [fn lastPathComponent]; + pth = [pp stringByAppendingPathComponent:fileName]; + + [[NSFileManager defaultManager] copyPath:fn toPath:pth handler:nil]; + + [project addFile:pth forKey:otherKey]; } } } @@ -367,3 +385,6 @@ } @end + + + diff --git a/PCLib/PCProject.h b/PCLib/PCProject.h index b13eb6c..7d2b1b8 100644 --- a/PCLib/PCProject.h +++ b/PCLib/PCProject.h @@ -28,6 +28,19 @@ #import "ProjectBuilder.h" +#ifndef IMAGE +#define IMAGE(X) [[[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:(X)]] autorelease] +#endif + +#define BUILD_ARGS_KEY @"BuildArgsKey" +#define BUILD_HOST_KEY @"BuildHostKey" + +#define TARGET_MAKE @"Make" +#define TARGET_MAKE_DEBUG @"MakeDebug" +#define TARGET_MAKE_PROFILE @"MakeProfile" +#define TARGET_MAKE_INSTALL @"MakeInstall" +#define TARGET_MAKE_CLEAN @"MakeClean" + #define TOUCHED_NOTHING (0) #define TOUCHED_EVERYTHING (1 << 0) #define TOUCHED_PROJECT_NAME (1 << 1) @@ -46,13 +59,6 @@ typedef int PCProjInfoBits; -typedef enum { - defaultTarget = 0, - debug, - profile, - install -} btarget; - //=========================================================================================== // ==== Project keys //=========================================================================================== @@ -82,7 +88,7 @@ static NSString * const PCLibraryVar = @"LIBRARY_VAR"; { id projectWindow; id delegate; - id projectBuilder; + id projectManager; id browserController; id textView; @@ -92,7 +98,8 @@ static NSString * const PCLibraryVar = @"LIBRARY_VAR"; id projectFileInspectorView; id buildTargetPanel; - id buildTargetPopup; + id buildTargetHostField; + id buildTargetArgsField; id buildStatusField; id targetField; @@ -102,10 +109,10 @@ static NSString * const PCLibraryVar = @"LIBRARY_VAR"; NSMutableDictionary *projectDict; NSDictionary *rootCategories; // Needs to be initialised by subclasses! + NSMutableDictionary *buildOptions; @private BOOL _needsReleasing; - btarget _buildTarget; } //=========================================================================================== @@ -122,6 +129,9 @@ static NSString * const PCLibraryVar = @"LIBRARY_VAR"; //=========================================================================================== - (id)browserController; +- (NSString *)selectedRootCategory; + +- (NSArray *)fileExtensionsForCategory:(NSString *)key; - (void)setProjectName:(NSString *)aName; - (NSString *)projectName; @@ -162,6 +172,9 @@ static NSString * const PCLibraryVar = @"LIBRARY_VAR"; // ==== Miscellaneous //=========================================================================================== +- (void)editSelectedFile:(NSString *)file; +- (void)structureEditedFile:(id)sender; + - (BOOL)doesAcceptFile:(NSString *)file forKey:(NSString *)key; // Returns YES if type is a valid key and file is not contained in the project already @@ -204,12 +217,12 @@ static NSString * const PCLibraryVar = @"LIBRARY_VAR"; - (id)updatedFilesView; - (void)showBuildTargetPanel:(id)sender; -- (void)setTarget:(id)sender; - (void)setHost:(id)sender; - (void)setArguments:(id)sender; - (void)build:(id)sender; -- (void)clean:(id)sender; + +- (NSDictionary *)buildOptions; @end @@ -228,3 +241,9 @@ static NSString * const PCLibraryVar = @"LIBRARY_VAR"; - (void)windowWillClose:(NSNotification *)aNotification; @end + +@interface PCProject (TextDelegate) + +- (void)textDidEndEditing:(NSNotification *)aNotification; + +@end diff --git a/PCLib/PCProject.m b/PCLib/PCProject.m index 15d5e9e..c1adef9 100644 --- a/PCLib/PCProject.m +++ b/PCLib/PCProject.m @@ -77,11 +77,15 @@ [browserController setBrowser:browser]; [browserController setProject:self]; - textView = [[NSTextView alloc] initWithFrame:NSMakeRect(0,0,472,88)]; + // textView = [[NSTextView alloc] initWithFrame:NSMakeRect(0,0,472,88)]; + textView = [[PCEditorView alloc] initWithFrame:NSMakeRect(0,0,472,88)]; [textView setMaxSize:NSMakeSize(1e7, 1e7)]; + [textView setRichText:NO]; + [textView setEditable:YES]; + [textView setSelectable:YES]; + [textView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [textView setVerticallyResizable:YES]; [textView setHorizontallyResizable:YES]; - [textView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [textView setBackgroundColor:[NSColor whiteColor]]; [[textView textContainer] setWidthTracksTextView:YES]; @@ -89,7 +93,7 @@ [scrollView setDocumentView:textView]; [textView setMinSize:NSMakeSize(0.0,[scrollView contentSize].height)]; [[textView textContainer] setContainerSize:NSMakeSize([scrollView contentSize].width,1e7)]; - [scrollView setHasHorizontalScroller: YES]; + [scrollView setHasHorizontalScroller: NO]; [scrollView setHasVerticalScroller: YES]; [scrollView setBorderType: NSBezelBorder]; [scrollView setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)]; @@ -110,27 +114,28 @@ prototype: buttonCell numberOfRows: 1 numberOfColumns: 3] autorelease]; + [matrix sizeToCells]; [matrix setSelectionByRect:YES]; [matrix setAutoresizingMask: (NSViewMaxXMargin | NSViewMinYMargin)]; [_c_view addSubview:matrix]; button = [matrix cellAtRow:0 column:0]; [button setImagePosition:NSImageOnly]; - [button setImage:[[[NSImage alloc] initWithContentsOfFile:@"ProjectCentre_build.tiff"] autorelease]]; + [button setImage:IMAGE(@"ProjectCentre_build")]; [button setButtonType:NSMomentaryPushButton]; [button setTarget:self]; [button setAction:@selector(build:)]; button = [matrix cellAtRow:0 column:1]; [button setImagePosition:NSImageOnly]; - [button setImage:[[[NSImage alloc] initWithContentsOfFile:@"ProjectCentre_clean.tiff"] autorelease]]; + [button setImage:IMAGE(@"ProjectCentre_settings.tiff")]; [button setButtonType:NSMomentaryPushButton]; [button setTarget:self]; - [button setAction:@selector(clean:)]; + [button setAction:@selector(showInspector:)]; button = [matrix cellAtRow:0 column:2]; [button setImagePosition:NSImageOnly]; - [button setImage:[[[NSImage alloc] initWithContentsOfFile:@"ProjectCentre_prefs.tiff"] autorelease]]; + [button setImage:IMAGE(@"ProjectCentre_prefs.tiff")]; [button setTarget:self]; [button setAction:@selector(showBuildTarget:)]; [button setButtonType:NSMomentaryPushButton]; @@ -144,31 +149,35 @@ prototype: buttonCell numberOfRows: 1 numberOfColumns: 4] autorelease]; + [matrix sizeToCells]; [matrix setSelectionByRect:YES]; [matrix setAutoresizingMask: (NSViewMinXMargin | NSViewMinYMargin)]; [_c_view addSubview:matrix]; button = [matrix cellAtRow:0 column:0]; [button setImagePosition:NSImageOnly]; - [button setImage:[[[NSImage alloc] initWithContentsOfFile:@"ProjectCentre_run.tiff"] autorelease]]; + [button setImage:IMAGE(@"ProjectCentre_run.tiff")]; [button setButtonType:NSMomentaryPushButton]; button = [matrix cellAtRow:0 column:1]; [button setImagePosition:NSImageOnly]; - [button setImage:[[[NSImage alloc] initWithContentsOfFile:@"ProjectCentre_uml.tiff"] autorelease]]; + [button setImage:IMAGE(@"ProjectCentre_uml.tiff")]; [button setButtonType:NSMomentaryPushButton]; button = [matrix cellAtRow:0 column:2]; [button setImagePosition:NSImageOnly]; - [button setImage:[[[NSImage alloc] initWithContentsOfFile:@"ProjectCentre_documentation.tiff"] autorelease]]; + [button setImage:IMAGE(@"ProjectCentre_documentation.tiff")]; [button setButtonType:NSMomentaryPushButton]; button = [matrix cellAtRow:0 column:3]; [button setImagePosition:NSImageOnly]; - [button setImage:[[[NSImage alloc] initWithContentsOfFile:@"ProjectCentre_find.tiff"] autorelease]]; + [button setImage:IMAGE(@"ProjectCentre_find.tiff")]; [button setButtonType:NSMomentaryPushButton]; - // Status + /* + * Status + */ + textField = [[NSTextField alloc] initWithFrame:NSMakeRect(152,296,48,15)]; [textField setAlignment: NSRightTextAlignment]; [textField setBordered: NO]; @@ -180,7 +189,10 @@ NSViewMinYMargin)]; [_c_view addSubview:[textField autorelease]]; - // Status message + /* + * Status message + */ + buildStatusField = [[NSTextField alloc] initWithFrame:NSMakeRect(204,296,104,15)]; [buildStatusField setAlignment: NSLeftTextAlignment]; [buildStatusField setBordered: NO]; @@ -193,7 +205,10 @@ NSViewMinYMargin)]; [_c_view addSubview:[buildStatusField autorelease]]; - // Target + /* + * Target + */ + textField = [[NSTextField alloc] initWithFrame:NSMakeRect(152,272,48,15)]; [textField setAlignment: NSRightTextAlignment]; [textField setBordered: NO]; @@ -205,7 +220,10 @@ NSViewMinYMargin)]; [_c_view addSubview:[textField autorelease]]; - // Target message + /* + * Target message + */ + targetField = [[NSTextField alloc] initWithFrame:NSMakeRect(204,272,104,15)]; [targetField setAlignment: NSLeftTextAlignment]; [targetField setBordered: NO]; @@ -219,40 +237,19 @@ [_c_view addSubview:[targetField autorelease]]; /* - * Build Panel + * Build Options Panel * */ - _w_frame = NSMakeRect(100,100,272,104); + _w_frame = NSMakeRect(100,100,272,80); buildTargetPanel = [[NSWindow alloc] initWithContentRect:_w_frame styleMask:style backing:NSBackingStoreBuffered defer:NO]; - + [buildTargetPanel setDelegate:self]; [buildTargetPanel setReleasedWhenClosed:NO]; [buildTargetPanel setTitle:@"Build Options"]; _c_view = [buildTargetPanel contentView]; - buildTargetPopup = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(72,24,184,20)]; - [buildTargetPopup addItemWithTitle:@"Default"]; - [buildTargetPopup addItemWithTitle:@"Debug"]; - [buildTargetPopup addItemWithTitle:@"Profile"]; - [buildTargetPopup addItemWithTitle:@"Install"]; - [buildTargetPopup autorelease]; - - [buildTargetPopup setTarget:self]; - [buildTargetPopup setAction:@selector(setTarget:)]; - [_c_view addSubview:buildTargetPopup]; - - // Target (popup) - textField = [[NSTextField alloc] initWithFrame:NSMakeRect(16,24,56,21)]; - [textField setAlignment: NSRightTextAlignment]; - [textField setBordered: NO]; - [textField setEditable: NO]; - [textField setBezeled: NO]; - [textField setDrawsBackground: NO]; - [textField setStringValue:@"Target:"]; - [_c_view addSubview:[textField autorelease]]; - // Host - textField = [[NSTextField alloc] initWithFrame:NSMakeRect(16,48,56,21)]; + textField = [[NSTextField alloc] initWithFrame:NSMakeRect(16,24,56,21)]; [textField setAlignment: NSRightTextAlignment]; [textField setBordered: NO]; [textField setEditable: NO]; @@ -262,17 +259,20 @@ [_c_view addSubview:[textField autorelease]]; // Host message - textField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,48,184,21)]; - [textField setAlignment: NSLeftTextAlignment]; - [textField setBordered: NO]; - [textField setEditable: YES]; - [textField setBezeled: YES]; - [textField setDrawsBackground: YES]; - [textField setStringValue:@"localhost"]; - [_c_view addSubview:[textField autorelease]]; + buildTargetHostField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,24,184,21)]; + [buildTargetHostField setAlignment: NSLeftTextAlignment]; + [buildTargetHostField setBordered: NO]; + [buildTargetHostField setEditable: YES]; + [buildTargetHostField setBezeled: YES]; + [buildTargetHostField setDrawsBackground: YES]; + [buildTargetHostField setStringValue:@"localhost"]; + [buildTargetHostField setDelegate:self]; + [buildTargetHostField setTarget:self]; + [buildTargetHostField setAction:@selector(setHost:)]; + [_c_view addSubview:[buildTargetHostField autorelease]]; // Args - textField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,68,60,21)]; + textField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,44,60,21)]; [textField setAlignment: NSRightTextAlignment]; [textField setBordered: NO]; [textField setEditable: NO]; @@ -282,19 +282,20 @@ [_c_view addSubview:[textField autorelease]]; // Args message - textField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,68,184,21)]; - [textField setAlignment: NSLeftTextAlignment]; - [textField setBordered: NO]; - [textField setEditable: YES]; - [textField setBezeled: YES]; - [textField setDrawsBackground: YES]; - [textField setStringValue:@""]; - [_c_view addSubview:[textField autorelease]]; + buildTargetArgsField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,44,184,21)]; + [buildTargetArgsField setAlignment: NSLeftTextAlignment]; + [buildTargetArgsField setBordered: NO]; + [buildTargetArgsField setEditable: YES]; + [buildTargetArgsField setBezeled: YES]; + [buildTargetArgsField setDrawsBackground: YES]; + [buildTargetArgsField setStringValue:@""]; + [buildTargetArgsField setDelegate:self]; + [buildTargetArgsField setTarget:self]; + [buildTargetArgsField setAction:@selector(setArguments:)]; + [_c_view addSubview:[buildTargetArgsField autorelease]]; // Redisplay! [browser loadColumnZero]; - - _needsReleasing = YES; } @end @@ -308,18 +309,8 @@ - (id)init { if ((self = [super init])) { - _buildTarget = defaultTarget; - - _needsReleasing = NO; - -#if defined(GNUSTEP) + buildOptions = [[NSMutableDictionary alloc] init]; [self _initUI]; -#else - if(![NSBundle loadNibNamed:@"Project.nib" owner:self]) { - [[NSException exceptionWithName:NIB_NOT_FOUND_EXCEPTION reason:@"Could not load Project.gmodel" userInfo:nil] raise]; - return nil; - } -#endif } return self; } @@ -351,11 +342,11 @@ [projectPath release]; [projectDict release]; - if (_needsReleasing) { - [browserController release]; - [projectWindow release]; - [buildTargetPanel release]; - } + [browserController release]; + [projectWindow release]; + [buildTargetPanel release]; + + [buildOptions release]; [super dealloc]; } @@ -369,6 +360,38 @@ return browserController; } +- (NSString *)selectedRootCategory +{ + return [self projectKeyForKeyPath:[browserController pathOfSelectedFile]]; +} + +- (NSArray *)fileExtensionsForCategory:(NSString *)key +{ + if ([key isEqualToString:PCGModels]) { + return [NSArray arrayWithObjects:@"gmodel",@"gorm",nil]; + } + else if ([key isEqualToString:PCClasses]) { + return [NSArray arrayWithObjects:@"m",nil]; + } + else if ([key isEqualToString:PCHeaders]) { + return [NSArray arrayWithObjects:@"h",nil]; + } + else if ([key isEqualToString:PCOtherSources]) { + return [NSArray arrayWithObjects:@"c",@"C",nil]; + } + else if ([key isEqualToString:PCLibraries]) { + return [NSArray arrayWithObjects:@"so",@"a",@"lib",nil]; + } + else if ([key isEqualToString:PCSubprojects]) { + return [NSArray arrayWithObjects:@"subproj",nil]; + } + else if ([key isEqualToString:PCImages]) { + return [NSArray arrayWithObjects:@"tiff",@"TIFF",@"jpg",@"JPG",@"jpeg",@"JPEG",@"bmp",@"BMP",nil]; + } + + return nil; +} + - (void)setProjectName:(NSString *)aName { [projectName autorelease]; @@ -408,13 +431,13 @@ - (void)setProjectBuilder:(id)aBuilder { - [projectBuilder autorelease]; - projectBuilder = [aBuilder retain]; + [projectManager autorelease]; + projectManager = [aBuilder retain]; } - (id)projectBuilder { - return projectBuilder; + return projectManager; } //=========================================================================================== @@ -465,6 +488,34 @@ // ==== Miscellaneous //=========================================================================================== +- (void)editSelectedFile:(NSString *)file +{ + // NSLayoutManager *_lm = [textView layoutManager]; + // NSTextStorage *_ts = [[NSTextStorage alloc] initWithString:file]; + + /* + [_ts beginEditing]; + [[_ts mutableString] setString:file]; + [_ts endEditing]; + */ + + /* + if (_lm) { + [_lm replaceTextStorage:_ts]; + } + */ + + [textView setString:file]; + // [textView structure:self]; + [textView display]; + // [_ts autorelease]; +} + +- (void)structureEditedFile:(id)sender +{ + [textView structure:self]; +} + - (BOOL)doesAcceptFile:(NSString *)file forKey:(NSString *)type { if ([[projectDict allKeys] containsObject:type]) { @@ -489,7 +540,7 @@ } if ([files containsObject:newFile]) { - NSRunAlertPanel(@"Attention!",@"The file %@ is already contained in this project!",@"OK",nil,nil,newFile); + NSRunAlertPanel(@"Attention!",@"The file %@ is already part of this project!",@"OK",nil,nil,newFile); return; } @@ -522,6 +573,10 @@ NSString *file = [browserController nameOfSelectedFile]; NSMutableArray *array; NSString *key; + NSString *otherKey; + NSString *ext; + NSString *fn; + BOOL ret = NO; if (!file) { return NO; @@ -530,11 +585,43 @@ key = [self projectKeyForKeyPath:[browserController pathOfSelectedFile]]; [self removeFile:file forKey:key]; + if ([key isEqualToString:PCClasses]) { + otherKey = PCHeaders; + ext = [NSString stringWithString:@"h"]; + + fn = [file stringByDeletingPathExtension]; + fn = [fn stringByAppendingPathExtension:ext]; + + if ([self doesAcceptFile:fn forKey:otherKey] == NO) { + ret = NSRunAlertPanel(@"Removing Header?",@"Should %@ be removed from the project %@ as well?",@"Yes",@"No",nil,fn,[self projectName]); + } + } + else if ([key isEqualToString:PCHeaders]) { + otherKey = PCClasses; + ext = [NSString stringWithString:@"m"]; + + fn = [file stringByDeletingPathExtension]; + fn = [fn stringByAppendingPathExtension:ext]; + + if ([self doesAcceptFile:fn forKey:otherKey] == NO) { + ret = NSRunAlertPanel(@"Removing Class?",@"Should %@ be removed from the project %@ as well?",@"Yes",@"No",nil,fn,[self projectName]); + } + } + + if (ret) { + [self removeFile:fn forKey:otherKey]; + } + // Remove the file permanently?! if (yn) { NSString *pth = [projectPath stringByAppendingPathComponent:file]; [[NSFileManager defaultManager] removeFileAtPath:pth handler:nil]; + + if (ret) { + pth = [projectPath stringByAppendingPathComponent:fn]; + [[NSFileManager defaultManager] removeFileAtPath:pth handler:nil]; + } } return YES; @@ -641,7 +728,7 @@ - (void)showInspector:(id)sender { - [projectBuilder showInspectorForProject:self]; + [projectManager showInspectorForProject:self]; } - (id)updatedAttributeView @@ -661,74 +748,34 @@ - (void)showBuildTargetPanel:(id)sender { - [buildTargetPanel center]; + if (![buildTargetPanel isVisible]) { + [buildTargetPanel center]; + } [buildTargetPanel makeKeyAndOrderFront:self]; } -- (void)setTarget:(id)sender -{ - _buildTarget = [buildTargetPopup indexOfSelectedItem]; -} - - (void)setHost:(id)sender { - NSLog(@"Setting host..."); + NSString *host = [buildTargetHostField stringValue]; + [buildOptions setObject:host forKey:BUILD_HOST_KEY]; + + NSLog(@"New host %@",host); } - (void)setArguments:(id)sender { - NSLog(@"Setting args..."); + NSString *args = [buildTargetArgsField stringValue]; + [buildOptions setObject:args forKey:BUILD_ARGS_KEY]; } - (void)build:(id)sender { - BOOL ret = YES; - NSString *target = [buildTargetPopup titleOfSelectedItem]; - NSMutableDictionary *optionDict = [NSMutableDictionary dictionary]; - - [buildStatusField setStringValue:@"Building..."]; - - // Check the panel for this option! - if ([target isEqualToString:@"Debug"]) { - [optionDict setObject:TARGET_MAKE_DEBUG forKey:BUILD_KEY]; - } - if ([target isEqualToString:@"Profile"]) { - [optionDict setObject:TARGET_MAKE_PROFILE forKey:BUILD_KEY]; - } - if ([target isEqualToString:@"Install"]) { - [optionDict setObject:TARGET_MAKE_INSTALL forKey:BUILD_KEY]; - } - else { - [optionDict setObject:TARGET_MAKE forKey:BUILD_KEY]; - } - - [[PCProjectBuilder sharedBuilder] buildProject:self options:optionDict]; - - if (ret) { - [buildStatusField setStringValue:@"Build completed!"]; - } - else { - [buildStatusField setStringValue:@"Build failed!"]; - } + [[PCProjectBuilder sharedBuilder] showPanelWithProject:self options:buildOptions]; } -- (void)clean:(id)sender +- (NSDictionary *)buildOptions { - BOOL ret = YES; - NSMutableDictionary *optionDict = [NSMutableDictionary dictionary]; - - [buildStatusField setStringValue:@"Cleaning..."]; - - // Check the panel for this option! - [optionDict setObject:TARGET_MAKE_CLEAN forKey:BUILD_KEY]; - [[PCProjectBuilder sharedBuilder] buildProject:self options:optionDict]; - - if (ret) { - [buildStatusField setStringValue:@"Cleaning completed!"]; - } - else { - [buildStatusField setStringValue:@"Cleaning failed!"]; - } + return (NSDictionary *)buildOptions; } @end @@ -758,7 +805,8 @@ } key = [[keyPath componentsSeparatedByString:@"/"] lastObject]; - if ([[rootCategories allKeys] containsObject:key] || [[projectDict objectForKey:PCSubprojects] containsObject:key]) { + if ([[rootCategories allKeys] containsObject:key] || + [[projectDict objectForKey:PCSubprojects] containsObject:key]) { return YES; } @@ -767,9 +815,9 @@ - (NSString *)projectKeyForKeyPath:(NSString *)kp { - NSString *type = [[kp componentsSeparatedByString:@"/"] objectAtIndex:1]; - - return [rootCategories objectForKey:type]; + NSString *type = [[kp componentsSeparatedByString:@"/"] objectAtIndex:1]; + + return [rootCategories objectForKey:type]; } @end @@ -778,23 +826,40 @@ - (void)windowDidBecomeKey:(NSNotification *)aNotification { - [projectBuilder setActiveProject:self]; + [projectManager setActiveProject:self]; } - (void)windowDidBecomeMain:(NSNotification *)aNotification { - [projectBuilder setActiveProject:self]; + [projectManager setActiveProject:self]; } - (void)windowWillClose:(NSNotification *)aNotification { + id object = [aNotification object]; + + if (object == buildTargetPanel) { + } + else if (object == [self projectWindow]) { if ([[self projectWindow] isDocumentEdited]) { - if (NSRunAlertPanel(@"Project changed!",@"The project %@ has unsaved files! Should they be saved before closing it?",@"Yes",@"No",nil,[self projectName])) { - [self save]; - } + if (NSRunAlertPanel(@"Project changed!",@"The project %@ has unsaved files! Should they be saved before closing it?",@"Yes",@"No",nil,[self projectName])) { + [self save]; + } } + // The PCProjectController is our delegate! - [projectBuilder closeProject:self]; + [projectManager closeProject:self]; + } } @end + +@implementation PCProject (TextDelegate) + +- (void)textDidEndEditing:(NSNotification *)aNotification +{ +} + +@end + + diff --git a/PCLib/PCProjectBuilder.h b/PCLib/PCProjectBuilder.h index 3ad3c7c..754923d 100644 --- a/PCLib/PCProjectBuilder.h +++ b/PCLib/PCProjectBuilder.h @@ -28,15 +28,6 @@ @class PCProject; -#define BUILD_KEY @"BuildKey" -#define BUILD_OPTIONS_KEY @"BuildOptionsKey" - -#define TARGET_MAKE @"Make" -#define TARGET_MAKE_DEBUG @"MakeDebug" -#define TARGET_MAKE_PROFILE @"MakeProfile" -#define TARGET_MAKE_INSTALL @"MakeInstall" -#define TARGET_MAKE_CLEAN @"MakeClean" - @class NSWindow; @class NSTextView; @@ -48,6 +39,9 @@ NSMutableDictionary *buildTasks; NSString *makePath; + + PCProject *currentProject; + NSDictionary *currentOptions; } + (id)sharedBuilder; @@ -55,6 +49,16 @@ - (id)init; - (void)dealloc; -- (BOOL)buildProject:(PCProject *)aProject options:(NSDictionary *)optionDict; +- (void)showPanelWithProject:(PCProject *)proj options:(NSDictionary *)options; + +- (void)build:(id)sender; +- (void)clean:(id)sender; +- (void)install:(id)sender; + +- (void)projectDidChange:(NSNotification *)aNotif; @end + + + + diff --git a/PCLib/PCProjectBuilder.m b/PCLib/PCProjectBuilder.m index 3daed46..72a91ac 100644 --- a/PCLib/PCProjectBuilder.m +++ b/PCLib/PCProjectBuilder.m @@ -26,6 +26,7 @@ #import "PCProjectBuilder.h" #import "PCProject.h" +#import "PCProjectManager.h" #import @@ -44,11 +45,12 @@ NSMiniaturizableWindowMask | NSResizableWindowMask; NSSplitView *split; NSScrollView *scrollView1; - NSScrollView *scrollView2; NSTextView *textView2; - + NSMatrix* matrix; NSRect _w_frame; + NSButtonCell* buttonCell = [[[NSButtonCell alloc] init] autorelease]; + id button; /* * Build Window @@ -67,16 +69,16 @@ logOutput = [[NSTextView alloc] initWithFrame:NSMakeRect(0,0,472,88)]; [logOutput setMaxSize:NSMakeSize(1e7, 1e7)]; [logOutput setVerticallyResizable:YES]; - [logOutput setHorizontallyResizable:YES]; + [logOutput setHorizontallyResizable:NO]; [logOutput setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; - [logOutput setBackgroundColor:[NSColor whiteColor]]; + [logOutput setBackgroundColor:[NSColor lightGrayColor]]; [[logOutput textContainer] setWidthTracksTextView:YES]; scrollView1 = [[NSScrollView alloc] initWithFrame:NSMakeRect (0,0,496,92)]; [scrollView1 setDocumentView:logOutput]; [logOutput setMinSize:NSMakeSize(0.0,[scrollView1 contentSize].height)]; [[logOutput textContainer] setContainerSize:NSMakeSize([scrollView1 contentSize].width,1e7)]; - [scrollView1 setHasHorizontalScroller: YES]; + [scrollView1 setHasHorizontalScroller: NO]; [scrollView1 setHasVerticalScroller: YES]; [scrollView1 setBorderType: NSBezelBorder]; [scrollView1 setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; @@ -89,7 +91,7 @@ textView2 = [[NSTextView alloc] initWithFrame:NSMakeRect(0,0,472,88)]; [textView2 setMaxSize:NSMakeSize(1e7, 1e7)]; [textView2 setVerticallyResizable:YES]; - [textView2 setHorizontallyResizable:YES]; + [textView2 setHorizontallyResizable:NO]; [textView2 setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [textView2 setBackgroundColor:[NSColor whiteColor]]; [[textView2 textContainer] setWidthTracksTextView:YES]; @@ -98,19 +100,66 @@ [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 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(8,0,496,288)] autorelease]; [split setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)]; [split addSubview: scrollView1]; [split addSubview: scrollView2]; _c_view = [buildWindow contentView]; [_c_view addSubview:split]; + + /* + * 5 build Buttons + */ + + _w_frame = NSMakeRect(8,292,244,24); + matrix = [[[NSMatrix alloc] initWithFrame: _w_frame + mode: NSHighlightModeMatrix + prototype: buttonCell + numberOfRows: 1 + numberOfColumns: 5] autorelease]; + [matrix sizeToCells]; + [matrix setSelectionByRect:YES]; + [matrix setAutoresizingMask: (NSViewMaxXMargin | NSViewMinYMargin)]; + [matrix setTarget:self]; + [matrix setAction:@selector(build:)]; + [_c_view addSubview:matrix]; + + button = [matrix cellAtRow:0 column:0]; + [button setTag:0]; + [button setImagePosition:NSNoImage]; + [button setButtonType:NSMomentaryPushButton]; + [button setTitle:@"Build"]; + + button = [matrix cellAtRow:0 column:1]; + [button setTag:1]; + [button setImagePosition:NSNoImage]; + [button setButtonType:NSMomentaryPushButton]; + [button setTitle:@"Clean"]; + + button = [matrix cellAtRow:0 column:2]; + [button setTag:2]; + [button setImagePosition:NSNoImage]; + [button setButtonType:NSMomentaryPushButton]; + [button setTitle:@"Debug"]; + + button = [matrix cellAtRow:0 column:3]; + [button setTag:3]; + [button setImagePosition:NSNoImage]; + [button setButtonType:NSMomentaryPushButton]; + [button setTitle:@"Profile"]; + + button = [matrix cellAtRow:0 column:4]; + [button setTag:4]; + [button setImagePosition:NSNoImage]; + [button setButtonType:NSMomentaryPushButton]; + [button setTitle:@"Install"]; } @end @@ -133,12 +182,16 @@ static PCProjectBuilder *_builder; [self _initUI]; makePath = [[NSString stringWithString:@"/usr/bin/make"] retain]; buildTasks = [[NSMutableDictionary dictionary] retain]; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(projectDidChange:) name:ActiveProjectDidChangeNotification object:nil]; } return self; } - (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [buildWindow release]; [makePath release]; [buildTasks release]; @@ -146,9 +199,21 @@ static PCProjectBuilder *_builder; [super dealloc]; } -- (BOOL)buildProject:(PCProject *)aProject options:(NSDictionary *)optionDict +- (void)showPanelWithProject:(PCProject *)proj options:(NSDictionary *)options; +{ + if (![buildWindow isVisible]) { + [buildWindow center]; + } + [buildWindow makeKeyAndOrderFront:self]; + + currentProject = proj; + currentOptions = options; + + [buildWindow setTitle:[proj projectName]]; +} + +- (void)build:(id)sender { - BOOL ret = NO; NSString *tg = nil; NSTask *makeTask; NSMutableArray *args; @@ -156,73 +221,82 @@ static PCProjectBuilder *_builder; NSPipe *logPipe; NSFileHandle *readHandle; NSData *inData = nil; + NSDictionary *optionDict; + + if (!currentProject) { + return; + } logPipe = [NSPipe pipe]; readHandle = [logPipe fileHandleForReading]; - - NSAssert(aProject,@"No project provided!"); - 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]; - } - 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]; - } + optionDict = [currentProject buildOptions]; + args = [NSMutableArray array]; - [makeTask setCurrentDirectoryPath:[aProject projectPath]]; - [makeTask setLaunchPath:makePath]; + switch ([[sender selectedCell] tag]) { + case 0: + break; + case 1: + [args addObject:@"clean"]; + break; + case 2: + [args addObject:@"debug=yes"]; + break; + case 3: + [args addObject:@"profile=yes"]; + [args addObject:@"static=yes"]; + break; + case 4: + [args addObject:@"install"]; + break; + } - [makeTask setStandardOutput:logPipe]; - [makeTask setStandardError:logPipe]; + [makeTask setArguments:args]; - 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]; + [makeTask setCurrentDirectoryPath:[currentProject projectPath]]; + [makeTask setLaunchPath:makePath]; + + [makeTask setStandardOutput:logPipe]; + [makeTask setStandardError:logPipe]; + + [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]; } - return ret; + [makeTask waitUntilExit]; + [makeTask autorelease]; +} + +- (void)clean:(id)sender +{ +} + +- (void)install:(id)sender +{ +} + +- (void)projectDidChange:(NSNotification *)aNotif +{ + PCProject *project = [aNotif object]; + + if (project) { + currentProject = project; + [buildWindow setTitle:[project projectName]]; + } + else { + currentProject = nil; + [buildWindow orderOut:self]; + } } @end diff --git a/PCLib/PCProjectManager.h b/PCLib/PCProjectManager.h index 3e1aa23..6600956 100644 --- a/PCLib/PCProjectManager.h +++ b/PCLib/PCProjectManager.h @@ -167,3 +167,7 @@ - (BOOL)projectManager:(id)sender shouldOpenProject:(PCProject *)aProject; @end + +extern NSString *ActiveProjectDidChangeNotification; + + diff --git a/PCLib/PCProjectManager.m b/PCLib/PCProjectManager.m index 6e3278a..c299ccd 100644 --- a/PCLib/PCProjectManager.m +++ b/PCLib/PCProjectManager.m @@ -31,6 +31,8 @@ #import #endif +NSString *ActiveProjectDidChangeNotification = @"ActiveProjectDidChange"; + @interface PCProjectManager (CreateUI) - (void)_initUI; @@ -155,18 +157,20 @@ - (void)setActiveProject:(PCProject *)aProject { - if (aProject != activeProject) { - activeProject = aProject; + if (aProject != activeProject) { + activeProject = aProject; - //~ Is this needed? - if (activeProject) { - [[activeProject projectWindow] makeKeyAndOrderFront:self]; - } - - if ([inspector isVisible]) { - [self inspectorPopupDidChange:inspectorPopup]; - } + [[NSNotificationCenter defaultCenter] postNotificationName:ActiveProjectDidChangeNotification object:activeProject]; + + //~ Is this needed? + if (activeProject) { + [[activeProject projectWindow] makeKeyAndOrderFront:self]; } + + if ([inspector isVisible]) { + [self inspectorPopupDidChange:inspectorPopup]; + } + } } - (void)saveAllProjects @@ -198,6 +202,8 @@ concretBuilder = [NSClassFromString([builders objectForKey:builderKey]) sharedCreator]; if ((project = [concretBuilder openProjectAt:aPath])) { + [[project projectWindow] center]; + return project; } } @@ -250,6 +256,8 @@ return NO; } + [[project projectWindow] center]; + [project setProjectBuilder:self]; [loadedProjects setObject:project forKey:aPath]; [self setActiveProject:project]; @@ -271,38 +279,31 @@ - (void)inspectorPopupDidChange:(id)sender { - NSView *view = nil; - - if (![self activeProject]) { - return; - } - - switch([sender indexOfSelectedItem]) { - case 0: - view = [[[self activeProject] updatedAttributeView] retain]; - break; - case 1: - view = [[[self activeProject] updatedProjectView] retain]; - break; - case 2: - view = [[[self activeProject] updatedFilesView] retain]; - break; - } - [(NSBox *)inspectorView setContentView:view]; - [inspectorView display]; + NSView *view = nil; + + if (![self activeProject]) { + return; + } + + switch([sender indexOfSelectedItem]) { + case 0: + view = [[[self activeProject] updatedAttributeView] retain]; + break; + case 1: + view = [[[self activeProject] updatedProjectView] retain]; + break; + case 2: + view = [[[self activeProject] updatedFilesView] retain]; + break; + } + [(NSBox *)inspectorView setContentView:view]; + [inspectorView display]; } - (void)showInspectorForProject:(PCProject *)aProject { if (!inspectorPopup) { -#if defined(GNUSTEP) [self _initUI]; -#else - if(![NSBundle loadNibNamed:@"Inspector.nib" owner:self]) { - [[NSException exceptionWithName:NIB_NOT_FOUND_EXCEPTION reason:@"Could not load Inspector.gmodel" userInfo:nil] raise]; - return nil; - } -#endif [inspectorPopup removeAllItems]; [inspectorPopup addItemWithTitle:@"Build Attributes"]; @@ -460,3 +461,5 @@ @end + + diff --git a/PCLib/PCServer.h b/PCLib/PCServer.h index e7e3864..f91b3b3 100644 --- a/PCLib/PCServer.h +++ b/PCLib/PCServer.h @@ -42,7 +42,7 @@ extern NSString *PCProjectDidUpdateNotification; extern NSString *PCFileAddedToProjectNotification; extern NSString *PCFileRemovedFromProjectNotification; extern NSString *PCFileWillOpenNotification; -extern NSString *PCFileDidOpenNotification; +extern NSString *PCFileDidOpenNotification; extern NSString *PCFileWillCloseNotification; extern NSString *PCFileDidCloseNotification; @@ -64,11 +64,28 @@ extern NSString *PCProjectBuildDidStopNotification; @interface PCServer : NSObject { NSMutableArray *clients; + NSMutableArray *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; diff --git a/PCLib/PCServer.m b/PCLib/PCServer.m index 33eb332..a90b2b4 100644 --- a/PCLib/PCServer.m +++ b/PCLib/PCServer.m @@ -26,23 +26,135 @@ #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 = [[NSMutableArray 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 +{ + NSWindow *editorWindow = [self editorForFile:file]; + + [editorWindow setDelegate:self]; + [editorWindow center]; + [editorWindow makeKeyAndOrderFront:self]; + + [openDocuments addObject:editorWindow]; +} + +- (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:NO]; + PCEditorView *textView; + NSScrollView *scrollView; + + NSString *text = [NSString stringWithContentsOfFile:aFile]; + + [window setMinSize:NSMakeSize(512,320)]; + [window setTitle:[aFile lastPathComponent]]; + + textView = [[PCEditorView alloc] initWithFrame:NSMakeRect(0,0,498,306)]; + [textView setMaxSize:NSMakeSize(1e7, 1e7)]; + [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 removeObject:window]; +} + +//---------------------------------------------------------------------------- +// Server +//---------------------------------------------------------------------------- + - (BOOL)registerProjectSubmenu:(NSMenu *)menu { } @@ -91,7 +203,7 @@ { } -- (BOOL)querTouchedFiles +- (BOOL)queryTouchedFiles { } diff --git a/PCLib/ProjectCenter.h b/PCLib/ProjectCenter.h index 37d09d1..58b6054 100644 --- a/PCLib/ProjectCenter.h +++ b/PCLib/ProjectCenter.h @@ -42,6 +42,7 @@ #define BundlePaths @"BundlePaths" #define SuccessSound @"SuccessSound" #define FailureSound @"FailureSound" +#define ExternalEditor @"ExternalEditor" #define PCAppDidInitNotification @"PCAppDidInit" #define PCAppWillTerminateNotification @"PCAppWillTerminate" @@ -69,3 +70,8 @@ #import "ProjectBuilder.h" #import "FileCreator.h" #import "PCProjectBuilder.h" +#import "PCEditorView.h" + + + + diff --git a/PCLib/Server.h b/PCLib/Server.h index 463d61c..aa036f2 100644 --- a/PCLib/Server.h +++ b/PCLib/Server.h @@ -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; diff --git a/PCLibProj/ChangeLog b/PCLibProj/ChangeLog new file mode 100644 index 0000000..a296da5 --- /dev/null +++ b/PCLibProj/ChangeLog @@ -0,0 +1,22 @@ +2000-09-17 14:13 robert + + * PCLibMakefileFactory.m: makefile improvements + +2000-08-27 21:13 robert + + * PCLibMakefileFactory.h, PCLibProj.h, GNUmakefile, + GNUmakefile.postamble, GNUmakefile.preamble, Info.table, + PCLibProj.m, Makefile, Makefile.postamble, Makefile.preamble, + PB.project, PC.proj, PCLibMakefileFactory.m, PCLibProject.h, + PCLibProject.m, h.template, m.template, LibProject.gmodel, Version: + Initial revision + +2000-08-27 21:13 robert + + * PCLibMakefileFactory.h, PCLibProj.h, GNUmakefile, + GNUmakefile.postamble, GNUmakefile.preamble, Info.table, + PCLibProj.m, Makefile, Makefile.postamble, Makefile.preamble, + PB.project, PC.proj, PCLibMakefileFactory.m, PCLibProject.h, + PCLibProject.m, h.template, m.template, LibProject.gmodel, Version: + Initial import + diff --git a/PCLibProj/PCLibMakefileFactory.m b/PCLibProj/PCLibMakefileFactory.m index 95a90ac..632cce8 100644 --- a/PCLibProj/PCLibMakefileFactory.m +++ b/PCLibProj/PCLibMakefileFactory.m @@ -83,13 +83,17 @@ 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:@"%@_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 += ",prName]]; if ([[prDict objectForKey:PCLibraries] count]) { enumerator = [[prDict objectForKey:PCLibraries] objectEnumerator]; @@ -135,8 +139,6 @@ static PCLibMakefileFactory *_factory = nil; [string appendString:@"\n\n"]; - [string appendString:[NSString stringWithFormat:@"%@_HEADER_FILES_INSTALL_DIR=/%@\n",libName,prName]]; - [string appendString:@"-include GNUmakefile.preamble\n"]; [string appendString:@"-include GNUmakefile.local\n"]; [string appendString:@"include $(GNUSTEP_MAKEFILES)/library.make\n"]; diff --git a/PCToolProj/GNUmakefile.preamble b/PCToolProj/GNUmakefile.preamble index f61a96d..49b00fc 100644 --- a/PCToolProj/GNUmakefile.preamble +++ b/PCToolProj/GNUmakefile.preamble @@ -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 += diff --git a/ProjectCenter/ChangeLog b/ProjectCenter/ChangeLog new file mode 100644 index 0000000..974c328 --- /dev/null +++ b/ProjectCenter/ChangeLog @@ -0,0 +1,85 @@ +2000-09-20 17:46 robert + + * ProjectCenter_main.m: Added the font panel stuff + +2000-09-20 12:35 robert + + * PCPrefController.m: some more work on the preferences + +2000-09-17 16:40 robert + + * PCPrefController.h, PCPrefController.m: Basic preferences + handling + +2000-09-17 14:12 robert + + * GNUmakefile, Info-project.plist, PCAppController+MenuHandling.h, + PCAppController+MenuHandling.m, PCAppController.m, + PCMenuController.m, ProjectCenter_main.m, ProjectCentre_build.tiff, + ProjectCentre_find.tiff, ProjectCentre_prefs.tiff, + ProjectCentre_settings.tiff, ProjectCentre_uml.tiff: Updated some + images, fixed some bugs and enhanced the featurelist... + +2000-09-14 11:04 robert + + * PCAppController.m: another minor flaw + +2000-09-14 10:28 robert + + * PCAppController.m: fixed some bugs introduced by removing the + gmodel + +2000-09-13 12:45 robert + + * GNUmakefile, PCAppController+MenuHandling.h, + PCAppController+MenuHandling.m, PCAppController.h, + PCAppController.m, PCMenuController.h, PCMenuController.m, + ProjectCenter_main.m, English.lproj/ProjectCenter.gmodel: removed + the gmodels completely from ProjectCenter.app + +2000-09-03 21:59 robert + + * GNUmakefile.preamble, PC.project, PCAppController.m: minor stuff + +2000-09-03 21:15 robert + + * PCAppController.m: New DO code + +2000-08-27 21:12 robert + + * Makefile.preamble, PB.project, h.template, m.template, Makefile, + ProjectCenter_main.m, Makefile.postamble, PCAppController.h, + PCAppController.m, PCPrefController.h, PCPrefController.m, + PCFindController.h, PCFindController.m, PCInfoController.h, + PCInfoController.m, PCLogController.h, PCLogController.m, + PCMenuController.h, ProjectCenter.tiff, PCMenuController.m, + GNUmakefile, GNUmakefile.postamble, GNUmakefile.preamble, + PC.project, FileIcon_.m.tiff, ProjectCentre_documentation.tiff, + ProjectCentre_cvs.tiff, ProjectCentre_prefs.tiff, + ProjectCenter.app.tiff, FileIcon_rtf.tiff, + ProjectCentre_files.tiff, FileIcon_.c.tiff, + ProjectCentre_clean.tiff, ProjectCentre_find.tiff, + FileIcon_.h.tiff, Info-project.plist, ProjectCentre_add.tiff, + ProjectCentre_build.tiff, ProjectCentre_run.tiff, + ProjectCentre_uml.tiff, English.lproj/ProjectCenter.gmodel: Initial + revision + +2000-08-27 21:12 robert + + * Makefile.preamble, PB.project, h.template, m.template, Makefile, + ProjectCenter_main.m, Makefile.postamble, PCAppController.h, + PCAppController.m, PCPrefController.h, PCPrefController.m, + PCFindController.h, PCFindController.m, PCInfoController.h, + PCInfoController.m, PCLogController.h, PCLogController.m, + PCMenuController.h, ProjectCenter.tiff, PCMenuController.m, + GNUmakefile, GNUmakefile.postamble, GNUmakefile.preamble, + PC.project, FileIcon_.m.tiff, ProjectCentre_documentation.tiff, + ProjectCentre_cvs.tiff, ProjectCentre_prefs.tiff, + ProjectCenter.app.tiff, FileIcon_rtf.tiff, + ProjectCentre_files.tiff, FileIcon_.c.tiff, + ProjectCentre_clean.tiff, ProjectCentre_find.tiff, + FileIcon_.h.tiff, Info-project.plist, ProjectCentre_add.tiff, + ProjectCentre_build.tiff, ProjectCentre_run.tiff, + ProjectCentre_uml.tiff, English.lproj/ProjectCenter.gmodel: Initial + import + diff --git a/ProjectCenter/English.lproj/ProjectCenter.gmodel b/ProjectCenter/English.lproj/ProjectCenter.gmodel deleted file mode 100755 index 17573e3..0000000 --- a/ProjectCenter/English.lproj/ProjectCenter.gmodel +++ /dev/null @@ -1,1734 +0,0 @@ -{ - "Object 1" = { - elements = ( - "Object 2", - "Object 114", - "Object 115", - "Object 116", - "Object 117", - "Object 118", - "Object 119", - "Object 120", - "Object 121", - "Object 122" - ); - 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 = ProjectCenter; - }; - "Object 12" = { - elements = ( - "Object 13", - "Object 20", - "Object 36", - "Object 46", - "Object 53", - "Object 98", - "Object 104", - "Object 110", - "Object 112", - "Object 113" - ); - 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 = 7; 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 = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Info Panel..."; - }; - "Object 18" = { - action = nil; - image = nil; - isEnabled = YES; - 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 = Project; - }; - "Object 21" = { - autoenablesItems = YES; - isa = NSMenu; - itemArray = "Object 22"; - title = Project; - }; - "Object 22" = { - elements = ( - "Object 23", - "Object 24", - "Object 25", - "Object 26", - "Object 27", - "Object 28", - "Object 29", - "Object 30" - ); - isa = NSMutableArray; - }; - "Object 23" = { - action = nil; - image = nil; - isEnabled = NO; - isa = NSMenuItem; - keyEquivalent = o; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Open...; - }; - "Object 24" = { - action = nil; - image = nil; - isEnabled = NO; - isa = NSMenuItem; - keyEquivalent = n; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = New; - }; - "Object 25" = { - action = nil; - image = nil; - isEnabled = NO; - isa = NSMenuItem; - keyEquivalent = s; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Save; - }; - "Object 26" = { - action = nil; - image = nil; - isEnabled = NO; - isa = NSMenuItem; - keyEquivalent = S; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Save As..."; - }; - "Object 27" = { - action = nil; - image = nil; - isEnabled = NO; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Save All"; - }; - "Object 28" = { - action = nil; - image = nil; - isEnabled = NO; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Revert to Saved"; - }; - "Object 29" = { - action = nil; - image = nil; - isEnabled = NO; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Close; - }; - "Object 30" = { - action = "submenuAction:"; - image = "Object 14"; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = "Object 31"; - title = Subproject; - }; - "Object 31" = { - autoenablesItems = YES; - isa = NSMenu; - itemArray = "Object 32"; - title = Subproject; - }; - "Object 32" = { - elements = ("Object 33", "Object 34", "Object 35"); - isa = NSMutableArray; - }; - "Object 33" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Add; - }; - "Object 34" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = New; - }; - "Object 35" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Remove; - }; - "Object 36" = { - action = "submenuAction:"; - image = "Object 14"; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = "Object 37"; - title = File; - }; - "Object 37" = { - autoenablesItems = YES; - isa = NSMenu; - itemArray = "Object 38"; - title = File; - }; - "Object 38" = { - elements = ( - "Object 39", - "Object 40", - "Object 41", - "Object 42", - "Object 43", - "Object 44", - "Object 45" - ); - isa = NSMutableArray; - }; - "Object 39" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = O; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Open; - }; - "Object 40" = { - action = nil; - image = nil; - isEnabled = NO; - isa = NSMenuItem; - keyEquivalent = A; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Add File"; - }; - "Object 41" = { - action = nil; - image = nil; - isEnabled = NO; - isa = NSMenuItem; - keyEquivalent = N; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "New in Project"; - }; - "Object 42" = { - action = nil; - image = nil; - isEnabled = NO; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Remove File"; - }; - "Object 43" = { - action = nil; - image = nil; - isEnabled = NO; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Save; - }; - "Object 44" = { - action = nil; - image = nil; - isEnabled = NO; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Save As..."; - }; - "Object 45" = { - action = nil; - image = nil; - isEnabled = NO; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Revert to Saved"; - }; - "Object 46" = { - action = "submenuAction:"; - image = "Object 14"; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = "Object 47"; - title = Edit; - }; - "Object 47" = { - autoenablesItems = YES; - isa = NSMenu; - itemArray = "Object 48"; - title = Edit; - }; - "Object 48" = { - elements = ("Object 49", "Object 50", "Object 51", "Object 52"); - isa = NSMutableArray; - }; - "Object 49" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = x; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Cut; - }; - "Object 50" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = c; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Copy; - }; - "Object 51" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = v; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Paste; - }; - "Object 52" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = a; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Select All"; - }; - "Object 53" = { - action = "submenuAction:"; - image = "Object 14"; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = "Object 54"; - title = Format; - }; - "Object 54" = { - autoenablesItems = YES; - isa = NSMenu; - itemArray = "Object 55"; - title = Format; - }; - "Object 55" = { - elements = ("Object 56", "Object 87", "Object 97"); - isa = NSMutableArray; - }; - "Object 56" = { - action = "submenuAction:"; - image = "Object 14"; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = "Object 57"; - title = Font; - }; - "Object 57" = { - autoenablesItems = YES; - isa = NSMenu; - itemArray = "Object 58"; - title = Font; - }; - "Object 58" = { - elements = ( - "Object 59", - "Object 60", - "Object 61", - "Object 62", - "Object 63", - "Object 70", - "Object 76", - "Object 84", - "Object 85", - "Object 86" - ); - isa = NSMutableArray; - }; - "Object 59" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = t; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Font Panel..."; - }; - "Object 60" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = b; - representedObject = nil; - state = 0; - tag = 2; - target = nil; - title = Bold; - }; - "Object 61" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = i; - representedObject = nil; - state = 0; - tag = 1; - target = nil; - title = Italic; - }; - "Object 62" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Underline; - }; - "Object 63" = { - action = "submenuAction:"; - image = "Object 14"; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = "Object 64"; - title = Kern; - }; - "Object 64" = { - autoenablesItems = YES; - isa = NSMenu; - itemArray = "Object 65"; - title = Kern; - }; - "Object 65" = { - elements = ("Object 66", "Object 67", "Object 68", "Object 69"); - isa = NSMutableArray; - }; - "Object 66" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Use Default"; - }; - "Object 67" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Use None"; - }; - "Object 68" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Tighten; - }; - "Object 69" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Loosen; - }; - "Object 70" = { - action = "submenuAction:"; - image = "Object 14"; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = "Object 71"; - title = Ligature; - }; - "Object 71" = { - autoenablesItems = YES; - isa = NSMenu; - itemArray = "Object 72"; - title = Ligature; - }; - "Object 72" = { - elements = ("Object 73", "Object 74", "Object 75"); - isa = NSMutableArray; - }; - "Object 73" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Use Default"; - }; - "Object 74" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Use None"; - }; - "Object 75" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Use All"; - }; - "Object 76" = { - action = "submenuAction:"; - image = "Object 14"; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = "Object 77"; - title = Baseline; - }; - "Object 77" = { - autoenablesItems = YES; - isa = NSMenu; - itemArray = "Object 78"; - title = Baseline; - }; - "Object 78" = { - elements = ("Object 79", "Object 80", "Object 81", "Object 82", "Object 83"); - isa = NSMutableArray; - }; - "Object 79" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Use Default"; - }; - "Object 80" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Superscript; - }; - "Object 81" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Subscript; - }; - "Object 82" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Raise; - }; - "Object 83" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Lower; - }; - "Object 84" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Colors...; - }; - "Object 85" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = 3; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Copy Font"; - }; - "Object 86" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = 4; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Paste Font"; - }; - "Object 87" = { - action = "submenuAction:"; - image = "Object 14"; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = "Object 88"; - title = Text; - }; - "Object 88" = { - autoenablesItems = YES; - isa = NSMenu; - itemArray = "Object 89"; - title = Text; - }; - "Object 89" = { - elements = ( - "Object 90", - "Object 91", - "Object 92", - "Object 93", - "Object 94", - "Object 95", - "Object 96" - ); - isa = NSMutableArray; - }; - "Object 90" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Align Left"; - }; - "Object 91" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Center; - }; - "Object 92" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Justify; - }; - "Object 93" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Align Right"; - }; - "Object 94" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Show Ruler"; - }; - "Object 95" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = 1; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Copy Ruler"; - }; - "Object 96" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = 2; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Paste Ruler"; - }; - "Object 97" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = P; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Page Layout..."; - }; - "Object 98" = { - action = "submenuAction:"; - image = "Object 14"; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = "Object 99"; - title = Tools; - }; - "Object 99" = { - autoenablesItems = YES; - isa = NSMenu; - itemArray = "Object 100"; - title = Tools; - }; - "Object 100" = { - elements=("Object 101", "Object 102", "Object 103"); - isa = NSMutableArray; - }; - "Object 101" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Inspector...; - }; - "Object 102" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Loaded Projects..."; - }; - "Object 103" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = f; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Find Panel"; - }; - "Object 104" = { - action = "submenuAction:"; - image = "Object 14"; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = "Object 105"; - title = Windows; - }; - "Object 105" = { - autoenablesItems = YES; - isa = NSMenu; - itemArray = "Object 106"; - title = Windows; - }; - "Object 106" = { - elements = ("Object 107", "Object 108", "Object 109"); - isa = NSMutableArray; - }; - "Object 107" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Arrange in Front"; - }; - "Object 108" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = m; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Miniaturize Window"; - }; - "Object 109" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = w; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = "Close Window"; - }; - "Object 110" = { - action = "submenuAction:"; - image = "Object 14"; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = ""; - representedObject = nil; - state = 0; - tag = 0; - target = "Object 111"; - title = Services; - }; - "Object 111" = { - autoenablesItems = YES; - isa = NSMenu; - itemArray = "Object 7"; - title = Services; - }; - "Object 112" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = h; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Hide; - }; - "Object 113" = { - action = nil; - image = nil; - isEnabled = YES; - isa = NSMenuItem; - keyEquivalent = q; - representedObject = nil; - state = 0; - tag = 0; - target = nil; - title = Quit; - }; - "Object 114" = {className = PCInfoController; isa = IMCustomObject; }; - "Object 115" = {className = PCFindController; isa = IMCustomObject; }; - "Object 116" = {className = NSFontManager; isa = IMCustomObject; }; - "Object 117" = {className = PCLogController; isa = IMCustomObject; }; - "Object 118" = {className = PCPrefController; isa = IMCustomObject; }; - "Object 119" = {className = PCProjectManager; isa = IMCustomObject; }; - "Object 120" = {className = PCAppController; isa = IMCustomObject; }; - "Object 121" = {className = PCMenuController; isa = IMCustomObject; }; - "Object 122" = {className = PCFileManager; isa = IMCustomObject; }; - "Object 123" = { - elements = ( - "Object 124", - "Object 126", - "Object 128", - "Object 130", - "Object 132", - "Object 134", - "Object 136", - "Object 138", - "Object 140", - "Object 142", - "Object 144", - "Object 146", - "Object 148", - "Object 150", - "Object 152", - "Object 154", - "Object 156", - "Object 158", - "Object 160", - "Object 162", - "Object 164", - "Object 166", - "Object 168", - "Object 170", - "Object 172", - "Object 173", - "Object 175", - "Object 177", - "Object 179", - "Object 181", - "Object 183", - "Object 185", - "Object 187", - "Object 189", - "Object 191", - "Object 193", - "Object 195", - "Object 197", - "Object 199", - "Object 201", - "Object 203", - "Object 205", - "Object 207", - "Object 209", - "Object 210", - "Object 212", - "Object 214", - "Object 215", - "Object 216", - "Object 218", - "Object 219", - "Object 221", - "Object 223", - "Object 225", - "Object 227", - "Object 229", - "Object 231", - "Object 233", - "Object 235", - "Object 236", - "Object 238", - "Object 240", - "Object 242", - "Object 244", - "Object 246", - "Object 248", - "Object 249", - "Object 251" - ); - isa = NSMutableArray; - }; - "Object 124" = { - destination = nil; - isa = IMControlConnector; - label = "Object 125"; - source = "Object 49"; - }; - "Object 125" = {isa = NSString; string = "cut:"; }; - "Object 126" = { - destination = nil; - isa = IMControlConnector; - label = "Object 127"; - source = "Object 50"; - }; - "Object 127" = {isa = NSString; string = "copy:"; }; - "Object 128" = { - destination = nil; - isa = IMControlConnector; - label = "Object 129"; - source = "Object 51"; - }; - "Object 129" = {isa = NSString; string = "paste:"; }; - "Object 130" = { - destination = nil; - isa = IMControlConnector; - label = "Object 131"; - source = "Object 52"; - }; - "Object 131" = {isa = NSString; string = "selectAll:"; }; - "Object 132" = { - destination = "Object 2"; - isa = IMControlConnector; - label = "Object 133"; - source = "Object 113"; - }; - "Object 133" = {isa = NSString; string = "terminate:"; }; - "Object 134" = { - destination = "Object 2"; - isa = IMControlConnector; - label = "Object 135"; - source = "Object 112"; - }; - "Object 135" = {isa = NSString; string = "hide:"; }; - "Object 136" = { - destination = nil; - isa = IMControlConnector; - label = "Object 137"; - source = "Object 108"; - }; - "Object 137" = {isa = NSString; string = "performMiniaturize:"; }; - "Object 138" = { - destination = nil; - isa = IMControlConnector; - label = "Object 139"; - source = "Object 109"; - }; - "Object 139" = {isa = NSString; string = "performClose:"; }; - "Object 140" = { - destination = nil; - isa = IMControlConnector; - label = "Object 141"; - source = "Object 107"; - }; - "Object 141" = {isa = NSString; string = "arrangeInFront:"; }; - "Object 142" = { - destination = "Object 120"; - isa = IMOutletConnector; - label = "Object 143"; - source = "Object 2"; - }; - "Object 143" = {isa = NSString; string = delegate; }; - "Object 144" = { - destination = nil; - isa = IMControlConnector; - label = "Object 145"; - source = "Object 84"; - }; - "Object 145" = {isa = NSString; string = "orderFrontColorPanel:"; }; - "Object 146" = { - destination = nil; - isa = IMControlConnector; - label = "Object 147"; - source = "Object 79"; - }; - "Object 147" = {isa = NSString; string = "unscript:"; }; - "Object 148" = { - destination = nil; - isa = IMControlConnector; - label = "Object 149"; - source = "Object 80"; - }; - "Object 149" = {isa = NSString; string = "superscript:"; }; - "Object 150" = { - destination = nil; - isa = IMControlConnector; - label = "Object 151"; - source = "Object 81"; - }; - "Object 151" = {isa = NSString; string = "subscript:"; }; - "Object 152" = { - destination = nil; - isa = IMControlConnector; - label = "Object 153"; - source = "Object 82"; - }; - "Object 153" = {isa = NSString; string = "raiseBaseline:"; }; - "Object 154" = { - destination = nil; - isa = IMControlConnector; - label = "Object 155"; - source = "Object 83"; - }; - "Object 155" = {isa = NSString; string = "lowerBaseline:"; }; - "Object 156" = { - destination = nil; - isa = IMControlConnector; - label = "Object 157"; - source = "Object 75"; - }; - "Object 157" = {isa = NSString; string = "useAllLigatures:"; }; - "Object 158" = { - destination = nil; - isa = IMControlConnector; - label = "Object 159"; - source = "Object 74"; - }; - "Object 159" = {isa = NSString; string = "turnOffLigatures:"; }; - "Object 160" = { - destination = nil; - isa = IMControlConnector; - label = "Object 161"; - source = "Object 73"; - }; - "Object 161" = {isa = NSString; string = "useStandardLigatures:"; }; - "Object 162" = { - destination = nil; - isa = IMControlConnector; - label = "Object 163"; - source = "Object 66"; - }; - "Object 163" = {isa = NSString; string = "useStandardKerning:"; }; - "Object 164" = { - destination = nil; - isa = IMControlConnector; - label = "Object 165"; - source = "Object 67"; - }; - "Object 165" = {isa = NSString; string = "turnOffKerning:"; }; - "Object 166" = { - destination = nil; - isa = IMControlConnector; - label = "Object 167"; - source = "Object 68"; - }; - "Object 167" = {isa = NSString; string = "tightenKerning:"; }; - "Object 168" = { - destination = nil; - isa = IMControlConnector; - label = "Object 169"; - source = "Object 69"; - }; - "Object 169" = {isa = NSString; string = "loosenKerning:"; }; - "Object 170" = { - destination = "Object 116"; - isa = IMControlConnector; - label = "Object 171"; - source = "Object 61"; - }; - "Object 171" = {isa = NSString; string = "addFontTrait:"; }; - "Object 172" = { - destination = "Object 116"; - isa = IMControlConnector; - label = "Object 171"; - source = "Object 60"; - }; - "Object 173" = { - destination = nil; - isa = IMControlConnector; - label = "Object 174"; - source = "Object 62"; - }; - "Object 174" = {isa = NSString; string = "underline:"; }; - "Object 175" = { - destination = nil; - isa = IMControlConnector; - label = "Object 176"; - source = "Object 86"; - }; - "Object 176" = {isa = NSString; string = "pasteFont:"; }; - "Object 177" = { - destination = nil; - isa = IMControlConnector; - label = "Object 178"; - source = "Object 85"; - }; - "Object 178" = {isa = NSString; string = "copyFont:"; }; - "Object 179" = { - destination = "Object 116"; - isa = IMControlConnector; - label = "Object 180"; - source = "Object 59"; - }; - "Object 180" = {isa = NSString; string = "orderFrontFontPanel:"; }; - "Object 181" = { - destination = nil; - isa = IMControlConnector; - label = "Object 182"; - source = "Object 97"; - }; - "Object 182" = {isa = NSString; string = "runPageLayout:"; }; - "Object 183" = { - destination = nil; - isa = IMControlConnector; - label = "Object 184"; - source = "Object 94"; - }; - "Object 184" = {isa = NSString; string = "toggleRuler:"; }; - "Object 185" = { - destination = nil; - isa = IMControlConnector; - label = "Object 186"; - source = "Object 96"; - }; - "Object 186" = {isa = NSString; string = "pasteRuler:"; }; - "Object 187" = { - destination = nil; - isa = IMControlConnector; - label = "Object 188"; - source = "Object 95"; - }; - "Object 188" = {isa = NSString; string = "copyRuler:"; }; - "Object 189" = { - destination = nil; - isa = IMControlConnector; - label = "Object 190"; - source = "Object 93"; - }; - "Object 190" = {isa = NSString; string = "alignRight:"; }; - "Object 191" = { - destination = nil; - isa = IMControlConnector; - label = "Object 192"; - source = "Object 91"; - }; - "Object 192" = {isa = NSString; string = "alignCenter:"; }; - "Object 193" = { - destination = nil; - isa = IMControlConnector; - label = "Object 194"; - source = "Object 90"; - }; - "Object 194" = {isa = NSString; string = "alignLeft:"; }; - "Object 195" = { - destination = nil; - isa = IMControlConnector; - label = "Object 196"; - source = "Object 92"; - }; - "Object 196" = {isa = NSString; string = "alignJustified:"; }; - "Object 197" = { - destination = "Object 118"; - isa = IMOutletConnector; - label = "Object 198"; - source = "Object 120"; - }; - "Object 198" = {isa = NSString; string = prefController; }; - "Object 199" = { - destination = "Object 115"; - isa = IMOutletConnector; - label = "Object 200"; - source = "Object 120"; - }; - "Object 200" = {isa = NSString; string = finder; }; - "Object 201" = { - destination = "Object 114"; - isa = IMOutletConnector; - label = "Object 202"; - source = "Object 120"; - }; - "Object 202" = {isa = NSString; string = infoController; }; - "Object 203" = { - destination = "Object 117"; - isa = IMOutletConnector; - label = "Object 204"; - source = "Object 120"; - }; - "Object 204" = {isa = NSString; string = logger; }; - "Object 205" = { - destination = "Object 114"; - isa = IMControlConnector; - label = "Object 206"; - source = "Object 17"; - }; - "Object 206" = {isa = NSString; string = "showInfoWindow:"; }; - "Object 207" = { - destination = "Object 118"; - isa = IMControlConnector; - label = "Object 208"; - source = "Object 18"; - }; - "Object 208" = {isa = NSString; string = "showPrefWindow:"; }; - "Object 209" = { - destination = "Object 120"; - isa = IMOutletConnector; - label = "Object 143"; - source = "Object 119"; - }; - "Object 210" = { - destination = "Object 119"; - isa = IMOutletConnector; - label = "Object 211"; - source = "Object 120"; - }; - "Object 211" = {isa = NSString; string = projectManager; }; - "Object 212" = { - destination = "Object 122"; - isa = IMOutletConnector; - label = "Object 213"; - source = "Object 119"; - }; - "Object 213" = {isa = NSString; string = fileManager; }; - "Object 214" = { - destination = "Object 119"; - isa = IMOutletConnector; - label = "Object 143"; - source = "Object 122"; - }; - "Object 215" = { - destination = "Object 122"; - isa = IMOutletConnector; - label = "Object 213"; - source = "Object 120"; - }; - "Object 216" = { - destination = "Object 121"; - isa = IMOutletConnector; - label = "Object 217"; - source = "Object 120"; - }; - "Object 217" = {isa = NSString; string = menuController; }; - "Object 218" = { - destination = "Object 119"; - isa = IMOutletConnector; - label = "Object 211"; - source = "Object 121"; - }; - "Object 219" = { - destination = "Object 121"; - isa = IMControlConnector; - label = "Object 220"; - source = "Object 23"; - }; - "Object 220" = {isa = NSString; string = "openProject:"; }; - "Object 221" = { - destination = "Object 121"; - isa = IMControlConnector; - label = "Object 222"; - source = "Object 24"; - }; - "Object 222" = {isa = NSString; string = "newProject:"; }; - "Object 223" = { - destination = "Object 121"; - isa = IMControlConnector; - label = "Object 224"; - source = "Object 25"; - }; - "Object 224" = {isa = NSString; string = "saveProject:"; }; - "Object 225" = { - destination = "Object 121"; - isa = IMControlConnector; - label = "Object 226"; - source = "Object 26"; - }; - "Object 226" = {isa = NSString; string = "saveProjectAs:"; }; - "Object 227" = { - destination = "Object 121"; - isa = IMControlConnector; - label = "Object 228"; - source = "Object 28"; - }; - "Object 228" = {isa = NSString; string = "revertToSaved:"; }; - "Object 229" = { - destination = "Object 121"; - isa = IMControlConnector; - label = "Object 230"; - source = "Object 29"; - }; - "Object 230" = {isa = NSString; string = "closeProject:"; }; - "Object 231" = { - destination = "Object 121"; - isa = IMControlConnector; - label = "Object 232"; - source = "Object 33"; - }; - "Object 232" = {isa = NSString; string = "addSubproject:"; }; - "Object 233" = { - destination = "Object 121"; - isa = IMControlConnector; - label = "Object 234"; - source = "Object 34"; - }; - "Object 234" = {isa = NSString; string = "newSubproject:"; }; - "Object 235" = { - destination = "Object 121"; - isa = IMControlConnector; - label = "Object 234"; - source = "Object 35"; - }; - "Object 236" = { - destination = "Object 121"; - isa = IMControlConnector; - label = "Object 237"; - source = "Object 39"; - }; - "Object 237" = {isa = NSString; string = "openFile:"; }; - "Object 238" = { - destination = "Object 121"; - isa = IMControlConnector; - label = "Object 239"; - source = "Object 40"; - }; - "Object 239" = {isa = NSString; string = "addFile:"; }; - "Object 240" = { - destination = "Object 121"; - isa = IMControlConnector; - label = "Object 241"; - source = "Object 42"; - }; - "Object 241" = {isa = NSString; string = "removeFile:"; }; - "Object 242" = { - destination = "Object 121"; - isa = IMControlConnector; - label = "Object 243"; - source = "Object 43"; - }; - "Object 243" = {isa = NSString; string = "saveFile:"; }; - "Object 244" = { - destination = "Object 121"; - isa = IMControlConnector; - label = "Object 245"; - source = "Object 44"; - }; - "Object 245" = {isa = NSString; string = "saveFileAs:"; }; - "Object 246" = { - destination = "Object 121"; - isa = IMControlConnector; - label = "Object 247"; - source = "Object 45"; - }; - "Object 247" = {isa = NSString; string = "revertFile:"; }; - "Object 248" = { - destination = "Object 122"; - isa = IMOutletConnector; - label = "Object 213"; - source = "Object 121"; - }; - "Object 249" = { - destination = "Object 121"; - isa = IMControlConnector; - label = "Object 250"; - source = "Object 41"; - }; - "Object 250" = {isa = NSString; string = "newFile:"; }; - "Object 251" = { - destination = "Object 120"; - isa = IMOutletConnector; - label = "Object 252"; - source = "Object 121"; - }; - "Object 252" = {isa = NSString; string = appController; }; - RootObject = {Connections = "Object 123"; Objects = "Object 1"; isa = GMModel; }; - TopLevelObjects = (RootObject); - Version = 1; -} - - - diff --git a/ProjectCenter/GNUmakefile b/ProjectCenter/GNUmakefile index 36fe6b4..016e810 100644 --- a/ProjectCenter/GNUmakefile +++ b/ProjectCenter/GNUmakefile @@ -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,6 +35,7 @@ ProjectCenter_RESOURCE_FILES= \ ProjectCentre_prefs.tiff \ ProjectCentre_run.tiff \ ProjectCentre_uml.tiff \ + ProjectCentre_settings.tiff \ FileIcon_.c.tiff \ FileIcon_.h.tiff \ FileIcon_.m.tiff \ @@ -48,6 +47,7 @@ ProjectCenter_RESOURCE_FILES= \ ProjectCenter_HEADERS= \ PCAppController.h \ + PCAppController+MenuHandling.h \ PCFindController.h \ PCInfoController.h \ PCLogController.h \ @@ -60,6 +60,7 @@ ProjectCenter_HEADERS= \ ProjectCenter_OBJC_FILES= \ PCAppController.m \ + PCAppController+MenuHandling.m \ PCFindController.m \ PCInfoController.m \ PCLogController.m \ diff --git a/ProjectCenter/GNUmakefile.preamble b/ProjectCenter/GNUmakefile.preamble index 4126b8a..b8c8324 100644 --- a/ProjectCenter/GNUmakefile.preamble +++ b/ProjectCenter/GNUmakefile.preamble @@ -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 += diff --git a/ProjectCenter/Info-project.plist b/ProjectCenter/Info-project.plist index 752e4b5..6e84288 100755 --- a/ProjectCenter/Info-project.plist +++ b/ProjectCenter/Info-project.plist @@ -4,7 +4,7 @@ ApplicationDescription = "GNUstep IDE"; ApplicationIcon = "ProjectCenter.tiff"; ApplicationRelease = "ProjectCenter 0.1"; - FullVersionID = "0.1 pre pre pre pre epsilon"; + FullVersionID = "0.1"; Authors = ("Philippe C.D. Robert "); URL = "http://www.projectcenter.ch"; Copyright = "Copyright (C) 2000 Philippe C.D. Robert"; diff --git a/ProjectCenter/PC.project b/ProjectCenter/PC.project index 5080dcc..612b7e6 100644 --- a/ProjectCenter/PC.project +++ b/ProjectCenter/PC.project @@ -9,6 +9,7 @@ "PCInfoController.m", "PCLogController.m", "PCMenuController.m", + "PCPrefController.m", "ProjectCenter_main.m" ); COMPILEROPTIONS = ""; @@ -27,23 +28,17 @@ "PCPrefController.h" ); IMAGES = ( - "build.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" = ""; LIBRARIES = ( "gnustep-base", - "gnustep-gui" + "gnustep-gui", + ProjectCenter ); MAININTERFACE = "main.gmodel"; MAKEFILEDIR = "/usr/GNUstep/Makefiles"; @@ -58,7 +53,7 @@ "PROJECT_CREATOR" = ""; "PROJECT_DESCRIPTION" = "No description avaliable!"; "PROJECT_MAINTAINER" = ""; - "PROJECT_NAME" = PC; + "PROJECT_NAME" = ProjectCenter; "PROJECT_TYPE" = PCAppProject; "PROJECT_VERSION" = "1.0"; SUBPROJECTS = ( diff --git a/ProjectCenter/PCAppController+MenuHandling.h b/ProjectCenter/PCAppController+MenuHandling.h new file mode 100644 index 0000000..1cda1c9 --- /dev/null +++ b/ProjectCenter/PCAppController+MenuHandling.h @@ -0,0 +1,64 @@ +/* + GNUstep ProjectCenter - http://www.projectcenter.ch + + Copyright (C) 2000 Philippe C.D. Robert + + Author: Philippe C.D. Robert + + 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 +#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 + + + diff --git a/ProjectCenter/PCAppController+MenuHandling.m b/ProjectCenter/PCAppController+MenuHandling.m new file mode 100644 index 0000000..b2ccd72 --- /dev/null +++ b/ProjectCenter/PCAppController+MenuHandling.m @@ -0,0 +1,150 @@ +/* + GNUstep ProjectCenter - http://www.projectcenter.ch + + Copyright (C) 2000 Philippe C.D. Robert + + Author: Philippe C.D. Robert + + 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 + +@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 diff --git a/ProjectCenter/PCAppController.h b/ProjectCenter/PCAppController.h index 4ec7dfa..e8be087 100644 --- a/ProjectCenter/PCAppController.h +++ b/ProjectCenter/PCAppController.h @@ -39,21 +39,21 @@ @interface PCAppController : NSObject { - IBOutlet PCPrefController *prefController; - IBOutlet PCFindController *finder; - IBOutlet PCInfoController *infoController; - IBOutlet PCLogController *logger; - IBOutlet PCProjectManager *projectManager; - IBOutlet PCFileManager *fileManager; - IBOutlet PCMenuController *menuController; - - PCBundleLoader *bundleLoader; - PCServer *doServer; - NSConnection *doConnection; - - id delegate; - - NSMutableDictionary *projectTypes; + PCPrefController *prefController; + PCFindController *finder; + PCInfoController *infoController; + PCLogController *logger; + PCProjectManager *projectManager; + PCFileManager *fileManager; + PCMenuController *menuController; + + PCBundleLoader *bundleLoader; + PCServer *doServer; + NSConnection *doConnection; + + id delegate; + + NSMutableDictionary *projectTypes; } //============================================================================ @@ -108,4 +108,4 @@ - (BOOL)registerProjectCreator:(NSString *)className forKey:(NSString *)aKey; // Returns YES upon successfully registering a new projecttype. -@end \ No newline at end of file +@end diff --git a/ProjectCenter/PCAppController.m b/ProjectCenter/PCAppController.m index 8ca8f02..0703416 100644 --- a/ProjectCenter/PCAppController.m +++ b/ProjectCenter/PCAppController.m @@ -38,12 +38,7 @@ + (void)initialize { NSMutableDictionary *defaults = [NSMutableDictionary dictionary]; - -#if defined(GNUSTEP) NSString *_bundlePath = @"/usr/GNUstep/Local/Library/ProjectCenter"; -#else - NSString *_bundlePath = @"/LocalLibrary/ProjectCenter"; -#endif [defaults setObject:_bundlePath forKey:BundlePaths]; @@ -51,6 +46,8 @@ [defaults setObject:@"/usr/bin/gdb" forKey:Debugger]; [defaults setObject:@"/usr/bin/gcc" forKey:Compiler]; + [defaults setObject:@"YES" forKey:ExternalEditor]; + [defaults setObject:[NSString stringWithFormat:@"%@/ProjectCenterBuildDir",NSTemporaryDirectory()] forKey:RootBuildDirectory]; /* @@ -75,6 +72,21 @@ // 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; } @@ -86,7 +98,14 @@ [doConnection release]; } + [prefController release]; + [finder release]; + [infoController release]; + [logger release]; [projectManager release]; + [fileManager release]; + [menuController release]; + [bundleLoader release]; [doServer release]; [projectTypes release]; @@ -153,35 +172,30 @@ - (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]; + + // The DO server + doServer = [[PCServer alloc] init]; + + NS_DURING + + doConnection = [[NSConnection alloc] init]; + [doConnection registerName:connectionName]; + + NS_HANDLER + + NSRunAlertPanel(@"Warning!",@"Could not register the DO connection %@",@"OK",nil,nil,nil,connectionName); + NS_ENDHANDLER + + [[NSNotificationCenter defaultCenter] addObserver:doServer selector:@selector(connectionDidDie:) name:NSConnectionDidDieNotification object:doConnection]; + + [doConnection setDelegate:doServer]; - [bundleLoader loadBundles]; - - // The DO server - doServer = [[PCServer alloc] init]; - -#if defined(GNUSTEP) - NS_DURING - doConnection = [NSConnection newRegisteringAtName:@"ProjectCenter" withRootObject:doServer]; - [logger logMessage:@"Successful initialisation of the DO connection 'ProjectCenter'." tag:INFORMATION]; - NS_HANDLER - [logger logMessage:@"Could not initialise the DO connection 'ProjectCenter'!" tag:WARNING]; - NSRunAlertPanel(@"Warning!",@"Could not register the DO connection 'ProjectCenter'",@"OK",nil,nil,nil); - NS_ENDHANDLER -#else - doConnection = [NSConnection defaultConnection]; - [doConnection setRootObject:doServer]; - if (![doConnection registerName:@"ProjectCenter"]) { - [logger logMessage:@"Could not initialise the DO connection 'ProjectCenter'!" tag:WARNING]; - } - else { - [logger logMessage:@"Successful initialisation of the DO connection 'ProjectCenter'." tag:INFORMATION]; - } -#endif - [[NSNotificationCenter defaultCenter] addObserver:doServer selector:@selector(connectionDidDie:) name:NSConnectionDidDieNotification object:doConnection]; - [doConnection setDelegate:doServer]; - - [[NSNotificationCenter defaultCenter] postNotificationName:PCAppDidInitNotification object:nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:PCAppDidInitNotification object:nil]; } - (BOOL)applicationShouldTerminate:(id)sender diff --git a/ProjectCenter/PCMenuController.h b/ProjectCenter/PCMenuController.h index 53b6439..fa5403c 100644 --- a/ProjectCenter/PCMenuController.h +++ b/ProjectCenter/PCMenuController.h @@ -32,17 +32,25 @@ @interface PCMenuController : NSObject { - IBOutlet PCProjectManager *projectManager; - IBOutlet PCFileManager *fileManager; - IBOutlet PCAppController *appController; - - NSBox *projectTypeAccessaryView; - id projectTypePopup; + PCProjectManager *projectManager; + PCFileManager *fileManager; + PCAppController *appController; + + NSBox *projectTypeAccessaryView; + id projectTypePopup; } +//============================================================================ +//==== Init and free +//============================================================================ + - (id)init; - (void)dealloc; +- (void)setAppController:(id)anObject; +- (void)setFileManager:(id)anObject; +- (void)setProjectManager:(id)anObject; + //============================================================================ //==== Menu stuff //============================================================================ diff --git a/ProjectCenter/PCMenuController.m b/ProjectCenter/PCMenuController.m index bda1b5a..910bcfa 100644 --- a/ProjectCenter/PCMenuController.m +++ b/ProjectCenter/PCMenuController.m @@ -71,6 +71,24 @@ [projectTypePopup addItemWithTitle:name]; } +- (void)setAppController:(id)anObject +{ + [appController autorelease]; + appController = [anObject retain]; +} + +- (void)setFileManager:(id)anObject +{ + [fileManager autorelease]; + fileManager = [anObject retain]; +} + +- (void)setProjectManager:(id)anObject +{ + [projectManager autorelease]; + projectManager = [anObject retain]; +} + //============================================================================ //==== Menu stuff //============================================================================ @@ -184,21 +202,21 @@ - (void)openFile:(id)sender { NSString *filePath; - NSOpenPanel *openPanel; - int retval; - - openPanel = [NSOpenPanel openPanel]; - [openPanel setAllowsMultipleSelection:NO]; - [openPanel setCanChooseDirectories:NO]; - [openPanel setCanChooseFiles:YES]; - - retval = [openPanel runModalForDirectory:[[NSUserDefaults standardUserDefaults] objectForKey:@"LastOpenDirectory"] file:nil types:nil]; - + NSOpenPanel *openPanel; + int retval; + + openPanel = [NSOpenPanel openPanel]; + [openPanel setAllowsMultipleSelection:NO]; + [openPanel setCanChooseDirectories:NO]; + [openPanel setCanChooseFiles:YES]; + + retval = [openPanel runModalForDirectory:[[NSUserDefaults standardUserDefaults] objectForKey:@"LastOpenDirectory"] file:nil types:nil]; + if (retval == NSOKButton) { BOOL isDir; - [[NSUserDefaults standardUserDefaults] setObject:[openPanel directory] forKey:@"LastOpenDirectory"]; - filePath = [[openPanel filenames] objectAtIndex:0]; + [[NSUserDefaults standardUserDefaults] setObject:[openPanel directory] forKey:@"LastOpenDirectory"]; + filePath = [[openPanel filenames] objectAtIndex:0]; if ([[NSFileManager defaultManager] fileExistsAtPath:filePath isDirectory:&isDir] && !isDir) { if (![projectManager openFile:filePath]) { @@ -243,20 +261,20 @@ - (void)removeFile:(id)sender { - NSString *file = nil; - PCProject *proj = [projectManager activeProject]; - - if ((file = [[proj browserController] nameOfSelectedFile])) { - int ret; - - ret = NSRunAlertPanel(@"Remove File!",@"Really remove %@ in project %@?",@"Cancel",@"...from Project only",@"...from Project and Disk",file,[proj projectName]); - - if (ret == NSAlertAlternateReturn || ret == NSAlertOtherReturn) { - BOOL flag = (ret == NSAlertOtherReturn) ? YES : NO; - - [projectManager removeFilePermanently:flag]; - } - } + NSString *file = nil; + PCProject *proj = [projectManager activeProject]; + + if ((file = [[proj browserController] nameOfSelectedFile])) { + int ret; + + ret = NSRunAlertPanel(@"Remove File!",@"Really remove %@ in project %@?",@"Cancel",@"...from Project only",@"...from Project and Disk",file,[proj projectName]); + + if (ret == NSAlertAlternateReturn || ret == NSAlertOtherReturn) { + BOOL flag = (ret == NSAlertOtherReturn) ? YES : NO; + + [projectManager removeFilePermanently:flag]; + } + } } //============================================================================ diff --git a/ProjectCenter/PCPrefController.h b/ProjectCenter/PCPrefController.h index 834f8ab..b1f76d1 100644 --- a/ProjectCenter/PCPrefController.h +++ b/ProjectCenter/PCPrefController.h @@ -40,6 +40,8 @@ id failureField; id autoSaveField;; + + id useExternalEditor; id editorField; id debuggerField; @@ -47,9 +49,6 @@ id bundlePathField; NSMutableDictionary *preferencesDict; - - @private - BOOL _needsReleasing; } - (id)init; @@ -66,6 +65,8 @@ - (void)setRemoveBackup:(id)sender; - (void)setSavePeriod:(id)sender; +- (void)setUseExternalEditor:(id)sender; + - (void)setEditor:(id)sender; - (void)setCompiler:(id)sender; - (void)setDebugger:(id)sender; diff --git a/ProjectCenter/PCPrefController.m b/ProjectCenter/PCPrefController.m index 4c9edee..5997925 100644 --- a/ProjectCenter/PCPrefController.m +++ b/ProjectCenter/PCPrefController.m @@ -42,12 +42,12 @@ - (void)_initUI { NSView *_c_view; - unsigned int style = NSTitledWindowMask | NSClosableWindowMask | - NSResizableWindowMask; + unsigned int style = NSTitledWindowMask | NSClosableWindowMask; NSRect _w_frame; NSBox *line; NSBox *v; NSButton *b; + NSTextField *textField; /* * Pref Window @@ -62,6 +62,7 @@ [prefWindow setMinSize:NSMakeSize(268,365)]; [prefWindow setTitle:@"Preferences"]; [prefWindow setDelegate:self]; + [prefWindow setReleasedWhenClosed:NO]; _c_view = [prefWindow contentView]; prefPopup = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(72,328,120,20)]; @@ -116,23 +117,125 @@ [prefMiscView setBorderType:NSNoBorder]; v = [[[NSBox alloc] init] autorelease]; - [v setTitle:@"External"]; + [v setTitle:@"External Tools"]; [v setFrameFromContentFrame:NSMakeRect(16,184,228,96)]; [prefMiscView addSubview:v]; + /* + * Editor + */ + + textField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,24,60,21)]; + [textField setAlignment: NSRightTextAlignment]; + [textField setBordered: NO]; + [textField setEditable: NO]; + [textField setBezeled: NO]; + [textField setDrawsBackground: NO]; + [textField setStringValue:@"Editor:"]; + [v addSubview:[textField autorelease]]; + + editorField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,24,144,21)]; + [editorField setAlignment: NSLeftTextAlignment]; + [editorField setBordered: NO]; + [editorField setEditable: YES]; + [editorField setBezeled: YES]; + [editorField setDrawsBackground: YES]; + [editorField setTarget:self]; + [editorField setAction:@selector(setEditor:)]; + [v addSubview:[editorField autorelease]]; + + /* + * Compiler + */ + + textField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,48,60,21)]; + [textField setAlignment: NSRightTextAlignment]; + [textField setBordered: NO]; + [textField setEditable: NO]; + [textField setBezeled: NO]; + [textField setDrawsBackground: NO]; + [textField setStringValue:@"Compiler:"]; + [v addSubview:[textField autorelease]]; + + compilerField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,48,144,21)]; + [compilerField setAlignment: NSLeftTextAlignment]; + [compilerField setBordered: NO]; + [compilerField setEditable: YES]; + [compilerField setBezeled: YES]; + [compilerField setDrawsBackground: YES]; + [compilerField setTarget:self]; + [compilerField setAction:@selector(setCompiler:)]; + [v addSubview:[compilerField autorelease]]; + + /* + * Debugger + */ + + textField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,72,60,21)]; + [textField setAlignment: NSRightTextAlignment]; + [textField setBordered: NO]; + [textField setEditable: NO]; + [textField setBezeled: NO]; + [textField setDrawsBackground: NO]; + [textField setStringValue:@"Debugger:"]; + [v addSubview:[textField autorelease]]; + + debuggerField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,72,144,21)]; + [debuggerField setAlignment: NSLeftTextAlignment]; + [debuggerField setBordered: NO]; + [debuggerField setEditable: YES]; + [debuggerField setBezeled: YES]; + [debuggerField setDrawsBackground: YES]; + [debuggerField setTarget:self]; + [debuggerField setAction:@selector(setDebugger:)]; + [v addSubview:[debuggerField autorelease]]; + + /* + * Bundles Box + */ + v = [[[NSBox alloc] init] autorelease]; - [v setTitle:@"Bundles"]; - [v setFrameFromContentFrame:NSMakeRect(16,120,228,48)]; + [v setTitle:@"Bundle Path"]; + [v setFrameFromContentFrame:NSMakeRect(16,96,228,48)]; [prefMiscView addSubview:v]; - b = [[[NSButton alloc] initWithFrame:NSMakeRect(32,80,144,15)] autorelease]; + /* + * Bundle path + */ + + bundlePathField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,24,212,21)]; + [bundlePathField setAlignment: NSLeftTextAlignment]; + [bundlePathField setBordered: NO]; + [bundlePathField setEditable: YES]; + [bundlePathField setBezeled: YES]; + [bundlePathField setDrawsBackground: YES]; + [bundlePathField setTarget:self]; + [bundlePathField setAction:@selector(setBundlePath:)]; + [v addSubview:[bundlePathField autorelease]]; + + /* + * Some buttons + */ + + useExternalEditor = [[[NSButton alloc] initWithFrame:NSMakeRect(32,24,204,15)] autorelease]; + [useExternalEditor setTitle:@"use external Editor"]; + [useExternalEditor setButtonType:NSSwitchButton]; + [useExternalEditor setBordered:NO]; + [useExternalEditor setTarget:self]; + [useExternalEditor setAction:@selector(setUseExternalEditor:)]; + [useExternalEditor setContinuous:NO]; + [prefMiscView addSubview:useExternalEditor]; + [useExternalEditor sizeToFit]; + + b = [[[NSButton alloc] initWithFrame:NSMakeRect(32,44,204,15)] autorelease]; [b setTitle:@"Prompt when quitting"]; [b setButtonType:NSSwitchButton]; [b setBordered:NO]; [b setTarget:self]; - // [b setAction:@selector(setPromptOnClean:)]; + // [b setAction:@selector()]; [b setContinuous:NO]; [prefMiscView addSubview:b]; + [b sizeToFit]; /* * Saving view @@ -159,7 +262,7 @@ [v addSubview:b]; b = [[[NSButton alloc] initWithFrame:NSMakeRect(13,13,124,15)] autorelease]; - [b setTitle:@"Remoe Backup"]; + [b setTitle:@"Remove Backup"]; [b setButtonType:NSSwitchButton]; [b setBordered:NO]; [b setTarget:self]; @@ -171,8 +274,6 @@ [v setTitle:@"Auto-Save"]; [v setFrameFromContentFrame:NSMakeRect(16,104,228,80)]; [prefSavingView addSubview:v]; - - _needsReleasing = YES; } @end @@ -195,16 +296,16 @@ { [preferencesDict release]; - if (_needsReleasing) { - [prefWindow release]; - [prefPopup release]; - - [prefEmptyView release]; - [prefBuildingView release]; - [prefMiscView release]; - [prefSavingView release]; - } + [prefWindow release]; + [prefPopup release]; + [prefEmptyView release]; + [prefBuildingView release]; + [prefMiscView release]; + [prefSavingView release]; + + [[NSUserDefaults standardUserDefaults] synchronize]; + [super dealloc]; } @@ -214,21 +315,16 @@ id view; NSString *val; -#if defined(GNUSTEP) [self _initUI]; -#else - if(![NSBundle loadNibNamed:@"Preferences.nib" owner:self]) { - [[NSException exceptionWithName:NIB_NOT_FOUND_EXCEPTION reason:@"Could not load Preferences.gmodel" userInfo:nil] raise]; - return; - } -#endif // Fill in the defaults [compilerField setStringValue:(val=[preferencesDict objectForKey:Compiler]) ? val : @""]; [debuggerField setStringValue:(val=[preferencesDict objectForKey:Debugger]) ? val : @""]; [editorField setStringValue:(val=[preferencesDict objectForKey:Editor]) ? val : @""]; [bundlePathField setStringValue:(val=[preferencesDict objectForKey:BundlePaths]) ? val : @""]; - + + [useExternalEditor setState:([[preferencesDict objectForKey:ExternalEditor] isEqualToString:@"YES"])?NSOnState:NSOffState]; + // The popup and selected view [prefPopup removeAllItems]; [prefPopup addItemWithTitle:@"Building"]; @@ -305,52 +401,58 @@ { } +- (void)setUseExternalEditor:(id)sender +{ + NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; + switch ([[sender selectedCell] state]) { + case 0: + [def setObject:@"NO" forKey:ExternalEditor]; + break; + case 1: + [def setObject:@"YES" forKey:ExternalEditor]; + break; + } + [def synchronize]; +} + - (void)setEditor:(id)sender { - NSString *path = [self selectFileWithTypes:[NSArray arrayWithObjects:@"app",nil]]; - - if (path) { - [editorField setStringValue:path]; - - [[NSUserDefaults standardUserDefaults] setObject:path forKey:Editor]; - [preferencesDict setObject:path forKey:Editor]; - } + NSString *path = [editorField stringValue]; + + if (path) { + [[NSUserDefaults standardUserDefaults] setObject:path forKey:Editor]; + [preferencesDict setObject:path forKey:Editor]; + } } - (void)setCompiler:(id)sender { - NSString *path = [self selectFileWithTypes:nil]; + NSString *path = [compilerField stringValue]; - if (path) { - [compilerField setStringValue:path]; - - [[NSUserDefaults standardUserDefaults] setObject:path forKey:Compiler]; - [preferencesDict setObject:path forKey:Compiler]; - } + if (path) { + [[NSUserDefaults standardUserDefaults] setObject:path forKey:Compiler]; + [preferencesDict setObject:path forKey:Compiler]; + } } - (void)setDebugger:(id)sender { - NSString *path = [self selectFileWithTypes:nil]; - - if (path) { - [debuggerField setStringValue:path]; - - [[NSUserDefaults standardUserDefaults] setObject:path forKey:Debugger]; - [preferencesDict setObject:path forKey:Debugger]; - } + NSString *path = [debuggerField stringValue]; + + if (path) { + [[NSUserDefaults standardUserDefaults] setObject:path forKey:Debugger]; + [preferencesDict setObject:path forKey:Debugger]; + } } - (void)setBundlePath:(id)sender { - NSString *path = [self selectFileWithTypes:[NSArray arrayWithObjects:@"bundle",nil]]; - - if (path) { - [bundlePathField setStringValue:path]; - - [[NSUserDefaults standardUserDefaults] setObject:path forKey:BundlePaths]; - [preferencesDict setObject:path forKey:BundlePaths]; - } + NSString *path = [bundlePathField stringValue]; + + if (path) { + [[NSUserDefaults standardUserDefaults] setObject:path forKey:BundlePaths]; + [preferencesDict setObject:path forKey:BundlePaths]; + } } - (void)promptWhenQuitting:(id)sender @@ -364,23 +466,23 @@ - (NSString *)selectFileWithTypes:(NSArray *)types { - NSString *file = nil; - NSOpenPanel *openPanel; - int retval; - - openPanel = [NSOpenPanel openPanel]; - [openPanel setAllowsMultipleSelection:NO]; - [openPanel setCanChooseDirectories:YES]; - [openPanel setCanChooseFiles:YES]; - - retval = [openPanel runModalForDirectory:[[NSUserDefaults standardUserDefaults] objectForKey:@"LastOpenDirectory"] file:nil types:types]; - - if (retval == NSOKButton) { - [[NSUserDefaults standardUserDefaults] setObject:[openPanel directory] forKey:@"LastOpenDirectory"]; - file = [[openPanel filenames] objectAtIndex:0]; + NSString *file = nil; + NSOpenPanel *openPanel; + int retval; - } - return file; + openPanel = [NSOpenPanel openPanel]; + [openPanel setAllowsMultipleSelection:NO]; + [openPanel setCanChooseDirectories:YES]; + [openPanel setCanChooseFiles:YES]; + + retval = [openPanel runModalForDirectory:[[NSUserDefaults standardUserDefaults] objectForKey:@"LastOpenDirectory"] file:nil types:types]; + + if (retval == NSOKButton) { + [[NSUserDefaults standardUserDefaults] setObject:[openPanel directory] forKey:@"LastOpenDirectory"]; + file = [[openPanel filenames] objectAtIndex:0]; + + } + return file; } @end diff --git a/ProjectCenter/ProjectCenter_main.m b/ProjectCenter/ProjectCenter_main.m index e6d6e80..89ee675 100644 --- a/ProjectCenter/ProjectCenter_main.m +++ b/ProjectCenter/ProjectCenter_main.m @@ -25,7 +25,183 @@ */ #import +#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]; } diff --git a/ProjectCenter/ProjectCentre_build.tiff b/ProjectCenter/ProjectCentre_build.tiff index 5ab5b20..90e755a 100644 Binary files a/ProjectCenter/ProjectCentre_build.tiff and b/ProjectCenter/ProjectCentre_build.tiff differ diff --git a/ProjectCenter/ProjectCentre_find.tiff b/ProjectCenter/ProjectCentre_find.tiff index c6e7e1c..8297e5b 100644 Binary files a/ProjectCenter/ProjectCentre_find.tiff and b/ProjectCenter/ProjectCentre_find.tiff differ diff --git a/ProjectCenter/ProjectCentre_prefs.tiff b/ProjectCenter/ProjectCentre_prefs.tiff index 5a4ddcb..c803f49 100644 Binary files a/ProjectCenter/ProjectCentre_prefs.tiff and b/ProjectCenter/ProjectCentre_prefs.tiff differ diff --git a/ProjectCenter/ProjectCentre_settings.tiff b/ProjectCenter/ProjectCentre_settings.tiff new file mode 100644 index 0000000..59e05f8 Binary files /dev/null and b/ProjectCenter/ProjectCentre_settings.tiff differ diff --git a/ProjectCenter/ProjectCentre_uml.tiff b/ProjectCenter/ProjectCentre_uml.tiff index 42304dd..dd6bdc9 100644 Binary files a/ProjectCenter/ProjectCentre_uml.tiff and b/ProjectCenter/ProjectCentre_uml.tiff differ diff --git a/Version b/Version index d8df70a..b766396 100644 --- a/Version +++ b/Version @@ -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=1 +SUBMINOR_VERSION=0 PC_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${SUBMINOR_VERSION} VERSION=${PC_VERSION}