logo

libbulletml

Library of Bullet Markup Language (forked from https://shinh.skr.jp/libbulletml/index_en.html )git clone https://anongit.hacktivis.me/git/libbulletml.git/

d_cpp_interface.h (12855B)


  1. #define D_CPP_CLASS(CLASS, CLASS_NAME) ;
  2. #define D_CPP_NEW_0(CLASS, NEW_NAME) \
  3. CLASS* NEW_NAME() { \
  4. return new CLASS(); \
  5. }
  6. #define D_CPP_NEW_1(CLASS, NEW_NAME, ARG1) \
  7. CLASS* NEW_NAME(ARG1 arg1) { \
  8. return new CLASS(arg1); \
  9. }
  10. #define D_CPP_NEW_2(CLASS, NEW_NAME, ARG1, ARG2) \
  11. CLASS* NEW_NAME(ARG1 arg1, ARG2 arg2) { \
  12. return new CLASS(arg1, arg2); \
  13. }
  14. #define D_CPP_NEW_3(CLASS, NEW_NAME, ARG1, ARG2, ARG3) \
  15. CLASS* NEW_NAME(ARG1 arg1, ARG2 arg2, ARG3 arg3) { \
  16. return new CLASS(arg1, arg2, arg3); \
  17. }
  18. #define D_CPP_NEW_4(CLASS, NEW_NAME, ARG1, ARG2, ARG3, ARG4) \
  19. CLASS* NEW_NAME(ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4) { \
  20. return new CLASS(arg1, arg2, arg3, arg4); \
  21. }
  22. #define D_CPP_NEW_5(CLASS, NEW_NAME, ARG1, ARG2, ARG3, ARG4, ARG5) \
  23. CLASS* NEW_NAME(ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5) { \
  24. return new CLASS(arg1, arg2, arg3, arg4, arg5); \
  25. }
  26. #define D_CPP_NEW_6(CLASS, NEW_NAME, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
  27. CLASS* NEW_NAME(ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6) { \
  28. return new CLASS(arg1, arg2, arg3, arg4, arg5, arg6); \
  29. }
  30. #define D_CPP_NEW_7(CLASS, NEW_NAME, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
  31. CLASS* NEW_NAME(ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6, ARG7 arg7) { \
  32. return new CLASS(arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
  33. }
  34. #define D_CPP_NEW_8(CLASS, NEW_NAME, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8) \
  35. CLASS* NEW_NAME(ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6, ARG7 arg7, ARG8 arg8) { \
  36. return new CLASS(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
  37. }
  38. #define D_CPP_NEW_9(CLASS, NEW_NAME, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8, ARG9) \
  39. CLASS* NEW_NAME(ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6, ARG7 arg7, ARG8 arg8, ARG9 arg9) { \
  40. return new CLASS(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \
  41. }
  42. #define D_CPP_DELETE(CLASS, DELETE_NAME) \
  43. void DELETE_NAME(CLASS* c) { delete c; }
  44. #define D_CPP_METHOD_0(CLASS, METHOD, METHOD_NAME, RETURN) \
  45. RETURN METHOD_NAME(CLASS* c) { \
  46. return c->METHOD(); \
  47. }
  48. #define D_CPP_METHOD_1(CLASS, METHOD, METHOD_NAME, RETURN, ARG1) \
  49. RETURN METHOD_NAME(CLASS* c, ARG1 arg1) { \
  50. return c->METHOD(arg1); \
  51. }
  52. #define D_CPP_METHOD_2(CLASS, METHOD, METHOD_NAME, RETURN, ARG1, ARG2) \
  53. RETURN METHOD_NAME(CLASS* c, ARG1 arg1, ARG2 arg2) { \
  54. return c->METHOD(arg1, arg2); \
  55. }
  56. #define D_CPP_METHOD_3(CLASS, METHOD, METHOD_NAME, RETURN, ARG1, ARG2, ARG3) \
  57. RETURN METHOD_NAME(CLASS* c, ARG1 arg1, ARG2 arg2, ARG3 arg3) { \
  58. return c->METHOD(arg1, arg2, arg3); \
  59. }
  60. #define D_CPP_METHOD_4(CLASS, METHOD, METHOD_NAME, RETURN, ARG1, ARG2, ARG3, ARG4) \
  61. RETURN METHOD_NAME(CLASS* c, ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4) { \
  62. return c->METHOD(arg1, arg2, arg3, arg4); \
  63. }
  64. #define D_CPP_METHOD_5(CLASS, METHOD, METHOD_NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \
  65. RETURN METHOD_NAME(CLASS* c, ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5) { \
  66. return c->METHOD(arg1, arg2, arg3, arg4, arg5); \
  67. }
  68. #define D_CPP_METHOD_6(CLASS, METHOD, METHOD_NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
  69. RETURN METHOD_NAME(CLASS* c, ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6) { \
  70. return c->METHOD(arg1, arg2, arg3, arg4, arg5, arg6); \
  71. }
  72. #define D_CPP_METHOD_7(CLASS, METHOD, METHOD_NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
  73. RETURN METHOD_NAME(CLASS* c, ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6, ARG7 arg7) { \
  74. return c->METHOD(arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
  75. }
  76. #define D_CPP_METHOD_8(CLASS, METHOD, METHOD_NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8) \
  77. RETURN METHOD_NAME(CLASS* c, ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6, ARG7 arg7, ARG8 arg8) { \
  78. return c->METHOD(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
  79. }
  80. #define D_CPP_METHOD_9(CLASS, METHOD, METHOD_NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8, ARG9) \
  81. RETURN METHOD_NAME(CLASS* c, ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6, ARG7 arg7, ARG8 arg8, ARG9 arg9) { \
  82. return c->METHOD(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \
  83. }
  84. #define D_CPP_STATIC_METHOD_0(CLASS, METHOD, METHOD_NAME, RETURN) \
  85. RETURN METHOD_NAME() { \
  86. return CLASS::METHOD(); \
  87. }
  88. #define D_CPP_STATIC_METHOD_1(CLASS, METHOD, METHOD_NAME, RETURN, ARG1) \
  89. RETURN METHOD_NAME(ARG1 arg1) { \
  90. return CLASS::METHOD(arg1); \
  91. }
  92. #define D_CPP_STATIC_METHOD_2(CLASS, METHOD, METHOD_NAME, RETURN, ARG1, ARG2) \
  93. RETURN METHOD_NAME(ARG1 arg1, ARG2 arg2) { \
  94. return CLASS::METHOD(arg1, arg2); \
  95. }
  96. #define D_CPP_STATIC_METHOD_3(CLASS, METHOD, METHOD_NAME, RETURN, ARG1, ARG2, ARG3) \
  97. RETURN METHOD_NAME(ARG1 arg1, ARG2 arg2, ARG3 arg3) { \
  98. return CLASS::METHOD(arg1, arg2, arg3); \
  99. }
  100. #define D_CPP_STATIC_METHOD_4(CLASS, METHOD, METHOD_NAME, RETURN, ARG1, ARG2, ARG3, ARG4) \
  101. RETURN METHOD_NAME(ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4) { \
  102. return CLASS::METHOD(arg1, arg2, arg3, arg4); \
  103. }
  104. #define D_CPP_STATIC_METHOD_5(CLASS, METHOD, METHOD_NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \
  105. RETURN METHOD_NAME(ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5) { \
  106. return CLASS::METHOD(arg1, arg2, arg3, arg4, arg5); \
  107. }
  108. #define D_CPP_STATIC_METHOD_6(CLASS, METHOD, METHOD_NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
  109. RETURN METHOD_NAME(ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6) { \
  110. return CLASS::METHOD(arg1, arg2, arg3, arg4, arg5, arg6); \
  111. }
  112. #define D_CPP_STATIC_METHOD_7(CLASS, METHOD, METHOD_NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
  113. RETURN METHOD_NAME(ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6, ARG7 arg7) { \
  114. return CLASS::METHOD(arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
  115. }
  116. #define D_CPP_STATIC_METHOD_8(CLASS, METHOD, METHOD_NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8) \
  117. RETURN METHOD_NAME(ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6, ARG7 arg7, ARG8 arg8) { \
  118. return CLASS::METHOD(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
  119. }
  120. #define D_CPP_STATIC_METHOD_9(CLASS, METHOD, METHOD_NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8, ARG9) \
  121. RETURN METHOD_NAME(ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6, ARG7 arg7, ARG8 arg8, ARG9 arg9) { \
  122. return CLASS::METHOD(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \
  123. }
  124. #define D_CPP_BASE_CLASS_OPEN(BASE, BASE_NAME) \
  125. struct BASE_NAME : public BASE {
  126. #define D_CPP_VIRTUAL_METHOD_0(CLASS, METHOD, RETURN) \
  127. virtual RETURN METHOD() { \
  128. return D_##METHOD##_fp(this ); \
  129. } \
  130. void D_set_##METHOD(RETURN (*fp) (CLASS* )) { \
  131. D_##METHOD##_fp = fp; \
  132. } \
  133. RETURN (*D_##METHOD##_fp) (CLASS*);
  134. #define D_CPP_VIRTUAL_METHOD_1(CLASS, METHOD, RETURN, ARG1) \
  135. virtual RETURN METHOD(ARG1 arg1) { \
  136. return D_##METHOD##_fp(this , arg1); \
  137. } \
  138. void D_set_##METHOD(RETURN (*fp) (CLASS* , ARG1)) { \
  139. D_##METHOD##_fp = fp; \
  140. } \
  141. RETURN (*D_##METHOD##_fp) (CLASS*, ARG1);
  142. #define D_CPP_VIRTUAL_METHOD_2(CLASS, METHOD, RETURN, ARG1, ARG2) \
  143. virtual RETURN METHOD(ARG1 arg1, ARG2 arg2) { \
  144. return D_##METHOD##_fp(this , arg1, arg2); \
  145. } \
  146. void D_set_##METHOD(RETURN (*fp) (CLASS* , ARG1, ARG2)) { \
  147. D_##METHOD##_fp = fp; \
  148. } \
  149. RETURN (*D_##METHOD##_fp) (CLASS*, ARG1, ARG2);
  150. #define D_CPP_VIRTUAL_METHOD_3(CLASS, METHOD, RETURN, ARG1, ARG2, ARG3) \
  151. virtual RETURN METHOD(ARG1 arg1, ARG2 arg2, ARG3 arg3) { \
  152. return D_##METHOD##_fp(this , arg1, arg2, arg3); \
  153. } \
  154. void D_set_##METHOD(RETURN (*fp) (CLASS* , ARG1, ARG2, ARG3)) { \
  155. D_##METHOD##_fp = fp; \
  156. } \
  157. RETURN (*D_##METHOD##_fp) (CLASS*, ARG1, ARG2, ARG3);
  158. #define D_CPP_VIRTUAL_METHOD_4(CLASS, METHOD, RETURN, ARG1, ARG2, ARG3, ARG4) \
  159. virtual RETURN METHOD(ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4) { \
  160. return D_##METHOD##_fp(this , arg1, arg2, arg3, arg4); \
  161. } \
  162. void D_set_##METHOD(RETURN (*fp) (CLASS* , ARG1, ARG2, ARG3, ARG4)) { \
  163. D_##METHOD##_fp = fp; \
  164. } \
  165. RETURN (*D_##METHOD##_fp) (CLASS*, ARG1, ARG2, ARG3, ARG4);
  166. #define D_CPP_VIRTUAL_METHOD_5(CLASS, METHOD, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \
  167. virtual RETURN METHOD(ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5) { \
  168. return D_##METHOD##_fp(this , arg1, arg2, arg3, arg4, arg5); \
  169. } \
  170. void D_set_##METHOD(RETURN (*fp) (CLASS* , ARG1, ARG2, ARG3, ARG4, ARG5)) { \
  171. D_##METHOD##_fp = fp; \
  172. } \
  173. RETURN (*D_##METHOD##_fp) (CLASS*, ARG1, ARG2, ARG3, ARG4, ARG5);
  174. #define D_CPP_VIRTUAL_METHOD_6(CLASS, METHOD, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
  175. virtual RETURN METHOD(ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6) { \
  176. return D_##METHOD##_fp(this , arg1, arg2, arg3, arg4, arg5, arg6); \
  177. } \
  178. void D_set_##METHOD(RETURN (*fp) (CLASS* , ARG1, ARG2, ARG3, ARG4, ARG5, ARG6)) { \
  179. D_##METHOD##_fp = fp; \
  180. } \
  181. RETURN (*D_##METHOD##_fp) (CLASS*, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6);
  182. #define D_CPP_VIRTUAL_METHOD_7(CLASS, METHOD, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
  183. virtual RETURN METHOD(ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6, ARG7 arg7) { \
  184. return D_##METHOD##_fp(this , arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
  185. } \
  186. void D_set_##METHOD(RETURN (*fp) (CLASS* , ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7)) { \
  187. D_##METHOD##_fp = fp; \
  188. } \
  189. RETURN (*D_##METHOD##_fp) (CLASS*, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7);
  190. #define D_CPP_VIRTUAL_METHOD_8(CLASS, METHOD, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8) \
  191. virtual RETURN METHOD(ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6, ARG7 arg7, ARG8 arg8) { \
  192. return D_##METHOD##_fp(this , arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
  193. } \
  194. void D_set_##METHOD(RETURN (*fp) (CLASS* , ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8)) { \
  195. D_##METHOD##_fp = fp; \
  196. } \
  197. RETURN (*D_##METHOD##_fp) (CLASS*, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8);
  198. #define D_CPP_VIRTUAL_METHOD_9(CLASS, METHOD, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8, ARG9) \
  199. virtual RETURN METHOD(ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5, ARG6 arg6, ARG7 arg7, ARG8 arg8, ARG9 arg9) { \
  200. return D_##METHOD##_fp(this , arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \
  201. } \
  202. void D_set_##METHOD(RETURN (*fp) (CLASS* , ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8, ARG9)) { \
  203. D_##METHOD##_fp = fp; \
  204. } \
  205. RETURN (*D_##METHOD##_fp) (CLASS*, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8, ARG9);
  206. #define D_CPP_VIRTUAL_METHOD_SETTER_0(CLASS, METHOD, SETTER_NAME, RETURN) \
  207. void SETTER_NAME(CLASS* c, RETURN (*fp) (CLASS*)) { \
  208. c->D_set_##METHOD(fp); \
  209. }
  210. #define D_CPP_VIRTUAL_METHOD_SETTER_1(CLASS, METHOD, SETTER_NAME, RETURN, ARG1) \
  211. void SETTER_NAME(CLASS* c, RETURN (*fp) (CLASS*, ARG1)) { \
  212. c->D_set_##METHOD(fp); \
  213. }
  214. #define D_CPP_VIRTUAL_METHOD_SETTER_2(CLASS, METHOD, SETTER_NAME, RETURN, ARG1, ARG2) \
  215. void SETTER_NAME(CLASS* c, RETURN (*fp) (CLASS*, ARG1, ARG2)) { \
  216. c->D_set_##METHOD(fp); \
  217. }
  218. #define D_CPP_VIRTUAL_METHOD_SETTER_3(CLASS, METHOD, SETTER_NAME, RETURN, ARG1, ARG2, ARG3) \
  219. void SETTER_NAME(CLASS* c, RETURN (*fp) (CLASS*, ARG1, ARG2, ARG3)) { \
  220. c->D_set_##METHOD(fp); \
  221. }
  222. #define D_CPP_VIRTUAL_METHOD_SETTER_4(CLASS, METHOD, SETTER_NAME, RETURN, ARG1, ARG2, ARG3, ARG4) \
  223. void SETTER_NAME(CLASS* c, RETURN (*fp) (CLASS*, ARG1, ARG2, ARG3, ARG4)) { \
  224. c->D_set_##METHOD(fp); \
  225. }
  226. #define D_CPP_VIRTUAL_METHOD_SETTER_5(CLASS, METHOD, SETTER_NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5) \
  227. void SETTER_NAME(CLASS* c, RETURN (*fp) (CLASS*, ARG1, ARG2, ARG3, ARG4, ARG5)) { \
  228. c->D_set_##METHOD(fp); \
  229. }
  230. #define D_CPP_VIRTUAL_METHOD_SETTER_6(CLASS, METHOD, SETTER_NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6) \
  231. void SETTER_NAME(CLASS* c, RETURN (*fp) (CLASS*, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6)) { \
  232. c->D_set_##METHOD(fp); \
  233. }
  234. #define D_CPP_VIRTUAL_METHOD_SETTER_7(CLASS, METHOD, SETTER_NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) \
  235. void SETTER_NAME(CLASS* c, RETURN (*fp) (CLASS*, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7)) { \
  236. c->D_set_##METHOD(fp); \
  237. }
  238. #define D_CPP_VIRTUAL_METHOD_SETTER_8(CLASS, METHOD, SETTER_NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8) \
  239. void SETTER_NAME(CLASS* c, RETURN (*fp) (CLASS*, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8)) { \
  240. c->D_set_##METHOD(fp); \
  241. }
  242. #define D_CPP_VIRTUAL_METHOD_SETTER_9(CLASS, METHOD, SETTER_NAME, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8, ARG9) \
  243. void SETTER_NAME(CLASS* c, RETURN (*fp) (CLASS*, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7, ARG8, ARG9)) { \
  244. c->D_set_##METHOD(fp); \
  245. }
  246. #define D_CPP_BASE_CLASS_CLOSE() \
  247. };
  248. #define D_CPP_D_DECLARE(arg) ;