Photon 1.0.0
Loading...
Searching...
No Matches
litehtml::render_item_flex Class Reference

#include <render_flex.h>

Inheritance diagram for litehtml::render_item_flex:
litehtml::render_item_block litehtml::render_item

Public Member Functions

 render_item_flex (std::shared_ptr< element > src_el)
 
std::shared_ptr< render_itemclone () override
 
std::shared_ptr< render_iteminit () override
 
int get_first_baseline () override
 
int get_last_baseline () override
 
- Public Member Functions inherited from litehtml::render_item_block
 render_item_block (std::shared_ptr< element > src_el)
 
- Public Member Functions inherited from litehtml::render_item
 render_item (std::shared_ptr< element > src_el)
 
virtual ~render_item ()=default
 
std::list< std::shared_ptr< render_item > > & children ()
 
positionpos ()
 
bool skip () const
 
void skip (bool val)
 
int right () const
 
int left () const
 
int top () const
 
int bottom () const
 
int height () const
 
int width () const
 
int padding_top () const
 
int padding_bottom () const
 
int padding_left () const
 
int padding_right () const
 
int border_top () const
 
int border_bottom () const
 
int border_left () const
 
int border_right () const
 
int margin_top () const
 
int margin_bottom () const
 
int margin_left () const
 
int margin_right () const
 
std::shared_ptr< render_itemparent () const
 
marginsget_margins ()
 
marginsget_paddings ()
 
void set_paddings (const margins &val)
 
marginsget_borders ()
 
int content_offset_top () const
 
int content_offset_bottom () const
 
int content_offset_left () const
 
int content_offset_right () const
 
int content_offset_width () const
 
int content_offset_height () const
 
int render_offset_left () const
 
int render_offset_right () const
 
int render_offset_width () const
 
int render_offset_top () const
 
int render_offset_bottom () const
 
int render_offset_height () const
 
int box_sizing_left () const
 
int box_sizing_right () const
 
int box_sizing_width () const
 
int box_sizing_top () const
 
int box_sizing_bottom () const
 
int box_sizing_height () const
 
void parent (const std::shared_ptr< render_item > &par)
 
const std::shared_ptr< element > & src_el () const
 
const css_propertiescss () const
 
void add_child (const std::shared_ptr< render_item > &ri)
 
bool is_root () const
 
bool collapse_top_margin () const
 
bool collapse_bottom_margin () const
 
bool is_visible () const
 
bool is_flex_item () const
 
int render (int x, int y, const containing_block_context &containing_block_size, formatting_context *fmt_ctx, bool second_pass=false)
 
void apply_relative_shift (const containing_block_context &containing_block_size)
 
void calc_outlines (int parent_width)
 
int calc_auto_margins (int parent_width)
 
virtual void apply_vertical_align ()
 
std::tuple< std::shared_ptr< litehtml::render_item >, std::shared_ptr< litehtml::render_item >, std::shared_ptr< litehtml::render_item > > split_inlines ()
 
bool fetch_positioned ()
 
void render_positioned (render_type width=render_all)
 
std::tuple< int, int > element_static_offset (const std::shared_ptr< litehtml::render_item > &el)
 
void add_positioned (const std::shared_ptr< litehtml::render_item > &el)
 
void get_redraw_box (litehtml::position &pos, int x=0, int y=0)
 
void calc_document_size (litehtml::size &sz, litehtml::size &content_size, int x=0, int y=0)
 
virtual void get_inline_boxes (position::vector &) const
 
virtual void set_inline_boxes (position::vector &)
 
virtual void add_inline_box (const position &)
 
virtual void clear_inline_boxes ()
 
void draw_stacking_context (uint_ptr hdc, int x, int y, const position *clip, bool with_positioned)
 
virtual void draw_children (uint_ptr hdc, int x, int y, const position *clip, draw_flag flag, int zindex)
 
virtual int get_draw_vertical_offset ()
 
virtual std::shared_ptr< elementget_child_by_point (int x, int y, int client_x, int client_y, draw_flag flag, int zindex)
 
