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>
195 for (
int x = 0; x <
m_size.w; x++)
276 u.m_named.m_name = name;
277 u.m_named.m_bright = bright;
299 return !(*
this == other);
317 return (
m_bold == other.m_bold
323 &&
m_url == other.m_url);
329 const style &old_style,
330 const style &new_style);
393 int width = cpp_wcwidth (
get_code ());
400 return (
m_code == other.m_code
409 return cpp_wcwidth (
m_code);
434 explicit styled_string (cppchar_t cppchar,
bool emoji =
false);
453 return m_chars == other.m_chars;
458 const char *fmt, ...)
469 std::vector<styled_unichar>::const_iterator
begin ()
const
473 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 set(const coord_t &coord, element_t &&element)
Definition types.h:186
void add_row(const element_t &element)
Definition types.h:168
size_t m_size
Definition types.h:209
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:210
array2(size_t sz)
Definition types.h:147
array2(array2 &&other)
Definition types.h:152
void fill(element_t element)
Definition types.h:192
::size_t get_idx(const coord_t &coord) const
Definition types.h:200
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:352
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:359
std::vector< style > m_styles
Definition types.h:362
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:451
std::vector< styled_unichar > m_chars
Definition types.h:485
styled_string copy() const
Definition types.h:444
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:469
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:467
static styled_string static styled_string size_t size() const
Definition types.h:466
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:473
bool m_emoji_variant_p
Definition types.h:424
bool emoji_variant_p() const
Definition types.h:388
styled_unichar(cppchar_t ch)
Definition types.h:374
int get_canvas_width() const
Definition types.h:407
const std::vector< cppchar_t > get_combining_chars() const
Definition types.h:417
style::id_t m_style_id
Definition types.h:425
styled_unichar(cppchar_t ch, bool emoji, style::id_t style_id)
Definition types.h:379
void set_emoji_variant()
Definition types.h:405
style::id_t get_style_id() const
Definition types.h:389
bool operator==(const styled_unichar &other) const
Definition types.h:398
styled_unichar()
Definition types.h:370
cppchar_t m_code
Definition types.h:423
void add_combining_char(cppchar_t ch)
Definition types.h:412
friend class styled_string
Definition types.h:368
cppchar_t get_code() const
Definition types.h:387
std::vector< cppchar_t > m_combining_chars
Definition types.h:426
bool double_width_p() const
Definition types.h:391
gcc::context * g
Definition context.cc:31
#define BOTTOM
Definition ipa.cc:1386
Definition analyzer-logging.h:28
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:496
@ TOP
Definition types.h:497
x_align
Definition types.h:489
@ RIGHT
Definition types.h:492
@ LEFT
Definition types.h:490
@ CENTER
Definition types.h:491
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
#define ATTRIBUTE_GCC_PPDIAG(m, n)
Definition pretty-print.h:582
bool(*) printer_fn(pretty_printer *, text_info *, const char *, int, bool, bool, bool, bool *, pp_token_list &)
Definition pretty-print.h:190
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:520
bool m_up
Definition types.h:517
bool m_left
Definition types.h:519
size_t as_index() const
Definition types.h:512
bool m_down
Definition types.h:518
directions(bool up, bool down, bool left, bool right)
Definition types.h:507
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:272
union text_art::style::color::@117042154020367337343243002032317004337077075210 u
kind
Definition types.h:251
void print_sgr(pretty_printer *pp, bool fg, bool &need_separator) const
Definition style.cc:79
color(uint8_t r, uint8_t g, uint8_t b)
Definition types.h:288
bool operator!=(const color &other) const
Definition types.h:297
color(uint8_t col_val)
Definition types.h:281
enum text_art::style::color::kind m_kind
bool operator==(const color &other) const
Definition style.cc:50
bool m_bold
Definition types.h:332
style()
Definition types.h:305
bool operator==(const style &other) const
Definition types.h:315
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:333
unsigned char id_t
Definition types.h:229
named_color
Definition types.h:234
@ DEFAULT
Definition types.h:235
bool m_blink
Definition types.h:334
color m_bg_color
Definition types.h:337
style & set_style_url(const char *url)
Definition style.cc:39
static const id_t id_plain
Definition types.h:230
std::vector< cppchar_t > m_url
Definition types.h:338
color m_fg_color
Definition types.h:336
bool m_reverse
Definition types.h:335
#define gcc_assert(EXPR)
Definition system.h:819
#define false
Definition system.h:893
struct text_art::style::color::@117042154020367337343243002032317004337077075210::@274032352342362202072121330210337243021024243342 m_named
struct text_art::style::color::@117042154020367337343243002032317004337077075210::@270270064322315304315134350212261177253034247243 m_24bit
const T2 & y
Definition wide-int.h:3870