2003-11-02 20:58:45 +00:00
|
|
|
/*
|
|
|
|
GNUstep ProjectCenter - http://www.gnustep.org
|
|
|
|
|
|
|
|
Copyright (C) 2000-2002 Free Software Foundation
|
|
|
|
|
|
|
|
Author: Philippe C.D. Robert <probert@siggraph.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 _PCProject_h_
|
|
|
|
#define _PCProject_h_
|
|
|
|
|
|
|
|
#include <AppKit/AppKit.h>
|
|
|
|
|
|
|
|
@class PCProjectManager;
|
|
|
|
@class PCProjectWindow;
|
|
|
|
@class PCProjectBrowser;
|
|
|
|
@class PCProjectHistory;
|
|
|
|
|
|
|
|
@class PCProjectInspector;
|
|
|
|
@class PCProjectBuilder;
|
|
|
|
@class PCProjectLauncher;
|
|
|
|
@class PCProjectEditor;
|
|
|
|
|
|
|
|
#ifndef GNUSTEP_BASE_VERSION
|
|
|
|
@protocol ProjectBuilder;
|
|
|
|
#else
|
|
|
|
#include <ProjectCenter/ProjectBuilder.h>
|
|
|
|
#endif
|
|
|
|
|
2004-01-13 06:37:05 +00:00
|
|
|
extern NSString *PCProjectDictDidChangeNotification;
|
|
|
|
extern NSString *PCProjectDictDidSaveNotification;
|
2003-11-02 20:58:45 +00:00
|
|
|
|
|
|
|
@interface PCProject : NSObject
|
|
|
|
{
|
|
|
|
PCProjectManager *projectManager;
|
|
|
|
PCProjectWindow *projectWindow;
|
|
|
|
PCProjectBrowser *projectBrowser;
|
|
|
|
PCProjectHistory *projectHistory;
|
2003-11-10 18:31:19 +00:00
|
|
|
PCProjectEditor *projectEditor;
|
2003-11-02 20:58:45 +00:00
|
|
|
PCProjectBuilder *projectBuilder;
|
|
|
|
PCProjectLauncher *projectLauncher;
|
|
|
|
|
|
|
|
NSView *builderContentView;
|
|
|
|
NSView *debuggerContentView;
|
|
|
|
|
|
|
|
// For compatibility. Should be changed later
|
|
|
|
NSView *projectProjectInspectorView;
|
|
|
|
//
|
|
|
|
|
|
|
|
NSMutableDictionary *projectDict;
|
|
|
|
NSString *projectName;
|
|
|
|
NSString *projectPath;
|
|
|
|
|
2004-03-26 13:36:22 +00:00
|
|
|
NSArray *rootKeys; // CLASS_FILES
|
|
|
|
NSArray *rootCategories; // Classes
|
|
|
|
NSDictionary *rootEntries; // Initialised by subclasses
|
2003-11-02 20:58:45 +00:00
|
|
|
NSMutableDictionary *buildOptions;
|
|
|
|
|
|
|
|
BOOL editorIsActive;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// ==== Init and free
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
- (id)init;
|
|
|
|
- (id)initWithProjectDictionary:(NSDictionary *)dict path:(NSString *)path;
|
|
|
|
- (PCProjectManager *)projectManager;
|
|
|
|
- (void)setProjectManager:(PCProjectManager *)aManager;
|
2004-01-13 06:37:05 +00:00
|
|
|
- (BOOL)close:(id)sender;
|
2003-11-02 20:58:45 +00:00
|
|
|
- (void)dealloc;
|
2004-01-13 06:37:05 +00:00
|
|
|
- (BOOL)saveProjectWindowsAndPanels;
|
2003-11-02 20:58:45 +00:00
|
|
|
|
|
|
|
// ============================================================================
|
2004-01-13 06:37:05 +00:00
|
|
|
// ==== Accessory methods
|
2003-11-02 20:58:45 +00:00
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
- (PCProjectManager *)projectManager;
|
|
|
|
- (PCProjectWindow *)projectWindow;
|
|
|
|
- (PCProjectBrowser *)projectBrowser;
|
|
|
|
- (PCProjectHistory *)projectHistory;
|
|
|
|
- (PCProjectBuilder *)projectBuilder;
|
|
|
|
- (PCProjectLauncher *)projectLauncher;
|
|
|
|
- (PCProjectEditor *)projectEditor;
|
|
|
|
|
2004-01-23 14:55:22 +00:00
|
|
|
- (void)setProjectDictObject:(id)object forKey:(NSString *)key;
|
2003-11-02 20:58:45 +00:00
|
|
|
- (NSString *)projectName;
|
|
|
|
- (void)setProjectName:(NSString *)aName;
|
|
|
|
- (BOOL)isProjectChanged;
|
2004-03-26 13:36:22 +00:00
|
|
|
|
2003-11-02 20:58:45 +00:00
|
|
|
- (NSString *)selectedRootCategory;
|
2004-03-26 13:36:22 +00:00
|
|
|
- (NSString *)selectedRootCategoryKey;
|
2003-11-02 20:58:45 +00:00
|
|
|
|
|
|
|
- (Class)principalClass;
|
|
|
|
|
|
|
|
// ===========================================================================
|
|
|
|
// ==== To be overriden!
|
|
|
|
// ===========================================================================
|
|
|
|
|
2003-11-16 22:57:50 +00:00
|
|
|
// TEMP! For compatibility with old PC*Project subclasses
|
2003-11-02 20:58:45 +00:00
|
|
|
- (void)updateValuesFromProjectDict;
|
|
|
|
|
|
|
|
- (NSView *)projectAttributesView;
|
|
|
|
|
|
|
|
- (Class)builderClass;
|
|
|
|
|
|
|
|
// Subclasses need to call this before their customised implementation!
|
|
|
|
- (BOOL)writeMakefile;
|
|
|
|
|
2004-03-26 13:36:22 +00:00
|
|
|
- (NSArray *)fileTypesForCategoryKey:(NSString *)key;
|
|
|
|
- (NSString *)dirForCategoryKey:(NSString *)key;
|
2003-11-02 20:58:45 +00:00
|
|
|
|
|
|
|
- (NSArray *)sourceFileKeys;
|
|
|
|
- (NSArray *)resourceFileKeys;
|
|
|
|
- (NSArray *)otherKeys;
|
|
|
|
- (NSArray *)buildTargets;
|
|
|
|
|
|
|
|
// Returns a string describing the project type
|
|
|
|
- (NSString *)projectDescription;
|
|
|
|
|
|
|
|
// Returns NO by default.
|
|
|
|
- (BOOL)isExecutable;
|
2004-01-23 14:55:22 +00:00
|
|
|
- (NSString *)execToolName;
|
2003-11-02 20:58:45 +00:00
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// ==== File Handling
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
// Remove path from "file" and handle special cases like libraries
|
|
|
|
- (NSString *)projectFileFromFile:(NSString *)file forKey:(NSString *)type;
|
|
|
|
|
|
|
|
// Returns YES if type is a valid key and file is not contained in the
|
|
|
|
// project already
|
|
|
|
- (BOOL)doesAcceptFile:(NSString *)file forKey:(NSString *)key;
|
|
|
|
|
|
|
|
- (BOOL)addAndCopyFiles:(NSArray *)files forKey:(NSString *)key;
|
|
|
|
- (void)addFiles:(NSArray *)files forKey:(NSString *)key;
|
|
|
|
- (BOOL)removeFiles:(NSArray *)files forKey:(NSString *)key;
|
2004-03-25 15:24:11 +00:00
|
|
|
- (BOOL)renameFile:(NSString *)fromFile toFile:(NSString *)toFile;
|
2003-11-02 20:58:45 +00:00
|
|
|
|
2003-11-16 22:57:50 +00:00
|
|
|
// ============================================================================
|
|
|
|
// ==== Project handling
|
|
|
|
// ============================================================================
|
|
|
|
|
2003-11-02 20:58:45 +00:00
|
|
|
- (BOOL)assignProjectDict:(NSDictionary *)aDict;
|
|
|
|
- (NSDictionary *)projectDict;
|
|
|
|
|
|
|
|
- (void)setProjectPath:(NSString *)aPath;
|
|
|
|
- (NSString *)projectPath;
|
|
|
|
|
2004-01-13 06:37:05 +00:00
|
|
|
- (NSArray *)rootKeys;
|
2004-03-26 13:36:22 +00:00
|
|
|
- (NSArray *)rootCategories;
|
|
|
|
- (NSDictionary *)rootEntries;
|
2004-02-07 23:46:00 +00:00
|
|
|
- (NSString *)keyForCategory:(NSString *)category;
|
2004-03-26 13:36:22 +00:00
|
|
|
- (NSString *)categoryForKey:(NSString *)key;
|
2003-11-02 20:58:45 +00:00
|
|
|
|
|
|
|
- (BOOL)save;
|
|
|
|
- (BOOL)saveAt:(NSString *)projPath;
|
|
|
|
|
|
|
|
- (BOOL)writeSpecFile;
|
|
|
|
|
2003-11-16 22:57:50 +00:00
|
|
|
- (BOOL)isValidDictionary:(NSDictionary *)aDict;
|
|
|
|
- (void)updateProjectDict;
|
|
|
|
|
|
|
|
// Validates the project dictionary and inserts missing keys if needed. It
|
|
|
|
// calls isValidDictionary to validate.
|
|
|
|
- (void)validateProjectDict;
|
|
|
|
|
2003-11-02 20:58:45 +00:00
|
|
|
// ============================================================================
|
|
|
|
// ==== Subprojects
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
- (NSArray *)subprojects;
|
|
|
|
- (void)addSubproject:(PCProject *)aSubproject;
|
|
|
|
- (PCProject *)superProject;
|
|
|
|
- (PCProject *)rootProject;
|
|
|
|
- (void)newSubprojectNamed:(NSString *)aName;
|
|
|
|
- (void)removeSubproject:(PCProject *)aSubproject;
|
|
|
|
|
|
|
|
- (BOOL)isSubProject;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2004-03-26 13:36:22 +00:00
|
|
|
@interface PCProject (CategoryPaths)
|
|
|
|
|
|
|
|
- (NSArray *)contentAtCategoryPath:(NSString *)categoryPath;
|
|
|
|
- (BOOL)hasChildrenAtCategoryPath:(NSString *)keyPath;
|
2003-11-02 20:58:45 +00:00
|
|
|
|
2004-03-26 13:36:22 +00:00
|
|
|
- (NSString *)categoryForCategoryPath:(NSString *)categoryPath;
|
|
|
|
- (NSString *)keyForCategoryPath:(NSString *)kp;
|
2003-11-02 20:58:45 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
#endif
|
2004-01-13 06:37:05 +00:00
|
|
|
|