Formatting & naming conventions.

This commit is contained in:
Jeff Young 2021-03-15 16:00:51 +00:00
parent a086795ac9
commit b2ac9cc29f
3 changed files with 38 additions and 33 deletions

View File

@ -401,12 +401,12 @@ void VIEW::SetRequired( int aLayerId, int aRequiredId, bool aRequired )
// stupid C++... python lambda would do this in one line // stupid C++... python lambda would do this in one line
template <class Container> template <class CONTAINER>
struct queryVisitor struct QUERY_VISITOR
{ {
typedef typename Container::value_type item_type; typedef typename CONTAINER::value_type item_type;
queryVisitor( Container& aCont, int aLayer ) : QUERY_VISITOR( CONTAINER& aCont, int aLayer ) :
m_cont( aCont ), m_layer( aLayer ) m_cont( aCont ), m_layer( aLayer )
{ {
} }
@ -419,7 +419,7 @@ struct queryVisitor
return true; return true;
} }
Container& m_cont; CONTAINER& m_cont;
int m_layer; int m_layer;
}; };
@ -439,7 +439,7 @@ int VIEW::Query( const BOX2I& aRect, std::vector<LAYER_ITEM_PAIR>& aResult ) con
if( ( *i )->displayOnly || !( *i )->visible ) if( ( *i )->displayOnly || !( *i )->visible )
continue; continue;
queryVisitor<std::vector<LAYER_ITEM_PAIR> > visitor( aResult, ( *i )->id ); QUERY_VISITOR<std::vector<LAYER_ITEM_PAIR> > visitor( aResult, ( *i )->id );
( *i )->items->Query( aRect, visitor ); ( *i )->items->Query( aRect, visitor );
} }
@ -721,10 +721,12 @@ void VIEW::ReorderLayerData( std::unordered_map<int, int> aReorderMap )
} }
struct VIEW::updateItemsColor struct VIEW::UPDATE_COLOR_VISITOR
{ {
updateItemsColor( int aLayer, PAINTER* aPainter, GAL* aGal ) : UPDATE_COLOR_VISITOR( int aLayer, PAINTER* aPainter, GAL* aGal ) :
layer( aLayer ), painter( aPainter ), gal( aGal ) layer( aLayer ),
painter( aPainter ),
gal( aGal )
{ {
} }
@ -760,7 +762,7 @@ void VIEW::UpdateLayerColor( int aLayer )
{ {
GAL_UPDATE_CONTEXT ctx( m_gal ); GAL_UPDATE_CONTEXT ctx( m_gal );
updateItemsColor visitor( aLayer, m_painter, m_gal ); UPDATE_COLOR_VISITOR visitor( aLayer, m_painter, m_gal );
m_layers[aLayer].items->Query( r, visitor ); m_layers[aLayer].items->Query( r, visitor );
MarkTargetDirty( m_layers[aLayer].target ); MarkTargetDirty( m_layers[aLayer].target );
} }
@ -798,10 +800,12 @@ void VIEW::UpdateAllLayersColor()
} }
struct VIEW::changeItemsDepth struct VIEW::UPDATE_DEPTH_VISITOR
{ {
changeItemsDepth( int aLayer, int aDepth, GAL* aGal ) : UPDATE_DEPTH_VISITOR( int aLayer, int aDepth, GAL* aGal ) :
layer( aLayer ), depth( aDepth ), gal( aGal ) layer( aLayer ),
depth( aDepth ),
gal( aGal )
{ {
} }
@ -928,10 +932,11 @@ void VIEW::UpdateAllLayersOrder()
} }
struct VIEW::drawItem struct VIEW::DRAW_ITEM_VISITOR
{ {
drawItem( VIEW* aView, int aLayer, bool aUseDrawPriority, bool aReverseDrawOrder ) : DRAW_ITEM_VISITOR( VIEW* aView, int aLayer, bool aUseDrawPriority, bool aReverseDrawOrder ) :
view( aView ), layer( aLayer ), view( aView ),
layer( aLayer ),
useDrawPriority( aUseDrawPriority ), useDrawPriority( aUseDrawPriority ),
reverseDrawOrder( aReverseDrawOrder ) reverseDrawOrder( aReverseDrawOrder )
{ {
@ -985,7 +990,7 @@ void VIEW::redrawRect( const BOX2I& aRect )
{ {
if( l->visible && IsTargetDirty( l->target ) && areRequiredLayersEnabled( l->id ) ) if( l->visible && IsTargetDirty( l->target ) && areRequiredLayersEnabled( l->id ) )
{ {
drawItem drawFunc( this, l->id, m_useDrawPriority, m_reverseDrawOrder ); DRAW_ITEM_VISITOR drawFunc( this, l->id, m_useDrawPriority, m_reverseDrawOrder );
m_gal->SetTarget( l->target ); m_gal->SetTarget( l->target );
m_gal->SetLayerDepth( l->renderingOrder ); m_gal->SetLayerDepth( l->renderingOrder );
@ -1048,10 +1053,12 @@ void VIEW::draw( VIEW_GROUP* aGroup, bool aImmediate )
} }
struct VIEW::recacheItem struct VIEW::RECACHE_ITEM_VISITOR
{ {
recacheItem( VIEW* aView, GAL* aGal, int aLayer ) : RECACHE_ITEM_VISITOR( VIEW* aView, GAL* aGal, int aLayer ) :
view( aView ), gal( aGal ), layer( aLayer ) view( aView ),
gal( aGal ),
layer( aLayer )
{ {
} }
@ -1152,9 +1159,9 @@ const VECTOR2I& VIEW::GetScreenPixelSize() const
} }
struct VIEW::clearLayerCache struct VIEW::CLEAR_LAYER_CACHE_VISITOR
{ {
clearLayerCache( VIEW* aView ) : CLEAR_LAYER_CACHE_VISITOR( VIEW* aView ) :
view( aView ) view( aView )
{ {
} }
@ -1175,7 +1182,7 @@ void VIEW::clearGroupCache()
BOX2I r; BOX2I r;
r.SetMaximum(); r.SetMaximum();
clearLayerCache visitor( this ); CLEAR_LAYER_CACHE_VISITOR visitor( this );
for( VIEW_LAYER& layer : m_layers ) for( VIEW_LAYER& layer : m_layers )
layer.items->Query( r, visitor ); layer.items->Query( r, visitor );
@ -1379,7 +1386,7 @@ void VIEW::RecacheAllItems()
{ {
if( IsCached( l.id ) ) if( IsCached( l.id ) )
{ {
recacheItem visitor( this, m_gal, l.id ); RECACHE_ITEM_VISITOR visitor( this, m_gal, l.id );
l.items->Query( r, visitor ); l.items->Query( r, visitor );
} }
} }

View File

@ -793,13 +793,11 @@ protected:
bool areRequiredLayersEnabled( int aLayerId ) const; bool areRequiredLayersEnabled( int aLayerId ) const;
// Function objects that need to access VIEW/VIEW_ITEM private/protected members // Function objects that need to access VIEW/VIEW_ITEM private/protected members
struct clearLayerCache; struct CLEAR_LAYER_CACHE_VISITOR;
struct recacheItem; struct RECACHE_ITEM_VISITOR;
struct drawItem; struct DRAW_ITEM_VISITOR;
struct unlinkItem; struct UPDATE_COLOR_VISITOR;
struct updateItemsColor; struct UPDATE_DEPTH_VISITOR;
struct changeItemsDepth;
struct extentsVisitor;
std::unique_ptr<KIGFX::VIEW_GROUP> m_preview; std::unique_ptr<KIGFX::VIEW_GROUP> m_preview;
std::vector<EDA_ITEM *> m_ownedItems; std::vector<EDA_ITEM *> m_ownedItems;

View File

@ -64,8 +64,8 @@
// clang-format off // clang-format off
/** /**
* Container that describes file type info for the add a library options * Container that describes file type info for the add a library options
*/ */
struct SUPPORTED_FILE_TYPE struct SUPPORTED_FILE_TYPE
{ {
wxString m_Description; ///< Description shown in the file picker dialog wxString m_Description; ///< Description shown in the file picker dialog