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>
|
2017-11-15 13:16:21 +00:00
|
|
|
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
|
2012-03-17 17:30:03 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
2017-12-08 17:02:46 +00:00
|
|
|
// support for wchar_t
|
|
|
|
%include "cwstring.i"
|
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-09-20 15:59:43 +00:00
|
|
|
%include kicad.i
|
2012-02-28 21:30:46 +00:00
|
|
|
|
2017-11-15 13:16:21 +00:00
|
|
|
// mostly for KICAD_T
|
|
|
|
%include typeinfo.i
|
|
|
|
|
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>
|
2016-09-20 15:59:43 +00:00
|
|
|
|
|
|
|
%{
|
2016-11-20 23:35:08 +00:00
|
|
|
#include <lib_id.h>
|
2016-09-20 15:59:43 +00:00
|
|
|
%}
|
2016-11-20 23:35:08 +00:00
|
|
|
%include lib_id.h
|
2016-09-20 15:59:43 +00:00
|
|
|
|
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;
|
2020-11-13 15:15:52 +00:00
|
|
|
%ignore PAD::m_PadSketchModePenSize;
|
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
|
|
|
class BASE_SET {};
|
|
|
|
%ignore BASE_SET;
|
|
|
|
|
|
|
|
|
2012-04-24 20:28:23 +00:00
|
|
|
|
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
|
|
|
%{
|
2016-09-19 19:31:26 +00:00
|
|
|
#include <wx_python_helpers.h>
|
2017-02-20 16:57:41 +00:00
|
|
|
#include <gal/color4d.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
|
|
|
|
2016-09-19 19:31:26 +00:00
|
|
|
#include <pcbnew_scripting_helpers.h>
|
2012-08-29 16:59:50 +00:00
|
|
|
|
2016-09-19 19:31:26 +00:00
|
|
|
#include <plotcontroller.h>
|
|
|
|
#include <pcb_plot_params.h>
|
2020-02-04 10:30:21 +00:00
|
|
|
#include <exporters/export_d356.h>
|
2021-11-03 14:09:14 +00:00
|
|
|
#include <exporters/export_footprints_placefile.h>
|
2020-08-28 11:17:50 +00:00
|
|
|
#include <exporters/export_vrml.h>
|
2017-05-01 12:19:38 +00:00
|
|
|
#include <exporters/gendrill_file_writer_base.h>
|
2016-09-19 19:31:26 +00:00
|
|
|
#include <exporters/gendrill_Excellon_writer.h>
|
2017-05-01 12:19:38 +00:00
|
|
|
#include <exporters/gendrill_gerber_writer.h>
|
2018-08-01 13:54:07 +00:00
|
|
|
#include <exporters/gerber_jobfile_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
|
|
|
|
2016-09-19 19:31:26 +00:00
|
|
|
BOARD *GetBoard(); /* get current editor board */
|
2020-06-05 22:21:41 +00:00
|
|
|
wxArrayString GetFootprintLibraries();
|
|
|
|
wxArrayString GetFootprints(const wxString& aNickName);
|
2012-02-28 21:30:46 +00:00
|
|
|
%}
|
|
|
|
|
2012-04-22 11:14:58 +00:00
|
|
|
|
2016-09-19 19:31:26 +00:00
|
|
|
// ignore RELEASER as nested classes are still unsupported by swig
|
|
|
|
%ignore IO_MGR::RELEASER;
|
|
|
|
%include <io_mgr.h>
|
|
|
|
%{
|
|
|
|
#include <io_mgr.h>
|
|
|
|
%}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
By default we do not translate exceptions for EVERY C++ function since not every
|
|
|
|
C++ function throws, and that would be unused and very bulky mapping code.
|
|
|
|
Therefore please help gather the subset of C++ functions for this class that do
|
|
|
|
throw and add them here, before the class declarations.
|
|
|
|
|
|
|
|
*/
|
|
|
|
HANDLE_EXCEPTIONS(PLUGIN::Load)
|
|
|
|
HANDLE_EXCEPTIONS(PLUGIN::Save)
|
|
|
|
HANDLE_EXCEPTIONS(PLUGIN::FootprintEnumerate)
|
|
|
|
HANDLE_EXCEPTIONS(PLUGIN::FootprintLoad)
|
|
|
|
HANDLE_EXCEPTIONS(PLUGIN::FootprintSave)
|
|
|
|
HANDLE_EXCEPTIONS(PLUGIN::FootprintDelete)
|
2021-11-25 12:22:40 +00:00
|
|
|
%include <plugins/kicad/pcb_plugin.h>
|
2012-03-11 19:07:10 +00:00
|
|
|
%{
|
2021-11-25 12:22:40 +00:00
|
|
|
#include <plugins/kicad/pcb_plugin.h>
|
2012-03-11 19:07:10 +00:00
|
|
|
%}
|
|
|
|
|
2012-03-17 15:17:13 +00:00
|
|
|
|
2012-08-29 16:59:50 +00:00
|
|
|
%include <plotcontroller.h>
|
|
|
|
%include <pcb_plot_params.h>
|
2021-08-18 20:38:14 +00:00
|
|
|
%include <plotters/plotter.h>
|
2020-02-04 10:30:21 +00:00
|
|
|
%include <exporters/export_d356.h>
|
2021-11-03 14:09:14 +00:00
|
|
|
%include <exporters/export_footprints_placefile.h>
|
2020-08-28 11:17:50 +00:00
|
|
|
%include <exporters/export_vrml.h>
|
2017-05-01 12:19:38 +00:00
|
|
|
%include <exporters/gendrill_file_writer_base.h>
|
2015-04-29 15:37:37 +00:00
|
|
|
%include <exporters/gendrill_Excellon_writer.h>
|
2017-05-01 12:19:38 +00:00
|
|
|
%include <exporters/gendrill_gerber_writer.h>
|
2018-08-01 13:54:07 +00:00
|
|
|
%include <exporters/gerber_jobfile_writer.h>
|
2017-02-20 16:57:41 +00:00
|
|
|
%include <gal/color4d.h>
|
2017-03-17 14:41:00 +00:00
|
|
|
%include <id.h>
|
2012-08-29 16:59:50 +00:00
|
|
|
|
2018-02-10 12:46:54 +00:00
|
|
|
HANDLE_EXCEPTIONS(LoadBoard)
|
2020-09-23 00:23:14 +00:00
|
|
|
HANDLE_EXCEPTIONS(WriteDRCReport)
|
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-03-19 08:36:38 +00:00
|
|
|
|
2016-09-20 15:59:43 +00:00
|
|
|
%include board.i
|
2018-02-16 19:26:55 +00:00
|
|
|
%include footprint.i
|
2016-09-20 15:59:43 +00:00
|
|
|
%include plugins.i
|
|
|
|
%include units.i
|
2022-02-03 23:53:12 +00:00
|
|
|
%include version.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
|
|
|
|