-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exploring what a helper module might look like (#19)
- Loading branch information
Showing
96 changed files
with
26,180 additions
and
21,349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
core/src/main/java/app/photofox/vipsffm/generated/GValue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Generated by jextract | ||
|
||
package app.photofox.vipsffm.generated; | ||
|
||
import java.lang.invoke.*; | ||
import java.lang.foreign.*; | ||
import java.nio.ByteOrder; | ||
import java.util.*; | ||
import java.util.function.*; | ||
import java.util.stream.*; | ||
|
||
import static java.lang.foreign.ValueLayout.*; | ||
import static java.lang.foreign.MemoryLayout.PathElement.*; | ||
|
||
/** | ||
* {@snippet lang=c : | ||
* typedef struct _GValue GValue | ||
* } | ||
*/ | ||
public class GValue extends _GValue { | ||
|
||
GValue() { | ||
// Should not be called directly | ||
} | ||
} | ||
|
26 changes: 26 additions & 0 deletions
26
core/src/main/java/app/photofox/vipsffm/generated/GValueArray.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Generated by jextract | ||
|
||
package app.photofox.vipsffm.generated; | ||
|
||
import java.lang.invoke.*; | ||
import java.lang.foreign.*; | ||
import java.nio.ByteOrder; | ||
import java.util.*; | ||
import java.util.function.*; | ||
import java.util.stream.*; | ||
|
||
import static java.lang.foreign.ValueLayout.*; | ||
import static java.lang.foreign.MemoryLayout.PathElement.*; | ||
|
||
/** | ||
* {@snippet lang=c : | ||
* typedef struct _GValueArray GValueArray | ||
* } | ||
*/ | ||
public class GValueArray extends _GValueArray { | ||
|
||
GValueArray() { | ||
// Should not be called directly | ||
} | ||
} | ||
|
68 changes: 68 additions & 0 deletions
68
core/src/main/java/app/photofox/vipsffm/generated/GValueTransform.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// Generated by jextract | ||
|
||
package app.photofox.vipsffm.generated; | ||
|
||
import java.lang.invoke.*; | ||
import java.lang.foreign.*; | ||
import java.nio.ByteOrder; | ||
import java.util.*; | ||
import java.util.function.*; | ||
import java.util.stream.*; | ||
|
||
import static java.lang.foreign.ValueLayout.*; | ||
import static java.lang.foreign.MemoryLayout.PathElement.*; | ||
|
||
/** | ||
* {@snippet lang=c : | ||
* typedef void (*GValueTransform)(const GValue *, GValue *) | ||
* } | ||
*/ | ||
public class GValueTransform { | ||
|
||
GValueTransform() { | ||
// Should not be called directly | ||
} | ||
|
||
/** | ||
* The function pointer signature, expressed as a functional interface | ||
*/ | ||
public interface Function { | ||
void apply(MemorySegment src_value, MemorySegment dest_value); | ||
} | ||
|
||
private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid( | ||
VipsRaw.C_POINTER, | ||
VipsRaw.C_POINTER | ||
); | ||
|
||
/** | ||
* The descriptor of this function pointer | ||
*/ | ||
public static FunctionDescriptor descriptor() { | ||
return $DESC; | ||
} | ||
|
||
private static final MethodHandle UP$MH = VipsRaw.upcallHandle(GValueTransform.Function.class, "apply", $DESC); | ||
|
||
/** | ||
* Allocates a new upcall stub, whose implementation is defined by {@code fi}. | ||
* The lifetime of the returned segment is managed by {@code arena} | ||
*/ | ||
public static MemorySegment allocate(GValueTransform.Function fi, Arena arena) { | ||
return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); | ||
} | ||
|
||
private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); | ||
|
||
/** | ||
* Invoke the upcall stub {@code funcPtr}, with given parameters | ||
*/ | ||
public static void invoke(MemorySegment funcPtr,MemorySegment src_value, MemorySegment dest_value) { | ||
try { | ||
DOWN$MH.invokeExact(funcPtr, src_value, dest_value); | ||
} catch (Throwable ex$) { | ||
throw new AssertionError("should not reach here", ex$); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.