Răsfoiți Sursa

interrogate: Isolate out remaining Python objects from the Panda3D core libraries to the Interrogate extensions.

Sam Edwards 11 ani în urmă
părinte
comite
52dc814a3b

+ 0 - 6
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();

+ 5 - 0
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;
 
 ////////////////////////////////////////////////////////////////////

+ 7 - 3
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)
 

+ 0 - 4
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();

+ 5 - 0
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

+ 3 - 2
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)

+ 0 - 4
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();

+ 5 - 0
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