diff --git a/Project.toml b/Project.toml index f7bf104..64ad162 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "NativeFileDialog" uuid = "e1fe445b-aa65-4df4-81c1-2041507f0fd4" authors = ["José Joaquín Zubieta Rico and contributors"] -version = "0.2.0" +version = "0.2.1" [deps] FilePathsBase = "48062228-2e41-5def-b9a4-89aafe57970f" @@ -9,7 +9,7 @@ NativeFileDialog_jll = "94d9ae2c-efc7-56f8-9a02-54c47b797961" [compat] FilePathsBase = "0.9" -julia = "1.3" +julia = "^1.6" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/src/wrapper.jl b/src/wrapper.jl index 9457c1d..3c9838f 100644 --- a/src/wrapper.jl +++ b/src/wrapper.jl @@ -1,36 +1,36 @@ function OpenDialog(filterlist::Cstring, defaultpath::Cstring) outpath = Ref(Ptr{UInt8}()) - status = ccall((:NFD_OpenDialog, libnfd), NFDResult, (Cstring, Cstring, Ref{Ptr{UInt8}}), filterlist, defaultpath, outpath) + status = @ccall libnfd.NFD_OpenDialog(filterlist::Cstring, defaultpath::Cstring, outpath::Ref{Ptr{UInt8}})::NFDResult return status, outpath[] end function OpenDialogMultiple(filterlist::Cstring, defaultpath::Cstring) outpathset = Ref(NFDPathSet(C_NULL, C_NULL, 0)) - status = ccall((:NFD_OpenDialogMultiple, libnfd), NFDResult, (Cstring, Cstring, Ref{NFDPathSet}), filterlist, defaultpath, outpathset) + status = @ccall libnfd.NFD_OpenDialogMultiple(filterlist::Cstring, defaultpath::Cstring, outpathset::Ref{NFDPathSet})::NFDResult return status, outpathset[] end function SaveDialog(filterlist::Cstring, defaultpath::Cstring) outpath = Ref(Ptr{UInt8}()) - status = ccall((:NFD_SaveDialog, libnfd), NFDResult, (Cstring, Cstring, Ref{Ptr{UInt8}}), filterlist, defaultpath, outpath) + status = @ccall libnfd.NFD_SaveDialog(filterlist::Cstring, defaultpath::Cstring, outpath::Ref{Ptr{UInt8}})::NFDResult return status, outpath[] end function PickFolder(defaultpath::Cstring) outpath = Ref(Ptr{UInt8}()) - status = ccall((:NFD_PickFolder, libnfd), NFDResult, (Cstring, Ref{Ptr{UInt8}}), defaultpath, outpath) + status = @ccall libnfd.NFD_PickFolder(defaultpath::Cstring, outpath::Ref{Ptr{UInt8}})::NFDResult return status, outpath[] end function GetError() - ccall((:NFD_GetError, libnfd), Cstring, ()) + @ccall libnfd.NFD_GetError()::Cstring end function PathSetFree(pathset::NFDPathSet) refpathset = Ref(pathset) - ccall((:NFD_PathSet_Free, libnfd), Cvoid, (Ref{NFDPathSet},), refpathset) + @ccall libnfd.NFD_PathSet_Free(refpathset::Ref{NFDPathSet})::Cvoid end function Free(ptr) - ccall((:NFD_Free, libnfd), Cvoid, (Ptr{Cvoid},), ptr) + @ccall libnfd.NFD_Free(ptr::Ptr{Cvoid})::Cvoid end