Refactoring: pya is a native binary package now. It's available to pymod, but may also be the basis of the built-in pya module.

This commit is contained in:
Matthias Koefferlein 2023-03-08 23:54:32 +01:00
parent 0253c25b30
commit 92204915a4
48 changed files with 786 additions and 139 deletions

View File

@ -22,19 +22,6 @@
#include "../pymodHelper.h"
// To force linking of the QtCore module
#include "../../gsiqt/qtbasic/gsiQtCoreExternals.h"
FORCE_LINK_GSI_QTCORE
// And this is *only* required because of QSignalMapper which takes a QWidget argument from
// the QtGui library and we need to supply the GSI binding for this ...
#include "../../gsiqt/qtbasic/gsiQtGuiExternals.h"
FORCE_LINK_GSI_QTGUI
// And because we pull in QtGui, we also need to pull in QtWidgets because QtGui bindings
// use QAction and QWidget which are itself in QtWidgets
#include "../../gsiqt/qtbasic/gsiQtWidgetsExternals.h"
FORCE_LINK_GSI_QTWIDGETS
#include "QtCoreMain.h"
DEFINE_PYMOD(QtCore, "QtCore", "KLayout/Qt module 'QtCore'")

View File

@ -0,0 +1,36 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// To force linking of the QtCore module
#include "../../gsiqt/qtbasic/gsiQtCoreExternals.h"
FORCE_LINK_GSI_QTCORE
// And this is *only* required because of QSignalMapper which takes a QWidget argument from
// the QtGui library and we need to supply the GSI binding for this ...
#include "../../gsiqt/qtbasic/gsiQtGuiExternals.h"
FORCE_LINK_GSI_QTGUI
// And because we pull in QtGui, we also need to pull in QtWidgets because QtGui bindings
// use QAction and QWidget which are itself in QtWidgets
#include "../../gsiqt/qtbasic/gsiQtWidgetsExternals.h"
FORCE_LINK_GSI_QTWIDGETS

View File

@ -22,8 +22,5 @@
#include "../pymodHelper.h"
// To force linking of the QtCore5Compat module
#include "../../gsiqt/qtbasic/gsiQtCore5CompatExternals.h"
FORCE_LINK_GSI_QTCORE5COMPAT
#include "QtCore5CompatMain.h"
DEFINE_PYMOD(QtCore5Compat, "QtCore5Compat", "KLayout/Qt module 'QtCore5Compat'")

View File

@ -0,0 +1,25 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// To force linking of the QtCore5Compat module
#include "../../gsiqt/qtbasic/gsiQtCore5CompatExternals.h"
FORCE_LINK_GSI_QTCORE5COMPAT

View File

@ -22,8 +22,5 @@
#include "../pymodHelper.h"
// To force linking of the QtDesigner module
#include "../../gsiqt/qtbasic/gsiQtDesignerExternals.h"
FORCE_LINK_GSI_QTDESIGNER
#include "QtDesignerMain.h"
DEFINE_PYMOD(QtDesigner, "QtDesigner", "KLayout/Qt module 'QtDesigner'")

View File

@ -0,0 +1,25 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// To force linking of the QtDesigner module
#include "../../gsiqt/qtbasic/gsiQtDesignerExternals.h"
FORCE_LINK_GSI_QTDESIGNER

View File

@ -22,13 +22,5 @@
#include "../pymodHelper.h"
// To force linking of the QtGui module
#include "../../gsiqt/qtbasic/gsiQtGuiExternals.h"
FORCE_LINK_GSI_QTGUI
// This is required because QAction and QWidget are used are arguments in QtGui, but are
// defined in QtWidgets
#include "../../gsiqt/qtbasic/gsiQtWidgetsExternals.h"
FORCE_LINK_GSI_QTWIDGETS
#include "QtGuiMain.h"
DEFINE_PYMOD(QtGui, "QtGui", "KLayout/Qt module 'QtGui'")

View File

