From 539ac4c21412e5985f7616022874db30d080add4 Mon Sep 17 00:00:00 2001
From: jean-pierre charras <jp.charras@wanadoo.fr>
Date: Sun, 18 Oct 2020 20:24:20 +0200
Subject: [PATCH] Remove a few include<wx/wx.h> in many files that do not
 actually use this include.

---
 .../3d_render_raytracing/shapes2D/cbbox2d.cpp |  1 -
 .../shapes2D/cpolygon2d.cpp                   |  1 -
 .../shapes3D/cbbox_ray.cpp                    |  1 -
 common/eda_size_ctrl.cpp                      |  2 +-
 common/page_layout/ws_data_model_io.cpp       |  1 +
 common/page_layout/ws_painter.cpp             |  2 ++
 common/scintilla_tricks.cpp                   |  1 -
 eeschema/dialogs/dialog_bom.cpp               |  3 ++
 eeschema/dialogs/dialog_bus_manager.cpp       |  4 +++
 eeschema/dialogs/dialog_pin_properties.h      |  3 ++
 eeschema/dialogs/dialog_plot_schematic.cpp    |  3 ++
 eeschema/dialogs/dialog_rescue_each.cpp       |  3 ++
 eeschema/eeschema.cpp                         |  2 --
 .../dialogs/dialog_layers_select_to_pcb.cpp   |  2 ++
 .../dialogs/dialog_select_one_pcb_layer.cpp   |  4 ++-
 gerbview/gerber_draw_item.cpp                 |  2 ++
 include/fctsys.h                              | 31 -------------------
 include/page_info.h                           |  2 +-
 .../dialogs/dialogs_for_printing.cpp          |  2 ++
 qa/eeschema/mocks_eeschema.cpp                |  2 ++
 qa/qa_utils/test_app_main.cpp                 |  1 -
 21 files changed, 32 insertions(+), 41 deletions(-)
 delete mode 100644 include/fctsys.h

diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cbbox2d.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cbbox2d.cpp
index 2d32fa42e0..44c670b868 100644
--- a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cbbox2d.cpp
+++ b/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cbbox2d.cpp
@@ -30,7 +30,6 @@
 #include "3d_fastmath.h"
 
 #include "cbbox2d.h"
-#include <fctsys.h>
 #include <wx/debug.h>
 
 
diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cpolygon2d.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cpolygon2d.cpp
index f4e4b982cb..0e308d5911 100644
--- a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cpolygon2d.cpp
+++ b/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cpolygon2d.cpp
@@ -29,7 +29,6 @@
 
 #include "cpolygon2d.h"
 #include <wx/debug.h>
-#include <fctsys.h>
 
 #ifdef PRINT_STATISTICS_3D_VIEWER
 #include <stdio.h>
diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cbbox_ray.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cbbox_ray.cpp
index ab9d2d077e..ddaa303e2a 100644
--- a/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cbbox_ray.cpp
+++ b/3d-viewer/3d_rendering/3d_render_raytracing/shapes3D/cbbox_ray.cpp
@@ -28,7 +28,6 @@
  */
 
 #include "cbbox.h"
-#include <fctsys.h>
 #include <wx/debug.h>
 
 // This BBOX Ray intersection test have the following credits:
diff --git a/common/eda_size_ctrl.cpp b/common/eda_size_ctrl.cpp
index cc39a08527..42e32b32a2 100644
--- a/common/eda_size_ctrl.cpp
+++ b/common/eda_size_ctrl.cpp
@@ -21,7 +21,7 @@
  * or you may write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
  */
-//#include <fctsys.h>
+
 #include <eda_base_frame.h>
 #include <dialog_helpers.h>
 #include <base_units.h>
diff --git a/common/page_layout/ws_data_model_io.cpp b/common/page_layout/ws_data_model_io.cpp
index 0d1eb6038f..e74ca2bd95 100644
--- a/common/page_layout/ws_data_model_io.cpp
+++ b/common/page_layout/ws_data_model_io.cpp
@@ -39,6 +39,7 @@
 #include <page_layout/page_layout_reader_lexer.h>
 #include <convert_to_biu.h>
 
+#include <wx/msgdlg.h>
 
 using namespace TB_READER_T;
 
diff --git a/common/page_layout/ws_painter.cpp b/common/page_layout/ws_painter.cpp
index 6e2397f523..9b3b44e376 100644
--- a/common/page_layout/ws_painter.cpp
+++ b/common/page_layout/ws_painter.cpp
@@ -35,6 +35,8 @@
 #include <page_layout/ws_painter.h>
 #include <page_layout/ws_data_item.h>
 
+#include <wx/app.h>
+
 using namespace KIGFX;
 
 static const wxString productName = wxT( "KiCad E.D.A.  " );
diff --git a/common/scintilla_tricks.cpp b/common/scintilla_tricks.cpp
index cb0ac2b7cc..d0cbb6e3a3 100644
--- a/common/scintilla_tricks.cpp
+++ b/common/scintilla_tricks.cpp
@@ -22,7 +22,6 @@
  */
 
 
-#include <fctsys.h>
 #include <kicad_string.h>
 #include <scintilla_tricks.h>
 #include <wx/stc/stc.h>
diff --git a/eeschema/dialogs/dialog_bom.cpp b/eeschema/dialogs/dialog_bom.cpp
index f8d09598db..3e4a89d344 100644
--- a/eeschema/dialogs/dialog_bom.cpp
+++ b/eeschema/dialogs/dialog_bom.cpp
@@ -47,6 +47,9 @@
 
 #include <dialogs/dialog_bom_cfg_lexer.h>
 
+#include <wx/filedlg.h>
+#include <wx/textdlg.h>
+
 static constexpr wxChar BOM_TRACE[] = wxT( "BOM_GENERATORS" );
 
 wxString s_bomHelpInfo =
diff --git a/eeschema/dialogs/dialog_bus_manager.cpp b/eeschema/dialogs/dialog_bus_manager.cpp
index bc43639e22..6cf01b5dd3 100644
--- a/eeschema/dialogs/dialog_bus_manager.cpp
+++ b/eeschema/dialogs/dialog_bus_manager.cpp
@@ -26,6 +26,10 @@
 
 #include "dialog_bus_manager.h"
 
+#include <wx/button.h>
+#include <wx/valtext.h>
+
+
 
 BEGIN_EVENT_TABLE( DIALOG_BUS_MANAGER, DIALOG_SHIM )
     EVT_BUTTON( wxID_OK, DIALOG_BUS_MANAGER::OnOkClick )
diff --git a/eeschema/dialogs/dialog_pin_properties.h b/eeschema/dialogs/dialog_pin_properties.h
index 8713952d24..6e4c3a8ab3 100644
--- a/eeschema/dialogs/dialog_pin_properties.h
+++ b/eeschema/dialogs/dialog_pin_properties.h
@@ -26,6 +26,9 @@
 #define __dialog_lib_edit_pin__
 
 #include <wx/bmpcbox.h>
+#include <wx/msgdlg.h>
+#include <wx/dcclient.h>
+
 #include <pin_shape_combobox.h>
 #include <pin_type_combobox.h>
 
diff --git a/eeschema/dialogs/dialog_plot_schematic.cpp b/eeschema/dialogs/dialog_plot_schematic.cpp
index 87007c34d4..cf60504124 100644
--- a/eeschema/dialogs/dialog_plot_schematic.cpp
+++ b/eeschema/dialogs/dialog_plot_schematic.cpp
@@ -34,6 +34,9 @@
 #include <sch_painter.h>
 #include <schematic.h>
 
+#include <wx/dirdlg.h>
+#include <wx/msgdlg.h>
+
 // static members (static to remember last state):
 int DIALOG_PLOT_SCHEMATIC::m_pageSizeSelect = PAGE_SIZE_AUTO;
 int DIALOG_PLOT_SCHEMATIC::m_HPGLPaperSizeSelect = PAGE_SIZE_AUTO;
diff --git a/eeschema/dialogs/dialog_rescue_each.cpp b/eeschema/dialogs/dialog_rescue_each.cpp
index 2997724f85..b19b7921e8 100644
--- a/eeschema/dialogs/dialog_rescue_each.cpp
+++ b/eeschema/dialogs/dialog_rescue_each.cpp
@@ -35,6 +35,9 @@
 #include <symbol_preview_widget.h>
 #include <vector>
 
