callbackObject_ext.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Filename: callbackObject_ext.h
  2. // Created by: rdb (25Feb15)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) Carnegie Mellon University. All rights reserved.
  8. //
  9. // All use of this software is subject to the terms of the revised BSD
  10. // license. You should have received a copy of this license along
  11. // with this source code in a file named "LICENSE."
  12. //
  13. ////////////////////////////////////////////////////////////////////
  14. #ifndef CALLBACKOBJECT_EXT_H
  15. #define CALLBACKOBJECT_EXT_H
  16. #include "dtoolbase.h"
  17. #include "pointerTo.h"
  18. #ifdef HAVE_PYTHON
  19. #include "extension.h"
  20. #include "pythonCallbackObject.h"
  21. #include "py_panda.h"
  22. ////////////////////////////////////////////////////////////////////
  23. // Class : Extension<CallbackObject>
  24. // Description : This class defines the extension methods for
  25. // CallbackObject, which are called instead of
  26. // any C++ methods with the same prototype.
  27. //
  28. // This just defines a static constructor, which makes
  29. // it possible for Interrogate to automatically accept
  30. // a Python function wherever a CallbackObject is
  31. // accepted.
  32. ////////////////////////////////////////////////////////////////////
  33. template<>
  34. class Extension<CallbackObject> : public ExtensionBase<CallbackObject> {
  35. public:
  36. INLINE static PT(CallbackObject) make(PyObject *function);
  37. };
  38. #include "callbackObject_ext.I"
  39. #endif // HAVE_PYTHON
  40. #endif // CALLBACKOBJECT_EXT_H