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

#include <render_item.h>

Inheritance diagram for litehtml::render_item:
litehtml::render_item_block litehtml::render_item_image litehtml::render_item_inline litehtml::render_item_table litehtml::render_item_table_part litehtml::render_item_table_row litehtml::render_item_block_context litehtml::render_item_flex litehtml::render_item_inline_context

Public Member Functions

 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 std::shared_ptr< render_iteminit ()
 
virtual void apply_vertical_align ()
 
virtual int get_first_baseline ()
 
virtual int get_last_baseline ()
 
virtual std::shared_ptr< render_itemclone ()
 
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)
 

Protected Member Functions

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
 
virtual int _render (int, int, const containing_block_context &, formatting_context *, bool)
 

Protected Attributes

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()

litehtml::render_item::render_item ( std::shared_ptr< element src_el)
explicit

◆ ~render_item()

virtual litehtml::render_item::~render_item ( )
virtualdefault

Member Function Documentation

◆ _render()

virtual int litehtml::render_item::_render ( int  ,
int  ,
const containing_block_context ,
formatting_context ,
bool   
)
inlineprotectedvirtual

◆ add_child()

void litehtml::render_item::add_child ( const std::shared_ptr< render_item > &  ri)
inline

◆ add_inline_box()

virtual void litehtml::render_item::add_inline_box ( const position )
inlinevirtual

Reimplemented in litehtml::render_item_inline.

◆ add_positioned()

void litehtml::render_item::add_positioned ( const std::shared_ptr< litehtml::render_item > &  el)

◆ apply_relative_shift()

void litehtml::render_item::apply_relative_shift ( const containing_block_context containing_block_size)

◆ apply_vertical_align()

virtual void litehtml::render_item::apply_vertical_align ( )
inlinevirtual

◆ border_bottom()

int litehtml::render_item::border_bottom ( ) const
inline

◆ border_left()

int litehtml::render_item::border_left ( ) const
inline

◆ border_right()

int litehtml::render_item::border_right ( ) const
inline

◆ border_top()

int litehtml::render_item::border_top ( ) const
inline

◆ bottom()

int litehtml::render_item::bottom ( ) const
inline

◆ box_sizing_bottom()

int litehtml::render_item::box_sizing_bottom ( ) const
inline

◆ box_sizing_height()

int litehtml::render_item::box_sizing_height ( ) const
inline

◆ box_sizing_left()

int litehtml::render_item::box_sizing_left ( ) const
inline

◆ box_sizing_right()

int litehtml::render_item::box_sizing_right ( ) const
inline

◆ box_sizing_top()

int litehtml::render_item::box_sizing_top ( ) const
inline

◆ box_sizing_width()

int litehtml::render_item::box_sizing_width ( ) const
inline

◆ calc_auto_margins()

int litehtml::render_item::calc_auto_margins ( int  parent_width)

◆ calc_cb_length()

void litehtml::render_item::calc_cb_length ( const css_length len,
int  percent_base,
containing_block_context::typed_int out_value 
) const
protected

◆ calc_document_size()

void litehtml::render_item::calc_document_size ( litehtml::size sz,
litehtml::size content_size,
int  x = 0,
int  y = 0 
)

◆ calc_outlines()

void litehtml::render_item::calc_outlines ( int  parent_width)

◆ calculate_containing_block_context()

litehtml::containing_block_context litehtml::render_item::calculate_containing_block_context ( const containing_block_context cb_context)
protected

◆ children()

std::list< std::shared_ptr< render_item > > & litehtml::render_item::children ( )
inline

◆ clear_inline_boxes()

virtual void litehtml::render_item::clear_inline_boxes ( )
inlinevirtual

Reimplemented in litehtml::render_item_inline.

◆ clone()

◆ collapse_bottom_margin()

bool litehtml::render_item::collapse_bottom_margin ( ) const
inline

◆ collapse_top_margin()

bool litehtml::render_item::collapse_top_margin ( ) const
inline

◆ content_offset_bottom()

