Include optimization: move some things from common.h to point-of-use

This commit is contained in:
Jon Evans 2021-03-20 11:35:37 -04:00
parent 80cb1db2e6
commit c04e19f9ac
92 changed files with 258 additions and 195 deletions

View File

@ -24,14 +24,11 @@
#define GLM_FORCE_RADIANS
#include <fstream>
#include <iostream>
#include <iterator>
#include <mutex>
#include <sstream>
#include <utility>
#include <wx/datetime.h>
#include <wx/dir.h>
#include <wx/filename.h>
#include <wx/log.h>
#include <wx/stdpaths.h>
@ -44,9 +41,6 @@
#include <boost/uuid/sha1.hpp>
#endif
#include <glm/glm.hpp>
#include <glm/ext.hpp>
#include "3d_cache.h"
#include "3d_info.h"
#include "3d_plugin_manager.h"

View File

@ -37,6 +37,7 @@
#include <gl_context_mgr.h>
#include <profile.h> // To use GetRunningMicroSecs or another profiling utility
#include <bitmaps.h>
#include <macros.h>
#include <menus_helpers.h>
#include <pgm_base.h>
#include <settings/settings_manager.h>

View File

@ -396,6 +396,7 @@ set( COMMON_SRCS
wildcards_and_files_ext.cpp
drawing_sheet/ds_painter.cpp
wxdataviewctrl_helpers.cpp
wx_stl_compat.cpp
wx_filename.cpp
xnode.cpp
)

View File

@ -23,11 +23,8 @@
*/
#include <bin_mod.h>
#include <common.h>
#include <filehistory.h>
#include <pgm_base.h>
#include <settings/app_settings.h>
#include <settings/common_settings.h>
#include <settings/settings_manager.h>

View File

@ -44,7 +44,6 @@
#include <eda_base_frame.h>
#include <eda_draw_frame.h>
#include <paths.h>
#include <settings/common_settings.h>
static std::unique_ptr<BITMAP_STORE> s_BitmapStore;

View File

@ -347,49 +347,6 @@ bool EnsureFileDirectoryExists( wxFileName* aTargetFullFileName,
}
// add this only if it is not in wxWidgets (for instance before 3.1.0)
#ifdef USE_KICAD_WXSTRING_HASH
size_t std::hash<wxString>::operator()( const wxString& s ) const
{
return std::hash<std::wstring>{}( s.ToStdWstring() );
}
#endif
#ifdef USE_KICAD_WXPOINT_LESS_AND_HASH
size_t std::hash<wxPoint>::operator() ( const wxPoint& k ) const
{
auto xhash = std::hash<int>()( k.x );
// 0x9e3779b9 is 2^33 / ( 1 + sqrt(5) )
// Adding this value ensures that consecutive bits of y will not be close to each other
// decreasing the likelihood of hash collision in similar values of x and y
return xhash ^ ( std::hash<int>()( k.y ) + 0x9e3779b9 + ( xhash << 6 ) + ( xhash >> 2 ) );
}
bool std::less<wxPoint>::operator()( const wxPoint& aA, const wxPoint& aB ) const
{
if( aA.x == aB.x )
return aA.y < aB.y;
return aA.x < aB.x;
}
#endif
std::ostream& operator<<( std::ostream& out, const wxSize& size )
{
out << " width=\"" << size.GetWidth() << "\" height=\"" << size.GetHeight() << "\"";
return out;
}
std::ostream& operator<<( std::ostream& out, const wxPoint& pt )
{
out << " x=\"" << pt.x << "\" y=\"" << pt.y << "\"";
return out;
}
/**
* Performance enhancements to file and directory operations.
*

View File

@ -32,6 +32,7 @@
#include <filename_resolver.h>
#include <env_vars.h>
#include <grid_tricks.h>
#include <pgm_base.h>
#include <widgets/wx_grid.h>
#include <widgets/grid_text_button_helpers.h>

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2021 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 as published by the
@ -25,6 +25,7 @@
#include <eda_item.h>
#include <gr_basic.h>
#include <kiface_i.h>
#include <macros.h>
#include <math/util.h> // for KiROUND, Clamp
#include <project.h>
#include <title_block.h>

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2007 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2021 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
@ -23,9 +23,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <dialog_helpers.h>
#include <eda_draw_frame.h>
#include <kicad_string.h>
#include <dialog_helpers.h>
#include <macros.h>
// wxWidgets spends *far* too long calcuating column widths (most of it, believe it or

View File

@ -23,6 +23,7 @@
*/
#include <common.h>
#include <pgm_base.h>
#include <base_screen.h>
#include <eda_draw_frame.h>

