| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (C) 2013 Google Inc. All rights reserved. | 2 # Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 'setter': None, | 56 'setter': None, |
| 57 'initial': None, | 57 'initial': None, |
| 58 # Setting these stops default handlers being generated | 58 # Setting these stops default handlers being generated |
| 59 # Setting custom_all is the same as setting the other three | 59 # Setting custom_all is the same as setting the other three |
| 60 'custom_all': False, | 60 'custom_all': False, |
| 61 'custom_initial': False, | 61 'custom_initial': False, |
| 62 'custom_inherit': False, | 62 'custom_inherit': False, |
| 63 'custom_value': False, | 63 'custom_value': False, |
| 64 } | 64 } |
| 65 | 65 |
| 66 def __init__(self, in_files, enabled_conditions): | 66 def __init__(self, in_files): |
| 67 super(StyleBuilderWriter, self).__init__(in_files, enabled_conditions) | 67 super(StyleBuilderWriter, self).__init__(in_files) |
| 68 self._outputs = {("StyleBuilderFunctions.h"): self.generate_style_builde
r_functions_h, | 68 self._outputs = {("StyleBuilderFunctions.h"): self.generate_style_builde
r_functions_h, |
| 69 ("StyleBuilderFunctions.cpp"): self.generate_style_buil
der_functions_cpp, | 69 ("StyleBuilderFunctions.cpp"): self.generate_style_buil
der_functions_cpp, |
| 70 ("StyleBuilder.cpp"): self.generate_style_builder, | 70 ("StyleBuilder.cpp"): self.generate_style_builder, |
| 71 } | 71 } |
| 72 | 72 |
| 73 self._properties = self.in_file.name_dictionaries | 73 self._properties = self.in_file.name_dictionaries |
| 74 | 74 |
| 75 def set_if_none(property, key, value): | 75 def set_if_none(property, key, value): |
| 76 if property[key] is None: | 76 if property[key] is None: |
| 77 property[key] = value | 77 property[key] = value |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 @template_expander.use_jinja("StyleBuilder.cpp.tmpl") | 120 @template_expander.use_jinja("StyleBuilder.cpp.tmpl") |
| 121 def generate_style_builder(self): | 121 def generate_style_builder(self): |
| 122 return { | 122 return { |
| 123 "properties": self._properties, | 123 "properties": self._properties, |
| 124 } | 124 } |
| 125 | 125 |
| 126 | 126 |
| 127 if __name__ == "__main__": | 127 if __name__ == "__main__": |
| 128 in_generator.Maker(StyleBuilderWriter).main(sys.argv) | 128 in_generator.Maker(StyleBuilderWriter).main(sys.argv) |
| OLD | NEW |