*** empty log message ***

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@19516 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Sergii Stoian 2004-06-14 09:42:27 +00:00
parent 0b4fa737b8
commit cc6f1ede8b
8 changed files with 710 additions and 0 deletions

View file

@ -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

View file

@ -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 <AppKit/AppKit.h>
#include <ProjectCenter/ProjectCenter.h>
@interface PCAggregateProj : NSObject <ProjectType>
{
}
//----------------------------------------------------------------------------
// ProjectType
//----------------------------------------------------------------------------
+ (id)sharedCreator;
- (Class)projectClass;
- (NSString *)projectTypeName;
- (PCProject *)createProjectAt:(NSString *)path;
- (PCProject *)openProjectAt:(NSString *)path;
@end
#endif

View file

@ -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

View file

@ -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 <AppKit/AppKit.h>
#include <ProjectCenter/PCProject.h>
@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

View file

@ -0,0 +1,230 @@
/*
GNUstep ProjectCenter - http://www.gnustep.org
Copyright (C) 2001 Free Software Foundation
Author: Philippe C.D. Robert <phr@3dkit.org>
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 <ProjectCenter/PCMakefileFactory.h>
@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

View file

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

View file

@ -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 = "";
}