Added new PCRenaissanceProj project type

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@15699 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2003-01-26 03:43:19 +00:00
parent d57c50e9b0
commit a2392f8080
33 changed files with 1237 additions and 4 deletions

View file

@ -1,3 +1,7 @@
2003-01-25 Daniel Luederwald <das_flip@gmx.de>
* GNUmakefile (SUBPROJECTS): New project PCRenaissanceProj
2002-10-06 15:45 probert
* AUTHORS, PCLib/PCEditor.h, PCLib/PCEditor.m,

View file

@ -41,6 +41,7 @@ SUBPROJECTS = \
PCToolProj \
PCLibProj \
PCBaseFileTypes \
PCRenaissanceProj \
ProjectCenter
-include GNUMakefile.preamble

View file

@ -1,3 +1,8 @@
2003-01-25 Daniel Luederwald <das_flip@gmx.de>
* GNUmakefile (PCBaseFileTypes_RESOURCE_FILES): New type gsmarkup.
* PCBaseFileType.m: Idem.
2002-11-27 15:45 probert
* Mac OS X port using Cocoa

View file

@ -45,6 +45,7 @@ class.template \
header.template \
protocol.template \
nsviewclass.template \
gsmarkup.template \
nsviewheader.template
#

View file

@ -33,6 +33,7 @@
#define CFile @"C File"
#define CHeader @"C Header"
#define ProtocolFile @"Objective-C Protocol"
#define GSMarkupFile @"GSMarkup"
@implementation PCBaseFileType
@ -49,6 +50,7 @@ static NSDictionary *dict = nil;
NSDictionary *ccDict;
NSDictionary *chDict;
NSDictionary *protocolDict;
NSDictionary *gsmarkupDict;
NSString *descr;
_creator = [[[self class] alloc] init];
@ -95,6 +97,14 @@ static NSDictionary *dict = nil;
PCHeaders,@"ProjectKey",
descr,@"TypeDescription",
nil];
descr = [NSString stringWithString:@"Generic GSMarkup File.\n\nThis is the interface description of GNUstep Renaissance."];
gsmarkupDict =[NSDictionary dictionaryWithObjectsAndKeys:
_creator,@"Creator",
PCGSMarkupFiles,@"ProjectKey",
descr,@"TypeDescription",
nil];
dict = [[NSDictionary alloc] initWithObjectsAndKeys:
ccDict,CFile,
@ -103,6 +113,7 @@ static NSDictionary *dict = nil;
headerDict,ObjCHeader,
classDict,ObjCClass,
nsviewClassDict,ObjCNSViewClass,
gsmarkupDict, GSMarkupFile,
nil];
}
return _creator;
@ -225,6 +236,17 @@ static NSDictionary *dict = nil;
[files setObject:ObjCHeader forKey:newFile];
}
else if ([type isEqualToString:GSMarkupFile])
{
_file = [[NSBundle bundleForClass:[self class]] pathForResource:@"gsmarkup" ofType:@"template"];
if ([[path pathExtension] isEqual: @"gsmarkup"] == NO)
newFile = [path stringByAppendingPathExtension:@"gsmarkup"];
[fm copyPath:_file toPath:newFile handler:nil];
[files setObject:GSMarkupFile forKey:newFile];
}
/*
*
*/

View file

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<!DOCTYPE gsmarkup>
<gsmarkup>
<objects>
<window/>
</objects>
</gsmarkup>

View file

@ -1,3 +1,10 @@
2003-01-25 Daniel Luederwald <das_flip@gmx.de>
* PCBrowserController.m: Add gsmarkup to editable files.
(isEditableFiles:): Idem, but don't allow editing if extension
is gorm (patch from Adam Fedor <fedor@gnu.org>).
* PCProjectDebugger.m (run:): Add PCRenaissanceProject.
2002-11-27 Philippe C.D. Robert <probert@siggraph.org>
* Extracting UI code into separate categories. PBX project file for

View file

@ -42,7 +42,7 @@
- (void)click:(id)sender;
- (void)doubleClick:(id)sender;
- (BOOL)isEditableCategory:(NSString *)category;
- (BOOL)isEditableCategory:(NSString *)category file: (NSString *)title;
- (void)projectDictDidChange:(NSNotification *)aNotif;

View file

