]> git.jsancho.org Git - guile-irrlicht.git/blobdiff - src/gui-skin.cpp
get-font set-font!
[guile-irrlicht.git] / src / gui-skin.cpp
index 4d1f0ec254ae8a67eaf1660fea38416b720e9994..5bbfc6633c99a919228bf64e11f2ba87b6ed706e 100644 (file)
@@ -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);