--- pcbnew/scripting/board.i +++ pcbnew/swig/board.i @@ -28,38 +28,123 @@ */ -%extend BOARD -{ - %pythoncode - %{ - def GetModules(self): return self.m_Modules - def GetDrawings(self): return self.m_Drawings - def GetTracks(self): return self.m_Track - def GetFullRatsnest(self): return self.m_FullRatsnest +/* - def Save(self,filename): - return SaveBoard(filename,self,IO_MGR.KICAD) +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. - # - # add function, clears the thisown to avoid python from deleting - # the object in the garbage collector - # +*/ +HANDLE_EXCEPTIONS(BOARD::TracksInNetBetweenPoints) - def Add(self,item): - item.thisown=0 - self.AddNative(item) - %} -} +%{ +#include -// this is to help python with the * accessor of DLIST templates +#include +#include + +%} + + +%import dlist.h + +// Organize the two forms of include side by side so that it is easier to +// migrate each grouping into a separate *.i file later. + + +%include class_board_item.h +%{ +#include +%} + +%include class_board_connected_item.h +%{ +#include +%} + +%include pad_shapes.h + +%include class_pad.h +%{ +#include +%} + +%include class_module.h +%{ +#include +%} + +%include class_track.h +%{ +#include +%} + +%include class_zone.h +%include zones.h +%{ +#include +#include +%} + + +%include layers_id_colors_and_visibility.h + +%include class_pcb_text.h +%{ +#include +%} + +%include class_dimension.h +%{ +#include +%} + +%include class_drawsegment.h +%{ +#include +%} + +%include class_marker_pcb.h +%{ +#include +%} + + +%include class_mire.h +%{ +#include +%} + + +%include class_text_mod.h +%{ +#include +%} + +%include class_edge_mod.h +%{ +#include +%} + +%include class_zone_settings.h + +%include class_netinfo.h +%include class_netclass.h +%{ +#include +#include +%} + + +// this is to help python with the * accessor of DLIST templates %rename(Get) operator BOARD_ITEM*; %rename(Get) operator TRACK*; %rename(Get) operator D_PAD*; %rename(Get) operator MODULE*; - // we must translate C++ templates to scripting languages %template(BOARD_ITEM_List) DLIST;