View File

@ -23,15 +23,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <macros.h> // FROM_UTF8()
#include <wx/stdpaths.h>
#include <kiface_i.h>
#include <pgm_base.h>
#include <kiway.h>
#include <search_stack.h>
#include <systemdirsappend.h>
#include <common.h>
/// Initialize aDst SEARCH_STACK with KIFACE (DSO) specific settings.
/// A non-member function so it an be moved easily, plus it's nobody's business.
static void setSearchPaths( SEARCH_STACK* aDst, KIWAY::FACE_T aId )

View File

@ -23,7 +23,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <common.h> // AsLegacyTimestampString, AsString
#include <kiid.h>
#include <boost/uuid/uuid_generators.hpp>

View File

@ -22,13 +22,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <memory>
#include <build_version.h>
#include <lockfile.h>
#include <wx/filename.h>
#include <wx/snglinst.h>
#include <common.h>
std::unique_ptr<wxSingleInstanceChecker> LockFile( const wxString& aFileName )
{

View File

@ -27,17 +27,20 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <trigo.h>
#include <algorithm>
#include <wx/zstream.h>
#include <wx/filename.h>
#include <wx/mstream.h>
#include <render_settings.h>
#include <wx/zstream.h>
#include <advanced_config.h>
#include <macros.h>
#include <render_settings.h>
#include <trigo.h>
#include "plotters_pslike.h"
std::string PDF_PLOTTER::encodeStringForPlotter( const wxString& aText )
{
// returns a string compatible with PDF string convention from a unicode string.

View File

@ -94,8 +94,8 @@
#include <base64.h>
#include <eda_base_frame.h>
#include <eda_rect.h>
#include <common.h>
#include <kicad_string.h>
#include <macros.h>
#include <trigo.h>
#include <cstdint>

View File

@ -22,9 +22,11 @@
* @file cadstar_archive_parser.cpp
* @brief Helper functions and common defines between schematic and PCB Archive files
*/
#include <wx/filename.h>
#include <plugins/cadstar/cadstar_archive_parser.h>
#include <eda_text.h>
#include <macros.h>
#include <trigo.h>
// Ratio derived from CADSTAR default font. See doxygen comment in cadstar_archive_parser.h

View File

@ -27,11 +27,10 @@
#include <plugins/eagle/eagle_parser.h>
#include <kicad_string.h>
#include <richio.h>
#include <functional>
#include <sstream>
#include <iomanip>
#include <cstdio>
constexpr auto DEFAULT_ALIGNMENT = ETEXT::BOTTOM_LEFT;

View File

@ -29,8 +29,8 @@
#ifndef _EAGLE_PARSER_H_
#define _EAGLE_PARSER_H_
#include <cerrno>
#include <map>
#include <memory>
#include <unordered_map>
#include <wx/xml/xml.h>
@ -38,10 +38,8 @@
#include <wx/filename.h>
#include <layers_id_colors_and_visibility.h>
#include <convert_to_biu.h>
#include <trigo.h>
#include <kicad_string.h>
#include <common.h> // needed for wxString hash template
#include <core/wx_stl_compat.h>
class FOOTPRINT;
struct EINSTANCE;

View File

@ -29,7 +29,6 @@
#include <gal/graphics_abstraction_layer.h>
#include <view/view.h>
#include <common.h>
#include <base_units.h>
#include <trigo.h>

View File

@ -25,7 +25,7 @@
#include <preview_items/draw_context.h>
#include <preview_items/preview_utils.h>
#include <view/view.h>
#include <common.h>
using namespace KIGFX::PREVIEW;
@ -94,4 +94,4 @@ void TWO_POINT_ASSISTANT::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
// place the text next to cursor, on opposite side from drawing
DrawTextNextToCursor( aView, end, origin - end, cursorStrings, aLayer == LAYER_SELECT_OVERLAY );
}
}

View File

@ -30,6 +30,7 @@
#include <kicad_string.h>
#include <kiface_ids.h>
#include <kiway.h>
#include <macros.h>
#include <pgm_base.h>
#include <project.h>
#include <project/project_file.h>

View File

@ -20,6 +20,7 @@
#include <regex>
#include <wx/debug.h>
#include <wx/dir.h>
#include <wx/filename.h>
#include <wx/stdpaths.h>
#include <wx/utils.h>
@ -36,14 +37,12 @@
#include <project/project_archiver.h>
#include <project/project_file.h>
#include <project/project_local_settings.h>
#include <settings/app_settings.h>
#include <settings/color_settings.h>
#include <settings/common_settings.h>
#include <settings/settings_manager.h>
#include <wildcards_and_files_ext.h>
/// Project settings path will be <projectname> + this
#define PROJECT_BACKUPS_DIR_SUFFIX wxT( "-backups" )

