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

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

There is a newer version: 1.4.1
Show newest version
// 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 _GActionGroupInterface {
 *     GTypeInterface g_iface;
 *     gboolean (*has_action)(GActionGroup *, const gchar *);
 *     gchar **(*list_actions)(GActionGroup *);
 *     gboolean (*get_action_enabled)(GActionGroup *, const gchar *);
 *     const GVariantType *(*get_action_parameter_type)(GActionGroup *, const gchar *);
 *     const GVariantType *(*get_action_state_type)(GActionGroup *, const gchar *);
 *     GVariant *(*get_action_state_hint)(GActionGroup *, const gchar *);
 *     GVariant *(*get_action_state)(GActionGroup *, const gchar *);
 *     void (*change_action_state)(GActionGroup *, const gchar *, GVariant *);
 *     void (*activate_action)(GActionGroup *, const gchar *, GVariant *);
 *     void (*action_added)(GActionGroup *, const gchar *);
 *     void (*action_removed)(GActionGroup *, const gchar *);
 *     void (*action_enabled_changed)(GActionGroup *, const gchar *, gboolean);
 *     void (*action_state_changed)(GActionGroup *, const gchar *, GVariant *);
 *     gboolean (*query_action)(GActionGroup *, const gchar *, gboolean *, const GVariantType **, const GVariantType **, GVariant **, GVariant **);
 * }
 * }
 */
public class _GActionGroupInterface {

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

