Generate geckolib setters for properties with simple predefined types.

This commit is contained in:
Cameron McCormack 2016-05-01 18:35:49 +10:00
parent a8e82440ff
commit d69763b0c1
3 changed files with 24 additions and 3 deletions

View file

@ -46,10 +46,11 @@ class Keyword(object):
class Longhand(object):
def __init__(self, style_struct, name, derived_from=None, keyword=None,
custom_cascade=False, experimental=False, internal=False,
predefined_type=None, custom_cascade=False, experimental=False, internal=False,
need_clone=False, gecko_ffi_name=None):
self.name = name
self.keyword = keyword
self.predefined_type = predefined_type
self.ident = to_rust_ident(name)
self.camel_case = to_camel_case(self.ident)
self.style_struct = style_struct

View file

@ -17,7 +17,7 @@
</%def>
<%def name="predefined_type(name, type, initial_value, parse_method='parse', **kwargs)">
<%call expr="longhand(name, **kwargs)">
<%call expr="longhand(name, predefined_type=type, **kwargs)">
#[allow(unused_imports)]
use app_units::Au;
pub type SpecifiedValue = specified::${type};