2012-03-17 17:30:03 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 NBEE Embedded Systems, Miguel Angel Ajo <miguelangel@nbee.es>
|
|
|
|
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file pcbnew.i
|
|
|
|
* @brief Specific pcbnew wrappers
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2012-02-28 21:30:46 +00:00
|
|
|
%module pcbnew
|
2012-04-08 14:25:49 +00:00
|
|
|
|
|
|
|
%feature("autodoc", "1");
|
2013-09-20 17:01:21 +00:00
|
|
|
#ifdef ENABLE_DOCSTRINGS_FROM_DOXYGEN
|
|
|
|
%include "docstrings.i"
|
|
|
|
#endif
|
2012-04-08 14:25:49 +00:00
|
|
|
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
|
2012-03-11 19:07:10 +00:00
|
|
|
%include "kicad.i"
|
2012-02-28 21:30:46 +00:00
|
|
|
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
%include <convert_to_biu.h>
|
|
|
|
%include <fpid.h>
|
2012-04-06 18:13:03 +00:00
|
|
|
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
// ignore a couple of items that generate warnings from swig built code
|
2012-04-06 18:13:03 +00:00
|
|
|
%ignore BOARD_ITEM::ZeroOffset;
|
|
|
|
%ignore D_PAD::m_PadSketchModePenSize;
|
|
|
|
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
class BASE_SET {};
|
|
|
|
%ignore BASE_SET;
|
|
|
|
|
|
|
|
|
2012-04-20 21:20:56 +00:00
|
|
|
// rename the Add method of classes to Add native, so we will handle
|
2012-11-10 06:39:18 +00:00
|
|
|
// the Add method in python
|
2012-04-06 19:46:45 +00:00
|
|
|
%rename(AddNative) *::Add;
|
|
|
|
|
2014-07-14 14:43:21 +00:00
|
|
|
// fix method names conflicts
|
|
|
|
%rename(AddChild) MODULE::Add;
|
|
|
|
%rename(RemoveChild) MODULE::Remove;
|
|
|
|
%rename(DeleteChild) MODULE::Delete;
|
|
|
|
|
2012-04-24 20:28:23 +00:00
|
|
|
%exception {
|
|
|
|
try{
|
|
|
|
$action
|
|
|
|
}
|
|
|
|
catch( IO_ERROR e )
|
|
|
|
{
|
2012-11-10 06:39:18 +00:00
|
|
|
std::string str = TO_UTF8( e.errorText );
|
|
|
|
str += '\n';
|
|
|
|
PyErr_SetString( PyExc_IOError, str.c_str() );
|
2012-08-29 16:59:50 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
catch( std::exception &e )
|
|
|
|
{
|
2012-11-10 06:39:18 +00:00
|
|
|
std::string str = e.what();
|
|
|
|
str += '\n';
|
|
|
|
PyErr_SetString( PyExc_IOError, str.c_str() );
|
2012-08-29 16:59:50 +00:00
|
|
|
return NULL;
|
2012-04-24 20:28:23 +00:00
|
|
|
}
|
|
|
|
catch( ... )
|
|
|
|
{
|
|
|
|
SWIG_fail;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
%include exception.i
|
|
|
|
|
|
|
|
|
2012-03-17 15:17:13 +00:00
|
|
|
// this is what it must be included in the wrapper .cxx code to compile
|
|
|
|
|
2012-11-10 06:39:18 +00:00
|
|
|
%{
|
2012-03-17 15:17:13 +00:00
|
|
|
#include <wx_python_helpers.h>
|
2012-03-19 07:40:43 +00:00
|
|
|
#include <class_board_item.h>
|
|
|
|
#include <class_board_connected_item.h>
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
#include <class_netinfo.h>
|
2012-04-09 06:19:57 +00:00
|
|
|
#include <class_board_design_settings.h>
|
2012-03-19 07:40:43 +00:00
|
|
|
#include <class_module.h>
|
2012-11-10 06:39:18 +00:00
|
|
|
#include <class_track.h>
|
2014-09-30 18:23:27 +00:00
|
|
|
#include <class_zone.h>
|
2015-08-18 14:19:17 +00:00
|
|
|
#include <zones.h>
|
2012-04-30 16:05:22 +00:00
|
|
|
#include <layers_id_colors_and_visibility.h>
|
2012-03-19 07:40:43 +00:00
|
|
|
#include <class_pad.h>
|
2012-03-17 15:17:13 +00:00
|
|
|
#include <class_pcb_text.h>
|
2012-03-19 07:40:43 +00:00
|
|
|
#include <class_dimension.h>
|
|
|
|
#include <class_drawsegment.h>
|
|
|
|
#include <class_marker_pcb.h>
|
2014-10-13 11:14:02 +00:00
|
|
|
#include <class_mire.h>
|
2012-03-19 07:40:43 +00:00
|
|
|
#include <class_text_mod.h>
|
|
|
|
#include <class_edge_mod.h>
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
|
2012-03-19 07:40:43 +00:00
|
|
|
#include <class_netclass.h>
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
#include <colors.h>
|
|
|
|
|
|
|
|
//#include <dlist.h>
|
|
|
|
#include <class_zone_settings.h>
|
2012-03-19 07:40:43 +00:00
|
|
|
#include <pcbnew_scripting_helpers.h>
|
2012-08-29 16:59:50 +00:00
|
|
|
|
|
|
|
#include <plotcontroller.h>
|
|
|
|
#include <pcb_plot_params.h>
|
2015-04-29 15:37:37 +00:00
|
|
|
#include <exporters/gendrill_Excellon_writer.h>
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
|
|
|
|
#include <class_board.h>
|
2012-11-10 06:39:18 +00:00
|
|
|
|
2012-03-19 07:40:43 +00:00
|
|
|
BOARD *GetBoard(); /* get current editor board */
|
2012-02-28 21:30:46 +00:00
|
|
|
%}
|
|
|
|
|
2012-04-22 11:14:58 +00:00
|
|
|
|
2012-03-11 19:07:10 +00:00
|
|
|
%{
|
2012-03-19 07:40:43 +00:00
|
|
|
#include <io_mgr.h>
|
|
|
|
#include <kicad_plugin.h>
|
2012-03-11 19:07:10 +00:00
|
|
|
%}
|
|
|
|
|
2012-02-28 21:30:46 +00:00
|
|
|
%include <class_board_item.h>
|
2012-03-18 21:35:51 +00:00
|
|
|
%include <class_board_connected_item.h>
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
%include <pad_shapes.h>
|
|
|
|
%include <class_pad.h>
|
|
|
|
%include <class_netinfo.h>
|
2012-02-28 21:30:46 +00:00
|
|
|
%include <class_module.h>
|
|
|
|
%include <class_track.h>
|
2014-09-30 18:23:27 +00:00
|
|
|
%include <class_zone.h>
|
2015-08-18 14:19:17 +00:00
|
|
|
%include <zones.h>
|
2012-04-30 16:05:22 +00:00
|
|
|
%include <layers_id_colors_and_visibility.h>
|
2012-03-11 19:07:10 +00:00
|
|
|
%include <class_pcb_text.h>
|
|
|
|
%include <class_dimension.h>
|
2012-03-18 21:35:51 +00:00
|
|
|
%include <class_drawsegment.h>
|
|
|
|
%include <class_marker_pcb.h>
|
2014-10-13 11:14:02 +00:00
|
|
|
%include <class_mire.h>
|
2012-03-18 21:35:51 +00:00
|
|
|
%include <class_text_mod.h>
|
|
|
|
%include <class_edge_mod.h>
|
2012-03-05 22:49:49 +00:00
|
|
|
%include <dlist.h>
|
2012-03-17 15:17:13 +00:00
|
|
|
%include <class_zone_settings.h>
|
|
|
|
%include <class_netclass.h>
|
|
|
|
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
%include <class_board_design_settings.h>
|
2012-08-29 16:59:50 +00:00
|
|
|
%include <plotcontroller.h>
|
|
|
|
%include <pcb_plot_params.h>
|
|
|
|
%include <plot_common.h>
|
2015-04-29 15:37:37 +00:00
|
|
|
%include <exporters/gendrill_Excellon_writer.h>
|
2012-08-29 16:59:50 +00:00
|
|
|
%include <colors.h>
|
|
|
|
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
%include <class_board.h>
|
|
|
|
|
2012-03-19 11:21:29 +00:00
|
|
|
%include "board_item.i"
|
2012-03-18 21:35:51 +00:00
|
|
|
|
2012-03-17 15:17:13 +00:00
|
|
|
%include <pcbnew_scripting_helpers.h>
|
2012-03-05 22:49:49 +00:00
|
|
|
|
2012-02-28 21:30:46 +00:00
|
|
|
|
2012-04-22 11:14:58 +00:00
|
|
|
// ignore RELEASER as nested classes are still unsupported by swig
|
|
|
|
%ignore IO_MGR::RELEASER;
|
|
|
|
%include <io_mgr.h>
|
|
|
|
%include <kicad_plugin.h>
|
2012-03-19 08:36:38 +00:00
|
|
|
|
2012-03-19 11:21:29 +00:00
|
|
|
%include "board.i"
|
2012-04-06 20:38:32 +00:00
|
|
|
%include "module.i"
|
2012-05-05 20:18:47 +00:00
|
|
|
%include "plugins.i"
|
2012-03-19 11:21:29 +00:00
|
|
|
%include "units.i"
|
2012-04-22 11:14:58 +00:00
|
|
|
|
Pcbnew: major swig fix.
* Switched hashtables.h over to std::undordered_map from boost version.
* Added new macros DECL_VEC_FOR_SWIG() and DECL_MAP_FOR_SWIG() in macros.h.
These along with future DECL_HASH_FOR_SWIG() unify the declaration to swig
and C++ so that the resultant type name is common in both languages, and
the types AGREE.
* Fixed swigging of NETINFO_ITEM and NETINFO_LIST via magic.
* Newly exposed (python wrapped) are: D_PADS, TRACKS (was TRACK_PTRS),
NETNAME_MAP, NETCODE_MAP, wxString (without constructor purposely, read
comment in wx.i), MARKERS, ZONE_CONTAINERS, NETCLASSPTR, KICAD_T types.
* std::vector<SOMETHING*> tends to end up named SOMETHINGS in C++ and python.
Having the name consistent between like types is helpful, and between
languages. std::map<> ends up as SOMETHING_MAP.
* NETINFO_LIST::m_netNames and NETINFO_LIST::m_netCodes are now std::map
instead of hashtables, because swig does not yet support std::unordered_map.
* You can now get to any netclass or net info. NETNAMES_MAP and NETCODES_MAP
are traversable basically the same as a python dictionary using a python
string (not wsString) as the key! The wxString typemap converts python
string to wxString before the lookup happens. Iteration also works.
2016-07-18 17:23:09 +00:00
|
|
|
|
|
|
|
|
2016-02-24 08:45:34 +00:00
|
|
|
// Extend LSET by 2 methods to add or remove layers from the layer list
|
|
|
|
// Mainly used to add or remove layers of a pad layer list
|
|
|
|
%extend LSET
|
|
|
|
{
|
|
|
|
LSET addLayer( LAYER_ID aLayer) { return self->set(aLayer); }
|
|
|
|
LSET removeLayer( LAYER_ID aLayer) { return self->reset(aLayer); }
|
|
|
|
LSET addLayerSet( LSET aLayerSet) { return *self |= aLayerSet; }
|
|
|
|
LSET removeLayerSet( LSET aLayerSet) { return *self &= ~aLayerSet; }
|
|
|
|
|
|
|
|
%pythoncode
|
|
|
|
%{
|
|
|
|
def AddLayer(self, layer):
|
|
|
|
return self.addLayer( layer )
|
|
|
|
|
|
|
|
def AddLayerSet(self, layers):
|
|
|
|
return self.addLayerSet( layers )
|
|
|
|
|
|
|
|
def RemoveLayer(self, layer):
|
|
|
|
return self.removeLayer( layer )
|
|
|
|
|
|
|
|
def RemoveLayerSet(self, layers):
|
|
|
|
return self.removeLayerSet( layers )
|
|
|
|
%}
|
|
|
|
}
|
2012-11-10 06:39:18 +00:00
|
|
|
|