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

Unified Diff: sky/engine/bindings/scripts/templates/interface_dart.template

Issue 1135283005: Sky: Add a CustomDart attribute to the IDL compiler, and use that with Canvas (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: . 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/bindings/scripts/dart_compiler.py ('k') | sky/engine/core/painting/Canvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/bindings/scripts/templates/interface_dart.template
diff --git a/sky/engine/bindings/scripts/templates/interface_dart.template b/sky/engine/bindings/scripts/templates/interface_dart.template
index 7576a537c4b52082668a213a10438b9fcbff6df0..d0622c33d23cb7f0206be839de7314f73a3d3910 100644
--- a/sky/engine/bindings/scripts/templates/interface_dart.template
+++ b/sky/engine/bindings/scripts/templates/interface_dart.template
@@ -19,8 +19,10 @@ part of dart.sky;
{%- endfor -%}
{%- endmacro -%}
+{%- set prefix = "_" if custom_dartcode else "" -%}
{% if not constructors and not custom_constructors %}abstract {% endif -%}
-class {{interface_name}} extends {{ parent_interface if parent_interface else 'NativeFieldWrapperClass2' }} {
+class {{prefix}}{{interface_name}} extends
+ {{ parent_interface if parent_interface else 'NativeFieldWrapperClass2' }} {
// Constructors
{# TODO(eseidel): We only ever have one constructor. #}
{%- for constructor in constructors + custom_constructors %}
@@ -38,15 +40,15 @@ class {{interface_name}} extends {{ parent_interface if parent_interface else 'N
// Attributes
{% for attribute in attributes %}
- {{ attribute.dart_type }} get {{ attribute.name }} native "{{interface_name}}_{{ attribute.name }}_Getter";
+ {{ attribute.dart_type }} get {{prefix}}{{ attribute.name }} native "{{interface_name}}_{{ attribute.name }}_Getter";
{% if not attribute.is_read_only %}
- void set {{ attribute.name }}({{ attribute.dart_type }} value) native "{{interface_name}}_{{ attribute.name }}_Setter";
+ void set {{prefix}}{{ attribute.name }}({{ attribute.dart_type }} value) native "{{interface_name}}_{{ attribute.name }}_Setter";
{% endif %}
{% endfor %}
// Methods
{% for method in methods %}
- {{method.dart_type}} {{method.name}}({{ args_macro(method.arguments)}}) native "{{interface_name}}_{{ method.name }}_Callback";
+ {{method.dart_type}} {{prefix}}{{method.name}}({{ args_macro(method.arguments)}}) native "{{interface_name}}_{{ method.name }}_Callback";
{% endfor %}
// Operators
@@ -57,3 +59,5 @@ class {{interface_name}} extends {{ parent_interface if parent_interface else 'N
void operator[]=(String name, String value) native "{{interface_name}}___setter___Callback";
{% endif %}
}
+
+{{custom_dartcode}}
« no previous file with comments | « sky/engine/bindings/scripts/dart_compiler.py ('k') | sky/engine/core/painting/Canvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698