View File

@ -44,6 +44,7 @@
#include <kiway.h>
#include <pgm_base.h>
#include <kiway_player.h>
#include <macros.h>
#include <confirm.h>
#include <settings/settings_manager.h>

View File

@ -24,17 +24,15 @@
#include <bitmaps.h>
#include <build_version.h>
#include <common.h> // for SearchHelpFileFullPath
#include <tool/actions.h>
#include <tool/tool_manager.h>
#include <eda_draw_frame.h>
#include <class_draw_panel_gal.h>
#include <view/view.h>
#include <view/view_controls.h>
#include <gal/graphics_abstraction_layer.h>
#include <base_screen.h>
#include <tool/common_control.h>
#include <id.h>
#include <project.h>
#include <kiface_i.h>
#include <kicad_curl/kicad_curl_easy.h>
#include <dialogs/dialog_configure_paths.h>

View File

@ -32,7 +32,6 @@
#include <widgets/gal_options_panel.h>
#include <eda_draw_frame.h>
#include <common.h>
#include <config_map.h>

63
common/wx_stl_compat.cpp Normal file
View File

@ -0,0 +1,63 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2021 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 as published by the
* Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
*/
#include <ostream>
#include <core/wx_stl_compat.h>
// add this only if it is not in wxWidgets (for instance before 3.1.0)
#ifdef USE_KICAD_WXSTRING_HASH
size_t std::hash<wxString>::operator()( const wxString& s ) const
{
return std::hash<std::wstring>{}( s.ToStdWstring() );
}
#endif
#ifdef USE_KICAD_WXPOINT_LESS_AND_HASH
size_t std::hash<wxPoint>::operator() ( const wxPoint& k ) const
{
auto xhash = std::hash<int>()( k.x );
// 0x9e3779b9 is 2^33 / ( 1 + sqrt(5) )
// Adding this value ensures that consecutive bits of y will not be close to each other
// decreasing the likelihood of hash collision in similar values of x and y
return xhash ^ ( std::hash<int>()( k.y ) + 0x9e3779b9 + ( xhash << 6 ) + ( xhash >> 2 ) );
}
bool std::less<wxPoint>::operator()( const wxPoint& aA, const wxPoint& aB ) const
{
if( aA.x == aB.x )
return aA.y < aB.y;
return aA.x < aB.x;
}
#endif
std::ostream& operator<<( std::ostream& out, const wxSize& size )
{
out << " width=\"" << size.GetWidth() << "\" height=\"" << size.GetHeight() << "\"";
return out;
}
std::ostream& operator<<( std::ostream& out, const wxPoint& pt )
{
out << " x=\"" << pt.x << "\" y=\"" << pt.y << "\"";
return out;
}

View File

@ -28,9 +28,9 @@
#include <dialogs/html_messagebox.h>
#include <kiway.h>
#include <lib_id.h>
#include <macros.h>
#include <cvpcb_mainframe.h>
#include <listboxes.h>
#include <fp_conflict_assignment_selector.h>

View File

@ -31,8 +31,7 @@
#include <kiface_i.h>
#include <eda_base_frame.h>
#include <kicad_string.h>
#include <gestfich.h>
#include <eda_doc.h>
#include <macros.h>
#include <richio.h>
#include <config_params.h>
#include <wildcards_and_files_ext.h>

View File

@ -27,6 +27,7 @@
#include <eeschema_settings.h>
#include <layers_id_colors_and_visibility.h>
#include <symbol_editor_settings.h>
#include <macros.h>
#include <pgm_base.h>
#include <settings/common_settings.h>
#include <settings/parameters.h>

View File

@ -24,6 +24,7 @@
*/
#include "connection_graph.h"
#include <common.h> // for ExpandEnvVarSubstitutions
#include <erc.h>
#include <kicad_string.h>
#include <lib_pin.h>

View File

@ -26,6 +26,7 @@
#include "netlist_exporter_xml.h"
#include <build_version.h>
#include <common.h> // for ExpandTextVars
#include <sch_base_frame.h>
#include <class_library.h>
#include <kicad_string.h>

View File

@ -23,6 +23,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <common.h> // for ProcessExecute
#include <kicad_string.h>
#include <gestfich.h>
#include <pgm_base.h>

View File

@ -32,6 +32,7 @@
*/
#include <wx/menu.h>
#include <common.h> // for ExpandTextVars
#include <eda_item.h>
#include <gr_text.h>
#include <sch_edit_frame.h>

