org.purejava.appindicator._GActionMapInterface Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of libappindicator-gtk3-java-full Show documentation
Show all versions of libappindicator-gtk3-java-full Show documentation
Java bindings for libappindicator-gtk3 in 100% pure Java
// Generated by jextract
package org.purejava.appindicator;
import java.lang.foreign.Arena;
import java.lang.foreign.MemoryLayout;
import java.lang.foreign.MemorySegment;
import java.lang.foreign.SegmentAllocator;
import java.lang.invoke.VarHandle;
/**
* {@snippet :
* struct _GActionMapInterface {
* struct _GTypeInterface g_iface;
* struct _GAction* (*lookup_action)(struct _GActionMap*,char*);
* void (*add_action)(struct _GActionMap*,struct _GAction*);
* void (*remove_action)(struct _GActionMap*,char*);
* };
* }
*/
public class _GActionMapInterface {
public static MemoryLayout $LAYOUT() {
return constants$712.const$0;
}
public static MemorySegment g_iface$slice(MemorySegment seg) {
return seg.asSlice(0, 16);
}
/**
* {@snippet :
* struct _GAction* (*lookup_action)(struct _GActionMap*,char*);
* }
*/
public interface lookup_action {
java.lang.foreign.MemorySegment apply(java.lang.foreign.MemorySegment path, java.lang.foreign.MemorySegment func_data);
static MemorySegment allocate(lookup_action fi, Arena scope) {
return RuntimeHelper.upcallStub(constants$712.const$1, fi, constants$5.const$5, scope);
}
static lookup_action ofAddress(MemorySegment addr, Arena arena) {
MemorySegment symbol = addr.reinterpret(arena, null);
return (java.lang.foreign.MemorySegment _path, java.lang.foreign.MemorySegment _func_data) -> {
try {
return (java.lang.foreign.MemorySegment)constants$15.const$1.invokeExact(symbol, _path, _func_data);
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
};
}
}
public static VarHandle lookup_action$VH() {
return constants$712.const$2;
}
/**
* Getter for field:
* {@snippet :
* struct _GAction* (*lookup_action)(struct _GActionMap*,char*);
* }
*/
public static MemorySegment lookup_action$get(MemorySegment seg) {
return (java.lang.foreign.MemorySegment)constants$712.const$2.get(seg);
}
/**
* Setter for field:
* {@snippet :
* struct _GAction* (*lookup_action)(struct _GActionMap*,char*);
* }
*/
public static void lookup_action$set(MemorySegment seg, MemorySegment x) {
constants$712.const$2.set(seg, x);
}
public static MemorySegment lookup_action$get(MemorySegment seg, long index) {
return (java.lang.foreign.MemorySegment)constants$712.const$2.get(seg.asSlice(index*sizeof()));
}
public static void lookup_action$set(MemorySegment seg, long index, MemorySegment x) {
constants$712.const$2.set(seg.asSlice(index*sizeof()), x);
}
public static lookup_action lookup_action(MemorySegment segment, Arena scope) {
return lookup_action.ofAddress(lookup_action$get(segment), scope);
}
/**
* {@snippet :
* void (*add_action)(struct _GActionMap*,struct _GAction*);
* }
*/
public interface add_action {
void apply(java.lang.foreign.MemorySegment tag, java.lang.foreign.MemorySegment data);
static MemorySegment allocate(add_action fi, Arena scope) {
return RuntimeHelper.upcallStub(constants$712.const$3, fi, constants$13.const$4, scope);
}
static add_action ofAddress(MemorySegment addr, Arena arena) {
MemorySegment symbol = addr.reinterpret(arena, null);
return (java.lang.foreign.MemorySegment _tag, java.lang.foreign.MemorySegment _data) -> {
try {
constants$14.const$0.invokeExact(symbol, _tag, _data);
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
};
}
}
public static VarHandle add_action$VH() {
return constants$712.const$4;
}
/**
* Getter for field:
* {@snippet :
* void (*add_action)(struct _GActionMap*,struct _GAction*);
* }
*/
public static MemorySegment add_action$get(MemorySegment seg) {
return (java.lang.foreign.MemorySegment)constants$712.const$4.get(seg);
}
/**
* Setter for field:
* {@snippet :
* void (*add_action)(struct _GActionMap*,struct _GAction*);
* }
*/
public static void add_action$set(MemorySegment seg, MemorySegment x) {
constants$712.const$4.set(seg, x);
}
public static MemorySegment add_action$get(MemorySegment seg, long index) {
return (java.lang.foreign.MemorySegment)constants$712.const$4.get(seg.asSlice(index*sizeof()));
}
public static void add_action$set(MemorySegment seg, long index, MemorySegment x) {
constants$712.const$4.set(seg.asSlice(index*sizeof()), x);
}
public static add_action add_action(MemorySegment segment, Arena scope) {
return add_action.ofAddress(add_action$get(segment), scope);
}
/**
* {@snippet :
* void (*remove_action)(struct _GActionMap*,char*);
* }
*/
public interface remove_action {
void apply(java.lang.foreign.MemorySegment tag, java.lang.foreign.MemorySegment data);
static MemorySegment allocate(remove_action fi, Arena scope) {
return RuntimeHelper.upcallStub(constants$712.const$5, fi, constants$13.const$4, scope);
}
static remove_action ofAddress(MemorySegment addr, Arena arena) {
MemorySegment symbol = addr.reinterpret(arena, null);
return (java.lang.foreign.MemorySegment _tag, java.lang.foreign.MemorySegment _data) -> {
try {
constants$14.const$0.invokeExact(symbol, _tag, _data);
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
};
}
}
public static VarHandle remove_action$VH() {
return constants$713.const$0;
}
/**
* Getter for field:
* {@snippet :
* void (*remove_action)(struct _GActionMap*,char*);
* }
*/
public static MemorySegment remove_action$get(MemorySegment seg) {
return (java.lang.foreign.MemorySegment)constants$713.const$0.get(seg);
}
/**
* Setter for field:
* {@snippet :
* void (*remove_action)(struct _GActionMap*,char*);
* }
*/
public static void remove_action$set(MemorySegment seg, MemorySegment x) {
constants$713.const$0.set(seg, x);
}
public static MemorySegment remove_action$get(MemorySegment seg, long index) {
return (java.lang.foreign.MemorySegment)constants$713.const$0.get(seg.asSlice(index*sizeof()));
}
public static void remove_action$set(MemorySegment seg, long index, MemorySegment x) {
constants$713.const$0.set(seg.asSlice(index*sizeof()), x);
}
public static remove_action remove_action(MemorySegment segment, Arena scope) {
return remove_action.ofAddress(remove_action$get(segment), scope);
}
public static long sizeof() { return $LAYOUT().byteSize(); }
public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
}
public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
}