Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: sky/engine/bindings/scripts/templates/interface_dart.template

Issue 1151673002: Sky: different tack for custom Rect type in the Canvas API. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: Float32List Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/bindings/scripts/templates/dart_blink.template ('k') | sky/engine/core/core.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // WARNING: Do not edit - generated code. 5 // WARNING: Do not edit - generated code.
6 part of dart.sky; 6 part of dart.sky;
7 7
8 {% macro args_macro(args) -%} 8 {% macro args_macro(args) -%}
9 {%- for arg in args -%} 9 {%- for arg in args -%}
10 {%- if arg.is_optional and (loop.first or not args[arg.index-1].is_optio nal) -%} 10 {%- if arg.is_optional and (loop.first or not args[arg.index-1].is_optio nal) -%}
11 {{ '{' if arg.is_named else '[' }} 11 {{ '{' if arg.is_named else '[' }}
12 {%- endif -%} 12 {%- endif -%}
13 {{ arg.dart_type }} {{ arg.name }} 13 {{ arg.dart_type }} {{ arg.name }}
14 {%- if arg.is_optional %} {{ ':' if arg.is_named else '='}} {{ arg.dart_ default_value }} 14 {%- if arg.is_optional %} {{ ':' if arg.is_named else '='}} {{ arg.dart_ default_value }}
15 {#- TODO(eseidel): This does not support having both optional and named arguments! -#} 15 {#- TODO(eseidel): This does not support having both optional and named arguments! -#}
16 {%- if loop.last -%}{{ '}' if arg.is_named else ']' }}{%- endif -%} 16 {%- if loop.last -%}{{ '}' if arg.is_named else ']' }}{%- endif -%}
17 {%- endif -%} 17 {%- endif -%}
18 {%- if not loop.last %}, {% endif %} 18 {%- if not loop.last %}, {% endif %}
19 {%- endfor -%} 19 {%- endfor -%}
20 {%- endmacro -%} 20 {%- endmacro -%}
21 21
22 {%- set prefix = "_" if custom_dartcode else "" -%}
23 {% if not constructors and not custom_constructors %}abstract {% endif -%} 22 {% if not constructors and not custom_constructors %}abstract {% endif -%}
24 class {{prefix}}{{interface_name}} extends 23 class {{interface_name}} extends
25 {{ parent_interface if parent_interface else 'NativeFieldWrapperClass2' }} { 24 {{ parent_interface if parent_interface else 'NativeFieldWrapperClass2' }} {
26 // Constructors 25 // Constructors
27 {# TODO(eseidel): We only ever have one constructor. #} 26 {# TODO(eseidel): We only ever have one constructor. #}
28 {%- for constructor in constructors + custom_constructors %} 27 {%- for constructor in constructors + custom_constructors %}
29 void _constructor( 28 void _constructor(
30 {%- for arg in constructor.arguments -%} 29 {%- for arg in constructor.arguments -%}
31 {{ arg.dart_type }} {{ arg.name }}{% if not loop.last %}, {% endif %} 30 {{ arg.dart_type }} {{ arg.name }}{% if not loop.last %}, {% endif %}
32 {%- endfor -%} 31 {%- endfor -%}
33 ) native "{{interface_name}}_constructorCallback"; 32 ) native "{{interface_name}}_constructorCallback";
34 {{interface_name}}({{ args_macro(constructor.arguments) }}) { _constructor( 33 {{interface_name}}({{ args_macro(constructor.arguments) }}) { _constructor(
35 {%- for arg in constructor.arguments -%} 34 {%- for arg in constructor.arguments -%}
36 {{ arg.name }}{% if not loop.last %}, {% endif %} 35 {{ arg.name }}{% if not loop.last %}, {% endif %}
37 {%- endfor -%} 36 {%- endfor -%}
38 ); } 37 ); }
39 {% endfor %} 38 {% endfor %}
40 39
41 // Attributes 40 // Attributes
42 {% for attribute in attributes %} 41 {% for attribute in attributes %}
43 {{ attribute.dart_type }} get {{prefix}}{{ attribute.name }} native "{{inter face_name}}_{{ attribute.name }}_Getter"; 42 {{ attribute.dart_type }} get {{ attribute.name }} native "{{interface_name} }_{{ attribute.name }}_Getter";
44 {% if not attribute.is_read_only %} 43 {% if not attribute.is_read_only %}
45 void set {{prefix}}{{ attribute.name }}({{ attribute.dart_type }} value) nat ive "{{interface_name}}_{{ attribute.name }}_Setter"; 44 void set {{ attribute.name }}({{ attribute.dart_type }} value) native "{{int erface_name}}_{{ attribute.name }}_Setter";
46 {% endif %} 45 {% endif %}
47 {% endfor %} 46 {% endfor %}
48 47
49 // Methods 48 // Methods
50 {% for method in methods %} 49 {% for method in methods %}
51 {{method.dart_type}} {{prefix}}{{method.name}}({{ args_macro(method.argument s)}}) native "{{interface_name}}_{{ method.name }}_Callback"; 50 {{method.dart_type}} {{method.name}}({{ args_macro(method.arguments)}}) nati ve "{{interface_name}}_{{ method.name }}_Callback";
52 {% endfor %} 51 {% endfor %}
53 52
54 // Operators 53 // Operators
55 {% if named_property_getter %} 54 {% if named_property_getter %}
56 String operator[](String name) native "{{interface_name}}___getter___Callbac k"; 55 String operator[](String name) native "{{interface_name}}___getter___Callbac k";
57 {% endif %} 56 {% endif %}
58 {% if named_property_setter %} 57 {% if named_property_setter %}
59 void operator[]=(String name, String value) native "{{interface_name}}___set ter___Callback"; 58 void operator[]=(String name, String value) native "{{interface_name}}___set ter___Callback";
60 {% endif %} 59 {% endif %}
61 } 60 }
62
63 {{custom_dartcode}}
OLDNEW
« no previous file with comments | « sky/engine/bindings/scripts/templates/dart_blink.template ('k') | sky/engine/core/core.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698