| 32 | constexpr uint64_t maxDepth = 250; |
| 33 | |
| 34 | std::string widgetType(const sol::table& layout) |
| 35 | { |
| 36 | sol::object typeField = LuaUtil::getFieldOrNil(layout, LayoutKeys::type); |
| 37 | std::string type = LuaUtil::getValueOrDefault(typeField, defaultWidgetType); |
| 38 | sol::object templateTypeField |
| 39 | = LuaUtil::getFieldOrNil(layout, LayoutKeys::templateLayout, LayoutKeys::type); |
| 40 | if (templateTypeField != sol::nil) |
| 41 | { |
| 42 | std::string templateType = LuaUtil::getValueOrDefault(templateTypeField, defaultWidgetType); |
| 43 | if (typeField != sol::nil && templateType != type) |
| 44 | throw std::logic_error(std::string("Template layout type ") + type |
| 45 | + std::string(" doesn't match template type ") + templateType); |
| 46 | type = std::move(templateType); |
| 47 | } |
| 48 | return type; |
| 49 | } |
| 50 | |
| 51 | void destroyWidget(WidgetExtension* ext) |
| 52 | { |
no test coverage detected