Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / Source / build / scripts / make_media_features.py
blob54d96901113dd71893195d9d4389b8f107851a99
1 #!/usr/bin/env python
3 # Copyright 2014 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
7 import media_feature_symbol
8 import in_generator
9 import template_expander
10 import name_utilities
11 import sys
14 class MakeMediaFeaturesWriter(in_generator.Writer):
15 defaults = {
16 'Conditional': None, # FIXME: Add support for Conditional.
17 'RuntimeEnabled': None,
18 'ImplementedAs': None,
20 filters = {
21 'symbol': media_feature_symbol.getMediaFeatureSymbolWithSuffix(''),
22 'to_macro_style': name_utilities.to_macro_style,
24 default_parameters = {
25 'namespace': '',
26 'export': '',
29 def __init__(self, in_file_path):
30 super(MakeMediaFeaturesWriter, self).__init__(in_file_path)
32 self._outputs = {
33 ('MediaFeatures.h'): self.generate_header,
35 self._template_context = {
36 'namespace': '',
37 'export': '',
38 'entries': self.in_file.name_dictionaries,
41 @template_expander.use_jinja('MediaFeatures.h.tmpl', filters=filters)
42 def generate_header(self):
43 return self._template_context
45 if __name__ == '__main__':
46 in_generator.Maker(MakeMediaFeaturesWriter).main(sys.argv)