Add more HANDLE_EXCEPTIONS(), board.i refactoring.
This commit is contained in:
parent
64232ce10c
commit
d957670034
|
@ -510,14 +510,12 @@ add_dependencies( dsntest lib-dependencies )
|
||||||
target_link_libraries( pcbcommon 3d-viewer )
|
target_link_libraries( pcbcommon 3d-viewer )
|
||||||
|
|
||||||
|
|
||||||
# kiway.so
|
# _kiway.so
|
||||||
if( false ) # future
|
if( false ) # future
|
||||||
#if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
|
#if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
|
||||||
#file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/scripting )
|
|
||||||
|
|
||||||
set( SWIG_FLAGS
|
set( SWIG_FLAGS
|
||||||
-I${CMAKE_CURRENT_SOURCE_DIR}/../include
|
-I${CMAKE_CURRENT_SOURCE_DIR}/../include
|
||||||
-I${CMAKE_CURRENT_SOURCE_DIR}/swig/wx
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if( DEBUG )
|
if( DEBUG )
|
||||||
|
@ -535,8 +533,6 @@ if( false ) # future
|
||||||
|
|
||||||
set( CMAKE_SWIG_FLAGS ${SWIG_FLAGS} )
|
set( CMAKE_SWIG_FLAGS ${SWIG_FLAGS} )
|
||||||
|
|
||||||
#set( SWIG_OPTS -python -c++ -outdir ${CMAKE_CURRENT_BINARY_DIR} ${SWIG_FLAGS} )
|
|
||||||
|
|
||||||
include_directories( BEFORE ${INC_BEFORE} )
|
include_directories( BEFORE ${INC_BEFORE} )
|
||||||
include_directories(
|
include_directories(
|
||||||
../common
|
../common
|
||||||
|
@ -550,10 +546,6 @@ if( false ) # future
|
||||||
|
|
||||||
swig_add_module( kiway python
|
swig_add_module( kiway python
|
||||||
swig/kiway.i
|
swig/kiway.i
|
||||||
#../common/kiway.cpp
|
|
||||||
#../common/project.cpp
|
|
||||||
#../common/pgm_base.cpp
|
|
||||||
#../common/
|
|
||||||
)
|
)
|
||||||
|
|
||||||
swig_link_libraries( kiway
|
swig_link_libraries( kiway
|
||||||
|
@ -563,6 +555,12 @@ if( false ) # future
|
||||||
${PYTHON_LIBRARIES}
|
${PYTHON_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set_source_files_properties( ${swig_generated_file_fullname} PROPERTIES
|
||||||
|
# See section 16.3 "The SWIG runtime code"
|
||||||
|
# http://www.swig.org/Doc3.0/SWIGDocumentation.html#Modules_nn2
|
||||||
|
COMPILE_FLAGS "-DSWIG_TYPE_TABLE=WXPYTHON_TYPE_TABLE -Wno-delete-non-virtual-dtor"
|
||||||
|
)
|
||||||
|
|
||||||
if( MAKE_LINK_MAPS )
|
if( MAKE_LINK_MAPS )
|
||||||
set_target_properties( _kiway PROPERTIES
|
set_target_properties( _kiway PROPERTIES
|
||||||
LINK_FLAGS "${TO_LINKER},-cref ${TO_LINKER},-Map=_kiway.so.map"
|
LINK_FLAGS "${TO_LINKER},-cref ${TO_LINKER},-Map=_kiway.so.map"
|
||||||
|
|
|
@ -2,15 +2,21 @@
|
||||||
//%module(directors="1") kiway
|
//%module(directors="1") kiway
|
||||||
%module kiway
|
%module kiway
|
||||||
|
|
||||||
/*
|
|
||||||
%import _defs.i
|
%import(module="wx") wx_kiway_player_hierarchy.h
|
||||||
%import _window.i
|
|
||||||
%import _toplvl.i
|
|
||||||
%threadWrapperOff // _defs.i turns on thread protection, turn it off
|
|
||||||
*/
|
|
||||||
|
|
||||||
%include ki_exception.i // affects all that follow it
|
%include ki_exception.i // affects all that follow it
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
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(KIWAY::Player)
|
||||||
|
|
||||||
%include pgm_base.h
|
%include pgm_base.h
|
||||||
%include frame_type.h
|
%include frame_type.h
|
||||||
%include mail_type.h
|
%include mail_type.h
|
||||||
|
@ -21,7 +27,6 @@
|
||||||
%include kiway_player.i
|
%include kiway_player.i
|
||||||
|
|
||||||
|
|
||||||
HANDLE_EXCEPTIONS(KIWAY::Player)
|
|
||||||
|
|
||||||
%constant KIWAY Kiway;
|
%constant KIWAY Kiway;
|
||||||
|
|
||||||
|
@ -46,7 +51,17 @@ HANDLE_EXCEPTIONS(KIWAY::Player)
|
||||||
KIWAY Kiway( &Pgm(), KFCTL_PY_PROJECT_SUITE );
|
KIWAY Kiway( &Pgm(), KFCTL_PY_PROJECT_SUITE );
|
||||||
|
|
||||||
|
|
||||||
|
// a dummy to quiet linking with EDA_BASE_FRAME::config();
|
||||||
|
#include <kiface_i.h>
|
||||||
|
KIFACE_I& Kiface()
|
||||||
|
{
|
||||||
|
// This function should never be called. It is only referenced from
|
||||||
|
// EDA_BASE_FRAME::config() and this is only provided to satisfy the linker,
|
||||||
|
// not to be actually called.
|
||||||
|
wxLogFatalError( wxT( "Unexpected call to Kiface() in kicad/kicad.cpp" ) );
|
||||||
|
|
||||||
|
return (KIFACE_I&) *(KIFACE_I*) 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,18 +1,8 @@
|
||||||
|
|
||||||
// Swig interface to classes KIWAY_PLAYER and KIWAY_HOLDER
|
// Swig interface to classes KIWAY_PLAYER and KIWAY_HOLDER
|
||||||
|
|
||||||
class wxFrame
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
class KIWAY_PLAYER : public wxFrame
|
%include kiway_player.h
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
%ignore wxFrame;
|
|
||||||
%ignore KIWAY_PLAYER;
|
|
||||||
|
|
||||||
//%include kiway_player.h
|
|
||||||
|
|
||||||
%{
|
%{
|
||||||
#include <kiway_player.h>
|
#include <kiway_player.h>
|
||||||
|
|
|
@ -39,12 +39,16 @@ throw and add them here, before the class declarations.
|
||||||
HANDLE_EXCEPTIONS(BOARD::TracksInNetBetweenPoints)
|
HANDLE_EXCEPTIONS(BOARD::TracksInNetBetweenPoints)
|
||||||
|
|
||||||
|
|
||||||
|
%include <class_board_design_settings.h>
|
||||||
|
%{
|
||||||
|
#include <class_board_design_settings.h>
|
||||||
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%{
|
%{
|
||||||
#include <class_board.h>
|
#include <class_board.h>
|
||||||
|
|
||||||
#include <class_board_design_settings.h>
|
|
||||||
#include <layers_id_colors_and_visibility.h>
|
#include <layers_id_colors_and_visibility.h>
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
@ -130,6 +134,9 @@ HANDLE_EXCEPTIONS(BOARD::TracksInNetBetweenPoints)
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%include class_zone_settings.h
|
%include class_zone_settings.h
|
||||||
|
%{
|
||||||
|
#include <class_zone_settings.h>
|
||||||
|
%}
|
||||||
|
|
||||||
%include class_netinfo.h
|
%include class_netinfo.h
|
||||||
%include class_netclass.h
|
%include class_netclass.h
|
||||||
|
|
|
@ -67,28 +67,47 @@ class BASE_SET {};
|
||||||
// this is what it must be included in the wrapper .cxx code to compile
|
// this is what it must be included in the wrapper .cxx code to compile
|
||||||
|
|
||||||
%{
|
%{
|
||||||
#include <wx_python_helpers.h>
|
#include <wx_python_helpers.h>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
|
|
||||||
//#include <dlist.h>
|
#include <pcbnew_scripting_helpers.h>
|
||||||
#include <class_zone_settings.h>
|
|
||||||
#include <pcbnew_scripting_helpers.h>
|
|
||||||
|
|
||||||
#include <plotcontroller.h>
|
#include <plotcontroller.h>
|
||||||
#include <pcb_plot_params.h>
|
#include <pcb_plot_params.h>
|
||||||
#include <exporters/gendrill_Excellon_writer.h>
|
#include <exporters/gendrill_Excellon_writer.h>
|
||||||
|
|
||||||
BOARD *GetBoard(); /* get current editor board */
|
BOARD *GetBoard(); /* get current editor board */
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
// ignore RELEASER as nested classes are still unsupported by swig
|
||||||
|
%ignore IO_MGR::RELEASER;
|
||||||
|
%include <io_mgr.h>
|
||||||
%{
|
%{
|
||||||
#include <io_mgr.h>
|
#include <io_mgr.h>
|
||||||
#include <kicad_plugin.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)
|
||||||
|
%include <kicad_plugin.h>
|
||||||
|
%{
|
||||||
|
#include <kicad_plugin.h>
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
||||||
%include <class_board_design_settings.h>
|
|
||||||
%include <plotcontroller.h>
|
%include <plotcontroller.h>
|
||||||
%include <pcb_plot_params.h>
|
%include <pcb_plot_params.h>
|
||||||
%include <plot_common.h>
|
%include <plot_common.h>
|
||||||
|
@ -98,10 +117,6 @@ class BASE_SET {};
|
||||||
%include <pcbnew_scripting_helpers.h>
|
%include <pcbnew_scripting_helpers.h>
|
||||||
|
|
||||||
|
|
||||||
// ignore RELEASER as nested classes are still unsupported by swig
|
|
||||||
%ignore IO_MGR::RELEASER;
|
|
||||||
%include <io_mgr.h>
|
|
||||||
%include <kicad_plugin.h>
|
|
||||||
|
|
||||||
%include board.i
|
%include board.i
|
||||||
%include module.i
|
%include module.i
|
||||||
|
|
Loading…
Reference in New Issue