kicad/pcbnew/swig/board.i.rej

148 lines
2.8 KiB
Plaintext

--- 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 <class_board.h>
-// this is to help python with the * accessor of DLIST templates
+#include <class_board_design_settings.h>
+#include <layers_id_colors_and_visibility.h>
+
+%}
+
+
+%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 <class_board_item.h>
+%}
+
+%include class_board_connected_item.h
+%{
+#include <class_board_connected_item.h>
+%}
+
+%include pad_shapes.h
+
+%include class_pad.h
+%{
+#include <class_pad.h>
+%}
+
+%include class_module.h
+%{
+#include <class_module.h>
+%}
+
+%include class_track.h
+%{
+#include <class_track.h>
+%}
+
+%include class_zone.h
+%include zones.h
+%{
+#include <class_zone.h>
+#include <zones.h>
+%}
+
+
+%include layers_id_colors_and_visibility.h
+
+%include class_pcb_text.h
+%{
+#include <class_pcb_text.h>
+%}
+
+%include class_dimension.h
+%{
+#include <class_dimension.h>
+%}
+
+%include class_drawsegment.h
+%{
+#include <class_drawsegment.h>
+%}
+
+%include class_marker_pcb.h
+%{
+#include <class_marker_pcb.h>
+%}
+
+
+%include class_mire.h
+%{
+#include <class_mire.h>
+%}
+
+
+%include class_text_mod.h
+%{
+#include <class_text_mod.h>
+%}
+
+%include class_edge_mod.h
+%{
+#include <class_edge_mod.h>
+%}
+
+%include class_zone_settings.h
+
+%include class_netinfo.h
+%include class_netclass.h
+%{
+#include <class_netinfo.h>
+#include <class_netclass.h>
+%}
+
+
+// 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<BOARD_ITEM>;