diff --git a/3d-viewer/3d_cache/sg/sg_helpers.h b/3d-viewer/3d_cache/sg/sg_helpers.h index 2b4bd1a6ef..470e2c7876 100644 --- a/3d-viewer/3d_cache/sg/sg_helpers.h +++ b/3d-viewer/3d_cache/sg/sg_helpers.h @@ -39,7 +39,7 @@ #include #include "plugins/3dapi/sg_base.h" #include "plugins/3dapi/sg_types.h" -#include +#include class SGNORMALS; class SGCOORDS; diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 0e914d3e9f..230ea74cce 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -716,6 +716,7 @@ set( COMMON_SRCS gr_basic.cpp hotkey_store.cpp hotkeys_basic.cpp + inspectable.cpp kiface_base.cpp kiway_player.cpp lib_table_grid_tricks.cpp diff --git a/common/eda_item.cpp b/common/eda_item.cpp index b0705992d7..0d610178a8 100644 --- a/common/eda_item.cpp +++ b/common/eda_item.cpp @@ -35,6 +35,8 @@ #include #include #include +#include +#include EDA_ITEM::EDA_ITEM( EDA_ITEM* parent, KICAD_T idType, bool isSCH_ITEM, bool isBOARD_ITEM ) : KIGFX::VIEW_ITEM( isSCH_ITEM, isBOARD_ITEM ), diff --git a/common/eda_shape.cpp b/common/eda_shape.cpp index 64f660f6d5..0c9c51bc73 100644 --- a/common/eda_shape.cpp +++ b/common/eda_shape.cpp @@ -40,6 +40,8 @@ #include #include #include +#include +#include #include // for KiROUND #include #include diff --git a/common/eda_text.cpp b/common/eda_text.cpp index 96fc7545f9..c6eb80991a 100644 --- a/common/eda_text.cpp +++ b/common/eda_text.cpp @@ -50,6 +50,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/common/import_gfx/svg_import_plugin.cpp b/common/import_gfx/svg_import_plugin.cpp index d7fd5fa401..32e1dbdd3c 100644 --- a/common/import_gfx/svg_import_plugin.cpp +++ b/common/import_gfx/svg_import_plugin.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include diff --git a/common/inspectable.cpp b/common/inspectable.cpp new file mode 100644 index 0000000000..30127a3eca --- /dev/null +++ b/common/inspectable.cpp @@ -0,0 +1,79 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2020 CERN + * Copyright The KiCad Developers, see AUTHORS.txt for contributors. + * @author Tomasz Wlostowski + * @author Maciej Suminski + * + * 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 . + */ + +#include + +#include + + +bool INSPECTABLE::Set( PROPERTY_BASE* aProperty, wxAny& aValue, bool aNotify ) +{ + PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance(); + void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() ); + + if( object ) + { + aProperty->setter( object, aValue ); + + if( aNotify ) + propMgr.PropertyChanged( this, aProperty ); + } + + return object != nullptr; +} + + +bool INSPECTABLE::Set( PROPERTY_BASE* aProperty, wxVariant aValue, bool aNotify ) +{ + PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance(); + void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() ); + + if( object ) + { + wxPGChoices choices = aProperty->GetChoices( this ); + + if( choices.GetCount() ) + { + if( aProperty->TypeHash() == TYPE_HASH( int ) ) + aProperty->set( object, aValue.GetInteger() ); + else + aProperty->set( object, choices.GetLabel( aValue.GetInteger() ) ); + } + else + { + aProperty->set( object, aValue ); + } + + if( aNotify ) + propMgr.PropertyChanged( this, aProperty ); + } + + return object != nullptr; +} + + +wxAny INSPECTABLE::Get( PROPERTY_BASE* aProperty ) const +{ + PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance(); + const void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() ); + return object ? aProperty->getter( object ) : wxAny(); +} diff --git a/common/properties/pg_editors.cpp b/common/properties/pg_editors.cpp index fc764af6d7..3c787a4f66 100644 --- a/common/properties/pg_editors.cpp +++ b/common/properties/pg_editors.cpp @@ -18,6 +18,7 @@ */ #include +#include #include #include #include diff --git a/common/properties/property_mgr.cpp b/common/properties/property_mgr.cpp index 78e6948434..8b1bd15fc3 100644 --- a/common/properties/property_mgr.cpp +++ b/common/properties/property_mgr.cpp @@ -36,6 +36,11 @@ static const std::map EMPTY_PROP_DISPLAY_ORDER; std::vector EMPTY_GROUP_DISPLAY_ORDER; +PROPERTY_MANAGER::~PROPERTY_MANAGER() +{ +} + + void PROPERTY_MANAGER::RegisterType( TYPE_ID aType, const wxString& aName ) { wxASSERT( m_classNames.count( aType ) == 0 ); @@ -284,6 +289,11 @@ PROPERTY_MANAGER::CLASS_DESC& PROPERTY_MANAGER::getClass( TYPE_ID aTypeId ) } +PROPERTY_MANAGER::CLASS_DESC::~CLASS_DESC() +{ +} + + void PROPERTY_MANAGER::CLASS_DESC::rebuild() { std::set> replaced; diff --git a/common/widgets/properties_panel.cpp b/common/widgets/properties_panel.cpp index a2b3a22e5e..c109c18072 100644 --- a/common/widgets/properties_panel.cpp +++ b/common/widgets/properties_panel.cpp @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #include diff --git a/eeschema/cross-probing.cpp b/eeschema/cross-probing.cpp index c061e04eec..cbaa800b86 100644 --- a/eeschema/cross-probing.cpp +++ b/eeschema/cross-probing.cpp @@ -23,6 +23,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include #include #include #include diff --git a/eeschema/dialogs/dialog_export_netlist.cpp b/eeschema/dialogs/dialog_export_netlist.cpp index 5af63dcd18..607428a07a 100644 --- a/eeschema/dialogs/dialog_export_netlist.cpp +++ b/eeschema/dialogs/dialog_export_netlist.cpp @@ -36,6 +36,7 @@ * referred to as plugins, but they are really just external binaries. */ +#include #include #include #include @@ -61,6 +62,7 @@ #include #include +#include namespace diff --git a/eeschema/dialogs/panel_setup_buses.cpp b/eeschema/dialogs/panel_setup_buses.cpp index 7d12ca4afd..a9de3fca4c 100644 --- a/eeschema/dialogs/panel_setup_buses.cpp +++ b/eeschema/dialogs/panel_setup_buses.cpp @@ -20,6 +20,7 @@ */ #include +#include #include #include #include diff --git a/eeschema/lib_symbol.cpp b/eeschema/lib_symbol.cpp index 4496aedc0b..f058d36988 100644 --- a/eeschema/lib_symbol.cpp +++ b/eeschema/lib_symbol.cpp @@ -44,6 +44,8 @@ #include #include #include +#include +#include /** diff --git a/eeschema/netlist_exporters/netlist_exporter_allegro.h b/eeschema/netlist_exporters/netlist_exporter_allegro.h index c3f3fea2dd..82dd86e592 100644 --- a/eeschema/netlist_exporters/netlist_exporter_allegro.h +++ b/eeschema/netlist_exporters/netlist_exporter_allegro.h @@ -27,6 +27,7 @@ #define NETLIST_EXPORTER_ALLEGRO_H #include "netlist_exporter_base.h" +#include /** * Generate a netlist compatible with Allegro. diff --git a/eeschema/netlist_exporters/netlist_exporter_spice.h b/eeschema/netlist_exporters/netlist_exporter_spice.h index a07eed047a..b7789c5c8f 100644 --- a/eeschema/netlist_exporters/netlist_exporter_spice.h +++ b/eeschema/netlist_exporters/netlist_exporter_spice.h @@ -32,6 +32,8 @@ #include #include +#include + class wxWindow; diff --git a/eeschema/sch_bitmap.cpp b/eeschema/sch_bitmap.cpp index 2d362ee793..05c206c6a8 100644 --- a/eeschema/sch_bitmap.cpp +++ b/eeschema/sch_bitmap.cpp @@ -40,6 +40,8 @@ #include #include +#include +#include SCH_BITMAP::SCH_BITMAP( const VECTOR2I& pos ) : diff --git a/eeschema/sch_bus_entry.cpp b/eeschema/sch_bus_entry.cpp index cf459e3efb..d6334a0af4 100644 --- a/eeschema/sch_bus_entry.cpp +++ b/eeschema/sch_bus_entry.cpp @@ -41,6 +41,8 @@ #include #include "sch_painter.h" #include "plotters/plotter.h" +#include +#include SCH_BUS_ENTRY_BASE::SCH_BUS_ENTRY_BASE( KICAD_T aType, const VECTOR2I& pos, bool aFlipY ) : diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index a049b07ea0..d02e4c4c07 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -40,6 +40,8 @@ #include #include #include "sim/sim_lib_mgr.h" +#include +#include static const std::vector labelTypes = { SCH_LABEL_LOCATE_ANY_T }; diff --git a/eeschema/sch_group.cpp b/eeschema/sch_group.cpp index 39fd2b7701..295d302f7b 100644 --- a/eeschema/sch_group.cpp +++ b/eeschema/sch_group.cpp @@ -34,6 +34,8 @@ #include #include +#include +#include SCH_GROUP::SCH_GROUP() : SCH_ITEM( nullptr, SCH_GROUP_T ) { diff --git a/eeschema/sch_io/database/sch_io_database.cpp b/eeschema/sch_io/database/sch_io_database.cpp index 29c28fd577..257a2d4a72 100644 --- a/eeschema/sch_io/database/sch_io_database.cpp +++ b/eeschema/sch_io/database/sch_io_database.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include diff --git a/eeschema/sch_io/http_lib/sch_io_http_lib.cpp b/eeschema/sch_io/http_lib/sch_io_http_lib.cpp index 2ab1042631..3278d3c4ce 100644 --- a/eeschema/sch_io/http_lib/sch_io_http_lib.cpp +++ b/eeschema/sch_io/http_lib/sch_io_http_lib.cpp @@ -20,6 +20,7 @@ #include +#include #include #include diff --git a/eeschema/sch_io/kicad_legacy/sch_io_kicad_legacy_lib_cache.cpp b/eeschema/sch_io/kicad_legacy/sch_io_kicad_legacy_lib_cache.cpp index e802afb92a..d4ca482e24 100644 --- a/eeschema/sch_io/kicad_legacy/sch_io_kicad_legacy_lib_cache.cpp +++ b/eeschema/sch_io/kicad_legacy/sch_io_kicad_legacy_lib_cache.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include diff --git a/eeschema/sch_io/ltspice/ltspice_schematic.cpp b/eeschema/sch_io/ltspice/ltspice_schematic.cpp index 2275e858dc..5ec80de903 100644 --- a/eeschema/sch_io/ltspice/ltspice_schematic.cpp +++ b/eeschema/sch_io/ltspice/ltspice_schematic.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/sch_item.cpp b/eeschema/sch_item.cpp index 42ce92f885..cb50b55ec4 100644 --- a/eeschema/sch_item.cpp +++ b/eeschema/sch_item.cpp @@ -36,6 +36,8 @@ #include #include #include +#include +#include // Rendering fonts is expensive (particularly when using outline fonts). At small effective diff --git a/eeschema/sch_item.h b/eeschema/sch_item.h index a0460f4ddd..74195725ba 100644 --- a/eeschema/sch_item.h +++ b/eeschema/sch_item.h @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -800,3 +801,4 @@ private: #ifndef SWIG DECLARE_ENUM_TO_WXANY( SCH_LAYER_ID ); #endif + diff --git a/eeschema/sch_junction.cpp b/eeschema/sch_junction.cpp index 40ac074f63..1336ff5a63 100644 --- a/eeschema/sch_junction.cpp +++ b/eeschema/sch_junction.cpp @@ -38,6 +38,8 @@ #include #include #include +#include +#include SCH_JUNCTION::SCH_JUNCTION( const VECTOR2I& aPosition, int aDiameter, SCH_LAYER_ID aLayer ) : diff --git a/eeschema/sch_label.cpp b/eeschema/sch_label.cpp index bbb2d6602b..f064e2b921 100644 --- a/eeschema/sch_label.cpp +++ b/eeschema/sch_label.cpp @@ -54,6 +54,8 @@ #include #include #include +#include +#include /* Coding polygons for global symbol graphic shapes. diff --git a/eeschema/sch_line.cpp b/eeschema/sch_line.cpp index e6505c0b19..64aa0ab1be 100644 --- a/eeschema/sch_line.cpp +++ b/eeschema/sch_line.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include #include diff --git a/eeschema/sch_pin.cpp b/eeschema/sch_pin.cpp index 12a6678b6f..9852e860b1 100644 --- a/eeschema/sch_pin.cpp +++ b/eeschema/sch_pin.cpp @@ -39,6 +39,8 @@ #include #include #include +#include +#include wxString FormatStackedPinForDisplay( const wxString& aPinNumber, int aPinLength, int aTextSize, KIFONT::FONT* aFont, const KIFONT::METRICS& aFontMetrics ) diff --git a/eeschema/sch_rule_area.cpp b/eeschema/sch_rule_area.cpp index 7a2f94a7cc..69783c06d6 100644 --- a/eeschema/sch_rule_area.cpp +++ b/eeschema/sch_rule_area.cpp @@ -38,6 +38,8 @@ #include #include #include +#include +#include SCH_RULE_AREA::~SCH_RULE_AREA() diff --git a/eeschema/sch_shape.cpp b/eeschema/sch_shape.cpp index 30519b4be5..b760052c58 100644 --- a/eeschema/sch_shape.cpp +++ b/eeschema/sch_shape.cpp @@ -33,6 +33,8 @@ #include #include #include +#include +#include SCH_SHAPE::SCH_SHAPE( SHAPE_T aShape, SCH_LAYER_ID aLayer, int aLineWidth, FILL_T aFillType, diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index ffd2d94108..34d2245b31 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -49,6 +49,8 @@ #include #include #include +#include +#include #include #include diff --git a/eeschema/sch_sheet_pin.cpp b/eeschema/sch_sheet_pin.cpp index ed44c69f92..35ca3c593f 100644 --- a/eeschema/sch_sheet_pin.cpp +++ b/eeschema/sch_sheet_pin.cpp @@ -36,6 +36,8 @@ #include #include #include +#include +#include SCH_SHEET_PIN::SCH_SHEET_PIN( SCH_SHEET* parent, const VECTOR2I& pos, const wxString& text ) : diff --git a/eeschema/sch_symbol.cpp b/eeschema/sch_symbol.cpp index d25ad14acf..105af018e7 100644 --- a/eeschema/sch_symbol.cpp +++ b/eeschema/sch_symbol.cpp @@ -45,6 +45,8 @@ #include #include +#include +#include std::unordered_map SCH_SYMBOL::s_transformToOrientationCache; diff --git a/eeschema/sch_table.cpp b/eeschema/sch_table.cpp index 36c4dd1da0..8723818511 100644 --- a/eeschema/sch_table.cpp +++ b/eeschema/sch_table.cpp @@ -34,6 +34,8 @@ #include #include #include +#include +#include SCH_TABLE::SCH_TABLE( int aLineWidth ) : diff --git a/eeschema/sch_tablecell.cpp b/eeschema/sch_tablecell.cpp index 2b6ce9fa2b..6dbd3ec9ed 100644 --- a/eeschema/sch_tablecell.cpp +++ b/eeschema/sch_tablecell.cpp @@ -28,6 +28,8 @@ #include #include #include +#include +#include SCH_TABLECELL::SCH_TABLECELL( int aLineWidth, FILL_T aFillType ) : diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index 4d51b47fc0..634fcfa51b 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -48,6 +48,8 @@ #include #include #include +#include +#include SCH_TEXT::SCH_TEXT( const VECTOR2I& aPos, const wxString& aText, SCH_LAYER_ID aLayer, KICAD_T aType ) : diff --git a/eeschema/sch_textbox.cpp b/eeschema/sch_textbox.cpp index 41e24ac89b..01b375f163 100644 --- a/eeschema/sch_textbox.cpp +++ b/eeschema/sch_textbox.cpp @@ -40,6 +40,8 @@ #include #include #include +#include +#include SCH_TEXTBOX::SCH_TEXTBOX( SCH_LAYER_ID aLayer, int aLineWidth, FILL_T aFillType, const wxString& aText, diff --git a/eeschema/schematic.cpp b/eeschema/schematic.cpp index eab4ee822c..6208d15a66 100644 --- a/eeschema/schematic.cpp +++ b/eeschema/schematic.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/eeschema/sim/legacy_workbook.cpp b/eeschema/sim/legacy_workbook.cpp index 7223500ce6..36629053a7 100644 --- a/eeschema/sim/legacy_workbook.cpp +++ b/eeschema/sim/legacy_workbook.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include diff --git a/eeschema/sim/sim_model.cpp b/eeschema/sim/sim_model.cpp index 643b3afc29..3317244dae 100644 --- a/eeschema/sim/sim_model.cpp +++ b/eeschema/sim/sim_model.cpp @@ -23,6 +23,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include #include #include #include diff --git a/eeschema/sim/sim_plot_tab.cpp b/eeschema/sim/sim_plot_tab.cpp index e879f2ee96..690d5b220b 100644 --- a/eeschema/sim/sim_plot_tab.cpp +++ b/eeschema/sim/sim_plot_tab.cpp @@ -25,6 +25,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include #include "sim_plot_colors.h" #include "sim_plot_tab.h" #include "simulator_frame.h" diff --git a/eeschema/sim/simulator_frame_ui.cpp b/eeschema/sim/simulator_frame_ui.cpp index a66cb5ab35..5e6441a87f 100644 --- a/eeschema/sim/simulator_frame_ui.cpp +++ b/eeschema/sim/simulator_frame_ui.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include diff --git a/eeschema/symbol_viewer_frame.cpp b/eeschema/symbol_viewer_frame.cpp index 8057806f0a..b1d4e5be86 100644 --- a/eeschema/symbol_viewer_frame.cpp +++ b/eeschema/symbol_viewer_frame.cpp @@ -23,6 +23,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include #include #include #include diff --git a/eeschema/widgets/sch_properties_panel.cpp b/eeschema/widgets/sch_properties_panel.cpp index 5d7ff0f935..2adeac5dae 100644 --- a/eeschema/widgets/sch_properties_panel.cpp +++ b/eeschema/widgets/sch_properties_panel.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff --git a/include/board_item.h b/include/board_item.h index da318a7118..365b21d91c 100644 --- a/include/board_item.h +++ b/include/board_item.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -465,7 +466,6 @@ protected: DECLARE_ENUM_TO_WXANY( PCB_LAYER_ID ); #endif - /** * A singleton item of this class is returned for a weak reference that no longer exists. * diff --git a/include/drawing_sheet/ds_proxy_view_item.h b/include/drawing_sheet/ds_proxy_view_item.h index 01c9328ccf..c53f058a6e 100644 --- a/include/drawing_sheet/ds_proxy_view_item.h +++ b/include/drawing_sheet/ds_proxy_view_item.h @@ -27,6 +27,7 @@ #define DS_PROXY_VIEW_ITEM_H #include +#include class BOARD; class PAGE_INFO; diff --git a/include/eda_shape.h b/include/eda_shape.h index 4cab4f8868..963e067ee5 100644 --- a/include/eda_shape.h +++ b/include/eda_shape.h @@ -526,3 +526,4 @@ DECLARE_ENUM_TO_WXANY( SHAPE_T ); DECLARE_ENUM_TO_WXANY( LINE_STYLE ); DECLARE_ENUM_TO_WXANY( UI_FILL_MODE ); #endif + diff --git a/include/inspectable.h b/include/inspectable.h index e649c53d75..858b717508 100644 --- a/include/inspectable.h +++ b/include/inspectable.h @@ -23,13 +23,14 @@ #ifndef INSPECTABLE_H #define INSPECTABLE_H -#include - -#include -#include +#include +#include +#include #include +class PROPERTY_BASE; + /** * Class that other classes need to inherit from, in order to be inspectable. */ @@ -40,128 +41,23 @@ public: { } - bool Set( PROPERTY_BASE* aProperty, wxAny& aValue, bool aNotify = true ) - { - PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance(); - void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() ); + bool Set( PROPERTY_BASE* aProperty, wxAny& aValue, bool aNotify = true ); - if( object ) - { - aProperty->setter( object, aValue ); + template + bool Set( PROPERTY_BASE* aProperty, T aValue, bool aNotify = true ); - if( aNotify ) - propMgr.PropertyChanged( this, aProperty ); - } + bool Set( PROPERTY_BASE* aProperty, wxVariant aValue, bool aNotify = true ); - return object != nullptr; - } + template + bool Set( const wxString& aProperty, T aValue, bool aNotify = true ); - template - bool Set( PROPERTY_BASE* aProperty, T aValue, bool aNotify = true ) - { - PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance(); - void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() ); + wxAny Get( PROPERTY_BASE* aProperty ) const; - if( object ) - { - aProperty->set( object, aValue ); + template + T Get( PROPERTY_BASE* aProperty ) const; - if( aNotify ) - propMgr.PropertyChanged( this, aProperty ); - } - - return object != nullptr; - } - - bool Set( PROPERTY_BASE* aProperty, wxVariant aValue, bool aNotify = true ) - { - PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance(); - void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() ); - - if( object ) - { - wxPGChoices choices = aProperty->GetChoices( this ); - - if( choices.GetCount() ) - { - // If the property type is int, use the choice value directly - // Otherwise, convert to the choice label string - if( aProperty->TypeHash() == TYPE_HASH( int ) ) - aProperty->set( object, aValue.GetInteger() ); - else - aProperty->set( object, choices.GetLabel( aValue.GetInteger() ) ); - } - else - aProperty->set( object, aValue ); - - if( aNotify ) - propMgr.PropertyChanged( this, aProperty ); - } - - return object != nullptr; - } - - template - bool Set( const wxString& aProperty, T aValue, bool aNotify = true ) - { - PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance(); - TYPE_ID thisType = TYPE_HASH( *this ); - PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty ); - void* object = nullptr; - - if( prop ) - { - object = propMgr.TypeCast( this, thisType, prop->OwnerHash() ); - - if( object ) - { - prop->set( object, aValue ); - - if( aNotify ) - propMgr.PropertyChanged( this, prop ); - } - } - - return object != nullptr; - } - - wxAny Get( PROPERTY_BASE* aProperty ) const - { - PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance(); - const void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() ); - return object ? aProperty->getter( object ) : wxAny(); - } - - template - T Get( PROPERTY_BASE* aProperty ) const - { - PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance(); - const void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() ); - - if( !object ) - throw std::runtime_error( "Could not cast INSPECTABLE to the requested type" ); - - return aProperty->get( object ); - } - - template - std::optional Get( const wxString& aProperty ) const - { - PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance(); - TYPE_ID thisType = TYPE_HASH( *this ); - PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty ); - std::optional ret; - - if( prop ) - { - const void* object = propMgr.TypeCast( this, thisType, prop->OwnerHash() ); - - if( object ) - ret = prop->get( object ); - } - - return ret; - } + template + std::optional Get( const wxString& aProperty ) const; }; #endif /* INSPECTABLE_H */ diff --git a/include/inspectable_impl.h b/include/inspectable_impl.h new file mode 100644 index 0000000000..ff418f4dc6 --- /dev/null +++ b/include/inspectable_impl.h @@ -0,0 +1,102 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2020 CERN + * Copyright The KiCad Developers, see AUTHORS.txt for contributors. + * @author Tomasz Wlostowski + * @author Maciej Suminski + * + * 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 INSPECTABLE_IMPL_H +#define INSPECTABLE_IMPL_H + +#include +#include +#include + +template +bool INSPECTABLE::Set( PROPERTY_BASE* aProperty, T aValue, bool aNotify ) +{ + PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance(); + void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() ); + + if( object ) + { + aProperty->set( object, aValue ); + + if( aNotify ) + propMgr.PropertyChanged( this, aProperty ); + } + + return object != nullptr; +} + +template +bool INSPECTABLE::Set( const wxString& aProperty, T aValue, bool aNotify ) +{ + PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance(); + TYPE_ID thisType = TYPE_HASH( *this ); + PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty ); + void* object = nullptr; + + if( prop ) + { + object = propMgr.TypeCast( this, thisType, prop->OwnerHash() ); + + if( object ) + { + prop->set( object, aValue ); + + if( aNotify ) + propMgr.PropertyChanged( this, prop ); + } + } + + return object != nullptr; +} + +template +T INSPECTABLE::Get( PROPERTY_BASE* aProperty ) const +{ + PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance(); + const void* object = propMgr.TypeCast( this, TYPE_HASH( *this ), aProperty->OwnerHash() ); + + if( !object ) + throw std::runtime_error( "Could not cast INSPECTABLE to the requested type" ); + + return aProperty->get( object ); +} + +template +std::optional INSPECTABLE::Get( const wxString& aProperty ) const +{ + PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance(); + TYPE_ID thisType = TYPE_HASH( *this ); + PROPERTY_BASE* prop = propMgr.GetProperty( thisType, aProperty ); + std::optional ret; + + if( prop ) + { + const void* object = propMgr.TypeCast( this, thisType, prop->OwnerHash() ); + + if( object ) + ret = prop->get( object ); + } + + return ret; +} + +#endif /* INSPECTABLE_IMPL_H */ diff --git a/include/preview_items/arc_assistant.h b/include/preview_items/arc_assistant.h index 5e0ea5d5ba..891303320d 100644 --- a/include/preview_items/arc_assistant.h +++ b/include/preview_items/arc_assistant.h @@ -25,6 +25,7 @@ #define PREVIEW_ITEMS_ARC_ASSISTANT_H #include +#include #include #include diff --git a/include/preview_items/bezier_assistant.h b/include/preview_items/bezier_assistant.h index a76fe9508d..8f31fed784 100644 --- a/include/preview_items/bezier_assistant.h +++ b/include/preview_items/bezier_assistant.h @@ -24,6 +24,7 @@ #pragma once #include +#include #include #include diff --git a/include/preview_items/ruler_item.h b/include/preview_items/ruler_item.h index eb53524d70..95aaa869a2 100644 --- a/include/preview_items/ruler_item.h +++ b/include/preview_items/ruler_item.h @@ -27,6 +27,7 @@ #include #include +#include #include #include diff --git a/include/preview_items/two_point_assistant.h b/include/preview_items/two_point_assistant.h index 557cf17324..958b388b72 100644 --- a/include/preview_items/two_point_assistant.h +++ b/include/preview_items/two_point_assistant.h @@ -25,6 +25,7 @@ #define PREVIEW_ITEMS_TWO_POINT_ASSISTANT_H #include +#include #include #include diff --git a/include/properties/property_mgr.h b/include/properties/property_mgr.h index a93ce20256..61872a68c9 100644 --- a/include/properties/property_mgr.h +++ b/include/properties/property_mgr.h @@ -268,6 +268,8 @@ private: { } + ~PROPERTY_MANAGER(); + friend class PROPERTY_COMMIT_HANDLER; ///< Structure holding type meta-data @@ -280,6 +282,10 @@ private: m_groups.insert( wxEmptyString ); } + ~CLASS_DESC(); + + CLASS_DESC( CLASS_DESC&& ) = default; + ///< Unique type identifier (obtained using TYPE_HASH) const TYPE_ID m_id; diff --git a/include/tool/point_editor_behavior.h b/include/tool/point_editor_behavior.h index eb91552054..93c489f067 100644 --- a/include/tool/point_editor_behavior.h +++ b/include/tool/point_editor_behavior.h @@ -31,6 +31,7 @@ #include #include +class COMMIT; class SHAPE_POLY_SET; /** diff --git a/include/view/view.h b/include/view/view.h index 3841bad27f..57b5481a9b 100644 --- a/include/view/view.h +++ b/include/view/view.h @@ -27,6 +27,7 @@ #pragma once #include +#include #include #include #include diff --git a/include/view/view_overlay.h b/include/view/view_overlay.h index 1310847057..831b672ac1 100644 --- a/include/view/view_overlay.h +++ b/include/view/view_overlay.h @@ -26,6 +26,7 @@ #pragma once +#include #include #include #include diff --git a/pcb_calculator/calculator_panels/panel_transline.cpp b/pcb_calculator/calculator_panels/panel_transline.cpp index eb60b5623f..975b29a25b 100644 --- a/pcb_calculator/calculator_panels/panel_transline.cpp +++ b/pcb_calculator/calculator_panels/panel_transline.cpp @@ -24,6 +24,8 @@ #include #include #include +#include +#include PANEL_TRANSLINE::PANEL_TRANSLINE( wxWindow* parent, wxWindowID id, const wxPoint& pos, diff --git a/pcb_calculator/transline_dlg_funct.cpp b/pcb_calculator/transline_dlg_funct.cpp index df98e9b078..49c6fee007 100644 --- a/pcb_calculator/transline_dlg_funct.cpp +++ b/pcb_calculator/transline_dlg_funct.cpp @@ -26,6 +26,8 @@ #include #include #include +#include +#include extern double DoubleFromString( const wxString& TextValue ); diff --git a/pcb_calculator/transline_ident.cpp b/pcb_calculator/transline_ident.cpp index 19565c490c..f521ebe448 100644 --- a/pcb_calculator/transline_ident.cpp +++ b/pcb_calculator/transline_ident.cpp @@ -41,6 +41,8 @@ #include "pcb_calculator_settings.h" #include "widgets/unit_selector.h" #include "transline_ident.h" +#include +#include TRANSLINE_PRM::TRANSLINE_PRM( PRM_TYPE aType, PRMS_ID aId, const char* aKeywordCfg, const wxString& aDlgLabel, diff --git a/pcbnew/api/api_handler_pcb.cpp b/pcbnew/api/api_handler_pcb.cpp index 55711c6044..71026b07c4 100644 --- a/pcbnew/api/api_handler_pcb.cpp +++ b/pcbnew/api/api_handler_pcb.cpp @@ -19,6 +19,7 @@ */ #include +#include #include #include diff --git a/pcbnew/board_connected_item.cpp b/pcbnew/board_connected_item.cpp index 4a585a7d54..8869367c13 100644 --- a/pcbnew/board_connected_item.cpp +++ b/pcbnew/board_connected_item.cpp @@ -31,6 +31,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/pcbnew/board_item.cpp b/pcbnew/board_item.cpp index 6dbe37feaf..0ae21b905e 100644 --- a/pcbnew/board_item.cpp +++ b/pcbnew/board_item.cpp @@ -36,6 +36,8 @@ #include #include #include +#include +#include bool BOARD_ITEM::IsGroupableType() const diff --git a/pcbnew/connectivity/connectivity_data.cpp b/pcbnew/connectivity/connectivity_data.cpp index ac2da17548..85d23cc84b 100644 --- a/pcbnew/connectivity/connectivity_data.cpp +++ b/pcbnew/connectivity/connectivity_data.cpp @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -44,6 +45,7 @@ #include #include #include +#include CONNECTIVITY_DATA::CONNECTIVITY_DATA() : m_skipRatsnestUpdate( false ) diff --git a/pcbnew/cross-probing.cpp b/pcbnew/cross-probing.cpp index a995c7a98d..7d9806b9be 100644 --- a/pcbnew/cross-probing.cpp +++ b/pcbnew/cross-probing.cpp @@ -31,6 +31,7 @@ * Note: these ports must be enabled for firewall protection */ +#include #include #include #include diff --git a/pcbnew/dialogs/dialog_board_reannotate.cpp b/pcbnew/dialogs/dialog_board_reannotate.cpp index de0773a3d9..232c2c7c5d 100644 --- a/pcbnew/dialogs/dialog_board_reannotate.cpp +++ b/pcbnew/dialogs/dialog_board_reannotate.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include diff --git a/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp b/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp index a97b4f24f3..80154460a5 100644 --- a/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp +++ b/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp @@ -27,6 +27,7 @@ #include "dialog_footprint_properties_fp_editor.h" #include +#include #include <3d_rendering/opengl/3d_model.h> #include <3d_viewer/eda_3d_viewer_frame.h> diff --git a/pcbnew/dialogs/panel_setup_rules.cpp b/pcbnew/dialogs/panel_setup_rules.cpp index 68fbc558df..5a44e80ccd 100644 --- a/pcbnew/dialogs/panel_setup_rules.cpp +++ b/pcbnew/dialogs/panel_setup_rules.cpp @@ -47,6 +47,8 @@ #include #include #include +#include +#include PANEL_SETUP_RULES::PANEL_SETUP_RULES( wxWindow* aParentWindow, PCB_EDIT_FRAME* aFrame ) : PANEL_SETUP_RULES_BASE( aParentWindow ), diff --git a/pcbnew/drc/drc_rule_parser.cpp b/pcbnew/drc/drc_rule_parser.cpp index 5eeec9d7c8..7d27b45d38 100644 --- a/pcbnew/drc/drc_rule_parser.cpp +++ b/pcbnew/drc/drc_rule_parser.cpp @@ -30,6 +30,8 @@ #include #include #include +#include +#include using namespace DRCRULE_T; diff --git a/pcbnew/drc/drc_test_provider.cpp b/pcbnew/drc/drc_test_provider.cpp index c60da7c5b8..79158b27bd 100644 --- a/pcbnew/drc/drc_test_provider.cpp +++ b/pcbnew/drc/drc_test_provider.cpp @@ -29,6 +29,8 @@ #include #include #include +#include +#include // A list of all basic (ie: non-compound) board geometry items diff --git a/pcbnew/drc/rule_editor/panel_drc_rule_editor.cpp b/pcbnew/drc/rule_editor/panel_drc_rule_editor.cpp index f25c54d2e7..26e5d80d55 100644 --- a/pcbnew/drc/rule_editor/panel_drc_rule_editor.cpp +++ b/pcbnew/drc/rule_editor/panel_drc_rule_editor.cpp @@ -71,6 +71,8 @@ #include "drc_re_permitted_layers_constraint_data.h" #include "drc_re_allowed_orientation_constraint_data.h" #include "drc_re_custom_rule_constraint_data.h" +#include +#include static constexpr const wxChar* KI_TRACE_DRC_RULE_EDITOR = wxT( "KI_TRACE_DRC_RULE_EDITOR" ); diff --git a/pcbnew/exporters/step/exporter_step.cpp b/pcbnew/exporters/step/exporter_step.cpp index a4b630ebce..afe98a5442 100644 --- a/pcbnew/exporters/step/exporter_step.cpp +++ b/pcbnew/exporters/step/exporter_step.cpp @@ -58,6 +58,7 @@ #include #include +#include #include // To use GetRunningMicroSecs or another profiling utility #define OCC_VERSION_MIN 0x070500 diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index fd956734be..c61d5f810f 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -73,6 +73,8 @@ #include #include #include +#include +#include FOOTPRINT::FOOTPRINT( BOARD* parent ) : diff --git a/pcbnew/generators/pcb_tuning_pattern.cpp b/pcbnew/generators/pcb_tuning_pattern.cpp index 0d8be988c0..7b81c2c950 100644 --- a/pcbnew/generators/pcb_tuning_pattern.cpp +++ b/pcbnew/generators/pcb_tuning_pattern.cpp @@ -75,6 +75,8 @@ #include #include +#include +#include TUNING_STATUS_VIEW_ITEM::TUNING_STATUS_VIEW_ITEM( PCB_BASE_EDIT_FRAME* aFrame ) : EDA_ITEM( NOT_USED ), // Never added to anything - just a preview diff --git a/pcbnew/pad.cpp b/pcbnew/pad.cpp index 46dfef84db..d9d4c9690c 100644 --- a/pcbnew/pad.cpp +++ b/pcbnew/pad.cpp @@ -52,6 +52,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/pcbnew/padstack.cpp b/pcbnew/padstack.cpp index 53c9a17978..008915d3f5 100644 --- a/pcbnew/padstack.cpp +++ b/pcbnew/padstack.cpp @@ -30,6 +30,8 @@ #include #include #include +#include +#include IMPLEMENT_ENUM_TO_WXANY( PAD_DRILL_POST_MACHINING_MODE ); diff --git a/pcbnew/pcb_barcode.cpp b/pcbnew/pcb_barcode.cpp index 6193d8e5fe..d5c9795c77 100644 --- a/pcbnew/pcb_barcode.cpp +++ b/pcbnew/pcb_barcode.cpp @@ -49,6 +49,8 @@ #include #include +#include +#include PCB_BARCODE::PCB_BARCODE( BOARD_ITEM* aParent ) : BOARD_ITEM( aParent, PCB_BARCODE_T ), @@ -843,6 +845,5 @@ static struct PCB_BARCODE_DESC } } _PCB_BARCODE_DESC; -// wxAny conversion implementations for enum properties (declarations in header) IMPLEMENT_ENUM_TO_WXANY( BARCODE_T ); IMPLEMENT_ENUM_TO_WXANY( BARCODE_ECC_T ); diff --git a/pcbnew/pcb_dimension.cpp b/pcbnew/pcb_dimension.cpp index 37641570b7..e44804fa0b 100644 --- a/pcbnew/pcb_dimension.cpp +++ b/pcbnew/pcb_dimension.cpp @@ -45,6 +45,8 @@ #include #include #include +#include +#include static const int INWARD_ARROW_LENGTH_TO_HEAD_RATIO = 2; diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 1a3ef8afbc..4f01c02cf1 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -99,6 +99,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/pcbnew/pcb_field.cpp b/pcbnew/pcb_field.cpp index b96a822714..50e4eff3cf 100644 --- a/pcbnew/pcb_field.cpp +++ b/pcbnew/pcb_field.cpp @@ -31,6 +31,8 @@ #include #include #include +#include +#include PCB_FIELD::PCB_FIELD( FOOTPRINT* aParent, FIELD_T aFieldId, const wxString& aName ) : diff --git a/pcbnew/pcb_generator.cpp b/pcbnew/pcb_generator.cpp index 50ea185871..d619e2b592 100644 --- a/pcbnew/pcb_generator.cpp +++ b/pcbnew/pcb_generator.cpp @@ -25,6 +25,8 @@ #include "pcb_generator.h" #include +#include +#include PCB_GENERATOR::PCB_GENERATOR( BOARD_ITEM* aParent, PCB_LAYER_ID aLayer ) : diff --git a/pcbnew/pcb_group.cpp b/pcbnew/pcb_group.cpp index a6589e3fc7..5afdefe924 100644 --- a/pcbnew/pcb_group.cpp +++ b/pcbnew/pcb_group.cpp @@ -41,6 +41,8 @@ #include #include +#include +#include PCB_GROUP::PCB_GROUP( BOARD_ITEM* aParent ) : BOARD_ITEM( aParent, PCB_GROUP_T ) diff --git a/pcbnew/pcb_io/ipc2581/pcb_io_ipc2581.cpp b/pcbnew/pcb_io/ipc2581/pcb_io_ipc2581.cpp index ff6aecb7bf..2590fd25fb 100644 --- a/pcbnew/pcb_io/ipc2581/pcb_io_ipc2581.cpp +++ b/pcbnew/pcb_io/ipc2581/pcb_io_ipc2581.cpp @@ -47,6 +47,8 @@ #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 356a95ba80..ecddedb708 100644 --- a/pcbnew/pcb_io/kicad_legacy/pcb_io_kicad_legacy.cpp +++ b/pcbnew/pcb_io/kicad_legacy/pcb_io_kicad_legacy.cpp @@ -68,6 +68,7 @@ #include #include #include +#include #include #include diff --git a/pcbnew/pcb_marker.cpp b/pcbnew/pcb_marker.cpp index 4a75c32a01..1c6532d06c 100644 --- a/pcbnew/pcb_marker.cpp +++ b/pcbnew/pcb_marker.cpp @@ -38,6 +38,8 @@ #include #include #include +#include +#include /// Factor to convert the maker unit shape to internal units: diff --git a/pcbnew/pcb_point.cpp b/pcbnew/pcb_point.cpp index 4dcfb31103..5d97ff6101 100644 --- a/pcbnew/pcb_point.cpp +++ b/pcbnew/pcb_point.cpp @@ -36,6 +36,8 @@ #include #include #include +#include +#include static const double DEFAULT_PT_SIZE_MM = 1.0; diff --git a/pcbnew/pcb_reference_image.cpp b/pcbnew/pcb_reference_image.cpp index 8c1351f899..308c8c49bb 100644 --- a/pcbnew/pcb_reference_image.cpp +++ b/pcbnew/pcb_reference_image.cpp @@ -40,6 +40,8 @@ #include #include +#include +#include using KIGFX::PCB_PAINTER; using KIGFX::PCB_RENDER_SETTINGS; diff --git a/pcbnew/pcb_shape.cpp b/pcbnew/pcb_shape.cpp index ecd01846fb..08313bb8ea 100644 --- a/pcbnew/pcb_shape.cpp +++ b/pcbnew/pcb_shape.cpp @@ -46,6 +46,8 @@ #include #include #include +#include +#include PCB_SHAPE::PCB_SHAPE( BOARD_ITEM* aParent, KICAD_T aItemType, SHAPE_T aShapeType ) : diff --git a/pcbnew/pcb_table.cpp b/pcbnew/pcb_table.cpp index a8b8abba71..8c7d24f462 100644 --- a/pcbnew/pcb_table.cpp +++ b/pcbnew/pcb_table.cpp @@ -31,6 +31,8 @@ #include #include #include // for PCB_RENDER_SETTINGS +#include +#include PCB_TABLE::PCB_TABLE( BOARD_ITEM* aParent, int aLineWidth ) : diff --git a/pcbnew/pcb_tablecell.cpp b/pcbnew/pcb_tablecell.cpp index d88891b0a7..7533b70773 100644 --- a/pcbnew/pcb_tablecell.cpp +++ b/pcbnew/pcb_tablecell.cpp @@ -30,6 +30,8 @@ #include #include #include +#include +#include PCB_TABLECELL::PCB_TABLECELL( BOARD_ITEM* aParent ) : diff --git a/pcbnew/pcb_target.cpp b/pcbnew/pcb_target.cpp index 8de8095cd3..3f6a85fa89 100644 --- a/pcbnew/pcb_target.cpp +++ b/pcbnew/pcb_target.cpp @@ -36,6 +36,8 @@ #include #include #include +#include +#include PCB_TARGET::PCB_TARGET( BOARD_ITEM* aParent ) : diff --git a/pcbnew/pcb_text.cpp b/pcbnew/pcb_text.cpp index f8c8fdf773..e4913a3527 100644 --- a/pcbnew/pcb_text.cpp +++ b/pcbnew/pcb_text.cpp @@ -46,6 +46,8 @@ #include #include #include +#include +#include PCB_TEXT::PCB_TEXT( BOARD_ITEM* parent, KICAD_T idtype ) : diff --git a/pcbnew/pcb_textbox.cpp b/pcbnew/pcb_textbox.cpp index 3159f915d2..777ee2af57 100644 --- a/pcbnew/pcb_textbox.cpp +++ b/pcbnew/pcb_textbox.cpp @@ -43,6 +43,8 @@ #include #include #include +#include +#include PCB_TEXTBOX::PCB_TEXTBOX( BOARD_ITEM* aParent, KICAD_T aType ) : diff --git a/pcbnew/pcb_track.cpp b/pcbnew/pcb_track.cpp index 4016f6d49a..3cce238d5a 100644 --- a/pcbnew/pcb_track.cpp +++ b/pcbnew/pcb_track.cpp @@ -50,6 +50,8 @@ #include #include #include +#include +#include #include #include diff --git a/pcbnew/pcbexpr_evaluator.cpp b/pcbnew/pcbexpr_evaluator.cpp index 78b2524b53..8cb4c8a235 100644 --- a/pcbnew/pcbexpr_evaluator.cpp +++ b/pcbnew/pcbexpr_evaluator.cpp @@ -23,6 +23,8 @@ #include "pcbexpr_evaluator.h" +#include + #include #include #include diff --git a/pcbnew/pcbexpr_functions.cpp b/pcbnew/pcbexpr_functions.cpp index 5cc7901f48..88eb2f600c 100644 --- a/pcbnew/pcbexpr_functions.cpp +++ b/pcbnew/pcbexpr_functions.cpp @@ -39,6 +39,8 @@ #include #include #include +#include +#include bool fromToFunc( LIBEVAL::CONTEXT* aCtx, void* self ) diff --git a/pcbnew/pcbnew_jobs_handler.cpp b/pcbnew/pcbnew_jobs_handler.cpp index d4724a14fe..bdff8d3862 100644 --- a/pcbnew/pcbnew_jobs_handler.cpp +++ b/pcbnew/pcbnew_jobs_handler.cpp @@ -19,6 +19,7 @@ */ #include +#include #include "pcbnew_jobs_handler.h" #include #include diff --git a/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp b/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp index daf39fd7f0..7d9b1b4cb3 100644 --- a/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp +++ b/pcbnew/python/scripting/pcbnew_scripting_helpers.cpp @@ -61,6 +61,8 @@ #include #include #include +#include +#include static PCB_EDIT_FRAME* s_PcbEditFrame = nullptr; static SETTINGS_MANAGER* s_SettingsManager = nullptr; diff --git a/pcbnew/router/pns_logger.cpp b/pcbnew/router/pns_logger.cpp index 570831ed16..719afe94dc 100644 --- a/pcbnew/router/pns_logger.cpp +++ b/pcbnew/router/pns_logger.cpp @@ -24,6 +24,7 @@ #include "pns_via.h" #include +#include namespace PNS { diff --git a/pcbnew/tools/generator_tool.cpp b/pcbnew/tools/generator_tool.cpp index ca85e6bc0a..0a9beeafd6 100644 --- a/pcbnew/tools/generator_tool.cpp +++ b/pcbnew/tools/generator_tool.cpp @@ -31,6 +31,8 @@ #include #include +#include +#include GENERATOR_TOOL::GENERATOR_TOOL() : diff --git a/pcbnew/widgets/pcb_net_inspector_panel.cpp b/pcbnew/widgets/pcb_net_inspector_panel.cpp index 47a91f8108..2229f45d8b 100644 --- a/pcbnew/widgets/pcb_net_inspector_panel.cpp +++ b/pcbnew/widgets/pcb_net_inspector_panel.cpp @@ -17,6 +17,7 @@ * with this program. If not, see . */ +#include #include #include @@ -44,6 +45,7 @@ #include #include +#include PCB_NET_INSPECTOR_PANEL::PCB_NET_INSPECTOR_PANEL( wxWindow* parent, PCB_EDIT_FRAME* aFrame ) : NET_INSPECTOR_PANEL( parent, aFrame ), diff --git a/pcbnew/widgets/pcb_properties_panel.cpp b/pcbnew/widgets/pcb_properties_panel.cpp index bff6474f62..761709da48 100644 --- a/pcbnew/widgets/pcb_properties_panel.cpp +++ b/pcbnew/widgets/pcb_properties_panel.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/pcbnew/zone.cpp b/pcbnew/zone.cpp index c779f34e51..1b37f69894 100644 --- a/pcbnew/zone.cpp +++ b/pcbnew/zone.cpp @@ -37,6 +37,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/qa/tests/common/test_property.cpp b/qa/tests/common/test_property.cpp index 1441ef2cc0..3644da71a5 100644 --- a/qa/tests/common/test_property.cpp +++ b/qa/tests/common/test_property.cpp @@ -21,7 +21,7 @@ #include #include // wxPoint -#include +#include #include using namespace std; diff --git a/qa/tests/common/test_types.cpp b/qa/tests/common/test_types.cpp index 9a077c51b2..01def0bb8c 100644 --- a/qa/tests/common/test_types.cpp +++ b/qa/tests/common/test_types.cpp @@ -25,6 +25,8 @@ // Code under test #include +#include +#include /** diff --git a/qa/tests/eeschema/test_ee_item.cpp b/qa/tests/eeschema/test_ee_item.cpp index b701c76fde..02e2f645d3 100644 --- a/qa/tests/eeschema/test_ee_item.cpp +++ b/qa/tests/eeschema/test_ee_item.cpp @@ -21,6 +21,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include #include #include #include @@ -48,6 +49,7 @@ #include #include +#include class TEST_EE_ITEM_FIXTURE { diff --git a/qa/tests/eeschema/test_sch_rtree.cpp b/qa/tests/eeschema/test_sch_rtree.cpp index e1e3df63a9..4a003dfb12 100644 --- a/qa/tests/eeschema/test_sch_rtree.cpp +++ b/qa/tests/eeschema/test_sch_rtree.cpp @@ -26,6 +26,7 @@ * Test suite for SCH_SHEET */ +#include #include #include #include @@ -37,6 +38,7 @@ #include #include +#include class TEST_SCH_RTREE_FIXTURE { diff --git a/qa/tests/pcbnew/test_board_item.cpp b/qa/tests/pcbnew/test_board_item.cpp index 4e11f2938e..cb9bfbfaca 100644 --- a/qa/tests/pcbnew/test_board_item.cpp +++ b/qa/tests/pcbnew/test_board_item.cpp @@ -46,6 +46,8 @@ #include #include #include +#include +#include class TEST_BOARD_ITEM_FIXTURE { diff --git a/qa/tests/pcbnew/test_libeval_compiler.cpp b/qa/tests/pcbnew/test_libeval_compiler.cpp index 47443b39ae..42ebe4d461 100644 --- a/qa/tests/pcbnew/test_libeval_compiler.cpp +++ b/qa/tests/pcbnew/test_libeval_compiler.cpp @@ -31,6 +31,8 @@ #include #include #include +#include +#include BOOST_AUTO_TEST_SUITE( Libeval_Compiler ) diff --git a/qa/tools/drc_proto/drc_proto_test.cpp b/qa/tools/drc_proto/drc_proto_test.cpp index cfa7b90dc2..c0e79936bb 100644 --- a/qa/tools/drc_proto/drc_proto_test.cpp +++ b/qa/tools/drc_proto/drc_proto_test.cpp @@ -30,6 +30,7 @@ #include #include +#include #include diff --git a/qa/tools/libeval_compiler/libeval_compiler_test.cpp b/qa/tools/libeval_compiler/libeval_compiler_test.cpp index 01687a68a6..51d4eeffd2 100644 --- a/qa/tools/libeval_compiler/libeval_compiler_test.cpp +++ b/qa/tools/libeval_compiler/libeval_compiler_test.cpp @@ -12,6 +12,8 @@ #include #include +#include +#include bool testEvalExpr( const std::string expr, LIBEVAL::VALUE expectedResult, bool expectError = false, BOARD_ITEM* itemA = nullptr, BOARD_ITEM* itemB = nullptr )