21#ifndef GCC_TEXT_ART_TYPES_H
22#define GCC_TEXT_ART_TYPES_H
29# error "You must define INCLUDE_VECTOR before including system.h to use text-art/types.h"
47template <
typename CoordinateSystem>
50 size (
int w_,
int h_) :
w (w_),
h (h_) {}
55template <
typename CoordinateSystem>
58 coord (
int x_,
int y_) :
x (x_),
y (y_) {}
63template <
typename CoordinateSystem>
72template <
typename CoordinateSystem>
92template <
typename CoordinateSystem>
104 :
m_top_left (x_range.get_min (), y_range.get_min ()),
105 m_size (x_range.get_size (), y_range.get_size ())
132template <
typename CoordinateSystem>
139template <
typename ElementType,
typename SizeType,
typename CoordType>
189 for (
int x = 0; x <
m_size.w; x++)
270 u.m_named.m_name = name;
271 u.m_named.m_bright = bright;
293 return !(*
this == other);
311 return (
m_bold == other.m_bold
317 &&
m_url == other.m_url);
323 const style &old_style,
324 const style &new_style);
387 int width = cpp_wcwidth (
get_code ());
394 return (
m_code == other.m_code
403 return cpp_wcwidth (
m_code);
428 explicit styled_string (cppchar_t cppchar,
bool emoji =
false);
447 return m_chars == other.m_chars;
452 const char *fmt, ...)
463 std::vector<styled_unichar>::const_iterator
begin ()
const
467 std::vector<styled_unichar>::const_iterator
end ()
const
Definition pretty-print.h:241
CoordType coord_t
Definition types.h:145
SizeType size_t
Definition types.h:144
void set(const coord_t &coord, const element_t &element)
Definition types.h:180
array2 & operator==(array2 &&other)=delete
array2(const array2 &other)=delete
ElementType element_t
Definition types.h:143
const size_t & get_size() const
Definition types.h:166
void add_row(const element_t &element)
Definition types.h:168
size_t m_size
Definition types.h:203
const element_t & get(const coord_t &coord) const
Definition types.h:174
array2 & operator=(const array2 &other)=delete
std::vector< element_t > m_elements
Definition types.h:204
array2(size_t sz)
Definition types.h:147
array2(array2 &&other)
Definition types.h:152
void fill(element_t element)
Definition types.h:186
::size_t get_idx(const coord_t &coord) const
Definition types.h:194
void print_any_style_changes(pretty_printer *pp, style::id_t old_id, style::id_t new_id) const
Definition style.cc:307
const style & get_style(style::id_t id) const
Definition types.h:346
style::id_t get_or_create_id(const style &style)
Definition style.cc:284
style_manager()
Definition style.cc:277
unsigned get_num_styles() const
Definition types.h:353
std::vector< style > m_styles
Definition types.h:356
styled_string(const styled_string &)=delete
styled_string(styled_string &&)=default
int calc_canvas_width() const
Definition styled-string.cc:588
styled_string & operator=(styled_string &&)=default
bool operator==(const styled_string &other) const
Definition types.h:445
std::vector< styled_unichar > m_chars
Definition types.h:479
styled_string copy() const
Definition types.h:438
void set_url(style_manager &sm, const char *url)
Definition styled-string.cc:605
std::vector< styled_unichar >::const_iterator begin() const
Definition types.h:463
void append(const styled_string &suffix)
Definition styled-string.cc:597
static styled_string static styled_string from_fmt_va(style_manager &sm, printer_fn format_decoder, const char *fmt, va_list *args) ATTRIBUTE_GCC_PPDIAG(3
Definition styled-string.cc:559
styled_unichar operator[](size_t idx) const
Definition types.h:461
static styled_string static styled_string size_t size() const
Definition types.h:460
static styled_string from_fmt(style_manager &sm, printer_fn format_decoder, const char *fmt,...) ATTRIBUTE_GCC_PPDIAG(3
Definition styled-string.cc:576
std::vector< styled_unichar >::const_iterator end() const
Definition types.h:467
bool m_emoji_variant_p
Definition types.h:418
bool emoji_variant_p() const
Definition types.h:382
styled_unichar(cppchar_t ch)
Definition types.h:368
int get_canvas_width() const
Definition types.h:401
const std::vector< cppchar_t > get_combining_chars() const
Definition types.h:411
style::id_t m_style_id
Definition types.h:419
styled_unichar(cppchar_t ch, bool emoji, style::id_t style_id)
Definition types.h:373
void set_emoji_variant()
Definition types.h:399
style::id_t get_style_id() const
Definition types.h:383
bool operator==(const styled_unichar &other) const
Definition types.h:392
styled_unichar()
Definition types.h:364
cppchar_t m_code
Definition types.h:417
void add_combining_char(cppchar_t ch)
Definition types.h:406
friend class styled_string
Definition types.h:362
cppchar_t get_code() const
Definition types.h:381
std::vector< cppchar_t > m_combining_chars
Definition types.h:420
bool double_width_p() const
Definition types.h:385
Definition diagnostics/context.h:57
coord< CoordinateSystem > operator+(coord< CoordinateSystem > a, coord< CoordinateSystem > b)
Definition types.h:64
style get_style_from_color_cap_name(const char *name)
Definition style.cc:263
y_align
Definition types.h:490
@ BOTTOM
Definition types.h:493
@ TOP
Definition types.h:491
x_align
Definition types.h:483
@ RIGHT
Definition types.h:486
@ LEFT
Definition types.h:484
@ CENTER
Definition types.h:485
poly_int< N, C > r
Definition poly-int.h:774
Ca const poly_int< N, Cb > & b
Definition poly-int.h:771
Ca & a
Definition poly-int.h:770
bool(* printer_fn)(pretty_printer *, text_info *, const char *, int, bool, bool, bool, bool *, pp_token_list &)
Definition pretty-print.h:190
#define ATTRIBUTE_GCC_PPDIAG(m, n)
Definition pretty-print.h:582
Definition collect2.cc:168
Definition ira-emit.cc:158
int x
Definition types.h:59
int y
Definition types.h:60
coord(int x_, int y_)
Definition types.h:58
bool m_right
Definition types.h:514
bool m_up
Definition types.h:511
bool m_left
Definition types.h:513
size_t as_index() const
Definition types.h:506
bool m_down
Definition types.h:512
directions(bool up, bool down, bool left, bool right)
Definition types.h:501
int start
Definition types.h:86
int get_size() const
Definition types.h:82
range(int start_, int next_)
Definition types.h:75
int get_max() const
Definition types.h:80
int get_midpoint() const
Definition types.h:84
int next
Definition types.h:87
int get_next() const
Definition types.h:81
int get_min() const
Definition types.h:79
int get_min_y() const
Definition types.h:110
int get_max_x() const
Definition types.h:111
int get_width() const
Definition types.h:125
range< CoordinateSystem > get_y_range() const
Definition types.h:120
int get_min_x() const
Definition types.h:109
int get_next_x() const
Definition types.h:113
int get_next_y() const
Definition types.h:114
size< class canvas > m_size
Definition types.h:129
rect(coord< CoordinateSystem > top_left, size< CoordinateSystem > size)
Definition types.h:95
range< CoordinateSystem > get_x_range() const
Definition types.h:116
int get_height() const
Definition types.h:126
rect(range< CoordinateSystem > x_range, range< CoordinateSystem > y_range)
Definition types.h:102
coord< class canvas > m_top_left
Definition types.h:128
int get_max_y() const
Definition types.h:112
int w
Definition types.h:51
size(int w_, int h_)
Definition types.h:50
int h
Definition types.h:52
color(enum named_color name=named_color::DEFAULT, bool bright=false)
Definition types.h:266
struct text_art::style::color::@117042154020367337343243002032317004337077075210::@270270064322315304315134350212261177253034247243 m_24bit
union text_art::style::color::@117042154020367337343243002032317004337077075210 u
uint8_t g
Definition types.h:260
uint8_t r
Definition types.h:259
kind
Definition types.h:245
@ BITS_8
Definition types.h:247
@ BITS_24
Definition types.h:248
@ NAMED
Definition types.h:246
void print_sgr(pretty_printer *pp, bool fg, bool &need_separator) const
Definition style.cc:79
enum named_color m_name
Definition types.h:254
bool m_bright
Definition types.h:255
uint8_t b
Definition types.h:261
struct text_art::style::color::@117042154020367337343243002032317004337077075210::@274032352342362202072121330210337243021024243342 m_named
color(uint8_t r, uint8_t g, uint8_t b)
Definition types.h:282
bool operator!=(const color &other) const
Definition types.h:291
color(uint8_t col_val)
Definition types.h:275
enum text_art::style::color::kind m_kind
bool operator==(const color &other) const
Definition style.cc:50
uint8_t m_8bit
Definition types.h:257
bool m_bold
Definition types.h:326
style()
Definition types.h:299
bool operator==(const style &other) const
Definition types.h:309
static void print_changes(pretty_printer *pp, const style &old_style, const style &new_style)
Definition style.cc:178
bool m_underscore
Definition types.h:327
unsigned char id_t
Definition types.h:223
named_color
Definition types.h:228
@ BLACK
Definition types.h:231
@ BLUE
Definition types.h:235
@ CYAN
Definition types.h:237
@ DEFAULT
Definition types.h:229
@ YELLOW
Definition types.h:234
@ GREEN
Definition types.h:233
@ RED
Definition types.h:232
@ WHITE
Definition types.h:238
@ MAGENTA
Definition types.h:236
bool m_blink
Definition types.h:328
color m_bg_color
Definition types.h:331
style & set_style_url(const char *url)
Definition style.cc:39
static const id_t id_plain
Definition types.h:224
std::vector< cppchar_t > m_url
Definition types.h:332
color m_fg_color
Definition types.h:330
bool m_reverse
Definition types.h:329
#define gcc_assert(EXPR)
Definition system.h:814
#define false
Definition system.h:888
const T2 & y
Definition wide-int.h:3870