diff --git a/Modules/LibraryProject/GNUmakefile b/Modules/LibraryProject/GNUmakefile new file mode 100644 index 0000000..b8f9367 --- /dev/null +++ b/Modules/LibraryProject/GNUmakefile @@ -0,0 +1,66 @@ +# +# GNUmakefile - Generated by ProjectCenter +# Written by Philippe C.D. Robert +# +# NOTE: Do NOT change this file -- ProjectCenter maintains it! +# +# Put all of your customisations in GNUmakefile.preamble and +# GNUmakefile.postamble +# + +include $(GNUSTEP_MAKEFILES)/common.make + + +# +# Subprojects +# + + + +# +# Bundle +# + +PACKAGE_NAME = LibraryProject +BUNDLE_NAME = LibraryProject +LibraryProject_PRINCIPAL_CLASS = PCLibProj + + +# +# Additional libraries +# + +LibraryProject_LIBRARIES_DEPEND_UPON += -lProjectCenter + +# +# Resource files +# + +LibraryProject_RESOURCE_FILES= \ +PC.proj \ +Version + +# +# Header files +# + +LibraryProject_HEADERS= \ +PCLibProj.h \ +PCLibProject.h + +# +# Class files +# + +LibraryProject_OBJC_FILES= \ +PCLibProj.m \ +PCLibProject.m + +# +# C files +# + +LibraryProject_C_FILES= + +include ../GNUmakefile.bundles +include $(GNUSTEP_MAKEFILES)/bundle.make diff --git a/Modules/LibraryProject/Info.table b/Modules/LibraryProject/Info.table new file mode 100644 index 0000000..e0861e8 --- /dev/null +++ b/Modules/LibraryProject/Info.table @@ -0,0 +1,29 @@ +{ + AdditionalAttributes = { + PrincipalClass = {ATTR_CLASS_NAME = "NSString";}; + }; + Allowable_SubprojectTypes = (Subproject, Bundle, Tool, Framework, Library, Palette); + AttributesInspector = ApplicationInspector; + DefaultExtension = ""; + Default_Localizable_Keys = (INTERFACES); + GeneratedFiles = (Makefile, iconHeader); + INSTALLFLAGS = "-c -s -m 755"; + InfoName = ""; + Localizable_Keys = (INTERFACES, IMAGES, OTHER_RESOURCES, HELP_RESOURCES); + MAKEFILE = app.make; + MAKEFILEDIR = "$(MAKEFILEPATH)/pb_makefiles"; + Other_Keys = (HELP_RESOURCES, OTHER_SOURCES, FRAMEWORKS, OTHER_LIBS); + PBProjectTypeSubClass = "PBApplicationProjectType"; + ProvidesIcons = Yes; + Public_Keys = (H_FILES); + Resource_Keys = (INTERFACES, IMAGES, OTHER_RESOURCES); + SOURCEMODE = 444; + Source_Keys = (CLASSES, H_FILES, OTHER_LINKED); + Subproj_Keys = (SUBPROJECTS); + Targets = (app, debug, profile, install); + ExecutableResults = ( + "$PROJECTNAME$.app/$PROJECTNAME$$EXECUTABLE_EXT$", + "$PROJECTNAME$.debug/$PROJECTNAME$$EXECUTABLE_EXT$", + "$PROJECTNAME$.profile/$PROJECTNAME$$EXECUTABLE_EXT$" + ); +} diff --git a/Modules/LibraryProject/PC.proj b/Modules/LibraryProject/PC.proj new file mode 100644 index 0000000..972e96a --- /dev/null +++ b/Modules/LibraryProject/PC.proj @@ -0,0 +1,34 @@ +{ + APPKIT = "GNUSTEP-GUI"; + BUILDTOOL = "/usr/bin/make"; + CLASS_FILES = (); + COMPILEROPTIONS = ""; + LINKEROPTIONS = ""; + CREATION_DATE = ""; + DOCU_FILES = (); + FOUNDATION = "GNUSTEP-BASE"; + FRAMEWORKS = (); + HEADER_FILES = (); + LANGUAGE = "English"; + LAST_EDITING = ""; + LIBRARIES = ("gnustep-base"); + MAKEFILEDIR = "$(GNUSTEP_SYSTEM_ROOT)/Makefiles"; + INSTALLDIR = "$(GNUSTEP_LOCAL_ROOT)"; + OTHER_FILES = (); + OTHER_RESOURCES = ("Version"); + OTHER_SOURCES = (); + PROJECT_CREATOR = ""; + PROJECT_DESCRIPTION = "No description avaliable!"; + PROJECT_GROUP = "No description avaliable!"; + PROJECT_SUMMARY = "No summary avaliable!"; + PROJECT_RELEASE = "1"; + PROJECT_COPYRIGHT = "No license specified!"; + PROJECT_SOURCE = "%{gs_name}-%{gs_version}.tar.gz"; + PROJECT_MAINTAINER = ""; + PROJECT_NAME = ""; + PROJECT_TYPE = "Library"; + PROJECT_BUILDER = "PCLibProj"; + PROJECT_VERSION = 1.0; + SUBPROJECTS = (); + SUPPORTING_FILES = ("GNUmakefile.preamble", "GNUmakefile", "GNUmakefile.postamble"); +} diff --git a/Modules/LibraryProject/PCLibProj.h b/Modules/LibraryProject/PCLibProj.h new file mode 100644 index 0000000..c8afdb2 --- /dev/null +++ b/Modules/LibraryProject/PCLibProj.h @@ -0,0 +1,53 @@ +/* + GNUstep ProjectCenter - http://www.gnustep.org + + Copyright (C) 2001 Free Software Foundation + + Author: Philippe C.D. Robert + + This file is part of GNUstep. + + 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$ +*/ + +#ifndef _PCLIBPROJ_H +#define _PCLIBPROJ_H + +#include +#include + +@interface PCLibProj : NSObject +{ +} + +//---------------------------------------------------------------------------- +// ProjectType +//---------------------------------------------------------------------------- + ++ (id)sharedCreator; + +- (Class)projectClass; + +- (NSString *)projectTypeName; +- (NSDictionary *)typeTable; + +- (PCProject *)createProjectAt:(NSString *)path; +- (PCProject *)openProjectAt:(NSString *)path; + +@end + +#endif diff --git a/Modules/LibraryProject/PCLibProj.m b/Modules/LibraryProject/PCLibProj.m new file mode 100644 index 0000000..1a22de4 --- /dev/null +++ b/Modules/LibraryProject/PCLibProj.m @@ -0,0 +1,141 @@ +/* + GNUstep ProjectCenter - http://www.gnustep.org + + Copyright (C) 2001 Free Software Foundation + + Author: Philippe C.D. Robert + + This file is part of GNUstep. + + This application is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This application is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. + + $Id$ +*/ + +/* + Description: + + PCLibProj creates new project of the type Application! + +*/ + +#include "PCLibProj.h" +#include "PCLibProject.h" + +@implementation PCLibProj + +static NSString *_projTypeName = @"Library"; +static PCLibProj *_creator = nil; + +//---------------------------------------------------------------------------- +// ProjectType +//---------------------------------------------------------------------------- + ++ (id)sharedCreator +{ + if (!_creator) { + _creator = [[[self class] alloc] init]; + } + return _creator; +} + +- (Class)projectClass +{ + return [PCLibProject class]; +} + +- (NSString *)projectTypeName +{ + return _projTypeName; +} + +- (NSDictionary *)typeTable +{ + NSString *_path = [[NSBundle bundleForClass:[self class]] pathForResource:@"Info" ofType:@"table"]; + + return [NSDictionary dictionaryWithContentsOfFile:_path]; +} + +- (PCProject *)createProjectAt:(NSString *)path +{ + PCLibProject *project = nil; + NSFileManager *fm = [NSFileManager defaultManager]; + + NSAssert(path,@"No valid project path provided!"); + + if ([fm createDirectoryAtPath:path attributes:nil]) { + NSString *_file; + //NSString *_resourcePath; + NSMutableDictionary *dict; + NSString *projectFile; + + project = [[[PCLibProject alloc] init] autorelease]; + + _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"PC" ofType:@"proj"]; + dict = [NSMutableDictionary dictionaryWithContentsOfFile:_file]; + + // Customise the project + [dict setObject:[path lastPathComponent] forKey:PCProjectName]; + [dict setObject:[[project principalClass] description] forKey:PCProjType]; + + // Save the project to disc + projectFile = [NSString stringWithString:[path lastPathComponent]]; + projectFile = [projectFile stringByAppendingPathExtension:@"pcproj"]; + [dict writeToFile:[path stringByAppendingPathComponent:projectFile] + atomically:YES]; + + // Copy the project files to the provided path + _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"GNUmakefile" ofType:@"postamble"]; + [fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"GNUmakefile.postamble"] handler:nil]; + + _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"GNUmakefile" ofType:@"preamble"]; + [fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"GNUmakefile.preamble"] handler:nil]; + + _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"main" ofType:@"m"]; + [fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"main.m"] handler:nil]; + + // Resources + /* + _resourcePath = [path stringByAppendingPathComponent:@"English.lproj"]; + [fm createDirectoryAtPath:_resourcePath attributes:nil]; + */ + + [fm createDirectoryAtPath:[path stringByAppendingPathComponent:@"Documentation"] attributes:nil]; + _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"Version" ofType:@""]; + [fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"Version"] handler:nil]; + + // The path cannot be in the PC.project file! + [project setProjectPath:path]; + + // Set the new dictionary - this causes the GNUmakefile to be written to disc + if(![project assignProjectDict:dict]) { + NSRunAlertPanel(@"Attention!",@"Could not load %@!",@"OK",nil,nil,path); + return nil; + } + } + return project; +} + +- (PCProject *)openProjectAt:(NSString *)path +{ + NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path]; + + if ([[dict objectForKey:PCProjectBuilderClass] isEqualToString:@"PCLibProj"]) { + return [[[PCLibProject alloc] initWithProjectDictionary:dict path:[path stringByDeletingLastPathComponent]] autorelease]; + } + return nil; +} + +@end diff --git a/Modules/LibraryProject/PCLibProject.h b/Modules/LibraryProject/PCLibProject.h new file mode 100644 index 0000000..7c8f721 --- /dev/null +++ b/Modules/LibraryProject/PCLibProject.h @@ -0,0 +1,70 @@ +/* + GNUstep ProjectCenter - http://www.gnustep.org + + Copyright (C) 2001 Free Software Foundation + + Author: Philippe C.D. Robert + + This file is part of GNUstep. + + This application is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This application is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. + + $Id$ +*/ + +/* + Description: + + This is the project type 'Application' for GNUstep. You never should create it yourself but + use PCLibProj for doing this. Otherwise needed files don't get copied to the right place. + + */ + +#ifndef _PCLIBPROJECT_H +#define _PCLIBPROJECT_H + +#include +#include + +@interface PCLibProject : PCProject +{ +} + +//---------------------------------------------------------------------------- +// Init and free +//---------------------------------------------------------------------------- + +- (id)init; +- (void)dealloc; + +//---------------------------------------------------------------------------- +// Project +//---------------------------------------------------------------------------- + +- (Class)builderClass; + +- (BOOL)writeMakefile; + +- (NSArray *)sourceFileKeys; +- (NSArray *)resourceFileKeys; +- (NSArray *)otherKeys; +- (NSArray *)buildTargets; +- (NSString *)projectDescription; + +- (void)updateValuesFromProjectDict; + +@end + +#endif diff --git a/Modules/LibraryProject/PCLibProject.m b/Modules/LibraryProject/PCLibProject.m new file mode 100644 index 0000000..b6c7bd5 --- /dev/null +++ b/Modules/LibraryProject/PCLibProject.m @@ -0,0 +1,171 @@ +/* + GNUstep ProjectCenter - http://www.gnustep.org + + Copyright (C) 2001 Free Software Foundation + + Author: Philippe C.D. Robert + + This file is part of GNUstep. + + 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$ +*/ + +#include "PCLibProject.h" +#include "PCLibProj.h" + +#include + +@interface PCLibProject (CreateUI) + +- (void)_initUI; + +@end + +@implementation PCLibProject (CreateUI) + +- (void)_initUI +{ +} + +@end + +@implementation PCLibProject + +//---------------------------------------------------------------------------- +// Init and free +//---------------------------------------------------------------------------- + +- (id)init +{ + if ((self = [super init])) { + rootObjects = [[NSArray arrayWithObjects: PCClasses, + PCHeaders, + PCOtherSources, + PCOtherResources, + PCSubprojects, + PCDocuFiles, + PCSupportingFiles, + PCLibraries, + PCNonProject, + nil] retain]; + + rootKeys = [[NSArray arrayWithObjects: @"Classes", + @"Headers", + @"Other Sources", + @"Other Resources", + @"Subprojects", + @"Documentation", + @"Supporting Files", + @"Libraries", + @"Non Project Files", + nil] retain]; + + rootCategories = [[NSDictionary + dictionaryWithObjects:rootObjects forKeys:rootKeys] retain]; + + } + return self; +} + +- (void)dealloc +{ + [rootCategories release]; + [rootObjects release]; + [rootKeys release]; + + [super dealloc]; +} + +//---------------------------------------------------------------------------- +// Project +//---------------------------------------------------------------------------- + +- (Class)builderClass +{ + return [PCLibProj class]; +} + +- (BOOL)writeMakefile +{ + NSData *mfd; + NSString *mfl = [projectPath stringByAppendingPathComponent:@"GNUmakefile"]; + PCMakefileFactory *mf = [PCMakefileFactory sharedFactory]; + NSDictionary *dict = [self projectDict]; + + // Save the project file + [super writeMakefile]; + + [mf createMakefileForProject:[self projectName]]; + [mf appendString:@"include $(GNUSTEP_MAKEFILES)/common.make\n"]; + [mf appendString:@"include Version\n"]; + [mf appendSubprojects:[dict objectForKey:PCSubprojects]]; + + [mf appendLibrary]; + [mf appendLibraryInstallDir:[dict objectForKey:PCInstallDir]]; + [mf appendLibraryLibraries:[dict objectForKey:PCLibraries]]; + + [mf appendLibraryHeaders:[dict objectForKey:PCHeaders]]; + [mf appendLibraryClasses:[dict objectForKey:PCClasses]]; + [mf appendLibraryOtherSources:[dict objectForKey:PCOtherSources]]; + + [mf appendTailForLibrary]; + + // Write the new file to disc! + if ((mfd = [mf encodedMakefile])) + { + if ([mfd writeToFile:mfl atomically:YES]) + { + return YES; + } + } + + return NO; +} + +- (NSArray *)sourceFileKeys +{ + return [NSArray arrayWithObjects:PCClasses,PCOtherSources,nil]; +} + +- (NSArray *)resourceFileKeys +{ + return [NSArray array]; +} + +- (NSArray *)otherKeys +{ + return [NSArray arrayWithObjects:PCDocuFiles,PCSupportingFiles,nil]; +} + +- (NSArray *)buildTargets +{ + return nil; +} + +- (NSString *)projectDescription +{ + return @"Project that handles GNUstep/ObjC based libraries."; +} + +- (void)updateValuesFromProjectDict +{ + [super updateValuesFromProjectDict]; + + //[appClassField setStringValue:[projectDict objectForKey:PCAppClass]]; +} + +@end diff --git a/Modules/LibraryProject/Version b/Modules/LibraryProject/Version new file mode 100644 index 0000000..c8601c2 --- /dev/null +++ b/Modules/LibraryProject/Version @@ -0,0 +1,12 @@ +# This file is included in various Makefile's to get version information. +# Compatible with Bourne shell syntax, so it can included there too. + +# The gcc version required to compile the library. +GCC_VERSION=2.8.0 + +# The version number of this release. +MAJOR_VERSION=0 +MINOR_VERSION=0 +SUBMINOR_VERSION=1 +LIB_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${SUBMINOR_VERSION} +VERSION=${LIB_VERSION} diff --git a/Modules/RenaissanceProject/AppController.h b/Modules/RenaissanceProject/AppController.h new file mode 100644 index 0000000..46ac829 --- /dev/null +++ b/Modules/RenaissanceProject/AppController.h @@ -0,0 +1,25 @@ +/* + * AppController.h + * + * GNUstep Renaissance Application Controller + * + * Created with ProjectCenter - http://www.gnustep.org + */ + +#ifndef _APPCONTROLLER_H_ +#define _APPCONTROLLER_H_ + +#include +#include + +@interface AppController : NSObject +{ + +} + +- (void) applicationDidFinishLaunching: (NSNotification *)not; + +@end + +#endif /* _APPCONTROLLER_H_ */ + diff --git a/Modules/RenaissanceProject/AppController.m b/Modules/RenaissanceProject/AppController.m new file mode 100644 index 0000000..8289eed --- /dev/null +++ b/Modules/RenaissanceProject/AppController.m @@ -0,0 +1,18 @@ +/* + * AppController.m + * + * GNUstep Renaissance Application Controller + * + * Created with ProjectCenter - http://www.gnustep.org + * + */ + +#include "AppController.h" + +@implementation AppController + +- (void) applicationDidFinishLaunching: (NSNotification *)not +{ + [NSBundle loadGSMarkupNamed: @"Main" owner: self]; +} +@end diff --git a/Modules/RenaissanceProject/GNUmakefile b/Modules/RenaissanceProject/GNUmakefile new file mode 100644 index 0000000..7a173f4 --- /dev/null +++ b/Modules/RenaissanceProject/GNUmakefile @@ -0,0 +1,72 @@ +# +# GNUmakefile - Generated by ProjectCenter +# Written by Philippe C.D. Robert +# +# NOTE: Do NOT change this file -- ProjectCenter maintains it! +# +# Put all of your customisations in GNUmakefile.preamble and +# GNUmakefile.postamble +# + +include $(GNUSTEP_MAKEFILES)/common.make + + +# +# Subprojects +# + + + +# +# Bundle +# + +PACKAGE_NAME = RenaissanceProject +BUNDLE_NAME = RenaissanceProject +RenaissanceProject_PRINCIPAL_CLASS = PCRenaissanceProj + + +# +# Additional libraries +# + +RenaissanceProject_LIBRARIES_DEPEND_UPON += -lProjectCenter + +# +# Resource files +# + +RenaissanceProject_RESOURCE_FILES= \ +PC.proj \ +main.m \ +AppController.m \ +AppController.h \ +Main.gsmarkup \ +MainMenu-GNUstep.gsmarkup \ +MainMenu-OSX.gsmarkup + + +# +# Header files +# + +RenaissanceProject_HEADERS= \ +PCRenaissanceProj.h \ +PCRenaissanceProject.h + +# +# Class files +# + +RenaissanceProject_OBJC_FILES= \ +PCRenaissanceProj.m \ +PCRenaissanceProject.m + +# +# C files +# + +RenaissanceProject_C_FILES= + +include ../GNUmakefile.bundles +include $(GNUSTEP_MAKEFILES)/bundle.make diff --git a/Modules/RenaissanceProject/Info.table b/Modules/RenaissanceProject/Info.table new file mode 100644 index 0000000..e0861e8 --- /dev/null +++ b/Modules/RenaissanceProject/Info.table @@ -0,0 +1,29 @@ +{ + AdditionalAttributes = { + PrincipalClass = {ATTR_CLASS_NAME = "NSString";}; + }; + Allowable_SubprojectTypes = (Subproject, Bundle, Tool, Framework, Library, Palette); + AttributesInspector = ApplicationInspector; + DefaultExtension = ""; + Default_Localizable_Keys = (INTERFACES); + GeneratedFiles = (Makefile, iconHeader); + INSTALLFLAGS = "-c -s -m 755"; + InfoName = ""; + Localizable_Keys = (INTERFACES, IMAGES, OTHER_RESOURCES, HELP_RESOURCES); + MAKEFILE = app.make; + MAKEFILEDIR = "$(MAKEFILEPATH)/pb_makefiles"; + Other_Keys = (HELP_RESOURCES, OTHER_SOURCES, FRAMEWORKS, OTHER_LIBS); + PBProjectTypeSubClass = "PBApplicationProjectType"; + ProvidesIcons = Yes; + Public_Keys = (H_FILES); + Resource_Keys = (INTERFACES, IMAGES, OTHER_RESOURCES); + SOURCEMODE = 444; + Source_Keys = (CLASSES, H_FILES, OTHER_LINKED); + Subproj_Keys = (SUBPROJECTS); + Targets = (app, debug, profile, install); + ExecutableResults = ( + "$PROJECTNAME$.app/$PROJECTNAME$$EXECUTABLE_EXT$", + "$PROJECTNAME$.debug/$PROJECTNAME$$EXECUTABLE_EXT$", + "$PROJECTNAME$.profile/$PROJECTNAME$$EXECUTABLE_EXT$" + ); +} diff --git a/Modules/RenaissanceProject/Main.gsmarkup b/Modules/RenaissanceProject/Main.gsmarkup new file mode 100644 index 0000000..e403420 --- /dev/null +++ b/Modules/RenaissanceProject/Main.gsmarkup @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Modules/RenaissanceProject/MainMenu-GNUstep.gsmarkup b/Modules/RenaissanceProject/MainMenu-GNUstep.gsmarkup new file mode 100644 index 0000000..8476723 --- /dev/null +++ b/Modules/RenaissanceProject/MainMenu-GNUstep.gsmarkup @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Modules/RenaissanceProject/MainMenu-OSX.gsmarkup b/Modules/RenaissanceProject/MainMenu-OSX.gsmarkup new file mode 100644 index 0000000..a20024f --- /dev/null +++ b/Modules/RenaissanceProject/MainMenu-OSX.gsmarkup @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Modules/RenaissanceProject/PC.proj b/Modules/RenaissanceProject/PC.proj new file mode 100644 index 0000000..6c5d77e --- /dev/null +++ b/Modules/RenaissanceProject/PC.proj @@ -0,0 +1,40 @@ +{ + APPCLASS = "NSApplication"; + APPKIT = "GNUSTEP-GUI"; + APPLICATIONICON = ""; + BUILDTOOL = "/usr/bin/make"; + CLASS_FILES = ("main.m", "AppController.m"); + COMPILEROPTIONS = ""; + LINKEROPTIONS = ""; + CREATION_DATE = ""; + DOCU_FILES = (); + FOUNDATION = "GNUSTEP-BASE"; + FRAMEWORKS = (); + HEADER_FILES = ("AppController.h"); + INTERFACES = ("Main.gsmarkup", "MainMenu-GNUstep.gsmarkup", "MainMenu-OSX.gsmarkup"); + IMAGES = (); + LANGUAGE = "English"; + LAST_EDITING = ""; + LIBRARIES = ("gnustep-base","gnustep-gui","Renaissance"); + MAININTERFACE = ""; + MAKEFILEDIR = "$(GNUSTEP_SYSTEM_ROOT)/Makefiles"; + INSTALLDIR = "$(GNUSTEP_LOCAL_ROOT)/"; + OTHER_FILES = (); + OTHER_RESOURCES = (); + OTHER_SOURCES = (); + PRINCIPAL_CLASS = "main.m"; + PROJECT_CREATOR = ""; + PROJECT_DESCRIPTION = "No description avaliable!"; + PROJECT_GROUP = "No description avaliable!"; + PROJECT_SUMMARY = "No summary avaliable!"; + PROJECT_RELEASE = "1"; + PROJECT_COPYRIGHT = "No license specified!"; + PROJECT_SOURCE = "%{gs_name}-%{gs_version}.tar.gz"; + PROJECT_MAINTAINER = ""; + PROJECT_NAME = ""; + PROJECT_TYPE = "RenaissanceApplication"; + PROJECT_BUILDER = "PCRenaissanceProj"; + PROJECT_VERSION = 1.0; + SUBPROJECTS = (); + SUPPORTING_FILES = ("GNUmakefile.preamble", "GNUmakefile", "GNUmakefile.postamble"); +} diff --git a/Modules/RenaissanceProject/PCRenaissanceProj.h b/Modules/RenaissanceProject/PCRenaissanceProj.h new file mode 100644 index 0000000..ed4a13e --- /dev/null +++ b/Modules/RenaissanceProject/PCRenaissanceProj.h @@ -0,0 +1,52 @@ +/* + GNUstep ProjectCenter - http://www.gnustep.org + + Copyright (C) 2003 Free Software Foundation + + Author: Philippe C.D. Robert + Modified by Daniel Luederwald + + This file is part of GNUstep. + + 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. +*/ + +#ifndef _PCRENAISSANCEPROJ_H +#define _PCRENAISSANCEPROJ_H + +#include +#include + +@interface PCRenaissanceProj : NSObject +{ +} + +//---------------------------------------------------------------------------- +// ProjectType +//---------------------------------------------------------------------------- + ++ (id)sharedCreator; + +- (Class)projectClass; + +- (NSString *)projectTypeName; +- (NSDictionary *)typeTable; + +- (PCProject *)createProjectAt:(NSString *)path; +- (PCProject *)openProjectAt:(NSString *)path; + +@end + +#endif diff --git a/Modules/RenaissanceProject/PCRenaissanceProj.m b/Modules/RenaissanceProject/PCRenaissanceProj.m new file mode 100644 index 0000000..44855f1 --- /dev/null +++ b/Modules/RenaissanceProject/PCRenaissanceProj.m @@ -0,0 +1,191 @@ +/* + GNUstep ProjectCenter - http://www.gnustep.org + + Copyright (C) 2003 Free Software Foundation + Copyright (C) 2001 Pierre-Yves Rivaille + + Authors: Philippe C.D. Robert + Pierre-Yves Rivaille + + Modified by Daniel Luederwald + + This file is part of GNUstep. + + 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. +*/ + +/* + Description: + + PCRenaissanceProj creates new project of the type RenaissanceApplication! + +*/ + +#include "PCRenaissanceProj.h" +#include "PCRenaissanceProject.h" + +@implementation PCRenaissanceProj + +static NSString *_projTypeName = @"RenaissanceApplication"; +static PCRenaissanceProj *_creator = nil; + +//---------------------------------------------------------------------------- +// ProjectType +//---------------------------------------------------------------------------- + ++ (id)sharedCreator +{ + if (!_creator) { + _creator = [[[self class] alloc] init]; + } + return _creator; +} + +- (Class)projectClass +{ + return [PCRenaissanceProject class]; +} + +- (NSString *)projectTypeName +{ + return _projTypeName; +} + +- (NSDictionary *)typeTable +{ + NSString *_path = [[NSBundle bundleForClass:[self class]] pathForResource:@"Info" ofType:@"table"]; + + return [NSDictionary dictionaryWithContentsOfFile:_path]; +} + +- (PCProject *)createProjectAt:(NSString *)path +{ + PCRenaissanceProject *project = nil; + NSFileManager *fm = [NSFileManager defaultManager]; + + NSAssert(path,@"No valid project path provided!"); + + if ([fm createDirectoryAtPath:path attributes:nil]) { + NSString *_file; + NSString *_resourcePath; + NSMutableDictionary *dict; + NSDictionary *infoDict; + NSString *plistFileName; + NSString *projectFile; + + project = [[[PCRenaissanceProject alloc] init] autorelease]; + + _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"PC" ofType:@"proj"]; + dict = [NSMutableDictionary dictionaryWithContentsOfFile:_file]; + + // Customise the project + [dict setObject:[path lastPathComponent] forKey:PCProjectName]; + [dict setObject:[[project principalClass] description] forKey:PCProjType]; + + // Create the AppNameInfo.plist + infoDict = [NSDictionary dictionaryWithObjectsAndKeys: + @"Automatically generated!",@"NOTE", + [path lastPathComponent],@"ApplicationName", + @"",@"ApplicationDescription", + @"",@"ApplicationIcon", + @"0.1",@"ApplicationRelease", + @"0.1",@"FullVersionID", + @"",@"Authors", + @"",@"URL", + @"Copyright (C) 200x by ...",@"Copyright", + @"Released under ...",@"CopyrightDescription", nil]; + plistFileName = [NSString stringWithFormat:@"%@Info.plist",[path lastPathComponent]]; + [infoDict writeToFile:[path stringByAppendingPathComponent:plistFileName] atomically:YES]; + + [dict setObject:[NSArray arrayWithObjects:plistFileName,nil] + forKey:PCOtherResources]; + // [dict setObject:[NSArray arrayWithObject:[NSString stringWithFormat: @"%@.gsmarkup", [path lastPathComponent]]] + [dict setObject:[NSArray arrayWithObjects: @"Main.gsmarkup", @"MainMenu-GNUstep.gsmarkup", @"MainMenu-OSX.gsmarkup",nil] + forKey:PCInterfaces]; + + // Save the project to disc + projectFile = [NSString stringWithString:[path lastPathComponent]]; + projectFile = [projectFile stringByAppendingPathExtension:@"pcproj"]; + [dict writeToFile:[path stringByAppendingPathComponent:projectFile] + atomically:YES]; + + /* + * Copy the project files to the provided path + * + */ + + _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"GNUmakefile" ofType:@"postamble"]; + [fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"GNUmakefile.postamble"] handler:nil]; + + _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"GNUmakefile" ofType:@"preamble"]; + [fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"GNUmakefile.preamble"] handler:nil]; + + _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"main" ofType:@"m"]; + [fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"main.m"] handler:nil]; + + _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"MainMenu-GNUstep" ofType:@"gsmarkup"]; + [fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"MainMenu-GNUstep.gsmarkup"] handler:nil]; + + + _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"MainMenu-OSX" ofType:@"gsmarkup"]; + [fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"MainMenu-OSX.gsmarkup"] handler:nil]; + + + _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"Main" ofType:@"gsmarkup"]; + [fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"Main.gsmarkup"] handler:nil]; + + _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"AppController" ofType:@"m"]; + [fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"AppController.m"] handler:nil]; + + _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"AppController" ofType:@"h"]; + [fm copyPath:_file toPath:[path stringByAppendingPathComponent:@"AppController.h"] handler:nil]; + + _file = [[NSBundle bundleForClass:[self class]] pathForResource:@"baseInterface" ofType:@"gsmarkup"]; + [fm copyPath:_file toPath:[path stringByAppendingPathComponent: + [[path lastPathComponent] stringByAppendingString: @".gsmarkup"]] handler:nil]; + + // Resources + _resourcePath = [path stringByAppendingPathComponent:@"English.lproj"]; + [fm createDirectoryAtPath:_resourcePath attributes:nil]; + [fm createDirectoryAtPath:[path stringByAppendingPathComponent:@"Images"] attributes:nil]; + [fm createDirectoryAtPath:[path stringByAppendingPathComponent:@"Documentation"] attributes:nil]; + + // The path cannot be in the PC.project file! + [project setProjectPath:path]; + + // Set the new dictionary - this causes the GNUmakefile to be written to disc + if(![project assignProjectDict:dict]) { + NSRunAlertPanel(@"Attention!",@"Could not load %@!",@"OK",nil,nil,path); + return nil; + } + } + return project; +} + +- (PCProject *)openProjectAt:(NSString *)path +{ + NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path]; + id obj; + + NSLog(@"<%@ %x>: opening project at %@",[self class],self,path); + + obj = [dict objectForKey:PCProjectBuilderClass]; + if ([obj isEqualToString:@"PCRenaissanceProj"]) { + return [[[PCRenaissanceProject alloc] initWithProjectDictionary:dict path:[path stringByDeletingLastPathComponent]] autorelease]; + } + return nil; +} + +@end diff --git a/Modules/RenaissanceProject/PCRenaissanceProj_Prefix.h b/Modules/RenaissanceProject/PCRenaissanceProj_Prefix.h new file mode 100644 index 0000000..5fc8bd6 --- /dev/null +++ b/Modules/RenaissanceProject/PCRenaissanceProj_Prefix.h @@ -0,0 +1,8 @@ +// +// Prefix header for all source files of the 'PCRenaissanceProj' target in the 'PCRenaissanceProj' project. +// + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/Modules/RenaissanceProject/PCRenaissanceProject.h b/Modules/RenaissanceProject/PCRenaissanceProject.h new file mode 100644 index 0000000..9977cdc --- /dev/null +++ b/Modules/RenaissanceProject/PCRenaissanceProject.h @@ -0,0 +1,85 @@ +/* + GNUstep ProjectCenter - http://www.gnustep.org + + Copyright (C) 2003 Free Software Foundation + + Author: Philippe C.D. Robert + Modified by Daniel Luederwald + + This file is part of GNUstep. + + 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. +*/ + +/* + Description: + + This is the project type 'RenaissanceApplication' for GNUstep. You never should create + it yourself but use PCRenaissanceProj for doing this. Otherwise needed files don't + get copied to the right place. + + */ + +#ifndef _PCRENAISSANCEPROJECT_H +#define _PCRENAISSANCEPROJECT_H + +#include +#include + +@interface PCRenaissanceProject : PCProject +{ + NSTextField *appClassField; + NSTextField *appImageField; + NSButton *setAppIconButton; + NSButton *clearAppIconButton; + NSImageView *appIconView; + NSImage *icon; +} + +//---------------------------------------------------------------------------- +// Init and free +//---------------------------------------------------------------------------- + +- (id)init; +- (void)dealloc; + +//---------------------------------------------------------------------------- +// Project +//---------------------------------------------------------------------------- + +- (Class)builderClass; + +- (BOOL)writeMakefile; + +- (NSArray *)sourceFileKeys; +- (NSArray *)resourceFileKeys; +- (NSArray *)otherKeys; +- (NSArray *)buildTargets; +- (NSString *)projectDescription; + +- (BOOL)isExecutable; + +- (void)updateValuesFromProjectDict; + +- (void)clearAppIcon:(id)sender; +- (void)setAppIcon:(id)sender; + +- (BOOL)setAppIconWithImageAtPath:(NSString *)path; + +- (void)setAppClass:(id)sender; + +@end + +#endif diff --git a/Modules/RenaissanceProject/PCRenaissanceProject.m b/Modules/RenaissanceProject/PCRenaissanceProject.m new file mode 100644 index 0000000..6952d75 --- /dev/null +++ b/Modules/RenaissanceProject/PCRenaissanceProject.m @@ -0,0 +1,349 @@ +/* + GNUstep ProjectCenter - http://www.gnustep.org + + Copyright (C) 2003 Free Software Foundation + + Authors: Philippe C.D. Robert + Modified by Daniel Luederwald + + This file is part of GNUstep. + + 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. +*/ + +#include "PCRenaissanceProject.h" +#include "PCRenaissanceProj.h" + +#include + +@interface PCRenaissanceProject (CreateUI) + +- (void)_initUI; + +@end + +@implementation PCRenaissanceProject (CreateUI) + +- (void)_initUI +{ + NSTextField *textField; + NSRect frame = {{84,120}, {80, 80}}; + NSBox *_iconViewBox; + NSBox *_appIconBox; + + textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,256,64,21)]; + [textField setAlignment: NSRightTextAlignment]; + [textField setBordered: NO]; + [textField setEditable: NO]; + [textField setBezeled: NO]; + [textField setDrawsBackground: NO]; + [textField setStringValue:@"App class:"]; + [projectProjectInspectorView addSubview:textField]; + RELEASE(textField); + + appClassField =[[NSTextField alloc] initWithFrame:NSMakeRect(111,248,165,21)]; + [appClassField setAlignment: NSLeftTextAlignment]; + [appClassField setBordered: YES]; + [appClassField setEditable: YES]; + [appClassField setBezeled: YES]; + [appClassField setDrawsBackground: YES]; + [appClassField setStringValue:@""]; + [appClassField setTarget:self]; + [appClassField setAction:@selector(setAppClass:)]; + [projectProjectInspectorView addSubview:appClassField]; + + // Application Icon + _appIconBox = [[NSBox alloc] init]; + [_appIconBox setFrame:NSMakeRect(6,154,270,84)]; + [_appIconBox setContentViewMargins:NSMakeSize(4.0, 6.0)]; + [_appIconBox setTitle:@"Application Icon"]; + [projectProjectInspectorView addSubview:_appIconBox]; + RELEASE(_appIconBox); + + appImageField = [[NSTextField alloc] initWithFrame:NSMakeRect(0,34,195,21)]; + [appImageField setAlignment: NSLeftTextAlignment]; + [appImageField setBordered: YES]; + [appImageField setEditable: YES]; + [appImageField setBezeled: YES]; + [appImageField setDrawsBackground: YES]; + [appImageField setStringValue:@""]; + [_appIconBox addSubview:appImageField]; + RELEASE(appImageField); + + setAppIconButton = [[NSButton alloc] initWithFrame:NSMakeRect(147,0,48,21)]; + [setAppIconButton setTitle:@"Set..."]; + [setAppIconButton setTarget:self]; + [setAppIconButton setAction:@selector(setAppIcon:)]; + [_appIconBox addSubview:setAppIconButton]; + RELEASE(setAppIconButton); + + clearAppIconButton = [[NSButton alloc] initWithFrame:NSMakeRect(95,0,48,21)]; + [clearAppIconButton setTitle:@"Clear"]; + [clearAppIconButton setTarget:self]; + [clearAppIconButton setAction:@selector(clearAppIcon:)]; + [_appIconBox addSubview:clearAppIconButton]; + RELEASE(clearAppIconButton); + + frame = NSMakeRect(200,0,56,56); + _iconViewBox = [[NSBox alloc] init]; + [_iconViewBox setFrame:frame]; + [_iconViewBox setTitlePosition:NSNoTitle]; + [_iconViewBox setBorderType:NSBezelBorder]; + [_appIconBox addSubview:_iconViewBox]; + RELEASE(_iconViewBox); + + appIconView = [[NSImageView alloc] initWithFrame:frame]; + [_iconViewBox addSubview:appIconView]; + RELEASE(appIconView); +} + +@end + +@implementation PCRenaissanceProject + +//---------------------------------------------------------------------------- +// Init and free +//---------------------------------------------------------------------------- + +- (id)init +{ + if ((self = [super init])) + { + rootObjects = [[NSArray arrayWithObjects: PCClasses, + PCHeaders, + PCOtherSources, + PCInterfaces, + PCImages, + PCOtherResources, + PCSubprojects, + PCDocuFiles, + PCSupportingFiles, + PCLibraries, + PCNonProject, + nil] retain]; + + rootKeys = [[NSArray arrayWithObjects: @"Classes", + @"Headers", + @"Other Sources", + @"Interfaces", + @"Images", + @"Other Resources", + @"Subprojects", + @"Documentation", + @"Supporting Files", + @"Libraries", + @"Non Project Files", + nil] retain]; + + rootCategories = [[NSDictionary + dictionaryWithObjects:rootObjects forKeys:rootKeys] retain]; + } + + return self; +} + +- (void)dealloc +{ + RELEASE(rootCategories); + RELEASE(rootObjects); + RELEASE(rootKeys); + RELEASE(appClassField); + RELEASE(appImageField); + + [super dealloc]; +} + +//---------------------------------------------------------------------------- +// Project +//---------------------------------------------------------------------------- + +- (Class)builderClass +{ + return [PCRenaissanceProj class]; +} + +- (BOOL)writeMakefile +{ + NSData *mfd; + NSString *mfl = [projectPath stringByAppendingPathComponent:@"GNUmakefile"]; + int i; + PCMakefileFactory *mf = [PCMakefileFactory sharedFactory]; + NSDictionary *dict = [self projectDict]; + + // Save the project file + [super writeMakefile]; + + // Create the new file + [mf createMakefileForProject:[self projectName]]; + + [mf appendString:@"include $(GNUSTEP_MAKEFILES)/common.make\n"]; + + [mf appendSubprojects:[dict objectForKey:PCSubprojects]]; + + [mf appendApplication]; + [mf appendInstallDir:[dict objectForKey:PCInstallDir]]; + [mf appendAppIcon:[dict objectForKey:PCAppIcon]]; + + [mf appendGuiLibraries:[dict objectForKey:PCLibraries]]; + [mf appendResources]; + for (i=0;i<[[self resourceFileKeys] count];i++) + { + NSString *k = [[self resourceFileKeys] objectAtIndex:i]; + [mf appendResourceItems:[dict objectForKey:k]]; + } + + [mf appendHeaders:[dict objectForKey:PCHeaders]]; + [mf appendClasses:[dict objectForKey:PCClasses]]; + [mf appendOtherSources:[dict objectForKey:PCOtherSources]]; + + [mf appendTailForApp]; + + // Write the new file to disc! + if ((mfd = [mf encodedMakefile])) + { + if ([mfd writeToFile:mfl atomically:YES]) + { + return YES; + } + } + + return NO; +} + +- (NSArray *)sourceFileKeys +{ + return [NSArray arrayWithObjects:PCClasses,PCOtherSources,nil]; +} + +- (NSArray *)resourceFileKeys +{ + return [NSArray arrayWithObjects:PCInterfaces,PCOtherResources,PCImages,nil]; +} + +- (NSArray *)otherKeys +{ + return [NSArray arrayWithObjects:PCDocuFiles,PCSupportingFiles,nil]; +} + +- (NSArray *)buildTargets +{ + return nil; +} + +- (NSString *)projectDescription +{ + return @"Project that handles GNUstep/ObjC based applications."; +} + +- (BOOL)isExecutable +{ + return YES; +} + +- (void)updateValuesFromProjectDict +{ + NSRect frame = {{0,0}, {64, 64}}; + NSImage *image; + NSString *path = nil; + NSString *_icon; + + [super updateValuesFromProjectDict]; + + [appClassField setStringValue:[projectDict objectForKey:PCAppClass]]; + [appImageField setStringValue:[projectDict objectForKey:PCAppIcon]]; + + if ((_icon = [projectDict objectForKey:PCAppIcon])) { + path = [projectPath stringByAppendingPathComponent:_icon]; + } + + if (path && (image = [[NSImage alloc] initWithContentsOfFile:path])) { + frame.size = [image size]; + [appIconView setFrame:frame]; + [appIconView setImage:image]; + [appIconView display]; + RELEASE(image); + } +} + +- (void)clearAppIcon:(id)sender +{ + [projectDict setObject:@"" forKey:PCAppIcon]; + [appImageField setStringValue:@"No Icon!"]; + [appIconView setImage:nil]; + [appIconView display]; + + [[NSNotificationCenter defaultCenter] + postNotificationName:ProjectDictDidChangeNotification + object:self]; +} + +- (void)setAppIcon:(id)sender +{ + int result; + NSArray *fileTypes = [NSImage imageFileTypes]; + NSOpenPanel *openPanel = [NSOpenPanel openPanel]; + + [openPanel setAllowsMultipleSelection:NO]; + result = [openPanel runModalForDirectory:NSHomeDirectory() + file:nil + types:fileTypes]; + + if (result == NSOKButton) { + NSArray *files = [openPanel filenames]; + NSString *imageFilePath = [files objectAtIndex:0]; + + if (![self setAppIconWithImageAtPath:imageFilePath]) { + NSRunAlertPanel(@"Error while opening file!", + @"Couldn't open %@", @"OK", nil, nil,imageFilePath); + } + } +} + +- (BOOL)setAppIconWithImageAtPath:(NSString *)path +{ + NSRect frame = {{0,0}, {64, 64}}; + NSImage *image; + + if (!(image = [[NSImage alloc] initWithContentsOfFile:path])) { + return NO; + } + + [self addFiles:[NSArray arrayWithObject:path] forKey:PCImages]; + [projectDict setObject:[path lastPathComponent] forKey:PCAppIcon]; + + [appImageField setStringValue:[path lastPathComponent]]; + + frame.size = [image size]; + [appIconView setFrame:frame]; + [appIconView setImage:image]; + [appIconView display]; + RELEASE(image); + + [[NSNotificationCenter defaultCenter] + postNotificationName:ProjectDictDidChangeNotification + object:self]; + + return YES; +} + +- (void)setAppClass:(id)sender +{ + [projectDict setObject:[appClassField stringValue] forKey:PCAppClass]; + [[NSNotificationCenter defaultCenter] + postNotificationName:ProjectDictDidChangeNotification + object:self]; +} + +@end diff --git a/Modules/RenaissanceProject/main.m b/Modules/RenaissanceProject/main.m new file mode 100644 index 0000000..f35a44a --- /dev/null +++ b/Modules/RenaissanceProject/main.m @@ -0,0 +1,27 @@ +#include +#include +#include +#include "AppController.h" + + +/* + * Initialise and go! + */ + +int main(int argc, const char *argv[]) +{ + CREATE_AUTORELEASE_POOL (pool); + [NSApplication sharedApplication]; + [NSApp setDelegate: [AppController new]]; + + #ifdef GNUSTEP + [NSBundle loadGSMarkupNamed: @"MainMenu-GNUstep" owner: [NSApp delegate]]; + #else + [NSBundle loadGSMarkupNamed: @"MainMenu-OSX" owner: [NSApp delegate]]; + #endif + + + RELEASE (pool); + return NSApplicationMain (argc, argv); + +}