diff --git a/buildSrc/src/main/kotlin/generators.kt b/buildSrc/src/main/kotlin/generators.kt new file mode 100644 index 00000000..934bcad5 --- /dev/null +++ b/buildSrc/src/main/kotlin/generators.kt @@ -0,0 +1,9 @@ +import org.gradle.api.Project +import org.gradle.kotlin.dsl.register + +fun Project.registerGenerateTask(main: String, targetProject: String) { + tasks.register("generate") { + mainClass.set(main) + workingDir = project(targetProject).projectDir.resolve("src/main/java/") + } +} diff --git a/generators/nfd/build.gradle.kts b/generators/nfd/build.gradle.kts index e3b77158..885aa1a8 100644 --- a/generators/nfd/build.gradle.kts +++ b/generators/nfd/build.gradle.kts @@ -6,7 +6,4 @@ dependencies { implementation(project(":generators")) } -tasks.register("generate") { - mainClass = "overrungl.nfd.NFDGeneratorKt" - workingDir = project(":nfd").projectDir.resolve("src/main/java/") -} +registerGenerateTask("overrungl.nfd.NFDGeneratorKt", ":nfd") diff --git a/generators/nfd/src/main/kotlin/overrungl/nfd/NFDGenerator.kt b/generators/nfd/src/main/kotlin/overrungl/nfd/NFDGenerator.kt index d32b5579..d1213e2c 100644 --- a/generators/nfd/src/main/kotlin/overrungl/nfd/NFDGenerator.kt +++ b/generators/nfd/src/main/kotlin/overrungl/nfd/NFDGenerator.kt @@ -202,14 +202,14 @@ fun main() { doFirst { add("Base functions of {@link \$T}.", ClassName.get("overrungl.nfd", "NFD")) } }) { extends(DirectAccess) - jint("ERROR" to "0") { addJavadoc("Programmatic error") } - jint("OKAY" to "1") { addJavadoc("User pressed okay, or successful return") } - jint("CANCEL" to "2") { addJavadoc("User pressed cancel") } - jint("WINDOW_HANDLE_TYPE_UNSET" to "0") { addJavadoc("The native window handle type.") } - jint("WINDOW_HANDLE_TYPE_WINDOWS" to "1") { addJavadoc("Windows: handle is HWND (the Windows API typedefs this to void*)") } - jint("WINDOW_HANDLE_TYPE_COCOA" to "2") { addJavadoc("Cocoa: handle is NSWindow*") } - jint("WINDOW_HANDLE_TYPE_X11" to "3") { addJavadoc("X11: handle is Window") } - jint("INTERFACE_VERSION" to "1") { + jint("NFD_ERROR" to "0") { addJavadoc("Programmatic error") } + jint("NFD_OKAY" to "1") { addJavadoc("User pressed okay, or successful return") } + jint("NFD_CANCEL" to "2") { addJavadoc("User pressed cancel") } + jint("NFD_WINDOW_HANDLE_TYPE_UNSET" to "0") { addJavadoc("The native window handle type.") } + jint("NFD_WINDOW_HANDLE_TYPE_WINDOWS" to "1") { addJavadoc("Windows: handle is HWND (the Windows API typedefs this to void*)") } + jint("NFD_WINDOW_HANDLE_TYPE_COCOA" to "2") { addJavadoc("Cocoa: handle is NSWindow*") } + jint("NFD_WINDOW_HANDLE_TYPE_X11" to "3") { addJavadoc("X11: handle is Window") } + jint("NFD_INTERFACE_VERSION" to "1") { addJavadoc( """ This is a unique identifier tagged to all the NFD_*With() function calls, for backward @@ -244,7 +244,7 @@ fun main() { } fun freePath(variant: CharVariant) { - val spec = "freePath${variant.uppercaseName}"( + val spec = "NFD_FreePath${variant.uppercaseName}"( void, variant.nfdchar_t_ptr("filePath"), entrypoint = "NFD_FreePath${variant.uppercaseName}", @@ -253,16 +253,16 @@ fun main() { """ Free a file path that was returned by the dialogs.

- Note: use {@link #pathSetFreePath${variant.uppercaseName}} to free path from pathset instead of this function. + Note: use {@link #NFD_PathSet_FreePath${variant.uppercaseName}} to free path from pathset instead of this function. """.trimIndent() ) }) - provideOverload(variant, spec, "freePath") + provideOverload(variant, spec, "NFD_FreePath") } freePath(Nchar) freePath(U8char) - "init"(nfdresult_t, entrypoint = "NFD_Init", javadoc = { + "NFD_Init"(nfdresult_t, entrypoint = "NFD_Init", javadoc = { add( """ Initialize NFD. Call this for every thread that might use NFD, before calling any other NFD @@ -270,16 +270,16 @@ fun main() { """.trimIndent() ) }) - "quit"(void, entrypoint = "NFD_Quit", javadoc = { + "NFD_Quit"(void, entrypoint = "NFD_Quit", javadoc = { add( """ - Call this to de-initialize NFD, if {@link #init()} returned NFD_OKAY. + Call this to de-initialize NFD, if {@link #NFD_Init()} returned NFD_OKAY. """.trimIndent() ) }) fun openDialog(variant: CharVariant) { - val spec = "openDialog${variant.uppercaseName}"( + val spec = "NFD_OpenDialog${variant.uppercaseName}"( nfdresult_t, variant.nfdchar_t_ptr_ptr("outPath"), variant.const_nfdfilteritem_t_ptr("filterList"), @@ -295,27 +295,27 @@ fun main() { """ Single file open dialog

- It's the caller's responsibility to free {@code outPath} via {@link #freePath${variant.uppercaseName}} if this function returns + It's the caller's responsibility to free {@code outPath} via {@link #NFD_FreePath${variant.uppercaseName}} if this function returns NFD_OKAY. """.trimIndent() ) } ) - provideOverload(variant, spec, "openDialog") + provideOverload(variant, spec, "NFD_OpenDialog") } openDialog(Nchar) openDialog(U8char) fun openDialogWith(variant: CharVariant) { - val openDialogWithImpl = "openDialog${variant.uppercaseName}WithImpl"( + val openDialogWithImpl = "NFD_OpenDialog${variant.uppercaseName}_With_Impl"( nfdresult_t, nfdversion_t("version"), variant.nfdchar_t_ptr_ptr("outPath"), variant.const_nfdopendialogargs_t_ptr("args"), entrypoint = "NFD_OpenDialog${variant.uppercaseName}_With_Impl", - javadoc = { add("This function is a library implementation detail. Please use {@link #openDialog${variant.uppercaseName}With} instead.") } + javadoc = { add("This function is a library implementation detail. Please use {@link #NFD_OpenDialog${variant.uppercaseName}_With} instead.") } ) - "openDialog${variant.uppercaseName}With"( + "NFD_OpenDialog${variant.uppercaseName}_With"( nfdresult_t, variant.nfdchar_t_ptr_ptr("outPath"), variant.const_nfdopendialogargs_t_ptr("args"), @@ -325,7 +325,7 @@ fun main() { """ Single file open dialog, with additional parameters.

- It is the caller's responsibility to free {@code outPath} via {@link #freePath${variant.uppercaseName}} if this function + It is the caller's responsibility to free {@code outPath} via {@link #NFD_FreePath${variant.uppercaseName}} if this function returns NFD_OKAY. See documentation of {@link NFDOpenDialog${variant.uppercaseName}Args} for details. """.trimIndent() ) @@ -333,14 +333,14 @@ fun main() { default = true, ) { addAnnotation(Skip) - addStatement("return $1N(INTERFACE_VERSION, outPath, args)", openDialogWithImpl) + addStatement("return $1N(NFD_INTERFACE_VERSION, outPath, args)", openDialogWithImpl) } } openDialogWith(Nchar) openDialogWith(U8char) fun openDialogMultiple(variant: CharVariant) { - val spec = "openDialogMultiple${variant.uppercaseName}"( + val spec = "NFD_OpenDialogMultiple${variant.uppercaseName}"( nfdresult_t, const_nfdpathset_t_ptr_ptr("outPaths"), variant.const_nfdfilteritem_t_ptr("filterList"), @@ -356,19 +356,19 @@ fun main() { """ Multiple file open dialog

- It is the caller's responsibility to free {@code outPaths} via {@link #pathSetFree} if this function + It is the caller's responsibility to free {@code outPaths} via {@link #NFD_PathSet_Free} if this function returns NFD_OKAY. """.trimIndent() ) } ) - provideOverload(variant, spec, "openDialogMultiple") + provideOverload(variant, spec, "NFD_OpenDialogMultiple") } openDialogMultiple(Nchar) openDialogMultiple(U8char) fun openDialogMultipleWith(variant: CharVariant) { - val openDialogMultipleWithImpl = "openDialogMultiple${variant.uppercaseName}WithImpl"( + val openDialogMultipleWithImpl = "NFD_OpenDialogMultiple${variant.uppercaseName}_With_Impl"( nfdresult_t, nfdversion_t("version"), const_nfdpathset_t_ptr_ptr("outPaths"), @@ -377,13 +377,13 @@ fun main() { javadoc = { add( """ - This function is a library implementation detail. Please use {@link #openDialogMultiple${variant.uppercaseName}With} + This function is a library implementation detail. Please use {@link #NFD_OpenDialogMultiple${variant.uppercaseName}_With} instead. """.trimIndent() ) } ) - "openDialogMultiple${variant.uppercaseName}With"( + "NFD_OpenDialogMultiple${variant.uppercaseName}_With"( nfdresult_t, const_nfdpathset_t_ptr_ptr("outPaths"), variant.const_nfdopendialogargs_t_ptr("args"), @@ -393,7 +393,7 @@ fun main() { """ Multiple file open dialog, with additional parameters.

- It is the caller's responsibility to free {@code outPaths} via {@link #pathSetFree} if this function + It is the caller's responsibility to free {@code outPaths} via {@link #NFD_PathSet_Free} if this function returns NFD_OKAY. See documentation of {@link NFDOpenDialog${variant.uppercaseName}Args} for details. """.trimIndent() ) @@ -401,7 +401,7 @@ fun main() { default = true ) { addAnnotation(Skip) - addStatement("return $1N(INTERFACE_VERSION, outPaths, args)", openDialogMultipleWithImpl) + addStatement("return $1N(NFD_INTERFACE_VERSION, outPaths, args)", openDialogMultipleWithImpl) } } openDialogMultipleWith(Nchar) @@ -409,7 +409,7 @@ fun main() { fun saveDialog(variant: CharVariant) { - val spec = "saveDialog${variant.uppercaseName}"( + val spec = "NFD_SaveDialog${variant.uppercaseName}"( nfdresult_t, variant.nfdchar_t_ptr_ptr("outPath"), variant.const_nfdfilteritem_t_ptr("filterList"), @@ -426,27 +426,27 @@ fun main() { """ Save dialog

- It is the caller's responsibility to free {@code outPath} via {@link #freePath${variant.uppercaseName}} if this function returns + It is the caller's responsibility to free {@code outPath} via {@link #NFD_FreePath${variant.uppercaseName}} if this function returns NFD_OKAY. """.trimIndent() ) } ) - provideOverload(variant, spec, "saveDialog") + provideOverload(variant, spec, "NFD_SaveDialog") } saveDialog(Nchar) saveDialog(U8char) fun saveDialogWith(variant: CharVariant) { - val saveDialogWithImpl = "saveDialog${variant.uppercaseName}WithImpl"( + val saveDialogWithImpl = "NFD_SaveDialog${variant.uppercaseName}_WithImpl"( nfdresult_t, nfdversion_t("version"), variant.nfdchar_t_ptr_ptr("outPath"), variant.const_nfdsavedialogargs_t_ptr("args"), entrypoint = "NFD_SaveDialog${variant.uppercaseName}_With_Impl", - javadoc = { add("This function is a library implementation detail. Please use {@link #saveDialog${variant.uppercaseName}With} instead.") } + javadoc = { add("This function is a library implementation detail. Please use {@link #NFD_SaveDialog${variant.uppercaseName}_With} instead.") } ) - "saveDialog${variant.uppercaseName}With"( + "NFD_SaveDialog${variant.uppercaseName}_With"( nfdresult_t, variant.nfdchar_t_ptr_ptr("outPath"), variant.const_nfdsavedialogargs_t_ptr("args"), @@ -456,7 +456,7 @@ fun main() { """ Single file save dialog, with additional parameters.

- It is the caller's responsibility to free {@code outPath} via {@link #freePath${variant.uppercaseName}} if this function + It is the caller's responsibility to free {@code outPath} via {@link #NFD_FreePath${variant.uppercaseName}} if this function returns NFD_OKAY. See documentation of {@link NFDSaveDialog${variant.uppercaseName}Args} for details. """.trimIndent() ) @@ -464,7 +464,7 @@ fun main() { default = true ) { addAnnotation(Skip) - addStatement("return $1N(INTERFACE_VERSION, outPath, args)", saveDialogWithImpl) + addStatement("return $1N(NFD_INTERFACE_VERSION, outPath, args)", saveDialogWithImpl) } } saveDialogWith(Nchar) @@ -472,7 +472,7 @@ fun main() { fun pickFolder(variant: CharVariant) { - val spec = "pickFolder${variant.uppercaseName}"( + val spec = "NFD_PickFolder${variant.uppercaseName}"( nfdresult_t, variant.nfdchar_t_ptr_ptr("outPath"), variant.const_nfdchar_t_ptr("defaultPath") { @@ -484,27 +484,27 @@ fun main() { """ Select single folder dialog

- It's the caller's responsibility to free {@code outPath} via {@link #freePath${variant.uppercaseName}} if this function returns + It's the caller's responsibility to free {@code outPath} via {@link #NFD_FreePath${variant.uppercaseName}} if this function returns NFD_OKAY. """.trimIndent() ) } ) - provideOverload(variant, spec, "pickFolder") + provideOverload(variant, spec, "NFD_PickFolder") } pickFolder(Nchar) pickFolder(U8char) fun pickFolderWith(variant: CharVariant) { - val pickFolderWithImpl = "pickFolder${variant.uppercaseName}WithImpl"( + val pickFolderWithImpl = "NFD_PickFolder${variant.uppercaseName}_With_Impl"( nfdresult_t, nfdversion_t("version"), variant.nfdchar_t_ptr_ptr("outPath"), variant.const_nfdpickfolderargs_t_ptr("args"), entrypoint = "NFD_PickFolder${variant.uppercaseName}_With_Impl", - javadoc = { add("This function is a library implementation detail. Please use {@link #pickFolder${variant.uppercaseName}With} instead.") } + javadoc = { add("This function is a library implementation detail. Please use {@link #NFD_PickFolder${variant.uppercaseName}_With} instead.") } ) - "pickFolder${variant.uppercaseName}With"( + "NFD_PickFolder${variant.uppercaseName}_With"( nfdresult_t, variant.nfdchar_t_ptr_ptr("outPath"), variant.const_nfdpickfolderargs_t_ptr("args"), @@ -514,7 +514,7 @@ fun main() { """ Single file open dialog, with additional parameters.

- It is the caller's responsibility to free {@code outPath} via {@link #freePath${variant.uppercaseName}} if this function + It is the caller's responsibility to free {@code outPath} via {@link #NFD_FreePath${variant.uppercaseName}} if this function returns NFD_OKAY. See documentation of {@link NFDPickFolder${variant.uppercaseName}Args} for details. """.trimIndent() ) @@ -522,14 +522,14 @@ fun main() { default = true, ) { addAnnotation(Skip) - addStatement("return $1N(INTERFACE_VERSION, outPath, args)", pickFolderWithImpl) + addStatement("return $1N(NFD_INTERFACE_VERSION, outPath, args)", pickFolderWithImpl) } } pickFolderWith(Nchar) pickFolderWith(U8char) fun pickFolderMultiple(variant: CharVariant) { - val spec = "pickFolderMultiple${variant.uppercaseName}"( + val spec = "NFD_PickFolderMultiple${variant.uppercaseName}"( nfdresult_t, const_nfdpathset_t_ptr_ptr("outPaths"), variant.const_nfdchar_t_ptr("defaultPath") { @@ -541,19 +541,19 @@ fun main() { """ Select multiple folder dialog

- It is the caller's responsibility to free {@code outPaths} via {@link #pathSetFree} if this function + It is the caller's responsibility to free {@code outPaths} via {@link #NFD_PathSet_Free} if this function returns NFD_OKAY. """.trimIndent() ) } ) - provideOverload(variant, spec, "pickFolderMultiple") + provideOverload(variant, spec, "NFD_PickFolderMultiple") } pickFolderMultiple(Nchar) pickFolderMultiple(U8char) fun pickFolderMultipleWith(variant: CharVariant) { - val pickFolderMultipleWithImpl = "pickFolderMultiple${variant.uppercaseName}WithImpl"( + val pickFolderMultipleWithImpl = "NFD_PickFolderMultiple${variant.uppercaseName}_With_Impl"( nfdresult_t, nfdversion_t("version"), const_nfdpathset_t_ptr_ptr("outPaths"), @@ -562,13 +562,13 @@ fun main() { javadoc = { add( """ - This function is a library implementation detail. Please use {@link #pickFolderMultiple${variant.uppercaseName}With} + This function is a library implementation detail. Please use {@link #NFD_PickFolderMultiple${variant.uppercaseName}_With} instead. """.trimIndent() ) } ) - "pickFolderMultiple${variant.uppercaseName}With"( + "NFD_PickFolderMultiple${variant.uppercaseName}_With"( nfdresult_t, const_nfdpathset_t_ptr_ptr("outPaths"), variant.const_nfdpickfolderargs_t_ptr("args"), @@ -578,7 +578,7 @@ fun main() { """ Multiple file open dialog, with additional parameters.

- It is the caller's responsibility to free {@code outPaths} via {@link #pathSetFree} if this function + It is the caller's responsibility to free {@code outPaths} via {@link #NFD_PathSet_Free} if this function returns NFD_OKAY. See documentation of {@link NFDPickFolder${variant.uppercaseName}Args} for details. """.trimIndent() ) @@ -586,13 +586,13 @@ fun main() { default = true ) { addAnnotation(Skip) - addStatement("return $1N(INTERFACE_VERSION, outPaths, args)", pickFolderMultipleWithImpl) + addStatement("return $1N(NFD_INTERFACE_VERSION, outPaths, args)", pickFolderMultipleWithImpl) } } pickFolderMultipleWith(Nchar) pickFolderMultipleWith(U8char) - val getError_ = "getError_"( + val getError_ = "NFD_GetError_"( const_char_ptr, entrypoint = "NFD_GetError", javadoc = { @@ -609,11 +609,11 @@ fun main() { ) } ) - typeSpecBuilder.addMethod(getError_.toBuilder().setName("getError").returns(String::class.java).build()) + typeSpecBuilder.addMethod(getError_.toBuilder().setName("NFD_GetError").returns(String::class.java).build()) - "clearError"(void, entrypoint = "NFD_ClearError", javadoc = { add("Clear the error.") }) + "NFD_ClearError"(void, entrypoint = "NFD_ClearError", javadoc = { add("Clear the error.") }) - val pathSetGetCount = "pathSetGetCount"( + val pathSetGetCount = "NFD_PathSet_GetCount"( nfdresult_t, const_nfdpathset_t_ptr("pathSet"), nfdpathsetsize_t_ptr("count"), @@ -638,7 +638,7 @@ fun main() { ) fun pathSetGetPath(variant: CharVariant, pathType: String) { - val spec = "pathSetGetPath${variant.uppercaseName}"( + val spec = "NFD_PathSet_GetPath${variant.uppercaseName}"( nfdresult_t, const_nfdpathset_t_ptr("pathSet"), nfdpathsetsize_t("index"), @@ -649,30 +649,30 @@ fun main() { """ Get the $pathType path at offset index.

- It is the caller's responsibility to free `outPath` via {@link #pathSetFreePath${variant.uppercaseName}} if this function + It is the caller's responsibility to free `outPath` via {@link #NFD_PathSet_FreePath${variant.uppercaseName}} if this function returns NFD_OKAY. """.trimIndent() ) } ) - provideOverload(variant, spec, "pathSetGetPath") + provideOverload(variant, spec, "NFD_PathSet_GetPath") } pathSetGetPath(Nchar, "native") pathSetGetPath(U8char, "UTF-8") fun pathSetFreePath(variant: CharVariant) { - val spec = "pathSetFreePath${variant.uppercaseName}"( + val spec = "NFD_PathSet_FreePath${variant.uppercaseName}"( void, variant.const_nfdchar_t_ptr("filePath"), entrypoint = "NFD_PathSet_FreePath${variant.uppercaseName}", - javadoc = { add("Free the path gotten by {@link #pathSetGetPath${variant.uppercaseName}}.") } + javadoc = { add("Free the path gotten by {@link #NFD_PathSet_GetPath${variant.uppercaseName}}.") } ) - provideOverload(variant, spec, "pathSetFreePath") + provideOverload(variant, spec, "NFD_PathSet_FreePath") } pathSetFreePath(Nchar) pathSetFreePath(U8char) - "pathSetGetEnum"( + "NFD_PathSet_GetEnum"( nfdresult_t, const_nfdpathset_t_ptr("pathSet"), nfdpathsetenum_t_ptr("outEnumerator"), @@ -682,13 +682,13 @@ fun main() { """ Gets an enumerator of the path set.

- It is the caller's responsibility to free {@code enumerator} via {@link #pathSetFreeEnum} + It is the caller's responsibility to free {@code enumerator} via {@link #NFD_PathSet_FreeEnum} if this function returns NFD_OKAY, and it should be freed before freeing the pathset. """.trimIndent() ) } ) - "pathSetFreeEnum"( + "NFD_PathSet_FreeEnum"( void, nfdpathsetenum_t_ptr("enumerator"), entrypoint = "NFD_PathSet_FreeEnum", @@ -696,7 +696,7 @@ fun main() { ) fun pathSetEnumNext(variant: CharVariant) { - val spec = "pathSetEnumNext${variant.uppercaseName}"( + val spec = "NFD_PathSet_EnumNext${variant.uppercaseName}"( nfdresult_t, nfdpathsetenum_t_ptr("enumerator"), variant.nfdchar_t_ptr_ptr("outPath"), @@ -707,18 +707,18 @@ fun main() { Gets the next item from the path set enumerator.

If there are no more items, then *outPaths will be set to null. - It is the caller's responsibility to free {@code *outPath} via {@link #pathSetFreePath${variant.uppercaseName}} + It is the caller's responsibility to free {@code *outPath} via {@link #NFD_PathSet_FreePath${variant.uppercaseName}} if this function returns NFD_OKAY and {@code *outPath} is not null. """.trimIndent() ) } ) - provideOverload(variant, spec, "pathSetEnumNext") + provideOverload(variant, spec, "NFD_PathSet_EnumNext") } pathSetEnumNext(Nchar) pathSetEnumNext(U8char) - "pathSetFree"( + "NFD_PathSet_Free"( void, const_nfdpathset_t_ptr("pathSet"), entrypoint = "NFD_PathSet_Free", @@ -758,6 +758,8 @@ fun main() { ) } + //region custom overloads + val nfdCharset = ", NFDInternal.nfdCharset" val StringArray = ArrayTypeName.of(String::class.java) @@ -781,8 +783,8 @@ fun main() { } fun openDialog(variant: CharVariant, charset: String) { - val spec = MethodSpec.methodBuilder("openDialog${variant.uppercaseName}") - .addJavadoc("Overloads {@link #openDialog${variant.uppercaseName}(MemorySegment, MemorySegment, int, MemorySegment)}") + val spec = MethodSpec.methodBuilder("NFD_OpenDialog${variant.uppercaseName}") + .addJavadoc("Overloads {@link #NFD_OpenDialog${variant.uppercaseName}(MemorySegment, MemorySegment, int, MemorySegment)}") .addModifiers(Modifier.PUBLIC, Modifier.STATIC) .returns(TypeName.INT) .addParameter(StringArray, "outPath") @@ -791,17 +793,17 @@ fun main() { .beginControlFlow("try (MemoryStack stack = MemoryStack.pushLocal())") .addStatement("var seg = Marshal.marshal(stack, outPath$1L)", charset) .addStatement( - "int result = openDialog${variant.uppercaseName}(seg, Marshal.marshal(filterList), filterItemCount(filterList), Marshal.marshal(stack, defaultPath$1L))", + "int result = NFD_OpenDialog${variant.uppercaseName}(seg, Marshal.marshal(filterList), filterItemCount(filterList), Marshal.marshal(stack, defaultPath$1L))", charset ) - .beginControlFlow("if (result == OKAY)") + .beginControlFlow("if (result == NFD_OKAY)") .addStatement("copyOutPath${variant.uppercaseName}(seg, outPath)") .endControlFlow() .addStatement("return result") .endControlFlow() .build() codeBuilder.add("$1L", spec) - provideOverload(variant, spec, "openDialog") + provideOverload(variant, spec, "NFD_OpenDialog") } openDialog(Nchar, nfdCharset) openDialog(U8char, "") @@ -809,16 +811,16 @@ fun main() { fun openDialogWith(variant: CharVariant, charset: String) { codeBuilder.add( "$1L", - MethodSpec.methodBuilder("openDialog${variant.uppercaseName}With") - .addJavadoc("Overloads {@link #openDialog${variant.uppercaseName}With(MemorySegment, MemorySegment)}") + MethodSpec.methodBuilder("NFD_OpenDialog${variant.uppercaseName}_With") + .addJavadoc("Overloads {@link #NFD_OpenDialog${variant.uppercaseName}_With(MemorySegment, MemorySegment)}") .addModifiers(Modifier.PUBLIC, Modifier.STATIC) .returns(TypeName.INT) .addParameter(StringArray, "outPath") .addParameter(ClassName.get("overrungl.nfd", "NFDOpenDialog${variant.uppercaseName}Args"), "args") .beginControlFlow("try (MemoryStack stack = MemoryStack.pushLocal())") .addStatement("var seg = Marshal.marshal(stack, outPath$1L)", charset) - .addStatement("int result = openDialog${variant.uppercaseName}With(seg, Marshal.marshal(args))") - .beginControlFlow("if (result == OKAY)") + .addStatement("int result = NFD_OpenDialog${variant.uppercaseName}_With(seg, Marshal.marshal(args))") + .beginControlFlow("if (result == NFD_OKAY)") .addStatement("copyOutPath${variant.uppercaseName}(seg, outPath)") .endControlFlow() .addStatement("return result") @@ -830,8 +832,8 @@ fun main() { openDialogWith(U8char, "") fun openDialogMultiple(variant: CharVariant, charset: String) { - val spec = MethodSpec.methodBuilder("openDialogMultiple${variant.uppercaseName}") - .addJavadoc("Overloads {@link #openDialogMultiple${variant.uppercaseName}(MemorySegment, MemorySegment, int, MemorySegment)}") + val spec = MethodSpec.methodBuilder("NFD_OpenDialogMultiple${variant.uppercaseName}") + .addJavadoc("Overloads {@link #NFD_OpenDialogMultiple${variant.uppercaseName}(MemorySegment, MemorySegment, int, MemorySegment)}") .addModifiers(Modifier.PUBLIC, Modifier.STATIC) .returns(TypeName.INT) .addParameter(MemorySegment_, "outPaths") @@ -839,13 +841,13 @@ fun main() { .addParameter(String::class.java, "defaultPath") .beginControlFlow("try (MemoryStack stack = MemoryStack.pushLocal())") .addStatement( - "return openDialogMultiple${variant.uppercaseName}(outPaths, Marshal.marshal(filterList), filterItemCount(filterList), Marshal.marshal(stack, defaultPath$1L))", + "return NFD_OpenDialogMultiple${variant.uppercaseName}(outPaths, Marshal.marshal(filterList), filterItemCount(filterList), Marshal.marshal(stack, defaultPath$1L))", charset ) .endControlFlow() .build() codeBuilder.add("$1L", spec) - provideOverload(variant, spec, "openDialogMultiple") + provideOverload(variant, spec, "NFD_OpenDialogMultiple") } openDialogMultiple(Nchar, nfdCharset) openDialogMultiple(U8char, "") @@ -853,13 +855,13 @@ fun main() { fun openDialogMultipleWith(variant: CharVariant) { codeBuilder.add( "$1L", - MethodSpec.methodBuilder("openDialogMultiple${variant.uppercaseName}With") - .addJavadoc("Overloads {@link #openDialogMultiple${variant.uppercaseName}With(MemorySegment, MemorySegment)}") + MethodSpec.methodBuilder("NFD_OpenDialogMultiple${variant.uppercaseName}_With") + .addJavadoc("Overloads {@link #NFD_OpenDialogMultiple${variant.uppercaseName}_With(MemorySegment, MemorySegment)}") .addModifiers(Modifier.PUBLIC, Modifier.STATIC) .returns(TypeName.INT) .addParameter(MemorySegment_, "outPaths") .addParameter(ClassName.get("overrungl.nfd", "NFDOpenDialog${variant.uppercaseName}Args"), "args") - .addStatement("return openDialogMultiple${variant.uppercaseName}With(outPaths, Marshal.marshal(args))") + .addStatement("return NFD_OpenDialogMultiple${variant.uppercaseName}_With(outPaths, Marshal.marshal(args))") .build() ) } @@ -868,8 +870,8 @@ fun main() { fun saveDialog(variant: CharVariant, charset: String) { - val spec = MethodSpec.methodBuilder("saveDialog${variant.uppercaseName}") - .addJavadoc("Overloads {@link #saveDialog${variant.uppercaseName}(MemorySegment, MemorySegment, int, MemorySegment, MemorySegment)}") + val spec = MethodSpec.methodBuilder("NFD_SaveDialog${variant.uppercaseName}") + .addJavadoc("Overloads {@link #NFD_SaveDialog${variant.uppercaseName}(MemorySegment, MemorySegment, int, MemorySegment, MemorySegment)}") .addModifiers(Modifier.PUBLIC, Modifier.STATIC) .returns(TypeName.INT) .addParameter(StringArray, "outPath") @@ -879,17 +881,17 @@ fun main() { .beginControlFlow("try (MemoryStack stack = MemoryStack.pushLocal())") .addStatement("var seg = Marshal.marshal(stack, outPath$1L)", charset) .addStatement( - "int result = saveDialog${variant.uppercaseName}(seg, Marshal.marshal(filterList), filterItemCount(filterList), Marshal.marshal(stack, defaultPath$1L), Marshal.marshal(stack, defaultName$1L))", + "int result = NFD_SaveDialog${variant.uppercaseName}(seg, Marshal.marshal(filterList), filterItemCount(filterList), Marshal.marshal(stack, defaultPath$1L), Marshal.marshal(stack, defaultName$1L))", charset ) - .beginControlFlow("if (result == OKAY)") + .beginControlFlow("if (result == NFD_OKAY)") .addStatement("copyOutPath${variant.uppercaseName}(seg, outPath)") .endControlFlow() .addStatement("return result") .endControlFlow() .build() codeBuilder.add("$1L", spec) - provideOverload(variant, spec, "saveDialog") + provideOverload(variant, spec, "NFD_SaveDialog") } saveDialog(Nchar, nfdCharset) saveDialog(U8char, "") @@ -897,16 +899,16 @@ fun main() { fun saveDialogWith(variant: CharVariant, charset: String) { codeBuilder.add( "$1L", - MethodSpec.methodBuilder("saveDialog${variant.uppercaseName}With") - .addJavadoc("Overloads {@link #saveDialog${variant.uppercaseName}With(MemorySegment, MemorySegment)}") + MethodSpec.methodBuilder("NFD_SaveDialog${variant.uppercaseName}_With") + .addJavadoc("Overloads {@link #NFD_SaveDialog${variant.uppercaseName}_With(MemorySegment, MemorySegment)}") .addModifiers(Modifier.PUBLIC, Modifier.STATIC) .returns(TypeName.INT) .addParameter(StringArray, "outPath") .addParameter(ClassName.get("overrungl.nfd", "NFDSaveDialog${variant.uppercaseName}Args"), "args") .beginControlFlow("try (MemoryStack stack = MemoryStack.pushLocal())") .addStatement("var seg = Marshal.marshal(stack, outPath$1L)", charset) - .addStatement("int result = saveDialog${variant.uppercaseName}With(seg, Marshal.marshal(args))") - .beginControlFlow("if (result == OKAY)") + .addStatement("int result = NFD_SaveDialog${variant.uppercaseName}_With(seg, Marshal.marshal(args))") + .beginControlFlow("if (result == NFD_OKAY)") .addStatement("copyOutPath${variant.uppercaseName}(seg, outPath)") .endControlFlow() .addStatement("return result") @@ -919,8 +921,8 @@ fun main() { fun pickFolder(variant: CharVariant, charset: String) { - val spec = MethodSpec.methodBuilder("pickFolder${variant.uppercaseName}") - .addJavadoc("Overloads {@link #pickFolder${variant.uppercaseName}(MemorySegment, MemorySegment)}") + val spec = MethodSpec.methodBuilder("NFD_PickFolder${variant.uppercaseName}") + .addJavadoc("Overloads {@link #NFD_PickFolder${variant.uppercaseName}(MemorySegment, MemorySegment)}") .addModifiers(Modifier.PUBLIC, Modifier.STATIC) .returns(TypeName.INT) .addParameter(StringArray, "outPath") @@ -928,17 +930,17 @@ fun main() { .beginControlFlow("try (MemoryStack stack = MemoryStack.pushLocal())") .addStatement("var seg = Marshal.marshal(stack, outPath$1L)", charset) .addStatement( - "int result = pickFolder${variant.uppercaseName}(seg, Marshal.marshal(stack, defaultPath$1L))", + "int result = NFD_PickFolder${variant.uppercaseName}(seg, Marshal.marshal(stack, defaultPath$1L))", charset ) - .beginControlFlow("if (result == OKAY)") + .beginControlFlow("if (result == NFD_OKAY)") .addStatement("copyOutPath${variant.uppercaseName}(seg, outPath)") .endControlFlow() .addStatement("return result") .endControlFlow() .build() codeBuilder.add("$1L", spec) - provideOverload(variant, spec, "pickFolder") + provideOverload(variant, spec, "NFD_PickFolder") } pickFolder(Nchar, nfdCharset) pickFolder(U8char, "") @@ -946,16 +948,16 @@ fun main() { fun pickFolderWith(variant: CharVariant, charset: String) { codeBuilder.add( "$1L", - MethodSpec.methodBuilder("pickFolder${variant.uppercaseName}With") - .addJavadoc("Overloads {@link #pickFolder${variant.uppercaseName}With(MemorySegment, MemorySegment)}") + MethodSpec.methodBuilder("NFD_PickFolder${variant.uppercaseName}_With") + .addJavadoc("Overloads {@link #NFD_PickFolder${variant.uppercaseName}_With(MemorySegment, MemorySegment)}") .addModifiers(Modifier.PUBLIC, Modifier.STATIC) .returns(TypeName.INT) .addParameter(StringArray, "outPath") .addParameter(ClassName.get("overrungl.nfd", "NFDPickFolder${variant.uppercaseName}Args"), "args") .beginControlFlow("try (MemoryStack stack = MemoryStack.pushLocal())") .addStatement("var seg = Marshal.marshal(stack, outPath$1L)", charset) - .addStatement("int result = pickFolder${variant.uppercaseName}With(seg, Marshal.marshal(args))") - .beginControlFlow("if (result == OKAY)") + .addStatement("int result = NFD_PickFolder${variant.uppercaseName}_With(seg, Marshal.marshal(args))") + .beginControlFlow("if (result == NFD_OKAY)") .addStatement("copyOutPath${variant.uppercaseName}(seg, outPath)") .endControlFlow() .addStatement("return result") @@ -967,21 +969,21 @@ fun main() { pickFolderWith(U8char, "") fun pickFolderMultiple(variant: CharVariant, charset: String) { - val spec = MethodSpec.methodBuilder("pickFolderMultiple${variant.uppercaseName}") - .addJavadoc("Overloads {@link #pickFolderMultiple${variant.uppercaseName}(MemorySegment, MemorySegment)}") + val spec = MethodSpec.methodBuilder("NFD_PickFolderMultiple${variant.uppercaseName}") + .addJavadoc("Overloads {@link #NFD_PickFolderMultiple${variant.uppercaseName}(MemorySegment, MemorySegment)}") .addModifiers(Modifier.PUBLIC, Modifier.STATIC) .returns(TypeName.INT) .addParameter(MemorySegment_, "outPaths") .addParameter(String::class.java, "defaultPath") .beginControlFlow("try (MemoryStack stack = MemoryStack.pushLocal())") .addStatement( - "return pickFolderMultiple${variant.uppercaseName}(outPaths, Marshal.marshal(stack, defaultPath$1L))", + "return NFD_PickFolderMultiple${variant.uppercaseName}(outPaths, Marshal.marshal(stack, defaultPath$1L))", charset ) .endControlFlow() .build() codeBuilder.add("$1L", spec) - provideOverload(variant, spec, "pickFolderMultiple") + provideOverload(variant, spec, "NFD_PickFolderMultiple") } pickFolderMultiple(Nchar, nfdCharset) pickFolderMultiple(U8char, "") @@ -989,13 +991,13 @@ fun main() { fun pickFolderMultipleWith(variant: CharVariant) { codeBuilder.add( "$1L", - MethodSpec.methodBuilder("pickFolderMultiple${variant.uppercaseName}With") - .addJavadoc("Overloads {@link #pickFolderMultiple${variant.uppercaseName}With(MemorySegment, MemorySegment)}") + MethodSpec.methodBuilder("NFD_PickFolderMultiple${variant.uppercaseName}_With") + .addJavadoc("Overloads {@link #NFD_PickFolderMultiple${variant.uppercaseName}_With(MemorySegment, MemorySegment)}") .addModifiers(Modifier.PUBLIC, Modifier.STATIC) .returns(TypeName.INT) .addParameter(MemorySegment_, "outPaths") .addParameter(ClassName.get("overrungl.nfd", "NFDPickFolder${variant.uppercaseName}Args"), "args") - .addStatement("return pickFolderMultiple${variant.uppercaseName}With(outPaths, Marshal.marshal(args))") + .addStatement("return NFD_PickFolderMultiple${variant.uppercaseName}_With(outPaths, Marshal.marshal(args))") .build() ) } @@ -1004,8 +1006,8 @@ fun main() { fun pathSetGetPath(variant: CharVariant, charset: String) { - val spec = MethodSpec.methodBuilder("pathSetGetPath${variant.uppercaseName}") - .addJavadoc("Overloads {@link #pathSetGetPath${variant.uppercaseName}(MemorySegment, long, MemorySegment)}") + val spec = MethodSpec.methodBuilder("NFD_PathSet_GetPath${variant.uppercaseName}") + .addJavadoc("Overloads {@link #NFD_PathSet_GetPath${variant.uppercaseName}(MemorySegment, long, MemorySegment)}") .addModifiers(Modifier.PUBLIC, Modifier.STATIC) .returns(TypeName.INT) .addParameter(MemorySegment_, "pathSet") @@ -1013,41 +1015,43 @@ fun main() { .addParameter(StringArray, "outPath") .beginControlFlow("try (MemoryStack stack = MemoryStack.pushLocal())") .addStatement("var seg = Marshal.marshal(stack, outPath$1L)", charset) - .addStatement("int result = pathSetGetPath${variant.uppercaseName}(pathSet, index, seg)") - .beginControlFlow("if (result == OKAY)") + .addStatement("int result = NFD_PathSet_GetPath${variant.uppercaseName}(pathSet, index, seg)") + .beginControlFlow("if (result == NFD_OKAY)") .addStatement("copyPathSetOutPath${variant.uppercaseName}(seg, outPath)") .endControlFlow() .addStatement("return result") .endControlFlow() .build() codeBuilder.add("$1L", spec) - provideOverload(variant, spec, "pathSetGetPath") + provideOverload(variant, spec, "NFD_PathSet_GetPath") } pathSetGetPath(Nchar, nfdCharset) pathSetGetPath(U8char, "") fun pathSetEnumNext(variant: CharVariant, charset: String) { - val spec = MethodSpec.methodBuilder("pathSetEnumNext${variant.uppercaseName}") - .addJavadoc("Overloads {@link #pathSetEnumNext${variant.uppercaseName}(MemorySegment, MemorySegment)}") + val spec = MethodSpec.methodBuilder("NFD_PathSet_EnumNext${variant.uppercaseName}") + .addJavadoc("Overloads {@link #NFD_PathSet_EnumNext${variant.uppercaseName}(MemorySegment, MemorySegment)}") .addModifiers(Modifier.PUBLIC, Modifier.STATIC) .returns(TypeName.INT) .addParameter(MemorySegment_, "enumerator") .addParameter(StringArray, "outPath") .beginControlFlow("try (MemoryStack stack = MemoryStack.pushLocal())") .addStatement("var seg = Marshal.marshal(stack, outPath$1L)", charset) - .addStatement("int result = pathSetEnumNext${variant.uppercaseName}(enumerator, seg)") - .beginControlFlow("if (result == OKAY)") + .addStatement("int result = NFD_PathSet_EnumNext${variant.uppercaseName}(enumerator, seg)") + .beginControlFlow("if (result == NFD_OKAY)") .addStatement("copyPathSetOutPath${variant.uppercaseName}(seg, outPath)") .endControlFlow() .addStatement("return result") .endControlFlow() .build() codeBuilder.add("$1L", spec) - provideOverload(variant, spec, "pathSetEnumNext") + provideOverload(variant, spec, "NFD_PathSet_EnumNext") } pathSetEnumNext(Nchar, nfdCharset) pathSetEnumNext(U8char, "") + //endregion + Files.writeString( path, "${split[0]}$GENERATOR_BEGIN\n${ diff --git a/generators/stb/build.gradle.kts b/generators/stb/build.gradle.kts new file mode 100644 index 00000000..51c20960 --- /dev/null +++ b/generators/stb/build.gradle.kts @@ -0,0 +1,9 @@ +plugins { + id("generator.conventions") +} + +dependencies { + implementation(project(":generators")) +} + +registerGenerateTask("overrungl.stb.STBGeneratorKt", ":stb") diff --git a/generators/stb/src/main/kotlin/overrungl/stb/STBGenerator.kt b/generators/stb/src/main/kotlin/overrungl/stb/STBGenerator.kt new file mode 100644 index 00000000..fb988997 --- /dev/null +++ b/generators/stb/src/main/kotlin/overrungl/stb/STBGenerator.kt @@ -0,0 +1,20 @@ +/* + * MIT License + * + * Copyright (c) 2024 Overrun Organization + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + */ + +package overrungl.stb + +fun main() { +} diff --git a/modules/overrungl.nfd/src/main/java/overrungl/nfd/CNFD.java b/modules/overrungl.nfd/src/main/java/overrungl/nfd/CNFD.java index 7ed9f387..e6c6f046 100644 --- a/modules/overrungl.nfd/src/main/java/overrungl/nfd/CNFD.java +++ b/modules/overrungl.nfd/src/main/java/overrungl/nfd/CNFD.java @@ -30,69 +30,69 @@ public interface CNFD extends DirectAccess { /** * Programmatic error */ - int ERROR = 0; + int NFD_ERROR = 0; /** * User pressed okay, or successful return */ - int OKAY = 1; + int NFD_OKAY = 1; /** * User pressed cancel */ - int CANCEL = 2; + int NFD_CANCEL = 2; /** * The native window handle type. */ - int WINDOW_HANDLE_TYPE_UNSET = 0; + int NFD_WINDOW_HANDLE_TYPE_UNSET = 0; /** * Windows: handle is HWND (the Windows API typedefs this to void*) */ - int WINDOW_HANDLE_TYPE_WINDOWS = 1; + int NFD_WINDOW_HANDLE_TYPE_WINDOWS = 1; /** * Cocoa: handle is NSWindow* */ - int WINDOW_HANDLE_TYPE_COCOA = 2; + int NFD_WINDOW_HANDLE_TYPE_COCOA = 2; /** * X11: handle is Window */ - int WINDOW_HANDLE_TYPE_X11 = 3; + int NFD_WINDOW_HANDLE_TYPE_X11 = 3; /** * This is a unique identifier tagged to all the NFD_*With() function calls, for backward * compatibility purposes.

There is usually no need to use this directly, unless you want to use * NFD differently depending on the version you're building with. */ - int INTERFACE_VERSION = 1; + int NFD_INTERFACE_VERSION = 1; /** * Free a file path that was returned by the dialogs. *

- * Note: use {@link #pathSetFreePathN} to free path from pathset instead of this function. + * Note: use {@link #NFD_PathSet_FreePathN} to free path from pathset instead of this function. */ @Entrypoint("NFD_FreePathN") - void freePathN(@CType("nfdnchar_t*") MemorySegment filePath); + void NFD_FreePathN(@CType("nfdnchar_t*") MemorySegment filePath); /** - * Overloads {@link #freePathN(java.lang.foreign.MemorySegment)} + * Overloads {@link #NFD_FreePathN(java.lang.foreign.MemorySegment)} */ @Entrypoint("NFD_FreePathN") @Skip - default void freePath(@CType("nfdnchar_t*") MemorySegment filePath) { - this.freePathN(filePath); + default void NFD_FreePath(@CType("nfdnchar_t*") MemorySegment filePath) { + this.NFD_FreePathN(filePath); } /** * Free a file path that was returned by the dialogs. *

- * Note: use {@link #pathSetFreePathU8} to free path from pathset instead of this function. + * Note: use {@link #NFD_PathSet_FreePathU8} to free path from pathset instead of this function. */ @Entrypoint("NFD_FreePathU8") - void freePathU8(@CType("nfdu8char_t*") MemorySegment filePath); + void NFD_FreePathU8(@CType("nfdu8char_t*") MemorySegment filePath); /** * Initialize NFD. Call this for every thread that might use NFD, before calling any other NFD @@ -100,456 +100,456 @@ default void freePath(@CType("nfdnchar_t*") MemorySegment filePath) { */ @CType("nfdresult_t") @Entrypoint("NFD_Init") - int init(); + int NFD_Init(); /** - * Call this to de-initialize NFD, if {@link #init()} returned NFD_OKAY. + * Call this to de-initialize NFD, if {@link #NFD_Init()} returned NFD_OKAY. */ @Entrypoint("NFD_Quit") - void quit(); + void NFD_Quit(); /** * Single file open dialog *

- * It's the caller's responsibility to free {@code outPath} via {@link #freePathN} if this function returns + * It's the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathN} if this function returns * NFD_OKAY. * @param filterCount If zero, filterList is ignored (you can use null). * @param defaultPath If null, the operating system will decide. */ @CType("nfdresult_t") @Entrypoint("NFD_OpenDialogN") - int openDialogN(@CType("nfdnchar_t**") MemorySegment outPath, + int NFD_OpenDialogN(@CType("nfdnchar_t**") MemorySegment outPath, @CType("const nfdnfilteritem_t*") MemorySegment filterList, @CType("nfdfiltersize_t") int filterCount, @CType("const nfdnchar_t*") MemorySegment defaultPath); /** - * Overloads {@link #openDialogN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, int, java.lang.foreign.MemorySegment)} + * Overloads {@link #NFD_OpenDialogN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, int, java.lang.foreign.MemorySegment)} * @param filterCount If zero, filterList is ignored (you can use null). * @param defaultPath If null, the operating system will decide. */ @CType("nfdresult_t") @Entrypoint("NFD_OpenDialogN") @Skip - default int openDialog(@CType("nfdnchar_t**") MemorySegment outPath, + default int NFD_OpenDialog(@CType("nfdnchar_t**") MemorySegment outPath, @CType("const nfdnfilteritem_t*") MemorySegment filterList, @CType("nfdfiltersize_t") int filterCount, @CType("const nfdnchar_t*") MemorySegment defaultPath) { - return this.openDialogN(outPath, filterList, filterCount, defaultPath); + return this.NFD_OpenDialogN(outPath, filterList, filterCount, defaultPath); } /** * Single file open dialog *

- * It's the caller's responsibility to free {@code outPath} via {@link #freePathU8} if this function returns + * It's the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathU8} if this function returns * NFD_OKAY. * @param filterCount If zero, filterList is ignored (you can use null). * @param defaultPath If null, the operating system will decide. */ @CType("nfdresult_t") @Entrypoint("NFD_OpenDialogU8") - int openDialogU8(@CType("nfdu8char_t**") MemorySegment outPath, + int NFD_OpenDialogU8(@CType("nfdu8char_t**") MemorySegment outPath, @CType("const nfdu8filteritem_t*") MemorySegment filterList, @CType("nfdfiltersize_t") int filterCount, @CType("const nfdu8char_t*") MemorySegment defaultPath); /** - * This function is a library implementation detail. Please use {@link #openDialogNWith} instead. + * This function is a library implementation detail. Please use {@link #NFD_OpenDialogN_With} instead. */ @CType("nfdresult_t") @Entrypoint("NFD_OpenDialogN_With_Impl") - int openDialogNWithImpl(@CType("nfdversion_t") long version, + int NFD_OpenDialogN_With_Impl(@CType("nfdversion_t") long version, @CType("nfdnchar_t**") MemorySegment outPath, @CType("const nfdopendialognargs_t*") MemorySegment args); /** * Single file open dialog, with additional parameters. *

- * It is the caller's responsibility to free {@code outPath} via {@link #freePathN} if this function + * It is the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathN} if this function * returns NFD_OKAY. See documentation of {@link NFDOpenDialogNArgs} for details. */ @CType("nfdresult_t") @Entrypoint("NFD_OpenDialogN_With") @Skip - default int openDialogNWith(@CType("nfdnchar_t**") MemorySegment outPath, + default int NFD_OpenDialogN_With(@CType("nfdnchar_t**") MemorySegment outPath, @CType("const nfdopendialognargs_t*") MemorySegment args) { - return openDialogNWithImpl(INTERFACE_VERSION, outPath, args); + return NFD_OpenDialogN_With_Impl(NFD_INTERFACE_VERSION, outPath, args); } /** - * This function is a library implementation detail. Please use {@link #openDialogU8With} instead. + * This function is a library implementation detail. Please use {@link #NFD_OpenDialogU8_With} instead. */ @CType("nfdresult_t") @Entrypoint("NFD_OpenDialogU8_With_Impl") - int openDialogU8WithImpl(@CType("nfdversion_t") long version, + int NFD_OpenDialogU8_With_Impl(@CType("nfdversion_t") long version, @CType("nfdu8char_t**") MemorySegment outPath, @CType("const nfdopendialogu8args_t*") MemorySegment args); /** * Single file open dialog, with additional parameters. *

- * It is the caller's responsibility to free {@code outPath} via {@link #freePathU8} if this function + * It is the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathU8} if this function * returns NFD_OKAY. See documentation of {@link NFDOpenDialogU8Args} for details. */ @CType("nfdresult_t") @Entrypoint("NFD_OpenDialogU8_With") @Skip - default int openDialogU8With(@CType("nfdu8char_t**") MemorySegment outPath, + default int NFD_OpenDialogU8_With(@CType("nfdu8char_t**") MemorySegment outPath, @CType("const nfdopendialogu8args_t*") MemorySegment args) { - return openDialogU8WithImpl(INTERFACE_VERSION, outPath, args); + return NFD_OpenDialogU8_With_Impl(NFD_INTERFACE_VERSION, outPath, args); } /** * Multiple file open dialog *

- * It is the caller's responsibility to free {@code outPaths} via {@link #pathSetFree} if this function + * It is the caller's responsibility to free {@code outPaths} via {@link #NFD_PathSet_Free} if this function * returns NFD_OKAY. * @param filterCount If zero, filterList is ignored (you can use null). * @param defaultPath If null, the operating system will decide. */ @CType("nfdresult_t") @Entrypoint("NFD_OpenDialogMultipleN") - int openDialogMultipleN(@CType("const nfdpathset_t**") MemorySegment outPaths, + int NFD_OpenDialogMultipleN(@CType("const nfdpathset_t**") MemorySegment outPaths, @CType("const nfdnfilteritem_t*") MemorySegment filterList, @CType("nfdfiltersize_t") int filterCount, @CType("const nfdnchar_t*") MemorySegment defaultPath); /** - * Overloads {@link #openDialogMultipleN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, int, java.lang.foreign.MemorySegment)} + * Overloads {@link #NFD_OpenDialogMultipleN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, int, java.lang.foreign.MemorySegment)} * @param filterCount If zero, filterList is ignored (you can use null). * @param defaultPath If null, the operating system will decide. */ @CType("nfdresult_t") @Entrypoint("NFD_OpenDialogMultipleN") @Skip - default int openDialogMultiple(@CType("const nfdpathset_t**") MemorySegment outPaths, + default int NFD_OpenDialogMultiple(@CType("const nfdpathset_t**") MemorySegment outPaths, @CType("const nfdnfilteritem_t*") MemorySegment filterList, @CType("nfdfiltersize_t") int filterCount, @CType("const nfdnchar_t*") MemorySegment defaultPath) { - return this.openDialogMultipleN(outPaths, filterList, filterCount, defaultPath); + return this.NFD_OpenDialogMultipleN(outPaths, filterList, filterCount, defaultPath); } /** * Multiple file open dialog *

- * It is the caller's responsibility to free {@code outPaths} via {@link #pathSetFree} if this function + * It is the caller's responsibility to free {@code outPaths} via {@link #NFD_PathSet_Free} if this function * returns NFD_OKAY. * @param filterCount If zero, filterList is ignored (you can use null). * @param defaultPath If null, the operating system will decide. */ @CType("nfdresult_t") @Entrypoint("NFD_OpenDialogMultipleU8") - int openDialogMultipleU8(@CType("const nfdpathset_t**") MemorySegment outPaths, + int NFD_OpenDialogMultipleU8(@CType("const nfdpathset_t**") MemorySegment outPaths, @CType("const nfdu8filteritem_t*") MemorySegment filterList, @CType("nfdfiltersize_t") int filterCount, @CType("const nfdu8char_t*") MemorySegment defaultPath); /** - * This function is a library implementation detail. Please use {@link #openDialogMultipleNWith} + * This function is a library implementation detail. Please use {@link #NFD_OpenDialogMultipleN_With} * instead. */ @CType("nfdresult_t") @Entrypoint("NFD_OpenDialogMultipleN_With_Impl") - int openDialogMultipleNWithImpl(@CType("nfdversion_t") long version, + int NFD_OpenDialogMultipleN_With_Impl(@CType("nfdversion_t") long version, @CType("const nfdpathset_t**") MemorySegment outPaths, @CType("const nfdopendialognargs_t*") MemorySegment args); /** * Multiple file open dialog, with additional parameters. *

- * It is the caller's responsibility to free {@code outPaths} via {@link #pathSetFree} if this function + * It is the caller's responsibility to free {@code outPaths} via {@link #NFD_PathSet_Free} if this function * returns NFD_OKAY. See documentation of {@link NFDOpenDialogNArgs} for details. */ @CType("nfdresult_t") @Entrypoint("NFD_OpenDialogMultipleN_With") @Skip - default int openDialogMultipleNWith(@CType("const nfdpathset_t**") MemorySegment outPaths, + default int NFD_OpenDialogMultipleN_With(@CType("const nfdpathset_t**") MemorySegment outPaths, @CType("const nfdopendialognargs_t*") MemorySegment args) { - return openDialogMultipleNWithImpl(INTERFACE_VERSION, outPaths, args); + return NFD_OpenDialogMultipleN_With_Impl(NFD_INTERFACE_VERSION, outPaths, args); } /** - * This function is a library implementation detail. Please use {@link #openDialogMultipleU8With} + * This function is a library implementation detail. Please use {@link #NFD_OpenDialogMultipleU8_With} * instead. */ @CType("nfdresult_t") @Entrypoint("NFD_OpenDialogMultipleU8_With_Impl") - int openDialogMultipleU8WithImpl(@CType("nfdversion_t") long version, + int NFD_OpenDialogMultipleU8_With_Impl(@CType("nfdversion_t") long version, @CType("const nfdpathset_t**") MemorySegment outPaths, @CType("const nfdopendialogu8args_t*") MemorySegment args); /** * Multiple file open dialog, with additional parameters. *

- * It is the caller's responsibility to free {@code outPaths} via {@link #pathSetFree} if this function + * It is the caller's responsibility to free {@code outPaths} via {@link #NFD_PathSet_Free} if this function * returns NFD_OKAY. See documentation of {@link NFDOpenDialogU8Args} for details. */ @CType("nfdresult_t") @Entrypoint("NFD_OpenDialogMultipleU8_With") @Skip - default int openDialogMultipleU8With(@CType("const nfdpathset_t**") MemorySegment outPaths, + default int NFD_OpenDialogMultipleU8_With(@CType("const nfdpathset_t**") MemorySegment outPaths, @CType("const nfdopendialogu8args_t*") MemorySegment args) { - return openDialogMultipleU8WithImpl(INTERFACE_VERSION, outPaths, args); + return NFD_OpenDialogMultipleU8_With_Impl(NFD_INTERFACE_VERSION, outPaths, args); } /** * Save dialog *

- * It is the caller's responsibility to free {@code outPath} via {@link #freePathN} if this function returns + * It is the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathN} if this function returns * NFD_OKAY. * @param filterCount If zero, filterList is ignored (you can use null). * @param defaultPath If null, the operating system will decide. */ @CType("nfdresult_t") @Entrypoint("NFD_SaveDialogN") - int saveDialogN(@CType("nfdnchar_t**") MemorySegment outPath, + int NFD_SaveDialogN(@CType("nfdnchar_t**") MemorySegment outPath, @CType("const nfdnfilteritem_t*") MemorySegment filterList, @CType("nfdfiltersize_t") int filterCount, @CType("const nfdnchar_t*") MemorySegment defaultPath, @CType("const nfdnchar_t*") MemorySegment defaultName); /** - * Overloads {@link #saveDialogN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, int, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)} + * Overloads {@link #NFD_SaveDialogN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, int, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)} * @param filterCount If zero, filterList is ignored (you can use null). * @param defaultPath If null, the operating system will decide. */ @CType("nfdresult_t") @Entrypoint("NFD_SaveDialogN") @Skip - default int saveDialog(@CType("nfdnchar_t**") MemorySegment outPath, + default int NFD_SaveDialog(@CType("nfdnchar_t**") MemorySegment outPath, @CType("const nfdnfilteritem_t*") MemorySegment filterList, @CType("nfdfiltersize_t") int filterCount, @CType("const nfdnchar_t*") MemorySegment defaultPath, @CType("const nfdnchar_t*") MemorySegment defaultName) { - return this.saveDialogN(outPath, filterList, filterCount, defaultPath, defaultName); + return this.NFD_SaveDialogN(outPath, filterList, filterCount, defaultPath, defaultName); } /** * Save dialog *

- * It is the caller's responsibility to free {@code outPath} via {@link #freePathU8} if this function returns + * It is the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathU8} if this function returns * NFD_OKAY. * @param filterCount If zero, filterList is ignored (you can use null). * @param defaultPath If null, the operating system will decide. */ @CType("nfdresult_t") @Entrypoint("NFD_SaveDialogU8") - int saveDialogU8(@CType("nfdu8char_t**") MemorySegment outPath, + int NFD_SaveDialogU8(@CType("nfdu8char_t**") MemorySegment outPath, @CType("const nfdu8filteritem_t*") MemorySegment filterList, @CType("nfdfiltersize_t") int filterCount, @CType("const nfdu8char_t*") MemorySegment defaultPath, @CType("const nfdu8char_t*") MemorySegment defaultName); /** - * This function is a library implementation detail. Please use {@link #saveDialogNWith} instead. + * This function is a library implementation detail. Please use {@link #NFD_SaveDialogN_With} instead. */ @CType("nfdresult_t") @Entrypoint("NFD_SaveDialogN_With_Impl") - int saveDialogNWithImpl(@CType("nfdversion_t") long version, + int NFD_SaveDialogN_WithImpl(@CType("nfdversion_t") long version, @CType("nfdnchar_t**") MemorySegment outPath, @CType("const nfdsavedialognargs_t*") MemorySegment args); /** * Single file save dialog, with additional parameters. *

- * It is the caller's responsibility to free {@code outPath} via {@link #freePathN} if this function + * It is the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathN} if this function * returns NFD_OKAY. See documentation of {@link NFDSaveDialogNArgs} for details. */ @CType("nfdresult_t") @Entrypoint("NFD_SaveDialogN_With") @Skip - default int saveDialogNWith(@CType("nfdnchar_t**") MemorySegment outPath, + default int NFD_SaveDialogN_With(@CType("nfdnchar_t**") MemorySegment outPath, @CType("const nfdsavedialognargs_t*") MemorySegment args) { - return saveDialogNWithImpl(INTERFACE_VERSION, outPath, args); + return NFD_SaveDialogN_WithImpl(NFD_INTERFACE_VERSION, outPath, args); } /** - * This function is a library implementation detail. Please use {@link #saveDialogU8With} instead. + * This function is a library implementation detail. Please use {@link #NFD_SaveDialogU8_With} instead. */ @CType("nfdresult_t") @Entrypoint("NFD_SaveDialogU8_With_Impl") - int saveDialogU8WithImpl(@CType("nfdversion_t") long version, + int NFD_SaveDialogU8_WithImpl(@CType("nfdversion_t") long version, @CType("nfdu8char_t**") MemorySegment outPath, @CType("const nfdsavedialogu8args_t*") MemorySegment args); /** * Single file save dialog, with additional parameters. *

- * It is the caller's responsibility to free {@code outPath} via {@link #freePathU8} if this function + * It is the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathU8} if this function * returns NFD_OKAY. See documentation of {@link NFDSaveDialogU8Args} for details. */ @CType("nfdresult_t") @Entrypoint("NFD_SaveDialogU8_With") @Skip - default int saveDialogU8With(@CType("nfdu8char_t**") MemorySegment outPath, + default int NFD_SaveDialogU8_With(@CType("nfdu8char_t**") MemorySegment outPath, @CType("const nfdsavedialogu8args_t*") MemorySegment args) { - return saveDialogU8WithImpl(INTERFACE_VERSION, outPath, args); + return NFD_SaveDialogU8_WithImpl(NFD_INTERFACE_VERSION, outPath, args); } /** * Select single folder dialog *

- * It's the caller's responsibility to free {@code outPath} via {@link #freePathN} if this function returns + * It's the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathN} if this function returns * NFD_OKAY. * @param defaultPath If null, the operating system will decide. */ @CType("nfdresult_t") @Entrypoint("NFD_PickFolderN") - int pickFolderN(@CType("nfdnchar_t**") MemorySegment outPath, + int NFD_PickFolderN(@CType("nfdnchar_t**") MemorySegment outPath, @CType("const nfdnchar_t*") MemorySegment defaultPath); /** - * Overloads {@link #pickFolderN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)} + * Overloads {@link #NFD_PickFolderN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)} * @param defaultPath If null, the operating system will decide. */ @CType("nfdresult_t") @Entrypoint("NFD_PickFolderN") @Skip - default int pickFolder(@CType("nfdnchar_t**") MemorySegment outPath, + default int NFD_PickFolder(@CType("nfdnchar_t**") MemorySegment outPath, @CType("const nfdnchar_t*") MemorySegment defaultPath) { - return this.pickFolderN(outPath, defaultPath); + return this.NFD_PickFolderN(outPath, defaultPath); } /** * Select single folder dialog *

- * It's the caller's responsibility to free {@code outPath} via {@link #freePathU8} if this function returns + * It's the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathU8} if this function returns * NFD_OKAY. * @param defaultPath If null, the operating system will decide. */ @CType("nfdresult_t") @Entrypoint("NFD_PickFolderU8") - int pickFolderU8(@CType("nfdu8char_t**") MemorySegment outPath, + int NFD_PickFolderU8(@CType("nfdu8char_t**") MemorySegment outPath, @CType("const nfdu8char_t*") MemorySegment defaultPath); /** - * This function is a library implementation detail. Please use {@link #pickFolderNWith} instead. + * This function is a library implementation detail. Please use {@link #NFD_PickFolderN_With} instead. */ @CType("nfdresult_t") @Entrypoint("NFD_PickFolderN_With_Impl") - int pickFolderNWithImpl(@CType("nfdversion_t") long version, + int NFD_PickFolderN_With_Impl(@CType("nfdversion_t") long version, @CType("nfdnchar_t**") MemorySegment outPath, @CType("const nfdpickfoldernargs_t*") MemorySegment args); /** * Single file open dialog, with additional parameters. *

- * It is the caller's responsibility to free {@code outPath} via {@link #freePathN} if this function + * It is the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathN} if this function * returns NFD_OKAY. See documentation of {@link NFDPickFolderNArgs} for details. */ @CType("nfdresult_t") @Entrypoint("NFD_PickFolderN_With") @Skip - default int pickFolderNWith(@CType("nfdnchar_t**") MemorySegment outPath, + default int NFD_PickFolderN_With(@CType("nfdnchar_t**") MemorySegment outPath, @CType("const nfdpickfoldernargs_t*") MemorySegment args) { - return pickFolderNWithImpl(INTERFACE_VERSION, outPath, args); + return NFD_PickFolderN_With_Impl(NFD_INTERFACE_VERSION, outPath, args); } /** - * This function is a library implementation detail. Please use {@link #pickFolderU8With} instead. + * This function is a library implementation detail. Please use {@link #NFD_PickFolderU8_With} instead. */ @CType("nfdresult_t") @Entrypoint("NFD_PickFolderU8_With_Impl") - int pickFolderU8WithImpl(@CType("nfdversion_t") long version, + int NFD_PickFolderU8_With_Impl(@CType("nfdversion_t") long version, @CType("nfdu8char_t**") MemorySegment outPath, @CType("const nfdpickfolderu8args_t*") MemorySegment args); /** * Single file open dialog, with additional parameters. *

- * It is the caller's responsibility to free {@code outPath} via {@link #freePathU8} if this function + * It is the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathU8} if this function * returns NFD_OKAY. See documentation of {@link NFDPickFolderU8Args} for details. */ @CType("nfdresult_t") @Entrypoint("NFD_PickFolderU8_With") @Skip - default int pickFolderU8With(@CType("nfdu8char_t**") MemorySegment outPath, + default int NFD_PickFolderU8_With(@CType("nfdu8char_t**") MemorySegment outPath, @CType("const nfdpickfolderu8args_t*") MemorySegment args) { - return pickFolderU8WithImpl(INTERFACE_VERSION, outPath, args); + return NFD_PickFolderU8_With_Impl(NFD_INTERFACE_VERSION, outPath, args); } /** * Select multiple folder dialog *

- * It is the caller's responsibility to free {@code outPaths} via {@link #pathSetFree} if this function + * It is the caller's responsibility to free {@code outPaths} via {@link #NFD_PathSet_Free} if this function * returns NFD_OKAY. * @param defaultPath If null, the operating system will decide. */ @CType("nfdresult_t") @Entrypoint("NFD_PickFolderMultipleN") - int pickFolderMultipleN(@CType("const nfdpathset_t**") MemorySegment outPaths, + int NFD_PickFolderMultipleN(@CType("const nfdpathset_t**") MemorySegment outPaths, @CType("const nfdnchar_t*") MemorySegment defaultPath); /** - * Overloads {@link #pickFolderMultipleN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)} + * Overloads {@link #NFD_PickFolderMultipleN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)} * @param defaultPath If null, the operating system will decide. */ @CType("nfdresult_t") @Entrypoint("NFD_PickFolderMultipleN") @Skip - default int pickFolderMultiple(@CType("const nfdpathset_t**") MemorySegment outPaths, + default int NFD_PickFolderMultiple(@CType("const nfdpathset_t**") MemorySegment outPaths, @CType("const nfdnchar_t*") MemorySegment defaultPath) { - return this.pickFolderMultipleN(outPaths, defaultPath); + return this.NFD_PickFolderMultipleN(outPaths, defaultPath); } /** * Select multiple folder dialog *

- * It is the caller's responsibility to free {@code outPaths} via {@link #pathSetFree} if this function + * It is the caller's responsibility to free {@code outPaths} via {@link #NFD_PathSet_Free} if this function * returns NFD_OKAY. * @param defaultPath If null, the operating system will decide. */ @CType("nfdresult_t") @Entrypoint("NFD_PickFolderMultipleU8") - int pickFolderMultipleU8(@CType("const nfdpathset_t**") MemorySegment outPaths, + int NFD_PickFolderMultipleU8(@CType("const nfdpathset_t**") MemorySegment outPaths, @CType("const nfdu8char_t*") MemorySegment defaultPath); /** - * This function is a library implementation detail. Please use {@link #pickFolderMultipleNWith} + * This function is a library implementation detail. Please use {@link #NFD_PickFolderMultipleN_With} * instead. */ @CType("nfdresult_t") @Entrypoint("NFD_PickFolderMultipleN_With_Impl") - int pickFolderMultipleNWithImpl(@CType("nfdversion_t") long version, + int NFD_PickFolderMultipleN_With_Impl(@CType("nfdversion_t") long version, @CType("const nfdpathset_t**") MemorySegment outPaths, @CType("const nfdpickfoldernargs_t*") MemorySegment args); /** * Multiple file open dialog, with additional parameters. *

- * It is the caller's responsibility to free {@code outPaths} via {@link #pathSetFree} if this function + * It is the caller's responsibility to free {@code outPaths} via {@link #NFD_PathSet_Free} if this function * returns NFD_OKAY. See documentation of {@link NFDPickFolderNArgs} for details. */ @CType("nfdresult_t") @Entrypoint("NFD_PickFolderMultipleN_With") @Skip - default int pickFolderMultipleNWith(@CType("const nfdpathset_t**") MemorySegment outPaths, + default int NFD_PickFolderMultipleN_With(@CType("const nfdpathset_t**") MemorySegment outPaths, @CType("const nfdpickfoldernargs_t*") MemorySegment args) { - return pickFolderMultipleNWithImpl(INTERFACE_VERSION, outPaths, args); + return NFD_PickFolderMultipleN_With_Impl(NFD_INTERFACE_VERSION, outPaths, args); } /** - * This function is a library implementation detail. Please use {@link #pickFolderMultipleU8With} + * This function is a library implementation detail. Please use {@link #NFD_PickFolderMultipleU8_With} * instead. */ @CType("nfdresult_t") @Entrypoint("NFD_PickFolderMultipleU8_With_Impl") - int pickFolderMultipleU8WithImpl(@CType("nfdversion_t") long version, + int NFD_PickFolderMultipleU8_With_Impl(@CType("nfdversion_t") long version, @CType("const nfdpathset_t**") MemorySegment outPaths, @CType("const nfdpickfolderu8args_t*") MemorySegment args); /** * Multiple file open dialog, with additional parameters. *

- * It is the caller's responsibility to free {@code outPaths} via {@link #pathSetFree} if this function + * It is the caller's responsibility to free {@code outPaths} via {@link #NFD_PathSet_Free} if this function * returns NFD_OKAY. See documentation of {@link NFDPickFolderU8Args} for details. */ @CType("nfdresult_t") @Entrypoint("NFD_PickFolderMultipleU8_With") @Skip - default int pickFolderMultipleU8With(@CType("const nfdpathset_t**") MemorySegment outPaths, + default int NFD_PickFolderMultipleU8_With(@CType("const nfdpathset_t**") MemorySegment outPaths, @CType("const nfdpickfolderu8args_t*") MemorySegment args) { - return pickFolderMultipleU8WithImpl(INTERFACE_VERSION, outPaths, args); + return NFD_PickFolderMultipleU8_With_Impl(NFD_INTERFACE_VERSION, outPaths, args); } /** @@ -563,7 +563,7 @@ default int pickFolderMultipleU8With(@CType("const nfdpathset_t**") MemorySegmen */ @CType("const char*") @Entrypoint("NFD_GetError") - MemorySegment getError_(); + MemorySegment NFD_GetError_(); /** * Get the last error @@ -576,13 +576,13 @@ default int pickFolderMultipleU8With(@CType("const nfdpathset_t**") MemorySegmen */ @CType("const char*") @Entrypoint("NFD_GetError") - String getError(); + String NFD_GetError(); /** * Clear the error. */ @Entrypoint("NFD_ClearError") - void clearError(); + void NFD_ClearError(); /** * Get the number of entries stored in pathSet. @@ -592,7 +592,7 @@ default int pickFolderMultipleU8With(@CType("const nfdpathset_t**") MemorySegmen */ @CType("nfdresult_t") @Entrypoint("NFD_PathSet_GetCount") - int pathSetGetCount(@CType("const nfdpathset_t*") MemorySegment pathSet, + int NFD_PathSet_GetCount(@CType("const nfdpathset_t*") MemorySegment pathSet, @CType("nfdpathsetsize_t*") MemorySegment count); /** @@ -603,118 +603,118 @@ int pathSetGetCount(@CType("const nfdpathset_t*") MemorySegment pathSet, */ @CType("nfdresult_t") @Entrypoint("NFD_PathSet_GetCount") - int pathSetGetCount(@CType("const nfdpathset_t*") MemorySegment pathSet, + int NFD_PathSet_GetCount(@CType("const nfdpathset_t*") MemorySegment pathSet, @CType("nfdpathsetsize_t*") @Ref long[] count); /** * Get the native path at offset index. *

- * It is the caller's responsibility to free `outPath` via {@link #pathSetFreePathN} if this function + * It is the caller's responsibility to free `outPath` via {@link #NFD_PathSet_FreePathN} if this function * returns NFD_OKAY. */ @CType("nfdresult_t") @Entrypoint("NFD_PathSet_GetPathN") - int pathSetGetPathN(@CType("const nfdpathset_t*") MemorySegment pathSet, + int NFD_PathSet_GetPathN(@CType("const nfdpathset_t*") MemorySegment pathSet, @CType("nfdpathsetsize_t") long index, @CType("nfdnchar_t**") MemorySegment outPath); /** - * Overloads {@link #pathSetGetPathN(java.lang.foreign.MemorySegment, long, java.lang.foreign.MemorySegment)} + * Overloads {@link #NFD_PathSet_GetPathN(java.lang.foreign.MemorySegment, long, java.lang.foreign.MemorySegment)} */ @CType("nfdresult_t") @Entrypoint("NFD_PathSet_GetPathN") @Skip - default int pathSetGetPath(@CType("const nfdpathset_t*") MemorySegment pathSet, + default int NFD_PathSet_GetPath(@CType("const nfdpathset_t*") MemorySegment pathSet, @CType("nfdpathsetsize_t") long index, @CType("nfdnchar_t**") MemorySegment outPath) { - return this.pathSetGetPathN(pathSet, index, outPath); + return this.NFD_PathSet_GetPathN(pathSet, index, outPath); } /** * Get the UTF-8 path at offset index. *

- * It is the caller's responsibility to free `outPath` via {@link #pathSetFreePathU8} if this function + * It is the caller's responsibility to free `outPath` via {@link #NFD_PathSet_FreePathU8} if this function * returns NFD_OKAY. */ @CType("nfdresult_t") @Entrypoint("NFD_PathSet_GetPathU8") - int pathSetGetPathU8(@CType("const nfdpathset_t*") MemorySegment pathSet, + int NFD_PathSet_GetPathU8(@CType("const nfdpathset_t*") MemorySegment pathSet, @CType("nfdpathsetsize_t") long index, @CType("nfdu8char_t**") MemorySegment outPath); /** - * Free the path gotten by {@link #pathSetGetPathN}. + * Free the path gotten by {@link #NFD_PathSet_GetPathN}. */ @Entrypoint("NFD_PathSet_FreePathN") - void pathSetFreePathN(@CType("const nfdnchar_t*") MemorySegment filePath); + void NFD_PathSet_FreePathN(@CType("const nfdnchar_t*") MemorySegment filePath); /** - * Overloads {@link #pathSetFreePathN(java.lang.foreign.MemorySegment)} + * Overloads {@link #NFD_PathSet_FreePathN(java.lang.foreign.MemorySegment)} */ @Entrypoint("NFD_PathSet_FreePathN") @Skip - default void pathSetFreePath(@CType("const nfdnchar_t*") MemorySegment filePath) { - this.pathSetFreePathN(filePath); + default void NFD_PathSet_FreePath(@CType("const nfdnchar_t*") MemorySegment filePath) { + this.NFD_PathSet_FreePathN(filePath); } /** - * Free the path gotten by {@link #pathSetGetPathU8}. + * Free the path gotten by {@link #NFD_PathSet_GetPathU8}. */ @Entrypoint("NFD_PathSet_FreePathU8") - void pathSetFreePathU8(@CType("const nfdu8char_t*") MemorySegment filePath); + void NFD_PathSet_FreePathU8(@CType("const nfdu8char_t*") MemorySegment filePath); /** * Gets an enumerator of the path set. *

- * It is the caller's responsibility to free {@code enumerator} via {@link #pathSetFreeEnum} + * It is the caller's responsibility to free {@code enumerator} via {@link #NFD_PathSet_FreeEnum} * if this function returns NFD_OKAY, and it should be freed before freeing the pathset. */ @CType("nfdresult_t") @Entrypoint("NFD_PathSet_GetEnum") - int pathSetGetEnum(@CType("const nfdpathset_t*") MemorySegment pathSet, + int NFD_PathSet_GetEnum(@CType("const nfdpathset_t*") MemorySegment pathSet, @CType("nfdpathsetenum_t*") MemorySegment outEnumerator); /** * Frees an enumerator of the path set. */ @Entrypoint("NFD_PathSet_FreeEnum") - void pathSetFreeEnum(@CType("nfdpathsetenum_t*") MemorySegment enumerator); + void NFD_PathSet_FreeEnum(@CType("nfdpathsetenum_t*") MemorySegment enumerator); /** * Gets the next item from the path set enumerator. *

* If there are no more items, then *outPaths will be set to null. - * It is the caller's responsibility to free {@code *outPath} via {@link #pathSetFreePathN} + * It is the caller's responsibility to free {@code *outPath} via {@link #NFD_PathSet_FreePathN} * if this function returns NFD_OKAY and {@code *outPath} is not null. */ @CType("nfdresult_t") @Entrypoint("NFD_PathSet_EnumNextN") - int pathSetEnumNextN(@CType("nfdpathsetenum_t*") MemorySegment enumerator, + int NFD_PathSet_EnumNextN(@CType("nfdpathsetenum_t*") MemorySegment enumerator, @CType("nfdnchar_t**") MemorySegment outPath); /** - * Overloads {@link #pathSetEnumNextN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)} + * Overloads {@link #NFD_PathSet_EnumNextN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)} */ @CType("nfdresult_t") @Entrypoint("NFD_PathSet_EnumNextN") @Skip - default int pathSetEnumNext(@CType("nfdpathsetenum_t*") MemorySegment enumerator, + default int NFD_PathSet_EnumNext(@CType("nfdpathsetenum_t*") MemorySegment enumerator, @CType("nfdnchar_t**") MemorySegment outPath) { - return this.pathSetEnumNextN(enumerator, outPath); + return this.NFD_PathSet_EnumNextN(enumerator, outPath); } /** * Gets the next item from the path set enumerator. *

* If there are no more items, then *outPaths will be set to null. - * It is the caller's responsibility to free {@code *outPath} via {@link #pathSetFreePathU8} + * It is the caller's responsibility to free {@code *outPath} via {@link #NFD_PathSet_FreePathU8} * if this function returns NFD_OKAY and {@code *outPath} is not null. */ @CType("nfdresult_t") @Entrypoint("NFD_PathSet_EnumNextU8") - int pathSetEnumNextU8(@CType("nfdpathsetenum_t*") MemorySegment enumerator, + int NFD_PathSet_EnumNextU8(@CType("nfdpathsetenum_t*") MemorySegment enumerator, @CType("nfdu8char_t**") MemorySegment outPath); /** * Free the pathSet */ @Entrypoint("NFD_PathSet_Free") - void pathSetFree(@CType("const nfdpathset_t*") MemorySegment pathSet); + void NFD_PathSet_Free(@CType("const nfdpathset_t*") MemorySegment pathSet); } diff --git a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java index 54cca2c6..3afb0669 100644 --- a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java +++ b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFD.java @@ -51,22 +51,22 @@ *

Basic Usages

* {@snippet lang = java: * void main() { - * NFD.init(); + * NFD_Init(); * - * try (MemoryStack stack = MemoryStack.stackPush()) { + * try (MemoryStack stack = MemoryStack.pushLocal()) { * String[] outPath = new String[1]; * var filterItem = NFDNFilterItem.create(stack, * Map.entry("Source code", "java"), * Map.entry("Image file", "png,jpg")); - * var result = NFD.openDialogN(outPath, filterItem, null); + * var result = NFD_OpenDialogN(outPath, filterItem, null); * switch (result) { - * case ERROR -> println("Error: " + NFD.getError()); - * case OKAY -> println("Success! " + outPath[0]); - * case CANCEL -> println("User pressed cancel."); + * case NFD_ERROR -> println("Error: " + NFD_GetError()); + * case NFD_OKAY -> println("Success! " + outPath[0]); + * case NFD_CANCEL -> println("User pressed cancel."); * } * } * - * NFD.quit(); + * NFD_Quit(); * }} * *

File Filter Syntax

@@ -120,65 +120,65 @@ public final class NFD { /** * Programmatic error */ - public static final int ERROR = CNFD.ERROR; + public static final int NFD_ERROR = CNFD.NFD_ERROR; /** * User pressed okay, or successful return */ - public static final int OKAY = CNFD.OKAY; + public static final int NFD_OKAY = CNFD.NFD_OKAY; /** * User pressed cancel */ - public static final int CANCEL = CNFD.CANCEL; + public static final int NFD_CANCEL = CNFD.NFD_CANCEL; /** * The native window handle type. */ - public static final int WINDOW_HANDLE_TYPE_UNSET = CNFD.WINDOW_HANDLE_TYPE_UNSET; + public static final int NFD_WINDOW_HANDLE_TYPE_UNSET = CNFD.NFD_WINDOW_HANDLE_TYPE_UNSET; /** * Windows: handle is HWND (the Windows API typedefs this to void*) */ - public static final int WINDOW_HANDLE_TYPE_WINDOWS = CNFD.WINDOW_HANDLE_TYPE_WINDOWS; + public static final int NFD_WINDOW_HANDLE_TYPE_WINDOWS = CNFD.NFD_WINDOW_HANDLE_TYPE_WINDOWS; /** * Cocoa: handle is NSWindow* */ - public static final int WINDOW_HANDLE_TYPE_COCOA = CNFD.WINDOW_HANDLE_TYPE_COCOA; + public static final int NFD_WINDOW_HANDLE_TYPE_COCOA = CNFD.NFD_WINDOW_HANDLE_TYPE_COCOA; /** * X11: handle is Window */ - public static final int WINDOW_HANDLE_TYPE_X11 = CNFD.WINDOW_HANDLE_TYPE_X11; + public static final int NFD_WINDOW_HANDLE_TYPE_X11 = CNFD.NFD_WINDOW_HANDLE_TYPE_X11; /** * This is a unique identifier tagged to all the NFD_*With() function calls, for backward * compatibility purposes.

There is usually no need to use this directly, unless you want to use * NFD differently depending on the version you're building with. */ - public static final int INTERFACE_VERSION = CNFD.INTERFACE_VERSION; + public static final int NFD_INTERFACE_VERSION = CNFD.NFD_INTERFACE_VERSION; /** * Free a file path that was returned by the dialogs. *

- * Note: use {@link #pathSetFreePathN} to free path from pathset instead of this function. + * Note: use {@link #NFD_PathSet_FreePathN} to free path from pathset instead of this function. */ @overrun.marshal.gen.Entrypoint("NFD_FreePathN") - public static void freePathN( + public static void NFD_FreePathN( @overrun.marshal.gen.CType("nfdnchar_t*") java.lang.foreign.MemorySegment filePath) { - getInstance().freePathN(filePath); + getInstance().NFD_FreePathN(filePath); } /** - * Overloads {@link #freePathN(java.lang.foreign.MemorySegment)} + * Overloads {@link #NFD_FreePathN(java.lang.foreign.MemorySegment)} */ @overrun.marshal.gen.Entrypoint("NFD_FreePathN") @overrun.marshal.gen.Skip - public static void freePath( + public static void NFD_FreePath( @overrun.marshal.gen.CType("nfdnchar_t*") java.lang.foreign.MemorySegment filePath) { - getInstance().freePath(filePath); + getInstance().NFD_FreePath(filePath); } /** * Free a file path that was returned by the dialogs. *

- * Note: use {@link #pathSetFreePathU8} to free path from pathset instead of this function. + * Note: use {@link #NFD_PathSet_FreePathU8} to free path from pathset instead of this function. */ @overrun.marshal.gen.Entrypoint("NFD_FreePathU8") - public static void freePathU8( + public static void NFD_FreePathU8( @overrun.marshal.gen.CType("nfdu8char_t*") java.lang.foreign.MemorySegment filePath) { - getInstance().freePathU8(filePath); + getInstance().NFD_FreePathU8(filePath); } /** * Initialize NFD. Call this for every thread that might use NFD, before calling any other NFD @@ -186,493 +186,495 @@ public static void freePathU8( */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_Init") - public static int init() { - return getInstance().init(); + public static int NFD_Init() { + return getInstance().NFD_Init(); } /** - * Call this to de-initialize NFD, if {@link #init()} returned NFD_OKAY. + * Call this to de-initialize NFD, if {@link #NFD_Init()} returned NFD_OKAY. */ @overrun.marshal.gen.Entrypoint("NFD_Quit") - public static void quit() { - getInstance().quit(); + public static void NFD_Quit() { + getInstance().NFD_Quit(); } /** * Single file open dialog *

- * It's the caller's responsibility to free {@code outPath} via {@link #freePathN} if this function returns + * It's the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathN} if this function returns * NFD_OKAY. * @param filterCount If zero, filterList is ignored (you can use null). * @param defaultPath If null, the operating system will decide. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_OpenDialogN") - public static int openDialogN( + public static int NFD_OpenDialogN( @overrun.marshal.gen.CType("nfdnchar_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdnfilteritem_t*") java.lang.foreign.MemorySegment filterList, @overrun.marshal.gen.CType("nfdfiltersize_t") int filterCount, @overrun.marshal.gen.CType("const nfdnchar_t*") java.lang.foreign.MemorySegment defaultPath) { - return getInstance().openDialogN(outPath, filterList, filterCount, defaultPath); + return getInstance().NFD_OpenDialogN(outPath, filterList, filterCount, defaultPath); } /** - * Overloads {@link #openDialogN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, int, java.lang.foreign.MemorySegment)} + * Overloads {@link #NFD_OpenDialogN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, int, java.lang.foreign.MemorySegment)} * @param filterCount If zero, filterList is ignored (you can use null). * @param defaultPath If null, the operating system will decide. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_OpenDialogN") @overrun.marshal.gen.Skip - public static int openDialog( + public static int NFD_OpenDialog( @overrun.marshal.gen.CType("nfdnchar_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdnfilteritem_t*") java.lang.foreign.MemorySegment filterList, @overrun.marshal.gen.CType("nfdfiltersize_t") int filterCount, @overrun.marshal.gen.CType("const nfdnchar_t*") java.lang.foreign.MemorySegment defaultPath) { - return getInstance().openDialog(outPath, filterList, filterCount, defaultPath); + return getInstance().NFD_OpenDialog(outPath, filterList, filterCount, defaultPath); } /** * Single file open dialog *

- * It's the caller's responsibility to free {@code outPath} via {@link #freePathU8} if this function returns + * It's the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathU8} if this function returns * NFD_OKAY. * @param filterCount If zero, filterList is ignored (you can use null). * @param defaultPath If null, the operating system will decide. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_OpenDialogU8") - public static int openDialogU8( + public static int NFD_OpenDialogU8( @overrun.marshal.gen.CType("nfdu8char_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdu8filteritem_t*") java.lang.foreign.MemorySegment filterList, @overrun.marshal.gen.CType("nfdfiltersize_t") int filterCount, @overrun.marshal.gen.CType("const nfdu8char_t*") java.lang.foreign.MemorySegment defaultPath) { - return getInstance().openDialogU8(outPath, filterList, filterCount, defaultPath); + return getInstance().NFD_OpenDialogU8(outPath, filterList, filterCount, defaultPath); } /** - * This function is a library implementation detail. Please use {@link #openDialogNWith} instead. + * This function is a library implementation detail. Please use {@link #NFD_OpenDialogN_With} instead. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_OpenDialogN_With_Impl") - public static int openDialogNWithImpl(@overrun.marshal.gen.CType("nfdversion_t") long version, + public static int NFD_OpenDialogN_With_Impl(@overrun.marshal.gen.CType("nfdversion_t") long version, @overrun.marshal.gen.CType("nfdnchar_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdopendialognargs_t*") java.lang.foreign.MemorySegment args) { - return getInstance().openDialogNWithImpl(version, outPath, args); + return getInstance().NFD_OpenDialogN_With_Impl(version, outPath, args); } /** * Single file open dialog, with additional parameters. *

- * It is the caller's responsibility to free {@code outPath} via {@link #freePathN} if this function + * It is the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathN} if this function * returns NFD_OKAY. See documentation of {@link NFDOpenDialogNArgs} for details. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_OpenDialogN_With") @overrun.marshal.gen.Skip - public static int openDialogNWith( + public static int NFD_OpenDialogN_With( @overrun.marshal.gen.CType("nfdnchar_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdopendialognargs_t*") java.lang.foreign.MemorySegment args) { - return getInstance().openDialogNWith(outPath, args); + return getInstance().NFD_OpenDialogN_With(outPath, args); } /** - * This function is a library implementation detail. Please use {@link #openDialogU8With} instead. + * This function is a library implementation detail. Please use {@link #NFD_OpenDialogU8_With} instead. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_OpenDialogU8_With_Impl") - public static int openDialogU8WithImpl(@overrun.marshal.gen.CType("nfdversion_t") long version, + public static int NFD_OpenDialogU8_With_Impl( + @overrun.marshal.gen.CType("nfdversion_t") long version, @overrun.marshal.gen.CType("nfdu8char_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdopendialogu8args_t*") java.lang.foreign.MemorySegment args) { - return getInstance().openDialogU8WithImpl(version, outPath, args); + return getInstance().NFD_OpenDialogU8_With_Impl(version, outPath, args); } /** * Single file open dialog, with additional parameters. *

- * It is the caller's responsibility to free {@code outPath} via {@link #freePathU8} if this function + * It is the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathU8} if this function * returns NFD_OKAY. See documentation of {@link NFDOpenDialogU8Args} for details. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_OpenDialogU8_With") @overrun.marshal.gen.Skip - public static int openDialogU8With( + public static int NFD_OpenDialogU8_With( @overrun.marshal.gen.CType("nfdu8char_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdopendialogu8args_t*") java.lang.foreign.MemorySegment args) { - return getInstance().openDialogU8With(outPath, args); + return getInstance().NFD_OpenDialogU8_With(outPath, args); } /** * Multiple file open dialog *

- * It is the caller's responsibility to free {@code outPaths} via {@link #pathSetFree} if this function + * It is the caller's responsibility to free {@code outPaths} via {@link #NFD_PathSet_Free} if this function * returns NFD_OKAY. * @param filterCount If zero, filterList is ignored (you can use null). * @param defaultPath If null, the operating system will decide. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_OpenDialogMultipleN") - public static int openDialogMultipleN( + public static int NFD_OpenDialogMultipleN( @overrun.marshal.gen.CType("const nfdpathset_t**") java.lang.foreign.MemorySegment outPaths, @overrun.marshal.gen.CType("const nfdnfilteritem_t*") java.lang.foreign.MemorySegment filterList, @overrun.marshal.gen.CType("nfdfiltersize_t") int filterCount, @overrun.marshal.gen.CType("const nfdnchar_t*") java.lang.foreign.MemorySegment defaultPath) { - return getInstance().openDialogMultipleN(outPaths, filterList, filterCount, defaultPath); + return getInstance().NFD_OpenDialogMultipleN(outPaths, filterList, filterCount, defaultPath); } /** - * Overloads {@link #openDialogMultipleN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, int, java.lang.foreign.MemorySegment)} + * Overloads {@link #NFD_OpenDialogMultipleN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, int, java.lang.foreign.MemorySegment)} * @param filterCount If zero, filterList is ignored (you can use null). * @param defaultPath If null, the operating system will decide. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_OpenDialogMultipleN") @overrun.marshal.gen.Skip - public static int openDialogMultiple( + public static int NFD_OpenDialogMultiple( @overrun.marshal.gen.CType("const nfdpathset_t**") java.lang.foreign.MemorySegment outPaths, @overrun.marshal.gen.CType("const nfdnfilteritem_t*") java.lang.foreign.MemorySegment filterList, @overrun.marshal.gen.CType("nfdfiltersize_t") int filterCount, @overrun.marshal.gen.CType("const nfdnchar_t*") java.lang.foreign.MemorySegment defaultPath) { - return getInstance().openDialogMultiple(outPaths, filterList, filterCount, defaultPath); + return getInstance().NFD_OpenDialogMultiple(outPaths, filterList, filterCount, defaultPath); } /** * Multiple file open dialog *

- * It is the caller's responsibility to free {@code outPaths} via {@link #pathSetFree} if this function + * It is the caller's responsibility to free {@code outPaths} via {@link #NFD_PathSet_Free} if this function * returns NFD_OKAY. * @param filterCount If zero, filterList is ignored (you can use null). * @param defaultPath If null, the operating system will decide. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_OpenDialogMultipleU8") - public static int openDialogMultipleU8( + public static int NFD_OpenDialogMultipleU8( @overrun.marshal.gen.CType("const nfdpathset_t**") java.lang.foreign.MemorySegment outPaths, @overrun.marshal.gen.CType("const nfdu8filteritem_t*") java.lang.foreign.MemorySegment filterList, @overrun.marshal.gen.CType("nfdfiltersize_t") int filterCount, @overrun.marshal.gen.CType("const nfdu8char_t*") java.lang.foreign.MemorySegment defaultPath) { - return getInstance().openDialogMultipleU8(outPaths, filterList, filterCount, defaultPath); + return getInstance().NFD_OpenDialogMultipleU8(outPaths, filterList, filterCount, defaultPath); } /** - * This function is a library implementation detail. Please use {@link #openDialogMultipleNWith} + * This function is a library implementation detail. Please use {@link #NFD_OpenDialogMultipleN_With} * instead. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_OpenDialogMultipleN_With_Impl") - public static int openDialogMultipleNWithImpl( + public static int NFD_OpenDialogMultipleN_With_Impl( @overrun.marshal.gen.CType("nfdversion_t") long version, @overrun.marshal.gen.CType("const nfdpathset_t**") java.lang.foreign.MemorySegment outPaths, @overrun.marshal.gen.CType("const nfdopendialognargs_t*") java.lang.foreign.MemorySegment args) { - return getInstance().openDialogMultipleNWithImpl(version, outPaths, args); + return getInstance().NFD_OpenDialogMultipleN_With_Impl(version, outPaths, args); } /** * Multiple file open dialog, with additional parameters. *

- * It is the caller's responsibility to free {@code outPaths} via {@link #pathSetFree} if this function + * It is the caller's responsibility to free {@code outPaths} via {@link #NFD_PathSet_Free} if this function * returns NFD_OKAY. See documentation of {@link NFDOpenDialogNArgs} for details. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_OpenDialogMultipleN_With") @overrun.marshal.gen.Skip - public static int openDialogMultipleNWith( + public static int NFD_OpenDialogMultipleN_With( @overrun.marshal.gen.CType("const nfdpathset_t**") java.lang.foreign.MemorySegment outPaths, @overrun.marshal.gen.CType("const nfdopendialognargs_t*") java.lang.foreign.MemorySegment args) { - return getInstance().openDialogMultipleNWith(outPaths, args); + return getInstance().NFD_OpenDialogMultipleN_With(outPaths, args); } /** - * This function is a library implementation detail. Please use {@link #openDialogMultipleU8With} + * This function is a library implementation detail. Please use {@link #NFD_OpenDialogMultipleU8_With} * instead. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_OpenDialogMultipleU8_With_Impl") - public static int openDialogMultipleU8WithImpl( + public static int NFD_OpenDialogMultipleU8_With_Impl( @overrun.marshal.gen.CType("nfdversion_t") long version, @overrun.marshal.gen.CType("const nfdpathset_t**") java.lang.foreign.MemorySegment outPaths, @overrun.marshal.gen.CType("const nfdopendialogu8args_t*") java.lang.foreign.MemorySegment args) { - return getInstance().openDialogMultipleU8WithImpl(version, outPaths, args); + return getInstance().NFD_OpenDialogMultipleU8_With_Impl(version, outPaths, args); } /** * Multiple file open dialog, with additional parameters. *

- * It is the caller's responsibility to free {@code outPaths} via {@link #pathSetFree} if this function + * It is the caller's responsibility to free {@code outPaths} via {@link #NFD_PathSet_Free} if this function * returns NFD_OKAY. See documentation of {@link NFDOpenDialogU8Args} for details. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_OpenDialogMultipleU8_With") @overrun.marshal.gen.Skip - public static int openDialogMultipleU8With( + public static int NFD_OpenDialogMultipleU8_With( @overrun.marshal.gen.CType("const nfdpathset_t**") java.lang.foreign.MemorySegment outPaths, @overrun.marshal.gen.CType("const nfdopendialogu8args_t*") java.lang.foreign.MemorySegment args) { - return getInstance().openDialogMultipleU8With(outPaths, args); + return getInstance().NFD_OpenDialogMultipleU8_With(outPaths, args); } /** * Save dialog *

- * It is the caller's responsibility to free {@code outPath} via {@link #freePathN} if this function returns + * It is the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathN} if this function returns * NFD_OKAY. * @param filterCount If zero, filterList is ignored (you can use null). * @param defaultPath If null, the operating system will decide. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_SaveDialogN") - public static int saveDialogN( + public static int NFD_SaveDialogN( @overrun.marshal.gen.CType("nfdnchar_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdnfilteritem_t*") java.lang.foreign.MemorySegment filterList, @overrun.marshal.gen.CType("nfdfiltersize_t") int filterCount, @overrun.marshal.gen.CType("const nfdnchar_t*") java.lang.foreign.MemorySegment defaultPath, @overrun.marshal.gen.CType("const nfdnchar_t*") java.lang.foreign.MemorySegment defaultName) { - return getInstance().saveDialogN(outPath, filterList, filterCount, defaultPath, defaultName); + return getInstance().NFD_SaveDialogN(outPath, filterList, filterCount, defaultPath, defaultName); } /** - * Overloads {@link #saveDialogN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, int, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)} + * Overloads {@link #NFD_SaveDialogN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, int, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)} * @param filterCount If zero, filterList is ignored (you can use null). * @param defaultPath If null, the operating system will decide. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_SaveDialogN") @overrun.marshal.gen.Skip - public static int saveDialog( + public static int NFD_SaveDialog( @overrun.marshal.gen.CType("nfdnchar_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdnfilteritem_t*") java.lang.foreign.MemorySegment filterList, @overrun.marshal.gen.CType("nfdfiltersize_t") int filterCount, @overrun.marshal.gen.CType("const nfdnchar_t*") java.lang.foreign.MemorySegment defaultPath, @overrun.marshal.gen.CType("const nfdnchar_t*") java.lang.foreign.MemorySegment defaultName) { - return getInstance().saveDialog(outPath, filterList, filterCount, defaultPath, defaultName); + return getInstance().NFD_SaveDialog(outPath, filterList, filterCount, defaultPath, defaultName); } /** * Save dialog *

- * It is the caller's responsibility to free {@code outPath} via {@link #freePathU8} if this function returns + * It is the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathU8} if this function returns * NFD_OKAY. * @param filterCount If zero, filterList is ignored (you can use null). * @param defaultPath If null, the operating system will decide. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_SaveDialogU8") - public static int saveDialogU8( + public static int NFD_SaveDialogU8( @overrun.marshal.gen.CType("nfdu8char_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdu8filteritem_t*") java.lang.foreign.MemorySegment filterList, @overrun.marshal.gen.CType("nfdfiltersize_t") int filterCount, @overrun.marshal.gen.CType("const nfdu8char_t*") java.lang.foreign.MemorySegment defaultPath, @overrun.marshal.gen.CType("const nfdu8char_t*") java.lang.foreign.MemorySegment defaultName) { - return getInstance().saveDialogU8(outPath, filterList, filterCount, defaultPath, defaultName); + return getInstance().NFD_SaveDialogU8(outPath, filterList, filterCount, defaultPath, defaultName); } /** - * This function is a library implementation detail. Please use {@link #saveDialogNWith} instead. + * This function is a library implementation detail. Please use {@link #NFD_SaveDialogN_With} instead. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_SaveDialogN_With_Impl") - public static int saveDialogNWithImpl(@overrun.marshal.gen.CType("nfdversion_t") long version, + public static int NFD_SaveDialogN_WithImpl(@overrun.marshal.gen.CType("nfdversion_t") long version, @overrun.marshal.gen.CType("nfdnchar_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdsavedialognargs_t*") java.lang.foreign.MemorySegment args) { - return getInstance().saveDialogNWithImpl(version, outPath, args); + return getInstance().NFD_SaveDialogN_WithImpl(version, outPath, args); } /** * Single file save dialog, with additional parameters. *

- * It is the caller's responsibility to free {@code outPath} via {@link #freePathN} if this function + * It is the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathN} if this function * returns NFD_OKAY. See documentation of {@link NFDSaveDialogNArgs} for details. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_SaveDialogN_With") @overrun.marshal.gen.Skip - public static int saveDialogNWith( + public static int NFD_SaveDialogN_With( @overrun.marshal.gen.CType("nfdnchar_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdsavedialognargs_t*") java.lang.foreign.MemorySegment args) { - return getInstance().saveDialogNWith(outPath, args); + return getInstance().NFD_SaveDialogN_With(outPath, args); } /** - * This function is a library implementation detail. Please use {@link #saveDialogU8With} instead. + * This function is a library implementation detail. Please use {@link #NFD_SaveDialogU8_With} instead. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_SaveDialogU8_With_Impl") - public static int saveDialogU8WithImpl(@overrun.marshal.gen.CType("nfdversion_t") long version, + public static int NFD_SaveDialogU8_WithImpl(@overrun.marshal.gen.CType("nfdversion_t") long version, @overrun.marshal.gen.CType("nfdu8char_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdsavedialogu8args_t*") java.lang.foreign.MemorySegment args) { - return getInstance().saveDialogU8WithImpl(version, outPath, args); + return getInstance().NFD_SaveDialogU8_WithImpl(version, outPath, args); } /** * Single file save dialog, with additional parameters. *

- * It is the caller's responsibility to free {@code outPath} via {@link #freePathU8} if this function + * It is the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathU8} if this function * returns NFD_OKAY. See documentation of {@link NFDSaveDialogU8Args} for details. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_SaveDialogU8_With") @overrun.marshal.gen.Skip - public static int saveDialogU8With( + public static int NFD_SaveDialogU8_With( @overrun.marshal.gen.CType("nfdu8char_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdsavedialogu8args_t*") java.lang.foreign.MemorySegment args) { - return getInstance().saveDialogU8With(outPath, args); + return getInstance().NFD_SaveDialogU8_With(outPath, args); } /** * Select single folder dialog *

- * It's the caller's responsibility to free {@code outPath} via {@link #freePathN} if this function returns + * It's the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathN} if this function returns * NFD_OKAY. * @param defaultPath If null, the operating system will decide. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PickFolderN") - public static int pickFolderN( + public static int NFD_PickFolderN( @overrun.marshal.gen.CType("nfdnchar_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdnchar_t*") java.lang.foreign.MemorySegment defaultPath) { - return getInstance().pickFolderN(outPath, defaultPath); + return getInstance().NFD_PickFolderN(outPath, defaultPath); } /** - * Overloads {@link #pickFolderN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)} + * Overloads {@link #NFD_PickFolderN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)} * @param defaultPath If null, the operating system will decide. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PickFolderN") @overrun.marshal.gen.Skip - public static int pickFolder( + public static int NFD_PickFolder( @overrun.marshal.gen.CType("nfdnchar_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdnchar_t*") java.lang.foreign.MemorySegment defaultPath) { - return getInstance().pickFolder(outPath, defaultPath); + return getInstance().NFD_PickFolder(outPath, defaultPath); } /** * Select single folder dialog *

- * It's the caller's responsibility to free {@code outPath} via {@link #freePathU8} if this function returns + * It's the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathU8} if this function returns * NFD_OKAY. * @param defaultPath If null, the operating system will decide. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PickFolderU8") - public static int pickFolderU8( + public static int NFD_PickFolderU8( @overrun.marshal.gen.CType("nfdu8char_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdu8char_t*") java.lang.foreign.MemorySegment defaultPath) { - return getInstance().pickFolderU8(outPath, defaultPath); + return getInstance().NFD_PickFolderU8(outPath, defaultPath); } /** - * This function is a library implementation detail. Please use {@link #pickFolderNWith} instead. + * This function is a library implementation detail. Please use {@link #NFD_PickFolderN_With} instead. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PickFolderN_With_Impl") - public static int pickFolderNWithImpl(@overrun.marshal.gen.CType("nfdversion_t") long version, + public static int NFD_PickFolderN_With_Impl(@overrun.marshal.gen.CType("nfdversion_t") long version, @overrun.marshal.gen.CType("nfdnchar_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdpickfoldernargs_t*") java.lang.foreign.MemorySegment args) { - return getInstance().pickFolderNWithImpl(version, outPath, args); + return getInstance().NFD_PickFolderN_With_Impl(version, outPath, args); } /** * Single file open dialog, with additional parameters. *

- * It is the caller's responsibility to free {@code outPath} via {@link #freePathN} if this function + * It is the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathN} if this function * returns NFD_OKAY. See documentation of {@link NFDPickFolderNArgs} for details. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PickFolderN_With") @overrun.marshal.gen.Skip - public static int pickFolderNWith( + public static int NFD_PickFolderN_With( @overrun.marshal.gen.CType("nfdnchar_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdpickfoldernargs_t*") java.lang.foreign.MemorySegment args) { - return getInstance().pickFolderNWith(outPath, args); + return getInstance().NFD_PickFolderN_With(outPath, args); } /** - * This function is a library implementation detail. Please use {@link #pickFolderU8With} instead. + * This function is a library implementation detail. Please use {@link #NFD_PickFolderU8_With} instead. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PickFolderU8_With_Impl") - public static int pickFolderU8WithImpl(@overrun.marshal.gen.CType("nfdversion_t") long version, + public static int NFD_PickFolderU8_With_Impl( + @overrun.marshal.gen.CType("nfdversion_t") long version, @overrun.marshal.gen.CType("nfdu8char_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdpickfolderu8args_t*") java.lang.foreign.MemorySegment args) { - return getInstance().pickFolderU8WithImpl(version, outPath, args); + return getInstance().NFD_PickFolderU8_With_Impl(version, outPath, args); } /** * Single file open dialog, with additional parameters. *

- * It is the caller's responsibility to free {@code outPath} via {@link #freePathU8} if this function + * It is the caller's responsibility to free {@code outPath} via {@link #NFD_FreePathU8} if this function * returns NFD_OKAY. See documentation of {@link NFDPickFolderU8Args} for details. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PickFolderU8_With") @overrun.marshal.gen.Skip - public static int pickFolderU8With( + public static int NFD_PickFolderU8_With( @overrun.marshal.gen.CType("nfdu8char_t**") java.lang.foreign.MemorySegment outPath, @overrun.marshal.gen.CType("const nfdpickfolderu8args_t*") java.lang.foreign.MemorySegment args) { - return getInstance().pickFolderU8With(outPath, args); + return getInstance().NFD_PickFolderU8_With(outPath, args); } /** * Select multiple folder dialog *

- * It is the caller's responsibility to free {@code outPaths} via {@link #pathSetFree} if this function + * It is the caller's responsibility to free {@code outPaths} via {@link #NFD_PathSet_Free} if this function * returns NFD_OKAY. * @param defaultPath If null, the operating system will decide. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PickFolderMultipleN") - public static int pickFolderMultipleN( + public static int NFD_PickFolderMultipleN( @overrun.marshal.gen.CType("const nfdpathset_t**") java.lang.foreign.MemorySegment outPaths, @overrun.marshal.gen.CType("const nfdnchar_t*") java.lang.foreign.MemorySegment defaultPath) { - return getInstance().pickFolderMultipleN(outPaths, defaultPath); + return getInstance().NFD_PickFolderMultipleN(outPaths, defaultPath); } /** - * Overloads {@link #pickFolderMultipleN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)} + * Overloads {@link #NFD_PickFolderMultipleN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)} * @param defaultPath If null, the operating system will decide. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PickFolderMultipleN") @overrun.marshal.gen.Skip - public static int pickFolderMultiple( + public static int NFD_PickFolderMultiple( @overrun.marshal.gen.CType("const nfdpathset_t**") java.lang.foreign.MemorySegment outPaths, @overrun.marshal.gen.CType("const nfdnchar_t*") java.lang.foreign.MemorySegment defaultPath) { - return getInstance().pickFolderMultiple(outPaths, defaultPath); + return getInstance().NFD_PickFolderMultiple(outPaths, defaultPath); } /** * Select multiple folder dialog *

- * It is the caller's responsibility to free {@code outPaths} via {@link #pathSetFree} if this function + * It is the caller's responsibility to free {@code outPaths} via {@link #NFD_PathSet_Free} if this function * returns NFD_OKAY. * @param defaultPath If null, the operating system will decide. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PickFolderMultipleU8") - public static int pickFolderMultipleU8( + public static int NFD_PickFolderMultipleU8( @overrun.marshal.gen.CType("const nfdpathset_t**") java.lang.foreign.MemorySegment outPaths, @overrun.marshal.gen.CType("const nfdu8char_t*") java.lang.foreign.MemorySegment defaultPath) { - return getInstance().pickFolderMultipleU8(outPaths, defaultPath); + return getInstance().NFD_PickFolderMultipleU8(outPaths, defaultPath); } /** - * This function is a library implementation detail. Please use {@link #pickFolderMultipleNWith} + * This function is a library implementation detail. Please use {@link #NFD_PickFolderMultipleN_With} * instead. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PickFolderMultipleN_With_Impl") - public static int pickFolderMultipleNWithImpl( + public static int NFD_PickFolderMultipleN_With_Impl( @overrun.marshal.gen.CType("nfdversion_t") long version, @overrun.marshal.gen.CType("const nfdpathset_t**") java.lang.foreign.MemorySegment outPaths, @overrun.marshal.gen.CType("const nfdpickfoldernargs_t*") java.lang.foreign.MemorySegment args) { - return getInstance().pickFolderMultipleNWithImpl(version, outPaths, args); + return getInstance().NFD_PickFolderMultipleN_With_Impl(version, outPaths, args); } /** * Multiple file open dialog, with additional parameters. *

- * It is the caller's responsibility to free {@code outPaths} via {@link #pathSetFree} if this function + * It is the caller's responsibility to free {@code outPaths} via {@link #NFD_PathSet_Free} if this function * returns NFD_OKAY. See documentation of {@link NFDPickFolderNArgs} for details. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PickFolderMultipleN_With") @overrun.marshal.gen.Skip - public static int pickFolderMultipleNWith( + public static int NFD_PickFolderMultipleN_With( @overrun.marshal.gen.CType("const nfdpathset_t**") java.lang.foreign.MemorySegment outPaths, @overrun.marshal.gen.CType("const nfdpickfoldernargs_t*") java.lang.foreign.MemorySegment args) { - return getInstance().pickFolderMultipleNWith(outPaths, args); + return getInstance().NFD_PickFolderMultipleN_With(outPaths, args); } /** - * This function is a library implementation detail. Please use {@link #pickFolderMultipleU8With} + * This function is a library implementation detail. Please use {@link #NFD_PickFolderMultipleU8_With} * instead. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PickFolderMultipleU8_With_Impl") - public static int pickFolderMultipleU8WithImpl( + public static int NFD_PickFolderMultipleU8_With_Impl( @overrun.marshal.gen.CType("nfdversion_t") long version, @overrun.marshal.gen.CType("const nfdpathset_t**") java.lang.foreign.MemorySegment outPaths, @overrun.marshal.gen.CType("const nfdpickfolderu8args_t*") java.lang.foreign.MemorySegment args) { - return getInstance().pickFolderMultipleU8WithImpl(version, outPaths, args); + return getInstance().NFD_PickFolderMultipleU8_With_Impl(version, outPaths, args); } /** * Multiple file open dialog, with additional parameters. *

- * It is the caller's responsibility to free {@code outPaths} via {@link #pathSetFree} if this function + * It is the caller's responsibility to free {@code outPaths} via {@link #NFD_PathSet_Free} if this function * returns NFD_OKAY. See documentation of {@link NFDPickFolderU8Args} for details. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PickFolderMultipleU8_With") @overrun.marshal.gen.Skip - public static int pickFolderMultipleU8With( + public static int NFD_PickFolderMultipleU8_With( @overrun.marshal.gen.CType("const nfdpathset_t**") java.lang.foreign.MemorySegment outPaths, @overrun.marshal.gen.CType("const nfdpickfolderu8args_t*") java.lang.foreign.MemorySegment args) { - return getInstance().pickFolderMultipleU8With(outPaths, args); + return getInstance().NFD_PickFolderMultipleU8_With(outPaths, args); } /** * Get the last error @@ -685,8 +687,8 @@ public static int pickFolderMultipleU8With( */ @overrun.marshal.gen.CType("const char*") @overrun.marshal.gen.Entrypoint("NFD_GetError") - public static java.lang.foreign.MemorySegment getError_() { - return getInstance().getError_(); + public static java.lang.foreign.MemorySegment NFD_GetError_() { + return getInstance().NFD_GetError_(); } /** * Get the last error @@ -699,15 +701,15 @@ public static java.lang.foreign.MemorySegment getError_() { */ @overrun.marshal.gen.CType("const char*") @overrun.marshal.gen.Entrypoint("NFD_GetError") - public static java.lang.String getError() { - return getInstance().getError(); + public static java.lang.String NFD_GetError() { + return getInstance().NFD_GetError(); } /** * Clear the error. */ @overrun.marshal.gen.Entrypoint("NFD_ClearError") - public static void clearError() { - getInstance().clearError(); + public static void NFD_ClearError() { + getInstance().NFD_ClearError(); } /** * Get the number of entries stored in pathSet. @@ -717,10 +719,10 @@ public static void clearError() { */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PathSet_GetCount") - public static int pathSetGetCount( + public static int NFD_PathSet_GetCount( @overrun.marshal.gen.CType("const nfdpathset_t*") java.lang.foreign.MemorySegment pathSet, @overrun.marshal.gen.CType("nfdpathsetsize_t*") java.lang.foreign.MemorySegment count) { - return getInstance().pathSetGetCount(pathSet, count); + return getInstance().NFD_PathSet_GetCount(pathSet, count); } /** * Get the number of entries stored in pathSet. @@ -730,473 +732,476 @@ public static int pathSetGetCount( */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PathSet_GetCount") - public static int pathSetGetCount( + public static int NFD_PathSet_GetCount( @overrun.marshal.gen.CType("const nfdpathset_t*") java.lang.foreign.MemorySegment pathSet, @overrun.marshal.gen.CType("nfdpathsetsize_t*") @overrun.marshal.gen.Ref long[] count) { - return getInstance().pathSetGetCount(pathSet, count); + return getInstance().NFD_PathSet_GetCount(pathSet, count); } /** * Get the native path at offset index. *

- * It is the caller's responsibility to free `outPath` via {@link #pathSetFreePathN} if this function + * It is the caller's responsibility to free `outPath` via {@link #NFD_PathSet_FreePathN} if this function * returns NFD_OKAY. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PathSet_GetPathN") - public static int pathSetGetPathN( + public static int NFD_PathSet_GetPathN( @overrun.marshal.gen.CType("const nfdpathset_t*") java.lang.foreign.MemorySegment pathSet, @overrun.marshal.gen.CType("nfdpathsetsize_t") long index, @overrun.marshal.gen.CType("nfdnchar_t**") java.lang.foreign.MemorySegment outPath) { - return getInstance().pathSetGetPathN(pathSet, index, outPath); + return getInstance().NFD_PathSet_GetPathN(pathSet, index, outPath); } /** - * Overloads {@link #pathSetGetPathN(java.lang.foreign.MemorySegment, long, java.lang.foreign.MemorySegment)} + * Overloads {@link #NFD_PathSet_GetPathN(java.lang.foreign.MemorySegment, long, java.lang.foreign.MemorySegment)} */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PathSet_GetPathN") @overrun.marshal.gen.Skip - public static int pathSetGetPath( + public static int NFD_PathSet_GetPath( @overrun.marshal.gen.CType("const nfdpathset_t*") java.lang.foreign.MemorySegment pathSet, @overrun.marshal.gen.CType("nfdpathsetsize_t") long index, @overrun.marshal.gen.CType("nfdnchar_t**") java.lang.foreign.MemorySegment outPath) { - return getInstance().pathSetGetPath(pathSet, index, outPath); + return getInstance().NFD_PathSet_GetPath(pathSet, index, outPath); } /** * Get the UTF-8 path at offset index. *

- * It is the caller's responsibility to free `outPath` via {@link #pathSetFreePathU8} if this function + * It is the caller's responsibility to free `outPath` via {@link #NFD_PathSet_FreePathU8} if this function * returns NFD_OKAY. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PathSet_GetPathU8") - public static int pathSetGetPathU8( + public static int NFD_PathSet_GetPathU8( @overrun.marshal.gen.CType("const nfdpathset_t*") java.lang.foreign.MemorySegment pathSet, @overrun.marshal.gen.CType("nfdpathsetsize_t") long index, @overrun.marshal.gen.CType("nfdu8char_t**") java.lang.foreign.MemorySegment outPath) { - return getInstance().pathSetGetPathU8(pathSet, index, outPath); + return getInstance().NFD_PathSet_GetPathU8(pathSet, index, outPath); } /** - * Free the path gotten by {@link #pathSetGetPathN}. + * Free the path gotten by {@link #NFD_PathSet_GetPathN}. */ @overrun.marshal.gen.Entrypoint("NFD_PathSet_FreePathN") - public static void pathSetFreePathN( + public static void NFD_PathSet_FreePathN( @overrun.marshal.gen.CType("const nfdnchar_t*") java.lang.foreign.MemorySegment filePath) { - getInstance().pathSetFreePathN(filePath); + getInstance().NFD_PathSet_FreePathN(filePath); } /** - * Overloads {@link #pathSetFreePathN(java.lang.foreign.MemorySegment)} + * Overloads {@link #NFD_PathSet_FreePathN(java.lang.foreign.MemorySegment)} */ @overrun.marshal.gen.Entrypoint("NFD_PathSet_FreePathN") @overrun.marshal.gen.Skip - public static void pathSetFreePath( + public static void NFD_PathSet_FreePath( @overrun.marshal.gen.CType("const nfdnchar_t*") java.lang.foreign.MemorySegment filePath) { - getInstance().pathSetFreePath(filePath); + getInstance().NFD_PathSet_FreePath(filePath); } /** - * Free the path gotten by {@link #pathSetGetPathU8}. + * Free the path gotten by {@link #NFD_PathSet_GetPathU8}. */ @overrun.marshal.gen.Entrypoint("NFD_PathSet_FreePathU8") - public static void pathSetFreePathU8( + public static void NFD_PathSet_FreePathU8( @overrun.marshal.gen.CType("const nfdu8char_t*") java.lang.foreign.MemorySegment filePath) { - getInstance().pathSetFreePathU8(filePath); + getInstance().NFD_PathSet_FreePathU8(filePath); } /** * Gets an enumerator of the path set. *

- * It is the caller's responsibility to free {@code enumerator} via {@link #pathSetFreeEnum} + * It is the caller's responsibility to free {@code enumerator} via {@link #NFD_PathSet_FreeEnum} * if this function returns NFD_OKAY, and it should be freed before freeing the pathset. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PathSet_GetEnum") - public static int pathSetGetEnum( + public static int NFD_PathSet_GetEnum( @overrun.marshal.gen.CType("const nfdpathset_t*") java.lang.foreign.MemorySegment pathSet, @overrun.marshal.gen.CType("nfdpathsetenum_t*") java.lang.foreign.MemorySegment outEnumerator) { - return getInstance().pathSetGetEnum(pathSet, outEnumerator); + return getInstance().NFD_PathSet_GetEnum(pathSet, outEnumerator); } /** * Frees an enumerator of the path set. */ @overrun.marshal.gen.Entrypoint("NFD_PathSet_FreeEnum") - public static void pathSetFreeEnum( + public static void NFD_PathSet_FreeEnum( @overrun.marshal.gen.CType("nfdpathsetenum_t*") java.lang.foreign.MemorySegment enumerator) { - getInstance().pathSetFreeEnum(enumerator); + getInstance().NFD_PathSet_FreeEnum(enumerator); } /** * Gets the next item from the path set enumerator. *

* If there are no more items, then *outPaths will be set to null. - * It is the caller's responsibility to free {@code *outPath} via {@link #pathSetFreePathN} + * It is the caller's responsibility to free {@code *outPath} via {@link #NFD_PathSet_FreePathN} * if this function returns NFD_OKAY and {@code *outPath} is not null. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PathSet_EnumNextN") - public static int pathSetEnumNextN( + public static int NFD_PathSet_EnumNextN( @overrun.marshal.gen.CType("nfdpathsetenum_t*") java.lang.foreign.MemorySegment enumerator, @overrun.marshal.gen.CType("nfdnchar_t**") java.lang.foreign.MemorySegment outPath) { - return getInstance().pathSetEnumNextN(enumerator, outPath); + return getInstance().NFD_PathSet_EnumNextN(enumerator, outPath); } /** - * Overloads {@link #pathSetEnumNextN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)} + * Overloads {@link #NFD_PathSet_EnumNextN(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)} */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PathSet_EnumNextN") @overrun.marshal.gen.Skip - public static int pathSetEnumNext( + public static int NFD_PathSet_EnumNext( @overrun.marshal.gen.CType("nfdpathsetenum_t*") java.lang.foreign.MemorySegment enumerator, @overrun.marshal.gen.CType("nfdnchar_t**") java.lang.foreign.MemorySegment outPath) { - return getInstance().pathSetEnumNext(enumerator, outPath); + return getInstance().NFD_PathSet_EnumNext(enumerator, outPath); } /** * Gets the next item from the path set enumerator. *

* If there are no more items, then *outPaths will be set to null. - * It is the caller's responsibility to free {@code *outPath} via {@link #pathSetFreePathU8} + * It is the caller's responsibility to free {@code *outPath} via {@link #NFD_PathSet_FreePathU8} * if this function returns NFD_OKAY and {@code *outPath} is not null. */ @overrun.marshal.gen.CType("nfdresult_t") @overrun.marshal.gen.Entrypoint("NFD_PathSet_EnumNextU8") - public static int pathSetEnumNextU8( + public static int NFD_PathSet_EnumNextU8( @overrun.marshal.gen.CType("nfdpathsetenum_t*") java.lang.foreign.MemorySegment enumerator, @overrun.marshal.gen.CType("nfdu8char_t**") java.lang.foreign.MemorySegment outPath) { - return getInstance().pathSetEnumNextU8(enumerator, outPath); + return getInstance().NFD_PathSet_EnumNextU8(enumerator, outPath); } /** * Free the pathSet */ @overrun.marshal.gen.Entrypoint("NFD_PathSet_Free") - public static void pathSetFree( + public static void NFD_PathSet_Free( @overrun.marshal.gen.CType("const nfdpathset_t*") java.lang.foreign.MemorySegment pathSet) { - getInstance().pathSetFree(pathSet); + getInstance().NFD_PathSet_Free(pathSet); } /** - * Overloads {@link #openDialogN(MemorySegment, MemorySegment, int, MemorySegment)} + * Overloads {@link #NFD_OpenDialogN(MemorySegment, MemorySegment, int, MemorySegment)} */ - public static int openDialogN(java.lang.String[] outPath, overrungl.nfd.NFDNFilterItem filterList, - java.lang.String defaultPath) { + public static int NFD_OpenDialogN(java.lang.String[] outPath, + overrungl.nfd.NFDNFilterItem filterList, java.lang.String defaultPath) { try (MemoryStack stack = MemoryStack.pushLocal()) { var seg = Marshal.marshal(stack, outPath, NFDInternal.nfdCharset); - int result = openDialogN(seg, Marshal.marshal(filterList), filterItemCount(filterList), Marshal.marshal(stack, defaultPath, NFDInternal.nfdCharset)); - if (result == OKAY) { + int result = NFD_OpenDialogN(seg, Marshal.marshal(filterList), filterItemCount(filterList), Marshal.marshal(stack, defaultPath, NFDInternal.nfdCharset)); + if (result == NFD_OKAY) { copyOutPathN(seg, outPath); } return result; } } /** - * Overloads {@link #openDialogN(MemorySegment, MemorySegment, int, MemorySegment)} + * Overloads {@link #NFD_OpenDialogN(MemorySegment, MemorySegment, int, MemorySegment)} */ - public static int openDialog(java.lang.String[] outPath, overrungl.nfd.NFDNFilterItem filterList, - java.lang.String defaultPath) { - return openDialogN(outPath, filterList, defaultPath); + public static int NFD_OpenDialog(java.lang.String[] outPath, + overrungl.nfd.NFDNFilterItem filterList, java.lang.String defaultPath) { + return NFD_OpenDialogN(outPath, filterList, defaultPath); } /** - * Overloads {@link #openDialogU8(MemorySegment, MemorySegment, int, MemorySegment)} + * Overloads {@link #NFD_OpenDialogU8(MemorySegment, MemorySegment, int, MemorySegment)} */ - public static int openDialogU8(java.lang.String[] outPath, overrungl.nfd.NFDU8FilterItem filterList, - java.lang.String defaultPath) { + public static int NFD_OpenDialogU8(java.lang.String[] outPath, + overrungl.nfd.NFDU8FilterItem filterList, java.lang.String defaultPath) { try (MemoryStack stack = MemoryStack.pushLocal()) { var seg = Marshal.marshal(stack, outPath); - int result = openDialogU8(seg, Marshal.marshal(filterList), filterItemCount(filterList), Marshal.marshal(stack, defaultPath)); - if (result == OKAY) { + int result = NFD_OpenDialogU8(seg, Marshal.marshal(filterList), filterItemCount(filterList), Marshal.marshal(stack, defaultPath)); + if (result == NFD_OKAY) { copyOutPathU8(seg, outPath); } return result; } } /** - * Overloads {@link #openDialogNWith(MemorySegment, MemorySegment)} + * Overloads {@link #NFD_OpenDialogN_With(MemorySegment, MemorySegment)} */ - public static int openDialogNWith(java.lang.String[] outPath, + public static int NFD_OpenDialogN_With(java.lang.String[] outPath, overrungl.nfd.NFDOpenDialogNArgs args) { try (MemoryStack stack = MemoryStack.pushLocal()) { var seg = Marshal.marshal(stack, outPath, NFDInternal.nfdCharset); - int result = openDialogNWith(seg, Marshal.marshal(args)); - if (result == OKAY) { + int result = NFD_OpenDialogN_With(seg, Marshal.marshal(args)); + if (result == NFD_OKAY) { copyOutPathN(seg, outPath); } return result; } } /** - * Overloads {@link #openDialogU8With(MemorySegment, MemorySegment)} + * Overloads {@link #NFD_OpenDialogU8_With(MemorySegment, MemorySegment)} */ - public static int openDialogU8With(java.lang.String[] outPath, + public static int NFD_OpenDialogU8_With(java.lang.String[] outPath, overrungl.nfd.NFDOpenDialogU8Args args) { try (MemoryStack stack = MemoryStack.pushLocal()) { var seg = Marshal.marshal(stack, outPath); - int result = openDialogU8With(seg, Marshal.marshal(args)); - if (result == OKAY) { + int result = NFD_OpenDialogU8_With(seg, Marshal.marshal(args)); + if (result == NFD_OKAY) { copyOutPathU8(seg, outPath); } return result; } } /** - * Overloads {@link #openDialogMultipleN(MemorySegment, MemorySegment, int, MemorySegment)} + * Overloads {@link #NFD_OpenDialogMultipleN(MemorySegment, MemorySegment, int, MemorySegment)} */ - public static int openDialogMultipleN(java.lang.foreign.MemorySegment outPaths, + public static int NFD_OpenDialogMultipleN(java.lang.foreign.MemorySegment outPaths, overrungl.nfd.NFDNFilterItem filterList, java.lang.String defaultPath) { try (MemoryStack stack = MemoryStack.pushLocal()) { - return openDialogMultipleN(outPaths, Marshal.marshal(filterList), filterItemCount(filterList), Marshal.marshal(stack, defaultPath, NFDInternal.nfdCharset)); + return NFD_OpenDialogMultipleN(outPaths, Marshal.marshal(filterList), filterItemCount(filterList), Marshal.marshal(stack, defaultPath, NFDInternal.nfdCharset)); } } /** - * Overloads {@link #openDialogMultipleN(MemorySegment, MemorySegment, int, MemorySegment)} + * Overloads {@link #NFD_OpenDialogMultipleN(MemorySegment, MemorySegment, int, MemorySegment)} */ - public static int openDialogMultiple(java.lang.foreign.MemorySegment outPaths, + public static int NFD_OpenDialogMultiple(java.lang.foreign.MemorySegment outPaths, overrungl.nfd.NFDNFilterItem filterList, java.lang.String defaultPath) { - return openDialogMultipleN(outPaths, filterList, defaultPath); + return NFD_OpenDialogMultipleN(outPaths, filterList, defaultPath); } /** - * Overloads {@link #openDialogMultipleU8(MemorySegment, MemorySegment, int, MemorySegment)} + * Overloads {@link #NFD_OpenDialogMultipleU8(MemorySegment, MemorySegment, int, MemorySegment)} */ - public static int openDialogMultipleU8(java.lang.foreign.MemorySegment outPaths, + public static int NFD_OpenDialogMultipleU8(java.lang.foreign.MemorySegment outPaths, overrungl.nfd.NFDU8FilterItem filterList, java.lang.String defaultPath) { try (MemoryStack stack = MemoryStack.pushLocal()) { - return openDialogMultipleU8(outPaths, Marshal.marshal(filterList), filterItemCount(filterList), Marshal.marshal(stack, defaultPath)); + return NFD_OpenDialogMultipleU8(outPaths, Marshal.marshal(filterList), filterItemCount(filterList), Marshal.marshal(stack, defaultPath)); } } /** - * Overloads {@link #openDialogMultipleNWith(MemorySegment, MemorySegment)} + * Overloads {@link #NFD_OpenDialogMultipleN_With(MemorySegment, MemorySegment)} */ - public static int openDialogMultipleNWith(java.lang.foreign.MemorySegment outPaths, + public static int NFD_OpenDialogMultipleN_With(java.lang.foreign.MemorySegment outPaths, overrungl.nfd.NFDOpenDialogNArgs args) { - return openDialogMultipleNWith(outPaths, Marshal.marshal(args)); + return NFD_OpenDialogMultipleN_With(outPaths, Marshal.marshal(args)); } /** - * Overloads {@link #openDialogMultipleU8With(MemorySegment, MemorySegment)} + * Overloads {@link #NFD_OpenDialogMultipleU8_With(MemorySegment, MemorySegment)} */ - public static int openDialogMultipleU8With(java.lang.foreign.MemorySegment outPaths, + public static int NFD_OpenDialogMultipleU8_With(java.lang.foreign.MemorySegment outPaths, overrungl.nfd.NFDOpenDialogU8Args args) { - return openDialogMultipleU8With(outPaths, Marshal.marshal(args)); + return NFD_OpenDialogMultipleU8_With(outPaths, Marshal.marshal(args)); } /** - * Overloads {@link #saveDialogN(MemorySegment, MemorySegment, int, MemorySegment, MemorySegment)} + * Overloads {@link #NFD_SaveDialogN(MemorySegment, MemorySegment, int, MemorySegment, MemorySegment)} */ - public static int saveDialogN(java.lang.String[] outPath, overrungl.nfd.NFDNFilterItem filterList, - java.lang.String defaultPath, java.lang.String defaultName) { + public static int NFD_SaveDialogN(java.lang.String[] outPath, + overrungl.nfd.NFDNFilterItem filterList, java.lang.String defaultPath, + java.lang.String defaultName) { try (MemoryStack stack = MemoryStack.pushLocal()) { var seg = Marshal.marshal(stack, outPath, NFDInternal.nfdCharset); - int result = saveDialogN(seg, Marshal.marshal(filterList), filterItemCount(filterList), Marshal.marshal(stack, defaultPath, NFDInternal.nfdCharset), Marshal.marshal(stack, defaultName, NFDInternal.nfdCharset)); - if (result == OKAY) { + int result = NFD_SaveDialogN(seg, Marshal.marshal(filterList), filterItemCount(filterList), Marshal.marshal(stack, defaultPath, NFDInternal.nfdCharset), Marshal.marshal(stack, defaultName, NFDInternal.nfdCharset)); + if (result == NFD_OKAY) { copyOutPathN(seg, outPath); } return result; } } /** - * Overloads {@link #saveDialogN(MemorySegment, MemorySegment, int, MemorySegment, MemorySegment)} + * Overloads {@link #NFD_SaveDialogN(MemorySegment, MemorySegment, int, MemorySegment, MemorySegment)} */ - public static int saveDialog(java.lang.String[] outPath, overrungl.nfd.NFDNFilterItem filterList, - java.lang.String defaultPath, java.lang.String defaultName) { - return saveDialogN(outPath, filterList, defaultPath, defaultName); + public static int NFD_SaveDialog(java.lang.String[] outPath, + overrungl.nfd.NFDNFilterItem filterList, java.lang.String defaultPath, + java.lang.String defaultName) { + return NFD_SaveDialogN(outPath, filterList, defaultPath, defaultName); } /** - * Overloads {@link #saveDialogU8(MemorySegment, MemorySegment, int, MemorySegment, MemorySegment)} + * Overloads {@link #NFD_SaveDialogU8(MemorySegment, MemorySegment, int, MemorySegment, MemorySegment)} */ - public static int saveDialogU8(java.lang.String[] outPath, overrungl.nfd.NFDU8FilterItem filterList, - java.lang.String defaultPath, java.lang.String defaultName) { + public static int NFD_SaveDialogU8(java.lang.String[] outPath, + overrungl.nfd.NFDU8FilterItem filterList, java.lang.String defaultPath, + java.lang.String defaultName) { try (MemoryStack stack = MemoryStack.pushLocal()) { var seg = Marshal.marshal(stack, outPath); - int result = saveDialogU8(seg, Marshal.marshal(filterList), filterItemCount(filterList), Marshal.marshal(stack, defaultPath), Marshal.marshal(stack, defaultName)); - if (result == OKAY) { + int result = NFD_SaveDialogU8(seg, Marshal.marshal(filterList), filterItemCount(filterList), Marshal.marshal(stack, defaultPath), Marshal.marshal(stack, defaultName)); + if (result == NFD_OKAY) { copyOutPathU8(seg, outPath); } return result; } } /** - * Overloads {@link #saveDialogNWith(MemorySegment, MemorySegment)} + * Overloads {@link #NFD_SaveDialogN_With(MemorySegment, MemorySegment)} */ - public static int saveDialogNWith(java.lang.String[] outPath, + public static int NFD_SaveDialogN_With(java.lang.String[] outPath, overrungl.nfd.NFDSaveDialogNArgs args) { try (MemoryStack stack = MemoryStack.pushLocal()) { var seg = Marshal.marshal(stack, outPath, NFDInternal.nfdCharset); - int result = saveDialogNWith(seg, Marshal.marshal(args)); - if (result == OKAY) { + int result = NFD_SaveDialogN_With(seg, Marshal.marshal(args)); + if (result == NFD_OKAY) { copyOutPathN(seg, outPath); } return result; } } /** - * Overloads {@link #saveDialogU8With(MemorySegment, MemorySegment)} + * Overloads {@link #NFD_SaveDialogU8_With(MemorySegment, MemorySegment)} */ - public static int saveDialogU8With(java.lang.String[] outPath, + public static int NFD_SaveDialogU8_With(java.lang.String[] outPath, overrungl.nfd.NFDSaveDialogU8Args args) { try (MemoryStack stack = MemoryStack.pushLocal()) { var seg = Marshal.marshal(stack, outPath); - int result = saveDialogU8With(seg, Marshal.marshal(args)); - if (result == OKAY) { + int result = NFD_SaveDialogU8_With(seg, Marshal.marshal(args)); + if (result == NFD_OKAY) { copyOutPathU8(seg, outPath); } return result; } } /** - * Overloads {@link #pickFolderN(MemorySegment, MemorySegment)} + * Overloads {@link #NFD_PickFolderN(MemorySegment, MemorySegment)} */ - public static int pickFolderN(java.lang.String[] outPath, java.lang.String defaultPath) { + public static int NFD_PickFolderN(java.lang.String[] outPath, java.lang.String defaultPath) { try (MemoryStack stack = MemoryStack.pushLocal()) { var seg = Marshal.marshal(stack, outPath, NFDInternal.nfdCharset); - int result = pickFolderN(seg, Marshal.marshal(stack, defaultPath, NFDInternal.nfdCharset)); - if (result == OKAY) { + int result = NFD_PickFolderN(seg, Marshal.marshal(stack, defaultPath, NFDInternal.nfdCharset)); + if (result == NFD_OKAY) { copyOutPathN(seg, outPath); } return result; } } /** - * Overloads {@link #pickFolderN(MemorySegment, MemorySegment)} + * Overloads {@link #NFD_PickFolderN(MemorySegment, MemorySegment)} */ - public static int pickFolder(java.lang.String[] outPath, java.lang.String defaultPath) { - return pickFolderN(outPath, defaultPath); + public static int NFD_PickFolder(java.lang.String[] outPath, java.lang.String defaultPath) { + return NFD_PickFolderN(outPath, defaultPath); } /** - * Overloads {@link #pickFolderU8(MemorySegment, MemorySegment)} + * Overloads {@link #NFD_PickFolderU8(MemorySegment, MemorySegment)} */ - public static int pickFolderU8(java.lang.String[] outPath, java.lang.String defaultPath) { + public static int NFD_PickFolderU8(java.lang.String[] outPath, java.lang.String defaultPath) { try (MemoryStack stack = MemoryStack.pushLocal()) { var seg = Marshal.marshal(stack, outPath); - int result = pickFolderU8(seg, Marshal.marshal(stack, defaultPath)); - if (result == OKAY) { + int result = NFD_PickFolderU8(seg, Marshal.marshal(stack, defaultPath)); + if (result == NFD_OKAY) { copyOutPathU8(seg, outPath); } return result; } } /** - * Overloads {@link #pickFolderNWith(MemorySegment, MemorySegment)} + * Overloads {@link #NFD_PickFolderN_With(MemorySegment, MemorySegment)} */ - public static int pickFolderNWith(java.lang.String[] outPath, + public static int NFD_PickFolderN_With(java.lang.String[] outPath, overrungl.nfd.NFDPickFolderNArgs args) { try (MemoryStack stack = MemoryStack.pushLocal()) { var seg = Marshal.marshal(stack, outPath, NFDInternal.nfdCharset); - int result = pickFolderNWith(seg, Marshal.marshal(args)); - if (result == OKAY) { + int result = NFD_PickFolderN_With(seg, Marshal.marshal(args)); + if (result == NFD_OKAY) { copyOutPathN(seg, outPath); } return result; } } /** - * Overloads {@link #pickFolderU8With(MemorySegment, MemorySegment)} + * Overloads {@link #NFD_PickFolderU8_With(MemorySegment, MemorySegment)} */ - public static int pickFolderU8With(java.lang.String[] outPath, + public static int NFD_PickFolderU8_With(java.lang.String[] outPath, overrungl.nfd.NFDPickFolderU8Args args) { try (MemoryStack stack = MemoryStack.pushLocal()) { var seg = Marshal.marshal(stack, outPath); - int result = pickFolderU8With(seg, Marshal.marshal(args)); - if (result == OKAY) { + int result = NFD_PickFolderU8_With(seg, Marshal.marshal(args)); + if (result == NFD_OKAY) { copyOutPathU8(seg, outPath); } return result; } } /** - * Overloads {@link #pickFolderMultipleN(MemorySegment, MemorySegment)} + * Overloads {@link #NFD_PickFolderMultipleN(MemorySegment, MemorySegment)} */ - public static int pickFolderMultipleN(java.lang.foreign.MemorySegment outPaths, + public static int NFD_PickFolderMultipleN(java.lang.foreign.MemorySegment outPaths, java.lang.String defaultPath) { try (MemoryStack stack = MemoryStack.pushLocal()) { - return pickFolderMultipleN(outPaths, Marshal.marshal(stack, defaultPath, NFDInternal.nfdCharset)); + return NFD_PickFolderMultipleN(outPaths, Marshal.marshal(stack, defaultPath, NFDInternal.nfdCharset)); } } /** - * Overloads {@link #pickFolderMultipleN(MemorySegment, MemorySegment)} + * Overloads {@link #NFD_PickFolderMultipleN(MemorySegment, MemorySegment)} */ - public static int pickFolderMultiple(java.lang.foreign.MemorySegment outPaths, + public static int NFD_PickFolderMultiple(java.lang.foreign.MemorySegment outPaths, java.lang.String defaultPath) { - return pickFolderMultipleN(outPaths, defaultPath); + return NFD_PickFolderMultipleN(outPaths, defaultPath); } /** - * Overloads {@link #pickFolderMultipleU8(MemorySegment, MemorySegment)} + * Overloads {@link #NFD_PickFolderMultipleU8(MemorySegment, MemorySegment)} */ - public static int pickFolderMultipleU8(java.lang.foreign.MemorySegment outPaths, + public static int NFD_PickFolderMultipleU8(java.lang.foreign.MemorySegment outPaths, java.lang.String defaultPath) { try (MemoryStack stack = MemoryStack.pushLocal()) { - return pickFolderMultipleU8(outPaths, Marshal.marshal(stack, defaultPath)); + return NFD_PickFolderMultipleU8(outPaths, Marshal.marshal(stack, defaultPath)); } } /** - * Overloads {@link #pickFolderMultipleNWith(MemorySegment, MemorySegment)} + * Overloads {@link #NFD_PickFolderMultipleN_With(MemorySegment, MemorySegment)} */ - public static int pickFolderMultipleNWith(java.lang.foreign.MemorySegment outPaths, + public static int NFD_PickFolderMultipleN_With(java.lang.foreign.MemorySegment outPaths, overrungl.nfd.NFDPickFolderNArgs args) { - return pickFolderMultipleNWith(outPaths, Marshal.marshal(args)); + return NFD_PickFolderMultipleN_With(outPaths, Marshal.marshal(args)); } /** - * Overloads {@link #pickFolderMultipleU8With(MemorySegment, MemorySegment)} + * Overloads {@link #NFD_PickFolderMultipleU8_With(MemorySegment, MemorySegment)} */ - public static int pickFolderMultipleU8With(java.lang.foreign.MemorySegment outPaths, + public static int NFD_PickFolderMultipleU8_With(java.lang.foreign.MemorySegment outPaths, overrungl.nfd.NFDPickFolderU8Args args) { - return pickFolderMultipleU8With(outPaths, Marshal.marshal(args)); + return NFD_PickFolderMultipleU8_With(outPaths, Marshal.marshal(args)); } /** - * Overloads {@link #pathSetGetPathN(MemorySegment, long, MemorySegment)} + * Overloads {@link #NFD_PathSet_GetPathN(MemorySegment, long, MemorySegment)} */ - public static int pathSetGetPathN(java.lang.foreign.MemorySegment pathSet, long index, + public static int NFD_PathSet_GetPathN(java.lang.foreign.MemorySegment pathSet, long index, java.lang.String[] outPath) { try (MemoryStack stack = MemoryStack.pushLocal()) { var seg = Marshal.marshal(stack, outPath, NFDInternal.nfdCharset); - int result = pathSetGetPathN(pathSet, index, seg); - if (result == OKAY) { + int result = NFD_PathSet_GetPathN(pathSet, index, seg); + if (result == NFD_OKAY) { copyPathSetOutPathN(seg, outPath); } return result; } } /** - * Overloads {@link #pathSetGetPathN(MemorySegment, long, MemorySegment)} + * Overloads {@link #NFD_PathSet_GetPathN(MemorySegment, long, MemorySegment)} */ - public static int pathSetGetPath(java.lang.foreign.MemorySegment pathSet, long index, + public static int NFD_PathSet_GetPath(java.lang.foreign.MemorySegment pathSet, long index, java.lang.String[] outPath) { - return pathSetGetPathN(pathSet, index, outPath); + return NFD_PathSet_GetPathN(pathSet, index, outPath); } /** - * Overloads {@link #pathSetGetPathU8(MemorySegment, long, MemorySegment)} + * Overloads {@link #NFD_PathSet_GetPathU8(MemorySegment, long, MemorySegment)} */ - public static int pathSetGetPathU8(java.lang.foreign.MemorySegment pathSet, long index, + public static int NFD_PathSet_GetPathU8(java.lang.foreign.MemorySegment pathSet, long index, java.lang.String[] outPath) { try (MemoryStack stack = MemoryStack.pushLocal()) { var seg = Marshal.marshal(stack, outPath); - int result = pathSetGetPathU8(pathSet, index, seg); - if (result == OKAY) { + int result = NFD_PathSet_GetPathU8(pathSet, index, seg); + if (result == NFD_OKAY) { copyPathSetOutPathU8(seg, outPath); } return result; } } /** - * Overloads {@link #pathSetEnumNextN(MemorySegment, MemorySegment)} + * Overloads {@link #NFD_PathSet_EnumNextN(MemorySegment, MemorySegment)} */ - public static int pathSetEnumNextN(java.lang.foreign.MemorySegment enumerator, + public static int NFD_PathSet_EnumNextN(java.lang.foreign.MemorySegment enumerator, java.lang.String[] outPath) { try (MemoryStack stack = MemoryStack.pushLocal()) { var seg = Marshal.marshal(stack, outPath, NFDInternal.nfdCharset); - int result = pathSetEnumNextN(enumerator, seg); - if (result == OKAY) { + int result = NFD_PathSet_EnumNextN(enumerator, seg); + if (result == NFD_OKAY) { copyPathSetOutPathN(seg, outPath); } return result; } } /** - * Overloads {@link #pathSetEnumNextN(MemorySegment, MemorySegment)} + * Overloads {@link #NFD_PathSet_EnumNextN(MemorySegment, MemorySegment)} */ - public static int pathSetEnumNext(java.lang.foreign.MemorySegment enumerator, + public static int NFD_PathSet_EnumNext(java.lang.foreign.MemorySegment enumerator, java.lang.String[] outPath) { - return pathSetEnumNextN(enumerator, outPath); + return NFD_PathSet_EnumNextN(enumerator, outPath); } /** - * Overloads {@link #pathSetEnumNextU8(MemorySegment, MemorySegment)} + * Overloads {@link #NFD_PathSet_EnumNextU8(MemorySegment, MemorySegment)} */ - public static int pathSetEnumNextU8(java.lang.foreign.MemorySegment enumerator, + public static int NFD_PathSet_EnumNextU8(java.lang.foreign.MemorySegment enumerator, java.lang.String[] outPath) { try (MemoryStack stack = MemoryStack.pushLocal()) { var seg = Marshal.marshal(stack, outPath); - int result = pathSetEnumNextU8(enumerator, seg); - if (result == OKAY) { + int result = NFD_PathSet_EnumNextU8(enumerator, seg); + if (result == NFD_OKAY) { copyPathSetOutPathU8(seg, outPath); } return result; @@ -1213,7 +1218,7 @@ private static void copyOutPathN(MemorySegment src, String[] outPath) { Unmarshal.copy(src, outPath, NFDInternal.nfdCharset); MemorySegment segment = src.get(ValueLayout.ADDRESS, 0); if (!Unmarshal.isNullPointer(segment)) { - freePathN(segment); + NFD_FreePathN(segment); } } @@ -1221,7 +1226,7 @@ private static void copyOutPathU8(MemorySegment src, String[] outPath) { Unmarshal.copy(src, outPath); MemorySegment segment = src.get(ValueLayout.ADDRESS, 0); if (!Unmarshal.isNullPointer(segment)) { - freePathU8(segment); + NFD_FreePathU8(segment); } } @@ -1229,7 +1234,7 @@ private static void copyPathSetOutPathN(MemorySegment src, String[] outPath) { Unmarshal.copy(src, outPath, NFDInternal.nfdCharset); MemorySegment segment = src.get(ValueLayout.ADDRESS, 0); if (!Unmarshal.isNullPointer(segment)) { - pathSetFreePathN(segment); + NFD_PathSet_FreePathN(segment); } } @@ -1237,7 +1242,7 @@ private static void copyPathSetOutPathU8(MemorySegment src, String[] outPath) { Unmarshal.copy(src, outPath); MemorySegment segment = src.get(ValueLayout.ADDRESS, 0); if (!Unmarshal.isNullPointer(segment)) { - pathSetFreePathU8(segment); + NFD_PathSet_FreePathU8(segment); } } diff --git a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDEnumerator.java b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDEnumerator.java index 237467aa..69019bcf 100644 --- a/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDEnumerator.java +++ b/modules/overrungl.nfd/src/main/java/overrungl/nfd/NFDEnumerator.java @@ -28,6 +28,7 @@ import java.util.NoSuchElementException; import static java.lang.foreign.ValueLayout.ADDRESS; +import static overrungl.nfd.NFD.*; /** * A wrapper of NFD path set enumerator. @@ -35,7 +36,7 @@ * Users are responsible to close the instance after the iteration finished. * * @author squid233 - * @see NFD#pathSetGetEnum(MemorySegment, MemorySegment) + * @see NFD#NFD_PathSet_GetEnum(MemorySegment, MemorySegment) NFD_PathSet_GetEnum * @since 0.1.0 */ public final class NFDEnumerator implements Iterable, AutoCloseable { @@ -80,11 +81,11 @@ public String next() { } try (MemoryStack stack = MemoryStack.pushLocal()) { MemorySegment outPath = stack.allocate(ADDRESS); - int result = NFD.pathSetEnumNext(segment, outPath); - if (result == NFD.ERROR) throw errorIterating(); + int result = NFD_PathSet_EnumNext(segment, outPath); + if (result == NFD_ERROR) throw errorIterating(); nextPath = Unmarshal.unmarshalStringPointer(outPath, NFDInternal.nfdCharset); if (nextPath != null) { - NFD.pathSetFreePath(outPath.get(ADDRESS, 0)); + NFD_PathSet_FreePath(outPath.get(ADDRESS, 0)); } } return curr; @@ -92,7 +93,8 @@ public String next() { } /** - * Creates an enumerator from the given path set that is created with {@link NFD#openDialogMultiple}. + * Creates an enumerator from the given path set created with + * {@link NFD#NFD_OpenDialogMultiple(MemorySegment, NFDNFilterItem, String) NFD_OpenDialogMultiple}. * * @param allocator the allocator of the enumerator. * @param pathSet the path set. @@ -100,15 +102,15 @@ public String next() { */ public static Tuple2.OfObjInt fromPathSet(SegmentAllocator allocator, MemorySegment pathSet) { MemorySegment struct = allocator.allocate(MemoryLayout.structLayout(ADDRESS)); - int result = NFD.pathSetGetEnum(pathSet, struct); - return new Tuple2.OfObjInt<>(result == NFD.OKAY ? + int result = NFD_PathSet_GetEnum(pathSet, struct); + return new Tuple2.OfObjInt<>(result == NFD_OKAY ? new NFDEnumerator(struct) : null, result); } private static IllegalStateException errorIterating() { - return new IllegalStateException("Error iterating: " + NFD.getError()); + return new IllegalStateException("Error iterating: " + NFD_GetError()); } @NotNull @@ -117,16 +119,16 @@ public Iterator iterator() { // TODO: 2023/7/6 Value object try (MemoryStack stack = MemoryStack.pushLocal()) { MemorySegment outPath = stack.allocate(ADDRESS); - int result = NFD.pathSetEnumNext(segment, outPath); + int result = NFD_PathSet_EnumNext(segment, outPath); switch (result) { - case NFD.OKAY -> { + case NFD_OKAY -> { String path = Unmarshal.unmarshalStringPointer(outPath, NFDInternal.nfdCharset); if (path != null) { - NFD.pathSetFreePath(outPath.get(ADDRESS, 0)); + NFD_PathSet_FreePath(outPath.get(ADDRESS, 0)); } return new EnumIterator(path); } - case NFD.CANCEL -> { + case NFD_CANCEL -> { return EMPTY_ITERATOR; } default -> throw errorIterating(); @@ -136,6 +138,6 @@ public Iterator iterator() { @Override public void close() { - NFD.pathSetFreeEnum(segment); + NFD_PathSet_FreeEnum(segment); } } diff --git a/modules/samples/src/test/java/overrungl/demo/nfd/NFDTest.java b/modules/samples/src/test/java/overrungl/demo/nfd/NFDTest.java index 0c466409..8469dbb2 100644 --- a/modules/samples/src/test/java/overrungl/demo/nfd/NFDTest.java +++ b/modules/samples/src/test/java/overrungl/demo/nfd/NFDTest.java @@ -19,12 +19,13 @@ import io.github.overrun.memstack.MemoryStack; import overrungl.nfd.NFDEnumerator; import overrungl.nfd.NFDNFilterItem; -import overrungl.nfd.NFD; import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; import java.util.Map; +import static overrungl.nfd.NFD.*; + /** * @author squid233 * @since 0.1.0 @@ -35,7 +36,7 @@ private static void openDialog() { // initialize NFD // either call NFD::init at the start of your program and NFD::quit at the end of your program, // or before/after every time you want to show a file dialog. - NFD.init(); + NFD_Init(); try (MemoryStack stack = MemoryStack.pushLocal()) { String[] outPath = new String[1]; @@ -46,17 +47,17 @@ private static void openDialog() { Map.entry("Image file", "png,jpg")); // show the dialog - final int result = NFD.openDialog(outPath, filterItem, null); + final int result = NFD_OpenDialog(outPath, filterItem, null); switch (result) { - case NFD.ERROR -> System.err.println("Error: " + NFD.getError()); - case NFD.OKAY -> System.out.println("Success! " + outPath[0]); - case NFD.CANCEL -> System.out.println("User pressed cancel."); + case NFD_ERROR -> System.err.println("Error: " + NFD_GetError()); + case NFD_OKAY -> System.out.println("Success! " + outPath[0]); + case NFD_CANCEL -> System.out.println("User pressed cancel."); } } // Quit NFD - NFD.quit(); + NFD_Quit(); } private static void openDialogMultiple() { @@ -64,7 +65,7 @@ private static void openDialogMultiple() { // initialize NFD // either call NFD::init at the start of your program and NFD::quit at the end of your program, // or before/after every time you want to show a file dialog. - NFD.init(); + NFD_Init(); try (MemoryStack stack = MemoryStack.pushLocal()) { MemorySegment pOutPaths = stack.allocate(ValueLayout.ADDRESS); @@ -76,30 +77,30 @@ private static void openDialogMultiple() { Map.entry("Image file", "png,jpg")); // show the dialog - final int result = NFD.openDialogMultiple(pOutPaths, filterItem, null); + final int result = NFD_OpenDialogMultiple(pOutPaths, filterItem, null); MemorySegment outPaths = pOutPaths.get(ValueLayout.ADDRESS, 0); switch (result) { - case NFD.ERROR -> System.err.println("Error: " + NFD.getError()); - case NFD.OKAY -> { + case NFD_ERROR -> System.err.println("Error: " + NFD_GetError()); + case NFD_OKAY -> { System.out.println("Success!"); long[] pNumPaths = new long[1]; - NFD.pathSetGetCount(outPaths, pNumPaths); + NFD_PathSet_GetCount(outPaths, pNumPaths); for (long i = 0, numPaths = pNumPaths[0]; i < numPaths; i++) { - NFD.pathSetGetPath(outPaths, i, outPath); + NFD_PathSet_GetPath(outPaths, i, outPath); System.out.println("Path " + i + ": " + outPath[0]); } // remember to free the path-set memory (since NFDResult::OKAY is returned) - NFD.pathSetFree(outPaths); + NFD_PathSet_Free(outPaths); } - case NFD.CANCEL -> System.out.println("User pressed cancel."); + case NFD_CANCEL -> System.out.println("User pressed cancel."); } } // Quit NFD - NFD.quit(); + NFD_Quit(); } private static void openDialogMultipleEnum() { @@ -107,7 +108,7 @@ private static void openDialogMultipleEnum() { // initialize NFD // either call NFD::init at the start of your program and NFD::quit at the end of your program, // or before/after every time you want to show a file dialog. - NFD.init(); + NFD_Init(); try (MemoryStack stack = MemoryStack.pushLocal()) { MemorySegment pOutPaths = stack.allocate(ValueLayout.ADDRESS); @@ -118,12 +119,12 @@ private static void openDialogMultipleEnum() { Map.entry("Image file", "png,jpg")); // show the dialog - final int result = NFD.openDialogMultiple(pOutPaths, filterItem, null); + final int result = NFD_OpenDialogMultiple(pOutPaths, filterItem, null); MemorySegment outPaths = pOutPaths.get(ValueLayout.ADDRESS, 0); switch (result) { - case NFD.ERROR -> System.err.println("Error: " + NFD.getError()); - case NFD.OKAY -> { + case NFD_ERROR -> System.err.println("Error: " + NFD_GetError()); + case NFD_OKAY -> { System.out.println("Success!"); try (NFDEnumerator enumerator = NFDEnumerator.fromPathSet(stack, outPaths).x()) { @@ -135,14 +136,14 @@ private static void openDialogMultipleEnum() { } // remember to free the path-set memory (since NFDResult::OKAY is returned) - NFD.pathSetFree(outPaths); + NFD_PathSet_Free(outPaths); } - case NFD.CANCEL -> System.out.println("User pressed cancel."); + case NFD_CANCEL -> System.out.println("User pressed cancel."); } } // Quit NFD - NFD.quit(); + NFD_Quit(); } private static void pickFolder() { @@ -150,20 +151,20 @@ private static void pickFolder() { // initialize NFD // either call NFD::init at the start of your program and NFD::quit at the end of your program, // or before/after every time you want to show a file dialog. - NFD.init(); + NFD_Init(); String[] outPath = new String[1]; // show the dialog - final int result = NFD.pickFolder(outPath, null); + final int result = NFD_PickFolder(outPath, null); switch (result) { - case NFD.ERROR -> System.err.println("Error: " + NFD.getError()); - case NFD.OKAY -> System.out.println("Success! " + outPath[0]); - case NFD.CANCEL -> System.out.println("User pressed cancel."); + case NFD_ERROR -> System.err.println("Error: " + NFD_GetError()); + case NFD_OKAY -> System.out.println("Success! " + outPath[0]); + case NFD_CANCEL -> System.out.println("User pressed cancel."); } // Quit NFD - NFD.quit(); + NFD_Quit(); } private static void saveDialog() { @@ -171,7 +172,7 @@ private static void saveDialog() { // initialize NFD // either call NFD::init at the start of your program and NFD::quit at the end of your program, // or before/after every time you want to show a file dialog. - NFD.init(); + NFD_Init(); try (MemoryStack stack = MemoryStack.pushLocal()) { String[] savePath = new String[1]; @@ -182,16 +183,16 @@ private static void saveDialog() { Map.entry("Image file", "png,jpg")); // show the dialog - final int result = NFD.saveDialog(savePath, filterItem, null, "Untitled.java"); + final int result = NFD_SaveDialog(savePath, filterItem, null, "Untitled.java"); switch (result) { - case NFD.ERROR -> System.err.println("Error: " + NFD.getError()); - case NFD.OKAY -> System.out.println("Success! " + savePath[0]); - case NFD.CANCEL -> System.out.println("User pressed cancel."); + case NFD_ERROR -> System.err.println("Error: " + NFD_GetError()); + case NFD_OKAY -> System.out.println("Success! " + savePath[0]); + case NFD_CANCEL -> System.out.println("User pressed cancel."); } } // Quit NFD - NFD.quit(); + NFD_Quit(); } public static void main(String[] args) { diff --git a/settings.gradle.kts b/settings.gradle.kts index 164c7a08..8f50c092 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -20,5 +20,6 @@ file("modules").listFiles()?.forEach { include( "generators:nfd", "generators:opengl", + "generators:stb", "generators:vulkan" )