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

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

There is a newer version: 1.4.1
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 _GActionEntry {
 *     char* name;
 *     void (*activate)(struct _GSimpleAction*,struct _GVariant*,void*);
 *     char* parameter_type;
 *     char* state;
 *     void (*change_state)(struct _GSimpleAction*,struct _GVariant*,void*);
 *     unsigned long padding[3];
 * };
 * }
 */
public class _GActionEntry {

    public static MemoryLayout $LAYOUT() {
        return constants$713.const$1;
    }
    public static VarHandle name$VH() {
        return constants$713.const$2;
    }
    /**
     * Getter for field:
     * {@snippet :
     * char* name;
     * }
     */
    public static MemorySegment name$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$713.const$2.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * char* name;
     * }
     */
    public static void name$set(MemorySegment seg, MemorySegment x) {
        constants$713.const$2.set(seg, x);
    }
    public static MemorySegment name$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$713.const$2.get(seg.asSlice(index*sizeof()));
    }
    public static void name$set(MemorySegment seg, long index, MemorySegment x) {
        constants$713.const$2.set(seg.asSlice(index*sizeof()), x);
    }
    /**
     * {@snippet :
 * void (*activate)(struct _GSimpleAction*,struct _GVariant*,void*);
     * }
     */
    public interface activate {

        void apply(java.lang.foreign.MemorySegment key, java.lang.foreign.MemorySegment value, java.lang.foreign.MemorySegment user_data);
        static MemorySegment allocate(activate fi, Arena scope) {
            return RuntimeHelper.upcallStub(constants$713.const$3, fi, constants$14.const$3, scope);
        }
        static activate ofAddress(MemorySegment addr, Arena arena) {
            MemorySegment symbol = addr.reinterpret(arena, null);
            return (java.lang.foreign.MemorySegment _key, java.lang.foreign.MemorySegment _value, java.lang.foreign.MemorySegment _user_data) -> {
                try {
                    constants$14.const$5.invokeExact(symbol, _key, _value, _user_data);
                } catch (Throwable ex$) {
                    throw new AssertionError("should not reach here", ex$);
                }
            };
        }
    }

    public static VarHandle activate$VH() {
        return constants$713.const$4;
    }
    /**
     * Getter for field:
     * {@snippet :
     * void (*activate)(struct _GSimpleAction*,struct _GVariant*,void*);
     * }
     */
    public static MemorySegment activate$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$713.const$4.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * void (*activate)(struct _GSimpleAction*,struct _GVariant*,void*);
     * }
     */
    public static void activate$set(MemorySegment seg, MemorySegment x) {
        constants$713.const$4.set(seg, x);
    }
    public static MemorySegment activate$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$713.const$4.get(seg.asSlice(index*sizeof()));
    }
    public static void activate$set(MemorySegment seg, long index, MemorySegment x) {
        constants$713.const$4.set(seg.asSlice(index*sizeof()), x);
    }
    public static activate activate(MemorySegment segment, Arena scope) {
        return activate.ofAddress(activate$get(segment), scope);
    }
    public static VarHandle parameter_type$VH() {
        return constants$713.const$5;
    }
    /**
     * Getter for field:
     * {@snippet :
     * char* parameter_type;
     * }
     */
    public static MemorySegment parameter_type$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$713.const$5.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * char* parameter_type;
     * }
     */
    public static void parameter_type$set(MemorySegment seg, MemorySegment x) {
        constants$713.const$5.set(seg, x);
    }
    public static MemorySegment parameter_type$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$713.const$5.get(seg.asSlice(index*sizeof()));
    }
    public static void parameter_type$set(MemorySegment seg, long index, MemorySegment x) {
        constants$713.const$5.set(seg.asSlice(index*sizeof()), x);
    }
    public static VarHandle state$VH() {
        return constants$714.const$0;
    }
    /**
     * Getter for field:
     * {@snippet :
     * char* state;
     * }
     */
    public static MemorySegment state$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$714.const$0.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * char* state;
     * }
     */
    public static void state$set(MemorySegment seg, MemorySegment x) {
        constants$714.const$0.set(seg, x);
    }
    public static MemorySegment state$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$714.const$0.get(seg.asSlice(index*sizeof()));
    }
    public static void state$set(MemorySegment seg, long index, MemorySegment x) {
        constants$714.const$0.set(seg.asSlice(index*sizeof()), x);
    }
    /**
     * {@snippet :
 * void (*change_state)(struct _GSimpleAction*,struct _GVariant*,void*);
     * }
     */
    public interface change_state {

        void apply(java.lang.foreign.MemorySegment key, java.lang.foreign.MemorySegment value, java.lang.foreign.MemorySegment user_data);
        static MemorySegment allocate(change_state fi, Arena scope) {
            return RuntimeHelper.upcallStub(constants$714.const$1, fi, constants$14.const$3, scope);
        }
        static change_state ofAddress(MemorySegment addr, Arena arena) {
            MemorySegment symbol = addr.reinterpret(arena, null);
            return (java.lang.foreign.MemorySegment _key, java.lang.foreign.MemorySegment _value, java.lang.foreign.MemorySegment _user_data) -> {
                try {
                    constants$14.const$5.invokeExact(symbol, _key, _value, _user_data);
                } catch (Throwable ex$) {
                    throw new AssertionError("should not reach here", ex$);
                }
            };
        }
    }

    public static VarHandle change_state$VH() {
        return constants$714.const$2;
    }
    /**
     * Getter for field:
     * {@snippet :
     * void (*change_state)(struct _GSimpleAction*,struct _GVariant*,void*);
     * }
     */
    public static MemorySegment change_state$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$714.const$2.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * void (*change_state)(struct _GSimpleAction*,struct _GVariant*,void*);
     * }
     */
    public static void change_state$set(MemorySegment seg, MemorySegment x) {
        constants$714.const$2.set(seg, x);
    }
    public static MemorySegment change_state$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$714.const$2.get(seg.asSlice(index*sizeof()));
    }
    public static void change_state$set(MemorySegment seg, long index, MemorySegment x) {
        constants$714.const$2.set(seg.asSlice(index*sizeof()), x);
    }
    public static change_state change_state(MemorySegment segment, Arena scope) {
        return change_state.ofAddress(change_state$get(segment), scope);
    }
    public static MemorySegment padding$slice(MemorySegment seg) {
        return seg.asSlice(40, 24);
    }
    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 - 2024 Weber Informatics LLC | Privacy Policy