View File

@ -31,6 +31,7 @@
#include <lib_arc.h>
#include <lib_polyline.h>
#include <lib_text.h>
#include <macros.h>
#include <kicad_string.h>
#include <sch_bus_entry.h>
#include <sch_edit_frame.h> //COMPONENT_ORIENTATION_T

View File

@ -34,6 +34,7 @@
#include <class_library.h>
#include <plugins/eagle/eagle_parser.h>
#include <kicad_string.h>
#include <lib_arc.h>
#include <lib_circle.h>
#include <lib_id.h>

View File

@ -27,6 +27,7 @@
#include <wx/mstream.h>
#include <wx/filename.h>
#include <wx/textfile.h>
#include <wx/tokenzr.h>
#include <pgm_base.h>

View File

@ -29,6 +29,7 @@
#include <map>
#include <lib_symbol.h>
#include <macros.h>
#include <sch_sheet_path.h>
#include <sch_symbol.h>
#include <sch_text.h>

View File

@ -26,6 +26,7 @@
#include <eda_text.h>
#include <eeschema_settings.h>
#include <kiface_i.h>
#include <macros.h>
#include <schematic_settings.h>
#include <settings/parameters.h>
#include <sim/spice_settings.h>

View File

@ -20,7 +20,7 @@
#include <thread>
#include <common.h>
#include <core/wx_stl_compat.h>
#include <symbol_async_loader.h>
#include <symbol_lib_table.h>
#include <widgets/progress_reporter.h>

View File

@ -24,6 +24,7 @@
*/
#include <functional>
#include <macros.h>
#include <sch_item.h>
#include <sch_line.h>
#include <sch_painter.h>

View File

@ -31,6 +31,7 @@
#include <gerbview_settings.h>
#include <gestfich.h>
#include <kiface_i.h>
#include <macros.h>
#include <nlohmann/json.hpp>
#include <pgm_base.h>
#include <settings/settings_manager.h>

View File

@ -23,7 +23,7 @@
#include <unordered_map>
#include <vector>
#include <common.h> // Unordered map of wxString
#include <core/wx_stl_compat.h>
/**
* An asset archive represents a file containing data assets that are loaded from disk and then

View File

@ -24,17 +24,9 @@
#ifndef BIN_MOD_H_
#define BIN_MOD_H_
/// @todo Should this be a check for the wxWidgets version rather that `#if 0`.
#if 0
#include <wx/filehistory.h> // wx 3.0:
#else
#include <wx/docview.h>
#endif
#include <wx/string.h>
#include <search_stack.h>
#include <memory>
class APP_SETTINGS_BASE;

View File

@ -32,22 +32,12 @@
#ifndef INCLUDE__COMMON_H_
#define INCLUDE__COMMON_H_
#include <vector>
#include <functional>
#include <wx/confbase.h>
#include <wx/fileconf.h>
#include <wx/dir.h>
#include <wx/string.h>
#include <wx/gdicmn.h>
#include <wx/process.h>
#include <atomic>
#include <limits>
#include <memory>
#include <type_traits>
#include <typeinfo>
#include <macros.h>
#include <wx/fileconf.h>
#include <wx/string.h>
#include <wx/process.h>
class PROJECT;
class SEARCH_STACK;
@ -124,51 +114,6 @@ wxString ExpandTextVars( const wxString& aSource, const PROJECT* aProject );
*/
const wxString ResolveUriByEnvVars( const wxString& aUri, PROJECT* aProject );
// Some wxWidgets versions (for instance before 3.1.0) do not include
// this function, so add it if missing
#if !wxCHECK_VERSION( 3, 1, 0 )
#define USE_KICAD_WXSTRING_HASH // for common.cpp
///< Template specialization to enable wxStrings for certain containers (e.g. unordered_map)
namespace std
{
template<> struct hash<wxString>
{
size_t operator()( const wxString& s ) const;
};
}
#endif
/// Required to use wxPoint as key type in maps
#define USE_KICAD_WXPOINT_LESS_AND_HASH // for common.cpp
namespace std
{
template <> struct hash<wxPoint>
{
size_t operator() ( const wxPoint& k ) const;
};
}
namespace std
{
template<> struct less<wxPoint>
{
bool operator()( const wxPoint& aA, const wxPoint& aB ) const;
};
}
/**
* Helper function to print the given wxSize to a stream.
*
* Used for debugging functions like EDA_ITEM::Show and also in unit testing fixtures.
*/
std::ostream& operator<<( std::ostream& out, const wxSize& size );
/**
* Helper function to print the given wxPoint to a stream.
*
* Used for debugging functions like EDA_ITEM::Show and also in unit testing fixtures.
*/
std::ostream& operator<<( std::ostream& out, const wxPoint& pt );
long long TimestampDir( const wxString& aDirPath, const wxString& aFilespec );

