Add package content.
This commit is contained in:
97
Runtime/Native/NativeFunctions.cs
Normal file
97
Runtime/Native/NativeFunctions.cs
Normal file
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace NativeFileDialogSharp.Native
|
||||
{
|
||||
public struct nfdpathset_t
|
||||
{
|
||||
public IntPtr buf;
|
||||
public IntPtr indices;
|
||||
public UIntPtr count;
|
||||
}
|
||||
|
||||
public enum nfdresult_t
|
||||
{
|
||||
NFD_ERROR,
|
||||
NFD_OKAY,
|
||||
NFD_CANCEL
|
||||
}
|
||||
|
||||
public static class NativeFunctions
|
||||
{
|
||||
public const string LibraryName = "nfd";
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe nfdresult_t NFD_OpenDialog(byte* filterList, byte* defaultPath, out IntPtr outPath);
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe nfdresult_t NFD_OpenDialogMultiple(byte* filterList, byte* defaultPath,
|
||||
nfdpathset_t* outPaths);
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe nfdresult_t NFD_SaveDialog(byte* filterList, byte* defaultPath, out IntPtr outPath);
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe nfdresult_t NFD_PickFolder(byte* defaultPath, out IntPtr outPath);
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe byte* NFD_GetError();
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe UIntPtr NFD_PathSet_GetCount(nfdpathset_t* pathSet);
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe byte* NFD_PathSet_GetPath(nfdpathset_t* pathSet, UIntPtr index);
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe void NFD_PathSet_Free(nfdpathset_t* pathSet);
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe void NFD_Dummy();
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe IntPtr NFD_Malloc(UIntPtr bytes);
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe void NFD_Free(IntPtr ptr);
|
||||
}
|
||||
|
||||
public static class NativeFunctions32
|
||||
{
|
||||
public const string LibraryName = "nfd_x86";
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe nfdresult_t NFD_OpenDialog(byte* filterList, byte* defaultPath, out IntPtr outPath);
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe nfdresult_t NFD_OpenDialogMultiple(byte* filterList, byte* defaultPath,
|
||||
nfdpathset_t* outPaths);
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe nfdresult_t NFD_SaveDialog(byte* filterList, byte* defaultPath, out IntPtr outPath);
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe nfdresult_t NFD_PickFolder(byte* defaultPath, out IntPtr outPath);
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe byte* NFD_GetError();
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe UIntPtr NFD_PathSet_GetCount(nfdpathset_t* pathSet);
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe byte* NFD_PathSet_GetPath(nfdpathset_t* pathSet, UIntPtr index);
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe void NFD_PathSet_Free(nfdpathset_t* pathSet);
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe void NFD_Dummy();
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe IntPtr NFD_Malloc(UIntPtr bytes);
|
||||
|
||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||
public static extern unsafe void NFD_Free(IntPtr ptr);
|
||||
}
|
||||
}
|
||||
11
Runtime/Native/NativeFunctions.cs.meta
Normal file
11
Runtime/Native/NativeFunctions.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f2e2abf13b9012b4296a07bf97c360c4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user