mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-02-22 19:31:56 +00:00
*** empty log message ***
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/branches/UNSTABLE_0_4@18033 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
896930258c
commit
3a5e704aad
22 changed files with 1598 additions and 0 deletions
66
Modules/LibraryProject/GNUmakefile
Normal file
66
Modules/LibraryProject/GNUmakefile
Normal file
|
@ -0,0 +1,66 @@
|
|||
#
|
||||
# GNUmakefile - Generated by ProjectCenter
|
||||
# Written by Philippe C.D. Robert <phr@3dkit.org>
|
||||
#
|
||||
# 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
|
29
Modules/LibraryProject/Info.table
Normal file
29
Modules/LibraryProject/Info.table
Normal file
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
AdditionalAttributes = {
|
||||
PrincipalClass = {ATTR_CLASS_NAME = "NSString";};
|
||||
};
|
||||
Allowable_SubprojectTypes = (Subproject, Bundle, Tool, Framework, Library, Palette);
|
||||
AttributesInspector = ApplicationInspector;
|
||||
DefaultExtension = "";
|
||||
Default_Localizable_Keys = (INTERFACES);
|
||||
GeneratedFiles = (Makefile, iconHeader);
|
||||
INSTALLFLAGS = "-c -s -m 755";
|
||||
InfoName = "";
|
||||
Localizable_Keys = (INTERFACES, IMAGES, OTHER_RESOURCES, HELP_RESOURCES);
|
||||
MAKEFILE = app.make;
|
||||
MAKEFILEDIR = "$(MAKEFILEPATH)/pb_makefiles";
|
||||
Other_Keys = (HELP_RESOURCES, OTHER_SOURCES, FRAMEWORKS, OTHER_LIBS);
|
||||
PBProjectTypeSubClass = "PBApplicationProjectType";
|
||||
ProvidesIcons = Yes;
|
||||
Public_Keys = (H_FILES);
|
||||
Resource_Keys = (INTERFACES, IMAGES, OTHER_RESOURCES);
|
||||
SOURCEMODE = 444;
|
||||
Source_Keys = (CLASSES, H_FILES, OTHER_LINKED);
|
||||
Subproj_Keys = (SUBPROJECTS);
|
||||
Targets = (app, debug, profile, install);
|
||||
ExecutableResults = (
|
||||
"$PROJECTNAME$.app/$PROJECTNAME$$EXECUTABLE_EXT$",
|
||||
"$PROJECTNAME$.debug/$PROJECTNAME$$EXECUTABLE_EXT$",
|
||||
"$PROJECTNAME$.profile/$PROJECTNAME$$EXECUTABLE_EXT$"
|
||||
);
|
||||
}
|
34
Modules/LibraryProject/PC.proj
Normal file
34
Modules/LibraryProject/PC.proj
Normal file
|
@ -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");
|
||||
}
|
53
Modules/LibraryProject/PCLibProj.h
Normal file
53
Modules/LibraryProject/PCLibProj.h
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
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.
|
||||
|
||||
$Id$
|
||||
*/
|
||||
|
||||
#ifndef _PCLIBPROJ_H
|
||||
#define _PCLIBPROJ_H
|
||||
|
||||
#include <AppKit/AppKit.h>
|
||||
#include <ProjectCenter/ProjectCenter.h>
|
||||
|
||||
@interface PCLibProj : NSObject <ProjectType>
|
||||
{
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// ProjectType
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
+ (id)sharedCreator;
|
||||
|
||||
- (Class)projectClass;
|
||||
|
||||
- (NSString *)projectTypeName;
|
||||
- (NSDictionary *)typeTable;
|
||||
|
||||
- (PCProject *)createProjectAt:(NSString *)path;
|
||||
- (PCProject *)openProjectAt:(NSString *)path;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
141
Modules/LibraryProject/PCLibProj.m
Normal file
141
Modules/LibraryProject/PCLibProj.m
Normal file
|
@ -0,0 +1,141 @@
|
|||
/*
|
||||
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.
|
||||
|
||||
$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
|
70
Modules/LibraryProject/PCLibProject.h
Normal file
70
Modules/LibraryProject/PCLibProject.h
Normal file
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
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.
|
||||
|
||||
$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 <AppKit/AppKit.h>
|
||||
#include <ProjectCenter/PCProject.h>
|
||||
|
||||
@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
|
171
Modules/LibraryProject/PCLibProject.m
Normal file
171
Modules/LibraryProject/PCLibProject.m
Normal file
|
@ -0,0 +1,171 @@
|
|||
/*
|
||||
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.
|
||||
|
||||
$Id$
|
||||
*/
|
||||
|
||||
#include "PCLibProject.h"
|
||||
#include "PCLibProj.h"
|
||||
|
||||
#include <ProjectCenter/PCMakefileFactory.h>
|
||||
|
||||
@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
|
12
Modules/LibraryProject/Version
Normal file
12
Modules/LibraryProject/Version
Normal file
|
@ -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}
|
25
Modules/RenaissanceProject/AppController.h
Normal file
25
Modules/RenaissanceProject/AppController.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* AppController.h
|
||||
*
|
||||
* GNUstep Renaissance Application Controller
|
||||
*
|
||||
* Created with ProjectCenter - http://www.gnustep.org
|
||||
*/
|
||||
|
||||
#ifndef _APPCONTROLLER_H_
|
||||
#define _APPCONTROLLER_H_
|
||||
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <Renaissance/Renaissance.h>
|
||||
|
||||
@interface AppController : NSObject
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
- (void) applicationDidFinishLaunching: (NSNotification *)not;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* _APPCONTROLLER_H_ */
|
||||
|
18
Modules/RenaissanceProject/AppController.m
Normal file
18
Modules/RenaissanceProject/AppController.m
Normal file
|
@ -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
|
72
Modules/RenaissanceProject/GNUmakefile
Normal file
72
Modules/RenaissanceProject/GNUmakefile
Normal file
|
@ -0,0 +1,72 @@
|
|||
#
|
||||
# GNUmakefile - Generated by ProjectCenter
|
||||
# Written by Philippe C.D. Robert <phr@3dkit.org>
|
||||
#
|
||||
# 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
|
29
Modules/RenaissanceProject/Info.table
Normal file
29
Modules/RenaissanceProject/Info.table
Normal file
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
AdditionalAttributes = {
|
||||
PrincipalClass = {ATTR_CLASS_NAME = "NSString";};
|
||||
};
|
||||
Allowable_SubprojectTypes = (Subproject, Bundle, Tool, Framework, Library, Palette);
|
||||
AttributesInspector = ApplicationInspector;
|
||||
DefaultExtension = "";
|
||||
Default_Localizable_Keys = (INTERFACES);
|
||||
GeneratedFiles = (Makefile, iconHeader);
|
||||
INSTALLFLAGS = "-c -s -m 755";
|
||||
InfoName = "";
|
||||
Localizable_Keys = (INTERFACES, IMAGES, OTHER_RESOURCES, HELP_RESOURCES);
|
||||
MAKEFILE = app.make;
|
||||
MAKEFILEDIR = "$(MAKEFILEPATH)/pb_makefiles";
|
||||
Other_Keys = (HELP_RESOURCES, OTHER_SOURCES, FRAMEWORKS, OTHER_LIBS);
|
||||
PBProjectTypeSubClass = "PBApplicationProjectType";
|
||||
ProvidesIcons = Yes;
|
||||
Public_Keys = (H_FILES);
|
||||
Resource_Keys = (INTERFACES, IMAGES, OTHER_RESOURCES);
|
||||
SOURCEMODE = 444;
|
||||
Source_Keys = (CLASSES, H_FILES, OTHER_LINKED);
|
||||
Subproj_Keys = (SUBPROJECTS);
|
||||
Targets = (app, debug, profile, install);
|
||||
ExecutableResults = (
|
||||
"$PROJECTNAME$.app/$PROJECTNAME$$EXECUTABLE_EXT$",
|
||||
"$PROJECTNAME$.debug/$PROJECTNAME$$EXECUTABLE_EXT$",
|
||||
"$PROJECTNAME$.profile/$PROJECTNAME$$EXECUTABLE_EXT$"
|
||||
);
|
||||
}
|
8
Modules/RenaissanceProject/Main.gsmarkup
Normal file
8
Modules/RenaissanceProject/Main.gsmarkup
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE gsmarkup>
|
||||
<gsmarkup>
|
||||
|
||||
<objects>
|
||||
<window/>
|
||||
</objects>
|
||||
</gsmarkup>
|
55
Modules/RenaissanceProject/MainMenu-GNUstep.gsmarkup
Normal file
55
Modules/RenaissanceProject/MainMenu-GNUstep.gsmarkup
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE gsmarkup>
|
||||
|
||||
<!-- Remove any menu items and submenus which you don't need. Add any
|
||||
menu items and submenus which you need. -->
|
||||
|
||||
<gsmarkup>
|
||||
<objects>
|
||||
|
||||
<menu type="main">
|
||||
|
||||
<menu title="Info">
|
||||
<menuItem title="Info Panel..."
|
||||
action="orderFrontStandardInfoPanel:"/>
|
||||
<menuItem title="Preferences..." action=""/>
|
||||
<menuItem title="Help..." action="orderFrontHelpPanel:" key="?"/>
|
||||
</menu>
|
||||
|
||||
<menu title="Document">
|
||||
<menuItem title="Open" action="" key="o"/>
|
||||
<menuItem title="New" action="" key="n"/>
|
||||
<menuItem title="Save" action="" key="s"/>
|
||||
<menuItem title="Save As..." action="" key="S"/>
|
||||
<menuItem title="Save To..." action="t"/>
|
||||
<menuItem title="Save All" action=""/>
|
||||
<menuItem title="Revert to Saved" action="" key="u"/>
|
||||
<menuItem title="Close" action=""/>
|
||||
<menuItem title="Page Layout..." action="pageLayout:" key="P"/>
|
||||
<menuItem title="Print" action="print:" key="p"/>
|
||||
</menu>
|
||||
|
||||
<menu title="Edit">
|
||||
<menuItem title="Undo" action="undo:" key="z"/>
|
||||
<menuItem title="Redo" action="redo:" key="Z"/>
|
||||
<menuItem title="Cut" action="cut:" key="x"/>
|
||||
<menuItem title="Copy" action="copy:" key="c"/>
|
||||
<menuItem title="Paste" action="paste:" key="v"/>
|
||||
<menuItem title="Delete" action="delete:" key=""/>
|
||||
<menuItem title="SelectAll" action="selectAll:" key="a"/>
|
||||
</menu>
|
||||
|
||||
<menu title="Windows">
|
||||
<menuItem title="Arrange In Front" action="arrangeInFront:"/>
|
||||
<menuItem title="Miniaturize Window" action="performMiniaturize:"
|
||||
key="m"/>
|
||||
<menuItem title="Close Window" action="performClose:" key="w"/>
|
||||
</menu>
|
||||
|
||||
<menu title="Services" type="services"/>
|
||||
|
||||
<menuItem title="Hide" action="hide:" key="h"/>
|
||||
<menuItem title="Quit" action="terminate:" key="q"/>
|
||||
</menu>
|
||||
</objects>
|
||||
</gsmarkup>
|
63
Modules/RenaissanceProject/MainMenu-OSX.gsmarkup
Normal file
63
Modules/RenaissanceProject/MainMenu-OSX.gsmarkup
Normal file
|
@ -0,0 +1,63 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE gsmarkup>
|
||||
|
||||
<gsmarkup>
|
||||
<objects>
|
||||
|
||||
<menu type="main">
|
||||
|
||||
<menu title="MyApplication" type="apple">
|
||||
<menuItem title="About MyApplication"
|
||||
action="orderFrontStandardAboutPanel:"/>
|
||||
<menuSeparator/>
|
||||
<menuItem title="Preferences..." action="runPreferencesPanel:"/>
|
||||
<menu title="Services" type="services"/>
|
||||
<menuSeparator/>
|
||||
<menuItem title="Hide MyApplication" action="hide:" key="h"/>
|
||||
<menuItem title="Hide Others" action="hideOtherApplications:"/>
|
||||
<menuItem title="Show All" action="unhideAllApplications:"/>
|
||||
<menuSeparator/>
|
||||
<menuItem title="Quit MyApplication" action="terminate:" key="q"/>
|
||||
</menu>
|
||||
|
||||
<menu title="File">
|
||||
<menuItem title="New" action="" key="n"/>
|
||||
<menuItem title="Open..." action="" key="o"/>
|
||||
<menu title="Open Recent" type="openRecent">
|
||||
<menuItem title="Clear menu" action=""/>
|
||||
</menu>
|
||||
<menuSeparator/>
|
||||
<menuItem title="Close" action="performClose:" key="w"/>
|
||||
<menuItem title="Save" action="" key="s"/>
|
||||
<menuItem title="Save As..." action="" key="S"/>
|
||||
<menuItem title="Revert" action=""/>
|
||||
<menuSeparator/>
|
||||
<menuItem title="Page Setup..." action="runPageLayout:" key="P"/>
|
||||
<menuItem title="Print..." action="print:" key="p"/>
|
||||
</menu>
|
||||
|
||||
<menu title="Edit">
|
||||
<menuItem title="Undo" action="undo:" key="z"/>
|
||||
<menuItem title="Redo" action="redo:" key="Z"/>
|
||||
<menuSeparator/>
|
||||
<menuItem title="Cut" action="cut:" key="x"/>
|
||||
<menuItem title="Copy" action="copy:" key="c"/>
|
||||
<menuItem title="Paste" action="paste:" key="v"/>
|
||||
<menuItem title="Delete" action="delete:"/>
|
||||
<menuItem title="Select All" action="selectAll:" key="a"/>
|
||||
</menu>
|
||||
|
||||
<menu title="Window" type="windows">
|
||||
<menuItem title="Close Window" action="performClose:" key="w"/>
|
||||
<menuItem title="Minimize Window" action="performMiniaturize:"
|
||||
key="m"/>
|
||||
<menuSeparator/>
|
||||
<menuItem title="Bring All to Front" action="arrangeInFront:" key=""/>
|
||||
</menu>
|
||||
|
||||
<menu title="Help">
|
||||
<menuItem title="MyApplication Help" action="showHelp:" key="?"/>
|
||||
</menu>
|
||||
</menu>
|
||||
</objects>
|
||||
</gsmarkup>
|
40
Modules/RenaissanceProject/PC.proj
Normal file
40
Modules/RenaissanceProject/PC.proj
Normal file
|
@ -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");
|
||||
}
|
52
Modules/RenaissanceProject/PCRenaissanceProj.h
Normal file
52
Modules/RenaissanceProject/PCRenaissanceProj.h
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org
|
||||
|
||||
Copyright (C) 2003 Free Software Foundation
|
||||
|
||||
Author: Philippe C.D. Robert <phr@3dkit.org>
|
||||
Modified by Daniel Luederwald <das_flip@gmx.de>
|
||||
|
||||
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 <AppKit/AppKit.h>
|
||||
#include <ProjectCenter/ProjectCenter.h>
|
||||
|
||||
@interface PCRenaissanceProj : NSObject <ProjectType>
|
||||
{
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// ProjectType
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
+ (id)sharedCreator;
|
||||
|
||||
- (Class)projectClass;
|
||||
|
||||
- (NSString *)projectTypeName;
|
||||
- (NSDictionary *)typeTable;
|
||||
|
||||
- (PCProject *)createProjectAt:(NSString *)path;
|
||||
- (PCProject *)openProjectAt:(NSString *)path;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
191
Modules/RenaissanceProject/PCRenaissanceProj.m
Normal file
191
Modules/RenaissanceProject/PCRenaissanceProj.m
Normal file
|
@ -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 <phr@3dkit.org>
|
||||
Pierre-Yves Rivaille <pyrivail@ens-lyon.fr>
|
||||
|
||||
Modified by Daniel Luederwald <das_flip@gmx.de>
|
||||
|
||||
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
|
8
Modules/RenaissanceProject/PCRenaissanceProj_Prefix.h
Normal file
8
Modules/RenaissanceProject/PCRenaissanceProj_Prefix.h
Normal file
|
@ -0,0 +1,8 @@
|
|||
//
|
||||
// Prefix header for all source files of the 'PCRenaissanceProj' target in the 'PCRenaissanceProj' project.
|
||||
//
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <AppKit/AppKit.h>
|
||||
#endif
|
85
Modules/RenaissanceProject/PCRenaissanceProject.h
Normal file
85
Modules/RenaissanceProject/PCRenaissanceProject.h
Normal file
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org
|
||||
|
||||
Copyright (C) 2003 Free Software Foundation
|
||||
|
||||
Author: Philippe C.D. Robert <phr@3dkit.org>
|
||||
Modified by Daniel Luederwald <das_flip@gmx.de>
|
||||
|
||||
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 <AppKit/AppKit.h>
|
||||
#include <ProjectCenter/PCProject.h>
|
||||
|
||||
@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
|
349
Modules/RenaissanceProject/PCRenaissanceProject.m
Normal file
349
Modules/RenaissanceProject/PCRenaissanceProject.m
Normal file
|
@ -0,0 +1,349 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org
|
||||
|
||||
Copyright (C) 2003 Free Software Foundation
|
||||
|
||||
Authors: Philippe C.D. Robert <probert@siggraph.org>
|
||||
Modified by Daniel Luederwald <das_flip@gmx.de>
|
||||
|
||||
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 <ProjectCenter/PCMakefileFactory.h>
|
||||
|
||||
@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
|
27
Modules/RenaissanceProject/main.m
Normal file
27
Modules/RenaissanceProject/main.m
Normal file
|
@ -0,0 +1,27 @@
|
|||
#include <Foundation/Foundation.h>
|
||||
#include <AppKit/AppKit.h>
|
||||
#include <Renaissance/Renaissance.h>
|
||||
#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);
|
||||
|
||||
}
|
Loading…
Reference in a new issue