20 using std::shared_ptr;
21 using std::make_shared;
36 template <
class... Types>
40 using std::variant<Types...>::variant;
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); }
58 using byte =
unsigned char;
85 void set(
float _x,
float _y) {
x = _x;
y = _y; }
163 if(!val)
return true;
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"
349#define font_size_strings "xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger"
364#define line_height_strings "normal"
371#define font_style_strings "normal;italic"
379#define font_system_family_name_strings "caption;icon;menu;message-box;small-caption;status-bar"
381#define font_variant_strings "normal;small-caps"
389#define font_weight_strings "normal;bold;bolder;lighter"
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"
426#define list_style_position_strings "inside;outside"
434#define vertical_align_strings "baseline;sub;super;top;text-top;middle;bottom;text-bottom"
448#define border_width_strings "thin;medium;thick"
462#define border_style_strings "none;hidden;dotted;dashed;solid;double;groove;ridge;inset;outset"
478#define element_float_strings "none;left;right"
487#define element_clear_strings "none;left;right;both"
497#define css_units_strings "none;%;in;cm;mm;em;ex;pt;pc;px;vw;vh;vmin;vmax;rem;ch"
519#define background_attachment_strings "scroll;fixed"
527#define background_repeat_strings "repeat;repeat-x;repeat-y;no-repeat"
538#define background_box_strings "border-box;padding-box;content-box"
547#define background_position_strings "left;right;top;bottom;center"
559#define element_position_strings "static;relative;absolute;fixed"
569#define text_align_strings "left;right;center;justify"
579#define text_transform_strings "none;capitalize;uppercase;lowercase"
589#define white_space_strings "normal;nowrap;pre;pre-line;pre-wrap"
600#define overflow_strings "visible;hidden;scroll;auto;no-display;no-content"
612#define background_size_strings "auto;cover;contain"
621#define visibility_strings "visible;hidden;collapse"
630#define border_collapse_strings "collapse;separate"
638#define content_property_string "none;normal;open-quote;close-quote;no-open-quote;no-close-quote"
657 std::shared_ptr<render_item>
el;
679 el = std::move(val.el);
688 el = std::move(val.el);
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"
855#define box_sizing_strings "content-box;border-box"
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
913 const char*
const void_elements =
"area;base;br;col;command;embed;hr;img;input;keygen;link;meta;param;source;track;wbr";
915#define flex_direction_strings "row;row-reverse;column;column-reverse"
925#define flex_wrap_strings "nowrap;wrap;wrap-reverse"
934#define flex_justify_content_strings "normal;flex-start;flex-end;center;space-between;space-around;start;end;left;right;space-evenly;stretch"
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
976#define flex_align_content_strings "flex-start;start;flex-end;end;center;space-between;space-around;stretch"
990#define flex_basis_strings "auto;content;fit-content;min-content;max-content"
1001#define caption_side_strings "top;bottom"
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
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
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
typed_int(const typed_int &v)=default
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
int value
Definition types.h:256
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
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
uint_ptr font
Definition types.h:221
font_metrics metrics
Definition types.h:222
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
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
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
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
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
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
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