X-Git-Url: https://git.jsancho.org/?p=guile-irrlicht.git;a=blobdiff_plain;f=src%2Fgui-skin.cpp;fp=src%2Fgui-skin.cpp;h=5bbfc6633c99a919228bf64e11f2ba87b6ed706e;hp=4d1f0ec254ae8a67eaf1660fea38416b720e9994;hb=15be0323f62a228707f616c25c4b87cd1d68766f;hpb=da89e12dbf35ce6452e6a6e2eeb3f83eaeb94c97 diff --git a/src/gui-skin.cpp b/src/gui-skin.cpp index 4d1f0ec..5bbfc66 100644 --- a/src/gui-skin.cpp +++ b/src/gui-skin.cpp @@ -34,7 +34,7 @@ extern "C" { { init_gui_skin_type (); DEFINE_GSUBR ("get-skin-font", 1, 0, 1, irr_gui_getSkinFont); - DEFINE_GSUBR ("set-skin-font!", 2, 0, 1, irr_gui_setSkinFont); + DEFINE_GSUBR ("set-font!", 2, 0, 1, irr_gui_setFont); } DEFINE_WRAPPED_TYPE (irr::gui::IGUISkin*, "gui-skin", @@ -57,13 +57,28 @@ extern "C" { } SCM - irr_gui_setSkinFont (SCM wrapped_gui_skin, - SCM font, - SCM rest) + irr_gui_IGUISkin_getFont (SCM wrapped_gui_skin, + SCM rest) { SCM which = scm_from_utf8_symbol ("default"); - scm_c_bind_keyword_arguments ("get-skin-font", rest, (scm_t_keyword_arguments_flags)0, + scm_c_bind_keyword_arguments ("get-font", rest, (scm_t_keyword_arguments_flags)0, + scm_from_utf8_keyword ("which"), &which, + SCM_UNDEFINED); + + irr::gui::IGUISkin* skin = unwrap_gui_skin (wrapped_gui_skin); + irr::gui::IGUIFont* font = skin->getFont (scm_to_default_font (which)); + return wrap_gui_font (font); + } + + SCM + irr_gui_setFont (SCM wrapped_gui_skin, + SCM font, + SCM rest) + { + SCM which = scm_from_utf8_symbol ("default"); + + scm_c_bind_keyword_arguments ("set-font!", rest, (scm_t_keyword_arguments_flags)0, scm_from_utf8_keyword ("which"), &which, SCM_UNDEFINED);