xmake.repo/packages/n/noesis/latest/Include/NsGui/IntegrationAPI.inl

31 lines
1013 B
Plaintext
Raw Normal View History

2024-12-22 19:15:02 +08:00
////////////////////////////////////////////////////////////////////////////////////////////////////
// NoesisGUI - http://www.noesisengine.com
// Copyright (c) 2013 Noesis Technologies S.L. All Rights Reserved.
////////////////////////////////////////////////////////////////////////////////////////////////////
#include <NsCore/DynamicCast.h>
namespace Noesis
{
////////////////////////////////////////////////////////////////////////////////////////////////////
template<class T> Ptr<T> GUI::LoadXaml(const Uri& uri)
{
Ptr<BaseComponent> xaml = LoadXaml(uri);
NS_CHECK(xaml == 0 || DynamicPtrCast<T>(xaml) != 0, "Invalid cast");
return StaticPtrCast<T>(xaml);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
template<class T> Ptr<T> GUI::ParseXaml(const char* xamlText)
{
Ptr<BaseComponent> xaml = ParseXaml(xamlText);
NS_CHECK(xaml == 0 || DynamicPtrCast<T>(xaml) != 0, "Invalid cast");
return StaticPtrCast<T>(xaml);
}
}