kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #25236
replace_boost_function_boost_bind.patch: Replace boost::function and boost::bind with their std:: counterparts
=== modified file 'common/gal/opengl/opengl_gal.cpp'
--- common/gal/opengl/opengl_gal.cpp 2016-06-13 14:43:33 +0000
+++ common/gal/opengl/opengl_gal.cpp 2016-06-28 13:23:01 +0000
@@ -39,7 +39,8 @@
#endif /* __WXDEBUG__ */
#include <limits>
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
using namespace KIGFX;
@@ -1532,7 +1533,7 @@
// 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();
=== modified file 'common/tool/context_menu.cpp'
--- common/tool/context_menu.cpp 2015-08-15 14:00:33 +0000
+++ common/tool/context_menu.cpp 2016-06-28 13:23:01 +0000
@@ -28,7 +28,8 @@
#include <tool/tool_interactive.h>
#include <tool/context_menu.h>
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
#include <cassert>
CONTEXT_MENU::CONTEXT_MENU() :
@@ -190,7 +191,7 @@
if( m_tool )
updateHotKeys();
- runOnSubmenus( boost::bind( &CONTEXT_MENU::UpdateAll, _1 ) );
+ runOnSubmenus( std::bind( &CONTEXT_MENU::UpdateAll, _1 ) );
}
@@ -198,7 +199,7 @@
{
m_tool = aTool;
- runOnSubmenus( boost::bind( &CONTEXT_MENU::SetTool, _1, aTool ) );
+ runOnSubmenus( std::bind( &CONTEXT_MENU::SetTool, _1, aTool ) );
}
@@ -306,11 +307,11 @@
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<void(CONTEXT_MENU*)> aFunction )
+void CONTEXT_MENU::runOnSubmenus( std::function<void(CONTEXT_MENU*)> aFunction )
{
try
{
=== modified file 'include/tool/context_menu.h'
--- include/tool/context_menu.h 2015-08-03 09:53:58 +0000
+++ include/tool/context_menu.h 2016-06-28 13:23:01 +0000
@@ -28,7 +28,7 @@
#include <map>
#include <list>
-#include <boost/function.hpp>
+#include <functional>
#include <wx/menu.h>
#include <tool/tool_action.h>
@@ -126,8 +126,8 @@
void UpdateAll();
// Helper typedefs
- typedef boost::function<OPT_TOOL_EVENT(const wxMenuEvent&)> MENU_HANDLER;
- typedef boost::function<void()> UPDATE_HANDLER;
+ typedef std::function<OPT_TOOL_EVENT(const wxMenuEvent&)> MENU_HANDLER;
+ typedef std::function<void()> UPDATE_HANDLER;
/**
* Function SetMenuHandler()
@@ -192,7 +192,7 @@
void runEventHandlers( const wxMenuEvent& aMenuEvent, OPT_TOOL_EVENT& aToolEvent );
///> Runs a function on the menu and all its submenus.
- void runOnSubmenus( boost::function<void(CONTEXT_MENU*)> aFunction );
+ void runOnSubmenus( std::function<void(CONTEXT_MENU*)> aFunction );
///> Flag indicating that the menu title was set up.
bool m_titleSet;
=== modified file 'pcbnew/board_undo_redo.cpp'
--- pcbnew/board_undo_redo.cpp 2016-01-29 14:43:40 +0000
+++ pcbnew/board_undo_redo.cpp 2016-06-28 13:23:01 +0000
@@ -23,7 +23,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
#include <fctsys.h>
#include <class_drawpanel.h>
#include <class_draw_panel_gal.h>
@@ -569,7 +570,7 @@
if( item->Type() == PCB_MODULE_T )
{
MODULE* oldModule = static_cast<MODULE*>( 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 @@
if( item->Type() == PCB_MODULE_T )
{
MODULE* newModule = static_cast<MODULE*>( 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 @@
if( item->Type() == PCB_MODULE_T )
{
MODULE* module = static_cast<MODULE*>( 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 @@
if( item->Type() == PCB_MODULE_T )
{
MODULE* module = static_cast<MODULE*>( item );
- module->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1) );
+ module->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1) );
}
view->Add( item );
=== modified file 'pcbnew/class_module.cpp'
--- pcbnew/class_module.cpp 2016-06-07 13:07:47 +0000
+++ pcbnew/class_module.cpp 2016-06-28 13:23:01 +0000
@@ -853,7 +853,7 @@
}
-void MODULE::RunOnChildren( boost::function<void (BOARD_ITEM*)> aFunction )
+void MODULE::RunOnChildren( std::function<void (BOARD_ITEM*)> aFunction )
{
try
{
@@ -866,7 +866,7 @@
aFunction( static_cast<BOARD_ITEM*>( m_Reference ) );
aFunction( static_cast<BOARD_ITEM*>( m_Value ) );
}
- catch( boost::bad_function_call& e )
+ catch( std::bad_function_call& e )
{
DisplayError( NULL, wxT( "Error running MODULE::RunOnChildren" ) );
}
=== modified file 'pcbnew/class_module.h'
--- pcbnew/class_module.h 2016-06-01 09:28:07 +0000
+++ pcbnew/class_module.h 2016-06-28 13:23:01 +0000
@@ -41,7 +41,7 @@
#include <PolyLine.h>
#include "zones.h"
-#include <boost/function.hpp>
+#include <functional>
class LINE_READER;
class EDA_3D_CANVAS;
@@ -551,7 +551,7 @@
* 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<void (BOARD_ITEM*)> aFunction );
+ void RunOnChildren( std::function<void (BOARD_ITEM*)> aFunction );
/// @copydoc VIEW_ITEM::ViewUpdate()
void ViewUpdate( int aUpdateFlags = KIGFX::VIEW_ITEM::ALL );
=== modified file 'pcbnew/dialogs/dialog_global_deletion.cpp'
--- pcbnew/dialogs/dialog_global_deletion.cpp 2015-09-22 15:55:10 +0000
+++ pcbnew/dialogs/dialog_global_deletion.cpp 2016-06-28 13:23:01 +0000
@@ -21,7 +21,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
#include <fctsys.h>
#include <class_drawpanel.h>
@@ -207,7 +208,7 @@
itemPicker.SetItem( item );
pickersList.PushItem( itemPicker );
static_cast<MODULE*>( item )->RunOnChildren(
- boost::bind( &KIGFX::VIEW_ITEM::ViewRelease, _1 ) );
+ std::bind( &KIGFX::VIEW_ITEM::ViewRelease, _1 ) );
ratsnest->Remove( item );
item->ViewRelease();
item->UnLink();
=== modified file 'pcbnew/dialogs/dialog_update_pcb.cpp'
--- pcbnew/dialogs/dialog_update_pcb.cpp 2016-03-18 03:09:24 +0000
+++ pcbnew/dialogs/dialog_update_pcb.cpp 2016-06-28 13:23:01 +0000
@@ -10,7 +10,8 @@
#include <class_board.h>
#include <ratsnest_data.h>
-#include <boost/bind.hpp>
+#include <functional>
+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 @@
// 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 @@
// 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();
}
=== modified file 'pcbnew/loadcmp.cpp'
--- pcbnew/loadcmp.cpp 2016-05-29 15:02:34 +0000
+++ pcbnew/loadcmp.cpp 2016-06-28 13:23:01 +0000
@@ -28,7 +28,8 @@
* @brief Footprints selection and loading functions.
*/
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
#include <fctsys.h>
#include <class_drawpanel.h>
@@ -99,7 +100,7 @@
aModule = newModule;
newModule->ClearFlags();
- newModule->RunOnChildren( boost::bind( &clearModuleItemFlags, _1 ) );
+ newModule->RunOnChildren( std::bind( &clearModuleItemFlags, _1 ) );
GetBoard()->Add( newModule );
=== modified file 'pcbnew/modedit.cpp'
--- pcbnew/modedit.cpp 2016-06-08 11:19:53 +0000
+++ pcbnew/modedit.cpp 2016-06-28 13:23:01 +0000
@@ -63,7 +63,8 @@
#include <footprint_wizard_frame.h>
#include <pcbnew_config.h>
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
// Functions defined in block_module_editor, but used here
@@ -463,7 +464,8 @@
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 @@
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();
}
=== modified file 'pcbnew/modedit_undo_redo.cpp'
--- pcbnew/modedit_undo_redo.cpp 2015-08-04 21:08:13 +0000
+++ pcbnew/modedit_undo_redo.cpp 2016-06-28 13:23:01 +0000
@@ -22,7 +22,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
+
#include <fctsys.h>
#include <class_drawpanel.h>
#include <class_draw_panel_gal.h>
@@ -104,7 +106,7 @@
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 @@
{
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 @@
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 @@
{
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();
}
=== modified file 'pcbnew/modview_frame.cpp'
--- pcbnew/modview_frame.cpp 2016-04-18 18:15:44 +0000
+++ pcbnew/modview_frame.cpp 2016-06-28 13:23:01 +0000
@@ -57,7 +57,8 @@
#include "tools/pcbnew_control.h"
#include "tools/common_actions.h"
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
#define NEXT_PART 1
=== modified file 'pcbnew/netlist.cpp'
--- pcbnew/netlist.cpp 2016-05-29 15:02:34 +0000
+++ pcbnew/netlist.cpp 2016-06-28 13:23:01 +0000
@@ -27,7 +27,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
+
#include <fctsys.h>
#include <pgm_base.h>
#include <class_drawpanel.h>
@@ -105,7 +107,7 @@
// 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 @@
// 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();
}
=== modified file 'pcbnew/pcb_draw_panel_gal.cpp'
--- pcbnew/pcb_draw_panel_gal.cpp 2016-06-07 13:07:47 +0000
+++ pcbnew/pcb_draw_panel_gal.cpp 2016-06-28 13:23:01 +0000
@@ -36,7 +36,8 @@
#include <class_track.h>
#include <wxBasePcbFrame.h>
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
const LAYER_NUM GAL_LAYER_ORDER[] =
{
@@ -145,7 +146,7 @@
// 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 );
}
=== modified file 'pcbnew/pcbframe.cpp'
--- pcbnew/pcbframe.cpp 2016-06-12 02:34:07 +0000
+++ pcbnew/pcbframe.cpp 2016-06-28 13:23:01 +0000
@@ -78,7 +78,8 @@
#include <pcb_draw_panel_gal.h>
#include <gal/graphics_abstraction_layer.h>
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
///@{
/// \ingroup config
=== modified file 'pcbnew/ratsnest_data.cpp'
--- pcbnew/ratsnest_data.cpp 2016-06-28 09:58:18 +0000
+++ pcbnew/ratsnest_data.cpp 2016-06-28 13:23:01 +0000
@@ -42,7 +42,8 @@
#include <boost/range/adaptor/map.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/make_shared.hpp>
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
#include <geometry/shape_poly_set.h>
@@ -379,7 +380,7 @@
// 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 @@
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 @@
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 );
=== modified file 'pcbnew/router/pns_tool_base.cpp'
--- pcbnew/router/pns_tool_base.cpp 2015-11-03 16:19:42 +0000
+++ pcbnew/router/pns_tool_base.cpp 2016-06-28 13:23:01 +0000
@@ -22,7 +22,8 @@
#include <boost/foreach.hpp>
#include <boost/optional.hpp>
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
#include "class_draw_panel_gal.h"
#include "class_board.h"
=== modified file 'pcbnew/router/router_tool.cpp'
--- pcbnew/router/router_tool.cpp 2016-06-07 15:33:12 +0000
+++ pcbnew/router/router_tool.cpp 2016-06-28 13:23:01 +0000
@@ -22,7 +22,8 @@
#include <boost/foreach.hpp>
#include <boost/optional.hpp>
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
#include "class_draw_panel_gal.h"
#include "class_board.h"
@@ -121,7 +122,7 @@
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 )
=== modified file 'pcbnew/tools/edit_tool.cpp'
--- pcbnew/tools/edit_tool.cpp 2016-06-01 09:28:07 +0000
+++ pcbnew/tools/edit_tool.cpp 2016-06-28 13:23:01 +0000
@@ -44,7 +44,8 @@
#include <cassert>
#include <boost/foreach.hpp>
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
#include "common_actions.h"
#include "selection_tool.h"
@@ -370,9 +371,10 @@
editFrame->SaveCopyInUndoList( selection.items, UR_CHANGED );
dlg.Apply();
- selection.ForAll<KIGFX::VIEW_ITEM>( boost::bind( &KIGFX::VIEW_ITEM::ViewUpdate, _1,
- KIGFX::VIEW_ITEM::ALL ) );
- selection.ForAll<BOARD_ITEM>( boost::bind( &RN_DATA::Update, ratsnest, _1 ) );
+ selection.ForAll<KIGFX::VIEW_ITEM>( std::bind( &KIGFX::VIEW_ITEM::ViewUpdate,
+ std::placeholders::_1, KIGFX::VIEW_ITEM::ALL ) );
+ selection.ForAll<BOARD_ITEM>( std::bind( &RN_DATA::Update, ratsnest,
+ std::placeholders::_1 ) );
ratsnest->Recalculate();
}
}
@@ -559,7 +561,7 @@
{
MODULE* module = static_cast<MODULE*>( 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 @@
{
if( new_item->Type() == PCB_MODULE_T )
{
- static_cast<MODULE*>( new_item )->RunOnChildren( boost::bind( &KIGFX::VIEW::Add,
- getView(), _1 ) );
+ static_cast<MODULE*>( new_item )->RunOnChildren( std::bind( &KIGFX::VIEW::Add,
+ getView(), std::placeholders::_1 ) );
}
editFrame->GetGalCanvas()->GetView()->Add( new_item );
@@ -850,8 +852,8 @@
KIGFX::VIEW* view = m_parent.GetToolManager()->GetView();
if( new_item->Type() == PCB_MODULE_T)
{
- static_cast<MODULE*>( new_item )->RunOnChildren(
- boost::bind( &KIGFX::VIEW::Add, view, _1 ) );
+ static_cast<MODULE*>(new_item)->RunOnChildren(
+ std::bind(&KIGFX::VIEW::Add, view, std::placeholders::_1));
}
m_parent.GetGalCanvas()->GetView()->Add( new_item );
@@ -1014,8 +1016,8 @@
case UR_DELETED:
if( updItem->Type() == PCB_MODULE_T )
- static_cast<MODULE*>( updItem )->RunOnChildren( boost::bind( &KIGFX::VIEW::Remove,
- view, _1 ) );
+ static_cast<MODULE*>( 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 @@
case UR_NEW:
if( updItem->Type() == PCB_MODULE_T )
- static_cast<MODULE*>( updItem )->RunOnChildren( boost::bind( &KIGFX::VIEW::Add,
- view, _1 ) );
+ static_cast<MODULE*>( updItem )->RunOnChildren( std::bind( &KIGFX::VIEW::Add,
+ view, std::placeholders::_1 ) );
view->Add( updItem );
//ratsnest->Add( updItem ); // this is done in BOARD::Add
=== modified file 'pcbnew/tools/grid_helper.cpp'
--- pcbnew/tools/grid_helper.cpp 2016-01-11 22:06:11 +0000
+++ pcbnew/tools/grid_helper.cpp 2016-06-28 13:23:01 +0000
@@ -23,7 +23,8 @@
*/
#include <boost/foreach.hpp>
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
#include <wxPcbStruct.h>
=== modified file 'pcbnew/tools/grid_menu.cpp'
--- pcbnew/tools/grid_menu.cpp 2015-05-12 09:05:36 +0000
+++ pcbnew/tools/grid_menu.cpp 2016-06-28 13:23:01 +0000
@@ -28,15 +28,16 @@
#include <class_base_screen.h>
#include <tools/common_actions.h>
-#include <boost/bind.hpp>
+#include <functional>
+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 );
=== modified file 'pcbnew/tools/module_tools.cpp'
--- pcbnew/tools/module_tools.cpp 2016-05-04 12:06:10 +0000
+++ pcbnew/tools/module_tools.cpp 2016-06-28 13:23:01 +0000
@@ -44,7 +44,8 @@
#include <class_module.h>
#include <class_edge_mod.h>
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
#include <boost/foreach.hpp>
#include <wx/defs.h>
@@ -431,7 +432,8 @@
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 );
=== modified file 'pcbnew/tools/pcb_editor_control.cpp'
--- pcbnew/tools/pcb_editor_control.cpp 2016-05-11 02:36:23 +0000
+++ pcbnew/tools/pcb_editor_control.cpp 2016-06-28 13:23:01 +0000
@@ -22,8 +22,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <boost/bind.hpp>
-
#include "pcb_editor_control.h"
#include "common_actions.h"
#include <tool/tool_manager.h>
@@ -48,7 +46,8 @@
#include <view/view_controls.h>
#include <origin_viewitem.h>
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
class ZONE_CONTEXT_MENU : public CONTEXT_MENU
@@ -57,7 +56,7 @@
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 @@
// 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 @@
// 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 @@
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 @@
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();
=== modified file 'pcbnew/tools/pcbnew_control.cpp'
--- pcbnew/tools/pcbnew_control.cpp 2016-05-04 12:59:14 +0000
+++ pcbnew/tools/pcbnew_control.cpp 2016-06-28 13:23:01 +0000
@@ -48,7 +48,8 @@
#include <pcb_painter.h>
#include <origin_viewitem.h>
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
// files.cpp
@@ -651,7 +652,7 @@
// 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 @@
// 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 @@
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 );
}
=== modified file 'pcbnew/tools/point_editor.cpp'
--- pcbnew/tools/point_editor.cpp 2015-12-14 21:20:54 +0000
+++ pcbnew/tools/point_editor.cpp 2016-06-28 13:23:01 +0000
@@ -23,7 +23,8 @@
*/
#include <boost/make_shared.hpp>
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
#include <tool/tool_manager.h>
#include <view/view_controls.h>
@@ -141,7 +142,7 @@
}
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 @@
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 @@
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;
}
=== modified file 'pcbnew/tools/selection_conditions.cpp'
--- pcbnew/tools/selection_conditions.cpp 2016-05-04 16:35:20 +0000
+++ pcbnew/tools/selection_conditions.cpp 2016-06-28 13:23:01 +0000
@@ -26,7 +26,8 @@
#include "selection_tool.h"
#include <class_board_connected_item.h>
-#include <boost/bind.hpp>
+#include <functional>
+using namespace std::placeholders;
bool SELECTION_CONDITIONS::NotEmpty( const SELECTION& aSelection )
@@ -54,55 +55,55 @@
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<KICAD_T>& 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 @@
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 );
}
=== modified file 'pcbnew/tools/selection_conditions.h'
--- pcbnew/tools/selection_conditions.h 2016-05-04 16:35:20 +0000
+++ pcbnew/tools/selection_conditions.h 2016-06-28 13:23:01 +0000
@@ -25,14 +25,14 @@
#ifndef SELECTION_CONDITIONS_H_
#define SELECTION_CONDITIONS_H_
-#include <boost/function.hpp>
+#include <functional>
#include <core/typeinfo.h>
#include <vector>
struct SELECTION;
///> Functor type that checks a specific condition for selected items.
-typedef boost::function<bool (const SELECTION&)> SELECTION_CONDITION;
+typedef std::function<bool (const SELECTION&)> SELECTION_CONDITION;
SELECTION_CONDITION operator||( const SELECTION_CONDITION& aConditionA,
const SELECTION_CONDITION& aConditionB );
=== modified file 'pcbnew/tools/selection_tool.cpp'
--- pcbnew/tools/selection_tool.cpp 2016-05-09 08:41:11 +0000
+++ pcbnew/tools/selection_tool.cpp 2016-06-28 13:23:01 +0000
@@ -25,8 +25,8 @@
#include <limits>
#include <boost/foreach.hpp>
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
+#include <functional>
+using namespace std::placeholders;
#include <class_board.h>
#include <class_board_item.h>
@@ -729,7 +729,7 @@
{
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 @@
if( aItem->Type() == PCB_MODULE_T )
{
MODULE* module = static_cast<MODULE*>( 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 @@
if( aItem->Type() == PCB_MODULE_T )
{
MODULE* module = static_cast<MODULE*>( aItem );
- module->RunOnChildren( boost::bind( &SELECTION_TOOL::unselectVisually, this, _1 ) );
+ module->RunOnChildren( std::bind( &SELECTION_TOOL::unselectVisually, this, _1 ) );
}
unselectVisually( aItem );
=== modified file 'pcbnew/tools/selection_tool.h'
--- pcbnew/tools/selection_tool.h 2016-01-20 14:22:09 +0000
+++ pcbnew/tools/selection_tool.h 2016-06-28 13:23:01 +0000
@@ -79,7 +79,7 @@
/// Runs a function on all selected items.
template <typename T>
- void ForAll( boost::function<void (T*)> aFunction ) const
+ void ForAll( std::function<void (T*)> aFunction ) const
{
for( unsigned int i = 0; i < items.GetCount(); ++i )
aFunction( Item<T>( i ) );
=== modified file 'pcbnew/tools/zoom_menu.cpp'
--- pcbnew/tools/zoom_menu.cpp 2015-07-30 11:49:35 +0000
+++ pcbnew/tools/zoom_menu.cpp 2016-06-28 13:23:01 +0000
@@ -28,15 +28,16 @@
#include <class_base_screen.h>
#include <tools/common_actions.h>
-#include <boost/bind.hpp>
+#include <functional>
+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,
Follow ups