@ -44,7 +44,7 @@
NSString *ltitle = [[sender selectedCell] stringValue];
NSString *category = [[sender selectedCellInColumn:0] stringValue];
if ([self isEditableCategory:category])
if ([self isEditableCategory:category file: ltitle])
{
[[NSNotificationCenter defaultCenter] postNotificationName:@"FileBecomesEditedNotification" object:ltitle];
@ -61,7 +61,7 @@
NSString *fn = [self nameOfSelectedFile];
NSString *f = [[project projectPath] stringByAppendingPathComponent:fn];
if ([self isEditableCategory:category])
if ([self isEditableCategory:category file: fn])
{
[project browserDidDblClickFile:f category:category];
}
@ -76,7 +76,7 @@
}
}
- (BOOL)isEditableCategory:(NSString *)category
- (BOOL)isEditableCategory:(NSString *)category file: (NSString *)title
{
NSString *k = [[project rootCategories] objectForKey:category];
@ -90,6 +90,12 @@
return YES;
}
if ([k isEqualToString:PCGSMarkupFiles]
&& [[title pathExtension] isEqual: @"gorm"] == NO)
{
return YES;
}
return NO;
}

View file

@ -81,6 +81,7 @@ typedef int PCProjInfoBits;
static NSString * const PCClasses = @"CLASS_FILES";
static NSString * const PCHeaders = @"HEADER_FILES";
static NSString * const PCGSMarkupFiles = @"INTERFACES";
static NSString * const PCOtherSources = @"OTHER_SOURCES";
static NSString * const PCOtherResources = @"OTHER_RESOURCES";
static NSString * const PCSupportingFiles = @"SUPPORTING_FILES";

View file

@ -138,6 +138,9 @@
if ([key isEqualToString:PCGModels]) {
return [NSArray arrayWithObjects:@"gmodel",@"gorm",nil];
}
if ([key isEqualToString:PCGSMarkupFiles]) {
return [NSArray arrayWithObjects:@"gsmarkup",nil];
}
else if ([key isEqualToString:PCClasses]) {
return [NSArray arrayWithObjects:@"m",nil];
}

View file

