7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-11 16:10:10 +00:00

Fix LSEQ exports in swig

Need to keep it correctly inherited from BASE_SEQ to
be able to iterate over it and have index access
This commit is contained in:
qu1ck 2024-07-21 14:05:41 -07:00 committed by jean-pierre charras
parent bf45a91c6f
commit ff15506d53
2 changed files with 11 additions and 8 deletions
common/swig
pcbnew/python/swig

View File

@ -117,9 +117,6 @@ principle should be easily implemented by adapting the current STL containers.
// SWIG is incompatible with std::unique_ptr
%ignore GetNewConfig;
// wrapper of BASE_SEQ (see typedef std::vector<PCB_LAYER_ID> BASE_SEQ;)
%template(base_seqVect) std::vector<enum PCB_LAYER_ID>;
// TODO: wrapper of BASE_SET (see std::bitset<PCB_LAYER_ID_COUNT> BASE_SET;)

View File

@ -37,7 +37,18 @@
%ignore GAL_SET::set(int, bool);
%ignore GAL_SET::set(int);
%{
#include <layer_ids.h>
#include <lseq.h>
#include <lset.h>
#include <pcbnew_scripting_helpers.h>
%}
// wrapper of BASE_SEQ (see typedef std::vector<PCB_LAYER_ID> BASE_SEQ;)
%template(base_seqVect) std::vector<enum PCB_LAYER_ID>;
%include layer_ids.h
%include lseq.h
%include lset.h
// Extend LSET by 2 methods to add or remove layers from the layer list
@ -64,8 +75,3 @@
return self.removeLayerSet( layers )
%}
}
%{
#include <layer_ids.h>
#include <lset.h>
#include <pcbnew_scripting_helpers.h>
%}