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

org.purejava.appindicator._GtkRecentChooserIface 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 _GtkRecentChooserIface {
 *     GTypeInterface base_iface;
 *     gboolean (*set_current_uri)(GtkRecentChooser *, const gchar *, GError **);
 *     gchar *(*get_current_uri)(GtkRecentChooser *);
 *     gboolean (*select_uri)(GtkRecentChooser *, const gchar *, GError **);
 *     void (*unselect_uri)(GtkRecentChooser *, const gchar *);
 *     void (*select_all)(GtkRecentChooser *);
 *     void (*unselect_all)(GtkRecentChooser *);
 *     GList *(*get_items)(GtkRecentChooser *);
 *     GtkRecentManager *(*get_recent_manager)(GtkRecentChooser *);
 *     void (*add_filter)(GtkRecentChooser *, GtkRecentFilter *);
 *     void (*remove_filter)(GtkRecentChooser *, GtkRecentFilter *);
 *     GSList *(*list_filters)(GtkRecentChooser *);
 *     void (*set_sort_func)(GtkRecentChooser *, GtkRecentSortFunc, gpointer, GDestroyNotify);
 *     void (*item_activated)(GtkRecentChooser *);
 *     void (*selection_changed)(GtkRecentChooser *);
 * }
 * }
 */
public class _GtkRecentChooserIface {

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

    private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
        _GTypeInterface.layout().withName("base_iface"),
        app_indicator_h.C_POINTER.withName("set_current_uri"),
        app_indicator_h.C_POINTER.withName("get_current_uri"),
        app_indicator_h.C_POINTER.withName("select_uri"),
        app_indicator_h.C_POINTER.withName("unselect_uri"),
        app_indicator_h.C_POINTER.withName("select_all"),
        app_indicator_h.C_POINTER.withName("unselect_all"),
        app_indicator_h.C_POINTER.withName("get_items"),
        app_indicator_h.C_POINTER.withName("get_recent_manager"),
        app_indicator_h.C_POINTER.withName("add_filter"),
        app_indicator_h.C_POINTER.withName("remove_filter"),
        app_indicator_h.C_POINTER.withName("list_filters"),
        app_indicator_h.C_POINTER.withName("set_sort_func"),
        app_indicator_h.C_POINTER.withName("item_activated"),
        app_indicator_h.C_POINTER.withName("selection_changed")
    ).withName("_GtkRecentChooserIface");

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

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

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

    private static final long base_iface$OFFSET = 0;

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

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

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

    /**
     * {@snippet lang=c :
     * gboolean (*set_current_uri)(GtkRecentChooser *, const gchar *, GError **)
     * }
     */
    public class set_current_uri {

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

        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
        );

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

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

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

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

    private static final long set_current_uri$OFFSET = 16;

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

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

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

    /**
     * {@snippet lang=c :
     * gchar *(*get_current_uri)(GtkRecentChooser *)
     * }
     */
    public class get_current_uri {

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

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

    private static final long get_current_uri$OFFSET = 24;

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

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

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

    /**
     * {@snippet lang=c :
     * gboolean (*select_uri)(GtkRecentChooser *, const gchar *, GError **)
     * }
     */
    public class select_uri {

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

        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
        );

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

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

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

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

    private static final long select_uri$OFFSET = 32;

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

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

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

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

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

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

    private static final long unselect_uri$OFFSET = 40;

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

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

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

    /**
     * {@snippet lang=c :
     * void (*select_all)(GtkRecentChooser *)
     * }
     */
    public class select_all {

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

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

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

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

    private static final long select_all$OFFSET = 48;

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

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

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

    /**
     * {@snippet lang=c :
     * void (*unselect_all)(GtkRecentChooser *)
     * }
     */
    public class unselect_all {

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

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

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

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

    private static final long unselect_all$OFFSET = 56;

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

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

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

    /**
     * {@snippet lang=c :
     * GList *(*get_items)(GtkRecentChooser *)
     * }
     */
    public class get_items {

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

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

    private static final long get_items$OFFSET = 64;

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

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

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

    /**
     * {@snippet lang=c :
     * GtkRecentManager *(*get_recent_manager)(GtkRecentChooser *)
     * }
     */
    public class get_recent_manager {

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

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

    private static final long get_recent_manager$OFFSET = 72;

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

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

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

    /**
     * {@snippet lang=c :
     * void (*add_filter)(GtkRecentChooser *, GtkRecentFilter *)
     * }
     */
    public class add_filter {

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

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

    private static final long add_filter$OFFSET = 80;

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

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

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

    /**
     * {@snippet lang=c :
     * void (*remove_filter)(GtkRecentChooser *, GtkRecentFilter *)
     * }
     */
    public class remove_filter {

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

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

    private static final long remove_filter$OFFSET = 88;

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

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

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

    /**
     * {@snippet lang=c :
     * GSList *(*list_filters)(GtkRecentChooser *)
     * }
     */
    public class list_filters {

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

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

    private static final long list_filters$OFFSET = 96;

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

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

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

    /**
     * {@snippet lang=c :
     * void (*set_sort_func)(GtkRecentChooser *, GtkRecentSortFunc, gpointer, GDestroyNotify)
     * }
     */
    public class set_sort_func {

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

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

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

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*set_sort_func)(GtkRecentChooser *, GtkRecentSortFunc, gpointer, GDestroyNotify)
     * }
     */
    public static final AddressLayout set_sort_func$layout() {
        return set_sort_func$LAYOUT;
    }

    private static final long set_sort_func$OFFSET = 104;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*set_sort_func)(GtkRecentChooser *, GtkRecentSortFunc, gpointer, GDestroyNotify)
     * }
     */
    public static final long set_sort_func$offset() {
        return set_sort_func$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * void (*set_sort_func)(GtkRecentChooser *, GtkRecentSortFunc, gpointer, GDestroyNotify)
     * }
     */
    public static MemorySegment set_sort_func(MemorySegment struct) {
        return struct.get(set_sort_func$LAYOUT, set_sort_func$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * void (*set_sort_func)(GtkRecentChooser *, GtkRecentSortFunc, gpointer, GDestroyNotify)
     * }
     */
    public static void set_sort_func(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(set_sort_func$LAYOUT, set_sort_func$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * void (*item_activated)(GtkRecentChooser *)
     * }
     */
    public class item_activated {

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

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

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

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

    private static final long item_activated$OFFSET = 112;

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

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

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

    /**
     * {@snippet lang=c :
     * void (*selection_changed)(GtkRecentChooser *)
     * }
     */
    public class selection_changed {

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

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

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

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

    private static final long selection_changed$OFFSET = 120;

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

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

    /**
     * Setter for field:
     * {@snippet lang=c :
     * void (*selection_changed)(GtkRecentChooser *)
     * }
     */
    public static void selection_changed(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(selection_changed$LAYOUT, selection_changed$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