org.purejava.appindicator._GCompletion Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of libayatana-appindicator-java-full Show documentation
Show all versions of libayatana-appindicator-java-full Show documentation
Java bindings for libayatana-appindicator in 100% pure Java
// 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 _GCompletion {
* GList *items;
* GCompletionFunc func;
* gchar *prefix;
* GList *cache;
* GCompletionStrncmpFunc strncmp_func;
* }
* }
*/
public class _GCompletion {
_GCompletion() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
app_indicator_h.C_POINTER.withName("items"),
app_indicator_h.C_POINTER.withName("func"),
app_indicator_h.C_POINTER.withName("prefix"),
app_indicator_h.C_POINTER.withName("cache"),
app_indicator_h.C_POINTER.withName("strncmp_func")
).withName("_GCompletion");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final AddressLayout items$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("items"));
/**
* Layout for field:
* {@snippet lang=c :
* GList *items
* }
*/
public static final AddressLayout items$layout() {
return items$LAYOUT;
}
private static final long items$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* GList *items
* }
*/
public static final long items$offset() {
return items$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* GList *items
* }
*/
public static MemorySegment items(MemorySegment struct) {
return struct.get(items$LAYOUT, items$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* GList *items
* }
*/
public static void items(MemorySegment struct, MemorySegment fieldValue) {
struct.set(items$LAYOUT, items$OFFSET, fieldValue);
}
private static final AddressLayout func$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("func"));
/**
* Layout for field:
* {@snippet lang=c :
* GCompletionFunc func
* }
*/
public static final AddressLayout func$layout() {
return func$LAYOUT;
}
private static final long func$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* GCompletionFunc func
* }
*/
public static final long func$offset() {
return func$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* GCompletionFunc func
* }
*/
public static MemorySegment func(MemorySegment struct) {
return struct.get(func$LAYOUT, func$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* GCompletionFunc func
* }
*/
public static void func(MemorySegment struct, MemorySegment fieldValue) {
struct.set(func$LAYOUT, func$OFFSET, fieldValue);
}
private static final AddressLayout prefix$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("prefix"));
/**
* Layout for field:
* {@snippet lang=c :
* gchar *prefix
* }
*/
public static final AddressLayout prefix$layout() {
return prefix$LAYOUT;
}
private static final long prefix$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* gchar *prefix
* }
*/
public static final long prefix$offset() {
return prefix$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* gchar *prefix
* }
*/
public static MemorySegment prefix(MemorySegment struct) {
return struct.get(prefix$LAYOUT, prefix$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* gchar *prefix
* }
*/
public static void prefix(MemorySegment struct, MemorySegment fieldValue) {
struct.set(prefix$LAYOUT, prefix$OFFSET, fieldValue);
}
private static final AddressLayout cache$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("cache"));
/**
* Layout for field:
* {@snippet lang=c :
* GList *cache
* }
*/
public static final AddressLayout cache$layout() {
return cache$LAYOUT;
}
private static final long cache$OFFSET = 24;
/**
* Offset for field:
* {@snippet lang=c :
* GList *cache
* }
*/
public static final long cache$offset() {
return cache$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* GList *cache
* }
*/
public static MemorySegment cache(MemorySegment struct) {
return struct.get(cache$LAYOUT, cache$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* GList *cache
* }
*/
public static void cache(MemorySegment struct, MemorySegment fieldValue) {
struct.set(cache$LAYOUT, cache$OFFSET, fieldValue);
}
private static final AddressLayout strncmp_func$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("strncmp_func"));
/**
* Layout for field:
* {@snippet lang=c :
* GCompletionStrncmpFunc strncmp_func
* }
*/
public static final AddressLayout strncmp_func$layout() {
return strncmp_func$LAYOUT;
}
private static final long strncmp_func$OFFSET = 32;
/**
* Offset for field:
* {@snippet lang=c :
* GCompletionStrncmpFunc strncmp_func
* }
*/
public static final long strncmp_func$offset() {
return strncmp_func$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* GCompletionStrncmpFunc strncmp_func
* }
*/
public static MemorySegment strncmp_func(MemorySegment struct) {
return struct.get(strncmp_func$LAYOUT, strncmp_func$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* GCompletionStrncmpFunc strncmp_func
* }
*/
public static void strncmp_func(MemorySegment struct, MemorySegment fieldValue) {
struct.set(strncmp_func$LAYOUT, strncmp_func$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);
}
}