1
1

functions.d 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /*
  2. Boost Software License - Version 1.0 - August 17th, 2003
  3. Permission is hereby granted, free of charge, to any person or organization
  4. obtaining a copy of the software and accompanying documentation covered by
  5. this license (the "Software") to use, reproduce, display, distribute,
  6. execute, and transmit the Software, and to prepare derivative works of the
  7. Software, and to permit third-parties to whom the Software is furnished to
  8. do so, all subject to the following:
  9. The copyright notices in the Software and this entire statement, including
  10. the above license grant, this restriction and the following disclaimer,
  11. must be included in all copies of the Software, in whole or in part, and
  12. all derivative works of the Software, unless such copies or derivative
  13. works are solely in the form of machine-executable object code generated by
  14. a source language processor.
  15. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
  18. SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
  19. FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
  20. ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  21. DEALINGS IN THE SOFTWARE.
  22. */
  23. module derelict.anttweakbar.functions;
  24. private
  25. {
  26. import core.stdc.config;
  27. import derelict.anttweakbar.types;
  28. }
  29. extern(System)
  30. {
  31. alias nothrow TwBar* function(const(char)* barName) da_TwNewBar;
  32. alias nothrow int function(TwBar* bar) da_TwDeleteBar;
  33. alias nothrow int function() da_TwDeleteAllBars;
  34. alias nothrow int function(const(TwBar)* bar) da_TwSetTopBar;
  35. alias nothrow TwBar* function() da_TwGetTopBar;
  36. alias nothrow int function(const(TwBar)* bar) da_TwSetBottomBar;
  37. alias nothrow TwBar* function() da_TwGetBottomBar;
  38. alias nothrow const(char)* function(const(TwBar)* bar) da_TwGetBarName;
  39. alias nothrow int function() da_TwGetBarCount;
  40. alias nothrow TwBar* function(int barIndex) da_TwGetBarByIndex;
  41. alias nothrow TwBar* function(const(char)* barName) da_TwGetBarByName;
  42. alias nothrow int function(TwBar* bar) da_TwRefreshBar;
  43. alias nothrow int function(TwBar* bar, const(char)* name, TwType type, void* var, const(char)* def) da_TwAddVarRW;
  44. alias nothrow int function(TwBar* bar, const(char)* name, TwType type, const(void)* var, const(char)* def) da_TwAddVarRO;
  45. alias nothrow int function(TwBar* bar, const(char)* name, TwType type, TwSetVarCallback setCallback, TwGetVarCallback getCallback, void* clientData, const(char)* def) da_TwAddVarCB;
  46. alias nothrow int function(TwBar* bar, const(char)* name, TwButtonCallback callback, void* clientData, const(char)* def) da_TwAddButton;
  47. alias nothrow int function(TwBar* bar, const(char)* name, const(char)* def) da_TwAddSeparator;
  48. alias nothrow int function(TwBar* bar, const(char)* name) da_TwRemoveVar;
  49. alias nothrow int function(TwBar* bar) da_TwRemoveAllVars;
  50. alias nothrow int function(const(char)* def) da_TwDefine;
  51. alias nothrow TwType function(const(char)* name, const(TwEnumVal)* enumValues, uint nbValues) da_TwDefineEnum;
  52. alias nothrow TwType function(const(char)* name, const(char)* enumString) da_TwDefineEnumFromString;
  53. alias nothrow TwType function(const(char)* name, const(TwStructMember)* structMembers, uint nbMembers, size_t structSize, TwSummaryCallback summaryCallback, void* summaryClientData) da_TwDefineStruct;
  54. alias nothrow void function(TwCopyCDStringToClient copyCDStringFunc) da_TwCopyCDStringToClientFunc;
  55. alias nothrow void function(char** destinationLibraryStringPtr, const(char)* sourceClientString) da_TwCopyCDStringToLibrary;
  56. alias nothrow int function(TwBar* bar, const(char)* varName, const(char)* paramName, TwParamValueType paramValueType, uint outValueMaxCount, void* outValues) da_TwGetParam;
  57. alias nothrow int function(TwBar* bar, const(char)* varName, const(char)* paramName, TwParamValueType paramValueType, uint inValueCount, const(void)* inValues) da_TwSetParam;
  58. alias nothrow int function(TwGraphAPI graphAPI, void* device) da_TwInit;
  59. alias nothrow int function() da_TwTerminate;
  60. alias nothrow int function() da_TwDraw;
  61. alias nothrow int function(int width, int height) da_TwWindowSize;
  62. alias nothrow int function(int windowID) da_TwSetCurrentWindow;
  63. alias nothrow int function() da_TwGetCurrentWindow;
  64. alias nothrow int function(int windowID) da_TwWindowExists;
  65. alias nothrow int function(int key, int modifiers) da_TwKeyPressed;
  66. alias nothrow int function(int key, int modifiers) da_TwKeyTest;
  67. alias nothrow int function(TwMouseAction action, TwMouseButtonID button) da_TwMouseButton;
  68. alias nothrow int function(int mouseX, int mouseY) da_TwMouseMotion;
  69. alias nothrow int function(int pos) da_TwMouseWheel;
  70. alias nothrow const(char)* function() da_TwGetLastError;
  71. alias nothrow void function(TwErrorHandler errorHandler) da_TwHandleErrors;
  72. alias nothrow int function(void* wnd, uint msg, uint wParam, int lParam) da_TwEventWin;
  73. alias nothrow int function(const(void)* sdlEvent, ubyte sdlMajorVersion, ubyte sdlMinorVersion) da_TwEventSDL;
  74. alias nothrow int function(int glfwButton, int glfwAction) da_TwEventMouseButtonGLFW;
  75. alias nothrow int function(int glfwKey, int glfwAction) da_TwEventKeyGLFW;
  76. alias nothrow int function(int glfwChar, int glfwAction) da_TwEventCharGLFW;
  77. }
  78. extern(C)
  79. {
  80. alias nothrow int function(int glutButton, int glutState, int mouseX, int mouseY) da_TwEventMouseButtonGLUT;
  81. alias nothrow int function(int mouseX, int mouseY) da_TwEventMouseMotionGLUT;
  82. alias nothrow int function(ubyte glutKey, int mouseX, int mouseY) da_TwEventKeyboardGLUT;
  83. alias nothrow int function(int glutKey, int mouseX, int mouseY) da_TwEventSpecialGLUT;
  84. // alias nothrow int function(int function() glutGetModifiersFunc) da_TwGLUTModifiersFunc;
  85. // alias nothrow int function(const(void)* sfmlEvent, ubyte sfmlMajorVersion, ubyte sfmlMinorVersion) da_TwEventSFML;
  86. /**
  87. Note: The following expect GLFW2 bindings, not GLFW3.
  88. In particular GLFW2 keys do not match GLFW3 keys,
  89. you'll have to translate them if you want to use these functions.
  90. */
  91. alias nothrow int function(int glfwButton, int glfwAction) da_TwEventMouseButtonGLFWcdecl;
  92. alias nothrow int function(int glfwKey, int glfwAction) da_TwEventKeyGLFWcdecl;
  93. alias nothrow int function(int glfwChar, int glfwAction) da_TwEventCharGLFWcdecl;
  94. alias nothrow int function(int mouseX, int mouseY) da_TwEventMousePosGLFWcdecl;
  95. alias nothrow int function(int wheelPos) da_TwEventMouseWheelGLFWcdecl;
  96. }
  97. __gshared
  98. {
  99. da_TwNewBar TwNewBar;
  100. da_TwDeleteBar TwDeleteBar;
  101. da_TwDeleteAllBars TwDeleteAllBars;
  102. da_TwSetTopBar TwSetTopBar;
  103. da_TwGetTopBar TwGetTopBar;
  104. da_TwSetBottomBar TwSetBottomBar;
  105. da_TwGetBottomBar TwGetBottomBar;
  106. da_TwGetBarName TwGetBarName;
  107. da_TwGetBarCount TwGetBarCount;
  108. da_TwGetBarByIndex TwGetBarByIndex;
  109. da_TwGetBarByName TwGetBarByName;
  110. da_TwRefreshBar TwRefreshBar;
  111. da_TwAddVarRW TwAddVarRW;
  112. da_TwAddVarRO TwAddVarRO;
  113. da_TwAddVarCB TwAddVarCB;
  114. da_TwAddButton TwAddButton;
  115. da_TwAddSeparator TwAddSeparator;
  116. da_TwRemoveVar TwRemoveVar;
  117. da_TwRemoveAllVars TwRemoveAllVars;
  118. da_TwDefine TwDefine;
  119. da_TwDefineEnum TwDefineEnum;
  120. da_TwDefineEnumFromString TwDefineEnumFromString;
  121. da_TwDefineStruct TwDefineStruct;
  122. da_TwCopyCDStringToClientFunc TwCopyCDStringToClientFunc;
  123. da_TwCopyCDStringToLibrary TwCopyCDStringToLibrary;
  124. da_TwGetParam TwGetParam;
  125. da_TwSetParam TwSetParam;
  126. da_TwInit TwInit;
  127. da_TwTerminate TwTerminate;
  128. da_TwDraw TwDraw;
  129. da_TwWindowSize TwWindowSize;
  130. da_TwSetCurrentWindow TwSetCurrentWindow;
  131. da_TwGetCurrentWindow TwGetCurrentWindow;
  132. da_TwWindowExists TwWindowExists;
  133. da_TwKeyPressed TwKeyPressed;
  134. da_TwKeyTest TwKeyTest;
  135. da_TwMouseButton TwMouseButton;
  136. da_TwMouseMotion TwMouseMotion;
  137. da_TwMouseWheel TwMouseWheel;
  138. da_TwGetLastError TwGetLastError;
  139. da_TwHandleErrors TwHandleErrors;
  140. da_TwEventWin TwEventWin;
  141. da_TwEventSDL TwEventSDL;
  142. da_TwEventMouseButtonGLFW TwEventMouseButtonGLFW;
  143. da_TwEventKeyGLFW TwEventKeyGLFW;
  144. da_TwEventCharGLFW TwEventCharGLFW;
  145. da_TwEventMouseButtonGLUT TwEventMouseButtonGLUT;
  146. da_TwEventMouseMotionGLUT TwEventMouseMotionGLUT;
  147. da_TwEventKeyboardGLUT TwEventKeyboardGLUT;
  148. da_TwEventSpecialGLUT TwEventSpecialGLUT;
  149. // da_TwGLUTModifiersFunc TwGLUTModifiersFunc;
  150. // da_TwEventSFML TwEventSFML;
  151. da_TwEventMouseButtonGLFWcdecl TwEventMouseButtonGLFWcdecl;
  152. da_TwEventKeyGLFWcdecl TwEventKeyGLFWcdecl;
  153. da_TwEventCharGLFWcdecl TwEventCharGLFWcdecl;
  154. da_TwEventMousePosGLFWcdecl TwEventMousePosGLFWcdecl;
  155. }