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

org.purejava.appindicator._GtkTableChild 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 _GtkTableChild {
 *     GtkWidget *widget;
 *     guint16 left_attach;
 *     guint16 right_attach;
 *     guint16 top_attach;
 *     guint16 bottom_attach;
 *     guint16 xpadding;
 *     guint16 ypadding;
 *     guint xexpand : 1;
 *     guint yexpand : 1;
 *     guint xshrink : 1;
 *     guint yshrink : 1;
 *     guint xfill : 1;
 *     guint yfill : 1;
 * }
 * }
 */
public class _GtkTableChild {

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

    private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
        app_indicator_h.C_POINTER.withName("widget"),
        app_indicator_h.C_SHORT.withName("left_attach"),
        app_indicator_h.C_SHORT.withName("right_attach"),
        app_indicator_h.C_SHORT.withName("top_attach"),
        app_indicator_h.C_SHORT.withName("bottom_attach"),
        app_indicator_h.C_SHORT.withName("xpadding"),
        app_indicator_h.C_SHORT.withName("ypadding"),
        MemoryLayout.paddingLayout(4)
    ).withName("_GtkTableChild");

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

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

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

    private static final long widget$OFFSET = 0;

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

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

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

    private static final OfShort left_attach$LAYOUT = (OfShort)$LAYOUT.select(groupElement("left_attach"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * guint16 left_attach
     * }
     */
    public static final OfShort left_attach$layout() {
        return left_attach$LAYOUT;
    }

    private static final long left_attach$OFFSET = 8;

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

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

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

    private static final OfShort right_attach$LAYOUT = (OfShort)$LAYOUT.select(groupElement("right_attach"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * guint16 right_attach
     * }
     */
    public static final OfShort right_attach$layout() {
        return right_attach$LAYOUT;
    }

    private static final long right_attach$OFFSET = 10;

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

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

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

    private static final OfShort top_attach$LAYOUT = (OfShort)$LAYOUT.select(groupElement("top_attach"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * guint16 top_attach
     * }
     */
    public static final OfShort top_attach$layout() {
        return top_attach$LAYOUT;
    }

    private static final long top_attach$OFFSET = 12;

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

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

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

    private static final OfShort bottom_attach$LAYOUT = (OfShort)$LAYOUT.select(groupElement("bottom_attach"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * guint16 bottom_attach
     * }
     */
    public static final OfShort bottom_attach$layout() {
        return bottom_attach$LAYOUT;
    }

    private static final long bottom_attach$OFFSET = 14;

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

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

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

    private static final OfShort xpadding$LAYOUT = (OfShort)$LAYOUT.select(groupElement("xpadding"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * guint16 xpadding
     * }
     */
    public static final OfShort xpadding$layout() {
        return xpadding$LAYOUT;
    }

    private static final long xpadding$OFFSET = 16;

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

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

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

    private static final OfShort ypadding$LAYOUT = (OfShort)$LAYOUT.select(groupElement("ypadding"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * guint16 ypadding
     * }
     */
    public static final OfShort ypadding$layout() {
        return ypadding$LAYOUT;
    }

    private static final long ypadding$OFFSET = 18;

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

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

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