@ -266,6 +266,7 @@ enum {
*/
if ([currentProject isKindOfClass:NSClassFromString(@"PCAppProject")] ||
[currentProject isKindOfClass:NSClassFromString(@"PCRenaissanceProject")] ||
[currentProject isKindOfClass:NSClassFromString(@"PCGormProject")])
{
NSString *tn;

View file

@ -0,0 +1,25 @@
/*
* AppController.h
*
* GNUstep Renaissance Application Controller
*
* Created with ProjectCenter - http://www.gnustep.org
*/
#ifndef _APPCONTROLLER_H_
#define _APPCONTROLLER_H_
#import <Foundation/Foundation.h>
#import <Renaissance/Renaissance.h>
@interface AppController : NSObject
{
}
- (void) applicationDidFinishLaunching: (NSNotification *)not;
@end
#endif // _APPCONTROLLER_H_

View file

@ -0,0 +1,18 @@
/*
* AppController.m
*
* GNUstep Renaissance Application Controller
*
* Created with ProjectCenter - http://www.gnustep.org
*
*/
#import "AppController.h"
@implementation AppController
- (void) applicationDidFinishLaunching: (NSNotification *)not
{
[NSBundle loadGSMarkupNamed: @"Main" owner: self];
}
@end

View file

@ -0,0 +1,4 @@
2003-01-25 Daniel Luederwald <das_flip@gmx.de>
* New project (copied and updated from PCGormProj).

View file

@ -0,0 +1,76 @@
#
# 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=PCRenaissanceProj
BUNDLE_NAME=PCRenaissanceProj
BUNDLE_EXTENSION=.bundle
BUNDLE_INSTALL_DIR=$(GNUSTEP_INSTALLATION_DIR)/Library/ProjectCenter
PCRenaissanceProj_PRINCIPAL_CLASS=PCRenaissanceProj
#
# Additional libraries
#
PCRenaissanceProj_LIBRARIES_DEPEND_UPON += -lProjectCenter
#
# Resource files
#
PCRenaissanceProj_RESOURCE_FILES= \
PC.proj \
main.m \
AppController.m \
AppController.h \
Main.gsmarkup \
MainMenu-GNUstep.gsmarkup \
MainMenu-OSX.gsmarkup \
Info-project.plist
#
# Header files
#
PCRenaissanceProj_HEADERS= \
PCRenaissanceProj.h \
PCRenaissanceProject.h
#
# Class files
#
PCRenaissanceProj_OBJC_FILES= \
PCRenaissanceProj.m \
PCRenaissanceProject.m
#
# C files
#
PCRenaissanceProj_C_FILES=
-include GNUmakefile.preamble
-include GNUmakefile.local
include $(GNUSTEP_MAKEFILES)/bundle.make
-include GNUmakefile.postamble

View file

@ -0,0 +1,30 @@
#
# Makefile.postamble
#
# Copyright (C) 2003 Free Software Foundation
#
# Author: Philippe C.D. Robert <prh@3dkit.org>
#
# This file is part of GNUstep
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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.
#
# If you are interested in a warranty or support for this source code,
# contact Scott Christley at scottc@net-community.com
#
# You should have received a copy of the GNU Library General Public
# License along with this library; see the file COPYING.LIB.
# If not, write to the Free Software Foundation,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

View file

@ -0,0 +1,78 @@
#
# Makefile.preamble
#
# Copyright (C) 2003 Free Software Foundation, Inc.
#
# Author: Philippe C.D. Robert <prh@3dkit.org>
#
# This file is part of GNUstep
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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.
#
# If you are interested in a warranty or support for this source code,
# contact Scott Christley at scottc@net-community.com
#
# You should have received a copy of the GNU Library General Public
# License along with this library; see the file COPYING.LIB.
# If not, write to the Free Software Foundation,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Makefile.preamble
#
# Project specific makefile variables, and additional
#
# Do not put any Makefile rules in this file, instead they should
# be put into Makefile.postamble.
#
#
# Flags dealing with compiling and linking
#
# Additional flags to pass to the preprocessor
ADDITIONAL_CPPFLAGS +=
# Additional flags to pass to the Objective-C compiler
ADDITIONAL_OBJCFLAGS +=
# Additional flags to pass to the C compiler
ADDITIONAL_CFLAGS +=
#ADDITIONAL_CFLAGS +=
# Additional include directories the compiler should search
ADDITIONAL_INCLUDE_DIRS += -I../PCLib
# Additional LDFLAGS to pass to the linker
#ADDITIONAL_LDFLAGS +=
# Additional library directories the linker should search
ADDITIONAL_LIB_DIRS += -L../PCLib/$(GNUSTEP_OBJ_DIR)
ADDITIONAL_TOOL_LIBS +=
# Not needed anymore, now managed by ProjectCenter
#PCGormProj_BUNDLE_LIBS = -lProjectCenter
#
# Flags dealing with installing and uninstalling
#
# Additional directories to be created during installation
ADDITIONAL_INSTALL_DIRS +=
#
# Local configuration
#

View file

@ -0,0 +1,12 @@
{
NOTE = "Automatically generated, do not edit!";
ApplicationName = "";
ApplicationDescription = "";
ApplicationIcon = "";
ApplicationRelease = "";
FullVersionID = "";
Authors = ();
URL = "";
Copyright = "";
CopyrightDescription = "";
}

View 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$"
);
}

View file

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<!DOCTYPE gsmarkup>
<gsmarkup>
<objects>
<window/>
</objects>
</gsmarkup>

View file

@ -0,0 +1,29 @@
<?xml version="1.0"?>
<!DOCTYPE gsmarkup>
<gsmarkup>
<objects>
<!-- application menu -->
<menu type="main">
<menuItem title="Info..." action="orderFrontStandardInfoPanel:" />
<menuItem title="Edit">
<menu>
<!-- <menuItem title="Cut" action="cut:" key="x" /> -->
<menuItem title="Copy" action="copy:" key="c" />
<menuItem title="Paste" action="paste:" key="v" />
<menuItem title="SelectAll" action="selectAll:" key="a" />
</menu>
</menuItem>
<menuItem title="Services">
<menu type="services" />
</menuItem>
<menuItem title="Hide" action="hide:" key="h" />
<menuItem title="Quit" action="terminate:" key="q" />
</menu>
</objects>
</gsmarkup>

View file

@ -0,0 +1,50 @@
<?xml version="1.0"?>
<!DOCTYPE gsmarkup>
<gsmarkup>
<objects>
<!-- application menu -->
<menu type="main">
<menuItem title="NewApplication">
<menu title="NewApplication" type="apple">
<menuItem title="About NewApplication" action="orderFrontStandardAboutPanel:" />
<menuSeparator />
<menuItem title="Services">
<menu title="Services" type="services" />
</menuItem>
<menuSeparator />
<menuItem title="Hide NewApplication" action="hide:" key="h" />
<menuItem title="Hide Others" action="hideOtherApplications:" />
<menuItem title="Show All" action="unhideAllApplications:" />
<menuSeparator />
<menuItem title="Quit NewApplication" action="terminate:" key="q" />
</menu>
</menuItem>
<menuItem title="Edit">
<menu title="Edit">
<!-- <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>
</menuItem>
<menuItem title="Window">
<menu title="Window">
<menuItem title="Minimize Window" action="performMiniaturize:" key="m" />
<menuSeparator />
<menuItem title="Bring All to Front" action="arrangeInFront:" key="" />
</menu>
</menuItem>
</menu>
</objects>
</gsmarkup>

