Strip richio.h from headers that don't need them

Like the DSNLEXER header, this has visibility in over 700
files, whereas well under half actually use any of it
(quite a bit, but not all, of it actually via DSNLEXER)

Many places already forward-declare the OUTPUTFORMATTER type,
by doing that for the others, it still possible to use the
non-IO methods without having to see richio.h.
This commit is contained in:
John Beard
2024-10-04 18:06:18 +01:00
parent df5fe44839
commit 3d6d8b9946
43 changed files with 123 additions and 52 deletions
+4 -1
View File
@@ -23,9 +23,12 @@
*/
#include <xnode.h>
#include "xnode.h"
#include <richio.h>
#include <string_utils.h>
typedef wxXmlAttribute XATTR;
+1
View File
@@ -34,6 +34,7 @@
#include <netlist_exporters/netlist_exporter_kicad.h>
#include <project/project_file.h>
#include <project/net_settings.h>
#include <richio.h>
#include <tools/ee_actions.h>
#include <tools/sch_editor_control.h>
#include <advanced_config.h>
@@ -22,6 +22,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "panel_template_fieldnames.h"
#include <wx/msgdlg.h>
#include <pgm_base.h>
@@ -31,8 +33,8 @@
#include <template_fieldnames.h>
#include <grid_tricks.h>
#include <bitmaps.h>
#include <richio.h>
#include <string_utils.h>
#include <panel_template_fieldnames.h>
PANEL_TEMPLATE_FIELDNAMES::PANEL_TEMPLATE_FIELDNAMES( wxWindow* aWindow,
TEMPLATES* aProjectTemplateMgr ) :
@@ -23,13 +23,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "netlist_exporter_kicad.h"
#include <algorithm>
#include <confirm.h>
#include <xnode.h>
#include <connection_graph.h>
#include "netlist_exporter_kicad.h"
#include <richio.h>
#include <xnode.h>
bool NETLIST_EXPORTER_KICAD::WriteNetlist( const wxString& aOutFileName, unsigned aNetlistOptions,
@@ -32,6 +32,7 @@
#include <confirm.h>
#include <pgm_base.h>
#include <env_paths.h>
#include <richio.h>
#include <sim/sim_library_ibis.h>
#include <sim/sim_xspice_parser.h>
#include <sch_screen.h>
@@ -488,7 +489,7 @@ void NETLIST_EXPORTER_SPICE::getNodePattern( SPICE_ITEM& aItem,
std::vector<std::string>& aModifiers )
{
std::string input = SIM_MODEL::GetFieldValue( &aItem.fields, SIM_NODES_FORMAT_FIELD, true );
if( input == "" )
return;
@@ -23,8 +23,11 @@
*/
#include "netlist_exporter_spice_model.h"
#include <sch_screen.h>
#include <string_utils.h>
#include <project.h>
#include <richio.h>
void NETLIST_EXPORTER_SPICE_MODEL::WriteHead( OUTPUTFORMATTER& aFormatter,
@@ -33,6 +33,7 @@
#include <confirm.h>
#include <kiway.h>
#include <erc/erc.h>
#include <richio.h>
#include <netlist.h>
#include <netlist_exporter_base.h>
@@ -23,7 +23,8 @@
* @brief Loads the asc file and asy files.
*/
#include <sch_io/ltspice/ltspice_schematic.h>
#include "sch_io/ltspice/ltspice_schematic.h"
#include <sch_io/ltspice/sch_io_ltspice_parser.h>
#include <sch_screen.h>
#include <wx/log.h>
@@ -31,6 +32,8 @@
#include <wildcards_and_files_ext.h>
#include <sch_sheet.h>
#include <schematic.h>
#include <project.h>
#include <richio.h>
void LTSPICE_SCHEMATIC::Load( SCHEMATIC* aSchematic, SCH_SHEET* aRootSheet,
+1
View File
@@ -30,6 +30,7 @@
#include <locale_io.h>
#include <fmt/core.h>
#include <paths.h>
#include <richio.h>
#include "spice_circuit_model.h"
#include "ngspice.h"
+5 -1
View File
@@ -22,11 +22,15 @@
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <ki_exception.h>
#include <lib_symbol.h>
#include <sch_symbol.h>
#include <string_utils.h>
#include <wx/regex.h>
#include <iterator>
#include <sim/sim_model.h>
#include <sim/sim_model_behavioral.h>
#include <sim/sim_model_ideal.h>
@@ -47,7 +51,7 @@
#include <fmt/core.h>
#include <pegtl/contrib/parse_tree.hpp>
#include <iterator>
#include "sim_model_spice_fallback.h"
using TYPE = SIM_MODEL::TYPE;
+2 -1
View File
@@ -22,10 +22,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <sim/sim_model_ngspice.h>
#include "sim/sim_model_ngspice.h"
#include <boost/algorithm/string.hpp>
#include <fmt/core.h>
#include <ki_exception.h>
std::vector<std::string> SPICE_GENERATOR_NGSPICE::CurrentNames( const SPICE_ITEM& aItem ) const
+3 -1
View File
@@ -22,7 +22,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <sim/sim_model_serializer.h>
#include "sim/sim_model_serializer.h"
#include <ki_exception.h>
#include <fmt/core.h>
#include <pegtl.hpp>
#include <pegtl/contrib/parse_tree.hpp>
+1
View File
@@ -29,6 +29,7 @@
#include <sim/sim_library_spice.h>
#include <boost/algorithm/string/trim.hpp>
#include <ki_exception.h>
std::string SPICE_GENERATOR_SPICE::Preview( const SPICE_ITEM& aItem ) const
+3 -1
View File
@@ -21,7 +21,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <sim/sim_model_spice_fallback.h>
#include "sim/sim_model_spice_fallback.h"
#include <ki_exception.h>
#include <fmt/format.h>
+3 -2
View File
@@ -22,12 +22,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <sim/sim_model_subckt.h>
#include <sim/spice_grammar.h>
#include "sim/sim_model_subckt.h"
#include <ki_exception.h>
#include <fmt/core.h>
#include <pegtl.hpp>
#include <pegtl/contrib/parse_tree.hpp>
#include <sim/spice_grammar.h>
namespace SIM_MODEL_SUBCKT_SPICE_PARSER
+4 -2
View File
@@ -24,11 +24,13 @@
*/
#include "spice_circuit_model.h"
#include <string_utils.h>
#include <wx/regex.h>
#include <wx/tokenzr.h>
#include <locale_io.h>
#include <locale_io.h>
#include <richio.h>
#include <string_utils.h>
SIM_TRACE_TYPE SPICE_CIRCUIT_MODEL::VectorToSignal( const std::string& aVector,
wxString& aSignal ) const
+7 -4
View File
@@ -22,16 +22,19 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <sim/spice_library_parser.h>
#include "sim/spice_library_parser.h"
#include <utility>
#include <core/thread_pool.h>
#include <ki_exception.h>
#include <sim/sim_library_spice.h>
#include <sim/spice_grammar.h>
#include <sim/sim_model_spice.h>
#include <ki_exception.h>
#include <richio.h>
#include <pegtl.hpp>
#include <pegtl/contrib/parse_tree.hpp>
#include <utility>
#include <core/thread_pool.h>
namespace SIM_LIBRARY_SPICE_PARSER
+2
View File
@@ -23,6 +23,8 @@
*/
#include <wx/log.h>
#include <ki_exception.h>
#include <sim/spice_model_parser.h>
#include <sim/spice_grammar.h>
#include <sim/sim_model_spice.h>
+4 -1
View File
@@ -20,6 +20,9 @@
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "tools/simulator_control.h"
#define wxUSE_BASE64 1
#include <wx/base64.h>
@@ -38,13 +41,13 @@
#include <sim/sim_plot_tab.h>
#include <tool/tool_manager.h>
#include <tools/ee_actions.h>
#include <tools/simulator_control.h>
#include <scintilla_tricks.h>
#include <sim/spice_circuit_model.h>
#include <dialogs/dialog_user_defined_signals.h>
#include <wx/clipbrd.h>
#include <wx/dataobj.h>
#include <wx/mstream.h>
#include <richio.h>
#include <string_utils.h>
+3 -1
View File
@@ -22,6 +22,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "symbol_editor_edit_tool.h"
#include <tool/picker_tool.h>
#include <tools/ee_selection_tool.h>
#include <tools/symbol_editor_pin_tool.h>
@@ -38,9 +40,9 @@
#include <dialogs/dialog_lib_edit_pin_table.h>
#include <dialogs/dialog_update_symbol_fields.h>
#include <view/view_controls.h>
#include <richio.h>
#include <sch_io/kicad_sexpr/sch_io_kicad_sexpr.h>
#include <sch_textbox.h>
#include "symbol_editor_edit_tool.h"
#include <wx/textdlg.h> // for wxTextEntryDialog
#include <math/util.h> // for KiROUND
+3 -4
View File
@@ -22,12 +22,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef SYMBOL_EDITOR_EDIT_TOOL_H
#define SYMBOL_EDITOR_EDIT_TOOL_H
#pragma once
#include <tools/ee_tool_base.h>
class SCH_PIN;
class SCH_SHAPE;
class SYMBOL_EDIT_FRAME;
@@ -77,5 +78,3 @@ private:
EDA_ITEM* m_pickerItem;
};
#endif // SYMBOL_EDITOR_EDIT_TOOL_H
+1
View File
@@ -25,6 +25,7 @@
*/
#include <ki_exception.h>
#include <sim/simulator_frame_ui.h>
#include <sim/simulator_frame.h>
#include <sch_symbol.h>
+2 -1
View File
@@ -26,9 +26,10 @@
#include <mmh3_hash.h>
#include <picosha2.h>
#include <richio.h>
#include <wildcards_and_files_ext.h>
class OUTPUTFORMATTER;
class EMBEDDED_FILES
{
public:
+2 -1
View File
@@ -24,8 +24,9 @@
#pragma once
#include <richio.h>
#include <wx/string.h>
class OUTPUTFORMATTER;
class TEMPLATE_FIELDNAMES_LEXER;
+1 -2
View File
@@ -25,8 +25,6 @@
#ifndef XNODE_H_
#define XNODE_H_
#include <richio.h>
// quiet the deprecated warnings with 3 lines:
#include <wx/defs.h>
#undef wxDEPRECATED
@@ -34,6 +32,7 @@
#include <wx/xml/xml.h>
class OUTPUTFORMATTER;
/**
* Hold an XML or S-expression element.
@@ -27,6 +27,7 @@
#include <board.h>
#include <i18n_utility.h> // For _HKI definition
#include "stackup_predefined_prms.h"
#include <richio.h>
#include <google/protobuf/any.pb.h>
#include <api/board/board.pb.h>
#include <api/api_enums.h>
@@ -48,6 +48,7 @@
#include <locale_io.h>
#include <eda_list_dialog.h>
#include <richio.h>
#include <string_utils.h> // for UIDouble2Str()
+1
View File
@@ -49,6 +49,7 @@
#include <pcb_edit_frame.h>
#include <pcbnew_settings.h>
#include <render_settings.h>
#include <richio.h>
#include <tool/tool_manager.h>
#include <tools/pcb_actions.h>
#include <tools/pcb_selection_tool.h>
+3 -1
View File
@@ -23,18 +23,20 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "dialog_board_reannotate.h"
#include <algorithm>
#include <base_units.h>
#include <bitmaps.h>
#include <board_commit.h>
#include <confirm.h>
#include <ctype.h>
#include <dialog_board_reannotate.h>
#include <gal/graphics_abstraction_layer.h>
#include <string_utils.h> // StrNumCmp
#include <kiface_base.h>
#include <pcbnew_settings.h>
#include <refdes_utils.h>
#include <richio.h>
#include <tool/grid_menu.h>
#include <widgets/wx_html_report_panel.h>
#include <wx/valtext.h>
@@ -25,6 +25,7 @@
#include <footprint.h>
#include <pad.h>
#include <pcb_track.h>
#include <richio.h>
#include <locale_io.h>
#include <macros.h>
#include <hash_eda.h>
+1
View File
@@ -37,6 +37,7 @@
#include <ki_exception.h>
#include <locale_io.h>
#include <reporter.h>
#include <richio.h>
#include <exporters/board_exporter_base.h>
#include <wx/log.h>
@@ -28,6 +28,7 @@
#include <eda_item.h>
#include <font/font.h>
#include <confirm.h>
#include <richio.h>
#include <string_utils.h>
#include <locale_io.h>
#include <macros.h>
@@ -29,6 +29,7 @@
#include <pcb_track.h>
#include <collectors.h>
#include <reporter.h>
#include <richio.h>
#include <gendrill_file_writer_base.h>
+11
View File
@@ -30,6 +30,7 @@
#include <string_utils.h>
#include <reporter.h>
#include <richio.h>
#include "pcb_netlist.h"
#include "netlist_reader.h"
@@ -112,6 +113,16 @@ NETLIST_READER* NETLIST_READER::GetNetlistReader( NETLIST* aNetlist,
}
CMP_READER::~CMP_READER()
{
if( m_lineReader )
{
delete m_lineReader;
m_lineReader = nullptr;
}
}
bool CMP_READER::Load( NETLIST* aNetlist )
{
wxCHECK_MSG( aNetlist != nullptr, true, wxT( "No netlist passed to CMP_READER::Load()" ) );
+3 -9
View File
@@ -31,8 +31,9 @@
#include <lib_id.h>
class NETLIST;
class COMPONENT;
class NETLIST;
class LINE_READER;
/**
@@ -51,14 +52,7 @@ public:
m_lineReader = aLineReader;
}
~CMP_READER()
{
if( m_lineReader )
{
delete m_lineReader;
m_lineReader = nullptr;
}
}
~CMP_READER();
/**
* Read the *.cmp file format contains the component footprint assignments created by CvPcb
+3 -1
View File
@@ -24,9 +24,11 @@
*/
#include <string_utils.h>
#include "pcb_netlist.h"
#include <footprint.h>
#include <richio.h>
#include <string_utils.h>
int COMPONENT_NET::Format( OUTPUTFORMATTER* aOut, int aNestLevel, int aCtl )
+1
View File
@@ -26,6 +26,7 @@
#include <pcad/pcad_via.h>
#include <pcad/pcad_via_shape.h>
#include <richio.h>
#include <xnode.h>
#include <wx/string.h>
+4 -2
View File
@@ -23,12 +23,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "board_editor_control.h"
#include <functional>
#include <memory>
#include <pgm_base.h>
#include <advanced_config.h>
#include "board_editor_control.h"
#include <bitmaps.h>
#include <pcb_painter.h>
#include <board.h>
@@ -64,6 +65,7 @@
#include <tools/edit_tool.h>
#include <tools/tool_event_utils.h>
#include <tools/zone_filler_tool.h>
#include <richio.h>
#include <router/router_tool.h>
#include <view/view_controls.h>
#include <view/view_group.h>
@@ -430,7 +432,7 @@ int BOARD_EDITOR_CONTROL::ExportSpecctraDSN( const TOOL_EVENT& aEvent )
int BOARD_EDITOR_CONTROL::ExportNetlist( const TOOL_EVENT& aEvent )
{
wxCHECK( m_frame, 0 );
wxFileName fn = m_frame->Prj().GetProjectFullName();
// Use a different file extension for the board netlist so the schematic netlist file
@@ -22,12 +22,15 @@
*/
#include "eeschema_test_utils.h"
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <sch_io/sch_io.h>
#include <wildcards_and_files_ext.h>
#include <cstdlib>
#include <memory>
#include <eeschema/sch_io/sch_io.h>
#include <eeschema/sch_io/sch_io_mgr.h>
#include <eeschema/sch_screen.h>
#include <eeschema/schematic.h>
@@ -35,6 +38,21 @@
#include <eeschema/sch_rule_area.h>
KI_TEST::SCHEMATIC_TEST_FIXTURE::SCHEMATIC_TEST_FIXTURE() :
m_schematic( nullptr ),
m_pi( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD ) ),
m_manager( true )
{
}
KI_TEST::SCHEMATIC_TEST_FIXTURE::~SCHEMATIC_TEST_FIXTURE()
{
m_schematic.Reset();
m_pi.reset();
}
void KI_TEST::SCHEMATIC_TEST_FIXTURE::LoadSchematic( const wxString& aBaseName )
{
wxFileName fn = GetSchematicPath( aBaseName );
+2 -10
View File
@@ -49,17 +49,9 @@ namespace KI_TEST
class SCHEMATIC_TEST_FIXTURE
{
public:
SCHEMATIC_TEST_FIXTURE()
: m_schematic( nullptr ),
m_pi( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD ) ),
m_manager( true )
{ }
SCHEMATIC_TEST_FIXTURE();
virtual ~SCHEMATIC_TEST_FIXTURE()
{
m_schematic.Reset();
m_pi.reset();
}
~SCHEMATIC_TEST_FIXTURE();
protected:
virtual void LoadSchematic( const wxString& aRelativePath );
+1 -1
View File
@@ -26,7 +26,7 @@
#include <core/ignore.h>
#include <kiway.h>
#include <sch_io/sch_io_mgr.h>
#include <sch_io/sch_io.h>
#include "eeschema_test_utils.h"
+1
View File
@@ -22,6 +22,7 @@
#include <sch_sheet_path.h>
#include <sch_label.h>
#include <sch_io/sch_io.h>
#include <project/net_settings.h>
#include <project/project_file.h>
@@ -20,6 +20,7 @@
#include <qa_utils/wx_utils/unit_test_utils.h>
#include "eeschema_test_utils.h"
#include <sch_io/sch_io.h>
#include <sch_sheet_path.h>
#include <wildcards_and_files_ext.h>