| 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 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 import in_generator | 33 import in_generator |
| 34 import template_expander | 34 import template_expander |
| 35 | 35 |
| 36 | 36 |
| 37 class StyleBuilderWriter(in_generator.Writer): | 37 class StyleBuilderWriter(in_generator.Writer): |
| 38 class_name = 'StyleBuilder' | 38 class_name = 'StyleBuilder' |
| 39 | 39 |
| 40 valid_values = { | 40 valid_values = { |
| 41 'svg': [True, False], | 41 'svg': [True, False], |
| 42 'font': [True, False], |
| 42 'custom_all': [True, False], | 43 'custom_all': [True, False], |
| 43 'custom_initial': [True, False], | 44 'custom_initial': [True, False], |
| 44 'custom_inherit': [True, False], | 45 'custom_inherit': [True, False], |
| 45 'custom_value': [True, False], | 46 'custom_value': [True, False], |
| 46 } | 47 } |
| 47 defaults = { | 48 defaults = { |
| 48 'condition': None, | 49 'condition': None, |
| 49 'name_for_methods': None, | 50 'name_for_methods': None, |
| 50 'use_handlers_for': None, | 51 'use_handlers_for': None, |
| 51 'svg': False, | 52 'svg': False, |
| 53 'font': False, |
| 52 'converter': None, | 54 'converter': None, |
| 53 # These depend on property name by default | 55 # These depend on property name by default |
| 54 'type_name': None, | 56 'type_name': None, |
| 55 'getter': None, | 57 'getter': None, |
| 56 'setter': None, | 58 'setter': None, |
| 57 'initial': None, | 59 'initial': None, |
| 58 # Setting these stops default handlers being generated | 60 # Setting these stops default handlers being generated |
| 59 # Setting custom_all is the same as setting the other three | 61 # Setting custom_all is the same as setting the other three |
| 60 'custom_all': False, | 62 'custom_all': False, |
| 61 'custom_initial': False, | 63 'custom_initial': False, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 121 |
| 120 @template_expander.use_jinja("StyleBuilder.cpp.tmpl") | 122 @template_expander.use_jinja("StyleBuilder.cpp.tmpl") |
| 121 def generate_style_builder(self): | 123 def generate_style_builder(self): |
| 122 return { | 124 return { |
| 123 "properties": self._properties, | 125 "properties": self._properties, |
| 124 } | 126 } |
| 125 | 127 |
| 126 | 128 |
| 127 if __name__ == "__main__": | 129 if __name__ == "__main__": |
| 128 in_generator.Maker(StyleBuilderWriter).main(sys.argv) | 130 in_generator.Maker(StyleBuilderWriter).main(sys.argv) |
| OLD | NEW |