UILuaAPI.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. //
  2. // Copyright (c) 2008-2013 the Urho3D project.
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to deal
  6. // in the Software without restriction, including without limitation the rights
  7. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. // copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. // THE SOFTWARE.
  21. //
  22. #pragma once
  23. #include "BorderImage.h"
  24. #include "Button.h"
  25. #include "CheckBox.h"
  26. #include "Context.h"
  27. #include "Cursor.h"
  28. #include "DropDownList.h"
  29. #include "FileSelector.h"
  30. #include "Font.h"
  31. #include "LineEdit.h"
  32. #include "ListView.h"
  33. #include "LuaScript.h"
  34. #include "Menu.h"
  35. #include "ScrollBar.h"
  36. #include "ScrollView.h"
  37. #include "Slider.h"
  38. #include "Sprite.h"
  39. #include "Text.h"
  40. #include "Text3D.h"
  41. #include "UI.h"
  42. #include "UIElement.h"
  43. #include "Window.h"
  44. namespace Urho3D
  45. {
  46. BorderImage* NewBorderImage()
  47. {
  48. return new BorderImage(GetLuaScriptContext());
  49. }
  50. Button* NewButton()
  51. {
  52. return new Button(GetLuaScriptContext());
  53. }
  54. CheckBox* NewCheckBox()
  55. {
  56. return new CheckBox(GetLuaScriptContext());
  57. }
  58. Cursor* NewCursor()
  59. {
  60. return new Cursor(GetLuaScriptContext());
  61. }
  62. DropDownList* NewDropDownList()
  63. {
  64. return new DropDownList(GetLuaScriptContext());
  65. }
  66. FileSelector* NewFileSelector()
  67. {
  68. return new FileSelector(GetLuaScriptContext());
  69. }
  70. Font* NewFont()
  71. {
  72. return new Font(GetLuaScriptContext());
  73. }
  74. LineEdit* NewLineEdit()
  75. {
  76. return new LineEdit(GetLuaScriptContext());
  77. }
  78. ListView* NewListView()
  79. {
  80. return new ListView(GetLuaScriptContext());
  81. }
  82. Menu* NewMenu()
  83. {
  84. return new Menu(GetLuaScriptContext());
  85. }
  86. ScrollBar* NewScrollBar()
  87. {
  88. return new ScrollBar(GetLuaScriptContext());
  89. }
  90. ScrollView* NewScrollView()
  91. {
  92. return new ScrollView(GetLuaScriptContext());
  93. }
  94. Slider* NewSlider()
  95. {
  96. return new Slider(GetLuaScriptContext());
  97. }
  98. Sprite* NewSprite()
  99. {
  100. return new Sprite(GetLuaScriptContext());
  101. }
  102. Text* NewText()
  103. {
  104. return new Text(GetLuaScriptContext());
  105. }
  106. Text3D* NewText3D()
  107. {
  108. return new Text3D(GetLuaScriptContext());
  109. }
  110. UI* GetUI()
  111. {
  112. return GetLuaScriptContext()->GetSubsystem<UI>();
  113. }
  114. UIElement* NewUIElement()
  115. {
  116. return new UIElement(GetLuaScriptContext());
  117. }
  118. Window* NewWindow()
  119. {
  120. return new Window(GetLuaScriptContext());
  121. }
  122. }