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

org.purejava.appindicator._GClosureNotifyData 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 _GClosureNotifyData {
 *     void* data;
 *     void (*notify)(void*,struct _GClosure*);
 * };
 * }
 */
public class _GClosureNotifyData {

    public static MemoryLayout $LAYOUT() {
        return constants$585.const$3;
    }
    public static VarHandle data$VH() {
        return constants$585.const$4;
    }
    /**
     * Getter for field:
     * {@snippet :
     * void* data;
     * }
     */
    public static MemorySegment data$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$585.const$4.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * void* data;
     * }
     */
    public static void data$set(MemorySegment seg, MemorySegment x) {
        constants$585.const$4.set(seg, x);
    }
    public static MemorySegment data$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$585.const$4.get(seg.asSlice(index*sizeof()));
    }
    public static void data$set(MemorySegment seg, long index, MemorySegment x) {
        constants$585.const$4.set(seg.asSlice(index*sizeof()), x);
    }
    /**
     * {@snippet :
 * void (*notify)(void*,struct _GClosure*);
     * }
     */
    public interface notify {

        void apply(java.lang.foreign.MemorySegment tag, java.lang.foreign.MemorySegment data);
        static MemorySegment allocate(notify fi, Arena scope) {
            return RuntimeHelper.upcallStub(constants$585.const$5, fi, constants$13.const$4, scope);
        }
        static notify 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 notify$VH() {
        return constants$586.const$0;
    }
    /**
     * Getter for field:
     * {@snippet :
     * void (*notify)(void*,struct _GClosure*);
     * }
     */
    public static MemorySegment notify$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$586.const$0.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * void (*notify)(void*,struct _GClosure*);
     * }
     */
    public static void notify$set(MemorySegment seg, MemorySegment x) {
        constants$586.const$0.set(seg, x);
    }
    public static MemorySegment notify$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$586.const$0.get(seg.asSlice(index*sizeof()));
    }
    public static void notify$set(MemorySegment seg, long index, MemorySegment x) {
        constants$586.const$0.set(seg.asSlice(index*sizeof()), x);
    }
    public static notify notify(MemorySegment segment, Arena scope) {
        return notify.ofAddress(notify$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