int litehtml::render_item::content_offset_bottom ( ) const
inline

Bottom offset to the element content. Includes paddings, margins and borders.

◆ content_offset_height()

int litehtml::render_item::content_offset_height ( ) const
inline

Sum of top and bottom offsets to the element content. Includes paddings, margins and borders.

◆ content_offset_left()

int litehtml::render_item::content_offset_left ( ) const
inline

Left offset to the element content. Includes paddings, margins and borders.

◆ content_offset_right()

int litehtml::render_item::content_offset_right ( ) const
inline

Right offset to the element content. Includes paddings, margins and borders.

◆ content_offset_top()

int litehtml::render_item::content_offset_top ( ) const
inline

Top offset to the element content. Includes paddings, margins and borders.

◆ content_offset_width()

int litehtml::render_item::content_offset_width ( ) const
inline

Sum of left and right offsets to the element content. Includes paddings, margins and borders.

◆ css()

const css_properties & litehtml::render_item::css ( ) const
inline

◆ draw_children()

void litehtml::render_item::draw_children ( uint_ptr  hdc,
int  x,
int  y,
const position clip,
draw_flag  flag,
int  zindex 
)
virtual

Reimplemented in litehtml::render_item_table.

◆ draw_stacking_context()

void litehtml::render_item::draw_stacking_context ( uint_ptr  hdc,
int  x,
int  y,
const position clip,
bool  with_positioned 
)

◆ dump()

void litehtml::render_item::dump ( litehtml::dumper cout)

◆ element_static_offset()

std::tuple< int, int > litehtml::render_item::element_static_offset ( const std::shared_ptr< litehtml::render_item > &  el)

◆ fetch_positioned()

bool litehtml::render_item::fetch_positioned ( )

◆ get_borders()

margins & litehtml::render_item::get_borders ( )
inline

◆ get_child_by_point()

std::shared_ptr< litehtml::element > litehtml::render_item::get_child_by_point ( int  x,
int  y,
int  client_x,
int  client_y,
draw_flag  flag,
int  zindex 
)
virtual

◆ get_draw_vertical_offset()

virtual int litehtml::render_item::get_draw_vertical_offset ( )
inlinevirtual

Reimplemented in litehtml::render_item_table.

◆ get_element_by_point()

std::shared_ptr< litehtml::element > litehtml::render_item::get_element_by_point ( int  x,
int  y,
int  client_x,
int  client_y 
)

◆ get_first_baseline()

virtual int litehtml::render_item::get_first_baseline ( )
inlinevirtual

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

Returns
offset of the first baseline from element top

Reimplemented in litehtml::render_item_block_context, litehtml::render_item_flex, litehtml::render_item_inline, and litehtml::render_item_inline_context.

◆ get_inline_boxes()

virtual void litehtml::render_item::get_inline_boxes ( position::vector ) const
inlinevirtual

◆ get_last_baseline()

virtual int litehtml::render_item::get_last_baseline ( )
inlinevirtual

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

Returns
offset of the last baseline from element top

Reimplemented in litehtml::render_item_block_context, litehtml::render_item_flex, litehtml::render_item_inline, and litehtml::render_item_inline_context.

◆ get_margins()

margins & litehtml::render_item::get_margins ( )
inline

◆ get_paddings()

margins & litehtml::render_item::get_paddings ( )
inline

◆ get_placement()

litehtml::position litehtml::render_item::get_placement ( ) const

◆ get_redraw_box()

void litehtml::render_item::get_redraw_box ( litehtml::position pos,
int  x = 0,
int  y = 0 
)

◆ get_rendering_boxes()

void litehtml::render_item::get_rendering_boxes ( position::vector redraw_boxes)

Returns the boxes of rendering element. All coordinates are absolute

Parameters
redraw_boxes[out] resulting rendering boxes
Returns

◆ height()

int litehtml::render_item::height ( ) const
inline

◆ init()

std::shared_ptr< litehtml::render_item > litehtml::render_item::init ( )
virtual