View File

@ -0,0 +1,72 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2021 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 as published by the
* Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef KICAD_WX_STL_COMPAT_H
#define KICAD_WX_STL_COMPAT_H
#include <wx/gdicmn.h>
#include <wx/string.h>
// Some wxWidgets versions (for instance before 3.1.0) do not include
// this function, so add it if missing
#if !wxCHECK_VERSION( 3, 1, 0 )
#define USE_KICAD_WXSTRING_HASH // for common.cpp
///< Template specialization to enable wxStrings for certain containers (e.g. unordered_map)
namespace std
{
template<> struct hash<wxString>
{
size_t operator()( const wxString& s ) const;
};
}
#endif
/// Required to use wxPoint as key type in maps
#define USE_KICAD_WXPOINT_LESS_AND_HASH // for common.cpp
namespace std
{
template <> struct hash<wxPoint>
{
size_t operator() ( const wxPoint& k ) const;
};
}
namespace std
{
template<> struct less<wxPoint>
{
bool operator()( const wxPoint& aA, const wxPoint& aB ) const;
};
}
/**
* Helper function to print the given wxSize to a stream.
*
* Used for debugging functions like EDA_ITEM::Show and also in unit testing fixtures.
*/
std::ostream& operator<<( std::ostream& out, const wxSize& size );
/**
* Helper function to print the given wxPoint to a stream.
*
* Used for debugging functions like EDA_ITEM::Show and also in unit testing fixtures.
*/
std::ostream& operator<<( std::ostream& out, const wxPoint& pt );
#endif // KICAD_WX_STL_COMPAT_H

View File

@ -27,11 +27,10 @@
#include <../common/dialogs/dialog_configure_paths_base.h>
#include <wx/string.h>
#include <wx/valtext.h>
#include <pgm_base.h>
class EDA_DRAW_FRAME;
class FILENAME_RESOLVER;
class HTML_MESSAGE_BOX;

View File

@ -22,6 +22,8 @@
#ifndef INSPECTABLE_H
#define INSPECTABLE_H
#include <core/wx_stl_compat.h>
#include "property_mgr.h"
#include "property.h"

View File

@ -24,6 +24,8 @@
#ifndef PROPERTY_H
#define PROPERTY_H
#include <core/wx_stl_compat.h>
#include <wx/any.h>
#include <wx/string.h>
#include <wx/bitmap.h>

View File

@ -24,6 +24,8 @@
#ifndef PROPERTY_MGR_H
#define PROPERTY_MGR_H
#include <core/wx_stl_compat.h> // Needed for stl hash extensions
#include <wx/string.h>
#include <map>
@ -33,9 +35,6 @@
#include <memory>
#include <eda_units.h>
#include <common.h> // Needed for stl hash extensions
class PROPERTY_BASE;
class TYPE_CAST_BASE;

View File

@ -21,6 +21,8 @@
#ifndef _JSON_SETTINGS_H
#define _JSON_SETTINGS_H
#include <core/wx_stl_compat.h>
#include <nlohmann/json.hpp>
#include <utility>
#include <wx/string.h>

View File

@ -26,6 +26,8 @@
* @file kicad/files-io.cpp
*/
#include <wx/dir.h>
#include <confirm.h>
#include <dialogs/panel_kicad_launcher.h>
#include <kiway.h>

View File

@ -36,6 +36,7 @@
#include <common.h>
#include <confirm.h>
#include <kiway.h>
#include <macros.h>
#include <richio.h>
#include <wildcards_and_files_ext.h>
#include <kiway_player.h>

View File

@ -37,6 +37,7 @@
#include <filehistory.h>
#include <hotkeys_basic.h>
#include <kiway.h>
#include <macros.h>
#include <paths.h>
#include <settings/settings_manager.h>
#include <systemdirsappend.h>

View File

@ -30,6 +30,7 @@
#include <bitmaps.h>
#include <confirm.h>
#include <eda_item.h>
#include <macros.h>
#include <view/view.h>
#include <math/util.h> // for KiROUND

View File

@ -6,6 +6,8 @@
**
*****************************************************************************/
#include <wx/bitmap.h>
#include <i18n_utility.h>
#include <kiface_i.h>
#include <bitmaps/bitmap_types.h>

View File

@ -26,6 +26,7 @@
#include <confirm.h>
#include <macros.h>
#include <kicad_string.h>
#include <pcb_edit_frame.h>
#include <project.h>

