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
|
|
|
|
2012-03-11 19:07:10 +00:00
|
|
|
%include "kicad.i"
|
2012-02-28 21:30:46 +00:00
|
|
|
|
2012-04-06 18:13:03 +00:00
|
|
|
// ignore a couple of items that generate warnings from swig built code
|
|
|
|
|
|
|
|
%ignore BOARD_ITEM::ZeroOffset;
|
|
|
|
%ignore D_PAD::m_PadSketchModePenSize;
|
|
|
|
|
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-20 21:20:56 +00:00
|
|
|
|
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>
|
2012-04-09 06:19:57 +00:00
|
|
|
#include <class_board_design_settings.h>
|
2012-03-19 07:40:43 +00:00
|
|
|
#include <class_board.h>
|
|
|
|
#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-04-30 16:05:22 +00:00
|
|
|
#include <pad_shapes.h>
|
2012-03-19 07:40:43 +00:00
|
|
|
#include <class_netinfo.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>
|
|
|
|
#include <dlist.h>
|
|
|
|
#include <class_zone_settings.h>
|
|
|
|
#include <class_netclass.h>
|
|
|
|
#include <class_netinfo.h>
|
|
|
|
#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>
|
2012-08-29 16:59:50 +00:00
|
|
|
#include <colors.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>
|
2012-04-09 06:19:57 +00:00
|
|
|
%include <class_board_design_settings.h>
|
2012-02-28 21:30:46 +00:00
|
|
|
%include <class_board.h>
|
|
|
|
%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-05 22:49:49 +00:00
|
|
|
%include <class_pad.h>
|
2012-04-30 16:05:22 +00:00
|
|
|
%include <pad_shapes.h>
|
2012-03-11 19:07:10 +00:00
|
|
|
%include <class_netinfo.h>
|
|
|
|
%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>
|
|
|
|
%include <class_netinfo.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>
|
|
|
|
|
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
|
|
|
|
2012-11-10 06:39:18 +00:00
|
|
|
|