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

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

// Generated by jextract

package org.purejava.appindicator;

import java.lang.invoke.*;
import java.lang.foreign.*;
import java.nio.ByteOrder;
import java.util.*;
import java.util.function.*;
import java.util.stream.*;

import static java.lang.foreign.ValueLayout.*;
import static java.lang.foreign.MemoryLayout.PathElement.*;

/**
 * {@snippet lang=c :
 * struct _AtkValueIface {
 *     GTypeInterface parent;
 *     void (*get_current_value)(AtkValue *, GValue *);
 *     void (*get_maximum_value)(AtkValue *, GValue *);
 *     void (*get_minimum_value)(AtkValue *, GValue *);
 *     gboolean (*set_current_value)(AtkValue *, const GValue *);
 *     void (*get_minimum_increment)(AtkValue *, GValue *);
 *     void (*get_value_and_text)(AtkValue *, gdouble *, gchar **);
 *     AtkRange *(*get_range)(AtkValue *);
 *     gdouble (*get_increment)(AtkValue *);
 *     GSList *(*get_sub_ranges)(AtkValue *);
 *     void (*set_value)(AtkValue *, const gdouble);
 * }
 * }
 */
public class _AtkValueIface {

    _AtkValueIface() {
        // Should not be called directly
    }

    private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
        _GTypeInterface.layout().withName("parent"),
        app_indicator_h.C_POINTER.withName("get_current_value"),
        app_indicator_h.C_POINTER.withName("get_maximum_value"),
        app_indicator_h.C_POINTER.withName("get_minimum_value"),
        app_indicator_h.C_POINTER.withName("set_current_value"),
        app_indicator_h.C_POINTER.withName("get_minimum_increment"),
        app_indicator_h.C_POINTER.withName("get_value_and_text"),
        app_indicator_h.C_POINTER.withName("get_range"),
        app_indicator_h.C_POINTER.withName("get_increment"),
        app_indicator_h.C_POINTER.withName("get_sub_ranges"),
        app_indicator_h.C_POINTER.withName("set_value")
    ).withName("_AtkValueIface");

    /**
     * The layout of this struct
     */
    public static final GroupLayout layout() {
        return $LAYOUT;
    }

    private static final GroupLayout parent$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("parent"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * GTypeInterface parent
     * }
     */
    public static final GroupLayout parent$layout() {
        return parent$LAYOUT;
    }

    private static final long parent$OFFSET = 0;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * GTypeInterface parent
     * }
     */
    public static final long parent$offset() {
        return parent$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * GTypeInterface parent
     * }
     */
    public static MemorySegment parent(MemorySegment struct) {
        return struct.asSlice(parent$OFFSET, parent$LAYOUT.byteSize());
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * GTypeInterface parent
     * }
     */
    public static void parent(MemorySegment struct, MemorySegment fieldValue) {
        MemorySegment.copy(fieldValue, 0L, struct, parent$OFFSET, parent$LAYOUT.byteSize());
    }

    /**
     * {@snippet lang=c :
     * void (*get_current_value)(AtkValue *, GValue *)
     * }
     */
    public class get_current_value {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            void apply(MemorySegment _x0, MemorySegment _x1);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid(
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(get_current_value.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(get_current_value.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static void invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1) {
            try {
                 DOWN$MH.invokeExact(funcPtr, _x0, _x1);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout get_current_value$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("get_current_value"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*get_current_value)(AtkValue *, GValue *)
     * }
     */
    public static final AddressLayout get_current_value$layout() {
        return get_current_value$LAYOUT;
    }

    private static final long get_current_value$OFFSET = 16;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*get_current_value)(AtkValue *, GValue *)
     * }
     */
    public static final long get_current_value$offset() {
        return get_current_value$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * void (*get_current_value)(AtkValue *, GValue *)
     * }
     */
    public static MemorySegment get_current_value(MemorySegment struct) {
        return struct.get(get_current_value$LAYOUT, get_current_value$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * void (*get_current_value)(AtkValue *, GValue *)
     * }
     */
    public static void get_current_value(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(get_current_value$LAYOUT, get_current_value$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * void (*get_maximum_value)(AtkValue *, GValue *)
     * }
     */
    public class get_maximum_value {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            void apply(MemorySegment _x0, MemorySegment _x1);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid(
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(get_maximum_value.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(get_maximum_value.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static void invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1) {
            try {
                 DOWN$MH.invokeExact(funcPtr, _x0, _x1);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout get_maximum_value$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("get_maximum_value"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*get_maximum_value)(AtkValue *, GValue *)
     * }
     */
    public static final AddressLayout get_maximum_value$layout() {
        return get_maximum_value$LAYOUT;
    }

    private static final long get_maximum_value$OFFSET = 24;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*get_maximum_value)(AtkValue *, GValue *)
     * }
     */
    public static final long get_maximum_value$offset() {
        return get_maximum_value$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * void (*get_maximum_value)(AtkValue *, GValue *)
     * }
     */
    public static MemorySegment get_maximum_value(MemorySegment struct) {
        return struct.get(get_maximum_value$LAYOUT, get_maximum_value$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * void (*get_maximum_value)(AtkValue *, GValue *)
     * }
     */
    public static void get_maximum_value(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(get_maximum_value$LAYOUT, get_maximum_value$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * void (*get_minimum_value)(AtkValue *, GValue *)
     * }
     */
    public class get_minimum_value {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            void apply(MemorySegment _x0, MemorySegment _x1);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid(
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(get_minimum_value.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(get_minimum_value.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static void invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1) {
            try {
                 DOWN$MH.invokeExact(funcPtr, _x0, _x1);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout get_minimum_value$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("get_minimum_value"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*get_minimum_value)(AtkValue *, GValue *)
     * }
     */
    public static final AddressLayout get_minimum_value$layout() {
        return get_minimum_value$LAYOUT;
    }

    private static final long get_minimum_value$OFFSET = 32;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*get_minimum_value)(AtkValue *, GValue *)
     * }
     */
    public static final long get_minimum_value$offset() {
        return get_minimum_value$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * void (*get_minimum_value)(AtkValue *, GValue *)
     * }
     */
    public static MemorySegment get_minimum_value(MemorySegment struct) {
        return struct.get(get_minimum_value$LAYOUT, get_minimum_value$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * void (*get_minimum_value)(AtkValue *, GValue *)
     * }
     */
    public static void get_minimum_value(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(get_minimum_value$LAYOUT, get_minimum_value$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * gboolean (*set_current_value)(AtkValue *, const GValue *)
     * }
     */
    public class set_current_value {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            int apply(MemorySegment _x0, MemorySegment _x1);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
            app_indicator_h.C_INT,
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(set_current_value.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(set_current_value.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static int invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1) {
            try {
                return (int) DOWN$MH.invokeExact(funcPtr, _x0, _x1);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout set_current_value$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("set_current_value"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * gboolean (*set_current_value)(AtkValue *, const GValue *)
     * }
     */
    public static final AddressLayout set_current_value$layout() {
        return set_current_value$LAYOUT;
    }

    private static final long set_current_value$OFFSET = 40;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * gboolean (*set_current_value)(AtkValue *, const GValue *)
     * }
     */
    public static final long set_current_value$offset() {
        return set_current_value$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * gboolean (*set_current_value)(AtkValue *, const GValue *)
     * }
     */
    public static MemorySegment set_current_value(MemorySegment struct) {
        return struct.get(set_current_value$LAYOUT, set_current_value$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * gboolean (*set_current_value)(AtkValue *, const GValue *)
     * }
     */
    public static void set_current_value(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(set_current_value$LAYOUT, set_current_value$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * void (*get_minimum_increment)(AtkValue *, GValue *)
     * }
     */
    public class get_minimum_increment {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            void apply(MemorySegment _x0, MemorySegment _x1);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid(
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(get_minimum_increment.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(get_minimum_increment.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static void invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1) {
            try {
                 DOWN$MH.invokeExact(funcPtr, _x0, _x1);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout get_minimum_increment$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("get_minimum_increment"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*get_minimum_increment)(AtkValue *, GValue *)
     * }
     */
    public static final AddressLayout get_minimum_increment$layout() {
        return get_minimum_increment$LAYOUT;
    }

    private static final long get_minimum_increment$OFFSET = 48;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*get_minimum_increment)(AtkValue *, GValue *)
     * }
     */
    public static final long get_minimum_increment$offset() {
        return get_minimum_increment$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * void (*get_minimum_increment)(AtkValue *, GValue *)
     * }
     */
    public static MemorySegment get_minimum_increment(MemorySegment struct) {
        return struct.get(get_minimum_increment$LAYOUT, get_minimum_increment$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * void (*get_minimum_increment)(AtkValue *, GValue *)
     * }
     */
    public static void get_minimum_increment(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(get_minimum_increment$LAYOUT, get_minimum_increment$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * void (*get_value_and_text)(AtkValue *, gdouble *, gchar **)
     * }
     */
    public class get_value_and_text {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            void apply(MemorySegment _x0, MemorySegment _x1, MemorySegment _x2);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid(
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(get_value_and_text.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(get_value_and_text.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static void invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1, MemorySegment _x2) {
            try {
                 DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout get_value_and_text$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("get_value_and_text"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*get_value_and_text)(AtkValue *, gdouble *, gchar **)
     * }
     */
    public static final AddressLayout get_value_and_text$layout() {
        return get_value_and_text$LAYOUT;
    }

    private static final long get_value_and_text$OFFSET = 56;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*get_value_and_text)(AtkValue *, gdouble *, gchar **)
     * }
     */
    public static final long get_value_and_text$offset() {
        return get_value_and_text$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * void (*get_value_and_text)(AtkValue *, gdouble *, gchar **)
     * }
     */
    public static MemorySegment get_value_and_text(MemorySegment struct) {
        return struct.get(get_value_and_text$LAYOUT, get_value_and_text$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * void (*get_value_and_text)(AtkValue *, gdouble *, gchar **)
     * }
     */
    public static void get_value_and_text(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(get_value_and_text$LAYOUT, get_value_and_text$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * AtkRange *(*get_range)(AtkValue *)
     * }
     */
    public class get_range {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            MemorySegment apply(MemorySegment _x0);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(get_range.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(get_range.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static MemorySegment invoke(MemorySegment funcPtr,MemorySegment _x0) {
            try {
                return (MemorySegment) DOWN$MH.invokeExact(funcPtr, _x0);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout get_range$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("get_range"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * AtkRange *(*get_range)(AtkValue *)
     * }
     */
    public static final AddressLayout get_range$layout() {
        return get_range$LAYOUT;
    }

    private static final long get_range$OFFSET = 64;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * AtkRange *(*get_range)(AtkValue *)
     * }
     */
    public static final long get_range$offset() {
        return get_range$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * AtkRange *(*get_range)(AtkValue *)
     * }
     */
    public static MemorySegment get_range(MemorySegment struct) {
        return struct.get(get_range$LAYOUT, get_range$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * AtkRange *(*get_range)(AtkValue *)
     * }
     */
    public static void get_range(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(get_range$LAYOUT, get_range$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * gdouble (*get_increment)(AtkValue *)
     * }
     */
    public class get_increment {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            double apply(MemorySegment _x0);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
            app_indicator_h.C_DOUBLE,
            app_indicator_h.C_POINTER
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(get_increment.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(get_increment.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static double invoke(MemorySegment funcPtr,MemorySegment _x0) {
            try {
                return (double) DOWN$MH.invokeExact(funcPtr, _x0);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout get_increment$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("get_increment"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * gdouble (*get_increment)(AtkValue *)
     * }
     */
    public static final AddressLayout get_increment$layout() {
        return get_increment$LAYOUT;
    }

    private static final long get_increment$OFFSET = 72;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * gdouble (*get_increment)(AtkValue *)
     * }
     */
    public static final long get_increment$offset() {
        return get_increment$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * gdouble (*get_increment)(AtkValue *)
     * }
     */
    public static MemorySegment get_increment(MemorySegment struct) {
        return struct.get(get_increment$LAYOUT, get_increment$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * gdouble (*get_increment)(AtkValue *)
     * }
     */
    public static void get_increment(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(get_increment$LAYOUT, get_increment$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * GSList *(*get_sub_ranges)(AtkValue *)
     * }
     */
    public class get_sub_ranges {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            MemorySegment apply(MemorySegment _x0);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(get_sub_ranges.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(get_sub_ranges.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static MemorySegment invoke(MemorySegment funcPtr,MemorySegment _x0) {
            try {
                return (MemorySegment) DOWN$MH.invokeExact(funcPtr, _x0);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout get_sub_ranges$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("get_sub_ranges"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * GSList *(*get_sub_ranges)(AtkValue *)
     * }
     */
    public static final AddressLayout get_sub_ranges$layout() {
        return get_sub_ranges$LAYOUT;
    }

    private static final long get_sub_ranges$OFFSET = 80;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * GSList *(*get_sub_ranges)(AtkValue *)
     * }
     */
    public static final long get_sub_ranges$offset() {
        return get_sub_ranges$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * GSList *(*get_sub_ranges)(AtkValue *)
     * }
     */
    public static MemorySegment get_sub_ranges(MemorySegment struct) {
        return struct.get(get_sub_ranges$LAYOUT, get_sub_ranges$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * GSList *(*get_sub_ranges)(AtkValue *)
     * }
     */
    public static void get_sub_ranges(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(get_sub_ranges$LAYOUT, get_sub_ranges$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * void (*set_value)(AtkValue *, const gdouble)
     * }
     */
    public class set_value {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            void apply(MemorySegment _x0, double _x1);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid(
            app_indicator_h.C_POINTER,
            app_indicator_h.C_DOUBLE
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(set_value.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(set_value.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static void invoke(MemorySegment funcPtr,MemorySegment _x0, double _x1) {
            try {
                 DOWN$MH.invokeExact(funcPtr, _x0, _x1);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout set_value$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("set_value"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*set_value)(AtkValue *, const gdouble)
     * }
     */
    public static final AddressLayout set_value$layout() {
        return set_value$LAYOUT;
    }

    private static final long set_value$OFFSET = 88;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*set_value)(AtkValue *, const gdouble)
     * }
     */
    public static final long set_value$offset() {
        return set_value$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * void (*set_value)(AtkValue *, const gdouble)
     * }
     */
    public static MemorySegment set_value(MemorySegment struct) {
        return struct.get(set_value$LAYOUT, set_value$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * void (*set_value)(AtkValue *, const gdouble)
     * }
     */
    public static void set_value(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(set_value$LAYOUT, set_value$OFFSET, fieldValue);
    }

    /**
     * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
     * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
     */
    public static MemorySegment asSlice(MemorySegment array, long index) {
        return array.asSlice(layout().byteSize() * index);
    }

    /**
     * The size (in bytes) of this struct
     */
    public static long sizeof() { return layout().byteSize(); }

    /**
     * Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
     */
    public static MemorySegment allocate(SegmentAllocator allocator) {
        return allocator.allocate(layout());
    }

    /**
     * Allocate an array of size {@code elementCount} using {@code allocator}.
     * The returned segment has size {@code elementCount * layout().byteSize()}.
     */
    public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
        return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
    }

    /**
     * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction) (if any).
     * The returned segment has size {@code layout().byteSize()}
     */
    public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
        return reinterpret(addr, 1, arena, cleanup);
    }

    /**
     * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction) (if any).
     * The returned segment has size {@code elementCount * layout().byteSize()}
     */
    public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
        return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy