+/* 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 "color.h"
+#include "gsubr.h"
+#include "gui.h"
+#include "gui-edit-box.h"
+#include "gui-static-text.h"
+
+extern "C" {
+
+ void
+ init_gui (void)
+ {
+ DEFINE_GSUBR ("set-override-color!", 2, 0, 0, irr_gui_setOverrideColor);
+ }
+
+ SCM
+ irr_gui_setOverrideColor (SCM wrapped_obj,
+ SCM color)
+ {
+#define SET_OVERRIDE_COLOR(OBJ) OBJ->setOverrideColor (scm_to_color (color));
+
+ if (gui_edit_box_p (wrapped_obj))
+ {
+ SET_OVERRIDE_COLOR (unwrap_gui_edit_box (wrapped_obj));
+ }
+ else if (gui_static_text_p (wrapped_obj))
+ {
+ SET_OVERRIDE_COLOR (unwrap_gui_static_text (wrapped_obj));
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Cannot set override color to object: ~S",
+ scm_list_1 (wrapped_obj), scm_list_1 (wrapped_obj));
+ }
+ return SCM_UNSPECIFIED;
+ }
+
+}