class MakeMediaFeaturesWriter(json5_generator.Writer): default_metadata = { 'namespace': '', 'export': '', } filters = { 'symbol': media_feature_symbol.getMediaFeatureSymbolWithSuffix(''), 'to_macro_style': name_utilities.to_macro_style, 'upper_first_letter': name_utilities.upper_first_letter, } def __init__(self, json5_file_path): super(MakeMediaFeaturesWriter, self).__init__(json5_file_path) self._outputs = { ('media_features.h'): self.generate_header, } self._template_context = { 'entries': self.json5_file.name_dictionaries, 'input_files': self._input_files, } @template_expander.use_jinja('core/css/templates/media_features.h.tmpl', filters=filters) def generate_header(self): return self._template_context
class MakeMediaFeaturesWriter(in_generator.Writer): defaults = { 'Conditional': None, # FIXME: Add support for Conditional. 'RuntimeEnabled': None, 'ImplementedAs': None, } filters = { 'symbol': media_feature_symbol.getMediaFeatureSymbolWithSuffix(''), 'to_macro_style': name_utilities.to_macro_style, } default_parameters = { 'namespace': '', 'export': '', } def __init__(self, in_file_path): super(MakeMediaFeaturesWriter, self).__init__(in_file_path) self._outputs = { ('MediaFeatures.h'): self.generate_header, } self._template_context = { 'namespace': '', 'export': '', 'entries': self.in_file.name_dictionaries, } @template_expander.use_jinja('MediaFeatures.h.tmpl', filters=filters) def generate_header(self): return self._template_context
class MakeMediaFeaturesWriter(json5_generator.Writer): default_metadata = { 'namespace': '', 'export': '', } filters = { 'symbol': media_feature_symbol.getMediaFeatureSymbolWithSuffix(''), 'to_function_name': lambda symbol: NameStyleConverter(symbol).to_function_name(), } def __init__(self, json5_file_path, output_dir): super(MakeMediaFeaturesWriter, self).__init__(json5_file_path, output_dir) self._outputs = { ('media_features.h'): self.generate_header, } self._template_context = { 'entries': self.json5_file.name_dictionaries, 'input_files': self._input_files, 'header_guard': self.make_header_guard(self._relative_output_dir + 'media_festures.h') } @template_expander.use_jinja('core/css/templates/media_features.h.tmpl', filters=filters) def generate_header(self): return self._template_context
#!/usr/bin/env python # Copyright 2014 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. import sys import json5_generator import make_names import media_feature_symbol class MakeMediaFeatureNamesWriter(make_names.MakeNamesWriter): pass MakeMediaFeatureNamesWriter.filters[ 'symbol'] = media_feature_symbol.getMediaFeatureSymbolWithSuffix( 'MediaFeature') if __name__ == "__main__": json5_generator.Maker(MakeMediaFeatureNamesWriter).main()
def __init__(self, json5_file_path, output_dir): super(MakeMediaFeatureNamesWriter, self).__init__(json5_file_path, output_dir) MakeMediaFeatureNamesWriter.filters['symbol'] = ( media_feature_symbol.getMediaFeatureSymbolWithSuffix( 'MediaFeature'))
#!/usr/bin/env python # Copyright 2014 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. import sys import in_generator import make_names import media_feature_symbol class MakeMediaFeatureNamesWriter(make_names.MakeNamesWriter): pass MakeMediaFeatureNamesWriter.filters['symbol'] = media_feature_symbol.getMediaFeatureSymbolWithSuffix('MediaFeature') if __name__ == "__main__": in_generator.Maker(MakeMediaFeatureNamesWriter).main(sys.argv)
#!/usr/bin/env python # Copyright 2014 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. import sys import in_generator import make_names import media_feature_symbol class MakeMediaFeatureNamesWriter(make_names.MakeNamesWriter): pass MakeMediaFeatureNamesWriter.filters["symbol"] = media_feature_symbol.getMediaFeatureSymbolWithSuffix("MediaFeature") if __name__ == "__main__": in_generator.Maker(MakeMediaFeatureNamesWriter).main(sys.argv)
#!/usr/bin/env python # Copyright 2014 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. import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), '../..')) import json5_generator import make_names import media_feature_symbol class MakeMediaFeatureNamesWriter(make_names.MakeNamesWriter): pass MakeMediaFeatureNamesWriter.filters['symbol'] = media_feature_symbol.getMediaFeatureSymbolWithSuffix('MediaFeature') if __name__ == "__main__": json5_generator.Maker(MakeMediaFeatureNamesWriter).main()