@ -0,0 +1,30 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// To force linking of the QtGui module
#include "../../gsiqt/qtbasic/gsiQtGuiExternals.h"
FORCE_LINK_GSI_QTGUI
// This is required because QAction and QWidget are used are arguments in QtGui, but are
// defined in QtWidgets
#include "../../gsiqt/qtbasic/gsiQtWidgetsExternals.h"
FORCE_LINK_GSI_QTWIDGETS

View File

@ -22,13 +22,5 @@
#include "../pymodHelper.h"
// To force linking of the QtMultimedia module
#include "../../gsiqt/qtbasic/gsiQtMultimediaExternals.h"
FORCE_LINK_GSI_QTMULTIMEDIA
// This is required because QAction and QWidget are used are arguments in QtGui, but are
// defined in QtWidgets
#include "../../gsiqt/qtbasic/gsiQtNetworkExternals.h"
FORCE_LINK_GSI_QTNETWORK
#include "QtMultimediaMain.h"
DEFINE_PYMOD(QtMultimedia, "QtMultimedia", "KLayout/Qt module 'QtMultimedia'")

View File

@ -0,0 +1,30 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// To force linking of the QtMultimedia module
#include "../../gsiqt/qtbasic/gsiQtMultimediaExternals.h"
FORCE_LINK_GSI_QTMULTIMEDIA
// This is required because QAction and QWidget are used are arguments in QtGui, but are
// defined in QtWidgets
#include "../../gsiqt/qtbasic/gsiQtNetworkExternals.h"
FORCE_LINK_GSI_QTNETWORK

View File

@ -22,8 +22,5 @@
#include "../pymodHelper.h"
// To force linking of the QtNetwork module
#include "../../gsiqt/qtbasic/gsiQtNetworkExternals.h"
FORCE_LINK_GSI_QTNETWORK
#include "QtNetworkMain.h"
DEFINE_PYMOD(QtNetwork, "QtNetwork", "KLayout/Qt module 'QtNetwork'")

View File

@ -0,0 +1,25 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// To force linking of the QtNetwork module
#include "../../gsiqt/qtbasic/gsiQtNetworkExternals.h"
FORCE_LINK_GSI_QTNETWORK

View File

@ -22,8 +22,5 @@
#include "../pymodHelper.h"
// To force linking of the QtPrintSupport module
#include "../../gsiqt/qtbasic/gsiQtPrintSupportExternals.h"
FORCE_LINK_GSI_QTPRINTSUPPORT
#include "QtPrintSupportMain.h"
DEFINE_PYMOD(QtPrintSupport, "QtPrintSupport", "KLayout/Qt module 'QtPrintSupport'")

View File

@ -0,0 +1,25 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// To force linking of the QtPrintSupport module
#include "../../gsiqt/qtbasic/gsiQtPrintSupportExternals.h"
FORCE_LINK_GSI_QTPRINTSUPPORT

View File

@ -22,8 +22,5 @@
#include "../pymodHelper.h"
// To force linking of the QtSql module
#include "../../gsiqt/qtbasic/gsiQtSqlExternals.h"
FORCE_LINK_GSI_QTSQL
#include "QtSqtMain.h"
DEFINE_PYMOD(QtSql, "QtSql", "KLayout/Qt module 'QtSql'")

View File

@ -0,0 +1,25 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// To force linking of the QtSql module
#include "../../gsiqt/qtbasic/gsiQtSqlExternals.h"
FORCE_LINK_GSI_QTSQL

View File

@ -22,8 +22,5 @@
#include "../pymodHelper.h"
// To force linking of the QtSvg module
#include "../../gsiqt/qtbasic/gsiQtSvgExternals.h"
FORCE_LINK_GSI_QTSVG
#include "QtSvgMain.h"
DEFINE_PYMOD(QtSvg, "QtSvg", "KLayout/Qt module 'QtSvg'")

View File

@ -0,0 +1,25 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// To force linking of the QtSvg module
#include "../../gsiqt/qtbasic/gsiQtSvgExternals.h"
FORCE_LINK_GSI_QTSVG