    private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
        _GTypeInterface.layout().withName("g_iface"),
        app_indicator_h.C_POINTER.withName("has_action"),
        app_indicator_h.C_POINTER.withName("list_actions"),
        app_indicator_h.C_POINTER.withName("get_action_enabled"),
        app_indicator_h.C_POINTER.withName("get_action_parameter_type"),
        app_indicator_h.C_POINTER.withName("get_action_state_type"),
        app_indicator_h.C_POINTER.withName("get_action_state_hint"),
        app_indicator_h.C_POINTER.withName("get_action_state"),
        app_indicator_h.C_POINTER.withName("change_action_state"),
        app_indicator_h.C_POINTER.withName("activate_action"),
        app_indicator_h.C_POINTER.withName("action_added"),
        app_indicator_h.C_POINTER.withName("action_removed"),
        app_indicator_h.C_POINTER.withName("action_enabled_changed"),
        app_indicator_h.C_POINTER.withName("action_state_changed"),
        app_indicator_h.C_POINTER.withName("query_action")
    ).withName("_GActionGroupInterface");

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

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

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

    private static final long g_iface$OFFSET = 0;

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

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

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

    /**
     * {@snippet lang=c :
     * gboolean (*has_action)(GActionGroup *, const gchar *)
     * }
     */
    public class has_action {

        /**
         * 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(has_action.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(has_action.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 has_action$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("has_action"));

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

    private static final long has_action$OFFSET = 16;

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

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

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

    /**
     * {@snippet lang=c :
     * gchar **(*list_actions)(GActionGroup *)
     * }
     */
    public class list_actions {

        /**
         * 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(list_actions.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(list_actions.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 list_actions$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("list_actions"));

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

    private static final long list_actions$OFFSET = 24;

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

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

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

    /**
     * {@snippet lang=c :
     * gboolean (*get_action_enabled)(GActionGroup *, const gchar *)
     * }
     */
    public class get_action_enabled {

        /**
         * 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(get_action_enabled.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_action_enabled.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 get_action_enabled$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("get_action_enabled"));

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

    private static final long get_action_enabled$OFFSET = 32;

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

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

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

    /**
     * {@snippet lang=c :
     * const GVariantType *(*get_action_parameter_type)(GActionGroup *, const gchar *)
     * }
     */
    public class get_action_parameter_type {

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

        private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
            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_action_parameter_type.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_action_parameter_type.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, MemorySegment _x1) {
            try {
                return (MemorySegment) DOWN$MH.invokeExact(funcPtr, _x0, _x1);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

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

    /**
     * Layout for field:
     * {@snippet lang=c :
     * const GVariantType *(*get_action_parameter_type)(GActionGroup *, const gchar *)
     * }
     */
    public static final AddressLayout get_action_parameter_type$layout() {
        return get_action_parameter_type$LAYOUT;
    }

    private static final long get_action_parameter_type$OFFSET = 40;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * const GVariantType *(*get_action_parameter_type)(GActionGroup *, const gchar *)
     * }
     */
    public static final long get_action_parameter_type$offset() {
        return get_action_parameter_type$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * const GVariantType *(*get_action_parameter_type)(GActionGroup *, const gchar *)
     * }
     */
    public static MemorySegment get_action_parameter_type(MemorySegment struct) {
        return struct.get(get_action_parameter_type$LAYOUT, get_action_parameter_type$OFFSET);
    }

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

    /**
     * {@snippet lang=c :
     * const GVariantType *(*get_action_state_type)(GActionGroup *, const gchar *)
     * }
     */
    public class get_action_state_type {

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

        private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
            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_action_state_type.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_action_state_type.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, MemorySegment _x1) {
            try {
                return (MemorySegment) DOWN$MH.invokeExact(funcPtr, _x0, _x1);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

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

    /**
     * Layout for field:
     * {@snippet lang=c :
     * const GVariantType *(*get_action_state_type)(GActionGroup *, const gchar *)
     * }
     */
    public static final AddressLayout get_action_state_type$layout() {
        return get_action_state_type$LAYOUT;
    }

    private static final long get_action_state_type$OFFSET = 48;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * const GVariantType *(*get_action_state_type)(GActionGroup *, const gchar *)
     * }
     */
    public static final long get_action_state_type$offset() {
        return get_action_state_type$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * const GVariantType *(*get_action_state_type)(GActionGroup *, const gchar *)
     * }
     */
    public static MemorySegment get_action_state_type(MemorySegment struct) {
        return struct.get(get_action_state_type$LAYOUT, get_action_state_type$OFFSET);
    }

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

    /**
     * {@snippet lang=c :
     * GVariant *(*get_action_state_hint)(GActionGroup *, const gchar *)
     * }
     */
    public class get_action_state_hint {

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

        private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
            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_action_state_hint.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_action_state_hint.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, MemorySegment _x1) {
            try {
                return (MemorySegment) DOWN$MH.invokeExact(funcPtr, _x0, _x1);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

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

    /**
     * Layout for field:
     * {@snippet lang=c :
     * GVariant *(*get_action_state_hint)(GActionGroup *, const gchar *)
     * }
     */
    public static final AddressLayout get_action_state_hint$layout() {
        return get_action_state_hint$LAYOUT;
    }

    private static final long get_action_state_hint$OFFSET = 56;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * GVariant *(*get_action_state_hint)(GActionGroup *, const gchar *)
     * }
     */
    public static final long get_action_state_hint$offset() {
        return get_action_state_hint$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * GVariant *(*get_action_state_hint)(GActionGroup *, const gchar *)
     * }
     */
    public static MemorySegment get_action_state_hint(MemorySegment struct) {
        return struct.get(get_action_state_hint$LAYOUT, get_action_state_hint$OFFSET);
    }

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

    /**
     * {@snippet lang=c :
     * GVariant *(*get_action_state)(GActionGroup *, const gchar *)
     * }
     */
    public class get_action_state {

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

        private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
            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_action_state.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_action_state.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, MemorySegment _x1) {
            try {
                return (MemorySegment) DOWN$MH.invokeExact(funcPtr, _x0, _x1);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

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

    /**
     * Layout for field:
     * {@snippet lang=c :
     * GVariant *(*get_action_state)(GActionGroup *, const gchar *)
     * }
     */
    public static final AddressLayout get_action_state$layout() {
        return get_action_state$LAYOUT;
    }

    private static final long get_action_state$OFFSET = 64;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * GVariant *(*get_action_state)(GActionGroup *, const gchar *)
     * }
     */
    public static final long get_action_state$offset() {
        return get_action_state$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * GVariant *(*get_action_state)(GActionGroup *, const gchar *)
     * }
     */
    public static MemorySegment get_action_state(MemorySegment struct) {
        return struct.get(get_action_state$LAYOUT, get_action_state$OFFSET);
    }

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

    /**
     * {@snippet lang=c :
     * void (*change_action_state)(GActionGroup *, const gchar *, GVariant *)
     * }
     */
    public class change_action_state {

        /**
         * 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(change_action_state.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(change_action_state.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 change_action_state$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("change_action_state"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*change_action_state)(GActionGroup *, const gchar *, GVariant *)
     * }
     */
    public static final AddressLayout change_action_state$layout() {
        return change_action_state$LAYOUT;
    }

    private static final long change_action_state$OFFSET = 72;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*change_action_state)(GActionGroup *, const gchar *, GVariant *)
     * }
     */
    public static final long change_action_state$offset() {
        return change_action_state$OFFSET;
    }

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

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

    /**
     * {@snippet lang=c :
     * void (*activate_action)(GActionGroup *, const gchar *, GVariant *)
     * }
     */
    public class activate_action {

        /**
         * 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(activate_action.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(activate_action.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 activate_action$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("activate_action"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*activate_action)(GActionGroup *, const gchar *, GVariant *)
     * }
     */
    public static final AddressLayout activate_action$layout() {
        return activate_action$LAYOUT;
    }

    private static final long activate_action$OFFSET = 80;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*activate_action)(GActionGroup *, const gchar *, GVariant *)
     * }
     */
    public static final long activate_action$offset() {
        return activate_action$OFFSET;
    }

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

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

    /**
     * {@snippet lang=c :
     * void (*action_added)(GActionGroup *, const gchar *)
     * }
     */
    public class action_added {

        /**
         * 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(action_added.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(action_added.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 action_added$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("action_added"));

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

    private static final long action_added$OFFSET = 88;

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

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

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

    /**
     * {@snippet lang=c :
     * void (*action_removed)(GActionGroup *, const gchar *)
     * }
     */
    public class action_removed {

        /**
         * 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(action_removed.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(action_removed.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 action_removed$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("action_removed"));

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

    private static final long action_removed$OFFSET = 96;

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

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

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

    /**
     * {@snippet lang=c :
     * void (*action_enabled_changed)(GActionGroup *, const gchar *, gboolean)
     * }
     */
    public class action_enabled_changed {

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

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

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

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(action_enabled_changed.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(action_enabled_changed.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, int _x2) {
            try {
                 DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

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

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*action_enabled_changed)(GActionGroup *, const gchar *, gboolean)
     * }
     */
    public static final AddressLayout action_enabled_changed$layout() {
        return action_enabled_changed$LAYOUT;
    }

    private static final long action_enabled_changed$OFFSET = 104;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*action_enabled_changed)(GActionGroup *, const gchar *, gboolean)
     * }
     */
    public static final long action_enabled_changed$offset() {
        return action_enabled_changed$OFFSET;
    }

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

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

    /**
     * {@snippet lang=c :
     * void (*action_state_changed)(GActionGroup *, const gchar *, GVariant *)
     * }
     */
    public class action_state_changed {

        /**
         * 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(action_state_changed.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(action_state_changed.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 action_state_changed$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("action_state_changed"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*action_state_changed)(GActionGroup *, const gchar *, GVariant *)
     * }
     */
    public static final AddressLayout action_state_changed$layout() {
        return action_state_changed$LAYOUT;
    }

    private static final long action_state_changed$OFFSET = 112;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*action_state_changed)(GActionGroup *, const gchar *, GVariant *)
     * }
     */
    public static final long action_state_changed$offset() {
        return action_state_changed$OFFSET;
    }

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

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

    /**
     * {@snippet lang=c :
     * gboolean (*query_action)(GActionGroup *, const gchar *, gboolean *, const GVariantType **, const GVariantType **, GVariant **, GVariant **)
     * }
     */
    public class query_action {

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

        private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
            app_indicator_h.C_INT,
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER,
            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(query_action.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(query_action.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, MemorySegment _x2, MemorySegment _x3, MemorySegment _x4, MemorySegment _x5, MemorySegment _x6) {
            try {
                return (int) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2, _x3, _x4, _x5, _x6);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

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

    /**
     * Layout for field:
     * {@snippet lang=c :
     * gboolean (*query_action)(GActionGroup *, const gchar *, gboolean *, const GVariantType **, const GVariantType **, GVariant **, GVariant **)
     * }
     */
    public static final AddressLayout query_action$layout() {
        return query_action$LAYOUT;
    }

    private static final long query_action$OFFSET = 120;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * gboolean (*query_action)(GActionGroup *, const gchar *, gboolean *, const GVariantType **, const GVariantType **, GVariant **, GVariant **)
     * }
     */
    public static final long query_action$offset() {
        return query_action$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * gboolean (*query_action)(GActionGroup *, const gchar *, gboolean *, const GVariantType **, const GVariantType **, GVariant **, GVariant **)
     * }
     */
    public static MemorySegment query_action(MemorySegment struct) {
        return struct.get(query_action$LAYOUT, query_action$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * gboolean (*query_action)(GActionGroup *, const gchar *, gboolean *, const GVariantType **, const GVariantType **, GVariant **, GVariant **)
     * }
     */
    public static void query_action(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(query_action$LAYOUT, query_action$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 - 2024 Weber Informatics LLC | Privacy Policy