|
Blender V5.3
|
Classes | |
| struct | ContextFontSettings |
Public Member Functions | |
| MarkdownLayouter (MarkdownLayoutCache &cache_) | |
| FontConfig | make_font_config (const int fontid, const float default_size, const int default_weight, const int bold_weight) |
| void | compute_layout () |
| void | add_pending_spacing (const float spacing) |
| void | line_box_end () |
| void | add_line_break () |
| void | md_enter_block (const MD_BLOCKTYPE block_type, void *detail) |
| float | list_indent_px () const |
| float | code_block_padding_x_px () const |
| float | code_block_padding_y_px () const |
| float | code_span_padding_x_px () const |
| float | code_span_padding_y_px () const |
| CodeSpan * | mutable_current_code_span () |
| float | context_block_start_x () const |
| float | context_content_start_x () const |
| float | context_content_end_x () const |
| void | append_pending_list_marker () |
| void | append_horizontal_rule () |
| void | track_quote_text_bounds (const MarkdownItemText &item) |
| void | track_code_text_bounds (const MarkdownItemText &item) |
| void | apply_code_span_left_padding () |
| void | finalize_code_span_line_bounds () |
| void | append_code_span_boxes (const CodeSpan &code_span) |
| void | extend_flow_bottom_for_code_block (const CodeBlock &code_block) |
| void | append_code_block_box () |
| void | append_quote_line () |
| bool | is_in_quote () const |
| bool | is_in_fenced_code_block () const |
| bool | has_code_span () const |
| bool | is_code () const |
| bool | is_direct_child_of_list_item () const |
| float | spacing_px (const float multiplier) const |
| float | block_margin_top (const MdBlock &block) const |
| float | block_margin_bottom (const MdBlock &block) const |
| void | md_leave_block (const MD_BLOCKTYPE block_type, void *) |
| void | md_enter_span (const MD_SPANTYPE span_type, void *detail) |
| void | md_leave_span (const MD_SPANTYPE span_type, void *) |
| void | md_text (const MD_TEXTTYPE text_type, const StringRef text) |
| void | md_text_normal (const StringRef text) |
| void | md_text_code (StringRef text) |
| void | ensure_line_box (const int fontid) |
| ContextFontSettings | get_context_font_settings () const |
| void | output_wrapped_text (StringRef text, const float size, const int fontid, const int weight, const bool italic, const std::optional< StringRef > &url, const float start_x) |
| void | finalize_vertical_positions () |
Static Public Member Functions | |
| static StringRef | unordered_bullet_for_level (const int level) |
| static bool | is_list_container_block (const MdBlock &block) |
Utility class used to take raw markdown as input and turn it into positions for text and other elements. A class is used to simplify state management during the parsing process.
Definition at line 156 of file interface_label_markdown.cc.
|
inline |
Definition at line 265 of file interface_label_markdown.cc.
References blender::blf_mono_font, uiFontStyle::character_weight, make_font_config(), uiFontStyle::points, blender::ui::style_get(), uiFontStyle::uifont_id, and uiStyle::widget.
Referenced by compute_layout().
|
inline |
Definition at line 334 of file interface_label_markdown.cc.
References line_box_end().
Referenced by md_text(), and md_text_code().
|
inline |
Definition at line 320 of file interface_label_markdown.cc.
References spacing_px().
Referenced by md_enter_block(), and md_leave_block().
|
inline |
Definition at line 704 of file interface_label_markdown.cc.
References blender::BLI_rctf_is_empty(), blender::ui::MarkdownItemCodeBox::Block, code_block_padding_y_px(), context_block_start_x(), float, blender::ui::MarkdownItemCodeBox::kind, blender::ui::MarkdownItemCodeBox::rect, blender::rctf::xmax, blender::rctf::xmin, blender::rctf::ymax, and blender::rctf::ymin.
Referenced by md_leave_block().
|
inline |
Definition at line 670 of file interface_label_markdown.cc.
References blender::BLI_rctf_is_empty(), code_span_padding_x_px(), code_span_padding_y_px(), blender::ui::MarkdownItemCodeBox::Inline, blender::ui::MarkdownItemCodeBox::kind, blender::ui::MarkdownItemCodeBox::rect, blender::rctf::xmax, blender::rctf::xmin, blender::rctf::ymax, and blender::rctf::ymin.
Referenced by md_leave_span().
|
inline |
Definition at line 596 of file interface_label_markdown.cc.
References blender::ui::md_style::horizontal_rule_padding, blender::padding(), and spacing_px().
Referenced by md_enter_block().
|
inline |
Definition at line 535 of file interface_label_markdown.cc.
References blender::BLF_width(), blender::blender::StringRefBase::data(), blender::ui::MarkdownItemText::fontid, blender::IndexRange::IndexRange(), blender::ui::MarkdownItemText::is_in_quote, is_in_quote(), blender::ui::MarkdownItemText::italic, list_indent_px(), blender::ui::md_style::list_marker_padding_px, blender::ui::markdown_apply_item_font(), blender::ui::markdown_disable_item_font(), blender::blender::StringRefBase::size(), blender::ui::MarkdownItemText::size_px, blender::ui::MarkdownItemText::text, track_quote_text_bounds(), unordered_bullet_for_level(), blender::ui::MarkdownItemText::weight, blender::ui::MarkdownItemText::x, and blender::ui::MarkdownItemText::y.
Referenced by ensure_line_box().
|
inline |
Definition at line 722 of file interface_label_markdown.cc.
References blender::BLI_assert(), context_block_start_x(), FLT_MAX, blender::ui::MarkdownItemQuoteLine::height, list_indent_px(), blender::padding(), blender::ui::md_style::quote_bar_padding, blender::ui::MarkdownItemQuoteLine::x, and blender::ui::MarkdownItemQuoteLine::y.
Referenced by md_leave_block().
|
inline |
Definition at line 650 of file interface_label_markdown.cc.
References code_span_padding_x_px(), and mutable_current_code_span().
Referenced by output_wrapped_text().
|
inline |
Definition at line 832 of file interface_label_markdown.cc.
References blender::ui::md_style::code_block, blender::ui::md_style::headers, blender::ui::md_style::horizontal_rule, blender::ui::md_style::list, blender::ui::md_style::paragraph, and blender::ui::md_style::quote.
Referenced by md_leave_block().
|
inline |
Definition at line 807 of file interface_label_markdown.cc.
References blender::ui::md_style::code_block, blender::ui::md_style::headers, blender::ui::md_style::horizontal_rule, blender::ui::md_style::list, blender::ui::md_style::paragraph, and blender::ui::md_style::quote.
Referenced by md_enter_block().
|
inline |
Definition at line 459 of file interface_label_markdown.cc.
References blender::ui::md_style::code_block_padding_x.
Referenced by context_content_end_x(), and context_content_start_x().
|
inline |
Definition at line 464 of file interface_label_markdown.cc.
References blender::ui::md_style::code_block_padding_y.
Referenced by append_code_block_box(), extend_flow_bottom_for_code_block(), and md_enter_block().
|
inline |
Definition at line 469 of file interface_label_markdown.cc.
References blender::ui::md_style::code_span_padding_x.
Referenced by append_code_span_boxes(), apply_code_span_left_padding(), and md_leave_span().
|
inline |
Definition at line 474 of file interface_label_markdown.cc.
References blender::ui::md_style::code_span_padding_y.
Referenced by append_code_span_boxes(), and ensure_line_box().
|
inline |
Definition at line 291 of file interface_label_markdown.cc.
References finalize_vertical_positions(), length(), MarkdownLayouter(), md_enter_block(), md_enter_span(), md_leave_block(), md_leave_span(), md_text(), and blender::StringRef::StringRef().
Referenced by blender::ui::label_markdown_resolve().
|
inline |
Definition at line 490 of file interface_label_markdown.cc.
References list_indent_px().
Referenced by append_code_block_box(), append_quote_line(), context_content_start_x(), and md_enter_block().
|
inline |
Definition at line 514 of file interface_label_markdown.cc.
References code_block_padding_x_px(), float, is_in_fenced_code_block(), and blender::x.
Referenced by output_wrapped_text().
|
inline |
Definition at line 505 of file interface_label_markdown.cc.
References code_block_padding_x_px(), context_block_start_x(), is_in_fenced_code_block(), and blender::x.
Referenced by ensure_line_box(), md_text(), md_text_code(), and md_text_normal().
|
inline |
Definition at line 1089 of file interface_label_markdown.cc.
References append_pending_list_marker(), blender::BLF_ascender(), blender::BLF_height_max(), code_span_padding_y_px(), context_content_start_x(), and has_code_span().
Referenced by md_leave_block(), and output_wrapped_text().
|
inline |
Definition at line 690 of file interface_label_markdown.cc.
References blender::BLI_rctf_is_empty(), and code_block_padding_y_px().
Referenced by md_leave_block().
|
inline |
Definition at line 660 of file interface_label_markdown.cc.
References blender::BLI_rctf_init_minmax(), blender::BLI_rctf_is_empty(), and mutable_current_code_span().
Referenced by md_leave_span(), and output_wrapped_text().
|
inline |
Definition at line 1240 of file interface_label_markdown.cc.
References line_box_end().
Referenced by compute_layout().
|
inline |
Definition at line 1105 of file interface_label_markdown.cc.
References blender::ui::MarkdownLayouter::ContextFontSettings::fontid, blender::ui::md_style::headers, is_in_fenced_code_block(), blender::ui::MarkdownLayouter::ContextFontSettings::italic, blender::ui::MdHeaderStyle::italic, blender::ui::MarkdownLayouter::ContextFontSettings::size, blender::ui::MdHeaderStyle::size_factor, blender::ui::MarkdownLayouter::ContextFontSettings::url, blender::ui::MarkdownLayouter::ContextFontSettings::weight, and blender::ui::MdHeaderStyle::weight.
Referenced by md_text_code(), and md_text_normal().
|
inline |
Definition at line 773 of file interface_label_markdown.cc.
Referenced by ensure_line_box(), is_code(), and output_wrapped_text().
|
inline |
Definition at line 783 of file interface_label_markdown.cc.
References has_code_span(), and is_in_fenced_code_block().
|
inline |
Definition at line 794 of file interface_label_markdown.cc.
|
inline |
Definition at line 763 of file interface_label_markdown.cc.
Referenced by context_content_end_x(), context_content_start_x(), get_context_font_settings(), is_code(), output_wrapped_text(), and track_code_text_bounds().
|
inline |
Definition at line 753 of file interface_label_markdown.cc.
Referenced by append_pending_list_marker(), output_wrapped_text(), and track_quote_text_bounds().
|
inlinestatic |
Definition at line 788 of file interface_label_markdown.cc.
Referenced by md_enter_block().
|
inline |
Definition at line 325 of file interface_label_markdown.cc.
Referenced by add_line_break(), finalize_vertical_positions(), md_enter_block(), md_leave_block(), and output_wrapped_text().
|
inline |
Definition at line 454 of file interface_label_markdown.cc.
References blender::ui::md_style::list_indent_px.
Referenced by append_pending_list_marker(), append_quote_line(), and context_block_start_x().
|
inline |
Definition at line 276 of file interface_label_markdown.cc.
References blender::BLF_height_max(), and blender::ui::markdown_apply_font().
Referenced by MarkdownLayouter().
|
inline |
Definition at line 345 of file interface_label_markdown.cc.
References add_pending_spacing(), append_horizontal_rule(), blender::BLI_rctf_init_minmax(), block_margin_top(), code_block_padding_y_px(), context_block_start_x(), is_list_container_block(), line_box_end(), and blender::ui::md_style::list.
Referenced by compute_layout().
|
inline |
Definition at line 931 of file interface_label_markdown.cc.
References blender::BLI_rctf_init_minmax(), and blender::StringRef::StringRef().
Referenced by compute_layout().
|
inline |
Definition at line 857 of file interface_label_markdown.cc.
References add_pending_spacing(), append_code_block_box(), append_quote_line(), blender::BLI_assert(), block_margin_bottom(), ensure_line_box(), extend_flow_bottom_for_code_block(), line_box_end(), and blender::ui::markdown_apply_font().
Referenced by compute_layout().
|
inline |
Definition at line 967 of file interface_label_markdown.cc.
References append_code_span_boxes(), blender::BLI_assert(), code_span_padding_x_px(), and finalize_code_span_line_bounds().
Referenced by compute_layout().
|
inline |
Definition at line 1003 of file interface_label_markdown.cc.
References add_line_break(), context_content_start_x(), md_text_code(), and md_text_normal().
Referenced by compute_layout().
|
inline |
Definition at line 1043 of file interface_label_markdown.cc.
References add_line_break(), context_content_start_x(), blender::StringRef::drop_prefix(), blender::blender::StringRefBase::find_first_of(), blender::ui::MarkdownLayouter::ContextFontSettings::fontid, get_context_font_settings(), blender::blender::StringRefBase::is_empty(), blender::ui::MarkdownLayouter::ContextFontSettings::italic, blender::ui::markdown_apply_font(), blender::blender::StringRefBase::not_found, output_wrapped_text(), blender::ui::MarkdownLayouter::ContextFontSettings::size, blender::blender::StringRefBase::substr(), blender::ui::MarkdownLayouter::ContextFontSettings::url, and blender::ui::MarkdownLayouter::ContextFontSettings::weight.
Referenced by md_text().
|
inline |
Definition at line 1030 of file interface_label_markdown.cc.
References context_content_start_x(), blender::ui::MarkdownLayouter::ContextFontSettings::fontid, get_context_font_settings(), blender::ui::MarkdownLayouter::ContextFontSettings::italic, output_wrapped_text(), blender::ui::MarkdownLayouter::ContextFontSettings::size, blender::ui::MarkdownLayouter::ContextFontSettings::url, and blender::ui::MarkdownLayouter::ContextFontSettings::weight.
Referenced by md_text().
|
inline |
Definition at line 479 of file interface_label_markdown.cc.
Referenced by apply_code_span_left_padding(), finalize_code_span_line_bounds(), and track_code_text_bounds().
|
inline |
Definition at line 1149 of file interface_label_markdown.cc.
References apply_code_span_left_padding(), blender::BLF_width(), blender::BLF_width_to_strlen(), BLI_SCOPED_DEFER, blender::BLI_str_utf8_size_safe(), blender::ui::MarkdownItemText::code_context, blender::ui::MarkdownItemText::CodeBlock, blender::ui::MarkdownItemText::CodeSpan, context_content_end_x(), blender::blender::StringRefBase::data(), blender::StringRef::drop_prefix(), ensure_line_box(), finalize_code_span_line_bounds(), blender::blender::StringRefBase::find_last_of(), blender::ui::MarkdownItemText::fontid, has_code_span(), blender::blender::StringRefBase::is_empty(), is_in_fenced_code_block(), blender::ui::MarkdownItemText::is_in_quote, is_in_quote(), blender::ui::MarkdownItemText::italic, line_box_end(), blender::ui::markdown_apply_item_font(), blender::ui::markdown_disable_item_font(), blender::ui::MarkdownItemText::None, blender::blender::StringRefBase::not_found, blender::blender::StringRefBase::size(), blender::ui::MarkdownItemText::size_px, blender::blender::StringRefBase::substr(), blender::ui::MarkdownItemText::text, track_code_text_bounds(), track_quote_text_bounds(), blender::ui::MarkdownItemText::url, blender::ui::MarkdownItemText::weight, blender::ui::MarkdownItemText::x, and blender::ui::MarkdownItemText::y.
Referenced by md_text_code(), and md_text_normal().
Definition at line 802 of file interface_label_markdown.cc.
Referenced by add_pending_spacing(), and append_horizontal_rule().
|
inline |
Definition at line 625 of file interface_label_markdown.cc.
References blender::BLF_ascender(), blender::BLF_descender(), blender::BLF_width(), blender::BLI_rctf_union(), blender::ui::MarkdownItemText::code_context, blender::ui::MarkdownItemText::CodeSpan, blender::blender::StringRefBase::data(), blender::ui::MarkdownItemText::fontid, is_in_fenced_code_block(), blender::ui::markdown_apply_item_font(), blender::ui::markdown_disable_item_font(), mutable_current_code_span(), blender::blender::StringRefBase::size(), blender::ui::MarkdownItemText::text, blender::ui::MarkdownItemText::x, and blender::ui::MarkdownItemText::y.
Referenced by output_wrapped_text().
|
inline |
Definition at line 606 of file interface_label_markdown.cc.
References blender::BLF_ascender(), blender::BLF_descender(), blender::ui::MarkdownItemText::fontid, is_in_quote(), blender::ui::markdown_apply_item_font(), blender::ui::markdown_disable_item_font(), and blender::ui::MarkdownItemText::y.
Referenced by append_pending_list_marker(), and output_wrapped_text().
|
inlinestatic |
Definition at line 523 of file interface_label_markdown.cc.
Referenced by append_pending_list_marker().