View File

@ -26,6 +26,7 @@
*/
#include <core/kicad_algo.h>
#include <macros.h>
#include <connectivity/connectivity_items.h>
int CN_ITEM::AnchorCount() const

View File

@ -25,7 +25,7 @@
#include "dialog_board_statistics.h"
#include "base_units.h"
#include "common.h"
#include <macros.h>
#include <wildcards_and_files_ext.h>
#define COL_LABEL 0

View File

@ -26,6 +26,7 @@
#include <confirm.h>
#include <dialog_drc.h>
#include <kiface_i.h>
#include <macros.h>
#include <pcb_edit_frame.h>
#include <pcbnew_settings.h>
#include <pgm_base.h>

View File

@ -31,6 +31,7 @@
#include <dialog_exchange_footprints.h>
#include <kicad_string.h>
#include <kiway.h>
#include <macros.h>
#include <pcb_edit_frame.h>
#include <pcbnew_settings.h>
#include <project.h>

View File

@ -28,7 +28,6 @@
#include <wx/grid.h>
#include <pcbnew.h>
#include <pcbnew_settings.h>
#include <pgm_base.h>
#include <settings/settings_manager.h>

View File

@ -34,6 +34,7 @@
#include <dialogs/html_messagebox.h>
#include <pcb_shape.h>
#include <fp_shape.h>
#include <macros.h>
#include <confirm.h>
#include <widgets/unit_binder.h>

View File

@ -32,6 +32,7 @@
#include <set>
#include <wx/dir.h>
#include <wx/regex.h>
#include <wx/grid.h>
@ -60,6 +61,7 @@
#include <pcbnew_id.h> // For ID_PCBNEW_END_LIST
#include <settings/settings_manager.h>
#include <paths.h>
#include <macros.h>
// clang-format off

View File

@ -23,6 +23,7 @@
#include <confirm.h>
#include <kicad_string.h>
#include <macros.h>
#include <pcb_edit_frame.h>
#include <board.h>
#include <footprint.h>

View File

@ -27,6 +27,7 @@
*/
#include <kicad_string.h>
#include <macros.h>
#include <locale_io.h>
#include <build_version.h>
#include <export_footprints_placefile.h>

View File

@ -38,6 +38,7 @@
#include <core/arraydim.h>
#include <dialogs/dialog_gencad_export_options.h>
#include <locale_io.h>
#include <macros.h>
#include <hash_eda.h>
#include <pcb_edit_frame.h>
#include <pcbnew_settings.h>

View File

@ -22,6 +22,7 @@
*/
#include <kiface_i.h>
#include <macros.h>
#include <pcb_edit_frame.h>
#include <board.h>
#include <board_item.h>

View File

@ -28,13 +28,12 @@
#include <list>
#include <locale_io.h>
#include <macros.h>
#include <pcb_edit_frame.h>
#include <pcbnew.h>
#include <board.h>
#include <footprint.h>
#include <fp_shape.h>
#include <idf_parser.h>
#include <3d_cache/3d_info.h>
#include <build_version.h>
#include "project.h"
#include "kiway.h"

View File

@ -37,7 +37,6 @@
#include "footprint.h"
#include "pcb_text.h"
#include "track.h"
#include "zone.h"
#include "convert_to_biu.h"
#include <core/arraydim.h>
#include <filename_resolver.h>
@ -46,10 +45,9 @@
#include "vrml_layer.h"
#include "pcb_edit_frame.h"
#include <bezier_curves.h>
#include <convert_basic_shapes_to_polygon.h>
#include <geometry/geometry_utils.h>
#include <zone_filler.h>
#include <macros.h>
#include <exporter_vrml.h>

View File

@ -34,6 +34,7 @@
#include <confirm.h>
#include <kicad_string.h>
#include <locale_io.h>
#include <macros.h>
#include <math/util.h> // for KiROUND
#include <board.h>

View File

@ -38,6 +38,7 @@
#include <plotter.h>
#include <kicad_string.h>
#include <locale_io.h>
#include <macros.h>
#include <pcb_edit_frame.h>
#include <pgm_base.h>
#include <build_version.h>

View File

@ -31,6 +31,7 @@
#include <plotters_specific.h>
#include <kicad_string.h>
#include <locale_io.h>
#include <macros.h>
#include <pcb_edit_frame.h>
#include <pgm_base.h>
@ -38,7 +39,6 @@
#include <pcbplot.h>
#include <wildcards_and_files_ext.h>
#include <reporter.h>
#include <gbr_metadata.h>
#include <footprint.h>

