From a8505d9c7647b62c6c4c314ac2887b98a219a12c Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Fri, 29 Jul 2022 20:00:39 -0400 Subject: [PATCH] SEARCH_RESULT -> INSPECT_RESULT To fix the name squatting it's doing for future functionality --- common/eda_item.cpp | 8 ++++---- eeschema/ee_collectors.cpp | 10 ++++----- eeschema/ee_collectors.h | 2 +- eeschema/lib_symbol.cpp | 8 ++++---- eeschema/lib_symbol.h | 2 +- eeschema/sch_label.cpp | 12 +++++------ eeschema/sch_label.h | 2 +- eeschema/sch_sheet.cpp | 16 +++++++-------- eeschema/sch_sheet.h | 2 +- eeschema/sch_symbol.cpp | 32 ++++++++++++++--------------- eeschema/sch_symbol.h | 2 +- gerbview/gbr_layout.cpp | 8 ++++---- gerbview/gbr_layout.h | 2 +- gerbview/gerber_collectors.cpp | 4 ++-- gerbview/gerber_collectors.h | 2 +- gerbview/gerber_draw_item.cpp | 8 ++++---- gerbview/gerber_draw_item.h | 2 +- gerbview/gerber_file_image.cpp | 6 +++--- gerbview/gerber_file_image.h | 2 +- include/collector.h | 4 ++-- include/eda_item.h | 22 ++++++++++---------- include/pcb_group.h | 2 +- pcbnew/board.cpp | 14 ++++++------- pcbnew/board.h | 2 +- pcbnew/collectors.cpp | 12 +++++------ pcbnew/collectors.h | 6 +++--- pcbnew/footprint.cpp | 10 ++++----- pcbnew/footprint.h | 2 +- pcbnew/pcb_base_edit_frame.cpp | 2 +- pcbnew/pcb_group.cpp | 8 ++++---- pcbnew/pcb_track.cpp | 8 ++++---- pcbnew/pcb_track.h | 2 +- pcbnew/tools/pcb_selection_tool.cpp | 4 ++-- 33 files changed, 114 insertions(+), 114 deletions(-) diff --git a/common/eda_item.cpp b/common/eda_item.cpp index 8b7d7006c8..95cba1bbda 100644 --- a/common/eda_item.cpp +++ b/common/eda_item.cpp @@ -90,7 +90,7 @@ EDA_ITEM* EDA_ITEM::Clone() const // see base_struct.h // many classes inherit this method, be careful: //TODO (snh): Fix this to use std::set instead of C-style vector -SEARCH_RESULT EDA_ITEM::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) +INSPECT_RESULT EDA_ITEM::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) { #if 0 && defined(DEBUG) std::cout << GetClass().mb_str() << ' '; @@ -98,11 +98,11 @@ SEARCH_RESULT EDA_ITEM::Visit( INSPECTOR inspector, void* testData, const KICAD_ if( IsType( scanTypes ) ) { - if( SEARCH_RESULT::QUIT == inspector( this, testData ) ) - return SEARCH_RESULT::QUIT; + if( INSPECT_RESULT::QUIT == inspector( this, testData ) ) + return INSPECT_RESULT::QUIT; } - return SEARCH_RESULT::CONTINUE; + return INSPECT_RESULT::CONTINUE; } diff --git a/eeschema/ee_collectors.cpp b/eeschema/ee_collectors.cpp index b6a83fcc2b..f9d6a317db 100644 --- a/eeschema/ee_collectors.cpp +++ b/eeschema/ee_collectors.cpp @@ -115,7 +115,7 @@ const KICAD_T EE_COLLECTOR::FieldOwners[] = { }; -SEARCH_RESULT EE_COLLECTOR::Inspect( EDA_ITEM* aItem, void* aTestData ) +INSPECT_RESULT EE_COLLECTOR::Inspect( EDA_ITEM* aItem, void* aTestData ) { if( m_Unit || m_Convert ) { @@ -127,10 +127,10 @@ SEARCH_RESULT EE_COLLECTOR::Inspect( EDA_ITEM* aItem, void* aTestData ) if( lib_item && lib_item->Type() != LIB_PIN_T ) { if( m_Unit && lib_item->GetUnit() && lib_item->GetUnit() != m_Unit ) - return SEARCH_RESULT::CONTINUE; + return INSPECT_RESULT::CONTINUE; if( m_Convert && lib_item->GetConvert() && lib_item->GetConvert() != m_Convert ) - return SEARCH_RESULT::CONTINUE; + return INSPECT_RESULT::CONTINUE; } } @@ -142,7 +142,7 @@ SEARCH_RESULT EE_COLLECTOR::Inspect( EDA_ITEM* aItem, void* aTestData ) aItem->ClearFlags( SHOW_ELEC_TYPE ); - return SEARCH_RESULT::CONTINUE; + return INSPECT_RESULT::CONTINUE; } @@ -180,7 +180,7 @@ void EE_COLLECTOR::Collect( LIB_ITEMS_CONTAINER& aItems, const KICAD_T aFilterLi for( LIB_ITEM& item : aItems ) { - if( item.Visit( m_inspector, nullptr, m_scanTypes ) == SEARCH_RESULT::QUIT ) + if( item.Visit( m_inspector, nullptr, m_scanTypes ) == INSPECT_RESULT::QUIT ) break; } } diff --git a/eeschema/ee_collectors.h b/eeschema/ee_collectors.h index 30b6ebc935..afcb196461 100644 --- a/eeschema/ee_collectors.h +++ b/eeschema/ee_collectors.h @@ -69,7 +69,7 @@ public: return nullptr; } - SEARCH_RESULT Inspect( EDA_ITEM* aItem, void* aTestData ) override; + INSPECT_RESULT Inspect( EDA_ITEM* aItem, void* aTestData ) override; /** * Scan a #EDA_ITEM using this class's Inspector method which does the collection. diff --git a/eeschema/lib_symbol.cpp b/eeschema/lib_symbol.cpp index 8e6dc39d6b..7e48061d86 100644 --- a/eeschema/lib_symbol.cpp +++ b/eeschema/lib_symbol.cpp @@ -1235,7 +1235,7 @@ LIB_ITEM* LIB_SYMBOL::LocateDrawItem( int aUnit, int aConvert, KICAD_T aType, } -SEARCH_RESULT LIB_SYMBOL::Visit( INSPECTOR aInspector, void* aTestData, +INSPECT_RESULT LIB_SYMBOL::Visit( INSPECTOR aInspector, void* aTestData, const KICAD_T aFilterTypes[] ) { // The part itself is never inspected, only its children @@ -1243,12 +1243,12 @@ SEARCH_RESULT LIB_SYMBOL::Visit( INSPECTOR aInspector, void* aTestData, { if( item.IsType( aFilterTypes ) ) { - if( aInspector( &item, aTestData ) == SEARCH_RESULT::QUIT ) - return SEARCH_RESULT::QUIT; + if( aInspector( &item, aTestData ) == INSPECT_RESULT::QUIT ) + return INSPECT_RESULT::QUIT; } } - return SEARCH_RESULT::CONTINUE; + return INSPECT_RESULT::CONTINUE; } diff --git a/eeschema/lib_symbol.h b/eeschema/lib_symbol.h index 45d048c8bf..c7b335b6cf 100644 --- a/eeschema/lib_symbol.h +++ b/eeschema/lib_symbol.h @@ -502,7 +502,7 @@ public: LIB_ITEMS_CONTAINER& GetDrawItems() { return m_drawings; } const LIB_ITEMS_CONTAINER& GetDrawItems() const { return m_drawings; } - SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; + INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; /** * Set the units per symbol count. diff --git a/eeschema/sch_label.cpp b/eeschema/sch_label.cpp index dcbc20ed86..4294f04596 100644 --- a/eeschema/sch_label.cpp +++ b/eeschema/sch_label.cpp @@ -509,15 +509,15 @@ void SCH_LABEL_BASE::RunOnChildren( const std::function& aFun } -SEARCH_RESULT SCH_LABEL_BASE::Visit( INSPECTOR aInspector, void* testData, +INSPECT_RESULT SCH_LABEL_BASE::Visit( INSPECTOR aInspector, void* testData, const KICAD_T aFilterTypes[] ) { KICAD_T stype; if( IsType( aFilterTypes ) ) { - if( SEARCH_RESULT::QUIT == aInspector( this, nullptr ) ) - return SEARCH_RESULT::QUIT; + if( INSPECT_RESULT::QUIT == aInspector( this, nullptr ) ) + return INSPECT_RESULT::QUIT; } for( const KICAD_T* p = aFilterTypes; (stype = *p) != EOT; ++p ) @@ -526,13 +526,13 @@ SEARCH_RESULT SCH_LABEL_BASE::Visit( INSPECTOR aInspector, void* testData, { for( SCH_FIELD& field : m_fields ) { - if( SEARCH_RESULT::QUIT == aInspector( &field, this ) ) - return SEARCH_RESULT::QUIT; + if( INSPECT_RESULT::QUIT == aInspector( &field, this ) ) + return INSPECT_RESULT::QUIT; } } } - return SEARCH_RESULT::CONTINUE; + return INSPECT_RESULT::CONTINUE; } diff --git a/eeschema/sch_label.h b/eeschema/sch_label.h index 0e08273b54..7c9bf08039 100644 --- a/eeschema/sch_label.h +++ b/eeschema/sch_label.h @@ -119,7 +119,7 @@ public: void RunOnChildren( const std::function& aFunction ) override; - SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; + INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; VECTOR2I GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const override; diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index 0cf530c0b8..82f0549873 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -945,7 +945,7 @@ std::vector SCH_SHEET::GetConnectionPoints() const } -SEARCH_RESULT SCH_SHEET::Visit( INSPECTOR aInspector, void* testData, const KICAD_T aFilterTypes[] ) +INSPECT_RESULT SCH_SHEET::Visit( INSPECTOR aInspector, void* testData, const KICAD_T aFilterTypes[] ) { KICAD_T stype; @@ -954,8 +954,8 @@ SEARCH_RESULT SCH_SHEET::Visit( INSPECTOR aInspector, void* testData, const KICA // If caller wants to inspect my type if( stype == SCH_LOCATE_ANY_T || stype == Type() ) { - if( SEARCH_RESULT::QUIT == aInspector( this, nullptr ) ) - return SEARCH_RESULT::QUIT; + if( INSPECT_RESULT::QUIT == aInspector( this, nullptr ) ) + return INSPECT_RESULT::QUIT; } if( stype == SCH_LOCATE_ANY_T || stype == SCH_FIELD_T ) @@ -963,8 +963,8 @@ SEARCH_RESULT SCH_SHEET::Visit( INSPECTOR aInspector, void* testData, const KICA // Test the sheet fields. for( SCH_FIELD& field : m_fields ) { - if( SEARCH_RESULT::QUIT == aInspector( &field, this ) ) - return SEARCH_RESULT::QUIT; + if( INSPECT_RESULT::QUIT == aInspector( &field, this ) ) + return INSPECT_RESULT::QUIT; } } @@ -973,13 +973,13 @@ SEARCH_RESULT SCH_SHEET::Visit( INSPECTOR aInspector, void* testData, const KICA // Test the sheet labels. for( SCH_SHEET_PIN* sheetPin : m_pins ) { - if( SEARCH_RESULT::QUIT == aInspector( sheetPin, this ) ) - return SEARCH_RESULT::QUIT; + if( INSPECT_RESULT::QUIT == aInspector( sheetPin, this ) ) + return INSPECT_RESULT::QUIT; } } } - return SEARCH_RESULT::CONTINUE; + return INSPECT_RESULT::CONTINUE; } diff --git a/eeschema/sch_sheet.h b/eeschema/sch_sheet.h index 80dbefa955..8325ee42cc 100644 --- a/eeschema/sch_sheet.h +++ b/eeschema/sch_sheet.h @@ -350,7 +350,7 @@ public: std::vector GetConnectionPoints() const override; - SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; + INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; void RunOnChildren( const std::function& aFunction ) override; diff --git a/eeschema/sch_symbol.cpp b/eeschema/sch_symbol.cpp index 491cf7ba8d..72cf6f8a9e 100644 --- a/eeschema/sch_symbol.cpp +++ b/eeschema/sch_symbol.cpp @@ -1711,7 +1711,7 @@ wxString SCH_SYMBOL::GetSelectMenuText( EDA_UNITS aUnits ) const } -SEARCH_RESULT SCH_SYMBOL::Visit( INSPECTOR aInspector, void* aTestData, +INSPECT_RESULT SCH_SYMBOL::Visit( INSPECTOR aInspector, void* aTestData, const KICAD_T aFilterTypes[] ) { KICAD_T stype; @@ -1722,42 +1722,42 @@ SEARCH_RESULT SCH_SYMBOL::Visit( INSPECTOR aInspector, void* aTestData, || ( stype == SCH_SYMBOL_T ) || ( stype == SCH_SYMBOL_LOCATE_POWER_T && m_part && m_part->IsPower() ) ) { - if( SEARCH_RESULT::QUIT == aInspector( this, aTestData ) ) - return SEARCH_RESULT::QUIT; + if( INSPECT_RESULT::QUIT == aInspector( this, aTestData ) ) + return INSPECT_RESULT::QUIT; } if( stype == SCH_LOCATE_ANY_T || stype == SCH_FIELD_T ) { for( SCH_FIELD& field : m_fields ) { - if( SEARCH_RESULT::QUIT == aInspector( &field, (void*) this ) ) - return SEARCH_RESULT::QUIT; + if( INSPECT_RESULT::QUIT == aInspector( &field, (void*) this ) ) + return INSPECT_RESULT::QUIT; } } if( stype == SCH_FIELD_LOCATE_REFERENCE_T ) { - if( SEARCH_RESULT::QUIT == aInspector( GetField( REFERENCE_FIELD ), (void*) this ) ) - return SEARCH_RESULT::QUIT; + if( INSPECT_RESULT::QUIT == aInspector( GetField( REFERENCE_FIELD ), (void*) this ) ) + return INSPECT_RESULT::QUIT; } if( stype == SCH_FIELD_LOCATE_VALUE_T || ( stype == SCH_SYMBOL_LOCATE_POWER_T && m_part && m_part->IsPower() ) ) { - if( SEARCH_RESULT::QUIT == aInspector( GetField( VALUE_FIELD ), (void*) this ) ) - return SEARCH_RESULT::QUIT; + if( INSPECT_RESULT::QUIT == aInspector( GetField( VALUE_FIELD ), (void*) this ) ) + return INSPECT_RESULT::QUIT; } if( stype == SCH_FIELD_LOCATE_FOOTPRINT_T ) { - if( SEARCH_RESULT::QUIT == aInspector( GetField( FOOTPRINT_FIELD ), (void*) this ) ) - return SEARCH_RESULT::QUIT; + if( INSPECT_RESULT::QUIT == aInspector( GetField( FOOTPRINT_FIELD ), (void*) this ) ) + return INSPECT_RESULT::QUIT; } if( stype == SCH_FIELD_LOCATE_DATASHEET_T ) { - if( SEARCH_RESULT::QUIT == aInspector( GetField( DATASHEET_FIELD ), (void*) this ) ) - return SEARCH_RESULT::QUIT; + if( INSPECT_RESULT::QUIT == aInspector( GetField( DATASHEET_FIELD ), (void*) this ) ) + return INSPECT_RESULT::QUIT; } if( stype == SCH_LOCATE_ANY_T || stype == SCH_PIN_T ) @@ -1775,13 +1775,13 @@ SEARCH_RESULT SCH_SYMBOL::Visit( INSPECTOR aInspector, void* aTestData, if( pin_convert > 0 && pin_convert != GetConvert() ) continue; - if( SEARCH_RESULT::QUIT == aInspector( pin.get(), (void*) this ) ) - return SEARCH_RESULT::QUIT; + if( INSPECT_RESULT::QUIT == aInspector( pin.get(), (void*) this ) ) + return INSPECT_RESULT::QUIT; } } } - return SEARCH_RESULT::CONTINUE; + return INSPECT_RESULT::CONTINUE; } diff --git a/eeschema/sch_symbol.h b/eeschema/sch_symbol.h index 036f37c330..18606cb060 100644 --- a/eeschema/sch_symbol.h +++ b/eeschema/sch_symbol.h @@ -630,7 +630,7 @@ public: std::vector GetConnectionPoints() const override; - SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; + INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; /** * Return the symbol library item at \a aPosition that is part of this symbol. diff --git a/gerbview/gbr_layout.cpp b/gerbview/gbr_layout.cpp index 8166070261..9606746d9c 100644 --- a/gerbview/gbr_layout.cpp +++ b/gerbview/gbr_layout.cpp @@ -75,10 +75,10 @@ EDA_RECT GBR_LAYOUT::ComputeBoundingBox() const } -SEARCH_RESULT GBR_LAYOUT::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) +INSPECT_RESULT GBR_LAYOUT::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) { KICAD_T stype; - SEARCH_RESULT result = SEARCH_RESULT::CONTINUE; + INSPECT_RESULT result = INSPECT_RESULT::CONTINUE; const KICAD_T* p = scanTypes; bool done = false; @@ -102,7 +102,7 @@ SEARCH_RESULT GBR_LAYOUT::Visit( INSPECTOR inspector, void* testData, const KICA result = gerber->Visit( inspector, testData, p ); - if( result == SEARCH_RESULT::QUIT ) + if( result == INSPECT_RESULT::QUIT ) break; } @@ -114,7 +114,7 @@ SEARCH_RESULT GBR_LAYOUT::Visit( INSPECTOR inspector, void* testData, const KICA break; } - if( result == SEARCH_RESULT::QUIT ) + if( result == INSPECT_RESULT::QUIT ) break; } diff --git a/gerbview/gbr_layout.h b/gerbview/gbr_layout.h index 7b714a7d6f..9fd994b119 100644 --- a/gerbview/gbr_layout.h +++ b/gerbview/gbr_layout.h @@ -78,7 +78,7 @@ public: void SetBoundingBox( const EDA_RECT& aBox ) { m_BoundingBox = aBox; } ///< @copydoc EDA_ITEM::Visit() - SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; + INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; #if defined(DEBUG) void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); } diff --git a/gerbview/gerber_collectors.cpp b/gerbview/gerber_collectors.cpp index 5710c9b56d..7af974be3a 100644 --- a/gerbview/gerber_collectors.cpp +++ b/gerbview/gerber_collectors.cpp @@ -34,12 +34,12 @@ const KICAD_T GERBER_COLLECTOR::AllItems[] = { * @param testData is not used here. * @return SEARCH_QUIT if the iterator is to stop the scan, else SCAN_CONTINUE. */ -SEARCH_RESULT GERBER_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData ) +INSPECT_RESULT GERBER_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData ) { if( testItem->HitTest( m_refPos ) ) Append( testItem ); - return SEARCH_RESULT::CONTINUE; + return INSPECT_RESULT::CONTINUE; } diff --git a/gerbview/gerber_collectors.h b/gerbview/gerber_collectors.h index d9b881c321..2d5ec93fc5 100644 --- a/gerbview/gerber_collectors.h +++ b/gerbview/gerber_collectors.h @@ -70,7 +70,7 @@ public: * @param testData is not used in this class. * @return SEARCH_QUIT if the Iterator is to stop the scan else SCAN_CONTINUE. */ - SEARCH_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override; + INSPECT_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override; /** * Scan an EDA_ITEM using this class's Inspector method, which does the collection. diff --git a/gerbview/gerber_draw_item.cpp b/gerbview/gerber_draw_item.cpp index 12cf3d71cd..ddc0fe35f8 100644 --- a/gerbview/gerber_draw_item.cpp +++ b/gerbview/gerber_draw_item.cpp @@ -996,7 +996,7 @@ double GERBER_DRAW_ITEM::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const } -SEARCH_RESULT GERBER_DRAW_ITEM::Visit( INSPECTOR inspector, void* testData, +INSPECT_RESULT GERBER_DRAW_ITEM::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) { KICAD_T stype = *scanTypes; @@ -1004,11 +1004,11 @@ SEARCH_RESULT GERBER_DRAW_ITEM::Visit( INSPECTOR inspector, void* testData, // If caller wants to inspect my type if( stype == Type() ) { - if( SEARCH_RESULT::QUIT == inspector( this, testData ) ) - return SEARCH_RESULT::QUIT; + if( INSPECT_RESULT::QUIT == inspector( this, testData ) ) + return INSPECT_RESULT::QUIT; } - return SEARCH_RESULT::CONTINUE; + return INSPECT_RESULT::CONTINUE; } diff --git a/gerbview/gerber_draw_item.h b/gerbview/gerber_draw_item.h index 282a3403bf..5eaead8e75 100644 --- a/gerbview/gerber_draw_item.h +++ b/gerbview/gerber_draw_item.h @@ -231,7 +231,7 @@ public: double ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override; ///< @copydoc EDA_ITEM::Visit() - SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; + INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; ///< @copydoc EDA_ITEM::GetSelectMenuText() virtual wxString GetSelectMenuText( EDA_UNITS aUnits ) const override; diff --git a/gerbview/gerber_file_image.cpp b/gerbview/gerber_file_image.cpp index 26bf46b9d6..57758f1615 100644 --- a/gerbview/gerber_file_image.cpp +++ b/gerbview/gerber_file_image.cpp @@ -405,10 +405,10 @@ void GERBER_FILE_IMAGE::RemoveAttribute( X2_ATTRIBUTE& aAttribute ) } -SEARCH_RESULT GERBER_FILE_IMAGE::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) +INSPECT_RESULT GERBER_FILE_IMAGE::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) { KICAD_T stype; - SEARCH_RESULT result = SEARCH_RESULT::CONTINUE; + INSPECT_RESULT result = INSPECT_RESULT::CONTINUE; const KICAD_T* p = scanTypes; bool done = false; @@ -434,7 +434,7 @@ SEARCH_RESULT GERBER_FILE_IMAGE::Visit( INSPECTOR inspector, void* testData, con break; } - if( result == SEARCH_RESULT::QUIT ) + if( result == INSPECT_RESULT::QUIT ) break; } diff --git a/gerbview/gerber_file_image.h b/gerbview/gerber_file_image.h index d2dba0e6b3..ad3cda226f 100644 --- a/gerbview/gerber_file_image.h +++ b/gerbview/gerber_file_image.h @@ -299,7 +299,7 @@ public: void RemoveAttribute( X2_ATTRIBUTE& aAttribute ); ///< @copydoc EDA_ITEM::Visit() - SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; + INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; #if defined(DEBUG) diff --git a/include/collector.h b/include/collector.h index cd80bc8943..3edc8cd772 100644 --- a/include/collector.h +++ b/include/collector.h @@ -63,9 +63,9 @@ public: virtual ~COLLECTOR() {} - virtual SEARCH_RESULT Inspect( EDA_ITEM* aItem, void* aTestData ) + virtual INSPECT_RESULT Inspect( EDA_ITEM* aItem, void* aTestData ) { - return SEARCH_RESULT::QUIT; + return INSPECT_RESULT::QUIT; }; using ITER = std::vector::iterator; diff --git a/include/eda_item.h b/include/eda_item.h index f6e70aa541..12b41f187c 100644 --- a/include/eda_item.h +++ b/include/eda_item.h @@ -38,7 +38,7 @@ enum class BITMAPS : unsigned int; -enum class SEARCH_RESULT +enum class INSPECT_RESULT { QUIT, CONTINUE @@ -87,7 +87,7 @@ class MSG_PANEL_ITEM; * @return A #SEARCH_RESULT type #SEARCH_QUIT if the iterator function is to * stop the scan, else #SEARCH_CONTINUE; */ -typedef std::function< SEARCH_RESULT ( EDA_ITEM* aItem, void* aTestData ) > INSPECTOR_FUNC; +typedef std::function< INSPECT_RESULT ( EDA_ITEM* aItem, void* aTestData ) > INSPECTOR_FUNC; ///< std::function passed to nested users by ref, avoids copying std::function. typedef const INSPECTOR_FUNC& INSPECTOR; @@ -305,13 +305,13 @@ public: * @return #SEARCH_RESULT SEARCH_QUIT if the Iterator is to stop the scan, * else #SCAN_CONTINUE, and determined by the inspector. */ - virtual SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ); + virtual INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ); /** * This changes first parameter to avoid the DList and use the main queue instead. */ template< class T > - static SEARCH_RESULT IterateForward( std::deque& aList, + static INSPECT_RESULT IterateForward( std::deque& aList, INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) @@ -319,28 +319,28 @@ public: for( auto it : aList ) { if( static_cast( it )->Visit( inspector, testData, scanTypes ) - == SEARCH_RESULT::QUIT ) - return SEARCH_RESULT::QUIT; + == INSPECT_RESULT::QUIT ) + return INSPECT_RESULT::QUIT; } - return SEARCH_RESULT::CONTINUE; + return INSPECT_RESULT::CONTINUE; } /** * Change first parameter to avoid the DList and use std::vector instead. */ template - static SEARCH_RESULT IterateForward( + static INSPECT_RESULT IterateForward( std::vector& aList, INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) { for( auto it : aList ) { if( static_cast( it )->Visit( inspector, testData, scanTypes ) - == SEARCH_RESULT::QUIT ) - return SEARCH_RESULT::QUIT; + == INSPECT_RESULT::QUIT ) + return INSPECT_RESULT::QUIT; } - return SEARCH_RESULT::CONTINUE; + return INSPECT_RESULT::CONTINUE; } /** diff --git a/include/pcb_group.h b/include/pcb_group.h index b88b49693e..d553301f72 100644 --- a/include/pcb_group.h +++ b/include/pcb_group.h @@ -161,7 +161,7 @@ public: const EDA_RECT GetBoundingBox() const override; ///< @copydoc EDA_ITEM::Visit - SEARCH_RESULT Visit( INSPECTOR aInspector, void* aTestData, + INSPECT_RESULT Visit( INSPECTOR aInspector, void* aTestData, const KICAD_T aScanTypes[] ) override; ///< @copydoc VIEW_ITEM::ViewGetLayers diff --git a/pcbnew/board.cpp b/pcbnew/board.cpp index fa5cc9d0a5..8066b836e3 100644 --- a/pcbnew/board.cpp +++ b/pcbnew/board.cpp @@ -333,7 +333,7 @@ void BOARD::Move( const VECTOR2I& aMoveVector ) // overload // aMoveVector was snapshotted, don't need "data". brd_item->Move( aMoveVector ); - return SEARCH_RESULT::CONTINUE; + return INSPECT_RESULT::CONTINUE; }; Visit( inspector, nullptr, top_level_board_stuff ); @@ -351,7 +351,7 @@ TRACKS BOARD::TracksInNet( int aNetCode ) if( t->GetNetCode() == aNetCode ) ret.push_back( t ); - return SEARCH_RESULT::CONTINUE; + return INSPECT_RESULT::CONTINUE; }; // visit this BOARD's PCB_TRACKs and PCB_VIAs with above TRACK INSPECTOR which @@ -1266,10 +1266,10 @@ void BOARD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector } -SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) +INSPECT_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) { KICAD_T stype; - SEARCH_RESULT result = SEARCH_RESULT::CONTINUE; + INSPECT_RESULT result = INSPECT_RESULT::CONTINUE; const KICAD_T* p = scanTypes; bool done = false; @@ -1391,7 +1391,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s { result = marker->Visit( inspector, testData, p ); - if( result == SEARCH_RESULT::QUIT ) + if( result == INSPECT_RESULT::QUIT ) break; } @@ -1403,7 +1403,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s { result = zone->Visit( inspector, testData, p ); - if( result == SEARCH_RESULT::QUIT ) + if( result == INSPECT_RESULT::QUIT ) break; } @@ -1420,7 +1420,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s break; } - if( result == SEARCH_RESULT::QUIT ) + if( result == INSPECT_RESULT::QUIT ) break; } diff --git a/pcbnew/board.h b/pcbnew/board.h index f64ee70631..a3d5027b74 100644 --- a/pcbnew/board.h +++ b/pcbnew/board.h @@ -763,7 +763,7 @@ public: * @return SEARCH_QUIT if the Iterator is to stop the scan, else SCAN_CONTINUE, and * determined by the inspector. */ - SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; + INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; /** * Search for a FOOTPRINT within this board with the given reference designator. diff --git a/pcbnew/collectors.cpp b/pcbnew/collectors.cpp index 810416fb99..3476afb3de 100644 --- a/pcbnew/collectors.cpp +++ b/pcbnew/collectors.cpp @@ -174,7 +174,7 @@ const KICAD_T GENERAL_COLLECTOR::DraggableItems[] = { }; -SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData ) +INSPECT_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData ) { BOARD_ITEM* item = (BOARD_ITEM*) testItem; FOOTPRINT* footprint = nullptr; @@ -613,7 +613,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData ) } exit: - return SEARCH_RESULT::CONTINUE; // always when collecting + return INSPECT_RESULT::CONTINUE; // always when collecting } @@ -645,13 +645,13 @@ void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const KICAD_T aScanList[], } -SEARCH_RESULT PCB_TYPE_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData ) +INSPECT_RESULT PCB_TYPE_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData ) { // The Visit() function only visits the testItem if its type was in the // the scanList, so therefore we can collect anything given to us here. Append( testItem ); - return SEARCH_RESULT::CONTINUE; // always when collecting + return INSPECT_RESULT::CONTINUE; // always when collecting } @@ -663,14 +663,14 @@ void PCB_TYPE_COLLECTOR::Collect( BOARD_ITEM* aBoard, const KICAD_T aScanList[] } -SEARCH_RESULT PCB_LAYER_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData ) +INSPECT_RESULT PCB_LAYER_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData ) { BOARD_ITEM* item = (BOARD_ITEM*) testItem; if( item->IsOnLayer( m_layer_id ) ) Append( testItem ); - return SEARCH_RESULT::CONTINUE; + return INSPECT_RESULT::CONTINUE; } diff --git a/pcbnew/collectors.h b/pcbnew/collectors.h index 323a971b46..27e3af8538 100644 --- a/pcbnew/collectors.h +++ b/pcbnew/collectors.h @@ -331,7 +331,7 @@ public: * @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan, * else SCAN_CONTINUE; */ - SEARCH_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override; + INSPECT_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override; /** * Scan a BOARD_ITEM using this class's Inspector method, which does the collection. @@ -559,7 +559,7 @@ public: * @param testData is not used in this class. * @return SEARCH_QUIT if the Iterator is to stop the scan, else SCAN_CONTINUE; */ - SEARCH_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override; + INSPECT_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override; /** * Collect #BOARD_ITEM objects using this class's Inspector method, which does the collection. @@ -594,7 +594,7 @@ public: * @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan, * else SCAN_CONTINUE; */ - SEARCH_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override; + INSPECT_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override; /** * Test a BOARD_ITEM using this class's Inspector method, which does the collection. diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index d45e8ed06e..5dab21480c 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -1237,10 +1237,10 @@ void FOOTPRINT::Add3DModel( FP_3DMODEL* a3DModel ) // see footprint.h -SEARCH_RESULT FOOTPRINT::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) +INSPECT_RESULT FOOTPRINT::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) { KICAD_T stype; - SEARCH_RESULT result = SEARCH_RESULT::CONTINUE; + INSPECT_RESULT result = INSPECT_RESULT::CONTINUE; const KICAD_T* p = scanTypes; bool done = false; @@ -1272,12 +1272,12 @@ SEARCH_RESULT FOOTPRINT::Visit( INSPECTOR inspector, void* testData, const KICAD case PCB_FP_TEXT_T: result = inspector( m_reference, testData ); - if( result == SEARCH_RESULT::QUIT ) + if( result == INSPECT_RESULT::QUIT ) break; result = inspector( m_value, testData ); - if( result == SEARCH_RESULT::QUIT ) + if( result == INSPECT_RESULT::QUIT ) break; // Intentionally fall through since m_Drawings can hold PCB_FP_SHAPE_T also @@ -1326,7 +1326,7 @@ SEARCH_RESULT FOOTPRINT::Visit( INSPECTOR inspector, void* testData, const KICAD break; } - if( result == SEARCH_RESULT::QUIT ) + if( result == INSPECT_RESULT::QUIT ) break; } diff --git a/pcbnew/footprint.h b/pcbnew/footprint.h index 6671c990c9..288c5b2001 100644 --- a/pcbnew/footprint.h +++ b/pcbnew/footprint.h @@ -596,7 +596,7 @@ public: */ void Add3DModel( FP_3DMODEL* a3DModel ); - SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; + INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; wxString GetClass() const override { diff --git a/pcbnew/pcb_base_edit_frame.cpp b/pcbnew/pcb_base_edit_frame.cpp index e95af32ee8..32e76ab2c1 100644 --- a/pcbnew/pcb_base_edit_frame.cpp +++ b/pcbnew/pcb_base_edit_frame.cpp @@ -237,7 +237,7 @@ void PCB_BASE_EDIT_FRAME::unitsChangeRefresh() view->Update( dimension ); } - return SEARCH_RESULT::CONTINUE; + return INSPECT_RESULT::CONTINUE; }; board->Visit( inspector, nullptr, GENERAL_COLLECTOR::Dimensions ); diff --git a/pcbnew/pcb_group.cpp b/pcbnew/pcb_group.cpp index f178cc7b5c..e46abfd6ac 100644 --- a/pcbnew/pcb_group.cpp +++ b/pcbnew/pcb_group.cpp @@ -233,19 +233,19 @@ const EDA_RECT PCB_GROUP::GetBoundingBox() const } -SEARCH_RESULT PCB_GROUP::Visit( INSPECTOR aInspector, void* aTestData, const KICAD_T aScanTypes[] ) +INSPECT_RESULT PCB_GROUP::Visit( INSPECTOR aInspector, void* aTestData, const KICAD_T aScanTypes[] ) { for( const KICAD_T* stype = aScanTypes; *stype != EOT; ++stype ) { // If caller wants to inspect my type if( *stype == Type() ) { - if( SEARCH_RESULT::QUIT == aInspector( this, aTestData ) ) - return SEARCH_RESULT::QUIT; + if( INSPECT_RESULT::QUIT == aInspector( this, aTestData ) ) + return INSPECT_RESULT::QUIT; } } - return SEARCH_RESULT::CONTINUE; + return INSPECT_RESULT::CONTINUE; } diff --git a/pcbnew/pcb_track.cpp b/pcbnew/pcb_track.cpp index 8ce8797891..fffb16d28e 100644 --- a/pcbnew/pcb_track.cpp +++ b/pcbnew/pcb_track.cpp @@ -351,18 +351,18 @@ void PCB_VIA::Flip( const VECTOR2I& aCentre, bool aFlipLeftRight ) // see class_track.h -SEARCH_RESULT PCB_TRACK::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) +INSPECT_RESULT PCB_TRACK::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) { KICAD_T stype = *scanTypes; // If caller wants to inspect my type if( stype == Type() ) { - if( SEARCH_RESULT::QUIT == inspector( this, testData ) ) - return SEARCH_RESULT::QUIT; + if( INSPECT_RESULT::QUIT == inspector( this, testData ) ) + return INSPECT_RESULT::QUIT; } - return SEARCH_RESULT::CONTINUE; + return INSPECT_RESULT::CONTINUE; } diff --git a/pcbnew/pcb_track.h b/pcbnew/pcb_track.h index 4957ab74cd..a36b58e648 100644 --- a/pcbnew/pcb_track.h +++ b/pcbnew/pcb_track.h @@ -173,7 +173,7 @@ public: void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) override; - SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; + INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override; bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override; diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index 2e31e6038e..5304d9a06c 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -2104,7 +2104,7 @@ void PCB_SELECTION_TOOL::RebuildSelection() // Let selected parents handle their children. if( parent && parent->IsSelected() ) - return SEARCH_RESULT::CONTINUE; + return INSPECT_RESULT::CONTINUE; highlight( item, SELECTED, &m_selection ); } @@ -2119,7 +2119,7 @@ void PCB_SELECTION_TOOL::RebuildSelection() item->ClearFlags( ENTERED ); } - return SEARCH_RESULT::CONTINUE; + return INSPECT_RESULT::CONTINUE; }; board()->Visit( inspector, nullptr, m_isFootprintEditor ? GENERAL_COLLECTOR::FootprintItems