GCC Middle and Back End API Reference
text_art Namespace Reference

Data Structures

class  array2
class  ascii_theme
class  canvas
class  canvas_widget
class  container_widget
struct  coord
struct  directions
struct  dump_widget_info
class  emoji_theme
class  leaf_widget
struct  range
struct  rect
struct  simple_table_geometry
struct  size
struct  style
class  style_manager
class  styled_string
class  styled_unichar
class  table
class  table_cell_content
class  table_cell_sizes
struct  table_dimension_sizes
class  table_geometry
class  text_widget
class  theme
class  tree_widget
class  unicode_theme
class  vbox_widget
class  widget
class  wrapper_widget
class  x_ruler

Enumerations

enum class  x_align { LEFT , CENTER , RIGHT }
enum class  y_align { TOP , CENTER , BOTTOM }

Functions

cppchar_t get_box_drawing_char (directions line_dirs)
template<typename T>
void dump_to_pp (const T &obj, text_art::theme *theme, pretty_printer *pp)
template<typename T>
void dump_to_file (const T &obj, FILE *outf)
template<typename T>
void dump (const T &obj)
template<typename CoordinateSystem>
coord< CoordinateSystem > operator+ (coord< CoordinateSystem > a, coord< CoordinateSystem > b)
template<typename CoordinateSystem>
rect< CoordinateSystem > operator+ (rect< CoordinateSystem > r, coord< CoordinateSystem > offset)
style get_style_from_color_cap_name (const char *name)

Detailed Description

Support for diagrams within diagnostics.
   Copyright (C) 2023-2025 Free Software Foundation, Inc.
   Contributed by David Malcolm <dmalcolm@redhat.com>

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
Procedural lookup of box drawing characters.
   Copyright (C) 2023-2025 Free Software Foundation, Inc.
   Contributed by David Malcolm <dmalcolm@redhat.com>.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

GCC is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
Canvas for random-access procedural text art.
   Copyright (C) 2023-2025 Free Software Foundation, Inc.
   Contributed by David Malcolm <dmalcolm@redhat.com>.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

GCC is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
Support for creating dump widgets.
   Copyright (C) 2024-2025 Free Software Foundation, Inc.
   Contributed by David Malcolm <dmalcolm@redhat.com>.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

GCC is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
Templates for dumping objects.
   Copyright (C) 2024-2025 Free Software Foundation, Inc.
   Contributed by David Malcolm <dmalcolm@redhat.com>.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

GCC is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
A family of templates for dumping objects via the text_art::widget
system.
Any type T that has a make_dump_widget member function ought to be
dumpable via these functions.   
Classes for printing labelled rulers.
   Copyright (C) 2023-2025 Free Software Foundation, Inc.
   Contributed by David Malcolm <dmalcolm@redhat.com>.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

GCC is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
Support for tabular/grid-based content.
   Copyright (C) 2023-2025 Free Software Foundation, Inc.
   Contributed by David Malcolm <dmalcolm@redhat.com>.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

GCC is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
Classes for abstracting ascii vs unicode output.
   Copyright (C) 2023-2025 Free Software Foundation, Inc.
   Contributed by David Malcolm <dmalcolm@redhat.com>.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

GCC is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
Tree diagrams.
   Copyright (C) 2024-2025 Free Software Foundation, Inc.
   Contributed by David Malcolm <dmalcolm@redhat.com>.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

GCC is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
Types for drawing 2d "text art".
   Copyright (C) 2023-2025 Free Software Foundation, Inc.
   Contributed by David Malcolm <dmalcolm@redhat.com>.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

GCC is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
This header uses std::vector, but <vector> can't be directly
included due to issues with macros.  Hence it must be included from
system.h by defining INCLUDE_VECTOR in any source file using it.   
Hierarchical diagram elements.
   Copyright (C) 2023-2025 Free Software Foundation, Inc.
   Contributed by David Malcolm <dmalcolm@redhat.com>.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

GCC is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   

Enumeration Type Documentation

◆ x_align

enum class text_art::x_align
strong
Enumerator
LEFT 
CENTER 
RIGHT 

◆ y_align

enum class text_art::y_align
strong
Enumerator
TOP 
CENTER 
BOTTOM 

Function Documentation

◆ dump()

template<typename T>
void text_art::dump ( const T & obj)
Dump OBJ to stderr, using OBJ's make_dump_widget member function.   

References dump_to_file(), and T.

◆ dump_to_file()

template<typename T>
void text_art::dump_to_file ( const T & obj,
FILE * outf )
Dump OBJ to OUTF, using OBJ's make_dump_widget member function.   

References dump_to_pp(), global_dc, and T.

Referenced by dump().

◆ dump_to_pp()

template<typename T>
void text_art::dump_to_pp ( const T & obj,
text_art::theme * theme,
pretty_printer * pp )
Dump OBJ to PP, using OBJ's make_dump_widget member function.   

References text_art::style_manager::get_or_create_id(), get_style_from_color_cap_name(), text_art::dump_widget_info::m_sm, and T.

Referenced by dump_to_file().

◆ get_box_drawing_char()

cppchar_t text_art::get_box_drawing_char ( directions line_dirs)
extern

◆ get_style_from_color_cap_name()

style text_art::get_style_from_color_cap_name ( const char * name)
extern
Look up the current SGR codes for a color capability NAME
(from GCC_COLORS or the defaults), and convert them to
a text_art::style.   

References colorize_start(), gcc_assert, text_art::style_manager::get_num_styles(), and text_art::style_manager::get_style().

Referenced by dump_to_pp().

◆ operator+() [1/2]

template<typename CoordinateSystem>
coord< CoordinateSystem > text_art::operator+ ( coord< CoordinateSystem > a,
coord< CoordinateSystem > b )

References a, and b.

◆ operator+() [2/2]

template<typename CoordinateSystem>
rect< CoordinateSystem > text_art::operator+ ( rect< CoordinateSystem > r,
coord< CoordinateSystem > offset )

References r.