40
PCRenaissanceProj/PC.proj Normal file
View 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");
}

View file

@ -0,0 +1,47 @@
/*
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.
*/
#import <AppKit/AppKit.h>
#import <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

View file

@ -0,0 +1,195 @@
/*
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!
*/
#import "PCRenaissanceProj.h"
#import "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];
#ifndef GNUSTEP_BASE_VERSION
[dict setObject:[[project principalClass] description] forKey:PCProjType];
#else
[dict setObject:[project principalClass] forKey:PCProjType];
#endif
// 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:PCGModels];
// 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

View file

@ -0,0 +1,68 @@
{
APPCLASS = NSApplication;
APPKIT = GNUSTEP-GUI;
APPLICATIONICON = "";
BUILDTOOL = "/usr/local/bin/gmake";
CLASS_FILES = (
PCRenaissanceProj.m,
PCRenaissanceProject.m
);
COMPILEROPTIONS = "";
CREATION_DATE = "";
DOCU_FILES = (
);
FOUNDATION = GNUSTEP-BASE;
FRAMEWORKS = (
);
HEADER_FILES = (
PCRenaissanceProj.h,
PCRenaissanceProject.h
);
IMAGES = (
);
INSTALLDIR = "$(GNUSTEP_INSTALLATION_DIR)/Library/ProjectCenter";
INTERFACES = (
);
LANGUAGE = English;
LAST_EDITING = "";
LIBRARIES = (
gnustep-base,
gnustep-gui,
ProjectCenter
);
LINKEROPTIONS = "";
MAININTERFACE = "";
MAKEFILEDIR = "$(GNUSTEP_SYSTEM_ROOT)/Makefiles";
OTHER_FILES = (
);
OTHER_RESOURCES = (
PC.proj,
main.m,
Main.gsmarkup,
MainMenu-GNUstep.gsmarkup,
MainMenu-OSX.gsmarkup,
Info-project.plist
);
OTHER_SOURCES = (
);
PRINCIPAL_CLASS = PCRenaissanceProj;
PROJECT_BUILDER = PCBundleProj;
PROJECT_COPYRIGHT = "No license specified!";
PROJECT_CREATOR = "";
PROJECT_DESCRIPTION = "No description avaliable!";
PROJECT_GROUP = "No description avaliable!";
PROJECT_MAINTAINER = "";
PROJECT_NAME = PCGormProj;
PROJECT_RELEASE = 1;
PROJECT_SOURCE = "%{gs_name}-%{gs_version}.tar.gz";
PROJECT_SUMMARY = "No summary avaliable!";
PROJECT_TYPE = PCBundleProject;
PROJECT_VERSION = 1.0;
SUBPROJECTS = (
);
SUPPORTING_FILES = (
GNUmakefile.preamble,
GNUmakefile,
GNUmakefile.postamble
);
}

View file

@ -0,0 +1,82 @@
/*
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.
*/
#import <AppKit/AppKit.h>
#import <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

View file

