* All tools:
- Bug: target_link_libraries() must be put back for OSX Snow Leopard (doesn't seems to affect Leopard). As I do not have an OSX under my hand it's untested and is likely to fail at that point. * ./hurricane: - Bug: In Instance, correct support for Instance::PlacementStatus::Code. - New: NetExternalComponents python object wrapper, moves getExternalComponents() from Hurricane module into that new object. - New: Breakpoint python object wrapper, to allow stratus1 to stop each times it calls the viewer. - Change: In PyHurricane, UpdateSession is now a true object with static methods. - Change: In BreakpointWidget uses a local event loop mechanism that no longer consumes 100% of a CPU while doing nothing... (copied from Qt's sources of QDialog).
This commit is contained in:
parent
76215da79c
commit
62b8477fee
|
@ -54,15 +54,18 @@ IF(NOT BUILD_SHARED_LIBS)
|
||||||
NO_DEFAULT_PATH
|
NO_DEFAULT_PATH
|
||||||
)
|
)
|
||||||
MESSAGE(STATUS "Building static libraries.")
|
MESSAGE(STATUS "Building static libraries.")
|
||||||
IF(Boost_FOUND)
|
|
||||||
ENDIF(Boost_FOUND)
|
|
||||||
ELSE(NOT BUILD_SHARED_LIBS)
|
ELSE(NOT BUILD_SHARED_LIBS)
|
||||||
MESSAGE(STATUS "Building dynamic libraries.")
|
MESSAGE(STATUS "Building dynamic libraries.")
|
||||||
ENDIF(NOT BUILD_SHARED_LIBS)
|
ENDIF(NOT BUILD_SHARED_LIBS)
|
||||||
|
|
||||||
SET(Boost_USE_STATIC_LIBS ON)
|
SET(Boost_USE_STATIC_LIBS ON)
|
||||||
MESSAGE(STATUS "Always uses Boost static libraries.")
|
MESSAGE(STATUS "Always uses Boost static libraries.")
|
||||||
|
FIND_PACKAGE(Boost 1.35.0 COMPONENTS regex)
|
||||||
|
IF(NOT Boost_FOUND)
|
||||||
FIND_PACKAGE(Boost 1.33.1 COMPONENTS regex REQUIRED)
|
FIND_PACKAGE(Boost 1.33.1 COMPONENTS regex REQUIRED)
|
||||||
|
ENDIF(NOT Boost_FOUND)
|
||||||
|
MESSAGE(STATUS "Found Boost libraries ${Boost_LIB_VERSION} in ${Boost_INCLUDE_DIR}")
|
||||||
|
MESSAGE(STATUS " ${Boost_LIBRARIES}")
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(src)
|
ADD_SUBDIRECTORY(src)
|
||||||
ADD_SUBDIRECTORY(cmake_modules)
|
ADD_SUBDIRECTORY(cmake_modules)
|
||||||
|
|
|
@ -133,7 +133,7 @@ namespace Hurricane {
|
||||||
|
|
||||||
bool Breakpoint::_stop ( unsigned int level, const string& message )
|
bool Breakpoint::_stop ( unsigned int level, const string& message )
|
||||||
{
|
{
|
||||||
if ( _stopCb && ( level <= _stopLevel ) )
|
if ( _stopCb && ( level >= _stopLevel ) )
|
||||||
return _stopCb ( message );
|
return _stopCb ( message );
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -304,7 +304,6 @@ void Instance::materialize()
|
||||||
// *************************
|
// *************************
|
||||||
{
|
{
|
||||||
if (not isMaterialized()) {
|
if (not isMaterialized()) {
|
||||||
cerr << "materialize: " << this << endl;
|
|
||||||
Box boundingBox = getBoundingBox();
|
Box boundingBox = getBoundingBox();
|
||||||
if (!boundingBox.isEmpty()) {
|
if (!boundingBox.isEmpty()) {
|
||||||
QuadTree* quadTree = _cell->_getQuadTree();
|
QuadTree* quadTree = _cell->_getQuadTree();
|
||||||
|
@ -376,18 +375,15 @@ void Instance::setTransformation(const Transformation& transformation)
|
||||||
void Instance::setPlacementStatus(const PlacementStatus& placementstatus)
|
void Instance::setPlacementStatus(const PlacementStatus& placementstatus)
|
||||||
// **********************************************************************
|
// **********************************************************************
|
||||||
{
|
{
|
||||||
cerr << "setPlacementStatus of " << this << " to " << placementstatus << endl;
|
|
||||||
if (placementstatus != _placementStatus) {
|
if (placementstatus != _placementStatus) {
|
||||||
invalidate(true);
|
invalidate(true);
|
||||||
|
|
||||||
if (_placementStatus == PlacementStatus::UNPLACED) {
|
if (_placementStatus == PlacementStatus::UNPLACED) {
|
||||||
cerr << "setPlacementStatus: PLACED/FIXED " << this << endl;
|
|
||||||
materialize ();
|
materialize ();
|
||||||
} else if (placementstatus == PlacementStatus::UNPLACED)
|
} else if (placementstatus == PlacementStatus::UNPLACED)
|
||||||
unmaterialize ();
|
unmaterialize ();
|
||||||
|
|
||||||
_placementStatus = placementstatus;
|
_placementStatus = placementstatus;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -460,12 +456,9 @@ void Instance::_postCreate()
|
||||||
end_for;
|
end_for;
|
||||||
}
|
}
|
||||||
|
|
||||||
cerr << "Initial placement status " << this << " " << _placementStatus << endl;
|
|
||||||
|
|
||||||
bool autoMaterialization = not autoMaterializationIsDisabled();
|
bool autoMaterialization = not autoMaterializationIsDisabled();
|
||||||
if ( _placementStatus == PlacementStatus::UNPLACED ) {
|
if ( _placementStatus == PlacementStatus::UNPLACED ) {
|
||||||
disableAutoMaterialization();
|
disableAutoMaterialization();
|
||||||
cerr << "do not materialize: " << this << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Inherit::_postCreate();
|
Inherit::_postCreate();
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
${PYTHON_INCLUDE_PATH}
|
${PYTHON_INCLUDE_PATH}
|
||||||
)
|
)
|
||||||
set ( sources ProxyProperty.cpp
|
set ( sources ProxyProperty.cpp
|
||||||
|
PyBreakpoint.cpp
|
||||||
PyBox.cpp
|
PyBox.cpp
|
||||||
PyCell.cpp
|
PyCell.cpp
|
||||||
PyCellCollection.cpp
|
PyCellCollection.cpp
|
||||||
|
@ -25,6 +26,7 @@
|
||||||
PyLibrary.cpp
|
PyLibrary.cpp
|
||||||
PyNet.cpp
|
PyNet.cpp
|
||||||
PyNetCollection.cpp
|
PyNetCollection.cpp
|
||||||
|
PyNetExternalComponents.cpp
|
||||||
PyOccurrence.cpp
|
PyOccurrence.cpp
|
||||||
PyOccurrenceCollection.cpp
|
PyOccurrenceCollection.cpp
|
||||||
PyPad.cpp
|
PyPad.cpp
|
||||||
|
@ -45,6 +47,7 @@
|
||||||
PyVertical.cpp
|
PyVertical.cpp
|
||||||
)
|
)
|
||||||
set ( includes hurricane/isobar/ProxyProperty.h
|
set ( includes hurricane/isobar/ProxyProperty.h
|
||||||
|
hurricane/isobar/PyBreakpoint.h
|
||||||
hurricane/isobar/PyBox.h
|
hurricane/isobar/PyBox.h
|
||||||
hurricane/isobar/PyCell.h
|
hurricane/isobar/PyCell.h
|
||||||
hurricane/isobar/PyCellCollection.h
|
hurricane/isobar/PyCellCollection.h
|
||||||
|
@ -63,6 +66,7 @@
|
||||||
hurricane/isobar/PyLibrary.h
|
hurricane/isobar/PyLibrary.h
|
||||||
hurricane/isobar/PyNet.h
|
hurricane/isobar/PyNet.h
|
||||||
hurricane/isobar/PyNetCollection.h
|
hurricane/isobar/PyNetCollection.h
|
||||||
|
hurricane/isobar/PyNetExternalComponents.h
|
||||||
hurricane/isobar/PyOccurrence.h
|
hurricane/isobar/PyOccurrence.h
|
||||||
hurricane/isobar/PyOccurrenceCollection.h
|
hurricane/isobar/PyOccurrenceCollection.h
|
||||||
hurricane/isobar/PyPad.h
|
hurricane/isobar/PyPad.h
|
||||||
|
@ -91,7 +95,9 @@
|
||||||
install ( FILES ${includes}
|
install ( FILES ${includes}
|
||||||
${includes2} DESTINATION include/coriolis2/hurricane/isobar )
|
${includes2} DESTINATION include/coriolis2/hurricane/isobar )
|
||||||
add_library ( isobar ${sources} ${sources2} )
|
add_library ( isobar ${sources} ${sources2} )
|
||||||
|
target_link_libraries ( isobar viewer )
|
||||||
add_library ( Hurricane MODULE ${sources} )
|
add_library ( Hurricane MODULE ${sources} )
|
||||||
|
target_link_libraries ( Hurricane viewer )
|
||||||
set_target_properties ( Hurricane PROPERTIES
|
set_target_properties ( Hurricane PROPERTIES
|
||||||
COMPILE_FLAGS "${COMPILE_FLAGS} -D__PYTHON_MODULE__=1"
|
COMPILE_FLAGS "${COMPILE_FLAGS} -D__PYTHON_MODULE__=1"
|
||||||
PREFIX ""
|
PREFIX ""
|
||||||
|
|
|
@ -0,0 +1,141 @@
|
||||||
|
|
||||||
|
// -*- C++ -*-
|
||||||
|
//
|
||||||
|
// This file is part of the Coriolis Software.
|
||||||
|
// Copyright (c) UPMC/LIP6 2010-2010, All Rights Reserved
|
||||||
|
//
|
||||||
|
// x-----------------------------------------------------------------x
|
||||||
|
// | |
|
||||||
|
// | C O R I O L I S |
|
||||||
|
// | I s o b a r - Hurricane / Python Interface |
|
||||||
|
// | |
|
||||||
|
// | Author : Jean-Paul CHAPUT |
|
||||||
|
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||||
|
// | =============================================================== |
|
||||||
|
// | C++ Module : "./PyBreakpoint.cpp" |
|
||||||
|
// | *************************************************************** |
|
||||||
|
// | U p d a t e s |
|
||||||
|
// | |
|
||||||
|
// x-----------------------------------------------------------------x
|
||||||
|
|
||||||
|
|
||||||
|
#include "hurricane/isobar/PyNet.h"
|
||||||
|
#include "hurricane/isobar/PyComponent.h"
|
||||||
|
#include "hurricane/isobar/PyComponentCollection.h"
|
||||||
|
#include "hurricane/isobar/PyBreakpoint.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Isobar {
|
||||||
|
|
||||||
|
using namespace Hurricane;
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
|
||||||
|
#define METHOD_HEAD(function) GENERIC_METHOD_HEAD(Breakpoint,bp,function)
|
||||||
|
|
||||||
|
|
||||||
|
// x=================================================================x
|
||||||
|
// | "PyBreakpoint" Python Module Code Part |
|
||||||
|
// x=================================================================x
|
||||||
|
|
||||||
|
#if defined(__PYTHON_MODULE__)
|
||||||
|
|
||||||
|
|
||||||
|
static void PyBreakpoint_DeAlloc ( PyBreakpoint* self )
|
||||||
|
{
|
||||||
|
trace << "PySingletonObject_DeAlloc(" << hex << self << ")" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static PyObject* PyBreakpoint_stop ( PyObject*, PyObject *args )
|
||||||
|
{
|
||||||
|
trace << "PyBreakpoint_stop()" << endl;
|
||||||
|
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
HTRY
|
||||||
|
PyObject* arg0;
|
||||||
|
PyObject* arg1;
|
||||||
|
if ( not ParseTwoArg ( "Breakpoint::stop()", args, ":int:string", &arg0, &arg1) ) return NULL;
|
||||||
|
|
||||||
|
result = Breakpoint::stop( (unsigned int)PyInt_AsLong (arg0)
|
||||||
|
, PyString_AsString(arg1)
|
||||||
|
);
|
||||||
|
HCATCH
|
||||||
|
|
||||||
|
if ( result ) Py_RETURN_TRUE;
|
||||||
|
Py_RETURN_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static PyObject* PyBreakpoint_setStopLevel ( PyObject*, PyObject* args )
|
||||||
|
{
|
||||||
|
trace << "PyBreakpoint_setStopLevel()" << endl;
|
||||||
|
|
||||||
|
|
||||||
|
HTRY
|
||||||
|
|
||||||
|
PyObject* arg0;
|
||||||
|
if ( not ParseOneArg ( "Breakpoint::setStopLevel()", args, ":int", &arg0) ) return NULL;
|
||||||
|
|
||||||
|
Breakpoint::setStopLevel ( (unsigned int)PyInt_AsLong(arg0) );
|
||||||
|
|
||||||
|
HCATCH
|
||||||
|
|
||||||
|
Py_RETURN_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static PyObject* PyBreakpoint_getStopLevel ( PyObject* )
|
||||||
|
{
|
||||||
|
trace << "PyBreakpoint_getStopLevel()" << endl;
|
||||||
|
|
||||||
|
return Py_BuildValue ( "i", Breakpoint::getStopLevel() );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PyMethodDef PyBreakpoint_Methods[] =
|
||||||
|
{ { "stop" , (PyCFunction)PyBreakpoint_stop, METH_VARARGS|METH_CLASS
|
||||||
|
, "Sets a breakpoint of the given level." }
|
||||||
|
, { "setStopLevel", (PyCFunction)PyBreakpoint_setStopLevel, METH_VARARGS|METH_CLASS
|
||||||
|
, "Sets the level below which breakpoints will be ignoreds." }
|
||||||
|
, { "getStopLevel", (PyCFunction)PyBreakpoint_getStopLevel, METH_NOARGS|METH_CLASS
|
||||||
|
, "Returns the level below which breakpoints will be ignoreds." }
|
||||||
|
, {NULL, NULL, 0, NULL} /* sentinel */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
PyTypeObjectLinkPyTypeWithoutObject(Breakpoint,Breakpoint)
|
||||||
|
|
||||||
|
|
||||||
|
// extern void PyBreakpoint_LinkPyType()
|
||||||
|
// {
|
||||||
|
// trace << "PyBreakpoint_LinkType()" << endl;
|
||||||
|
|
||||||
|
// PyTypeBreakpoint.tp_new = (newfunc) PyType_GenericNew;
|
||||||
|
// PyTypeBreakpoint.tp_dealloc = (destructor)PyBreakpoint_DeAlloc;
|
||||||
|
// PyTypeBreakpoint.tp_methods = PyBreakpoint_Methods;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
#else // End of Python Module Code Part.
|
||||||
|
|
||||||
|
|
||||||
|
// x=================================================================x
|
||||||
|
// | "PyBreakpoint" Shared Library Code Part |
|
||||||
|
// x=================================================================x
|
||||||
|
|
||||||
|
|
||||||
|
PyTypeObjectDefinitions(Breakpoint)
|
||||||
|
|
||||||
|
|
||||||
|
# endif // End of Shared Library Code Part.
|
||||||
|
|
||||||
|
|
||||||
|
} // End of extern "C".
|
||||||
|
|
||||||
|
|
||||||
|
} // End of Isobar namespace.
|
||||||
|
|
|
@ -0,0 +1,137 @@
|
||||||
|
|
||||||
|
// -*- C++ -*-
|
||||||
|
//
|
||||||
|
// This file is part of the Coriolis Software.
|
||||||
|
// Copyright (c) UPMC/LIP6 2010-2010, All Rights Reserved
|
||||||
|
//
|
||||||
|
// ===================================================================
|
||||||
|
//
|
||||||
|
// $Id$
|
||||||
|
//
|
||||||
|
// x-----------------------------------------------------------------x
|
||||||
|
// | |
|
||||||
|
// | C O R I O L I S |
|
||||||
|
// | I s o b a r - Hurricane / Python Interface |
|
||||||
|
// | |
|
||||||
|
// | Author : Jean-Paul CHAPUT |
|
||||||
|
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||||
|
// | =============================================================== |
|
||||||
|
// | C++ Module : "./PyCellViewer.cpp" |
|
||||||
|
// | *************************************************************** |
|
||||||
|
// | U p d a t e s |
|
||||||
|
// | |
|
||||||
|
// x-----------------------------------------------------------------x
|
||||||
|
|
||||||
|
|
||||||
|
#include "hurricane/isobar/PyCell.h"
|
||||||
|
#include "hurricane/isobar/PyCellViewer.h"
|
||||||
|
#include "hurricane/viewer/CellWidget.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Isobar {
|
||||||
|
|
||||||
|
using namespace Hurricane;
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
|
||||||
|
#define METHOD_HEAD(function) GENERIC_METHOD_HEAD(CellViewer,cw,function)
|
||||||
|
|
||||||
|
|
||||||
|
// x=================================================================x
|
||||||
|
// | "PyCellViewer" Python Module Code Part |
|
||||||
|
// x=================================================================x
|
||||||
|
|
||||||
|
#if defined(__PYTHON_MODULE__)
|
||||||
|
|
||||||
|
|
||||||
|
// Standart Destroy (Attribute).
|
||||||
|
DirectDestroyAttribute(PyCellViewer_destroy, PyCellViewer)
|
||||||
|
|
||||||
|
|
||||||
|
static PyObject* PyCellViewer_getCell ( PyCellViewer* self )
|
||||||
|
{
|
||||||
|
trace << "PyCellViewer_getCell ()" << endl;
|
||||||
|
|
||||||
|
Cell* cell = NULL;
|
||||||
|
|
||||||
|
HTRY
|
||||||
|
METHOD_HEAD("CellViewer.getCell()")
|
||||||
|
|
||||||
|
cell = cw->getCell ();
|
||||||
|
HCATCH
|
||||||
|
|
||||||
|
if ( cell == NULL ) Py_RETURN_NONE;
|
||||||
|
|
||||||
|
return PyCell_Link(cell);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static PyObject* PyCellViewer_setCell ( PyCellViewer* self, PyObject* args )
|
||||||
|
{
|
||||||
|
trace << "PyCellViewer_setCell ()" << endl;
|
||||||
|
|
||||||
|
HTRY
|
||||||
|
METHOD_HEAD("CellViewer.setCell()")
|
||||||
|
|
||||||
|
PyCell* cell;
|
||||||
|
if ( not ParseOneArg("CellViewer.setCell()",args,CELL_ARG,(PyObject**)&cell) ) return NULL;
|
||||||
|
|
||||||
|
cw->setCell ( PYCELL_O(cell) );
|
||||||
|
HCATCH
|
||||||
|
|
||||||
|
Py_RETURN_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static PyObject* PyCellViewer_fit ( PyCellViewer* self )
|
||||||
|
{
|
||||||
|
trace << "PyCellViewer_fit()" << endl;
|
||||||
|
|
||||||
|
HTRY
|
||||||
|
METHOD_HEAD("CellViewer.fit()")
|
||||||
|
cw->getCellWidget()->fitToContents();
|
||||||
|
HCATCH
|
||||||
|
|
||||||
|
Py_RETURN_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------
|
||||||
|
// PyCellViewer Attribute Method table.
|
||||||
|
|
||||||
|
PyMethodDef PyCellViewer_Methods[] =
|
||||||
|
{ { "getCell" , (PyCFunction)PyCellViewer_getCell , METH_NOARGS
|
||||||
|
, "Return the currently edited Cell." }
|
||||||
|
, { "setCell" , (PyCFunction)PyCellViewer_setCell , METH_VARARGS
|
||||||
|
, "Load a Cell into the viewer." }
|
||||||
|
, { "fit" , (PyCFunction)PyCellViewer_fit , METH_NOARGS
|
||||||
|
, "Fit the contents to the viewer's visible area." }
|
||||||
|
, { "destroy" , (PyCFunction)PyCellViewer_destroy , METH_NOARGS
|
||||||
|
, "Destroy the associated hurricane object. The python object remains." }
|
||||||
|
, {NULL, NULL, 0, NULL} /* sentinel */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
PythonOnlyDeleteMethod(CellViewer)
|
||||||
|
PyTypeObjectLinkPyType(CellViewer)
|
||||||
|
|
||||||
|
|
||||||
|
#else // End of Python Module Code Part.
|
||||||
|
|
||||||
|
|
||||||
|
// x=================================================================x
|
||||||
|
// | "PyCellViewer" Shared Library Code Part |
|
||||||
|
// x=================================================================x
|
||||||
|
|
||||||
|
|
||||||
|
PyTypeObjectDefinitions(CellViewer)
|
||||||
|
|
||||||
|
|
||||||
|
# endif // End of Shared Library Code Part.
|
||||||
|
|
||||||
|
|
||||||
|
} // End of extern "C".
|
||||||
|
|
||||||
|
|
||||||
|
} // End of Isobar namespace.
|
|
@ -138,13 +138,16 @@ extern "C" {
|
||||||
&PyTypeNet, &pyNet, &PyTypeLayer, &pyLayer,
|
&PyTypeNet, &pyNet, &PyTypeLayer, &pyLayer,
|
||||||
&x, &y, &width, &height)) {
|
&x, &y, &width, &height)) {
|
||||||
contact = Contact::create(PYNET_O(pyNet), PYLAYER_O(pyLayer), x, y, width, height);
|
contact = Contact::create(PYNET_O(pyNet), PYLAYER_O(pyLayer), x, y, width, height);
|
||||||
} else if (PyArg_ParseTuple(args, "O!O!ll|ll:Contact.create",
|
} else {
|
||||||
|
PyErr_Clear ();
|
||||||
|
if (PyArg_ParseTuple(args, "O!O!ll|ll:Contact.create",
|
||||||
&PyTypeComponent, &pyComponent, &PyTypeLayer, &pyLayer,
|
&PyTypeComponent, &pyComponent, &PyTypeLayer, &pyLayer,
|
||||||
&x, &y, &width, &height)) {
|
&x, &y, &width, &height)) {
|
||||||
contact = Contact::create(PYCOMPONENT_O(pyComponent), PYLAYER_O(pyLayer), x, y, width, height);
|
contact = Contact::create(PYCOMPONENT_O(pyComponent), PYLAYER_O(pyLayer), x, y, width, height);
|
||||||
} else {
|
} else {
|
||||||
PyErr_SetString ( ConstructorError, "invalid number of parameters for Contact constructor." );
|
PyErr_SetString ( ConstructorError, "invalid number of parameters for Contact constructor." );
|
||||||
return ( NULL );
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "hurricane/isobar/PyHurricane.h"
|
#include "hurricane/isobar/PyHurricane.h"
|
||||||
|
#include "hurricane/isobar/PyBreakpoint.h"
|
||||||
#include "hurricane/isobar/PyUpdateSession.h"
|
#include "hurricane/isobar/PyUpdateSession.h"
|
||||||
#include "hurricane/isobar/PyDbU.h"
|
#include "hurricane/isobar/PyDbU.h"
|
||||||
#include "hurricane/isobar/PyPoint.h"
|
#include "hurricane/isobar/PyPoint.h"
|
||||||
|
@ -73,6 +74,7 @@
|
||||||
#include "hurricane/isobar/PyReferenceCollection.h"
|
#include "hurricane/isobar/PyReferenceCollection.h"
|
||||||
#include "hurricane/isobar/PyNet.h"
|
#include "hurricane/isobar/PyNet.h"
|
||||||
#include "hurricane/isobar/PyNetCollection.h"
|
#include "hurricane/isobar/PyNetCollection.h"
|
||||||
|
#include "hurricane/isobar/PyNetExternalComponents.h"
|
||||||
#include "hurricane/isobar/PyHyperNet.h"
|
#include "hurricane/isobar/PyHyperNet.h"
|
||||||
#include "hurricane/isobar/PyComponent.h"
|
#include "hurricane/isobar/PyComponent.h"
|
||||||
#include "hurricane/isobar/PyComponentCollection.h"
|
#include "hurricane/isobar/PyComponentCollection.h"
|
||||||
|
@ -470,31 +472,6 @@ extern "C" {
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
// ---------------------------------------------------------------
|
|
||||||
// Attribute Method : "PyNetExternalComponents_getNetExternalComponents ()"
|
|
||||||
|
|
||||||
PyObject* PyNetExternalComponents_getExternalComponents ( PyObject* module, PyObject* args )
|
|
||||||
{
|
|
||||||
trace << "PyNetExternalComponents_getExternalComponents()" << endl;
|
|
||||||
|
|
||||||
PyObject* arg0;
|
|
||||||
if ( ! ParseOneArg ( "getExternalComponents", args, ":ent", &arg0) ) return ( NULL );
|
|
||||||
|
|
||||||
PyComponentCollection* pyComponentCollection = NULL;
|
|
||||||
|
|
||||||
HTRY
|
|
||||||
|
|
||||||
Components* components = new Components(NetExternalComponents::get(PYNET_O(arg0)));
|
|
||||||
|
|
||||||
pyComponentCollection = PyObject_NEW(PyComponentCollection, &PyTypeComponentCollection);
|
|
||||||
if (pyComponentCollection == NULL) { return NULL; }
|
|
||||||
|
|
||||||
pyComponentCollection->_object = components;
|
|
||||||
|
|
||||||
HCATCH
|
|
||||||
|
|
||||||
return ((PyObject*)pyComponentCollection);
|
|
||||||
}
|
|
||||||
|
|
||||||
// x-------------------------------------------------------------x
|
// x-------------------------------------------------------------x
|
||||||
// | "PyHurricane" Module Methods |
|
// | "PyHurricane" Module Methods |
|
||||||
|
@ -512,8 +489,6 @@ extern "C" {
|
||||||
, { "Point" , PyPoint_create , METH_VARARGS, "Creates a new Point." }
|
, { "Point" , PyPoint_create , METH_VARARGS, "Creates a new Point." }
|
||||||
, { "Box" , PyBox_create , METH_VARARGS, "Creates a new Box." }
|
, { "Box" , PyBox_create , METH_VARARGS, "Creates a new Box." }
|
||||||
, { "Transformation" , PyTransformation_create , METH_VARARGS, "Creates a new Transformation." }
|
, { "Transformation" , PyTransformation_create , METH_VARARGS, "Creates a new Transformation." }
|
||||||
, { "UpdateSession_open" , (PyCFunction)PyUpdateSession_open , METH_NOARGS , "Opens an update session." }
|
|
||||||
, { "UpdateSession_close" , (PyCFunction)PyUpdateSession_close , METH_NOARGS , "Closes an update session." }
|
|
||||||
, { "DataBase" , (PyCFunction)PyDataBase_create , METH_NOARGS , "Creates the DataBase." }
|
, { "DataBase" , (PyCFunction)PyDataBase_create , METH_NOARGS , "Creates the DataBase." }
|
||||||
, { "getDataBase" , (PyCFunction)PyDataBase_getDataBase , METH_NOARGS , "Gets the current DataBase." }
|
, { "getDataBase" , (PyCFunction)PyDataBase_getDataBase , METH_NOARGS , "Gets the current DataBase." }
|
||||||
, { "Library" , (PyCFunction)PyLibrary_create , METH_VARARGS, "Creates a new Library." }
|
, { "Library" , (PyCFunction)PyLibrary_create , METH_VARARGS, "Creates a new Library." }
|
||||||
|
@ -530,7 +505,6 @@ extern "C" {
|
||||||
, { "Pad" , (PyCFunction)PyPad_create , METH_VARARGS, "Creates a new Pad." }
|
, { "Pad" , (PyCFunction)PyPad_create , METH_VARARGS, "Creates a new Pad." }
|
||||||
, { "Path" , (PyCFunction)PyPath_create , METH_VARARGS, "Creates a new Path." }
|
, { "Path" , (PyCFunction)PyPath_create , METH_VARARGS, "Creates a new Path." }
|
||||||
, { "Occurrence" , (PyCFunction)PyOccurrence_create , METH_VARARGS, "Creates a new Occurrence." }
|
, { "Occurrence" , (PyCFunction)PyOccurrence_create , METH_VARARGS, "Creates a new Occurrence." }
|
||||||
, { "getExternalComponents" , (PyCFunction)PyNetExternalComponents_getExternalComponents, METH_VARARGS, "Returns the components collection of an external net" }
|
|
||||||
, {NULL, NULL, 0, NULL} /* sentinel */
|
, {NULL, NULL, 0, NULL} /* sentinel */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -543,6 +517,7 @@ extern "C" {
|
||||||
DL_EXPORT(void) initHurricane () {
|
DL_EXPORT(void) initHurricane () {
|
||||||
trace << "initHurricane()" << endl;
|
trace << "initHurricane()" << endl;
|
||||||
|
|
||||||
|
PyUpdateSession_LinkPyType ();
|
||||||
PyPoint_LinkPyType ();
|
PyPoint_LinkPyType ();
|
||||||
PyBox_LinkPyType ();
|
PyBox_LinkPyType ();
|
||||||
PyTransformation_LinkPyType ();
|
PyTransformation_LinkPyType ();
|
||||||
|
@ -556,7 +531,7 @@ extern "C" {
|
||||||
PyInstanceCollection_LinkPyType ();
|
PyInstanceCollection_LinkPyType ();
|
||||||
PyPlugCollection_LinkPyType ();
|
PyPlugCollection_LinkPyType ();
|
||||||
PyNetCollection_LinkPyType ();
|
PyNetCollection_LinkPyType ();
|
||||||
PyNetCollection_LinkPyType ();
|
PyNetExternalComponents_LinkPyType ();
|
||||||
PyCellCollection_LinkPyType ();
|
PyCellCollection_LinkPyType ();
|
||||||
PyPinCollection_LinkPyType ();
|
PyPinCollection_LinkPyType ();
|
||||||
PySegmentCollection_LinkPyType ();
|
PySegmentCollection_LinkPyType ();
|
||||||
|
@ -577,7 +552,9 @@ extern "C" {
|
||||||
PyPin_LinkPyType ();
|
PyPin_LinkPyType ();
|
||||||
PyPlug_LinkPyType ();
|
PyPlug_LinkPyType ();
|
||||||
PyCellViewer_LinkPyType ();
|
PyCellViewer_LinkPyType ();
|
||||||
|
PyBreakpoint_LinkPyType ();
|
||||||
|
|
||||||
|
PYTYPE_READY ( UpdateSession )
|
||||||
PYTYPE_READY ( Point )
|
PYTYPE_READY ( Point )
|
||||||
PYTYPE_READY ( Box )
|
PYTYPE_READY ( Box )
|
||||||
PYTYPE_READY ( Transformation )
|
PYTYPE_READY ( Transformation )
|
||||||
|
@ -608,6 +585,8 @@ extern "C" {
|
||||||
PYTYPE_READY ( ReferenceCollectionLocator )
|
PYTYPE_READY ( ReferenceCollectionLocator )
|
||||||
PYTYPE_READY ( HyperNet )
|
PYTYPE_READY ( HyperNet )
|
||||||
PYTYPE_READY ( CellViewer )
|
PYTYPE_READY ( CellViewer )
|
||||||
|
PYTYPE_READY ( NetExternalComponents )
|
||||||
|
PYTYPE_READY ( Breakpoint )
|
||||||
|
|
||||||
PYTYPE_READY_SUB ( Cell , Entity )
|
PYTYPE_READY_SUB ( Cell , Entity )
|
||||||
PYTYPE_READY_SUB ( Instance , Entity )
|
PYTYPE_READY_SUB ( Instance , Entity )
|
||||||
|
@ -674,7 +653,14 @@ extern "C" {
|
||||||
<< " Failed to initialize Hurricane module." << endl;
|
<< " Failed to initialize Hurricane module." << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//PyModule_AddObject(module, "Box", (PyObject*)&PyTypeBox); // To add Hurricane.Box type in module -> the Hurricane.Box() method must be renamed
|
|
||||||
|
Py_INCREF ( &PyTypeNetExternalComponents );
|
||||||
|
PyModule_AddObject ( module, "NetExternalComponents", (PyObject*)&PyTypeNetExternalComponents );
|
||||||
|
Py_INCREF ( &PyTypeUpdateSession );
|
||||||
|
PyModule_AddObject ( module, "UpdateSession", (PyObject*)&PyTypeUpdateSession );
|
||||||
|
Py_INCREF ( &PyTypeBreakpoint );
|
||||||
|
PyModule_AddObject ( module, "Breakpoint", (PyObject*)&PyTypeBreakpoint );
|
||||||
|
|
||||||
|
|
||||||
PyObject* dictionnary = PyModule_GetDict ( module );
|
PyObject* dictionnary = PyModule_GetDict ( module );
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,133 @@
|
||||||
|
|
||||||
|
// -*- C++ -*-
|
||||||
|
//
|
||||||
|
// This file is part of the Coriolis Software.
|
||||||
|
// Copyright (c) UPMC/LIP6 2010-2010, All Rights Reserved
|
||||||
|
//
|
||||||
|
// x-----------------------------------------------------------------x
|
||||||
|
// | |
|
||||||
|
// | C O R I O L I S |
|
||||||
|
// | I s o b a r - Hurricane / Python Interface |
|
||||||
|
// | |
|
||||||
|
// | Author : Jean-Paul CHAPUT |
|
||||||
|
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||||
|
// | =============================================================== |
|
||||||
|
// | C++ Module : "./PyNetExternalComponents.cpp" |
|
||||||
|
// | *************************************************************** |
|
||||||
|
// | U p d a t e s |
|
||||||
|
// | |
|
||||||
|
// x-----------------------------------------------------------------x
|
||||||
|
|
||||||
|
|
||||||
|
#include "hurricane/isobar/PyNet.h"
|
||||||
|
#include "hurricane/isobar/PyComponent.h"
|
||||||
|
#include "hurricane/isobar/PyComponentCollection.h"
|
||||||
|
#include "hurricane/isobar/PyNetExternalComponents.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Isobar {
|
||||||
|
|
||||||
|
using namespace Hurricane;
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
|
||||||
|
#define METHOD_HEAD(function) GENERIC_METHOD_HEAD(NetExternalComponents,property,function)
|
||||||
|
|
||||||
|
|
||||||
|
// x=================================================================x
|
||||||
|
// | "PyNetExternalComponents" Python Module Code Part |
|
||||||
|
// x=================================================================x
|
||||||
|
|
||||||
|
#if defined(__PYTHON_MODULE__)
|
||||||
|
|
||||||
|
|
||||||
|
static void PyNetExternalComponents_DeAlloc ( PyNetExternalComponents* self )
|
||||||
|
{
|
||||||
|
trace << "PySingletonObject_DeAlloc(" << hex << self << ")" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static PyObject* PyNetExternalComponents_isExternal ( PyObject*, PyObject *args )
|
||||||
|
{
|
||||||
|
trace << "PyNetExternalComponents_isExternal()" << endl;
|
||||||
|
|
||||||
|
bool isExternal = false;
|
||||||
|
|
||||||
|
HTRY
|
||||||
|
PyObject* arg0;
|
||||||
|
if ( not ParseOneArg ( "NetExternalComponents.isExternal()", args, COMP_ARG, &arg0) ) return NULL;
|
||||||
|
|
||||||
|
isExternal = NetExternalComponents::isExternal(PYCOMPONENT_O(arg0));
|
||||||
|
HCATCH
|
||||||
|
|
||||||
|
if ( isExternal ) Py_RETURN_TRUE;
|
||||||
|
Py_RETURN_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static PyObject* PyNetExternalComponents_get ( PyObject*, PyObject* args )
|
||||||
|
{
|
||||||
|
trace << "PyNetExternalComponents_getExternalComponents()" << endl;
|
||||||
|
|
||||||
|
PyObject* arg0;
|
||||||
|
|
||||||
|
PyComponentCollection* pyComponentCollection = NULL;
|
||||||
|
|
||||||
|
HTRY
|
||||||
|
|
||||||
|
if ( not ParseOneArg ( "getExternalComponents", args, ":ent", &arg0) ) return NULL;
|
||||||
|
Components* components = new Components(NetExternalComponents::get(PYNET_O(arg0)));
|
||||||
|
|
||||||
|
pyComponentCollection = PyObject_NEW(PyComponentCollection, &PyTypeComponentCollection);
|
||||||
|
if (pyComponentCollection == NULL) { return NULL; }
|
||||||
|
|
||||||
|
pyComponentCollection->_object = components;
|
||||||
|
|
||||||
|
HCATCH
|
||||||
|
|
||||||
|
return (PyObject*)pyComponentCollection;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PyMethodDef PyNetExternalComponents_Methods[] =
|
||||||
|
{ { "isExternal", (PyCFunction)PyNetExternalComponents_isExternal, METH_VARARGS|METH_CLASS
|
||||||
|
, "Tells if Component belong to the externals of the Net." }
|
||||||
|
, { "get" , (PyCFunction)PyNetExternalComponents_get , METH_VARARGS|METH_CLASS
|
||||||
|
, "Returns the Collection of external components of the Net." }
|
||||||
|
, {NULL, NULL, 0, NULL} /* sentinel */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
PyTypeObjectLinkPyTypeWithoutObject(NetExternalComponents,NetExternalComponents)
|
||||||
|
|
||||||
|
|
||||||
|
// extern void PyNetExternalComponents_LinkPyType()
|
||||||
|
// {
|
||||||
|
// trace << "PyNetExternalComponents_LinkType()" << endl;
|
||||||
|
|
||||||
|
// PyTypeNetExternalComponents.tp_new = (newfunc) PyType_GenericNew;
|
||||||
|
// PyTypeNetExternalComponents.tp_dealloc = (destructor)PyNetExternalComponents_DeAlloc;
|
||||||
|
// PyTypeNetExternalComponents.tp_methods = PyNetExternalComponents_Methods;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
#else // End of Python Module Code Part.
|
||||||
|
|
||||||
|
|
||||||
|
// x=================================================================x
|
||||||
|
// | "PyNetExternalComponents" Shared Library Code Part |
|
||||||
|
// x=================================================================x
|
||||||
|
|
||||||
|
|
||||||
|
PyTypeObjectDefinitions(NetExternalComponents)
|
||||||
|
|
||||||
|
|
||||||
|
# endif // End of Shared Library Code Part.
|
||||||
|
|
||||||
|
|
||||||
|
} // End of extern "C".
|
||||||
|
|
||||||
|
|
||||||
|
} // End of Isobar namespace.
|
||||||
|
|
|
@ -1,39 +1,8 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Project.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
// Copyright (c) UPMC/LIP6 2010-2010, All Rights Reserved
|
||||||
// Universite Pierre et Marie Curie
|
|
||||||
//
|
|
||||||
// Main contributors :
|
|
||||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
|
||||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
|
||||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
|
||||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
|
||||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
|
||||||
// Christian Masson <Christian.Masson@lip6.fr>
|
|
||||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
|
||||||
//
|
|
||||||
// The Coriolis Project 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.
|
|
||||||
//
|
|
||||||
// The Coriolis Project 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 the Coriolis Project; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
||||||
// USA
|
|
||||||
//
|
|
||||||
// License-Tag
|
|
||||||
// Authors-Tag
|
|
||||||
// ===================================================================
|
|
||||||
//
|
|
||||||
// $Id: PyUpdateSession.cpp,v 1.12 2006/07/19 14:00:05 xtof Exp $
|
|
||||||
//
|
//
|
||||||
// x-----------------------------------------------------------------x
|
// x-----------------------------------------------------------------x
|
||||||
// | |
|
// | |
|
||||||
|
@ -49,6 +18,7 @@
|
||||||
// | |
|
// | |
|
||||||
// x-----------------------------------------------------------------x
|
// x-----------------------------------------------------------------x
|
||||||
|
|
||||||
|
|
||||||
#include "hurricane/isobar/PyUpdateSession.h"
|
#include "hurricane/isobar/PyUpdateSession.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,6 +29,9 @@ using namespace Hurricane;
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
|
|
||||||
|
#define METHOD_HEAD(function) GENERIC_METHOD_HEAD(UpdateSession,session,function)
|
||||||
|
|
||||||
|
|
||||||
// x=================================================================x
|
// x=================================================================x
|
||||||
// | "PyUpdateSession" Python Module Code Part |
|
// | "PyUpdateSession" Python Module Code Part |
|
||||||
// x=================================================================x
|
// x=================================================================x
|
||||||
|
@ -66,15 +39,14 @@ extern "C" {
|
||||||
#if defined(__PYTHON_MODULE__)
|
#if defined(__PYTHON_MODULE__)
|
||||||
|
|
||||||
|
|
||||||
// x-------------------------------------------------------------x
|
static void PyUpdateSession_DeAlloc ( PyUpdateSession* self )
|
||||||
// | "PyUpdateSession" General Methods |
|
{
|
||||||
// x-------------------------------------------------------------x
|
trace << "PyUpdateSession_DeAlloc(" << hex << self << ")" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------
|
static PyObject* PyUpdateSession_open ( PyObject* )
|
||||||
// Attribute Method : "PyUpdateSession_open ()"
|
{
|
||||||
|
|
||||||
extern PyObject* PyUpdateSession_open ( PyObject* module ) {
|
|
||||||
trace << "PyUpdateSession_open()" << endl;
|
trace << "PyUpdateSession_open()" << endl;
|
||||||
|
|
||||||
HTRY
|
HTRY
|
||||||
|
@ -85,12 +57,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static PyObject* PyUpdateSession_close ( PyObject* )
|
||||||
|
|
||||||
// ---------------------------------------------------------------
|
|
||||||
// Attribute Method : "PyUpdateSession_close()"
|
|
||||||
|
|
||||||
extern PyObject* PyUpdateSession_close( PyObject* module )
|
|
||||||
{
|
{
|
||||||
trace << "PyUpdateSession_close()" << endl;
|
trace << "PyUpdateSession_close()" << endl;
|
||||||
|
|
||||||
|
@ -101,6 +68,19 @@ extern "C" {
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PyMethodDef PyUpdateSession_Methods[] =
|
||||||
|
{ { "open" , (PyCFunction)PyUpdateSession_open, METH_NOARGS|METH_CLASS
|
||||||
|
, "Opens a new Update Session." }
|
||||||
|
, { "close" , (PyCFunction)PyUpdateSession_close, METH_NOARGS|METH_CLASS
|
||||||
|
, "Closes an Update Session." }
|
||||||
|
, {NULL, NULL, 0, NULL} /* sentinel */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
PyTypeObjectLinkPyTypeWithoutObject(UpdateSession,UpdateSession)
|
||||||
|
|
||||||
|
|
||||||
#else // End of Python Module Code Part.
|
#else // End of Python Module Code Part.
|
||||||
|
|
||||||
|
|
||||||
|
@ -109,13 +89,14 @@ extern "C" {
|
||||||
// x=================================================================x
|
// x=================================================================x
|
||||||
|
|
||||||
|
|
||||||
#endif
|
PyTypeObjectDefinitions(UpdateSession)
|
||||||
|
|
||||||
|
|
||||||
|
# endif // End of Shared Library Code Part.
|
||||||
|
|
||||||
|
|
||||||
} // End of extern "C".
|
} // End of extern "C".
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // End of Isobar namespace.
|
} // End of Isobar namespace.
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
|
||||||
|
// -*- C++ -*-
|
||||||
|
//
|
||||||
|
// This file is part of the Coriolis Software.
|
||||||
|
// Copyright (c) UPMC/LIP6 2010-2010, All Rights Reserved
|
||||||
|
//
|
||||||
|
// x-----------------------------------------------------------------x
|
||||||
|
// | |
|
||||||
|
// | C O R I O L I S |
|
||||||
|
// | I s o b a r - Hurricane / Python Interface |
|
||||||
|
// | |
|
||||||
|
// | Author : Jean-Paul CHAPUT |
|
||||||
|
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||||
|
// | =============================================================== |
|
||||||
|
// | C++ Header : "./PyBreakpoint.h" |
|
||||||
|
// | *************************************************************** |
|
||||||
|
// | U p d a t e s |
|
||||||
|
// | |
|
||||||
|
// x-----------------------------------------------------------------x
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# ifndef __PY_BREAKPOINT__
|
||||||
|
# define __PY_BREAKPOINT__
|
||||||
|
|
||||||
|
|
||||||
|
#include "hurricane/isobar/PyHurricane.h"
|
||||||
|
#include "hurricane/Breakpoint.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Isobar {
|
||||||
|
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Python Object : "PyBreakpoint".
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
PyObject_HEAD
|
||||||
|
} PyBreakpoint;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Functions & Types exported to "PyHurricane.cpp".
|
||||||
|
|
||||||
|
extern PyTypeObject PyTypeBreakpoint;
|
||||||
|
extern PyMethodDef PyBreakpoint_Methods[];
|
||||||
|
|
||||||
|
extern void PyBreakpoint_LinkPyType ();
|
||||||
|
|
||||||
|
|
||||||
|
#define IsPyBreakpoint(v) ( (v)->ob_type == &PyTypeBreakpoint )
|
||||||
|
#define PYBREAKPOINT(v) ( (PyBreakpoint*)(v) )
|
||||||
|
#define PYBREAKPOINT_O(v) ( PY_BREAKPOINT(v)->_object )
|
||||||
|
|
||||||
|
|
||||||
|
} // End of extern "C".
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // End of Isobar namespace.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# endif
|
|
@ -0,0 +1,68 @@
|
||||||
|
|
||||||
|
// -*- C++ -*-
|
||||||
|
//
|
||||||
|
// This file is part of the Coriolis Software.
|
||||||
|
// Copyright (c) UPMC/LIP6 2010-2010, All Rights Reserved
|
||||||
|
//
|
||||||
|
// ===================================================================
|
||||||
|
//
|
||||||
|
// $Id$
|
||||||
|
//
|
||||||
|
// x-----------------------------------------------------------------x
|
||||||
|
// | |
|
||||||
|
// | C O R I O L I S |
|
||||||
|
// | I s o b a r - Hurricane / Python Interface |
|
||||||
|
// | |
|
||||||
|
// | Author : Jean-Paul CHAPUT |
|
||||||
|
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||||
|
// | =============================================================== |
|
||||||
|
// | C++ Header : "./PyCellViewer.cpp" |
|
||||||
|
// | *************************************************************** |
|
||||||
|
// | U p d a t e s |
|
||||||
|
// | |
|
||||||
|
// x-----------------------------------------------------------------x
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __ISOBAR_CELL_VIEWER__
|
||||||
|
#define __ISOBAR_CELL_VIEWER__
|
||||||
|
|
||||||
|
#include "hurricane/isobar/PyHurricane.h"
|
||||||
|
#include "hurricane/viewer/CellViewer.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Isobar {
|
||||||
|
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Python Object : "PyCellViewer".
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
PyObject_HEAD
|
||||||
|
Hurricane::CellViewer* _object;
|
||||||
|
} PyCellViewer;
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Functions & Types exported to "PyHurricane.cpp".
|
||||||
|
|
||||||
|
extern PyTypeObject PyTypeCellViewer;
|
||||||
|
extern PyMethodDef PyCellViewer_Methods[];
|
||||||
|
|
||||||
|
extern PyObject* PyCellViewer_create ( PyObject* self, PyObject* args );
|
||||||
|
extern void PyCellViewer_LinkPyType ();
|
||||||
|
|
||||||
|
|
||||||
|
#define IsPyCellViewer(v) ( (v)->ob_type == &PyTypeCellViewer )
|
||||||
|
#define ISOBARCELLVIEWER(v) ( (PyCellViewer*)(v) )
|
||||||
|
#define ISOBARCELLVIEWER_O(v) ( ISOBAR_CELL_VIEWER(v)->_object )
|
||||||
|
|
||||||
|
|
||||||
|
} // End of extern "C".
|
||||||
|
|
||||||
|
|
||||||
|
} // End of Isobar namespace.
|
||||||
|
|
||||||
|
|
||||||
|
#endif // __ISOBAR_CELL_VIEWER__
|
|
@ -143,6 +143,7 @@ extern "C" {
|
||||||
#define NET_LAYER_INTS2_ARG ":ent:layer:int:int"
|
#define NET_LAYER_INTS2_ARG ":ent:layer:int:int"
|
||||||
#define NET_LAYER_INTS3_ARG ":ent:layer:int:int:int"
|
#define NET_LAYER_INTS3_ARG ":ent:layer:int:int:int"
|
||||||
#define NET_LAYER_INTS4_ARG ":ent:layer:int:int:int:int"
|
#define NET_LAYER_INTS4_ARG ":ent:layer:int:int:int:int"
|
||||||
|
#define COMP_ARG ":comp"
|
||||||
#define COMP_LAYER_INTS2_ARG ":comp:layer:int:int"
|
#define COMP_LAYER_INTS2_ARG ":comp:layer:int:int"
|
||||||
#define COMP_LAYER_INTS3_ARG ":comp:layer:int:int:int"
|
#define COMP_LAYER_INTS3_ARG ":comp:layer:int:int:int"
|
||||||
#define COMP_LAYER_INTS4_ARG ":comp:layer:int:int:int:int"
|
#define COMP_LAYER_INTS4_ARG ":comp:layer:int:int:int:int"
|
||||||
|
@ -176,6 +177,11 @@ extern "C" {
|
||||||
PyDict_SetItemString ( dictionnary, CONSTANT_NAME, constant ); \
|
PyDict_SetItemString ( dictionnary, CONSTANT_NAME, constant ); \
|
||||||
Py_DECREF ( constant );
|
Py_DECREF ( constant );
|
||||||
|
|
||||||
|
#define LoadObjectConstant(DICTIONARY,CONSTANT_VALUE,CONSTANT_NAME) \
|
||||||
|
constant = PyInt_FromLong ( (long)CONSTANT_VALUE ); \
|
||||||
|
PyDict_SetItemString ( DICTIONARY, CONSTANT_NAME, constant ); \
|
||||||
|
Py_DECREF ( constant );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -253,18 +259,18 @@ extern "C" {
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Attribute Method Macro For Booleans.
|
// Attribute Method Macro For Booleans.
|
||||||
|
|
||||||
#define DirectSetBoolAttribute(PY_FUNC_NAME,FUNC_NAME,PY_FORMAT,PY_SELF_TYPE,SELF_TYPE) \
|
#define DirectSetBoolAttribute(PY_FUNC_NAME,FUNC_NAME,STR_FUNC_NAME,PY_SELF_TYPE,SELF_TYPE) \
|
||||||
static PyObject* PY_FUNC_NAME ( PY_SELF_TYPE *self, PyObject* args ) \
|
static PyObject* PY_FUNC_NAME ( PY_SELF_TYPE *self, PyObject* args ) \
|
||||||
{ \
|
{ \
|
||||||
GENERIC_METHOD_HEAD(SELF_TYPE,cobject,"DirectSetBoolAttribute()") \
|
GENERIC_METHOD_HEAD(SELF_TYPE,cobject,STR_FUNC_NAME "()") \
|
||||||
\
|
\
|
||||||
|
HTRY \
|
||||||
PyObject* arg0; \
|
PyObject* arg0; \
|
||||||
if ( ! PyArg_ParseTuple ( args, "O:" PY_FORMAT, &arg0 ) ) \
|
if ( not PyArg_ParseTuple ( args, "O:" STR_FUNC_NAME, &arg0 ) or PyBool_Check(arg0) ) \
|
||||||
return ( NULL ); \
|
return NULL; \
|
||||||
if(arg0 == Py_True) \
|
\
|
||||||
cobject->FUNC_NAME (true); \
|
(arg0 == Py_True) ? cobject->FUNC_NAME (true) : cobject->FUNC_NAME (false); \
|
||||||
else \
|
HCATCH \
|
||||||
cobject->FUNC_NAME (false); \
|
|
||||||
\
|
\
|
||||||
Py_RETURN_NONE; \
|
Py_RETURN_NONE; \
|
||||||
}
|
}
|
||||||
|
@ -278,10 +284,12 @@ extern "C" {
|
||||||
{ \
|
{ \
|
||||||
GENERIC_METHOD_HEAD(SELF_TYPE,cobject,"DirectSetLongAttribute()") \
|
GENERIC_METHOD_HEAD(SELF_TYPE,cobject,"DirectSetLongAttribute()") \
|
||||||
\
|
\
|
||||||
|
HTRY \
|
||||||
PyObject* arg0; \
|
PyObject* arg0; \
|
||||||
if ( ! PyArg_ParseTuple ( args, "O:" PY_FORMAT, &arg0 ) ) \
|
if ( ! PyArg_ParseTuple ( args, "O:" PY_FORMAT, &arg0 ) ) \
|
||||||
return ( NULL ); \
|
return ( NULL ); \
|
||||||
cobject->FUNC_NAME ( PyInt_AsLong(arg0) ); \
|
cobject->FUNC_NAME ( PyInt_AsLong(arg0) ); \
|
||||||
|
HCATCH \
|
||||||
\
|
\
|
||||||
Py_RETURN_NONE; \
|
Py_RETURN_NONE; \
|
||||||
}
|
}
|
||||||
|
@ -599,30 +607,16 @@ extern "C" {
|
||||||
PyObject_DEL ( self ); \
|
PyObject_DEL ( self ); \
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
// Attribute Method For Singleton Deletion.
|
|
||||||
|
|
||||||
// # define SingletonDeleteMethod(SELF_TYPE)
|
|
||||||
// static void Py##SELF_TYPE##_DeAlloc ( Py##SELF_TYPE *self )
|
|
||||||
// {
|
|
||||||
// trace << "PySingletonObject_DeAlloc(" << hex << self << ") "
|
|
||||||
// << self->ACCESS_OBJECT << endl;
|
|
||||||
//
|
|
||||||
// if ( self->ACCESS_OBJECT != NULL ) {
|
|
||||||
// ostringstream message;
|
|
||||||
// message << "Never delete singleton "#SELF_TYPE".";
|
|
||||||
// PyErr_SetString ( ProxyError, message.str().c_str() );
|
|
||||||
// }
|
|
||||||
// PyObject_DEL ( self );
|
|
||||||
// }
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Attribute Method For Singleton Deletion.
|
// Attribute Method For Python Only Object Deletion.
|
||||||
|
|
||||||
# define SingletonDeleteMethod(SELF_TYPE) \
|
# define PythonOnlyDeleteMethod(SELF_TYPE) \
|
||||||
static void Py##SELF_TYPE##_DeAlloc ( Py##SELF_TYPE *self ) \
|
static void Py##SELF_TYPE##_DeAlloc ( Py##SELF_TYPE *self ) \
|
||||||
{ \
|
{ \
|
||||||
trace << "PySingletonObject_DeAlloc(" << hex << self << ") " \
|
trace << "PythonOnlyObject_DeAlloc(" << hex << self << ") " \
|
||||||
<< self->ACCESS_OBJECT << endl; \
|
<< self->ACCESS_OBJECT << endl; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -632,23 +626,62 @@ extern "C" {
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Initialisation Function for PyTypeObject Runtime Link.
|
// Initialisation Function for PyTypeObject Runtime Link.
|
||||||
|
|
||||||
#define PyTypeObjectLinkPyType(SELF_TYPE) \
|
#define PyTypeObjectLinkPyTypeWithoutObject(PY_SELF_TYPE,SELF_TYPE) \
|
||||||
DirectReprMethod(Py##SELF_TYPE##_Repr, Py##SELF_TYPE, SELF_TYPE) \
|
extern void Py##PY_SELF_TYPE##_LinkPyType() { \
|
||||||
DirectStrMethod (Py##SELF_TYPE##_Str, Py##SELF_TYPE, SELF_TYPE) \
|
trace << "Py" #PY_SELF_TYPE "_LinkType()" << endl; \
|
||||||
DirectCmpMethod (Py##SELF_TYPE##_Cmp, IsPy##SELF_TYPE, Py##SELF_TYPE) \
|
|
||||||
DirectHashMethod(Py##SELF_TYPE##_Hash, Py##SELF_TYPE) \
|
|
||||||
extern void Py##SELF_TYPE##_LinkPyType() { \
|
|
||||||
trace << "Py" #SELF_TYPE "_LinkType()" << endl; \
|
|
||||||
\
|
\
|
||||||
PyType##SELF_TYPE.tp_dealloc = (destructor)Py##SELF_TYPE##_DeAlloc; \
|
PyType##PY_SELF_TYPE.tp_dealloc = (destructor) Py##PY_SELF_TYPE##_DeAlloc; \
|
||||||
PyType##SELF_TYPE.tp_compare = (cmpfunc) Py##SELF_TYPE##_Cmp; \
|
PyType##PY_SELF_TYPE.tp_methods = Py##PY_SELF_TYPE##_Methods; \
|
||||||
PyType##SELF_TYPE.tp_repr = (reprfunc) Py##SELF_TYPE##_Repr; \
|
|
||||||
PyType##SELF_TYPE.tp_str = (reprfunc) Py##SELF_TYPE##_Str; \
|
|
||||||
PyType##SELF_TYPE.tp_hash = (hashfunc) Py##SELF_TYPE##_Hash; \
|
|
||||||
PyType##SELF_TYPE.tp_methods = Py##SELF_TYPE##_Methods; \
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Initialisation Function for PyTypeObject Runtime Link.
|
||||||
|
|
||||||
|
#define PyTypeObjectLinkPyTypeWithClass(PY_SELF_TYPE,SELF_TYPE) \
|
||||||
|
DirectReprMethod(Py##PY_SELF_TYPE##_Repr, Py##PY_SELF_TYPE, SELF_TYPE) \
|
||||||
|
DirectStrMethod (Py##PY_SELF_TYPE##_Str, Py##PY_SELF_TYPE, SELF_TYPE) \
|
||||||
|
DirectCmpMethod (Py##PY_SELF_TYPE##_Cmp, IsPy##PY_SELF_TYPE, Py##PY_SELF_TYPE) \
|
||||||
|
DirectHashMethod(Py##PY_SELF_TYPE##_Hash, Py##SELF_TYPE) \
|
||||||
|
extern void Py##PY_SELF_TYPE##_LinkPyType() { \
|
||||||
|
trace << "Py" #PY_SELF_TYPE "_LinkType()" << endl; \
|
||||||
|
\
|
||||||
|
PyType##PY_SELF_TYPE.tp_dealloc = (destructor) Py##PY_SELF_TYPE##_DeAlloc; \
|
||||||
|
PyType##PY_SELF_TYPE.tp_compare = (cmpfunc) Py##PY_SELF_TYPE##_Cmp; \
|
||||||
|
PyType##PY_SELF_TYPE.tp_repr = (reprfunc) Py##PY_SELF_TYPE##_Repr; \
|
||||||
|
PyType##PY_SELF_TYPE.tp_str = (reprfunc) Py##PY_SELF_TYPE##_Str; \
|
||||||
|
PyType##PY_SELF_TYPE.tp_hash = (hashfunc) Py##PY_SELF_TYPE##_Hash; \
|
||||||
|
PyType##PY_SELF_TYPE.tp_methods = Py##PY_SELF_TYPE##_Methods; \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Initialisation Function for PyTypeObject Runtime Link.
|
||||||
|
|
||||||
|
#define PyTypeObjectLinkPyType(SELF_TYPE) \
|
||||||
|
PyTypeObjectLinkPyTypeWithClass(SELF_TYPE,SELF_TYPE)
|
||||||
|
|
||||||
|
// #define PyTypeObjectLinkPyType(SELF_TYPE)
|
||||||
|
// DirectReprMethod(Py##SELF_TYPE##_Repr, Py##SELF_TYPE, SELF_TYPE)
|
||||||
|
// DirectStrMethod (Py##SELF_TYPE##_Str, Py##SELF_TYPE, SELF_TYPE)
|
||||||
|
// DirectCmpMethod (Py##SELF_TYPE##_Cmp, IsPy##SELF_TYPE, Py##SELF_TYPE)
|
||||||
|
// DirectHashMethod(Py##SELF_TYPE##_Hash, Py##SELF_TYPE)
|
||||||
|
// extern void Py##SELF_TYPE##_LinkPyType() {
|
||||||
|
// trace << "Py" #SELF_TYPE "_LinkType()" << endl;
|
||||||
|
//
|
||||||
|
// PyType##SELF_TYPE.tp_dealloc = (destructor) Py##SELF_TYPE##_DeAlloc;
|
||||||
|
// PyType##SELF_TYPE.tp_compare = (cmpfunc) Py##SELF_TYPE##_Cmp;
|
||||||
|
// PyType##SELF_TYPE.tp_repr = (reprfunc) Py##SELF_TYPE##_Repr;
|
||||||
|
// PyType##SELF_TYPE.tp_str = (reprfunc) Py##SELF_TYPE##_Str;
|
||||||
|
// PyType##SELF_TYPE.tp_hash = (hashfunc) Py##SELF_TYPE##_Hash;
|
||||||
|
// PyType##SELF_TYPE.tp_methods = Py##SELF_TYPE##_Methods;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
// Special Initialisation Function for Locator PyTypeObject Runtime Link.
|
// Special Initialisation Function for Locator PyTypeObject Runtime Link.
|
||||||
#define LocatorPyTypeObjectLinkPyType(PY_SELF_TYPE, SELF_TYPE) \
|
#define LocatorPyTypeObjectLinkPyType(PY_SELF_TYPE, SELF_TYPE) \
|
||||||
DirectReprMethod(Py##PY_SELF_TYPE##Locator_Repr, Py##PY_SELF_TYPE##Locator, Locator<SELF_TYPE>) \
|
DirectReprMethod(Py##PY_SELF_TYPE##Locator_Repr, Py##PY_SELF_TYPE##Locator, Locator<SELF_TYPE>) \
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
|
||||||
|
// -*- C++ -*-
|
||||||
|
//
|
||||||
|
// This file is part of the Coriolis Software.
|
||||||
|
// Copyright (c) UPMC/LIP6 2010-2010, All Rights Reserved
|
||||||
|
//
|
||||||
|
// x-----------------------------------------------------------------x
|
||||||
|
// | |
|
||||||
|
// | C O R I O L I S |
|
||||||
|
// | I s o b a r - Hurricane / Python Interface |
|
||||||
|
// | |
|
||||||
|
// | Author : Jean-Paul CHAPUT |
|
||||||
|
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||||
|
// | =============================================================== |
|
||||||
|
// | C++ Header : "./PyNetExternalComponents.h" |
|
||||||
|
// | *************************************************************** |
|
||||||
|
// | U p d a t e s |
|
||||||
|
// | |
|
||||||
|
// x-----------------------------------------------------------------x
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# ifndef __PY_NET_EXTERNAL_COMPONENTS__
|
||||||
|
# define __PY_NET_EXTERNAL_COMPONENTS__
|
||||||
|
|
||||||
|
|
||||||
|
#include "hurricane/isobar/PyHurricane.h"
|
||||||
|
#include "hurricane/NetExternalComponents.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace Isobar {
|
||||||
|
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Python Object : "PyNetExternalComponents".
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
PyObject_HEAD
|
||||||
|
} PyNetExternalComponents;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Functions & Types exported to "PyHurricane.cpp".
|
||||||
|
|
||||||
|
extern PyTypeObject PyTypeNetExternalComponents;
|
||||||
|
extern PyMethodDef PyNetExternalComponents_Methods[];
|
||||||
|
|
||||||
|
extern void PyNetExternalComponents_LinkPyType ();
|
||||||
|
|
||||||
|
|
||||||
|
#define IsPyNetExternalComponents(v) ( (v)->ob_type == &PyTypeNetExternalComponents )
|
||||||
|
#define PYNETEXTERNALCOMPONENTS(v) ( (PyNetExternalComponents*)(v) )
|
||||||
|
#define PYNETEXTERNALCOMPONENTS_O(v) ( PY_NET_EXTERNAL_COMPONENTS(v)->_object )
|
||||||
|
|
||||||
|
|
||||||
|
} // End of extern "C".
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // End of Isobar namespace.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# endif
|
|
@ -1,39 +1,8 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Project.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
// Copyright (c) UPMC/LIP6 2010-2010, All Rights Reserved
|
||||||
// Universite Pierre et Marie Curie
|
|
||||||
//
|
|
||||||
// Main contributors :
|
|
||||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
|
||||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
|
||||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
|
||||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
|
||||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
|
||||||
// Christian Masson <Christian.Masson@lip6.fr>
|
|
||||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
|
||||||
//
|
|
||||||
// The Coriolis Project 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.
|
|
||||||
//
|
|
||||||
// The Coriolis Project 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 the Coriolis Project; if not, write to the Free Software
|
|
||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
||||||
// USA
|
|
||||||
//
|
|
||||||
// License-Tag
|
|
||||||
// Authors-Tag
|
|
||||||
// ===================================================================
|
|
||||||
//
|
|
||||||
// $Id: PyUpdateSession.h,v 1.8 2006/05/03 14:00:05 jpc Exp $
|
|
||||||
//
|
//
|
||||||
// x-----------------------------------------------------------------x
|
// x-----------------------------------------------------------------x
|
||||||
// | |
|
// | |
|
||||||
|
@ -53,12 +22,11 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __PYUPDATESESSION__
|
# ifndef __PY_UPDATE_SESSION__
|
||||||
#define __PYUPDATESESSION__
|
# define __PY_UPDATE_SESSION__
|
||||||
|
|
||||||
|
|
||||||
#include "hurricane/isobar/PyHurricane.h"
|
#include "hurricane/isobar/PyHurricane.h"
|
||||||
|
|
||||||
#include "hurricane/UpdateSession.h"
|
#include "hurricane/UpdateSession.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -67,25 +35,34 @@ namespace Isobar {
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Python Object : "PyUpdateSession".
|
// Python Object : "PyUpdateSession".
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
PyObject_HEAD
|
||||||
|
} PyUpdateSession;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Functions & Types exported to "PyHurricane.ccp".
|
// Functions & Types exported to "PyHurricane.cpp".
|
||||||
|
|
||||||
extern PyObject* PyUpdateSession_open ( PyObject* module );
|
extern PyTypeObject PyTypeUpdateSession;
|
||||||
extern PyObject* PyUpdateSession_close ( PyObject* module );
|
extern PyMethodDef PyUpdateSession_Methods[];
|
||||||
|
|
||||||
|
extern void PyUpdateSession_LinkPyType ();
|
||||||
|
|
||||||
|
|
||||||
|
#define IsPyUpdateSession(v) ( (v)->ob_type == &PyTypeUpdateSession )
|
||||||
|
#define PYUPDATESESSION(v) ( (PyUpdateSession*)(v) )
|
||||||
|
#define PYUPDATESESSION_O(v) ( PY_UPDATE_SESSION(v)->_object )
|
||||||
|
|
||||||
|
|
||||||
} // End of extern "C".
|
} // End of extern "C".
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // End of Isobar namespace.
|
} // End of Isobar namespace.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
// x-----------------------------------------------------------------x
|
// x-----------------------------------------------------------------x
|
||||||
|
|
||||||
|
|
||||||
|
#include <QPointer>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
@ -42,6 +43,7 @@ namespace Hurricane {
|
||||||
, _message (new QLabel())
|
, _message (new QLabel())
|
||||||
, _stopLevel (new QSpinBox())
|
, _stopLevel (new QSpinBox())
|
||||||
, _isFinished(false)
|
, _isFinished(false)
|
||||||
|
, _eventLoop (NULL)
|
||||||
{
|
{
|
||||||
setModal ( false );
|
setModal ( false );
|
||||||
setWindowTitle ( "Breakpoint" );
|
setWindowTitle ( "Breakpoint" );
|
||||||
|
@ -83,8 +85,15 @@ namespace Hurricane {
|
||||||
|
|
||||||
_isFinished = false;
|
_isFinished = false;
|
||||||
show ();
|
show ();
|
||||||
while ( !_isFinished )
|
|
||||||
QApplication::processEvents ();
|
// Snipet code from Qt's QDialog.
|
||||||
|
_eventLoop = new QEventLoop ();
|
||||||
|
QPointer<QDialog> guard = this;
|
||||||
|
(void)_eventLoop->exec(QEventLoop::DialogExec);
|
||||||
|
_eventLoop = NULL;
|
||||||
|
|
||||||
|
if (guard.isNull()) return QDialog::Rejected;
|
||||||
|
|
||||||
return result();
|
return result();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,6 +101,7 @@ namespace Hurricane {
|
||||||
void BreakpointWidget::raiseFinished ( int )
|
void BreakpointWidget::raiseFinished ( int )
|
||||||
{
|
{
|
||||||
_isFinished = true;
|
_isFinished = true;
|
||||||
|
if ( _eventLoop ) _eventLoop->exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -116,6 +116,8 @@
|
||||||
qt4_wrap_cpp ( MOC_SRCS ${mocincludes} )
|
qt4_wrap_cpp ( MOC_SRCS ${mocincludes} )
|
||||||
qt4_add_resources ( RCC_SRCS CellViewer.qrc )
|
qt4_add_resources ( RCC_SRCS CellViewer.qrc )
|
||||||
|
|
||||||
install ( FILES ${exports} DESTINATION include/coriolis2/hurricane/viewer )
|
|
||||||
add_library ( viewer ${cpps} ${MOC_SRCS} ${RCC_SRCS} )
|
add_library ( viewer ${cpps} ${MOC_SRCS} ${RCC_SRCS} )
|
||||||
|
target_link_libraries ( viewer hurricane ${QT_LIBRARIES} ${Boost_LIBRARIES} )
|
||||||
|
|
||||||
|
install ( FILES ${exports} DESTINATION include/coriolis2/hurricane/viewer )
|
||||||
install ( TARGETS viewer DESTINATION lib${LIB_SUFFIX} )
|
install ( TARGETS viewer DESTINATION lib${LIB_SUFFIX} )
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#define __HURRICANE_BREAKPOINT_WIDGET__
|
#define __HURRICANE_BREAKPOINT_WIDGET__
|
||||||
|
|
||||||
|
|
||||||
|
#include <QEventLoop>
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
class QLabel;
|
class QLabel;
|
||||||
class QSpinBox;
|
class QSpinBox;
|
||||||
|
@ -53,6 +54,7 @@ namespace Hurricane {
|
||||||
QLabel* _message;
|
QLabel* _message;
|
||||||
QSpinBox* _stopLevel;
|
QSpinBox* _stopLevel;
|
||||||
bool _isFinished;
|
bool _isFinished;
|
||||||
|
QEventLoop* _eventLoop;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue