org.purejava.appindicator._GtkBindingArg Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of libappindicator-gtk3-java-full Show documentation
Show all versions of libappindicator-gtk3-java-full Show documentation
Java bindings for libappindicator-gtk3 in 100% pure Java
// Generated by jextract
package org.purejava.appindicator;
import java.lang.foreign.Arena;
import java.lang.foreign.MemoryLayout;
import java.lang.foreign.MemorySegment;
import java.lang.foreign.SegmentAllocator;
import java.lang.invoke.VarHandle;
/**
* {@snippet :
* struct _GtkBindingArg {
* unsigned long arg_type;
* union d;
* };
* }
*/
public class _GtkBindingArg {
public static MemoryLayout $LAYOUT() {
return constants$2530.const$5;
}
public static VarHandle arg_type$VH() {
return constants$2531.const$0;
}
/**
* Getter for field:
* {@snippet :
* unsigned long arg_type;
* }
*/
public static long arg_type$get(MemorySegment seg) {
return (long)constants$2531.const$0.get(seg);
}
/**
* Setter for field:
* {@snippet :
* unsigned long arg_type;
* }
*/
public static void arg_type$set(MemorySegment seg, long x) {
constants$2531.const$0.set(seg, x);
}
public static long arg_type$get(MemorySegment seg, long index) {
return (long)constants$2531.const$0.get(seg.asSlice(index*sizeof()));
}
public static void arg_type$set(MemorySegment seg, long index, long x) {
constants$2531.const$0.set(seg.asSlice(index*sizeof()), x);
}
/**
* {@snippet :
* union {
* long long_data;
* double double_data;
* char* string_data;
* };
* }
*/
public static final class d {
// Suppresses default constructor, ensuring non-instantiability.
private d() {}
public static MemoryLayout $LAYOUT() {
return constants$2531.const$1;
}
public static VarHandle long_data$VH() {
return constants$2531.const$2;
}
/**
* Getter for field:
* {@snippet :
* long long_data;
* }
*/
public static long long_data$get(MemorySegment seg) {
return (long)constants$2531.const$2.get(seg);
}
/**
* Setter for field:
* {@snippet :
* long long_data;
* }
*/
public static void long_data$set(MemorySegment seg, long x) {
constants$2531.const$2.set(seg, x);
}
public static long long_data$get(MemorySegment seg, long index) {
return (long)constants$2531.const$2.get(seg.asSlice(index*sizeof()));
}
public static void long_data$set(MemorySegment seg, long index, long x) {
constants$2531.const$2.set(seg.asSlice(index*sizeof()), x);
}
public static VarHandle double_data$VH() {
return constants$2531.const$3;
}
/**
* Getter for field:
* {@snippet :
* double double_data;
* }
*/
public static double double_data$get(MemorySegment seg) {
return (double)constants$2531.const$3.get(seg);
}
/**
* Setter for field:
* {@snippet :
* double double_data;
* }
*/
public static void double_data$set(MemorySegment seg, double x) {
constants$2531.const$3.set(seg, x);
}
public static double double_data$get(MemorySegment seg, long index) {
return (double)constants$2531.const$3.get(seg.asSlice(index*sizeof()));
}
public static void double_data$set(MemorySegment seg, long index, double x) {
constants$2531.const$3.set(seg.asSlice(index*sizeof()), x);
}
public static VarHandle string_data$VH() {
return constants$2531.const$4;
}
/**
* Getter for field:
* {@snippet :
* char* string_data;
* }
*/
public static MemorySegment string_data$get(MemorySegment seg) {
return (java.lang.foreign.MemorySegment)constants$2531.const$4.get(seg);
}
/**
* Setter for field:
* {@snippet :
* char* string_data;
* }
*/
public static void string_data$set(MemorySegment seg, MemorySegment x) {
constants$2531.const$4.set(seg, x);
}
public static MemorySegment string_data$get(MemorySegment seg, long index) {
return (java.lang.foreign.MemorySegment)constants$2531.const$4.get(seg.asSlice(index*sizeof()));
}
public static void string_data$set(MemorySegment seg, long index, MemorySegment x) {
constants$2531.const$4.set(seg.asSlice(index*sizeof()), x);
}
public static long sizeof() { return $LAYOUT().byteSize(); }
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
}
public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
}
public static MemorySegment d$slice(MemorySegment seg) {
return seg.asSlice(8, 8);
}
public static long sizeof() { return $LAYOUT().byteSize(); }
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
}
public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
}