DEFINE_GSUBR ("add-image!", 3, 0, 1, irr_gui_addImage);
DEFINE_GSUBR ("add-static-text!", 3, 0, 1, irr_gui_addStaticText);
DEFINE_GSUBR ("get-built-in-font", 1, 0, 0, irr_gui_getBuiltInFont);
- DEFINE_GSUBR ("get-font", 2, 0, 0, irr_gui_getFont);
DEFINE_GSUBR ("get-gui-environment", 1, 0, 0, irr_getGUIEnvironment);
DEFINE_GSUBR ("get-skin", 1, 0, 0, irr_gui_getSkin);
}
return wrap_gui_font (font);
}
- SCM
- irr_gui_getFont (SCM wrapped_gui_environment,
- SCM filename)
- {
- irr::gui::IGUIEnvironment* guienv = unwrap_gui_environment (wrapped_gui_environment);
- irr::gui::IGUIFont* font = guienv->getFont (scm_to_utf8_stringn (filename, NULL));
- return wrap_gui_font (font);
- }
-
SCM
irr_gui_getSkin (SCM wrapped_gui_environment)
{
return wrap_gui_button (button);
}
+ SCM
+ irr_gui_IGUIEnvironment_getFont (SCM wrapped_gui_environment,
+ SCM filename)
+ {
+ irr::gui::IGUIEnvironment* guienv = unwrap_gui_environment (wrapped_gui_environment);
+ irr::gui::IGUIFont* font = guienv->getFont (scm_to_utf8_stringn (filename, NULL));
+ return wrap_gui_font (font);
+ }
+
}
SCM
irr_gui_getBuiltInFont (SCM wrapped_gui_environment);
- SCM
- irr_gui_getFont (SCM wrapped_gui_environment,
- SCM filename);
-
SCM
irr_gui_getSkin (SCM wrapped_gui_environment);
SCM rectangle,
SCM rest);
+ SCM
+ irr_gui_IGUIEnvironment_getFont (SCM wrapped_gui_environment,
+ SCM filename);
+
}
#endif
{
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",
}
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);
SCM rest);
SCM
- irr_gui_setSkinFont (SCM wrapped_gui_skin,
- SCM font,
- SCM rest);
+ irr_gui_IGUISkin_getFont (SCM wrapped_gui_skin,
+ SCM rest);
+
+ SCM
+ irr_gui_setFont (SCM wrapped_gui_skin,
+ SCM font,
+ SCM rest);
irr::gui::EGUI_DEFAULT_FONT
scm_to_default_font (SCM default_font);
// Shared procedures (used by two or more objects)
DEFINE_GSUBR ("add-button!", 1, 1, 1, irr_gui_addButton);
+ DEFINE_GSUBR ("get-font", 1, 1, 1, irr_gui_getFont);
DEFINE_GSUBR ("set-override-color!", 2, 0, 0, irr_gui_setOverrideColor);
}
}
}
+ SCM
+ irr_gui_getFont (SCM wrapped_obj,
+ SCM filename,
+ SCM rest)
+ {
+ if (gui_environment_p (wrapped_obj))
+ {
+ return irr_gui_IGUIEnvironment_getFont (wrapped_obj, filename);
+ }
+ else if (gui_skin_p (wrapped_obj))
+ {
+ return irr_gui_IGUISkin_getFont (wrapped_obj, rest);
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Cannot get font from object: ~S",
+ scm_list_1 (wrapped_obj), scm_list_1 (wrapped_obj));
+ }
+ }
+
SCM
irr_gui_setOverrideColor (SCM wrapped_obj,
SCM color)
SCM rectangle,
SCM rest);
+ SCM
+ irr_gui_getFont (SCM wrapped_obj,
+ SCM filename,
+ SCM rest);
+
SCM
irr_gui_setOverrideColor (SCM wrapped_obj,
SCM color);