From cc6f1ede8b247bc75985027220499d4f7409b0b9 Mon Sep 17 00:00:00 2001 From: Sergii Stoian Date: Mon, 14 Jun 2004 09:42:27 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@19516 72102866-910b-0410-8b05-ffd578937521 --- Modules/AggregateProject/GNUmakefile | 47 ++++ Modules/AggregateProject/PCAggregateProj.h | 49 ++++ Modules/AggregateProject/PCAggregateProj.m | 123 ++++++++++ Modules/AggregateProject/PCAggregateProject.h | 66 +++++ Modules/AggregateProject/PCAggregateProject.m | 230 ++++++++++++++++++ .../Resources/Inspector.gorm/data.classes | 155 ++++++++++++ .../Resources/Inspector.gorm/objects.gorm | Bin 0 -> 3467 bytes Modules/AggregateProject/Resources/PC.project | 40 +++ 8 files changed, 710 insertions(+) create mode 100644 Modules/AggregateProject/GNUmakefile create mode 100644 Modules/AggregateProject/PCAggregateProj.h create mode 100644 Modules/AggregateProject/PCAggregateProj.m create mode 100644 Modules/AggregateProject/PCAggregateProject.h create mode 100644 Modules/AggregateProject/PCAggregateProject.m create mode 100644 Modules/AggregateProject/Resources/Inspector.gorm/data.classes create mode 100644 Modules/AggregateProject/Resources/Inspector.gorm/objects.gorm create mode 100644 Modules/AggregateProject/Resources/PC.project diff --git a/Modules/AggregateProject/GNUmakefile b/Modules/AggregateProject/GNUmakefile new file mode 100644 index 0000000..eacbad8 --- /dev/null +++ b/Modules/AggregateProject/GNUmakefile @@ -0,0 +1,47 @@ +# +# GNUmakefile +# +include $(GNUSTEP_MAKEFILES)/common.make + + +# +# Bundle +# +PACKAGE_NAME = AggregateProject +BUNDLE_NAME = AggregateProject +AggregateProject_PRINCIPAL_CLASS = PCAggregateProj + +# +# Additional libraries +# +AggregateProject_LIBRARIES_DEPEND_UPON += -lProjectCenter + +# +# Resource files +# +AggregateProject_RESOURCE_FILES= \ +Resources/PC.project \ +Resources/Inspector.gorm + +# +# Header files +# +AggregateProject_HEADERS= \ +PCAggregateProj.h \ +PCAggregateProject.h + +# +# Class files +# +AggregateProject_OBJC_FILES= \ +PCAggregateProj.m \ +PCAggregateProject.m + +# +# C files +# + +AggregateProject_C_FILES= + +include ../GNUmakefile.bundles +include $(GNUSTEP_MAKEFILES)/bundle.make diff --git a/Modules/AggregateProject/PCAggregateProj.h b/Modules/AggregateProject/PCAggregateProj.h new file mode 100644 index 0000000..f06aac1 --- /dev/null +++ b/Modules/AggregateProject/PCAggregateProj.h @@ -0,0 +1,49 @@ +/* + GNUstep ProjectCenter - http://www.gnustep.org + + Copyright (C) 2004 Free Software Foundation + + Authors: Serg Stoyan + + 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 _PCAGGREGATEPROJ_H +#define _PCAGGREGATEPROJ_H + +#include +#include + +@interface PCAggregateProj : NSObject +{ +} + +//---------------------------------------------------------------------------- +// ProjectType +//---------------------------------------------------------------------------- + ++ (id)sharedCreator; + +- (Class)projectClass; +- (NSString *)projectTypeName; + +- (PCProject *)createProjectAt:(NSString *)path; +- (PCProject *)openProjectAt:(NSString *)path; + +@end + +#endif diff --git a/Modules/AggregateProject/PCAggregateProj.m b/Modules/AggregateProject/PCAggregateProj.m new file mode 100644 index 0000000..e4cf265 --- /dev/null +++ b/Modules/AggregateProject/PCAggregateProj.m @@ -0,0 +1,123 @@ +/* + GNUstep ProjectCenter - http://www.gnustep.org + + Copyright (C) 2004 Free Software Foundation + + Author: Serg Stoyan + + 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 "ProjectCenter/PCFileCreator.h" +#include "ProjectCenter/PCMakefileFactory.h" + +#include "PCAggregateProj.h" +#include "PCAggregateProject.h" + +@implementation PCAggregateProj + +static PCAggregateProj *_creator = nil; + +//---------------------------------------------------------------------------- +// ProjectType +//---------------------------------------------------------------------------- + ++ (id)sharedCreator +{ + if (!_creator) + { + _creator = [[[self class] alloc] init]; + } + + return _creator; +} + +- (Class)projectClass +{ + return [PCAggregateProject class]; +} + +- (NSString *)projectTypeName +{ + return @"Aggregate"; +} + +- (PCProject *)createProjectAt:(NSString *)path +{ + PCAggregateProject *project = nil; + NSFileManager *fm = [NSFileManager defaultManager]; + + NSAssert(path,@"No valid project path provided!"); + + if ([fm createDirectoryAtPath:path attributes:nil]) + { + NSString *_file = nil; + NSMutableDictionary *projectDict = nil; + NSBundle *projectBundle = nil; + NSString *projectName = nil; + + project = [[[PCAggregateProject alloc] init] autorelease]; + projectBundle = [NSBundle bundleForClass:[self class]]; + + _file = [projectBundle pathForResource:@"PC" ofType:@"project"]; + projectDict = [NSMutableDictionary dictionaryWithContentsOfFile:_file]; + + // Customise the project + projectName = [path lastPathComponent]; + if ([[projectName pathExtension] isEqualToString:@"subproj"]) + { + projectName = [projectName stringByDeletingPathExtension]; + } + [projectDict setObject:projectName forKey:PCProjectName]; + [projectDict setObject:[self projectTypeName] forKey:PCProjectType]; + // The path cannot be in the PC.project file! + [project setProjectPath:path]; + [project setProjectName:projectName]; + + // GNUmakefile.postamble + [[PCMakefileFactory sharedFactory] createPostambleForProject:project]; + + // Set the new dictionary - this causes the GNUmakefile to be written + if(![project assignProjectDict:projectDict]) + { + NSRunAlertPanel(@"Attention!", + @"Could not load %@!", + @"OK",nil,nil,path); + return nil; + } + + // Save the project to disc + [project save]; + } + + return project; +} + +- (PCProject *)openProjectAt:(NSString *)path +{ + NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path]; + NSString *pPath = [path stringByDeletingLastPathComponent]; + PCAggregateProject *project = nil; + + project = [[[PCAggregateProject alloc] + initWithProjectDictionary:dict + path:pPath] autorelease]; + + return project; +} + +@end diff --git a/Modules/AggregateProject/PCAggregateProject.h b/Modules/AggregateProject/PCAggregateProject.h new file mode 100644 index 0000000..85c5380 --- /dev/null +++ b/Modules/AggregateProject/PCAggregateProject.h @@ -0,0 +1,66 @@ +/* + GNUstep ProjectCenter - http://www.gnustep.org + + Copyright (C) 2001 Free Software Foundation + + Authors: Serg Stoyan + + 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 _PCAGGREGATEPROJECT_H +#define _PCAGGREGATEPROJECT_H + +#include +#include + +@class PCMakefileFactory; + +@interface PCAggregateProject : PCProject +{ + IBOutlet NSBox *projectAttributesView; + IBOutlet NSTextField *projectTypeField; + IBOutlet NSTextField *projectNameField; + + NSMutableDictionary *infoDict; +} + +//---------------------------------------------------------------------------- +// Init and free +//---------------------------------------------------------------------------- + +- (id)init; +- (void)dealloc; + +@end + +@interface PCAggregateProject (GeneratedFiles) + +- (BOOL)writeMakefile; +- (void)appendHead:(PCMakefileFactory *)mff; +- (void)appendTail:(PCMakefileFactory *)mff; + +@end + +@interface PCAggregateProject (Inspector) + +- (NSView *)projectAttributesView; +- (void)updateInspectorValues:(NSNotification *)aNotif; + +@end + +#endif diff --git a/Modules/AggregateProject/PCAggregateProject.m b/Modules/AggregateProject/PCAggregateProject.m new file mode 100644 index 0000000..f81b14b --- /dev/null +++ b/Modules/AggregateProject/PCAggregateProject.m @@ -0,0 +1,230 @@ +/* + 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. +*/ + +#include "PCAggregateProject.h" +#include "PCAggregateProj.h" + +#include + +@implementation PCAggregateProject + +//---------------------------------------------------------------------------- +// Init and free +//---------------------------------------------------------------------------- + +- (id)init +{ + if ((self = [super init])) + { + rootKeys = [[NSArray arrayWithObjects: + PCSubprojects, + PCSupportingFiles, + PCNonProject, + nil] retain]; + + rootCategories = [[NSArray arrayWithObjects: + @"Subprojects", + @"Supporting Files", + @"Non Project Files", + nil] retain]; + + rootEntries = [[NSDictionary + dictionaryWithObjects:rootCategories forKeys:rootKeys] retain]; + + } + + return self; +} + +- (void)dealloc +{ + [rootCategories release]; + [rootKeys release]; + [rootEntries release]; + + [super dealloc]; +} + +//---------------------------------------------------------------------------- +// Project +//---------------------------------------------------------------------------- + +- (Class)builderClass +{ + return [PCAggregateProj class]; +} + +- (NSString *)projectDescription +{ + return @"Project that contains subprojects."; +} + +- (BOOL)isExecutable +{ + return NO; +} + +- (NSString *)execAggregateName +{ + return nil; +} + +- (NSArray *)fileTypesForCategoryKey:(NSString *)category +{ + if ([category isEqualToString:PCSubprojects]) + { + return [NSArray arrayWithObjects:@"subproj",nil]; + } + + return nil; +} + +- (NSString *)dirForCategory:(NSString *)category +{ + return projectPath; +} + +- (NSArray *)buildTargets +{ + return nil; +} + +- (NSArray *)sourceFileKeys +{ + return nil; +} + +- (NSArray *)resourceFileKeys +{ + return nil; +} + +- (NSArray *)otherKeys +{ + return [NSArray arrayWithObjects:PCSupportingFiles,nil]; +} + +- (NSArray *)allowableSubprojectTypes +{ + return [NSArray arrayWithObjects: + @"Application", @"Bundle", @"Library", @"Tool", nil]; +} + +- (NSArray *)defaultLocalizableKeys +{ + return nil; +} + +- (NSArray *)localizableKeys +{ + return nil; +} + +@end + +@implementation PCAggregateProject (GeneratedFiles) + +- (BOOL)writeMakefile +{ + PCMakefileFactory *mf = [PCMakefileFactory sharedFactory]; + NSString *mfl = nil; + NSData *mfd = nil; + + // Save the GNUmakefile backup + [super writeMakefile]; + + // Save GNUmakefile.preamble + [mf createPreambleForProject:self]; + + // Create the new file + [mf createMakefileForProject:projectName]; + + // Head + [self appendHead:mf]; + + // Subprojects + if ([[projectDict objectForKey:PCSubprojects] count] > 0) + { + [mf appendSubprojects:[projectDict objectForKey:PCSubprojects]]; + } + + // Tail + [self appendTail:mf]; + + // Write the new file to disc! + mfl = [projectPath stringByAppendingPathComponent:@"GNUmakefile"]; + if ((mfd = [mf encodedMakefile])) + { + if ([mfd writeToFile:mfl atomically:YES]) + { + return YES; + } + } + + return NO; +} + +- (void)appendHead:(PCMakefileFactory *)mff +{ + [mff appendString:@"\n#\n# Aggregate\n#\n"]; + [mff appendString:[NSString stringWithFormat:@"PACKAGE_NAME = %@\n", + projectName]]; +} + +- (void)appendTail:(PCMakefileFactory *)mff +{ + [mff appendString:@"\n\n#\n# Makefiles\n#\n"]; + [mff appendString:@"-include GNUmakefile.preamble\n"]; + [mff appendString:@"include $(GNUSTEP_MAKEFILES)/aggregate.make\n"]; + [mff appendString:@"-include GNUmakefile.postamble\n"]; +} + +@end + +@implementation PCAggregateProject (Inspector) + +- (NSView *)projectAttributesView +{ + if (projectAttributesView == nil) + { + if ([NSBundle loadNibNamed:@"Inspector" owner:self] == NO) + { + NSLog(@"PCLibraryProject: error loading Inspector NIB!"); + return nil; + } + [projectAttributesView retain]; + [self updateInspectorValues:nil]; + } + + return projectAttributesView; +} + +- (void)updateInspectorValues:(NSNotification *)aNotif +{ + [projectTypeField setStringValue:@"Aggregate"]; + [projectNameField setStringValue:projectName]; +} + +@end + diff --git a/Modules/AggregateProject/Resources/Inspector.gorm/data.classes b/Modules/AggregateProject/Resources/Inspector.gorm/data.classes new file mode 100644 index 0000000..ed48144 --- /dev/null +++ b/Modules/AggregateProject/Resources/Inspector.gorm/data.classes @@ -0,0 +1,155 @@ +{ + FirstResponder = { + Actions = ( + "activateContextHelpMode:", + "alignCenter:", + "alignJustified:", + "alignLeft:", + "alignRight:", + "arrangeInFront:", + "cancel:", + "capitalizeWord:", + "changeColor:", + "changeFont:", + "checkSpelling:", + "close:", + "complete:", + "copy:", + "copyFont:", + "copyRuler:", + "cut:", + "delete:", + "deleteBackward:", + "deleteForward:", + "deleteToBeginningOfLine:", + "deleteToBeginningOfParagraph:", + "deleteToEndOfLine:", + "deleteToEndOfParagraph:", + "deleteToMark:", + "deleteWordBackward:", + "deleteWordForward:", + "deminiaturize:", + "deselectAll:", + "fax:", + "hide:", + "hideOtherApplications:", + "indent:", + "loosenKerning:", + "lowerBaseline:", + "lowercaseWord:", + "makeKeyAndOrderFront:", + "miniaturize:", + "miniaturizeAll:", + "moveBackward:", + "moveBackwardAndModifySelection:", + "moveDown:", + "moveDownAndModifySelection:", + "moveForward:", + "moveForwardAndModifySelection:", + "moveLeft:", + "moveRight:", + "moveToBeginningOfDocument:", + "moveToBeginningOfLine:", + "moveToBeginningOfParagraph:", + "moveToEndOfDocument:", + "moveToEndOfLine:", + "moveToEndOfParagraph:", + "moveUp:", + "moveUpAndModifySelection:", + "moveWordBackward:", + "moveWordBackwardAndModifySelection:", + "moveWordForward:", + "moveWordForwardAndModifySelection:", + "newDocument:", + "ok:", + "open:", + "openDocument:", + "orderBack:", + "orderFront:", + "orderFrontColorPanel:", + "orderFrontDataLinkPanel:", + "orderFrontFontPanel:", + "orderFrontHelpPanel:", + "orderFrontStandardAboutPanel:", + "orderFrontStandardInfoPanel:", + "orderOut:", + "pageDown:", + "pageUp:", + "paste:", + "pasteAsPlainText:", + "pasteAsRichText:", + "pasteFont:", + "pasteRuler:", + "performClose:", + "performMiniaturize:", + "performZoom:", + "print:", + "raiseBaseline:", + "revertDocumentToSaved:", + "runPageLayout:", + "runToolbarCustomizationPalette:", + "saveAllDocuments:", + "saveDocument:", + "saveDocumentAs:", + "saveDocumentTo:", + "scrollLineDown:", + "scrollLineUp:", + "scrollPageDown:", + "scrollPageUp:", + "scrollViaScroller:", + "selectAll:", + "selectLine:", + "selectNextKeyView:", + "selectParagraph:", + "selectPreviousKeyView:", + "selectText:", + "selectToMark:", + "selectWord:", + "showContextHelp:", + "showGuessPanel:", + "showHelp:", + "showWindow:", + "stop:", + "subscript:", + "superscript:", + "swapWithMark:", + "takeDoubleValueFrom:", + "takeFloatValueFrom:", + "takeIntValueFrom:", + "takeObjectValueFrom:", + "takeStringValueFrom:", + "terminate:", + "tightenKerning:", + "toggle:", + "toggleContinuousSpellChecking:", + "toggleRuler:", + "toggleToolbarShown:", + "toggleTraditionalCharacterShape:", + "transpose:", + "transposeWords:", + "turnOffKerning:", + "turnOffLigatures:", + "underline:", + "unhide:", + "unhideAllApplications:", + "unscript:", + "uppercaseWord:", + "useAllLigatures:", + "useStandardKerning:", + "useStandardLigatures:", + "yank:", + "zoom:" + ); + Super = NSObject; + }; + PCToolProject = { + Actions = ( + ); + Outlets = ( + projectAttributesView, + projectTypeField, + projectNameField + ); + Super = NSObject; + }; +} \ No newline at end of file diff --git a/Modules/AggregateProject/Resources/Inspector.gorm/objects.gorm b/Modules/AggregateProject/Resources/Inspector.gorm/objects.gorm new file mode 100644 index 0000000000000000000000000000000000000000..c9a1e68d64095d5d74553b9ef8e1bba2c0595437 GIT binary patch literal 3467 zcmcInUvt|;5MSAH9LI?h$FV6%fk0^~rG-`chb9FQ+rg=UD4_}sZ;WDVQWeMc*h-VU zk3O zz=#%wjBc#&JLXQ!TD2>V-Kd+bBOcUL7}t%#KDb5$qZrjhBYEk5p#qWIljt{dG?iJQW>C^+T|0EOWdw!j5h_>K+#cEWJCyJJ`pAdumtpWvp-N>v=!lDxky z>(D9LR;@~%iZ%`j-C$<48a3|dZFuFF>=r$?Tlj;T`JaaE2HnGUC!}4e3sc$zO!nC= zS~X!xOEIbPf@eYBBp*ok3ve=&GkrXPdE(CzG>J7!E>3AvJikQyq0K})3rI^PiGU3W z6&})r8a$)Y0hR7BI}-T zZExy-alm&3Uf0jS>s>j10e`w7{OLNrcP_-GKi%v@T>6thJaC+$Tc_)0!k?5#;7_*( z5PzQ#|3EGRTtw**YB;8J@O*vods-A5;`2aI(*&jqXJC5!!kFF>m@eSmb73l3e9xc6 z52gIcq`>ts90&nH4~R%eIPW18MEAa=fc;n41H2!y+O1AZF3}al*HP6Q$3-bO7KErV zm2Nm0y8}7Uyi2%rF3AP&3O)$2U8cz27WXD)TO#&v}x8Yc|T`3vD>!m)dr_W zkzQ&*UqRCI0|)%SLF``M0~GrIq|Vi^UjTmGm&k<88sc(SnZUfmWzL{JkzAJ9kvEFV zf?_LjTc?J(yd2L4P-ay)AgKAuYf$Uoufjrz_U+zmEXwg%pgqRvtV!DGD7|7%1mt9a zcAZO>F0X(nSXerjbh3`C;i@*n*q8UrU5g|XlEF`+7r$&hz8(I!#gn^BHr)D{nYWABcdvV;9h6awQ+5ay9d19zTJvQu6_Rlv} q8y*XvIlwRdoLBZ1@sZRr@V_vqrJE-PUWA62Tf(g~=XNimVD3MoItbPP literal 0 HcmV?d00001 diff --git a/Modules/AggregateProject/Resources/PC.project b/Modules/AggregateProject/Resources/PC.project new file mode 100644 index 0000000..0e205d8 --- /dev/null +++ b/Modules/AggregateProject/Resources/PC.project @@ -0,0 +1,40 @@ +{ + BUILDTOOL = "/usr/bin/make"; + CLASS_FILES = (); + COMPILEROPTIONS = ""; + CPPOPTIONS = ""; + LINKEROPTIONS = ""; + CREATION_DATE = ""; + DOCU_FILES = (); + FRAMEWORKS = (); + HEADER_FILES = (); + IMAGES = (); + LANGUAGE = "English"; + LAST_EDITING = ""; + LIBRARIES = ("gnustep-base"); + MAKEFILEDIR = "$(GNUSTEP_MAKEFILES)"; + INSTALLDIR = "$(HOME)/GNUstep"; + OBJC_COMPILEROPTIONS = ""; + OTHER_FILES = (); + OTHER_RESOURCES = (); + OTHER_SOURCES = (); + PROJECT_AUTHORS = (); + PROJECT_CREATOR = ""; + PROJECT_DESCRIPTION = "No description avaliable!"; + PROJECT_GROUP = "No group avaliable!"; + PROJECT_SUMMARY = "No summary avaliable!"; + PROJECT_RELEASE = "0.1"; + PROJECT_COPYRIGHT = "Copyright (C) 200x"; + PROJECT_COPYRIGHT_DESC = "Released under ..."; + PROJECT_SOURCE = "%{gs_name}-%{gs_version}.tar.gz"; + PROJECT_MAINTAINER = ""; + PROJECT_NAME = ""; + PROJECT_TYPE = "Aggregate"; + PROJECT_VERSION = 0.1; + PROJECT_URL = ""; + SEARCH_HEADER_DIRS = (); + SEARCH_LIB_DIRS = (); + SUBPROJECTS = (); + SUPPORTING_FILES = ("GNUmakefile.preamble", "GNUmakefile", "GNUmakefile.postamble"); + TOOLICON = ""; +}