diff --git a/3d-viewer/3d_canvas/board_adapter.cpp b/3d-viewer/3d_canvas/board_adapter.cpp index 19a4a837dc..b348ef198f 100644 --- a/3d-viewer/3d_canvas/board_adapter.cpp +++ b/3d-viewer/3d_canvas/board_adapter.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include diff --git a/3d-viewer/3d_canvas/eda_3d_canvas.cpp b/3d-viewer/3d_canvas/eda_3d_canvas.cpp index 926ed404cf..05e297e309 100644 --- a/3d-viewer/3d_canvas/eda_3d_canvas.cpp +++ b/3d-viewer/3d_canvas/eda_3d_canvas.cpp @@ -34,10 +34,12 @@ #include <3d_viewer_id.h> #include #include +#include #include #include #include #include +#include #include #include // To use GetRunningMicroSecs or another profiling utility #include diff --git a/3d-viewer/dialogs/appearance_controls_3D.cpp b/3d-viewer/dialogs/appearance_controls_3D.cpp index 8b96b5a204..49ea917597 100644 --- a/3d-viewer/dialogs/appearance_controls_3D.cpp +++ b/3d-viewer/dialogs/appearance_controls_3D.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -35,6 +36,7 @@ #include #include #include +#include #include #include #include diff --git a/bitmap2component/bitmap2cmp_panel.cpp b/bitmap2component/bitmap2cmp_panel.cpp index 272152eee6..e775178d66 100644 --- a/bitmap2component/bitmap2cmp_panel.cpp +++ b/bitmap2component/bitmap2cmp_panel.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include diff --git a/common/api/api_handler_common.cpp b/common/api/api_handler_common.cpp index a0b2a810e6..9add380588 100644 --- a/common/api/api_handler_common.cpp +++ b/common/api/api_handler_common.cpp @@ -18,6 +18,7 @@ * with this program. If not, see . */ +#include #include #include diff --git a/common/design_block_io.cpp b/common/design_block_io.cpp index 0dcc80b6ed..6e3ed02fa2 100644 --- a/common/design_block_io.cpp +++ b/common/design_block_io.cpp @@ -23,6 +23,7 @@ */ #include +#include #include #include #include @@ -329,10 +330,10 @@ DESIGN_BLOCK* DESIGN_BLOCK_IO::DesignBlockLoad( const wxString& aLibraryPath, dbMetadataFile >> dbMetadata; if( dbMetadata.contains( "description" ) ) - newDB->SetLibDescription( dbMetadata["description"] ); + newDB->SetLibDescription( dbMetadata["description"].get() ); if( dbMetadata.contains( "keywords" ) ) - newDB->SetKeywords( dbMetadata["keywords"] ); + newDB->SetKeywords( dbMetadata["keywords"].get() ); // Read the "fields" object from the JSON if( dbMetadata.contains( "fields" ) ) diff --git a/common/dialog_shim.cpp b/common/dialog_shim.cpp index 3f78d906bb..5946b76586 100644 --- a/common/dialog_shim.cpp +++ b/common/dialog_shim.cpp @@ -25,6 +25,8 @@ #include #include +#include +#include #include #include #include @@ -350,9 +352,9 @@ bool DIALOG_SHIM::Show( bool show ) if( COMMON_SETTINGS* settings = Pgm().GetCommonSettings() ) { - auto dlgIt = settings->m_dialogControlValues.find( key ); + auto dlgIt = settings->CsInternals().m_dialogControlValues.find( key ); - if( dlgIt != settings->m_dialogControlValues.end() ) + if( dlgIt != settings->CsInternals().m_dialogControlValues.end() ) { auto geoIt = dlgIt->second.find( "__geometry" ); @@ -439,9 +441,9 @@ void DIALOG_SHIM::resetSize() { std::string key = m_hash_key.empty() ? getDialogKeyFromTitle( GetTitle() ) : m_hash_key; - auto dlgIt = settings->m_dialogControlValues.find( key ); + auto dlgIt = settings->CsInternals().m_dialogControlValues.find( key ); - if( dlgIt == settings->m_dialogControlValues.end() ) + if( dlgIt == settings->CsInternals().m_dialogControlValues.end() ) return; dlgIt->second.erase( "__geometry" ); @@ -545,7 +547,7 @@ void DIALOG_SHIM::SaveControlState() return; std::string dialogKey = m_hash_key.empty() ? getDialogKeyFromTitle( GetTitle() ) : m_hash_key; - std::map& dlgMap = settings->m_dialogControlValues[ dialogKey ]; + std::map& dlgMap = settings->CsInternals().m_dialogControlValues[ dialogKey ]; wxRect rect( GetPosition(), GetSize() ); nlohmann::json geom; @@ -655,9 +657,9 @@ void DIALOG_SHIM::LoadControlState() return; std::string dialogKey = m_hash_key.empty() ? getDialogKeyFromTitle( GetTitle() ) : m_hash_key; - auto dlgIt = settings->m_dialogControlValues.find( dialogKey ); + auto dlgIt = settings->CsInternals().m_dialogControlValues.find( dialogKey ); - if( dlgIt == settings->m_dialogControlValues.end() ) + if( dlgIt == settings->CsInternals().m_dialogControlValues.end() ) return; const std::map& dlgMap = dlgIt->second; diff --git a/common/dialogs/dialog_multi_unit_entry.cpp b/common/dialogs/dialog_multi_unit_entry.cpp index 8667e02ee9..4cbc0bc8bc 100644 --- a/common/dialogs/dialog_multi_unit_entry.cpp +++ b/common/dialogs/dialog_multi_unit_entry.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/common/dialogs/panel_maintenance.cpp b/common/dialogs/panel_maintenance.cpp index a349a8d68c..648741154a 100644 --- a/common/dialogs/panel_maintenance.cpp +++ b/common/dialogs/panel_maintenance.cpp @@ -24,12 +24,14 @@ #include #include +#include #include #include #include #include #include #include +#include PANEL_MAINTENANCE::PANEL_MAINTENANCE( wxWindow* aParent, EDA_BASE_FRAME* aFrame ) : @@ -118,7 +120,7 @@ void PANEL_MAINTENANCE::doClearDialogState() if( COMMON_SETTINGS* settings = Pgm().GetSettingsManager().GetCommonSettings() ) { - settings->m_dialogControlValues = {}; + settings->CsInternals().m_dialogControlValues = {}; settings->SaveToFile( Pgm().GetSettingsManager().GetPathForSettingsFile( settings ) ); } } diff --git a/common/eda_base_frame.cpp b/common/eda_base_frame.cpp index c3b4c75ae7..393c75c61a 100644 --- a/common/eda_base_frame.cpp +++ b/common/eda_base_frame.cpp @@ -27,6 +27,7 @@ #include "dialogs/panel_maintenance.h" #include "kicad_manager_frame.h" #include +#include #include #include @@ -577,6 +578,22 @@ void EDA_BASE_FRAME::configureToolbars() } +void EDA_BASE_FRAME::SelectToolbarAction( const TOOL_ACTION& aAction ) +{ + if( m_tbLeft ) + m_tbLeft->SelectAction( aAction ); + + if( m_tbTopMain ) + m_tbTopMain->SelectAction( aAction ); + + if( m_tbTopAux ) + m_tbTopAux->SelectAction( aAction ); + + if( m_tbRight ) + m_tbRight->SelectAction( aAction ); +} + + void EDA_BASE_FRAME::RecreateToolbars() { wxWindowUpdateLocker dummy( this ); @@ -1001,7 +1018,7 @@ void EDA_BASE_FRAME::LoadWindowSettings( const WINDOW_SETTINGS* aCfg ) LoadWindowState( aCfg->state ); m_perspective = aCfg->perspective; - m_auiLayoutState = aCfg->aui_state; + m_auiLayoutState = std::make_unique( aCfg->aui_state ); m_mruPath = aCfg->mru_path; TOOLS_HOLDER::CommonSettingsChanged(); @@ -1171,11 +1188,11 @@ void EDA_BASE_FRAME::RestoreAuiLayout() #if wxCHECK_VERSION( 3, 3, 0 ) bool restored = false; - if( !m_auiLayoutState.is_null() && !m_auiLayoutState.empty() ) + if( m_auiLayoutState && !m_auiLayoutState->is_null() && !m_auiLayoutState->empty() ) { WX_AUI_JSON_SERIALIZER serializer( m_auimgr ); - if( serializer.Deserialize( m_auiLayoutState ) ) + if( serializer.Deserialize( *m_auiLayoutState ) ) restored = true; } @@ -1202,7 +1219,7 @@ void EDA_BASE_FRAME::RestoreAuiLayout() void EDA_BASE_FRAME::ShowInfoBarError( const wxString& aErrorMsg, bool aShowCloseButton, - WX_INFOBAR::MESSAGE_TYPE aType ) + INFOBAR_MESSAGE_TYPE aType ) { m_infoBar->RemoveAllButtons(); diff --git a/common/eda_draw_frame.cpp b/common/eda_draw_frame.cpp index c7939797fd..91c7c197aa 100644 --- a/common/eda_draw_frame.cpp +++ b/common/eda_draw_frame.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -192,6 +193,12 @@ EDA_DRAW_FRAME::~EDA_DRAW_FRAME() } +EDA_SEARCH_DATA& EDA_DRAW_FRAME::GetFindReplaceData() +{ + return *m_findReplaceData; +} + + void EDA_DRAW_FRAME::configureToolbars() { EDA_BASE_FRAME::configureToolbars(); diff --git a/common/embedded_files.cpp b/common/embedded_files.cpp index 11b966ae96..a01887d241 100644 --- a/common/embedded_files.cpp +++ b/common/embedded_files.cpp @@ -36,8 +36,35 @@ #include #include #include +#include +#include +bool EMBEDDED_FILES::EMBEDDED_FILE::Validate() +{ + MMH3_HASH hash( EMBEDDED_FILES::Seed() ); + hash.add( decompressedData ); + + is_valid = ( hash.digest().ToString() == data_hash ); + return is_valid; +} + + +bool EMBEDDED_FILES::EMBEDDED_FILE::Validate_SHA256() +{ + std::string new_sha; + picosha2::hash256_hex_string( decompressedData, new_sha ); + + is_valid = ( new_sha == data_hash ); + return is_valid; +} + + +wxString EMBEDDED_FILES::EMBEDDED_FILE::GetLink() const +{ + return wxString::Format( "%s://%s", FILEEXT::KiCadUriPrefix, name ); +} + EMBEDDED_FILES::EMBEDDED_FILE* EMBEDDED_FILES::AddFile( const wxFileName& aName, bool aOverwrite ) { diff --git a/common/jobs/job.h b/common/jobs/job.h index fe7989e083..4714e441d3 100644 --- a/common/jobs/job.h +++ b/common/jobs/job.h @@ -22,6 +22,7 @@ #include +#include #include #include #include diff --git a/common/lib_tree_model_adapter.cpp b/common/lib_tree_model_adapter.cpp index f8c2cd6aa4..ac8ebffa6e 100644 --- a/common/lib_tree_model_adapter.cpp +++ b/common/lib_tree_model_adapter.cpp @@ -165,6 +165,12 @@ LIB_TREE_MODEL_ADAPTER::~LIB_TREE_MODEL_ADAPTER() {} +TOOL_DISPATCHER* LIB_TREE_MODEL_ADAPTER::GetToolDispatcher() const +{ + return m_parent->GetToolDispatcher(); +} + + void LIB_TREE_MODEL_ADAPTER::loadColumnConfig() { for( const std::pair& pair : m_cfg.column_widths ) diff --git a/common/libraries/library_manager.cpp b/common/libraries/library_manager.cpp index 32d2c0614c..7d83966c3d 100644 --- a/common/libraries/library_manager.cpp +++ b/common/libraries/library_manager.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include diff --git a/common/pgm_base.cpp b/common/pgm_base.cpp index 887b64f7f0..9377c59b9d 100644 --- a/common/pgm_base.cpp +++ b/common/pgm_base.cpp @@ -143,6 +143,12 @@ LANGUAGE_DESCR LanguagesList[] = #define _(s) wxGetTranslation((s)) +BS::priority_thread_pool& PGM_BASE::GetThreadPool() +{ + return *m_singleton.m_ThreadPool; +} + + PGM_BASE::PGM_BASE() { m_locale = nullptr; diff --git a/common/project/board_project_settings.cpp b/common/project/board_project_settings.cpp index 7c447bc805..e907a61ee5 100644 --- a/common/project/board_project_settings.cpp +++ b/common/project/board_project_settings.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include using namespace std::placeholders; diff --git a/common/project/net_settings.cpp b/common/project/net_settings.cpp index b0d823e93b..290e7557f8 100644 --- a/common/project/net_settings.cpp +++ b/common/project/net_settings.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include #include diff --git a/common/project/project_file.cpp b/common/project/project_file.cpp index 83a49eee45..3a83ad4398 100644 --- a/common/project/project_file.cpp +++ b/common/project/project_file.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/common/settings/app_settings.cpp b/common/settings/app_settings.cpp index 2b8ce40b76..0f54aaf1d0 100644 --- a/common/settings/app_settings.cpp +++ b/common/settings/app_settings.cpp @@ -18,6 +18,7 @@ * with this program. If not, see . */ +#include #include #include #include diff --git a/common/settings/common_settings.cpp b/common/settings/common_settings.cpp index 61096f7e2d..8e7f2b0be2 100644 --- a/common/settings/common_settings.cpp +++ b/common/settings/common_settings.cpp @@ -28,7 +28,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -44,6 +46,8 @@ const wxRegEx versionedEnvVarRegex( wxS( "KICAD[0-9]+_[A-Z0-9_]+(_DIR)?" ) ); ///! Update the schema version whenever a migration is required const int commonSchemaVersion = 4; +COMMON_SETTINGS::~COMMON_SETTINGS() = default; + COMMON_SETTINGS::COMMON_SETTINGS() : JSON_SETTINGS( "kicad_common", SETTINGS_LOC::USER, commonSchemaVersion ), m_Appearance(), @@ -56,7 +60,8 @@ COMMON_SETTINGS::COMMON_SETTINGS() : m_System(), m_DoNotShowAgain(), m_PackageManager(), - m_Api() + m_Api(), + m_csInternals( std::make_unique() ) { /* * Automatic dark mode detection works fine on Mac. @@ -449,14 +454,14 @@ COMMON_SETTINGS::COMMON_SETTINGS() : { nlohmann::json ret = nlohmann::json::object(); - for( const auto& dlg : m_dialogControlValues ) + for( const auto& dlg : m_csInternals->m_dialogControlValues ) ret[ dlg.first ] = dlg.second; return ret; }, [&]( const nlohmann::json& aVal ) { - m_dialogControlValues.clear(); + m_csInternals->m_dialogControlValues.clear(); if( !aVal.is_object() ) return; @@ -467,7 +472,7 @@ COMMON_SETTINGS::COMMON_SETTINGS() : continue; for( auto& [ctrlKey, ctrlVal] : dlgVal.items() ) - m_dialogControlValues[ dlgKey ][ ctrlKey ] = ctrlVal; + m_csInternals->m_dialogControlValues[ dlgKey ][ ctrlKey ] = ctrlVal; } }, nlohmann::json::object() ) ); diff --git a/common/settings/settings_manager.cpp b/common/settings/settings_manager.cpp index 60f1af1a10..71130f3e24 100644 --- a/common/settings/settings_manager.cpp +++ b/common/settings/settings_manager.cpp @@ -286,6 +286,20 @@ COLOR_SETTINGS* SETTINGS_MANAGER::GetColorSettings( const wxString& aName ) } +std::vector SETTINGS_MANAGER::GetColorSettingsList() +{ + std::vector ret; + + for( const std::pair& entry : m_color_settings ) + ret.push_back( entry.second ); + + std::sort( ret.begin(), ret.end(), []( COLOR_SETTINGS* a, COLOR_SETTINGS* b ) + { return a->GetName() < b->GetName(); } ); + + return ret; +} + + COLOR_SETTINGS* SETTINGS_MANAGER::loadColorSettingsByName( const wxString& aName ) { wxLogTrace( traceSettings, wxT( "Attempting to load color theme %s" ), aName ); diff --git a/common/singleton.cpp b/common/singleton.cpp index 20b654e188..ac13f8488b 100644 --- a/common/singleton.cpp +++ b/common/singleton.cpp @@ -18,6 +18,7 @@ */ #include +#include #include #include #include diff --git a/common/tool/design_block_control.h b/common/tool/design_block_control.h index 61339df080..7d8b206fe7 100644 --- a/common/tool/design_block_control.h +++ b/common/tool/design_block_control.h @@ -29,6 +29,7 @@ #include class DESIGN_BLOCK_PANE; +class LIB_TREE_NODE; /** * Handle schematic design block actions in the schematic editor. diff --git a/cvpcb/cvpcb_mainframe.cpp b/cvpcb/cvpcb_mainframe.cpp index 858d87e691..992ef27e51 100644 --- a/cvpcb/cvpcb_mainframe.cpp +++ b/cvpcb/cvpcb_mainframe.cpp @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include diff --git a/cvpcb/display_footprints_frame.cpp b/cvpcb/display_footprints_frame.cpp index 9048ffd6eb..07bb27b82c 100644 --- a/cvpcb/display_footprints_frame.cpp +++ b/cvpcb/display_footprints_frame.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/dialogs/dialog_annotate.cpp b/eeschema/dialogs/dialog_annotate.cpp index 39e8f4296d..1dddcff595 100644 --- a/eeschema/dialogs/dialog_annotate.cpp +++ b/eeschema/dialogs/dialog_annotate.cpp @@ -24,6 +24,7 @@ #include +#include #include #include #include diff --git a/eeschema/dialogs/dialog_erc.cpp b/eeschema/dialogs/dialog_erc.cpp index 0ce03c798f..47e5164b79 100644 --- a/eeschema/dialogs/dialog_erc.cpp +++ b/eeschema/dialogs/dialog_erc.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/dialogs/dialog_junction_props.cpp b/eeschema/dialogs/dialog_junction_props.cpp index de8bb26b7d..7415dac8cd 100644 --- a/eeschema/dialogs/dialog_junction_props.cpp +++ b/eeschema/dialogs/dialog_junction_props.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include #include diff --git a/eeschema/dialogs/dialog_lib_new_symbol.cpp b/eeschema/dialogs/dialog_lib_new_symbol.cpp index 5411669ef5..7811a5c824 100644 --- a/eeschema/dialogs/dialog_lib_new_symbol.cpp +++ b/eeschema/dialogs/dialog_lib_new_symbol.cpp @@ -23,6 +23,7 @@ */ #include "dialog_lib_new_symbol.h" +#include #include #include diff --git a/eeschema/dialogs/dialog_line_properties.cpp b/eeschema/dialogs/dialog_line_properties.cpp index 2de521f5df..586b63cccf 100644 --- a/eeschema/dialogs/dialog_line_properties.cpp +++ b/eeschema/dialogs/dialog_line_properties.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/dialogs/dialog_pin_properties.cpp b/eeschema/dialogs/dialog_pin_properties.cpp index af53888ea2..36dc830221 100644 --- a/eeschema/dialogs/dialog_pin_properties.cpp +++ b/eeschema/dialogs/dialog_pin_properties.cpp @@ -23,6 +23,7 @@ */ #include +#include #include #include #include diff --git a/eeschema/dialogs/dialog_plot_schematic.cpp b/eeschema/dialogs/dialog_plot_schematic.cpp index c44cd0a2d9..7bc98160a4 100644 --- a/eeschema/dialogs/dialog_plot_schematic.cpp +++ b/eeschema/dialogs/dialog_plot_schematic.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/dialogs/dialog_schematic_setup.cpp b/eeschema/dialogs/dialog_schematic_setup.cpp index 39e524e01d..b7c02ed4c1 100644 --- a/eeschema/dialogs/dialog_schematic_setup.cpp +++ b/eeschema/dialogs/dialog_schematic_setup.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include "dialog_schematic_setup.h" #include "panel_template_fieldnames.h" diff --git a/eeschema/dialogs/dialog_shape_properties.cpp b/eeschema/dialogs/dialog_shape_properties.cpp index 87a773a1da..495c82490d 100644 --- a/eeschema/dialogs/dialog_shape_properties.cpp +++ b/eeschema/dialogs/dialog_shape_properties.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/dialogs/dialog_sheet_properties.cpp b/eeschema/dialogs/dialog_sheet_properties.cpp index 5994665662..f9d51b43a9 100644 --- a/eeschema/dialogs/dialog_sheet_properties.cpp +++ b/eeschema/dialogs/dialog_sheet_properties.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include "panel_eeschema_color_settings.h" #include "wx/dcclient.h" diff --git a/eeschema/dialogs/dialog_sim_model.cpp b/eeschema/dialogs/dialog_sim_model.cpp index 7408b0f72e..14c82c3660 100644 --- a/eeschema/dialogs/dialog_sim_model.cpp +++ b/eeschema/dialogs/dialog_sim_model.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/dialogs/dialog_symbol_fields_table.cpp b/eeschema/dialogs/dialog_symbol_fields_table.cpp index 874e905581..f645202046 100644 --- a/eeschema/dialogs/dialog_symbol_fields_table.cpp +++ b/eeschema/dialogs/dialog_symbol_fields_table.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/dialogs/dialog_table_properties.cpp b/eeschema/dialogs/dialog_table_properties.cpp index 0d67dd8dc2..34143f326a 100644 --- a/eeschema/dialogs/dialog_table_properties.cpp +++ b/eeschema/dialogs/dialog_table_properties.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/dialogs/dialog_tablecell_properties.cpp b/eeschema/dialogs/dialog_tablecell_properties.cpp index 0a29f9bde5..e58236d770 100644 --- a/eeschema/dialogs/dialog_tablecell_properties.cpp +++ b/eeschema/dialogs/dialog_tablecell_properties.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/dialogs/dialog_text_properties.cpp b/eeschema/dialogs/dialog_text_properties.cpp index a00bc78b91..23058d84a5 100644 --- a/eeschema/dialogs/dialog_text_properties.cpp +++ b/eeschema/dialogs/dialog_text_properties.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/dialogs/dialog_wire_bus_properties.cpp b/eeschema/dialogs/dialog_wire_bus_properties.cpp index 4b75e7eddb..043e1ff4ad 100644 --- a/eeschema/dialogs/dialog_wire_bus_properties.cpp +++ b/eeschema/dialogs/dialog_wire_bus_properties.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/dialogs/panel_sym_color_settings.cpp b/eeschema/dialogs/panel_sym_color_settings.cpp index 9324cadd07..a3bc995192 100644 --- a/eeschema/dialogs/panel_sym_color_settings.cpp +++ b/eeschema/dialogs/panel_sym_color_settings.cpp @@ -22,6 +22,7 @@ */ #include +#include #include #include #include "panel_sym_color_settings.h" diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index 7aca6a43a8..401864b12b 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/eeschema_settings.cpp b/eeschema/eeschema_settings.cpp index 0bc1e2dd23..cdbd775f64 100644 --- a/eeschema/eeschema_settings.cpp +++ b/eeschema/eeschema_settings.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/sch_base_frame.cpp b/eeschema/sch_base_frame.cpp index 462a6210f3..653bc9be9e 100644 --- a/eeschema/sch_base_frame.cpp +++ b/eeschema/sch_base_frame.cpp @@ -41,7 +41,9 @@ #include #include #include +#include #include +#include #include #include #include diff --git a/eeschema/sch_render_settings.cpp b/eeschema/sch_render_settings.cpp index cf3ba56e85..0474f6c7ed 100644 --- a/eeschema/sch_render_settings.cpp +++ b/eeschema/sch_render_settings.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/schematic_settings.h b/eeschema/schematic_settings.h index f56390eb1f..6ca1d4a0c6 100644 --- a/eeschema/schematic_settings.h +++ b/eeschema/schematic_settings.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include class NGSPICE_SETTINGS; class REFDES_TRACKER; diff --git a/eeschema/sim/simulator_frame.cpp b/eeschema/sim/simulator_frame.cpp index 45b5592850..417ca4f4ae 100644 --- a/eeschema/sim/simulator_frame.cpp +++ b/eeschema/sim/simulator_frame.cpp @@ -33,6 +33,7 @@ #include #include +#include #include #include #include diff --git a/eeschema/symbol_editor/symbol_edit_frame.cpp b/eeschema/symbol_editor/symbol_edit_frame.cpp index e0757b62e4..e280e008ff 100644 --- a/eeschema/symbol_editor/symbol_edit_frame.cpp +++ b/eeschema/symbol_editor/symbol_edit_frame.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -76,6 +77,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/symbol_tree_model_adapter.cpp b/eeschema/symbol_tree_model_adapter.cpp index dd0a555cff..3b781ff9e0 100644 --- a/eeschema/symbol_tree_model_adapter.cpp +++ b/eeschema/symbol_tree_model_adapter.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/symbol_viewer_frame.cpp b/eeschema/symbol_viewer_frame.cpp index a2f303d27d..8057806f0a 100644 --- a/eeschema/symbol_viewer_frame.cpp +++ b/eeschema/symbol_viewer_frame.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/toolbars_sch_editor.cpp b/eeschema/toolbars_sch_editor.cpp index c0b1fd4456..2299cd8fbb 100644 --- a/eeschema/toolbars_sch_editor.cpp +++ b/eeschema/toolbars_sch_editor.cpp @@ -35,8 +35,10 @@ #include #include #include +#include #include #include +#include #include #include #include diff --git a/eeschema/tools/sch_drawing_tools.cpp b/eeschema/tools/sch_drawing_tools.cpp index e5f2fa1e15..26a2e31d87 100644 --- a/eeschema/tools/sch_drawing_tools.cpp +++ b/eeschema/tools/sch_drawing_tools.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 442d577bf5..2d71da1dd2 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -82,6 +82,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/tools/sch_line_wire_bus_tool.cpp b/eeschema/tools/sch_line_wire_bus_tool.cpp index 1ae3003f3c..1289c94164 100644 --- a/eeschema/tools/sch_line_wire_bus_tool.cpp +++ b/eeschema/tools/sch_line_wire_bus_tool.cpp @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/tools/sch_move_tool.cpp b/eeschema/tools/sch_move_tool.cpp index a593561d1c..3a446ac62f 100644 --- a/eeschema/tools/sch_move_tool.cpp +++ b/eeschema/tools/sch_move_tool.cpp @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/tools/symbol_editor_drawing_tools.cpp b/eeschema/tools/symbol_editor_drawing_tools.cpp index b15bf0a3c1..7ba03ad81b 100644 --- a/eeschema/tools/symbol_editor_drawing_tools.cpp +++ b/eeschema/tools/symbol_editor_drawing_tools.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/widgets/panel_symbol_chooser.cpp b/eeschema/widgets/panel_symbol_chooser.cpp index 05696c47fe..b088943c5a 100644 --- a/eeschema/widgets/panel_symbol_chooser.cpp +++ b/eeschema/widgets/panel_symbol_chooser.cpp @@ -25,6 +25,7 @@ #include "panel_symbol_chooser.h" #include +#include #include #include #include diff --git a/gerbview/dialogs/panel_gerbview_color_settings.cpp b/gerbview/dialogs/panel_gerbview_color_settings.cpp index 840a171817..26b30321ea 100644 --- a/gerbview/dialogs/panel_gerbview_color_settings.cpp +++ b/gerbview/dialogs/panel_gerbview_color_settings.cpp @@ -18,6 +18,7 @@ */ #include +#include #include #include #include diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index ff61940b57..de80a27207 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -19,6 +19,7 @@ */ #include +#include #include #include #include diff --git a/gerbview/gerbview_settings.cpp b/gerbview/gerbview_settings.cpp index 7162c80de2..3db24e9b39 100644 --- a/gerbview/gerbview_settings.cpp +++ b/gerbview/gerbview_settings.cpp @@ -22,6 +22,7 @@ */ #include +#include #include #include #include diff --git a/gerbview/widgets/gerbview_layer_widget.cpp b/gerbview/widgets/gerbview_layer_widget.cpp index 4ff0d4fe43..2519defa82 100644 --- a/gerbview/widgets/gerbview_layer_widget.cpp +++ b/gerbview/widgets/gerbview_layer_widget.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include #include "gerbview_draw_panel_gal.h" diff --git a/include/board_design_settings.h b/include/board_design_settings.h index 758ad552c4..474cc013ae 100644 --- a/include/board_design_settings.h +++ b/include/board_design_settings.h @@ -26,10 +26,7 @@ #include -#include -#include #include -#include #include #include #include @@ -100,6 +97,10 @@ #define MINIMUM_ERROR_SIZE_MM 0.001 // For arc approximation #define MAXIMUM_ERROR_SIZE_MM 0.1 // For arc approximation +class DRC_ENGINE; +class NET_SETTINGS; +class NETCLASS; + #define MAXIMUM_CLEARANCE pcbIUScale.mmToIU( 500 ) // to prevent int-overflows // Min/max values used in dialogs to validate settings diff --git a/include/eda_base_frame.h b/include/eda_base_frame.h index ab65563fd3..044b1b720c 100644 --- a/include/eda_base_frame.h +++ b/include/eda_base_frame.h @@ -33,10 +33,13 @@ #define EDA_BASE_FRAME_H_ +#include #include #include +#include #include +#include #include #include @@ -44,10 +47,9 @@ #include #include #include -#include #include #include -#include +#include #include #include #include @@ -89,8 +91,13 @@ class APPEARANCE_CONTROLS_3D; struct WINDOW_SETTINGS; struct WINDOW_STATE; class ACTION_MENU; +class ACTION_TOOLBAR; +class ACTION_TOOLBAR_CONTROL; class TOOL_INTERACTIVE; class TOOLBAR_SETTINGS; +class WX_INFOBAR; + +using ACTION_TOOLBAR_CONTROL_FACTORY = std::function; #define DEFAULT_MAX_UNDO_ITEMS 0 #define ABS_MAX_UNDO_ITEMS (INT_MAX / 2) @@ -204,20 +211,7 @@ public: * Select the given action in the toolbar group which contains it, if any. * This updates the displayed icon/tooltip and UI conditions for that group. */ - void SelectToolbarAction( const TOOL_ACTION& aAction ) - { - if( m_tbLeft ) - m_tbLeft->SelectAction( aAction ); - - if( m_tbTopMain ) - m_tbTopMain->SelectAction( aAction ); - - if( m_tbTopAux ) - m_tbTopAux->SelectAction( aAction ); - - if( m_tbRight ) - m_tbRight->SelectAction( aAction ); - } + void SelectToolbarAction( const TOOL_ACTION& aAction ); void OnMaximize( wxMaximizeEvent& aEvent ); @@ -268,7 +262,7 @@ public: * @param aShowCloseButton true to show a close button on the right of the #WX_INFOBAR. */ void ShowInfoBarError( const wxString& aErrorMsg, bool aShowCloseButton = false, - WX_INFOBAR::MESSAGE_TYPE aType = WX_INFOBAR::MESSAGE_TYPE::GENERIC ); + INFOBAR_MESSAGE_TYPE aType = INFOBAR_MESSAGE_TYPE::GENERIC ); /** * Show the #WX_INFOBAR displayed on the top of the canvas with a message and an error @@ -806,7 +800,7 @@ private: wxAuiManager m_auimgr; wxString m_perspective; // wxAuiManager perspective. - nlohmann::json m_auiLayoutState; + std::unique_ptr m_auiLayoutState; WX_INFOBAR* m_infoBar; // Infobar for the frame APPEARANCE_CONTROLS_3D* m_appearancePanel; wxString m_configName; // Prefix used to identify some params (frame diff --git a/include/eda_draw_frame.h b/include/eda_draw_frame.h index 06f2bca3bc..8966a8fb0e 100644 --- a/include/eda_draw_frame.h +++ b/include/eda_draw_frame.h @@ -28,7 +28,6 @@ #include #include -#include #include #include #include @@ -36,8 +35,10 @@ #include #include #include -#include +#include +struct EDA_SEARCH_DATA; +class LIB_TREE; class EDA_ITEM; class wxSingleInstanceChecker; class ACTION_TOOLBAR; @@ -115,7 +116,7 @@ public: */ bool IsScriptingConsoleVisible(); - EDA_SEARCH_DATA& GetFindReplaceData() { return *m_findReplaceData; } + EDA_SEARCH_DATA& GetFindReplaceData(); wxArrayString& GetFindHistoryList() { return m_findStringHistoryList; } virtual void SetPageSettings( const PAGE_INFO& aPageSettings ) = 0; diff --git a/include/eda_item.h b/include/eda_item.h index 1d9eb5c820..e71bec1f98 100644 --- a/include/eda_item.h +++ b/include/eda_item.h @@ -29,7 +29,6 @@ #include -#include #include #include #include @@ -37,6 +36,8 @@ #include #include +class SHAPE_LINE_CHAIN; + enum class BITMAPS : unsigned int; diff --git a/include/embedded_files.h b/include/embedded_files.h index 3f2fb0f448..6db5fa32f7 100644 --- a/include/embedded_files.h +++ b/include/embedded_files.h @@ -19,14 +19,13 @@ #pragma once +#include #include #include #include #include -#include -#include #include #include #include @@ -57,30 +56,13 @@ public: is_valid( false ) {} - bool Validate() - { - MMH3_HASH hash( EMBEDDED_FILES::Seed() ); - hash.add( decompressedData ); - - is_valid = ( hash.digest().ToString() == data_hash ); - return is_valid; - } + bool Validate(); // This is the old way of validating the file. It is deprecated and retained only // to validate files that were previously embedded. - bool Validate_SHA256() - { - std::string new_sha; - picosha2::hash256_hex_string( decompressedData, new_sha ); + bool Validate_SHA256(); - is_valid = ( new_sha == data_hash ); - return is_valid; - } - - wxString GetLink() const - { - return wxString::Format( "%s://%s", FILEEXT::KiCadUriPrefix, name ); - } + wxString GetLink() const; wxString name; FILE_TYPE type; diff --git a/include/font/font.h b/include/font/font.h index b5dc1ea8ba..5299e29243 100644 --- a/include/font/font.h +++ b/include/font/font.h @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -90,40 +91,6 @@ inline bool IsSubscript( TEXT_STYLE_FLAGS aFlags ) namespace KIFONT { -class GAL_API METRICS -{ -public: - /** - * Compute the vertical position of an overbar. This is the distance between the text - * baseline and the overbar. - */ - double GetOverbarVerticalPosition( double aGlyphHeight ) const - { - return aGlyphHeight * m_OverbarHeight; - } - - /** - * Compute the vertical position of an underline. This is the distance between the text - * baseline and the underline. - */ - double GetUnderlineVerticalPosition( double aGlyphHeight ) const - { - return aGlyphHeight * m_UnderlineOffset; - } - - double GetInterline( double aFontHeight ) const - { - return aFontHeight * m_InterlinePitch; - } - - static const METRICS& Default(); - -public: - double m_InterlinePitch = 1.68; - double m_OverbarHeight = 1.23; - double m_UnderlineOffset = -0.16; -}; - /** * FONT is an abstract base class for both outline and stroke fonts */ diff --git a/include/font/font_metrics.h b/include/font/font_metrics.h new file mode 100644 index 0000000000..ddeedbba1c --- /dev/null +++ b/include/font/font_metrics.h @@ -0,0 +1,69 @@ +/* + * This program source code file is part of KICAD, a free EDA CAD application. + * + * Copyright (C) 2021 Ola Rinta-Koski + * Copyright The 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 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 FONT_METRICS_H_ +#define FONT_METRICS_H_ + +#include + +namespace KIFONT +{ + +class GAL_API METRICS +{ +public: + /** + * Compute the vertical position of an overbar. This is the distance between the text + * baseline and the overbar. + */ + double GetOverbarVerticalPosition( double aGlyphHeight ) const + { + return aGlyphHeight * m_OverbarHeight; + } + + /** + * Compute the vertical position of an underline. This is the distance between the text + * baseline and the underline. + */ + double GetUnderlineVerticalPosition( double aGlyphHeight ) const + { + return aGlyphHeight * m_UnderlineOffset; + } + + double GetInterline( double aFontHeight ) const + { + return aFontHeight * m_InterlinePitch; + } + + static const METRICS& Default(); + +public: + double m_InterlinePitch = 1.68; + double m_OverbarHeight = 1.23; + double m_UnderlineOffset = -0.16; +}; + +} // namespace KIFONT + +#endif // FONT_METRICS_H_ diff --git a/include/lib_tree_model_adapter.h b/include/lib_tree_model_adapter.h index fabb2cf8da..21d3afa6c7 100644 --- a/include/lib_tree_model_adapter.h +++ b/include/lib_tree_model_adapter.h @@ -23,7 +23,6 @@ #ifndef LIB_TREE_MODEL_ADAPTER_H #define LIB_TREE_MODEL_ADAPTER_H -#include #include #include #include @@ -96,6 +95,7 @@ #include ; +class TOOL_DISPATCHER; class TOOL_INTERACTIVE; class EDA_BASE_FRAME; @@ -279,7 +279,7 @@ public: virtual void ShowPreview( wxWindow* aParent, const wxDataViewItem& aItem ) {} virtual void ShutdownPreview( wxWindow* aParent ) {} - TOOL_DISPATCHER* GetToolDispatcher() const { return m_parent->GetToolDispatcher(); } + TOOL_DISPATCHER* GetToolDispatcher() const; /** * Return the number of symbols loaded in the tree. diff --git a/include/mouse_drag_action.h b/include/mouse_drag_action.h new file mode 100644 index 0000000000..90d199f974 --- /dev/null +++ b/include/mouse_drag_action.h @@ -0,0 +1,34 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright The 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 . + */ + +#ifndef MOUSE_DRAG_ACTION_H +#define MOUSE_DRAG_ACTION_H + +enum class MOUSE_DRAG_ACTION +{ + // WARNING: these are encoded as integers in the file, so don't change their values. + DRAG_ANY = -2, + DRAG_SELECTED, + SELECT, + ZOOM, + PAN, + NONE +}; + +#endif // MOUSE_DRAG_ACTION_H diff --git a/include/pcb_base_frame.h b/include/pcb_base_frame.h index 90d6bff2d4..918a29de4a 100644 --- a/include/pcb_base_frame.h +++ b/include/pcb_base_frame.h @@ -233,7 +233,7 @@ public: virtual void ShowChangedLanguage() override; virtual void UpdateStatusBar() override; - PCB_SCREEN* GetScreen() const override { return (PCB_SCREEN*) EDA_DRAW_FRAME::GetScreen(); } + PCB_SCREEN* GetScreen() const override; /** * Show the 3D view frame. @@ -347,8 +347,8 @@ public: */ virtual void SwitchLayer( PCB_LAYER_ID aLayer ); - virtual void SetActiveLayer( PCB_LAYER_ID aLayer ) { GetScreen()->m_Active_Layer = aLayer; } - virtual PCB_LAYER_ID GetActiveLayer() const { return GetScreen()->m_Active_Layer; } + virtual void SetActiveLayer( PCB_LAYER_ID aLayer ); + virtual PCB_LAYER_ID GetActiveLayer() const; SEVERITY GetSeverity( int aErrorCode ) const override; diff --git a/include/pgm_base.h b/include/pgm_base.h index 6d74bd603a..caf901a7b4 100644 --- a/include/pgm_base.h +++ b/include/pgm_base.h @@ -31,7 +31,6 @@ #ifndef PGM_BASE_H_ #define PGM_BASE_H_ -#include #include #include #include @@ -117,7 +116,7 @@ public: */ void BuildArgvUtf8(); - BS::priority_thread_pool& GetThreadPool() { return *m_singleton.m_ThreadPool; } + BS::priority_thread_pool& GetThreadPool(); GL_CONTEXT_MANAGER* GetGLContextManager() { return m_singleton.m_GLContextManager; } diff --git a/include/project/board_project_settings.h b/include/project/board_project_settings.h index 03f20167ec..dcf64072a6 100644 --- a/include/project/board_project_settings.h +++ b/include/project/board_project_settings.h @@ -23,10 +23,6 @@ #include #include -#include - -// Can be removed by refactoring PARAM_LAYER_PRESET -#include #include #include @@ -203,24 +199,6 @@ struct KICOMMON_API LAYER_PRESET }; -class KICOMMON_API PARAM_LAYER_PRESET : public PARAM_LAMBDA -{ -public: - PARAM_LAYER_PRESET( const std::string& aPath, std::vector* aPresetList ); - - static void MigrateToV9Layers( nlohmann::json& aJson ); - - static void MigrateToNamedRenderLayers( nlohmann::json& aJson ); - -private: - nlohmann::json presetsToJson(); - - void jsonToPresets( const nlohmann::json& aJson ); - - std::vector* m_presets; -}; - - struct KICOMMON_API VIEWPORT { VIEWPORT( const wxString& aName = wxEmptyString ) : @@ -237,20 +215,6 @@ struct KICOMMON_API VIEWPORT }; -class KICOMMON_API PARAM_VIEWPORT : public PARAM_LAMBDA -{ -public: - PARAM_VIEWPORT( const std::string& aPath, std::vector* aViewportList ); - -private: - nlohmann::json viewportsToJson(); - - void jsonToViewports( const nlohmann::json& aJson ); - - std::vector* m_viewports; -}; - - struct KICOMMON_API VIEWPORT3D { VIEWPORT3D( const wxString& aName = wxEmptyString ) : @@ -267,20 +231,6 @@ struct KICOMMON_API VIEWPORT3D }; -class KICOMMON_API PARAM_VIEWPORT3D : public PARAM_LAMBDA -{ -public: - PARAM_VIEWPORT3D( const std::string& aPath, std::vector* aViewportList ); - -private: - nlohmann::json viewportsToJson(); - - void jsonToViewports( const nlohmann::json & aJson ); - - std::vector* m_viewports; -}; - - class KICOMMON_API LAYER_PAIR { public: @@ -343,20 +293,6 @@ private: }; -class KICOMMON_API PARAM_LAYER_PAIRS : public PARAM_LAMBDA -{ -public: - PARAM_LAYER_PAIRS( const std::string& aPath, std::vector& m_layerPairInfos ); - -private: - nlohmann::json layerPairsToJson(); - - void jsonToLayerPairs( const nlohmann::json& aJson ); - - std::vector& m_layerPairInfos; -}; - - /** * Persisted state for the net inspector panel */ diff --git a/include/project/board_project_settings_params.h b/include/project/board_project_settings_params.h new file mode 100644 index 0000000000..2f7abd1ddd --- /dev/null +++ b/include/project/board_project_settings_params.h @@ -0,0 +1,88 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2020 Jon Evans + * Copyright The 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 . + */ + +#ifndef KICAD_BOARD_PROJECT_SETTINGS_PARAMS_H +#define KICAD_BOARD_PROJECT_SETTINGS_PARAMS_H + +#include +#include + + +class KICOMMON_API PARAM_LAYER_PRESET : public PARAM_LAMBDA +{ +public: + PARAM_LAYER_PRESET( const std::string& aPath, std::vector* aPresetList ); + + static void MigrateToV9Layers( nlohmann::json& aJson ); + + static void MigrateToNamedRenderLayers( nlohmann::json& aJson ); + +private: + nlohmann::json presetsToJson(); + + void jsonToPresets( const nlohmann::json& aJson ); + + std::vector* m_presets; +}; + + +class KICOMMON_API PARAM_VIEWPORT : public PARAM_LAMBDA +{ +public: + PARAM_VIEWPORT( const std::string& aPath, std::vector* aViewportList ); + +private: + nlohmann::json viewportsToJson(); + + void jsonToViewports( const nlohmann::json& aJson ); + + std::vector* m_viewports; +}; + + +class KICOMMON_API PARAM_VIEWPORT3D : public PARAM_LAMBDA +{ +public: + PARAM_VIEWPORT3D( const std::string& aPath, std::vector* aViewportList ); + +private: + nlohmann::json viewportsToJson(); + + void jsonToViewports( const nlohmann::json & aJson ); + + std::vector* m_viewports; +}; + + +class KICOMMON_API PARAM_LAYER_PAIRS : public PARAM_LAMBDA +{ +public: + PARAM_LAYER_PAIRS( const std::string& aPath, std::vector& m_layerPairInfos ); + +private: + nlohmann::json layerPairsToJson(); + + void jsonToLayerPairs( const nlohmann::json& aJson ); + + std::vector& m_layerPairInfos; +}; + + +#endif // KICAD_BOARD_PROJECT_SETTINGS_PARAMS_H diff --git a/include/settings/app_settings.h b/include/settings/app_settings.h index 93bae0fdd5..1fdbdd93f9 100644 --- a/include/settings/app_settings.h +++ b/include/settings/app_settings.h @@ -22,7 +22,7 @@ #define _APP_SETTINGS_H #include -#include +#include #include #include diff --git a/include/settings/common_settings.h b/include/settings/common_settings.h index 4f92fdd054..c9cd665068 100644 --- a/include/settings/common_settings.h +++ b/include/settings/common_settings.h @@ -20,20 +20,12 @@ #pragma once +#include +#include #include #include - -enum class MOUSE_DRAG_ACTION -{ - // WARNING: these are encoded as integers in the file, so don't change their values. - DRAG_ANY = -2, - DRAG_SELECTED, - SELECT, - ZOOM, - PAN, - NONE -}; +struct COMMON_SETTINGS_INTERNALS; enum class ICON_THEME { @@ -188,7 +180,10 @@ public: COMMON_SETTINGS(); - virtual ~COMMON_SETTINGS() {} + virtual ~COMMON_SETTINGS(); + + COMMON_SETTINGS_INTERNALS& CsInternals() { return *m_csInternals; } + const COMMON_SETTINGS_INTERNALS& CsInternals() const { return *m_csInternals; } virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override; @@ -230,6 +225,5 @@ public: GIT m_Git; API m_Api; - /// Persistent dialog control values - std::map> m_dialogControlValues; + std::unique_ptr m_csInternals; }; diff --git a/include/settings/common_settings_internals.h b/include/settings/common_settings_internals.h new file mode 100644 index 0000000000..19545c8cf5 --- /dev/null +++ b/include/settings/common_settings_internals.h @@ -0,0 +1,32 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright The 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 . + */ + +#ifndef KICAD_COMMON_SETTINGS_INTERNALS_H +#define KICAD_COMMON_SETTINGS_INTERNALS_H + +#include +#include +#include + +struct COMMON_SETTINGS_INTERNALS +{ + std::map> m_dialogControlValues; +}; + +#endif // KICAD_COMMON_SETTINGS_INTERNALS_H diff --git a/include/settings/json_settings.h b/include/settings/json_settings.h index 84be921d6f..f41433e7be 100644 --- a/include/settings/json_settings.h +++ b/include/settings/json_settings.h @@ -22,14 +22,13 @@ #define _JSON_SETTINGS_H #include -#include #include #include #include #include -#include +#include #include #include @@ -48,6 +47,7 @@ struct GRID; namespace KIGFX { class COLOR4D; +enum class CROSS_HAIR_MODE : int; }; #define traceSettings wxT( "KICAD_SETTINGS" ) diff --git a/include/settings/parameters.h b/include/settings/parameters.h index 50ee3ee70f..e56b3f49e1 100644 --- a/include/settings/parameters.h +++ b/include/settings/parameters.h @@ -27,6 +27,7 @@ #include #include +#include #include #include #include diff --git a/include/settings/settings_manager.h b/include/settings/settings_manager.h index 1e64ab6efe..e41f265f05 100644 --- a/include/settings/settings_manager.h +++ b/include/settings/settings_manager.h @@ -25,7 +25,7 @@ #include #include #include // for wxString hash -#include +#include #include class COLOR_SETTINGS; @@ -219,20 +219,7 @@ public: */ COLOR_SETTINGS* GetColorSettings( const wxString& aName ); - std::vector GetColorSettingsList() - { - std::vector ret; - - for( const std::pair& entry : m_color_settings ) - ret.push_back( entry.second ); - - std::sort( ret.begin(), ret.end(), []( COLOR_SETTINGS* a, COLOR_SETTINGS* b ) - { - return a->GetName() < b->GetName(); - } ); - - return ret; - } + std::vector GetColorSettingsList(); /** * Safely save a #COLOR_SETTINGS to disk, preserving any changes outside the given namespace. diff --git a/include/singleton.h b/include/singleton.h index 8d18a3fca3..2a5957bd6a 100644 --- a/include/singleton.h +++ b/include/singleton.h @@ -21,7 +21,6 @@ #define KICAD_SINGLETON_H #include -#include class GL_CONTEXT_MANAGER; namespace BS diff --git a/include/tool/tools_holder.h b/include/tool/tools_holder.h index d9d45a5bbd..ada738d3ce 100644 --- a/include/tool/tools_holder.h +++ b/include/tool/tools_holder.h @@ -26,7 +26,7 @@ #include #include -#include +#include struct ACTION_CONDITIONS; diff --git a/include/widgets/lib_tree.h b/include/widgets/lib_tree.h index f97153869c..898feea524 100644 --- a/include/widgets/lib_tree.h +++ b/include/widgets/lib_tree.h @@ -26,6 +26,7 @@ #define LIB_TREE_H #include +#include #include #include #include @@ -37,6 +38,7 @@ class wxSearchCtrl; class wxTimer; class wxTimerEvent; class wxPopupWindow; +class BITMAP_BUTTON; class STD_BITMAP_BUTTON; class ACTION_MENU; class LIB_ID; diff --git a/include/widgets/wx_infobar.h b/include/widgets/wx_infobar.h index 10393d0064..f794ac7078 100644 --- a/include/widgets/wx_infobar.h +++ b/include/widgets/wx_infobar.h @@ -29,6 +29,7 @@ #include #include #include +#include class wxAuiManager; @@ -87,16 +88,7 @@ public: ~WX_INFOBAR(); - /** - * Sets the type of message for special handling if needed - */ - enum class MESSAGE_TYPE - { - GENERIC, /**< GENERIC Are messages that do not have special handling */ - OUTDATED_SAVE, /**< OUTDATED_SAVE Messages that should be cleared on save */ - DRC_RULES_ERROR, - DRC_VIOLATION - }; + using MESSAGE_TYPE = INFOBAR_MESSAGE_TYPE; MESSAGE_TYPE GetMessageType() const { return m_type; } diff --git a/include/widgets/wx_infobar_message_type.h b/include/widgets/wx_infobar_message_type.h new file mode 100644 index 0000000000..30a84c8632 --- /dev/null +++ b/include/widgets/wx_infobar_message_type.h @@ -0,0 +1,35 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2020 Ian McInerney + * Copyright The 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 . + */ + +#ifndef WX_INFOBAR_MESSAGE_TYPE_H +#define WX_INFOBAR_MESSAGE_TYPE_H + +/** + * Sets the type of message for special handling if needed + */ +enum class INFOBAR_MESSAGE_TYPE +{ + GENERIC, ///< GENERIC Are messages that do not have special handling + OUTDATED_SAVE, ///< OUTDATED_SAVE Messages that should be cleared on save + DRC_RULES_ERROR, + DRC_VIOLATION +}; + +#endif // WX_INFOBAR_MESSAGE_TYPE_H diff --git a/kicad/kicad_manager_frame.cpp b/kicad/kicad_manager_frame.cpp index 9114a7cf71..216b3c95e6 100644 --- a/kicad/kicad_manager_frame.cpp +++ b/kicad/kicad_manager_frame.cpp @@ -59,6 +59,7 @@ #include #include #include +#include #include #include #include diff --git a/kicad/menubar.cpp b/kicad/menubar.cpp index 8a4a96d131..bae652e7c4 100644 --- a/kicad/menubar.cpp +++ b/kicad/menubar.cpp @@ -24,6 +24,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include #include #include #include diff --git a/kicad/project_tree_pane.cpp b/kicad/project_tree_pane.cpp index 38f859ce0f..9cb805492f 100644 --- a/kicad/project_tree_pane.cpp +++ b/kicad/project_tree_pane.cpp @@ -35,6 +35,7 @@ #include #include +#include #include #include #include diff --git a/kicad/tools/kicad_manager_control.cpp b/kicad/tools/kicad_manager_control.cpp index e12ee67c7a..084cf46d3f 100644 --- a/kicad/tools/kicad_manager_control.cpp +++ b/kicad/tools/kicad_manager_control.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include diff --git a/pagelayout_editor/dialogs/panel_pl_editor_color_settings.cpp b/pagelayout_editor/dialogs/panel_pl_editor_color_settings.cpp index eb882298d9..0fe4704b0a 100644 --- a/pagelayout_editor/dialogs/panel_pl_editor_color_settings.cpp +++ b/pagelayout_editor/dialogs/panel_pl_editor_color_settings.cpp @@ -18,6 +18,7 @@ */ #include +#include #include #include #include "panel_pl_editor_color_settings.h" diff --git a/pagelayout_editor/tools/pl_edit_tool.cpp b/pagelayout_editor/tools/pl_edit_tool.cpp index 91097425c1..a74553ad20 100644 --- a/pagelayout_editor/tools/pl_edit_tool.cpp +++ b/pagelayout_editor/tools/pl_edit_tool.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include diff --git a/pcbnew/api/api_handler_pcb.cpp b/pcbnew/api/api_handler_pcb.cpp index c69fb1f7f8..55711c6044 100644 --- a/pcbnew/api/api_handler_pcb.cpp +++ b/pcbnew/api/api_handler_pcb.cpp @@ -20,6 +20,7 @@ #include +#include #include #include #include diff --git a/pcbnew/autorouter/autoplace_tool.cpp b/pcbnew/autorouter/autoplace_tool.cpp index 2db2eddc43..a8bb909467 100644 --- a/pcbnew/autorouter/autoplace_tool.cpp +++ b/pcbnew/autorouter/autoplace_tool.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include "ar_autoplacer.h" diff --git a/pcbnew/board.h b/pcbnew/board.h index e1352e77b3..55b36ed27f 100644 --- a/pcbnew/board.h +++ b/pcbnew/board.h @@ -29,7 +29,6 @@ #include #include #include -#include // Needed for stl hash extensions #include // for OUTLINE_ERROR_HANDLER #include #include @@ -40,6 +39,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/board_connected_item.cpp b/pcbnew/board_connected_item.cpp index 55d67bc94c..4a585a7d54 100644 --- a/pcbnew/board_connected_item.cpp +++ b/pcbnew/board_connected_item.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/board_design_settings.cpp b/pcbnew/board_design_settings.cpp index 45361a64dd..94af115ce5 100644 --- a/pcbnew/board_design_settings.cpp +++ b/pcbnew/board_design_settings.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/board_item_container.h b/pcbnew/board_item_container.h index 6386cf7fe5..9b7474e0f3 100644 --- a/pcbnew/board_item_container.h +++ b/pcbnew/board_item_container.h @@ -28,7 +28,6 @@ #define BOARD_ITEM_CONTAINER_H #include -#include enum class ADD_MODE { diff --git a/pcbnew/board_statistics_report.cpp b/pcbnew/board_statistics_report.cpp index 884ff9225c..f13d155103 100644 --- a/pcbnew/board_statistics_report.cpp +++ b/pcbnew/board_statistics_report.cpp @@ -22,6 +22,7 @@ #include #include +#include #include #include #include diff --git a/pcbnew/connectivity/connectivity_algo.cpp b/pcbnew/connectivity/connectivity_algo.cpp index ffc6486db8..da763ecf5f 100644 --- a/pcbnew/connectivity/connectivity_algo.cpp +++ b/pcbnew/connectivity/connectivity_algo.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include diff --git a/pcbnew/connectivity/connectivity_data.h b/pcbnew/connectivity/connectivity_data.h index 744591a8cc..6370b677fc 100644 --- a/pcbnew/connectivity/connectivity_data.h +++ b/pcbnew/connectivity/connectivity_data.h @@ -36,11 +36,10 @@ #include #include -#include -#include #include class FROM_TO_CACHE; +class NET_SETTINGS; class CN_CLUSTER; class CN_CONNECTIVITY_ALGO; class CN_EDGE; diff --git a/pcbnew/dialogs/dialog_board_setup.cpp b/pcbnew/dialogs/dialog_board_setup.cpp index 028bae1a3f..e924ec64d6 100644 --- a/pcbnew/dialogs/dialog_board_setup.cpp +++ b/pcbnew/dialogs/dialog_board_setup.cpp @@ -27,6 +27,7 @@ #include <../board_stackup_manager/panel_board_finish.h> #include #include +#include #include #include #include diff --git a/pcbnew/dialogs/dialog_export_odbpp.cpp b/pcbnew/dialogs/dialog_export_odbpp.cpp index 87114ee03e..065b324572 100644 --- a/pcbnew/dialogs/dialog_export_odbpp.cpp +++ b/pcbnew/dialogs/dialog_export_odbpp.cpp @@ -32,6 +32,7 @@ #include #include +#include #include #include #include diff --git a/pcbnew/dialogs/dialog_export_step.cpp b/pcbnew/dialogs/dialog_export_step.cpp index a1f8b59e09..c0c6426cd9 100644 --- a/pcbnew/dialogs/dialog_export_step.cpp +++ b/pcbnew/dialogs/dialog_export_step.cpp @@ -33,6 +33,7 @@ #include #include +#include #include #include #include diff --git a/pcbnew/dialogs/dialog_gencad_export_options.cpp b/pcbnew/dialogs/dialog_gencad_export_options.cpp index 25c5b6b9d7..b0afb54a01 100644 --- a/pcbnew/dialogs/dialog_gencad_export_options.cpp +++ b/pcbnew/dialogs/dialog_gencad_export_options.cpp @@ -26,6 +26,7 @@ #include "dialog_gencad_export_options.h" +#include #include #include #include diff --git a/pcbnew/dialogs/dialog_gendrill.cpp b/pcbnew/dialogs/dialog_gendrill.cpp index 5d77effd47..cfd585c944 100644 --- a/pcbnew/dialogs/dialog_gendrill.cpp +++ b/pcbnew/dialogs/dialog_gendrill.cpp @@ -24,6 +24,7 @@ #include "dialog_gendrill.h" +#include #include #include #include diff --git a/pcbnew/dialogs/dialog_global_edit_teardrops.cpp b/pcbnew/dialogs/dialog_global_edit_teardrops.cpp index 70bb16f189..5ccdc6dff2 100644 --- a/pcbnew/dialogs/dialog_global_edit_teardrops.cpp +++ b/pcbnew/dialogs/dialog_global_edit_teardrops.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp index d2cab72cdd..303b5c9ee3 100644 --- a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp +++ b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/dialogs/panel_fp_editor_color_settings.cpp b/pcbnew/dialogs/panel_fp_editor_color_settings.cpp index 58600a8f02..e5a0a498e4 100644 --- a/pcbnew/dialogs/panel_fp_editor_color_settings.cpp +++ b/pcbnew/dialogs/panel_fp_editor_color_settings.cpp @@ -19,6 +19,7 @@ */ #include +#include #include #include #include diff --git a/pcbnew/dialogs/panel_pcbnew_action_plugins.cpp b/pcbnew/dialogs/panel_pcbnew_action_plugins.cpp index c4a84cf2e2..884ea6ad97 100644 --- a/pcbnew/dialogs/panel_pcbnew_action_plugins.cpp +++ b/pcbnew/dialogs/panel_pcbnew_action_plugins.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/dialogs/panel_pcbnew_color_settings.cpp b/pcbnew/dialogs/panel_pcbnew_color_settings.cpp index 81009ed909..90e3b72c67 100644 --- a/pcbnew/dialogs/panel_pcbnew_color_settings.cpp +++ b/pcbnew/dialogs/panel_pcbnew_color_settings.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include diff --git a/pcbnew/dialogs/panel_setup_rules.cpp b/pcbnew/dialogs/panel_setup_rules.cpp index 8cab8554de..68fbc558df 100644 --- a/pcbnew/dialogs/panel_setup_rules.cpp +++ b/pcbnew/dialogs/panel_setup_rules.cpp @@ -22,6 +22,7 @@ */ #include +#include #include #include #include @@ -29,6 +30,9 @@ #include #include #include +#include +#include +#include #include #include #include diff --git a/pcbnew/dialogs/panel_setup_rules.h b/pcbnew/dialogs/panel_setup_rules.h index 1e52cfba11..213d5c90e3 100644 --- a/pcbnew/dialogs/panel_setup_rules.h +++ b/pcbnew/dialogs/panel_setup_rules.h @@ -29,6 +29,7 @@ #include class DRC; +class DRC_RULE; class PAGED_DIALOG; class PCB_EDIT_FRAME; class SCINTILLA_TRICKS; diff --git a/pcbnew/dialogs/panel_setup_zone_hatch_offsets.cpp b/pcbnew/dialogs/panel_setup_zone_hatch_offsets.cpp index 3914ddcf06..fb109aad3d 100644 --- a/pcbnew/dialogs/panel_setup_zone_hatch_offsets.cpp +++ b/pcbnew/dialogs/panel_setup_zone_hatch_offsets.cpp @@ -22,6 +22,7 @@ */ #include "panel_setup_zone_hatch_offsets.h" +#include #include #include #include diff --git a/pcbnew/dialogs/panel_zone_properties.cpp b/pcbnew/dialogs/panel_zone_properties.cpp index f4fb0ee594..13e1dca83e 100644 --- a/pcbnew/dialogs/panel_zone_properties.cpp +++ b/pcbnew/dialogs/panel_zone_properties.cpp @@ -25,6 +25,8 @@ #include "panel_zone_properties.h" +#include +#include #include #include #include diff --git a/pcbnew/drc/drc_engine.cpp b/pcbnew/drc/drc_engine.cpp index ca82845acc..0b50f2a96a 100644 --- a/pcbnew/drc/drc_engine.cpp +++ b/pcbnew/drc/drc_engine.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/drc/drc_test_provider_misc.cpp b/pcbnew/drc/drc_test_provider_misc.cpp index 91c5328179..2149ef37e1 100644 --- a/pcbnew/drc/drc_test_provider_misc.cpp +++ b/pcbnew/drc/drc_test_provider_misc.cpp @@ -22,6 +22,7 @@ */ #include +#include #include #include #include diff --git a/pcbnew/drc/rule_editor/dialog_drc_rule_editor.cpp b/pcbnew/drc/rule_editor/dialog_drc_rule_editor.cpp index eba66ea6c0..1296cba629 100644 --- a/pcbnew/drc/rule_editor/dialog_drc_rule_editor.cpp +++ b/pcbnew/drc/rule_editor/dialog_drc_rule_editor.cpp @@ -18,6 +18,8 @@ */ +#include +#include #include #include diff --git a/pcbnew/drc/rule_editor/panel_drc_rule_editor.cpp b/pcbnew/drc/rule_editor/panel_drc_rule_editor.cpp index af017d1dec..f25c54d2e7 100644 --- a/pcbnew/drc/rule_editor/panel_drc_rule_editor.cpp +++ b/pcbnew/drc/rule_editor/panel_drc_rule_editor.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/exporters/export_gencad_writer.cpp b/pcbnew/exporters/export_gencad_writer.cpp index bb570121ef..2f5aba08fc 100644 --- a/pcbnew/exporters/export_gencad_writer.cpp +++ b/pcbnew/exporters/export_gencad_writer.cpp @@ -19,6 +19,7 @@ #include "export_gencad_writer.h" #include +#include #include #include #include diff --git a/pcbnew/exporters/gerber_jobfile_writer.cpp b/pcbnew/exporters/gerber_jobfile_writer.cpp index e11be14fa0..152575fe86 100644 --- a/pcbnew/exporters/gerber_jobfile_writer.cpp +++ b/pcbnew/exporters/gerber_jobfile_writer.cpp @@ -32,12 +32,14 @@ #include #include +#include #include #include #include #include #include +#include #include #include #include diff --git a/pcbnew/footprint.h b/pcbnew/footprint.h index 5a55e1ab8c..c559d6c6ce 100644 --- a/pcbnew/footprint.h +++ b/pcbnew/footprint.h @@ -44,7 +44,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 63e2a27993..811145cf86 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -38,6 +38,8 @@ #include <3d_viewer/eda_3d_viewer_frame.h> #include #include +#include +#include #include #include #include diff --git a/pcbnew/footprint_editor_settings.cpp b/pcbnew/footprint_editor_settings.cpp index 5341a3a22a..c10b56c78a 100644 --- a/pcbnew/footprint_editor_settings.cpp +++ b/pcbnew/footprint_editor_settings.cpp @@ -20,6 +20,8 @@ #include "footprint_editor_settings.h" +#include +#include #include #include #include diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index 4f30a6610a..2f47e8a1e1 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index f9de973cb3..06dac301e7 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -514,7 +515,7 @@ void FOOTPRINT_WIZARD_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg ) PCB_BASE_FRAME::LoadSettings( cfg ); m_auiPerspective = cfg->m_FootprintViewer.perspective; - m_viewerAuiState = cfg->m_FootprintViewer.aui_state; + m_viewerAuiState = std::make_unique( cfg->m_FootprintViewer.aui_state ); } diff --git a/pcbnew/footprint_wizard_frame.h b/pcbnew/footprint_wizard_frame.h index e4ec3a0cb0..20fb45b587 100644 --- a/pcbnew/footprint_wizard_frame.h +++ b/pcbnew/footprint_wizard_frame.h @@ -30,6 +30,7 @@ #ifndef FOOTPRINT_WIZARD_FRAME_H_ #define FOOTPRINT_WIZARD_FRAME_H_ +#include #include #include #include @@ -192,7 +193,7 @@ private: wxTextCtrl* m_buildMessageBox; wxString m_auiPerspective; ///< Encoded string describing the AUI layout - nlohmann::json m_viewerAuiState; + std::unique_ptr m_viewerAuiState; bool m_wizardListShown; ///< A show-once flag for the wizard list }; diff --git a/pcbnew/netinfo_item.cpp b/pcbnew/netinfo_item.cpp index 07e6cac22d..e8f1ba3e1d 100644 --- a/pcbnew/netinfo_item.cpp +++ b/pcbnew/netinfo_item.cpp @@ -28,6 +28,7 @@ */ #include "netinfo.h" +#include #include diff --git a/pcbnew/pcb_base_edit_frame.cpp b/pcbnew/pcb_base_edit_frame.cpp index 1ccd3401d7..aac2243dee 100644 --- a/pcbnew/pcb_base_edit_frame.cpp +++ b/pcbnew/pcb_base_edit_frame.cpp @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index fee2559d19..4a57179f40 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -624,6 +624,24 @@ void PCB_BASE_FRAME::doReCreateMenuBar() } +PCB_SCREEN* PCB_BASE_FRAME::GetScreen() const +{ + return static_cast( EDA_DRAW_FRAME::GetScreen() ); +} + + +void PCB_BASE_FRAME::SetActiveLayer( PCB_LAYER_ID aLayer ) +{ + GetScreen()->m_Active_Layer = aLayer; +} + + +PCB_LAYER_ID PCB_BASE_FRAME::GetActiveLayer() const +{ + return GetScreen()->m_Active_Layer; +} + + void PCB_BASE_FRAME::ShowChangedLanguage() { // call my base class diff --git a/pcbnew/pcb_draw_panel_gal.cpp b/pcbnew/pcb_draw_panel_gal.cpp index 5ae2e52dbc..7bdd2d5b68 100644 --- a/pcbnew/pcb_draw_panel_gal.cpp +++ b/pcbnew/pcb_draw_panel_gal.cpp @@ -25,6 +25,7 @@ #include "pcb_draw_panel_gal.h" +#include #include #include #include diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index e7380c3c63..1a3ef8afbc 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include <3d_viewer/eda_3d_viewer_frame.h> diff --git a/pcbnew/pcb_field.cpp b/pcbnew/pcb_field.cpp index d2d9dad261..b96a822714 100644 --- a/pcbnew/pcb_field.cpp +++ b/pcbnew/pcb_field.cpp @@ -22,6 +22,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include #include #include #include diff --git a/pcbnew/pcb_io/allegro/allegro_builder.cpp b/pcbnew/pcb_io/allegro/allegro_builder.cpp index 0be833e5f7..5ce54dfe2f 100644 --- a/pcbnew/pcb_io/allegro/allegro_builder.cpp +++ b/pcbnew/pcb_io/allegro/allegro_builder.cpp @@ -38,6 +38,7 @@ #include #include +#include #include #include #include diff --git a/pcbnew/pcb_io/allegro/pcb_io_allegro.cpp b/pcbnew/pcb_io/allegro/pcb_io_allegro.cpp index 9ea508b04d..b0405fb277 100644 --- a/pcbnew/pcb_io/allegro/pcb_io_allegro.cpp +++ b/pcbnew/pcb_io/allegro/pcb_io_allegro.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include diff --git a/pcbnew/pcb_io/altium/altium_pcb.cpp b/pcbnew/pcb_io/altium/altium_pcb.cpp index a3c1ddf482..747f06aacb 100644 --- a/pcbnew/pcb_io/altium/altium_pcb.cpp +++ b/pcbnew/pcb_io/altium/altium_pcb.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include #include diff --git a/pcbnew/pcb_io/cadstar/cadstar_pcb_archive_loader.cpp b/pcbnew/pcb_io/cadstar/cadstar_pcb_archive_loader.cpp index 1ca4890cee..6f1d25341a 100644 --- a/pcbnew/pcb_io/cadstar/cadstar_pcb_archive_loader.cpp +++ b/pcbnew/pcb_io/cadstar/cadstar_pcb_archive_loader.cpp @@ -29,6 +29,7 @@ #include // KEY_COPPER, KEY_CORE, KEY_PREPREG #include #include +#include #include #include #include diff --git a/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp b/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp index c727b3e2f7..e103009739 100644 --- a/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp +++ b/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp @@ -69,6 +69,7 @@ Load() TODO's #include #include #include +#include #include #include #include diff --git a/pcbnew/pcb_io/easyeda/pcb_io_easyeda_plugin.cpp b/pcbnew/pcb_io/easyeda/pcb_io_easyeda_plugin.cpp index e755c5d97b..bfe074f7c1 100644 --- a/pcbnew/pcb_io/easyeda/pcb_io_easyeda_plugin.cpp +++ b/pcbnew/pcb_io/easyeda/pcb_io_easyeda_plugin.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include diff --git a/pcbnew/pcb_io/easyedapro/pcb_io_easyedapro_parser.cpp b/pcbnew/pcb_io/easyedapro/pcb_io_easyedapro_parser.cpp index 95ec5f066f..1260d9ea59 100644 --- a/pcbnew/pcb_io/easyedapro/pcb_io_easyedapro_parser.cpp +++ b/pcbnew/pcb_io/easyedapro/pcb_io_easyedapro_parser.cpp @@ -34,6 +34,7 @@ #include #include +#include #include #include diff --git a/pcbnew/pcb_io/kicad_legacy/pcb_io_kicad_legacy.cpp b/pcbnew/pcb_io/kicad_legacy/pcb_io_kicad_legacy.cpp index d584ca4e92..356a95ba80 100644 --- a/pcbnew/pcb_io/kicad_legacy/pcb_io_kicad_legacy.cpp +++ b/pcbnew/pcb_io/kicad_legacy/pcb_io_kicad_legacy.cpp @@ -77,6 +77,7 @@ #include #include +#include #include #include #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 bbf65f2294..76fa44d8f6 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/pcb_io/pads/pcb_io_pads.cpp b/pcbnew/pcb_io/pads/pcb_io_pads.cpp index 5769319e58..480ccadfd4 100644 --- a/pcbnew/pcb_io/pads/pcb_io_pads.cpp +++ b/pcbnew/pcb_io/pads/pcb_io_pads.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -47,6 +48,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/pcb_plotter.cpp b/pcbnew/pcb_plotter.cpp index a4b4fe8081..d498819b59 100644 --- a/pcbnew/pcb_plotter.cpp +++ b/pcbnew/pcb_plotter.cpp @@ -22,6 +22,7 @@ */ #include +#include #include #include #include diff --git a/pcbnew/pcb_text.cpp b/pcbnew/pcb_text.cpp index 7bb725ffc7..f8c8fdf773 100644 --- a/pcbnew/pcb_text.cpp +++ b/pcbnew/pcb_text.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include diff --git a/pcbnew/pcb_textbox.cpp b/pcbnew/pcb_textbox.cpp index 71bf44788b..3159f915d2 100644 --- a/pcbnew/pcb_textbox.cpp +++ b/pcbnew/pcb_textbox.cpp @@ -22,6 +22,7 @@ */ #include +#include #include #include #include diff --git a/pcbnew/pcbnew_jobs_handler.cpp b/pcbnew/pcbnew_jobs_handler.cpp index 5e76f1b41e..d4724a14fe 100644 --- a/pcbnew/pcbnew_jobs_handler.cpp +++ b/pcbnew/pcbnew_jobs_handler.cpp @@ -22,6 +22,7 @@ #include "pcbnew_jobs_handler.h" #include #include +#include #include #include #include diff --git a/pcbnew/pcbnew_settings.cpp b/pcbnew/pcbnew_settings.cpp index 6238c24d03..4841d655c4 100644 --- a/pcbnew/pcbnew_settings.cpp +++ b/pcbnew/pcbnew_settings.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include diff --git a/pcbnew/pcbplot.cpp b/pcbnew/pcbplot.cpp index 00a9cd4fe9..a813c23659 100644 --- a/pcbnew/pcbplot.cpp +++ b/pcbnew/pcbplot.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include #include diff --git a/pcbnew/python/scripting/pcb_scripting_tool.cpp b/pcbnew/python/scripting/pcb_scripting_tool.cpp index 75e5105acc..ab0d2acf46 100644 --- a/pcbnew/python/scripting/pcb_scripting_tool.cpp +++ b/pcbnew/python/scripting/pcb_scripting_tool.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp b/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp index 29507f5f02..daf39fd7f0 100644 --- a/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp +++ b/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -48,6 +49,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index 61f1c68f73..230f394f36 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index fc186ce1a4..be2bcacca7 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -31,6 +31,7 @@ #include using namespace std::placeholders; +#include #include #include #include diff --git a/pcbnew/specctra_import_export/specctra_export.cpp b/pcbnew/specctra_import_export/specctra_export.cpp index d2ace17392..6cabcbad4b 100644 --- a/pcbnew/specctra_import_export/specctra_export.cpp +++ b/pcbnew/specctra_import_export/specctra_export.cpp @@ -33,6 +33,7 @@ #include "specctra.h" +#include #include #include diff --git a/pcbnew/specctra_import_export/specctra_import.cpp b/pcbnew/specctra_import_export/specctra_import.cpp index 0e5dc9c651..751304f3b7 100644 --- a/pcbnew/specctra_import_export/specctra_import.cpp +++ b/pcbnew/specctra_import_export/specctra_import.cpp @@ -36,6 +36,7 @@ #include // DisplayErrorMessage() #include #include +#include #include #include #include diff --git a/pcbnew/toolbars_pcb_editor.cpp b/pcbnew/toolbars_pcb_editor.cpp index 4c18914032..6a26a8b54a 100644 --- a/pcbnew/toolbars_pcb_editor.cpp +++ b/pcbnew/toolbars_pcb_editor.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/tools/board_editor_control.cpp b/pcbnew/tools/board_editor_control.cpp index 3cc25f9dbe..319e4be596 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.cpp b/pcbnew/tools/drawing_tool.cpp index 5325f675a9..2c553158c8 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -65,6 +65,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/pcbnew/tools/pcb_control.cpp b/pcbnew/tools/pcb_control.cpp index a23b9e4455..9f6454b4ea 100644 --- a/pcbnew/tools/pcb_control.cpp +++ b/pcbnew/tools/pcb_control.cpp @@ -26,6 +26,7 @@ #include "pcb_control.h" #include "convert_basic_shapes_to_polygon.h" +#include #include #include #include diff --git a/pcbnew/tools/zone_filler_tool.cpp b/pcbnew/tools/zone_filler_tool.cpp index 2c1d6c0dfd..2b5be9d6ce 100644 --- a/pcbnew/tools/zone_filler_tool.cpp +++ b/pcbnew/tools/zone_filler_tool.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/widgets/appearance_controls.cpp b/pcbnew/widgets/appearance_controls.cpp index c2d7ce65d2..46eb0ca77d 100644 --- a/pcbnew/widgets/appearance_controls.cpp +++ b/pcbnew/widgets/appearance_controls.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/widgets/panel_footprint_chooser.h b/pcbnew/widgets/panel_footprint_chooser.h index cf1ff9fcef..9afee95054 100644 --- a/pcbnew/widgets/panel_footprint_chooser.h +++ b/pcbnew/widgets/panel_footprint_chooser.h @@ -24,6 +24,7 @@ #ifndef PANEL_FOOTPRINT_CHOOSER_H #define PANEL_FOOTPRINT_CHOOSER_H +#include #include #include #include diff --git a/pcbnew/zone_filler.cpp b/pcbnew/zone_filler.cpp index 32674ea331..13d48253e8 100644 --- a/pcbnew/zone_filler.cpp +++ b/pcbnew/zone_filler.cpp @@ -40,6 +40,7 @@ */ static const wxChar traceZoneFiller[] = wxT( "KICAD_ZONE_FILLER" ); #include +#include #include #include #include diff --git a/pcbnew/zone_layer_properties_grid.h b/pcbnew/zone_layer_properties_grid.h new file mode 100644 index 0000000000..f565ac9a63 --- /dev/null +++ b/pcbnew/zone_layer_properties_grid.h @@ -0,0 +1,94 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2008-2018 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr + * Copyright The 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 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 + */ + +#pragma once + +#include +#include +#include + +#include +#include +#include +#include + +class PCB_BASE_FRAME; + + +class LAYER_PROPERTIES_GRID_TABLE : public WX_GRID_TABLE_BASE +{ +public: + LAYER_PROPERTIES_GRID_TABLE( PCB_BASE_FRAME* aFrame, std::function getLayers ); + ~LAYER_PROPERTIES_GRID_TABLE() override; + + int GetNumberRows() override { return (int) m_items.size(); } + int GetNumberCols() override { return 3; } + + wxString GetColLabelValue( int aCol ) override + { + switch( aCol ) + { + case 0: return _( "Layer" ); + case 1: return _( "Offset X" ); + case 2: return _( "Offset Y" ); + default: return wxEmptyString; + } + } + + bool CanGetValueAs( int aRow, int aCol, const wxString& aTypeName ) override + { + switch( aCol ) + { + case 0: return aTypeName == wxGRID_VALUE_NUMBER; + case 1: return aTypeName == wxGRID_VALUE_STRING; + case 2: return aTypeName == wxGRID_VALUE_STRING; + default: wxFAIL; return false; + } + } + + bool CanSetValueAs( int aRow, int aCol, const wxString& aTypeName ) override + { + return CanGetValueAs( aRow, aCol, aTypeName ); + } + + wxString GetValue( int aRow, int aCol ) override; + void SetValue( int aRow, int aCol, const wxString& aValue ) override; + + long GetValueAsLong( int aRow, int aCol ) override; + void SetValueAsLong( int aRow, int aCol, long aValue ) override; + + void AddItem( PCB_LAYER_ID aLayer, const ZONE_LAYER_PROPERTIES& aProps ); + bool AppendRows( size_t aNumRows = 1 ) override; + bool DeleteRows( size_t aPos, size_t aNumRows ) override; + + const std::vector>& GetItems() { return m_items; } + +protected: + void onUnitsChanged( wxCommandEvent& aEvent ); + +private: + PCB_BASE_FRAME* m_frame; + std::function m_getLayersFunc; + std::vector> m_items; +}; diff --git a/pcbnew/zone_settings.cpp b/pcbnew/zone_settings.cpp index 5509d7e114..f8faabb599 100644 --- a/pcbnew/zone_settings.cpp +++ b/pcbnew/zone_settings.cpp @@ -24,6 +24,7 @@ */ #include +#include #include #include diff --git a/pcbnew/zone_settings.h b/pcbnew/zone_settings.h index af81055d4a..25ba661471 100644 --- a/pcbnew/zone_settings.h +++ b/pcbnew/zone_settings.h @@ -36,8 +36,6 @@ #include #include #include -#include - class PCB_BASE_FRAME; class wxDataViewListCtrl; @@ -261,62 +259,4 @@ public: void SetMinIslandArea( long long int aArea ) { m_minIslandArea = aArea; } }; - -class LAYER_PROPERTIES_GRID_TABLE : public WX_GRID_TABLE_BASE -{ -public: - LAYER_PROPERTIES_GRID_TABLE( PCB_BASE_FRAME* aFrame, std::function getLayers ); - ~LAYER_PROPERTIES_GRID_TABLE() override; - - int GetNumberRows() override { return (int) m_items.size(); } - int GetNumberCols() override { return 3; } - - wxString GetColLabelValue( int aCol ) override - { - switch( aCol ) - { - case 0: return _( "Layer" ); - case 1: return _( "Offset X" ); - case 2: return _( "Offset Y" ); - default: return wxEmptyString; - } - } - - bool CanGetValueAs( int aRow, int aCol, const wxString& aTypeName ) override - { - switch( aCol ) - { - case 0: return aTypeName == wxGRID_VALUE_NUMBER; - case 1: return aTypeName == wxGRID_VALUE_STRING; - case 2: return aTypeName == wxGRID_VALUE_STRING; - default: wxFAIL; return false; - } - } - - bool CanSetValueAs( int aRow, int aCol, const wxString& aTypeName ) override - { - return CanGetValueAs( aRow, aCol, aTypeName ); - } - - wxString GetValue( int aRow, int aCol ) override; - void SetValue( int aRow, int aCol, const wxString& aValue ) override; - - long GetValueAsLong( int aRow, int aCol ) override; - void SetValueAsLong( int aRow, int aCol, long aValue ) override; - - void AddItem( PCB_LAYER_ID aLayer, const ZONE_LAYER_PROPERTIES& aProps ); - bool AppendRows( size_t aNumRows = 1 ) override; - bool DeleteRows( size_t aPos, size_t aNumRows ) override; - - const std::vector>& GetItems() { return m_items; } - -protected: - void onUnitsChanged( wxCommandEvent& aEvent ); - -private: - PCB_BASE_FRAME* m_frame; - std::function m_getLayersFunc; - std::vector> m_items; -}; - - +class LAYER_PROPERTIES_GRID_TABLE; diff --git a/qa/tests/pcbnew/drc/test_custom_rule_severities.cpp b/qa/tests/pcbnew/drc/test_custom_rule_severities.cpp index e51c86cfd3..80780f87fc 100644 --- a/qa/tests/pcbnew/drc/test_custom_rule_severities.cpp +++ b/qa/tests/pcbnew/drc/test_custom_rule_severities.cpp @@ -25,7 +25,9 @@ #include #include #include +#include #include +#include #include #include diff --git a/qa/tests/pcbnew/drc/test_drc_component_classes.cpp b/qa/tests/pcbnew/drc/test_drc_component_classes.cpp index 9adf25a661..14d8b179e8 100644 --- a/qa/tests/pcbnew/drc/test_drc_component_classes.cpp +++ b/qa/tests/pcbnew/drc/test_drc_component_classes.cpp @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include #include diff --git a/qa/tests/pcbnew/drc/test_drc_copper_conn.cpp b/qa/tests/pcbnew/drc/test_drc_copper_conn.cpp index e42875f0e1..0a0c098fff 100644 --- a/qa/tests/pcbnew/drc/test_drc_copper_conn.cpp +++ b/qa/tests/pcbnew/drc/test_drc_copper_conn.cpp @@ -25,10 +25,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include diff --git a/qa/tests/pcbnew/drc/test_drc_copper_graphics.cpp b/qa/tests/pcbnew/drc/test_drc_copper_graphics.cpp index a11241b043..a088f43002 100644 --- a/qa/tests/pcbnew/drc/test_drc_copper_graphics.cpp +++ b/qa/tests/pcbnew/drc/test_drc_copper_graphics.cpp @@ -25,7 +25,9 @@ #include #include #include +#include #include +#include #include #include diff --git a/qa/tests/pcbnew/drc/test_drc_copper_sliver.cpp b/qa/tests/pcbnew/drc/test_drc_copper_sliver.cpp index 691a1a3f9c..1e0a134caa 100644 --- a/qa/tests/pcbnew/drc/test_drc_copper_sliver.cpp +++ b/qa/tests/pcbnew/drc/test_drc_copper_sliver.cpp @@ -28,10 +28,12 @@ #include #include +#include #include #include #include #include +#include #include #include diff --git a/qa/tests/pcbnew/drc/test_drc_incorrect_text_mirror.cpp b/qa/tests/pcbnew/drc/test_drc_incorrect_text_mirror.cpp index 11de036059..59e1c5138f 100644 --- a/qa/tests/pcbnew/drc/test_drc_incorrect_text_mirror.cpp +++ b/qa/tests/pcbnew/drc/test_drc_incorrect_text_mirror.cpp @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include #include diff --git a/qa/tests/pcbnew/drc/test_drc_lengths.cpp b/qa/tests/pcbnew/drc/test_drc_lengths.cpp index 1c2df48cfa..70c8fc0499 100644 --- a/qa/tests/pcbnew/drc/test_drc_lengths.cpp +++ b/qa/tests/pcbnew/drc/test_drc_lengths.cpp @@ -25,10 +25,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include diff --git a/qa/tests/pcbnew/drc/test_drc_multi_netclasses.cpp b/qa/tests/pcbnew/drc/test_drc_multi_netclasses.cpp index 7d6a6b33c8..fab8de49e7 100644 --- a/qa/tests/pcbnew/drc/test_drc_multi_netclasses.cpp +++ b/qa/tests/pcbnew/drc/test_drc_multi_netclasses.cpp @@ -25,10 +25,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include diff --git a/qa/tests/pcbnew/drc/test_drc_orientation.cpp b/qa/tests/pcbnew/drc/test_drc_orientation.cpp index 0a1945b509..177d7ff9b5 100644 --- a/qa/tests/pcbnew/drc/test_drc_orientation.cpp +++ b/qa/tests/pcbnew/drc/test_drc_orientation.cpp @@ -25,10 +25,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include diff --git a/qa/tests/pcbnew/drc/test_drc_regressions.cpp b/qa/tests/pcbnew/drc/test_drc_regressions.cpp index a4dea87c67..954a50694e 100644 --- a/qa/tests/pcbnew/drc/test_drc_regressions.cpp +++ b/qa/tests/pcbnew/drc/test_drc_regressions.cpp @@ -25,10 +25,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include diff --git a/qa/tests/pcbnew/drc/test_drc_skew.cpp b/qa/tests/pcbnew/drc/test_drc_skew.cpp index aa9f1df0ed..3188503655 100644 --- a/qa/tests/pcbnew/drc/test_drc_skew.cpp +++ b/qa/tests/pcbnew/drc/test_drc_skew.cpp @@ -25,10 +25,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include diff --git a/qa/tests/pcbnew/drc/test_drc_starved_thermal.cpp b/qa/tests/pcbnew/drc/test_drc_starved_thermal.cpp index 0035ab9626..98daea8e0d 100644 --- a/qa/tests/pcbnew/drc/test_drc_starved_thermal.cpp +++ b/qa/tests/pcbnew/drc/test_drc_starved_thermal.cpp @@ -25,10 +25,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include diff --git a/qa/tests/pcbnew/drc/test_drc_tuning_profiles.cpp b/qa/tests/pcbnew/drc/test_drc_tuning_profiles.cpp index 649e3c56ac..d1c9817fd9 100644 --- a/qa/tests/pcbnew/drc/test_drc_tuning_profiles.cpp +++ b/qa/tests/pcbnew/drc/test_drc_tuning_profiles.cpp @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include #include diff --git a/qa/tests/pcbnew/drc/test_drc_unconnected_items_exclusion_loss.cpp b/qa/tests/pcbnew/drc/test_drc_unconnected_items_exclusion_loss.cpp index 857de2efa4..d95d454332 100644 --- a/qa/tests/pcbnew/drc/test_drc_unconnected_items_exclusion_loss.cpp +++ b/qa/tests/pcbnew/drc/test_drc_unconnected_items_exclusion_loss.cpp @@ -26,11 +26,13 @@ #include #include +#include #include #include #include #include #include +#include #include #include #include diff --git a/qa/tests/pcbnew/drc/test_drc_via_dangling.cpp b/qa/tests/pcbnew/drc/test_drc_via_dangling.cpp index fee6698e12..18b706ab09 100644 --- a/qa/tests/pcbnew/drc/test_drc_via_dangling.cpp +++ b/qa/tests/pcbnew/drc/test_drc_via_dangling.cpp @@ -25,7 +25,9 @@ #include #include #include +#include #include +#include #include #include diff --git a/qa/tests/pcbnew/drc/test_solder_mask_bridge_all_tracks.cpp b/qa/tests/pcbnew/drc/test_solder_mask_bridge_all_tracks.cpp index e595a38a9c..496ee2943f 100644 --- a/qa/tests/pcbnew/drc/test_solder_mask_bridge_all_tracks.cpp +++ b/qa/tests/pcbnew/drc/test_solder_mask_bridge_all_tracks.cpp @@ -35,8 +35,10 @@ #include #include #include +#include #include #include +#include #include #include diff --git a/qa/tests/pcbnew/drc/test_solder_mask_bridging.cpp b/qa/tests/pcbnew/drc/test_solder_mask_bridging.cpp index 66a593f7a7..24fd3051d5 100644 --- a/qa/tests/pcbnew/drc/test_solder_mask_bridging.cpp +++ b/qa/tests/pcbnew/drc/test_solder_mask_bridging.cpp @@ -25,7 +25,9 @@ #include #include #include +#include #include +#include #include #include diff --git a/qa/tests/pcbnew/drc/test_solder_mask_track_to_pad.cpp b/qa/tests/pcbnew/drc/test_solder_mask_track_to_pad.cpp index 66954f9ab1..cf7bb44803 100644 --- a/qa/tests/pcbnew/drc/test_solder_mask_track_to_pad.cpp +++ b/qa/tests/pcbnew/drc/test_solder_mask_track_to_pad.cpp @@ -35,7 +35,9 @@ #include #include #include +#include #include +#include #include #include #include diff --git a/qa/tests/pcbnew/pcb_io/allegro/test_allegro_import.cpp b/qa/tests/pcbnew/pcb_io/allegro/test_allegro_import.cpp index 6b72ef960c..dd0b903559 100644 --- a/qa/tests/pcbnew/pcb_io/allegro/test_allegro_import.cpp +++ b/qa/tests/pcbnew/pcb_io/allegro/test_allegro_import.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include #include diff --git a/qa/tests/pcbnew/pcb_io/pads/test_pads_import.cpp b/qa/tests/pcbnew/pcb_io/pads/test_pads_import.cpp index 6386159aaf..8308e52ad8 100644 --- a/qa/tests/pcbnew/pcb_io/pads/test_pads_import.cpp +++ b/qa/tests/pcbnew/pcb_io/pads/test_pads_import.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include diff --git a/qa/tests/pcbnew/test_tracks_cleaner.cpp b/qa/tests/pcbnew/test_tracks_cleaner.cpp index 6ccbdf375b..6e2f19bf05 100644 --- a/qa/tests/pcbnew/test_tracks_cleaner.cpp +++ b/qa/tests/pcbnew/test_tracks_cleaner.cpp @@ -28,9 +28,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include diff --git a/qa/tests/pcbnew/test_zone_filler.cpp b/qa/tests/pcbnew/test_zone_filler.cpp index 9fca1ca416..176bb23399 100644 --- a/qa/tests/pcbnew/test_zone_filler.cpp +++ b/qa/tests/pcbnew/test_zone_filler.cpp @@ -28,10 +28,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include