#include <libguile.h>
#include "gui-scrollbar.h"
+#include "gsubr.h"
#include "wrapped.h"
extern "C" {
init_gui_scrollbar (void)
{
init_gui_scrollbar_type ();
+ DEFINE_GSUBR ("get-pos", 1, 0, 0, irr_gui_getPos);
+ DEFINE_GSUBR ("set-pos!", 2, 0, 0, irr_gui_setPos);
}
DEFINE_WRAPPED_TYPE (irr::gui::IGUIScrollBar*, "gui-scrollbar",
init_gui_scrollbar_type, gui_scrollbar_p,
wrap_gui_scrollbar, unwrap_gui_scrollbar);
+ SCM
+ irr_gui_getPos (SCM wrapped_scrollbar)
+ {
+ irr::gui::IGUIScrollBar* scrollbar = unwrap_gui_scrollbar (wrapped_scrollbar);
+ return scm_from_int32 (scrollbar->getPos ());
+ }
+
+ SCM
+ irr_gui_setPos (SCM wrapped_scrollbar,
+ SCM pos)
+ {
+ irr::gui::IGUIScrollBar* scrollbar = unwrap_gui_scrollbar (wrapped_scrollbar);
+ scrollbar->setPos (scm_to_int32 (pos));
+ return SCM_UNSPECIFIED;
+ }
+
}
DECLARE_WRAPPED_TYPE (irr::gui::IGUIScrollBar*, init_gui_scrollbar_type,
gui_scrollbar_p, wrap_gui_scrollbar, unwrap_gui_scrollbar);
+
+ SCM
+ irr_gui_getPos (SCM wrapped_scrollbar);
+
+ SCM
+ irr_gui_setPos (SCM wrapped_scrollbar,
+ SCM pos);
+
}
#endif
// Shared procedures (used by two or more objects)
DEFINE_GSUBR ("add-button!", 1, 1, 1, irr_gui_addButton);
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);
}
}
}
+ SCM
+ irr_gui_setMax (SCM wrapped_obj,
+ SCM max)
+ {
+#define SET_MAX(OBJ) OBJ->setMax (scm_to_int32 (max));
+
+ if (gui_edit_box_p (wrapped_obj))
+ {
+ SET_MAX (unwrap_gui_edit_box (wrapped_obj));
+ }
+ else if (gui_scrollbar_p (wrapped_obj))
+ {
+ SET_MAX (unwrap_gui_scrollbar (wrapped_obj));
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Cannot set max to object: ~S",
+ scm_list_1 (wrapped_obj), scm_list_1 (wrapped_obj));
+ }
+ return SCM_UNSPECIFIED;
+ }
+
SCM
irr_gui_setOverrideColor (SCM wrapped_obj,
SCM color)
SCM filename,
SCM rest);
+ SCM
+ irr_gui_setMax (SCM wrapped_obj,
+ SCM max);
+
SCM
irr_gui_setOverrideColor (SCM wrapped_obj,
SCM color);