Context.pkg 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. $#include "Core/Context.h"
  2. class Context
  3. {
  4. Object* GetEventSender() const;
  5. EventHandler* GetEventHandler() const;
  6. const String GetTypeName(StringHash objectType) const;
  7. };
  8. Context* GetContext();
  9. tolua_readonly tolua_property__get_set Context* context;
  10. Object* GetEventSender();
  11. tolua_readonly tolua_property__get_set EventSender* eventSender;
  12. EventHandler* GetEventHandler() const;
  13. tolua_readonly tolua_property__get_set EventHandler* eventHandler;
  14. ${
  15. #define TOLUA_DISABLE_tolua_CoreLuaAPI_GetContext00
  16. static int tolua_CoreLuaAPI_GetContext00(lua_State* tolua_S)
  17. {
  18. tolua_pushusertype(tolua_S, (void*)GetContext(tolua_S), "Context");
  19. return 1;
  20. }
  21. #define TOLUA_DISABLE_tolua_get_context_ptr
  22. static int tolua_get_context_ptr(lua_State* tolua_S)
  23. {
  24. return tolua_CoreLuaAPI_GetContext00(tolua_S);
  25. }
  26. #define TOLUA_DISABLE_tolua_CoreLuaAPI_GetEventSender00
  27. static int tolua_CoreLuaAPI_GetEventSender00(lua_State* tolua_S)
  28. {
  29. // Could be null outside event handling
  30. Object* tolua_ret = GetContext(tolua_S)->GetEventSender();
  31. if (tolua_ret)
  32. tolua_pushusertype(tolua_S, (void*)tolua_ret, "Object");
  33. else
  34. lua_pushnil(tolua_S);
  35. return 1;
  36. }
  37. #define TOLUA_DISABLE_tolua_get_eventSender_ptr
  38. static int tolua_get_eventSender_ptr(lua_State* tolua_S)
  39. {
  40. return tolua_CoreLuaAPI_GetEventSender00(tolua_S);
  41. }
  42. #define TOLUA_DISABLE_tolua_CoreLuaAPI_GetEventHandler00
  43. static int tolua_CoreLuaAPI_GetEventHandler00(lua_State* tolua_S)
  44. {
  45. EventHandler* tolua_ret = GetContext(tolua_S)->GetEventHandler();
  46. if (tolua_ret)
  47. tolua_pushusertype(tolua_S, (void*)tolua_ret, "EventHandler");
  48. else
  49. lua_pushnil(tolua_S);
  50. return 1;
  51. }
  52. #define TOLUA_DISABLE_tolua_get_eventHandler_ptr
  53. static int tolua_get_eventHandler_ptr(lua_State* tolua_S)
  54. {
  55. return tolua_CoreLuaAPI_GetEventHandler00(tolua_S);
  56. }
  57. $}