View File

@ -33,6 +33,7 @@
#include <widgets/msgpanel.h>
#include <fp_lib_table.h>
#include <kiface_i.h>
#include <macros.h>
#include <trace_helpers.h>
#include <lockfile.cpp>
#include <netlist_reader/pcb_netlist.h>
@ -47,7 +48,6 @@
#include <widgets/appearance_controls.h>
#include <widgets/infobar.h>
#include <wx/wupdlock.h>
#include <settings/common_settings.h>
#include <settings/settings_manager.h>
#include <paths.h>
#include <project/project_file.h>

View File

@ -33,6 +33,7 @@
#include <pcb_edit_frame.h>
#include <board.h>
#include <fp_shape.h>
#include <macros.h>
#include <pcb_text.h>
#include <pcb_marker.h>
#include <pcb_group.h>

View File

@ -44,12 +44,12 @@
#include <footprint_editor_settings.h>
#include <footprint_info_impl.h>
#include <footprint_tree_pane.h>
#include <footprint_viewer_frame.h>
#include <fp_lib_table.h>
#include <plugins/kicad/kicad_plugin.h>
#include <kiface_i.h>
#include <kiplatform/app.h>
#include <kiway.h>
#include <macros.h>
#include <panel_hotkeys_editor.h>
#include <pcb_draw_panel_gal.h>
#include <pcb_edit_frame.h>

View File

@ -35,6 +35,7 @@
#include <pgm_base.h>
#include <wildcards_and_files_ext.h>
#include <widgets/progress_reporter.h>
#include <wx/textfile.h>
#include <wx/txtstrm.h>
#include <wx/wfstream.h>

View File

@ -26,6 +26,7 @@
#include <kiface_i.h>
#include <confirm.h>
#include <kicad_string.h>
#include <macros.h>
#include <pcb_edit_frame.h>
#include <dialog_helpers.h>
#include <filter_reader.h>

View File

@ -24,13 +24,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <core/wx_stl_compat.h>
#include <bitmaps.h>
#include <core/mirror.h>
#include <macros.h>
#include <math/util.h> // for KiROUND
#include <settings/color_settings.h>
#include <settings/settings_manager.h>
#include <pcb_edit_frame.h>
#include <board.h>
#include <footprint.h>
#include <fp_shape.h>
#include <view/view.h>

View File

@ -23,6 +23,7 @@
#include <board.h>
#include <footprint.h>
#include <macros.h>
#include <pad.h>
#include <track.h>
#include <zone.h>

View File

@ -32,6 +32,7 @@
#include <board.h>
#include <footprint.h>
#include <track.h>
#include <macros.h>
#include <pcb_marker.h>
#include <pcb_base_frame.h>
#include <pcbnew_settings.h>

View File

@ -36,6 +36,7 @@
#include <geometry/shape_segment.h>
#include <geometry/shape_circle.h>
#include <geometry/shape_compound.h>
#include <macros.h>
#include <origin_transforms.h>
#include <settings/color_settings.h>
#include <settings/settings_manager.h>

View File

@ -38,6 +38,7 @@
#include <confirm.h>
#include <pcb_edit_frame.h>
#include <eda_dde.h>
#include <macros.h>
#include <wx/file.h>
#include <wx/log.h>
#include <wx/snglinst.h>
@ -45,7 +46,6 @@
#include <pcbnew.h>
#include <pcbnew_settings.h>
#include <settings/settings_manager.h>
#include <board.h>
#include <class_draw_panel_gal.h>
#include <fp_lib_table.h>
#include <footprint_edit_frame.h>
@ -54,7 +54,6 @@
#include <footprint_preview_panel.h>
#include <footprint_info_impl.h>
#include <dialogs/dialog_configure_paths.h>
#include <paths.h>
#include "invoke_pcb_dialog.h"
#include "dialog_global_fp_lib_table_config.h"
#include <wildcards_and_files_ext.h>

View File

@ -27,13 +27,13 @@
#include <stddef.h> // for NULL, size_t
#include <vector> // for vector, __vector_base<>...
#include <eda_item.h>
#include <geometry/seg.h> // for SEG
#include <geometry/shape_circle.h>
#include <geometry/shape_line_chain.h> // for SHAPE_LINE_CHAIN
#include <geometry/shape_poly_set.h> // for SHAPE_POLY_SET, SHAPE_P...
#include <geometry/shape_segment.h>
#include <kicad_string.h>
#include <macros.h>
#include <math/util.h> // for KiROUND, Clamp
#include <math/vector2d.h> // for VECTOR2I
#include <plotter.h>

View File

