LuaScriptLuaAPI.cpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. ** Lua binding: LuaScript
  3. ** Generated automatically by tolua++-1.0.92 on 06/30/13 11:31:52.
  4. */
  5. //
  6. // Copyright (c) 2008-2013 the Urho3D project.
  7. //
  8. // Permission is hereby granted, free of charge, to any person obtaining a copy
  9. // of this software and associated documentation files (the "Software"), to deal
  10. // in the Software without restriction, including without limitation the rights
  11. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12. // copies of the Software, and to permit persons to whom the Software is
  13. // furnished to do so, subject to the following conditions:
  14. //
  15. // The above copyright notice and this permission notice shall be included in
  16. // all copies or substantial portions of the Software.
  17. //
  18. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  24. // THE SOFTWARE.
  25. //
  26. #include "Precompiled.h"
  27. #include "tolua++.h"
  28. /* Exported function */
  29. TOLUA_API int tolua_LuaScript_open (lua_State* tolua_S);
  30. #define TOLUA_RELEASE
  31. #include "LuaScript.h"
  32. using namespace Urho3D;
  33. #pragma warning(disable:4800)
  34. /* function to register type */
  35. static void tolua_reg_types (lua_State* tolua_S)
  36. {
  37. }
  38. /* function: SubscribeToEvent */
  39. #ifndef TOLUA_DISABLE_tolua_LuaScript_SubscribeToEvent00
  40. static int tolua_LuaScript_SubscribeToEvent00(lua_State* tolua_S)
  41. {
  42. #ifndef TOLUA_RELEASE
  43. tolua_Error tolua_err;
  44. if (
  45. !tolua_isstring(tolua_S,1,0,&tolua_err) ||
  46. !tolua_isstring(tolua_S,2,0,&tolua_err) ||
  47. !tolua_isnoobj(tolua_S,3,&tolua_err)
  48. )
  49. goto tolua_lerror;
  50. else
  51. #endif
  52. {
  53. const char* eventType = ((const char*) tolua_tostring(tolua_S,1,0));
  54. const char* funcName = ((const char*) tolua_tostring(tolua_S,2,0));
  55. {
  56. SubscribeToEvent(eventType,funcName);
  57. }
  58. }
  59. return 0;
  60. #ifndef TOLUA_RELEASE
  61. tolua_lerror:
  62. tolua_error(tolua_S,"#ferror in function 'SubscribeToEvent'.",&tolua_err);
  63. return 0;
  64. #endif
  65. }
  66. #endif //#ifndef TOLUA_DISABLE
  67. /* Open function */
  68. TOLUA_API int tolua_LuaScript_open (lua_State* tolua_S)
  69. {
  70. tolua_open(tolua_S);
  71. tolua_reg_types(tolua_S);
  72. tolua_module(tolua_S,NULL,0);
  73. tolua_beginmodule(tolua_S,NULL);
  74. tolua_function(tolua_S,"SubscribeToEvent",tolua_LuaScript_SubscribeToEvent00);
  75. tolua_endmodule(tolua_S);
  76. return 1;
  77. }
  78. #if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
  79. TOLUA_API int luaopen_LuaScript (lua_State* tolua_S) {
  80. return tolua_LuaScript_open(tolua_S);
  81. };
  82. #endif