]> git.jsancho.org Git - guile-irrlicht.git/blob - irrlicht.i
Quit regular expressions
[guile-irrlicht.git] / irrlicht.i
1 /*
2 guile-irrlicht --- GNU Guile bindings for Irrlicht Engine
3
4 Copyright (C) 2021 Javier Sancho <jsf@jsancho.org>
5
6 This file is part of guile-irrlicht.
7
8 guile-irrlicht is free software; you can redistribute it and/or modify
9 it under the terms of the GNU Lesser General Public License as
10 published by the Free Software Foundation; either version 3 of the
11 License, or (at your option) any later version.
12
13 guile-irrlicht is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with guile-irrlicht. If not, see
20 <http://www.gnu.org/licenses/>.
21 */
22
23 %module irrlicht
24 %{
25 #include <irrlicht/irrlicht.h>
26 using namespace irr;
27 using namespace core;
28 using namespace scene;
29 using namespace video;
30 using namespace io;
31 using namespace gui;
32 %}
33
34 %typecheck (SWIG_TYPECHECK_POINTER) const IRR_CHAR_TYPE &
35 {
36   $1 = scm_is_string ($input);
37 }
38 %typemap (in) const IRR_CHAR_TYPE &
39 {
40   $1 = ($ltype) scm_to_utf8_string ($input);
41 }
42 %typemap (freearg) const IRR_CHAR_TYPE &
43 {
44   free ($1);
45 }
46
47 %typecheck (SWIG_TYPECHECK_POINTER) const IRR_WCHAR_TYPE &
48 {
49   $1 = scm_is_string ($input);
50 }
51 %typemap (in) const IRR_WCHAR_TYPE &
52 {
53   $1 = ($ltype) scm_to_utf32_string ($input);
54 }
55 %typemap (freearg) const IRR_WCHAR_TYPE &
56 {
57   free ($1);
58 }
59
60 %typecheck (SWIG_TYPECHECK_POINTER) const IRR_IO_PATH &
61 {
62   $1 = scm_is_string ($input);
63 }
64 %typemap (in) const IRR_IO_PATH &
65 {
66   $1 = new $*1_ltype (scm_to_utf8_string ($input));
67 }
68 %typemap (freearg) const IRR_IO_PATH &
69 {
70   delete $1;
71 }
72
73 %include irrString.h
74 %apply const IRR_CHAR_TYPE & { const irr::core::stringc & };
75 %apply const IRR_WCHAR_TYPE & { const wchar_t *, const irr::core::stringw & };
76 %apply const IRR_IO_PATH & { const irr::io::path &, const path &, irr::io::path &, path & };
77
78 typedef int s32;
79 typedef unsigned int u32;
80 typedef float f32;
81 typedef double f64;
82
83 #define _IRR_DEPRECATED_
84
85 %rename (add) operator+;
86 %rename (substract) operator-;
87 %rename (product) operator*;
88 %rename (divide) operator/;
89 %rename (equal) operator==;
90 %rename (not_equal) operator!=;
91 %rename (less) operator<;
92 %rename (less_equal) operator<=;
93 %rename (greater) operator>;
94 %rename (greater_equal) operator>=;
95 %ignore operator=;
96 %ignore operator+=;
97 %ignore operator-=;
98 %ignore operator*=;
99 %ignore operator/=;
100 %ignore operator!=;
101
102 %include dimension2d.h
103 %template (dimension2df) irr::core::dimension2d<irr::f32>;
104 %template (dimension2du) irr::core::dimension2d<irr::u32>;
105 %template (dimension2di) irr::core::dimension2d<irr::s32>;
106
107 %include rect.h
108 %template (rectf) irr::core::rect<irr::f32>;
109 %template (recti) irr::core::rect<irr::s32>;
110
111 %include vector3d.h
112 %template (vector3df) irr::core::vector3d<irr::f32>;
113 %template (vector3di) irr::core::vector3d<irr::s32>;
114
115 %rename ("%(undercase)s", %$not %$isconstant, %$not %$isenumitem) "";
116 %feature ("constasvar");
117
118 %include EDriverTypes.h
119 %include EMaterialFlags.h
120 %include IrrCompileConfig.h
121
122 %rename (color) irr::video::SColor;
123 %rename (color) irr::video::SColor::SColor;
124 %rename (xcolor) irr::video::SColor::color;
125 %rename (get_color_alpha) irr::video::SColor::getAlpha;
126 %rename (get_color_red) irr::video::SColor::getRed;
127 %rename (get_color_green) irr::video::SColor::getGreen;
128 %rename (get_color_blue) irr::video::SColor::getBlue;
129 %rename (get_color_average) irr::video::SColor::getAverage;
130 %rename (get_colorf_alpha) irr::video::SColorf::getAlpha;
131 %rename (get_colorf_red) irr::video::SColorf::getRed;
132 %rename (get_colorf_green) irr::video::SColorf::getGreen;
133 %rename (get_colorf_blue) irr::video::SColorf::getBlue;
134 %rename (get_colorf_average) irr::video::SColorf::getAverage;
135 %include SColor.h
136
137 %include IReferenceCounted.h
138 %include IAttributeExchangingObject.h
139
140 %include IMesh.h
141
142 %rename (animated_mesh) irr::scene::IAnimatedMesh;
143 %include IAnimatedMesh.h
144
145 %include IAnimatedMeshMD2.h
146 %include SAnimatedMesh.h
147
148 %rename (scene_node) irr::scene::ISceneNode;
149 %include ISceneNode.h
150
151 %rename (animated_mesh_scene_node) irr::scene::IAnimatedMeshSceneNode;
152 %rename (set_md2_animation) irr::scene::IAnimatedMeshSceneNode::setMD2Animation;
153 %include IAnimatedMeshSceneNode.h
154
155 %include IEventReceiver.h
156 %include IGUIElement.h
157
158 %rename (gui_static_text) irr::gui::IGUIStaticText;
159 %include IGUIStaticText.h
160
161 %rename (get_gui_environment) getGUIEnvironment;
162 %rename (gui_environment) irr::gui::IGUIEnvironment;
163 %include IGUIEnvironment.h
164
165 %rename (scene_manager) irr::scene::ISceneManager;
166 %include ISceneManager.h
167
168 %ignore irr::video::IVideoDriver::createImage;
169 %rename (apply_material) apply;
170 %rename (video_driver) irr::video::IVideoDriver;
171 %include IVideoDriver.h
172
173 %rename (yield_device) yield;
174 %rename (sleep_device) sleep;
175 %include IrrlichtDevice.h
176 %include irrlicht.h
177
178 %scheme %{ (load-extension "libguile-irrlicht" "scm_init_irrlicht_module") %}