OLD | NEW |
---|---|
1 {%- for method in interface.methods %} | 1 {%- for method in interface.methods %} |
2 const int _{{interface|name}}_{{method|name}}Name = {{method.ordinal}}; | 2 const int _{{interface|name}}_{{method|name}}Name = {{method.ordinal}}; |
3 {%- endfor %} | 3 {%- endfor %} |
4 | 4 |
5 {#--- Interface Enums #} | 5 {#--- Interface Enums #} |
6 {%- from "enum_definition.tmpl" import enum_def -%} | 6 {%- from "enum_definition.tmpl" import enum_def -%} |
7 {%- for enum in interface.enums %} | 7 {%- for enum in interface.enums %} |
8 {{ enum_def(enum, typepkg, package) }} | 8 {{ enum_def(enum, typepkg, package) }} |
9 {%- endfor %} | 9 {%- endfor %} |
10 | 10 |
11 {% if should_gen_mojom_types -%} | |
12 {{ mojom_type_macros.writeMojomTypeDef(interface, typepkg, package) }} | |
13 {%- endif %} | |
14 | |
15 class _{{interface|name}}ServiceDescription implements {{descpkg}}ServiceDescrip tion { | 11 class _{{interface|name}}ServiceDescription implements {{descpkg}}ServiceDescrip tion { |
16 {%- if should_gen_mojom_types %} | 12 {%- if should_gen_mojom_types and interface.service_name %} |
alexfandrianto
2016/03/02 05:27:12
It may be worth noting explicitly in the CL descri
rudominer
2016/03/03 01:09:36
Good suggestion. Done.
| |
17 dynamic getTopLevelInterface([Function responseFactory]) => | 13 dynamic getTopLevelInterface([Function responseFactory]){ |
18 responseFactory(_{{interface|mojom_type_identifier|lower_camel}}()); | 14 var interfaceTypeKey = getRuntimeTypeInfo().servicesByName["{{interface.serv ice_name}}"].topLevelInterface; |
15 var userDefinedType = getAllMojomTypeDefinitions()[interfaceTypeKey]; | |
16 return responseFactory(userDefinedType.interfaceType); | |
17 } | |
19 | 18 |
20 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 19 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => |
21 responseFactory(getAllMojomTypeDefinitions()[typeKey]); | 20 responseFactory(getAllMojomTypeDefinitions()[typeKey]); |
22 | 21 |
23 dynamic getAllTypeDefinitions([Function responseFactory]) => | 22 dynamic getAllTypeDefinitions([Function responseFactory]) => |
24 responseFactory(getAllMojomTypeDefinitions()); | 23 responseFactory(getAllMojomTypeDefinitions()); |
25 {%- else %} | 24 {%- else %} |
26 dynamic getTopLevelInterface([Function responseFactory]) => | 25 dynamic getTopLevelInterface([Function responseFactory]) => |
27 responseFactory(null); | 26 responseFactory(null); |
28 | 27 |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
335 int get version => {{interface.version}}; | 334 int get version => {{interface.version}}; |
336 | 335 |
337 static {{descpkg}}ServiceDescription _cachedServiceDescription; | 336 static {{descpkg}}ServiceDescription _cachedServiceDescription; |
338 static {{descpkg}}ServiceDescription get serviceDescription { | 337 static {{descpkg}}ServiceDescription get serviceDescription { |
339 if (_cachedServiceDescription == null) { | 338 if (_cachedServiceDescription == null) { |
340 _cachedServiceDescription = new _{{interface|name}}ServiceDescription(); | 339 _cachedServiceDescription = new _{{interface|name}}ServiceDescription(); |
341 } | 340 } |
342 return _cachedServiceDescription; | 341 return _cachedServiceDescription; |
343 } | 342 } |
344 } | 343 } |
OLD | NEW |