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

org.purejava.appindicator.GTestConfig 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 {
 *     gboolean test_initialized;
 *     gboolean test_quick;
 *     gboolean test_perf;
 *     gboolean test_verbose;
 *     gboolean test_quiet;
 *     gboolean test_undefined;
 * }
 * }
 */
public class GTestConfig {

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

    private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
        app_indicator_h.C_INT.withName("test_initialized"),
        app_indicator_h.C_INT.withName("test_quick"),
        app_indicator_h.C_INT.withName("test_perf"),
        app_indicator_h.C_INT.withName("test_verbose"),
        app_indicator_h.C_INT.withName("test_quiet"),
        app_indicator_h.C_INT.withName("test_undefined")
    ).withName("$anon$649:9");

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

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

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

    private static final long test_initialized$OFFSET = 0;

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

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

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

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

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

    private static final long test_quick$OFFSET = 4;

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

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

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

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

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

    private static final long test_perf$OFFSET = 8;

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

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

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

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

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

    private static final long test_verbose$OFFSET = 12;

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

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

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

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

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

    private static final long test_quiet$OFFSET = 16;

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

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

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

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

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

    private static final long test_undefined$OFFSET = 20;

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

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

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