@ -37,6 +37,7 @@
#include <zone.h>
#include <convert_basic_shapes_to_polygon.h>
#include <trigo.h>
#include <macros.h>
#include <limits> // std::numeric_limits

View File

@ -61,6 +61,7 @@ Load() TODO's
#include <geometry/geometry_utils.h>
#include <kicad_string.h>
#include <locale_io.h>
#include <macros.h>
#include <properties.h>
#include <trigo.h>
#include <math/util.h> // for KiROUND

View File

@ -25,6 +25,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <convert_to_biu.h>
#include <io_mgr.h>
#include <layers_id_colors_and_visibility.h>
#include <plugins/eagle/eagle_parser.h>

View File

@ -34,6 +34,7 @@
#include <board.h>
#include <footprint.h>
#include <locale_io.h>
#include <macros.h>
#include <pcb_text.h>
#include <pcb_shape.h>
#include <fp_shape.h>
@ -44,7 +45,6 @@
#include <wx/filename.h>
#include <wx/wfstream.h>
#include <boost/ptr_container/ptr_map.hpp>
#include <memory.h>
static inline long parseInt( const wxString& aValue, double aScalar )

View File

@ -22,30 +22,32 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wildcards_and_files_ext.h>
#include <advanced_config.h>
#include <base_units.h>
#include <trace_helpers.h>
#include <board.h>
#include <footprint.h>
#include <pcb_text.h>
#include <boost/ptr_container/ptr_map.hpp>
#include <confirm.h>
#include <convert_basic_shapes_to_polygon.h> // for enum RECT_CHAMFER_POSITIONS definition
#include <core/arraydim.h>
#include <dimension.h>
#include <track.h>
#include <zone.h>
#include <footprint.h>
#include <fp_shape.h>
#include <kiface_i.h>
#include <locale_io.h>
#include <macros.h>
#include <pcb_shape.h>
#include <pcb_target.h>
#include <fp_shape.h>
#include <confirm.h>
#include <core/arraydim.h>
#include <locale_io.h>
#include <zones.h>
#include <pcb_text.h>
#include <pcbnew_settings.h>
#include <plugins/kicad/kicad_plugin.h>
#include <plugins/kicad/pcb_parser.h>
#include <pcbnew_settings.h>
#include <boost/ptr_container/ptr_map.hpp>
#include <convert_basic_shapes_to_polygon.h> // for enum RECT_CHAMFER_POSITIONS definition
#include <kiface_i.h>
#include <trace_helpers.h>
#include <track.h>
#include <wildcards_and_files_ext.h>
#include <wx/dir.h>
#include <wx_filename.h>
#include <zone.h>
#include <zones.h>
using namespace PCB_KEYS_T;

View File

@ -39,6 +39,7 @@
#include <fp_lib_table.h>
#include <io_mgr.h>
#include <kicad_string.h>
#include <macros.h>
#include <pcbnew_scripting_helpers.h>
#include <project.h>
#include <settings/settings_manager.h>

View File

@ -36,6 +36,7 @@
#include <gal/color4d.h>
#include <trace_helpers.h>
#include <kicad_string.h>
#include <macros.h>
#include <paths.h>
#include <pgm_base.h>

View File

@ -30,6 +30,7 @@
#include <board.h>
#include <dialog_helpers.h>
#include <kiface_i.h>
#include <macros.h>
#include <pcb_edit_frame.h>
#include <pcb_layer_box_selector.h>
#include <pcbnew_id.h>
@ -38,7 +39,6 @@
#include <router/pns_routing_settings.h>
#include <router/router_tool.h>
#include <settings/color_settings.h>
#include <settings/common_settings.h>
#include <tool/action_toolbar.h>
#include <tool/actions.h>
#include <tool/common_tools.h>

View File

@ -30,12 +30,10 @@
#include <import_gfx/dialog_import_gfx.h>
#include <view/view.h>
#include <tool/tool_manager.h>
#include <tools/pcb_actions.h>
#include <tools/pcb_grid_helper.h>
#include <tools/pcb_selection_tool.h>
#include <tools/tool_event_utils.h>
#include <tools/zone_create_helper.h>
#include <tools/drawing_tool.h>
#include <router/router_tool.h>
#include <geometry/geometry_utils.h>
#include <geometry/shape_segment.h>
@ -58,6 +56,7 @@
#include <pcbnew_id.h>
#include <dialogs/dialog_track_via_size.h>
#include <kicad_string.h>
#include <macros.h>
#include <widgets/infobar.h>
using SCOPED_DRAW_MODE = SCOPED_SET_RESET<DRAWING_TOOL::MODE>;