Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cppwinrt/code_writers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 % = %;
% };
)";

Expand Down Expand Up @@ -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);
}
Expand Down
24 changes: 12 additions & 12 deletions cppwinrt/type_writers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand Down Expand Up @@ -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);
}
}
}
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -459,7 +459,7 @@ namespace cppwinrt
}
else
{
write("@::%<%>", ns, name, bind_list(", ", type.GenericArgs()));
write("winrt::@::%<%>", ns, name, bind_list(", ", type.GenericArgs()));
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/test_component/Windows.Class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
4 changes: 2 additions & 2 deletions test/test_component/Windows.Class.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions test/test_component/test_component.idl
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}