X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2Fgui.cpp;h=6068f3a7eea71546811237d4dc7f20b1a92d7921;hb=61aadd8525de89016f63572fd474547a1bb932de;hp=532a78645f05c821d463c6d1b671468ce10400f3;hpb=c29f09b112d14ca0a37ee6733dc9748eb4e599c2;p=guile-irrlicht.git diff --git a/src/gui.cpp b/src/gui.cpp index 532a786..6068f3a 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -31,6 +31,7 @@ #include "gui-environment.h" #include "gui-font.h" #include "gui-image.h" +#include "gui-in-out-fader.h" #include "gui-scrollbar.h" #include "gui-skin.h" #include "gui-static-text.h" @@ -48,6 +49,7 @@ extern "C" { init_gui_environment (); init_gui_font (); init_gui_image (); + init_gui_in_out_fader (); init_gui_scrollbar (); init_gui_skin (); init_gui_static_text (); @@ -55,6 +57,7 @@ extern "C" { // Shared procedures (used by two or more objects) DEFINE_GSUBR ("add-button!", 1, 1, 1, irr_gui_addButton); + DEFINE_GSUBR ("get-color", 1, 1, 0, irr_gui_getColor); DEFINE_GSUBR ("get-font", 1, 1, 1, irr_gui_getFont); DEFINE_GSUBR ("set-max!", 2, 0, 0, irr_gui_setMax); DEFINE_GSUBR ("set-override-color!", 2, 0, 0, irr_gui_setOverrideColor); @@ -80,6 +83,31 @@ extern "C" { } } + SCM + irr_gui_getColor (SCM wrapped_obj, + SCM color) + { +#define GET_COLOR(OBJ) scm_from_color (OBJ->getColor ()); + + if (gui_image_p (wrapped_obj)) + { + return GET_COLOR (unwrap_gui_image (wrapped_obj)); + } + else if (gui_in_out_fader_p (wrapped_obj)) + { + return GET_COLOR (unwrap_gui_in_out_fader (wrapped_obj)); + } + else if (gui_skin_p (wrapped_obj)) + { + return irr_gui_IGUISkin_getColor (wrapped_obj, color); + } + else + { + scm_error (scm_arg_type_key, NULL, "Cannot get color from object: ~S", + scm_list_1 (wrapped_obj), scm_list_1 (wrapped_obj)); + } + } + SCM irr_gui_getFont (SCM wrapped_obj, SCM filename,