From: Javier Sancho Date: Fri, 22 May 2020 07:20:54 +0000 (+0200) Subject: set-override-color! X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=79027b9833bbb753e7576091a8907605c2d89707;p=guile-irrlicht.git set-override-color! --- diff --git a/Makefile.am b/Makefile.am index 46627f3..e21fa49 100644 --- a/Makefile.am +++ b/Makefile.am @@ -40,6 +40,7 @@ libguile_irrlicht_la_SOURCES = \ src/gui-listbox.cpp \ src/gui-scrollbar.cpp \ src/gui-skin.cpp \ + src/gui-static-text.cpp \ src/gui-toolbar.cpp \ src/guile-irrlicht.cpp \ src/keycodes.cpp \ diff --git a/irrlicht.scm b/irrlicht.scm index 7498274..31416ce 100644 --- a/irrlicht.scm +++ b/irrlicht.scm @@ -103,6 +103,7 @@ set-material-flag! set-material-texture! set-md2-animation! + set-override-color! set-position! set-rotation! set-scale! diff --git a/irrlicht/gui.scm b/irrlicht/gui.scm index 10cf0bf..18dc559 100644 --- a/irrlicht/gui.scm +++ b/irrlicht/gui.scm @@ -80,7 +80,11 @@ (define-class () (irr-class #:init-value "IGUIStaticText")) -(export ) +(define-method (set-override-color! (static-text ) color) + (let ((setOverrideColor (get-irrlicht-proc "setOverrideColor" static-text))) + (setOverrideColor static-text color))) + +(export set-override-color!) ;; IGUIImage diff --git a/src/gui-static-text.cpp b/src/gui-static-text.cpp new file mode 100644 index 0000000..9785b11 --- /dev/null +++ b/src/gui-static-text.cpp @@ -0,0 +1,44 @@ +/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine + + Copyright (C) 2020 Javier Sancho + + 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 + . +*/ + +#include +#include +#include "color.h" +#include "gsubr.h" +#include "gui-static-text.h" +#include "wrapped.h" + +using namespace irr; + +SCM +IGUIStaticText_setOverrideColor (SCM gui_static_text, + SCM color) +{ + gui::IGUIStaticText* static_text = (gui::IGUIStaticText*) scm_to_irr_pointer (gui_static_text); + static_text->setOverrideColor (scm_to_color (color)); + return SCM_UNSPECIFIED; +} + +void +init_gui_static_text (void) +{ + DEFINE_GSUBR ("IGUIStaticText_setOverrideColor", 2, 0, 0, IGUIStaticText_setOverrideColor); +} diff --git a/src/gui-static-text.h b/src/gui-static-text.h new file mode 100644 index 0000000..319555b --- /dev/null +++ b/src/gui-static-text.h @@ -0,0 +1,31 @@ +/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine + + Copyright (C) 2020 Javier Sancho + + 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 + . +*/ + +#ifndef __GUILE_IRRLICHT_GUI_STATIC_TEXT_H_INCLUDED__ +#define __GUILE_IRRLICHT_GUI_STATIC_TEXT_H_INCLUDED__ + +#include +#include + +void +init_gui_static_text (void); + +#endif diff --git a/src/guile-irrlicht.cpp b/src/guile-irrlicht.cpp index be39e7f..cd18a09 100644 --- a/src/guile-irrlicht.cpp +++ b/src/guile-irrlicht.cpp @@ -32,6 +32,7 @@ #include "gui-listbox.h" #include "gui-scrollbar.h" #include "gui-skin.h" +#include "gui-static-text.h" #include "gui-toolbar.h" #include "guile-irrlicht.h" #include "material.h" @@ -60,6 +61,7 @@ extern "C" { init_gui_listbox (); init_gui_scrollbar (); init_gui_skin (); + init_gui_static_text (); init_gui_toolbar (); init_material (); init_reference_counted ();