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
72c70148
Commit
72c70148
authored
Jul 09, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a few memory leaks and Valgrind warnings.
parent
da678809
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
68 additions
and
89 deletions
+68
-89
painter.cpp
common/painter.cpp
+1
-0
context_menu.h
include/tool/context_menu.h
+2
-0
wxPcbStruct.h
include/wxPcbStruct.h
+1
-2
CMakeLists.txt
pcbnew/CMakeLists.txt
+0
-1
basepcbframe.cpp
pcbnew/basepcbframe.cpp
+3
-0
dialog_track_via_size.cpp
pcbnew/dialogs/dialog_track_via_size.cpp
+1
-0
layer_widget.cpp
pcbnew/layer_widget.cpp
+9
-0
layer_widget.h
pcbnew/layer_widget.h
+2
-0
pcbframe.cpp
pcbnew/pcbframe.cpp
+35
-1
pns_routing_settings.cpp
pcbnew/router/pns_routing_settings.cpp
+10
-0
pns_routing_settings.h
pcbnew/router/pns_routing_settings.h
+3
-8
router_tool.h
pcbnew/router/router_tool.h
+0
-5
pcb_tools.cpp
pcbnew/tools/pcb_tools.cpp
+0
-71
selection_tool.cpp
pcbnew/tools/selection_tool.cpp
+1
-1
No files found.
common/painter.cpp
View file @
72c70148
...
...
@@ -38,6 +38,7 @@ RENDER_SETTINGS::RENDER_SETTINGS()
m_highlightEnabled
=
false
;
m_hiContrastEnabled
=
false
;
m_hiContrastFactor
=
0.2
;
m_highlightNetcode
=
-
1
;
m_outlineWidth
=
1
;
m_worksheetLineWidth
=
100000
;
...
...
include/tool/context_menu.h
View file @
72c70148
...
...
@@ -47,6 +47,8 @@ public:
///> Copy constructor
CONTEXT_MENU
(
const
CONTEXT_MENU
&
aMenu
);
virtual
~
CONTEXT_MENU
()
{};
/**
* Function SetTitle()
* Sets title for the context menu. The title is shown as a text label shown on the top of
...
...
include/wxPcbStruct.h
View file @
72c70148
...
...
@@ -117,9 +117,8 @@ protected:
bool
m_useCmpFileForFpNames
;
///< is true, use the .cmp file from CvPcb, else use the netlist
// to know the footprint name of components.
//
Functions that handle the Tool Framework (de)
initalization
//
The Tool Framework
initalization
void
setupTools
();
void
destroyTools
();
// we'll use lower case function names for private member functions.
void
createPopUpMenuForZones
(
ZONE_CONTAINER
*
edge_zone
,
wxMenu
*
aPopMenu
);
...
...
pcbnew/CMakeLists.txt
View file @
72c70148
...
...
@@ -264,7 +264,6 @@ set( PCBNEW_CLASS_SRCS
tools/edit_tool.cpp
tools/pcbnew_control.cpp
tools/pcb_editor_control.cpp
tools/pcb_tools.cpp
tools/placement_tool.cpp
tools/common_actions.cpp
)
...
...
pcbnew/basepcbframe.cpp
View file @
72c70148
...
...
@@ -125,6 +125,9 @@ PCB_BASE_FRAME::~PCB_BASE_FRAME()
{
delete
m_Collector
;
delete
m_toolManager
;
delete
m_toolDispatcher
;
delete
m_Pcb
;
delete
GetGalCanvas
();
}
...
...
pcbnew/dialogs/dialog_track_via_size.cpp
View file @
72c70148
...
...
@@ -26,6 +26,7 @@
#include <router/pns_routing_settings.h>
#include <base_units.h>
#include <confirm.h>
#include <boost/optional.hpp>
DIALOG_TRACK_VIA_SIZE
::
DIALOG_TRACK_VIA_SIZE
(
wxWindow
*
aParent
,
PNS_ROUTING_SETTINGS
&
aSettings
)
:
DIALOG_TRACK_VIA_SIZE_BASE
(
aParent
),
...
...
pcbnew/layer_widget.cpp
View file @
72c70148
...
...
@@ -587,6 +587,15 @@ LAYER_WIDGET::LAYER_WIDGET( wxWindow* aParent, wxWindow* aFocusOwner, int aPoint
}
LAYER_WIDGET
::~
LAYER_WIDGET
()
{
delete
m_BlankBitmap
;
delete
m_BlankAlternateBitmap
;
delete
m_RightArrowBitmap
;
delete
m_RightArrowAlternateBitmap
;
}
wxSize
LAYER_WIDGET
::
GetBestSize
()
const
{
// size of m_LayerScrolledWindow --------------
...
...
pcbnew/layer_widget.h
View file @
72c70148
...
...
@@ -227,6 +227,8 @@ public:
wxWindowID
id
=
wxID_ANY
,
const
wxPoint
&
pos
=
wxDefaultPosition
,
const
wxSize
&
size
=
wxDefaultSize
,
long
style
=
wxTAB_TRAVERSAL
);
virtual
~
LAYER_WIDGET
();
/**
* Function GetBestSize
* returns the preferred minimum size, taking into consideration the
...
...
pcbnew/pcbframe.cpp
View file @
72c70148
...
...
@@ -70,6 +70,17 @@
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
#include <tools/selection_tool.h>
#include <router/router_tool.h>
#include <tools/edit_tool.h>
#include <tools/drawing_tool.h>
#include <tools/point_editor.h>
#include <tools/pcbnew_control.h>
#include <tools/pcb_editor_control.h>
#include <tools/placement_tool.h>
#include <tools/common_actions.h>
#if defined(KICAD_SCRIPTING) || defined(KICAD_SCRIPTING_WXPYTHON)
#include <python_scripting.h>
// The name of the pane info handling the python console:
...
...
@@ -469,7 +480,6 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
PCB_EDIT_FRAME
::~
PCB_EDIT_FRAME
()
{
destroyTools
();
m_RecordingMacros
=
-
1
;
for
(
int
i
=
0
;
i
<
10
;
i
++
)
...
...
@@ -524,6 +534,30 @@ bool PCB_EDIT_FRAME::isAutoSaveRequired() const
}
void
PCB_EDIT_FRAME
::
setupTools
()
{
// Create the manager and dispatcher & route draw panel events to the dispatcher
m_toolManager
=
new
TOOL_MANAGER
;
m_toolManager
->
SetEnvironment
(
NULL
,
GetGalCanvas
()
->
GetView
(),
GetGalCanvas
()
->
GetViewControls
(),
this
);
m_toolDispatcher
=
new
TOOL_DISPATCHER
(
m_toolManager
);
// Register tools
m_toolManager
->
RegisterTool
(
new
SELECTION_TOOL
);
m_toolManager
->
RegisterTool
(
new
ROUTER_TOOL
);
m_toolManager
->
RegisterTool
(
new
EDIT_TOOL
);
m_toolManager
->
RegisterTool
(
new
DRAWING_TOOL
);
m_toolManager
->
RegisterTool
(
new
POINT_EDITOR
);
m_toolManager
->
RegisterTool
(
new
PCBNEW_CONTROL
);
m_toolManager
->
RegisterTool
(
new
PCB_EDITOR_CONTROL
);
m_toolManager
->
RegisterTool
(
new
PLACEMENT_TOOL
);
m_toolManager
->
ResetTools
(
TOOL_BASE
::
RUN
);
// Run the selection tool, it is supposed to be always active
m_toolManager
->
InvokeTool
(
"pcbnew.InteractiveSelection"
);
}
void
PCB_EDIT_FRAME
::
ReFillLayerWidget
()
{
m_Layers
->
ReFill
();
...
...
pcbnew/router/pns_routing_settings.cpp
View file @
72c70148
...
...
@@ -19,6 +19,7 @@
*/
#include "pns_routing_settings.h"
#include "direction.h"
PNS_ROUTING_SETTINGS
::
PNS_ROUTING_SETTINGS
()
{
...
...
@@ -39,6 +40,15 @@ PNS_ROUTING_SETTINGS::PNS_ROUTING_SETTINGS()
}
const
DIRECTION_45
PNS_ROUTING_SETTINGS
::
InitialDirection
()
const
{
if
(
m_startDiagonal
)
return
DIRECTION_45
(
DIRECTION_45
::
NE
);
else
return
DIRECTION_45
(
DIRECTION_45
::
N
);
}
TIME_LIMIT
PNS_ROUTING_SETTINGS
::
ShoveTimeLimit
()
const
{
return
TIME_LIMIT
(
m_shoveTimeLimit
);
...
...
pcbnew/router/pns_routing_settings.h
View file @
72c70148
...
...
@@ -21,8 +21,9 @@
#ifndef __PNS_ROUTING_SETTINGS
#define __PNS_ROUTING_SETTINGS
#include "direction.h"
#include "time_limit.h"
class
DIRECTION_45
;
///> Routing modes
enum
PNS_MODE
...
...
@@ -118,13 +119,7 @@ public:
void
SetViaDrill
(
int
aDrill
)
{
m_viaDrill
=
aDrill
;
}
int
GetViaDrill
()
const
{
return
m_viaDrill
;
}
const
DIRECTION_45
InitialDirection
()
const
{
if
(
m_startDiagonal
)
return
DIRECTION_45
(
DIRECTION_45
::
NE
);
else
return
DIRECTION_45
(
DIRECTION_45
::
N
);
}
const
DIRECTION_45
InitialDirection
()
const
;
int
ShoveIterationLimit
()
const
;
TIME_LIMIT
ShoveTimeLimit
()
const
;
...
...
pcbnew/router/router_tool.h
View file @
72c70148
...
...
@@ -22,18 +22,13 @@
#ifndef __ROUTER_TOOL_H
#define __ROUTER_TOOL_H
#include <set>
#include <boost/shared_ptr.hpp>
#include <import_export.h>
#include <math/vector2d.h>
#include <tool/tool_interactive.h>
#include <wxstruct.h>
#include <msgpanel.h>
#include "pns_layerset.h"
#include "pns_routing_settings.h"
class
PNS_ROUTER
;
...
...
pcbnew/tools/pcb_tools.cpp
deleted
100644 → 0
View file @
da678809
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wxPcbStruct.h>
#include <wxBasePcbFrame.h>
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
#include <class_draw_panel_gal.h>
#include "selection_tool.h"
#include "edit_tool.h"
#include "drawing_tool.h"
#include "point_editor.h"
#include "pcbnew_control.h"
#include "pcb_editor_control.h"
#include "placement_tool.h"
#include "common_actions.h"
#include <router/router_tool.h>
void
PCB_EDIT_FRAME
::
setupTools
()
{
// Create the manager and dispatcher & route draw panel events to the dispatcher
m_toolManager
=
new
TOOL_MANAGER
;
m_toolManager
->
SetEnvironment
(
NULL
,
GetGalCanvas
()
->
GetView
(),
GetGalCanvas
()
->
GetViewControls
(),
this
);
m_toolDispatcher
=
new
TOOL_DISPATCHER
(
m_toolManager
);
// Register tools
m_toolManager
->
RegisterTool
(
new
SELECTION_TOOL
);
m_toolManager
->
RegisterTool
(
new
ROUTER_TOOL
);
m_toolManager
->
RegisterTool
(
new
EDIT_TOOL
);
m_toolManager
->
RegisterTool
(
new
DRAWING_TOOL
);
m_toolManager
->
RegisterTool
(
new
POINT_EDITOR
);
m_toolManager
->
RegisterTool
(
new
PCBNEW_CONTROL
);
m_toolManager
->
RegisterTool
(
new
PCB_EDITOR_CONTROL
);
m_toolManager
->
RegisterTool
(
new
PLACEMENT_TOOL
);
m_toolManager
->
ResetTools
(
TOOL_BASE
::
RUN
);
// Run the selection tool, it is supposed to be always active
m_toolManager
->
InvokeTool
(
"pcbnew.InteractiveSelection"
);
}
void
PCB_EDIT_FRAME
::
destroyTools
()
{
delete
m_toolManager
;
delete
m_toolDispatcher
;
}
pcbnew/tools/selection_tool.cpp
View file @
72c70148
...
...
@@ -54,7 +54,7 @@ SELECTION_TOOL::SELECTION_TOOL() :
SelectedEvent
(
TC_MESSAGE
,
TA_ACTION
,
"pcbnew.InteractiveSelection.selected"
),
DeselectedEvent
(
TC_MESSAGE
,
TA_ACTION
,
"pcbnew.InteractiveSelection.deselected"
),
ClearedEvent
(
TC_MESSAGE
,
TA_ACTION
,
"pcbnew.InteractiveSelection.cleared"
),
m_additive
(
false
),
m_multiple
(
false
),
m_editModules
(
false
)
m_
frame
(
NULL
),
m_
additive
(
false
),
m_multiple
(
false
),
m_editModules
(
false
)
{
m_selArea
=
new
SELECTION_AREA
;
m_selection
.
group
=
new
KIGFX
::
VIEW_GROUP
;
...
...
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