+ .method("heightForWidth", &sc::Text::heightForWidth)
+ .method("maxWidth", &sc::Text::maxWidth)
+ .method("lineCount", &sc::Text::lineCount)
+ .method("lineLength", &sc::Text::lineLength)
+ .method("getNearestCursor", &sc::Text::getNearestCursor)
+ .method("getCursorPos", &sc::Text::getCursorPos);
+
+ //----------------------------------------------------------------------------
+ // Layouting
+
+#define ALIGN_ENUM_MAPPING(key, val, comment) canvas_module.set(#key, sc::key);
+# include <simgear/canvas/layout/AlignFlag_values.hxx>
+#undef ALIGN_ENUM_MAPPING
+
+ void (sc::LayoutItem::*f_layoutItemSetContentsMargins)(int, int, int, int)
+ = &sc::LayoutItem::setContentsMargins;
+
+ NasalLayoutItem::init("canvas.LayoutItem")
+ .method("getCanvas", &sc::LayoutItem::getCanvas)
+ .method("setCanvas", &sc::LayoutItem::setCanvas)
+ .method("getParent", &sc::LayoutItem::getParent)
+ .method("setParent", &sc::LayoutItem::setParent)
+ .method("setContentsMargins", f_layoutItemSetContentsMargins)
+ .method("setContentsMargin", &sc::LayoutItem::setContentsMargin)
+ .method("sizeHint", &sc::LayoutItem::sizeHint)
+ .method("minimumSize", &sc::LayoutItem::minimumSize)
+ .method("maximumSize", &sc::LayoutItem::maximumSize)
+ .method("hasHeightForWidth", &sc::LayoutItem::hasHeightForWidth)
+ .method("heightForWidth", &sc::LayoutItem::heightForWidth)
+ .method("minimumHeightForWidth", &sc::LayoutItem::minimumHeightForWidth)
+ .method("setAlignment", &sc::LayoutItem::setAlignment)
+ .method("alignment", &sc::LayoutItem::alignment)
+ .method("setVisible", &sc::LayoutItem::setVisible)
+ .method("isVisible", &sc::LayoutItem::isVisible)
+ .method("isExplicitlyHidden", &sc::LayoutItem::isExplicitlyHidden)
+ .method("show", &sc::LayoutItem::show)
+ .method("hide", &sc::LayoutItem::hide)
+ .method("setGeometry", &sc::LayoutItem::setGeometry)
+ .method("geometry", &sc::LayoutItem::geometry);
+ sc::NasalWidget::setupGhost(canvas_module);
+
+ NasalLayout::init("canvas.Layout")
+ .bases<NasalLayoutItem>()
+ .method("addItem", &sc::Layout::addItem)
+ .method("setSpacing", &sc::Layout::setSpacing)
+ .method("spacing", &sc::Layout::spacing)
+ .method("count", &sc::Layout::count)
+ .method("itemAt", &sc::Layout::itemAt)
+ .method("takeAt", &sc::Layout::takeAt)
+ .method("removeItem", &sc::Layout::removeItem)
+ .method("clear", &sc::Layout::clear);
+
+ NasalBoxLayout::init("canvas.BoxLayout")
+ .bases<NasalLayout>()
+ .method("addItem", &f_boxLayoutAddItem)
+ .method("addSpacing", &sc::BoxLayout::addSpacing)
+ .method("addStretch", &f_boxLayoutAddStretch)
+ .method("insertItem", &f_boxLayoutInsertItem)
+ .method("insertSpacing", &sc::BoxLayout::insertSpacing)
+ .method("insertStretch", &f_boxLayoutInsertStretch)
+ .method("setStretch", &sc::BoxLayout::setStretch)
+ .method("setStretchFactor", &sc::BoxLayout::setStretchFactor)
+ .method("stretch", &sc::BoxLayout::stretch);
+
+ canvas_module.createHash("HBoxLayout")
+ .set("new", &f_newAsBase<sc::HBoxLayout, sc::BoxLayout>);
+ canvas_module.createHash("VBoxLayout")
+ .set("new", &f_newAsBase<sc::VBoxLayout, sc::BoxLayout>);
+
+ //----------------------------------------------------------------------------
+ // Window