GCC Middle and Back End API Reference
|
#include <canvas.h>
Public Types | |
typedef styled_unichar | cell_t |
typedef size< class canvas > | size_t |
typedef coord< class canvas > | coord_t |
typedef range< class canvas > | range_t |
typedef rect< class canvas > | rect_t |
Public Member Functions | |
canvas (size_t size, const style_manager &style_mgr) | |
size_t | get_size () const |
void | paint (coord_t coord, cell_t c) |
void | paint_text (coord_t coord, const styled_string &text) |
void | fill (rect_t rect, cell_t c) |
void | debug_fill () |
void | print_to_pp (pretty_printer *pp, const char *per_line_prefix=NULL) const |
void | debug (bool styled) const |
const cell_t & | get (coord_t coord) const |
Private Member Functions | |
int | get_final_x_in_row (int y) const |
Private Attributes | |
array2< cell_t, size_t, coord_t > | m_cells |
const style_manager & | m_style_mgr |
A 2 dimensional grid of text cells (a "canvas"), which can be written to ("painted") via random access, and then written out to a pretty_printer once the picture is complete. Each text cell can be styled independently (colorization, URLs, etc).
typedef coord<class canvas> text_art::canvas::coord_t |
typedef range<class canvas> text_art::canvas::range_t |
typedef rect<class canvas> text_art::canvas::rect_t |
typedef size<class canvas> text_art::canvas::size_t |
canvas::canvas | ( | size_t | size, |
const style_manager & | style_mgr ) |
References m_cells, and m_style_mgr.
DEBUG_FUNCTION void canvas::debug | ( | bool | styled | ) | const |
References determine_url_format(), DIAGNOSTICS_URL_AUTO, pp_formatted_text(), pp_show_color(), print_to_pp(), and pretty_printer::set_url_format().
Referenced by text_art::table::debug().
void canvas::debug_fill | ( | ) |
References fill(), and get_size().
References text_art::rect< CoordinateSystem >::get_min_x(), text_art::rect< CoordinateSystem >::get_min_y(), text_art::rect< CoordinateSystem >::get_next_x(), text_art::rect< CoordinateSystem >::get_next_y(), paint(), and y.
Referenced by debug_fill(), text_art::table::paint_to_canvas(), and text_art::x_ruler::paint_to_canvas().
|
private |
Find right-most non-default cell in this row, or -1 if all are default.
References text_art::styled_unichar::get_code(), text_art::styled_unichar::get_style_id(), text_art::style::id_plain, m_cells, and y.
Referenced by print_to_pp().
|
inline |
References m_cells.
Referenced by debug_fill().
void canvas::paint_text | ( | coord_t | coord, |
const styled_string & | text ) |
References paint(), and text_art::coord< CoordinateSystem >::x.
Referenced by text_art::table_cell_content::paint_to_canvas(), text_art::text_widget::paint_to_canvas(), and text_art::x_ruler::paint_to_canvas().
void canvas::print_to_pp | ( | pretty_printer * | pp, |
const char * | per_line_prefix = NULL ) const |
References text_art::styled_unichar::double_width_p(), text_art::styled_unichar::emoji_variant_p(), text_art::styled_unichar::get_code(), get_final_x_in_row(), text_art::styled_unichar::get_style_id(), pretty_printer::get_url_format(), m_cells, m_style_mgr, pp_append_text(), pp_formatted_text(), pp_newline(), pp_show_color(), pp_string(), pp_unicode_character(), pretty_printer::set_url_format(), and y.
Referenced by debug(), diagnostics::sarif_builder::make_message_object_for_diagram(), and diagnostics::text_sink::on_diagram().
Referenced by canvas(), get(), get_final_x_in_row(), get_size(), paint(), and print_to_pp().
|
private |
Referenced by canvas(), and print_to_pp().