Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
b6aa832f
Commit
b6aa832f
authored
Apr 02, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted std::bind1st to boost::bind.
parent
5de41eab
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
18 deletions
+19
-18
board_undo_redo.cpp
pcbnew/board_undo_redo.cpp
+5
-4
pcbframe.cpp
pcbnew/pcbframe.cpp
+2
-1
drawing_tool.cpp
pcbnew/tools/drawing_tool.cpp
+4
-5
edit_tool.cpp
pcbnew/tools/edit_tool.cpp
+5
-6
selection_tool.cpp
pcbnew/tools/selection_tool.cpp
+3
-2
No files found.
pcbnew/board_undo_redo.cpp
View file @
b6aa832f
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
*/
#include <boost/bind.hpp>
#include <fctsys.h>
#include <fctsys.h>
#include <class_drawpanel.h>
#include <class_drawpanel.h>
#include <class_drawpanel_gal.h>
#include <class_drawpanel_gal.h>
...
@@ -522,7 +523,7 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed
...
@@ -522,7 +523,7 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed
if
(
item
->
Type
()
==
PCB_MODULE_T
)
if
(
item
->
Type
()
==
PCB_MODULE_T
)
{
{
MODULE
*
oldModule
=
static_cast
<
MODULE
*>
(
item
);
MODULE
*
oldModule
=
static_cast
<
MODULE
*>
(
item
);
oldModule
->
RunOnChildren
(
std
::
bind1st
(
std
::
mem_fun
(
&
KIGFX
::
VIEW
::
Remove
),
view
)
);
oldModule
->
RunOnChildren
(
boost
::
bind
(
&
KIGFX
::
VIEW
::
Remove
,
view
,
_1
)
);
}
}
ratsnest
->
Remove
(
item
);
ratsnest
->
Remove
(
item
);
...
@@ -533,7 +534,7 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed
...
@@ -533,7 +534,7 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed
if
(
item
->
Type
()
==
PCB_MODULE_T
)
if
(
item
->
Type
()
==
PCB_MODULE_T
)
{
{
MODULE
*
newModule
=
static_cast
<
MODULE
*>
(
item
);
MODULE
*
newModule
=
static_cast
<
MODULE
*>
(
item
);
newModule
->
RunOnChildren
(
std
::
bind1st
(
std
::
mem_fun
(
&
KIGFX
::
VIEW
::
Add
),
view
)
);
newModule
->
RunOnChildren
(
boost
::
bind
(
&
KIGFX
::
VIEW
::
Add
,
view
,
_1
)
);
}
}
ratsnest
->
Add
(
item
);
ratsnest
->
Add
(
item
);
...
@@ -549,7 +550,7 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed
...
@@ -549,7 +550,7 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed
if
(
item
->
Type
()
==
PCB_MODULE_T
)
if
(
item
->
Type
()
==
PCB_MODULE_T
)
{
{
MODULE
*
module
=
static_cast
<
MODULE
*>
(
item
);
MODULE
*
module
=
static_cast
<
MODULE
*>
(
item
);
module
->
RunOnChildren
(
std
::
bind1st
(
std
::
mem_fun
(
&
KIGFX
::
VIEW
::
Remove
),
view
)
);
module
->
RunOnChildren
(
boost
::
bind
(
&
KIGFX
::
VIEW
::
Remove
,
view
,
_1
)
);
}
}
view
->
Remove
(
item
);
view
->
Remove
(
item
);
...
@@ -563,7 +564,7 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed
...
@@ -563,7 +564,7 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed
if
(
item
->
Type
()
==
PCB_MODULE_T
)
if
(
item
->
Type
()
==
PCB_MODULE_T
)
{
{
MODULE
*
module
=
static_cast
<
MODULE
*>
(
item
);
MODULE
*
module
=
static_cast
<
MODULE
*>
(
item
);
module
->
RunOnChildren
(
std
::
bind1st
(
std
::
mem_fun
(
&
KIGFX
::
VIEW
::
Add
),
view
)
);
module
->
RunOnChildren
(
boost
::
bind
(
&
KIGFX
::
VIEW
::
Add
,
view
,
_1
)
);
}
}
view
->
Add
(
item
);
view
->
Add
(
item
);
...
...
pcbnew/pcbframe.cpp
View file @
b6aa832f
...
@@ -75,6 +75,7 @@
...
@@ -75,6 +75,7 @@
#endif
#endif
#include <class_drawpanel_gal.h>
#include <class_drawpanel_gal.h>
#include <boost/bind.hpp>
// Keys used in read/write config
// Keys used in read/write config
#define OPTKEY_DEFAULT_LINEWIDTH_VALUE wxT( "PlotLineWidth_mm" )
#define OPTKEY_DEFAULT_LINEWIDTH_VALUE wxT( "PlotLineWidth_mm" )
...
@@ -524,7 +525,7 @@ void PCB_EDIT_FRAME::ViewReloadBoard( const BOARD* aBoard ) const
...
@@ -524,7 +525,7 @@ void PCB_EDIT_FRAME::ViewReloadBoard( const BOARD* aBoard ) const
// Load modules and its additional elements
// Load modules and its additional elements
for
(
MODULE
*
module
=
aBoard
->
m_Modules
;
module
;
module
=
module
->
Next
()
)
for
(
MODULE
*
module
=
aBoard
->
m_Modules
;
module
;
module
=
module
->
Next
()
)
{
{
module
->
RunOnChildren
(
std
::
bind1st
(
std
::
mem_fun
(
&
KIGFX
::
VIEW
::
Add
),
view
)
);
module
->
RunOnChildren
(
boost
::
bind
(
&
KIGFX
::
VIEW
::
Add
,
view
,
_1
)
);
view
->
Add
(
module
);
view
->
Add
(
module
);
}
}
...
...
pcbnew/tools/drawing_tool.cpp
View file @
b6aa832f
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
*/
#include <boost/bind.hpp>
#include "drawing_tool.h"
#include "drawing_tool.h"
#include "common_actions.h"
#include "common_actions.h"
...
@@ -706,14 +707,13 @@ int DRAWING_TOOL::PlaceModule( TOOL_EVENT& aEvent )
...
@@ -706,14 +707,13 @@ int DRAWING_TOOL::PlaceModule( TOOL_EVENT& aEvent )
// Add all the drawable parts to preview
// Add all the drawable parts to preview
preview
.
Add
(
module
);
preview
.
Add
(
module
);
module
->
RunOnChildren
(
std
::
bind1st
(
std
::
mem_fun
(
&
KIGFX
::
VIEW_GROUP
::
Add
),
module
->
RunOnChildren
(
boost
::
bind
(
&
KIGFX
::
VIEW_GROUP
::
Add
,
&
preview
,
_1
)
);
&
preview
)
);
preview
.
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
preview
.
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
}
}
else
else
{
{
module
->
RunOnChildren
(
std
::
bind1st
(
std
::
mem_fun
(
&
KIGFX
::
VIEW
::
Add
),
m_view
)
);
module
->
RunOnChildren
(
boost
::
bind
(
&
KIGFX
::
VIEW
::
Add
,
m_view
,
_1
)
);
m_view
->
Add
(
module
);
m_view
->
Add
(
module
);
module
->
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
module
->
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
...
@@ -722,8 +722,7 @@ int DRAWING_TOOL::PlaceModule( TOOL_EVENT& aEvent )
...
@@ -722,8 +722,7 @@ int DRAWING_TOOL::PlaceModule( TOOL_EVENT& aEvent )
// Remove from preview
// Remove from preview
preview
.
Remove
(
module
);
preview
.
Remove
(
module
);
module
->
RunOnChildren
(
std
::
bind1st
(
std
::
mem_fun
(
&
KIGFX
::
VIEW_GROUP
::
Remove
),
module
->
RunOnChildren
(
boost
::
bind
(
&
KIGFX
::
VIEW_GROUP
::
Remove
,
&
preview
,
_1
)
);
&
preview
)
);
module
=
NULL
;
// to indicate that there is no module that we currently modify
module
=
NULL
;
// to indicate that there is no module that we currently modify
m_controls
->
ShowCursor
(
true
);
m_controls
->
ShowCursor
(
true
);
...
...
pcbnew/tools/edit_tool.cpp
View file @
b6aa832f
...
@@ -30,16 +30,15 @@
...
@@ -30,16 +30,15 @@
#include <view/view_controls.h>
#include <view/view_controls.h>
#include <ratsnest_data.h>
#include <ratsnest_data.h>
#include <confirm.h>
#include <confirm.h>
#include <cassert>
#include <cassert>
#include <boost/foreach.hpp>
#include <boost/foreach.hpp>
#include <boost/bind.hpp>
#include "common_actions.h"
#include "common_actions.h"
#include "selection_tool.h"
#include "selection_tool.h"
#include "edit_tool.h"
#include "edit_tool.h"
using
namespace
KIGFX
;
using
boost
::
optional
;
EDIT_TOOL
::
EDIT_TOOL
()
:
EDIT_TOOL
::
EDIT_TOOL
()
:
TOOL_INTERACTIVE
(
"pcbnew.InteractiveEdit"
),
m_selectionTool
(
NULL
)
TOOL_INTERACTIVE
(
"pcbnew.InteractiveEdit"
),
m_selectionTool
(
NULL
)
{
{
...
@@ -96,7 +95,7 @@ int EDIT_TOOL::Main( TOOL_EVENT& aEvent )
...
@@ -96,7 +95,7 @@ int EDIT_TOOL::Main( TOOL_EVENT& aEvent )
// Offset from the dragged item's center (anchor)
// Offset from the dragged item's center (anchor)
wxPoint
offset
;
wxPoint
offset
;
VIEW_CONTROLS
*
controls
=
getViewControls
();
KIGFX
::
VIEW_CONTROLS
*
controls
=
getViewControls
();
PCB_EDIT_FRAME
*
editFrame
=
static_cast
<
PCB_EDIT_FRAME
*>
(
m_toolMgr
->
GetEditFrame
()
);
PCB_EDIT_FRAME
*
editFrame
=
static_cast
<
PCB_EDIT_FRAME
*>
(
m_toolMgr
->
GetEditFrame
()
);
controls
->
ShowCursor
(
true
);
controls
->
ShowCursor
(
true
);
controls
->
SetSnapping
(
true
);
controls
->
SetSnapping
(
true
);
...
@@ -163,7 +162,7 @@ int EDIT_TOOL::Main( TOOL_EVENT& aEvent )
...
@@ -163,7 +162,7 @@ int EDIT_TOOL::Main( TOOL_EVENT& aEvent )
m_dragging
=
true
;
m_dragging
=
true
;
}
}
selection
.
group
->
ViewUpdate
(
VIEW_ITEM
::
GEOMETRY
);
selection
.
group
->
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
m_toolMgr
->
RunAction
(
COMMON_ACTIONS
::
pointEditorUpdate
);
m_toolMgr
->
RunAction
(
COMMON_ACTIONS
::
pointEditorUpdate
);
}
}
...
@@ -399,7 +398,7 @@ void EDIT_TOOL::remove( BOARD_ITEM* aItem )
...
@@ -399,7 +398,7 @@ void EDIT_TOOL::remove( BOARD_ITEM* aItem )
{
{
MODULE
*
module
=
static_cast
<
MODULE
*>
(
aItem
);
MODULE
*
module
=
static_cast
<
MODULE
*>
(
aItem
);
module
->
ClearFlags
();
module
->
ClearFlags
();
module
->
RunOnChildren
(
std
::
bind1st
(
std
::
mem_fun
(
&
KIGFX
::
VIEW
::
Remove
),
getView
()
)
);
module
->
RunOnChildren
(
boost
::
bind
(
&
KIGFX
::
VIEW
::
Remove
,
getView
(),
_1
)
);
// Module itself is deleted after the switch scope is finished
// Module itself is deleted after the switch scope is finished
// list of pads is rebuild by BOARD::BuildListOfNets()
// list of pads is rebuild by BOARD::BuildListOfNets()
...
...
pcbnew/tools/selection_tool.cpp
View file @
b6aa832f
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#include <boost/foreach.hpp>
#include <boost/foreach.hpp>
#include <boost/optional.hpp>
#include <boost/optional.hpp>
#include <boost/bind.hpp>
#include <cassert>
#include <cassert>
#include <class_drawpanel_gal.h>
#include <class_drawpanel_gal.h>
...
@@ -556,7 +557,7 @@ void SELECTION_TOOL::select( BOARD_ITEM* aItem )
...
@@ -556,7 +557,7 @@ void SELECTION_TOOL::select( BOARD_ITEM* aItem )
if
(
aItem
->
Type
()
==
PCB_MODULE_T
)
if
(
aItem
->
Type
()
==
PCB_MODULE_T
)
{
{
MODULE
*
module
=
static_cast
<
MODULE
*>
(
aItem
);
MODULE
*
module
=
static_cast
<
MODULE
*>
(
aItem
);
module
->
RunOnChildren
(
std
::
bind1st
(
std
::
mem_fun
(
&
SELECTION_TOOL
::
selectVisually
),
this
)
);
module
->
RunOnChildren
(
boost
::
bind
(
&
SELECTION_TOOL
::
selectVisually
,
this
,
_1
)
);
}
}
selectVisually
(
aItem
);
selectVisually
(
aItem
);
...
@@ -587,7 +588,7 @@ void SELECTION_TOOL::deselect( BOARD_ITEM* aItem )
...
@@ -587,7 +588,7 @@ void SELECTION_TOOL::deselect( BOARD_ITEM* aItem )
if
(
aItem
->
Type
()
==
PCB_MODULE_T
)
if
(
aItem
->
Type
()
==
PCB_MODULE_T
)
{
{
MODULE
*
module
=
static_cast
<
MODULE
*>
(
aItem
);
MODULE
*
module
=
static_cast
<
MODULE
*>
(
aItem
);
module
->
RunOnChildren
(
std
::
bind1st
(
std
::
mem_fun
(
&
SELECTION_TOOL
::
deselectVisually
),
this
)
);
module
->
RunOnChildren
(
boost
::
bind
(
&
SELECTION_TOOL
::
deselectVisually
,
this
,
_1
)
);
}
}
deselectVisually
(
aItem
);
deselectVisually
(
aItem
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment