Remove property.h and property_mgr.h from inspectable.h

This breaks the view_item.h -> inspectable.h -> property.h chain that
pulled wx/propgrid/property.h into 150-200 TUs. The lean inspectable.h
now includes only wx/any.h, wx/string.h, wx/variant.h.

Headers using DECLARE_ENUM_TO_WXANY (board_item.h, sch_item.h) retain
their property.h include since the macro requires it.
This commit is contained in:
Seth Hillbrand
2026-02-13 15:01:06 -08:00
parent d45f46a900
commit 6c9c75eb07
113 changed files with 389 additions and 124 deletions
+1 -1
View File
@@ -39,7 +39,7 @@
#include <vector>
#include "plugins/3dapi/sg_base.h"
#include "plugins/3dapi/sg_types.h"
#include <glm/glm.hpp>
#include <glm/fwd.hpp>
class SGNORMALS;
class SGCOORDS;
+1
View File
@@ -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
+2
View File
@@ -35,6 +35,8 @@
#include <wx/fdrepdlg.h>
#include <wx/regex.h>
#include <eda_pattern_match.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
EDA_ITEM::EDA_ITEM( EDA_ITEM* parent, KICAD_T idType, bool isSCH_ITEM, bool isBOARD_ITEM ) :
KIGFX::VIEW_ITEM( isSCH_ITEM, isBOARD_ITEM ),
+2
View File
@@ -40,6 +40,8 @@
#include <macros.h>
#include <algorithm>
#include <properties/property_validators.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
#include <math/util.h> // for KiROUND
#include <eda_item.h>
#include <plotters/plotter.h>
+2
View File
@@ -50,6 +50,8 @@
#include <font/outline_font.h>
#include <geometry/shape_poly_set.h>
#include <properties/property_validators.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
#include <ctl_flags.h>
#include <markup_parser.h>
#include <api/api_enums.h>
+1
View File
@@ -28,6 +28,7 @@
#include <nanosvg.h>
#include <algorithm>
#include <cmath>
#include <wx/math.h>
#include <locale_io.h>
#include <eda_item.h>
+79
View File
@@ -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 <tomasz.wlostowski@cern.ch>
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <inspectable_impl.h>
#include <wx/propgrid/property.h>
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<int>( object, aValue.GetInteger() );
else
aProperty->set<wxString>( object, choices.GetLabel( aValue.GetInteger() ) );
}
else
{
aProperty->set<wxVariant>( 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();
}
+1
View File
@@ -18,6 +18,7 @@
*/
#include <eda_draw_frame.h>
#include <properties/color4d_variant.h>
#include <properties/std_optional_variants.h>
#include <properties/eda_angle_variant.h>
#include <properties/pg_editors.h>
+10
View File
@@ -36,6 +36,11 @@ static const std::map<PROPERTY_BASE*, int> EMPTY_PROP_DISPLAY_ORDER;
std::vector<wxString> 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<std::pair<size_t, wxString>> replaced;
+2
View File
@@ -26,6 +26,8 @@
#include <import_export.h>
#include <pgm_base.h>
#include <properties/pg_cell_renderer.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
#include <algorithm>
#include <iterator>
+1
View File
@@ -23,6 +23,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wx/tokenzr.h>
#include <fmt.h>
#include <kiface_base.h>
#include <kiway.h>
@@ -36,6 +36,7 @@
* referred to as plugins, but they are really just external binaries.
*/
#include <properties/property.h>
#include <pgm_base.h>
#include <kiface_base.h>
#include <string_utils.h>
@@ -61,6 +62,7 @@
#include <thread>
#include <vector>
#include <properties/property_mgr.h>
namespace
+1
View File
@@ -20,6 +20,7 @@
*/
#include <algorithm>
#include <wx/tokenzr.h>
#include <widgets/wx_grid.h>
#include <widgets/std_bitmap_button.h>
#include <confirm.h>
+2
View File
@@ -44,6 +44,8 @@
#include <memory>
#include <unordered_set>
#include <advanced_config.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
/**
@@ -27,6 +27,7 @@
#define NETLIST_EXPORTER_ALLEGRO_H
#include "netlist_exporter_base.h"
#include <list>
/**
* Generate a netlist compatible with Allegro.
@@ -32,6 +32,8 @@
#include <sim/sim_model.h>
#include <sim/spice_generator.h>
#include <list>
class wxWindow;
+2
View File
@@ -40,6 +40,8 @@
#include <trigo.h>
#include <wx/mstream.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
SCH_BITMAP::SCH_BITMAP( const VECTOR2I& pos ) :
+2
View File
@@ -41,6 +41,8 @@
#include <connection_graph.h>
#include "sch_painter.h"
#include "plotters/plotter.h"
#include <properties/property.h>
#include <properties/property_mgr.h>
SCH_BUS_ENTRY_BASE::SCH_BUS_ENTRY_BASE( KICAD_T aType, const VECTOR2I& pos, bool aFlipY ) :
+2
View File
@@ -40,6 +40,8 @@
#include <tools/sch_navigate_tool.h>
#include <font/outline_font.h>
#include "sim/sim_lib_mgr.h"
#include <properties/property.h>
#include <properties/property_mgr.h>
static const std::vector<KICAD_T> labelTypes = { SCH_LABEL_LOCATE_ANY_T };
+2
View File
@@ -34,6 +34,8 @@
#include <view/view.h>
#include <wx/debug.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
SCH_GROUP::SCH_GROUP() : SCH_ITEM( nullptr, SCH_GROUP_T )
{
@@ -23,6 +23,7 @@
#include <utility>
#include <wx/datetime.h>
#include <wx/log.h>
#include <wx/tokenzr.h>
#include <boost/algorithm/string.hpp>
@@ -20,6 +20,7 @@
#include <wx/log.h>
#include <wx/tokenzr.h>
#include <fmt.h>
#include <lib_symbol.h>
@@ -19,6 +19,7 @@
#include <magic_enum.hpp>
#include <wx/log.h>
#include <wx/tokenzr.h>
#include <common.h>
#include <kiplatform/io.h>
@@ -29,6 +29,7 @@
#include <sch_screen.h>
#include <wx/log.h>
#include <wx/dir.h>
#include <wx/tokenzr.h>
#include <wildcards_and_files_ext.h>
#include <sch_sheet.h>
#include <schematic.h>
+2
View File
@@ -36,6 +36,8 @@
#include <project/project_file.h>
#include <project/net_settings.h>
#include <font/kicad_font_name.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
// Rendering fonts is expensive (particularly when using outline fonts). At small effective
+2
View File
@@ -30,6 +30,7 @@
#include <set>
#include <eda_item.h>
#include <properties/property.h>
#include <sch_sheet_path.h>
#include <netclass.h>
#include <stroke_params.h>
@@ -800,3 +801,4 @@ private:
#ifndef SWIG
DECLARE_ENUM_TO_WXANY( SCH_LAYER_ID );
#endif
+2
View File
@@ -38,6 +38,8 @@
#include <settings/color_settings.h>
#include <connection_graph.h>
#include <string_utils.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
SCH_JUNCTION::SCH_JUNCTION( const VECTOR2I& aPosition, int aDiameter, SCH_LAYER_ID aLayer ) :
+2
View File
@@ -54,6 +54,8 @@
#include <magic_enum.hpp>
#include <api/api_utils.h>
#include <api/schematic/schematic_types.pb.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
/* Coding polygons for global symbol graphic shapes.
+1
View File
@@ -42,6 +42,7 @@
#include <api/api_utils.h>
#include <api/schematic/schematic_types.pb.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
#include <origin_transforms.h>
#include <math/util.h>
+2
View File
@@ -39,6 +39,8 @@
#include <trace_helpers.h>
#include <trigo.h>
#include <string_utils.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
wxString FormatStackedPinForDisplay( const wxString& aPinNumber, int aPinLength, int aTextSize, KIFONT::FONT* aFont,
const KIFONT::METRICS& aFontMetrics )
+2
View File
@@ -38,6 +38,8 @@
#include <sch_screen.h>
#include <sch_sheet_path.h>
#include <geometry/shape_rect.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
SCH_RULE_AREA::~SCH_RULE_AREA()
+2
View File
@@ -33,6 +33,8 @@
#include <geometry/geometry_utils.h>
#include <schematic.h>
#include <sch_shape.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
SCH_SHAPE::SCH_SHAPE( SHAPE_T aShape, SCH_LAYER_ID aLayer, int aLineWidth, FILL_T aFillType,
+2
View File
@@ -49,6 +49,8 @@
#include <trace_helpers.h>
#include <validators.h>
#include <properties/property_validators.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
#include <pgm_base.h>
#include <wx/log.h>
+2
View File
@@ -36,6 +36,8 @@
#include <sch_painter.h>
#include <schematic.h>
#include <trigo.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
SCH_SHEET_PIN::SCH_SHEET_PIN( SCH_SHEET* parent, const VECTOR2I& pos, const wxString& text ) :
+2
View File
@@ -45,6 +45,8 @@
#include <utility>
#include <validators.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
std::unordered_map<TRANSFORM, int> SCH_SYMBOL::s_transformToOrientationCache;
+2
View File
@@ -34,6 +34,8 @@
#include <wx/log.h>
#include <sch_table.h>
#include <geometry/geometry_utils.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
SCH_TABLE::SCH_TABLE( int aLineWidth ) :
+2
View File
@@ -28,6 +28,8 @@
#include <string_utils.h>
#include <sch_table.h>
#include <sch_tablecell.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
SCH_TABLECELL::SCH_TABLECELL( int aLineWidth, FILL_T aFillType ) :
+2
View File
@@ -48,6 +48,8 @@
#include <tools/sch_navigate_tool.h>
#include <trigo.h>
#include <markup_parser.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
SCH_TEXT::SCH_TEXT( const VECTOR2I& aPos, const wxString& aText, SCH_LAYER_ID aLayer, KICAD_T aType ) :
+2
View File
@@ -40,6 +40,8 @@
#include <sch_textbox.h>
#include <tools/sch_navigate_tool.h>
#include <markup_parser.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
SCH_TEXTBOX::SCH_TEXTBOX( SCH_LAYER_ID aLayer, int aLineWidth, FILL_T aFillType, const wxString& aText,
+1
View File
@@ -20,6 +20,7 @@
#include <advanced_config.h>
#include <algorithm>
#include <common.h>
#include <inspectable_impl.h>
#include <set>
#include <bus_alias.h>
#include <commit.h>
+1
View File
@@ -26,6 +26,7 @@
#include <memory>
#include <wx/debug.h>
#include <wx/tokenzr.h>
#include <project/project_file.h>
#include <confirm.h>
+1
View File
@@ -23,6 +23,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wx/tokenzr.h>
#include <ki_exception.h>
#include <lib_symbol.h>
#include <sch_symbol.h>
+1
View File
@@ -25,6 +25,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wx/tokenzr.h>
#include "sim_plot_colors.h"
#include "sim_plot_tab.h"
#include "simulator_frame.h"
+1
View File
@@ -35,6 +35,7 @@
#include <wx/debug.h>
#include <wx/clipbrd.h>
#include <wx/log.h>
#include <wx/tokenzr.h>
#include <project/project_file.h>
#include <sch_edit_frame.h>
+1
View File
@@ -23,6 +23,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wx/tokenzr.h>
#include <bitmaps.h>
#include <symbol_library_common.h>
#include <confirm.h>
@@ -29,6 +29,7 @@
#include <properties/pg_editors.h>
#include <properties/pg_properties.h>
#include <properties/property_mgr.h>
#include <properties/property.h>
#include <sch_commit.h>
#include <sch_edit_frame.h>
#include <sch_sheet.h>
+1 -1
View File
@@ -29,6 +29,7 @@
#include <eda_item.h>
#include <geometry/approximation.h>
#include <layer_ids.h>
#include <properties/property.h>
#include <lseq.h>
#include <lset.h>
#include <stroke_params.h>
@@ -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.
*
@@ -27,6 +27,7 @@
#define DS_PROXY_VIEW_ITEM_H
#include <eda_item.h>
#include <eda_units.h>
class BOARD;
class PAGE_INFO;
+1
View File
@@ -526,3 +526,4 @@ DECLARE_ENUM_TO_WXANY( SHAPE_T );
DECLARE_ENUM_TO_WXANY( LINE_STYLE );
DECLARE_ENUM_TO_WXANY( UI_FILL_MODE );
#endif
+16 -120
View File
@@ -23,13 +23,14 @@
#ifndef INSPECTABLE_H
#define INSPECTABLE_H
#include <core/wx_stl_compat.h>
#include <properties/property_mgr.h>
#include <properties/property.h>
#include <wx/any.h>
#include <wx/string.h>
#include <wx/variant.h>
#include <optional>
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 <typename T>
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 <typename T>
bool Set( const wxString& aProperty, T aValue, bool aNotify = true );
template<typename T>
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<T>( object, aValue );
template <typename T>
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<int>( object, aValue.GetInteger() );
else
aProperty->set<wxString>( object, choices.GetLabel( aValue.GetInteger() ) );
}
else
aProperty->set<wxVariant>( object, aValue );
if( aNotify )
propMgr.PropertyChanged( this, aProperty );
}
return object != nullptr;
}
template<typename T>
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<T>( 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<typename T>
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<T>( object );
}
template<typename T>
std::optional<T> 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<T> ret;
if( prop )
{
const void* object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
if( object )
ret = prop->get<T>( object );
}
return ret;
}
template <typename T>
std::optional<T> Get( const wxString& aProperty ) const;
};
#endif /* INSPECTABLE_H */
+102
View File
@@ -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 <tomasz.wlostowski@cern.ch>
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INSPECTABLE_IMPL_H
#define INSPECTABLE_IMPL_H
#include <inspectable.h>
#include <properties/property_mgr.h>
#include <properties/property.h>
template <typename T>
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<T>( object, aValue );
if( aNotify )
propMgr.PropertyChanged( this, aProperty );
}
return object != nullptr;
}
template <typename T>
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<T>( object, aValue );
if( aNotify )
propMgr.PropertyChanged( this, prop );
}
}
return object != nullptr;
}
template <typename T>
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<T>( object );
}
template <typename T>
std::optional<T> 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<T> ret;
if( prop )
{
const void* object = propMgr.TypeCast( this, thisType, prop->OwnerHash() );
if( object )
ret = prop->get<T>( object );
}
return ret;
}
#endif /* INSPECTABLE_IMPL_H */
+1
View File
@@ -25,6 +25,7 @@
#define PREVIEW_ITEMS_ARC_ASSISTANT_H
#include <eda_item.h>
#include <eda_units.h>
#include <preview_items/arc_geom_manager.h>
#include <layer_ids.h>
+1
View File
@@ -24,6 +24,7 @@
#pragma once
#include <eda_item.h>
#include <eda_units.h>
#include <preview_items/bezier_geom_manager.h>
#include <layer_ids.h>
+1
View File
@@ -27,6 +27,7 @@
#include <optional>
#include <eda_item.h>
#include <eda_units.h>
#include <gal/color4d.h>
#include <preview_items/two_point_geom_manager.h>
@@ -25,6 +25,7 @@
#define PREVIEW_ITEMS_TWO_POINT_ASSISTANT_H
#include <eda_item.h>
#include <eda_units.h>
#include <preview_items/two_point_geom_manager.h>
#include <layer_ids.h>
+6
View File
@@ -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;
+1
View File
@@ -31,6 +31,7 @@
#include <tool/edit_points.h>
#include <view/view_controls.h>
class COMMIT;
class SHAPE_POLY_SET;
/**
+1
View File
@@ -27,6 +27,7 @@
#pragma once
#include <gal/gal.h>
#include <map>
#include <vector>
#include <set>
#include <unordered_map>
+1
View File
@@ -26,6 +26,7 @@
#pragma once
#include <gal/color4d.h>
#include <gal/gal.h>
#include <view/view_item.h>
#include <vector>
@@ -24,6 +24,8 @@
#include <calculator_panels/panel_transline.h>
#include <pcb_calculator_settings.h>
#include <widgets/std_bitmap_button.h>
#include <properties/property_mgr.h>
#include <properties/property.h>
PANEL_TRANSLINE::PANEL_TRANSLINE( wxWindow* parent, wxWindowID id, const wxPoint& pos,
+2
View File
@@ -26,6 +26,8 @@
#include <common_data.h>
#include <widgets/unit_selector.h>
#include <pcb_calculator_utils.h>
#include <properties/property_mgr.h>
#include <properties/property.h>
extern double DoubleFromString( const wxString& TextValue );
+2
View File
@@ -41,6 +41,8 @@
#include "pcb_calculator_settings.h"
#include "widgets/unit_selector.h"
#include "transline_ident.h"
#include <properties/property_mgr.h>
#include <properties/property.h>
TRANSLINE_PRM::TRANSLINE_PRM( PRM_TYPE aType, PRMS_ID aId, const char* aKeywordCfg, const wxString& aDlgLabel,
+1
View File
@@ -19,6 +19,7 @@
*/
#include <magic_enum.hpp>
#include <properties/property.h>
#include <common.h>
#include <api/api_handler_pcb.h>
+2
View File
@@ -31,6 +31,8 @@
#include <connectivity/connectivity_data.h>
#include <lset.h>
#include <properties/property_validators.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
#include <string_utils.h>
#include <i18n_utility.h>
#include <netinfo.h>
+2
View File
@@ -36,6 +36,8 @@
#include <pcb_generator.h>
#include <footprint.h>
#include <font/font.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
bool BOARD_ITEM::IsGroupableType() const
@@ -33,6 +33,7 @@
#include <connectivity/connectivity_data.h>
#include <connectivity/connectivity_algo.h>
#include <properties/property.h>
#include <connectivity/from_to_cache.h>
#include <board_item.h>
#include <project/net_settings.h>
@@ -44,6 +45,7 @@
#include <thread_pool.h>
#include <trigo.h>
#include <drc/drc_rtree.h>
#include <properties/property_mgr.h>
CONNECTIVITY_DATA::CONNECTIVITY_DATA() :
m_skipRatsnestUpdate( false )
+1
View File
@@ -31,6 +31,7 @@
* Note: these ports must be enabled for firewall protection
*/
#include <wx/tokenzr.h>
#include <board.h>
#include <board_design_settings.h>
#include <fmt.h>
@@ -39,6 +39,7 @@
#include <richio.h>
#include <tool/grid_menu.h>
#include <widgets/wx_html_report_panel.h>
#include <wx/tokenzr.h>
#include <wx/valtext.h>
@@ -27,6 +27,7 @@
#include "dialog_footprint_properties_fp_editor.h"
#include <wx/debug.h>
#include <wx/tokenzr.h>
#include <3d_rendering/opengl/3d_model.h>
#include <3d_viewer/eda_3d_viewer_frame.h>
+2
View File
@@ -47,6 +47,8 @@
#include <wildcards_and_files_ext.h>
#include <regex>
#include <unordered_map>
#include <properties/property.h>
#include <properties/property_mgr.h>
PANEL_SETUP_RULES::PANEL_SETUP_RULES( wxWindow* aParentWindow, PCB_EDIT_FRAME* aFrame ) :
PANEL_SETUP_RULES_BASE( aParentWindow ),
+2
View File
@@ -30,6 +30,8 @@
#include <pcbexpr_evaluator.h>
#include <reporter.h>
#include <component_classes/component_class_assignment_rule.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
using namespace DRCRULE_T;
+2
View File
@@ -29,6 +29,8 @@
#include <pad.h>
#include <zone.h>
#include <pcb_text.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
// A list of all basic (ie: non-compound) board geometry items
@@ -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 <properties/property.h>
#include <properties/property_mgr.h>
static constexpr const wxChar* KI_TRACE_DRC_RULE_EDITOR = wxT( "KI_TRACE_DRC_RULE_EDITOR" );
+1
View File
@@ -58,6 +58,7 @@
#include <wx/crt.h>
#include <wx/log.h>
#include <wx/tokenzr.h>
#include <core/profile.h> // To use GetRunningMicroSecs or another profiling utility
#define OCC_VERSION_MIN 0x070500
+2
View File
@@ -73,6 +73,8 @@
#include <api/api_enums.h>
#include <api/api_utils.h>
#include <api/api_pcb_utils.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
FOOTPRINT::FOOTPRINT( BOARD* parent ) :
+2
View File
@@ -75,6 +75,8 @@
#include <dialogs/dialog_tuning_pattern_properties.h>
#include <generators/pcb_tuning_pattern.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
TUNING_STATUS_VIEW_ITEM::TUNING_STATUS_VIEW_ITEM( PCB_BASE_EDIT_FRAME* aFrame ) :
EDA_ITEM( NOT_USED ), // Never added to anything - just a preview
+2
View File
@@ -52,6 +52,8 @@
#include <widgets/msgpanel.h>
#include <pcb_painter.h>
#include <properties/property_validators.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
#include <wx/log.h>
#include <api/api_enums.h>
#include <api/api_utils.h>
+2
View File
@@ -30,6 +30,8 @@
#include <pad.h>
#include <board.h>
#include <pcb_shape.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
IMPLEMENT_ENUM_TO_WXANY( PAD_DRILL_POST_MACHINING_MODE );
+2 -1
View File
@@ -49,6 +49,8 @@
#include <backend/zint.h>
#include <board_design_settings.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
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 );
+2
View File
@@ -45,6 +45,8 @@
#include <api/api_enums.h>
#include <api/api_utils.h>
#include <api/board/board_types.pb.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
static const int INWARD_ARROW_LENGTH_TO_HEAD_RATIO = 2;
+2
View File
@@ -99,6 +99,8 @@
#include <tools/align_distribute_tool.h>
#include <tools/pad_tool.h>
#include <microwave/microwave_tool.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
#include <tools/position_relative_tool.h>
#include <tools/zone_filler_tool.h>
#include <tools/multichannel_tool.h>
+2
View File
@@ -31,6 +31,8 @@
#include <api/board/board_types.pb.h>
#include <string_utils.h>
#include <board.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
PCB_FIELD::PCB_FIELD( FOOTPRINT* aParent, FIELD_T aFieldId, const wxString& aName ) :
+2
View File
@@ -25,6 +25,8 @@
#include "pcb_generator.h"
#include <board.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
PCB_GENERATOR::PCB_GENERATOR( BOARD_ITEM* aParent, PCB_LAYER_ID aLayer ) :
+2
View File
@@ -41,6 +41,8 @@
#include <google/protobuf/any.pb.h>
#include <wx/debug.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
PCB_GROUP::PCB_GROUP( BOARD_ITEM* aParent ) :
BOARD_ITEM( aParent, PCB_GROUP_T )
+2
View File
@@ -47,6 +47,8 @@
#include <wx/log.h>
#include <wx/numformatter.h>
#include <wx/xml/xml.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
/**
@@ -68,6 +68,7 @@
#include <wx/filename.h>
#include <wx/wfstream.h>
#include <wx/txtstrm.h>
#include <wx/tokenzr.h>
#include <boost/ptr_container/ptr_map.hpp>
#include <string_utils.h>
+2
View File
@@ -38,6 +38,8 @@
#include <pgm_base.h>
#include <drc/drc_item.h>
#include <trigo.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
/// Factor to convert the maker unit shape to internal units:
+2
View File
@@ -36,6 +36,8 @@
#include <settings/color_settings.h>
#include <settings/settings_manager.h>
#include <view/view.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
static const double DEFAULT_PT_SIZE_MM = 1.0;
+2
View File
@@ -40,6 +40,8 @@
#include <trigo.h>
#include <wx/mstream.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
using KIGFX::PCB_PAINTER;
using KIGFX::PCB_RENDER_SETTINGS;
+2
View File
@@ -46,6 +46,8 @@
#include <api/board/board_types.pb.h>
#include <api/api_enums.h>
#include <api/api_utils.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
PCB_SHAPE::PCB_SHAPE( BOARD_ITEM* aParent, KICAD_T aItemType, SHAPE_T aShapeType ) :
+2
View File
@@ -31,6 +31,8 @@
#include <geometry/geometry_utils.h>
#include <convert_basic_shapes_to_polygon.h>
#include <pcb_painter.h> // for PCB_RENDER_SETTINGS
#include <properties/property.h>
#include <properties/property_mgr.h>
PCB_TABLE::PCB_TABLE( BOARD_ITEM* aParent, int aLineWidth ) :
+2
View File
@@ -30,6 +30,8 @@
#include <board.h>
#include <pcb_table.h>
#include <footprint.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
PCB_TABLECELL::PCB_TABLECELL( BOARD_ITEM* aParent ) :
+2
View File
@@ -36,6 +36,8 @@
#include <geometry/shape_circle.h>
#include <eda_draw_frame.h>
#include <pcb_shape.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
PCB_TARGET::PCB_TARGET( BOARD_ITEM* aParent ) :
+2
View File
@@ -46,6 +46,8 @@
#include <api/api_enums.h>
#include <api/api_utils.h>
#include <api/board/board_types.pb.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
PCB_TEXT::PCB_TEXT( BOARD_ITEM* parent, KICAD_T idtype ) :
+2
View File
@@ -43,6 +43,8 @@
#include <api/api_enums.h>
#include <api/api_utils.h>
#include <api/board/board_types.pb.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
PCB_TEXTBOX::PCB_TEXTBOX( BOARD_ITEM* aParent, KICAD_T aType ) :
+2
View File
@@ -50,6 +50,8 @@
#include <pcb_painter.h>
#include <trigo.h>
#include <properties/property_validators.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
#include <google/protobuf/any.pb.h>
#include <api/api_enums.h>
+2
View File
@@ -23,6 +23,8 @@
#include "pcbexpr_evaluator.h"
#include <inspectable_impl.h>
#include <cstdio>
#include <memory>
#include <mutex>
+2
View File
@@ -39,6 +39,8 @@
#include <connectivity/connectivity_data.h>
#include <connectivity/connectivity_algo.h>
#include <connectivity/from_to_cache.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
bool fromToFunc( LIBEVAL::CONTEXT* aCtx, void* self )
+1
View File
@@ -19,6 +19,7 @@
*/
#include <wx/dir.h>
#include <wx/tokenzr.h>
#include "pcbnew_jobs_handler.h"
#include <board_commit.h>
#include <board_design_settings.h>
@@ -61,6 +61,8 @@
#include <wx/app.h>
#include <wx/crt.h>
#include <wx/image.h>
#include <properties/property.h>
#include <properties/property_mgr.h>
static PCB_EDIT_FRAME* s_PcbEditFrame = nullptr;
static SETTINGS_MANAGER* s_SettingsManager = nullptr;

Some files were not shown because too many files have changed in this diff Show More