X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2FIGUIEnvironment.cpp;h=c0a2a06a5ccd5f55ce96c5a1fa9cb7b1be6bbdf9;hb=03d4e13abc392abec3ef9cb6a97d83a5ae722ca8;hp=0f66f7210b7017803ad4c28ed40584aebc13f3ff;hpb=84e93e7eac45dde889fc436a247838da3c87edf6;p=guile-irrlicht.git diff --git a/src/IGUIEnvironment.cpp b/src/IGUIEnvironment.cpp index 0f66f72..c0a2a06 100644 --- a/src/IGUIEnvironment.cpp +++ b/src/IGUIEnvironment.cpp @@ -22,6 +22,7 @@ #include #include #include "IGUIEnvironment.h" +#include "util.h" extern "C" { @@ -31,33 +32,8 @@ extern "C" { init_gui_environment_type (); } - static SCM gui_environment_type; - - void - init_gui_environment_type (void) - { - SCM name, slots; - scm_t_struct_finalize finalizer; - - name = scm_from_utf8_symbol ("gui_environment"); - slots = scm_list_1 (scm_from_utf8_symbol ("data")); - finalizer = NULL; - - gui_environment_type = - scm_make_foreign_object_type (name, slots, finalizer); - } - - SCM - wrap_gui_environment (irr::gui::IGUIEnvironment* gui_environment) - { - return scm_make_foreign_object_1 (gui_environment_type, gui_environment); - } - - irr::gui::IGUIEnvironment* - unwrap_gui_environment (SCM gui_environment_obj) - { - scm_assert_foreign_object_type (gui_environment_type, gui_environment_obj); - return (irr::gui::IGUIEnvironment*)scm_foreign_object_ref (gui_environment_obj, 0); - } + DEFINE_WRAPPED_TYPE (irr::gui::IGUIEnvironment*, "gui-environment", + init_gui_environment_type, + wrap_gui_environment, unwrap_gui_environment); }