std::shared_ptr< elementget_element_by_point (int x, int y, int client_x, int client_y)
 
bool is_point_inside (int x, int y)
 
void dump (litehtml::dumper &cout)
 
position get_placement () const
 
void get_rendering_boxes (position::vector &redraw_boxes)
 

Private Member Functions

std::list< flex_lineget_lines (const containing_block_context &self_size, formatting_context *fmt_ctx, bool is_row_direction, int container_main_size, bool single_line)
 
int _render_content (int x, int y, bool second_pass, const containing_block_context &self_size, formatting_context *fmt_ctx) override
 

Private Attributes

std::list< flex_linem_lines
 

Additional Inherited Members

- Protected Member Functions inherited from litehtml::render_item_block
int _render (int x, int y, const containing_block_context &containing_block_size, formatting_context *fmt_ctx, bool second_pass) override
 
int place_float (const std::shared_ptr< render_item > &el, int top, const containing_block_context &self_size, formatting_context *fmt_ctx)
 
virtual void fix_line_width (element_float, const containing_block_context &, formatting_context *)
 
- Protected Member Functions inherited from litehtml::render_item
containing_block_context calculate_containing_block_context (const containing_block_context &cb_context)
 
void calc_cb_length (const css_length &len, int percent_base, containing_block_context::typed_int &out_value) const
 
- Protected Attributes inherited from litehtml::render_item
std::shared_ptr< elementm_element
 
std::weak_ptr< render_itemm_parent
 
std::list< std::shared_ptr< render_item > > m_children
 
margins m_margins
 
margins m_padding
 
margins m_borders
 
position m_pos
 
bool m_skip
 
std::vector< std::shared_ptr< render_item > > m_positioned
 

Constructor & Destructor Documentation

◆ render_item_flex()

litehtml::render_item_flex::render_item_flex ( std::shared_ptr< element src_el)
inlineexplicit

Member Function Documentation

◆ _render_content()

int litehtml::render_item_flex::_render_content ( int  ,
int  ,
bool  ,
const containing_block_context ,
formatting_context  
)
overrideprivatevirtual

Render block content.

Parameters
x- horizontal position of the content
y- vertical position of the content
second_pass- true is this is the second pass.
ret_width- input minimal width.
self_size- defines calculated size of block
Returns
return value is the minimal width of the content in block. Must be greater or equal to ret_width parameter

Split flex items to lines

Resolving Flexible Lengths REF: https://www.w3.org/TR/css-flexbox-1/#resolve-flexible-lengths

Calculate free cross size

Fix align-content property

Distribute free cross size for align-content: stretch

Reverse lines for flex-wrap: wrap-reverse

Align flex lines

Fix justify-content property

Align flex items in flex lines

Reimplemented from litehtml::render_item_block.

◆ clone()

std::shared_ptr< render_item > litehtml::render_item_flex::clone ( )
inlineoverridevirtual

Reimplemented from litehtml::render_item_block.

◆ get_first_baseline()

int litehtml::render_item_flex::get_first_baseline ( )
overridevirtual

Get first baseline position. Default position is element bottom without bottom margin.

Returns
offset of the first baseline from element top

Reimplemented from litehtml::render_item.

◆ get_last_baseline()

int litehtml::render_item_flex::get_last_baseline ( )
overridevirtual

Get last baseline position. Default position is element bottom without bottom margin.

Returns
offset of the last baseline from element top

Reimplemented from litehtml::render_item.

◆ get_lines()

std::list< litehtml::flex_line > litehtml::render_item_flex::get_lines ( const containing_block_context self_size,
litehtml::formatting_context fmt_ctx,
bool  is_row_direction,
int  container_main_size,
bool  single_line 
)
private

◆ init()

std::shared_ptr< litehtml::render_item > litehtml::render_item_flex::init ( )
overridevirtual

Reimplemented from litehtml::render_item_block.

Member Data Documentation

◆ m_lines

std::list<flex_line> litehtml::render_item_flex::m_lines
private

The documentation for this class was generated from the following files: