#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"
init_gui_environment ();
init_gui_font ();
init_gui_image ();
+ init_gui_in_out_fader ();
init_gui_scrollbar ();
init_gui_skin ();
init_gui_static_text ();
// 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-color!", 2, 1, 0, irr_gui_setColor);
DEFINE_GSUBR ("set-max!", 2, 0, 0, irr_gui_setMax);
DEFINE_GSUBR ("set-override-color!", 2, 0, 0, irr_gui_setOverrideColor);
}
}
}
+ 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,
}
}
+ SCM
+ irr_gui_setColor (SCM wrapped_obj,
+ SCM color,
+ SCM dest_color)
+ {
+ if (gui_image_p (wrapped_obj))
+ {
+ // Params: color
+ unwrap_gui_image (wrapped_obj)->setColor (scm_to_color (color));
+ return SCM_UNSPECIFIED;
+ }
+ else if (gui_in_out_fader_p (wrapped_obj))
+ {
+ // Params: color and dest_color (optional)
+ return irr_gui_IGUIInOutFader_setColor (wrapped_obj, color, dest_color);
+ }
+ else if (gui_skin_p (wrapped_obj) && !scm_is_false (dest_color))
+ {
+ // Params: which and new_color
+ return irr_gui_IGUISkin_setColor (wrapped_obj, color, dest_color);
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Cannot set color to object: ~S",
+ scm_list_1 (wrapped_obj), scm_list_1 (wrapped_obj));
+ }
+ }
+
SCM
irr_gui_setMax (SCM wrapped_obj,
SCM max)