diff --git a/pcbnew/scripting/pcbnew.i b/pcbnew/scripting/pcbnew.i index d778bf7e3d..c74d00fdc6 100644 --- a/pcbnew/scripting/pcbnew.i +++ b/pcbnew/scripting/pcbnew.i @@ -180,9 +180,10 @@ BOARD *GetBoard(); %template(TRACK_List) DLIST; %template(PAD_List) DLIST; -/* TODO: -the std::* compilatio is broken with some swig + gcc combinations - * see kicad.i for more information. - * %template(MARKER_Vector) std::vector; - * %template(ZONE_CONTAINER_Vector) std::vector; - */ + + +%template(MARKER_Vector) std::vector; +%template(ZONE_CONTAINER_Vector) std::vector; +%template(VIA_DIMENSION_Vector) std::vector; + diff --git a/scripting/kicad.i b/scripting/kicad.i index 5bd5dd11f7..b2c9809c69 100644 --- a/scripting/kicad.i +++ b/scripting/kicad.i @@ -30,10 +30,12 @@ /* OFF NOW, it triggers an error with GCC 4.6 and swig-2.0.4 or trunk.. http://sourceforge.net/tracker/index.php?func=detail&aid=3391906&group_id=1645&atid=101645 +*/ + %include %include -*/ + %nodefaultctor EDA_ITEM; @@ -48,6 +50,7 @@ %ignore GetCommandOptions; %{ + #include #include #include #include @@ -63,7 +66,6 @@ /* all the wx wrappers for wxString, wxPoint, wxRect, wxChar .. */ %include - %include %include %include @@ -71,9 +73,34 @@ %include -/* -namespace std +%extend DLIST { - %template(intVector) vector; + %pythoncode + { + class DLISTIter: + def __init__(self,aList): + self.last = aList + + def next(self): + if self.last is None: + raise StopIteration + else: + ret = None + + # first item in list has "Get" as a DLIST + try: + ret = self.last.Get() + except: + ret = self.last #next items just not.. + + self.last = self.last.Next() + return ret + + def __iter__(self): + return self.DLISTIter(self) + + } } -*/ +%template(intVector) std::vector; + +