From 856635bc82bfb88f77d206dcea426eacbe29e0b3 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 15 May 2022 18:45:07 +0200 Subject: [PATCH] WIP: debugging, enabled pymod builds ... --- setup.py | 125 +++++++----------- .../laybasic/gsiDeclLayLayoutViewBase.cc | 28 ---- src/layui/layui/layui.pro | 6 - .../layview}/GridNetConfigPage.ui | 0 .../layview/gsiDeclLayLayoutView_noqt.cc | 31 +++++ .../layview/gsiDeclLayLayoutView_qt.cc | 3 + .../layui => layview/layview}/layGridNet.cc | 0 .../layui => layview/layview}/layGridNet.h | 0 .../layview}/layGridNetConfigPage.cc | 0 .../layview}/layGridNetConfigPage.h | 0 src/layview/layview/layLayoutView_noqt.cc | 4 + src/layview/layview/layLayoutView_noqt.h | 3 + src/layview/layview/layLayoutView_qt.cc | 5 + src/layview/layview/layLayoutView_qt.h | 3 + src/layview/layview/layview.pro | 11 +- 15 files changed, 108 insertions(+), 111 deletions(-) rename src/{layui/layui => layview/layview}/GridNetConfigPage.ui (100%) rename src/{layui/layui => layview/layview}/layGridNet.cc (100%) rename src/{layui/layui => layview/layview}/layGridNet.h (100%) rename src/{layui/layui => layview/layview}/layGridNetConfigPage.cc (100%) rename src/{layui/layui => layview/layview}/layGridNetConfigPage.h (100%) diff --git a/setup.py b/setup.py index bf826a911..d2105dd64 100644 --- a/setup.py +++ b/setup.py @@ -524,21 +524,38 @@ _rdb = Library(config.root + '._rdb', config.add_extension(_rdb) # ------------------------------------------------------------------ -# _lay dependency library +# _laybasic dependency library -_lay_path = os.path.join("src", "laybasic", "laybasic") -_lay_sources = set(glob.glob(os.path.join(_lay_path, "*.cc"))) +_laybasic_path = os.path.join("src", "laybasic", "laybasic") +_laybasic_sources = set(glob.glob(os.path.join(_laybasic_path, "*.cc"))) -_lay = Library(config.root + '._lay', +_laybasic = Library(config.root + '._laybasic', define_macros=config.macros() + [('MAKE_LAYBASIC_LIBRARY', 1)], include_dirs=[_rdb_path, _db_path, _tl_path, _gsi_path], extra_objects=[config.path_of('_rdb', _rdb_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_db', _db_path)], language='c++', - libraries=config.libraries('_lay'), - extra_link_args=config.link_args('_lay'), - extra_compile_args=config.compile_args('_lay'), - sources=list(_lay_sources)) -config.add_extension(_lay) + libraries=config.libraries('_laybasic'), + extra_link_args=config.link_args('_laybasic'), + extra_compile_args=config.compile_args('_laybasic'), + sources=list(_laybasic_sources)) +config.add_extension(_laybasic) + +# ------------------------------------------------------------------ +# _layview dependency library + +_layview_path = os.path.join("src", "layview", "layview") +_layview_sources = set(glob.glob(os.path.join(_layview_path, "*.cc"))) + +_layview = Library(config.root + '._layview', + define_macros=config.macros() + [('MAKE_LAYVIEW_LIBRARY', 1)], + include_dirs=[_laybasic_path, _rdb_path, _db_path, _tl_path, _gsi_path], + extra_objects=[config.path_of('_laybasic', _laybasic_path), config.path_of('_rdb', _rdb_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_db', _db_path)], + language='c++', + libraries=config.libraries('_layview'), + extra_link_args=config.link_args('_layview'), + extra_compile_args=config.compile_args('_layview'), + sources=list(_layview_sources)) +config.add_extension(_layview) # ------------------------------------------------------------------ # _lym dependency library @@ -565,8 +582,8 @@ _ant_sources = set(glob.glob(os.path.join(_ant_path, "*.cc"))) _ant = Library(config.root + '._ant', define_macros=config.macros() + [('MAKE_ANT_LIBRARY', 1)], - include_dirs=[_lay_path, _rdb_path, _db_path, _tl_path, _gsi_path], - extra_objects=[config.path_of('_lay', _lay_path), config.path_of('_rdb', _rdb_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_db', _db_path)], + include_dirs=[_laybasic_path, _layview_path, _rdb_path, _db_path, _tl_path, _gsi_path], + extra_objects=[config.path_of('_laybasic', _laybasic_path), config.path_of('_layview', _layview_path), config.path_of('_rdb', _rdb_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_db', _db_path)], language='c++', libraries=config.libraries('_ant'), extra_link_args=config.link_args('_ant'), @@ -582,8 +599,8 @@ _img_sources = set(glob.glob(os.path.join(_img_path, "*.cc"))) _img = Library(config.root + '._img', define_macros=config.macros() + [('MAKE_ANT_LIBRARY', 1)], - include_dirs=[_lay_path, _rdb_path, _db_path, _tl_path, _gsi_path], - extra_objects=[config.path_of('_lay', _lay_path), config.path_of('_rdb', _rdb_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_db', _db_path)], + include_dirs=[_laybasic_path, _layview_path, _rdb_path, _db_path, _tl_path, _gsi_path], + extra_objects=[config.path_of('_laybasic', _laybasic_path), config.path_of('_layview', _layview_path), config.path_of('_rdb', _rdb_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_db', _db_path)], language='c++', libraries=config.libraries('_img'), extra_link_args=config.link_args('_img'), @@ -599,8 +616,8 @@ _edt_sources = set(glob.glob(os.path.join(_edt_path, "*.cc"))) _edt = Library(config.root + '._edt', define_macros=config.macros() + [('MAKE_ANT_LIBRARY', 1)], - include_dirs=[_lay_path, _rdb_path, _db_path, _tl_path, _gsi_path], - extra_objects=[config.path_of('_lay', _lay_path), config.path_of('_rdb', _rdb_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_db', _db_path)], + include_dirs=[_laybasic_path, _layview_path, _rdb_path, _db_path, _tl_path, _gsi_path], + extra_objects=[config.path_of('_laybasic', _laybasic_path), config.path_of('_layview', _layview_path), config.path_of('_rdb', _rdb_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_db', _db_path)], language='c++', libraries=config.libraries('_edt'), extra_link_args=config.link_args('_edt'), @@ -699,68 +716,28 @@ lay_sources = set(glob.glob(os.path.join(lay_path, "*.cc"))) lay = Extension(config.root + '.laycore', define_macros=config.macros(), - include_dirs=[_lay_path, _img_path, _ant_path, _edt_path, _lym_path, _tl_path, _gsi_path, _pya_path], - extra_objects=[config.path_of('_lay', _lay_path), config.path_of('_img', _img_path), config.path_of('_ant', _ant_path), config.path_of('_edt', _edt_path), config.path_of('_lym', _lym_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_pya', _pya_path)], + include_dirs=[_laybasic_path, + _layview_path, + _img_path, + _ant_path, + _edt_path, + _lym_path, + _tl_path, + _gsi_path, + _pya_path], + extra_objects=[config.path_of('_laybasic', _laybasic_path), + config.path_of('_layview', _layview_path), + config.path_of('_img', _img_path), + config.path_of('_ant', _ant_path), + config.path_of('_edt', _edt_path), + config.path_of('_lym', _lym_path), + config.path_of('_tl', _tl_path), + config.path_of('_gsi', _gsi_path), + config.path_of('_pya', _pya_path)], extra_link_args=config.link_args('laycore'), extra_compile_args=config.compile_args('laycore'), sources=list(lay_sources)) -# ------------------------------------------------------------------ -# ant extension library - -ant_path = os.path.join("src", "pymod", "ant") -ant_sources = set(glob.glob(os.path.join(ant_path, "*.cc"))) - -ant = Extension(config.root + '.antcore', - define_macros=config.macros(), - include_dirs=[_ant_path, _tl_path, _gsi_path, _pya_path], - extra_objects=[config.path_of('_ant', _ant_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_pya', _pya_path)], - extra_link_args=config.link_args('antcore'), - extra_compile_args=config.compile_args('antcore'), - sources=list(ant_sources)) - -# ------------------------------------------------------------------ -# edt extension library - -edt_path = os.path.join("src", "pymod", "edt") -edt_sources = set(glob.glob(os.path.join(edt_path, "*.cc"))) - -edt = Extension(config.root + '.edtcore', - define_macros=config.macros(), - include_dirs=[_edt_path, _tl_path, _gsi_path, _pya_path], - extra_objects=[config.path_of('_edt', _edt_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_pya', _pya_path)], - extra_link_args=config.link_args('edtcore'), - extra_compile_args=config.compile_args('edtcore'), - sources=list(edt_sources)) - -# ------------------------------------------------------------------ -# img extension library - -img_path = os.path.join("src", "pymod", "img") -img_sources = set(glob.glob(os.path.join(img_path, "*.cc"))) - -img = Extension(config.root + '.imgcore', - define_macros=config.macros(), - include_dirs=[_img_path, _tl_path, _gsi_path, _pya_path], - extra_objects=[config.path_of('_img', _img_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_pya', _pya_path)], - extra_link_args=config.link_args('imgcore'), - extra_compile_args=config.compile_args('imgcore'), - sources=list(img_sources)) - -# ------------------------------------------------------------------ -# lym extension library - -lym_path = os.path.join("src", "pymod", "lym") -lym_sources = set(glob.glob(os.path.join(lym_path, "*.cc"))) - -lym = Extension(config.root + '.lymcore', - define_macros=config.macros(), - include_dirs=[_lym_path, _tl_path, _gsi_path, _pya_path], - extra_objects=[config.path_of('_lym', _lym_path), config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path), config.path_of('_pya', _pya_path)], - extra_link_args=config.link_args('lymcore'), - extra_compile_args=config.compile_args('lymcore'), - sources=list(lym_sources)) - # ------------------------------------------------------------------ # Core setup function @@ -786,4 +763,4 @@ if __name__ == '__main__': url='https://github.com/klayout/klayout', packages=find_packages('src/pymod/distutils_src'), package_dir={'': 'src/pymod/distutils_src'}, # https://github.com/pypa/setuptools/issues/230 - ext_modules=[_tl, _gsi, _pya, _rba, _db, _lib, _rdb, _lym, _lay, _ant, _edt, _img] + db_plugins + [tl, db, lib, rdb, lay, ant, edt, img, lym]) + ext_modules=[_tl, _gsi, _pya, _rba, _db, _lib, _rdb, _lym, _laybasic, _layview, _ant, _edt, _img] + db_plugins + [tl, db, lib, rdb, lay]) diff --git a/src/laybasic/laybasic/gsiDeclLayLayoutViewBase.cc b/src/laybasic/laybasic/gsiDeclLayLayoutViewBase.cc index 765271b88..b13ae2f36 100644 --- a/src/laybasic/laybasic/gsiDeclLayLayoutViewBase.cc +++ b/src/laybasic/laybasic/gsiDeclLayLayoutViewBase.cc @@ -1546,34 +1546,6 @@ LAYBASIC_PUBLIC Class decl_LayoutViewBase (QT_EXTERNAL_BASE "Returns an array of \\LayerPropertiesIterator objects pointing to the currently selected layers. " "If no layer view is selected currently, an empty array is returned.\n" ) + -#if !defined(HAVE_QT) - gsi::event ("on_image_updated_event", static_cast (&lay::LayoutViewBase::image_updated_event), - "@brief An event indicating that the image (\"screenshot\") was updated\n" - "\n" - "This event is triggered when calling \\timer." - "\n" - "This event has been introduced in version 0.28." - ) + - gsi::event ("on_drawing_finished_event", static_cast (&lay::LayoutViewBase::drawing_finished_event), - "@brief An event indicating that the image is fully drawn\n" - "\n" - "This event is triggered when calling \\timer. " - "Before this event is issue, a final \\on_image_updated_event may be issued.\n" - "\n" - "This event has been introduced in version 0.28." - ) + - gsi::method ("timer", static_cast (&lay::LayoutViewBase::timer), - "@brief A callback required to be called regularily in the non-Qt case.\n" - "\n" - "This callback eventually implements the event loop in the non-Qt case. The main task " - "is to indicate new versions of the layout image while it is drawn. " - "When a new image has arrived, this method will issue an \\on_image_updated_event. " - "In the implementation of the latter, \"screenshot\" may be called to retrieve the current image.\n" - "When drawing has finished, the \\on_drawing_finished_event will be triggered.\n" - "\n" - "This method has been introduced in version 0.28." - ) + -#endif gsi::event ("on_active_cellview_changed", static_cast (&lay::LayoutViewBase::active_cellview_changed_event), "@brief An event indicating that the active cellview has changed\n" "\n" diff --git a/src/layui/layui/layui.pro b/src/layui/layui/layui.pro index 733082897..0b2e9f730 100644 --- a/src/layui/layui/layui.pro +++ b/src/layui/layui/layui.pro @@ -23,7 +23,6 @@ FORMS = \ DuplicateLayerDialog.ui \ EditStipplesForm.ui \ FlattenInstOptionsDialog.ui \ - GridNetConfigPage.ui \ LayerMappingWidget.ui \ LayerSourceDialog.ui \ LayoutProperties.ui \ @@ -105,8 +104,6 @@ SOURCES = \ layEditorOptionsPage.cc \ layEditorOptionsPages.cc \ layFileDialog.cc \ - layGridNetConfigPage.cc \ - layGridNet.cc \ layGenericSyntaxHighlighter.cc \ layHierarchyControlPanel.cc \ layIndexedNetlistModel.cc \ @@ -165,8 +162,6 @@ HEADERS = \ layEditorOptionsPages.h \ layFileDialog.h \ layGenericSyntaxHighlighter.h \ - layGridNetConfigPage.h \ - layGridNet.h \ layHierarchyControlPanel.h \ layIndexedNetlistModel.h \ layItemDelegates.h \ @@ -196,7 +191,6 @@ HEADERS = \ layTechnology.h \ layTipDialog.h \ layWidgets.h \ - laybasicConfig.h \ rdbInfoWidget.h \ rdbMarkerBrowser.h \ rdbMarkerBrowserDialog.h \ diff --git a/src/layui/layui/GridNetConfigPage.ui b/src/layview/layview/GridNetConfigPage.ui similarity index 100% rename from src/layui/layui/GridNetConfigPage.ui rename to src/layview/layview/GridNetConfigPage.ui diff --git a/src/layview/layview/gsiDeclLayLayoutView_noqt.cc b/src/layview/layview/gsiDeclLayLayoutView_noqt.cc index 528636548..c3162124f 100644 --- a/src/layview/layview/gsiDeclLayLayoutView_noqt.cc +++ b/src/layview/layview/gsiDeclLayLayoutView_noqt.cc @@ -20,7 +20,10 @@ */ +#if !defined(HAVE_QT) + #include "gsiDecl.h" +#include "gsiSignals.h" #include "layLayoutView.h" namespace gsi @@ -46,6 +49,32 @@ Class decl_LayoutView (decl_LayoutViewBase, "lay", "LayoutView" "\n" "This constructor has been introduced in version 0.25.\n" "It has been enhanced with the arguments in version 0.27.\n" + ) + + gsi::event ("on_image_updated_event", static_cast (&lay::LayoutView::image_updated_event), + "@brief An event indicating that the image (\"screenshot\") was updated\n" + "\n" + "This event is triggered when calling \\timer." + "\n" + "This event has been introduced in version 0.28." + ) + + gsi::event ("on_drawing_finished_event", static_cast (&lay::LayoutView::drawing_finished_event), + "@brief An event indicating that the image is fully drawn\n" + "\n" + "This event is triggered when calling \\timer. " + "Before this event is issue, a final \\on_image_updated_event may be issued.\n" + "\n" + "This event has been introduced in version 0.28." + ) + + gsi::method ("timer", static_cast (&lay::LayoutView::timer), + "@brief A callback required to be called regularily in the non-Qt case.\n" + "\n" + "This callback eventually implements the event loop in the non-Qt case. The main task " + "is to indicate new versions of the layout image while it is drawn. " + "When a new image has arrived, this method will issue an \\on_image_updated_event. " + "In the implementation of the latter, \"screenshot\" may be called to retrieve the current image.\n" + "When drawing has finished, the \\on_drawing_finished_event will be triggered.\n" + "\n" + "This method has been introduced in version 0.28." ), "@brief The view object presenting one or more layout objects\n" "\n" @@ -82,3 +111,5 @@ static ClassExt extdecl_LayerPropertiesNode ( } +#endif + diff --git a/src/layview/layview/gsiDeclLayLayoutView_qt.cc b/src/layview/layview/gsiDeclLayLayoutView_qt.cc index 7ea2ef2e2..aac221373 100644 --- a/src/layview/layview/gsiDeclLayLayoutView_qt.cc +++ b/src/layview/layview/gsiDeclLayLayoutView_qt.cc @@ -20,6 +20,7 @@ */ +#if defined(HAVE_QT) #include "gsiDecl.h" #include "gsiSignals.h" @@ -221,3 +222,5 @@ static ClassExt extdecl_LayerPropertiesNode ( ); } + +#endif diff --git a/src/layui/layui/layGridNet.cc b/src/layview/layview/layGridNet.cc similarity index 100% rename from src/layui/layui/layGridNet.cc rename to src/layview/layview/layGridNet.cc diff --git a/src/layui/layui/layGridNet.h b/src/layview/layview/layGridNet.h similarity index 100% rename from src/layui/layui/layGridNet.h rename to src/layview/layview/layGridNet.h diff --git a/src/layui/layui/layGridNetConfigPage.cc b/src/layview/layview/layGridNetConfigPage.cc similarity index 100% rename from src/layui/layui/layGridNetConfigPage.cc rename to src/layview/layview/layGridNetConfigPage.cc diff --git a/src/layui/layui/layGridNetConfigPage.h b/src/layview/layview/layGridNetConfigPage.h similarity index 100% rename from src/layui/layui/layGridNetConfigPage.h rename to src/layview/layview/layGridNetConfigPage.h diff --git a/src/layview/layview/layLayoutView_noqt.cc b/src/layview/layview/layLayoutView_noqt.cc index 20c612067..6b8743a40 100644 --- a/src/layview/layview/layLayoutView_noqt.cc +++ b/src/layview/layview/layLayoutView_noqt.cc @@ -20,6 +20,8 @@ */ +#if !defined(HAVE_QT) + #include "layLayoutView.h" namespace lay @@ -58,3 +60,5 @@ LayoutView::timer () } } // namespace lay + +#endif diff --git a/src/layview/layview/layLayoutView_noqt.h b/src/layview/layview/layLayoutView_noqt.h index 9c1d16c52..0288d6081 100644 --- a/src/layview/layview/layLayoutView_noqt.h +++ b/src/layview/layview/layLayoutView_noqt.h @@ -20,6 +20,7 @@ */ +#if !defined(HAVE_QT) #ifndef HDR_layLayoutViewNoQt #define HDR_layLayoutViewNoQt @@ -78,3 +79,5 @@ private: } #endif + +#endif diff --git a/src/layview/layview/layLayoutView_qt.cc b/src/layview/layview/layLayoutView_qt.cc index 9c41b9f4b..e8805b1b3 100644 --- a/src/layview/layview/layLayoutView_qt.cc +++ b/src/layview/layview/layLayoutView_qt.cc @@ -20,6 +20,8 @@ */ +#if defined(HAVE_QT) + #include #include #include @@ -1083,3 +1085,6 @@ LayoutView::sizeHint () const } } // namespace lay + +#endif + diff --git a/src/layview/layview/layLayoutView_qt.h b/src/layview/layview/layLayoutView_qt.h index 9d2378218..fe65fde62 100644 --- a/src/layview/layview/layLayoutView_qt.h +++ b/src/layview/layview/layLayoutView_qt.h @@ -20,6 +20,7 @@ */ +#if defined(HAVE_QT) #ifndef HDR_layLayoutViewQt #define HDR_layLayoutViewQt @@ -738,3 +739,5 @@ private: } #endif + +#endif diff --git a/src/layview/layview/layview.pro b/src/layview/layview/layview.pro index eb6211e0a..ed2df8454 100644 --- a/src/layview/layview/layview.pro +++ b/src/layview/layview/layview.pro @@ -6,22 +6,27 @@ include($$PWD/../../lib.pri) DEFINES += MAKE_LAYVIEW_LIBRARY -FORMS = \ - RESOURCES = \ SOURCES = \ + layGridNet.cc \ HEADERS = \ - layLayoutView.h + layGridNet.h \ + layLayoutView.h \ !equals(HAVE_QT, "0") { + FORMS = \ + GridNetConfigPage.ui \ + SOURCES += \ + layGridNetConfigPage.cc \ layLayoutView_qt.cc \ gsiDeclLayLayoutView_qt.cc \ HEADERS += \ + layGridNetConfigPage.h \ layLayoutView_qt.h \ } else {