View File

@ -22,12 +22,6 @@
#include "../pymodHelper.h"
// To force linking of the QtCore module
#include "../../gsiqt/qtbasic/gsiQtCoreExternals.h"
FORCE_LINK_GSI_QTCORE
# include "../../gsiqt/qtbasic/gsiQtUiToolsExternals.h"
FORCE_LINK_GSI_QTUITOOLS
#include "QtUiToolsMain.h"
DEFINE_PYMOD(QtUiTools, "QtUiTools", "KLayout/Qt module 'QtUiTools'")

View File

@ -0,0 +1,29 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// To force linking of the QtCore module
#include "../../gsiqt/qtbasic/gsiQtCoreExternals.h"
FORCE_LINK_GSI_QTCORE
# include "../../gsiqt/qtbasic/gsiQtUiToolsExternals.h"
FORCE_LINK_GSI_QTUITOOLS

View File

@ -22,8 +22,5 @@
#include "../pymodHelper.h"
// To force linking of the QtWidgets module
#include "../../gsiqt/qtbasic/gsiQtWidgetsExternals.h"
FORCE_LINK_GSI_QTWIDGETS
#include "QtWidgetsMain.h"
DEFINE_PYMOD(QtWidgets, "QtWidgets", "KLayout/Qt module 'QtWidgets'")

View File

@ -0,0 +1,25 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// To force linking of the QtWidgets module
#include "../../gsiqt/qtbasic/gsiQtWidgetsExternals.h"
FORCE_LINK_GSI_QTWIDGETS

View File

@ -22,24 +22,5 @@
#include "../pymodHelper.h"
// To force linking of the QtXml module
#include "../../gsiqt/qtbasic/gsiQtXmlExternals.h"
FORCE_LINK_GSI_QTXML
// To force linking of the QtCore module (some arguments
// are QIODevice or QTextStream)
#include "../../gsiqt/qtbasic/gsiQtCoreExternals.h"
FORCE_LINK_GSI_QTCORE
// And because will pull in QtCore:
// This is *only* required because of QSignalMapper which takes a QWidget argument from
// the QtGui library and we need to supply the GSI binding for this ...
#include "../../gsiqt/qtbasic/gsiQtGuiExternals.h"
FORCE_LINK_GSI_QTGUI
// And because we pull in QtGui, we also need to pull in QtWidgets because QtGui bindings
// use QAction and QWidget which are itself in QtWidgets
#include "../../gsiqt/qtbasic/gsiQtWidgetsExternals.h"
FORCE_LINK_GSI_QTWIDGETS
#include "QtXmlMain.h"
DEFINE_PYMOD(QtXml, "QtXml", "KLayout/Qt module 'QtXml'")

View File

@ -0,0 +1,41 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// To force linking of the QtXml module
#include "../../gsiqt/qtbasic/gsiQtXmlExternals.h"
FORCE_LINK_GSI_QTXML
// To force linking of the QtCore module (some arguments
// are QIODevice or QTextStream)
#include "../../gsiqt/qtbasic/gsiQtCoreExternals.h"
FORCE_LINK_GSI_QTCORE
// And because will pull in QtCore:
// This is *only* required because of QSignalMapper which takes a QWidget argument from
// the QtGui library and we need to supply the GSI binding for this ...
#include "../../gsiqt/qtbasic/gsiQtGuiExternals.h"
FORCE_LINK_GSI_QTGUI
// And because we pull in QtGui, we also need to pull in QtWidgets because QtGui bindings
// use QAction and QWidget which are itself in QtWidgets
#include "../../gsiqt/qtbasic/gsiQtWidgetsExternals.h"
FORCE_LINK_GSI_QTWIDGETS

View File

