Replace boost::function and boost::bind with their std:: counterparts

This commit is contained in:
Michael Steinberg 2016-06-29 12:23:11 +02:00 committed by Maciej Suminski
parent cef8b388a5
commit fde12ebd25
30 changed files with 136 additions and 108 deletions

View File

@ -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 @@ 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();

View File

@ -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 @@ 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<void(CONTEXT_MENU*)> aFunction )
void CONTEXT_MENU::runOnSubmenus( std::function<void(CONTEXT_MENU*)> aFunction )
{
try
{

View File

@ -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 @@ public:
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 @@ private:
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;

View File

@ -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 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed
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 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed
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 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed
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 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed
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 );

View File

@ -853,7 +853,7 @@ EDA_ITEM* MODULE::Clone() const
}
void MODULE::RunOnChildren( boost::function<void (BOARD_ITEM*)> aFunction )
void MODULE::RunOnChildren( std::function<void (BOARD_ITEM*)> aFunction )
{
try
{
@ -866,7 +866,7 @@ void MODULE::RunOnChildren( boost::function<void (BOARD_ITEM*)> aFunction )
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" ) );
}

View File

@ -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 @@ 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<void (BOARD_ITEM*)> aFunction );
void RunOnChildren( std::function<void (BOARD_ITEM*)> aFunction );
/// @copydoc VIEW_ITEM::ViewUpdate()
void ViewUpdate( int aUpdateFlags = KIGFX::VIEW_ITEM::ALL );

View File

@ -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 @@ void DIALOG_GLOBAL_DELETION::AcceptPcbDelete()
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();

View File

@ -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 @@ 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();
}

View File

@ -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 @@ 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 );

View File

@ -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 @@ 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();
}

View File

@ -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 @@ 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();
}

View File

@ -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

View File

@ -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 @@ 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();
}

View File

@ -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 @@ 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 );
}

View File

@ -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

View File

@ -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 @@ 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_NODE_PTR> 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_NODE_PTR> 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 );

View File

@ -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"

View File

@ -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 @@ 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 )

View File

@ -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 @@ int EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
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 @@ void EDIT_TOOL::remove( BOARD_ITEM* aItem )
{
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 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
{
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 );
@ -851,7 +853,7 @@ private:
if( new_item->Type() == PCB_MODULE_T)
{
static_cast<MODULE*>(new_item)->RunOnChildren(
boost::bind( &KIGFX::VIEW::Add, view, _1 ) );
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<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 @@ void EDIT_TOOL::processPickedList( const PICKED_ITEMS_LIST* aList )
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

View File

@ -23,7 +23,8 @@
*/
#include <boost/foreach.hpp>
#include <boost/bind.hpp>
#include <functional>
using namespace std::placeholders;
#include <wxPcbStruct.h>

View File

@ -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 );

View File

@ -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 @@ 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 );

View File

@ -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 @@ 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();

View File

@ -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 @@ 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 );
}

View File

@ -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 @@ 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;
}

View File

@ -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 @@ 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<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 @@ 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 );
}

View File

@ -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 );

View File

@ -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 @@ 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<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 @@ void SELECTION_TOOL::unselect( BOARD_ITEM* aItem )
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 );

View File

@ -79,7 +79,7 @@ struct SELECTION
/// 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 ) );

View File

@ -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,