зеркало из https://github.com/microsoft/cppwinrt.git
Windows test (#905)
This commit is contained in:
Родитель
1935608ceb
Коммит
122b732393
|
@ -2111,7 +2111,7 @@ struct __declspec(empty_bases) produce_dispatch_to_overridable<T, D, %>
|
|||
D& shim() noexcept { return *static_cast<D*>(this); }
|
||||
D const& shim() const noexcept { return *static_cast<const D*>(this); }
|
||||
public:
|
||||
using % = winrt::%;
|
||||
using % = %;
|
||||
% };
|
||||
)";
|
||||
|
||||
|
@ -3207,7 +3207,7 @@ struct __declspec(empty_bases) produce_dispatch_to_overridable<T, D, %>
|
|||
{
|
||||
auto generics = type.GenericParam();
|
||||
|
||||
w.write(" template<%> struct hash<winrt::%> : winrt::impl::hash_base {};\n",
|
||||
w.write(" template<%> struct hash<%> : winrt::impl::hash_base {};\n",
|
||||
bind<write_generic_typenames>(generics),
|
||||
type);
|
||||
}
|
||||
|
|
|
@ -273,7 +273,7 @@ namespace cppwinrt
|
|||
|
||||
if (!empty(generics))
|
||||
{
|
||||
write("@::%<%>", ns, remove_tick(name), bind_list(", ", generics));
|
||||
write("winrt::@::%<%>", ns, remove_tick(name), bind_list(", ", generics));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -301,7 +301,7 @@ namespace cppwinrt
|
|||
else if (name == "Vector3") { name = "float3"; }
|
||||
else if (name == "Vector4") { name = "float4"; }
|
||||
|
||||
write("@::%", ns, name);
|
||||
write("winrt::@::%", ns, name);
|
||||
}
|
||||
else if (category == category::struct_type)
|
||||
{
|
||||
|
@ -311,7 +311,7 @@ namespace cppwinrt
|
|||
}
|
||||
else if ((name == "Point" || name == "Size" || name == "Rect") && ns == "Windows.Foundation")
|
||||
{
|
||||
write("@::%", ns, name);
|
||||
write("winrt::@::%", ns, name);
|
||||
}
|
||||
else if (delegate_types)
|
||||
{
|
||||
|
@ -343,11 +343,11 @@ namespace cppwinrt
|
|||
else if (name == "Vector3") { name = "float3"; }
|
||||
else if (name == "Vector4") { name = "float4"; }
|
||||
|
||||
write("@::%", ns, name);
|
||||
write("winrt::@::%", ns, name);
|
||||
}
|
||||
else
|
||||
{
|
||||
write("@::%", ns, name);
|
||||
write("winrt::@::%", ns, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -400,14 +400,14 @@ namespace cppwinrt
|
|||
|
||||
if (consume_types)
|
||||
{
|
||||
static constexpr std::string_view iterable("Windows::Foundation::Collections::IIterable<"sv);
|
||||
static constexpr std::string_view vector_view("Windows::Foundation::Collections::IVectorView<"sv);
|
||||
static constexpr std::string_view map_view("Windows::Foundation::Collections::IMapView<"sv);
|
||||
static constexpr std::string_view vector("Windows::Foundation::Collections::IVector<"sv);
|
||||
static constexpr std::string_view map("Windows::Foundation::Collections::IMap<"sv);
|
||||
static constexpr std::string_view iterable("winrt::Windows::Foundation::Collections::IIterable<"sv);
|
||||
static constexpr std::string_view vector_view("winrt::Windows::Foundation::Collections::IVectorView<"sv);
|
||||
static constexpr std::string_view map_view("winrt::Windows::Foundation::Collections::IMapView<"sv);
|
||||
static constexpr std::string_view vector("winrt::Windows::Foundation::Collections::IVector<"sv);
|
||||
static constexpr std::string_view map("winrt::Windows::Foundation::Collections::IMap<"sv);
|
||||
|
||||
consume_types = false;
|
||||
auto full_name = write_temp("@::%<%>", ns, name, bind_list(", ", type.GenericArgs()));
|
||||
auto full_name = write_temp("winrt::@::%<%>", ns, name, bind_list(", ", type.GenericArgs()));
|
||||
consume_types = true;
|
||||
|
||||
if (starts_with(full_name, iterable))
|
||||
|
@ -459,7 +459,7 @@ namespace cppwinrt
|
|||
}
|
||||
else
|
||||
{
|
||||
write("@::%<%>", ns, name, bind_list(", ", type.GenericArgs()));
|
||||
write("winrt::@::%<%>", ns, name, bind_list(", ", type.GenericArgs()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
|
||||
namespace winrt::test_component::Windows::implementation
|
||||
{
|
||||
void Class::StaticMethod()
|
||||
void Class::StaticMethod(winrt::test_component::Windows::Struct const&)
|
||||
{
|
||||
throw hresult_not_implemented();
|
||||
}
|
||||
void Class::Method()
|
||||
void Class::Method(winrt::Windows::Foundation::Uri const&)
|
||||
{
|
||||
throw hresult_not_implemented();
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@ namespace winrt::test_component::Windows::implementation
|
|||
{
|
||||
Class() = default;
|
||||
|
||||
static void StaticMethod();
|
||||
void Method();
|
||||
static void StaticMethod(winrt::test_component::Windows::Struct const& param);
|
||||
void Method(winrt::Windows::Foundation::Uri const& param);
|
||||
};
|
||||
}
|
||||
namespace winrt::test_component::Windows::factory_implementation
|
||||
|
|
|
@ -280,11 +280,18 @@ namespace test_component
|
|||
|
||||
namespace Windows
|
||||
{
|
||||
struct Struct
|
||||
{
|
||||
Windows.Foundation.Rect rect;
|
||||
Windows.Foundation.Numerics.Matrix3x2 matrix;
|
||||
Windows.Foundation.IReference<Windows.Foundation.Rect> ref_rect;
|
||||
};
|
||||
|
||||
runtimeclass Class
|
||||
{
|
||||
Class();
|
||||
static void StaticMethod();
|
||||
void Method();
|
||||
static void StaticMethod(Struct param);
|
||||
void Method(Windows.Foundation.Uri param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче