org.purejava.appindicator._GValueArray 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
The newest version!
// Generated by jextract
package org.purejava.appindicator;
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 :
* struct _GValueArray {
* guint n_values;
* GValue *values;
* guint n_prealloced;
* }
* }
*/
public class _GValueArray {
_GValueArray() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
app_indicator_h.C_INT.withName("n_values"),
MemoryLayout.paddingLayout(4),
app_indicator_h.C_POINTER.withName("values"),
app_indicator_h.C_INT.withName("n_prealloced"),
MemoryLayout.paddingLayout(4)
).withName("_GValueArray");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfInt n_values$LAYOUT = (OfInt)$LAYOUT.select(groupElement("n_values"));
/**
* Layout for field:
* {@snippet lang=c :
* guint n_values
* }
*/
public static final OfInt n_values$layout() {
return n_values$LAYOUT;
}
private static final long n_values$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* guint n_values
* }
*/
public static final long n_values$offset() {
return n_values$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* guint n_values
* }
*/
public static int n_values(MemorySegment struct) {
return struct.get(n_values$LAYOUT, n_values$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* guint n_values
* }
*/
public static void n_values(MemorySegment struct, int fieldValue) {
struct.set(n_values$LAYOUT, n_values$OFFSET, fieldValue);
}
private static final AddressLayout values$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("values"));
/**
* Layout for field:
* {@snippet lang=c :
* GValue *values
* }
*/
public static final AddressLayout values$layout() {
return values$LAYOUT;
}
private static final long values$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* GValue *values
* }
*/
public static final long values$offset() {
return values$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* GValue *values
* }
*/
public static MemorySegment values(MemorySegment struct) {
return struct.get(values$LAYOUT, values$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* GValue *values
* }
*/
public static void values(MemorySegment struct, MemorySegment fieldValue) {
struct.set(values$LAYOUT, values$OFFSET, fieldValue);
}
private static final OfInt n_prealloced$LAYOUT = (OfInt)$LAYOUT.select(groupElement("n_prealloced"));
/**
* Layout for field:
* {@snippet lang=c :
* guint n_prealloced
* }
*/
public static final OfInt n_prealloced$layout() {
return n_prealloced$LAYOUT;
}
private static final long n_prealloced$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* guint n_prealloced
* }
*/
public static final long n_prealloced$offset() {
return n_prealloced$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* guint n_prealloced
* }
*/
public static int n_prealloced(MemorySegment struct) {
return struct.get(n_prealloced$LAYOUT, n_prealloced$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* guint n_prealloced
* }
*/
public static void n_prealloced(MemorySegment struct, int fieldValue) {
struct.set(n_prealloced$LAYOUT, n_prealloced$OFFSET, fieldValue);
}
/**
* Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
* The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
*/
public static MemorySegment asSlice(MemorySegment array, long index) {
return array.asSlice(layout().byteSize() * index);
}
/**
* The size (in bytes) of this struct
*/
public static long sizeof() { return layout().byteSize(); }
/**
* Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
*/
public static MemorySegment allocate(SegmentAllocator allocator) {
return allocator.allocate(layout());
}
/**
* Allocate an array of size {@code elementCount} using {@code allocator}.
* The returned segment has size {@code elementCount * layout().byteSize()}.
*/
public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction) (if any).
* The returned segment has size {@code layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
return reinterpret(addr, 1, arena, cleanup);
}
/**
* Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction) (if any).
* The returned segment has size {@code elementCount * layout().byteSize()}
*/
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy