def generate_code_internal(self, definitions, definition_name): if not definition_name in definitions.dictionaries: raise ValueError('%s is not an IDL dictionary') interfaces_info = self.info_provider.interfaces_info dictionary = definitions.dictionaries[definition_name] interface_info = interfaces_info[definition_name] header_template = self.jinja_env.get_template('dictionary_impl.h') cpp_template = self.jinja_env.get_template('dictionary_impl.cpp') template_context = v8_dictionary.dictionary_impl_context( dictionary, interfaces_info) include_paths = interface_info.get('dependencies_include_paths') # Add union containers header file to header_includes rather than # cpp file so that union containers can be used in dictionary headers. union_container_headers = [ header for header in include_paths if header.find('UnionTypes') > 0 ] include_paths = [ header for header in include_paths if header not in union_container_headers ] template_context['header_includes'].update(union_container_headers) if not is_testing_target(interface_info.get('full_path')): template_context[ 'exported'] = self.info_provider.specifier_for_export template_context['header_includes'].add( self.info_provider.include_path_for_export) header_text, cpp_text = render_template(include_paths, header_template, cpp_template, template_context) header_path, cpp_path = self.output_paths(cpp_name(dictionary), interface_info) return ( (header_path, header_text), (cpp_path, cpp_text), )
def generate_code_internal(self, definitions, definition_name): if not definition_name in definitions.dictionaries: raise ValueError('%s is not an IDL dictionary') interfaces_info = self.info_provider.interfaces_info dictionary = definitions.dictionaries[definition_name] interface_info = interfaces_info[definition_name] header_template = self.jinja_env.get_template('dictionary_impl.h') cpp_template = self.jinja_env.get_template('dictionary_impl.cpp') template_context = v8_dictionary.dictionary_impl_context( dictionary, interfaces_info) include_paths = interface_info.get('dependencies_include_paths') if not is_testing_target(interface_info.get('full_path')): template_context[ 'exported'] = self.info_provider.specifier_for_export template_context['header_includes'].add( self.info_provider.include_path_for_export) template_context['header_includes'].update( interface_info.get('additional_header_includes', [])) header_text, cpp_text = render_template(include_paths, header_template, cpp_template, template_context) header_path, cpp_path = self.output_paths(cpp_name(dictionary), interface_info) return ( (header_path, header_text), (cpp_path, cpp_text), )
def generate_code_internal(self, definitions, definition_name): if not definition_name in definitions.dictionaries: raise ValueError('%s is not an IDL dictionary') interfaces_info = self.info_provider.interfaces_info dictionary = definitions.dictionaries[definition_name] interface_info = interfaces_info[definition_name] header_template = self.jinja_env.get_template('dictionary_impl.h') cpp_template = self.jinja_env.get_template('dictionary_impl.cpp') template_context = v8_dictionary.dictionary_impl_context( dictionary, interfaces_info) include_paths = interface_info.get('dependencies_include_paths') # Add union containers header file to header_includes rather than # cpp file so that union containers can be used in dictionary headers. union_container_headers = [header for header in include_paths if header.find('UnionTypes') > 0] include_paths = [header for header in include_paths if header not in union_container_headers] template_context['header_includes'].update(union_container_headers) if not is_testing_target(interface_info.get('full_path')): template_context['exported'] = self.info_provider.specifier_for_export template_context['header_includes'].add(self.info_provider.include_path_for_export) header_text, cpp_text = render_template( include_paths, header_template, cpp_template, template_context) header_path, cpp_path = self.output_paths( cpp_name(dictionary), interface_info) return ( (header_path, header_text), (cpp_path, cpp_text), )
def generate_dictionary_impl(self, dictionary_name, interface_info, dictionary): header_template = self.jinja_env.get_template('dictionary_impl.h') cpp_template = self.jinja_env.get_template('dictionary_impl.cpp') template_context = v8_dictionary.dictionary_impl_context( dictionary, self.interfaces_info) header_text, cpp_text = render_template( interface_info, header_template, cpp_template, template_context) header_path, cpp_path = self.output_paths_for_impl(dictionary_name) return ( (header_path, header_text), (cpp_path, cpp_text), )
def generate_dictionary_impl(self, dictionary_name, interface_info, dictionary): header_template = self.jinja_env.get_template('dictionary_impl.h') cpp_template = self.jinja_env.get_template('dictionary_impl.cpp') template_context = v8_dictionary.dictionary_impl_context( dictionary, self.interfaces_info) header_text, cpp_text = render_template(interface_info, header_template, cpp_template, template_context) header_path, cpp_path = self.output_paths_for_impl(dictionary_name) return ( (header_path, header_text), (cpp_path, cpp_text), )
def generate_code_internal(self, definitions, definition_name): if not definition_name in definitions.dictionaries: raise ValueError('%s is not an IDL dictionary') dictionary = definitions.dictionaries[definition_name] interface_info = self.interfaces_info[definition_name] header_template = self.jinja_env.get_template('dictionary_impl.h') cpp_template = self.jinja_env.get_template('dictionary_impl.cpp') template_context = v8_dictionary.dictionary_impl_context( dictionary, self.interfaces_info) header_text, cpp_text = render_template( interface_info, header_template, cpp_template, template_context) header_path, cpp_path = self.output_paths( definition_name, interface_info) return ( (header_path, header_text), (cpp_path, cpp_text), )
def generate_code_internal(self, definitions, definition_name): if not definition_name in definitions.dictionaries: raise ValueError("%s is not an IDL dictionary" % definition_name) interfaces_info = self.info_provider.interfaces_info dictionary = definitions.dictionaries[definition_name] interface_info = interfaces_info[definition_name] header_template = self.jinja_env.get_template("dictionary_impl.h.tmpl") cpp_template = self.jinja_env.get_template("dictionary_impl.cpp.tmpl") template_context = v8_dictionary.dictionary_impl_context(dictionary, interfaces_info) include_paths = interface_info.get("dependencies_include_paths") if not is_testing_target(interface_info.get("full_path")): template_context["exported"] = self.info_provider.specifier_for_export template_context["header_includes"].add(self.info_provider.include_path_for_export) template_context["header_includes"].update(interface_info.get("additional_header_includes", [])) header_text, cpp_text = self.render_template(include_paths, header_template, cpp_template, template_context) header_path, cpp_path = self.output_paths(cpp_name(dictionary), interface_info) return ((header_path, header_text), (cpp_path, cpp_text))
def generate_code_internal(self, definitions, definition_name): if not definition_name in definitions.dictionaries: raise ValueError('%s is not an IDL dictionary') interfaces_info = self.info_provider.interfaces_info dictionary = definitions.dictionaries[definition_name] interface_info = interfaces_info[definition_name] header_template = self.jinja_env.get_template('dictionary_impl.h') cpp_template = self.jinja_env.get_template('dictionary_impl.cpp') template_context = v8_dictionary.dictionary_impl_context( dictionary, interfaces_info) include_paths = interface_info.get('dependencies_include_paths') if not is_testing_target(interface_info.get('full_path')): template_context['exported'] = self.info_provider.specifier_for_export template_context['header_includes'].add(self.info_provider.include_path_for_export) template_context['header_includes'].update( interface_info.get('additional_header_includes', [])) header_text, cpp_text = render_template( include_paths, header_template, cpp_template, template_context) header_path, cpp_path = self.output_paths( cpp_name(dictionary), interface_info) return ( (header_path, header_text), (cpp_path, cpp_text), )