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