add support for Ayatana indicator to Notification plugin
[claws.git] / src / plugins / litehtml_viewer / litehtml / render_inline_context.h
blob7d629bc7ff4570dd0c52703b3675da9fff3ececc
1 #ifndef LITEHTML_RENDER_INLINE_CONTEXT_H
2 #define LITEHTML_RENDER_INLINE_CONTEXT_H
4 #include "render_block.h"
6 namespace litehtml
8 /**
9 * An inline formatting context is established by a block container box that contains no block-level boxes.
10 * https://www.w3.org/TR/CSS22/visuren.html#inline-formatting
12 class render_item_inline_context : public render_item_block
14 /**
15 * Structure contains elements with display: inline
16 * members:
17 * - element: render_item with display: inline
18 * - boxes: rectangles represented inline element content. There are can be many boxes if content
19 * is split into some lines
20 * - start_box: the start position of currently calculated box
22 struct inlines_item
24 std::shared_ptr<render_item> element;
25 position::vector boxes;
26 position start_box;
28 explicit inlines_item(const std::shared_ptr<render_item>& el) : element(el) {}
30 protected:
31 std::vector<std::unique_ptr<litehtml::line_box> > m_line_boxes;
32 int m_max_line_width;
34 int _render_content(int x, int y, bool second_pass, const containing_block_context &self_size, formatting_context* fmt_ctx) override;
35 void fix_line_width(element_float flt,
36 const containing_block_context &self_size, formatting_context* fmt_ctx) override;
38 std::list<std::unique_ptr<line_box_item> > finish_last_box(bool end_of_render, const containing_block_context &self_size);
39 void place_inline(std::unique_ptr<line_box_item> item, const containing_block_context &self_size, formatting_context* fmt_ctx);
40 int new_box(const std::unique_ptr<line_box_item>& el, line_context& line_ctx, const containing_block_context &self_size, formatting_context* fmt_ctx);
41 void apply_vertical_align() override;
42 public:
43 explicit render_item_inline_context(std::shared_ptr<element> src_el) : render_item_block(std::move(src_el)), m_max_line_width(0)
46 std::shared_ptr<render_item> clone() override
48 return std::make_shared<render_item_inline_context>(src_el());
51 int get_first_baseline() override;
52 int get_last_baseline() override;
56 #endif //LITEHTML_RENDER_INLINE_CONTEXT_H