diff options
author | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-05-31 19:53:14 +0200 |
---|---|---|
committer | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-10-05 09:46:55 +0200 |
commit | ac56aa678cfe1666b60821f342ccb7b3d3fa7a0d (patch) | |
tree | 2887de1a5a21c8550e4bd52ea8867c18a5e2bac9 /src/html_common.hh | |
parent | ee32215fc1937e8a5e3c26b646ca8563e8de92e9 (diff) |
Define CssLength as struct instead of int
The int type doesn't have a fixed size, and is only guarantee to hold 16
bits. The current implementation assumes a size of at least 32 bits, an
uses three bits to encode the type of information stored in the rest.
To add more types of lengths we would need to take more bits from the
value itself.
A simpler approach is just to use a enumeration to take care of the type
of length and a union to encapsulate the different lengths values.
Diffstat (limited to 'src/html_common.hh')
-rw-r--r-- | src/html_common.hh | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/html_common.hh b/src/html_common.hh index cf99d8e6..de685d46 100644 --- a/src/html_common.hh +++ b/src/html_common.hh @@ -1,3 +1,16 @@ +/* + * File: html_common.hh + * + * Copyright (C) 2008-2016 Jorge Arellano Cid <jcid@dillo.org> + * Copyright (C) 2008-2014 Johannes Hofmann <Johannes.Hofmann@gmx.de> + * Copyright (C) 2024 Rodrigo Arias Mallo <rodarima@gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + */ + #ifndef __HTML_COMMON_HH__ #define __HTML_COMMON_HH__ @@ -268,7 +281,7 @@ void a_Html_pop_tag(DilloHtml *html, int TagIdx); void a_Html_stash_init(DilloHtml *html); int32_t a_Html_color_parse(DilloHtml *html, const char *str, int32_t default_color); -dw::core::style::Length a_Html_parse_length (DilloHtml *html, +CssLength a_Html_parse_length (DilloHtml *html, const char *attr); void a_Html_tag_set_align_attr(DilloHtml *html, const char *tag, int tagsize); bool a_Html_tag_set_valign_attr(DilloHtml *html, |