◆ is_flex_item()

bool litehtml::render_item::is_flex_item ( ) const
inline

◆ is_point_inside()

bool litehtml::render_item::is_point_inside ( int  x,
int  y 
)

◆ is_root()

bool litehtml::render_item::is_root ( ) const
inline

◆ is_visible()

bool litehtml::render_item::is_visible ( ) const
inline

◆ left()

int litehtml::render_item::left ( ) const
inline

◆ margin_bottom()

int litehtml::render_item::margin_bottom ( ) const
inline

◆ margin_left()

int litehtml::render_item::margin_left ( ) const
inline

◆ margin_right()

int litehtml::render_item::margin_right ( ) const
inline

◆ margin_top()

int litehtml::render_item::margin_top ( ) const
inline

◆ padding_bottom()

int litehtml::render_item::padding_bottom ( ) const
inline

◆ padding_left()

int litehtml::render_item::padding_left ( ) const
inline

◆ padding_right()

int litehtml::render_item::padding_right ( ) const
inline

◆ padding_top()

int litehtml::render_item::padding_top ( ) const
inline

◆ parent() [1/2]

std::shared_ptr< render_item > litehtml::render_item::parent ( ) const
inline

◆ parent() [2/2]

void litehtml::render_item::parent ( const std::shared_ptr< render_item > &  par)
inline

◆ pos()

position & litehtml::render_item::pos ( )
inline

◆ render()

int litehtml::render_item::render ( int  x,
int  y,
const containing_block_context containing_block_size,
formatting_context fmt_ctx,
bool  second_pass = false 
)

◆ render_offset_bottom()

int litehtml::render_item::render_offset_bottom ( ) const
inline

◆ render_offset_height()

int litehtml::render_item::render_offset_height ( ) const
inline

◆ render_offset_left()

int litehtml::render_item::render_offset_left ( ) const
inline

◆ render_offset_right()

int litehtml::render_item::render_offset_right ( ) const
inline

◆ render_offset_top()

int litehtml::render_item::render_offset_top ( ) const
inline

◆ render_offset_width()

int litehtml::render_item::render_offset_width ( ) const
inline

◆ render_positioned()

void litehtml::render_item::render_positioned ( render_type  width = render_all)

◆ right()

int litehtml::render_item::right ( ) const
inline

◆ set_inline_boxes()

virtual void litehtml::render_item::set_inline_boxes ( position::vector )
inlinevirtual

Reimplemented in litehtml::render_item_inline.

◆ set_paddings()

void litehtml::render_item::set_paddings ( const margins val)
inline

◆ skip() [1/2]

bool litehtml::render_item::skip ( ) const
inline

◆ skip() [2/2]

void litehtml::render_item::skip ( bool  val)
inline

◆ split_inlines()

std::tuple< std::shared_ptr< litehtml::render_item >, std::shared_ptr< litehtml::render_item >, std::shared_ptr< litehtml::render_item > > litehtml::render_item::split_inlines ( )

◆ src_el()

const std::shared_ptr< element > & litehtml::render_item::src_el ( ) const
inline

◆ top()

int litehtml::render_item::top ( ) const
inline

◆ width()

int litehtml::render_item::width ( ) const
inline

Member Data Documentation

◆ m_borders

margins litehtml::render_item::m_borders
protected

◆ m_children

std::list<std::shared_ptr<render_item> > litehtml::render_item::m_children
protected

◆ m_element

std::shared_ptr<element> litehtml::render_item::m_element
protected

◆ m_margins

margins litehtml::render_item::m_margins
protected

◆ m_padding

margins litehtml::render_item::m_padding
protected

◆ m_parent

std::weak_ptr<render_item> litehtml::render_item::m_parent
protected

◆ m_pos

position litehtml::render_item::m_pos
protected

◆ m_positioned

std::vector<std::shared_ptr<render_item> > litehtml::render_item::m_positioned
protected

◆ m_skip

bool litehtml::render_item::m_skip
protected

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