@ -22,13 +22,5 @@
#include "../pymodHelper.h"
// To force linking of the QtXmlPatterns module
#include "../../gsiqt/qtbasic/gsiQtXmlPatternsExternals.h"
FORCE_LINK_GSI_QTXMLPATTERNS
// To force linking of the QtNetwork module (some arguments
// are QNetworkAccessManager)
#include "../../gsiqt/qtbasic/gsiQtNetworkExternals.h"
FORCE_LINK_GSI_QTNETWORK
#include "QtXmlPatternsMain.h"
DEFINE_PYMOD(QtXmlPatterns, "QtXmlPatterns", "KLayout/Qt module 'QtXmlPatterns'")

View File

@ -0,0 +1,30 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// To force linking of the QtXmlPatterns module
#include "../../gsiqt/qtbasic/gsiQtXmlPatternsExternals.h"
FORCE_LINK_GSI_QTXMLPATTERNS
// To force linking of the QtNetwork module (some arguments
// are QNetworkAccessManager)
#include "../../gsiqt/qtbasic/gsiQtNetworkExternals.h"
FORCE_LINK_GSI_QTNETWORK

View File

@ -22,7 +22,5 @@
#include "../pymodHelper.h"
// to force linking of the ant module
# include "../../ant/ant/antForceLink.h"
#include "antMain.h"
DEFINE_PYMOD(antcore, "ant", "KLayout core module 'ant'")

24
src/pymod/ant/antMain.h Normal file
View File

@ -0,0 +1,24 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// to force linking of the ant module
#include "../../ant/ant/antForceLink.h"

View File