@ -0,0 +1,326 @@
/*
GNUstep ProjectCenter - http://www.gnustep.org
Copyright (C) 2003 Free Software Foundation
Authors: 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.
*/
#import "PCRenaissanceProject.h"
#import "PCRenaissanceProj.h"
#import <ProjectCenter/PCMakefileFactory.h>
@interface PCRenaissanceProject (CreateUI)
- (void)_initUI;
@end
@implementation PCRenaissanceProject (CreateUI)
- (void)_initUI
{
NSTextField *textField;
NSRect frame = {{84,120}, {80, 80}};
NSBox *_box;
[super _initUI];
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(84,256,176,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];
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,204,64,21)];
[textField setAlignment: NSRightTextAlignment];
[textField setBordered: NO];
[textField setEditable: NO];
[textField setBezeled: NO];
[textField setDrawsBackground: NO];
[textField setStringValue:@"App icon:"];
[projectProjectInspectorView addSubview:textField];
RELEASE(textField);
appImageField =[[NSTextField alloc] initWithFrame:NSMakeRect(84,204,176,21)];
[appImageField setAlignment: NSLeftTextAlignment];
[appImageField setBordered: YES];
[appImageField setEditable: NO];
[appImageField setBezeled: YES];
[appImageField setDrawsBackground: YES];
[appImageField setStringValue:@""];
[projectProjectInspectorView addSubview:appImageField];
setAppIconButton =[[NSButton alloc] initWithFrame:NSMakeRect(220,180,40,21)];
[setAppIconButton setTitle:@"Set"];
[setAppIconButton setTarget:self];
[setAppIconButton setAction:@selector(setAppIcon:)];
[projectProjectInspectorView addSubview:setAppIconButton];
clearAppIconButton =[[NSButton alloc] initWithFrame:NSMakeRect(180,180,40,21)];
[clearAppIconButton setTitle:@"Clear"];
[clearAppIconButton setTarget:self];
[clearAppIconButton setAction:@selector(clearAppIcon:)];
[projectProjectInspectorView addSubview:clearAppIconButton];
_box = [[NSBox alloc] init];
[_box setFrame:frame];
[_box setTitlePosition:NSNoTitle];
[_box setBorderType:NSBezelBorder];
[projectProjectInspectorView addSubview:_box];
appIconView = [[NSImageView alloc] initWithFrame:frame];
[_box addSubview:appIconView];
RELEASE(_box);
RELEASE(setAppIconButton);
RELEASE(clearAppIconButton);
RELEASE(appIconView);
}
@end
@implementation PCRenaissanceProject
//----------------------------------------------------------------------------
// Init and free
//----------------------------------------------------------------------------
- (id)init
{
if ((self = [super init])) {
rootCategories = [[NSDictionary dictionaryWithObjectsAndKeys:
PCGModels,@"Interfaces",
PCSupportingFiles,@"Supporting Files",
PCImages,@"Images",
PCOtherResources,@"Other Resources",
PCSubprojects,@"Subprojects",
PCLibraries,@"Libraries",
PCDocuFiles,@"Documentation",
PCOtherSources,@"Other Sources",
PCHeaders,@"Headers",
PCClasses,@"Classes",
nil] retain];
}
return self;
}
- (void)dealloc
{
[rootCategories release];
[appClassField release];
[appImageField release];
[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 appendCFiles:[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:PCGModels,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];
[projectWindow setDocumentEdited:YES];
}
- (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 addFile:path forKey:PCImages copy:YES];
[projectDict setObject:[path lastPathComponent] forKey:PCAppIcon];
[appImageField setStringValue:[path lastPathComponent]];
frame.size = [image size];
[appIconView setFrame:frame];
[appIconView setImage:image];
[appIconView display];
RELEASE(image);
[projectWindow setDocumentEdited:YES];
return YES;
}
- (void)setAppClass:(id)sender
{
[projectDict setObject:[appClassField stringValue] forKey:PCAppClass];
[projectWindow setDocumentEdited:YES];
}
@end

View file

@ -0,0 +1,11 @@
$$
/* $FILENAME$ created by $USERNAME$ on $DATE$ */
#import <AppKit/AppKit.h>
@interface $FILENAMESANSEXTENSION$ : NSObject
{
}
@end

View file

@ -0,0 +1,18 @@
$$ Lines starting with $$ are not inserted into newly created files
$$ The following substitutions are made:
$$
$$ $FILENAME$ e.g. foo.m
$$ $FILENAMESANSEXTENSION$ e.g. foo
$$ $DIRECTORY$ e.g. /tmp/MyNewApp
$$ $PROJECTNAME$ e.g. MyNewApp
$$ $SUBPROJECTNAME$ e.g. TheGoodPart.subproj
$$ $USERNAME$ e.g. mwagner
$$ $DATE$ e.g. Jan-1-1994
$$
/* $FILENAME$ created by $USERNAME$ on $DATE$ */
#import "$FILENAMESANSEXTENSION$.h"
@implementation $FILENAMESANSEXTENSION$
@end

27
PCRenaissanceProj/main.m Normal file
View file

@ -0,0 +1,27 @@
#import <AppKit/AppKit.h>
#import <Foundation/Foundation.h>
#import <Renaissance/Renaissance.h>
#import "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);
}

View file

@ -55,6 +55,7 @@
projectTypeAccessaryView = [[NSBox alloc] init];
projectTypePopup = [[NSPopUpButton alloc] initWithFrame:fr pullsDown:NO];
[projectTypePopup setAutoenablesItems: NO];
[projectTypePopup addItemWithTitle:@"No type available!"];
[projectTypeAccessaryView setTitle:@"Project Types"];