org.purejava.appindicator._PangoFontMetrics 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 _PangoFontMetrics {
* guint ref_count;
* int ascent;
* int descent;
* int height;
* int approximate_char_width;
* int approximate_digit_width;
* int underline_position;
* int underline_thickness;
* int strikethrough_position;
* int strikethrough_thickness;
* }
* }
*/
public class _PangoFontMetrics {
_PangoFontMetrics() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
app_indicator_h.C_INT.withName("ref_count"),
app_indicator_h.C_INT.withName("ascent"),
app_indicator_h.C_INT.withName("descent"),
app_indicator_h.C_INT.withName("height"),
app_indicator_h.C_INT.withName("approximate_char_width"),
app_indicator_h.C_INT.withName("approximate_digit_width"),
app_indicator_h.C_INT.withName("underline_position"),
app_indicator_h.C_INT.withName("underline_thickness"),
app_indicator_h.C_INT.withName("strikethrough_position"),
app_indicator_h.C_INT.withName("strikethrough_thickness")
).withName("_PangoFontMetrics");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final OfInt ref_count$LAYOUT = (OfInt)$LAYOUT.select(groupElement("ref_count"));
/**
* Layout for field:
* {@snippet lang=c :
* guint ref_count
* }
*/
public static final OfInt ref_count$layout() {
return ref_count$LAYOUT;
}
private static final long ref_count$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* guint ref_count
* }
*/
public static final long ref_count$offset() {
return ref_count$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* guint ref_count
* }
*/
public static int ref_count(MemorySegment struct) {
return struct.get(ref_count$LAYOUT, ref_count$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* guint ref_count
* }
*/
public static void ref_count(MemorySegment struct, int fieldValue) {
struct.set(ref_count$LAYOUT, ref_count$OFFSET, fieldValue);
}
private static final OfInt ascent$LAYOUT = (OfInt)$LAYOUT.select(groupElement("ascent"));
/**
* Layout for field:
* {@snippet lang=c :
* int ascent
* }
*/
public static final OfInt ascent$layout() {
return ascent$LAYOUT;
}
private static final long ascent$OFFSET = 4;
/**
* Offset for field:
* {@snippet lang=c :
* int ascent
* }
*/
public static final long ascent$offset() {
return ascent$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* int ascent
* }
*/
public static int ascent(MemorySegment struct) {
return struct.get(ascent$LAYOUT, ascent$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* int ascent
* }
*/
public static void ascent(MemorySegment struct, int fieldValue) {
struct.set(ascent$LAYOUT, ascent$OFFSET, fieldValue);
}
private static final OfInt descent$LAYOUT = (OfInt)$LAYOUT.select(groupElement("descent"));
/**
* Layout for field:
* {@snippet lang=c :
* int descent
* }
*/
public static final OfInt descent$layout() {
return descent$LAYOUT;
}
private static final long descent$OFFSET = 8;
/**
* Offset for field:
* {@snippet lang=c :
* int descent
* }
*/
public static final long descent$offset() {
return descent$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* int descent
* }
*/
public static int descent(MemorySegment struct) {
return struct.get(descent$LAYOUT, descent$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* int descent
* }
*/
public static void descent(MemorySegment struct, int fieldValue) {
struct.set(descent$LAYOUT, descent$OFFSET, fieldValue);
}
private static final OfInt height$LAYOUT = (OfInt)$LAYOUT.select(groupElement("height"));
/**
* Layout for field:
* {@snippet lang=c :
* int height
* }
*/
public static final OfInt height$layout() {
return height$LAYOUT;
}
private static final long height$OFFSET = 12;
/**
* Offset for field:
* {@snippet lang=c :
* int height
* }
*/
public static final long height$offset() {
return height$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* int height
* }
*/
public static int height(MemorySegment struct) {
return struct.get(height$LAYOUT, height$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* int height
* }
*/
public static void height(MemorySegment struct, int fieldValue) {
struct.set(height$LAYOUT, height$OFFSET, fieldValue);
}
private static final OfInt approximate_char_width$LAYOUT = (OfInt)$LAYOUT.select(groupElement("approximate_char_width"));
/**
* Layout for field:
* {@snippet lang=c :
* int approximate_char_width
* }
*/
public static final OfInt approximate_char_width$layout() {
return approximate_char_width$LAYOUT;
}
private static final long approximate_char_width$OFFSET = 16;
/**
* Offset for field:
* {@snippet lang=c :
* int approximate_char_width
* }
*/
public static final long approximate_char_width$offset() {
return approximate_char_width$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* int approximate_char_width
* }
*/
public static int approximate_char_width(MemorySegment struct) {
return struct.get(approximate_char_width$LAYOUT, approximate_char_width$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* int approximate_char_width
* }
*/
public static void approximate_char_width(MemorySegment struct, int fieldValue) {
struct.set(approximate_char_width$LAYOUT, approximate_char_width$OFFSET, fieldValue);
}
private static final OfInt approximate_digit_width$LAYOUT = (OfInt)$LAYOUT.select(groupElement("approximate_digit_width"));
/**
* Layout for field:
* {@snippet lang=c :
* int approximate_digit_width
* }
*/
public static final OfInt approximate_digit_width$layout() {
return approximate_digit_width$LAYOUT;
}
private static final long approximate_digit_width$OFFSET = 20;
/**
* Offset for field:
* {@snippet lang=c :
* int approximate_digit_width
* }
*/
public static final long approximate_digit_width$offset() {
return approximate_digit_width$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* int approximate_digit_width
* }
*/
public static int approximate_digit_width(MemorySegment struct) {
return struct.get(approximate_digit_width$LAYOUT, approximate_digit_width$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* int approximate_digit_width
* }
*/
public static void approximate_digit_width(MemorySegment struct, int fieldValue) {
struct.set(approximate_digit_width$LAYOUT, approximate_digit_width$OFFSET, fieldValue);
}
private static final OfInt underline_position$LAYOUT = (OfInt)$LAYOUT.select(groupElement("underline_position"));
/**
* Layout for field:
* {@snippet lang=c :
* int underline_position
* }
*/
public static final OfInt underline_position$layout() {
return underline_position$LAYOUT;
}
private static final long underline_position$OFFSET = 24;
/**
* Offset for field:
* {@snippet lang=c :
* int underline_position
* }
*/
public static final long underline_position$offset() {
return underline_position$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* int underline_position
* }
*/
public static int underline_position(MemorySegment struct) {
return struct.get(underline_position$LAYOUT, underline_position$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* int underline_position
* }
*/
public static void underline_position(MemorySegment struct, int fieldValue) {
struct.set(underline_position$LAYOUT, underline_position$OFFSET, fieldValue);
}
private static final OfInt underline_thickness$LAYOUT = (OfInt)$LAYOUT.select(groupElement("underline_thickness"));
/**
* Layout for field:
* {@snippet lang=c :
* int underline_thickness
* }
*/
public static final OfInt underline_thickness$layout() {
return underline_thickness$LAYOUT;
}
private static final long underline_thickness$OFFSET = 28;
/**
* Offset for field:
* {@snippet lang=c :
* int underline_thickness
* }
*/
public static final long underline_thickness$offset() {
return underline_thickness$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* int underline_thickness
* }
*/
public static int underline_thickness(MemorySegment struct) {
return struct.get(underline_thickness$LAYOUT, underline_thickness$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* int underline_thickness
* }
*/
public static void underline_thickness(MemorySegment struct, int fieldValue) {
struct.set(underline_thickness$LAYOUT, underline_thickness$OFFSET, fieldValue);
}
private static final OfInt strikethrough_position$LAYOUT = (OfInt)$LAYOUT.select(groupElement("strikethrough_position"));
/**
* Layout for field:
* {@snippet lang=c :
* int strikethrough_position
* }
*/
public static final OfInt strikethrough_position$layout() {
return strikethrough_position$LAYOUT;
}
private static final long strikethrough_position$OFFSET = 32;
/**
* Offset for field:
* {@snippet lang=c :
* int strikethrough_position
* }
*/
public static final long strikethrough_position$offset() {
return strikethrough_position$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* int strikethrough_position
* }
*/
public static int strikethrough_position(MemorySegment struct) {
return struct.get(strikethrough_position$LAYOUT, strikethrough_position$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* int strikethrough_position
* }
*/
public static void strikethrough_position(MemorySegment struct, int fieldValue) {
struct.set(strikethrough_position$LAYOUT, strikethrough_position$OFFSET, fieldValue);
}
private static final OfInt strikethrough_thickness$LAYOUT = (OfInt)$LAYOUT.select(groupElement("strikethrough_thickness"));
/**
* Layout for field:
* {@snippet lang=c :
* int strikethrough_thickness
* }
*/
public static final OfInt strikethrough_thickness$layout() {
return strikethrough_thickness$LAYOUT;
}
private static final long strikethrough_thickness$OFFSET = 36;
/**
* Offset for field:
* {@snippet lang=c :
* int strikethrough_thickness
* }
*/
public static final long strikethrough_thickness$offset() {
return strikethrough_thickness$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* int strikethrough_thickness
* }
*/
public static int strikethrough_thickness(MemorySegment struct) {
return struct.get(strikethrough_thickness$LAYOUT, strikethrough_thickness$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* int strikethrough_thickness
* }
*/
public static void strikethrough_thickness(MemorySegment struct, int fieldValue) {
struct.set(strikethrough_thickness$LAYOUT, strikethrough_thickness$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);
}
}