org.purejava.appindicator._PangoGlyphItem 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 _PangoGlyphItem {
* PangoItem *item;
* PangoGlyphString *glyphs;
* int y_offset;
* int start_x_offset;
* int end_x_offset;
* }
* }
*/
public class _PangoGlyphItem {
_PangoGlyphItem() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
app_indicator_h.C_POINTER.withName("item"),
app_indicator_h.C_POINTER.withName("glyphs"),
app_indicator_h.C_INT.withName("y_offset"),
app_indicator_h.C_INT.withName("start_x_offset"),
app_indicator_h.C_INT.withName("end_x_offset"),
MemoryLayout.paddingLayout(4)
).withName("_PangoGlyphItem");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final AddressLayout item$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("item"));
/**
* Layout for field:
* {@snippet lang=c :
* PangoItem *item
* }
*/
public static final AddressLayout item$layout() {
return item$LAYOUT;
}
private static final long item$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* PangoItem *item
* }
*/
public static final long item$offset() {
return item$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* PangoItem *item
* }
*/
public static MemorySegment item(MemorySegment struct) {
return struct.get(item$LAYOUT, item$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* PangoItem *item
* }
*/
public static void item(MemorySegment struct, MemorySegment fieldValue) {
struct.set(item$LAYOUT, item$OFFSET, fieldValue);
}
private static final AddressLayout glyphs$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("glyphs"));
/**
* Layout for field:
* {@snippet lang=c :
* PangoGlyphString *glyphs
* }
*/
public static final AddressLayout glyphs$layout() {
return glyphs$LAYOUT;
}
private static final long glyphs$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* PangoGlyphString *glyphs
* }
*/
public static final long glyphs$offset() {
return glyphs$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* PangoGlyphString *glyphs
* }
*/
public static MemorySegment glyphs(MemorySegment struct) {
return struct.get(glyphs$LAYOUT, glyphs$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* PangoGlyphString *glyphs
* }
*/
public static void glyphs(MemorySegment struct, MemorySegment fieldValue) {
struct.set(glyphs$LAYOUT, glyphs$OFFSET, fieldValue);
}
private static final OfInt y_offset$LAYOUT = (OfInt)$LAYOUT.select(groupElement("y_offset"));
/**
* Layout for field:
* {@snippet lang=c :
* int y_offset
* }
*/
public static final OfInt y_offset$layout() {
return y_offset$LAYOUT;
}
private static final long y_offset$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* int y_offset
* }
*/
public static final long y_offset$offset() {
return y_offset$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* int y_offset
* }
*/
public static int y_offset(MemorySegment struct) {
return struct.get(y_offset$LAYOUT, y_offset$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* int y_offset
* }
*/
public static void y_offset(MemorySegment struct, int fieldValue) {
struct.set(y_offset$LAYOUT, y_offset$OFFSET, fieldValue);
}
private static final OfInt start_x_offset$LAYOUT = (OfInt)$LAYOUT.select(groupElement("start_x_offset"));
/**
* Layout for field:
* {@snippet lang=c :
* int start_x_offset
* }
*/
public static final OfInt start_x_offset$layout() {
return start_x_offset$LAYOUT;
}
private static final long start_x_offset$OFFSET = 20;
/**
* Offset for field:
* {@snippet lang=c :
* int start_x_offset
* }
*/
public static final long start_x_offset$offset() {
return start_x_offset$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* int start_x_offset
* }
*/
public static int start_x_offset(MemorySegment struct) {
return struct.get(start_x_offset$LAYOUT, start_x_offset$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* int start_x_offset
* }
*/
public static void start_x_offset(MemorySegment struct, int fieldValue) {
struct.set(start_x_offset$LAYOUT, start_x_offset$OFFSET, fieldValue);
}
private static final OfInt end_x_offset$LAYOUT = (OfInt)$LAYOUT.select(groupElement("end_x_offset"));
/**
* Layout for field:
* {@snippet lang=c :
* int end_x_offset
* }
*/
public static final OfInt end_x_offset$layout() {
return end_x_offset$LAYOUT;
}
private static final long end_x_offset$OFFSET = 24;
/**
* Offset for field:
* {@snippet lang=c :
* int end_x_offset
* }
*/
public static final long end_x_offset$offset() {
return end_x_offset$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* int end_x_offset
* }
*/
public static int end_x_offset(MemorySegment struct) {
return struct.get(end_x_offset$LAYOUT, end_x_offset$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* int end_x_offset
* }
*/
public static void end_x_offset(MemorySegment struct, int fieldValue) {
struct.set(end_x_offset$LAYOUT, end_x_offset$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);
}
}