| Index: tools/json_schema_compiler/templates/ppapi/idl.template
|
| diff --git a/tools/json_schema_compiler/templates/ppapi/idl.template b/tools/json_schema_compiler/templates/ppapi/idl.template
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..863355c6a6bf2935b47339f95a0608b74e684888
|
| --- /dev/null
|
| +++ b/tools/json_schema_compiler/templates/ppapi/idl.template
|
| @@ -0,0 +1,98 @@
|
| +{# Copyright 2013 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. -#}
|
| +
|
| +{% extends "base.template" %}
|
| +
|
| +{% macro optional_array_struct(type) %}
|
| +{%- if type | needs_optional_array %}
|
| +struct {{ type | ppapi_type(array=True, optional=True) }} {
|
| + {{ type | ppapi_type(array=True) }} value;
|
| + PP_Bool is_set;
|
| +};
|
| +{% endif -%}
|
| +{% endmacro %}
|
| +
|
| +{% macro array_struct(type) %}
|
| +{%- if type | needs_array %}
|
| +struct {{ type | ppapi_type(array=True) }} {
|
| + uint32_t size;
|
| + [size_is(size)] {{ type | ppapi_type }}[] elements;
|
| + PP_ArrayOutput output;
|
| +};
|
| +{% endif -%}
|
| +{% endmacro %}
|
| +
|
| +{% macro optional_struct(type) %}
|
| +{%- if type | needs_optional %}
|
| +struct {{ type | ppapi_type(optional=True) }} {
|
| + {{ type | ppapi_type }} value;
|
| + PP_Bool is_set;
|
| +};
|
| +{% endif -%}
|
| +{% endmacro %}
|
| +
|
| +{% block content -%}
|
| +label Chrome {
|
| + M33 = 0.1
|
| +};
|
| +{% for type in enums %}
|
| +enum {{ type | ppapi_type }} {
|
| + {%- for value in type.enum_values %}
|
| + {{ value | enum_value(type) }}{% if not loop.last %},{% endif %}
|
| + {%- endfor %}
|
| +};
|
| +{{ optional_struct(type) -}}
|
| +{{ array_struct(type) -}}
|
| +{{ optional_array_struct(type) -}}
|
| +{%- endfor %}
|
| +{%- for type in types %}
|
| +struct {{ type | ppapi_type }} {
|
| + {%- for member in type.properties.values() %}
|
| + {{ member | format_param_type }} {{ member.unix_name}};
|
| + {%- endfor %}
|
| +};
|
| +{{ optional_struct(type) -}}
|
| +{{ array_struct(type) -}}
|
| +{{ optional_array_struct(type) -}}
|
| +{% endfor %}
|
| +{%- for event in events.values() %}
|
| +typedef uint32_t {{ event | ppapi_type }}(
|
| + [in] uint32_t listener_id,
|
| + [inout] mem_t user_data{% if event.params %},{% endif %}
|
| + {%- for param in event.params %}
|
| + [inout] {{ param | format_param_type }} {{ param.unix_name }}
|
| + {%- if not loop.last %},{% endif %}
|
| + {%- endfor -%}
|
| +);
|
| +{% endfor %}
|
| +interface PPB_{{ name | classname | dev_suffix }} {
|
| +{% for function in functions.values() %}
|
| + {{ function | return_type }} {{ function.name | classname }}(
|
| + [in] PP_Instance instance
|
| + {%- if function.params or function.callback or function.returns %},
|
| + {%- endif %}
|
| + {%- for param in function.params %}
|
| + [in] {{ param | format_param_type }} {{ param.unix_name }}
|
| + {%- if not loop.last or function.callback or function.returns %},
|
| + {%- endif %}
|
| + {%- endfor -%}
|
| + {%- if function.returns %}
|
| + [out] {{ function.returns | ppapi_type }} result,
|
| + {%- endif %}
|
| + {%- for param in function.callback.params %}
|
| + [out] {{ param | format_param_type }} {{ param.unix_name }},
|
| + {%- endfor %}
|
| + {%- if function.callback or function.returns %}
|
| + [in] PP_CompletionCallback callback
|
| + {%- endif -%}
|
| + );
|
| +{% endfor -%}
|
| +{% for event in events.values() %}
|
| + uint32_t Add{{ event.name | classname }}Listener (
|
| + [in] PP_Instance instance,
|
| + [in] {{ event | ppapi_type }} callback,
|
| + [inout] mem_t user_data);
|
| +{% endfor %}
|
| +};
|
| +{% endblock %}
|
|
|