From 4aca084ab0057c5dcc02f65b4586f8e4ff0e40d5 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 13 Feb 2026 15:54:48 -0800 Subject: [PATCH] Remove heavy includes from board.h and footprint.h PCH chain Remove component_class_manager.h and pcb_selection.h from board.h Remove collectors.h and component_class_manager.h from footprint.h --- pcbnew/autorouter/autoplace_tool.cpp | 1 + pcbnew/board.cpp | 2 ++ pcbnew/board.h | 4 ++-- pcbnew/board_commit.cpp | 1 + pcbnew/component_classes/component_class_cache_proxy.cpp | 1 + pcbnew/dialogs/dialog_rule_area_properties.cpp | 1 + pcbnew/drc/drc_engine.cpp | 1 + pcbnew/drc/drc_interactive_courtyard_clearance.cpp | 1 + pcbnew/drc/drc_rule_parser.h | 1 + pcbnew/files.cpp | 2 ++ pcbnew/footprint.cpp | 2 ++ pcbnew/footprint.h | 5 +++-- pcbnew/microwave/microwave_tool.cpp | 1 + pcbnew/netlist_reader/board_netlist_updater.cpp | 1 + pcbnew/netlist_reader/netlist.cpp | 1 + pcbnew/pcb_field.cpp | 1 + pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp | 1 + pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp | 1 + pcbnew/router/router_tool.cpp | 1 + pcbnew/tools/align_distribute_tool.cpp | 1 + pcbnew/tools/board_editor_control.cpp | 1 + pcbnew/tools/drawing_tool.h | 1 + pcbnew/tools/edit_tool.cpp | 1 + pcbnew/tools/edit_tool_move_fct.cpp | 1 + pcbnew/tools/multichannel_tool.cpp | 1 + pcbnew/tools/pad_tool.cpp | 1 + pcbnew/tools/pcb_control.cpp | 1 + pcbnew/tools/pcb_point_editor.h | 1 + pcbnew/undo_redo.cpp | 1 + 29 files changed, 35 insertions(+), 4 deletions(-) diff --git a/pcbnew/autorouter/autoplace_tool.cpp b/pcbnew/autorouter/autoplace_tool.cpp index a8bb909467..7550004105 100644 --- a/pcbnew/autorouter/autoplace_tool.cpp +++ b/pcbnew/autorouter/autoplace_tool.cpp @@ -23,6 +23,7 @@ #include +#include #include #include #include diff --git a/pcbnew/board.cpp b/pcbnew/board.cpp index 167c6d388d..32e61cdabf 100644 --- a/pcbnew/board.cpp +++ b/pcbnew/board.cpp @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/pcbnew/board.h b/pcbnew/board.h index 55b36ed27f..9ed2a2a2fa 100644 --- a/pcbnew/board.h +++ b/pcbnew/board.h @@ -27,7 +27,6 @@ #include #include -#include #include #include // for OUTLINE_ERROR_HANDLER #include @@ -38,15 +37,16 @@ #include #include #include -#include #include #include +#include #include #include class BOARD_DESIGN_SETTINGS; class BOARD_CONNECTED_ITEM; class BOARD_COMMIT; +class COMPONENT_CLASS_MANAGER; class DRC_RTREE; class PCB_BASE_FRAME; class PCB_EDIT_FRAME; diff --git a/pcbnew/board_commit.cpp b/pcbnew/board_commit.cpp index 01a27ab1b5..d48e4b050d 100644 --- a/pcbnew/board_commit.cpp +++ b/pcbnew/board_commit.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/component_classes/component_class_cache_proxy.cpp b/pcbnew/component_classes/component_class_cache_proxy.cpp index e445b01c0f..cf2370da5b 100644 --- a/pcbnew/component_classes/component_class_cache_proxy.cpp +++ b/pcbnew/component_classes/component_class_cache_proxy.cpp @@ -21,6 +21,7 @@ #include #include +#include #include const COMPONENT_CLASS* COMPONENT_CLASS_CACHE_PROXY::GetComponentClass() const diff --git a/pcbnew/dialogs/dialog_rule_area_properties.cpp b/pcbnew/dialogs/dialog_rule_area_properties.cpp index 3b9d493ef2..c8be36ae8e 100644 --- a/pcbnew/dialogs/dialog_rule_area_properties.cpp +++ b/pcbnew/dialogs/dialog_rule_area_properties.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/drc/drc_engine.cpp b/pcbnew/drc/drc_engine.cpp index 0b50f2a96a..e0478165f3 100644 --- a/pcbnew/drc/drc_engine.cpp +++ b/pcbnew/drc/drc_engine.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/drc/drc_interactive_courtyard_clearance.cpp b/pcbnew/drc/drc_interactive_courtyard_clearance.cpp index ec5ca69daa..08bbcea6e1 100644 --- a/pcbnew/drc/drc_interactive_courtyard_clearance.cpp +++ b/pcbnew/drc/drc_interactive_courtyard_clearance.cpp @@ -29,6 +29,7 @@ #include #include #include +#include void DRC_INTERACTIVE_COURTYARD_CLEARANCE::testCourtyardClearances() { diff --git a/pcbnew/drc/drc_rule_parser.h b/pcbnew/drc/drc_rule_parser.h index 4fe1b2f27a..364417e2de 100644 --- a/pcbnew/drc/drc_rule_parser.h +++ b/pcbnew/drc/drc_rule_parser.h @@ -32,6 +32,7 @@ class BOARD_ITEM; +class COMPONENT_CLASS_ASSIGNMENT_RULE; #define DRC_RULE_FILE_VERSION 20200610 diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index eea1a44bd5..60f52a4d35 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -49,6 +49,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index c61d5f810f..5200cdbdd1 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/pcbnew/footprint.h b/pcbnew/footprint.h index c559d6c6ce..fd92bcd5d7 100644 --- a/pcbnew/footprint.h +++ b/pcbnew/footprint.h @@ -27,13 +27,12 @@ #include #include +#include #include #include #include -#include -#include #include #include // ALL_LAYERS definition. #include @@ -53,6 +52,8 @@ class LINE_READER; class EDA_3D_CANVAS; class PAD; class BOARD; +class COMPONENT_CLASS; +class GENERAL_COLLECTOR; class MSG_PANEL_ITEM; class SHAPE; class REPORTER; diff --git a/pcbnew/microwave/microwave_tool.cpp b/pcbnew/microwave/microwave_tool.cpp index 8819a49c82..69d6c85abe 100644 --- a/pcbnew/microwave/microwave_tool.cpp +++ b/pcbnew/microwave/microwave_tool.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include diff --git a/pcbnew/netlist_reader/board_netlist_updater.cpp b/pcbnew/netlist_reader/board_netlist_updater.cpp index b04e429e97..1203afb2e2 100644 --- a/pcbnew/netlist_reader/board_netlist_updater.cpp +++ b/pcbnew/netlist_reader/board_netlist_updater.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/netlist_reader/netlist.cpp b/pcbnew/netlist_reader/netlist.cpp index fa1fb2afb4..42ba4af445 100644 --- a/pcbnew/netlist_reader/netlist.cpp +++ b/pcbnew/netlist_reader/netlist.cpp @@ -37,6 +37,7 @@ using namespace std::placeholders; #include #include #include +#include #include #include #include diff --git a/pcbnew/pcb_field.cpp b/pcbnew/pcb_field.cpp index 50e4eff3cf..3e3957e2a6 100644 --- a/pcbnew/pcb_field.cpp +++ b/pcbnew/pcb_field.cpp @@ -23,6 +23,7 @@ */ #include +#include #include #include #include diff --git a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp index dcdc4b13da..3320a66345 100644 --- a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp +++ b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include // for enum RECT_CHAMFER_POSITIONS definition #include diff --git a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp index 76fa44d8f6..b91dd79f46 100644 --- a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp +++ b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp @@ -38,6 +38,7 @@ #include #include +#include #include #include #include diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index be2bcacca7..ae432efdf6 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -35,6 +35,7 @@ using namespace std::placeholders; #include #include #include +#include #include #include #include diff --git a/pcbnew/tools/align_distribute_tool.cpp b/pcbnew/tools/align_distribute_tool.cpp index 63fec44544..3f1b7afe5c 100644 --- a/pcbnew/tools/align_distribute_tool.cpp +++ b/pcbnew/tools/align_distribute_tool.cpp @@ -32,6 +32,7 @@ #include #include +#include #include #include #include diff --git a/pcbnew/tools/board_editor_control.cpp b/pcbnew/tools/board_editor_control.cpp index 319e4be596..2e4bd62981 100644 --- a/pcbnew/tools/board_editor_control.cpp +++ b/pcbnew/tools/board_editor_control.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/tools/drawing_tool.h b/pcbnew/tools/drawing_tool.h index c8005ba329..0162191bbe 100644 --- a/pcbnew/tools/drawing_tool.h +++ b/pcbnew/tools/drawing_tool.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #include diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index ad140a7413..dab71761c2 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/tools/edit_tool_move_fct.cpp b/pcbnew/tools/edit_tool_move_fct.cpp index 9332c6ee46..72ca58af7f 100644 --- a/pcbnew/tools/edit_tool_move_fct.cpp +++ b/pcbnew/tools/edit_tool_move_fct.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/tools/multichannel_tool.cpp b/pcbnew/tools/multichannel_tool.cpp index dcd9736130..0d6a309800 100644 --- a/pcbnew/tools/multichannel_tool.cpp +++ b/pcbnew/tools/multichannel_tool.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include diff --git a/pcbnew/tools/pad_tool.cpp b/pcbnew/tools/pad_tool.cpp index b2c9c15696..0940677d94 100644 --- a/pcbnew/tools/pad_tool.cpp +++ b/pcbnew/tools/pad_tool.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/tools/pcb_control.cpp b/pcbnew/tools/pcb_control.cpp index 9f6454b4ea..7cef94eabb 100644 --- a/pcbnew/tools/pcb_control.cpp +++ b/pcbnew/tools/pcb_control.cpp @@ -27,6 +27,7 @@ #include "convert_basic_shapes_to_polygon.h" #include +#include #include #include #include diff --git a/pcbnew/tools/pcb_point_editor.h b/pcbnew/tools/pcb_point_editor.h index 87a6608490..82b64ccc5d 100644 --- a/pcbnew/tools/pcb_point_editor.h +++ b/pcbnew/tools/pcb_point_editor.h @@ -28,6 +28,7 @@ #define PCB_POINT_EDITOR_H #include +#include #include "tool/edit_points.h" #include #include diff --git a/pcbnew/undo_redo.cpp b/pcbnew/undo_redo.cpp index 83f72f5ff0..e5d8d95280 100644 --- a/pcbnew/undo_redo.cpp +++ b/pcbnew/undo_redo.cpp @@ -27,6 +27,7 @@ #include using namespace std::placeholders; +#include #include #include #include