#include <irrlicht/irrlicht.h>
#include <libguile.h>
-
-#include "gui-element.h"
#include "gui-scrollbar.h"
#include "gsubr.h"
-#include "wrapped.h"
-extern "C" {
- void
- 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);
- }
+using namespace irr;
- DEFINE_WRAPPED_TYPE (irr::gui::IGUIScrollBar*, "gui-scrollbar",
- init_gui_scrollbar_type, gui_scrollbar_p,
- wrap_gui_scrollbar, unwrap_gui_scrollbar);
- SCM
- irr_gui_setMax (SCM wrapped_obj,
- SCM max)
- {
-#define SET_MAX(OBJ) OBJ->setMax (scm_to_int32 (max));
-
- if (gui_editbox_p (wrapped_obj))
- {
- SET_MAX (unwrap_gui_editbox (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
+gui_IGUIScrollBar_getPos (SCM gui_scrollbar)
+{
+ return scm_from_int32
+ (((gui::IGUIScrollBar*)scm_to_pointer (gui_scrollbar))->getPos ());
+}
- SCM
- irr_gui_getPos (SCM wrapped_scrollbar)
- {
- irr::gui::IGUIScrollBar* scrollbar;
- if (gui_element_p (wrapped_scrollbar))
- {
- scrollbar = (irr::gui::IGUIScrollBar*)unwrap_gui_element (wrapped_scrollbar);
- }
- else {
- scrollbar = unwrap_gui_scrollbar (wrapped_scrollbar);
- }
- return scm_from_int32 (scrollbar->getPos ());
- }
- SCM
- irr_gui_setPos (SCM wrapped_scrollbar,
- SCM pos)
+SCM
+gui_IGUIScrollBar_setMax (SCM gui_scrollbar,
+ SCM max)
+{
+ ((gui::IGUIScrollBar*) scm_to_pointer (gui_scrollbar))->setMax (scm_to_int32 (max));
+ return SCM_UNSPECIFIED;
+}
+
+
+SCM
+gui_IGUIScrollBar_setPos (SCM gui_scrollbar,
+ SCM pos)
+{
+ ((gui::IGUIScrollBar*) scm_to_pointer (gui_scrollbar))->setPos (scm_to_int32 (pos));
+ return SCM_UNSPECIFIED;
+}
+
+
+extern "C" {
+
+ void
+ init_gui_scrollbar (void)
{
- irr::gui::IGUIScrollBar* scrollbar;
- if (gui_element_p (wrapped_scrollbar))
- {
- scrollbar = (irr::gui::IGUIScrollBar*)unwrap_gui_element (wrapped_scrollbar);
- }
- else {
- scrollbar = unwrap_gui_scrollbar (wrapped_scrollbar);
- }
- scrollbar->setPos (scm_to_int32 (pos));
- return SCM_UNSPECIFIED;
+ DEFINE_GSUBR ("gui_IGUIScrollBar_getPos", 1, 0, 0, gui_IGUIScrollBar_getPos);
+ DEFINE_GSUBR ("gui_IGUIScrollBar_setMax", 2, 0, 0, gui_IGUIScrollBar_setMax);
+ DEFINE_GSUBR ("gui_IGUIScrollBar_setPos", 2, 0, 0, gui_IGUIScrollBar_setPos);
}
}