From 92204915a4e766417acc0901a781f5649bf4948e Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 8 Mar 2023 23:54:32 +0100 Subject: [PATCH] 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. --- src/pymod/QtCore/QtCoreMain.cc | 15 +-- src/pymod/QtCore/QtCoreMain.h | 36 ++++++ src/pymod/QtCore5Compat/QtCore5CompatMain.cc | 5 +- src/pymod/QtCore5Compat/QtCore5CompatMain.h | 25 +++++ src/pymod/QtDesigner/QtDesignerMain.cc | 5 +- src/pymod/QtDesigner/QtDesignerMain.h | 25 +++++ src/pymod/QtGui/QtGuiMain.cc | 10 +- src/pymod/QtGui/QtGuiMain.h | 30 +++++ src/pymod/QtMultimedia/QtMultimediaMain.cc | 10 +- src/pymod/QtMultimedia/QtMultimediaMain.h | 30 +++++ src/pymod/QtNetwork/QtNetworkMain.cc | 5 +- src/pymod/QtNetwork/QtNetworkMain.h | 25 +++++ .../QtPrintSupport/QtPrintSupportMain.cc | 5 +- src/pymod/QtPrintSupport/QtPrintSupportMain.h | 25 +++++ src/pymod/QtSql/QtSqlMain.cc | 5 +- src/pymod/QtSql/QtSqlMain.h | 25 +++++ src/pymod/QtSvg/QtSvgMain.cc | 5 +- src/pymod/QtSvg/QtSvgMain.h | 25 +++++ src/pymod/QtUiTools/QtUiToolsMain.cc | 8 +- src/pymod/QtUiTools/QtUiToolsMain.h | 29 +++++ src/pymod/QtWidgets/QtWidgetsMain.cc | 5 +- src/pymod/QtWidgets/QtWidgetsMain.h | 25 +++++ src/pymod/QtXml/QtXmlMain.cc | 21 +--- src/pymod/QtXml/QtXmlMain.h | 41 +++++++ src/pymod/QtXmlPatterns/QtXmlPatternsMain.cc | 10 +- src/pymod/QtXmlPatterns/QtXmlPatternsMain.h | 30 +++++ src/pymod/ant/antMain.cc | 4 +- src/pymod/ant/antMain.h | 24 ++++ src/pymod/db/dbMain.cc | 3 +- src/pymod/db/dbMain.h | 24 ++++ .../distutils_src/klayout/pya/__init__.py | 4 + src/pymod/distutils_src/pya/__init__.py | 11 +- src/pymod/edt/edtMain.cc | 4 +- src/pymod/edt/edtMain.h | 24 ++++ src/pymod/img/imgMain.cc | 4 +- src/pymod/img/imgMain.h | 24 ++++ src/pymod/lay/layMain.cc | 15 +-- src/pymod/lay/layMain.h | 35 ++++++ src/pymod/lib/libMain.cc | 4 +- src/pymod/lib/libMain.h | 24 ++++ src/pymod/lym/lymMain.cc | 4 +- src/pymod/lym/lymMain.h | 24 ++++ src/pymod/pya/pya.pro | 106 ++++++++++++++++++ src/pymod/pya/pyaMain.cc | 76 +++++++++++++ src/pymod/pymod.pro | 1 + src/pymod/pymodHelper.h | 2 +- src/pymod/rdb/rdbMain.cc | 4 +- src/pymod/rdb/rdbMain.h | 24 ++++ 48 files changed, 786 insertions(+), 139 deletions(-) create mode 100644 src/pymod/QtCore/QtCoreMain.h create mode 100644 src/pymod/QtCore5Compat/QtCore5CompatMain.h create mode 100644 src/pymod/QtDesigner/QtDesignerMain.h create mode 100644 src/pymod/QtGui/QtGuiMain.h create mode 100644 src/pymod/QtMultimedia/QtMultimediaMain.h create mode 100644 src/pymod/QtNetwork/QtNetworkMain.h create mode 100644 src/pymod/QtPrintSupport/QtPrintSupportMain.h create mode 100644 src/pymod/QtSql/QtSqlMain.h create mode 100644 src/pymod/QtSvg/QtSvgMain.h create mode 100644 src/pymod/QtUiTools/QtUiToolsMain.h create mode 100644 src/pymod/QtWidgets/QtWidgetsMain.h create mode 100644 src/pymod/QtXml/QtXmlMain.h create mode 100644 src/pymod/QtXmlPatterns/QtXmlPatternsMain.h create mode 100644 src/pymod/ant/antMain.h create mode 100644 src/pymod/db/dbMain.h create mode 100644 src/pymod/distutils_src/klayout/pya/__init__.py create mode 100644 src/pymod/edt/edtMain.h create mode 100644 src/pymod/img/imgMain.h create mode 100644 src/pymod/lay/layMain.h create mode 100644 src/pymod/lib/libMain.h create mode 100644 src/pymod/lym/lymMain.h create mode 100644 src/pymod/pya/pya.pro create mode 100644 src/pymod/pya/pyaMain.cc create mode 100644 src/pymod/rdb/rdbMain.h diff --git a/src/pymod/QtCore/QtCoreMain.cc b/src/pymod/QtCore/QtCoreMain.cc index de5e946b9..8d47c6675 100644 --- a/src/pymod/QtCore/QtCoreMain.cc +++ b/src/pymod/QtCore/QtCoreMain.cc @@ -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'") diff --git a/src/pymod/QtCore/QtCoreMain.h b/src/pymod/QtCore/QtCoreMain.h new file mode 100644 index 000000000..2fefe9d7c --- /dev/null +++ b/src/pymod/QtCore/QtCoreMain.h @@ -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 + diff --git a/src/pymod/QtCore5Compat/QtCore5CompatMain.cc b/src/pymod/QtCore5Compat/QtCore5CompatMain.cc index d6be38818..7fca785c8 100644 --- a/src/pymod/QtCore5Compat/QtCore5CompatMain.cc +++ b/src/pymod/QtCore5Compat/QtCore5CompatMain.cc @@ -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'") diff --git a/src/pymod/QtCore5Compat/QtCore5CompatMain.h b/src/pymod/QtCore5Compat/QtCore5CompatMain.h new file mode 100644 index 000000000..dac584ad5 --- /dev/null +++ b/src/pymod/QtCore5Compat/QtCore5CompatMain.h @@ -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 diff --git a/src/pymod/QtDesigner/QtDesignerMain.cc b/src/pymod/QtDesigner/QtDesignerMain.cc index 25960aedd..84fdb7502 100644 --- a/src/pymod/QtDesigner/QtDesignerMain.cc +++ b/src/pymod/QtDesigner/QtDesignerMain.cc @@ -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'") diff --git a/src/pymod/QtDesigner/QtDesignerMain.h b/src/pymod/QtDesigner/QtDesignerMain.h new file mode 100644 index 000000000..79f8a7c4f --- /dev/null +++ b/src/pymod/QtDesigner/QtDesignerMain.h @@ -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 diff --git a/src/pymod/QtGui/QtGuiMain.cc b/src/pymod/QtGui/QtGuiMain.cc index 1319c2e1e..ac9cc87b5 100644 --- a/src/pymod/QtGui/QtGuiMain.cc +++ b/src/pymod/QtGui/QtGuiMain.cc @@ -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'") diff --git a/src/pymod/QtGui/QtGuiMain.h b/src/pymod/QtGui/QtGuiMain.h new file mode 100644 index 000000000..87decc396 --- /dev/null +++ b/src/pymod/QtGui/QtGuiMain.h @@ -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 diff --git a/src/pymod/QtMultimedia/QtMultimediaMain.cc b/src/pymod/QtMultimedia/QtMultimediaMain.cc index 2ca63979b..b0996f519 100644 --- a/src/pymod/QtMultimedia/QtMultimediaMain.cc +++ b/src/pymod/QtMultimedia/QtMultimediaMain.cc @@ -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'") diff --git a/src/pymod/QtMultimedia/QtMultimediaMain.h b/src/pymod/QtMultimedia/QtMultimediaMain.h new file mode 100644 index 000000000..eef8d36d6 --- /dev/null +++ b/src/pymod/QtMultimedia/QtMultimediaMain.h @@ -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 diff --git a/src/pymod/QtNetwork/QtNetworkMain.cc b/src/pymod/QtNetwork/QtNetworkMain.cc index 0d6c30021..75b0bb8bd 100644 --- a/src/pymod/QtNetwork/QtNetworkMain.cc +++ b/src/pymod/QtNetwork/QtNetworkMain.cc @@ -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'") diff --git a/src/pymod/QtNetwork/QtNetworkMain.h b/src/pymod/QtNetwork/QtNetworkMain.h new file mode 100644 index 000000000..2285fabb3 --- /dev/null +++ b/src/pymod/QtNetwork/QtNetworkMain.h @@ -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 diff --git a/src/pymod/QtPrintSupport/QtPrintSupportMain.cc b/src/pymod/QtPrintSupport/QtPrintSupportMain.cc index 556e7bb9e..3cdfe418c 100644 --- a/src/pymod/QtPrintSupport/QtPrintSupportMain.cc +++ b/src/pymod/QtPrintSupport/QtPrintSupportMain.cc @@ -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'") diff --git a/src/pymod/QtPrintSupport/QtPrintSupportMain.h b/src/pymod/QtPrintSupport/QtPrintSupportMain.h new file mode 100644 index 000000000..453a9714b --- /dev/null +++ b/src/pymod/QtPrintSupport/QtPrintSupportMain.h @@ -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 diff --git a/src/pymod/QtSql/QtSqlMain.cc b/src/pymod/QtSql/QtSqlMain.cc index bf16b25dc..9db124b2d 100644 --- a/src/pymod/QtSql/QtSqlMain.cc +++ b/src/pymod/QtSql/QtSqlMain.cc @@ -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'") diff --git a/src/pymod/QtSql/QtSqlMain.h b/src/pymod/QtSql/QtSqlMain.h new file mode 100644 index 000000000..e16c0b0de --- /dev/null +++ b/src/pymod/QtSql/QtSqlMain.h @@ -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 diff --git a/src/pymod/QtSvg/QtSvgMain.cc b/src/pymod/QtSvg/QtSvgMain.cc index 765762f8d..de369342b 100644 --- a/src/pymod/QtSvg/QtSvgMain.cc +++ b/src/pymod/QtSvg/QtSvgMain.cc @@ -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'") diff --git a/src/pymod/QtSvg/QtSvgMain.h b/src/pymod/QtSvg/QtSvgMain.h new file mode 100644 index 000000000..e5cc9d372 --- /dev/null +++ b/src/pymod/QtSvg/QtSvgMain.h @@ -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 diff --git a/src/pymod/QtUiTools/QtUiToolsMain.cc b/src/pymod/QtUiTools/QtUiToolsMain.cc index 71f5db2b6..5b4cedbdd 100644 --- a/src/pymod/QtUiTools/QtUiToolsMain.cc +++ b/src/pymod/QtUiTools/QtUiToolsMain.cc @@ -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'") diff --git a/src/pymod/QtUiTools/QtUiToolsMain.h b/src/pymod/QtUiTools/QtUiToolsMain.h new file mode 100644 index 000000000..ca08435a8 --- /dev/null +++ b/src/pymod/QtUiTools/QtUiToolsMain.h @@ -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 + diff --git a/src/pymod/QtWidgets/QtWidgetsMain.cc b/src/pymod/QtWidgets/QtWidgetsMain.cc index 38d4b67bd..59f5a9abd 100644 --- a/src/pymod/QtWidgets/QtWidgetsMain.cc +++ b/src/pymod/QtWidgets/QtWidgetsMain.cc @@ -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'") diff --git a/src/pymod/QtWidgets/QtWidgetsMain.h b/src/pymod/QtWidgets/QtWidgetsMain.h new file mode 100644 index 000000000..43b313474 --- /dev/null +++ b/src/pymod/QtWidgets/QtWidgetsMain.h @@ -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 diff --git a/src/pymod/QtXml/QtXmlMain.cc b/src/pymod/QtXml/QtXmlMain.cc index 6e5d6f826..376797d23 100644 --- a/src/pymod/QtXml/QtXmlMain.cc +++ b/src/pymod/QtXml/QtXmlMain.cc @@ -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'") diff --git a/src/pymod/QtXml/QtXmlMain.h b/src/pymod/QtXml/QtXmlMain.h new file mode 100644 index 000000000..e9ce9e1f4 --- /dev/null +++ b/src/pymod/QtXml/QtXmlMain.h @@ -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 diff --git a/src/pymod/QtXmlPatterns/QtXmlPatternsMain.cc b/src/pymod/QtXmlPatterns/QtXmlPatternsMain.cc index f0d3c8c45..60f2203a3 100644 --- a/src/pymod/QtXmlPatterns/QtXmlPatternsMain.cc +++ b/src/pymod/QtXmlPatterns/QtXmlPatternsMain.cc @@ -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'") diff --git a/src/pymod/QtXmlPatterns/QtXmlPatternsMain.h b/src/pymod/QtXmlPatterns/QtXmlPatternsMain.h new file mode 100644 index 000000000..9f0b1f7cc --- /dev/null +++ b/src/pymod/QtXmlPatterns/QtXmlPatternsMain.h @@ -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 diff --git a/src/pymod/ant/antMain.cc b/src/pymod/ant/antMain.cc index 87f201ed4..431e6b41a 100644 --- a/src/pymod/ant/antMain.cc +++ b/src/pymod/ant/antMain.cc @@ -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'") diff --git a/src/pymod/ant/antMain.h b/src/pymod/ant/antMain.h new file mode 100644 index 000000000..d81d76d27 --- /dev/null +++ b/src/pymod/ant/antMain.h @@ -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" diff --git a/src/pymod/db/dbMain.cc b/src/pymod/db/dbMain.cc index 93f9217bb..da8d20f04 100644 --- a/src/pymod/db/dbMain.cc +++ b/src/pymod/db/dbMain.cc @@ -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) { diff --git a/src/pymod/db/dbMain.h b/src/pymod/db/dbMain.h new file mode 100644 index 000000000..a1e04eacd --- /dev/null +++ b/src/pymod/db/dbMain.h @@ -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" diff --git a/src/pymod/distutils_src/klayout/pya/__init__.py b/src/pymod/distutils_src/klayout/pya/__init__.py new file mode 100644 index 000000000..66f96ac93 --- /dev/null +++ b/src/pymod/distutils_src/klayout/pya/__init__.py @@ -0,0 +1,4 @@ + +from ..pyacore import __all__ +from ..pyacore import * + diff --git a/src/pymod/distutils_src/pya/__init__.py b/src/pymod/distutils_src/pya/__init__.py index ff9d59e2e..df2cefac7 100644 --- a/src/pymod/distutils_src/pya/__init__.py +++ b/src/pymod/distutils_src/pya/__init__.py @@ -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 * diff --git a/src/pymod/edt/edtMain.cc b/src/pymod/edt/edtMain.cc index e3887760e..de5201d2a 100644 --- a/src/pymod/edt/edtMain.cc +++ b/src/pymod/edt/edtMain.cc @@ -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'") diff --git a/src/pymod/edt/edtMain.h b/src/pymod/edt/edtMain.h new file mode 100644 index 000000000..ccfd2cb2a --- /dev/null +++ b/src/pymod/edt/edtMain.h @@ -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" diff --git a/src/pymod/img/imgMain.cc b/src/pymod/img/imgMain.cc index 538e5044c..866144459 100644 --- a/src/pymod/img/imgMain.cc +++ b/src/pymod/img/imgMain.cc @@ -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'") diff --git a/src/pymod/img/imgMain.h b/src/pymod/img/imgMain.h new file mode 100644 index 000000000..627e610c5 --- /dev/null +++ b/src/pymod/img/imgMain.h @@ -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" diff --git a/src/pymod/lay/layMain.cc b/src/pymod/lay/layMain.cc index c32966867..f36cee5e4 100644 --- a/src/pymod/lay/layMain.cc +++ b/src/pymod/lay/layMain.cc @@ -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'") diff --git a/src/pymod/lay/layMain.h b/src/pymod/lay/layMain.h new file mode 100644 index 000000000..e9e16751e --- /dev/null +++ b/src/pymod/lay/layMain.h @@ -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" diff --git a/src/pymod/lib/libMain.cc b/src/pymod/lib/libMain.cc index bc3e6a9ad..6315b5dba 100644 --- a/src/pymod/lib/libMain.cc +++ b/src/pymod/lib/libMain.cc @@ -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) diff --git a/src/pymod/lib/libMain.h b/src/pymod/lib/libMain.h new file mode 100644 index 000000000..9b62feae9 --- /dev/null +++ b/src/pymod/lib/libMain.h @@ -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" diff --git a/src/pymod/lym/lymMain.cc b/src/pymod/lym/lymMain.cc index abd15ae15..a32e1ad60 100644 --- a/src/pymod/lym/lymMain.cc +++ b/src/pymod/lym/lymMain.cc @@ -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'") diff --git a/src/pymod/lym/lymMain.h b/src/pymod/lym/lymMain.h new file mode 100644 index 000000000..a55de524a --- /dev/null +++ b/src/pymod/lym/lymMain.h @@ -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" diff --git a/src/pymod/pya/pya.pro b/src/pymod/pya/pya.pro new file mode 100644 index 000000000..cd6dc1bf7 --- /dev/null +++ b/src/pymod/pya/pya.pro @@ -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 + } + } + + } + +} diff --git a/src/pymod/pya/pyaMain.cc b/src/pymod/pya/pyaMain.cc new file mode 100644 index 000000000..1d7e7ce3d --- /dev/null +++ b/src/pymod/pya/pyaMain.cc @@ -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) diff --git a/src/pymod/pymod.pro b/src/pymod/pymod.pro index b8f7744ea..1fac8d258 100644 --- a/src/pymod/pymod.pro +++ b/src/pymod/pymod.pro @@ -8,6 +8,7 @@ SUBDIRS = \ rdb \ lib \ lay \ + pya \ !equals(HAVE_QT, "0") { diff --git a/src/pymod/pymodHelper.h b/src/pymod/pymodHelper.h index 02b6790e7..8f21489c2 100644 --- a/src/pymod/pymodHelper.h +++ b/src/pymod/pymodHelper.h @@ -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 diff --git a/src/pymod/rdb/rdbMain.cc b/src/pymod/rdb/rdbMain.cc index 48314a071..ffcfe2e75 100644 --- a/src/pymod/rdb/rdbMain.cc +++ b/src/pymod/rdb/rdbMain.cc @@ -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'") diff --git a/src/pymod/rdb/rdbMain.h b/src/pymod/rdb/rdbMain.h new file mode 100644 index 000000000..344cb11a9 --- /dev/null +++ b/src/pymod/rdb/rdbMain.h @@ -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"