Update blink generators for the big Blink rename.
This commit is contained in:
parent
0fba0b4811
commit
5473d719f7
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
#include "bindings/core/v8/ScriptWrappable.h"
|
#include "bindings/core/v8/ScriptWrappable.h"
|
||||||
#include "platform/heap/GarbageCollected.h"
|
#include "platform/heap/GarbageCollected.h"
|
||||||
#include "wtf/text/WTFString.h"
|
#include "platform/wtf/text/WTFString.h"
|
||||||
|
|
||||||
#include "../NXTState.h"
|
#include "../NXTState.h"
|
||||||
#include "Forward.h"
|
#include "Forward.h"
|
||||||
|
@ -41,10 +41,10 @@ class {{Class}} final :
|
||||||
public ScriptWrappable {
|
public ScriptWrappable {
|
||||||
|
|
||||||
WTF_MAKE_NONCOPYABLE({{Class}});
|
WTF_MAKE_NONCOPYABLE({{Class}});
|
||||||
USING_PRE_FINALIZER({{Class}}, dispose);
|
USING_PRE_FINALIZER({{Class}}, Dispose);
|
||||||
public:
|
public:
|
||||||
DEFINE_INLINE_TRACE() {
|
DEFINE_INLINE_TRACE() {
|
||||||
visitor->trace(m_state);
|
visitor->Trace(state_);
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -52,7 +52,7 @@ class {{Class}} final :
|
||||||
|
|
||||||
public:
|
public:
|
||||||
{{Class}}({{as_cType(type.name)}} self, Member<NXTState> state);
|
{{Class}}({{as_cType(type.name)}} self, Member<NXTState> state);
|
||||||
void dispose();
|
void Dispose();
|
||||||
|
|
||||||
{% for method in type.methods %}
|
{% for method in type.methods %}
|
||||||
{% if method.return_type.name.concatcase() == "void" %}
|
{% if method.return_type.name.concatcase() == "void" %}
|
||||||
|
@ -89,8 +89,8 @@ class {{Class}} final :
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
{{as_cType(type.name)}} m_self = nullptr;
|
{{as_cType(type.name)}} self_ = nullptr;
|
||||||
Member<NXTState> m_state;
|
Member<NXTState> state_;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,18 +27,18 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
#include "nxt/nxt.h"
|
#include "nxt/nxt.h"
|
||||||
#include "wtf/text/StringUTF8Adaptor.h"
|
#include "platform/wtf/text/StringUTF8Adaptor.h"
|
||||||
|
|
||||||
namespace blink {
|
namespace blink {
|
||||||
|
|
||||||
{% for type in by_category["object"] %}
|
{% for type in by_category["object"] %}
|
||||||
{% set Class = "NXT" + type.name.CamelCase() %}
|
{% set Class = "NXT" + type.name.CamelCase() %}
|
||||||
{{Class}}::{{Class}}({{as_cType(type.name)}} self, Member<NXTState> state)
|
{{Class}}::{{Class}}({{as_cType(type.name)}} self, Member<NXTState> state)
|
||||||
: m_self(self), m_state(state) {
|
: self_(self), state_(state) {
|
||||||
}
|
}
|
||||||
void {{Class}}::dispose() {
|
void {{Class}}::Dispose() {
|
||||||
{% if type.name.canonical_case() != "device" %}
|
{% if type.name.canonical_case() != "device" %}
|
||||||
m_state->getProcTable()->{{as_varName(type.name, Name("release"))}}(m_self);
|
state_->GetProcTable()->{{as_varName(type.name, Name("release"))}}(self_);
|
||||||
{% endif %}
|
{% endif %}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ namespace blink {
|
||||||
{% elif arg.annotation == "const*" %}
|
{% elif arg.annotation == "const*" %}
|
||||||
{% if arg.length == "strlen" %}
|
{% if arg.length == "strlen" %}
|
||||||
WTF::StringUTF8Adaptor {{argName}}Adaptor({{argName}}_);
|
WTF::StringUTF8Adaptor {{argName}}Adaptor({{argName}}_);
|
||||||
std::string {{argName}}String({{argName}}Adaptor.data(), {{argName}}Adaptor.length());
|
std::string {{argName}}String({{argName}}Adaptor.Data(), {{argName}}Adaptor.length());
|
||||||
const char* {{argName}} = {{argName}}String.c_str();
|
const char* {{argName}} = {{argName}}String.c_str();
|
||||||
{% elif arg.type.category == "object" %}
|
{% elif arg.type.category == "object" %}
|
||||||
//* TODO error on bad length
|
//* TODO error on bad length
|
||||||
|
@ -95,7 +95,7 @@ namespace blink {
|
||||||
{% if method.return_type.name.concatcase() != "void" %}
|
{% if method.return_type.name.concatcase() != "void" %}
|
||||||
auto result =
|
auto result =
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
m_state->getProcTable()->{{as_varName(type.name, method.name)}}(m_self
|
state_->GetProcTable()->{{as_varName(type.name, method.name)}}(self_
|
||||||
{%- for arg in method.arguments -%}
|
{%- for arg in method.arguments -%}
|
||||||
, {{as_varName(arg.name)}}
|
, {{as_varName(arg.name)}}
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
|
@ -105,13 +105,13 @@ namespace blink {
|
||||||
return this;
|
return this;
|
||||||
{% else %}
|
{% else %}
|
||||||
// TODO actually return the object given by the call to the procs
|
// TODO actually return the object given by the call to the procs
|
||||||
return new NXT{{method.return_type.name.CamelCase()}}(result, m_state);
|
return new NXT{{method.return_type.name.CamelCase()}}(result, state_);
|
||||||
{% endif %}
|
{% endif %}
|
||||||
}
|
}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{{as_cType(type.name)}} {{Class}}::GetNXT() {
|
{{as_cType(type.name)}} {{Class}}::GetNXT() {
|
||||||
return m_self;
|
return self_;
|
||||||
}
|
}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue