From 366855c9bd9bf35d57e6c47128fd3cfbf197e867 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sun, 8 Oct 2023 19:25:38 +0200 Subject: [PATCH] Move ErrorWidget & CellViewer from Viewer to Hurricane module (complete). --- crlcore/python/helpers/io.py | 4 ++-- hurricane/src/isobar/PyHurricane.cpp | 12 +++++++++++- hurricane/src/viewer/PyViewer.cpp | 12 ------------ 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/crlcore/python/helpers/io.py b/crlcore/python/helpers/io.py index 22f8b247..594aeadd 100644 --- a/crlcore/python/helpers/io.py +++ b/crlcore/python/helpers/io.py @@ -20,8 +20,8 @@ import os.path import re import traceback from .. import Cfg -from ..Hurricane import UpdateSession -from ..Viewer import Graphics, ErrorWidget +from ..Hurricane import UpdateSession, ErrorWidget +from ..Viewer import Graphics def textStackTrace ( trace, showIndent=True, scriptPath=None ): diff --git a/hurricane/src/isobar/PyHurricane.cpp b/hurricane/src/isobar/PyHurricane.cpp index 3abe04ce..f684dd87 100644 --- a/hurricane/src/isobar/PyHurricane.cpp +++ b/hurricane/src/isobar/PyHurricane.cpp @@ -89,6 +89,8 @@ #include "hurricane/isobar/PyUnitRule.h" #include "hurricane/isobar/PyPhysicalRule.h" #include "hurricane/isobar/PyTwoLayersPhysicalRule.h" +#include "hurricane/isobar/PyErrorWidget.h" +#include "hurricane/isobar/PyCellViewer.h" #include "hurricane/NetExternalComponents.h" #include @@ -615,6 +617,8 @@ extern "C" { PyUnitRule_LinkPyType(); PyPhysicalRule_LinkPyType(); PyTwoLayersPhysicalRule_LinkPyType(); + PyErrorWidget_LinkPyType(); + PyCellViewer_LinkPyType(); PYTYPE_READY( AttributesHolder ) PYTYPE_READY( DebugSession ) @@ -683,6 +687,8 @@ extern "C" { PYTYPE_READY( QueryMask ) PYTYPE_READY( DeviceDescriptor ) PYTYPE_READY( Rule ) + PYTYPE_READY( ErrorWidget ) + PYTYPE_READY( CellViewer ) PYTYPE_READY_SUB( BasicLayer , Layer ) PYTYPE_READY_SUB( RegularLayer , Layer ) @@ -880,7 +886,10 @@ extern "C" { PyModule_AddObject ( module, "Polygon" , (PyObject*)&PyTypePolygon ); Py_INCREF( &PyTypeDeviceDescriptor ); PyModule_AddObject( module, "DeviceDescriptor" , (PyObject*)&PyTypeDeviceDescriptor ); - + Py_INCREF( &PyTypeErrorWidget ); + PyModule_AddObject( module, "ErrorWidget" , (PyObject*)&PyTypeErrorWidget ); + Py_INCREF( &PyTypeCellViewer ); + PyModule_AddObject( module, "CellViewer" , (PyObject*)&PyTypeCellViewer ); PyObject* dictionnary = PyModule_GetDict ( module ); @@ -906,6 +915,7 @@ extern "C" { PyCell_postModuleInit(); PyInstance_postModuleInit(); PyQuery_postModuleInit(); + PyCellViewer_postModuleInit(); //Py_AtExit( showAtExit ); diff --git a/hurricane/src/viewer/PyViewer.cpp b/hurricane/src/viewer/PyViewer.cpp index 5d31aa06..22a51179 100644 --- a/hurricane/src/viewer/PyViewer.cpp +++ b/hurricane/src/viewer/PyViewer.cpp @@ -21,8 +21,6 @@ #include "hurricane/viewer/PyDrawingGroup.h" #include "hurricane/viewer/PyDisplayStyle.h" #include "hurricane/viewer/PyHSVr.h" -#include "hurricane/isobar/PyErrorWidget.h" -#include "hurricane/isobar/PyCellViewer.h" #include "hurricane/viewer/PyAboutWindow.h" @@ -91,8 +89,6 @@ extern "C" { PyDisplayStyleVector_LinkPyType (); PyHApplication_LinkPyType (); PyGraphics_LinkPyType (); - PyErrorWidget_LinkPyType (); - PyCellViewer_LinkPyType (); PyAboutWindow_LinkPyType (); PYTYPE_READY ( HSVr ); @@ -107,15 +103,12 @@ extern "C" { PYTYPE_READY ( DisplayStyleVectorIterator ); PYTYPE_READY ( HApplication ); PYTYPE_READY ( Graphics ); - PYTYPE_READY ( ErrorWidget ); - PYTYPE_READY ( CellViewer ); PYTYPE_READY ( AboutWindow ); // Identifier string can take up to 10 characters. __cs.addType ( "hsvr" , &PyTypeHSVr , "" , false ); __cs.addType ( "displaySty", &PyTypeDisplayStyle, "", false ); __cs.addType ( "graphics" , &PyTypeGraphics , "" , false ); - __cs.addType ( "cellView" , &PyTypeCellViewer , "" , false ); PyObject* module = PyModule_Create( &PyViewer_ModuleDef ); if ( module == NULL ) { @@ -130,15 +123,10 @@ extern "C" { PyModule_AddObject ( module, "HApplication", (PyObject*)&PyTypeHApplication ); Py_INCREF ( &PyTypeGraphics ); PyModule_AddObject ( module, "Graphics" , (PyObject*)&PyTypeGraphics ); - Py_INCREF ( &PyTypeCellViewer ); - PyModule_AddObject ( module, "ErrorWidget" , (PyObject*)&PyTypeErrorWidget ); - Py_INCREF ( &PyTypeErrorWidget ); - PyModule_AddObject ( module, "CellViewer" , (PyObject*)&PyTypeCellViewer ); Py_INCREF ( &PyTypeAboutWindow ); PyModule_AddObject ( module, "AboutWindow" , (PyObject*)&PyTypeAboutWindow ); PyDisplayStyle_postModuleInit(); - PyCellViewer_postModuleInit(); cdebug_log(20,0) << "Viewer.so loaded " << (void*)&typeid(string) << endl;