Photon 1.0.0
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1#ifndef LH_TYPES_H
2#define LH_TYPES_H
3
4#include <cstdint>
5#include <memory>
6#include <string>
7#include <vector>
8#include <map>
9#include <list>
10#include <set>
11#include <variant>
12#include <optional>
13#include <algorithm>
14
15namespace litehtml
16{
17 using uint_ptr = std::uintptr_t;
18 using std::string;
19 using std::vector;
20 using std::shared_ptr;
21 using std::make_shared;
22 using std::optional;
23 using std::min;
24 using std::max;
25 using std::swap;
26 using std::abs;
27
28 class document;
29 class element;
30
31 using string_map = std::map<string, string>;
32 using elements_list = std::list<std::shared_ptr<element>>;
33 using int_vector = std::vector<int>;
34 using string_vector = std::vector<string>;
35
36 template <class... Types>
37 struct variant : std::variant<Types...>
38 {
39 using base = variant<Types...>; // for derived class ctors
40 using std::variant<Types...>::variant; // inherit ctors
41 template<class T> bool is() const { return std::holds_alternative<T>(*this); }
42 template<class T> const T& get() const { return std::get<T>(*this); }
43 template<class T> T& get() { return std::get<T>(*this); }
44 };
45
52
53 const unsigned int font_decoration_none = 0x00;
54 const unsigned int font_decoration_underline = 0x01;
55 const unsigned int font_decoration_linethrough = 0x02;
56 const unsigned int font_decoration_overline = 0x04;
57
58 using byte = unsigned char;
59 using ucode_t = unsigned int;
60
61 struct margins
62 {
63 int left;
64 int right;
65 int top;
66 int bottom;
67
69 {
70 left = right = top = bottom = 0;
71 }
72
73 int width() const { return left + right; }
74 int height() const { return top + bottom; }
75 };
76
77 struct pointF
78 {
79 float x;
80 float y;
81
82 pointF() : x(0), y(0) {}
83 pointF(float _x, float _y) : x(_x), y(_y) {}
84
85 void set(float _x, float _y) { x = _x; y = _y; }
86 };
87
88 struct size
89 {
90 int width;
91 int height;
92
93 size(int w, int h) : width(w), height(h)
94 {
95 }
96
97 size() : width(0), height(0)
98 {
99 }
100 };
101
102 struct position
103 {
104 using vector = std::vector<position>;
105
106 int x;
107 int y;
108 int width;
110
112 {
113 x = y = width = height = 0;
114 }
115
116 position(int x, int y, int width, int height)
117 {
118 this->x = x;
119 this->y = y;
120 this->width = width;
121 this->height = height;
122 }
123
124 int right() const { return x + width; }
125 int bottom() const { return y + height; }
126 int left() const { return x; }
127 int top() const { return y; }
128
129 void operator+=(const margins& mg)
130 {
131 x -= mg.left;
132 y -= mg.top;
133 width += mg.left + mg.right;
134 height += mg.top + mg.bottom;
135 }
136 void operator-=(const margins& mg)
137 {
138 x += mg.left;
139 y += mg.top;
140 width -= mg.left + mg.right;
141 height -= mg.top + mg.bottom;
142 }
143
144 void clear()
145 {
146 x = y = width = height = 0;
147 }
148
149 void operator=(const size& sz)
150 {
151 width = sz.width;
152 height = sz.height;
153 }
154
155 void move_to(int _x, int _y)
156 {
157 x = _x;
158 y = _y;
159 }
160
161 bool does_intersect(const position* val) const
162 {
163 if(!val) return true;
164
165 return (
166 left() <= val->right() &&
167 right() >= val->left() &&
168 bottom() >= val->top() &&
169 top() <= val->bottom() )
170 || (
171 val->left() <= right() &&
172 val->right() >= left() &&
173 val->bottom() >= top() &&
174 val->top() <= bottom() );
175 }
176
177 bool empty() const
178 {
179 if(!width && !height)
180 {
181 return true;
182 }
183 return false;
184 }
185
186 bool is_point_inside(int _x, int _y) const
187 {
188 if(_x >= left() && _x < right() && _y >= top() && _y < bottom())
189 {
190 return true;
191 }
192 return false;
193 }
194 };
195
197 {
205
207 {
208 font_size = 0;
209 height = 0;
210 ascent = 0;
211 descent = 0;
212 x_height = 0;
213 ch_width = 0;
214 draw_spaces = true;
215 }
216 int base_line() const { return descent; }
217 };
218
224
225 using fonts_map = std::map<string, font_item>;
226
235
237 {
239 {
240 cbc_value_type_absolute, // width/height of containing block is defined as absolute value
241 cbc_value_type_percentage, // width/height of containing block is defined as percentage
242 cbc_value_type_auto, // width/height of containing block is defined as auto
243 cbc_value_type_none, // min/max width/height of containing block is defined as none
244 };
245
253
255 {
256 int value;
258
259 typed_int(const typed_int& v) = default;
260
262 {
263 value = val;
264 type = tp;
265 }
266
267 operator int() const
268 {
269 return value;
270 }
271
273 {
274 value = val;
275 return *this;
276 }
277
278 typed_int& operator=(const typed_int& v) = default;
279 };
280
281 typed_int width; // width of the containing block
285
286 typed_int height; // height of the containing block
289
291 uint32_t size_mode;
292
304
305 containing_block_context new_width(int w, uint32_t _size_mode = size_mode_normal) const
306 {
307 containing_block_context ret = *this;
308 ret.render_width = w - (ret.width - ret.render_width);
309 ret.width = w;
310 ret.size_mode = _size_mode;
311 return ret;
312 }
313
314 containing_block_context new_width_height(int w, int h, uint32_t _size_mode = size_mode_normal) const
315 {
316 containing_block_context ret = *this;
317 ret.render_width = w - (ret.width - ret.render_width);
318 ret.width = w;
319 ret.height = h;
320 ret.size_mode = _size_mode;
321 return ret;
322 }
323 };
324
325#define style_display_strings "none;block;inline;inline-block;inline-table;list-item;table;table-caption;table-cell;table-column;table-column-group;table-footer-group;table-header-group;table-row;table-row-group;inline-text;flex;inline-flex"
326
348
349#define font_size_strings "xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger"
350
363
364#define line_height_strings "normal"
365
370
371#define font_style_strings "normal;italic"
372
378
379#define font_system_family_name_strings "caption;icon;menu;message-box;small-caption;status-bar"
380
381#define font_variant_strings "normal;small-caps"
382
388
389#define font_weight_strings "normal;bold;bolder;lighter"
390
398
399#define list_style_type_strings "none;circle;disc;square;armenian;cjk-ideographic;decimal;decimal-leading-zero;georgian;hebrew;hiragana;hiragana-iroha;katakana;katakana-iroha;lower-alpha;lower-greek;lower-latin;lower-roman;upper-alpha;upper-latin;upper-roman"
400
425
426#define list_style_position_strings "inside;outside"
427
433
434#define vertical_align_strings "baseline;sub;super;top;text-top;middle;bottom;text-bottom"
435
447
448#define border_width_strings "thin;medium;thick"
449
456
457 const float border_width_thin_value = 1;
461
462#define border_style_strings "none;hidden;dotted;dashed;solid;double;groove;ridge;inset;outset"
463
477
478#define element_float_strings "none;left;right"
479
486
487#define element_clear_strings "none;left;right;both"
488
496
497#define css_units_strings "none;%;in;cm;mm;em;ex;pt;pc;px;vw;vh;vmin;vmax;rem;ch"
498
518
519#define background_attachment_strings "scroll;fixed"
520
526
527#define background_repeat_strings "repeat;repeat-x;repeat-y;no-repeat"
528
536
537// https://drafts.csswg.org/css-box-4/#typedef-visual-box
538#define background_box_strings "border-box;padding-box;content-box"
539
546
547#define background_position_strings "left;right;top;bottom;center"
548 const float background_position_percentages[] = {0, 100, 0, 100, 50};
549
558
559#define element_position_strings "static;relative;absolute;fixed"
560
568
569#define text_align_strings "left;right;center;justify"
570
578
579#define text_transform_strings "none;capitalize;uppercase;lowercase"
580
588
589#define white_space_strings "normal;nowrap;pre;pre-line;pre-wrap"
590
599
600#define overflow_strings "visible;hidden;scroll;auto;no-display;no-content"
601
611
612#define background_size_strings "auto;cover;contain"
613
620
621#define visibility_strings "visible;hidden;collapse"
622
629
630#define border_collapse_strings "collapse;separate"
631
637
638#define content_property_string "none;normal;open-quote;close-quote;no-open-quote;no-close-quote"
639
649
650 class render_item;
651
653 {
657 std::shared_ptr<render_item> el;
660
661 floated_box() = default;
663 {
664 pos = val.pos;
667 el = val.el;
668 context = val.context;
669 min_width = val.min_width;
670 }
671
672 floated_box& operator=(const floated_box& val) = default;
673
675 {
676 pos = val.pos;
677 float_side = val.float_side;
678 clear_floats = val.clear_floats;
679 el = std::move(val.el);
680 context = val.context;
681 min_width = val.min_width;
682 }
684 {
685 pos = val.pos;
686 float_side = val.float_side;
687 clear_floats = val.clear_floats;
688 el = std::move(val.el);
689 context = val.context;
690 min_width = val.min_width;
691 }
692 };
693
695 {
696 int hash;
697 int val;
700
702 {
703 hash = 0;
704 val = 0;
705 is_valid = false;
706 is_default = false;
707 }
709 {
710 is_valid = false;
711 is_default = false;
712 }
713 void set_value(int vHash, int vVal)
714 {
715 hash = vHash;
716 val = vVal;
717 is_valid = true;
718 }
719 };
720
729
730 template<class T>
732 {
735 public:
736 def_value(T def_val)
737 {
738 m_is_default = true;
739 m_val = def_val;
740 }
742 {
744 m_val = val.m_val;
745 }
746 void reset(T def_val)
747 {
748 m_is_default = true;
749 m_val = def_val;
750 }
751 bool is_default() const
752 {
753 return m_is_default;
754 }
755 T operator=(T new_val)
756 {
757 m_val = new_val;
758 m_is_default = false;
759 return m_val;
760 }
762 {
764 m_val = val.m_val;
765 return *this;
766 }
767 operator T() const
768 {
769 return m_val;
770 }
771 };
772
774 {
775 public:
782
783 public:
785 baseline(int _value, _baseline_type _type) : m_value(_value), m_type(_type) {}
786
787 int value() const { return m_value; }
788 void value(int _value) { m_value = _value; }
789 _baseline_type type() const { return m_type; }
790 void type(_baseline_type _type) { m_type = _type; }
791
792 operator int() const { return m_value; }
793 baseline& operator=(int _value) { m_value = _value; return *this; }
794
795 void set(int _value, _baseline_type _type) { m_value = _value; m_type =_type; }
801 int get_offset_from_top(int height) const
802 {
803 if(m_type == baseline_type_top) return m_value;
804 return height - m_value;
805 }
811 int get_offset_from_bottom(int height) const
812 {
813 if(m_type == baseline_type_bottom) return m_value;
814 return height - m_value;
815 }
821 void calc(int top, int bottom)
822 {
824 m_value = -top;
825 else if(m_type == baseline_type_bottom)
826 m_value = bottom;
827 }
828 private:
831 };
832
833#define appearance_strings "none;auto;menulist-button;textfield;button;checkbox;listbox;menulist;meter;progress-bar;push-button;radio;searchfield;slider-horizontal;square-button;textarea"
834
854
855#define box_sizing_strings "content-box;border-box"
856
862
863// https://drafts.csswg.org/mediaqueries/#media-types
864// User agents must recognize the following media types as valid, but must make them match nothing.
865#define deprecated_media_type_strings "tty;tv;projection;handheld;braille;embossed;aural;speech"
866#define media_type_strings "all;print;screen;" deprecated_media_type_strings
867
876
878 {
880 int width; // (pixels) For continuous media, this is the width of the viewport including the size of a rendered scroll bar (if any). For paged media, this is the width of the page box.
881 int height; // (pixels) The height of the targeted display area of the output device. For continuous media, this is the height of the viewport including the size of a rendered scroll bar (if any). For paged media, this is the height of the page box.
882 int device_width; // (pixels) The width of the rendering surface of the output device. For continuous media, this is the width of the screen. For paged media, this is the width of the page sheet size.
883 int device_height; // (pixels) The height of the rendering surface of the output device. For continuous media, this is the height of the screen. For paged media, this is the height of the page sheet size.
884 int color; // The number of bits per color component of the output device. If the device is not a color device, the value is zero.
885 int color_index; // The number of entries in the color lookup table of the output device. If the device does not use a color lookup table, the value is zero.
886 int monochrome; // The number of bits per pixel in a monochrome frame buffer. If the device is not a monochrome device, the output device value will be 0.
887 int resolution; // The resolution of the output device (in DPI)
888
890 {
892 width = 0;
893 height = 0;
894 device_width = 0;
895 device_height = 0;
896 color = 0;
897 color_index = 0;
898 monochrome = 0;
899 resolution = 0;
900 }
901 };
902
909
910 const char* const split_delims_spaces = " \t\r\n\f\v";
911
912 // List of the Void Elements (can't have any contents)
913 const char* const void_elements = "area;base;br;col;command;embed;hr;img;input;keygen;link;meta;param;source;track;wbr";
914
915#define flex_direction_strings "row;row-reverse;column;column-reverse"
916
924
925#define flex_wrap_strings "nowrap;wrap;wrap-reverse"
926
933
934#define flex_justify_content_strings "normal;flex-start;flex-end;center;space-between;space-around;start;end;left;right;space-evenly;stretch"
935
951
952#define self_position_strings "center;start;end;self-start;self-end;flex-start;flex-end"
953#define flex_align_items_strings "auto;normal;stretch;baseline;" self_position_strings
954
975
976#define flex_align_content_strings "flex-start;start;flex-end;end;center;space-between;space-around;stretch"
977
989
990#define flex_basis_strings "auto;content;fit-content;min-content;max-content"
991
1000
1001#define caption_side_strings "top;bottom"
1002
1008}
1009
1010#endif // LH_TYPES_H
Definition types.h:774
void calc(int top, int bottom)
Definition types.h:821
baseline(int _value, _baseline_type _type)
Definition types.h:785
_baseline_type type() const
Definition types.h:789
void type(_baseline_type _type)
Definition types.h:790
baseline & operator=(int _value)
Definition types.h:793
void set(int _value, _baseline_type _type)
Definition types.h:795
void value(int _value)
Definition types.h:788
int value() const
Definition types.h:787
baseline()
Definition types.h:784
_baseline_type m_type
Definition types.h:830
int m_value
Definition types.h:829
_baseline_type
Definition types.h:777
@ baseline_type_none
Definition types.h:778
@ baseline_type_top
Definition types.h:779
@ baseline_type_bottom
Definition types.h:780
int get_offset_from_top(int height) const
Definition types.h:801
int get_offset_from_bottom(int height) const
Definition types.h:811
Definition types.h:732
bool is_default() const
Definition types.h:751
void reset(T def_val)
Definition types.h:746
T m_val
Definition types.h:733
def_value< T > & operator=(const def_value< T > &val)
Definition types.h:761
T operator=(T new_val)
Definition types.h:755
def_value(const def_value< T > &val)
Definition types.h:741
bool m_is_default
Definition types.h:734
def_value(T def_val)
Definition types.h:736
Definition document.h:45
Definition element.h:19
Definition core.h:1598
type
Definition core.h:681
Definition background.h:12
font_weight
Definition types.h:392
@ font_weight_lighter
Definition types.h:396
@ font_weight_bold
Definition types.h:394
@ font_weight_normal
Definition types.h:393
@ font_weight_bolder
Definition types.h:395
line_height
Definition types.h:367
@ line_height_normal
Definition types.h:368
background_position
Definition types.h:551
@ background_position_right
Definition types.h:553
@ background_position_bottom
Definition types.h:555
@ background_position_top
Definition types.h:554
@ background_position_center
Definition types.h:556
@ background_position_left
Definition types.h:552
font_size
Definition types.h:352
@ font_size_xx_large
Definition types.h:359
@ font_size_smaller
Definition types.h:360
@ font_size_x_small
Definition types.h:354
@ font_size_large
Definition types.h:357
@ font_size_larger
Definition types.h:361
@ font_size_small
Definition types.h:355
@ font_size_x_large
Definition types.h:358
@ font_size_xx_small
Definition types.h:353
@ font_size_medium
Definition types.h:356
border_width
Definition types.h:451
@ border_width_thick
Definition types.h:454
@ border_width_medium
Definition types.h:453
@ border_width_thin
Definition types.h:452
element_position
Definition types.h:562
@ element_position_absolute
Definition types.h:565
@ element_position_static
Definition types.h:563
@ element_position_fixed
Definition types.h:566
@ element_position_relative
Definition types.h:564
background_repeat
Definition types.h:530
@ background_repeat_repeat_x
Definition types.h:532
@ background_repeat_no_repeat
Definition types.h:534
@ background_repeat_repeat_y
Definition types.h:533
@ background_repeat_repeat
Definition types.h:531
text_transform
Definition types.h:582
@ text_transform_capitalize
Definition types.h:584
@ text_transform_uppercase
Definition types.h:585
@ text_transform_lowercase
Definition types.h:586
@ text_transform_none
Definition types.h:583
border_collapse
Definition types.h:633
@ border_collapse_collapse
Definition types.h:634
@ border_collapse_separate
Definition types.h:635
box_sizing
Definition types.h:858
@ box_sizing_content_box
Definition types.h:859
@ box_sizing_border_box
Definition types.h:860
std::uintptr_t uint_ptr
Definition types.h:17
white_space
Definition types.h:592
@ white_space_normal
Definition types.h:593
@ white_space_pre_wrap
Definition types.h:597
@ white_space_pre_line
Definition types.h:596
@ white_space_pre
Definition types.h:595
@ white_space_nowrap
Definition types.h:594
flex_wrap
Definition types.h:928
@ flex_wrap_wrap
Definition types.h:930
@ flex_wrap_wrap_reverse
Definition types.h:931
@ flex_wrap_nowrap
Definition types.h:929
std::map< string, font_item > fonts_map
Definition types.h:225
const float background_position_percentages[]
Definition types.h:548
element_float
Definition types.h:481
@ float_none
Definition types.h:482
@ float_left
Definition types.h:483
@ float_right
Definition types.h:484
border_style
Definition types.h:465
@ border_style_groove
Definition types.h:472
@ border_style_double
Definition types.h:471
@ border_style_none
Definition types.h:466
@ border_style_dotted
Definition types.h:468
@ border_style_dashed
Definition types.h:469
@ border_style_solid
Definition types.h:470
@ border_style_hidden
Definition types.h:467
@ border_style_inset
Definition types.h:474
@ border_style_outset
Definition types.h:475
@ border_style_ridge
Definition types.h:473
caption_side
Definition types.h:1004
@ caption_side_top
Definition types.h:1005
@ caption_side_bottom
Definition types.h:1006
flex_align_items
Definition types.h:956
@ flex_align_items_last
Definition types.h:971
@ flex_align_items_self_start
Definition types.h:965
@ flex_align_items_unsafe
Definition types.h:972
@ flex_align_items_normal
Definition types.h:958
@ flex_align_items_first
Definition types.h:970
@ flex_align_items_flex_end
Definition types.h:968
@ flex_align_items_stretch
Definition types.h:959
@ flex_align_items_center
Definition types.h:962
@ flex_align_items_safe
Definition types.h:973
@ flex_align_items_auto
Definition types.h:957
@ flex_align_items_start
Definition types.h:963
@ flex_align_items_baseline
Definition types.h:960
@ flex_align_items_end
Definition types.h:964
@ flex_align_items_flex_start
Definition types.h:967
@ flex_align_items_self_end
Definition types.h:966
const unsigned int font_decoration_underline
Definition types.h:54
render_type
Definition types.h:904
@ render_no_fixed
Definition types.h:906
@ render_all
Definition types.h:905
@ render_fixed_only
Definition types.h:907
std::list< std::shared_ptr< element > > elements_list
Definition types.h:32
flex_align_content
Definition types.h:979
@ flex_align_content_space_between
Definition types.h:985
@ flex_align_content_flex_end
Definition types.h:982
@ flex_align_content_space_around
Definition types.h:986
@ flex_align_content_end
Definition types.h:983
@ flex_align_content_flex_start
Definition types.h:980
@ flex_align_content_center
Definition types.h:984
@ flex_align_content_start
Definition types.h:981
@ flex_align_content_stretch
Definition types.h:987
font_style
Definition types.h:374
@ font_style_normal
Definition types.h:375
@ font_style_italic
Definition types.h:376
const float border_width_thick_value
Definition types.h:459
unsigned char byte
Definition types.h:58
const float border_width_thin_value
Definition types.h:457
draw_flag
Definition types.h:228
@ draw_positioned
Definition types.h:233
@ draw_floats
Definition types.h:231
@ draw_block
Definition types.h:230
@ draw_root
Definition types.h:229
@ draw_inlines
Definition types.h:232
std::map< string, string > string_map
Definition types.h:31
list_style_type
Definition types.h:402
@ list_style_type_hebrew
Definition types.h:412
@ list_style_type_decimal_leading_zero
Definition types.h:410
@ list_style_type_hiragana_iroha
Definition types.h:414
@ list_style_type_georgian
Definition types.h:411
@ list_style_type_cjk_ideographic
Definition types.h:408
@ list_style_type_katakana
Definition types.h:415
@ list_style_type_circle
Definition types.h:404
@ list_style_type_lower_alpha
Definition types.h:417
@ list_style_type_armenian
Definition types.h:407
@ list_style_type_none
Definition types.h:403
@ list_style_type_lower_roman
Definition types.h:420
@ list_style_type_lower_greek
Definition types.h:418
@ list_style_type_upper_latin
Definition types.h:422
@ list_style_type_upper_alpha
Definition types.h:421
@ list_style_type_katakana_iroha
Definition types.h:416
@ list_style_type_upper_roman
Definition types.h:423
@ list_style_type_lower_latin
Definition types.h:419
@ list_style_type_square
Definition types.h:406
@ list_style_type_disc
Definition types.h:405
@ list_style_type_hiragana
Definition types.h:413
@ list_style_type_decimal
Definition types.h:409
document_mode
Definition types.h:47
@ limited_quirks_mode
Definition types.h:50
@ no_quirks_mode
Definition types.h:48
@ quirks_mode
Definition types.h:49
appearance
Definition types.h:836
@ appearance_progress_bar
Definition types.h:846
@ appearance_checkbox
Definition types.h:842
@ appearance_button
Definition types.h:841
@ appearance_slider_horizontal
Definition types.h:850
@ appearance_searchfield
Definition types.h:849
@ appearance_menulist_button
Definition types.h:839
@ appearance_square_button
Definition types.h:851
@ appearance_auto
Definition types.h:838
@ appearance_none
Definition types.h:837
@ appearance_menulist
Definition types.h:844
@ appearance_listbox
Definition types.h:843
@ appearance_textarea
Definition types.h:852
@ appearance_radio
Definition types.h:848
@ appearance_meter
Definition types.h:845
@ appearance_textfield
Definition types.h:840
@ appearance_push_button
Definition types.h:847
vertical_align
Definition types.h:437
@ va_text_bottom
Definition types.h:445
@ va_text_top
Definition types.h:442
@ va_middle
Definition types.h:443
@ va_top
Definition types.h:441
@ va_sub
Definition types.h:439
@ va_baseline
Definition types.h:438
@ va_bottom
Definition types.h:444
@ va_super
Definition types.h:440
list_style_position
Definition types.h:429
@ list_style_position_inside
Definition types.h:430
@ list_style_position_outside
Definition types.h:431
flex_justify_content
Definition types.h:937
@ flex_justify_content_left
Definition types.h:946
@ flex_justify_content_space_evenly
Definition types.h:948
@ flex_justify_content_stretch
Definition types.h:949
@ flex_justify_content_normal
Definition types.h:938
@ flex_justify_content_center
Definition types.h:941
@ flex_justify_content_start
Definition types.h:944
@ flex_justify_content_right
Definition types.h:947
@ flex_justify_content_end
Definition types.h:945
@ flex_justify_content_space_around
Definition types.h:943
@ flex_justify_content_space_between
Definition types.h:942
@ flex_justify_content_flex_start
Definition types.h:939
@ flex_justify_content_flex_end
Definition types.h:940
const char *const split_delims_spaces
Definition types.h:910
const float border_width_values[]
Definition types.h:460
flex_direction
Definition types.h:918
@ flex_direction_row
Definition types.h:919
@ flex_direction_column
Definition types.h:921
@ flex_direction_column_reverse
Definition types.h:922
@ flex_direction_row_reverse
Definition types.h:920
background_box
Definition types.h:541
@ background_box_padding
Definition types.h:543
@ background_box_border
Definition types.h:542
@ background_box_content
Definition types.h:544
const unsigned int font_decoration_linethrough
Definition types.h:55
background_attachment
Definition types.h:522
@ background_attachment_fixed
Definition types.h:524
@ background_attachment_scroll
Definition types.h:523
visibility
Definition types.h:624
@ visibility_hidden
Definition types.h:626
@ visibility_visible
Definition types.h:625
@ visibility_collapse
Definition types.h:627
std::vector< int > int_vector
Definition types.h:33
const unsigned int font_decoration_none
Definition types.h:53
element_clear
Definition types.h:490
@ clear_both
Definition types.h:494
@ clear_none
Definition types.h:491
@ clear_left
Definition types.h:492
@ clear_right
Definition types.h:493
std::vector< string > string_vector
Definition types.h:34
content_property
Definition types.h:641
@ content_property_open_quote
Definition types.h:644
@ content_property_close_quote
Definition types.h:645
@ content_property_no_open_quote
Definition types.h:646
@ content_property_none
Definition types.h:642
@ content_property_no_close_quote
Definition types.h:647
@ content_property_normal
Definition types.h:643
const unsigned int font_decoration_overline
Definition types.h:56
overflow
Definition types.h:603
@ overflow_visible
Definition types.h:604
@ overflow_no_content
Definition types.h:609
@ overflow_hidden
Definition types.h:605
@ overflow_no_display
Definition types.h:608
@ overflow_auto
Definition types.h:607
@ overflow_scroll
Definition types.h:606
const float border_width_medium_value
Definition types.h:458
style_display
Definition types.h:328
@ display_none
Definition types.h:329
@ display_block
Definition types.h:330
@ display_inline
Definition types.h:331
@ display_table_row_group
Definition types.h:343
@ display_flex
Definition types.h:345
@ display_inline_block
Definition types.h:332
@ display_table_column
Definition types.h:338
@ display_list_item
Definition types.h:334
@ display_inline_table
Definition types.h:333
@ display_table_cell
Definition types.h:337
@ display_table
Definition types.h:335
@ display_table_column_group
Definition types.h:339
@ display_inline_flex
Definition types.h:346
@ display_table_row
Definition types.h:342
@ display_table_caption
Definition types.h:336
@ display_table_header_group
Definition types.h:341
@ display_inline_text
Definition types.h:344
@ display_table_footer_group
Definition types.h:340
text_align
Definition types.h:572
@ text_align_center
Definition types.h:575
@ text_align_left
Definition types.h:573
@ text_align_right
Definition types.h:574
@ text_align_justify
Definition types.h:576
flex_basis
Definition types.h:993
@ flex_basis_auto
Definition types.h:994
@ flex_basis_min_content
Definition types.h:997
@ flex_basis_fit_content
Definition types.h:996
@ flex_basis_content
Definition types.h:995
@ flex_basis_max_content
Definition types.h:998
select_result
Definition types.h:722
@ select_match_with_after
Definition types.h:727
@ select_no_match
Definition types.h:723
@ select_match_pseudo_class
Definition types.h:725
@ select_match_with_before
Definition types.h:726
@ select_match
Definition types.h:724
media_type
Definition types.h:869
@ media_type_first_deprecated
Definition types.h:874
@ media_type_all
Definition types.h:871
@ media_type_print
Definition types.h:872
@ media_type_unknown
Definition types.h:870
@ media_type_screen
Definition types.h:873
unsigned int ucode_t
Definition types.h:59
font_variant
Definition types.h:384
@ font_variant_normal
Definition types.h:385
@ font_variant_small_caps
Definition types.h:386
const char *const void_elements
Definition types.h:913
background_size
Definition types.h:615
@ background_size_contain
Definition types.h:618
@ background_size_auto
Definition types.h:616
@ background_size_cover
Definition types.h:617
css_units
Definition types.h:500
@ css_units_in
Definition types.h:503
@ css_units_rem
Definition types.h:515
@ css_units_em
Definition types.h:506
@ css_units_pt
Definition types.h:508
@ css_units_pc
Definition types.h:509
@ css_units_px
Definition types.h:510
@ css_units_percentage
Definition types.h:502
@ css_units_mm
Definition types.h:505
@ css_units_ch
Definition types.h:516
@ css_units_vw
Definition types.h:511
@ css_units_vh
Definition types.h:512
@ css_units_vmax
Definition types.h:514
@ css_units_none
Definition types.h:501
@ css_units_vmin
Definition types.h:513
@ css_units_cm
Definition types.h:504
@ css_units_ex
Definition types.h:507
Definition Bitmap.h:10
cbc_value_type type
Definition types.h:257
typed_int & operator=(const typed_int &v)=default
typed_int(int val, cbc_value_type tp)
Definition types.h:261
typed_int & operator=(int val)
Definition types.h:272
typed_int render_width
Definition types.h:282
containing_block_context new_width_height(int w, int h, uint32_t _size_mode=size_mode_normal) const
Definition types.h:314
typed_int max_height
Definition types.h:288
typed_int width
Definition types.h:281
int context_idx
Definition types.h:290
typed_int max_width
Definition types.h:284
cbc_size_mode
Definition types.h:247
@ size_mode_content
Definition types.h:251
@ size_mode_exact_width
Definition types.h:249
@ size_mode_exact_height
Definition types.h:250
@ size_mode_normal
Definition types.h:248
typed_int height
Definition types.h:286
uint32_t size_mode
Definition types.h:291
typed_int min_height
Definition types.h:287
cbc_value_type
Definition types.h:239
@ cbc_value_type_percentage
Definition types.h:241
@ cbc_value_type_absolute
Definition types.h:240
@ cbc_value_type_none
Definition types.h:243
@ cbc_value_type_auto
Definition types.h:242
containing_block_context new_width(int w, uint32_t _size_mode=size_mode_normal) const
Definition types.h:305
typed_int min_width
Definition types.h:283
containing_block_context()
Definition types.h:293
Definition types.h:653
element_clear clear_floats
Definition types.h:656
void operator=(floated_box &&val)
Definition types.h:683
floated_box & operator=(const floated_box &val)=default
int context
Definition types.h:658
floated_box(floated_box &&val)
Definition types.h:674
floated_box(const floated_box &val)
Definition types.h:662
int min_width
Definition types.h:659
position pos
Definition types.h:654
std::shared_ptr< render_item > el
Definition types.h:657
element_float float_side
Definition types.h:655
Definition types.h:220
uint_ptr font
Definition types.h:221
font_metrics metrics
Definition types.h:222
Definition types.h:197
int font_size
Definition types.h:198
int ch_width
Definition types.h:203
int base_line() const
Definition types.h:216
bool draw_spaces
Definition types.h:204
int ascent
Definition types.h:200
font_metrics()
Definition types.h:206
int height
Definition types.h:199
int descent
Definition types.h:201
int x_height
Definition types.h:202
Definition types.h:695
int_int_cache()
Definition types.h:701
int hash
Definition types.h:696
void set_value(int vHash, int vVal)
Definition types.h:713
int val
Definition types.h:697
void invalidate()
Definition types.h:708
bool is_default
Definition types.h:699
bool is_valid
Definition types.h:698
Definition types.h:62
int bottom
Definition types.h:66
int height() const
Definition types.h:74
int left
Definition types.h:63
int right
Definition types.h:64
int top
Definition types.h:65
int width() const
Definition types.h:73
margins()
Definition types.h:68
Definition types.h:878
media_features()
Definition types.h:889
int color_index
Definition types.h:885
int resolution
Definition types.h:887
int color
Definition types.h:884
int device_width
Definition types.h:882
int device_height
Definition types.h:883
int monochrome
Definition types.h:886
media_type type
Definition types.h:879
int height
Definition types.h:881
int width
Definition types.h:880
Definition types.h:78
pointF(float _x, float _y)
Definition types.h:83
float x
Definition types.h:79
float y
Definition types.h:80
pointF()
Definition types.h:82
void set(float _x, float _y)
Definition types.h:85
Definition types.h:103
int x
Definition types.h:106
void operator-=(const margins &mg)
Definition types.h:136
int right() const
Definition types.h:124
int bottom() const
Definition types.h:125
void operator+=(const margins &mg)
Definition types.h:129
bool empty() const
Definition types.h:177
int top() const
Definition types.h:127
bool does_intersect(const position *val) const
Definition types.h:161
std::vector< position > vector
Definition types.h:104
void operator=(const size &sz)
Definition types.h:149
int left() const
Definition types.h:126
bool is_point_inside(int _x, int _y) const
Definition types.h:186
position(int x, int y, int width, int height)
Definition types.h:116
int y
Definition types.h:107
void move_to(int _x, int _y)
Definition types.h:155
int height
Definition types.h:109
void clear()
Definition types.h:144
position()
Definition types.h:111
int width
Definition types.h:108
Definition types.h:89
int height
Definition types.h:91
size(int w, int h)
Definition types.h:93
int width
Definition types.h:90
size()
Definition types.h:97
Definition types.h:38
bool is() const
Definition types.h:41
T & get()
Definition types.h:43
variant< Types... > base
Definition types.h:39
const T & get() const
Definition types.h:42