src/gui-edit-box.cpp \
src/gui-element.cpp \
src/gui-environment.cpp \
+ src/gui-font.cpp \
src/gui-image.cpp \
src/gui-skin.cpp \
src/gui-static-text.cpp \
#include "gsubr.h"
#include "gui-element.h"
#include "gui-environment.h"
+#include "gui-font.h"
#include "gui-image.h"
#include "gui-skin.h"
#include "gui-static-text.h"
init_gui_environment_type ();
DEFINE_GSUBR ("add-image!", 3, 0, 1, irr_gui_addImage);
DEFINE_GSUBR ("add-static-text!", 3, 0, 1, irr_gui_addStaticText);
+ 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_static_text (staticText);
}
+ 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)
{
SCM rectangle,
SCM rest);
+ SCM
+ irr_gui_getFont (SCM wrapped_gui_environment,
+ SCM filename);
+
SCM
irr_gui_getSkin (SCM wrapped_gui_environment);
--- /dev/null
+/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine
+
+ Copyright (C) 2020 Javier Sancho <jsf@jsancho.org>
+
+ This file is part of guile-irrlicht.
+
+ guile-irrlicht is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 3 of the
+ License, or (at your option) any later version.
+
+ guile-irrlicht is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with guile-irrlicht. If not, see
+ <http://www.gnu.org/licenses/>.
+*/
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+
+#include "gui-font.h"
+#include "wrapped.h"
+
+extern "C" {
+
+ void
+ init_gui_font (void)
+ {
+ init_gui_font_type ();
+ }
+
+ DEFINE_WRAPPED_TYPE (irr::gui::IGUIFont*, "gui-font",
+ init_gui_font_type, gui_font_p,
+ wrap_gui_font, unwrap_gui_font);
+
+}
--- /dev/null
+/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine
+
+ Copyright (C) 2020 Javier Sancho <jsf@jsancho.org>
+
+ This file is part of guile-irrlicht.
+
+ guile-irrlicht is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 3 of the
+ License, or (at your option) any later version.
+
+ guile-irrlicht is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with guile-irrlicht. If not, see
+ <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __GUILE_IRRLICHT_GUI_FONT_H_INCLUDED__
+#define __GUILE_IRRLICHT_GUI_FONT_H_INCLUDED__
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+#include "wrapped.h"
+
+extern "C" {
+
+ void
+ init_gui_font (void);
+
+ DECLARE_WRAPPED_TYPE (irr::gui::IGUIFont*, init_gui_font_type,
+ gui_font_p, wrap_gui_font, unwrap_gui_font);
+}
+
+#endif
#include <irrlicht/irrlicht.h>
#include <libguile.h>
+#include "gsubr.h"
+#include "gui-font.h"
#include "gui-skin.h"
#include "wrapped.h"
init_gui_skin (void)
{
init_gui_skin_type ();
+ DEFINE_GSUBR ("get-skin-font", 1, 0, 1, irr_gui_getSkinFont);
}
DEFINE_WRAPPED_TYPE (irr::gui::IGUISkin*, "gui-skin",
init_gui_skin_type, gui_skin_p,
wrap_gui_skin, unwrap_gui_skin);
+ SCM
+ irr_gui_getSkinFont (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_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);
+ }
+
+ irr::gui::EGUI_DEFAULT_FONT
+ scm_to_default_font (SCM default_font)
+ {
+ char* font = scm_to_utf8_stringn (scm_symbol_to_string (default_font), NULL);
+ if (!strcmp (font, "default"))
+ {
+ return irr::gui::EGDF_DEFAULT;
+ }
+ else if (!strcmp (font, "button"))
+ {
+ return irr::gui::EGDF_BUTTON;
+ }
+ else if (!strcmp (font, "window"))
+ {
+ return irr::gui::EGDF_WINDOW;
+ }
+ else if (!strcmp (font, "menu"))
+ {
+ return irr::gui::EGDF_MENU;
+ }
+ else if (!strcmp (font, "tooltip"))
+ {
+ return irr::gui::EGDF_TOOLTIP;
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Wrong default font: ~S",
+ scm_list_1 (default_font), scm_list_1 (default_font));
+ }
+ }
}
DECLARE_WRAPPED_TYPE (irr::gui::IGUISkin*, init_gui_skin_type,
gui_skin_p, wrap_gui_skin, unwrap_gui_skin);
+
+ SCM
+ irr_gui_getSkinFont (SCM wrapped_gui_skin,
+ SCM rest);
+
+ irr::gui::EGUI_DEFAULT_FONT
+ scm_to_default_font (SCM default_font);
+
}
#endif
#include "gsubr.h"
#include "gui.h"
#include "gui-edit-box.h"
+#include "gui-element.h"
+#include "gui-environment.h"
+#include "gui-font.h"
+#include "gui-image.h"
+#include "gui-skin.h"
#include "gui-static-text.h"
extern "C" {
void
init_gui (void)
{
+ // Init objects
+ init_gui_edit_box ();
+ init_gui_element ();
+ init_gui_environment ();
+ init_gui_font ();
+ init_gui_image ();
+ init_gui_skin ();
+ init_gui_static_text ();
+
+ // Shared procedures (used by two or more objects)
DEFINE_GSUBR ("set-override-color!", 2, 0, 0, irr_gui_setOverrideColor);
}
#include "file-system.h"
#include "gsubr.h"
#include "gui.h"
-#include "gui-edit-box.h"
#include "gui-element.h"
#include "gui-environment.h"
-#include "gui-image.h"
-#include "gui-skin.h"
-#include "gui-static-text.h"
#include "guile-irrlicht.h"
#include "keymap.h"
#include "material.h"
init_file_archive ();
init_file_system ();
init_gui ();
- init_gui_edit_box ();
- init_gui_element ();
- init_gui_environment ();
- init_gui_image ();
- init_gui_skin ();
- init_gui_static_text ();
init_keymap ();
init_material ();
init_mesh ();