Blender V5.3
interface_label_markdown.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2026 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include <optional>
12#include <variant>
13
14#include "BLI_rect.hh"
15#include "BLI_resource_scope.hh"
16#include "BLI_string_ref.hh"
17#include "BLI_vector.hh"
18
19namespace blender::ui {
20
21struct Block;
22struct Button;
23struct ButtonLabel;
24struct Layout;
25
31 enum class CodeContext {
32 None,
33 CodeSpan,
34 CodeBlock,
35 };
36
40 float x = 0.0f;
41 float y = 0.0f;
42 float size_px = 0.0f;
43 int fontid = 0;
44 int weight = 400;
45 bool italic = false;
46 bool is_in_quote = false;
49 std::optional<StringRef> url;
50};
51
58 float y = 0.0f;
59};
60
67 float x = 0.0f;
68 float y = 0.0f;
70 float height = 0.0f;
71};
72
78 enum class Kind {
81 };
82
83 rctf rect = {};
85};
86
91using MarkdownItem = std::variant<MarkdownItemText,
95
108
115
130
131bool button_label_is_markdown(const Button *button);
132
138
144
146void label_markdown_draw(const ButtonLabel *button, const uchar color[4], const rcti *rect);
147
149
150} // namespace blender::ui
void label_markdown_create_link_buttons(Block *block)
bool button_label_is_markdown(const Button *button)
void label_markdown_dev_config(Layout &layout)
void label_markdown_resolve(ButtonLabel *button)
std::variant< MarkdownItemText, MarkdownItemHorizontalRule, MarkdownItemQuoteLine, MarkdownItemCodeBox > MarkdownItem
void label_markdown_draw(const ButtonLabel *button, const uchar color[4], const rcti *rect)
unsigned char uchar
Definition BKE_text.h:58
@ Inline
Definition types.hh:103
bool operator==(const MarkdownLayoutCacheKey &other) const =default