Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String marshalling fix #3

Merged
merged 8 commits into from
Dec 25, 2023
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 .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "nativefiledialog-extended"]
path = nativefiledialog-extended
url = ssh://git@github.com/Speykious/nativefiledialog-extended
branch = dynamic
url = ssh://git@github.com/btzy/nativefiledialog-extended.git
branch = master
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup Label="Project">
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup Label="Package References">
<PackageReference Include="NativeFileDialogs.Net.Runtime" Version="1.0.0" />
<PackageReference Include="NativeFileDialogs.Net.Runtime" Version="1.1.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Speykious
// Copyright (c) Speykious
// This file is part of NativeFileDialogs.NET.
// NativeFileDialogs.NET is licensed under the Zlib License. See LICENSE for details.

Expand All @@ -9,22 +9,22 @@
{
nfd.NFD_Init();

NfdnfilteritemT[] filterItem = new[]
Nfdu8filteritemT[] filterItem = new[]
{
new NfdnfilteritemT
new Nfdu8filteritemT
{
Name = "Source code",
Spec = "c,cpp,cc",
},
new NfdnfilteritemT
new Nfdu8filteritemT
{
Name = "Headers",
Spec = "h,hpp",
},
};

sbyte* outPathPtr;
NfdresultT result = nfd.NFD_OpenDialogN(&outPathPtr, filterItem, (uint)filterItem.Length, null);
NfdresultT result = nfd.NFD_OpenDialogU8(&outPathPtr, filterItem, (uint)filterItem.Length, null);
switch (result)
{
case NfdresultT.NFD_OKAY:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup Label="Project">
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup Label="Package References">
<PackageReference Include="NativeFileDialogs.Net.Runtime" Version="1.0.0" />
<PackageReference Include="NativeFileDialogs.Net.Runtime" Version="1.1.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Speykious
// Copyright (c) Speykious
// This file is part of NativeFileDialogs.NET.
// NativeFileDialogs.NET is licensed under the Zlib License. See LICENSE for details.

Expand All @@ -9,22 +9,22 @@
{
nfd.NFD_Init();

NfdnfilteritemT[] filterItems = new[]
Nfdu8filteritemT[] filterItems = new[]
{
new NfdnfilteritemT
new Nfdu8filteritemT
{
Name = "Source code",
Spec = "c,cpp,cc",
},
new NfdnfilteritemT
new Nfdu8filteritemT
{
Name = "Headers",
Spec = "h,hpp",
},
};

IntPtr pathSet;
NfdresultT result = nfd.NFD_OpenDialogMultipleN(&pathSet, filterItems, (uint)filterItems.Length, null);
NfdresultT result = nfd.NFD_OpenDialogMultipleU8(&pathSet, filterItems, (uint)filterItems.Length, null);
switch (result)
{
case NfdresultT.NFD_OKAY:
Expand All @@ -36,7 +36,7 @@
for (uint i = 0; i < count; i++)
{
sbyte* pathPtr;
nfd.NFD_PathSetGetPathN(pathSet, i, &pathPtr);
nfd.NFD_PathSetGetPathU8(pathSet, i, &pathPtr);
outPaths[i] = new string(pathPtr);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup Label="Project">
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup Label="Package References">
<PackageReference Include="NativeFileDialogs.Net.Runtime" Version="1.0.0" />
<PackageReference Include="NativeFileDialogs.Net.Runtime" Version="1.1.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Speykious
// Copyright (c) Speykious
// This file is part of NativeFileDialogs.NET.
// NativeFileDialogs.NET is licensed under the Zlib License. See LICENSE for details.

Expand All @@ -10,7 +10,7 @@
nfd.NFD_Init();

sbyte* outPathPtr;
NfdresultT result = nfd.NFD_PickFolderN(&outPathPtr, null);
NfdresultT result = nfd.NFD_PickFolderU8(&outPathPtr, null);
switch (result)
{
case NfdresultT.NFD_OKAY:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup Label="Project">
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup Label="Package References">
<PackageReference Include="NativeFileDialogs.Net.Runtime" Version="1.0.0" />
<PackageReference Include="NativeFileDialogs.Net.Runtime" Version="1.1.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Speykious
// Copyright (c) Speykious
// This file is part of NativeFileDialogs.NET.
// NativeFileDialogs.NET is licensed under the Zlib License. See LICENSE for details.

Expand All @@ -9,22 +9,22 @@
{
nfd.NFD_Init();

NfdnfilteritemT[] filterItem = new[]
Nfdu8filteritemT[] filterItem = new[]
{
new NfdnfilteritemT
new Nfdu8filteritemT
{
Name = "Source code",
Spec = "c,cpp,cc",
},
new NfdnfilteritemT
new Nfdu8filteritemT
{
Name = "Headers",
Spec = "h,hpp",
},
};

sbyte* savePathPtr;
NfdresultT result = nfd.NFD_SaveDialogN(&savePathPtr, filterItem, (uint)filterItem.Length, null, "Untitled.c");
NfdresultT result = nfd.NFD_SaveDialogU8(&savePathPtr, filterItem, (uint)filterItem.Length, null, "Untitled.c");
switch (result)
{
case NfdresultT.NFD_OKAY:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup Label="Project">
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -12,7 +12,7 @@
</ItemGroup>

<ItemGroup Label="Package References">
<PackageReference Include="NativeFileDialogs.Net.Runtime" Version="1.0.0" />
<PackageReference Include="NativeFileDialogs.Net.Runtime" Version="1.1.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup Label="Project">
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -12,7 +12,7 @@
</ItemGroup>

<ItemGroup Label="Package References">
<PackageReference Include="NativeFileDialogs.Net.Runtime" Version="1.0.0" />
<PackageReference Include="NativeFileDialogs.Net.Runtime" Version="1.1.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup Label="Project">
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -12,7 +12,7 @@
</ItemGroup>

<ItemGroup Label="Package References">
<PackageReference Include="NativeFileDialogs.Net.Runtime" Version="1.0.0" />
<PackageReference Include="NativeFileDialogs.Net.Runtime" Version="1.1.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup Label="Project">
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -12,7 +12,7 @@
</ItemGroup>

<ItemGroup Label="Package References">
<PackageReference Include="NativeFileDialogs.Net.Runtime" Version="1.0.0" />
<PackageReference Include="NativeFileDialogs.Net.Runtime" Version="1.1.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
#include <new>

nfdpathsetenum_t& (nfdpathsetenum_t::*_0)(nfdpathsetenum_t&&) = &nfdpathsetenum_t::operator=;
nfdnfilteritem_t& (nfdnfilteritem_t::*_1)(nfdnfilteritem_t&&) = &nfdnfilteritem_t::operator=;
nfdu8filteritem_t& (nfdu8filteritem_t::*_1)(nfdu8filteritem_t&&) = &nfdu8filteritem_t::operator=;
nfdnfilteritem_t& (nfdnfilteritem_t::*_2)(nfdnfilteritem_t&&) = &nfdnfilteritem_t::operator=;
9 changes: 3 additions & 6 deletions NativeFileDialogs.AutoGen/NativeFileDialogs.AutoGen.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Label="Project">
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -17,16 +17,13 @@
<Title>NativeFileDialogs.AutoGen</Title>
<Description>Auto-generated .NET bindings for NativeFileDialogs (Extended)</Description>
<Copyright>2022 Speykious</Copyright>
<RepositoryUrl>https://github.com/Speykious/NativeFileDialogs.NET</RepositoryUrl>
<PackageProjectUrl>https://github.com/Speykious/NativeFileDialogs.NET</PackageProjectUrl>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>

<ItemGroup Label="Package References">
<PackageReference Include="CppSharp.Runtime" Version="1.0.3" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="CppSharp.Runtime" Version="1.1.5.3168" />
</ItemGroup>

<ItemGroup Label="Documents">
Expand Down
2 changes: 2 additions & 0 deletions NativeFileDialogs.AutoGen/Std.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
using __IntPtr = global::System.IntPtr;
[assembly:InternalsVisibleTo("nfd")]

#pragma warning disable CS0109 // Member does not hide an inherited member; new keyword is not required

Loading