diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2022-11-27 16:13:53 +0000 |
---|---|---|
committer | Michael Drake <mdrake.unique@gmail.com> | 2022-11-27 16:22:21 +0000 |
commit | 022a04d022f446b57818dfa7d5b49928f9d63bf4 (patch) | |
tree | ca33d047ef028d5c0327e5e31a7177d56db82171 /src/select/overrides.py | |
parent | 609e1623335d5d5147439c5ba600152e963fc951 (diff) | |
download | libcss-022a04d022f446b57818dfa7d5b49928f9d63bf4.tar.gz |
select: generator: Generate _bits variants
This avoids having overrides to provide trivially
generated variants.
Diffstat (limited to 'src/select/overrides.py')
-rw-r--r-- | src/select/overrides.py | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/select/overrides.py b/src/select/overrides.py index b4d349a..869d6ec 100644 --- a/src/select/overrides.py +++ b/src/select/overrides.py @@ -183,35 +183,3 @@ static inline css_error set_content( return CSS_OK; }''' - -get_side = '''\ -static inline uint8_t get_{0}( - const css_computed_style *style, - css_fixed *length, css_unit *unit) -{{ - uint32_t bits = style->i.bits[{1}_INDEX]; - bits &= {1}_MASK; - bits >>= {1}_SHIFT; - - /* 7bits: uuuuutt : units | type */ - if ((bits & 0x3) == CSS_{1}_SET) {{ - *length = style->i.{0}; - *unit = bits >> 2; - }} - - return (bits & 0x3); -}} -static inline uint8_t get_{0}_bits( - const css_computed_style *style) -{{ - uint32_t bits = style->i.bits[{1}_INDEX]; - bits &= {1}_MASK; - bits >>= {1}_SHIFT; - - /* 7bits: uuuuutt : units | type */ - return bits; -}}''' -overrides['get']['top'] = get_side.format('top', 'TOP') -overrides['get']['right'] = get_side.format('right', 'RIGHT') -overrides['get']['bottom'] = get_side.format('bottom', 'BOTTOM') -overrides['get']['left'] = get_side.format('left', 'LEFT') |