diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 998a4a3f7f..bcbee68ea2 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -39,7 +39,8 @@ #endif /* __WXDEBUG__ */ #include -#include +#include +using namespace std::placeholders; using namespace KIGFX; @@ -1532,7 +1533,7 @@ void OPENGL_GAL::OPENGL_TEST::Render( wxPaintEvent& WXUNUSED( aEvent ) ) // One test is enough - close the testing dialog when the test is finished Disconnect( wxEVT_PAINT, wxPaintEventHandler( OPENGL_GAL::OPENGL_TEST::Render ) ); - CallAfter( boost::bind( &wxDialog::EndModal, m_parent, wxID_NONE ) ); + CallAfter( std::bind( &wxDialog::EndModal, m_parent, wxID_NONE ) ); GL_CONTEXT_MANAGER::Get().LockCtx( m_context, this ); GLenum err = glewInit(); diff --git a/common/tool/context_menu.cpp b/common/tool/context_menu.cpp index bd316cbf7d..fe00415748 100644 --- a/common/tool/context_menu.cpp +++ b/common/tool/context_menu.cpp @@ -28,7 +28,8 @@ #include #include -#include +#include +using namespace std::placeholders; #include CONTEXT_MENU::CONTEXT_MENU() : @@ -190,7 +191,7 @@ void CONTEXT_MENU::UpdateAll() if( m_tool ) updateHotKeys(); - runOnSubmenus( boost::bind( &CONTEXT_MENU::UpdateAll, _1 ) ); + runOnSubmenus( std::bind( &CONTEXT_MENU::UpdateAll, _1 ) ); } @@ -198,7 +199,7 @@ void CONTEXT_MENU::SetTool( TOOL_INTERACTIVE* aTool ) { m_tool = aTool; - runOnSubmenus( boost::bind( &CONTEXT_MENU::SetTool, _1, aTool ) ); + runOnSubmenus( std::bind( &CONTEXT_MENU::SetTool, _1, aTool ) ); } @@ -306,11 +307,11 @@ void CONTEXT_MENU::runEventHandlers( const wxMenuEvent& aMenuEvent, OPT_TOOL_EVE aToolEvent = m_menu_handler( aMenuEvent ); if( !aToolEvent ) - runOnSubmenus( boost::bind( &CONTEXT_MENU::runEventHandlers, _1, aMenuEvent, aToolEvent ) ); + runOnSubmenus( std::bind( &CONTEXT_MENU::runEventHandlers, _1, aMenuEvent, aToolEvent ) ); } -void CONTEXT_MENU::runOnSubmenus( boost::function aFunction ) +void CONTEXT_MENU::runOnSubmenus( std::function aFunction ) { try { diff --git a/include/tool/context_menu.h b/include/tool/context_menu.h index 819cb5eeba..60ae7bf347 100644 --- a/include/tool/context_menu.h +++ b/include/tool/context_menu.h @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include @@ -126,8 +126,8 @@ public: void UpdateAll(); // Helper typedefs - typedef boost::function MENU_HANDLER; - typedef boost::function UPDATE_HANDLER; + typedef std::function MENU_HANDLER; + typedef std::function UPDATE_HANDLER; /** * Function SetMenuHandler() @@ -192,7 +192,7 @@ private: void runEventHandlers( const wxMenuEvent& aMenuEvent, OPT_TOOL_EVENT& aToolEvent ); ///> Runs a function on the menu and all its submenus. - void runOnSubmenus( boost::function aFunction ); + void runOnSubmenus( std::function aFunction ); ///> Flag indicating that the menu title was set up. bool m_titleSet; diff --git a/pcbnew/board_undo_redo.cpp b/pcbnew/board_undo_redo.cpp index 1670d00b54..c7aecac947 100644 --- a/pcbnew/board_undo_redo.cpp +++ b/pcbnew/board_undo_redo.cpp @@ -23,7 +23,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include +#include +using namespace std::placeholders; #include #include #include @@ -569,7 +570,7 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed if( item->Type() == PCB_MODULE_T ) { MODULE* oldModule = static_cast( item ); - oldModule->RunOnChildren( boost::bind( &KIGFX::VIEW::Remove, view, _1 ) ); + oldModule->RunOnChildren( std::bind( &KIGFX::VIEW::Remove, view, _1 ) ); } view->Remove( item ); ratsnest->Remove( item ); @@ -581,7 +582,7 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed if( item->Type() == PCB_MODULE_T ) { MODULE* newModule = static_cast( item ); - newModule->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1 ) ); + newModule->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1 ) ); } view->Add( item ); ratsnest->Add( item ); @@ -598,7 +599,7 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed if( item->Type() == PCB_MODULE_T ) { MODULE* module = static_cast( item ); - module->RunOnChildren( boost::bind( &KIGFX::VIEW::Remove, view, _1 ) ); + module->RunOnChildren( std::bind( &KIGFX::VIEW::Remove, view, _1 ) ); } view->Remove( item ); @@ -612,7 +613,7 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed if( item->Type() == PCB_MODULE_T ) { MODULE* module = static_cast( item ); - module->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1) ); + module->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1) ); } view->Add( item ); diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index fef9924f6d..21d25b1d0c 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -853,7 +853,7 @@ EDA_ITEM* MODULE::Clone() const } -void MODULE::RunOnChildren( boost::function aFunction ) +void MODULE::RunOnChildren( std::function aFunction ) { try { @@ -866,7 +866,7 @@ void MODULE::RunOnChildren( boost::function aFunction ) aFunction( static_cast( m_Reference ) ); aFunction( static_cast( m_Value ) ); } - catch( boost::bad_function_call& e ) + catch( std::bad_function_call& e ) { DisplayError( NULL, wxT( "Error running MODULE::RunOnChildren" ) ); } diff --git a/pcbnew/class_module.h b/pcbnew/class_module.h index 2034dce396..1af049248a 100644 --- a/pcbnew/class_module.h +++ b/pcbnew/class_module.h @@ -41,7 +41,7 @@ #include #include "zones.h" -#include +#include class LINE_READER; class EDA_3D_CANVAS; @@ -551,7 +551,7 @@ public: * Invokes a function on all BOARD_ITEMs that belong to the module (pads, drawings, texts). * @param aFunction is the function to be invoked. */ - void RunOnChildren( boost::function aFunction ); + void RunOnChildren( std::function aFunction ); /// @copydoc VIEW_ITEM::ViewUpdate() void ViewUpdate( int aUpdateFlags = KIGFX::VIEW_ITEM::ALL ); diff --git a/pcbnew/dialogs/dialog_global_deletion.cpp b/pcbnew/dialogs/dialog_global_deletion.cpp index 8d1c2b4c52..cbbc61b973 100644 --- a/pcbnew/dialogs/dialog_global_deletion.cpp +++ b/pcbnew/dialogs/dialog_global_deletion.cpp @@ -21,7 +21,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include +#include +using namespace std::placeholders; #include #include @@ -207,7 +208,7 @@ void DIALOG_GLOBAL_DELETION::AcceptPcbDelete() itemPicker.SetItem( item ); pickersList.PushItem( itemPicker ); static_cast( item )->RunOnChildren( - boost::bind( &KIGFX::VIEW_ITEM::ViewRelease, _1 ) ); + std::bind( &KIGFX::VIEW_ITEM::ViewRelease, _1 ) ); ratsnest->Remove( item ); item->ViewRelease(); item->UnLink(); diff --git a/pcbnew/dialogs/dialog_update_pcb.cpp b/pcbnew/dialogs/dialog_update_pcb.cpp index 3a399f0cdd..ff80e156df 100644 --- a/pcbnew/dialogs/dialog_update_pcb.cpp +++ b/pcbnew/dialogs/dialog_update_pcb.cpp @@ -10,7 +10,8 @@ #include #include -#include +#include +using namespace std::placeholders; DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB( PCB_EDIT_FRAME* aParent, NETLIST *aNetlist ) : DIALOG_UPDATE_PCB_BASE ( aParent ), @@ -44,7 +45,7 @@ void DIALOG_UPDATE_PCB::PerformUpdate( bool aDryRun ) // Remove old modules for( MODULE* module = board->m_Modules; module; module = module->Next() ) { - module->RunOnChildren( boost::bind( &KIGFX::VIEW::Remove, view, _1 ) ); + module->RunOnChildren( std::bind( &KIGFX::VIEW::Remove, view, _1 ) ); view->Remove( module ); } @@ -92,7 +93,7 @@ void DIALOG_UPDATE_PCB::PerformUpdate( bool aDryRun ) // Reload modules for( MODULE* module = board->m_Modules; module; module = module->Next() ) { - module->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1 ) ); + module->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1 ) ); view->Add( module ); module->ViewUpdate(); } diff --git a/pcbnew/loadcmp.cpp b/pcbnew/loadcmp.cpp index c49d105adf..f40fa72afb 100644 --- a/pcbnew/loadcmp.cpp +++ b/pcbnew/loadcmp.cpp @@ -28,7 +28,8 @@ * @brief Footprints selection and loading functions. */ -#include +#include +using namespace std::placeholders; #include #include @@ -99,7 +100,7 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule ) aModule = newModule; newModule->ClearFlags(); - newModule->RunOnChildren( boost::bind( &clearModuleItemFlags, _1 ) ); + newModule->RunOnChildren( std::bind( &clearModuleItemFlags, _1 ) ); GetBoard()->Add( newModule ); diff --git a/pcbnew/modedit.cpp b/pcbnew/modedit.cpp index 5d73b136f3..fa02c907dc 100644 --- a/pcbnew/modedit.cpp +++ b/pcbnew/modedit.cpp @@ -63,7 +63,8 @@ #include #include -#include +#include +using namespace std::placeholders; // Functions defined in block_module_editor, but used here @@ -463,7 +464,8 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) if( pcbframe->IsGalCanvasActive() ) { KIGFX::VIEW* view = pcbframe->GetGalCanvas()->GetView(); - source_module->RunOnChildren( boost::bind( &KIGFX::VIEW::Remove, view, _1 ) ); + source_module->RunOnChildren( std::bind( &KIGFX::VIEW::Remove, view, + std::placeholders::_1 ) ); view->Remove( source_module ); } @@ -497,7 +499,8 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ratsnest->Recalculate(); KIGFX::VIEW* view = pcbframe->GetGalCanvas()->GetView(); - newmodule->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1 ) ); + newmodule->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, + std::placeholders::_1 ) ); view->Add( newmodule ); pcbframe->GetGalCanvas()->ForceRefresh(); } diff --git a/pcbnew/modedit_undo_redo.cpp b/pcbnew/modedit_undo_redo.cpp index ac72fd672f..08b8674fdd 100644 --- a/pcbnew/modedit_undo_redo.cpp +++ b/pcbnew/modedit_undo_redo.cpp @@ -22,7 +22,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include +#include +using namespace std::placeholders; + #include #include #include @@ -104,7 +106,7 @@ void FOOTPRINT_EDIT_FRAME::RestoreCopyFromRedoList( wxCommandEvent& aEvent ) GetScreen()->PushCommandToUndoList( lastcmd ); view->Remove( module ); - module->RunOnChildren( boost::bind( &KIGFX::VIEW::Remove, view, _1 ) ); + module->RunOnChildren( std::bind( &KIGFX::VIEW::Remove, view, _1 ) ); // Retrieve last module state from undo list lastcmd = GetScreen()->PopCommandFromRedoList(); @@ -116,7 +118,7 @@ void FOOTPRINT_EDIT_FRAME::RestoreCopyFromRedoList( wxCommandEvent& aEvent ) { GetBoard()->Add( module ); GetGalCanvas()->GetView()->Add( module ); - module->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1 ) ); + module->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1 ) ); module->ViewUpdate(); } @@ -151,7 +153,7 @@ void FOOTPRINT_EDIT_FRAME::RestoreCopyFromUndoList( wxCommandEvent& aEvent ) GetScreen()->PushCommandToRedoList( lastcmd ); view->Remove( module ); - module->RunOnChildren( boost::bind( &KIGFX::VIEW::Remove, view, _1 ) ); + module->RunOnChildren( std::bind( &KIGFX::VIEW::Remove, view, _1 ) ); // Retrieve last module state from undo list lastcmd = GetScreen()->PopCommandFromUndoList(); @@ -163,7 +165,7 @@ void FOOTPRINT_EDIT_FRAME::RestoreCopyFromUndoList( wxCommandEvent& aEvent ) { GetBoard()->Add( module, ADD_APPEND ); view->Add( module ); - module->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1 ) ); + module->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1 ) ); module->ViewUpdate(); } diff --git a/pcbnew/modview_frame.cpp b/pcbnew/modview_frame.cpp index c5b3174e2b..5ba9241dfb 100644 --- a/pcbnew/modview_frame.cpp +++ b/pcbnew/modview_frame.cpp @@ -57,7 +57,8 @@ #include "tools/pcbnew_control.h" #include "tools/common_actions.h" -#include +#include +using namespace std::placeholders; #define NEXT_PART 1 diff --git a/pcbnew/netlist.cpp b/pcbnew/netlist.cpp index 96b4e8b88e..0058fddd57 100644 --- a/pcbnew/netlist.cpp +++ b/pcbnew/netlist.cpp @@ -27,7 +27,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include +#include +using namespace std::placeholders; + #include #include #include @@ -105,7 +107,7 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName, // Remove old modules for( MODULE* module = board->m_Modules; module; module = module->Next() ) { - module->RunOnChildren( boost::bind( &KIGFX::VIEW::Remove, view, _1 ) ); + module->RunOnChildren( std::bind( &KIGFX::VIEW::Remove, view, _1 ) ); view->Remove( module ); } } @@ -140,7 +142,7 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName, // Reload modules for( MODULE* module = board->m_Modules; module; module = module->Next() ) { - module->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1 ) ); + module->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1 ) ); view->Add( module ); module->ViewUpdate(); } diff --git a/pcbnew/pcb_draw_panel_gal.cpp b/pcbnew/pcb_draw_panel_gal.cpp index 75ca9f01f4..c7b37a0245 100644 --- a/pcbnew/pcb_draw_panel_gal.cpp +++ b/pcbnew/pcb_draw_panel_gal.cpp @@ -36,7 +36,8 @@ #include #include -#include +#include +using namespace std::placeholders; const LAYER_NUM GAL_LAYER_ORDER[] = { @@ -145,7 +146,7 @@ void PCB_DRAW_PANEL_GAL::DisplayBoard( const BOARD* aBoard ) // Load modules and its additional elements for( MODULE* module = aBoard->m_Modules; module; module = module->Next() ) { - module->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, m_view, _1 ) ); + module->RunOnChildren( std::bind( &KIGFX::VIEW::Add, m_view, _1 ) ); m_view->Add( module ); } diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 2f6214f7b6..896d1d1576 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -78,7 +78,8 @@ #include #include -#include +#include +using namespace std::placeholders; ///@{ /// \ingroup config diff --git a/pcbnew/ratsnest_data.cpp b/pcbnew/ratsnest_data.cpp index 04d379ae49..605baa97bf 100644 --- a/pcbnew/ratsnest_data.cpp +++ b/pcbnew/ratsnest_data.cpp @@ -42,7 +42,8 @@ #include #include #include -#include +#include +using namespace std::placeholders; #include @@ -379,7 +380,7 @@ void RN_NET::clearNode( const RN_NODE_PTR& aNode ) // Remove all ratsnest edges for associated with the node newEnd = std::remove_if( m_rnEdges->begin(), m_rnEdges->end(), - boost::bind( isEdgeConnectingNode, _1, boost::cref( aNode ) ) ); + std::bind( isEdgeConnectingNode, _1, std::cref( aNode ) ) ); m_rnEdges->resize( std::distance( m_rnEdges->begin(), newEnd ) ); } @@ -618,7 +619,7 @@ std::list RN_NET::GetClosestNodes( const RN_NODE_PTR& aNode, int aN closest.push_back( node ); // Sort by the distance from aNode - closest.sort( boost::bind( sortDistance, boost::cref( aNode ), _1, _2 ) ); + closest.sort( std::bind( sortDistance, std::cref( aNode ), _1, _2 ) ); // aNode should not be returned in the results closest.remove( aNode ); @@ -642,7 +643,7 @@ std::list RN_NET::GetClosestNodes( const RN_NODE_PTR& aNode, closest.push_back( node ); // Sort by the distance from aNode - closest.sort( boost::bind( sortDistance, boost::cref( aNode ), _1, _2 ) ); + closest.sort( std::bind( sortDistance, std::cref( aNode ), _1, _2 ) ); // aNode should not be returned in the results closest.remove( aNode ); diff --git a/pcbnew/router/pns_tool_base.cpp b/pcbnew/router/pns_tool_base.cpp index 5ebbb2d2b9..43e37086d0 100644 --- a/pcbnew/router/pns_tool_base.cpp +++ b/pcbnew/router/pns_tool_base.cpp @@ -22,7 +22,8 @@ #include #include -#include +#include +using namespace std::placeholders; #include "class_draw_panel_gal.h" #include "class_board.h" diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index b837ad5b70..6dab447a2a 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -22,7 +22,8 @@ #include #include -#include +#include +using namespace std::placeholders; #include "class_draw_panel_gal.h" #include "class_board.h" @@ -121,7 +122,7 @@ public: CONTEXT_TRACK_WIDTH_MENU() : CONTEXT_TRACK_VIA_SIZE_MENU( true, true ), m_board( NULL ) { - SetMenuHandler( boost::bind( &CONTEXT_TRACK_WIDTH_MENU::EventHandler, this, _1 ) ); + SetMenuHandler( std::bind( &CONTEXT_TRACK_WIDTH_MENU::EventHandler, this, _1 ) ); } void SetBoard( BOARD* aBoard ) diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 4bf4ba1833..907e2b98eb 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -44,7 +44,8 @@ #include #include -#include +#include +using namespace std::placeholders; #include "common_actions.h" #include "selection_tool.h" @@ -370,9 +371,10 @@ int EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) editFrame->SaveCopyInUndoList( selection.items, UR_CHANGED ); dlg.Apply(); - selection.ForAll( boost::bind( &KIGFX::VIEW_ITEM::ViewUpdate, _1, - KIGFX::VIEW_ITEM::ALL ) ); - selection.ForAll( boost::bind( &RN_DATA::Update, ratsnest, _1 ) ); + selection.ForAll( std::bind( &KIGFX::VIEW_ITEM::ViewUpdate, + std::placeholders::_1, KIGFX::VIEW_ITEM::ALL ) ); + selection.ForAll( std::bind( &RN_DATA::Update, ratsnest, + std::placeholders::_1 ) ); ratsnest->Recalculate(); } } @@ -559,7 +561,7 @@ void EDIT_TOOL::remove( BOARD_ITEM* aItem ) { MODULE* module = static_cast( aItem ); module->ClearFlags(); - module->RunOnChildren( boost::bind( &KIGFX::VIEW::Remove, getView(), _1 ) ); + module->RunOnChildren( std::bind( &KIGFX::VIEW::Remove, getView(), std::placeholders::_1 ) ); // Module itself is deleted after the switch scope is finished // list of pads is rebuild by BOARD::BuildListOfNets() @@ -763,8 +765,8 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent ) { if( new_item->Type() == PCB_MODULE_T ) { - static_cast( new_item )->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, - getView(), _1 ) ); + static_cast( new_item )->RunOnChildren( std::bind( &KIGFX::VIEW::Add, + getView(), std::placeholders::_1 ) ); } editFrame->GetGalCanvas()->GetView()->Add( new_item ); @@ -850,8 +852,8 @@ private: KIGFX::VIEW* view = m_parent.GetToolManager()->GetView(); if( new_item->Type() == PCB_MODULE_T) { - static_cast( new_item )->RunOnChildren( - boost::bind( &KIGFX::VIEW::Add, view, _1 ) ); + static_cast(new_item)->RunOnChildren( + std::bind(&KIGFX::VIEW::Add, view, std::placeholders::_1)); } m_parent.GetGalCanvas()->GetView()->Add( new_item ); @@ -1014,8 +1016,8 @@ void EDIT_TOOL::processPickedList( const PICKED_ITEMS_LIST* aList ) case UR_DELETED: if( updItem->Type() == PCB_MODULE_T ) - static_cast( updItem )->RunOnChildren( boost::bind( &KIGFX::VIEW::Remove, - view, _1 ) ); + static_cast( updItem )->RunOnChildren( std::bind( &KIGFX::VIEW::Remove, + view, std::placeholders::_1 ) ); view->Remove( updItem ); //ratsnest->Remove( updItem ); // this is done in BOARD::Remove @@ -1023,8 +1025,8 @@ void EDIT_TOOL::processPickedList( const PICKED_ITEMS_LIST* aList ) case UR_NEW: if( updItem->Type() == PCB_MODULE_T ) - static_cast( updItem )->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, - view, _1 ) ); + static_cast( updItem )->RunOnChildren( std::bind( &KIGFX::VIEW::Add, + view, std::placeholders::_1 ) ); view->Add( updItem ); //ratsnest->Add( updItem ); // this is done in BOARD::Add diff --git a/pcbnew/tools/grid_helper.cpp b/pcbnew/tools/grid_helper.cpp index b53fca2b9d..18f31d084d 100644 --- a/pcbnew/tools/grid_helper.cpp +++ b/pcbnew/tools/grid_helper.cpp @@ -23,7 +23,8 @@ */ #include -#include +#include +using namespace std::placeholders; #include diff --git a/pcbnew/tools/grid_menu.cpp b/pcbnew/tools/grid_menu.cpp index 4d233515d8..9647fa9e76 100644 --- a/pcbnew/tools/grid_menu.cpp +++ b/pcbnew/tools/grid_menu.cpp @@ -28,15 +28,16 @@ #include #include -#include +#include +using namespace std::placeholders; GRID_MENU::GRID_MENU( EDA_DRAW_FRAME* aParent ) : m_parent( aParent ) { BASE_SCREEN* screen = aParent->GetScreen(); SetIcon( grid_select_xpm ); - SetMenuHandler( boost::bind( &GRID_MENU::EventHandler, this, _1 ) ); - SetUpdateHandler( boost::bind( &GRID_MENU::Update, this ) ); + SetMenuHandler( std::bind( &GRID_MENU::EventHandler, this, _1 ) ); + SetUpdateHandler( std::bind( &GRID_MENU::Update, this ) ); wxArrayString gridsList; screen->BuildGridsChoiceList( gridsList, g_UserUnit != INCHES ); diff --git a/pcbnew/tools/module_tools.cpp b/pcbnew/tools/module_tools.cpp index 2c34d83d14..d5cfeb4f12 100644 --- a/pcbnew/tools/module_tools.cpp +++ b/pcbnew/tools/module_tools.cpp @@ -44,7 +44,8 @@ #include #include -#include +#include +using namespace std::placeholders; #include #include @@ -431,7 +432,8 @@ int MODULE_TOOLS::PasteItems( const TOOL_EVENT& aEvent ) KIGFX::VIEW_GROUP preview( m_view ); pastedModule->SetParent( m_board ); pastedModule->SetPosition( wxPoint( cursorPos.x, cursorPos.y ) ); - pastedModule->RunOnChildren( boost::bind( &KIGFX::VIEW_GROUP::Add, boost::ref( preview ), _1 ) ); + pastedModule->RunOnChildren( std::bind( &KIGFX::VIEW_GROUP::Add, + std::ref( preview ), _1 ) ); preview.Add( pastedModule ); m_view->Add( &preview ); diff --git a/pcbnew/tools/pcb_editor_control.cpp b/pcbnew/tools/pcb_editor_control.cpp index 4c5cd55858..0476bb4614 100644 --- a/pcbnew/tools/pcb_editor_control.cpp +++ b/pcbnew/tools/pcb_editor_control.cpp @@ -22,8 +22,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include - #include "pcb_editor_control.h" #include "common_actions.h" #include @@ -48,7 +46,8 @@ #include #include -#include +#include +using namespace std::placeholders; class ZONE_CONTEXT_MENU : public CONTEXT_MENU @@ -57,7 +56,7 @@ public: ZONE_CONTEXT_MENU() { SetIcon( add_zone_xpm ); - SetUpdateHandler( boost::bind( &ZONE_CONTEXT_MENU::update, this ) ); + SetUpdateHandler( std::bind( &ZONE_CONTEXT_MENU::update, this ) ); Add( COMMON_ACTIONS::zoneFill ); Add( COMMON_ACTIONS::zoneFillAll ); Add( COMMON_ACTIONS::zoneUnfill ); @@ -293,14 +292,14 @@ int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent ) // Add all the drawable parts to preview preview.Add( module ); - module->RunOnChildren( boost::bind( &KIGFX::VIEW_GROUP::Add, &preview, _1 ) ); + module->RunOnChildren( std::bind( &KIGFX::VIEW_GROUP::Add, &preview, _1 ) ); preview.ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); } else { // Place the selected module - module->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1 ) ); + module->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1 ) ); view->Add( module ); module->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); @@ -309,7 +308,7 @@ int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent ) // Remove from preview preview.Remove( module ); - module->RunOnChildren( boost::bind( &KIGFX::VIEW_GROUP::Remove, &preview, _1 ) ); + module->RunOnChildren( std::bind( &KIGFX::VIEW_GROUP::Remove, &preview, _1 ) ); module = NULL; // to indicate that there is no module that we currently modify } @@ -734,7 +733,7 @@ int PCB_EDITOR_CONTROL::DrillOrigin( const TOOL_EVENT& aEvent ) assert( picker ); m_frame->SetToolID( ID_PCB_PLACE_OFFSET_COORD_BUTT, wxCURSOR_PENCIL, _( "Adjust zero" ) ); - picker->SetClickHandler( boost::bind( setDrillOrigin, getView(), m_frame, m_placeOrigin, _1 ) ); + picker->SetClickHandler( std::bind( setDrillOrigin, getView(), m_frame, m_placeOrigin, _1 ) ); picker->Activate(); Wait(); @@ -806,7 +805,7 @@ int PCB_EDITOR_CONTROL::HighlightNetCursor( const TOOL_EVENT& aEvent ) assert( picker ); m_frame->SetToolID( ID_PCB_HIGHLIGHT_BUTT, wxCURSOR_PENCIL, _( "Highlight net" ) ); - picker->SetClickHandler( boost::bind( highlightNet, m_toolMgr, _1 ) ); + picker->SetClickHandler( std::bind( highlightNet, m_toolMgr, _1 ) ); picker->SetSnapping( false ); picker->Activate(); Wait(); diff --git a/pcbnew/tools/pcbnew_control.cpp b/pcbnew/tools/pcbnew_control.cpp index 90f00dd99e..d0e6542116 100644 --- a/pcbnew/tools/pcbnew_control.cpp +++ b/pcbnew/tools/pcbnew_control.cpp @@ -48,7 +48,8 @@ #include #include -#include +#include +using namespace std::placeholders; // files.cpp @@ -651,7 +652,7 @@ int PCBNEW_CONTROL::GridSetOrigin( const TOOL_EVENT& aEvent ) // TODO it will not check the toolbar button in module editor, as it uses a different ID.. m_frame->SetToolID( ID_PCB_PLACE_GRID_COORD_BUTT, wxCURSOR_PENCIL, _( "Adjust grid origin" ) ); - picker->SetClickHandler( boost::bind( setOrigin, getView(), m_frame, m_gridOrigin, _1 ) ); + picker->SetClickHandler( std::bind( setOrigin, getView(), m_frame, m_gridOrigin, _1 ) ); picker->Activate(); Wait(); } @@ -756,7 +757,7 @@ int PCBNEW_CONTROL::DeleteItemCursor( const TOOL_EVENT& aEvent ) // TODO it will not check the toolbar button in the module editor, as it uses a different ID.. m_frame->SetToolID( ID_PCB_DELETE_ITEM_BUTT, wxCURSOR_PENCIL, _( "Delete item" ) ); picker->SetSnapping( false ); - picker->SetClickHandler( boost::bind( deleteItem, m_toolMgr, _1 ) ); + picker->SetClickHandler( std::bind( deleteItem, m_toolMgr, _1 ) ); picker->Activate(); Wait(); @@ -850,7 +851,7 @@ int PCBNEW_CONTROL::AppendBoard( const TOOL_EVENT& aEvent ) picker.SetItem( module ); undoListPicker.PushItem( picker ); - module->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1 ) ); + module->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1 ) ); view->Add( module ); m_toolMgr->RunAction( COMMON_ACTIONS::selectItem, true, module ); } diff --git a/pcbnew/tools/point_editor.cpp b/pcbnew/tools/point_editor.cpp index d73a90b225..722df12455 100644 --- a/pcbnew/tools/point_editor.cpp +++ b/pcbnew/tools/point_editor.cpp @@ -23,7 +23,8 @@ */ #include -#include +#include +using namespace std::placeholders; #include #include @@ -141,7 +142,7 @@ public: } points->Line( i ).SetConstraint( new EC_SNAPLINE( points->Line( i ), - boost::bind( &KIGFX::GAL::GetGridPoint, aGal, _1 ) ) ); + std::bind( &KIGFX::GAL::GetGridPoint, aGal, _1 ) ) ); } // The last missing line, connecting the last and the first polygon point @@ -150,7 +151,7 @@ public: points->Line( points->LinesSize() - 1 ).SetConstraint( new EC_SNAPLINE( points->Line( points->LinesSize() - 1 ), - boost::bind( &KIGFX::GAL::GetGridPoint, aGal, _1 ) ) ); + std::bind( &KIGFX::GAL::GetGridPoint, aGal, _1 ) ) ); break; } @@ -213,7 +214,7 @@ bool POINT_EDITOR::Init() m_selectionTool->GetMenu().AddItem( COMMON_ACTIONS::pointEditorAddCorner, POINT_EDITOR::addCornerCondition ); m_selectionTool->GetMenu().AddItem( COMMON_ACTIONS::pointEditorRemoveCorner, - boost::bind( &POINT_EDITOR::removeCornerCondition, this, _1 ) ); + std::bind( &POINT_EDITOR::removeCornerCondition, this, _1 ) ); return true; } diff --git a/pcbnew/tools/selection_conditions.cpp b/pcbnew/tools/selection_conditions.cpp index 40ce758a39..c9b58b7d6f 100644 --- a/pcbnew/tools/selection_conditions.cpp +++ b/pcbnew/tools/selection_conditions.cpp @@ -26,7 +26,8 @@ #include "selection_tool.h" #include -#include +#include +using namespace std::placeholders; bool SELECTION_CONDITIONS::NotEmpty( const SELECTION& aSelection ) @@ -54,55 +55,55 @@ bool SELECTION_CONDITIONS::OnlyConnectedItems( const SELECTION& aSelection ) SELECTION_CONDITION SELECTION_CONDITIONS::SameNet( bool aAllowUnconnected ) { - return boost::bind( &SELECTION_CONDITIONS::sameNetFunc, _1, aAllowUnconnected ); + return std::bind( &SELECTION_CONDITIONS::sameNetFunc, _1, aAllowUnconnected ); } SELECTION_CONDITION SELECTION_CONDITIONS::SameLayer() { - return boost::bind( &SELECTION_CONDITIONS::sameLayerFunc, _1 ); + return std::bind( &SELECTION_CONDITIONS::sameLayerFunc, _1 ); } SELECTION_CONDITION SELECTION_CONDITIONS::HasType( KICAD_T aType ) { - return boost::bind( &SELECTION_CONDITIONS::hasTypeFunc, _1, aType ); + return std::bind( &SELECTION_CONDITIONS::hasTypeFunc, _1, aType ); } SELECTION_CONDITION SELECTION_CONDITIONS::OnlyType( KICAD_T aType ) { - return boost::bind( &SELECTION_CONDITIONS::onlyTypeFunc, _1, aType ); + return std::bind( &SELECTION_CONDITIONS::onlyTypeFunc, _1, aType ); } SELECTION_CONDITION SELECTION_CONDITIONS::OnlyTypes( const std::vector& aTypes ) { - return boost::bind( &SELECTION_CONDITIONS::onlyTypesFunc, _1, aTypes ); + return std::bind( &SELECTION_CONDITIONS::onlyTypesFunc, _1, aTypes ); } SELECTION_CONDITION SELECTION_CONDITIONS::OnlyTypes( const KICAD_T aTypes[] ) { - return boost::bind( &SELECTION_CONDITIONS::onlyTypesFuncArr, _1, aTypes ); + return std::bind( &SELECTION_CONDITIONS::onlyTypesFuncArr, _1, aTypes ); } SELECTION_CONDITION SELECTION_CONDITIONS::Count( int aNumber ) { - return boost::bind( &SELECTION_CONDITIONS::countFunc, _1, aNumber ); + return std::bind( &SELECTION_CONDITIONS::countFunc, _1, aNumber ); } SELECTION_CONDITION SELECTION_CONDITIONS::MoreThan( int aNumber ) { - return boost::bind( &SELECTION_CONDITIONS::moreThanFunc, _1, aNumber ); + return std::bind( &SELECTION_CONDITIONS::moreThanFunc, _1, aNumber ); } SELECTION_CONDITION SELECTION_CONDITIONS::LessThan( int aNumber ) { - return boost::bind( &SELECTION_CONDITIONS::lessThanFunc, _1, aNumber ); + return std::bind( &SELECTION_CONDITIONS::lessThanFunc, _1, aNumber ); } @@ -280,12 +281,12 @@ bool SELECTION_CONDITIONS::lessThanFunc( const SELECTION& aSelection, int aNumbe SELECTION_CONDITION operator||( const SELECTION_CONDITION& aConditionA, const SELECTION_CONDITION& aConditionB ) { - return boost::bind( &SELECTION_CONDITIONS::orFunc, aConditionA, aConditionB, _1 ); + return std::bind( &SELECTION_CONDITIONS::orFunc, aConditionA, aConditionB, _1 ); } SELECTION_CONDITION operator&&( const SELECTION_CONDITION& aConditionA, const SELECTION_CONDITION& aConditionB ) { - return boost::bind( &SELECTION_CONDITIONS::andFunc, aConditionA, aConditionB, _1 ); + return std::bind( &SELECTION_CONDITIONS::andFunc, aConditionA, aConditionB, _1 ); } diff --git a/pcbnew/tools/selection_conditions.h b/pcbnew/tools/selection_conditions.h index e7070dc765..6cefe52152 100644 --- a/pcbnew/tools/selection_conditions.h +++ b/pcbnew/tools/selection_conditions.h @@ -25,14 +25,14 @@ #ifndef SELECTION_CONDITIONS_H_ #define SELECTION_CONDITIONS_H_ -#include +#include #include #include struct SELECTION; ///> Functor type that checks a specific condition for selected items. -typedef boost::function SELECTION_CONDITION; +typedef std::function SELECTION_CONDITION; SELECTION_CONDITION operator||( const SELECTION_CONDITION& aConditionA, const SELECTION_CONDITION& aConditionB ); diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index c548c2fcfa..1d46e72a87 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -25,8 +25,8 @@ #include #include -#include -#include +#include +using namespace std::placeholders; #include #include @@ -729,7 +729,7 @@ int SELECTION_TOOL::find( const TOOL_EVENT& aEvent ) { DIALOG_FIND dlg( m_frame ); dlg.EnableWarp( false ); - dlg.SetCallback( boost::bind( &SELECTION_TOOL::findCallback, this, _1 ) ); + dlg.SetCallback( std::bind( &SELECTION_TOOL::findCallback, this, _1 ) ); dlg.ShowModal(); return 0; @@ -986,7 +986,7 @@ void SELECTION_TOOL::select( BOARD_ITEM* aItem ) if( aItem->Type() == PCB_MODULE_T ) { MODULE* module = static_cast( aItem ); - module->RunOnChildren( boost::bind( &SELECTION_TOOL::selectVisually, this, _1 ) ); + module->RunOnChildren( std::bind( &SELECTION_TOOL::selectVisually, this, _1 ) ); } if( aItem->Type() == PCB_PAD_T ) @@ -1024,7 +1024,7 @@ void SELECTION_TOOL::unselect( BOARD_ITEM* aItem ) if( aItem->Type() == PCB_MODULE_T ) { MODULE* module = static_cast( aItem ); - module->RunOnChildren( boost::bind( &SELECTION_TOOL::unselectVisually, this, _1 ) ); + module->RunOnChildren( std::bind( &SELECTION_TOOL::unselectVisually, this, _1 ) ); } unselectVisually( aItem ); diff --git a/pcbnew/tools/selection_tool.h b/pcbnew/tools/selection_tool.h index 4e7046c7ed..4a04516f28 100644 --- a/pcbnew/tools/selection_tool.h +++ b/pcbnew/tools/selection_tool.h @@ -79,7 +79,7 @@ struct SELECTION /// Runs a function on all selected items. template - void ForAll( boost::function aFunction ) const + void ForAll( std::function aFunction ) const { for( unsigned int i = 0; i < items.GetCount(); ++i ) aFunction( Item( i ) ); diff --git a/pcbnew/tools/zoom_menu.cpp b/pcbnew/tools/zoom_menu.cpp index 42aa0936e8..9085f08480 100644 --- a/pcbnew/tools/zoom_menu.cpp +++ b/pcbnew/tools/zoom_menu.cpp @@ -28,15 +28,16 @@ #include #include -#include +#include +using namespace std::placeholders; ZOOM_MENU::ZOOM_MENU( EDA_DRAW_FRAME* aParent ) : m_parent( aParent ) { BASE_SCREEN* screen = aParent->GetScreen(); SetIcon( zoom_selection_xpm ); - SetMenuHandler( boost::bind( &ZOOM_MENU::EventHandler, this, _1 ) ); - SetUpdateHandler( boost::bind( &ZOOM_MENU::Update, this ) ); + SetMenuHandler( std::bind( &ZOOM_MENU::EventHandler, this, _1 ) ); + SetUpdateHandler( std::bind( &ZOOM_MENU::Update, this ) ); //int zoom = screen->GetZoom(); int maxZoomIds = std::min( ID_POPUP_ZOOM_LEVEL_END - ID_POPUP_ZOOM_LEVEL_START,