org.purejava.appindicator._GtkRangeClass 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 _GtkRangeClass {
* GtkWidgetClass parent_class;
* gchar *slider_detail;
* gchar *stepper_detail;
* void (*value_changed)(GtkRange *);
* void (*adjust_bounds)(GtkRange *, gdouble);
* void (*move_slider)(GtkRange *, GtkScrollType);
* void (*get_range_border)(GtkRange *, GtkBorder *);
* gboolean (*change_value)(GtkRange *, GtkScrollType, gdouble);
* void (*get_range_size_request)(GtkRange *, GtkOrientation, gint *, gint *);
* void (*_gtk_reserved1)(void);
* void (*_gtk_reserved2)(void);
* void (*_gtk_reserved3)(void);
* }
* }
*/
public class _GtkRangeClass {
_GtkRangeClass() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
_GtkWidgetClass.layout().withName("parent_class"),
app_indicator_h.C_POINTER.withName("slider_detail"),
app_indicator_h.C_POINTER.withName("stepper_detail"),
app_indicator_h.C_POINTER.withName("value_changed"),
app_indicator_h.C_POINTER.withName("adjust_bounds"),
app_indicator_h.C_POINTER.withName("move_slider"),
app_indicator_h.C_POINTER.withName("get_range_border"),
app_indicator_h.C_POINTER.withName("change_value"),
app_indicator_h.C_POINTER.withName("get_range_size_request"),
app_indicator_h.C_POINTER.withName("_gtk_reserved1"),
app_indicator_h.C_POINTER.withName("_gtk_reserved2"),
app_indicator_h.C_POINTER.withName("_gtk_reserved3")
).withName("_GtkRangeClass");
/**
* The layout of this struct
*/
public static final GroupLayout layout() {
return $LAYOUT;
}
private static final GroupLayout parent_class$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("parent_class"));
/**
* Layout for field:
* {@snippet lang=c :
* GtkWidgetClass parent_class
* }
*/
public static final GroupLayout parent_class$layout() {
return parent_class$LAYOUT;
}
private static final long parent_class$OFFSET = 0;
/**
* Offset for field:
* {@snippet lang=c :
* GtkWidgetClass parent_class
* }
*/
public static final long parent_class$offset() {
return parent_class$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* GtkWidgetClass parent_class
* }
*/
public static MemorySegment parent_class(MemorySegment struct) {
return struct.asSlice(parent_class$OFFSET, parent_class$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* GtkWidgetClass parent_class
* }
*/
public static void parent_class(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, parent_class$OFFSET, parent_class$LAYOUT.byteSize());
}
private static final AddressLayout slider_detail$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("slider_detail"));
/**
* Layout for field:
* {@snippet lang=c :
* gchar *slider_detail
* }
*/
public static final AddressLayout slider_detail$layout() {
return slider_detail$LAYOUT;
}
private static final long slider_detail$OFFSET = 824;
/**
* Offset for field:
* {@snippet lang=c :
* gchar *slider_detail
* }
*/
public static final long slider_detail$offset() {
return slider_detail$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* gchar *slider_detail
* }
*/
public static MemorySegment slider_detail(MemorySegment struct) {
return struct.get(slider_detail$LAYOUT, slider_detail$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* gchar *slider_detail
* }
*/
public static void slider_detail(MemorySegment struct, MemorySegment fieldValue) {
struct.set(slider_detail$LAYOUT, slider_detail$OFFSET, fieldValue);
}
private static final AddressLayout stepper_detail$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("stepper_detail"));
/**
* Layout for field:
* {@snippet lang=c :
* gchar *stepper_detail
* }
*/
public static final AddressLayout stepper_detail$layout() {
return stepper_detail$LAYOUT;
}
private static final long stepper_detail$OFFSET = 832;
/**
* Offset for field:
* {@snippet lang=c :
* gchar *stepper_detail
* }
*/
public static final long stepper_detail$offset() {
return stepper_detail$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* gchar *stepper_detail
* }
*/
public static MemorySegment stepper_detail(MemorySegment struct) {
return struct.get(stepper_detail$LAYOUT, stepper_detail$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* gchar *stepper_detail
* }
*/
public static void stepper_detail(MemorySegment struct, MemorySegment fieldValue) {
struct.set(stepper_detail$LAYOUT, stepper_detail$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* void (*value_changed)(GtkRange *)
* }
*/
public class value_changed {
/**
* The function pointer signature, expressed as a functional interface
*/
public interface Function {
void apply(MemorySegment _x0);
}
private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid(
app_indicator_h.C_POINTER
);
/**
* The descriptor of this function pointer
*/
public static FunctionDescriptor descriptor() {
return $DESC;
}
private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(value_changed.Function.class, "apply", $DESC);
/**
* Allocates a new upcall stub, whose implementation is defined by {@code fi}.
* The lifetime of the returned segment is managed by {@code arena}
*/
public static MemorySegment allocate(value_changed.Function fi, Arena arena) {
return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
}
private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);
/**
* Invoke the upcall stub {@code funcPtr}, with given parameters
*/
public static void invoke(MemorySegment funcPtr,MemorySegment _x0) {
try {
DOWN$MH.invokeExact(funcPtr, _x0);
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
}
}
private static final AddressLayout value_changed$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("value_changed"));
/**
* Layout for field:
* {@snippet lang=c :
* void (*value_changed)(GtkRange *)
* }
*/
public static final AddressLayout value_changed$layout() {
return value_changed$LAYOUT;
}
private static final long value_changed$OFFSET = 840;
/**
* Offset for field:
* {@snippet lang=c :
* void (*value_changed)(GtkRange *)
* }
*/
public static final long value_changed$offset() {
return value_changed$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* void (*value_changed)(GtkRange *)
* }
*/
public static MemorySegment value_changed(MemorySegment struct) {
return struct.get(value_changed$LAYOUT, value_changed$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* void (*value_changed)(GtkRange *)
* }
*/
public static void value_changed(MemorySegment struct, MemorySegment fieldValue) {
struct.set(value_changed$LAYOUT, value_changed$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* void (*adjust_bounds)(GtkRange *, gdouble)
* }
*/
public class adjust_bounds {
/**
* The function pointer signature, expressed as a functional interface
*/
public interface Function {
void apply(MemorySegment _x0, double _x1);
}
private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid(
app_indicator_h.C_POINTER,
app_indicator_h.C_DOUBLE
);
/**
* The descriptor of this function pointer
*/
public static FunctionDescriptor descriptor() {
return $DESC;
}
private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(adjust_bounds.Function.class, "apply", $DESC);
/**
* Allocates a new upcall stub, whose implementation is defined by {@code fi}.
* The lifetime of the returned segment is managed by {@code arena}
*/
public static MemorySegment allocate(adjust_bounds.Function fi, Arena arena) {
return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
}
private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);
/**
* Invoke the upcall stub {@code funcPtr}, with given parameters
*/
public static void invoke(MemorySegment funcPtr,MemorySegment _x0, double _x1) {
try {
DOWN$MH.invokeExact(funcPtr, _x0, _x1);
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
}
}
private static final AddressLayout adjust_bounds$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("adjust_bounds"));
/**
* Layout for field:
* {@snippet lang=c :
* void (*adjust_bounds)(GtkRange *, gdouble)
* }
*/
public static final AddressLayout adjust_bounds$layout() {
return adjust_bounds$LAYOUT;
}
private static final long adjust_bounds$OFFSET = 848;
/**
* Offset for field:
* {@snippet lang=c :
* void (*adjust_bounds)(GtkRange *, gdouble)
* }
*/
public static final long adjust_bounds$offset() {
return adjust_bounds$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* void (*adjust_bounds)(GtkRange *, gdouble)
* }
*/
public static MemorySegment adjust_bounds(MemorySegment struct) {
return struct.get(adjust_bounds$LAYOUT, adjust_bounds$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* void (*adjust_bounds)(GtkRange *, gdouble)
* }
*/
public static void adjust_bounds(MemorySegment struct, MemorySegment fieldValue) {
struct.set(adjust_bounds$LAYOUT, adjust_bounds$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* void (*move_slider)(GtkRange *, GtkScrollType)
* }
*/
public class move_slider {
/**
* The function pointer signature, expressed as a functional interface
*/
public interface Function {
void apply(MemorySegment _x0, int _x1);
}
private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid(
app_indicator_h.C_POINTER,
app_indicator_h.C_INT
);
/**
* The descriptor of this function pointer
*/
public static FunctionDescriptor descriptor() {
return $DESC;
}
private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(move_slider.Function.class, "apply", $DESC);
/**
* Allocates a new upcall stub, whose implementation is defined by {@code fi}.
* The lifetime of the returned segment is managed by {@code arena}
*/
public static MemorySegment allocate(move_slider.Function fi, Arena arena) {
return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
}
private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);
/**
* Invoke the upcall stub {@code funcPtr}, with given parameters
*/
public static void invoke(MemorySegment funcPtr,MemorySegment _x0, int _x1) {
try {
DOWN$MH.invokeExact(funcPtr, _x0, _x1);
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
}
}
private static final AddressLayout move_slider$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("move_slider"));
/**
* Layout for field:
* {@snippet lang=c :
* void (*move_slider)(GtkRange *, GtkScrollType)
* }
*/
public static final AddressLayout move_slider$layout() {
return move_slider$LAYOUT;
}
private static final long move_slider$OFFSET = 856;
/**
* Offset for field:
* {@snippet lang=c :
* void (*move_slider)(GtkRange *, GtkScrollType)
* }
*/
public static final long move_slider$offset() {
return move_slider$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* void (*move_slider)(GtkRange *, GtkScrollType)
* }
*/
public static MemorySegment move_slider(MemorySegment struct) {
return struct.get(move_slider$LAYOUT, move_slider$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* void (*move_slider)(GtkRange *, GtkScrollType)
* }
*/
public static void move_slider(MemorySegment struct, MemorySegment fieldValue) {
struct.set(move_slider$LAYOUT, move_slider$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* void (*get_range_border)(GtkRange *, GtkBorder *)
* }
*/
public class get_range_border {
/**
* The function pointer signature, expressed as a functional interface
*/
public interface Function {
void apply(MemorySegment _x0, MemorySegment _x1);
}
private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid(
app_indicator_h.C_POINTER,
app_indicator_h.C_POINTER
);
/**
* The descriptor of this function pointer
*/
public static FunctionDescriptor descriptor() {
return $DESC;
}
private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(get_range_border.Function.class, "apply", $DESC);
/**
* Allocates a new upcall stub, whose implementation is defined by {@code fi}.
* The lifetime of the returned segment is managed by {@code arena}
*/
public static MemorySegment allocate(get_range_border.Function fi, Arena arena) {
return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
}
private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);
/**
* Invoke the upcall stub {@code funcPtr}, with given parameters
*/
public static void invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1) {
try {
DOWN$MH.invokeExact(funcPtr, _x0, _x1);
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
}
}
private static final AddressLayout get_range_border$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("get_range_border"));
/**
* Layout for field:
* {@snippet lang=c :
* void (*get_range_border)(GtkRange *, GtkBorder *)
* }
*/
public static final AddressLayout get_range_border$layout() {
return get_range_border$LAYOUT;
}
private static final long get_range_border$OFFSET = 864;
/**
* Offset for field:
* {@snippet lang=c :
* void (*get_range_border)(GtkRange *, GtkBorder *)
* }
*/
public static final long get_range_border$offset() {
return get_range_border$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* void (*get_range_border)(GtkRange *, GtkBorder *)
* }
*/
public static MemorySegment get_range_border(MemorySegment struct) {
return struct.get(get_range_border$LAYOUT, get_range_border$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* void (*get_range_border)(GtkRange *, GtkBorder *)
* }
*/
public static void get_range_border(MemorySegment struct, MemorySegment fieldValue) {
struct.set(get_range_border$LAYOUT, get_range_border$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* gboolean (*change_value)(GtkRange *, GtkScrollType, gdouble)
* }
*/
public class change_value {
/**
* The function pointer signature, expressed as a functional interface
*/
public interface Function {
int apply(MemorySegment _x0, int _x1, double _x2);
}
private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
app_indicator_h.C_INT,
app_indicator_h.C_POINTER,
app_indicator_h.C_INT,
app_indicator_h.C_DOUBLE
);
/**
* The descriptor of this function pointer
*/
public static FunctionDescriptor descriptor() {
return $DESC;
}
private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(change_value.Function.class, "apply", $DESC);
/**
* Allocates a new upcall stub, whose implementation is defined by {@code fi}.
* The lifetime of the returned segment is managed by {@code arena}
*/
public static MemorySegment allocate(change_value.Function fi, Arena arena) {
return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
}
private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);
/**
* Invoke the upcall stub {@code funcPtr}, with given parameters
*/
public static int invoke(MemorySegment funcPtr,MemorySegment _x0, int _x1, double _x2) {
try {
return (int) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2);
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
}
}
private static final AddressLayout change_value$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("change_value"));
/**
* Layout for field:
* {@snippet lang=c :
* gboolean (*change_value)(GtkRange *, GtkScrollType, gdouble)
* }
*/
public static final AddressLayout change_value$layout() {
return change_value$LAYOUT;
}
private static final long change_value$OFFSET = 872;
/**
* Offset for field:
* {@snippet lang=c :
* gboolean (*change_value)(GtkRange *, GtkScrollType, gdouble)
* }
*/
public static final long change_value$offset() {
return change_value$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* gboolean (*change_value)(GtkRange *, GtkScrollType, gdouble)
* }
*/
public static MemorySegment change_value(MemorySegment struct) {
return struct.get(change_value$LAYOUT, change_value$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* gboolean (*change_value)(GtkRange *, GtkScrollType, gdouble)
* }
*/
public static void change_value(MemorySegment struct, MemorySegment fieldValue) {
struct.set(change_value$LAYOUT, change_value$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* void (*get_range_size_request)(GtkRange *, GtkOrientation, gint *, gint *)
* }
*/
public class get_range_size_request {
/**
* The function pointer signature, expressed as a functional interface
*/
public interface Function {
void apply(MemorySegment _x0, int _x1, MemorySegment _x2, MemorySegment _x3);
}
private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid(
app_indicator_h.C_POINTER,
app_indicator_h.C_INT,
app_indicator_h.C_POINTER,
app_indicator_h.C_POINTER
);
/**
* The descriptor of this function pointer
*/
public static FunctionDescriptor descriptor() {
return $DESC;
}
private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(get_range_size_request.Function.class, "apply", $DESC);
/**
* Allocates a new upcall stub, whose implementation is defined by {@code fi}.
* The lifetime of the returned segment is managed by {@code arena}
*/
public static MemorySegment allocate(get_range_size_request.Function fi, Arena arena) {
return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
}
private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);
/**
* Invoke the upcall stub {@code funcPtr}, with given parameters
*/
public static void invoke(MemorySegment funcPtr,MemorySegment _x0, int _x1, MemorySegment _x2, MemorySegment _x3) {
try {
DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2, _x3);
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
}
}
private static final AddressLayout get_range_size_request$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("get_range_size_request"));
/**
* Layout for field:
* {@snippet lang=c :
* void (*get_range_size_request)(GtkRange *, GtkOrientation, gint *, gint *)
* }
*/
public static final AddressLayout get_range_size_request$layout() {
return get_range_size_request$LAYOUT;
}
private static final long get_range_size_request$OFFSET = 880;
/**
* Offset for field:
* {@snippet lang=c :
* void (*get_range_size_request)(GtkRange *, GtkOrientation, gint *, gint *)
* }
*/
public static final long get_range_size_request$offset() {
return get_range_size_request$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* void (*get_range_size_request)(GtkRange *, GtkOrientation, gint *, gint *)
* }
*/
public static MemorySegment get_range_size_request(MemorySegment struct) {
return struct.get(get_range_size_request$LAYOUT, get_range_size_request$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* void (*get_range_size_request)(GtkRange *, GtkOrientation, gint *, gint *)
* }
*/
public static void get_range_size_request(MemorySegment struct, MemorySegment fieldValue) {
struct.set(get_range_size_request$LAYOUT, get_range_size_request$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* void (*_gtk_reserved1)(void)
* }
*/
public class _gtk_reserved1 {
/**
* The function pointer signature, expressed as a functional interface
*/
public interface Function {
void apply();
}
private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid();
/**
* The descriptor of this function pointer
*/
public static FunctionDescriptor descriptor() {
return $DESC;
}
private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(_gtk_reserved1.Function.class, "apply", $DESC);
/**
* Allocates a new upcall stub, whose implementation is defined by {@code fi}.
* The lifetime of the returned segment is managed by {@code arena}
*/
public static MemorySegment allocate(_gtk_reserved1.Function fi, Arena arena) {
return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
}
private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);
/**
* Invoke the upcall stub {@code funcPtr}, with given parameters
*/
public static void invoke(MemorySegment funcPtr) {
try {
DOWN$MH.invokeExact(funcPtr);
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
}
}
private static final AddressLayout _gtk_reserved1$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_gtk_reserved1"));
/**
* Layout for field:
* {@snippet lang=c :
* void (*_gtk_reserved1)(void)
* }
*/
public static final AddressLayout _gtk_reserved1$layout() {
return _gtk_reserved1$LAYOUT;
}
private static final long _gtk_reserved1$OFFSET = 888;
/**
* Offset for field:
* {@snippet lang=c :
* void (*_gtk_reserved1)(void)
* }
*/
public static final long _gtk_reserved1$offset() {
return _gtk_reserved1$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* void (*_gtk_reserved1)(void)
* }
*/
public static MemorySegment _gtk_reserved1(MemorySegment struct) {
return struct.get(_gtk_reserved1$LAYOUT, _gtk_reserved1$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* void (*_gtk_reserved1)(void)
* }
*/
public static void _gtk_reserved1(MemorySegment struct, MemorySegment fieldValue) {
struct.set(_gtk_reserved1$LAYOUT, _gtk_reserved1$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* void (*_gtk_reserved2)(void)
* }
*/
public class _gtk_reserved2 {
/**
* The function pointer signature, expressed as a functional interface
*/
public interface Function {
void apply();
}
private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid();
/**
* The descriptor of this function pointer
*/
public static FunctionDescriptor descriptor() {
return $DESC;
}
private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(_gtk_reserved2.Function.class, "apply", $DESC);
/**
* Allocates a new upcall stub, whose implementation is defined by {@code fi}.
* The lifetime of the returned segment is managed by {@code arena}
*/
public static MemorySegment allocate(_gtk_reserved2.Function fi, Arena arena) {
return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
}
private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);
/**
* Invoke the upcall stub {@code funcPtr}, with given parameters
*/
public static void invoke(MemorySegment funcPtr) {
try {
DOWN$MH.invokeExact(funcPtr);
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
}
}
private static final AddressLayout _gtk_reserved2$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_gtk_reserved2"));
/**
* Layout for field:
* {@snippet lang=c :
* void (*_gtk_reserved2)(void)
* }
*/
public static final AddressLayout _gtk_reserved2$layout() {
return _gtk_reserved2$LAYOUT;
}
private static final long _gtk_reserved2$OFFSET = 896;
/**
* Offset for field:
* {@snippet lang=c :
* void (*_gtk_reserved2)(void)
* }
*/
public static final long _gtk_reserved2$offset() {
return _gtk_reserved2$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* void (*_gtk_reserved2)(void)
* }
*/
public static MemorySegment _gtk_reserved2(MemorySegment struct) {
return struct.get(_gtk_reserved2$LAYOUT, _gtk_reserved2$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* void (*_gtk_reserved2)(void)
* }
*/
public static void _gtk_reserved2(MemorySegment struct, MemorySegment fieldValue) {
struct.set(_gtk_reserved2$LAYOUT, _gtk_reserved2$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* void (*_gtk_reserved3)(void)
* }
*/
public class _gtk_reserved3 {
/**
* The function pointer signature, expressed as a functional interface
*/
public interface Function {
void apply();
}
private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid();
/**
* The descriptor of this function pointer
*/
public static FunctionDescriptor descriptor() {
return $DESC;
}
private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(_gtk_reserved3.Function.class, "apply", $DESC);
/**
* Allocates a new upcall stub, whose implementation is defined by {@code fi}.
* The lifetime of the returned segment is managed by {@code arena}
*/
public static MemorySegment allocate(_gtk_reserved3.Function fi, Arena arena) {
return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
}
private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);
/**
* Invoke the upcall stub {@code funcPtr}, with given parameters
*/
public static void invoke(MemorySegment funcPtr) {
try {
DOWN$MH.invokeExact(funcPtr);
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
}
}
private static final AddressLayout _gtk_reserved3$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_gtk_reserved3"));
/**
* Layout for field:
* {@snippet lang=c :
* void (*_gtk_reserved3)(void)
* }
*/
public static final AddressLayout _gtk_reserved3$layout() {
return _gtk_reserved3$LAYOUT;
}
private static final long _gtk_reserved3$OFFSET = 904;
/**
* Offset for field:
* {@snippet lang=c :
* void (*_gtk_reserved3)(void)
* }
*/
public static final long _gtk_reserved3$offset() {
return _gtk_reserved3$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* void (*_gtk_reserved3)(void)
* }
*/
public static MemorySegment _gtk_reserved3(MemorySegment struct) {
return struct.get(_gtk_reserved3$LAYOUT, _gtk_reserved3$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* void (*_gtk_reserved3)(void)
* }
*/
public static void _gtk_reserved3(MemorySegment struct, MemorySegment fieldValue) {
struct.set(_gtk_reserved3$LAYOUT, _gtk_reserved3$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);
}
}