GCC Middle and Back End API Reference
|
#include <table.h>
Public Member Functions | |
table_geometry (const table &table, table_cell_sizes &cell_sizes) | |
void | recalc_coords () |
const canvas::size_t | get_canvas_size () const |
canvas::coord_t | table_to_canvas (table::coord_t table_coord) const |
int | table_x_to_canvas_x (int table_x) const |
int | table_y_to_canvas_y (int table_y) const |
int | get_col_width (int table_x) const |
canvas::size_t | get_canvas_size (const table::rect_t &rect) const |
Private Attributes | |
table_cell_sizes & | m_cell_sizes |
canvas::size_t | m_canvas_size |
std::vector< int > | m_col_start_x |
std::vector< int > | m_row_start_y |
A class responsible for mapping from table cell coords to canvas coords, handling column widths. It's the result of solving "how big are all the table cells and where do they go?" The cell_sizes are passed in, for handling aligning multiple tables, sharing column widths or row heights.
table_geometry::table_geometry | ( | const table & | table, |
table_cell_sizes & | cell_sizes ) |
class text_art::table_geometry.
References m_canvas_size, m_cell_sizes, m_col_start_x, m_row_start_y, and recalc_coords().
|
inline |
|
inline |
References m_cell_sizes.
|
inline |
References m_cell_sizes.
Referenced by text_art::table::paint_cell_borders_to_canvas().
void table_geometry::recalc_coords | ( | ) |
References m_canvas_size, m_cell_sizes, m_col_start_x, and m_row_start_y.
Referenced by table_geometry().
canvas::coord_t table_geometry::table_to_canvas | ( | table::coord_t | table_coord | ) | const |
Get the TL corner of the table cell at TABLE_COORD in canvas coords (including the border).
References table_x_to_canvas_x(), table_y_to_canvas_y(), text_art::coord< CoordinateSystem >::x, and text_art::coord< CoordinateSystem >::y.
Referenced by text_art::table::paint_cell_borders_to_canvas(), and text_art::table::cell_placement::paint_cell_contents_to_canvas().
int table_geometry::table_x_to_canvas_x | ( | int | table_x | ) | const |
Get the left border of the table cell at column TABLE_X in canvas coords (including the border).
References m_canvas_size, and m_col_start_x.
Referenced by text_art::table::paint_cell_borders_to_canvas(), and table_to_canvas().
int table_geometry::table_y_to_canvas_y | ( | int | table_y | ) | const |
Get the top border of the table cell at column TABLE_Y in canvas coords (including the border).
References m_canvas_size, and m_row_start_y.
Referenced by text_art::table::paint_cell_borders_to_canvas(), and table_to_canvas().
|
private |
Referenced by get_canvas_size(), recalc_coords(), table_geometry(), table_x_to_canvas_x(), and table_y_to_canvas_y().
|
private |
Referenced by get_canvas_size(), get_col_width(), recalc_coords(), and table_geometry().
|
private |
Referenced by recalc_coords(), table_geometry(), and table_x_to_canvas_x().
|
private |
Referenced by recalc_coords(), table_geometry(), and table_y_to_canvas_y().