| OLD | NEW |
| 1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 path = entry['name'] | 124 path = entry['name'] |
| 125 return path + '.h' | 125 return path + '.h' |
| 126 | 126 |
| 127 def _headers_header_includes(self, entries): | 127 def _headers_header_includes(self, entries): |
| 128 includes = dict() | 128 includes = dict() |
| 129 for entry in entries: | 129 for entry in entries: |
| 130 cpp_name = name_utilities.cpp_name(entry) | 130 cpp_name = name_utilities.cpp_name(entry) |
| 131 # Avoid duplicate includes. | 131 # Avoid duplicate includes. |
| 132 if cpp_name in includes: | 132 if cpp_name in includes: |
| 133 continue | 133 continue |
| 134 if self.suffix == 'Modules': | 134 include = '#include "%(path)s"\n' % { |
| 135 subdir_name = 'modules' | |
| 136 else: | |
| 137 subdir_name = 'core' | |
| 138 include = '#include "%(path)s"\n#include "bindings/%(subdir_name)s/v
8/V8%(script_name)s.h"' % { | |
| 139 'path': self._headers_header_include_path(entry), | 135 'path': self._headers_header_include_path(entry), |
| 140 'script_name': name_utilities.script_name(entry), | |
| 141 'subdir_name': subdir_name, | |
| 142 } | 136 } |
| 143 includes[cpp_name] = self.wrap_with_condition(include, entry['Condit
ional']) | 137 includes[cpp_name] = self.wrap_with_condition(include, entry['Condit
ional']) |
| 144 return includes.values() | 138 return includes.values() |
| 145 | 139 |
| 146 def generate_headers_header(self): | 140 def generate_headers_header(self): |
| 147 base_header_for_suffix = '' | 141 base_header_for_suffix = '' |
| 148 if self.suffix: | 142 if self.suffix: |
| 149 base_header_for_suffix = '\n#include "core/%(namespace)sHeaders.h"\n
' % {'namespace': self.namespace} | 143 base_header_for_suffix = '\n#include "core/%(namespace)sHeaders.h"\n
' % {'namespace': self.namespace} |
| 150 return HEADER_TEMPLATE % { | 144 return HEADER_TEMPLATE % { |
| 151 'license': license.license_for_generated_cpp(), | 145 'license': license.license_for_generated_cpp(), |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 return INTERFACES_HEADER_TEMPLATE % { | 186 return INTERFACES_HEADER_TEMPLATE % { |
| 193 'license': license.license_for_generated_cpp(), | 187 'license': license.license_for_generated_cpp(), |
| 194 'namespace': self.namespace, | 188 'namespace': self.namespace, |
| 195 'suffix': self.suffix, | 189 'suffix': self.suffix, |
| 196 'base_header_for_suffix': base_header_for_suffix, | 190 'base_header_for_suffix': base_header_for_suffix, |
| 197 'macro_style_name': name_utilities.to_macro_style(self.namespace + s
elf.suffix), | 191 'macro_style_name': name_utilities.to_macro_style(self.namespace + s
elf.suffix), |
| 198 'declare_conditional_macros': self._declare_conditional_macros(), | 192 'declare_conditional_macros': self._declare_conditional_macros(), |
| 199 'unconditional_macros': '\n'.join(sorted(set(map(self._unconditional
_macro, self._unconditional_entries)))), | 193 'unconditional_macros': '\n'.join(sorted(set(map(self._unconditional
_macro, self._unconditional_entries)))), |
| 200 'conditional_macros': '\n'.join(map(self._conditional_macros, self._
entries_by_conditional.keys())), | 194 'conditional_macros': '\n'.join(map(self._conditional_macros, self._
entries_by_conditional.keys())), |
| 201 } | 195 } |
| OLD | NEW |