+#include <wx/msgdlg.h>
+#include <wx/dcclient.h>
+
 
 class DIALOG_RESCUE_EACH: public DIALOG_RESCUE_EACH_BASE
 {
diff --git a/eeschema/eeschema.cpp b/eeschema/eeschema.cpp
index 21b88900ab..4a2202e61d 100644
--- a/eeschema/eeschema.cpp
+++ b/eeschema/eeschema.cpp
@@ -23,8 +23,6 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
  */
 
-#include <fctsys.h>
-
 #include <pgm_base.h>
 #include <kiface_i.h>
 #include <confirm.h>
diff --git a/gerbview/dialogs/dialog_layers_select_to_pcb.cpp b/gerbview/dialogs/dialog_layers_select_to_pcb.cpp
index 269a7cc823..7babd56dfe 100644
--- a/gerbview/dialogs/dialog_layers_select_to_pcb.cpp
+++ b/gerbview/dialogs/dialog_layers_select_to_pcb.cpp
@@ -38,6 +38,8 @@
 
 #include <dialogs/dialog_layers_select_to_pcb.h>
 
+#include <wx/msgdlg.h>
+
 // Imported function
 extern const wxString GetPCBDefaultLayerName( LAYER_NUM aLayerNumber );
 
diff --git a/gerbview/dialogs/dialog_select_one_pcb_layer.cpp b/gerbview/dialogs/dialog_select_one_pcb_layer.cpp
index 7448d932c7..f37b5c2875 100644
--- a/gerbview/dialogs/dialog_select_one_pcb_layer.cpp
+++ b/gerbview/dialogs/dialog_select_one_pcb_layer.cpp
@@ -2,7 +2,7 @@
  * This program source code file is part of KiCad, a free EDA CAD application.
  *
  * Copyright (C) 2012-2014 Jean-Pierre Charras  jp.charras at wanadoo.fr
- * Copyright (C) 1992-2020 KiCad Developers, see change_log.txt for contributors.
+ * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -30,6 +30,8 @@
 #include <gerbview_frame.h>
 #include <dialogs/dialog_layers_select_to_pcb.h>
 
+#include <wx/radiobox.h>
+
 #define NB_PCB_LAYERS PCB_LAYER_ID_COUNT
 #define FIRST_COPPER_LAYER 0
 #define LAST_COPPER_LAYER 31
diff --git a/gerbview/gerber_draw_item.cpp b/gerbview/gerber_draw_item.cpp
index cebc35d539..72a7a914c8 100644
--- a/gerbview/gerber_draw_item.cpp
+++ b/gerbview/gerber_draw_item.cpp
@@ -34,6 +34,8 @@
 #include <geometry/shape_arc.h>
 #include <math/util.h>      // for KiROUND
 
+#include <wx/msgdlg.h>
+
 GERBER_DRAW_ITEM::GERBER_DRAW_ITEM( GERBER_FILE_IMAGE* aGerberImageFile ) :
     EDA_ITEM( (EDA_ITEM*)NULL, GERBER_DRAW_ITEM_T )
 {
diff --git a/include/fctsys.h b/include/fctsys.h
deleted file mode 100644
index e83da61664..0000000000
--- a/include/fctsys.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * This program source code file is part of KiCad, a free EDA CAD application.
- *
- * Copyright (C) 2007-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
- * Copyright (C) 1992-2014 KiCad Developers, see CHANGELOG.TXT for contributors.
- *
- * This program 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 2
- * of the License, or (at your option) any later version.
- *
- * This program 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 this program; if not, you may find one here:
- * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
- * or you may search the http://www.gnu.org website for the version 2 license,
- * or you may write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
- */
-
-#ifndef FCTSYS_H_
-#define FCTSYS_H_
-
-#include <wx/wx.h>
-#include <config.h>
-
-#endif // FCTSYS_H__
diff --git a/include/page_info.h b/include/page_info.h
index f0417823d8..d573d35b79 100644
--- a/include/page_info.h
+++ b/include/page_info.h
@@ -30,7 +30,7 @@
 #ifndef PAGE_INFO_H
 #define PAGE_INFO_H
 
-#include <wx/wx.h>
+#include <wx/string.h>
 
 #include <richio.h>         // for OUTPUTFORMATTER and IO_ERROR
 #include <base_units.h>     // for IU_PER_MILS
diff --git a/pagelayout_editor/dialogs/dialogs_for_printing.cpp b/pagelayout_editor/dialogs/dialogs_for_printing.cpp
index 6040d21dbd..559ea000b4 100644
--- a/pagelayout_editor/dialogs/dialogs_for_printing.cpp
+++ b/pagelayout_editor/dialogs/dialogs_for_printing.cpp
@@ -40,6 +40,8 @@
 #include "pl_editor_frame.h"
 #include "pl_editor_id.h"
 
+#include <wx/msgdlg.h>
+
 /**
  * Custom print out for printing schematics.
  */
diff --git a/qa/eeschema/mocks_eeschema.cpp b/qa/eeschema/mocks_eeschema.cpp
index 792c2b7cc9..1823192232 100644
--- a/qa/eeschema/mocks_eeschema.cpp
+++ b/qa/eeschema/mocks_eeschema.cpp
@@ -28,6 +28,8 @@
 #include <sch_edit_frame.h>
 #include <settings/settings_manager.h>
 
+#include <wx/app.h>
+
 
 // a transform matrix, to display components in lib editor
 TRANSFORM DefaultTransform = TRANSFORM( 1, 0, 0, -1 );
diff --git a/qa/qa_utils/test_app_main.cpp b/qa/qa_utils/test_app_main.cpp
index 3b96317eaf..dcf2292341 100644
--- a/qa/qa_utils/test_app_main.cpp
+++ b/qa/qa_utils/test_app_main.cpp
@@ -36,7 +36,6 @@
 
 #include <typeinfo>
 #include <macros.h>
-#include <fctsys.h>
 #include <wx/filename.h>
 #include <wx/stdpaths.h>
 #include <wx/snglinst.h>