#include <libguile.h>
#include "gui-listbox.h"
#include "gsubr.h"
-#include "wchar.h"
-
+#include "wrapped.h"
using namespace irr;
-
SCM
-gui_IGUIListBox_addItem (SCM gui_listbox,
- SCM text,
- SCM icon)
+IGUIListBox_addItem (SCM gui_listbox,
+ SCM text,
+ SCM icon)
{
- gui::IGUIListBox* listbox = (gui::IGUIListBox*)scm_to_pointer (gui_listbox);
+ gui::IGUIListBox* listbox = (gui::IGUIListBox*)scm_to_irr_pointer (gui_listbox);
+ wchar_t* wtext = (wchar_t*) scm_to_utf32_string (text);
u32 item_id;
if (icon == SCM_UNDEFINED)
{
- item_id = listbox->addItem (scm_to_wide_char_string (text));
+ item_id = listbox->addItem (wtext);
}
else
{
- item_id = listbox->addItem (scm_to_wide_char_string (text),
+ item_id = listbox->addItem (wtext,
scm_to_int32 (icon));
}
+ free (wtext);
return scm_from_uint32 (item_id);
}
-
-extern "C" {
-
- void
- init_gui_listbox (void)
- {
- DEFINE_GSUBR ("gui_IGUIListBox_addItem", 2, 1, 0, gui_IGUIListBox_addItem);
- }
-
+void
+init_gui_listbox (void)
+{
+ DEFINE_GSUBR ("IGUIListBox_addItem", 2, 1, 0, IGUIListBox_addItem);
}