LuaPlugin.h 785 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include <RmlUi/Core/Plugin.h>
  3. #include <RmlUi/Lua/Header.h>
  4. typedef struct lua_State lua_State;
  5. namespace Rml {
  6. namespace Lua {
  7. class LuaDocumentElementInstancer;
  8. class LuaEventListenerInstancer;
  9. /**
  10. This initializes the Lua interpreter, and has functions to load the scripts or
  11. call functions that exist in Lua.
  12. */
  13. class RMLUILUA_API LuaPlugin : public Plugin {
  14. public:
  15. LuaPlugin(lua_State* lua_state);
  16. static lua_State* GetLuaState();
  17. private:
  18. int GetEventClasses() override;
  19. void OnInitialise() override;
  20. void OnShutdown() override;
  21. LuaDocumentElementInstancer* lua_document_element_instancer = nullptr;
  22. LuaEventListenerInstancer* lua_event_listener_instancer = nullptr;
  23. bool owns_lua_state = false;
  24. };
  25. } // namespace Lua
  26. } // namespace Rml