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

org.purejava.appindicator._GSignalQuery 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 _GSignalQuery {
 *     guint signal_id;
 *     const gchar *signal_name;
 *     GType itype;
 *     GSignalFlags signal_flags;
 *     GType return_type;
 *     guint n_params;
 *     const GType *param_types;
 * }
 * }
 */
public class _GSignalQuery {

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

    private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
        app_indicator_h.C_INT.withName("signal_id"),
        MemoryLayout.paddingLayout(4),
        app_indicator_h.C_POINTER.withName("signal_name"),
        app_indicator_h.C_LONG.withName("itype"),
        app_indicator_h.C_INT.withName("signal_flags"),
        MemoryLayout.paddingLayout(4),
        app_indicator_h.C_LONG.withName("return_type"),
        app_indicator_h.C_INT.withName("n_params"),
        MemoryLayout.paddingLayout(4),
        app_indicator_h.C_POINTER.withName("param_types")
    ).withName("_GSignalQuery");

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

    private static final OfInt signal_id$LAYOUT = (OfInt)$LAYOUT.select(groupElement("signal_id"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * guint signal_id
     * }
     */
    public static final OfInt signal_id$layout() {
        return signal_id$LAYOUT;
    }

    private static final long signal_id$OFFSET = 0;

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

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

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

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

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

    private static final long signal_name$OFFSET = 8;

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

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

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

    private static final OfLong itype$LAYOUT = (OfLong)$LAYOUT.select(groupElement("itype"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * GType itype
     * }
     */
    public static final OfLong itype$layout() {
        return itype$LAYOUT;
    }

    private static final long itype$OFFSET = 16;

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

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

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

    private static final OfInt signal_flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("signal_flags"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * GSignalFlags signal_flags
     * }
     */
    public static final OfInt signal_flags$layout() {
        return signal_flags$LAYOUT;
    }

    private static final long signal_flags$OFFSET = 24;

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

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

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

    private static final OfLong return_type$LAYOUT = (OfLong)$LAYOUT.select(groupElement("return_type"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * GType return_type
     * }
     */
    public static final OfLong return_type$layout() {
        return return_type$LAYOUT;
    }

    private static final long return_type$OFFSET = 32;

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

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

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

    private static final OfInt n_params$LAYOUT = (OfInt)$LAYOUT.select(groupElement("n_params"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * guint n_params
     * }
     */
    public static final OfInt n_params$layout() {
        return n_params$LAYOUT;
    }

    private static final long n_params$OFFSET = 40;

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

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

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

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

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

    private static final long param_types$OFFSET = 48;

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

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

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