mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This patch starts down the process of cleaning up the dart:ui API. In this approach, we use Dart code to specify the interface instead of IDL. The code in this patch is far from complete. It's just a sketch to see how this sort of approach might work.
59 lines
1.9 KiB
Plaintext
59 lines
1.9 KiB
Plaintext
// Copyright 2015 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
{# The warning below applies to the code generated by this template, not this file. #}
|
|
// WARNING: Do not edit - generated code.
|
|
|
|
#ifndef GEN_SKY_BINDINGS_{{dart_class}}_H_
|
|
#define GEN_SKY_BINDINGS_{{dart_class}}_H_
|
|
|
|
{% for filename in header_includes %}
|
|
#include "{{filename}}"
|
|
{% endfor %}
|
|
|
|
namespace blink {
|
|
|
|
struct {{dart_class}} {
|
|
static bool hasInstance(Dart_Handle handle) {
|
|
// TODO(abarth): Need to look up the class_id from |handle| and compare with |dart_class_id|.
|
|
return false;
|
|
}
|
|
|
|
static Dart_NativeFunction Resolver(Dart_Handle name,
|
|
int argument_count,
|
|
bool* auto_scope);
|
|
static const uint8_t* Symbolizer(Dart_NativeFunction native_function);
|
|
};
|
|
|
|
namespace {{dart_class}}Internal {
|
|
{% from 'methods_cpp.template' import static_method_name %}
|
|
|
|
{% if has_custom_constructor %}
|
|
{# FIXME(vsm): Name this properly. #}
|
|
void constructorCallback(Dart_NativeArguments);
|
|
{% endif %}
|
|
|
|
{% if has_event_constructor %}
|
|
void initialize{{interface_name}}ForDart({{interface_name}}Init&, const String&, const HashMap<String, Dart_Handle>&, Dart_Handle&);
|
|
{% endif %}
|
|
{% for method in methods if method.is_custom or method.custom_dart_new %}
|
|
void {{static_method_name(method.name)}}(Dart_NativeArguments args);
|
|
{% if method.overload_index == 1 %}
|
|
void {{static_method_name(method.name, 0)}}(Dart_NativeArguments args);
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% for attribute in attributes %}
|
|
{% if attribute.has_custom_getter %}
|
|
void {{attribute.name}}Getter(Dart_NativeArguments);
|
|
{% endif %}
|
|
{% if attribute.has_custom_setter %}
|
|
void {{attribute.name}}Setter(Dart_NativeArguments);
|
|
{% endif %}
|
|
{% endfor %}
|
|
}
|
|
|
|
} // namespace blink
|
|
|
|
#endif // GEN_SKY_BINDINGS_{{dart_class}}_H_
|