Class NFD
Native File Dialog Extended binding.
See the source repository for basic usages.
Important
NFD uses UTF-16 on Windows. You should use
NFD_AllocString and
NFD_NativeString
instead of the MemoryUtil
version.
- Since:
- 0.1.0
- Author:
- squid233
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final Charset
On Windows, this is UTF-16 little-endian; on others, this is UTF-8static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final ValueLayout
On Windows, this iswchar_t
; on others, this is bytestatic final ValueLayout
On macOS, this is Clong
; on Windows and others, this is int -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull MemorySegment
NFD_AllocString
(SegmentAllocator allocator, @Nullable String string) static void
InvokesNFD_ClearError
.static void
NFD_FreePath
(@NonNull MemorySegment filePath) InvokesNFD_FreePathN
.static @NonNull MemorySegment
InvokesNFD_GetError
.static int
NFD_Init()
InvokesNFD_Init
.static @Nullable String
NFD_NativeString
(@Nullable MemorySegment segment) static int
NFD_OpenDialog
(@NonNull MemorySegment outPath, @NonNull MemorySegment filterList, int filterCount, @NonNull MemorySegment defaultPath) InvokesNFD_OpenDialogN
.static int
NFD_OpenDialog_With
(@NonNull MemorySegment outPath, @NonNull MemorySegment args) InvokesNFD_OpenDialog_With
.static int
NFD_OpenDialog_With_Impl
(long version, @NonNull MemorySegment outPath, @NonNull MemorySegment args) InvokesNFD_OpenDialogN_With_Impl
.static int
NFD_OpenDialogMultiple
(@NonNull MemorySegment outPaths, @NonNull MemorySegment filterList, int filterCount, @NonNull MemorySegment defaultPath) InvokesNFD_OpenDialogMultipleN
.static int
NFD_OpenDialogMultiple_With
(@NonNull MemorySegment outPaths, @NonNull MemorySegment args) InvokesNFD_OpenDialogMultiple_With
.static int
NFD_OpenDialogMultiple_With_Impl
(long version, @NonNull MemorySegment outPaths, @NonNull MemorySegment args) InvokesNFD_OpenDialogMultipleN_With_Impl
.static int
NFD_PathSet_EnumNext
(@NonNull MemorySegment enumerator, @NonNull MemorySegment outPath) InvokesNFD_PathSet_EnumNextN
.static void
NFD_PathSet_Free
(@NonNull MemorySegment pathSet) InvokesNFD_PathSet_Free
.static void
NFD_PathSet_FreeEnum
(@NonNull MemorySegment enumerator) InvokesNFD_PathSet_FreeEnum
.static void
NFD_PathSet_FreePath
(@NonNull MemorySegment filePath) InvokesNFD_PathSet_FreePathN
.static int
NFD_PathSet_GetCount
(@NonNull MemorySegment pathSet, @NonNull MemorySegment count) InvokesNFD_PathSet_GetCount
.static int
NFD_PathSet_GetEnum
(@NonNull MemorySegment pathSet, @NonNull MemorySegment outEnumerator) InvokesNFD_PathSet_GetEnum
.static int
NFD_PathSet_GetPath
(@NonNull MemorySegment pathSet, long index, @NonNull MemorySegment outPath) InvokesNFD_PathSet_GetPathN
.static int
NFD_PickFolder
(@NonNull MemorySegment outPath, @NonNull MemorySegment defaultPath) InvokesNFD_PickFolderN
.static int
NFD_PickFolder_With
(@NonNull MemorySegment outPath, @NonNull MemorySegment args) InvokesNFD_PickFolder_With
.static int
NFD_PickFolder_With_Impl
(long version, @NonNull MemorySegment outPath, @NonNull MemorySegment args) InvokesNFD_PickFolderN_With_Impl
.static int
NFD_PickFolderMultiple
(@NonNull MemorySegment outPaths, @NonNull MemorySegment defaultPath) InvokesNFD_PickFolderMultipleN
.static int
NFD_PickFolderMultiple_With
(@NonNull MemorySegment outPaths, @NonNull MemorySegment args) InvokesNFD_PickFolderMultiple_With
.static int
NFD_PickFolderMultiple_With_Impl
(long version, @NonNull MemorySegment outPaths, @NonNull MemorySegment args) InvokesNFD_PickFolderMultipleN_With_Impl
.static void
NFD_Quit()
InvokesNFD_Quit
.static int
NFD_SaveDialog
(@NonNull MemorySegment outPath, @NonNull MemorySegment filterList, int filterCount, @NonNull MemorySegment defaultPath, @NonNull MemorySegment defaultName) InvokesNFD_SaveDialogN
.static int
NFD_SaveDialog_With
(@NonNull MemorySegment outPath, @NonNull MemorySegment args) InvokesNFD_SaveDialog_With
.static int
NFD_SaveDialog_With_Impl
(long version, @NonNull MemorySegment outPath, @NonNull MemorySegment args) InvokesNFD_SaveDialogN_With_Impl
.
-
Field Details
-
NFD_INTERFACE_VERSION
public static final int NFD_INTERFACE_VERSION- See Also:
-
NFD_ERROR
public static final int NFD_ERROR- See Also:
-
NFD_OKAY
public static final int NFD_OKAY- See Also:
-
NFD_CANCEL
public static final int NFD_CANCEL- See Also:
-
NFD_WINDOW_HANDLE_TYPE_UNSET
public static final int NFD_WINDOW_HANDLE_TYPE_UNSET- See Also:
-
NFD_WINDOW_HANDLE_TYPE_WINDOWS
public static final int NFD_WINDOW_HANDLE_TYPE_WINDOWS- See Also:
-
NFD_WINDOW_HANDLE_TYPE_COCOA
public static final int NFD_WINDOW_HANDLE_TYPE_COCOA- See Also:
-
NFD_WINDOW_HANDLE_TYPE_X11
public static final int NFD_WINDOW_HANDLE_TYPE_X11- See Also:
-
NFD_CHARSET
On Windows, this is UTF-16 little-endian; on others, this is UTF-8 -
nfdnchar_t
On Windows, this iswchar_t
; on others, this is byte -
nfdpathsetsize_t
On macOS, this is Clong
; on Windows and others, this is int
-
-
Method Details
-
NFD_FreePath
Invokes
NFD_FreePathN
.void NFD_FreePathN(nfdnchar_t* filePath);
-
NFD_Init
public static int NFD_Init()Invokes
NFD_Init
.(int) nfdresult_t NFD_Init();
-
NFD_Quit
public static void NFD_Quit()Invokes
NFD_Quit
.void NFD_Quit();
-
NFD_OpenDialog
public static int NFD_OpenDialog(@NonNull MemorySegment outPath, @NonNull MemorySegment filterList, int filterCount, @NonNull MemorySegment defaultPath) Invokes
NFD_OpenDialogN
.(int) nfdresult_t NFD_OpenDialogN(nfdnchar_t** outPath, const nfdnfilteritem_t* filterList, (unsigned int) nfdfiltersize_t filterCount, const nfdnchar_t* defaultPath);
-
NFD_OpenDialog_With_Impl
public static int NFD_OpenDialog_With_Impl(long version, @NonNull MemorySegment outPath, @NonNull MemorySegment args) Invokes
NFD_OpenDialogN_With_Impl
.(int) nfdresult_t NFD_OpenDialogN_With_Impl((size_t) nfdversion_t version, nfdnchar_t** outPath, const nfdopendialognargs_t* args);
-
NFD_OpenDialog_With
Invokes
NFD_OpenDialog_With
.(int) nfdresult_t NFD_OpenDialog_With(nfdnchar_t** outPath, const nfdopendialognargs_t* args);
-
NFD_OpenDialogMultiple
public static int NFD_OpenDialogMultiple(@NonNull MemorySegment outPaths, @NonNull MemorySegment filterList, int filterCount, @NonNull MemorySegment defaultPath) Invokes
NFD_OpenDialogMultipleN
.(int) nfdresult_t NFD_OpenDialogMultipleN(const nfdpathset_t** outPaths, const nfdnfilteritem_t* filterList, (unsigned int) nfdfiltersize_t filterCount, const nfdnchar_t* defaultPath);
-
NFD_OpenDialogMultiple_With_Impl
public static int NFD_OpenDialogMultiple_With_Impl(long version, @NonNull MemorySegment outPaths, @NonNull MemorySegment args) Invokes
NFD_OpenDialogMultipleN_With_Impl
.(int) nfdresult_t NFD_OpenDialogMultipleN_With_Impl((size_t) nfdversion_t version, const nfdpathset_t** outPaths, const nfdopendialognargs_t* args);
-
NFD_OpenDialogMultiple_With
public static int NFD_OpenDialogMultiple_With(@NonNull MemorySegment outPaths, @NonNull MemorySegment args) Invokes
NFD_OpenDialogMultiple_With
.(int) nfdresult_t NFD_OpenDialogMultiple_With(const nfdpathset_t** outPaths, const nfdopendialognargs_t* args);
-
NFD_SaveDialog
public static int NFD_SaveDialog(@NonNull MemorySegment outPath, @NonNull MemorySegment filterList, int filterCount, @NonNull MemorySegment defaultPath, @NonNull MemorySegment defaultName) Invokes
NFD_SaveDialogN
.(int) nfdresult_t NFD_SaveDialogN(nfdnchar_t** outPath, const nfdnfilteritem_t* filterList, (unsigned int) nfdfiltersize_t filterCount, const nfdnchar_t* defaultPath, const nfdnchar_t* defaultName);
-
NFD_SaveDialog_With_Impl
public static int NFD_SaveDialog_With_Impl(long version, @NonNull MemorySegment outPath, @NonNull MemorySegment args) Invokes
NFD_SaveDialogN_With_Impl
.(int) nfdresult_t NFD_SaveDialogN_With_Impl((size_t) nfdversion_t version, nfdnchar_t** outPath, const nfdsavedialognargs_t* args);
-
NFD_SaveDialog_With
Invokes
NFD_SaveDialog_With
.(int) nfdresult_t NFD_SaveDialog_With(nfdnchar_t** outPath, const nfdsavedialognargs_t* args);
-
NFD_PickFolder
public static int NFD_PickFolder(@NonNull MemorySegment outPath, @NonNull MemorySegment defaultPath) Invokes
NFD_PickFolderN
.(int) nfdresult_t NFD_PickFolderN(nfdnchar_t** outPath, const nfdnchar_t* defaultPath);
-
NFD_PickFolder_With_Impl
public static int NFD_PickFolder_With_Impl(long version, @NonNull MemorySegment outPath, @NonNull MemorySegment args) Invokes
NFD_PickFolderN_With_Impl
.(int) nfdresult_t NFD_PickFolderN_With_Impl((size_t) nfdversion_t version, nfdnchar_t** outPath, const nfdpickfoldernargs_t* args);
-
NFD_PickFolder_With
Invokes
NFD_PickFolder_With
.(int) nfdresult_t NFD_PickFolder_With(nfdnchar_t** outPath, const nfdpickfoldernargs_t* args);
-
NFD_PickFolderMultiple
public static int NFD_PickFolderMultiple(@NonNull MemorySegment outPaths, @NonNull MemorySegment defaultPath) Invokes
NFD_PickFolderMultipleN
.(int) nfdresult_t NFD_PickFolderMultipleN(const nfdpathset_t** outPaths, const nfdnchar_t* defaultPath);
-
NFD_PickFolderMultiple_With_Impl
public static int NFD_PickFolderMultiple_With_Impl(long version, @NonNull MemorySegment outPaths, @NonNull MemorySegment args) Invokes
NFD_PickFolderMultipleN_With_Impl
.(int) nfdresult_t NFD_PickFolderMultipleN_With_Impl((size_t) nfdversion_t version, const nfdpathset_t** outPaths, const nfdpickfoldernargs_t* args);
-
NFD_PickFolderMultiple_With
public static int NFD_PickFolderMultiple_With(@NonNull MemorySegment outPaths, @NonNull MemorySegment args) Invokes
NFD_PickFolderMultiple_With
.(int) nfdresult_t NFD_PickFolderMultiple_With(const nfdpathset_t** outPaths, const nfdpickfoldernargs_t* args);
-
NFD_GetError
Invokes
NFD_GetError
.const char* NFD_GetError();
-
NFD_ClearError
public static void NFD_ClearError()Invokes
NFD_ClearError
.void NFD_ClearError();
-
NFD_PathSet_GetCount
public static int NFD_PathSet_GetCount(@NonNull MemorySegment pathSet, @NonNull MemorySegment count) Invokes
NFD_PathSet_GetCount
.(int) nfdresult_t NFD_PathSet_GetCount(const nfdpathset_t* pathSet, nfdpathsetsize_t* count);
-
NFD_PathSet_GetPath
public static int NFD_PathSet_GetPath(@NonNull MemorySegment pathSet, long index, @NonNull MemorySegment outPath) Invokes
NFD_PathSet_GetPathN
.(int) nfdresult_t NFD_PathSet_GetPathN(const nfdpathset_t* pathSet, (size_t) nfdpathsetsize_t index, nfdnchar_t** outPath);
-
NFD_PathSet_FreePath
Invokes
NFD_PathSet_FreePathN
.void NFD_PathSet_FreePathN(const nfdnchar_t* filePath);
-
NFD_PathSet_GetEnum
public static int NFD_PathSet_GetEnum(@NonNull MemorySegment pathSet, @NonNull MemorySegment outEnumerator) Invokes
NFD_PathSet_GetEnum
.(int) nfdresult_t NFD_PathSet_GetEnum(const nfdpathset_t* pathSet, nfdpathsetenum_t* outEnumerator);
-
NFD_PathSet_FreeEnum
Invokes
NFD_PathSet_FreeEnum
.void NFD_PathSet_FreeEnum(nfdpathsetenum_t* enumerator);
-
NFD_PathSet_EnumNext
public static int NFD_PathSet_EnumNext(@NonNull MemorySegment enumerator, @NonNull MemorySegment outPath) Invokes
NFD_PathSet_EnumNextN
.(int) nfdresult_t NFD_PathSet_EnumNextN(nfdpathsetenum_t* enumerator, nfdnchar_t** outPath);
-
NFD_PathSet_Free
Invokes
NFD_PathSet_Free
.void NFD_PathSet_Free(const nfdpathset_t* pathSet);
-
NFD_AllocString
public static @NonNull MemorySegment NFD_AllocString(SegmentAllocator allocator, @Nullable String string) -
NFD_NativeString
-