flexlay_wrap.i 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. %module flexlay_wrap
  2. %exception {
  3. try {
  4. $action
  5. }
  6. catch (const CL_Error& err) {
  7. // static VALUE cpperror = rb_define_class("CPPError", rb_eStandardError);
  8. // rb_raise(cpperror, "Range error.");
  9. std::cout << "CL_Error: " << err.message << std::endl;
  10. }
  11. catch (...) {
  12. std::cout << "Catched some C++ exception" << std::endl;
  13. }
  14. }
  15. %{
  16. #include <ClanLib/Display/color.h>
  17. #include <ClanLib/Display/Providers/provider_factory.h>
  18. #include <ClanLib/GUI/component.h>
  19. #include <ClanLib/GUI/button.h>
  20. #include <ClanLib/GUI/window.h>
  21. #include <ClanLib/Core/Math/rect.h>
  22. #include <ClanLib/Core/Math/point.h>
  23. #include "command.hpp"
  24. #include "paint_command.hpp"
  25. #include "object_move_command.hpp"
  26. #include "object_add_command.hpp"
  27. #include "object_delete_command.hpp"
  28. #include "tile.hpp"
  29. #include "tile_brush.hpp"
  30. #include "meta_data.hpp"
  31. #include "gui/console.hpp"
  32. #include "blitter.hpp"
  33. #include "layer.hpp"
  34. #include "tilemap_layer.hpp"
  35. #include "object_layer.hpp"
  36. #include "onion_skin_layer.hpp"
  37. #include "gui/minimap.hpp"
  38. #include "editor_map.hpp"
  39. #include "workspace.hpp"
  40. #include "tileset.hpp"
  41. #include "gui/editor_map_component.hpp"
  42. #include "flexlay.hpp"
  43. #include "globals.hpp"
  44. #include "gui_manager.hpp"
  45. #include "gui/tile_selector.hpp"
  46. #include "object_brush.hpp"
  47. #include "gui/object_selector.hpp"
  48. #include "gui/icon.hpp"
  49. #include "gui/window.hpp"
  50. #include "gui/panel.hpp"
  51. #include "gui/directory_view.hpp"
  52. #include "gui/menu.hpp"
  53. #include "gui/menubar.hpp"
  54. #include "gui/scrollbar.hpp"
  55. #include "graphic_context_state.hpp"
  56. #include "tools/workspace_move_tool.hpp"
  57. #include "tools/layer_move_tool.hpp"
  58. #include "tools/sketch_stroke_tool.hpp"
  59. #include "sketch_layer.hpp"
  60. #include "bitmap_layer.hpp"
  61. #include "stroke.hpp"
  62. #include "stroke_drawer.hpp"
  63. #include "drawer_properties.hpp"
  64. #include "sprite_stroke_drawer.hpp"
  65. #include "marker_stroke_drawer.hpp"
  66. #include "brushmask.hpp"
  67. #include "brush.hpp"
  68. #include "generated_brush.hpp"
  69. #include "sprite_brush.hpp"
  70. #include "gui/colorpicker.hpp"
  71. #include "gui/slider.hpp"
  72. #include "tools/tilemap_paint_tool.hpp"
  73. #include "tools/tilemap_select_tool.hpp"
  74. #include "tools/objmap_select_tool.hpp"
  75. #include "objmap_sprite_object.hpp"
  76. #include "objmap_rect_object.hpp"
  77. #include "objmap_object.hpp"
  78. #include "tools/zoom_tool.hpp"
  79. #include "tools/zoom2_tool.hpp"
  80. #include "objmap_path_node.hpp"
  81. // #include "netpanzer.hpp"
  82. #include "helper.hpp"
  83. #ifdef SWIGRUBY
  84. #include "../ruby/ruby_sexpr_parser.hpp"
  85. #include "../ruby/ruby_meta_data.hpp"
  86. #include "../ruby/ruby_functor.hpp"
  87. VALUE ObjMapObject2Value(const ObjMapObject& arg)
  88. {
  89. ObjMapObject* resultptr = new ObjMapObject(arg);
  90. return SWIG_NewPointerObj((void *) resultptr, SWIGTYPE_p_ObjMapObject, 1);
  91. }
  92. VALUE ObjectBrush2Value(const ObjectBrush& arg)
  93. {
  94. ObjectBrush* resultptr = new ObjectBrush(arg);
  95. return SWIG_NewPointerObj((void *) resultptr, SWIGTYPE_p_ObjectBrush, 1);
  96. }
  97. VALUE CL_Color2Value(const CL_Color& arg)
  98. {
  99. CL_Color* resultptr = new CL_Color(arg);
  100. return SWIG_NewPointerObj((void *) resultptr, SWIGTYPE_p_CL_Color, 1);
  101. }
  102. VALUE CL_Pointf2Value(const CL_Pointf& arg)
  103. {
  104. CL_Pointf* resultptr = new CL_Pointf(arg);
  105. return SWIG_NewPointerObj((void *) resultptr, SWIGTYPE_p_CL_Pointf, 1);
  106. }
  107. VALUE CL_Point2Value(const CL_Point& arg)
  108. {
  109. CL_Point* resultptr = new CL_Point(arg);
  110. return SWIG_NewPointerObj((void *) resultptr, SWIGTYPE_p_CL_Point, 1);
  111. }
  112. #endif
  113. %}
  114. %include "std_string.i"
  115. %include "std_vector.i"
  116. %template(Std_vector_string) std::vector<std::string>;
  117. %template(Std_vector_int) std::vector<int>;
  118. %template(Std_vector_CL_RadioButton) std::vector<CL_RadioButton *>;
  119. %template(Std_vector_ObjMapObject) std::vector<ObjMapObject>;
  120. %template(Std_vector_CL_Pointf) std::vector<CL_Pointf>;
  121. %template(Std_vector_Stroke) std::vector<Stroke>;
  122. %template(Std_vector_Dab) std::vector<Dab>;
  123. %include "clanlib.i"
  124. %include "command.hpp"
  125. %include "paint_command.hpp"
  126. %include "object_move_command.hpp"
  127. %include "object_add_command.hpp"
  128. %include "object_delete_command.hpp"
  129. %include "tile.hpp"
  130. %include "tile_brush.hpp"
  131. %include "meta_data.hpp"
  132. %include "gui/console.hpp"
  133. %include "blitter.hpp"
  134. %include "layer.hpp"
  135. %include "tilemap_layer.hpp"
  136. %include "object_layer.hpp"
  137. %include "onion_skin_layer.hpp"
  138. %include "editor_map.hpp"
  139. %include "workspace.hpp"
  140. %include "tileset.hpp"
  141. %include "gui/editor_map_component.hpp"
  142. %include "flexlay.hpp"
  143. %include "globals.hpp"
  144. %include "gui_manager.hpp"
  145. %include "gui/tile_selector.hpp"
  146. %include "object_brush.hpp"
  147. %include "gui/object_selector.hpp"
  148. %include "gui/icon.hpp"
  149. %include "gui/window.hpp"
  150. %include "gui/panel.hpp"
  151. %include "gui/minimap.hpp"
  152. %include "gui/directory_view.hpp"
  153. %include "gui/menu.hpp"
  154. %include "gui/menubar.hpp"
  155. %include "gui/scrollbar.hpp"
  156. %include "tools/workspace_move_tool.hpp"
  157. %include "tools/layer_move_tool.hpp"
  158. %include "tools/sketch_stroke_tool.hpp"
  159. %include "sketch_layer.hpp"
  160. %include "bitmap_layer.hpp"
  161. %include "stroke.hpp"
  162. %include "stroke_drawer.hpp"
  163. %include "drawer_properties.hpp"
  164. %include "sprite_stroke_drawer.hpp"
  165. %include "marker_stroke_drawer.hpp"
  166. %include "brushmask.hpp"
  167. %include "brush.hpp"
  168. %include "generated_brush.hpp"
  169. %include "sprite_brush.hpp"
  170. %include "gui/colorpicker.hpp"
  171. %include "gui/slider.hpp"
  172. %include "tools/tilemap_paint_tool.hpp"
  173. %include "tools/tilemap_select_tool.hpp"
  174. %include "tools/objmap_select_tool.hpp"
  175. %include "objmap_sprite_object.hpp"
  176. %include "objmap_rect_object.hpp"
  177. %include "objmap_object.hpp"
  178. %include "tools/zoom_tool.hpp"
  179. %include "tools/zoom2_tool.hpp"
  180. %include "graphic_context_state.hpp"
  181. %include "objmap_path_node.hpp"
  182. # %include "scripting/editor.hpp"
  183. // %include "netpanzer.hpp"
  184. %include "helper.hpp"
  185. #ifdef SWIGRUBY
  186. %include "../ruby/ruby_meta_data.hpp"
  187. %include "../ruby/ruby_sexpr_parser.hpp"
  188. #endif
  189. // 8
  190. /* EOF */