All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.purejava.appindicator._GAsyncInitableIface Maven / Gradle / Ivy

There is a newer version: 1.4.2
Show newest version
// 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 _GAsyncInitableIface {
 *     struct _GTypeInterface g_iface;
 *     void (*init_async)(struct _GAsyncInitable*,int,struct _GCancellable*,void (*)(struct _GObject*,struct _GAsyncResult*,void*),void*);
 *     int (*init_finish)(struct _GAsyncInitable*,struct _GAsyncResult*,struct _GError**);
 * };
 * }
 */
public class _GAsyncInitableIface {

    public static MemoryLayout $LAYOUT() {
        return constants$754.const$0;
    }
    public static MemorySegment g_iface$slice(MemorySegment seg) {
        return seg.asSlice(0, 16);
    }
    /**
     * {@snippet :
 * void (*init_async)(struct _GAsyncInitable*,int,struct _GCancellable*,void (*)(struct _GObject*,struct _GAsyncResult*,void*),void*);
     * }
     */
    public interface init_async {

        void apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2, java.lang.foreign.MemorySegment _x3, java.lang.foreign.MemorySegment _x4);
        static MemorySegment allocate(init_async fi, Arena scope) {
            return RuntimeHelper.upcallStub(constants$754.const$1, fi, constants$281.const$5, scope);
        }
        static init_async ofAddress(MemorySegment addr, Arena arena) {
            MemorySegment symbol = addr.reinterpret(arena, null);
            return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2, java.lang.foreign.MemorySegment __x3, java.lang.foreign.MemorySegment __x4) -> {
                try {
                    constants$754.const$2.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4);
                } catch (Throwable ex$) {
                    throw new AssertionError("should not reach here", ex$);
                }
            };
        }
    }

    public static VarHandle init_async$VH() {
        return constants$754.const$3;
    }
    /**
     * Getter for field:
     * {@snippet :
     * void (*init_async)(struct _GAsyncInitable*,int,struct _GCancellable*,void (*)(struct _GObject*,struct _GAsyncResult*,void*),void*);
     * }
     */
    public static MemorySegment init_async$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$754.const$3.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * void (*init_async)(struct _GAsyncInitable*,int,struct _GCancellable*,void (*)(struct _GObject*,struct _GAsyncResult*,void*),void*);
     * }
     */
    public static void init_async$set(MemorySegment seg, MemorySegment x) {
        constants$754.const$3.set(seg, x);
    }
    public static MemorySegment init_async$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$754.const$3.get(seg.asSlice(index*sizeof()));
    }
    public static void init_async$set(MemorySegment seg, long index, MemorySegment x) {
        constants$754.const$3.set(seg.asSlice(index*sizeof()), x);
    }
    public static init_async init_async(MemorySegment segment, Arena scope) {
        return init_async.ofAddress(init_async$get(segment), scope);
    }
    /**
     * {@snippet :
 * int (*init_finish)(struct _GAsyncInitable*,struct _GAsyncResult*,struct _GError**);
     * }
     */
    public interface init_finish {

        int apply(java.lang.foreign.MemorySegment a, java.lang.foreign.MemorySegment b, java.lang.foreign.MemorySegment user_data);
        static MemorySegment allocate(init_finish fi, Arena scope) {
            return RuntimeHelper.upcallStub(constants$754.const$4, fi, constants$12.const$2, scope);
        }
        static init_finish ofAddress(MemorySegment addr, Arena arena) {
            MemorySegment symbol = addr.reinterpret(arena, null);
            return (java.lang.foreign.MemorySegment _a, java.lang.foreign.MemorySegment _b, java.lang.foreign.MemorySegment _user_data) -> {
                try {
                    return (int)constants$12.const$4.invokeExact(symbol, _a, _b, _user_data);
                } catch (Throwable ex$) {
                    throw new AssertionError("should not reach here", ex$);
                }
            };
        }
    }

    public static VarHandle init_finish$VH() {
        return constants$754.const$5;
    }
    /**
     * Getter for field:
     * {@snippet :
     * int (*init_finish)(struct _GAsyncInitable*,struct _GAsyncResult*,struct _GError**);
     * }
     */
    public static MemorySegment init_finish$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$754.const$5.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * int (*init_finish)(struct _GAsyncInitable*,struct _GAsyncResult*,struct _GError**);
     * }
     */
    public static void init_finish$set(MemorySegment seg, MemorySegment x) {
        constants$754.const$5.set(seg, x);
    }
    public static MemorySegment init_finish$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$754.const$5.get(seg.asSlice(index*sizeof()));
    }
    public static void init_finish$set(MemorySegment seg, long index, MemorySegment x) {
        constants$754.const$5.set(seg.asSlice(index*sizeof()), x);
    }
    public static init_finish init_finish(MemorySegment segment, Arena scope) {
        return init_finish.ofAddress(init_finish$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); }
}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy