|
1 <!-- |
|
2 This file provides macro definitions that can create files and classes. |
|
3 They set up a hierarchy of location names which may be referenced by |
|
4 clients. |
|
5 |
|
6 This depends on the CommonMacros.inc file. |
|
7 |
|
8 2.1 Source file |
|
9 This is the location used for the main source file. It is not owned. |
|
10 2.1.1 System includes region |
|
11 Owned region for #include <...>, which are grouped together |
|
12 2.1.2 User includes region |
|
13 Owned region for #include "...", which must follow all system includes |
|
14 2.1.3 Constants region |
|
15 Owned region for literals, etc. |
|
16 2.2 Header file |
|
17 2.2.1 System includes region |
|
18 Owned region for #include <...> |
|
19 Typically used for child components which can be added or removed as design time, or the base class declarations used in the baseClassInfo property. |
|
20 Note: S60 style guide recommends against too many #includes " use forwards instead " but they are required if you need to declare a class requiring a base class from the header. |
|
21 2.2.2 Added includes region |
|
22 Non-owned region for #include <...> |
|
23 This provides decls needed for non-owned methods or non-deletable components and methods. |
|
24 Typically used for system headers providing declarations needed for event handlers but not by the normal class declaration. We cannot delete these #includes automatically since event handler stubs are not deleted automatically. |
|
25 2.2.3 User includes region |
|
26 Not needed, in S60 practice. Typically the main source file includes any needed user includes. This one may be needed if any components generate classes based on other classes defined by components. |
|
27 2.2.4 Forward declarations region |
|
28 Owned region for forward class and struct declarations used where a class is only referenced with a pointer or reference. The source file must include the actual header #include. |
|
29 2.2.5 Class |
|
30 Non-owned class declaration for the primary class generated by a component. These are grouped by access specifier first, to avoid a lot of repeated accessor usage (a violation of S60 coding conventions, and ugly in general). |
|
31 2.2.5.1 Public access region |
|
32 Non-owned location decorated with a "public:" accessor. This has a "unique-prototypes" filter. |
|
33 Usually contains non-owned NewL(), NewLC(), destructor declarations. |
|
34 2.2.5.1.1 Owned methods region |
|
35 Owned section for methods that other generated classes may wish to use, esp. static constructor methods, e.g. for transient components; or getters/setters for instance variables. |
|
36 This has a "unique-prototypes" filter. |
|
37 2.2.5.1.2 Owned types region |
|
38 Owned section for types that other generated classes may wish to use, esp. enums. |
|
39 2.2.5.2 Protected access region |
|
40 Non-owned location decorated with a "protected:" accessor. This has a "unique-prototypes" filter. |
|
41 This will contain base class method overrides. These are non-owned because the definitions are non-owned, which is because the user may have already overridden the method, and we don"t want to destroy/conflict with their changes. |
|
42 Note that unlike S60, we do not need a special region for overridden methods here, because the protected access region itself can be the target. |
|
43 2.2.5.3 Private access region |
|
44 Non-owned location decorated with a "private:" accessor. This has a "unique-prototypes" filter. |
|
45 Usually contains non-owned constructor. |
|
46 2.2.5.3.1 Instance variables region |
|
47 Owned |
|
48 2.2.5.3.2 Generated methods region |
|
49 Owned declarations for methods used by the implementation, e.g. listbox utilities. |
|
50 This has a "unique-prototypes" filter. |
|
51 2.2.5.3.3 Generated types region |
|
52 Owned declarations for types used by the implementation, e.g. inner classes. |
|
53 |
|
54 --> |
|
55 |
|
56 <!-- |
|
57 |
|
58 --> |
|
59 <defineMacro id="SourceFileTemplate" |
|
60 help="Defines the basic structure for a source file. |
|
61 |
|
62 This defines a file with system includes, user includes, and constants."> |
|
63 <macroArgument name="Dir" optional="true" default="${src}" |
|
64 help="Project-relative directory for file"/> |
|
65 |
|
66 <macroArgument name="FileName" optional="true" default="${instanceName$title}.cpp" |
|
67 help="Filename, inside $(Dir), to create"/> |
|
68 |
|
69 <macroArgument name="HeaderFileName" optional="true" default="${instanceName$title}.h" |
|
70 help="Filename of associated header to #include, or blank for no #include" /> |
|
71 |
|
72 <macroArgument name="LocationPrefix" optional="true" default="SOURCE" |
|
73 help="String which is prefixed to the location ids defined by this macro." /> |
|
74 |
|
75 <macroArgument name="InitialFileHeadContent" optional="true" default="" |
|
76 help="optional stock text for the source file (before system includes, user includes, |
|
77 constants). $p$ |
|
78 NOTE: one-time text, should not depend on modifiable properties $p$ |
|
79 NOTE: does not need to specify default source file template (comments), which is automatic."/> |
|
80 |
|
81 <macroArgument name="RealizeSystemIncludes" optional="true" default="true" |
|
82 help="flag that can be used to avoid generating the system includes section unless it is used. |
|
83 $p$ |
|
84 NOTE: due to issues with the source generator, this shouldn't be set 'false' unless |
|
85 you really expect there to be no system includes ever defined, otherwise, the section |
|
86 will appear out of order when generated." /> |
|
87 |
|
88 |
|
89 <macroArgument name="SystemIncludesRegionName" optional="true" default="Generated System Includes" |
|
90 help="name of the generated section for system includes"/> |
|
91 |
|
92 <macroArgument name="InitialSystemIncludesContent" optional="true" default="" |
|
93 help="optional stock text for the system includes" /> |
|
94 |
|
95 <macroArgument name="RealizeUserIncludes" optional="true" default="true" |
|
96 help="flag that can be used to avoid generating the user includes section unless it is used. |
|
97 $p$ |
|
98 NOTE: due to issues with the source generator, this shouldn't be set 'false' unless |
|
99 you really expect there to be no user includes ever defined, otherwise, the section |
|
100 will appear out of order when generated." /> |
|
101 |
|
102 <macroArgument name="UserIncludesRegionName" optional="true" default="Generated User Includes" |
|
103 help="name of the generated section for user includes"/> |
|
104 |
|
105 <macroArgument name="InitialUserIncludesContent" optional="true" default="" |
|
106 help="optional stock text for the user includes"/> |
|
107 |
|
108 <macroArgument name="RealizeConstants" optional="true" default="true" |
|
109 help="flag that can be used to avoid generating the constants section unless it is used. |
|
110 $p$ |
|
111 NOTE: due to issues with the source generator, this shouldn't be set 'false' unless |
|
112 you really expect there to be no constants ever defined, otherwise, the section |
|
113 will appear out of order when generated."/> |
|
114 |
|
115 <macroArgument name="ConstantsRegionName" optional="true" default="Generated Constants" |
|
116 help="name of the generated section for constants" /> |
|
117 |
|
118 <macroArgument name="InitialConstantsContent" optional="true" default="" |
|
119 help="optional stock text for the constants" /> |
|
120 |
|
121 <macroArgument name="InitialFileTailContent" optional="true" default="" |
|
122 help="optional stock text for the source file (after system includes, user includes, |
|
123 constants) which appears at the very end of the file. |
|
124 $p$ |
|
125 NOTE: one-time text, should not depend on modifiable properties |
|
126 $p$ |
|
127 NOTE: this really comes at the very end during initial file generation |
|
128 (unless you emit other templates with mode="at-end"), so if you simply |
|
129 want content after these sections but before other templates you add, |
|
130 just create templates for location="$(LocationPrefix)_FILE". " |
|
131 /> |
|
132 |
|
133 <!--====================================================================--> |
|
134 |
|
135 <defineLocation id="$(LocationPrefix)_FILE" |
|
136 domain="cpp" dir="$(Dir)" |
|
137 file="$(FileName)" |
|
138 owned="false" |
|
139 location=""> |
|
140 |
|
141 <template>$(InitialFileHeadContent)</template> |
|
142 |
|
143 </defineLocation> |
|
144 |
|
145 <defineLocation id="$(LocationPrefix)_OWNED_SYSTEM_INCLUDES" |
|
146 baseLocation="$(LocationPrefix)_FILE" |
|
147 location="region($(SystemIncludesRegionName))" |
|
148 filter="unique-includes" |
|
149 owned="true" |
|
150 realize="$(RealizeSystemIncludes)"> |
|
151 <template>$(InitialSystemIncludesContent)</template> |
|
152 </defineLocation> |
|
153 |
|
154 <defineLocation id="$(LocationPrefix)_OWNED_USER_INCLUDES" |
|
155 baseLocation="$(LocationPrefix)_FILE" |
|
156 location="region($(UserIncludesRegionName))" |
|
157 filter="unique-includes" |
|
158 owned="true" |
|
159 realize="$(RealizeUserIncludes)" > |
|
160 <template><![CDATA[$(InitialUserIncludesContent) |
|
161 <% if ($(HeaderFileName::as-string).length > 0) { %>#include "$(HeaderFileName)"<% } %> |
|
162 ]]> </template> |
|
163 </defineLocation> |
|
164 |
|
165 <defineLocation id="$(LocationPrefix)_OWNED_CONSTANTS" |
|
166 baseLocation="$(LocationPrefix)_FILE" |
|
167 location="region($(ConstantsRegionName))" |
|
168 owned="true" |
|
169 realize="$(RealizeConstants)"> |
|
170 <template>$(InitialConstantsContent)</template> |
|
171 </defineLocation> |
|
172 |
|
173 <template location="$(LocationPrefix)_FILE" mode="at-end"> |
|
174 $(InitialFileTailContent) |
|
175 </template> |
|
176 |
|
177 </defineMacro> |
|
178 |
|
179 |
|
180 |
|
181 |
|
182 <defineMacro id="HeaderFileTemplate" |
|
183 help=" |
|
184 Defines the basic structure for a header file. |
|
185 $p$ |
|
186 This defines a file with an include guard, system includes, user includes, |
|
187 event handler includes (non-owned but modifiable), constants, |
|
188 and forward declarations. |
|
189 "> |
|
190 <macroArgument name="Dir" optional="true" default="${inc}" |
|
191 help="Project-relative directory for file"/> |
|
192 |
|
193 <macroArgument name="FileName" optional="true" default="${instanceName$title}.h" |
|
194 help="Filename, inside $(Dir), to create" /> |
|
195 |
|
196 <macroArgument name="IncludeGuardMacro" optional="true" default="${instanceName$upper}_H" |
|
197 help="Include guard macro (#ifndef ...) to use" /> |
|
198 |
|
199 <macroArgument name="LocationPrefix" optional="true" default="HEADER" |
|
200 help="String which is prefixed to the location ids defined by this macro." /> |
|
201 |
|
202 <macroArgument name="InitialFileHeadContent" optional="true" default="" |
|
203 help="optional stock text for the top of the header file. |
|
204 |
|
205 NOTE: one-time text, should not depend on modifiable properties |
|
206 |
|
207 NOTE: does not need to specify header file template (comments) or #ifdef guards. "/> |
|
208 |
|
209 <macroArgument name="RealizeEventHandlerIncludes" optional="true" default="true" |
|
210 help="flag that can be used to avoid generating the section unless it is used. |
|
211 $p$ |
|
212 NOTE: due to issues with the source generator, this shouldn't be set 'false' unless |
|
213 you really expect there to be no event handler includes ever defined, otherwise, the section |
|
214 will appear out of order when generated." /> |
|
215 |
|
216 <macroArgument name="InitialEventHandlerIncludesContent" optional="true" default="" |
|
217 help="optional stock text for the event handler includes. |
|
218 $p$ |
|
219 NOTE: one-time text, should not depend on modifiable properties"/> |
|
220 |
|
221 |
|
222 <macroArgument name="RealizeOwnedSystemIncludes" optional="true" default="true" |
|
223 help="flag that can be used to avoid generating the system includes section unless it is used. |
|
224 $p$ |
|
225 NOTE: due to issues with the source generator, this shouldn't be set 'false' unless |
|
226 you really expect there to be no system includes ever defined, otherwise, the section |
|
227 will appear out of order when generated." /> |
|
228 |
|
229 |
|
230 <macroArgument name="OwnedSystemIncludesRegionName" optional="true" default="Generated System Includes" |
|
231 help="name of the generated section for system includes" /> |
|
232 |
|
233 <macroArgument name="RealizeOwnedUserIncludes" optional="true" default="true" |
|
234 help="flag that can be used to avoid generating the user includes section unless it is used. |
|
235 $p$ |
|
236 NOTE: due to issues with the source generator, this shouldn't be set 'false' unless |
|
237 you really expect there to be no user includes ever defined, otherwise, the section |
|
238 will appear out of order when generated." /> |
|
239 |
|
240 <macroArgument name="OwnedUserIncludesRegionName" optional="true" default="Generated User Includes" |
|
241 help="name of the generated section for user includes" /> |
|
242 |
|
243 <macroArgument name="InitialOwnedSystemIncludesContent" optional="true" default="" |
|
244 help="optional stock text for the added system includes" /> |
|
245 |
|
246 <macroArgument name="InitialOwnedUserIncludesContent" optional="true" default="" |
|
247 help="optional stock text for the user includes." /> |
|
248 |
|
249 <macroArgument name="RealizeOwnedConstants" optional="true" default="true" |
|
250 help="flag that can be used to avoid generating the constants section unless it is used. |
|
251 $p$ |
|
252 NOTE: due to issues with the source generator, this shouldn't be set 'false' unless |
|
253 you really expect there to be no constants ever defined, otherwise, the section |
|
254 will appear out of order when generated." /> |
|
255 |
|
256 <macroArgument name="InitialOwnedConstantsContent" optional="true" default="" |
|
257 help="optional stock text for the constants" /> |
|
258 |
|
259 <macroArgument name="RealizeOwnedForwardDeclarations" optional="true" default="true" |
|
260 help="flag that can be used to avoid generating the forward declarations section unless it is used. |
|
261 $p$ |
|
262 NOTE: due to issues with the source generator, this shouldn't be set 'false' unless |
|
263 you really expect there to be no forward decls ever defined, otherwise, the section |
|
264 will appear out of order when generated." /> |
|
265 |
|
266 <macroArgument name="InitialOwnedForwardDeclarationsContent" optional="true" default="" |
|
267 help="optional stock text for the forward declarations" /> |
|
268 |
|
269 <macroArgument name="RealizeOwnedTypedefs" optional="true" default="true" |
|
270 help="flag that can be used to avoid generating the typedefs section unless it is used. |
|
271 $p$ |
|
272 NOTE: due to issues with the source generator, this should't be set 'false' unless |
|
273 you really expect there to be no typedefs ever defined, otherwise, the section |
|
274 will appear out of order when generated."/> |
|
275 |
|
276 <macroArgument name="OwnedTypedefsRegionName" optional="true" default="Generated Typedefs" |
|
277 help="name of the generated section for owned typedefs"/> |
|
278 |
|
279 <macroArgument name="InitialOwnedTypedefsContent" optional="true" default="" |
|
280 help="optional stock text for the initial typedefs" /> |
|
281 |
|
282 <macroArgument name="InitialFileTailContent" optional="true" default="" |
|
283 help="optional stock text for the end of the header file. |
|
284 $p$ |
|
285 NOTE: one-time text, should not depend on modifiable properties |
|
286 $p$ |
|
287 NOTE: this really comes at the very end during initial file generation |
|
288 (unless you emit other templates with mode="at-end"), so if you simply |
|
289 want content after these sections but before other templates you add, |
|
290 just create templates for location="$(LocationPrefix)HEADER_FILE". |
|
291 "/> |
|
292 |
|
293 <!--====================================================================--> |
|
294 |
|
295 <defineLocation id="$(LocationPrefix)_FILE" |
|
296 domain="cpp" dir="$(Dir)" |
|
297 file="$(FileName)" |
|
298 owned="false" |
|
299 location=""> |
|
300 |
|
301 <template><![CDATA[ |
|
302 #ifndef $(IncludeGuardMacro) |
|
303 #define $(IncludeGuardMacro) |
|
304 $(InitialFileHeadContent) |
|
305 ]]> </template> |
|
306 |
|
307 </defineLocation> |
|
308 |
|
309 <defineLocation id="$(LocationPrefix)_OWNED_SYSTEM_INCLUDES" |
|
310 baseLocation="$(LocationPrefix)_FILE" |
|
311 location="region($(OwnedSystemIncludesRegionName))" |
|
312 filter="unique-includes" |
|
313 owned="true" |
|
314 realize="$(RealizeOwnedSystemIncludes)"> |
|
315 <template>$(InitialOwnedSystemIncludesContent)</template> |
|
316 </defineLocation> |
|
317 |
|
318 <defineLocation id="$(LocationPrefix)_EVENT_HANDLER_INCLUDES" |
|
319 baseLocation="$(LocationPrefix)_FILE" |
|
320 location="region(Event Handler Includes)" |
|
321 filter="unique-includes" |
|
322 owned="false" |
|
323 realize="$(RealizeEventHandlerIncludes)"> |
|
324 <template>$(InitialEventHandlerIncludesContent)</template> |
|
325 </defineLocation> |
|
326 |
|
327 <defineLocation id="$(LocationPrefix)_OWNED_USER_INCLUDES" |
|
328 baseLocation="$(LocationPrefix)_FILE" |
|
329 location="region($(OwnedUserIncludesRegionName))" |
|
330 filter="unique-includes" |
|
331 owned="true" |
|
332 realize="$(RealizeOwnedUserIncludes)" > |
|
333 <template>$(InitialOwnedUserIncludesContent)</template> |
|
334 </defineLocation> |
|
335 |
|
336 <defineLocation id="$(LocationPrefix)_OWNED_TYPEDEFS" |
|
337 baseLocation="$(LocationPrefix)_FILE" |
|
338 location="region($(OwnedTypedefsRegionName))" |
|
339 owned="true" |
|
340 realize="$(RealizeOwnedTypedefs)" > |
|
341 <template>$(InitialOwnedTypedefsContent)</template> |
|
342 </defineLocation> |
|
343 |
|
344 <defineLocation id="$(LocationPrefix)_OWNED_CONSTANTS" |
|
345 baseLocation="$(LocationPrefix)_FILE" |
|
346 location="region(Generated Constants)" |
|
347 owned="true" |
|
348 realize="$(RealizeOwnedConstants)"> |
|
349 <template>$(InitialOwnedConstantsContent)</template> |
|
350 </defineLocation> |
|
351 |
|
352 <defineLocation id="$(LocationPrefix)_OWNED_FORWARD_DECLARATIONS" |
|
353 baseLocation="$(LocationPrefix)_FILE" |
|
354 location="region(Generated Forward Declarations)" |
|
355 owned="true" |
|
356 realize="$(RealizeOwnedForwardDeclarations)"> |
|
357 <template>$(InitialOwnedForwardDeclarationsContent)</template> |
|
358 </defineLocation> |
|
359 |
|
360 <template location="$(LocationPrefix)_FILE" mode="at-end"><![CDATA[ |
|
361 $(InitialFileTailContent) |
|
362 #endif // $(IncludeGuardMacro) |
|
363 ]]> </template> |
|
364 |
|
365 </defineMacro> |
|
366 |
|
367 |
|
368 <defineMacro id="ClassTemplate" |
|
369 help="Defines the basic structure for a class with public, protected, and private regions, |
|
370 with owned sections therein for common purposes. |
|
371 " > |
|
372 <macroArgument name="LocationPrefix" optional="true" default="" |
|
373 help="String which is prefixed to the location ids defined by this macro. |
|
374 Useful when one component defines multiple files."/> |
|
375 |
|
376 <macroArgument name="BaseLocation" optional="true" default="HEADER_FILE" |
|
377 help="name of the base location in which to place the class, defaults to HEADER_FILE" /> |
|
378 |
|
379 <macroArgument name="ClassName" optional="true" default="${className}" |
|
380 help="name of the class to generate" /> |
|
381 |
|
382 <macroArgument name="BaseClassName" |
|
383 help="name of the base class, from which this class derives " /> |
|
384 |
|
385 <macroArgument name="BaseClassAccessor" optional="true" default="public" |
|
386 help="accessor for the base class, from which this class derives" /> |
|
387 |
|
388 <macroArgument name="ExtraBaseClasses" optional="true" |
|
389 help="extra interface classes, separated by commas" /> |
|
390 |
|
391 <macroArgument name="ExtraOwnedBases" optional="true" |
|
392 help="extra interface classes, separated by commas" /> |
|
393 |
|
394 <macroArgument name="ClassComment" optional="true" default="" |
|
395 help="optional text for the class comment" /> |
|
396 |
|
397 <macroArgument name="InitialClassHeadContent" optional="true" default="" |
|
398 help="optional text for the start of the class |
|
399 $p$ |
|
400 NOTE: one-time code, should not depend on modifiable properties" /> |
|
401 |
|
402 <!-- public: --> |
|
403 |
|
404 <macroArgument name="InitialPublicHeadContent" optional="true" default="" |
|
405 help="optional text for the start of the public section (follows "public:") |
|
406 $p$ |
|
407 NOTE: one-time code, should not depend on modifiable properties" /> |
|
408 |
|
409 <macroArgument name="RealizePublicOwnedTypes" optional="true" default="true" |
|
410 help="flag that can be used to avoid generating the public types section unless it is used. |
|
411 $p$ |
|
412 NOTE: if InitialPublicOwnedTypesContent is set, this flag is ignored." /> |
|
413 |
|
414 <macroArgument name="InitialPublicOwnedTypesContent" optional="true" default="" |
|
415 help="optional text for the public owned types section" /> |
|
416 |
|
417 <macroArgument name="RealizePublicOwnedMethods" optional="true" default="true" |
|
418 help="flag that can be used to avoid generating the public owned methods section unless it is used. |
|
419 $p$ |
|
420 NOTE: if InitialPublicOwnedMethodsContent is set, this flag is ignored." /> |
|
421 |
|
422 <macroArgument name="InitialPublicOwnedMethodsContent" optional="true" default="" |
|
423 help="optional text for the public owned methods section " /> |
|
424 |
|
425 <macroArgument name="InitialPublicTailContent" optional="true" default="" |
|
426 help="optional text for the end of the public section (follows "public:") |
|
427 $p$ |
|
428 NOTE: one-time code, should not depend on modifiable properties |
|
429 $p$ |
|
430 NOTE: content appears at the end of all initially generated public content. |
|
431 " /> |
|
432 |
|
433 <!-- protected: --> |
|
434 |
|
435 <macroArgument name="InitialProtectedHeadContent" optional="true" default="" |
|
436 help="optional text for the start of the protected section (follows "protected:") |
|
437 $p$ |
|
438 NOTE: one-time code, should not depend on modifiable properties" /> |
|
439 |
|
440 <macroArgument name="RealizeProtectedOverriddenMethods" optional="true" default="true" |
|
441 help="flag that can be used to avoid generating the protected overridden methods section unless it is used."/> |
|
442 |
|
443 <macroArgument name="InitialProtectedOverriddenMethodsContent" optional="true" default="" |
|
444 help="optional text for the the protected overridden methods section"/> |
|
445 |
|
446 <macroArgument name="RealizeProtectedUserHandlers" optional="true" default="true" |
|
447 help="flag that can be used to avoid generating the protected user handlers section |
|
448 unless it is used. This is used for the prototypes for the user-editable |
|
449 event handler methods."/> |
|
450 |
|
451 <macroArgument name="InitialProtectedUserHandlersContent" optional="true" default="" |
|
452 help="optional text for the protected user handlers section"/> |
|
453 |
|
454 |
|
455 <macroArgument name="InitialProtectedTailContent" optional="true" default="" |
|
456 help="optional text for the end of the protected section |
|
457 $p$ |
|
458 NOTE: one-time code, should not depend on modifiable properties |
|
459 $p$ |
|
460 NOTE: content appears at the end of all initially generated protected content."/> |
|
461 |
|
462 <!-- private: --> |
|
463 |
|
464 <macroArgument name="InitialPrivateHeadContent" optional="true" default="" |
|
465 help="optional text for the start of the private section (follows "private:") |
|
466 $p$ |
|
467 NOTE: one-time code, should not depend on modifiable properties"/> |
|
468 |
|
469 <macroArgument name="RealizePrivateOwnedTypes" optional="true" default="true" |
|
470 help="flag that can be used to avoid generating the private owned types section unless it is used. |
|
471 $p$ |
|
472 NOTE: if InitialPrivateOwnedTypesContent is set, this flag is ignored."/> |
|
473 |
|
474 <macroArgument name="InitialPrivateOwnedTypesContent" optional="true" default="" |
|
475 help="optional text for the the private types section"/> |
|
476 |
|
477 <macroArgument name="RealizePrivateOwnedInstanceVariables" optional="true" default="true" |
|
478 help="flag that can be used to avoid generating the private instance variables section unless it is used."/> |
|
479 |
|
480 <macroArgument name="InitialPrivateOwnedInstanceVariablesContent" optional="true" default="" |
|
481 help=" optional text for the the private instance variables section"/> |
|
482 |
|
483 <macroArgument name="RealizePrivateOwnedMethods" optional="true" default="true" |
|
484 help="flag that can be used to avoid generating the private owned methods section unless it is used."/> |
|
485 |
|
486 <macroArgument name="InitialPrivateOwnedMethodsContent" optional="true" default="" |
|
487 help="optional text for the private owned methods section"/> |
|
488 |
|
489 <macroArgument name="RealizePrivateMethods" optional="true" default="true" |
|
490 help="flag that can be used to avoid generating the private methods section unless it is used."/> |
|
491 |
|
492 <macroArgument name="InitialPrivateMethodsContent" optional="true" default="" |
|
493 help="optional text for the private methods section"/> |
|
494 |
|
495 <macroArgument name="InitialPrivateTailContent" optional="true" default="" |
|
496 help="optional text for the end of the private section |
|
497 $p$ |
|
498 NOTE: one-time code, should not depend on modifiable properties |
|
499 $p$ |
|
500 NOTE: content appears at the end of all initially generated private content."/> |
|
501 |
|
502 <!--=========================--> |
|
503 |
|
504 <macroArgument name="InitialClassTailContent" optional="true" default="" |
|
505 help="optional text for the end of the class |
|
506 $p$ |
|
507 NOTE: one-time code, should not depend on modifiable properties" |
|
508 /> |
|
509 |
|
510 <!--====================================================================--> |
|
511 |
|
512 <defineLocation id="$(LocationPrefix)CLASS" |
|
513 owned="false" |
|
514 location="class($(ClassName))" |
|
515 baseLocation="$(BaseLocation)"> |
|
516 |
|
517 <template> |
|
518 $(ClassComment) |
|
519 class $(ClassName) : $(BaseClassAccessor) $(BaseClassName) |
|
520 { |
|
521 }; |
|
522 </template> |
|
523 |
|
524 </defineLocation> |
|
525 |
|
526 <template location="$(LocationPrefix)CLASS"> |
|
527 $(InitialClassHeadContent) |
|
528 </template> |
|
529 |
|
530 <defineLocation id="$(LocationPrefix)CLASS_BASES" |
|
531 baseLocation="$(LocationPrefix)CLASS" |
|
532 owned="false" |
|
533 filter="unique-bases" |
|
534 location="bases()"> |
|
535 </defineLocation> |
|
536 |
|
537 <template location="$(LocationPrefix)CLASS_BASES"><![CDATA[<% |
|
538 if ($(ExtraBaseClasses::is-defined)) { |
|
539 %>, $(ExtraBaseClasses)<% } |
|
540 %> ]]></template> |
|
541 |
|
542 <defineLocation baseLocation="$(LocationPrefix)CLASS_BASES" |
|
543 owned="true" id="$(LocationPrefix)OWNED_BASES" |
|
544 filter="unique-bases" |
|
545 location="region(Generated Content)" |
|
546 realize="true"> |
|
547 <template> |
|
548 </template> |
|
549 </defineLocation> |
|
550 |
|
551 <template location="$(LocationPrefix)OWNED_BASES"> |
|
552 <![CDATA[<% |
|
553 if ($(ExtraOwnedBases::is-defined)) { |
|
554 %>, $(ExtraOwnedBases)<% } |
|
555 %> ]]> </template> |
|
556 |
|
557 <!-- the filter allows the location to accept new content --> |
|
558 <defineLocation id="$(LocationPrefix)CLASS_PUBLIC" |
|
559 baseLocation="$(LocationPrefix)CLASS" |
|
560 location="region(Public Section)" |
|
561 owned="false" |
|
562 filter="unique-prototypes" |
|
563 realize="true"> |
|
564 <template><![CDATA[ |
|
565 public:<% contrib.indentAdjust(-1); %>]]> |
|
566 </template> |
|
567 <template location="$(LocationPrefix)CLASS_PUBLIC"> |
|
568 $(InitialPublicHeadContent) |
|
569 </template> |
|
570 <template location="$(LocationPrefix)CLASS_PUBLIC" mode="at-end">$(InitialPublicTailContent) |
|
571 </template> |
|
572 </defineLocation> |
|
573 |
|
574 |
|
575 <defineLocation id="$(LocationPrefix)CLASS_PUBLIC_OWNED_TYPES" |
|
576 baseLocation="$(LocationPrefix)CLASS_PUBLIC" |
|
577 location="region(Generated Types)" |
|
578 owned="true" |
|
579 filter="unique-prototypes" |
|
580 realize="$(RealizePublicOwnedTypes)"> |
|
581 <template>$(InitialPublicOwnedTypesContent) |
|
582 </template> |
|
583 </defineLocation> |
|
584 |
|
585 <defineLocation id="$(LocationPrefix)CLASS_PUBLIC_OWNED_METHODS" |
|
586 baseLocation="$(LocationPrefix)CLASS_PUBLIC" |
|
587 location="region(Generated Methods)" |
|
588 owned="true" |
|
589 filter="unique-prototypes" |
|
590 realize="$(RealizePublicOwnedMethods)"> |
|
591 <template>$(InitialPublicOwnedMethodsContent) |
|
592 </template> |
|
593 </defineLocation> |
|
594 |
|
595 <!-- the filter allows the location to accept new content --> |
|
596 <defineLocation id="$(LocationPrefix)CLASS_PROTECTED" |
|
597 baseLocation="$(LocationPrefix)CLASS" |
|
598 location="region(Protected Section)" |
|
599 owned="false" |
|
600 filter="unique-prototypes" |
|
601 realize="true"> |
|
602 <template><![CDATA[ |
|
603 protected:<% contrib.indentAdjust(-1); %>]]> |
|
604 </template> |
|
605 <template location="$(LocationPrefix)CLASS_PROTECTED"> |
|
606 $(InitialProtectedHeadContent) |
|
607 </template> |
|
608 <template location="$(LocationPrefix)CLASS_PROTECTED" mode="at-end">$(InitialProtectedTailContent) |
|
609 </template> |
|
610 </defineLocation> |
|
611 |
|
612 |
|
613 <defineLocation id="$(LocationPrefix)CLASS_PROTECTED_OVERRIDDEN_METHODS" |
|
614 baseLocation="$(LocationPrefix)CLASS_PROTECTED" |
|
615 location="region(Overridden Methods)" |
|
616 owned="true" |
|
617 filter="unique-prototypes" |
|
618 realize="$(RealizeProtectedOverriddenMethods)"> |
|
619 <template>$(InitialProtectedOverriddenMethodsContent) |
|
620 </template> |
|
621 </defineLocation> |
|
622 |
|
623 <defineLocation id="$(LocationPrefix)CLASS_PROTECTED_USER_HANDLERS" |
|
624 baseLocation="$(LocationPrefix)CLASS_PROTECTED" |
|
625 location="region(User Handlers)" |
|
626 owned="false" |
|
627 filter="unique-prototypes" |
|
628 realize="$(RealizeProtectedUserHandlers)"> |
|
629 <template>$(InitialProtectedUserHandlersContent) |
|
630 </template> |
|
631 </defineLocation> |
|
632 |
|
633 <!-- the filter allows the location to accept new content --> |
|
634 <defineLocation id="$(LocationPrefix)CLASS_PRIVATE" |
|
635 baseLocation="$(LocationPrefix)CLASS" |
|
636 location="region(Private Section)" |
|
637 owned="false" |
|
638 filter="unique-prototypes" |
|
639 realize="true"> |
|
640 <template><![CDATA[ |
|
641 private:<% contrib.indentAdjust(-1);%> |
|
642 ]]> </template> |
|
643 <template location="$(LocationPrefix)CLASS_PRIVATE"> |
|
644 $(InitialPrivateHeadContent) |
|
645 </template> |
|
646 <template location="$(LocationPrefix)CLASS_PRIVATE" mode="at-end">$(InitialPrivateTailContent) |
|
647 </template> |
|
648 </defineLocation> |
|
649 |
|
650 |
|
651 <defineLocation id="$(LocationPrefix)CLASS_PRIVATE_OWNED_TYPES" |
|
652 baseLocation="$(LocationPrefix)CLASS_PRIVATE" |
|
653 location="region(Generated Types)" |
|
654 owned="true" |
|
655 filter="unique-prototypes" |
|
656 realize="$(RealizePrivateOwnedTypes)"> |
|
657 <template>$(InitialPrivateOwnedTypesContent) |
|
658 </template> |
|
659 </defineLocation> |
|
660 |
|
661 <defineLocation id="$(LocationPrefix)CLASS_PRIVATE_OWNED_INSTANCE_VARIABLES" |
|
662 baseLocation="$(LocationPrefix)CLASS_PRIVATE" |
|
663 location="region(Generated Instance Variables)" |
|
664 owned="true" |
|
665 filter="unique-prototypes" |
|
666 realize="$(RealizePrivateOwnedInstanceVariables)"> |
|
667 <template>$(InitialPrivateOwnedInstanceVariablesContent) |
|
668 </template> |
|
669 </defineLocation> |
|
670 |
|
671 <defineLocation id="$(LocationPrefix)CLASS_PRIVATE_OWNED_METHODS" |
|
672 baseLocation="$(LocationPrefix)CLASS_PRIVATE" |
|
673 location="region(Generated Owned Methods)" |
|
674 owned="true" |
|
675 filter="unique-prototypes" |
|
676 realize="$(RealizePrivateOwnedMethods)"> |
|
677 <template>$(InitialPrivateOwnedMethodsContent) |
|
678 </template> |
|
679 </defineLocation> |
|
680 |
|
681 <defineLocation id="$(LocationPrefix)CLASS_PRIVATE_METHODS" |
|
682 baseLocation="$(LocationPrefix)CLASS_PRIVATE" |
|
683 location="region(Generated Not Owned Methods)" |
|
684 owned="false" |
|
685 filter="unique-prototypes" |
|
686 realize="$(RealizePrivateMethods)"> |
|
687 <template>$(InitialPrivateMethodsContent) |
|
688 </template> |
|
689 </defineLocation> |
|
690 |
|
691 <template location="$(LocationPrefix)CLASS" mode="at-end">$(InitialClassTailContent) |
|
692 </template> |
|
693 |
|
694 </defineMacro> |
|
695 |
|
696 |
|
697 |
|
698 |
|
699 <defineMacro id="AddCppIncludes" |
|
700 help="Generate #includes for a space-separated list of headers. |
|
701 $p$ |
|
702 Note: you cannot use variable substitution, script escapes, etc. in the list. |
|
703 Instead, just write explicit contributions for the include, e.g. <template location="MAIN_OWNED_SYSTEM_INCLUDES"> ... "> |
|
704 |
|
705 <macroArgument name="Headers" |
|
706 help="a space-separated list of header files "/> |
|
707 |
|
708 <macroArgument name="Location" optional="true" |
|
709 help="location where includes should go (either this or Phase should be set)"/> |
|
710 |
|
711 <macroArgument name="Phase" optional="true" |
|
712 help="phase where includes should go (either this or Location should be set)"/> |
|
713 |
|
714 <macroArgument name="IsUser" optional="true" default="false" |
|
715 help=""User" or <system> includes?" /> |
|
716 |
|
717 <inline><![CDATA[ |
|
718 var headers = $(Headers::as-string).split(" "); |
|
719 var prefix, suffix; |
|
720 if ($(IsUser)) { |
|
721 prefix = "#include \""; |
|
722 suffix = "\"\n"; |
|
723 } else { |
|
724 prefix = "#include <"; |
|
725 suffix = ">\n"; |
|
726 } |
|
727 for (var h in headers) { |
|
728 var contrib = null; |
|
729 if ($(Location::is-defined)) { |
|
730 contrib = Engine.createContributionForLocation($(Location::as-string)); |
|
731 } else { |
|
732 contrib = Engine.createContributionForPhase($(Phase::as-string)); |
|
733 } |
|
734 contrib.setText(prefix + headers[h] + suffix); |
|
735 contribs.add(contrib); |
|
736 } |
|
737 ]]> |
|
738 </inline> |
|
739 </defineMacro> |
|
740 |
|
741 <defineMacro id="ResolvePhases" |
|
742 help="This macro fixes up phase -> location mappings on the current contributions, |
|
743 or optionally, another list. |
|
744 $p$ |
|
745 The mappings are Phase=Location pairs separated |
|
746 by spaces. |
|
747 $p$ |
|
748 This may be called multiple times."> |
|
749 |
|
750 <macroArgument name="Mappings" |
|
751 help="A space-separated list of Phase=Location mappings."/> |
|
752 |
|
753 <macroArgument name="ContribsList" optional="true" default="contribs" |
|
754 help="The array or list of IContribution upon which to apply the fixups."/> |
|
755 |
|
756 <inline><![CDATA[ |
|
757 var mappings = $(Mappings::as-string).split(" "); |
|
758 for (var entry in mappings) { |
|
759 var info = entry.split("="); |
|
760 Engine.assignLocationsForPhase($(ContribsList), info[0], info[1]); |
|
761 } |
|
762 ]]> </inline> |
|
763 |
|
764 </defineMacro> |
|
765 |