org.purejava.appindicator._GPollableInputStreamInterface 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 _GPollableInputStreamInterface {
* struct _GTypeInterface g_iface;
* int (*can_poll)(struct _GPollableInputStream*);
* int (*is_readable)(struct _GPollableInputStream*);
* struct _GSource* (*create_source)(struct _GPollableInputStream*,struct _GCancellable*);
* long (*read_nonblocking)(struct _GPollableInputStream*,void*,unsigned long,struct _GError**);
* };
* }
*/
public class _GPollableInputStreamInterface {
public static MemoryLayout $LAYOUT() {
return constants$1209.const$1;
}
public static MemorySegment g_iface$slice(MemorySegment seg) {
return seg.asSlice(0, 16);
}
/**
* {@snippet :
* int (*can_poll)(struct _GPollableInputStream*);
* }
*/
public interface can_poll {
int apply(java.lang.foreign.MemorySegment user_data);
static MemorySegment allocate(can_poll fi, Arena scope) {
return RuntimeHelper.upcallStub(constants$1209.const$2, fi, constants$10.const$5, scope);
}
static can_poll ofAddress(MemorySegment addr, Arena arena) {
MemorySegment symbol = addr.reinterpret(arena, null);
return (java.lang.foreign.MemorySegment _user_data) -> {
try {
return (int)constants$14.const$2.invokeExact(symbol, _user_data);
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
};
}
}
public static VarHandle can_poll$VH() {
return constants$1209.const$3;
}
/**
* Getter for field:
* {@snippet :
* int (*can_poll)(struct _GPollableInputStream*);
* }
*/
public static MemorySegment can_poll$get(MemorySegment seg) {
return (java.lang.foreign.MemorySegment)constants$1209.const$3.get(seg);
}
/**
* Setter for field:
* {@snippet :
* int (*can_poll)(struct _GPollableInputStream*);
* }
*/
public static void can_poll$set(MemorySegment seg, MemorySegment x) {
constants$1209.const$3.set(seg, x);
}
public static MemorySegment can_poll$get(MemorySegment seg, long index) {
return (java.lang.foreign.MemorySegment)constants$1209.const$3.get(seg.asSlice(index*sizeof()));
}
public static void can_poll$set(MemorySegment seg, long index, MemorySegment x) {
constants$1209.const$3.set(seg.asSlice(index*sizeof()), x);
}
public static can_poll can_poll(MemorySegment segment, Arena scope) {
return can_poll.ofAddress(can_poll$get(segment), scope);
}
/**
* {@snippet :
* int (*is_readable)(struct _GPollableInputStream*);
* }
*/
public interface is_readable {
int apply(java.lang.foreign.MemorySegment user_data);
static MemorySegment allocate(is_readable fi, Arena scope) {
return RuntimeHelper.upcallStub(constants$1209.const$4, fi, constants$10.const$5, scope);
}
static is_readable ofAddress(MemorySegment addr, Arena arena) {
MemorySegment symbol = addr.reinterpret(arena, null);
return (java.lang.foreign.MemorySegment _user_data) -> {
try {
return (int)constants$14.const$2.invokeExact(symbol, _user_data);
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
};
}
}
public static VarHandle is_readable$VH() {
return constants$1209.const$5;
}
/**
* Getter for field:
* {@snippet :
* int (*is_readable)(struct _GPollableInputStream*);
* }
*/
public static MemorySegment is_readable$get(MemorySegment seg) {
return (java.lang.foreign.MemorySegment)constants$1209.const$5.get(seg);
}
/**
* Setter for field:
* {@snippet :
* int (*is_readable)(struct _GPollableInputStream*);
* }
*/
public static void is_readable$set(MemorySegment seg, MemorySegment x) {
constants$1209.const$5.set(seg, x);
}
public static MemorySegment is_readable$get(MemorySegment seg, long index) {
return (java.lang.foreign.MemorySegment)constants$1209.const$5.get(seg.asSlice(index*sizeof()));
}
public static void is_readable$set(MemorySegment seg, long index, MemorySegment x) {
constants$1209.const$5.set(seg.asSlice(index*sizeof()), x);
}
public static is_readable is_readable(MemorySegment segment, Arena scope) {
return is_readable.ofAddress(is_readable$get(segment), scope);
}
/**
* {@snippet :
* struct _GSource* (*create_source)(struct _GPollableInputStream*,struct _GCancellable*);
* }
*/
public interface create_source {
java.lang.foreign.MemorySegment apply(java.lang.foreign.MemorySegment path, java.lang.foreign.MemorySegment func_data);
static MemorySegment allocate(create_source fi, Arena scope) {
return RuntimeHelper.upcallStub(constants$1210.const$0, fi, constants$5.const$5, scope);
}
static create_source 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 create_source$VH() {
return constants$1210.const$1;
}
/**
* Getter for field:
* {@snippet :
* struct _GSource* (*create_source)(struct _GPollableInputStream*,struct _GCancellable*);
* }
*/
public static MemorySegment create_source$get(MemorySegment seg) {
return (java.lang.foreign.MemorySegment)constants$1210.const$1.get(seg);
}
/**
* Setter for field:
* {@snippet :
* struct _GSource* (*create_source)(struct _GPollableInputStream*,struct _GCancellable*);
* }
*/
public static void create_source$set(MemorySegment seg, MemorySegment x) {
constants$1210.const$1.set(seg, x);
}
public static MemorySegment create_source$get(MemorySegment seg, long index) {
return (java.lang.foreign.MemorySegment)constants$1210.const$1.get(seg.asSlice(index*sizeof()));
}
public static void create_source$set(MemorySegment seg, long index, MemorySegment x) {
constants$1210.const$1.set(seg.asSlice(index*sizeof()), x);
}
public static create_source create_source(MemorySegment segment, Arena scope) {
return create_source.ofAddress(create_source$get(segment), scope);
}
/**
* {@snippet :
* long (*read_nonblocking)(struct _GPollableInputStream*,void*,unsigned long,struct _GError**);
* }
*/
public interface read_nonblocking {
long apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, java.lang.foreign.MemorySegment _x3);
static MemorySegment allocate(read_nonblocking fi, Arena scope) {
return RuntimeHelper.upcallStub(constants$1210.const$2, fi, constants$20.const$4, scope);
}
static read_nonblocking ofAddress(MemorySegment addr, Arena arena) {
MemorySegment symbol = addr.reinterpret(arena, null);
return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, java.lang.foreign.MemorySegment __x3) -> {
try {
return (long)constants$1210.const$3.invokeExact(symbol, __x0, __x1, __x2, __x3);
} catch (Throwable ex$) {
throw new AssertionError("should not reach here", ex$);
}
};
}
}
public static VarHandle read_nonblocking$VH() {
return constants$1210.const$4;
}
/**
* Getter for field:
* {@snippet :
* long (*read_nonblocking)(struct _GPollableInputStream*,void*,unsigned long,struct _GError**);
* }
*/
public static MemorySegment read_nonblocking$get(MemorySegment seg) {
return (java.lang.foreign.MemorySegment)constants$1210.const$4.get(seg);
}
/**
* Setter for field:
* {@snippet :
* long (*read_nonblocking)(struct _GPollableInputStream*,void*,unsigned long,struct _GError**);
* }
*/
public static void read_nonblocking$set(MemorySegment seg, MemorySegment x) {
constants$1210.const$4.set(seg, x);
}
public static MemorySegment read_nonblocking$get(MemorySegment seg, long index) {
return (java.lang.foreign.MemorySegment)constants$1210.const$4.get(seg.asSlice(index*sizeof()));
}
public static void read_nonblocking$set(MemorySegment seg, long index, MemorySegment x) {
constants$1210.const$4.set(seg.asSlice(index*sizeof()), x);
}
public static read_nonblocking read_nonblocking(MemorySegment segment, Arena scope) {
return read_nonblocking.ofAddress(read_nonblocking$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); }
}