1 /*
2    GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
3 
4    Copyright (C) 2000-2010 Free Software Foundation
5 
6    Authors: Philippe C.D. Robert
7             Serg Stoyan
8 
9    This file is part of GNUstep.
10 
11    This application is free software; you can redistribute it and/or
12    modify it under the terms of the GNU General Public
13    License as published by the Free Software Foundation; either
14    version 2 of the License, or (at your option) any later version.
15 
16    This application is distributed in the hope that it will be useful,
17    but WITHOUT ANY WARRANTY; without even the implied warranty of
18    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19    Library General Public License for more details.
20 
21    You should have received a copy of the GNU General Public
22    License along with this library; if not, write to the Free
23    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
24 */
25 
26 #ifndef _PCDefines_h_
27 #define _PCDefines_h_
28 
29 #define PC_EXTERN       extern
30 #define PRIVATE_EXTERN  __private_extern__
31 
32 #define Compiler                        @"Compiler"
33 #define BundlePaths                     @"BundlePaths"
34 
35 #define PCAppDidInitNotification        @"PCAppDidInit"
36 #define PCAppWillTerminateNotification  @"PCAppWillTerminate"
37 
38 #define NIB_NOT_FOUND_EXCEPTION         @"NibNotFoundException"
39 #define UNKNOWN_PROJECT_TYPE_EXCEPTION  @"UnknownProjectTypeException"
40 #define NOT_A_PROJECT_TYPE_EXCEPTION    @"NoProjectTypeCreatorException"
41 #define PROJECT_CREATION_EXCEPTION      @"ProjectCreationException"
42 #define PROJECT_OPEN_FAILED_EXCEPTION   @"ProjectOpenFailedException"
43 #define PROJECT_SAVE_FAILED_EXCEPTION   @"ProjectSaveFailedException"
44 #define BUNDLE_MANAGER_EXCEPTION        @"BundleManagerException"
45 
46 //=============================================================================
47 // ==== MacOS X portability defines
48 //=============================================================================
49 #ifndef GNUSTEP
50 
51 #define RETAIN(object)          [object retain]
52 #define RELEASE(object)         [object release]
53 #define AUTORELEASE(object)     [object autorelease]
54 #define TEST_RELEASE(object)    ({ if (object) [object release]; })
55 #define ASSIGN(object,value)    ({\
56 id __value = (id)(value); \
57 id __object = (id)(object); \
58 if (__value != __object) \
59   { \
60     if (__value != nil) \
61       { \
62         [__value retain]; \
63       } \
64     object = __value; \
65     if (__object != nil) \
66       { \
67         [__object release]; \
68       } \
69   } \
70 })
71 #define DESTROY(object) ({ \
72   if (object) \
73     { \
74       id __o = object; \
75       object = nil; \
76       [__o release]; \
77     } \
78 })
79 
80 #define NSLocalizedString(key, comment) \
81   [[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]
82 
83 #define _(X) NSLocalizedString (X, @"")
84 
85 #endif // GNUSTEP_BASE_VERSION
86 
87 //
88 // ==== From PCProject.h
89 //
90 #ifndef IMAGE
91 #define IMAGE(X) [NSImage imageNamed:(X)]
92 #endif
93 
94 //=============================================================================
95 // ==== Not used yet
96 //=============================================================================
97 
98 #define TOUCHED_NOTHING		(0)
99 #define TOUCHED_EVERYTHING	(1 << 0)
100 #define TOUCHED_PROJECT_NAME	(1 << 1)
101 #define TOUCHED_LANGUAGE	(1 << 2)
102 #define TOUCHED_PROJECT_TYPE	(1 << 3)
103 #define TOUCHED_INSTALL_DIR	(1 << 4)
104 #define TOUCHED_ICON_NAMES	(1 << 5)
105 #define TOUCHED_FILES		(1 << 6)
106 #define TOUCHED_MAINNIB		(1 << 7)
107 #define TOUCHED_PRINCIPALCLASS	(1 << 8)
108 #define TOUCHED_TARGETS		(1 << 9)
109 #define TOUCHED_PB_PROJECT	(1 << 10)
110 #define TOUCHED_SYST_EXT	(1 << 11)
111 #define TOUCHED_EXTENSION	(1 << 12)
112 #define TOUCHED_PATHS		(1 << 13)
113 
114 typedef int PCProjInfoBits;
115 
116 //=============================================================================
117 // ==== Project keys
118 //=============================================================================
119 
120 #import <Foundation/Foundation.h>
121 
122 static NSString * const PCLastEditing          = @"LAST_EDITING";
123 static NSString * const PCWindows              = @"PC_WINDOWS";
124 
125 static NSString * const PCClasses              = @"CLASS_FILES";
126 static NSString * const PCHeaders              = @"HEADER_FILES";
127 static NSString * const PCOtherSources         = @"OTHER_SOURCES";
128 static NSString * const PCInterfaces           = @"INTERFACES";
129 static NSString * const PCImages               = @"IMAGES";
130 static NSString * const PCOtherResources       = @"OTHER_RESOURCES";
131 static NSString * const PCSubprojects          = @"SUBPROJECTS";
132 static NSString * const PCDocuFiles            = @"DOCU_FILES";
133 static NSString * const PCSupportingFiles      = @"SUPPORTING_FILES";
134 static NSString * const PCLibraries            = @"LIBRARIES";
135 static NSString * const PCNonProject           = @"NON_PROJECT_FILES";
136 static NSString * const PCGSMarkupFiles	       = @"INTERFACES";
137 static NSString * const PCLanguage	       = @"LANGUAGE";
138 static NSString * const PCUserLanguages	       = @"USER_LANGUAGES";
139 static NSString * const PCLocalizedResources   = @"LOCALIZED_RESOURCES";
140 
141 static NSString * const PCBuildTool            = @"BUILDTOOL";
142 static NSString * const PCCompilerOptions      = @"COMPILEROPTIONS";
143 static NSString * const PCPreprocessorOptions  = @"CPPOPTIONS";
144 static NSString * const PCCreationDate         = @"CREATION_DATE";
145 static NSString * const PCInstallDomain        = @"INSTALLDOMAIN";
146 static NSString * const PCLinkerOptions        = @"LINKEROPTIONS";
147 static NSString * const PCObjCCompilerOptions  = @"OBJC_COMPILEROPTIONS";
148 static NSString * const PCPrincipalClass       = @"PRINCIPAL_CLASS";
149 static NSString * const PCAuthors              = @"PROJECT_AUTHORS";
150 static NSString * const PCCopyright            = @"PROJECT_COPYRIGHT";
151 static NSString * const PCCopyrightDescription = @"PROJECT_COPYRIGHT_DESC";
152 static NSString * const PCProjectCreator       = @"PROJECT_CREATOR";
153 static NSString * const PCDescription          = @"PROJECT_DESCRIPTION";
154 static NSString * const PCDocumentExtensions   = @"PROJECT_DOCUMENTEXTENSIONS";
155 static NSString * const PCDocumentTypes        = @"PROJECT_DOCUMENTTYPES";
156 static NSString * const PCGroup                = @"PROJECT_GROUP";
157 static NSString * const PCProjectMaintainer    = @"PROJECT_MAINTAINER";
158 static NSString * const PCProjectName          = @"PROJECT_NAME";
159 static NSString * const PCRelease              = @"PROJECT_RELEASE";
160 static NSString * const PCSummary              = @"PROJECT_SUMMARY";
161 static NSString * const PCProjectType          = @"PROJECT_TYPE";
162 static NSString * const PCURL                  = @"PROJECT_URL";
163 static NSString * const PCSearchHeaders        = @"SEARCH_HEADER_DIRS";
164 static NSString * const PCSearchLibs           = @"SEARCH_LIB_DIRS";
165 
166 // Project Builder options
167 static NSString * const PCBuilderTargets       = @"BUILDER_TARGETS";
168 static NSString * const PCBuilderArguments     = @"BUILDER_ARGS";
169 static NSString * const PCBuilderDebug         = @"BUILDER_DEBUG";
170 static NSString * const PCBuilderStrip         = @"BUILDER_STRIP";
171 static NSString * const PCBuilderVerbose       = @"BUILDER_VERBOSE";
172 static NSString * const PCBuilderSharedLibs    = @"BUILDER_SHARED_LIBS";
173 
174 // Application specific
175 static NSString * const PCAppIcon              = @"APPLICATIONICON";
176 static NSString * const PCMainInterfaceFile    = @"MAININTERFACE";
177 static NSString * const PCHelpFile             = @"HELP_FILE";
178 static NSString * const PCDocumentBasedApp     = @"APP_DOCUMENT_BASED";
179 static NSString * const PCAppType              = @"APP_TYPE";
180 
181 // Library specific
182 static NSString * const PCPublicHeaders        = @"PUBLIC_HEADERS";
183 static NSString * const PCHeadersInstallDir    = @"HEADERS_INSTALL_DIR";
184 
185 // Bundle specific
186 static NSString * const PCBundleExtension      = @"BUNDLE_EXTENSION";
187 
188 // Tool specific
189 static NSString * const PCToolIcon             = @"TOOLICON";
190 
191 static NSString * const PCPackageName          = @"PACKAGE_NAME";
192 static NSString * const PCLibraryVar           = @"LIBRARY_VAR";
193 
194 // Will be removed (compatibility)
195 static NSString * const PCProjectBuilderClass  = @"PROJECT_BUILDER";
196 
197 #endif // _PCDEFINES_H_
198 
199