From 0598c829727ea01e995ac204deae66523b9d8d71 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 30 May 2021 22:04:07 +0100 Subject: [PATCH] Terminology (use present tense for flags). --- eeschema/bus-wire-junction.cpp | 4 ++-- eeschema/sch_symbol.h | 2 +- eeschema/tools/ee_selection_tool.cpp | 2 +- eeschema/tools/sch_drawing_tools.cpp | 16 ++++++++-------- eeschema/tools/sch_editor_control.cpp | 4 ++-- eeschema/tools/sch_line_wire_bus_tool.cpp | 10 +++++----- eeschema/tools/sch_move_tool.cpp | 8 ++++---- eeschema/tools/symbol_editor_drawing_tools.cpp | 2 +- eeschema/tools/symbol_editor_move_tool.cpp | 2 +- include/eda_item.h | 16 ++++++++-------- pagelayout_editor/tools/pl_drawing_tools.cpp | 2 +- pagelayout_editor/tools/pl_edit_tool.cpp | 2 +- pcbnew/tools/pcb_selection_tool.cpp | 2 +- pcbnew/track.cpp | 4 ++-- 14 files changed, 38 insertions(+), 38 deletions(-) diff --git a/eeschema/bus-wire-junction.cpp b/eeschema/bus-wire-junction.cpp index 886ba6be83..01ceb84a10 100644 --- a/eeschema/bus-wire-junction.cpp +++ b/eeschema/bus-wire-junction.cpp @@ -48,7 +48,7 @@ std::vector SCH_EDIT_FRAME::GetSchematicConnections() for( SCH_ITEM* item : GetScreen()->Items() ) { // Avoid items that are changing - if( !( item->GetEditFlags() & ( IS_DRAGGED | IS_MOVED | IS_DELETED ) ) ) + if( !( item->GetEditFlags() & ( IS_DRAGGING | IS_MOVING | IS_DELETED ) ) ) { std::vector pts = item->GetConnectionPoints(); retval.insert( retval.end(), pts.begin(), pts.end() ); @@ -104,7 +104,7 @@ bool SCH_EDIT_FRAME::TrimWire( const wxPoint& aStart, const wxPoint& aEnd ) for( SCH_LINE* line : wires ) { // Don't remove wires that are already deleted or are currently being dragged - if( line->GetEditFlags() & ( STRUCT_DELETED | IS_DRAGGED | IS_MOVED | SKIP_STRUCT ) ) + if( line->GetEditFlags() & ( STRUCT_DELETED | IS_DRAGGING | IS_MOVING | SKIP_STRUCT ) ) continue; if( !IsPointOnSegment( line->GetStartPoint(), line->GetEndPoint(), aStart ) || diff --git a/eeschema/sch_symbol.h b/eeschema/sch_symbol.h index 8ae59b1b29..a671eda75a 100644 --- a/eeschema/sch_symbol.h +++ b/eeschema/sch_symbol.h @@ -89,7 +89,7 @@ public: * @param unit is unit for symbols that have multiple parts per package. * @param convert is the alternate body style for the schematic symbols. * @param pos is the position of the symbol. - * @param setNewItemFlag is used to set the symbol #IS_NEW and #IS_MOVED flags. + * @param setNewItemFlag is used to set the symbol #IS_NEW and #IS_MOVING flags. */ SCH_COMPONENT( const LIB_PART& aPart, const LIB_ID& aLibId, const SCH_SHEET_PATH* aSheet, int unit = 0, int convert = 0, diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index 43e42b67d4..8f580842aa 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -528,7 +528,7 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) else if( evt->IsDrag( BUT_LEFT ) ) { // Is another tool already moving a new object? Don't allow a drag start - if( !m_selection.Empty() && m_selection[0]->HasFlag( IS_NEW | IS_MOVED ) ) + if( !m_selection.Empty() && m_selection[0]->HasFlag( IS_NEW | IS_MOVING ) ) { evt->SetPassEvent(); continue; diff --git a/eeschema/tools/sch_drawing_tools.cpp b/eeschema/tools/sch_drawing_tools.cpp index ee7f064497..fcf07e5a6c 100644 --- a/eeschema/tools/sch_drawing_tools.cpp +++ b/eeschema/tools/sch_drawing_tools.cpp @@ -146,11 +146,11 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent ) m_selectionTool->AddItemToSel( aSymbol ); aSymbol->SetParent( m_frame->GetScreen() ); - aSymbol->SetFlags( IS_NEW | IS_MOVED ); + aSymbol->SetFlags( IS_NEW | IS_MOVING ); m_frame->AddItemToScreenAndUndoList( m_frame->GetScreen(), aSymbol, false ); - // Set IS_MOVED again, as AddItemToScreenAndUndoList() will have cleared it. - aSymbol->SetFlags( IS_MOVED ); + // Set IS_MOVING again, as AddItemToScreenAndUndoList() will have cleared it. + aSymbol->SetFlags( IS_MOVING ); m_toolMgr->RunAction( ACTIONS::refreshPreview ); }; @@ -516,7 +516,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent ) continue; } - image->SetFlags( IS_NEW | IS_MOVED ); + image->SetFlags( IS_NEW | IS_MOVING ); m_frame->SaveCopyForRepeatItem( image ); @@ -890,7 +890,7 @@ SCH_TEXT* SCH_DRAWING_TOOLS::createNewText( const VECTOR2I& aPosition, int aType textItem->SetItalic( m_lastTextItalic ); textItem->SetLabelSpinStyle( m_lastTextOrientation ); textItem->SetTextSize( wxSize( settings.m_DefaultTextSize, settings.m_DefaultTextSize ) ); - textItem->SetFlags( IS_NEW | IS_MOVED ); + textItem->SetFlags( IS_NEW | IS_MOVING ); DIALOG_LABEL_EDITOR dlg( m_frame, textItem ); @@ -1158,7 +1158,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) if( item ) { - item->SetFlags( IS_NEW | IS_MOVED ); + item->SetFlags( IS_NEW | IS_MOVING ); item->AutoplaceFields( /* aScreen */ nullptr, /* aManual */ false ); updatePreview(); @@ -1174,7 +1174,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) // ... and second click places: else { - item->ClearFlags( IS_MOVED ); + item->ClearFlags( IS_MOVING ); m_frame->AddItemToScreenAndUndoList( m_frame->GetScreen(), (SCH_ITEM*) item, false ); item = nullptr; @@ -1327,7 +1327,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent ) sheet = new SCH_SHEET( m_frame->GetCurrentSheet().Last(), static_cast( cursorPos ) ); - sheet->SetFlags( IS_NEW | IS_RESIZED ); + sheet->SetFlags( IS_NEW | IS_RESIZING ); sheet->SetScreen( NULL ); sheet->SetBorderWidth( cfg->m_Drawing.default_line_thickness ); sheet->SetBorderColor( cfg->m_Drawing.default_sheet_border_color ); diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index b1d65ff23e..4dda56e1af 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -1693,11 +1693,11 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent ) const_cast( item->m_Uuid ) = KIID(); } - item->SetFlags( IS_NEW | IS_PASTED | IS_MOVED ); + item->SetFlags( IS_NEW | IS_PASTED | IS_MOVING ); m_frame->AddItemToScreenAndUndoList( m_frame->GetScreen(), (SCH_ITEM*) item, i > 0 ); // Reset flags for subsequent move operation - item->SetFlags( IS_NEW | IS_PASTED | IS_MOVED ); + item->SetFlags( IS_NEW | IS_PASTED | IS_MOVING ); // Start out hidden so the pasted items aren't "ghosted" in their original location // before being moved to the current location. getView()->Hide( item, true ); diff --git a/eeschema/tools/sch_line_wire_bus_tool.cpp b/eeschema/tools/sch_line_wire_bus_tool.cpp index cdcabf88d4..deffde1f08 100644 --- a/eeschema/tools/sch_line_wire_bus_tool.cpp +++ b/eeschema/tools/sch_line_wire_bus_tool.cpp @@ -375,7 +375,7 @@ SCH_LINE* SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus( const wxString& aNet, wxPoint aPo m_busUnfold.label->SetTextSize( wxSize( cfg.m_DefaultTextSize, cfg.m_DefaultTextSize ) ); m_busUnfold.label->SetLabelSpinStyle( LABEL_SPIN_STYLE::RIGHT ); m_busUnfold.label->SetParent( m_frame->GetScreen() ); - m_busUnfold.label->SetFlags( IS_NEW | IS_MOVED ); + m_busUnfold.label->SetFlags( IS_NEW | IS_MOVING ); m_busUnfold.in_progress = true; m_busUnfold.origin = aPos; @@ -651,7 +651,7 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType, // Create a new segment, and chain it after the current segment. segment = new SCH_LINE( *segment ); - segment->SetFlags( IS_NEW | IS_MOVED ); + segment->SetFlags( IS_NEW | IS_MOVING ); segment->SetStartPoint( cursorPos ); m_wires.push_back( segment ); @@ -790,7 +790,7 @@ SCH_LINE* SCH_LINE_WIRE_BUS_TOOL::startSegments( int aType, const VECTOR2D& aPos // Give segments a parent so they find the default line/wire/bus widths segment->SetParent( &m_frame->Schematic() ); - segment->SetFlags( IS_NEW | IS_MOVED ); + segment->SetFlags( IS_NEW | IS_MOVING ); m_wires.push_back( segment ); m_selectionTool->AddItemToSel( segment, true /*quiet mode*/ ); @@ -800,7 +800,7 @@ SCH_LINE* SCH_LINE_WIRE_BUS_TOOL::startSegments( int aType, const VECTOR2D& aPos if( m_frame->eeconfig()->m_Drawing.hv_lines_only ) { segment = new SCH_LINE( *segment ); - segment->SetFlags( IS_NEW | IS_MOVED ); + segment->SetFlags( IS_NEW | IS_MOVING ); m_wires.push_back( segment ); m_selectionTool->AddItemToSel( segment, true /*quiet mode*/ ); @@ -908,7 +908,7 @@ void SCH_LINE_WIRE_BUS_TOOL::finishSegments() // Add the new wires for( SCH_LINE* wire : m_wires ) { - wire->ClearFlags( IS_NEW | IS_MOVED ); + wire->ClearFlags( IS_NEW | IS_MOVING ); m_frame->AddToScreen( wire, screen ); } diff --git a/eeschema/tools/sch_move_tool.cpp b/eeschema/tools/sch_move_tool.cpp index 0cd64246d8..8395de810a 100644 --- a/eeschema/tools/sch_move_tool.cpp +++ b/eeschema/tools/sch_move_tool.cpp @@ -776,7 +776,7 @@ void SCH_MOVE_TOOL::moveItem( EDA_ITEM* aItem, const VECTOR2I& aDelta ) } getView()->Hide( aItem, false ); - aItem->SetFlags( IS_MOVED ); + aItem->SetFlags( IS_MOVING ); } @@ -832,7 +832,7 @@ int SCH_MOVE_TOOL::AlignElements( const TOOL_EVENT& aEvent ) append_undo = true; moveItem( dragItem, gridpt ); - dragItem->ClearFlags( IS_MOVED ); + dragItem->ClearFlags( IS_MOVING ); updateItem( dragItem, true ); } } @@ -849,7 +849,7 @@ int SCH_MOVE_TOOL::AlignElements( const TOOL_EVENT& aEvent ) moveItem( item, gridpt ); updateItem( item, true ); - item->ClearFlags( IS_MOVED ); + item->ClearFlags( IS_MOVING ); } } else @@ -889,7 +889,7 @@ int SCH_MOVE_TOOL::AlignElements( const TOOL_EVENT& aEvent ) append_undo = true; moveItem( dragItem, most_common ); - dragItem->ClearFlags( IS_MOVED ); + dragItem->ClearFlags( IS_MOVING ); updateItem( dragItem, true ); } } diff --git a/eeschema/tools/symbol_editor_drawing_tools.cpp b/eeschema/tools/symbol_editor_drawing_tools.cpp index b63303c8cd..b2eb8237e2 100644 --- a/eeschema/tools/symbol_editor_drawing_tools.cpp +++ b/eeschema/tools/symbol_editor_drawing_tools.cpp @@ -193,7 +193,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) if( item ) { - item->SetFlags( IS_NEW | IS_MOVED ); + item->SetFlags( IS_NEW | IS_MOVING ); m_view->ClearPreview(); m_view->AddToPreview( item->Clone() ); m_selectionTool->AddItemToSel( item ); diff --git a/eeschema/tools/symbol_editor_move_tool.cpp b/eeschema/tools/symbol_editor_move_tool.cpp index 0d0180f8b9..c16bab276c 100644 --- a/eeschema/tools/symbol_editor_move_tool.cpp +++ b/eeschema/tools/symbol_editor_move_tool.cpp @@ -366,7 +366,7 @@ int SYMBOL_EDITOR_MOVE_TOOL::Main( const TOOL_EVENT& aEvent ) void SYMBOL_EDITOR_MOVE_TOOL::moveItem( EDA_ITEM* aItem, VECTOR2I aDelta ) { static_cast( aItem )->Offset( mapCoords( aDelta ) ); - aItem->SetFlags( IS_MOVED ); + aItem->SetFlags( IS_MOVING ); } diff --git a/include/eda_item.h b/include/eda_item.h index 1398db33e1..fd30083024 100644 --- a/include/eda_item.h +++ b/include/eda_item.h @@ -103,10 +103,10 @@ typedef const INSPECTOR_FUNC& INSPECTOR; #define IS_CHANGED (1 << 0) ///< Item was edited, and modified #define IS_LINKED (1 << 1) ///< Used in calculation to mark linked items (temporary use) #define IN_EDIT (1 << 2) ///< Item currently edited -#define IS_MOVED (1 << 3) ///< Item being moved +#define IS_MOVING (1 << 3) ///< Item being moved #define IS_NEW (1 << 4) ///< New item, just created -#define IS_RESIZED (1 << 5) ///< Item being resized -#define IS_DRAGGED (1 << 6) ///< Item being dragged +#define IS_RESIZING (1 << 5) ///< Item being resized +#define IS_DRAGGING (1 << 6) ///< Item being dragged #define IS_DELETED (1 << 7) #define IS_WIRE_IMAGE (1 << 8) ///< Item to be drawn as wireframe while editing #define STARTPOINT (1 << 9) ///< When a line is selected, these flags indicate which @@ -167,12 +167,12 @@ public: inline bool IsModified() const { return m_flags & IS_CHANGED; } inline bool IsNew() const { return m_flags & IS_NEW; } - inline bool IsMoving() const { return m_flags & IS_MOVED; } - inline bool IsDragging() const { return m_flags & IS_DRAGGED; } + inline bool IsMoving() const { return m_flags & IS_MOVING; } + inline bool IsDragging() const { return m_flags & IS_DRAGGING; } inline bool IsWireImage() const { return m_flags & IS_WIRE_IMAGE; } inline bool IsSelected() const { return m_flags & SELECTED; } inline bool IsEntered() const { return m_flags & ENTERED; } - inline bool IsResized() const { return m_flags & IS_RESIZED; } + inline bool IsResized() const { return m_flags & IS_RESIZING; } inline bool IsBrightened() const { return m_flags & BRIGHTENED; } inline void SetWireImage() { SetFlags( IS_WIRE_IMAGE ); } @@ -207,8 +207,8 @@ public: STATUS_FLAGS GetEditFlags() const { - constexpr int mask = ( IS_NEW | IS_PASTED | IS_MOVED | IS_RESIZED | IS_DRAGGED | - IS_WIRE_IMAGE | STRUCT_DELETED ); + constexpr int mask = ( IS_NEW | IS_PASTED | IS_MOVING | IS_RESIZING | IS_DRAGGING + | IS_WIRE_IMAGE | STRUCT_DELETED ); return m_flags & mask; } diff --git a/pagelayout_editor/tools/pl_drawing_tools.cpp b/pagelayout_editor/tools/pl_drawing_tools.cpp index 483f8609aa..8bb01e3965 100644 --- a/pagelayout_editor/tools/pl_drawing_tools.cpp +++ b/pagelayout_editor/tools/pl_drawing_tools.cpp @@ -160,7 +160,7 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent ) m_toolMgr->RunAction( PL_ACTIONS::clearSelection, true ); item = dataItem->GetDrawItems()[0]; - item->SetFlags( IS_NEW | IS_MOVED ); + item->SetFlags( IS_NEW | IS_MOVING ); // Select the item but don't inform other tools (to prevent the Properties // panel from updating the item before it has been placed) diff --git a/pagelayout_editor/tools/pl_edit_tool.cpp b/pagelayout_editor/tools/pl_edit_tool.cpp index ec570fb458..5281720915 100644 --- a/pagelayout_editor/tools/pl_edit_tool.cpp +++ b/pagelayout_editor/tools/pl_edit_tool.cpp @@ -279,7 +279,7 @@ void PL_EDIT_TOOL::moveItem( DS_DATA_ITEM* aItem, VECTOR2I aDelta ) for( DS_DRAW_ITEM_BASE* item : aItem->GetDrawItems() ) { getView()->Update( item ); - item->SetFlags( IS_MOVED ); + item->SetFlags( IS_MOVING ); } } diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index c5ae5f8019..df458377fd 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -356,7 +356,7 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) else if( evt->IsDrag( BUT_LEFT ) ) { // Is another tool already moving a new object? Don't allow a drag start - if( !m_selection.Empty() && m_selection[0]->HasFlag( IS_NEW | IS_MOVED ) ) + if( !m_selection.Empty() && m_selection[0]->HasFlag( IS_NEW | IS_MOVING ) ) { evt->SetPassEvent(); continue; diff --git a/pcbnew/track.cpp b/pcbnew/track.cpp index dfb62d4428..1ee08cb60e 100644 --- a/pcbnew/track.cpp +++ b/pcbnew/track.cpp @@ -1033,8 +1033,8 @@ wxString TRACK::ShowState( int stateBits ) if( stateBits & IN_EDIT ) ret << wxT( " | IN_EDIT" ); - if( stateBits & IS_DRAGGED ) - ret << wxT( " | IS_DRAGGED" ); + if( stateBits & IS_DRAGGING ) + ret << wxT( " | IS_DRAGGING" ); if( stateBits & DO_NOT_DRAW ) ret << wxT( " | DO_NOT_DRAW" );