diff --git a/panda/src/display/config_display.cxx b/panda/src/display/config_display.cxx index 6cfa88dec8..012a323317 100644 --- a/panda/src/display/config_display.cxx +++ b/panda/src/display/config_display.cxx @@ -24,9 +24,6 @@ #include "graphicsBuffer.h" #include "graphicsWindow.h" #include "graphicsDevice.h" -#ifdef HAVE_PYTHON -#include "pythonGraphicsWindowProc.h" -#endif #include "graphicsWindowProcCallbackData.h" #include "nativeWindowHandle.h" #include "parasiteBuffer.h" @@ -493,9 +490,6 @@ init_libdisplay() { GraphicsPipe::init_type(); GraphicsStateGuardian::init_type(); GraphicsWindow::init_type(); -#ifdef HAVE_PYTHON - PythonGraphicsWindowProc::init_type(); -#endif GraphicsWindowProcCallbackData::init_type(); NativeWindowHandle::init_type(); ParasiteBuffer::init_type(); diff --git a/panda/src/display/pythonGraphicsWindowProc.cxx b/panda/src/display/pythonGraphicsWindowProc.cxx index 0037641a50..2a9ad1dff2 100644 --- a/panda/src/display/pythonGraphicsWindowProc.cxx +++ b/panda/src/display/pythonGraphicsWindowProc.cxx @@ -15,6 +15,11 @@ #include "pythonGraphicsWindowProc.h" #include "graphicsWindowProcCallbackData.h" +ConfigureDef(config_pythonGraphicsWindowProc); +ConfigureFn(config_pythonGraphicsWindowProc) { + PythonGraphicsWindowProc::init_type(); +} + TypeHandle PythonGraphicsWindowProc::_type_handle; //////////////////////////////////////////////////////////////////// diff --git a/panda/src/event/CMakeLists.txt b/panda/src/event/CMakeLists.txt index d3cc6dff51..b2976a4136 100644 --- a/panda/src/event/CMakeLists.txt +++ b/panda/src/event/CMakeLists.txt @@ -11,7 +11,6 @@ set(P3EVENT_HEADERS genericAsyncTask.h genericAsyncTask.I pointerEvent.I pointerEvent.h pointerEventList.I pointerEventList.h - pythonTask.h pythonTask.I event.I event.h eventHandler.h eventHandler.I eventParameter.I eventParameter.h eventQueue.I eventQueue.h eventReceiver.h @@ -30,16 +29,21 @@ set(P3EVENT_SOURCES genericAsyncTask.cxx pointerEvent.cxx pointerEventList.cxx - pythonTask.cxx config_event.cxx event.cxx eventHandler.cxx eventParameter.cxx eventQueue.cxx eventReceiver.cxx pt_Event.cxx ) +set(P3EVENT_IGATEEXT + pythonTask.cxx + pythonTask.h + pythonTask.I +) + composite_sources(p3event P3EVENT_SOURCES) add_library(p3event ${P3EVENT_HEADERS} ${P3EVENT_SOURCES}) target_link_libraries(p3event p3linmath p3pstatclient) -target_interrogate(p3event ALL) +target_interrogate(p3event ALL EXTENSIONS ${P3EVENT_IGATEEXT}) install(TARGETS p3event DESTINATION lib) diff --git a/panda/src/event/config_event.cxx b/panda/src/event/config_event.cxx index 1b241f462d..9f6ef94d35 100644 --- a/panda/src/event/config_event.cxx +++ b/panda/src/event/config_event.cxx @@ -24,7 +24,6 @@ #include "eventParameter.h" #include "genericAsyncTask.h" #include "pointerEventList.h" -#include "pythonTask.h" #include "dconfig.h" @@ -49,9 +48,6 @@ ConfigureFn(config_event) { EventStoreWstring::init_type("EventStoreWstring"); EventStoreTypedRefCount::init_type(); GenericAsyncTask::init_type(); -#ifdef HAVE_PYTHON - PythonTask::init_type(); -#endif ButtonEventList::register_with_read_factory(); EventStoreInt::register_with_read_factory(); diff --git a/panda/src/event/pythonTask.cxx b/panda/src/event/pythonTask.cxx index 4ae81b5a1a..a51601edea 100644 --- a/panda/src/event/pythonTask.cxx +++ b/panda/src/event/pythonTask.cxx @@ -19,6 +19,11 @@ #ifdef HAVE_PYTHON #include "py_panda.h" +ConfigureDef(config_pythonTask); +ConfigureFn(config_pythonTask) { + PythonTask::init_type(); +} + TypeHandle PythonTask::_type_handle; #ifndef CPPPARSER diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index 149fc79840..c2701ba7ef 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -50,7 +50,6 @@ set(P3PUTIL_HEADERS pbitops.I pbitops.h portalMask.h pta_ushort.h - pythonCallbackObject.h pythonCallbackObject.I simpleHashMap.I simpleHashMap.h sparseArray.I sparseArray.h timedCycle.I timedCycle.h typedWritable.I @@ -99,7 +98,6 @@ set(P3PUTIL_SOURCES nodeCachedReferenceCount.cxx pbitops.cxx pta_ushort.cxx - pythonCallbackObject.cxx simpleHashMap.cxx sparseArray.cxx timedCycle.cxx typedWritable.cxx @@ -113,6 +111,9 @@ set(P3PUTIL_SOURCES set(P3PUTIL_IGATEEXT typedWritable_ext.cxx typedWritable_ext.h + pythonCallbackObject.cxx + pythonCallbackObject.h + pythonCallbackObject.I ) composite_sources(p3putil P3PUTIL_SOURCES) diff --git a/panda/src/putil/config_util.cxx b/panda/src/putil/config_util.cxx index 89b71a6b3f..62b16fca3c 100644 --- a/panda/src/putil/config_util.cxx +++ b/panda/src/putil/config_util.cxx @@ -34,7 +34,6 @@ #include "factoryParam.h" #include "namable.h" #include "nodeCachedReferenceCount.h" -#include "pythonCallbackObject.h" #include "referenceCount.h" #include "sparseArray.h" #include "typedObject.h" @@ -200,9 +199,6 @@ init_libputil() { FactoryParam::init_type(); Namable::init_type(); NodeCachedReferenceCount::init_type(); -#ifdef HAVE_PYTHON - PythonCallbackObject::init_type(); -#endif QuadBitMaskNative::init_type(); ReferenceCount::init_type(); SparseArray::init_type(); diff --git a/panda/src/putil/pythonCallbackObject.cxx b/panda/src/putil/pythonCallbackObject.cxx index 1160877901..2651f91fff 100644 --- a/panda/src/putil/pythonCallbackObject.cxx +++ b/panda/src/putil/pythonCallbackObject.cxx @@ -20,6 +20,11 @@ #include "callbackData.h" #include "config_util.h" +ConfigureDef(config_pythonCallbackObject); +ConfigureFn(config_pythonCallbackObject) { + PythonCallbackObject::init_type(); +} + TypeHandle PythonCallbackObject::_type_handle; #ifndef CPPPARSER