From 7d386268765a2ef8af3b6bf25d2f27c850c73e4c Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 17 Nov 2000 04:49:21 +0000 Subject: [PATCH] *** empty log message *** --- direct/src/directutil/DirectManipulation.py | 12 ++-- direct/src/directutil/DirectSession.py | 14 ++--- direct/src/leveleditor/LevelEditor.py | 4 +- direct/src/showbase/ShowBase.py | 18 ++++-- direct/src/showbase/showBase.h | 3 + dtool/pptempl/Global.pp | 1 + dtool/pptempl/Template.gmsvc.pp | 2 +- dtool/pptempl/Template.msvc.pp | 2 +- dtool/pptempl/Template.unix.pp | 6 +- dtool/src/dconfig/dconfig.h | 1 + dtool/src/dconfig/notify.h | 2 +- dtool/src/dconfig/notifyCategory.h | 2 +- dtool/src/dconfig/notifySeverity.h | 2 + dtool/src/dtoolutil/dSearchPath.h | 4 +- dtool/src/dtoolutil/filename.h | 7 ++- dtool/src/interrogate/interrogate.cxx | 13 ++++- dtool/src/interrogate/interrogate.h | 1 + dtool/src/interrogate/interrogateBuilder.cxx | 21 ++++++- dtool/src/interrogate/typeManager.cxx | 32 +++++++++++ dtool/src/interrogate/wrapperBuilder.cxx | 56 ++++++++++++++++++- dtool/src/interrogate/wrapperBuilder.h | 2 + dtool/src/interrogate/wrapperBuilderC.cxx | 2 + .../src/interrogate/wrapperBuilderPython.cxx | 2 + dtool/src/interrogatedb/Sources.pp | 6 +- panda/src/audio/audio_manager.h | 1 + panda/src/audio/audio_pool.h | 1 + panda/src/chan/animBundle.h | 2 +- panda/src/chan/animBundleNode.h | 2 +- panda/src/chan/animControl.h | 1 + panda/src/chan/animControlCollection.h | 2 +- panda/src/chan/auto_bind.h | 2 + panda/src/chan/movingPartBase.cxx | 10 ++-- panda/src/chan/partBundle.h | 3 +- panda/src/chan/partBundleNode.h | 1 + panda/src/chan/partGroup.h | 4 ++ panda/src/char/character.cxx | 5 +- panda/src/char/character.h | 4 ++ panda/src/char/characterJoint.h | 1 + panda/src/char/characterJointBundle.h | 2 + panda/src/chat/chatInput.h | 3 +- panda/src/collide/collisionEntry.h | 1 + panda/src/collide/collisionHandlerEvent.h | 4 +- panda/src/collide/collisionHandlerFloor.h | 2 +- panda/src/collide/collisionHandlerPhysical.h | 1 + panda/src/collide/collisionHandlerPusher.h | 2 +- panda/src/collide/collisionHandlerQueue.h | 4 +- panda/src/collide/collisionNode.cxx | 2 +- panda/src/collide/collisionNode.h | 7 ++- panda/src/collide/collisionPlane.h | 5 +- panda/src/collide/collisionPolygon.h | 4 +- panda/src/collide/collisionRay.h | 6 +- panda/src/collide/collisionSolid.h | 3 + panda/src/collide/collisionSphere.h | 6 +- panda/src/collide/collisionTraverser.h | 2 +- panda/src/cull/cullTraverser.cxx | 2 +- panda/src/cull/directRenderTransition.h | 5 +- panda/src/device/mouse.h | 4 +- panda/src/dgraph/Sources.pp | 4 +- panda/src/dgraph/dataNode.h | 1 + panda/src/dgraph/dataRelation.h | 4 +- panda/src/display/displayRegion.h | 2 +- panda/src/display/graphicsChannel.h | 3 + panda/src/display/graphicsLayer.h | 3 + panda/src/display/graphicsPipe.h | 3 +- panda/src/display/graphicsWindow.I | 26 ++++----- panda/src/display/graphicsWindow.h | 13 +++-- panda/src/downloader/Sources.pp | 3 +- panda/src/downloader/crypto_utils.h | 4 ++ panda/src/downloader/downloadDb.h | 1 - panda/src/downloader/download_utils.h | 4 ++ panda/src/downloader/downloader.h | 2 +- panda/src/downloader/extractor.h | 4 +- panda/src/downloader/patcher.h | 2 +- panda/src/effects/lensFlareNode.h | 3 +- panda/src/event/event.h | 2 +- panda/src/event/eventHandler.h | 3 + panda/src/event/eventParameter.h | 2 +- panda/src/event/eventQueue.h | 1 + panda/src/express/clockObject.h | 2 +- panda/src/express/config_express.cxx | 24 ++++++-- panda/src/express/config_express.h | 2 + panda/src/express/datagram.h | 2 +- panda/src/express/datagramIterator.h | 2 +- panda/src/express/memoryUsage.cxx | 18 +++--- panda/src/express/memoryUsage.h | 1 + panda/src/express/memoryUsagePointers.cxx | 2 +- panda/src/express/memoryUsagePointers.h | 2 +- panda/src/express/multifile.h | 2 +- panda/src/express/namable.h | 2 +- panda/src/express/patchfile.cxx | 14 ++--- panda/src/express/patchfile.h | 2 +- panda/src/express/pointerTo.I | 2 +- panda/src/express/pointerTo.h | 9 ++- panda/src/express/referenceCount.I | 32 ++++++++--- panda/src/express/referenceCount.cxx | 32 +++++++++++ panda/src/express/referenceCount.h | 13 ++++- panda/src/express/typeHandle.h | 6 +- panda/src/express/typedReferenceCount.h | 4 ++ panda/src/gobj/drawable.h | 8 ++- panda/src/gobj/fog.h | 2 +- panda/src/gobj/geom.cxx | 13 ++--- panda/src/gobj/geom.h | 10 ++-- panda/src/gobj/texturePool.h | 2 +- panda/src/graph/Sources.pp | 3 + panda/src/graph/boundedObject.h | 1 + panda/src/graph/immediateTransition.h | 4 ++ panda/src/graph/multiTransition.I | 2 +- panda/src/graph/namedNode.h | 4 +- panda/src/graph/node.h | 6 ++ panda/src/graph/nodeAttribute.h | 4 ++ panda/src/graph/nodeAttributes.h | 5 +- panda/src/graph/nodeRelation.h | 2 + panda/src/graph/nodeTransition.h | 2 + panda/src/graph/nodeTransitionCache.cxx | 2 +- panda/src/graph/nodeTransitionWrapper.I | 2 +- panda/src/graph/onOffAttribute.h | 3 +- panda/src/graph/onOffTransition.cxx | 2 +- panda/src/graph/onOffTransition.h | 3 +- panda/src/graph/onTransition.cxx | 2 +- panda/src/graph/onTransition.h | 4 ++ panda/src/grutil/lineSegs.h | 2 +- panda/src/gui/guiButton.h | 7 ++- panda/src/gui/guiFrame.h | 5 +- panda/src/gui/guiItem.h | 3 +- panda/src/gui/guiLabel.h | 4 +- panda/src/gui/guiManager.cxx | 8 +-- panda/src/gui/guiManager.h | 3 +- panda/src/gui/guiRegion.h | 4 +- panda/src/gui/guiRollover.h | 4 +- panda/src/gui/guiSign.h | 4 +- panda/src/lerp/lerp.h | 8 ++- panda/src/lerp/lerpblend.h | 28 ++++++---- panda/src/linmath/Sources.pp | 3 +- panda/src/linmath/compose_matrix.h | 3 + panda/src/linmath/coordinateSystem.h | 4 ++ panda/src/linmath/deg_2_rad.h | 2 + panda/src/linmath/lmat_ops.h | 4 ++ panda/src/linmath/lmatrix3.h | 5 +- panda/src/linmath/lmatrix4.h | 2 +- panda/src/linmath/lpoint2.h | 2 +- panda/src/linmath/lpoint3.h | 2 +- panda/src/linmath/lpoint4.h | 2 +- panda/src/linmath/lquaternion.h | 4 +- panda/src/linmath/lrotation.h | 2 +- panda/src/linmath/luse.h | 2 + panda/src/linmath/lvecBase2.h | 4 +- panda/src/linmath/lvecBase3.h | 4 +- panda/src/linmath/lvecBase4.h | 4 +- panda/src/linmath/lvector2.h | 2 +- panda/src/linmath/lvector3.h | 2 +- panda/src/linmath/lvector4.h | 2 +- panda/src/loader/loader.h | 2 +- panda/src/loader/modelPool.h | 2 +- panda/src/mathutil/boundingLine.h | 5 +- panda/src/mathutil/boundingSphere.h | 5 +- panda/src/mathutil/boundingVolume.h | 2 +- panda/src/mathutil/finiteBoundingVolume.h | 2 +- panda/src/mathutil/geometricBoundingVolume.h | 1 + panda/src/mathutil/look_at.h | 3 + panda/src/mathutil/mathHelpers.h | 4 ++ panda/src/mathutil/omniBoundingVolume.h | 4 +- panda/src/mathutil/plane.h | 2 +- panda/src/mathutil/rotate_to.h | 4 ++ panda/src/net/connection.h | 2 +- panda/src/net/connectionListener.h | 2 +- panda/src/net/connectionManager.h | 2 +- panda/src/net/connectionReader.h | 2 +- panda/src/net/connectionWriter.h | 2 +- panda/src/net/netAddress.h | 2 +- panda/src/net/netDatagram.h | 2 +- panda/src/net/queuedConnectionListener.h | 2 +- panda/src/net/queuedConnectionManager.h | 2 +- panda/src/net/queuedConnectionReader.h | 2 +- panda/src/net/queuedReturn.h | 2 +- panda/src/net/recentConnectionReader.h | 2 +- .../particlesystem/particleSystemManager.cxx | 2 +- panda/src/putil/bitMask.h | 2 +- panda/src/putil/buttonHandle.h | 5 +- panda/src/putil/buttonRegistry.h | 2 +- panda/src/putil/config_util.h | 2 + panda/src/putil/keyboardButton.h | 3 +- panda/src/putil/lineStream.h | 2 +- panda/src/putil/modifierButtons.cxx | 4 +- panda/src/putil/mouseButton.h | 3 +- panda/src/putil/mouseData.h | 3 +- panda/src/putil/pointerToArray.I | 12 ++-- panda/src/putil/pointerToArray.h | 4 +- panda/src/putil/typedWriteable.h | 4 +- .../src/putil/typedWriteableReferenceCount.h | 4 ++ panda/src/putil/writeableConfigurable.h | 4 +- panda/src/sgattrib/colorAttribute.h | 3 +- panda/src/sgattrib/colorTransition.h | 5 +- panda/src/sgattrib/pruneTransition.h | 3 +- panda/src/sgattrib/renderRelation.h | 4 +- panda/src/sgattrib/transparencyTransition.h | 5 +- panda/src/sgmanip/get_cout.h | 34 ----------- panda/src/sgmanip/nodePath.h | 2 +- panda/src/sgmanip/nodePathCollection.cxx | 4 +- panda/src/sgmanip/nodePathCollection.h | 2 +- panda/src/sgmanip/nodePathLerps.h | 42 +++++++++++--- panda/src/sgraph/camera.h | 5 +- panda/src/sgraph/geomNode.cxx | 2 +- panda/src/sgraph/geomNode.h | 7 ++- panda/src/sgraph/modelNode.h | 4 +- panda/src/sgraph/modelRoot.h | 4 +- panda/src/sgraph/planeNode.h | 5 +- panda/src/sgraph/projectionNode.h | 7 ++- panda/src/sgraph/renderTraverser.h | 5 +- panda/src/switchnode/LODNode.h | 6 +- panda/src/switchnode/sequenceNode.h | 3 +- panda/src/text/textNode.h | 4 +- panda/src/tform/buttonThrower.h | 2 +- panda/src/tform/driveInterface.h | 2 +- panda/src/tform/mouseWatcher.h | 2 +- panda/src/tform/mouseWatcherRegion.h | 2 +- panda/src/tform/trackball.h | 2 +- panda/src/tform/trackerTransform.h | 3 +- panda/src/tform/transform2sg.h | 2 +- 218 files changed, 772 insertions(+), 318 deletions(-) delete mode 100644 panda/src/sgmanip/get_cout.h diff --git a/direct/src/directutil/DirectManipulation.py b/direct/src/directutil/DirectManipulation.py index 1058a733e2..9a35727294 100644 --- a/direct/src/directutil/DirectManipulation.py +++ b/direct/src/directutil/DirectManipulation.py @@ -146,7 +146,7 @@ class DirectManipulationControl(PandaObject): pos = VBase3(0) hpr = VBase3(0) decomposeMatrix(self.direct.selected.last.mCoa2Dnp, - VBase3(0), hpr, pos, getDefaultCoordinateSystem()) + VBase3(0), hpr, pos, CSDefault) # Create the task t = Task.Task(self.followSelectedNodePathTask) # Update state variables @@ -363,7 +363,7 @@ class DirectManipulationControl(PandaObject): # And determine where the viewpoint is relative to widget pos = VBase3(0) decomposeMatrix(mWidget2Cam, VBase3(0), VBase3(0), pos, - getDefaultCoordinateSystem()) + CSDefault) widgetDir = Vec3(pos) widgetDir.normalize() # Convert specified widget axis to view space @@ -438,7 +438,7 @@ class DirectManipulationControl(PandaObject): mBase2NewBase = Mat4() mBase2NewBase.composeMatrix( UNIT_VEC, VBase3(h,p,r), ZERO_VEC, - getDefaultCoordinateSystem()) + CSDefault) mBase2Widget = base.getMat(self.direct.widget) mWidget2Parent = self.direct.widget.getMat() # Compose the result @@ -448,7 +448,7 @@ class DirectManipulationControl(PandaObject): # Extract and apply the hpr hpr = Vec3(0) decomposeMatrix(resultMat, VBase3(), hpr, VBase3(), - getDefaultCoordinateSystem()) + CSDefault) self.direct.widget.setHpr(hpr) def rotate2D(self): @@ -845,7 +845,7 @@ class ObjectHandles(NodePath,PandaObject): # And determine where the viewpoint is relative to widget lineOrigin = VBase3(0) decomposeMatrix(mCam2Widget, VBase3(0), VBase3(0), lineOrigin, - getDefaultCoordinateSystem()) + CSDefault) # Now see where this hits the plane containing the 1D motion axis. # Pick the intersection plane most normal to the intersection ray # by comparing lineDir with plane normals. The plane with the @@ -892,7 +892,7 @@ class ObjectHandles(NodePath,PandaObject): # And determine where the viewpoint is relative to widget lineOrigin = VBase3(0) decomposeMatrix(mCam2NodePath, VBase3(0), VBase3(0), lineOrigin, - getDefaultCoordinateSystem()) + CSDefault) # Next we find the vector from viewpoint to the widget through # the mouse's position on near plane. diff --git a/direct/src/directutil/DirectSession.py b/direct/src/directutil/DirectSession.py index 22dcd3b6a1..2e5c882139 100644 --- a/direct/src/directutil/DirectSession.py +++ b/direct/src/directutil/DirectSession.py @@ -36,6 +36,9 @@ class DirectSession(PandaObject): self.fShift = 0 self.in2DWidget = 0 + self.mouseX = 0 + self.mouseY = 0 + self.pos = VBase3() self.hpr = VBase3() self.scale = VBase3() @@ -93,7 +96,7 @@ class DirectSession(PandaObject): mCoa2Render = state.dnp.mCoa2Dnp * state.dnp.getMat(render) decomposeMatrix(mCoa2Render, self.scale,self.hpr,self.pos, - getDefaultCoordinateSystem()) + CSDefault) self.widget.setPosHpr(self.pos,self.hpr) return Task.cont @@ -253,7 +256,6 @@ class DisplayRegionContext(PandaObject): self.camera = camera self.cam = camera.getChild(0) self.camNode = self.cam.getNode(0) - self.mouseData = win.getMouseData(0) self.nearVec = Vec3(0) self.mouseX = 0.0 self.mouseY = 0.0 @@ -297,12 +299,10 @@ class DisplayRegionContext(PandaObject): self.mouseLastX = self.mouseX self.mouseLastY = self.mouseY # Values for this frame - # Pixel coordinates of the mouse - self.mousePixelX = self.mouseData.getX() - self.mousePixelY = self.mouseData.getY() # This ranges from -1 to 1 - self.mouseX = ((self.mousePixelX / float(self.width)) * 2.0) - 1.0 - self.mouseY = ((self.mousePixelY / float(self.height)) * -2.0) + 1.0 + if (base.mouseWatcher.node().hasMouse()): + self.mouseX = base.mouseWatcher.node().getMouseX() + self.mouseY = base.mouseWatcher.node().getMouseY() # Delta percent of window the mouse moved self.mouseDeltaX = self.mouseX - self.mouseLastX self.mouseDeltaY = self.mouseY - self.mouseLastY diff --git a/direct/src/leveleditor/LevelEditor.py b/direct/src/leveleditor/LevelEditor.py index 65cb30ceb0..49d8367cb1 100644 --- a/direct/src/leveleditor/LevelEditor.py +++ b/direct/src/leveleditor/LevelEditor.py @@ -52,7 +52,7 @@ class LevelEditor(NodePath, PandaObject): # DNAStorage instance for storing level DNA info self.dnaStore = DNAStorage() loadDNAFile(self.dnaStore, 'dna/storage.dna', - getDefaultCoordinateSystem()) + CSDefault) self.dnaOutputDir = 'ToontownCentral' self.dnaOutputFile = 'toontown_working.dna' @@ -2239,7 +2239,7 @@ class LevelEditor(NodePath, PandaObject): self.dnaStore.resetDNAVisGroups() # Now load in new file self.groupParent = loadDNAFile(self.dnaStore, filename, - getDefaultCoordinateSystem()) + CSDefault) # Make sure the topmost level object gets put under level objects dna self.groupParentDNA = self.dnaStore.findDNAGroup( self.groupParent.getBottomArc()) diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index bb4556be0f..f26bbff0a5 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -55,15 +55,25 @@ class ShowBase: self.camList.append( camera.find('**/+Camera') ) # Set the default camera self.cam = self.camera.find('**/+Camera') - # Just one per window + + # We create both a MouseAndKeyboard object and a MouseWatcher object + # for the window. The MouseAndKeyboard generates mouse events and + # mouse button/keyboard events; the MouseWatcher passes them through + # unchanged when the mouse is not over a 2-d button, and passes + # nothing through when the mouse *is* over a 2-d button. Therefore, + # objects that don't want to get events when the mouse is over a + # button, like the driveInterface, should be parented to + # mouseWatcher, while objects that want events in all cases, like the + # chat interface, should be parented to mak. self.mak = self.dataRoot.attachNewNode(MouseAndKeyboard(self.win, 0, 'mak')) + self.mouseWatcher = self.mak.attachNewNode(MouseWatcher('mouseWatcher')) self.trackball = self.dataUnused.attachNewNode(Trackball('trackball')) self.drive = self.dataUnused.attachNewNode(DriveInterface('drive')) self.mouse2cam = self.dataUnused.attachNewNode(Transform2SG('mouse2cam')) self.mouse2cam.node().setArc(self.camera.getBottomArc()) self.useDrive() - self.buttonThrower = self.mak.attachNewNode(ButtonThrower()) + self.buttonThrower = self.mouseWatcher.attachNewNode(ButtonThrower()) if (ShowBase.notify == None): ShowBase.notify = directNotify.newCategory("ShowBase") @@ -132,7 +142,7 @@ class ShowBase: # Update the mouseInterface to point to the drive self.mouseInterface = self.drive self.drive.node().reset() - self.drive.reparentTo(self.mak) + self.drive.reparentTo(self.mouseWatcher) # Hookup the drive to the camera self.mouse2cam.reparentTo(self.drive) # Set the height to a good eyeheight @@ -147,7 +157,7 @@ class ShowBase: # Update the mouseInterface to point to the trackball self.mouseInterface = self.trackball # Hookup the trackball to the camera - self.trackball.reparentTo(self.mak) + self.trackball.reparentTo(self.mouseWatcher) self.mouse2cam.reparentTo(self.trackball) def run(self): diff --git a/direct/src/showbase/showBase.h b/direct/src/showbase/showBase.h index cd2908d2dc..c13d5ee48a 100644 --- a/direct/src/showbase/showBase.h +++ b/direct/src/showbase/showBase.h @@ -28,6 +28,8 @@ typedef Config::Config ConfigShowbase; class CollisionTraverser; +BEGIN_PUBLISH + EXPCL_DIRECT PT(GraphicsPipe) make_graphics_pipe(); EXPCL_DIRECT PT(GraphicsWindow) make_graphics_window(GraphicsPipe *pipe, @@ -48,5 +50,6 @@ EXPCL_DIRECT void toggle_backface(NodeAttributes &initial_state); EXPCL_DIRECT ConfigShowbase &get_config_showbase(); +END_PUBLISH #endif diff --git a/dtool/pptempl/Global.pp b/dtool/pptempl/Global.pp index 1ea24fb275..d543859ed8 100644 --- a/dtool/pptempl/Global.pp +++ b/dtool/pptempl/Global.pp @@ -676,6 +676,7 @@ Warning: Variable $[upcase $[tree]]_INSTALL is not set! $[filter -D%,$[C++FLAGS]] \ $[INTERROGATE_OPTIONS] \ $[if $[INTERROGATE_PYTHON_INTERFACE],-python] \ + $[if $[<= $[OPTIMIZE], 1],-spam] \ $[if $[INTERROGATE_C_INTERFACE],-c] diff --git a/dtool/pptempl/Template.gmsvc.pp b/dtool/pptempl/Template.gmsvc.pp index 77d59f1c0c..7e38dbef13 100644 --- a/dtool/pptempl/Template.gmsvc.pp +++ b/dtool/pptempl/Template.gmsvc.pp @@ -384,7 +384,7 @@ $[install_igatedb_dir]/$[igatedb] : $[so_dir]/$[igatedb] $[so_dir]/stamp $[so_dir]/$[igatedb] : $[so_dir]/$[igateoutput] lib$[TARGET]_igatescan = $[igatescan] -$[so_dir]/$[igateoutput] : $[filter-out %.c %.cxx,$[igatescan]] $[so_dir]/stamp +$[so_dir]/$[igateoutput] : $[sort $[patsubst ./%.h,%.h,./%.I,%.I,%,,$[dependencies $[igatescan]] $[igatescan:%=./%]]] $[so_dir]/stamp interrogate -od $[so_dir]/$[igatedb] -oc $[so_dir]/$[igateoutput] $[interrogate_options] -module "$[igatemod]" -library "$[igatelib]" $(lib$[TARGET]_igatescan) #define target $[igateoutput:%.cxx=$[so_dir]/%.obj] diff --git a/dtool/pptempl/Template.msvc.pp b/dtool/pptempl/Template.msvc.pp index 1fd56cae3a..e263574273 100644 --- a/dtool/pptempl/Template.msvc.pp +++ b/dtool/pptempl/Template.msvc.pp @@ -361,7 +361,7 @@ $[install_igatedb_dir]\$[igatedb] : $[so_dir]\$[igatedb] copy $[so_dir]\$[local] $[dest] lib$[TARGET]_igatescan = $[osfilename $[igatescan]] -$[so_dir]\$[igatedb] $[so_dir]\$[igateoutput] : $[filter-out %.c %.cxx,$[igatescan]] +$[so_dir]\$[igatedb] $[so_dir]\$[igateoutput] : $[sort $[patsubst ./%.h,%.h,./%.I,%.I,%,,$[dependencies $[igatescan]] $[igatescan:%=./%]]] // We use forward slash for interrogate because it prefers those. interrogate -od $[so_dir]/$[igatedb] -oc $[so_dir]/$[igateoutput] $[interrogate_options] -module "$[igatemod]" -library "$[igatelib]" $(lib$[TARGET]_igatescan) diff --git a/dtool/pptempl/Template.unix.pp b/dtool/pptempl/Template.unix.pp index cb6455827f..7122a01312 100644 --- a/dtool/pptempl/Template.unix.pp +++ b/dtool/pptempl/Template.unix.pp @@ -316,8 +316,12 @@ $[install_igatedb_dir]/$[igatedb] : $[so_dir]/$[igatedb] #define dest $[install_igatedb_dir] cd ./$[so_dir]; $[INSTALL] +// We have to split this out as a separate rule to properly support +// parallel make. +$[so_dir]/$[igatedb] : $[so_dir]/$[igateoutput] + lib$[TARGET]_igatescan = $[igatescan] -$[so_dir]/$[igatedb] $[so_dir]/$[igateoutput] : $[filter-out %.c %.cxx,$[igatescan]] +$[so_dir]/$[igateoutput] : $[sort $[patsubst ./%.h,%.h,./%.I,%.I,%,,$[dependencies $[igatescan]] $[igatescan:%=./%]]] interrogate -od $[so_dir]/$[igatedb] -oc $[so_dir]/$[igateoutput] $[interrogate_options] -module "$[igatemod]" -library "$[igatelib]" $(lib$[TARGET]_igatescan) #define target $[igateoutput:%.cxx=$[so_dir]/%.o] diff --git a/dtool/src/dconfig/dconfig.h b/dtool/src/dconfig/dconfig.h index a7f1e5abf1..a7ca74d6ea 100644 --- a/dtool/src/dconfig/dconfig.h +++ b/dtool/src/dconfig/dconfig.h @@ -64,6 +64,7 @@ class Config { static ConfigString Get(const ConfigString sym); static ConfigTable::Symbol& GetAll(const ConfigString, ConfigTable::Symbol&); + PUBLISHED: static bool GetBool(const ConfigString sym, bool def = false); static int GetInt(const ConfigString sym, int def = 0); static float GetFloat(const ConfigString sym, float def = 0.); diff --git a/dtool/src/dconfig/notify.h b/dtool/src/dconfig/notify.h index d8114323dd..ccfd9e1e3c 100644 --- a/dtool/src/dconfig/notify.h +++ b/dtool/src/dconfig/notify.h @@ -30,7 +30,7 @@ // respected according to the wishes of the user. //////////////////////////////////////////////////////////////////// class EXPCL_DTOOL Notify { -public: +PUBLISHED: Notify(); ~Notify(); diff --git a/dtool/src/dconfig/notifyCategory.h b/dtool/src/dconfig/notifyCategory.h index 2380790cfb..72bd1faa3b 100644 --- a/dtool/src/dconfig/notifyCategory.h +++ b/dtool/src/dconfig/notifyCategory.h @@ -27,7 +27,7 @@ private: NotifyCategory(const string &fullname, const string &basename, NotifyCategory *parent); -public: +PUBLISHED: INLINE string get_fullname() const; INLINE string get_basename() const; INLINE NotifySeverity get_severity() const; diff --git a/dtool/src/dconfig/notifySeverity.h b/dtool/src/dconfig/notifySeverity.h index 1b60c92292..00f08f6a08 100644 --- a/dtool/src/dconfig/notifySeverity.h +++ b/dtool/src/dconfig/notifySeverity.h @@ -8,6 +8,7 @@ #include +BEGIN_PUBLISH enum NotifySeverity { NS_unspecified, // Never used, a special case internally. NS_spam, @@ -17,6 +18,7 @@ enum NotifySeverity { NS_error, // Specifically, a recoverable error. NS_fatal // A nonrecoverable error--expect abort() or core dump. }; +END_PUBLISH EXPCL_DTOOL ostream &operator << (ostream &out, NotifySeverity severity); diff --git a/dtool/src/dtoolutil/dSearchPath.h b/dtool/src/dtoolutil/dSearchPath.h index fa6bcf6980..86d562ee93 100644 --- a/dtool/src/dtoolutil/dSearchPath.h +++ b/dtool/src/dtoolutil/dSearchPath.h @@ -24,7 +24,7 @@ class EXPCL_DTOOL DSearchPath { public: class Results { - public: + PUBLISHED: Results(); Results(const Results ©); void operator = (const Results ©); @@ -40,7 +40,7 @@ public: friend class DSearchPath; }; -public: +PUBLISHED: DSearchPath(); DSearchPath(const string &path, const string &delimiters = ": \t\n"); DSearchPath(const DSearchPath ©); diff --git a/dtool/src/dtoolutil/filename.h b/dtool/src/dtoolutil/filename.h index a9565ef50a..02d8dffc01 100644 --- a/dtool/src/dtoolutil/filename.h +++ b/dtool/src/dtoolutil/filename.h @@ -37,7 +37,7 @@ class DSearchPath; // fstream for reading or writing. //////////////////////////////////////////////////////////////////// class EXPCL_DTOOL Filename { -public: +PUBLISHED: enum Type { // These type values must fit within the bits allocated for // F_type, below. @@ -46,14 +46,15 @@ public: T_executable = 0x02, // Perhaps other types will be added later. }; - + +public: enum Flags { F_type = 0x0f, F_binary = 0x10, F_text = 0x20, }; -public: +PUBLISHED: INLINE Filename(const string &filename = ""); INLINE Filename(const char *filename); INLINE Filename(const Filename ©); diff --git a/dtool/src/interrogate/interrogate.cxx b/dtool/src/interrogate/interrogate.cxx index 185a930ad8..ddb4c4788f 100644 --- a/dtool/src/interrogate/interrogate.cxx +++ b/dtool/src/interrogate/interrogate.cxx @@ -35,6 +35,7 @@ bool build_c_wrappers = false; bool build_python_wrappers = false; bool save_unique_names = false; bool no_database = false; +bool generate_spam = false; CPPVisibility min_vis = V_published; string library_name; string module_name; @@ -61,6 +62,7 @@ enum CommandOptions { CO_nodb, CO_longlong, CO_promiscuous, + CO_spam, CO_help, }; @@ -82,6 +84,7 @@ static struct option long_options[] = { { "nodb", no_argument, NULL, CO_nodb }, { "longlong", required_argument, NULL, CO_longlong }, { "promiscuous", no_argument, NULL, CO_promiscuous }, + { "spam", no_argument, NULL, CO_spam }, { "help", no_argument, NULL, CO_help }, { NULL } }; @@ -233,7 +236,11 @@ void show_help() { << " -promiscuous\n" << " Export *all* public symbols, functions, and classes seen, even those\n" - << " not explicitly marked to be published.\n\n"; + << " not explicitly marked to be published.\n\n" + + << " -spam\n" + << " Generate wrapper functions that report each invocation to Notify.\n" + << " This can sometimes be useful for tracking down bugs.\n\n"; } // handle commandline -D options @@ -356,6 +363,10 @@ main(int argc, char *argv[]) { min_vis = V_public; break; + case CO_spam: + generate_spam = true; + break; + case 'h': case CO_help: show_help(); diff --git a/dtool/src/interrogate/interrogate.h b/dtool/src/interrogate/interrogate.h index 3536bac59d..494cbdcb00 100644 --- a/dtool/src/interrogate/interrogate.h +++ b/dtool/src/interrogate/interrogate.h @@ -29,6 +29,7 @@ extern bool build_c_wrappers; extern bool build_python_wrappers; extern bool save_unique_names; extern bool no_database; +extern bool generate_spam; extern CPPVisibility min_vis; extern string library_name; extern string module_name; diff --git a/dtool/src/interrogate/interrogateBuilder.cxx b/dtool/src/interrogate/interrogateBuilder.cxx index 3d1ddac974..1fd9da06a9 100644 --- a/dtool/src/interrogate/interrogateBuilder.cxx +++ b/dtool/src/interrogate/interrogateBuilder.cxx @@ -317,6 +317,13 @@ write_code(ostream &out, InterrogateModuleDef *def) { out << "#include \n\n"; } + if (generate_spam) { + out << "#include \n" + << "#include \n\n" + << "NotifyCategoryDecl(in_" << library_name << ", EXPCL_MISC, EXPTP_MISC);\n" + << "NotifyCategoryDef(in_" << library_name << ", interrogatedb_cat);\n\n"; + } + // Now, define all of our wrappers. out << "extern \"C\" {\n\n"; @@ -2109,8 +2116,20 @@ define_method(CPPInstance *function, InterrogateType &itype, // The function is a template function, not a true function. return; } + + // As a special kludgey extension, we consider a public static + // method called "get_class_type()" to be marked published, even if + // it is not. This allows us to export all of the TypeHandle system + // stuff without having to specifically flag get_class_type() as + // published. + bool force_publish = false; + if (function->get_simple_name() == "get_class_type" && + (function->_storage_class && CPPInstance::SC_static) != 0 && + function->_vis <= V_public) { + force_publish = true; + } - if (function->_vis > min_vis) { + if (!force_publish && function->_vis > min_vis) { // The function is not marked to be exported. if ((ftype->_flags & CPPFunctionType::F_destructor) != 0) { itype._flags |= InterrogateType::F_private_destructor; diff --git a/dtool/src/interrogate/typeManager.cxx b/dtool/src/interrogate/typeManager.cxx index 1d7abf073b..376d7e5524 100644 --- a/dtool/src/interrogate/typeManager.cxx +++ b/dtool/src/interrogate/typeManager.cxx @@ -723,7 +723,38 @@ involves_unpublished(CPPType *type) { case CPPDeclaration::ST_pointer: return involves_unpublished(type->as_pointer_type()->_pointing_at); + case CPPDeclaration::ST_struct: + // A struct type is unpublished only if all of its members are + // unpublished. + if (type->_declaration != (CPPTypeDeclaration *)NULL) { + if (type->_declaration->_vis <= min_vis) { + return false; + } + } + { + CPPScope *scope = type->as_struct_type()->_scope; + + bool any_exported = false; + CPPScope::Declarations::const_iterator di; + for (di = scope->_declarations.begin(); + di != scope->_declarations.end() && !any_exported; + ++di) { + if ((*di)->_vis <= min_vis) { + any_exported = true; + } + } + + return !any_exported; + } + case CPPDeclaration::ST_function: + if (type->_declaration != (CPPTypeDeclaration *)NULL) { + if (type->_declaration->_vis <= min_vis) { + return false; + } + } + return true; + /* { CPPFunctionType *ftype = type->as_function_type(); if (involves_unpublished(ftype->_return_type)) { @@ -739,6 +770,7 @@ involves_unpublished(CPPType *type) { } return false; } + */ default: if (type->_declaration != (CPPTypeDeclaration *)NULL) { diff --git a/dtool/src/interrogate/wrapperBuilder.cxx b/dtool/src/interrogate/wrapperBuilder.cxx index 4f05a54cdc..f20790a9c7 100644 --- a/dtool/src/interrogate/wrapperBuilder.cxx +++ b/dtool/src/interrogate/wrapperBuilder.cxx @@ -615,9 +615,63 @@ call_function(ostream &out, int indent_level, bool convert_result, return return_expr; } +//////////////////////////////////////////////////////////////////// +// Function: WrapperBuilder::write_spam_message +// Access: Protected +// Description: Generates the lines of code at the beginning of the +// wrapper function that output a message when the +// wrapper is called. This is output only if -spam is +// specified on the command line. +//////////////////////////////////////////////////////////////////// +void WrapperBuilder:: +write_spam_message(ostream &out) const { + if (generate_spam) { + out << "#ifndef NDEBUG\n" + << " if (in_" << library_name << "_cat.is_spam()) {\n" + << " in_" << library_name << "_cat.spam()\n" + << " << \""; + write_quoted_string(out, _description); + out << "\\n\";\n" + << " }\n" + << "#endif\n"; + } +} + +//////////////////////////////////////////////////////////////////// +// Function: WrapperBuilder::write_quoted_string +// Access: Protected +// Description: Writes the string to the given output stream, as if +// it were quoted within double quotes in a C program. +// Specifically, this escapes characters that need to be +// escaped, and otherwise leaves the string unchanged. +//////////////////////////////////////////////////////////////////// +void WrapperBuilder:: +write_quoted_string(ostream &out, const string &str) const { + string::const_iterator si; + for (si = str.begin(); si != str.end(); ++si) { + switch (*si) { + case '\n': + out << "\\n"; + break; + + case '\t': + out << "\\t"; + break; + + case '\\': + case '"': + out << '\\'; + // fall through + + default: + out << *si; + } + } +} + //////////////////////////////////////////////////////////////////// // Function: WrapperBuilder::indent -// Access: Protected, Static +// Access: Public, Static // Description: //////////////////////////////////////////////////////////////////// ostream &WrapperBuilder:: diff --git a/dtool/src/interrogate/wrapperBuilder.h b/dtool/src/interrogate/wrapperBuilder.h index 4981a8dc11..dffe54bba7 100644 --- a/dtool/src/interrogate/wrapperBuilder.h +++ b/dtool/src/interrogate/wrapperBuilder.h @@ -112,6 +112,8 @@ protected: bool convert_result = true, const vector &pexprs = vector()) const; + void write_quoted_string(ostream &out, const string &str) const; + bool _is_valid; bool _return_value_needs_management; FunctionIndex _return_value_destructor; diff --git a/dtool/src/interrogate/wrapperBuilderC.cxx b/dtool/src/interrogate/wrapperBuilderC.cxx index 969fcf1fd7..dba510bf1b 100644 --- a/dtool/src/interrogate/wrapperBuilderC.cxx +++ b/dtool/src/interrogate/wrapperBuilderC.cxx @@ -67,6 +67,8 @@ write_wrapper(ostream &out, const string &wrapper_name) const { } out << ") {\n"; + write_spam_message(out); + string return_expr = call_function(out, 2); return_expr = manage_return_value(out, 2, return_expr); if (!return_expr.empty()) { diff --git a/dtool/src/interrogate/wrapperBuilderPython.cxx b/dtool/src/interrogate/wrapperBuilderPython.cxx index b6d93c9213..72edecad84 100644 --- a/dtool/src/interrogate/wrapperBuilderPython.cxx +++ b/dtool/src/interrogate/wrapperBuilderPython.cxx @@ -51,6 +51,8 @@ write_wrapper(ostream &out, const string &wrapper_name) const { out << "PyObject *\n" << wrapper_name << "(PyObject *, PyObject *args) {\n"; + write_spam_message(out); + int pn; string format_specifiers; diff --git a/dtool/src/interrogatedb/Sources.pp b/dtool/src/interrogatedb/Sources.pp index be6ccb7861..716461e6c6 100644 --- a/dtool/src/interrogatedb/Sources.pp +++ b/dtool/src/interrogatedb/Sources.pp @@ -21,12 +21,12 @@ #define INSTALL_HEADERS \ interrogate_interface.h interrogate_request.h \ - vector_int.h + vector_int.h config_interrogatedb.h // These are temporary; they need not be installed in the future. These are // necessary only when using template stopgap. #define INSTALL_HEADERS \ - interrogate_interface.h interrogate_request.h \ + $[INSTALL_HEADERS] \ interrogateComponent.h interrogateComponent.I \ interrogateType.h interrogateType.I \ interrogateFunction.h interrogateFunction.I \ @@ -34,6 +34,6 @@ interrogateManifest.h interrogateManifest.I \ interrogateElement.h interrogateElement.I \ interrogateDatabase.h interrogateDatabase.I \ - indexRemapper.h vector_int.h + indexRemapper.h #end lib_target diff --git a/panda/src/audio/audio_manager.h b/panda/src/audio/audio_manager.h index ba2a7a2732..392cd8a825 100644 --- a/panda/src/audio/audio_manager.h +++ b/panda/src/audio/audio_manager.h @@ -45,6 +45,7 @@ public: static void set_update_func(UpdateFunc*); static void set_shutdown_func(ShutdownFunc*); +PUBLISHED: INLINE static void play(AudioSound*); INLINE static void stop(AudioSound*); INLINE static void set_loop(AudioSound*, bool); diff --git a/panda/src/audio/audio_pool.h b/panda/src/audio/audio_pool.h index a68e8ae365..7c51445a3b 100644 --- a/panda/src/audio/audio_pool.h +++ b/panda/src/audio/audio_pool.h @@ -30,6 +30,7 @@ private: public: typedef AudioTraits::SoundClass* SoundLoadFunc(Filename); +PUBLISHED: INLINE static bool has_sound(const string& filename); INLINE static bool verify_sound(const string& filename); INLINE static AudioSound* load_sound(const string& filename); diff --git a/panda/src/chan/animBundle.h b/panda/src/chan/animBundle.h index b27a869f23..da219de320 100644 --- a/panda/src/chan/animBundle.h +++ b/panda/src/chan/animBundle.h @@ -19,7 +19,7 @@ // channels in the hierarchy (which must all match). //////////////////////////////////////////////////////////////////// class EXPCL_PANDA AnimBundle : public AnimGroup { -public: +PUBLISHED: INLINE AnimBundle(const string &name, float fps, int num_frames); INLINE double get_base_frame_rate() const; diff --git a/panda/src/chan/animBundleNode.h b/panda/src/chan/animBundleNode.h index 0e9ca6f85c..365b73aa1b 100644 --- a/panda/src/chan/animBundleNode.h +++ b/panda/src/chan/animBundleNode.h @@ -21,7 +21,7 @@ // instance. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA AnimBundleNode : public NamedNode { -public: +PUBLISHED: INLINE AnimBundleNode(AnimBundle *bundle); INLINE AnimBundleNode(const AnimBundleNode ©); INLINE void operator = (const AnimBundleNode ©); diff --git a/panda/src/chan/animControl.h b/panda/src/chan/animControl.h index 1a46e6db0e..86459d90ea 100644 --- a/panda/src/chan/animControl.h +++ b/panda/src/chan/animControl.h @@ -35,6 +35,7 @@ class EXPCL_PANDA AnimControl : public ReferenceCount { public: AnimControl(PartBundle *part, AnimBundle *anim, int channel_index); +PUBLISHED: void play(const CPT_Event &stop_event = NULL); void play(int from, int to, const CPT_Event &stop_event = NULL); void loop(bool restart); diff --git a/panda/src/chan/animControlCollection.h b/panda/src/chan/animControlCollection.h index 7d62019321..9ef7636f3b 100644 --- a/panda/src/chan/animControlCollection.h +++ b/panda/src/chan/animControlCollection.h @@ -27,7 +27,7 @@ // delete it, unbinding its animation). //////////////////////////////////////////////////////////////////// class EXPCL_PANDA AnimControlCollection { -public: +PUBLISHED: AnimControlCollection(); ~AnimControlCollection(); diff --git a/panda/src/chan/auto_bind.h b/panda/src/chan/auto_bind.h index 760e6402f6..1225db855b 100644 --- a/panda/src/chan/auto_bind.h +++ b/panda/src/chan/auto_bind.h @@ -13,6 +13,7 @@ class Node; +BEGIN_PUBLISH //////////////////////////////////////////////////////////////////// // Function: auto_bind // Description: Walks the scene graph or subgraph beginning at the @@ -25,6 +26,7 @@ class Node; EXPCL_PANDA void auto_bind(Node *root_node, AnimControlCollection &controls, int hierarchy_match_flags = 0); +END_PUBLISH #endif diff --git a/panda/src/chan/movingPartBase.cxx b/panda/src/chan/movingPartBase.cxx index cd9f739810..2ae5beb617 100644 --- a/panda/src/chan/movingPartBase.cxx +++ b/panda/src/chan/movingPartBase.cxx @@ -67,7 +67,7 @@ do_update(PartBundle *root, PartGroup *parent, ++bci) { AnimControl *control = (*bci); int channel_index = control->get_channel_index(); - nassertv(channel_index >= 0 && channel_index < _channels.size()); + nassertv(channel_index >= 0 && channel_index < (int)_channels.size()); AnimChannelBase *channel = _channels[channel_index]; nassertv(channel != (AnimChannelBase*)0L); @@ -124,7 +124,7 @@ pick_channel_index(list &holes, int &next) const { int hole = (*ii); nassertv(hole >= 0 && hole < next); - if (hole < _channels.size() || + if (hole < (int)_channels.size() || _channels[hole] != (AnimChannelBase *)NULL) { // We can't accept this hole; we're using it! holes.erase(ii); @@ -133,9 +133,9 @@ pick_channel_index(list &holes, int &next) const { } // Now do we have any more to restrict? - if (next < _channels.size()) { + if (next < (int)_channels.size()) { int i; - for (i = next; i < _channels.size(); i++) { + for (i = next; i < (int)_channels.size(); i++) { if (_channels[i] == (AnimChannelBase*)0L) { // Here's a hole we do have. holes.push_back(i); @@ -157,7 +157,7 @@ pick_channel_index(list &holes, int &next) const { //////////////////////////////////////////////////////////////////// void MovingPartBase:: bind_hierarchy(AnimGroup *anim, int channel_index) { - while (_channels.size() <= channel_index) { + while ((int)_channels.size() <= channel_index) { _channels.push_back((AnimChannelBase*)0L); } diff --git a/panda/src/chan/partBundle.h b/panda/src/chan/partBundle.h index 199ee13c7d..a57cef1c0d 100644 --- a/panda/src/chan/partBundle.h +++ b/panda/src/chan/partBundle.h @@ -75,6 +75,7 @@ public: PartBundle(const string &name = ""); virtual PartGroup *make_copy() const; +PUBLISHED: void set_blend_type(BlendType bt); INLINE BlendType get_blend_type() const; @@ -94,7 +95,7 @@ public: INLINE const ChannelBlend &get_blend_map() const; -public: +PUBLISHED: virtual void output(ostream &out) const; virtual void write(ostream &out, int indent_level) const; diff --git a/panda/src/chan/partBundleNode.h b/panda/src/chan/partBundleNode.h index 021abf1a7d..1b3873eb4d 100644 --- a/panda/src/chan/partBundleNode.h +++ b/panda/src/chan/partBundleNode.h @@ -29,6 +29,7 @@ protected: public: virtual bool safe_to_flatten() const; +PUBLISHED: INLINE PartBundle *get_bundle() const; private: diff --git a/panda/src/chan/partGroup.h b/panda/src/chan/partGroup.h index 52e88c29d2..d5fd3fc48e 100644 --- a/panda/src/chan/partGroup.h +++ b/panda/src/chan/partGroup.h @@ -97,9 +97,13 @@ public: return get_class_type(); } virtual TypeHandle force_init_type() {init_type(); return get_class_type();} + +PUBLISHED: static TypeHandle get_class_type() { return _type_handle; } + +public: static void init_type() { TypedWriteableReferenceCount::init_type(); register_type(_type_handle, "PartGroup", diff --git a/panda/src/char/character.cxx b/panda/src/char/character.cxx index 54d8af6666..e7f8ba68e5 100644 --- a/panda/src/char/character.cxx +++ b/panda/src/char/character.cxx @@ -115,7 +115,10 @@ app_traverse() { //////////////////////////////////////////////////////////////////// // Function: Character::update // Access: Public -// Description: +// Description: Recalculates the character's joints and vertices for +// the current frame. Normally this is performed +// automatically during the render and need not be +// called explicitly. //////////////////////////////////////////////////////////////////// void Character:: update() { diff --git a/panda/src/char/character.h b/panda/src/char/character.h index 478b817d70..4f625356ef 100644 --- a/panda/src/char/character.h +++ b/panda/src/char/character.h @@ -36,13 +36,17 @@ public: virtual bool safe_to_transform() const; +PUBLISHED: INLINE CharacterJointBundle *get_bundle() const; INLINE ComputedVertices *get_computed_vertices() const; INLINE int get_num_parts() const; INLINE PartGroup *get_part(int n) const; +public: virtual void app_traverse(); + +PUBLISHED: void update(); private: diff --git a/panda/src/char/characterJoint.h b/panda/src/char/characterJoint.h index b00921c88c..709ca3690a 100644 --- a/panda/src/char/characterJoint.h +++ b/panda/src/char/characterJoint.h @@ -32,6 +32,7 @@ public: virtual void update_internals(PartGroup *parent, bool self_changed, bool parent_changed); +PUBLISHED: bool add_net_transform(NodeRelation *arc); bool remove_net_transform(NodeRelation *arc); bool has_net_transform(NodeRelation *arc) const; diff --git a/panda/src/char/characterJointBundle.h b/panda/src/char/characterJointBundle.h index dd471ae307..30c032506a 100644 --- a/panda/src/char/characterJointBundle.h +++ b/panda/src/char/characterJointBundle.h @@ -26,8 +26,10 @@ protected: public: CharacterJointBundle(const string &name = ""); +PUBLISHED: INLINE Character *get_node() const; +public: virtual PartGroup *make_copy() const; static void register_with_read_factory(void); diff --git a/panda/src/chat/chatInput.h b/panda/src/chat/chatInput.h index ca1f625140..243a3db393 100644 --- a/panda/src/chat/chatInput.h +++ b/panda/src/chat/chatInput.h @@ -25,8 +25,7 @@ // Description : Reads keyboard input in as that of a chat. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA ChatInput : public DataNode { - -public: +PUBLISHED: ChatInput(TextNode* text_node, const string& name = ""); void reset(void); diff --git a/panda/src/collide/collisionEntry.h b/panda/src/collide/collisionEntry.h index fff0737c20..c8672cc76b 100644 --- a/panda/src/collide/collisionEntry.h +++ b/panda/src/collide/collisionEntry.h @@ -35,6 +35,7 @@ public: CollisionEntry(const CollisionEntry ©); void operator = (const CollisionEntry ©); +PUBLISHED: INLINE const CollisionSolid *get_from() const; INLINE bool has_into() const; INLINE const CollisionSolid *get_into() const; diff --git a/panda/src/collide/collisionHandlerEvent.h b/panda/src/collide/collisionHandlerEvent.h index cd1e1d35ee..cf0a687dad 100644 --- a/panda/src/collide/collisionHandlerEvent.h +++ b/panda/src/collide/collisionHandlerEvent.h @@ -24,13 +24,15 @@ // triggered it. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA CollisionHandlerEvent : public CollisionHandler { -public: +PUBLISHED: CollisionHandlerEvent(); +public: virtual void begin_group(); virtual void add_entry(CollisionEntry *entry); virtual void end_group(); +PUBLISHED: INLINE void set_in_pattern(const string &pattern); INLINE string get_in_pattern() const; INLINE void set_out_pattern(const string &pattern); diff --git a/panda/src/collide/collisionHandlerFloor.h b/panda/src/collide/collisionHandlerFloor.h index 04850f783c..a3ebdf07be 100644 --- a/panda/src/collide/collisionHandlerFloor.h +++ b/panda/src/collide/collisionHandlerFloor.h @@ -21,7 +21,7 @@ // avatar's head. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA CollisionHandlerFloor : public CollisionHandlerPhysical { -public: +PUBLISHED: CollisionHandlerFloor(); virtual ~CollisionHandlerFloor(); diff --git a/panda/src/collide/collisionHandlerPhysical.h b/panda/src/collide/collisionHandlerPhysical.h index aab92e6669..9f30d33bc6 100644 --- a/panda/src/collide/collisionHandlerPhysical.h +++ b/panda/src/collide/collisionHandlerPhysical.h @@ -30,6 +30,7 @@ public: virtual void add_entry(CollisionEntry *entry); virtual void end_group(); +PUBLISHED: void add_collider(CollisionNode *node, DriveInterface *drive_interface); void add_collider(CollisionNode *node, NodeRelation *arc); bool remove_collider(CollisionNode *node); diff --git a/panda/src/collide/collisionHandlerPusher.h b/panda/src/collide/collisionHandlerPusher.h index fce0b3a232..f7952122cb 100644 --- a/panda/src/collide/collisionHandlerPusher.h +++ b/panda/src/collide/collisionHandlerPusher.h @@ -19,7 +19,7 @@ // collisions you can have. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA CollisionHandlerPusher : public CollisionHandlerPhysical { -public: +PUBLISHED: CollisionHandlerPusher(); virtual ~CollisionHandlerPusher(); diff --git a/panda/src/collide/collisionHandlerQueue.h b/panda/src/collide/collisionHandlerQueue.h index 8b5634941c..d7e4d730bf 100644 --- a/panda/src/collide/collisionHandlerQueue.h +++ b/panda/src/collide/collisionHandlerQueue.h @@ -21,12 +21,14 @@ // e.g. for picking from the window. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA CollisionHandlerQueue : public CollisionHandler { -public: +PUBLISHED: CollisionHandlerQueue(); +public: virtual void begin_group(); virtual void add_entry(CollisionEntry *entry); +PUBLISHED: void sort_entries(); int get_num_entries() const; diff --git a/panda/src/collide/collisionNode.cxx b/panda/src/collide/collisionNode.cxx index 31f3040d25..7e2e3e2707 100644 --- a/panda/src/collide/collisionNode.cxx +++ b/panda/src/collide/collisionNode.cxx @@ -100,7 +100,7 @@ xform(const LMatrix4f &mat) { // We may have to copy each of our solids as we transform them if // someone else is sharing their pointers. - if (solid->get_count() > 1) { + if (solid->get_ref_count() > 1) { solid = solid->make_copy(); (*si) = solid; } diff --git a/panda/src/collide/collisionNode.h b/panda/src/collide/collisionNode.h index 64eba77e01..d02036d218 100644 --- a/panda/src/collide/collisionNode.h +++ b/panda/src/collide/collisionNode.h @@ -22,15 +22,17 @@ // world and running into things. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA CollisionNode : public NamedNode { -public: +PUBLISHED: CollisionNode(const string &name = ""); + +public: CollisionNode(const CollisionNode ©); void operator = (const CollisionNode ©); virtual ~CollisionNode(); - virtual Node *make_copy() const; virtual void xform(const LMatrix4f &mat); +PUBLISHED: INLINE void set_collide_mask(CollideMask mask); INLINE void set_from_collide_mask(CollideMask mask); INLINE void set_into_collide_mask(CollideMask mask); @@ -45,6 +47,7 @@ public: INLINE void remove_solid(int n); INLINE int add_solid(CollisionSolid *solid); +public: virtual void draw_traverse(); virtual void output(ostream &out) const; diff --git a/panda/src/collide/collisionPlane.h b/panda/src/collide/collisionPlane.h index 54b2b58ab6..655c056f79 100644 --- a/panda/src/collide/collisionPlane.h +++ b/panda/src/collide/collisionPlane.h @@ -21,10 +21,11 @@ class EXPCL_PANDA CollisionPlane : public CollisionSolid { protected: INLINE CollisionPlane(); -public: +PUBLISHED: INLINE CollisionPlane(const Planef &plane); INLINE CollisionPlane(const CollisionPlane ©); +public: virtual CollisionSolid *make_copy(); virtual int @@ -33,9 +34,9 @@ public: const CollisionSolid *into) const; virtual void xform(const LMatrix4f &mat); - virtual void output(ostream &out) const; +PUBLISHED: INLINE LVector3f get_normal() const; INLINE float dist_to_plane(const LPoint3f &point) const; diff --git a/panda/src/collide/collisionPolygon.h b/panda/src/collide/collisionPolygon.h index c85c01ed99..a29f171fc6 100644 --- a/panda/src/collide/collisionPolygon.h +++ b/panda/src/collide/collisionPolygon.h @@ -17,12 +17,14 @@ // Description : //////////////////////////////////////////////////////////////////// class EXPCL_PANDA CollisionPolygon : public CollisionPlane { -public: +PUBLISHED: INLINE CollisionPolygon(const LPoint3f &a, const LPoint3f &b, const LPoint3f &c); INLINE CollisionPolygon(const LPoint3f &a, const LPoint3f &b, const LPoint3f &c, const LPoint3f &d); INLINE CollisionPolygon(const LPoint3f *begin, const LPoint3f *end); + +public: CollisionPolygon(const CollisionPolygon ©); virtual CollisionSolid *make_copy(); diff --git a/panda/src/collide/collisionRay.h b/panda/src/collide/collisionRay.h index 8739251d35..32c0a3cfdc 100644 --- a/panda/src/collide/collisionRay.h +++ b/panda/src/collide/collisionRay.h @@ -21,13 +21,14 @@ class ProjectionNode; // effects. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA CollisionRay : public CollisionSolid { -public: +PUBLISHED: INLINE CollisionRay(); INLINE CollisionRay(const LPoint3f &origin, const LVector3f &direction); INLINE CollisionRay(float ox, float oy, float oz, float dx, float dy, float dz); - INLINE CollisionRay(const CollisionRay ©); +public: + INLINE CollisionRay(const CollisionRay ©); virtual CollisionSolid *make_copy(); virtual int @@ -39,6 +40,7 @@ public: virtual void output(ostream &out) const; +PUBLISHED: INLINE void set_origin(const LPoint3f &origin); INLINE void set_origin(float x, float y, float z); INLINE const LPoint3f &get_origin() const; diff --git a/panda/src/collide/collisionSolid.h b/panda/src/collide/collisionSolid.h index 268b95c752..278a21465d 100644 --- a/panda/src/collide/collisionSolid.h +++ b/panda/src/collide/collisionSolid.h @@ -43,9 +43,11 @@ public: virtual CollisionSolid *make_copy()=0; +PUBLISHED: INLINE void set_tangible(bool tangible); INLINE bool is_tangible() const; +public: virtual int test_intersection(CollisionHandler *record, const CollisionEntry &entry, @@ -55,6 +57,7 @@ public: void update_viz(Node *parent); +PUBLISHED: virtual void output(ostream &out) const; virtual void write(ostream &out, int indent_level = 0) const; diff --git a/panda/src/collide/collisionSphere.h b/panda/src/collide/collisionSphere.h index c24f529cad..b92156f6f2 100644 --- a/panda/src/collide/collisionSphere.h +++ b/panda/src/collide/collisionSphere.h @@ -15,11 +15,12 @@ // Description : A spherical collision volume or object. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA CollisionSphere : public CollisionSolid { -public: +PUBLISHED: INLINE CollisionSphere(const LPoint3f ¢er, float radius); INLINE CollisionSphere(float cx, float cy, float cz, float radius); - INLINE CollisionSphere(const CollisionSphere ©); +public: + INLINE CollisionSphere(const CollisionSphere ©); virtual CollisionSolid *make_copy(); virtual int @@ -31,6 +32,7 @@ public: virtual void output(ostream &out) const; +PUBLISHED: INLINE void set_center(const LPoint3f ¢er); INLINE void set_center(float x, float y, float z); INLINE const LPoint3f &get_center() const; diff --git a/panda/src/collide/collisionTraverser.h b/panda/src/collide/collisionTraverser.h index 24d08f4acc..db17138f3b 100644 --- a/panda/src/collide/collisionTraverser.h +++ b/panda/src/collide/collisionTraverser.h @@ -30,7 +30,7 @@ class Geom; //////////////////////////////////////////////////////////////////// class EXPCL_PANDA CollisionTraverser : public TraverserVisitor { -public: +PUBLISHED: CollisionTraverser(TypeHandle graph_type = RenderRelation::get_class_type()); ~CollisionTraverser(); diff --git a/panda/src/cull/cullTraverser.cxx b/panda/src/cull/cullTraverser.cxx index 04df5a4faf..ab44644ecb 100644 --- a/panda/src/cull/cullTraverser.cxx +++ b/panda/src/cull/cullTraverser.cxx @@ -245,7 +245,7 @@ clean_out_old_states() { ++snext; CullState *cs = (*si); - if (cs->get_count() == 1 && cs->is_empty() && !cs->has_bin()) { + if (cs->get_ref_count() == 1 && cs->is_empty() && !cs->has_bin()) { // This CullState doesn't seem to be used anywhere else. _states.erase(si); } diff --git a/panda/src/cull/directRenderTransition.h b/panda/src/cull/directRenderTransition.h index b7c2f8c91b..3aa7faff89 100644 --- a/panda/src/cull/directRenderTransition.h +++ b/panda/src/cull/directRenderTransition.h @@ -30,9 +30,10 @@ // instance decalling, while using the CullTraverser. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA DirectRenderTransition : public ImmediateTransition { -public: +PUBLISHED: INLINE DirectRenderTransition(); - + +public: virtual NodeTransition *make_copy() const; virtual bool has_sub_render() const; diff --git a/panda/src/device/mouse.h b/panda/src/device/mouse.h index 3c88520dbc..b19e5d0aba 100644 --- a/panda/src/device/mouse.h +++ b/panda/src/device/mouse.h @@ -47,11 +47,11 @@ const int MIN_MOVE = 2; // otherwise, the events will be discarded. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA MouseAndKeyboard : public DataNode { -public: - +PUBLISHED: MouseAndKeyboard(GraphicsWindow *window, int device, const string& name = ""); +public: virtual void transmit_data(NodeAttributes &data); public: diff --git a/panda/src/dgraph/Sources.pp b/panda/src/dgraph/Sources.pp index 985789e2d5..2462e4fc27 100644 --- a/panda/src/dgraph/Sources.pp +++ b/panda/src/dgraph/Sources.pp @@ -54,8 +54,8 @@ vectorDataTransition.I vectorDataTransition.h #define IGATESCAN \ - dataNode.cxx dataRelation.cxx \ - dataGraphTraversal.cxx + dataNode.cxx dataNode.h dataRelation.cxx dataRelation.h \ + dataGraphTraversal.cxx dataGraphTraversal.h #end lib_target diff --git a/panda/src/dgraph/dataNode.h b/panda/src/dgraph/dataNode.h index a06cc54f5d..78818e4b77 100644 --- a/panda/src/dgraph/dataNode.h +++ b/panda/src/dgraph/dataNode.h @@ -70,6 +70,7 @@ public: virtual void transmit_data(NodeAttributes &data)=0; +PUBLISHED: void set_spam_mode(bool flag); bool get_spam_mode() const; diff --git a/panda/src/dgraph/dataRelation.h b/panda/src/dgraph/dataRelation.h index 0bf9d95cb7..3534777efe 100644 --- a/panda/src/dgraph/dataRelation.h +++ b/panda/src/dgraph/dataRelation.h @@ -31,10 +31,12 @@ public: private: static NodeRelation *make_arc(const FactoryParams ¶ms); -public: +PUBLISHED: static TypeHandle get_class_type() { return _type_handle; } + +public: static void init_type() { NodeRelation::init_type(); register_type(_type_handle, "DataRelation", diff --git a/panda/src/display/displayRegion.h b/panda/src/display/displayRegion.h index 931c4e08d0..5f62a149dd 100644 --- a/panda/src/display/displayRegion.h +++ b/panda/src/display/displayRegion.h @@ -30,7 +30,6 @@ class GraphicsPipe; //////////////////////////////////////////////////////////////////// class EXPCL_PANDA DisplayRegion : public ReferenceCount { public: - DisplayRegion(GraphicsLayer *); DisplayRegion(GraphicsLayer *, const float l, const float r, @@ -38,6 +37,7 @@ public: DisplayRegion(int xsize, int ysize); virtual ~DisplayRegion(); +PUBLISHED: INLINE void get_dimensions(float &l, float &r, float &b, float &t) const; void set_dimensions(float l, float r, float b, float t); diff --git a/panda/src/display/graphicsChannel.h b/panda/src/display/graphicsChannel.h index 01e71c7845..f1300b41e9 100644 --- a/panda/src/display/graphicsChannel.h +++ b/panda/src/display/graphicsChannel.h @@ -42,6 +42,7 @@ public: GraphicsChannel(GraphicsWindow *); virtual ~GraphicsChannel(); +PUBLISHED: GraphicsLayer *make_layer(int index = -1); int get_num_layers() const; GraphicsLayer *get_layer(int index) const; @@ -51,8 +52,10 @@ public: GraphicsWindow *get_window() const; GraphicsPipe *get_pipe() const; +public: virtual void window_resized(int x, int y); +PUBLISHED: INLINE void set_active(bool active); INLINE bool is_active() const; diff --git a/panda/src/display/graphicsLayer.h b/panda/src/display/graphicsLayer.h index 3777282695..d501f0a16a 100644 --- a/panda/src/display/graphicsLayer.h +++ b/panda/src/display/graphicsLayer.h @@ -44,6 +44,7 @@ protected: public: virtual ~GraphicsLayer(); +PUBLISHED: DisplayRegion *make_display_region(); DisplayRegion *make_display_region(float l, float r, float b, float t); @@ -57,8 +58,10 @@ public: GraphicsWindow *get_window() const; GraphicsPipe *get_pipe() const; +public: void channel_resized(int x, int y); +PUBLISHED: INLINE void set_active(bool active); INLINE bool is_active() const; diff --git a/panda/src/display/graphicsPipe.h b/panda/src/display/graphicsPipe.h index 9629192da0..37bf955456 100644 --- a/panda/src/display/graphicsPipe.h +++ b/panda/src/display/graphicsPipe.h @@ -34,7 +34,7 @@ class glxDisplay; // Description : //////////////////////////////////////////////////////////////////// class EXPCL_PANDA GraphicsPipe : public TypedReferenceCount, public Namable { -public: +PUBLISHED: GraphicsPipe(const PipeSpecifier &spec); virtual ~GraphicsPipe(); @@ -54,6 +54,7 @@ public: static int get_num_pipes(); static GraphicsPipe *get_pipe(int n); +public: // This function's interface must be defined here even though we // know nothing about glx displays at this point. virtual glxDisplay *get_glx_display(); diff --git a/panda/src/display/graphicsWindow.I b/panda/src/display/graphicsWindow.I index 3b2adc8cd9..e5b5cdb873 100644 --- a/panda/src/display/graphicsWindow.I +++ b/panda/src/display/graphicsWindow.I @@ -134,19 +134,6 @@ has_keyboard(int device) const { return _input_devices[device].has_keyboard(); } -//////////////////////////////////////////////////////////////////// -// Function: GraphicsWindow::get_mouse_data -// Access: Public -// Description: Returns the MouseData associated with the nth input -// device. -//////////////////////////////////////////////////////////////////// -INLINE const MouseData &GraphicsWindow:: -get_mouse_data(int device) const { - nassertr(device >= 0 && device < (int)_input_devices.size(), - *(new MouseData)); - return _input_devices[device].get_mouse_data(); -} - //////////////////////////////////////////////////////////////////// // Function: GraphicsWindow::get_modifier_buttons // Access: Public @@ -175,6 +162,19 @@ set_modifier_buttons(int device, const ModifierButtons &mods) { _input_devices[device].set_modifier_buttons(mods); } +//////////////////////////////////////////////////////////////////// +// Function: GraphicsWindow::get_mouse_data +// Access: Public +// Description: Returns the MouseData associated with the nth input +// device. +//////////////////////////////////////////////////////////////////// +INLINE const MouseData &GraphicsWindow:: +get_mouse_data(int device) const { + nassertr(device >= 0 && device < (int)_input_devices.size(), + *(new MouseData)); + return _input_devices[device].get_mouse_data(); +} + //////////////////////////////////////////////////////////////////// // Function: GraphicsWindow::has_button_event // Access: Public diff --git a/panda/src/display/graphicsWindow.h b/panda/src/display/graphicsWindow.h index 5c2efa907d..43bfbac9f1 100644 --- a/panda/src/display/graphicsWindow.h +++ b/panda/src/display/graphicsWindow.h @@ -93,6 +93,8 @@ public: virtual ~GraphicsWindow(); INLINE const GraphicsWindow::Properties& get_properties() const; + +PUBLISHED: INLINE int get_width() const; INLINE int get_height() const; INLINE int get_xorg() const; @@ -104,7 +106,8 @@ public: INLINE void set_frame_number(const int); INLINE int get_frame_number() const; - + +public: virtual void resized(const int, const int); INLINE virtual void set_draw_callback(Callback *c); @@ -123,21 +126,22 @@ public: virtual void make_current(); virtual void unmake_current(); -public: +PUBLISHED: // Mouse and keyboard routines INLINE int get_num_input_devices() const; INLINE string get_input_device_name(int device) const; INLINE bool has_pointer(int device) const; INLINE bool has_keyboard(int device) const; - INLINE const MouseData &get_mouse_data(int device) const; INLINE const ModifierButtons &get_modifier_buttons(int device) const; INLINE void set_modifier_buttons(int device, const ModifierButtons &mods); +public: + INLINE const MouseData &get_mouse_data(int device) const; INLINE bool has_button_event(int device) const; INLINE ButtonEvent get_button_event(int device); -public: +PUBLISHED: // GUI glue methods virtual void flag_redisplay(); virtual void register_draw_function(GraphicsWindow::vfn); @@ -148,6 +152,7 @@ public: virtual bool supports_update() const; virtual void update(); +public: virtual void begin_frame(); virtual void end_frame(); diff --git a/panda/src/downloader/Sources.pp b/panda/src/downloader/Sources.pp index ca5ebc48f4..d6566d317a 100644 --- a/panda/src/downloader/Sources.pp +++ b/panda/src/downloader/Sources.pp @@ -13,6 +13,7 @@ config_downloader.h downloadDb.I \ downloadDb.cxx downloadDb.h \ downloader.I downloader.cxx downloader.h extractor.cxx extractor.h \ + hashVal.cxx hashVal.I hashVal.h \ patcher.cxx \ patcher.h @@ -21,7 +22,7 @@ zcompressor.h download_utils.cxx download_utils.h #define IF_CRYPTO_SOURCES \ - crypto_utils.cxx crypto_utils.h hashVal.cxx hashVal.I hashVal.h + crypto_utils.cxx crypto_utils.h #define INSTALL_HEADERS \ downloader.h downloader.I \ diff --git a/panda/src/downloader/crypto_utils.h b/panda/src/downloader/crypto_utils.h index b786c8ed29..c66f97838c 100644 --- a/panda/src/downloader/crypto_utils.h +++ b/panda/src/downloader/crypto_utils.h @@ -12,8 +12,12 @@ class HashVal; +BEGIN_PUBLISH + EXPCL_PANDAEXPRESS void md5_a_file(const Filename &fname, HashVal &ret); EXPCL_PANDAEXPRESS void md5_a_buffer(uchar *buf, ulong len, HashVal &ret); +END_PUBLISH + #endif diff --git a/panda/src/downloader/downloadDb.h b/panda/src/downloader/downloadDb.h index de1ad27751..000d1ef766 100644 --- a/panda/src/downloader/downloadDb.h +++ b/panda/src/downloader/downloadDb.h @@ -20,7 +20,6 @@ #include #include "hashVal.h" -#include "crypto_utils.h" /* ////////////////////////////////////////////////// diff --git a/panda/src/downloader/download_utils.h b/panda/src/downloader/download_utils.h index 5bced97c75..e780d19985 100644 --- a/panda/src/downloader/download_utils.h +++ b/panda/src/downloader/download_utils.h @@ -10,8 +10,12 @@ #include #include +BEGIN_PUBLISH + EXPCL_PANDAEXPRESS ulong check_crc(Filename name); EXPCL_PANDAEXPRESS ulong check_adler(Filename name); +END_PUBLISH + #endif diff --git a/panda/src/downloader/downloader.h b/panda/src/downloader/downloader.h index b412dca2d9..2a132e3e9e 100644 --- a/panda/src/downloader/downloader.h +++ b/panda/src/downloader/downloader.h @@ -31,7 +31,7 @@ class DownloaderToken; // Description : //////////////////////////////////////////////////////////////////// class EXPCL_PANDAEXPRESS Downloader : public AsyncUtility { -public: +PUBLISHED: Downloader(void); Downloader(PT(Buffer) buffer); virtual ~Downloader(void); diff --git a/panda/src/downloader/extractor.h b/panda/src/downloader/extractor.h index abe7400684..35a4f5e5f4 100644 --- a/panda/src/downloader/extractor.h +++ b/panda/src/downloader/extractor.h @@ -23,13 +23,13 @@ class ExtractorToken; // Description : //////////////////////////////////////////////////////////////////// class EXPCL_PANDAEXPRESS Extractor : public AsyncUtility { -public: +PUBLISHED: Extractor(void); Extractor(PT(Buffer) buffer); virtual ~Extractor(void); int request_extract(const Filename &source_file, - const string &event_name, const Filename &rel_path = ""); + const string &event_name, const Filename &rel_path = ""); bool extract(Filename &source_file, const Filename &rel_path); diff --git a/panda/src/downloader/patcher.h b/panda/src/downloader/patcher.h index 2225168282..e4250875dc 100644 --- a/panda/src/downloader/patcher.h +++ b/panda/src/downloader/patcher.h @@ -23,7 +23,7 @@ class PatcherToken; // Description : Applys a patch asynchronously //////////////////////////////////////////////////////////////////// class EXPCL_PANDAEXPRESS Patcher : public AsyncUtility { -public: +PUBLISHED: Patcher(void); Patcher(PT(Buffer) buffer); virtual ~Patcher(void); diff --git a/panda/src/effects/lensFlareNode.h b/panda/src/effects/lensFlareNode.h index 9a74d380f6..f9ee48b0a6 100644 --- a/panda/src/effects/lensFlareNode.h +++ b/panda/src/effects/lensFlareNode.h @@ -21,7 +21,7 @@ class ClockObject; class EXPCL_PANDA LensFlareNode : public Node { -public: +PUBLISHED: INLINE LensFlareNode(void); void add_flare(PT(Texture) flare, PTA_float scales, PTA_float offsets, @@ -37,6 +37,7 @@ public: INLINE void set_light_source(PT_Node source); +public: virtual bool sub_render(const AllAttributesWrapper &attrib, AllTransitionsWrapper &trans, GraphicsStateGuardianBase *gsgbase); virtual bool has_sub_render() const; diff --git a/panda/src/event/event.h b/panda/src/event/event.h index 6fc794fff0..9acb293f71 100644 --- a/panda/src/event/event.h +++ b/panda/src/event/event.h @@ -24,7 +24,7 @@ class EventReceiver; // on the events (but not necessarily immediately). //////////////////////////////////////////////////////////////////// class EXPCL_PANDAEXPRESS Event : public TypedReferenceCount, public Namable { -public: +PUBLISHED: Event(const string &event_name, EventReceiver *receiver = NULL); Event(const Event ©); void operator = (const Event ©); diff --git a/panda/src/event/eventHandler.h b/panda/src/event/eventHandler.h index 708da1375a..c77a53be85 100644 --- a/panda/src/event/eventHandler.h +++ b/panda/src/event/eventHandler.h @@ -34,11 +34,14 @@ public: typedef void EventFunction(CPT_Event); typedef void EventCallbackFunction(CPT(Event), void*); +PUBLISHED: EventHandler(EventQueue *queue); void process_events(); + virtual void dispatch_event(const CPT_Event &event); +public: bool add_hook(const string &event_name, EventFunction *function); bool add_hook(const string &event_name, EventCallbackFunction *function, void*); diff --git a/panda/src/event/eventParameter.h b/panda/src/event/eventParameter.h index ca488fc2c5..918ac20bec 100644 --- a/panda/src/event/eventParameter.h +++ b/panda/src/event/eventParameter.h @@ -26,7 +26,7 @@ // EventStoreValue template class, defined below. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAEXPRESS EventParameter { -public: +PUBLISHED: INLINE EventParameter(const TypedReferenceCount *ptr); INLINE EventParameter(int value); INLINE EventParameter(double value); diff --git a/panda/src/event/eventQueue.h b/panda/src/event/eventQueue.h index b0a2dc08ab..1481774ce6 100644 --- a/panda/src/event/eventQueue.h +++ b/panda/src/event/eventQueue.h @@ -31,6 +31,7 @@ public: EventQueue(); ~EventQueue(); +PUBLISHED: void queue_event(CPT_Event event); bool is_queue_empty() const; diff --git a/panda/src/express/clockObject.h b/panda/src/express/clockObject.h index abb51e7952..006360c474 100644 --- a/panda/src/express/clockObject.h +++ b/panda/src/express/clockObject.h @@ -36,7 +36,7 @@ // return the time for the current frame. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAEXPRESS ClockObject { -public: +PUBLISHED: enum Mode { M_normal, M_non_real_time, diff --git a/panda/src/express/config_express.cxx b/panda/src/express/config_express.cxx index b6a1f969b2..b6997d4324 100644 --- a/panda/src/express/config_express.cxx +++ b/panda/src/express/config_express.cxx @@ -27,13 +27,25 @@ ConfigureFn(config_express) { } -// Set this true to enable tracking of ReferenceCount pointer -// allocation/deallcation via the MemoryUsage object. This is -// primarily useful for detecting memory leaks. It has no effect when -// compiling in NDEBUG mode. +// Set leak-memory true to disable the actual deletion of +// ReferenceCount-derived objects. This is sometimes useful to track +// a reference counting bug, since the formerly deleted objects will +// still remain (with a reference count of -100) without being +// overwritten with a newly-allocated object, and the assertion tests +// in ReferenceCount may more accurately detect the first instance of +// an error. +bool +get_leak_memory() { + static bool got_leak_memory = false; + static bool leak_memory; -// This variable is no longer defined here; instead, it's a member of -// MemoryUsage. + if (!got_leak_memory) { + leak_memory = config_express.GetBool("leak-memory", false); + got_leak_memory = true; + } + + return leak_memory; +} //const bool track_memory_usage = config_express.GetBool("track-memory-usage", false); diff --git a/panda/src/express/config_express.h b/panda/src/express/config_express.h index 5399a2b853..a963c02f7c 100644 --- a/panda/src/express/config_express.h +++ b/panda/src/express/config_express.h @@ -20,6 +20,8 @@ NotifyCategoryDecl(express, EXPCL_PANDAEXPRESS, EXPTP_PANDAEXPRESS); //extern EXPCL_PANDAEXPRESS const bool track_memory_usage; +bool get_leak_memory(); + extern const int patchfile_window_size; extern const int patchfile_increment_size; extern const int patchfile_buffer_size; diff --git a/panda/src/express/datagram.h b/panda/src/express/datagram.h index 8f44acca97..a57fe0a4ba 100644 --- a/panda/src/express/datagram.h +++ b/panda/src/express/datagram.h @@ -33,7 +33,7 @@ // collection of data elements. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAEXPRESS Datagram : public TypedObject { -public: +PUBLISHED: INLINE Datagram(); INLINE Datagram(const void *data, size_t size); INLINE Datagram(const string &data); diff --git a/panda/src/express/datagramIterator.h b/panda/src/express/datagramIterator.h index 6abc517a81..bc59a4d88d 100644 --- a/panda/src/express/datagramIterator.h +++ b/panda/src/express/datagramIterator.h @@ -18,7 +18,7 @@ // know the correct type and order of each element. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAEXPRESS DatagramIterator { -public: +PUBLISHED: DatagramIterator(const Datagram &datagram, size_t offset = 0); bool get_bool(); diff --git a/panda/src/express/memoryUsage.cxx b/panda/src/express/memoryUsage.cxx index 8de5136d9f..475a2b0fbe 100644 --- a/panda/src/express/memoryUsage.cxx +++ b/panda/src/express/memoryUsage.cxx @@ -5,7 +5,7 @@ #include "memoryUsage.h" #include "memoryUsagePointers.h" -#include "clockObject.h" +#include "trueClock.h" #include "typedReferenceCount.h" #ifndef NDEBUG @@ -334,7 +334,7 @@ ns_record_pointer(ReferenceCount *ptr) { info._ptr = ptr; info._static_type = ReferenceCount::get_class_type(); info._dynamic_type = ReferenceCount::get_class_type(); - info._time = ClockObject::get_global_clock()->get_real_time(); + info._time = TrueClock::get_ptr()->get_real_time(); info._freeze_index = _freeze_index; info._reconsider_dynamic_type = true; @@ -395,7 +395,7 @@ ns_remove_pointer(ReferenceCount *ptr) { MemoryInfo &info = (*ti).second; if (info._freeze_index == _freeze_index) { - double now = ClockObject::get_global_clock()->get_real_time(); + double now = TrueClock::get_ptr()->get_real_time(); _count--; _trend_types.add_info(info.get_type()); _trend_ages.add_info(now - info._time); @@ -427,7 +427,7 @@ ns_get_pointers(MemoryUsagePointers &result) { nassertv(_track_memory_usage); result.clear(); - double now = ClockObject::get_global_clock()->get_real_time(); + double now = TrueClock::get_ptr()->get_real_time(); Table::iterator ti; for (ti = _table.begin(); ti != _table.end(); ++ti) { MemoryInfo &info = (*ti).second; @@ -449,7 +449,7 @@ ns_get_pointers_of_type(MemoryUsagePointers &result, TypeHandle type) { nassertv(_track_memory_usage); result.clear(); - double now = ClockObject::get_global_clock()->get_real_time(); + double now = TrueClock::get_ptr()->get_real_time(); Table::iterator ti; for (ti = _table.begin(); ti != _table.end(); ++ti) { MemoryInfo &info = (*ti).second; @@ -476,7 +476,7 @@ ns_get_pointers_of_age(MemoryUsagePointers &result, nassertv(_track_memory_usage); result.clear(); - double now = ClockObject::get_global_clock()->get_real_time(); + double now = TrueClock::get_ptr()->get_real_time(); Table::iterator ti; for (ti = _table.begin(); ti != _table.end(); ++ti) { MemoryInfo &info = (*ti).second; @@ -518,12 +518,12 @@ ns_get_pointers_with_zero_count(MemoryUsagePointers &result) { nassertv(_track_memory_usage); result.clear(); - double now = ClockObject::get_global_clock()->get_real_time(); + double now = TrueClock::get_ptr()->get_real_time(); Table::iterator ti; for (ti = _table.begin(); ti != _table.end(); ++ti) { MemoryInfo &info = (*ti).second; if (info._freeze_index == _freeze_index) { - if ((*ti).first->get_count() == 0) { + if ((*ti).first->get_ref_count() == 0) { (*ti).first->ref(); result.add_entry((*ti).first, info.get_type(), now - info._time); } @@ -591,7 +591,7 @@ ns_show_trend_types() { void MemoryUsage:: ns_show_current_ages() { AgeHistogram hist; - double now = ClockObject::get_global_clock()->get_real_time(); + double now = TrueClock::get_ptr()->get_real_time(); Table::iterator ti; for (ti = _table.begin(); ti != _table.end(); ++ti) { diff --git a/panda/src/express/memoryUsage.h b/panda/src/express/memoryUsage.h index 2ca0bd2ef8..828b772ad7 100644 --- a/panda/src/express/memoryUsage.h +++ b/panda/src/express/memoryUsage.h @@ -29,6 +29,7 @@ class EXPCL_PANDAEXPRESS MemoryUsage { public: INLINE static bool get_track_memory_usage(); +PUBLISHED: #if defined(__GNUC__) && !defined(NDEBUG) // There seems to be a problem with egcs-2.91.66: it gets confused // with too many nested inline functions, and sets the wrong pointer diff --git a/panda/src/express/memoryUsagePointers.cxx b/panda/src/express/memoryUsagePointers.cxx index 08d040f89b..f9a4cbfa90 100644 --- a/panda/src/express/memoryUsagePointers.cxx +++ b/panda/src/express/memoryUsagePointers.cxx @@ -145,7 +145,7 @@ add_entry(ReferenceCount *ptr, TypeHandle type, double age) { // We can't safly add pointers with a zero reference count. They // might be statically-allocated or something, and if we try to add // them they'll try to destruct when the PointerTo later goes away. - if (ptr->get_count() != 0) { + if (ptr->get_ref_count() != 0) { _entries.push_back(Entry(ptr, type, age)); } } diff --git a/panda/src/express/memoryUsagePointers.h b/panda/src/express/memoryUsagePointers.h index 85e56b8ff0..e44152c6a9 100644 --- a/panda/src/express/memoryUsagePointers.h +++ b/panda/src/express/memoryUsagePointers.h @@ -37,7 +37,7 @@ // even exist when compiled with NDEBUG. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAEXPRESS MemoryUsagePointers { -public: +PUBLISHED: MemoryUsagePointers(); ~MemoryUsagePointers(); diff --git a/panda/src/express/multifile.h b/panda/src/express/multifile.h index 4c1bb225ec..21b787097c 100644 --- a/panda/src/express/multifile.h +++ b/panda/src/express/multifile.h @@ -24,7 +24,7 @@ // Description : A file that contains a set of files. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAEXPRESS Multifile { -public: +PUBLISHED: enum Type { T_unknown, T_valid, diff --git a/panda/src/express/namable.h b/panda/src/express/namable.h index 52864c7016..60011eb773 100644 --- a/panda/src/express/namable.h +++ b/panda/src/express/namable.h @@ -17,7 +17,7 @@ // NULL. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAEXPRESS Namable { -public: +PUBLISHED: INLINE Namable(const string &initial_name = ""); INLINE Namable(const Namable ©); INLINE Namable &operator = (const Namable &other); diff --git a/panda/src/express/patchfile.cxx b/panda/src/express/patchfile.cxx index 88af419c03..0beec16f32 100644 --- a/panda/src/express/patchfile.cxx +++ b/panda/src/express/patchfile.cxx @@ -99,7 +99,7 @@ PN_uint16 Patchfile:: calc_hash(const char *buffer) { PN_uint16 hash_value = 0; - for(int i = 0; i < _footprint_length; i++) { + for(int i = 0; i < (int)_footprint_length; i++) { // this is probably not such a good hash. to be replaced hash_value ^= (*buffer) << (i % 8); buffer++; @@ -368,7 +368,7 @@ build(Filename &file_orig, Filename &file_new) { } // are there still more bytes left in the new file? - if (ADD_offset != length_new) { + if ((int)ADD_offset != length_new) { // emit ADD for all remaining bytes emit_ADD(write_stream, length_new - ADD_offset, &buffer_new[ADD_offset]); @@ -466,7 +466,7 @@ apply(Filename &patch, Filename &file) { { /////////// // read # of ADD bytes - nassertr(_buffer->get_length() >= sizeof(ADD_length), false); + nassertr(_buffer->get_length() >= (int)sizeof(ADD_length), false); patch_stream.read(_buffer->_buffer, sizeof(ADD_length)); _datagram.clear(); _datagram.append_data(_buffer->_buffer, sizeof(ADD_length)); @@ -478,7 +478,7 @@ apply(Filename &patch, Filename &file) { PN_uint32 bytes_left = ADD_length; while (bytes_left > 0) { - PN_uint32 bytes_this_time = (bytes_left < buflen) ? bytes_left : buflen; + PN_uint32 bytes_this_time = ((int)bytes_left < buflen) ? bytes_left : buflen; patch_stream.read(_buffer->_buffer, bytes_this_time); write_stream.write(_buffer->_buffer, bytes_this_time); bytes_left -= bytes_this_time; @@ -487,7 +487,7 @@ apply(Filename &patch, Filename &file) { /////////// // read # of COPY bytes - nassertr(_buffer->get_length() >= sizeof(COPY_length), false); + nassertr(_buffer->get_length() >= (int)sizeof(COPY_length), false); patch_stream.read(_buffer->_buffer, sizeof(COPY_length)); _datagram.clear(); _datagram.append_data(_buffer->_buffer, sizeof(COPY_length)); @@ -497,7 +497,7 @@ apply(Filename &patch, Filename &file) { // if there are bytes to copy, read them from original file and write them to output if (0 != COPY_length) { // read copy offset - nassertr(_buffer->get_length() >= sizeof(COPY_offset), false); + nassertr(_buffer->get_length() >= (int)sizeof(COPY_offset), false); patch_stream.read(_buffer->_buffer, sizeof(COPY_offset)); _datagram.clear(); _datagram.append_data(_buffer->_buffer, sizeof(COPY_offset)); @@ -511,7 +511,7 @@ apply(Filename &patch, Filename &file) { PN_uint32 bytes_left = COPY_length; while (bytes_left > 0) { - PN_uint32 bytes_this_time = (bytes_left < buflen) ? bytes_left : buflen; + PN_uint32 bytes_this_time = ((int)bytes_left < buflen) ? bytes_left : buflen; origfile_stream.read(_buffer->_buffer, bytes_this_time); write_stream.write(_buffer->_buffer, bytes_this_time); bytes_left -= bytes_this_time; diff --git a/panda/src/express/patchfile.h b/panda/src/express/patchfile.h index 60a0ccf25f..6ba8302b27 100644 --- a/panda/src/express/patchfile.h +++ b/panda/src/express/patchfile.h @@ -27,7 +27,7 @@ // Description : //////////////////////////////////////////////////////////////////// class EXPCL_PANDAEXPRESS Patchfile { -public: +PUBLISHED: Patchfile(void); Patchfile(PT(Buffer) buffer); ~Patchfile(void); diff --git a/panda/src/express/pointerTo.I b/panda/src/express/pointerTo.I index 7090da6584..6faa014175 100644 --- a/panda/src/express/pointerTo.I +++ b/panda/src/express/pointerTo.I @@ -261,7 +261,7 @@ INLINE void PointerToBase:: output(ostream &out) const { out << (void *)_ptr; if (_ptr != (To *)NULL) { - out << ":" << _ptr->get_count(); + out << ":" << _ptr->get_ref_count(); } } diff --git a/panda/src/express/pointerTo.h b/panda/src/express/pointerTo.h index 1233be0fa0..28bfc6ab4e 100644 --- a/panda/src/express/pointerTo.h +++ b/panda/src/express/pointerTo.h @@ -111,6 +111,7 @@ public: INLINE bool operator < (const PointerToBase &other) const; #endif // CPPPARSER +PUBLISHED: INLINE bool is_null() const; INLINE void clear(); @@ -131,14 +132,16 @@ INLINE ostream &operator <<(ostream &out, const PointerToBase &pointer) { //////////////////////////////////////////////////////////////////// template class PointerTo : public PointerToBase { -public: +PUBLISHED: INLINE PointerTo(To *ptr = (To *)NULL); INLINE PointerTo(const PointerTo ©); +public: INLINE To &operator *() const; INLINE To *operator -> () const; INLINE operator PointerToBase::To *() const; +PUBLISHED: // When downcasting to a derived class from a PointerTo, // C++ would normally require you to cast twice: once to an actual // BaseClass pointer, and then again to your desired pointer. You @@ -183,15 +186,17 @@ public: //////////////////////////////////////////////////////////////////// template class ConstPointerTo : public PointerToBase { -public: +PUBLISHED: INLINE ConstPointerTo(const To *ptr = (const To *)NULL); INLINE ConstPointerTo(const PointerTo ©); INLINE ConstPointerTo(const ConstPointerTo ©); +public: INLINE const To &operator *() const; INLINE const To *operator -> () const; INLINE operator const PointerToBase::To *() const; +PUBLISHED: INLINE const To *p() const; INLINE ConstPointerTo &operator = (const To *ptr); diff --git a/panda/src/express/referenceCount.I b/panda/src/express/referenceCount.I index 3da064d076..b9a2a75c6f 100644 --- a/panda/src/express/referenceCount.I +++ b/panda/src/express/referenceCount.I @@ -125,13 +125,33 @@ prepare_delete() { _ref_count = -100; } +#ifdef NDEBUG //////////////////////////////////////////////////////////////////// -// Function: ReferenceCount::get_count +// Function: ReferenceCount::unref_consider_delete +// Access: Public +// Description: This function is called by the global unref_delete() +// function. This function unrefs the pointer and +// returns true if it should be deleted (i.e. the count +// has gone to zero), or false otherwise. It doesn't +// delete itself because (a) a method cannot safely +// delete this, and (b) we don't have a virtual +// destructor anyway. The decision of whether to delete +// is left up to unref_delete(). +//////////////////////////////////////////////////////////////////// +INLINE bool ReferenceCount:: +unref_consider_delete() { + unref(); + return (get_ref_count() == 0); +} +#endif + +//////////////////////////////////////////////////////////////////// +// Function: ReferenceCount::get_ref_count // Access: Public // Description: Returns the current reference count. //////////////////////////////////////////////////////////////////// INLINE int ReferenceCount:: -get_count() const { +get_ref_count() const { test_ref_count_integrity(); return _ref_count; } @@ -270,14 +290,8 @@ test_ref_count_integrity() const { template INLINE void unref_delete(RefCountType *ptr) { - ptr->unref(); - if (ptr->get_count() == 0) { + if (((ReferenceCount *)ptr)->unref_consider_delete()) { delete ptr; - - // If we're testing reference counts, it's sometimes useful to do - // the following instead of actually deleting the pointer: - - // ptr->prepare_delete(); } } diff --git a/panda/src/express/referenceCount.cxx b/panda/src/express/referenceCount.cxx index b2aa1d4e90..b00570146b 100644 --- a/panda/src/express/referenceCount.cxx +++ b/panda/src/express/referenceCount.cxx @@ -6,3 +6,35 @@ #include "referenceCount.h" TypeHandle ReferenceCount::_type_handle; + +#ifndef NDEBUG +//////////////////////////////////////////////////////////////////// +// Function: ReferenceCount::unref_consider_delete +// Access: Public +// Description: This function is called by the global unref_delete() +// function. This function unrefs the pointer and +// returns true if it should be deleted (i.e. the count +// has gone to zero), or false otherwise. It doesn't +// delete itself because (a) a method cannot safely +// delete this, and (b) we don't have a virtual +// destructor anyway. The decision of whether to delete +// is left up to unref_delete(). +//////////////////////////////////////////////////////////////////// +bool ReferenceCount:: +unref_consider_delete() { + unref(); + + if (get_leak_memory()) { + // In leak-memory mode, we don't actually delete anything. + // However, we do want to call prepare_delete() when the count + // reaches zero, to reset the refcount to -100 as a deleted flag. + if (get_ref_count() == 0) { + prepare_delete(); + MemoryUsage::remove_pointer(this); + } + return false; + } + + return (get_ref_count() == 0); +} +#endif diff --git a/panda/src/express/referenceCount.h b/panda/src/express/referenceCount.h index 9021e24170..fdbe4373cb 100644 --- a/panda/src/express/referenceCount.h +++ b/panda/src/express/referenceCount.h @@ -41,14 +41,25 @@ protected: INLINE ~ReferenceCount(); public: + // These functions are not part of the normal API, but they have to + // be public. You shouldn't generally call these directly. INLINE void prepare_delete(); +#ifdef NDEBUG + // unref_consider_delete() is inline only if we are compiling + // NDEBUG. + INLINE bool unref_consider_delete(); +#else + bool unref_consider_delete(); +#endif - INLINE int get_count() const; +PUBLISHED: + INLINE int get_ref_count() const; INLINE void ref() const; INLINE void unref() const; INLINE void test_ref_count_integrity() const; +public: static TypeHandle get_class_type() { return _type_handle; } diff --git a/panda/src/express/typeHandle.h b/panda/src/express/typeHandle.h index a696e1ccb7..e31a430180 100644 --- a/panda/src/express/typeHandle.h +++ b/panda/src/express/typeHandle.h @@ -80,7 +80,7 @@ class TypedObject; // type name may be retrieved for run-time display. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAEXPRESS TypeHandle { -public: +PUBLISHED: INLINE TypeHandle(); INLINE TypeHandle(const TypeHandle ©); @@ -154,6 +154,7 @@ public: void record_derivation(TypeHandle child, TypeHandle parent); +PUBLISHED: TypeHandle find_type(const string &name) const; string get_name(TypeHandle type, TypedObject *object) const; @@ -284,7 +285,8 @@ public: INLINE TypedObject(); INLINE TypedObject(const TypedObject ©); INLINE void operator = (const TypedObject ©); - + +PUBLISHED: // A virtual destructor is just a good idea. virtual ~TypedObject(); diff --git a/panda/src/express/typedReferenceCount.h b/panda/src/express/typedReferenceCount.h index be2c5b6548..ef50e7281e 100644 --- a/panda/src/express/typedReferenceCount.h +++ b/panda/src/express/typedReferenceCount.h @@ -31,9 +31,13 @@ public: return get_class_type(); } virtual TypeHandle force_init_type() {init_type(); return get_class_type();} + +PUBLISHED: static TypeHandle get_class_type() { return _type_handle; } + +public: static void init_type() { TypedObject::init_type(); ReferenceCount::init_type(); diff --git a/panda/src/gobj/drawable.h b/panda/src/gobj/drawable.h index 8829d36d2d..b7a6fed82e 100644 --- a/panda/src/gobj/drawable.h +++ b/panda/src/gobj/drawable.h @@ -50,10 +50,12 @@ public: protected: void fillin(DatagramIterator& scan, BamReader* manager); -public: +PUBLISHED: static TypeHandle get_class_type() { return _type_handle; } + +public: static void init_type() { ReferenceCount::init_type(); WriteableConfigurable::init_type(); @@ -63,9 +65,13 @@ public: WriteableConfigurable::get_class_type(), BoundedObject::get_class_type()); } + +PUBLISHED: // Temporary kludge around ffi bug virtual TypeHandle get_type() const { return get_class_type(); } + +public: virtual TypeHandle force_init_type() {init_type(); return get_class_type();} diff --git a/panda/src/gobj/fog.h b/panda/src/gobj/fog.h index ce975c06cf..bbcec89901 100644 --- a/panda/src/gobj/fog.h +++ b/panda/src/gobj/fog.h @@ -25,7 +25,7 @@ // Description : Specifies atmospheric fog parameters //////////////////////////////////////////////////////////////////// class EXPCL_PANDA Fog : public TypedReferenceCount { -public: +PUBLISHED: enum Mode { M_linear, // f = (end - z) / (end - start) M_exponential, // f = e^(-density * z) diff --git a/panda/src/gobj/geom.cxx b/panda/src/gobj/geom.cxx index 26d4bbbc6c..4209811c6e 100644 --- a/panda/src/gobj/geom.cxx +++ b/panda/src/gobj/geom.cxx @@ -407,14 +407,13 @@ config(void) { } //////////////////////////////////////////////////////////////////// -// Function: Geom::print +// Function: Geom::write // Access: Public -// Description: Writes the Geom information briefly to standard -// output. +// Description: //////////////////////////////////////////////////////////////////// void Geom:: -print() const { - nout << *this << endl; +write(ostream &out) const { + out << *this << endl; } //////////////////////////////////////////////////////////////////// @@ -647,14 +646,14 @@ describe_attr(ostream &out, const Geom *geom, } //////////////////////////////////////////////////////////////////// -// Function: Geom::output_verbose +// Function: Geom::write_verbose // Access: Public // Description: Writes to the indicated ostream a formatted picture // of the contents of the Geom, in detail--but hopefully // not too much detail. //////////////////////////////////////////////////////////////////// void Geom:: -output_verbose(ostream &out) const { +write_verbose(ostream &out) const { GeomBindType bind_coords; GeomBindType bind_normals; GeomBindType bind_tcoords; diff --git a/panda/src/gobj/geom.h b/panda/src/gobj/geom.h index 355b6a7afb..26e1a34478 100644 --- a/panda/src/gobj/geom.h +++ b/panda/src/gobj/geom.h @@ -104,11 +104,13 @@ public: void operator = ( const Geom © ); virtual Geom *make_copy() const=0; - - void print() const; + +PUBLISHED: + void write(ostream &out) const; virtual void output(ostream &out) const; - void output_verbose(ostream &out) const; - + void write_verbose(ostream &out) const; + +public: // From parent dDrawable virtual void draw(GraphicsStateGuardianBase *gsg) { dDrawable::draw(gsg); draw_immediate(gsg); diff --git a/panda/src/gobj/texturePool.h b/panda/src/gobj/texturePool.h index c9a0ee0421..aa61b8ef70 100644 --- a/panda/src/gobj/texturePool.h +++ b/panda/src/gobj/texturePool.h @@ -23,7 +23,7 @@ // unnecessarily. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA TexturePool { -public: +PUBLISHED: // These functions take string parameters instead of Filenames // because that's somewhat more convenient to the scripting // language. diff --git a/panda/src/graph/Sources.pp b/panda/src/graph/Sources.pp index 3837b79f81..896ca26d01 100644 --- a/panda/src/graph/Sources.pp +++ b/panda/src/graph/Sources.pp @@ -72,6 +72,7 @@ #define TARGET test_graph #define LOCAL_LIBS \ graph putil + #define OTHER_LIBS $[OTHER_LIBS] pystub #define SOURCES \ test_graph.cxx @@ -82,6 +83,7 @@ #define TARGET test_graphRead #define LOCAL_LIBS \ putil graph + #define OTHER_LIBS $[OTHER_LIBS] pystub #define SOURCES \ test_graphRead.cxx @@ -92,6 +94,7 @@ #define TARGET test_graphWrite #define LOCAL_LIBS \ graph putil + #define OTHER_LIBS $[OTHER_LIBS] pystub #define SOURCES \ test_graphWrite.cxx diff --git a/panda/src/graph/boundedObject.h b/panda/src/graph/boundedObject.h index 969616f51b..45c0d0e539 100644 --- a/panda/src/graph/boundedObject.h +++ b/panda/src/graph/boundedObject.h @@ -31,6 +31,7 @@ public: INLINE BoundedObject(); virtual ~BoundedObject(); +PUBLISHED: INLINE void set_bound(BoundingVolumeType type); INLINE void set_bound(const BoundingVolume &volume); INLINE const BoundingVolume &get_bound() const; diff --git a/panda/src/graph/immediateTransition.h b/panda/src/graph/immediateTransition.h index 2e24d77401..2c22676d16 100644 --- a/panda/src/graph/immediateTransition.h +++ b/panda/src/graph/immediateTransition.h @@ -58,9 +58,13 @@ public: return get_class_type(); } virtual TypeHandle force_init_type() {init_type(); return get_class_type();} + +PUBLISHED: static TypeHandle get_class_type() { return _type_handle; } + +public: static void init_type() { NodeTransition::init_type(); register_type(_type_handle, "ImmediateTransition", diff --git a/panda/src/graph/multiTransition.I b/panda/src/graph/multiTransition.I index d9ca690b8f..28e37805db 100644 --- a/panda/src/graph/multiTransition.I +++ b/panda/src/graph/multiTransition.I @@ -335,7 +335,7 @@ apply(const NodeAttribute *attrib) const { return result; } - if (result->get_count() > 1) { + if (result->get_ref_count() > 1) { // Copy on write. DCAST_INTO_R(result, result->make_copy(), NULL); } diff --git a/panda/src/graph/namedNode.h b/panda/src/graph/namedNode.h index 64aa3640a0..cff3d5e3cf 100644 --- a/panda/src/graph/namedNode.h +++ b/panda/src/graph/namedNode.h @@ -16,8 +16,10 @@ // will be (almost?) all of them. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA NamedNode : public Node, public Namable { -public: +PUBLISHED: INLINE NamedNode(const string &initial_name = ""); + +public: INLINE NamedNode(const NamedNode ©); INLINE void operator = (const NamedNode ©); diff --git a/panda/src/graph/node.h b/panda/src/graph/node.h index df0f7cb826..0a8720a777 100644 --- a/panda/src/graph/node.h +++ b/panda/src/graph/node.h @@ -36,8 +36,11 @@ class EXPCL_PANDA Node : public TypedWriteable, public BoundedObject, public: static Node* const Null; +PUBLISHED: Node(); Node(const Node ©); + +public: void operator = (const Node ©); virtual ~Node(); @@ -50,11 +53,13 @@ public: virtual void transform_changed(NodeRelation *arc); +PUBLISHED: int get_num_parents(TypeHandle type) const; NodeRelation *get_parent(TypeHandle type, int index) const; int get_num_children(TypeHandle type) const; NodeRelation *get_child(TypeHandle type, int index) const; +public: // These functions will be called when the node is visited during // the indicated traversal. virtual void app_traverse() { } @@ -68,6 +73,7 @@ public: GraphicsStateGuardianBase *gsgbase); virtual bool has_sub_render() const; +PUBLISHED: virtual void output(ostream &out) const; // We reference-count the child pointer, but not the parent pointer, diff --git a/panda/src/graph/nodeAttribute.h b/panda/src/graph/nodeAttribute.h index 9205930099..ba7a4cea82 100644 --- a/panda/src/graph/nodeAttribute.h +++ b/panda/src/graph/nodeAttribute.h @@ -56,17 +56,21 @@ public: INLINE int compare_to(const NodeAttribute &other) const; +PUBLISHED: INLINE void set_priority(int priority); INLINE int get_priority() const; +public: virtual NodeAttribute *make_copy() const=0; virtual NodeAttribute *make_initial() const=0; virtual TypeHandle get_handle() const=0; +PUBLISHED: virtual void output(ostream &out) const; virtual void write(ostream &out, int indent_level = 0) const; +public: virtual void issue(GraphicsStateGuardianBase *gsgbase); protected: diff --git a/panda/src/graph/nodeAttributes.h b/panda/src/graph/nodeAttributes.h index f0d4caa352..bed8163a75 100644 --- a/panda/src/graph/nodeAttributes.h +++ b/panda/src/graph/nodeAttributes.h @@ -23,12 +23,15 @@ class NodeTransitionCache; // value. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA NodeAttributes { -public: +PUBLISHED: NodeAttributes(); + +public: NodeAttributes(const NodeAttributes ©); void operator = (const NodeAttributes ©); ~NodeAttributes(); +PUBLISHED: bool is_empty() const; PT(NodeAttribute) set_attribute(TypeHandle handle, NodeAttribute *attrib); PT(NodeAttribute) clear_attribute(TypeHandle handle); diff --git a/panda/src/graph/nodeRelation.h b/panda/src/graph/nodeRelation.h index 764f76aa69..e3c717555b 100644 --- a/panda/src/graph/nodeRelation.h +++ b/panda/src/graph/nodeRelation.h @@ -77,6 +77,7 @@ public: INLINE void output_transitions(ostream &out) const; INLINE void write_transitions(ostream &out, int indent = 0) const; +PUBLISHED: INLINE Node *get_parent() const; INLINE Node *get_child() const; INLINE int get_sort() const; @@ -101,6 +102,7 @@ public: INLINE int compare_transitions_to(const NodeRelation *arc) const; +public: bool sub_render_trans(const AllAttributesWrapper &attrib, AllTransitionsWrapper &trans, GraphicsStateGuardianBase *gsgbase); diff --git a/panda/src/graph/nodeTransition.h b/panda/src/graph/nodeTransition.h index fa8dfe69fc..bd6da30848 100644 --- a/panda/src/graph/nodeTransition.h +++ b/panda/src/graph/nodeTransition.h @@ -50,9 +50,11 @@ public: INLINE int compare_to(const NodeTransition &other) const; +PUBLISHED: INLINE void set_priority(int priority); INLINE int get_priority() const; +public: virtual NodeTransition *make_copy() const=0; virtual NodeAttribute *make_attrib() const=0; diff --git a/panda/src/graph/nodeTransitionCache.cxx b/panda/src/graph/nodeTransitionCache.cxx index b4c9800c4f..6f7c9a0a65 100644 --- a/panda/src/graph/nodeTransitionCache.cxx +++ b/panda/src/graph/nodeTransitionCache.cxx @@ -449,7 +449,7 @@ set_computed_verified(const NodeTransitionCache *a, UpdateSeq now) { } NodeTransitionCache *result = (NodeTransitionCache *)a; - if (a->get_count() > 1) { + if (a->get_ref_count() > 1) { // Copy-on-write. result = new NodeTransitionCache(*a); } diff --git a/panda/src/graph/nodeTransitionWrapper.I b/panda/src/graph/nodeTransitionWrapper.I index 82d82633ca..9e057aa6b3 100644 --- a/panda/src/graph/nodeTransitionWrapper.I +++ b/panda/src/graph/nodeTransitionWrapper.I @@ -200,7 +200,7 @@ store_to_cache(NodeRelation *arc, Node *top_subtree) { if (arc->_net_transitions == (NodeTransitionCache *)NULL) { arc->_net_transitions = new NodeTransitionCache; - } else if (arc->_net_transitions->get_count() > 1) { + } else if (arc->_net_transitions->get_ref_count() > 1) { // Copy-on-write. arc->_net_transitions = new NodeTransitionCache(*arc->_net_transitions); } diff --git a/panda/src/graph/onOffAttribute.h b/panda/src/graph/onOffAttribute.h index 156719954c..000bbd6976 100644 --- a/panda/src/graph/onOffAttribute.h +++ b/panda/src/graph/onOffAttribute.h @@ -22,13 +22,14 @@ protected: INLINE OnOffAttribute(const OnOffAttribute ©); INLINE void operator = (const OnOffAttribute ©); -public: +PUBLISHED: INLINE void set_on(); INLINE void set_off(); INLINE bool is_on() const; INLINE bool is_off() const; +public: virtual void output(ostream &out) const; virtual void write(ostream &out, int indent_level = 0) const; diff --git a/panda/src/graph/onOffTransition.cxx b/panda/src/graph/onOffTransition.cxx index 0707f04acc..6be753657d 100644 --- a/panda/src/graph/onOffTransition.cxx +++ b/panda/src/graph/onOffTransition.cxx @@ -100,7 +100,7 @@ apply(const NodeAttribute *attrib) const { return result; } - if (result->get_count() > 1) { + if (result->get_ref_count() > 1) { // Copy on write. DCAST_INTO_R(result, result->make_copy(), NULL); } diff --git a/panda/src/graph/onOffTransition.h b/panda/src/graph/onOffTransition.h index 9d0a3c1353..897c76b5da 100644 --- a/panda/src/graph/onOffTransition.h +++ b/panda/src/graph/onOffTransition.h @@ -40,7 +40,7 @@ protected: INLINE OnOffTransition(const OnOffTransition ©); INLINE void operator = (const OnOffTransition ©); -public: +PUBLISHED: INLINE void set_identity(); INLINE void set_on(); INLINE void set_off(); @@ -49,6 +49,7 @@ public: INLINE bool is_on() const; INLINE bool is_off() const; +public: virtual NodeTransition *compose(const NodeTransition *other) const; virtual NodeTransition *invert() const; virtual NodeAttribute *apply(const NodeAttribute *attrib) const; diff --git a/panda/src/graph/onTransition.cxx b/panda/src/graph/onTransition.cxx index 25a8430d3e..4178c4066b 100644 --- a/panda/src/graph/onTransition.cxx +++ b/panda/src/graph/onTransition.cxx @@ -74,7 +74,7 @@ apply(const NodeAttribute *attrib) const { return result; } - if (result->get_count() > 1) { + if (result->get_ref_count() > 1) { // Copy on write. DCAST_INTO_R(result, result->make_copy(), NULL); } diff --git a/panda/src/graph/onTransition.h b/panda/src/graph/onTransition.h index a5506b0865..c45d71f902 100644 --- a/panda/src/graph/onTransition.h +++ b/panda/src/graph/onTransition.h @@ -57,9 +57,13 @@ public: return get_class_type(); } virtual TypeHandle force_init_type() {init_type(); return get_class_type();} + +PUBLISHED: static TypeHandle get_class_type() { return _type_handle; } + +public: static void init_type() { NodeTransition::init_type(); register_type(_type_handle, "OnTransition", diff --git a/panda/src/grutil/lineSegs.h b/panda/src/grutil/lineSegs.h index 12bd927c9f..4d799c4d03 100644 --- a/panda/src/grutil/lineSegs.h +++ b/panda/src/grutil/lineSegs.h @@ -26,7 +26,7 @@ // primarily as a visualization and editing tool. //////////////////////////////////////////////////////////////////// class LineSegs { -public: +PUBLISHED: LineSegs(); ~LineSegs(); diff --git a/panda/src/gui/guiButton.h b/panda/src/gui/guiButton.h index 63f0f3db3f..7890af2dea 100644 --- a/panda/src/gui/guiButton.h +++ b/panda/src/gui/guiButton.h @@ -35,15 +35,19 @@ private: INLINE GuiButton(void); void switch_state(States); virtual void recompute_frame(void); -public: + +PUBLISHED: GuiButton(const string&, GuiLabel*, GuiLabel*); GuiButton(const string&, GuiLabel*, GuiLabel*, GuiLabel*); GuiButton(const string&, GuiLabel*, GuiLabel*, GuiLabel*, GuiLabel*, GuiLabel*); virtual ~GuiButton(void); +public: virtual void manage(GuiManager*, EventHandler&); virtual void unmanage(void); + +PUBLISHED: INLINE void enter(void); INLINE void exit(void); INLINE void up(void); @@ -74,6 +78,7 @@ public: virtual void set_pos(const LVector3f&); virtual void output(ostream&) const; + public: // type interface static TypeHandle get_class_type(void) { diff --git a/panda/src/gui/guiFrame.h b/panda/src/gui/guiFrame.h index 7584b9ec36..de92583efd 100644 --- a/panda/src/gui/guiFrame.h +++ b/panda/src/gui/guiFrame.h @@ -11,7 +11,7 @@ #include class EXPCL_PANDA GuiFrame : public GuiItem { -public: +PUBLISHED: enum Packing { NONE, ABOVE, UNDER, LEFT, RIGHT, ALIGN_ABOVE, ALIGN_UNDER, ALIGN_LEFT, ALIGN_RIGHT }; private: @@ -71,7 +71,8 @@ private: INLINE GuiFrame(void); Boxes::iterator find_box(GuiItem*); virtual void recompute_frame(void); -public: + +PUBLISHED: GuiFrame(const string&); ~GuiFrame(void); diff --git a/panda/src/gui/guiItem.h b/panda/src/gui/guiItem.h index 5d5344a775..d0a51a38fc 100644 --- a/panda/src/gui/guiItem.h +++ b/panda/src/gui/guiItem.h @@ -19,7 +19,8 @@ protected: INLINE GuiItem(void); virtual void recompute_frame(void) = 0; -public: + +PUBLISHED: GuiItem(const string&); virtual ~GuiItem(void); diff --git a/panda/src/gui/guiLabel.h b/panda/src/gui/guiLabel.h index 2d7b842868..7f359d579a 100644 --- a/panda/src/gui/guiLabel.h +++ b/panda/src/gui/guiLabel.h @@ -46,7 +46,8 @@ private: void recompute_transform(void); void set_properties(void); -public: + +PUBLISHED: INLINE GuiLabel(void); virtual ~GuiLabel(void); @@ -77,6 +78,7 @@ public: INLINE Colorf get_background_color(void) const; INLINE void recompute(void); + public: // type interface static TypeHandle get_class_type(void) { diff --git a/panda/src/gui/guiManager.cxx b/panda/src/gui/guiManager.cxx index 0336887d85..f3f3cacc7f 100644 --- a/panda/src/gui/guiManager.cxx +++ b/panda/src/gui/guiManager.cxx @@ -63,22 +63,22 @@ GuiManager* GuiManager::get_ptr(GraphicsWindow* w, MouseAndKeyboard* mak) { gui_cat->debug() << "found a MouseWatcher, don't have to make one" << endl; // now setup event triggers for the watcher - if (has_watcher) + if (has_watcher && !watcher->get_button_down_pattern().empty()) gui_cat->warning() << "overwriting existing button down pattern '" << watcher->get_button_down_pattern() << "' with 'gui-%r-%b'" << endl; watcher->set_button_down_pattern("gui-%r-%b"); - if (has_watcher) + if (has_watcher && !watcher->get_button_up_pattern().empty()) gui_cat->warning() << "overwriting existing button up pattern '" << watcher->get_button_up_pattern() << "' with 'gui-%r-%b-up'" << endl; watcher->set_button_up_pattern("gui-%r-%b"); - if (has_watcher) + if (has_watcher && !watcher->get_enter_pattern().empty()) gui_cat->warning() << "overwriting existing enter pattern '" << watcher->get_enter_pattern() << "' with 'gui-in-%r'" << endl; watcher->set_enter_pattern("gui-in-%r"); - if (has_watcher) + if (has_watcher && !watcher->get_leave_pattern().empty()) gui_cat->warning() << "overwriting existing exit pattern '" << watcher->get_leave_pattern() << "' with 'gui-out-%r'" << endl; diff --git a/panda/src/gui/guiManager.h b/panda/src/gui/guiManager.h index 3fa90d8fef..a5ead4a9c3 100644 --- a/panda/src/gui/guiManager.h +++ b/panda/src/gui/guiManager.h @@ -30,7 +30,8 @@ private: MouseWatcher* _watcher; INLINE GuiManager(MouseWatcher*, Node*); -public: + +PUBLISHED: static GuiManager* get_ptr(GraphicsWindow*, MouseAndKeyboard*); void add_region(GuiRegion*); diff --git a/panda/src/gui/guiRegion.h b/panda/src/gui/guiRegion.h index 1102191c2c..3b5957e689 100644 --- a/panda/src/gui/guiRegion.h +++ b/panda/src/gui/guiRegion.h @@ -25,7 +25,8 @@ private: INLINE MouseWatcherRegion* get_region(void) const; friend GuiManager; -public: + +PUBLISHED: INLINE GuiRegion(const string&, float, float, float, float, bool); ~GuiRegion(void); @@ -33,6 +34,7 @@ public: INLINE void set_region(float, float, float, float); INLINE LVector4f get_frame(void) const; + public: // type interface static TypeHandle get_class_type(void) { diff --git a/panda/src/gui/guiRollover.h b/panda/src/gui/guiRollover.h index 08cda83e07..e47028fa6f 100644 --- a/panda/src/gui/guiRollover.h +++ b/panda/src/gui/guiRollover.h @@ -24,7 +24,8 @@ private: INLINE GuiRollover(void); virtual void recompute_frame(void); -public: + +PUBLISHED: GuiRollover(const string&, GuiLabel*, GuiLabel*); virtual ~GuiRollover(void); @@ -39,6 +40,7 @@ public: virtual void set_pos(const LVector3f&); virtual void output(ostream&) const; + public: // type interface static TypeHandle get_class_type(void) { diff --git a/panda/src/gui/guiSign.h b/panda/src/gui/guiSign.h index c27e3ec7ef..d26a7b54ef 100644 --- a/panda/src/gui/guiSign.h +++ b/panda/src/gui/guiSign.h @@ -17,7 +17,8 @@ private: INLINE GuiSign(void); virtual void recompute_frame(void); -public: + +PUBLISHED: GuiSign(const string&, GuiLabel*); ~GuiSign(void); @@ -28,6 +29,7 @@ public: virtual void set_pos(const LVector3f&); virtual void output(ostream&) const; + public: // type interface static TypeHandle get_class_type(void) { diff --git a/panda/src/lerp/lerp.h b/panda/src/lerp/lerp.h index 75dfeb6fa2..ba81fd1eec 100644 --- a/panda/src/lerp/lerp.h +++ b/panda/src/lerp/lerp.h @@ -23,7 +23,8 @@ private: float _endt; float _delta; float _t; -public: + +PUBLISHED: Lerp(LerpFunctor* func, float endt, LerpBlendType* blend); Lerp(LerpFunctor* func, float startt, float endt, LerpBlendType* blend); Lerp(const Lerp&); @@ -38,6 +39,7 @@ public: LerpFunctor* get_functor(void) const; void set_end_event(std::string&); std::string get_end_event(void) const; + public: // now for typehandle stuff static TypeHandle get_class_type(void) { @@ -70,7 +72,8 @@ private: virtual void step(void); static void handle_event(CPT(Event), void*); -public: + +PUBLISHED: AutonomousLerp(LerpFunctor* func, float endt, LerpBlendType* blend, EventHandler* handler); AutonomousLerp(LerpFunctor* func, float startt, float endt, @@ -87,6 +90,7 @@ public: float get_t(void) const; void set_end_event(std::string&); std::string get_end_event(void) const; + public: // now for typehandle stuff static TypeHandle get_class_type(void) { diff --git a/panda/src/lerp/lerpblend.h b/panda/src/lerp/lerpblend.h index 6251584987..1dd31718f9 100644 --- a/panda/src/lerp/lerpblend.h +++ b/panda/src/lerp/lerpblend.h @@ -10,10 +10,12 @@ #include class LerpBlendType : public TypedReferenceCount { -public: +PUBLISHED: LerpBlendType(void) {} - LerpBlendType(const LerpBlendType&); virtual ~LerpBlendType(void); + +public: + LerpBlendType(const LerpBlendType&); LerpBlendType& operator=(const LerpBlendType&); virtual float operator()(float) = 0; public: @@ -38,10 +40,12 @@ private: }; class EaseInBlendType : public LerpBlendType { -public: +PUBLISHED: EaseInBlendType(void) {} - EaseInBlendType(const EaseInBlendType&); virtual ~EaseInBlendType(void); + +public: + EaseInBlendType(const EaseInBlendType&); EaseInBlendType& operator=(const EaseInBlendType&); virtual float operator()(float); public: @@ -66,10 +70,12 @@ private: }; class EaseOutBlendType : public LerpBlendType { -public: +PUBLISHED: EaseOutBlendType(void) {} - EaseOutBlendType(const EaseOutBlendType&); virtual ~EaseOutBlendType(void); + +public: + EaseOutBlendType(const EaseOutBlendType&); EaseOutBlendType& operator=(const EaseOutBlendType&); virtual float operator()(float); public: @@ -94,10 +100,11 @@ private: }; class EaseInOutBlendType : public LerpBlendType { -public: +PUBLISHED: EaseInOutBlendType(void) {} - EaseInOutBlendType(const EaseInOutBlendType&); virtual ~EaseInOutBlendType(void); +public: + EaseInOutBlendType(const EaseInOutBlendType&); EaseInOutBlendType& operator=(const EaseInOutBlendType&); virtual float operator()(float); public: @@ -122,10 +129,11 @@ private: }; class NoBlendType : public LerpBlendType { -public: +PUBLISHED: NoBlendType(void) {} - NoBlendType(const NoBlendType&); virtual ~NoBlendType(void); +public: + NoBlendType(const NoBlendType&); NoBlendType& operator=(const NoBlendType&); virtual float operator()(float); public: diff --git a/panda/src/linmath/Sources.pp b/panda/src/linmath/Sources.pp index d6ada584e9..6a8d8c426e 100644 --- a/panda/src/linmath/Sources.pp +++ b/panda/src/linmath/Sources.pp @@ -8,7 +8,8 @@ #define SOURCES \ compose_matrix.I compose_matrix.cxx compose_matrix.h \ config_linmath.cxx config_linmath.h coordinateSystem.cxx \ - coordinateSystem.h ioPtaDatagramLinMath.I ioPtaDatagramLinMath.cxx \ + coordinateSystem.h deg_2_rad.h \ + ioPtaDatagramLinMath.I ioPtaDatagramLinMath.cxx \ ioPtaDatagramLinMath.h lmatrix.cxx lmatrix.h luse.I luse.N luse.cxx \ luse.h mathNumbers.cxx mathNumbers.h pta_Colorf.cxx pta_Colorf.h \ pta_Normalf.cxx pta_Normalf.h pta_TexCoordf.cxx pta_TexCoordf.h \ diff --git a/panda/src/linmath/compose_matrix.h b/panda/src/linmath/compose_matrix.h index 62d5722591..0f67343d64 100644 --- a/panda/src/linmath/compose_matrix.h +++ b/panda/src/linmath/compose_matrix.h @@ -30,6 +30,7 @@ #include "lmatrix.h" #include "luse.h" +BEGIN_PUBLISH EXPCL_PANDA void compose_matrix(LMatrix3f &mat, @@ -89,6 +90,8 @@ decompose_matrix(const LMatrix4d &mat, INLINE bool decompose_matrix(const LMatrix4d &mat, double components[9], CoordinateSystem cs = CS_default); +END_PUBLISH + #include "compose_matrix.I" #endif diff --git a/panda/src/linmath/coordinateSystem.h b/panda/src/linmath/coordinateSystem.h index ccb189f5bf..f82b0efa2e 100644 --- a/panda/src/linmath/coordinateSystem.h +++ b/panda/src/linmath/coordinateSystem.h @@ -12,6 +12,8 @@ #include +BEGIN_PUBLISH + enum CoordinateSystem { // The CS_default entry does not refer to a particular coordinate // system, but rather to the value stored in @@ -30,6 +32,8 @@ enum CoordinateSystem { CS_invalid, }; +END_PUBLISH + extern CoordinateSystem EXPCL_PANDA default_coordinate_system; CoordinateSystem EXPCL_PANDA parse_coordinate_system_string(const string &str); diff --git a/panda/src/linmath/deg_2_rad.h b/panda/src/linmath/deg_2_rad.h index e6ce6e1fa8..b7a29d9b30 100644 --- a/panda/src/linmath/deg_2_rad.h +++ b/panda/src/linmath/deg_2_rad.h @@ -10,8 +10,10 @@ #include "mathNumbers.h" +BEGIN_PUBLISH INLINE double deg_2_rad( double f ) { return f * MathNumbers::pi / 180.0; } INLINE double rad_2_deg( double f ) { return f * 180.0 / MathNumbers::pi; } +END_PUBLISH #endif diff --git a/panda/src/linmath/lmat_ops.h b/panda/src/linmath/lmat_ops.h index 0750c0c28a..1703b1ac56 100644 --- a/panda/src/linmath/lmat_ops.h +++ b/panda/src/linmath/lmat_ops.h @@ -48,6 +48,8 @@ operator * (const LPoint3 &v, const LMatrix4 &m); // 'instantiations' of the above template functions on types float and // double. +BEGIN_PUBLISH + INLINE LVecBase3 operator * (const LVecBase3 &v, const LMatrix3 &m); INLINE LVector2 @@ -74,6 +76,8 @@ operator * (const LVector3 &v, const LMatrix4 &m); INLINE LPoint3 operator * (const LPoint3 &v, const LMatrix4 &m); +END_PUBLISH + #endif // CPPPARSER #include "lmat_ops.I" diff --git a/panda/src/linmath/lmatrix3.h b/panda/src/linmath/lmatrix3.h index 076d4e19f0..75cb1324a5 100644 --- a/panda/src/linmath/lmatrix3.h +++ b/panda/src/linmath/lmatrix3.h @@ -26,7 +26,7 @@ //////////////////////////////////////////////////////////////////// template class LMatrix3 { -public: +PUBLISHED: typedef const NumType *iterator; typedef const NumType *const_iterator; @@ -66,13 +66,14 @@ public: INLINE const NumType *get_data() const; INLINE int get_num_components() const; +public: INLINE iterator begin(); INLINE iterator end(); INLINE const_iterator begin() const; INLINE const_iterator end() const; - +PUBLISHED: bool operator == (const LMatrix3 &other) const; INLINE bool operator != (const LMatrix3 &other) const; diff --git a/panda/src/linmath/lmatrix4.h b/panda/src/linmath/lmatrix4.h index b8c849e905..1d813d07c3 100644 --- a/panda/src/linmath/lmatrix4.h +++ b/panda/src/linmath/lmatrix4.h @@ -23,7 +23,7 @@ //////////////////////////////////////////////////////////////////// template class LMatrix4 { -public: +PUBLISHED: typedef const NumType *iterator; typedef const NumType *const_iterator; diff --git a/panda/src/linmath/lpoint2.h b/panda/src/linmath/lpoint2.h index 190745fbfa..c444f5f68a 100644 --- a/panda/src/linmath/lpoint2.h +++ b/panda/src/linmath/lpoint2.h @@ -17,7 +17,7 @@ //////////////////////////////////////////////////////////////////// template class LPoint2 : public LVecBase2 { -public: +PUBLISHED: INLINE LPoint2(); INLINE LPoint2(const LVecBase2 ©); INLINE LPoint2 &operator = (const LVecBase2 ©); diff --git a/panda/src/linmath/lpoint3.h b/panda/src/linmath/lpoint3.h index 6f3d20829d..07de1ab8c6 100644 --- a/panda/src/linmath/lpoint3.h +++ b/panda/src/linmath/lpoint3.h @@ -24,7 +24,7 @@ //////////////////////////////////////////////////////////////////// template class LPoint3 : public LVecBase3 { -public: +PUBLISHED: INLINE LPoint3(); INLINE LPoint3(const LVecBase3 ©); INLINE LPoint3 &operator = (const LVecBase3 ©); diff --git a/panda/src/linmath/lpoint4.h b/panda/src/linmath/lpoint4.h index 5d299e3c75..f0ddf00156 100644 --- a/panda/src/linmath/lpoint4.h +++ b/panda/src/linmath/lpoint4.h @@ -17,7 +17,7 @@ //////////////////////////////////////////////////////////////////// template class LPoint4 : public LVecBase4 { -public: +PUBLISHED: INLINE LPoint4(); INLINE LPoint4(const LVecBase4 ©); INLINE LPoint4 &operator = (const LVecBase4 ©); diff --git a/panda/src/linmath/lquaternion.h b/panda/src/linmath/lquaternion.h index 635b92d6ec..0532a1cdcd 100644 --- a/panda/src/linmath/lquaternion.h +++ b/panda/src/linmath/lquaternion.h @@ -18,7 +18,7 @@ protected: INLINE LQuaternionBase multiply(const LQuaternionBase&) const; -public: +PUBLISHED: INLINE LQuaternionBase(void); INLINE LQuaternionBase(const LQuaternionBase &); INLINE LQuaternionBase(NumType, NumType, NumType, NumType); @@ -91,6 +91,7 @@ operator * (const LMatrix4 &m, const LQuaternionBase &q); // pacify interrogate. #ifdef CPPPARSER +BEGIN_PUBLISH INLINE LMatrix3 operator * (const LMatrix3 &m, const LQuaternionBase &q); INLINE LMatrix4 @@ -99,6 +100,7 @@ INLINE LMatrix3 operator * (const LMatrix3 &m, const LQuaternionBase &q); INLINE LMatrix4 operator * (const LMatrix4 &m, const LQuaternionBase &q); +END_PUBLISH #endif // Cast to a different numeric type diff --git a/panda/src/linmath/lrotation.h b/panda/src/linmath/lrotation.h index def0fb3df6..99d0511bc5 100644 --- a/panda/src/linmath/lrotation.h +++ b/panda/src/linmath/lrotation.h @@ -15,7 +15,7 @@ //////////////////////////////////////////////////////////////////////// template class LRotation : public LQuaternionBase { -public: +PUBLISHED: INLINE LRotation(); INLINE LRotation(const LQuaternionBase&); INLINE LRotation(NumType, NumType, NumType, NumType); diff --git a/panda/src/linmath/luse.h b/panda/src/linmath/luse.h index a9b34ed1bc..e626faa63a 100644 --- a/panda/src/linmath/luse.h +++ b/panda/src/linmath/luse.h @@ -117,6 +117,7 @@ typedef LQuaternionBase LQuaterniond; typedef LRotation LRotationd; typedef LOrientation LOrientationd; +/* // Now define explicit instantiations of the output operator functions // for interrogate's benefit. These functions don't actually exist // anywhere, but interrogate can't know how to instantiate template @@ -136,6 +137,7 @@ INLINE ostream &operator << (ostream &out, const LMatrix3d &mat); INLINE ostream &operator << (ostream &out, const LMatrix4d &mat); INLINE ostream &operator << (ostream &out, const LQuaterniond &q); #endif +*/ #endif diff --git a/panda/src/linmath/lvecBase2.h b/panda/src/linmath/lvecBase2.h index 0a1d63ed7f..77c9c8e376 100644 --- a/panda/src/linmath/lvecBase2.h +++ b/panda/src/linmath/lvecBase2.h @@ -22,7 +22,7 @@ class DatagramIterator; //////////////////////////////////////////////////////////////////// template class LVecBase2 { -public: +PUBLISHED: typedef const NumType *iterator; typedef const NumType *const_iterator; @@ -54,12 +54,14 @@ public: INLINE const NumType *get_data() const; INLINE int get_num_components() const; +public: INLINE iterator begin(); INLINE iterator end(); INLINE const_iterator begin() const; INLINE const_iterator end() const; +PUBLISHED: INLINE void fill(NumType fill_value); INLINE void set(NumType x, NumType y); diff --git a/panda/src/linmath/lvecBase3.h b/panda/src/linmath/lvecBase3.h index 91e3e6c032..15b75c083f 100644 --- a/panda/src/linmath/lvecBase3.h +++ b/panda/src/linmath/lvecBase3.h @@ -22,7 +22,7 @@ class DatagramIterator; //////////////////////////////////////////////////////////////////// template class LVecBase3 { -public: +PUBLISHED: typedef const NumType *iterator; typedef const NumType *const_iterator; @@ -57,12 +57,14 @@ public: INLINE const NumType *get_data() const; INLINE int get_num_components() const; +public: INLINE iterator begin(); INLINE iterator end(); INLINE const_iterator begin() const; INLINE const_iterator end() const; +PUBLISHED: INLINE void fill(NumType fill_value); INLINE void set(NumType x, NumType y, NumType z); diff --git a/panda/src/linmath/lvecBase4.h b/panda/src/linmath/lvecBase4.h index 7a8e5dd0c0..8332171620 100644 --- a/panda/src/linmath/lvecBase4.h +++ b/panda/src/linmath/lvecBase4.h @@ -22,7 +22,7 @@ class DatagramIterator; //////////////////////////////////////////////////////////////////// template class LVecBase4 { -public: +PUBLISHED: typedef const NumType *iterator; typedef const NumType *const_iterator; @@ -60,12 +60,14 @@ public: INLINE const NumType *get_data() const; INLINE int get_num_components() const; +public: INLINE iterator begin(); INLINE iterator end(); INLINE const_iterator begin() const; INLINE const_iterator end() const; +PUBLISHED: INLINE void fill(NumType fill_value); INLINE void set(NumType x, NumType y, NumType z, NumType w); diff --git a/panda/src/linmath/lvector2.h b/panda/src/linmath/lvector2.h index 09045a4957..42f3406722 100644 --- a/panda/src/linmath/lvector2.h +++ b/panda/src/linmath/lvector2.h @@ -16,7 +16,7 @@ //////////////////////////////////////////////////////////////////// template class LVector2 : public LVecBase2 { -public: +PUBLISHED: INLINE LVector2(); INLINE LVector2(const LVecBase2 ©); INLINE LVector2 &operator = (const LVecBase2 ©); diff --git a/panda/src/linmath/lvector3.h b/panda/src/linmath/lvector3.h index a0d0182b22..f2c2e3c117 100644 --- a/panda/src/linmath/lvector3.h +++ b/panda/src/linmath/lvector3.h @@ -23,7 +23,7 @@ //////////////////////////////////////////////////////////////////// template class LVector3 : public LVecBase3 { -public: +PUBLISHED: INLINE LVector3(); INLINE LVector3(const LVecBase3 ©); INLINE LVector3 &operator = (const LVecBase3 ©); diff --git a/panda/src/linmath/lvector4.h b/panda/src/linmath/lvector4.h index 13e01d6ae7..37164261c2 100644 --- a/panda/src/linmath/lvector4.h +++ b/panda/src/linmath/lvector4.h @@ -16,7 +16,7 @@ //////////////////////////////////////////////////////////////////// template class LVector4 : public LVecBase4 { -public: +PUBLISHED: INLINE LVector4(); INLINE LVector4(const LVecBase4 ©); INLINE LVector4 &operator = (const LVecBase4 ©); diff --git a/panda/src/loader/loader.h b/panda/src/loader/loader.h index 688db18551..b3bfdcabc6 100644 --- a/panda/src/loader/loader.h +++ b/panda/src/loader/loader.h @@ -26,7 +26,7 @@ class LoaderToken; // threading //////////////////////////////////////////////////////////////////// class EXPCL_PANDA Loader : public AsyncUtility { -public: +PUBLISHED: Loader(); ~Loader(); diff --git a/panda/src/loader/modelPool.h b/panda/src/loader/modelPool.h index d79781623b..84f011d288 100644 --- a/panda/src/loader/modelPool.h +++ b/panda/src/loader/modelPool.h @@ -33,7 +33,7 @@ // although it wouldn't be *too* difficult to add. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA ModelPool { -public: +PUBLISHED: INLINE static bool has_model(const string &filename); INLINE static bool verify_model(const string &filename); INLINE static PT_Node load_model(const string &filename); diff --git a/panda/src/mathutil/boundingLine.h b/panda/src/mathutil/boundingLine.h index 26b35f4b0a..46d409e3e5 100644 --- a/panda/src/mathutil/boundingLine.h +++ b/panda/src/mathutil/boundingLine.h @@ -22,9 +22,11 @@ // arbitrary points on the line. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA BoundingLine : public GeometricBoundingVolume { -public: +PUBLISHED: INLINE BoundingLine(); INLINE BoundingLine(const LPoint3f &a, const LPoint3f &b); + +public: virtual BoundingVolume *make_copy() const; virtual LPoint3f get_approx_center() const; @@ -32,6 +34,7 @@ public: virtual void output(ostream &out) const; +PUBLISHED: INLINE const LPoint3f &get_point_a() const; INLINE LPoint3f get_point_b() const; diff --git a/panda/src/mathutil/boundingSphere.h b/panda/src/mathutil/boundingSphere.h index 13bb7ae33a..b9fe6be1b3 100644 --- a/panda/src/mathutil/boundingSphere.h +++ b/panda/src/mathutil/boundingSphere.h @@ -17,9 +17,11 @@ // never an ellipsoid or other quadric. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA BoundingSphere : public FiniteBoundingVolume { -public: +PUBLISHED: INLINE BoundingSphere(); INLINE BoundingSphere(const LPoint3f ¢er, float radius); + +public: virtual BoundingVolume *make_copy() const; virtual LPoint3f get_min() const; @@ -30,6 +32,7 @@ public: virtual void output(ostream &out) const; +PUBLISHED: INLINE const LPoint3f &get_center() const; INLINE float get_radius() const; diff --git a/panda/src/mathutil/boundingVolume.h b/panda/src/mathutil/boundingVolume.h index 14289b3986..8291ac6d37 100644 --- a/panda/src/mathutil/boundingVolume.h +++ b/panda/src/mathutil/boundingVolume.h @@ -27,7 +27,7 @@ class BoundingLine; // sort. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA BoundingVolume : public TypedReferenceCount { -public: +PUBLISHED: INLINE BoundingVolume(); virtual BoundingVolume *make_copy() const=0; diff --git a/panda/src/mathutil/finiteBoundingVolume.h b/panda/src/mathutil/finiteBoundingVolume.h index 515f7feee8..90c6ca8812 100644 --- a/panda/src/mathutil/finiteBoundingVolume.h +++ b/panda/src/mathutil/finiteBoundingVolume.h @@ -18,7 +18,7 @@ // kind of volume for its minimum and maximum extents. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA FiniteBoundingVolume : public GeometricBoundingVolume { -public: +PUBLISHED: virtual LPoint3f get_min() const=0; virtual LPoint3f get_max() const=0; diff --git a/panda/src/mathutil/geometricBoundingVolume.h b/panda/src/mathutil/geometricBoundingVolume.h index 649a2e61ff..2e0a15780e 100644 --- a/panda/src/mathutil/geometricBoundingVolume.h +++ b/panda/src/mathutil/geometricBoundingVolume.h @@ -23,6 +23,7 @@ class EXPCL_PANDA GeometricBoundingVolume : public BoundingVolume { public: INLINE GeometricBoundingVolume(); +PUBLISHED: INLINE bool extend_by(const GeometricBoundingVolume *vol); INLINE bool extend_by(const LPoint3f &point); diff --git a/panda/src/mathutil/look_at.h b/panda/src/mathutil/look_at.h index 5c425a2030..819809731a 100644 --- a/panda/src/mathutil/look_at.h +++ b/panda/src/mathutil/look_at.h @@ -27,6 +27,7 @@ // functions that simply return the upper 3x3 part of the matrix, and // flavors that return the whole 4x4 matrix with a zero bottom row. +BEGIN_PUBLISH // Flavors for float-type arithmetic. @@ -87,6 +88,8 @@ INLINE void heads_up(LMatrix4d &mat, const LVector3d &fwd, INLINE void look_at(LMatrix4d &mat, const LVector3d &fwd, CoordinateSystem cs); +END_PUBLISH + #include "look_at.I" #endif diff --git a/panda/src/mathutil/mathHelpers.h b/panda/src/mathutil/mathHelpers.h index 4ec6ba48db..a3607c7e4a 100644 --- a/panda/src/mathutil/mathHelpers.h +++ b/panda/src/mathutil/mathHelpers.h @@ -13,8 +13,12 @@ #include +BEGIN_PUBLISH + INLINE float distance(const LPoint3f &pos0, const LPoint3f &pos1); +END_PUBLISH + #include "mathHelpers.I" #endif diff --git a/panda/src/mathutil/omniBoundingVolume.h b/panda/src/mathutil/omniBoundingVolume.h index c78e0f13a6..6b41e15c82 100644 --- a/panda/src/mathutil/omniBoundingVolume.h +++ b/panda/src/mathutil/omniBoundingVolume.h @@ -16,8 +16,10 @@ // that fills all of space. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA OmniBoundingVolume : public GeometricBoundingVolume { -public: +PUBLISHED: INLINE OmniBoundingVolume(); + +public: virtual BoundingVolume *make_copy() const; virtual LPoint3f get_approx_center() const; diff --git a/panda/src/mathutil/plane.h b/panda/src/mathutil/plane.h index c09aabdecd..6c24966b16 100644 --- a/panda/src/mathutil/plane.h +++ b/panda/src/mathutil/plane.h @@ -27,7 +27,7 @@ class DatagramIterator; //////////////////////////////////////////////////////////////////// template class Plane { -public: +PUBLISHED: INLINE Plane(void); INLINE Plane(const Plane ©); INLINE Plane(const LPoint3 &a, const LPoint3 &b, diff --git a/panda/src/mathutil/rotate_to.h b/panda/src/mathutil/rotate_to.h index 0743b0bf38..f60d665a2c 100644 --- a/panda/src/mathutil/rotate_to.h +++ b/panda/src/mathutil/rotate_to.h @@ -22,10 +22,14 @@ #include "lmatrix.h" #include "luse.h" +BEGIN_PUBLISH + EXPCL_PANDA void rotate_to(LMatrix3f &mat, const LVector3f &a, const LVector3f &b); EXPCL_PANDA void rotate_to(LMatrix3d &mat, const LVector3d &a, const LVector3d &b); EXPCL_PANDA void rotate_to(LMatrix4f &mat, const LVector3f &a, const LVector3f &b); EXPCL_PANDA void rotate_to(LMatrix4d &mat, const LVector3d &a, const LVector3d &b); +END_PUBLISH + #endif diff --git a/panda/src/net/connection.h b/panda/src/net/connection.h index 25a23fa47f..b2f5f89f93 100644 --- a/panda/src/net/connection.h +++ b/panda/src/net/connection.h @@ -24,7 +24,7 @@ class NetDatagram; // output. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA Connection : public ReferenceCount { -public: +PUBLISHED: Connection(ConnectionManager *manager, PRFileDesc *socket); ~Connection(); diff --git a/panda/src/net/connectionListener.h b/panda/src/net/connectionListener.h index bd58b58a80..890a9a1aaa 100644 --- a/panda/src/net/connectionListener.h +++ b/panda/src/net/connectionListener.h @@ -24,7 +24,7 @@ class NetAddress; // QueuedConnectionListener. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA ConnectionListener : public ConnectionReader { -public: +PUBLISHED: ConnectionListener(ConnectionManager *manager, int num_threads); protected: diff --git a/panda/src/net/connectionManager.h b/panda/src/net/connectionManager.h index 4cc8c259e0..bfaa3c6ee2 100644 --- a/panda/src/net/connectionManager.h +++ b/panda/src/net/connectionManager.h @@ -36,7 +36,7 @@ class ConnectionWriter; // QueuedConnectionManager. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA ConnectionManager { -public: +PUBLISHED: ConnectionManager(); virtual ~ConnectionManager(); diff --git a/panda/src/net/connectionReader.h b/panda/src/net/connectionReader.h index ba1b91cdc2..12267432b7 100644 --- a/panda/src/net/connectionReader.h +++ b/panda/src/net/connectionReader.h @@ -44,7 +44,7 @@ class ConnectionManager; // rather than read datagrams. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA ConnectionReader { -public: +PUBLISHED: // The implementation here used to involve NSPR's multi-wait // interface, but that got too complicated to manage. It turns out // to be difficult to protect against memory leaks caused by race diff --git a/panda/src/net/connectionWriter.h b/panda/src/net/connectionWriter.h index ffe85641ba..be7c3c1cd8 100644 --- a/panda/src/net/connectionWriter.h +++ b/panda/src/net/connectionWriter.h @@ -30,7 +30,7 @@ class NetAddress; // construction time and cannot be changed. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA ConnectionWriter { -public: +PUBLISHED: ConnectionWriter(ConnectionManager *manager, int num_threads); ~ConnectionWriter(); diff --git a/panda/src/net/netAddress.h b/panda/src/net/netAddress.h index 60b1611e7f..0655c7d55d 100644 --- a/panda/src/net/netAddress.h +++ b/panda/src/net/netAddress.h @@ -17,7 +17,7 @@ // be sent or to which a TCP socket may be bound. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA NetAddress { -public: +PUBLISHED: NetAddress(); NetAddress(const PRNetAddr &addr); diff --git a/panda/src/net/netDatagram.h b/panda/src/net/netDatagram.h index cbcb2e0c58..bcfde25633 100644 --- a/panda/src/net/netDatagram.h +++ b/panda/src/net/netDatagram.h @@ -32,7 +32,7 @@ static const int maximum_udp_datagram = 1024; // NetAddress it is to be sent to or was received from. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA NetDatagram : public Datagram { -public: +PUBLISHED: NetDatagram(); NetDatagram(const void *data, size_t size); NetDatagram(const Datagram ©); diff --git a/panda/src/net/queuedConnectionListener.h b/panda/src/net/queuedConnectionListener.h index ed34a843c8..e50673f23e 100644 --- a/panda/src/net/queuedConnectionListener.h +++ b/panda/src/net/queuedConnectionListener.h @@ -40,7 +40,7 @@ EXPORT_TEMPLATE_CLASS(EXPCL_PANDA, EXPTP_PANDA, QueuedReturn { -public: +PUBLISHED: QueuedConnectionListener(ConnectionManager *manager, int num_threads); virtual ~QueuedConnectionListener(); diff --git a/panda/src/net/queuedConnectionManager.h b/panda/src/net/queuedConnectionManager.h index 0c734878e3..b70eb4e420 100644 --- a/panda/src/net/queuedConnectionManager.h +++ b/panda/src/net/queuedConnectionManager.h @@ -31,7 +31,7 @@ EXPORT_TEMPLATE_CLASS(EXPCL_PANDA, EXPTP_PANDA, QueuedReturn< PT(Connection) >); //////////////////////////////////////////////////////////////////// class EXPCL_PANDA QueuedConnectionManager : public ConnectionManager, public QueuedReturn { -public: +PUBLISHED: QueuedConnectionManager(); ~QueuedConnectionManager(); diff --git a/panda/src/net/queuedConnectionReader.h b/panda/src/net/queuedConnectionReader.h index bac966fc7a..2c91665833 100644 --- a/panda/src/net/queuedConnectionReader.h +++ b/panda/src/net/queuedConnectionReader.h @@ -28,7 +28,7 @@ EXPORT_TEMPLATE_CLASS(EXPCL_PANDA, EXPTP_PANDA, QueuedReturn); //////////////////////////////////////////////////////////////////// class EXPCL_PANDA QueuedConnectionReader : public ConnectionReader, public QueuedReturn { -public: +PUBLISHED: QueuedConnectionReader(ConnectionManager *manager, int num_threads); virtual ~QueuedConnectionReader(); diff --git a/panda/src/net/queuedReturn.h b/panda/src/net/queuedReturn.h index 6f839b058d..f61486a37b 100644 --- a/panda/src/net/queuedReturn.h +++ b/panda/src/net/queuedReturn.h @@ -24,7 +24,7 @@ //////////////////////////////////////////////////////////////////// template class QueuedReturn { -public: +PUBLISHED: void set_max_queue_size(int max_size); int get_max_queue_size() const; int get_current_queue_size() const; diff --git a/panda/src/net/recentConnectionReader.h b/panda/src/net/recentConnectionReader.h index 2e047c581e..c983be4c64 100644 --- a/panda/src/net/recentConnectionReader.h +++ b/panda/src/net/recentConnectionReader.h @@ -26,7 +26,7 @@ // This class will always create one thread for itself. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA RecentConnectionReader : public ConnectionReader { -public: +PUBLISHED: RecentConnectionReader(ConnectionManager *manager); virtual ~RecentConnectionReader(); diff --git a/panda/src/particlesystem/particleSystemManager.cxx b/panda/src/particlesystem/particleSystemManager.cxx index 62cdd84211..6cfda58159 100644 --- a/panda/src/particlesystem/particleSystemManager.cxx +++ b/panda/src/particlesystem/particleSystemManager.cxx @@ -75,7 +75,7 @@ do_particles(float dt) { // update this system if (cur_ps->get_active_system_flag() == true) { // cout << " system " << cs++ << endl; - // cout << " count is: " << cur_ps->get_render_parent()->get_count() << endl; + // cout << " count is: " << cur_ps->get_render_parent()->get_ref_count() << endl; cur_ps->update(dt); // handle age diff --git a/panda/src/putil/bitMask.h b/panda/src/putil/bitMask.h index 5f3ecea2da..49704cc9d5 100644 --- a/panda/src/putil/bitMask.h +++ b/panda/src/putil/bitMask.h @@ -21,7 +21,7 @@ //////////////////////////////////////////////////////////////////// template class BitMask { -public: +PUBLISHED: INLINE BitMask(); INLINE BitMask(WordType init_value); INLINE BitMask(const BitMask ©); diff --git a/panda/src/putil/buttonHandle.h b/panda/src/putil/buttonHandle.h index 9c6d88f370..4da440c46c 100644 --- a/panda/src/putil/buttonHandle.h +++ b/panda/src/putil/buttonHandle.h @@ -15,14 +15,17 @@ // (but see KeyboardButton and MouseButton). //////////////////////////////////////////////////////////////////// class EXPCL_PANDA ButtonHandle { -public: +PUBLISHED: INLINE ButtonHandle(); + +public: INLINE ButtonHandle(const ButtonHandle ©); INLINE bool operator == (const ButtonHandle &other) const; INLINE bool operator != (const ButtonHandle &other) const; INLINE bool operator < (const ButtonHandle &other) const; +PUBLISHED: string get_name() const; INLINE bool has_ascii_equivalent() const; INLINE char get_ascii_equivalent() const; diff --git a/panda/src/putil/buttonRegistry.h b/panda/src/putil/buttonRegistry.h index f27fa4147a..5e97a1b3ad 100644 --- a/panda/src/putil/buttonRegistry.h +++ b/panda/src/putil/buttonRegistry.h @@ -31,7 +31,7 @@ protected: string _name; }; -public: +PUBLISHED: bool register_button(ButtonHandle &button_handle, const string &name, char ascii_equivalent = '\0'); diff --git a/panda/src/putil/config_util.h b/panda/src/putil/config_util.h index ea80a1b297..3f9131ce97 100644 --- a/panda/src/putil/config_util.h +++ b/panda/src/putil/config_util.h @@ -26,8 +26,10 @@ NotifyCategoryDecl(util, EXPCL_PANDA, EXPTP_PANDA); // computed based on the concatenation of all appearances of the // corresponding variable in the config files. +BEGIN_PUBLISH EXPCL_PANDA DSearchPath &get_model_path(); EXPCL_PANDA DSearchPath &get_texture_path(); EXPCL_PANDA DSearchPath &get_sound_path(); +END_PUBLISH #endif /* __CONFIG_UTIL_H__ */ diff --git a/panda/src/putil/keyboardButton.h b/panda/src/putil/keyboardButton.h index 5d25fb7eeb..9244b1fea7 100644 --- a/panda/src/putil/keyboardButton.h +++ b/panda/src/putil/keyboardButton.h @@ -17,7 +17,7 @@ // buttons which map to standard keyboard keys. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA KeyboardButton { -public: +PUBLISHED: static ButtonHandle ascii_key(char ascii_equivalent); static ButtonHandle space(); @@ -57,6 +57,7 @@ public: static ButtonHandle caps_lock(); static ButtonHandle shift_lock(); +public: static void init_keyboard_buttons(); }; diff --git a/panda/src/putil/lineStream.h b/panda/src/putil/lineStream.h index 3ee270feda..e2038c1f6e 100644 --- a/panda/src/putil/lineStream.h +++ b/panda/src/putil/lineStream.h @@ -25,7 +25,7 @@ // extracted. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA LineStream : public ostream { -public: +PUBLISHED: INLINE LineStream(); INLINE bool is_text_available() const; diff --git a/panda/src/putil/modifierButtons.cxx b/panda/src/putil/modifierButtons.cxx index 3c427244e3..d2b7488f09 100644 --- a/panda/src/putil/modifierButtons.cxx +++ b/panda/src/putil/modifierButtons.cxx @@ -228,7 +228,7 @@ write(ostream &out) const { //////////////////////////////////////////////////////////////////// void ModifierButtons:: modify_button_list() { - if (_button_list.get_count() > 1) { + if (_button_list.get_ref_count() > 1) { PTA(ButtonHandle) old_list = _button_list; _button_list = PTA(ButtonHandle)(0); @@ -238,5 +238,5 @@ modify_button_list() { } // Now we should be the only ones holding a count. - nassertv(_button_list.get_count() == 1); + nassertv(_button_list.get_ref_count() == 1); } diff --git a/panda/src/putil/mouseButton.h b/panda/src/putil/mouseButton.h index 30926f0c3b..a7f1573598 100644 --- a/panda/src/putil/mouseButton.h +++ b/panda/src/putil/mouseButton.h @@ -17,12 +17,13 @@ // buttons which map to standard mouse buttons. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA MouseButton { -public: +PUBLISHED: static ButtonHandle button(int button_number); static ButtonHandle one(); static ButtonHandle two(); static ButtonHandle three(); +public: static void init_mouse_buttons(); }; diff --git a/panda/src/putil/mouseData.h b/panda/src/putil/mouseData.h index f0cbb9e0e8..c77c588346 100644 --- a/panda/src/putil/mouseData.h +++ b/panda/src/putil/mouseData.h @@ -17,13 +17,14 @@ // GraphicsWindow. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA MouseData { -public: +PUBLISHED: MouseData(); int get_x() const; int get_y() const; bool get_in_window() const; +public: bool _in_window; int _xpos; int _ypos; diff --git a/panda/src/putil/pointerToArray.I b/panda/src/putil/pointerToArray.I index 2f6c5cde95..93a69a6770 100644 --- a/panda/src/putil/pointerToArray.I +++ b/panda/src/putil/pointerToArray.I @@ -433,14 +433,14 @@ set_void_ptr(void* p) reassign((RefCountObj > *)p); } //////////////////////////////////////////////////////////////////// -// Function: PointerToArray::get_count +// Function: PointerToArray::get_ref_count // Access: Public // Description: Returns the reference count of the underlying vector. //////////////////////////////////////////////////////////////////// template INLINE int PointerToArray:: -get_count() const { - return (_ptr == NULL) ? 0 : _ptr->get_count(); +get_ref_count() const { + return (_ptr == NULL) ? 0 : _ptr->get_ref_count(); } //////////////////////////////////////////////////////////////////// @@ -722,14 +722,14 @@ v() const { } //////////////////////////////////////////////////////////////////// -// Function: ConstPointerToArray::get_count +// Function: ConstPointerToArray::get_ref_count // Access: Public // Description: Returns the reference count of the underlying vector. //////////////////////////////////////////////////////////////////// template INLINE int ConstPointerToArray:: -get_count() const { - return (_ptr == NULL) ? 0 : _ptr->get_count(); +get_ref_count() const { + return (_ptr == NULL) ? 0 : _ptr->get_ref_count(); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/putil/pointerToArray.h b/panda/src/putil/pointerToArray.h index 003aa9a2a4..6eaf1abac9 100644 --- a/panda/src/putil/pointerToArray.h +++ b/panda/src/putil/pointerToArray.h @@ -142,7 +142,7 @@ public: INLINE void *get_void_ptr() const; INLINE void set_void_ptr(void* p); - INLINE int get_count() const; + INLINE int get_ref_count() const; // Reassignment is by pointer, not memberwise as with a vector. INLINE PointerToArray & @@ -214,7 +214,7 @@ public: INLINE const Element *p() const; INLINE const vector &v() const; - INLINE int get_count() const; + INLINE int get_ref_count() const; // Reassignment is by pointer, not memberwise as with a vector. INLINE ConstPointerToArray & diff --git a/panda/src/putil/typedWriteable.h b/panda/src/putil/typedWriteable.h index d912e87863..5c58597d74 100644 --- a/panda/src/putil/typedWriteable.h +++ b/panda/src/putil/typedWriteable.h @@ -61,10 +61,12 @@ protected: //virtual void fillin(TypedWriteable*, DatagramIterator&, BamReader *); -public: +PUBLISHED: static TypeHandle get_class_type() { return _type_handle; } + +public: static void init_type() { TypedObject::init_type(); Writeable::init_type(); diff --git a/panda/src/putil/typedWriteableReferenceCount.h b/panda/src/putil/typedWriteableReferenceCount.h index 2f261b4414..9f9ae33530 100644 --- a/panda/src/putil/typedWriteableReferenceCount.h +++ b/panda/src/putil/typedWriteableReferenceCount.h @@ -34,9 +34,13 @@ public: return get_class_type(); } virtual TypeHandle force_init_type() {init_type(); return get_class_type();} + +PUBLISHED: static TypeHandle get_class_type() { return _type_handle; } + +public: static void init_type() { TypedWriteable::init_type(); ReferenceCount::init_type(); diff --git a/panda/src/putil/writeableConfigurable.h b/panda/src/putil/writeableConfigurable.h index fa7d2f76f3..071671649c 100644 --- a/panda/src/putil/writeableConfigurable.h +++ b/panda/src/putil/writeableConfigurable.h @@ -56,10 +56,12 @@ private: public: virtual void write_datagram(BamWriter*, Datagram&) = 0; -public: +PUBLISHED: static TypeHandle get_class_type() { return _type_handle; } + +public: static void init_type() { TypedWriteable::init_type(); register_type(_type_handle, "WriteableConfigurable", diff --git a/panda/src/sgattrib/colorAttribute.h b/panda/src/sgattrib/colorAttribute.h index 1891eccafd..0b3679c09b 100644 --- a/panda/src/sgattrib/colorAttribute.h +++ b/panda/src/sgattrib/colorAttribute.h @@ -17,7 +17,7 @@ // Description : See ColorTransition. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA ColorAttribute : public OnOffAttribute { -public: +PUBLISHED: INLINE ColorAttribute(); INLINE void set_on(const Colorf &color); @@ -27,6 +27,7 @@ public: INLINE bool is_real() const; INLINE Colorf get_color() const; +public: virtual TypeHandle get_handle() const; virtual NodeAttribute *make_copy() const; virtual NodeAttribute *make_initial() const; diff --git a/panda/src/sgattrib/colorTransition.h b/panda/src/sgattrib/colorTransition.h index 17865c7220..dfb0080464 100644 --- a/panda/src/sgattrib/colorTransition.h +++ b/panda/src/sgattrib/colorTransition.h @@ -23,7 +23,7 @@ // otherwise, the primitive color shows through. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA ColorTransition : public OnOffTransition { -public: +PUBLISHED: INLINE ColorTransition(); INLINE ColorTransition(const Colorf &color); INLINE ColorTransition(float r, float g, float b, float a); @@ -36,7 +36,8 @@ public: INLINE bool is_real() const; INLINE Colorf get_color() const; - + +public: virtual NodeTransition *make_copy() const; virtual NodeAttribute *make_attrib() const; diff --git a/panda/src/sgattrib/pruneTransition.h b/panda/src/sgattrib/pruneTransition.h index 82fb5ffcbb..4be80b190c 100644 --- a/panda/src/sgattrib/pruneTransition.h +++ b/panda/src/sgattrib/pruneTransition.h @@ -20,9 +20,10 @@ // invisible. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA PruneTransition : public ImmediateTransition { -public: +PUBLISHED: INLINE PruneTransition(); +public: virtual NodeTransition *make_copy() const; virtual bool sub_render(NodeRelation *arc, diff --git a/panda/src/sgattrib/renderRelation.h b/panda/src/sgattrib/renderRelation.h index 60f117e173..8b7cbdea6b 100644 --- a/panda/src/sgattrib/renderRelation.h +++ b/panda/src/sgattrib/renderRelation.h @@ -42,10 +42,12 @@ public: static TypedWriteable *make_RenderRelation(const FactoryParams ¶ms); -public: +PUBLISHED: static TypeHandle get_class_type() { return _type_handle; } + +public: static void init_type() { NodeRelation::init_type(); register_type(_type_handle, "RenderRelation", diff --git a/panda/src/sgattrib/transparencyTransition.h b/panda/src/sgattrib/transparencyTransition.h index 68baf93c3a..1fa2e06386 100644 --- a/panda/src/sgattrib/transparencyTransition.h +++ b/panda/src/sgattrib/transparencyTransition.h @@ -25,12 +25,13 @@ // less than 1). //////////////////////////////////////////////////////////////////// class EXPCL_PANDA TransparencyTransition : public OnTransition { -public: +PUBLISHED: INLINE TransparencyTransition(TransparencyProperty::Mode mode); INLINE void set_mode(TransparencyProperty::Mode mode); INLINE TransparencyProperty::Mode get_mode() const; - + +public: virtual NodeTransition *make_copy() const; virtual NodeAttribute *make_attrib() const; diff --git a/panda/src/sgmanip/get_cout.h b/panda/src/sgmanip/get_cout.h deleted file mode 100644 index 919a4b4cb7..0000000000 --- a/panda/src/sgmanip/get_cout.h +++ /dev/null @@ -1,34 +0,0 @@ -// Filename: get_cout.h -// Created by: drose (23Feb00) -// -//////////////////////////////////////////////////////////////////// - -#ifndef GET_COUT_H -#define GET_COUT_H - -// This file defines some general object-placement functions for scene -// graph operations. These are all higher-level wrappers around more -// fundamental scene graph manipulations, and are most useful from a -// scripting-language point of view. - -#include - -// These are just handy hooks to export these so a non-C++ scripting -// language can access iostream objects for input and output. When -// interrogate supports exporting system globals directly, the need -// for these will go away. - -INLINE ostream &get_cout() { - return cout; -} - -INLINE ostream &get_cerr() { - return cerr; -} - -INLINE istream &get_cin() { - return cin; -} - -#endif - diff --git a/panda/src/sgmanip/nodePath.h b/panda/src/sgmanip/nodePath.h index 432b52f64e..3e171d9811 100644 --- a/panda/src/sgmanip/nodePath.h +++ b/panda/src/sgmanip/nodePath.h @@ -96,7 +96,7 @@ class AllTransitionsWrapper; // exactly what a NodePath is. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA NodePath : public NodePathBase { -public: +PUBLISHED: INLINE NodePath(TypeHandle graph_type = RenderRelation::get_class_type()); INLINE NodePath(Node *top_node, TypeHandle graph_type = RenderRelation::get_class_type()); INLINE NodePath(NodeRelation *top_arc); diff --git a/panda/src/sgmanip/nodePathCollection.cxx b/panda/src/sgmanip/nodePathCollection.cxx index ea08e4c10c..274eb6e857 100644 --- a/panda/src/sgmanip/nodePathCollection.cxx +++ b/panda/src/sgmanip/nodePathCollection.cxx @@ -52,7 +52,7 @@ add_path(const NodePath &node_path) { // inadvertently modify any of our brethren NodePathCollection // objects. - if (_node_paths.get_count() > 1) { + if (_node_paths.get_ref_count() > 1) { PTA(NodePathBase) old_node_paths = _node_paths; _node_paths = PTA(NodePathBase)(0); _node_paths.v() = old_node_paths.v(); @@ -87,7 +87,7 @@ remove_path(const NodePath &node_path) { // inadvertently modify any of our brethren NodePathCollection // objects. - if (_node_paths.get_count() > 1) { + if (_node_paths.get_ref_count() > 1) { PTA(NodePathBase) old_node_paths = _node_paths; _node_paths = PTA(NodePathBase)(0); _node_paths.v() = old_node_paths.v(); diff --git a/panda/src/sgmanip/nodePathCollection.h b/panda/src/sgmanip/nodePathCollection.h index 4acf9d86aa..d802b007f5 100644 --- a/panda/src/sgmanip/nodePathCollection.h +++ b/panda/src/sgmanip/nodePathCollection.h @@ -24,7 +24,7 @@ class NodePath; // NodePaths::get_children). //////////////////////////////////////////////////////////////////// class EXPCL_PANDA NodePathCollection { -public: +PUBLISHED: NodePathCollection(); NodePathCollection(const NodePathCollection ©); void operator = (const NodePathCollection ©); diff --git a/panda/src/sgmanip/nodePathLerps.h b/panda/src/sgmanip/nodePathLerps.h index 4141b74d7d..c6a52048e9 100644 --- a/panda/src/sgmanip/nodePathLerps.h +++ b/panda/src/sgmanip/nodePathLerps.h @@ -18,7 +18,8 @@ private: NodePath _node_path; NodePath _wrt_path; bool _is_wrt; -public: + +PUBLISHED: PosLerpFunctor(NodePath np, LPoint3f start, LPoint3f end) : LPoint3fLerpFunctor(start, end), _node_path(np), _is_wrt(false) {} PosLerpFunctor(NodePath np, float sx, float sy, float sz, float ex, float ey, @@ -32,10 +33,13 @@ public: float ez, NodePath wrt) : LPoint3fLerpFunctor(LPoint3f(sx, sy, sz), LPoint3f(ex, ey, ez)), _node_path(np), _is_wrt(true), _wrt_path(wrt) {} + +public: PosLerpFunctor(const PosLerpFunctor&); virtual ~PosLerpFunctor(void); PosLerpFunctor& operator=(const PosLerpFunctor&); virtual void operator()(float); + public: // now for typehandle stuff static TypeHandle get_class_type(void) { @@ -68,7 +72,8 @@ private: NodePath _node_path; NodePath _wrt_path; bool _is_wrt; -public: + +PUBLISHED: HprLerpFunctor(NodePath np, LVecBase3f start, LVecBase3f end) : LVecBase3fLerpFunctor(start, end), _node_path(np), _is_wrt(false) {} HprLerpFunctor(NodePath np, float sx, float sy, float sz, float ex, float ey, @@ -82,10 +87,13 @@ public: float ez, NodePath wrt) : LVecBase3fLerpFunctor(LVecBase3f(sx, sy, sz), LVecBase3f(ex, ey, ez)), _node_path(np), _is_wrt(true), _wrt_path(wrt) {} + +public: HprLerpFunctor(const HprLerpFunctor&); virtual ~HprLerpFunctor(void); HprLerpFunctor& operator=(const HprLerpFunctor&); virtual void operator()(float); + public: // now for typehandle stuff static TypeHandle get_class_type(void) { @@ -116,7 +124,8 @@ private: NodePath _node_path; NodePath _wrt_path; bool _is_wrt; -public: + +PUBLISHED: ScaleLerpFunctor(NodePath np, LVecBase3f start, LVecBase3f end) : LVecBase3fLerpFunctor(start, end), _node_path(np), _is_wrt(false) {} ScaleLerpFunctor(NodePath np, float sx, float sy, float sz, float ex, @@ -130,10 +139,13 @@ public: float ey, float ez, NodePath wrt) : LVecBase3fLerpFunctor(LVecBase3f(sx, sy, sz), LVecBase3f(ex, ey, ez)), _node_path(np), _is_wrt(true), _wrt_path(wrt) {} + +public: ScaleLerpFunctor(const ScaleLerpFunctor&); virtual ~ScaleLerpFunctor(void); ScaleLerpFunctor& operator=(const ScaleLerpFunctor&); virtual void operator()(float); + public: // now for typehandle stuff static TypeHandle get_class_type(void) { @@ -164,7 +176,8 @@ private: NodePath _node_path; NodePath _wrt_path; bool _is_wrt; -public: + +PUBLISHED: ColorLerpFunctor(NodePath np, LVecBase4f start, LVecBase4f end) : LVecBase4fLerpFunctor(start, end), _node_path(np), _is_wrt(false) {} ColorLerpFunctor(NodePath np, float sr, float sg, float sb, float sa, @@ -177,10 +190,13 @@ public: float eb, float ea, NodePath wrt) : LVecBase4fLerpFunctor(LVecBase4f(sr, sg, sb, sa), LVecBase4f(er, eg, eb, ea)), _node_path(np), _is_wrt(true), _wrt_path(wrt) {} + +public: ColorLerpFunctor(const ColorLerpFunctor&); virtual ~ColorLerpFunctor(void); ColorLerpFunctor& operator=(const ColorLerpFunctor&); virtual void operator()(float); + public: // now for typehandle stuff static TypeHandle get_class_type(void) { @@ -218,7 +234,8 @@ private: LVecBase3f _hdiff_cache; NodePath _wrt_path; bool _is_wrt; -public: + +PUBLISHED: PosHprLerpFunctor(NodePath np, LPoint3f pstart, LPoint3f pend, LVecBase3f hstart, LVecBase3f hend) : LerpFunctor(), _node_path(np), _pstart(pstart), _pend(pend), @@ -243,10 +260,13 @@ public: _pend(pex, pey, pez), _pdiff_cache(_pend-_pstart), _hstart(hsx, hsy, hsz), _hend(hex, hey, hez), _hdiff_cache(_hend - _hstart), _is_wrt(true), _wrt_path(wrt) {} + +public: PosHprLerpFunctor(const PosHprLerpFunctor&); virtual ~PosHprLerpFunctor(void); PosHprLerpFunctor& operator=(const PosHprLerpFunctor&); virtual void operator()(float); + public: // now for typehandle stuff static TypeHandle get_class_type(void) { @@ -287,7 +307,8 @@ private: LVecBase3f _sdiff_cache; NodePath _wrt_path; bool _is_wrt; -public: + +PUBLISHED: PosHprScaleLerpFunctor(NodePath np, LPoint3f pstart, LPoint3f pend, LVecBase3f hstart, LVecBase3f hend, LVecBase3f sstart, LVecBase3f send) @@ -322,10 +343,13 @@ public: _hdiff_cache(_hend-_hstart), _sstart(ssx, ssy, ssz), _send(sex, sey, sez), _sdiff_cache(_send-_sstart), _is_wrt(true), _wrt_path(wrt) {} + +public: PosHprScaleLerpFunctor(const PosHprScaleLerpFunctor&); virtual ~PosHprScaleLerpFunctor(void); PosHprScaleLerpFunctor& operator=(const PosHprScaleLerpFunctor&); virtual void operator()(float); + public: // now for typehandle stuff static TypeHandle get_class_type(void) { @@ -356,7 +380,8 @@ private: NodePath _node_path; NodePath _wrt_path; bool _is_wrt; -public: + +PUBLISHED: ColorScaleLerpFunctor(NodePath np, LVecBase4f start, LVecBase4f end) : LVecBase4fLerpFunctor(start, end), _node_path(np), _is_wrt(false) {} ColorScaleLerpFunctor(NodePath np, float sr, float sg, float sb, float sa, @@ -369,10 +394,13 @@ public: float eb, float ea, NodePath wrt) : LVecBase4fLerpFunctor(LVecBase4f(sr, sg, sb, sa), LVecBase4f(er, eg, eb, ea)), _node_path(np), _is_wrt(true), _wrt_path(wrt) {} + +public: ColorScaleLerpFunctor(const ColorScaleLerpFunctor&); virtual ~ColorScaleLerpFunctor(void); ColorScaleLerpFunctor& operator=(const ColorScaleLerpFunctor&); virtual void operator()(float); + public: // now for typehandle stuff static TypeHandle get_class_type(void) { diff --git a/panda/src/sgraph/camera.h b/panda/src/sgraph/camera.h index 15d23e7045..0b1aa63ed7 100644 --- a/panda/src/sgraph/camera.h +++ b/panda/src/sgraph/camera.h @@ -27,8 +27,10 @@ class DisplayRegion; // Description : //////////////////////////////////////////////////////////////////// class EXPCL_PANDA Camera : public ProjectionNode { -public: +PUBLISHED: Camera(const string &name = ""); + +public: Camera(const Camera ©); void operator = (const Camera ©); virtual ~Camera(); @@ -40,6 +42,7 @@ public: //virtual void output(ostream &out) const; virtual void config() { } +PUBLISHED: INLINE void set_active(bool active); INLINE bool is_active() const; diff --git a/panda/src/sgraph/geomNode.cxx b/panda/src/sgraph/geomNode.cxx index 744a369854..b71c75cf42 100644 --- a/panda/src/sgraph/geomNode.cxx +++ b/panda/src/sgraph/geomNode.cxx @@ -122,7 +122,7 @@ write_verbose(ostream &out) const { for (gi = _geoms.begin(); gi != _geoms.end(); ++gi) { dDrawable *drawable = (*gi); if (drawable->is_of_type(Geom::get_class_type())) { - DCAST(Geom, drawable)->output_verbose(out); + DCAST(Geom, drawable)->write_verbose(out); } else { out << drawable->get_type() << "\n"; } diff --git a/panda/src/sgraph/geomNode.h b/panda/src/sgraph/geomNode.h index 92221d05d6..3120d25604 100644 --- a/panda/src/sgraph/geomNode.h +++ b/panda/src/sgraph/geomNode.h @@ -25,8 +25,10 @@ class AllAttributesWrapper; // elements //////////////////////////////////////////////////////////////////// class EXPCL_PANDA GeomNode : public NamedNode { -public: +PUBLISHED: GeomNode(const string &name = ""); + +public: GeomNode(const GeomNode ©); void operator = (const GeomNode ©); virtual ~GeomNode(); @@ -34,11 +36,14 @@ public: virtual Node *make_copy() const; virtual void xform(const LMatrix4f &mat); +PUBLISHED: void write(ostream &out, int indent_level = 0) const; void write_verbose(ostream &out) const; +public: void draw(GraphicsStateGuardianBase *gsg); +PUBLISHED: int get_num_geoms() const; dDrawable *get_geom(int n) const; void remove_geom(int n); diff --git a/panda/src/sgraph/modelNode.h b/panda/src/sgraph/modelNode.h index 50c5eda909..9fc9e16965 100644 --- a/panda/src/sgraph/modelNode.h +++ b/panda/src/sgraph/modelNode.h @@ -23,8 +23,10 @@ // flag within an egg file. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA ModelNode : public NamedNode { -public: +PUBLISHED: INLINE ModelNode(const string &name = ""); + +public: INLINE ModelNode(const ModelNode ©); INLINE void operator = (const ModelNode ©); diff --git a/panda/src/sgraph/modelRoot.h b/panda/src/sgraph/modelRoot.h index ca31a5b45c..3df0b1fc8a 100644 --- a/panda/src/sgraph/modelRoot.h +++ b/panda/src/sgraph/modelRoot.h @@ -20,8 +20,10 @@ // indicate the presence of a loaded model file. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA ModelRoot : public ModelNode { -public: +PUBLISHED: INLINE ModelRoot(const string &name = ""); + +public: INLINE ModelRoot(const ModelRoot ©); INLINE void operator = (const ModelRoot ©); diff --git a/panda/src/sgraph/planeNode.h b/panda/src/sgraph/planeNode.h index ba986ddc1e..19b7c621c5 100644 --- a/panda/src/sgraph/planeNode.h +++ b/panda/src/sgraph/planeNode.h @@ -24,13 +24,16 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDA PlaneNode : public NamedNode { -public: +PUBLISHED: INLINE PlaneNode(const string& name = ""); + +public: INLINE PlaneNode(const PlaneNode ©); INLINE void operator = (const PlaneNode ©); virtual Node *make_copy() const; +PUBLISHED: void set_plane(const Planef& plane); const Planef& get_plane(void) const; diff --git a/panda/src/sgraph/projectionNode.h b/panda/src/sgraph/projectionNode.h index 4913ff067e..1a35c4828d 100644 --- a/panda/src/sgraph/projectionNode.h +++ b/panda/src/sgraph/projectionNode.h @@ -23,13 +23,16 @@ // Description : A node that has a frustum //////////////////////////////////////////////////////////////////// class EXPCL_PANDA ProjectionNode : public NamedNode { -public: +PUBLISHED: INLINE ProjectionNode(const string& name = ""); + +public: INLINE ProjectionNode(const ProjectionNode ©); INLINE void operator = (const ProjectionNode ©); virtual Node *make_copy() const; - + +PUBLISHED: void set_projection( const Projection& projection ); const Projection* get_projection( void ) const; diff --git a/panda/src/sgraph/renderTraverser.h b/panda/src/sgraph/renderTraverser.h index 1aa2992824..9eb29fbb92 100644 --- a/panda/src/sgraph/renderTraverser.h +++ b/panda/src/sgraph/renderTraverser.h @@ -28,13 +28,16 @@ class EXPCL_PANDA RenderTraverser : public TypedReferenceCount { public: INLINE RenderTraverser(GraphicsStateGuardian *gsg, TypeHandle graph_type); +PUBLISHED: INLINE GraphicsStateGuardian *get_gsg() const; INLINE TypeHandle get_graph_type() const; - + +public: virtual void traverse(Node *root, const AllAttributesWrapper &initial_state, const AllTransitionsWrapper &net_trans)=0; +PUBLISHED: virtual void output(ostream &out) const; virtual void write(ostream &out, int indent_level = 0) const; diff --git a/panda/src/switchnode/LODNode.h b/panda/src/switchnode/LODNode.h index 9d46714074..64101d3fdc 100644 --- a/panda/src/switchnode/LODNode.h +++ b/panda/src/switchnode/LODNode.h @@ -23,13 +23,16 @@ // Description : A node that implements level of detail //////////////////////////////////////////////////////////////////// class EXPCL_PANDA LODNode : public NamedNode { -public: +PUBLISHED: INLINE LODNode(const string &name = ""); + +public: INLINE LODNode(const LODNode ©); virtual Node *make_copy() const; virtual void xform(const LMatrix4f &mat); +PUBLISHED: // The sense of in vs. out distances is as if the object were coming // towards you from far away: it switches "in" at the far distance, // and switches "out" at the close distance. Thus, "in" should be @@ -43,6 +46,7 @@ public: INLINE float get_in(int index) const; INLINE float get_out(int index) const; +public: virtual void output(ostream &out) const; virtual bool sub_render(const AllAttributesWrapper &attrib, diff --git a/panda/src/switchnode/sequenceNode.h b/panda/src/switchnode/sequenceNode.h index 88b90307fe..beba85c939 100644 --- a/panda/src/switchnode/sequenceNode.h +++ b/panda/src/switchnode/sequenceNode.h @@ -23,12 +23,13 @@ class EXPCL_PANDA SequenceNode : public NamedNode, public TimedCycle { -public: +PUBLISHED: SequenceNode(const string &initial_name = ""); SequenceNode(float switch_time, const string &initial_name = ""); void set_switch_time(float switch_time); +public: virtual bool sub_render(const AllAttributesWrapper &attrib, AllTransitionsWrapper &trans, GraphicsStateGuardianBase *gsgbase); diff --git a/panda/src/text/textNode.h b/panda/src/text/textNode.h index da9e7e78d4..ec6b765192 100644 --- a/panda/src/text/textNode.h +++ b/panda/src/text/textNode.h @@ -26,16 +26,18 @@ //////////////////////////////////////////////////////////////////// // Defines //////////////////////////////////////////////////////////////////// +BEGIN_PUBLISH #define TM_ALIGN_LEFT 1 #define TM_ALIGN_RIGHT 2 #define TM_ALIGN_CENTER 3 +END_PUBLISH //////////////////////////////////////////////////////////////////// // Class : TextNode // Description : //////////////////////////////////////////////////////////////////// class EXPCL_PANDA TextNode : public NamedNode { -public: +PUBLISHED: TextNode(const string &name = ""); ~TextNode(); diff --git a/panda/src/tform/buttonThrower.h b/panda/src/tform/buttonThrower.h index 1396af1b6f..a838b529b5 100644 --- a/panda/src/tform/buttonThrower.h +++ b/panda/src/tform/buttonThrower.h @@ -25,7 +25,7 @@ // call. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA ButtonThrower : public DataNode { -public: +PUBLISHED: ButtonThrower(const string &name = ""); void set_prefix(const string &prefix); diff --git a/panda/src/tform/driveInterface.h b/panda/src/tform/driveInterface.h index 59ff9922a9..73764373b8 100644 --- a/panda/src/tform/driveInterface.h +++ b/panda/src/tform/driveInterface.h @@ -26,7 +26,7 @@ // driving a vehicle. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA DriveInterface : public DataNode { -public: +PUBLISHED: DriveInterface(const string &name = ""); ~DriveInterface(); diff --git a/panda/src/tform/mouseWatcher.h b/panda/src/tform/mouseWatcher.h index 67e039c8d5..4e306b0416 100644 --- a/panda/src/tform/mouseWatcher.h +++ b/panda/src/tform/mouseWatcher.h @@ -38,7 +38,7 @@ // according to the mouse's known position. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA MouseWatcher : public DataNode { -public: +PUBLISHED: MouseWatcher(const string &name = ""); ~MouseWatcher(); diff --git a/panda/src/tform/mouseWatcherRegion.h b/panda/src/tform/mouseWatcherRegion.h index e6177b9acb..7d57d8bd06 100644 --- a/panda/src/tform/mouseWatcherRegion.h +++ b/panda/src/tform/mouseWatcherRegion.h @@ -18,7 +18,7 @@ // on the screen for the MouseWatcher. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA MouseWatcherRegion : public ReferenceCount, public Namable { -public: +PUBLISHED: INLINE MouseWatcherRegion(const string &name, float left, float right, float bottom, float top); INLINE MouseWatcherRegion(const string &name, const LVecBase4f &frame); diff --git a/panda/src/tform/trackball.h b/panda/src/tform/trackball.h index 244f93b178..8f12d387e1 100644 --- a/panda/src/tform/trackball.h +++ b/panda/src/tform/trackball.h @@ -28,7 +28,7 @@ // origin. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA Trackball : public DataNode { -public: +PUBLISHED: Trackball(const string &name = ""); ~Trackball(); diff --git a/panda/src/tform/trackerTransform.h b/panda/src/tform/trackerTransform.h index e588afc447..a771c986d7 100644 --- a/panda/src/tform/trackerTransform.h +++ b/panda/src/tform/trackerTransform.h @@ -32,9 +32,10 @@ // from the data and sends that matrix down the line //////////////////////////////////////////////////////////////////// class EXPCL_PANDA TrackerTransform : public DataNode { -public: +PUBLISHED: TrackerTransform(const string &name = ""); +public: virtual void transmit_data(NodeAttributes &data); private: diff --git a/panda/src/tform/transform2sg.h b/panda/src/tform/transform2sg.h index 24a2b6badf..91250321e6 100644 --- a/panda/src/tform/transform2sg.h +++ b/panda/src/tform/transform2sg.h @@ -20,7 +20,7 @@ class NodeRelation; // attribute for a given arc of the scene graph. //////////////////////////////////////////////////////////////////// class EXPCL_PANDA Transform2SG : public DataNode { -public: +PUBLISHED: Transform2SG(const string &name = ""); void set_arc(NodeRelation *arc);