org.purejava.appindicator._GApplicationClass 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 _GApplicationClass {
* GObjectClass parent_class;
* void (*startup)(GApplication *);
* void (*activate)(GApplication *);
* void (*open)(GApplication *, GFile **, gint, const gchar *);
* int (*command_line)(GApplication *, GApplicationCommandLine *);
* gboolean (*local_command_line)(GApplication *, gchar ***, int *);
* void (*before_emit)(GApplication *, GVariant *);
* void (*after_emit)(GApplication *, GVariant *);
* void (*add_platform_data)(GApplication *, GVariantBuilder *);
* void (*quit_mainloop)(GApplication *);
* void (*run_mainloop)(GApplication *);
* void (*shutdown)(GApplication *);
* gboolean (*dbus_register)(GApplication *, GDBusConnection *, const gchar *, GError **);
* void (*dbus_unregister)(GApplication *, GDBusConnection *, const gchar *);
* gint (*handle_local_options)(GApplication *, GVariantDict *);
* gboolean (*name_lost)(GApplication *);
* gpointer padding[7];
* }
* }
*/
public class _GApplicationClass {
_GApplicationClass() {
// Should not be called directly
}
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
_GObjectClass.layout().withName("parent_class"),
app_indicator_h.C_POINTER.withName("startup"),
app_indicator_h.C_POINTER.withName("activate"),
app_indicator_h.C_POINTER.withName("open"),
app_indicator_h.C_POINTER.withName("command_line"),
app_indicator_h.C_POINTER.withName("local_command_line"),
app_indicator_h.C_POINTER.withName("before_emit"),
app_indicator_h.C_POINTER.withName("after_emit"),
app_indicator_h.C_POINTER.withName("add_platform_data"),
app_indicator_h.C_POINTER.withName("quit_mainloop"),
app_indicator_h.C_POINTER.withName("run_mainloop"),
app_indicator_h.C_POINTER.withName("shutdown"),
app_indicator_h.C_POINTER.withName("dbus_register"),
app_indicator_h.C_POINTER.withName("dbus_unregister"),
app_indicator_h.C_POINTER.withName("handle_local_options"),
app_indicator_h.C_POINTER.withName("name_lost"),
MemoryLayout.sequenceLayout(7, app_indicator_h.C_POINTER).withName("padding")
).withName("_GApplicationClass");
/**
* 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 :
* GObjectClass 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 :
* GObjectClass parent_class
* }
*/
public static final long parent_class$offset() {
return parent_class$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* GObjectClass 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 :
* GObjectClass parent_class
* }
*/
public static void parent_class(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, parent_class$OFFSET, parent_class$LAYOUT.byteSize());
}
/**
* {@snippet lang=c :
* void (*startup)(GApplication *)
* }
*/
public class startup {
/**
* 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(startup.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(startup.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 startup$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("startup"));
/**
* Layout for field:
* {@snippet lang=c :
* void (*startup)(GApplication *)
* }
*/
public static final AddressLayout startup$layout() {
return startup$LAYOUT;
}
private static final long startup$OFFSET = 136;
/**
* Offset for field:
* {@snippet lang=c :
* void (*startup)(GApplication *)
* }
*/
public static final long startup$offset() {
return startup$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* void (*startup)(GApplication *)
* }
*/
public static MemorySegment startup(MemorySegment struct) {
return struct.get(startup$LAYOUT, startup$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* void (*startup)(GApplication *)
* }
*/
public static void startup(MemorySegment struct, MemorySegment fieldValue) {
struct.set(startup$LAYOUT, startup$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* void (*activate)(GApplication *)
* }
*/
public class activate {
/**
* 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(activate.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(activate.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 activate$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("activate"));
/**
* Layout for field:
* {@snippet lang=c :
* void (*activate)(GApplication *)
* }
*/
public static final AddressLayout activate$layout() {
return activate$LAYOUT;
}
private static final long activate$OFFSET = 144;
/**
* Offset for field:
* {@snippet lang=c :
* void (*activate)(GApplication *)
* }
*/
public static final long activate$offset() {
return activate$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* void (*activate)(GApplication *)
* }
*/
public static MemorySegment activate(MemorySegment struct) {
return struct.get(activate$LAYOUT, activate$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* void (*activate)(GApplication *)
* }
*/
public static void activate(MemorySegment struct, MemorySegment fieldValue) {
struct.set(activate$LAYOUT, activate$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* void (*open)(GApplication *, GFile **, gint, const gchar *)
* }
*/
public class open {
/**
* The function pointer signature, expressed as a functional interface
*/
public interface Function {
void apply(MemorySegment _x0, MemorySegment _x1, int _x2, MemorySegment _x3);
}
private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid(
app_indicator_h.C_POINTER,
app_indicator_h.C_POINTER,
app_indicator_h.C_INT,
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(open.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(open.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, int _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 open$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("open"));
/**
* Layout for field:
* {@snippet lang=c :
* void (*open)(GApplication *, GFile **, gint, const gchar *)
* }
*/
public static final AddressLayout open$layout() {
return open$LAYOUT;
}
private static final long open$OFFSET = 152;
/**
* Offset for field:
* {@snippet lang=c :
* void (*open)(GApplication *, GFile **, gint, const gchar *)
* }
*/
public static final long open$offset() {
return open$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* void (*open)(GApplication *, GFile **, gint, const gchar *)
* }
*/
public static MemorySegment open(MemorySegment struct) {
return struct.get(open$LAYOUT, open$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* void (*open)(GApplication *, GFile **, gint, const gchar *)
* }
*/
public static void open(MemorySegment struct, MemorySegment fieldValue) {
struct.set(open$LAYOUT, open$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* int (*command_line)(GApplication *, GApplicationCommandLine *)
* }
*/
public class command_line {
/**
* The function pointer signature, expressed as a functional interface
*/
public interface Function {
int apply(MemorySegment _x0, MemorySegment _x1);
}
private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
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(command_line.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(command_line.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, MemorySegment _x1) {
try {
return (int) DOWN$MH.invokeExact(funcPtr, _x0, _x1);
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
}
}
private static final AddressLayout command_line$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("command_line"));
/**
* Layout for field:
* {@snippet lang=c :
* int (*command_line)(GApplication *, GApplicationCommandLine *)
* }
*/
public static final AddressLayout command_line$layout() {
return command_line$LAYOUT;
}
private static final long command_line$OFFSET = 160;
/**
* Offset for field:
* {@snippet lang=c :
* int (*command_line)(GApplication *, GApplicationCommandLine *)
* }
*/
public static final long command_line$offset() {
return command_line$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* int (*command_line)(GApplication *, GApplicationCommandLine *)
* }
*/
public static MemorySegment command_line(MemorySegment struct) {
return struct.get(command_line$LAYOUT, command_line$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* int (*command_line)(GApplication *, GApplicationCommandLine *)
* }
*/
public static void command_line(MemorySegment struct, MemorySegment fieldValue) {
struct.set(command_line$LAYOUT, command_line$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* gboolean (*local_command_line)(GApplication *, gchar ***, int *)
* }
*/
public class local_command_line {
/**
* The function pointer signature, expressed as a functional interface
*/
public interface Function {
int apply(MemorySegment _x0, MemorySegment _x1, MemorySegment _x2);
}
private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
app_indicator_h.C_INT,
app_indicator_h.C_POINTER,
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(local_command_line.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(local_command_line.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, MemorySegment _x1, MemorySegment _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 local_command_line$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("local_command_line"));
/**
* Layout for field:
* {@snippet lang=c :
* gboolean (*local_command_line)(GApplication *, gchar ***, int *)
* }
*/
public static final AddressLayout local_command_line$layout() {
return local_command_line$LAYOUT;
}
private static final long local_command_line$OFFSET = 168;
/**
* Offset for field:
* {@snippet lang=c :
* gboolean (*local_command_line)(GApplication *, gchar ***, int *)
* }
*/
public static final long local_command_line$offset() {
return local_command_line$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* gboolean (*local_command_line)(GApplication *, gchar ***, int *)
* }
*/
public static MemorySegment local_command_line(MemorySegment struct) {
return struct.get(local_command_line$LAYOUT, local_command_line$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* gboolean (*local_command_line)(GApplication *, gchar ***, int *)
* }
*/
public static void local_command_line(MemorySegment struct, MemorySegment fieldValue) {
struct.set(local_command_line$LAYOUT, local_command_line$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* void (*before_emit)(GApplication *, GVariant *)
* }
*/
public class before_emit {
/**
* 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(before_emit.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(before_emit.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 before_emit$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("before_emit"));
/**
* Layout for field:
* {@snippet lang=c :
* void (*before_emit)(GApplication *, GVariant *)
* }
*/
public static final AddressLayout before_emit$layout() {
return before_emit$LAYOUT;
}
private static final long before_emit$OFFSET = 176;
/**
* Offset for field:
* {@snippet lang=c :
* void (*before_emit)(GApplication *, GVariant *)
* }
*/
public static final long before_emit$offset() {
return before_emit$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* void (*before_emit)(GApplication *, GVariant *)
* }
*/
public static MemorySegment before_emit(MemorySegment struct) {
return struct.get(before_emit$LAYOUT, before_emit$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* void (*before_emit)(GApplication *, GVariant *)
* }
*/
public static void before_emit(MemorySegment struct, MemorySegment fieldValue) {
struct.set(before_emit$LAYOUT, before_emit$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* void (*after_emit)(GApplication *, GVariant *)
* }
*/
public class after_emit {
/**
* 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(after_emit.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(after_emit.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 after_emit$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("after_emit"));
/**
* Layout for field:
* {@snippet lang=c :
* void (*after_emit)(GApplication *, GVariant *)
* }
*/
public static final AddressLayout after_emit$layout() {
return after_emit$LAYOUT;
}
private static final long after_emit$OFFSET = 184;
/**
* Offset for field:
* {@snippet lang=c :
* void (*after_emit)(GApplication *, GVariant *)
* }
*/
public static final long after_emit$offset() {
return after_emit$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* void (*after_emit)(GApplication *, GVariant *)
* }
*/
public static MemorySegment after_emit(MemorySegment struct) {
return struct.get(after_emit$LAYOUT, after_emit$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* void (*after_emit)(GApplication *, GVariant *)
* }
*/
public static void after_emit(MemorySegment struct, MemorySegment fieldValue) {
struct.set(after_emit$LAYOUT, after_emit$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* void (*add_platform_data)(GApplication *, GVariantBuilder *)
* }
*/
public class add_platform_data {
/**
* 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(add_platform_data.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(add_platform_data.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 add_platform_data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("add_platform_data"));
/**
* Layout for field:
* {@snippet lang=c :
* void (*add_platform_data)(GApplication *, GVariantBuilder *)
* }
*/
public static final AddressLayout add_platform_data$layout() {
return add_platform_data$LAYOUT;
}
private static final long add_platform_data$OFFSET = 192;
/**
* Offset for field:
* {@snippet lang=c :
* void (*add_platform_data)(GApplication *, GVariantBuilder *)
* }
*/
public static final long add_platform_data$offset() {
return add_platform_data$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* void (*add_platform_data)(GApplication *, GVariantBuilder *)
* }
*/
public static MemorySegment add_platform_data(MemorySegment struct) {
return struct.get(add_platform_data$LAYOUT, add_platform_data$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* void (*add_platform_data)(GApplication *, GVariantBuilder *)
* }
*/
public static void add_platform_data(MemorySegment struct, MemorySegment fieldValue) {
struct.set(add_platform_data$LAYOUT, add_platform_data$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* void (*quit_mainloop)(GApplication *)
* }
*/
public class quit_mainloop {
/**
* 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(quit_mainloop.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(quit_mainloop.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 quit_mainloop$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("quit_mainloop"));
/**
* Layout for field:
* {@snippet lang=c :
* void (*quit_mainloop)(GApplication *)
* }
*/
public static final AddressLayout quit_mainloop$layout() {
return quit_mainloop$LAYOUT;
}
private static final long quit_mainloop$OFFSET = 200;
/**
* Offset for field:
* {@snippet lang=c :
* void (*quit_mainloop)(GApplication *)
* }
*/
public static final long quit_mainloop$offset() {
return quit_mainloop$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* void (*quit_mainloop)(GApplication *)
* }
*/
public static MemorySegment quit_mainloop(MemorySegment struct) {
return struct.get(quit_mainloop$LAYOUT, quit_mainloop$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* void (*quit_mainloop)(GApplication *)
* }
*/
public static void quit_mainloop(MemorySegment struct, MemorySegment fieldValue) {
struct.set(quit_mainloop$LAYOUT, quit_mainloop$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* void (*run_mainloop)(GApplication *)
* }
*/
public class run_mainloop {
/**
* 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(run_mainloop.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(run_mainloop.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 run_mainloop$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("run_mainloop"));
/**
* Layout for field:
* {@snippet lang=c :
* void (*run_mainloop)(GApplication *)
* }
*/
public static final AddressLayout run_mainloop$layout() {
return run_mainloop$LAYOUT;
}
private static final long run_mainloop$OFFSET = 208;
/**
* Offset for field:
* {@snippet lang=c :
* void (*run_mainloop)(GApplication *)
* }
*/
public static final long run_mainloop$offset() {
return run_mainloop$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* void (*run_mainloop)(GApplication *)
* }
*/
public static MemorySegment run_mainloop(MemorySegment struct) {
return struct.get(run_mainloop$LAYOUT, run_mainloop$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* void (*run_mainloop)(GApplication *)
* }
*/
public static void run_mainloop(MemorySegment struct, MemorySegment fieldValue) {
struct.set(run_mainloop$LAYOUT, run_mainloop$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* void (*shutdown)(GApplication *)
* }
*/
public class shutdown {
/**
* 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(shutdown.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(shutdown.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 shutdown$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("shutdown"));
/**
* Layout for field:
* {@snippet lang=c :
* void (*shutdown)(GApplication *)
* }
*/
public static final AddressLayout shutdown$layout() {
return shutdown$LAYOUT;
}
private static final long shutdown$OFFSET = 216;
/**
* Offset for field:
* {@snippet lang=c :
* void (*shutdown)(GApplication *)
* }
*/
public static final long shutdown$offset() {
return shutdown$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* void (*shutdown)(GApplication *)
* }
*/
public static MemorySegment shutdown(MemorySegment struct) {
return struct.get(shutdown$LAYOUT, shutdown$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* void (*shutdown)(GApplication *)
* }
*/
public static void shutdown(MemorySegment struct, MemorySegment fieldValue) {
struct.set(shutdown$LAYOUT, shutdown$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* gboolean (*dbus_register)(GApplication *, GDBusConnection *, const gchar *, GError **)
* }
*/
public class dbus_register {
/**
* The function pointer signature, expressed as a functional interface
*/
public interface Function {
int apply(MemorySegment _x0, MemorySegment _x1, MemorySegment _x2, MemorySegment _x3);
}
private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
app_indicator_h.C_INT,
app_indicator_h.C_POINTER,
app_indicator_h.C_POINTER,
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(dbus_register.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(dbus_register.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, MemorySegment _x1, MemorySegment _x2, MemorySegment _x3) {
try {
return (int) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2, _x3);
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
}
}
private static final AddressLayout dbus_register$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("dbus_register"));
/**
* Layout for field:
* {@snippet lang=c :
* gboolean (*dbus_register)(GApplication *, GDBusConnection *, const gchar *, GError **)
* }
*/
public static final AddressLayout dbus_register$layout() {
return dbus_register$LAYOUT;
}
private static final long dbus_register$OFFSET = 224;
/**
* Offset for field:
* {@snippet lang=c :
* gboolean (*dbus_register)(GApplication *, GDBusConnection *, const gchar *, GError **)
* }
*/
public static final long dbus_register$offset() {
return dbus_register$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* gboolean (*dbus_register)(GApplication *, GDBusConnection *, const gchar *, GError **)
* }
*/
public static MemorySegment dbus_register(MemorySegment struct) {
return struct.get(dbus_register$LAYOUT, dbus_register$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* gboolean (*dbus_register)(GApplication *, GDBusConnection *, const gchar *, GError **)
* }
*/
public static void dbus_register(MemorySegment struct, MemorySegment fieldValue) {
struct.set(dbus_register$LAYOUT, dbus_register$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* void (*dbus_unregister)(GApplication *, GDBusConnection *, const gchar *)
* }
*/
public class dbus_unregister {
/**
* The function pointer signature, expressed as a functional interface
*/
public interface Function {
void apply(MemorySegment _x0, MemorySegment _x1, MemorySegment _x2);
}
private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid(
app_indicator_h.C_POINTER,
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(dbus_unregister.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(dbus_unregister.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, MemorySegment _x2) {
try {
DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2);
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
}
}
private static final AddressLayout dbus_unregister$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("dbus_unregister"));
/**
* Layout for field:
* {@snippet lang=c :
* void (*dbus_unregister)(GApplication *, GDBusConnection *, const gchar *)
* }
*/
public static final AddressLayout dbus_unregister$layout() {
return dbus_unregister$LAYOUT;
}
private static final long dbus_unregister$OFFSET = 232;
/**
* Offset for field:
* {@snippet lang=c :
* void (*dbus_unregister)(GApplication *, GDBusConnection *, const gchar *)
* }
*/
public static final long dbus_unregister$offset() {
return dbus_unregister$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* void (*dbus_unregister)(GApplication *, GDBusConnection *, const gchar *)
* }
*/
public static MemorySegment dbus_unregister(MemorySegment struct) {
return struct.get(dbus_unregister$LAYOUT, dbus_unregister$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* void (*dbus_unregister)(GApplication *, GDBusConnection *, const gchar *)
* }
*/
public static void dbus_unregister(MemorySegment struct, MemorySegment fieldValue) {
struct.set(dbus_unregister$LAYOUT, dbus_unregister$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* gint (*handle_local_options)(GApplication *, GVariantDict *)
* }
*/
public class handle_local_options {
/**
* The function pointer signature, expressed as a functional interface
*/
public interface Function {
int apply(MemorySegment _x0, MemorySegment _x1);
}
private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
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(handle_local_options.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(handle_local_options.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, MemorySegment _x1) {
try {
return (int) DOWN$MH.invokeExact(funcPtr, _x0, _x1);
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
}
}
private static final AddressLayout handle_local_options$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("handle_local_options"));
/**
* Layout for field:
* {@snippet lang=c :
* gint (*handle_local_options)(GApplication *, GVariantDict *)
* }
*/
public static final AddressLayout handle_local_options$layout() {
return handle_local_options$LAYOUT;
}
private static final long handle_local_options$OFFSET = 240;
/**
* Offset for field:
* {@snippet lang=c :
* gint (*handle_local_options)(GApplication *, GVariantDict *)
* }
*/
public static final long handle_local_options$offset() {
return handle_local_options$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* gint (*handle_local_options)(GApplication *, GVariantDict *)
* }
*/
public static MemorySegment handle_local_options(MemorySegment struct) {
return struct.get(handle_local_options$LAYOUT, handle_local_options$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* gint (*handle_local_options)(GApplication *, GVariantDict *)
* }
*/
public static void handle_local_options(MemorySegment struct, MemorySegment fieldValue) {
struct.set(handle_local_options$LAYOUT, handle_local_options$OFFSET, fieldValue);
}
/**
* {@snippet lang=c :
* gboolean (*name_lost)(GApplication *)
* }
*/
public class name_lost {
/**
* The function pointer signature, expressed as a functional interface
*/
public interface Function {
int apply(MemorySegment _x0);
}
private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
app_indicator_h.C_INT,
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(name_lost.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(name_lost.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) {
try {
return (int) DOWN$MH.invokeExact(funcPtr, _x0);
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
}
}
private static final AddressLayout name_lost$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("name_lost"));
/**
* Layout for field:
* {@snippet lang=c :
* gboolean (*name_lost)(GApplication *)
* }
*/
public static final AddressLayout name_lost$layout() {
return name_lost$LAYOUT;
}
private static final long name_lost$OFFSET = 248;
/**
* Offset for field:
* {@snippet lang=c :
* gboolean (*name_lost)(GApplication *)
* }
*/
public static final long name_lost$offset() {
return name_lost$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* gboolean (*name_lost)(GApplication *)
* }
*/
public static MemorySegment name_lost(MemorySegment struct) {
return struct.get(name_lost$LAYOUT, name_lost$OFFSET);
}
/**
* Setter for field:
* {@snippet lang=c :
* gboolean (*name_lost)(GApplication *)
* }
*/
public static void name_lost(MemorySegment struct, MemorySegment fieldValue) {
struct.set(name_lost$LAYOUT, name_lost$OFFSET, fieldValue);
}
private static final SequenceLayout padding$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("padding"));
/**
* Layout for field:
* {@snippet lang=c :
* gpointer padding[7]
* }
*/
public static final SequenceLayout padding$layout() {
return padding$LAYOUT;
}
private static final long padding$OFFSET = 256;
/**
* Offset for field:
* {@snippet lang=c :
* gpointer padding[7]
* }
*/
public static final long padding$offset() {
return padding$OFFSET;
}
/**
* Getter for field:
* {@snippet lang=c :
* gpointer padding[7]
* }
*/
public static MemorySegment padding(MemorySegment struct) {
return struct.asSlice(padding$OFFSET, padding$LAYOUT.byteSize());
}
/**
* Setter for field:
* {@snippet lang=c :
* gpointer padding[7]
* }
*/
public static void padding(MemorySegment struct, MemorySegment fieldValue) {
MemorySegment.copy(fieldValue, 0L, struct, padding$OFFSET, padding$LAYOUT.byteSize());
}
private static long[] padding$DIMS = { 7 };
/**
* Dimensions for array field:
* {@snippet lang=c :
* gpointer padding[7]
* }
*/
public static long[] padding$dimensions() {
return padding$DIMS;
}
private static final VarHandle padding$ELEM_HANDLE = padding$LAYOUT.varHandle(sequenceElement());
/**
* Indexed getter for field:
* {@snippet lang=c :
* gpointer padding[7]
* }
*/
public static MemorySegment padding(MemorySegment struct, long index0) {
return (MemorySegment)padding$ELEM_HANDLE.get(struct, 0L, index0);
}
/**
* Indexed setter for field:
* {@snippet lang=c :
* gpointer padding[7]
* }
*/
public static void padding(MemorySegment struct, long index0, MemorySegment fieldValue) {
padding$ELEM_HANDLE.set(struct, 0L, index0, 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);
}
}