@ -24,8 +24,7 @@
#include "../../db/db/dbInit.h"
// to force linking of the db module
#include "../../db/db/dbForceLink.h"
#include "dbMain.h"
static PyObject *db_module_init (const char *pymod_name, const char *mod_name, const char *mod_description)
{

24
src/pymod/db/dbMain.h Normal file
View File

@ -0,0 +1,24 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// to force linking of the db module
#include "../../db/db/dbForceLink.h"

View File

@ -0,0 +1,4 @@
from ..pyacore import __all__
from ..pyacore import *

View File

@ -1,9 +1,4 @@
# import all packages from klayout, such as klayout.db and klayout.tl
# WARNING: doing it manually until it becomes impractical
# TODO: We need a specification document explaining what should go into pya
from klayout.db import * # noqa
from klayout.lib import * # noqa
from klayout.tl import * # noqa
from klayout.rdb import * # noqa
from klayout.lay import * # noqa
# pull everything from the generic klayout.pya package into pya
from klayout.pya import __all__
from klayout.pya import *

View File

@ -22,7 +22,5 @@
#include "../pymodHelper.h"
// to force linking of the edt module
# include "../../edt/edt/edtForceLink.h"
#include "edtMain.h"
DEFINE_PYMOD(edtcore, "edt", "KLayout core module 'edt'")

24
src/pymod/edt/edtMain.h Normal file
View File

@ -0,0 +1,24 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warrlymy of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// to force linking of the edt module
#include "../../edt/edt/edtForceLink.h"

View File

@ -22,7 +22,5 @@
#include "../pymodHelper.h"
// to force linking of the img module
# include "../../img/img/imgForceLink.h"
#include "imgMain.h"
DEFINE_PYMOD(imgcore, "img", "KLayout core module 'img'")

24
src/pymod/img/imgMain.h Normal file
View File

@ -0,0 +1,24 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warrimgy of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// to force linking of the img module
#include "../../img/img/imgForceLink.h"

View File

@ -22,18 +22,5 @@
#include "../pymodHelper.h"
// to force linking of the layview module
#if defined(HAVE_QT)
# include "../../lay/lay/layForceLink.h"
#else
# include "../../layview/layview/layviewForceLink.h"
#endif
// Force-include other dependencies
// NOTE: these libraries contribute to the "lay" module space. Hence we have to include them.
#include "../../ant/ant/antForceLink.h"
#include "../../img/img/imgForceLink.h"
#include "../../edt/edt/edtForceLink.h"
#include "../../lym/lym/lymForceLink.h"
#include "layMain.h"
DEFINE_PYMOD(laycore, "lay", "KLayout core module 'lay'")

35
src/pymod/lay/layMain.h Normal file
View File

@ -0,0 +1,35 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// to force linking of the layview module
#if defined(HAVE_QT)
# include "../../lay/lay/layForceLink.h"
#else
# include "../../layview/layview/layviewForceLink.h"
#endif
// Force-include other dependencies
// NOTE: these libraries contribute to the "lay" module space. Hence we have to include them.
#include "../../ant/ant/antForceLink.h"
#include "../../img/img/imgForceLink.h"
#include "../../edt/edt/edtForceLink.h"
#include "../../lym/lym/lymForceLink.h"

View File

@ -22,12 +22,10 @@
#include "../pymodHelper.h"
// to force linking of the lib module
#include "../../lib/lib/libForceLink.h"
static PyObject *lib_module_init (const char *pymod_name, const char *mod_name, const char *mod_description)
{
return module_init (pymod_name, mod_name, mod_description);
}
#include "libMain.h"
DEFINE_PYMOD_WITH_INIT(libcore, "lib", "KLayout core module 'lib'", lib_module_init)

24
src/pymod/lib/libMain.h Normal file
View File

@ -0,0 +1,24 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// to force linking of the lib module
#include "../../lib/lib/libForceLink.h"

View File

@ -22,7 +22,5 @@
#include "../pymodHelper.h"
// to force linking of the lym module
# include "../../lym/lym/lymForceLink.h"
#include "lymMain.h"
DEFINE_PYMOD(lymcore, "lym", "KLayout core module 'lym'")

24
src/pymod/lym/lymMain.h Normal file
View File

@ -0,0 +1,24 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warrlymy of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// to force linking of the lym module
#include "../../lym/lym/lymForceLink.h"

106
src/pymod/pya/pya.pro Normal file
View File

@ -0,0 +1,106 @@
TARGET = pyacore
REALMODULE = pya
include($$PWD/../pymod.pri)
SOURCES = \
pyaMain.cc \
HEADERS += \
# needs all libraries as dependencies because we register all
# classes
LIBS += -lklayout_layview
!equals(HAVE_QT, "0") {
LIBS += -lklayout_layui
LIBS += -lklayout_lay
}
LIBS += -lklayout_laybasic
LIBS += -lklayout_img
LIBS += -lklayout_lib
LIBS += -lklayout_edt
LIBS += -lklayout_ant
LIBS += -lklayout_lym
LIBS += -lklayout_db
LIBS += -lklayout_rdb
# adds all the Qt binding stuff
!equals(HAVE_QT, "0") {
equals(HAVE_QTBINDINGS, "1") {
LIBS += -lklayout_QtCore -lklayout_QtGui
!equals(HAVE_QT_NETWORK, "0") {
LIBS += -lklayout_QtNetwork
DEFINES += INCLUDE_QTNETWORK
}
greaterThan(QT_MAJOR_VERSION, 4) {
LIBS += -lklayout_QtWidgets
DEFINES += INCLUDE_QTWIDGETS
}
!equals(HAVE_QT_MULTIMEDIA, "0") {
greaterThan(QT_MAJOR_VERSION, 4) {
LIBS += -lklayout_QtMultimedia
DEFINES += INCLUDE_QTMULTIMEDIA
}
}
!equals(HAVE_QT_PRINTSUPPORT, "0") {
greaterThan(QT_MAJOR_VERSION, 4) {
LIBS += -lklayout_QtPrintSupport
DEFINES += INCLUDE_QTPRINTSUPPORT
}
}
!equals(HAVE_QT_SVG, "0") {
greaterThan(QT_MAJOR_VERSION, 4) {
LIBS += -lklayout_QtSvg
DEFINES += INCLUDE_QTSVG
}
}
!equals(HAVE_QT_XML, "0") {
LIBS += -lklayout_QtXml
DEFINES += INCLUDE_QTXML
greaterThan(QT_MAJOR_VERSION, 4) {
lessThan(QT_MAJOR_VERSION, 6) {
LIBS += -lklayout_QtXmlPatterns
DEFINES += INCLUDE_QTXMLPATTERNS
}
}
}
!equals(HAVE_QT_SQL, "0") {
LIBS += -lklayout_QtSql
DEFINES += INCLUDE_QTSQL
}
!equals(HAVE_QT_DESIGNER, "0") {
lessThan(QT_MAJOR_VERSION, 6) {
LIBS += -lklayout_QtDesigner
DEFINES += INCLUDE_QTDESIGNER
}
}
!equals(HAVE_QT_UITOOLS, "0") {
LIBS += -lklayout_QtUiTools
DEFINES += INCLUDE_QTUITOOLS
}
!equals(HAVE_QT_CORE5COMPAT, "0") {
greaterThan(QT_MAJOR_VERSION, 5) {
LIBS += -lklayout_QtCore5Compat
DEFINES += INCLUDE_QTCORE5COMPAT
}
}
}
}

76
src/pymod/pya/pyaMain.cc Normal file
View File

@ -0,0 +1,76 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "../pymodHelper.h"
// to force linking of the layview module
#include "../db/dbMain.h"
#include "../rdb/rdbMain.h"
#include "../lib/libMain.h"
#include "../lay/layMain.h"
#if defined(HAVE_QT)
# if defined(HAVE_QTBINDINGS)
# include "QtCore/QtCoreMain.h"
# include "QtGui/QtGuiMain.h"
# if defined(INCLUDE_QTNETWORK)
# include "QtNetwork/QtNetworkMain.h"
# endif
# if defined(INCLUDE_QTWIDGETS)
# include "QtWidgets/QtWidgetsMain.h"
# endif
# if defined(INCLUDE_QTPRINTSUPPORT)
# include "QtPrintSupport/QtPrintSupportMain.h"
# endif
# if defined(INCLUDE_QTSVG)
# include "QtSvg/QtSvgMain.h"
# endif
# if defined(INCLUDE_QTXML)
# include "QtXml/QtXmlMain.h"
# endif
# if defined(INCLUDE_QTXMLPATTERNS)
# include "QtXmlPatterns/QtXmlPatternsMain.h"
# endif
# if defined(INCLUDE_QTSQL)
# include "QtSql/QtSqlMain.h"
# endif
# if defined(INCLUDE_QTDESIGNER)
# include "QtDesigner/QtDesignerMain.h"
# endif
# if defined(INCLUDE_QTUITOOLS)
# include "QtUiTools/QtUiToolsMain.h"
# endif
# if defined(INCLUDE_QTCORE5COMPAT)
# include "QtCore5Compat/QtCore5CompatMain.h"
# endif
# endif
#endif
#include "../../db/db/dbInit.h"
static PyObject *pya_module_init (const char *pymod_name, const char *mod_name, const char *mod_description)
{
db::init ();
return module_init (pymod_name, mod_name, mod_description);
}
DEFINE_PYMOD_WITH_INIT(pyacore, 0, "KLayout generic Python module (pya)", pya_module_init)

View File

@ -8,6 +8,7 @@ SUBDIRS = \
rdb \
lib \
lay \
pya \
!equals(HAVE_QT, "0") {

View File

@ -27,7 +27,7 @@
* Use this helper file this way:
*
* #include "pymodHelper.h"
* DEFINE_PYMOD(mymod, "mymod", "KLayout Test module klayout.mymod")
* DEFINE_PYMOD(klayout.mymod, "mymod", "KLayout Test module klayout.mymod")
*/
#include <Python.h>

View File

@ -22,7 +22,5 @@
#include "../pymodHelper.h"
// to force linking of the rdb module
#include "../../rdb/rdb/rdbForceLink.h"
#include "rdbMain.h"
DEFINE_PYMOD(rdbcore, "rdb", "KLayout core module 'rdb'")

24
src/pymod/rdb/rdbMain.h Normal file
View File

@ -0,0 +1,24 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2023 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// to force linking of the rdb module
#include "../../rdb/rdb/rdbForceLink.h"