PythonEditorAction.h 895 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/Memory/SystemAllocator.h>
  10. #include <AzCore/std/function/function_template.h>
  11. #include <EditorPythonBindings/PythonCommon.h>
  12. #include <pybind11/pybind11.h>
  13. namespace EditorPythonBindings
  14. {
  15. class PythonEditorAction final
  16. {
  17. public:
  18. AZ_TYPE_INFO(PythonEditorAction, "{1A5676D2-767B-4C2F-BC35-9CDDCE1430BB}");
  19. AZ_CLASS_ALLOCATOR(PythonEditorAction, AZ::SystemAllocator);
  20. explicit PythonEditorAction(PyObject* handler);
  21. PyObject* GetPyObject();
  22. const PyObject* GetPyObject() const;
  23. private:
  24. PyObject* m_pythonCallableObject = nullptr;
  25. };
  26. } // namespace EditorPythonBindings