add lwjgl-freetype

This commit is contained in:
ShirosakiMio 2024-04-03 08:46:36 +08:00
parent 2ebe13d52b
commit fa92cc28d8
150 changed files with 32977 additions and 1 deletions

View File

@ -1 +1 @@
1709635789759 1712051464002

View File

@ -0,0 +1,292 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* This structure models a given BDF/PCF property.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct BDF_PropertyRec {
* BDF_PropertyType type;
* union {
* char const * atom;
* FT_Int32 integer;
* FT_UInt32 cardinal;
* } u;
* }</code></pre>
*/
@NativeType("struct BDF_PropertyRec")
public class BDF_Property extends Struct<BDF_Property> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
TYPE,
U,
U_ATOM,
U_INTEGER,
U_CARDINAL;
static {
Layout layout = __struct(
__member(4),
__union(
__member(POINTER_SIZE),
__member(4),
__member(4)
)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
TYPE = layout.offsetof(0);
U = layout.offsetof(1);
U_ATOM = layout.offsetof(2);
U_INTEGER = layout.offsetof(3);
U_CARDINAL = layout.offsetof(4);
}
protected BDF_Property(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected BDF_Property create(long address, @Nullable ByteBuffer container) {
return new BDF_Property(address, container);
}
/**
* Creates a {@code BDF_Property} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public BDF_Property(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code type} field. */
@NativeType("BDF_PropertyType")
public int type() { return ntype(address()); }
/** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code u.atom} field. */
@Nullable
@NativeType("char const *")
public ByteBuffer u_atom() { return nu_atom(address()); }
/** @return the null-terminated string pointed to by the {@code u.atom} field. */
@Nullable
@NativeType("char const *")
public String u_atomString() { return nu_atomString(address()); }
/** @return the value of the {@code u.integer} field. */
@NativeType("FT_Int32")
public int u_integer() { return nu_integer(address()); }
/** @return the value of the {@code u.cardinal} field. */
@NativeType("FT_UInt32")
public int u_cardinal() { return nu_cardinal(address()); }
// -----------------------------------
/** Returns a new {@code BDF_Property} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static BDF_Property malloc() {
return new BDF_Property(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code BDF_Property} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static BDF_Property calloc() {
return new BDF_Property(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code BDF_Property} instance allocated with {@link BufferUtils}. */
public static BDF_Property create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new BDF_Property(memAddress(container), container);
}
/** Returns a new {@code BDF_Property} instance for the specified memory address. */
public static BDF_Property create(long address) {
return new BDF_Property(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static BDF_Property createSafe(long address) {
return address == NULL ? null : new BDF_Property(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code BDF_Property} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static BDF_Property malloc(MemoryStack stack) {
return new BDF_Property(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code BDF_Property} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static BDF_Property calloc(MemoryStack stack) {
return new BDF_Property(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #type}. */
public static int ntype(long struct) { return UNSAFE.getInt(null, struct + BDF_Property.TYPE); }
/** Unsafe version of {@link #u_atom}. */
@Nullable public static ByteBuffer nu_atom(long struct) { return memByteBufferNT1Safe(memGetAddress(struct + BDF_Property.U_ATOM)); }
/** Unsafe version of {@link #u_atomString}. */
@Nullable public static String nu_atomString(long struct) { return memASCIISafe(memGetAddress(struct + BDF_Property.U_ATOM)); }
/** Unsafe version of {@link #u_integer}. */
public static int nu_integer(long struct) { return UNSAFE.getInt(null, struct + BDF_Property.U_INTEGER); }
/** Unsafe version of {@link #u_cardinal}. */
public static int nu_cardinal(long struct) { return UNSAFE.getInt(null, struct + BDF_Property.U_CARDINAL); }
// -----------------------------------
/** An array of {@link BDF_Property} structs. */
public static class Buffer extends StructBuffer<BDF_Property, Buffer> implements NativeResource {
private static final BDF_Property ELEMENT_FACTORY = BDF_Property.create(-1L);
/**
* Creates a new {@code BDF_Property.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link BDF_Property#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected BDF_Property getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code type} field. */
@NativeType("BDF_PropertyType")
public int type() { return BDF_Property.ntype(address()); }
/** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code u.atom} field. */
@Nullable
@NativeType("char const *")
public ByteBuffer u_atom() { return BDF_Property.nu_atom(address()); }
/** @return the null-terminated string pointed to by the {@code u.atom} field. */
@Nullable
@NativeType("char const *")
public String u_atomString() { return BDF_Property.nu_atomString(address()); }
/** @return the value of the {@code u.integer} field. */
@NativeType("FT_Int32")
public int u_integer() { return BDF_Property.nu_integer(address()); }
/** @return the value of the {@code u.cardinal} field. */
@NativeType("FT_UInt32")
public int u_cardinal() { return BDF_Property.nu_cardinal(address()); }
}
}

View File

@ -0,0 +1,282 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure used to represent data in a CID top-level dictionary.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct CID_FaceDictRec {
* {@link PS_Private PS_PrivateRec} private_dict;
* FT_UInt len_buildchar;
* FT_Fixed forcebold_threshold;
* FT_Pos stroke_width;
* FT_Fixed expansion_factor;
* FT_Byte paint_type;
* FT_Byte font_type;
* {@link FT_Matrix FT_Matrix} font_matrix;
* {@link FT_Vector FT_Vector} font_offset;
* FT_UInt num_subrs;
* FT_ULong subrmap_offset;
* FT_UInt sd_bytes;
* }</code></pre>
*/
@NativeType("struct CID_FaceDictRec")
public class CID_FaceDict extends Struct<CID_FaceDict> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
PRIVATE_DICT,
LEN_BUILDCHAR,
FORCEBOLD_THRESHOLD,
STROKE_WIDTH,
EXPANSION_FACTOR,
PAINT_TYPE,
FONT_TYPE,
FONT_MATRIX,
FONT_OFFSET,
NUM_SUBRS,
SUBRMAP_OFFSET,
SD_BYTES;
static {
Layout layout = __struct(
__member(PS_Private.SIZEOF, PS_Private.ALIGNOF),
__member(4),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(1),
__member(1),
__member(FT_Matrix.SIZEOF, FT_Matrix.ALIGNOF),
__member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF),
__member(4),
__member(CLONG_SIZE),
__member(4)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
PRIVATE_DICT = layout.offsetof(0);
LEN_BUILDCHAR = layout.offsetof(1);
FORCEBOLD_THRESHOLD = layout.offsetof(2);
STROKE_WIDTH = layout.offsetof(3);
EXPANSION_FACTOR = layout.offsetof(4);
PAINT_TYPE = layout.offsetof(5);
FONT_TYPE = layout.offsetof(6);
FONT_MATRIX = layout.offsetof(7);
FONT_OFFSET = layout.offsetof(8);
NUM_SUBRS = layout.offsetof(9);
SUBRMAP_OFFSET = layout.offsetof(10);
SD_BYTES = layout.offsetof(11);
}
protected CID_FaceDict(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected CID_FaceDict create(long address, @Nullable ByteBuffer container) {
return new CID_FaceDict(address, container);
}
/**
* Creates a {@code CID_FaceDict} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public CID_FaceDict(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link PS_Private} view of the {@code private_dict} field. */
@NativeType("PS_PrivateRec")
public PS_Private private_dict() { return nprivate_dict(address()); }
/** @return the value of the {@code len_buildchar} field. */
@NativeType("FT_UInt")
public int len_buildchar() { return nlen_buildchar(address()); }
/** @return the value of the {@code forcebold_threshold} field. */
@NativeType("FT_Fixed")
public long forcebold_threshold() { return nforcebold_threshold(address()); }
/** @return the value of the {@code stroke_width} field. */
@NativeType("FT_Pos")
public long stroke_width() { return nstroke_width(address()); }
/** @return the value of the {@code expansion_factor} field. */
@NativeType("FT_Fixed")
public long expansion_factor() { return nexpansion_factor(address()); }
/** @return the value of the {@code paint_type} field. */
@NativeType("FT_Byte")
public byte paint_type() { return npaint_type(address()); }
/** @return the value of the {@code font_type} field. */
@NativeType("FT_Byte")
public byte font_type() { return nfont_type(address()); }
/** @return a {@link FT_Matrix} view of the {@code font_matrix} field. */
public FT_Matrix font_matrix() { return nfont_matrix(address()); }
/** @return a {@link FT_Vector} view of the {@code font_offset} field. */
public FT_Vector font_offset() { return nfont_offset(address()); }
/** @return the value of the {@code num_subrs} field. */
@NativeType("FT_UInt")
public int num_subrs() { return nnum_subrs(address()); }
/** @return the value of the {@code subrmap_offset} field. */
@NativeType("FT_ULong")
public long subrmap_offset() { return nsubrmap_offset(address()); }
/** @return the value of the {@code sd_bytes} field. */
@NativeType("FT_UInt")
public int sd_bytes() { return nsd_bytes(address()); }
// -----------------------------------
/** Returns a new {@code CID_FaceDict} instance for the specified memory address. */
public static CID_FaceDict create(long address) {
return new CID_FaceDict(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static CID_FaceDict createSafe(long address) {
return address == NULL ? null : new CID_FaceDict(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #private_dict}. */
public static PS_Private nprivate_dict(long struct) { return PS_Private.create(struct + CID_FaceDict.PRIVATE_DICT); }
/** Unsafe version of {@link #len_buildchar}. */
public static int nlen_buildchar(long struct) { return UNSAFE.getInt(null, struct + CID_FaceDict.LEN_BUILDCHAR); }
/** Unsafe version of {@link #forcebold_threshold}. */
public static long nforcebold_threshold(long struct) { return memGetCLong(struct + CID_FaceDict.FORCEBOLD_THRESHOLD); }
/** Unsafe version of {@link #stroke_width}. */
public static long nstroke_width(long struct) { return memGetCLong(struct + CID_FaceDict.STROKE_WIDTH); }
/** Unsafe version of {@link #expansion_factor}. */
public static long nexpansion_factor(long struct) { return memGetCLong(struct + CID_FaceDict.EXPANSION_FACTOR); }
/** Unsafe version of {@link #paint_type}. */
public static byte npaint_type(long struct) { return UNSAFE.getByte(null, struct + CID_FaceDict.PAINT_TYPE); }
/** Unsafe version of {@link #font_type}. */
public static byte nfont_type(long struct) { return UNSAFE.getByte(null, struct + CID_FaceDict.FONT_TYPE); }
/** Unsafe version of {@link #font_matrix}. */
public static FT_Matrix nfont_matrix(long struct) { return FT_Matrix.create(struct + CID_FaceDict.FONT_MATRIX); }
/** Unsafe version of {@link #font_offset}. */
public static FT_Vector nfont_offset(long struct) { return FT_Vector.create(struct + CID_FaceDict.FONT_OFFSET); }
/** Unsafe version of {@link #num_subrs}. */
public static int nnum_subrs(long struct) { return UNSAFE.getInt(null, struct + CID_FaceDict.NUM_SUBRS); }
/** Unsafe version of {@link #subrmap_offset}. */
public static long nsubrmap_offset(long struct) { return memGetCLong(struct + CID_FaceDict.SUBRMAP_OFFSET); }
/** Unsafe version of {@link #sd_bytes}. */
public static int nsd_bytes(long struct) { return UNSAFE.getInt(null, struct + CID_FaceDict.SD_BYTES); }
// -----------------------------------
/** An array of {@link CID_FaceDict} structs. */
public static class Buffer extends StructBuffer<CID_FaceDict, Buffer> {
private static final CID_FaceDict ELEMENT_FACTORY = CID_FaceDict.create(-1L);
/**
* Creates a new {@code CID_FaceDict.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link CID_FaceDict#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected CID_FaceDict getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link PS_Private} view of the {@code private_dict} field. */
@NativeType("PS_PrivateRec")
public PS_Private private_dict() { return CID_FaceDict.nprivate_dict(address()); }
/** @return the value of the {@code len_buildchar} field. */
@NativeType("FT_UInt")
public int len_buildchar() { return CID_FaceDict.nlen_buildchar(address()); }
/** @return the value of the {@code forcebold_threshold} field. */
@NativeType("FT_Fixed")
public long forcebold_threshold() { return CID_FaceDict.nforcebold_threshold(address()); }
/** @return the value of the {@code stroke_width} field. */
@NativeType("FT_Pos")
public long stroke_width() { return CID_FaceDict.nstroke_width(address()); }
/** @return the value of the {@code expansion_factor} field. */
@NativeType("FT_Fixed")
public long expansion_factor() { return CID_FaceDict.nexpansion_factor(address()); }
/** @return the value of the {@code paint_type} field. */
@NativeType("FT_Byte")
public byte paint_type() { return CID_FaceDict.npaint_type(address()); }
/** @return the value of the {@code font_type} field. */
@NativeType("FT_Byte")
public byte font_type() { return CID_FaceDict.nfont_type(address()); }
/** @return a {@link FT_Matrix} view of the {@code font_matrix} field. */
public FT_Matrix font_matrix() { return CID_FaceDict.nfont_matrix(address()); }
/** @return a {@link FT_Vector} view of the {@code font_offset} field. */
public FT_Vector font_offset() { return CID_FaceDict.nfont_offset(address()); }
/** @return the value of the {@code num_subrs} field. */
@NativeType("FT_UInt")
public int num_subrs() { return CID_FaceDict.nnum_subrs(address()); }
/** @return the value of the {@code subrmap_offset} field. */
@NativeType("FT_ULong")
public long subrmap_offset() { return CID_FaceDict.nsubrmap_offset(address()); }
/** @return the value of the {@code sd_bytes} field. */
@NativeType("FT_UInt")
public int sd_bytes() { return CID_FaceDict.nsd_bytes(address()); }
}
}

View File

@ -0,0 +1,390 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure used to represent CID Face information.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct CID_FaceInfoRec {
* FT_String * cid_font_name;
* FT_Fixed cid_version;
* FT_Int cid_font_type;
* FT_String * registry;
* FT_String * ordering;
* FT_Int supplement;
* {@link PS_FontInfo PS_FontInfoRec} font_info;
* {@link FT_BBox FT_BBox} font_bbox;
* FT_ULong uid_base;
* FT_Int num_xuid;
* FT_ULong xuid[16];
* FT_ULong cidmap_offset;
* FT_UInt fd_bytes;
* FT_UInt gd_bytes;
* FT_ULong cid_count;
* FT_UInt num_dicts;
* {@link CID_FaceDict CID_FaceDict} font_dicts;
* FT_ULong data_offset;
* }</code></pre>
*/
@NativeType("struct CID_FaceInfoRec")
public class CID_FaceInfo extends Struct<CID_FaceInfo> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
CID_FONT_NAME,
CID_VERSION,
CID_FONT_TYPE,
REGISTRY,
ORDERING,
SUPPLEMENT,
FONT_INFO,
FONT_BBOX,
UID_BASE,
NUM_XUID,
XUID,
CIDMAP_OFFSET,
FD_BYTES,
GD_BYTES,
CID_COUNT,
NUM_DICTS,
FONT_DICTS,
DATA_OFFSET;
static {
Layout layout = __struct(
__member(POINTER_SIZE),
__member(CLONG_SIZE),
__member(4),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(4),
__member(PS_FontInfo.SIZEOF, PS_FontInfo.ALIGNOF),
__member(FT_BBox.SIZEOF, FT_BBox.ALIGNOF),
__member(CLONG_SIZE),
__member(4),
__array(CLONG_SIZE, 16),
__member(CLONG_SIZE),
__member(4),
__member(4),
__member(CLONG_SIZE),
__member(4),
__member(POINTER_SIZE),
__member(CLONG_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
CID_FONT_NAME = layout.offsetof(0);
CID_VERSION = layout.offsetof(1);
CID_FONT_TYPE = layout.offsetof(2);
REGISTRY = layout.offsetof(3);
ORDERING = layout.offsetof(4);
SUPPLEMENT = layout.offsetof(5);
FONT_INFO = layout.offsetof(6);
FONT_BBOX = layout.offsetof(7);
UID_BASE = layout.offsetof(8);
NUM_XUID = layout.offsetof(9);
XUID = layout.offsetof(10);
CIDMAP_OFFSET = layout.offsetof(11);
FD_BYTES = layout.offsetof(12);
GD_BYTES = layout.offsetof(13);
CID_COUNT = layout.offsetof(14);
NUM_DICTS = layout.offsetof(15);
FONT_DICTS = layout.offsetof(16);
DATA_OFFSET = layout.offsetof(17);
}
protected CID_FaceInfo(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected CID_FaceInfo create(long address, @Nullable ByteBuffer container) {
return new CID_FaceInfo(address, container);
}
/**
* Creates a {@code CID_FaceInfo} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public CID_FaceInfo(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code cid_font_name} field. */
@NativeType("FT_String *")
public ByteBuffer cid_font_name() { return ncid_font_name(address()); }
/** @return the null-terminated string pointed to by the {@code cid_font_name} field. */
@NativeType("FT_String *")
public String cid_font_nameString() { return ncid_font_nameString(address()); }
/** @return the value of the {@code cid_version} field. */
@NativeType("FT_Fixed")
public long cid_version() { return ncid_version(address()); }
/** @return the value of the {@code cid_font_type} field. */
@NativeType("FT_Int")
public int cid_font_type() { return ncid_font_type(address()); }
/** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code registry} field. */
@NativeType("FT_String *")
public ByteBuffer registry() { return nregistry(address()); }
/** @return the null-terminated string pointed to by the {@code registry} field. */
@NativeType("FT_String *")
public String registryString() { return nregistryString(address()); }
/** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code ordering} field. */
@NativeType("FT_String *")
public ByteBuffer ordering() { return nordering(address()); }
/** @return the null-terminated string pointed to by the {@code ordering} field. */
@NativeType("FT_String *")
public String orderingString() { return norderingString(address()); }
/** @return the value of the {@code supplement} field. */
@NativeType("FT_Int")
public int supplement() { return nsupplement(address()); }
/** @return a {@link PS_FontInfo} view of the {@code font_info} field. */
@NativeType("PS_FontInfoRec")
public PS_FontInfo font_info() { return nfont_info(address()); }
/** @return a {@link FT_BBox} view of the {@code font_bbox} field. */
public FT_BBox font_bbox() { return nfont_bbox(address()); }
/** @return the value of the {@code uid_base} field. */
@NativeType("FT_ULong")
public long uid_base() { return nuid_base(address()); }
/** @return the value of the {@code num_xuid} field. */
@NativeType("FT_Int")
public int num_xuid() { return nnum_xuid(address()); }
/** @return a {@link CLongBuffer} view of the {@code xuid} field. */
@NativeType("FT_ULong[16]")
public CLongBuffer xuid() { return nxuid(address()); }
/** @return the value at the specified index of the {@code xuid} field. */
@NativeType("FT_ULong")
public long xuid(int index) { return nxuid(address(), index); }
/** @return the value of the {@code cidmap_offset} field. */
@NativeType("FT_ULong")
public long cidmap_offset() { return ncidmap_offset(address()); }
/** @return the value of the {@code fd_bytes} field. */
@NativeType("FT_UInt")
public int fd_bytes() { return nfd_bytes(address()); }
/** @return the value of the {@code gd_bytes} field. */
@NativeType("FT_UInt")
public int gd_bytes() { return ngd_bytes(address()); }
/** @return the value of the {@code cid_count} field. */
@NativeType("FT_ULong")
public long cid_count() { return ncid_count(address()); }
/** @return the value of the {@code num_dicts} field. */
@NativeType("FT_UInt")
public int num_dicts() { return nnum_dicts(address()); }
/** @return a {@link CID_FaceDict} view of the struct pointed to by the {@code font_dicts} field. */
public CID_FaceDict font_dicts() { return nfont_dicts(address()); }
/** @return the value of the {@code data_offset} field. */
@NativeType("FT_ULong")
public long data_offset() { return ndata_offset(address()); }
// -----------------------------------
/** Returns a new {@code CID_FaceInfo} instance for the specified memory address. */
public static CID_FaceInfo create(long address) {
return new CID_FaceInfo(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static CID_FaceInfo createSafe(long address) {
return address == NULL ? null : new CID_FaceInfo(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #cid_font_name}. */
public static ByteBuffer ncid_font_name(long struct) { return memByteBufferNT1(memGetAddress(struct + CID_FaceInfo.CID_FONT_NAME)); }
/** Unsafe version of {@link #cid_font_nameString}. */
public static String ncid_font_nameString(long struct) { return memUTF8(memGetAddress(struct + CID_FaceInfo.CID_FONT_NAME)); }
/** Unsafe version of {@link #cid_version}. */
public static long ncid_version(long struct) { return memGetCLong(struct + CID_FaceInfo.CID_VERSION); }
/** Unsafe version of {@link #cid_font_type}. */
public static int ncid_font_type(long struct) { return UNSAFE.getInt(null, struct + CID_FaceInfo.CID_FONT_TYPE); }
/** Unsafe version of {@link #registry}. */
public static ByteBuffer nregistry(long struct) { return memByteBufferNT1(memGetAddress(struct + CID_FaceInfo.REGISTRY)); }
/** Unsafe version of {@link #registryString}. */
public static String nregistryString(long struct) { return memUTF8(memGetAddress(struct + CID_FaceInfo.REGISTRY)); }
/** Unsafe version of {@link #ordering}. */
public static ByteBuffer nordering(long struct) { return memByteBufferNT1(memGetAddress(struct + CID_FaceInfo.ORDERING)); }
/** Unsafe version of {@link #orderingString}. */
public static String norderingString(long struct) { return memUTF8(memGetAddress(struct + CID_FaceInfo.ORDERING)); }
/** Unsafe version of {@link #supplement}. */
public static int nsupplement(long struct) { return UNSAFE.getInt(null, struct + CID_FaceInfo.SUPPLEMENT); }
/** Unsafe version of {@link #font_info}. */
public static PS_FontInfo nfont_info(long struct) { return PS_FontInfo.create(struct + CID_FaceInfo.FONT_INFO); }
/** Unsafe version of {@link #font_bbox}. */
public static FT_BBox nfont_bbox(long struct) { return FT_BBox.create(struct + CID_FaceInfo.FONT_BBOX); }
/** Unsafe version of {@link #uid_base}. */
public static long nuid_base(long struct) { return memGetCLong(struct + CID_FaceInfo.UID_BASE); }
/** Unsafe version of {@link #num_xuid}. */
public static int nnum_xuid(long struct) { return UNSAFE.getInt(null, struct + CID_FaceInfo.NUM_XUID); }
/** Unsafe version of {@link #xuid}. */
public static CLongBuffer nxuid(long struct) { return memCLongBuffer(struct + CID_FaceInfo.XUID, 16); }
/** Unsafe version of {@link #xuid(int) xuid}. */
public static long nxuid(long struct, int index) {
return memGetCLong(struct + CID_FaceInfo.XUID + check(index, 16) * CLONG_SIZE);
}
/** Unsafe version of {@link #cidmap_offset}. */
public static long ncidmap_offset(long struct) { return memGetCLong(struct + CID_FaceInfo.CIDMAP_OFFSET); }
/** Unsafe version of {@link #fd_bytes}. */
public static int nfd_bytes(long struct) { return UNSAFE.getInt(null, struct + CID_FaceInfo.FD_BYTES); }
/** Unsafe version of {@link #gd_bytes}. */
public static int ngd_bytes(long struct) { return UNSAFE.getInt(null, struct + CID_FaceInfo.GD_BYTES); }
/** Unsafe version of {@link #cid_count}. */
public static long ncid_count(long struct) { return memGetCLong(struct + CID_FaceInfo.CID_COUNT); }
/** Unsafe version of {@link #num_dicts}. */
public static int nnum_dicts(long struct) { return UNSAFE.getInt(null, struct + CID_FaceInfo.NUM_DICTS); }
/** Unsafe version of {@link #font_dicts}. */
public static CID_FaceDict nfont_dicts(long struct) { return CID_FaceDict.create(memGetAddress(struct + CID_FaceInfo.FONT_DICTS)); }
/** Unsafe version of {@link #data_offset}. */
public static long ndata_offset(long struct) { return memGetCLong(struct + CID_FaceInfo.DATA_OFFSET); }
// -----------------------------------
/** An array of {@link CID_FaceInfo} structs. */
public static class Buffer extends StructBuffer<CID_FaceInfo, Buffer> {
private static final CID_FaceInfo ELEMENT_FACTORY = CID_FaceInfo.create(-1L);
/**
* Creates a new {@code CID_FaceInfo.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link CID_FaceInfo#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected CID_FaceInfo getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code cid_font_name} field. */
@NativeType("FT_String *")
public ByteBuffer cid_font_name() { return CID_FaceInfo.ncid_font_name(address()); }
/** @return the null-terminated string pointed to by the {@code cid_font_name} field. */
@NativeType("FT_String *")
public String cid_font_nameString() { return CID_FaceInfo.ncid_font_nameString(address()); }
/** @return the value of the {@code cid_version} field. */
@NativeType("FT_Fixed")
public long cid_version() { return CID_FaceInfo.ncid_version(address()); }
/** @return the value of the {@code cid_font_type} field. */
@NativeType("FT_Int")
public int cid_font_type() { return CID_FaceInfo.ncid_font_type(address()); }
/** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code registry} field. */
@NativeType("FT_String *")
public ByteBuffer registry() { return CID_FaceInfo.nregistry(address()); }
/** @return the null-terminated string pointed to by the {@code registry} field. */
@NativeType("FT_String *")
public String registryString() { return CID_FaceInfo.nregistryString(address()); }
/** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code ordering} field. */
@NativeType("FT_String *")
public ByteBuffer ordering() { return CID_FaceInfo.nordering(address()); }
/** @return the null-terminated string pointed to by the {@code ordering} field. */
@NativeType("FT_String *")
public String orderingString() { return CID_FaceInfo.norderingString(address()); }
/** @return the value of the {@code supplement} field. */
@NativeType("FT_Int")
public int supplement() { return CID_FaceInfo.nsupplement(address()); }
/** @return a {@link PS_FontInfo} view of the {@code font_info} field. */
@NativeType("PS_FontInfoRec")
public PS_FontInfo font_info() { return CID_FaceInfo.nfont_info(address()); }
/** @return a {@link FT_BBox} view of the {@code font_bbox} field. */
public FT_BBox font_bbox() { return CID_FaceInfo.nfont_bbox(address()); }
/** @return the value of the {@code uid_base} field. */
@NativeType("FT_ULong")
public long uid_base() { return CID_FaceInfo.nuid_base(address()); }
/** @return the value of the {@code num_xuid} field. */
@NativeType("FT_Int")
public int num_xuid() { return CID_FaceInfo.nnum_xuid(address()); }
/** @return a {@link CLongBuffer} view of the {@code xuid} field. */
@NativeType("FT_ULong[16]")
public CLongBuffer xuid() { return CID_FaceInfo.nxuid(address()); }
/** @return the value at the specified index of the {@code xuid} field. */
@NativeType("FT_ULong")
public long xuid(int index) { return CID_FaceInfo.nxuid(address(), index); }
/** @return the value of the {@code cidmap_offset} field. */
@NativeType("FT_ULong")
public long cidmap_offset() { return CID_FaceInfo.ncidmap_offset(address()); }
/** @return the value of the {@code fd_bytes} field. */
@NativeType("FT_UInt")
public int fd_bytes() { return CID_FaceInfo.nfd_bytes(address()); }
/** @return the value of the {@code gd_bytes} field. */
@NativeType("FT_UInt")
public int gd_bytes() { return CID_FaceInfo.ngd_bytes(address()); }
/** @return the value of the {@code cid_count} field. */
@NativeType("FT_ULong")
public long cid_count() { return CID_FaceInfo.ncid_count(address()); }
/** @return the value of the {@code num_dicts} field. */
@NativeType("FT_UInt")
public int num_dicts() { return CID_FaceInfo.nnum_dicts(address()); }
/** @return a {@link CID_FaceDict} view of the struct pointed to by the {@code font_dicts} field. */
public CID_FaceDict font_dicts() { return CID_FaceInfo.nfont_dicts(address()); }
/** @return the value of the {@code data_offset} field. */
@NativeType("FT_ULong")
public long data_offset() { return CID_FaceInfo.ndata_offset(address()); }
}
}

View File

@ -0,0 +1,76 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* FT_Error (*{@link #invoke}) (
* FTC_FaceID face_id,
* FT_Library library,
* FT_Pointer req_data,
* FT_Face *aface
* )</code></pre>
*/
public abstract class FTC_Face_Requester extends Callback implements FTC_Face_RequesterI {
/**
* Creates a {@code FTC_Face_Requester} instance from the specified function pointer.
*
* @return the new {@code FTC_Face_Requester}
*/
public static FTC_Face_Requester create(long functionPointer) {
FTC_Face_RequesterI instance = Callback.get(functionPointer);
return instance instanceof FTC_Face_Requester
? (FTC_Face_Requester)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static FTC_Face_Requester createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code FTC_Face_Requester} instance that delegates to the specified {@code FTC_Face_RequesterI} instance. */
public static FTC_Face_Requester create(FTC_Face_RequesterI instance) {
return instance instanceof FTC_Face_Requester
? (FTC_Face_Requester)instance
: new Container(instance.address(), instance);
}
protected FTC_Face_Requester() {
super(CIF);
}
FTC_Face_Requester(long functionPointer) {
super(functionPointer);
}
private static final class Container extends FTC_Face_Requester {
private final FTC_Face_RequesterI delegate;
Container(long functionPointer, FTC_Face_RequesterI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public int invoke(long face_id, long library, long req_data, long aface) {
return delegate.invoke(face_id, library, req_data, aface);
}
}
}

View File

@ -0,0 +1,56 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* FT_Error (*{@link #invoke}) (
* FTC_FaceID face_id,
* FT_Library library,
* FT_Pointer req_data,
* FT_Face *aface
* )</code></pre>
*/
@FunctionalInterface
@NativeType("FTC_Face_Requester")
public interface FTC_Face_RequesterI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_sint32,
ffi_type_pointer, ffi_type_pointer, ffi_type_pointer, ffi_type_pointer
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
int __result = invoke(
memGetAddress(memGetAddress(args)),
memGetAddress(memGetAddress(args + POINTER_SIZE)),
memGetAddress(memGetAddress(args + 2 * POINTER_SIZE)),
memGetAddress(memGetAddress(args + 3 * POINTER_SIZE))
);
apiClosureRet(ret, __result);
}
/**
* A callback function provided by client applications. It is used by the cache manager to translate a given FTC _FaceID into a new valid {@code FT_Face}
* object, on demand.
*/
@NativeType("FT_Error") int invoke(@NativeType("FTC_FaceID") long face_id, @NativeType("FT_Library") long library, @NativeType("FT_Pointer") long req_data, @NativeType("FT_Face *") long aface);
}

View File

@ -0,0 +1,190 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure used to model the type of images in a glyph cache.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FTC_ImageTypeRec {
* FTC_FaceID face_id;
* FT_UInt width;
* FT_UInt height;
* FT_Int32 flags;
* }</code></pre>
*/
@NativeType("struct FTC_ImageTypeRec")
public class FTC_ImageType extends Struct<FTC_ImageType> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
FACE_ID,
WIDTH,
HEIGHT,
FLAGS;
static {
Layout layout = __struct(
__member(POINTER_SIZE),
__member(4),
__member(4),
__member(4)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
FACE_ID = layout.offsetof(0);
WIDTH = layout.offsetof(1);
HEIGHT = layout.offsetof(2);
FLAGS = layout.offsetof(3);
}
protected FTC_ImageType(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FTC_ImageType create(long address, @Nullable ByteBuffer container) {
return new FTC_ImageType(address, container);
}
/**
* Creates a {@code FTC_ImageType} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FTC_ImageType(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code face_id} field. */
@NativeType("FTC_FaceID")
public long face_id() { return nface_id(address()); }
/** @return the value of the {@code width} field. */
@NativeType("FT_UInt")
public int width() { return nwidth(address()); }
/** @return the value of the {@code height} field. */
@NativeType("FT_UInt")
public int height() { return nheight(address()); }
/** @return the value of the {@code flags} field. */
@NativeType("FT_Int32")
public int flags() { return nflags(address()); }
// -----------------------------------
/** Returns a new {@code FTC_ImageType} instance for the specified memory address. */
public static FTC_ImageType create(long address) {
return new FTC_ImageType(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FTC_ImageType createSafe(long address) {
return address == NULL ? null : new FTC_ImageType(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #face_id}. */
public static long nface_id(long struct) { return memGetAddress(struct + FTC_ImageType.FACE_ID); }
/** Unsafe version of {@link #width}. */
public static int nwidth(long struct) { return UNSAFE.getInt(null, struct + FTC_ImageType.WIDTH); }
/** Unsafe version of {@link #height}. */
public static int nheight(long struct) { return UNSAFE.getInt(null, struct + FTC_ImageType.HEIGHT); }
/** Unsafe version of {@link #flags}. */
public static int nflags(long struct) { return UNSAFE.getInt(null, struct + FTC_ImageType.FLAGS); }
// -----------------------------------
/** An array of {@link FTC_ImageType} structs. */
public static class Buffer extends StructBuffer<FTC_ImageType, Buffer> {
private static final FTC_ImageType ELEMENT_FACTORY = FTC_ImageType.create(-1L);
/**
* Creates a new {@code FTC_ImageType.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FTC_ImageType#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FTC_ImageType getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code face_id} field. */
@NativeType("FTC_FaceID")
public long face_id() { return FTC_ImageType.nface_id(address()); }
/** @return the value of the {@code width} field. */
@NativeType("FT_UInt")
public int width() { return FTC_ImageType.nwidth(address()); }
/** @return the value of the {@code height} field. */
@NativeType("FT_UInt")
public int height() { return FTC_ImageType.nheight(address()); }
/** @return the value of the {@code flags} field. */
@NativeType("FT_Int32")
public int flags() { return FTC_ImageType.nflags(address()); }
}
}

View File

@ -0,0 +1,270 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A very compact structure used to describe a small glyph bitmap.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FTC_SBitRec {
* FT_Byte width;
* FT_Byte height;
* FT_Char left;
* FT_Char top;
* FT_Byte format;
* FT_Byte max_grays;
* FT_Short pitch;
* FT_Char xadvance;
* FT_Char yadvance;
* FT_Byte * buffer;
* }</code></pre>
*/
@NativeType("struct FTC_SBitRec")
public class FTC_SBit extends Struct<FTC_SBit> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
WIDTH,
HEIGHT,
LEFT,
TOP,
FORMAT,
MAX_GRAYS,
PITCH,
XADVANCE,
YADVANCE,
BUFFER;
static {
Layout layout = __struct(
__member(1),
__member(1),
__member(1),
__member(1),
__member(1),
__member(1),
__member(2),
__member(1),
__member(1),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
WIDTH = layout.offsetof(0);
HEIGHT = layout.offsetof(1);
LEFT = layout.offsetof(2);
TOP = layout.offsetof(3);
FORMAT = layout.offsetof(4);
MAX_GRAYS = layout.offsetof(5);
PITCH = layout.offsetof(6);
XADVANCE = layout.offsetof(7);
YADVANCE = layout.offsetof(8);
BUFFER = layout.offsetof(9);
}
protected FTC_SBit(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FTC_SBit create(long address, @Nullable ByteBuffer container) {
return new FTC_SBit(address, container);
}
/**
* Creates a {@code FTC_SBit} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FTC_SBit(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code width} field. */
@NativeType("FT_Byte")
public byte width() { return nwidth(address()); }
/** @return the value of the {@code height} field. */
@NativeType("FT_Byte")
public byte height() { return nheight(address()); }
/** @return the value of the {@code left} field. */
@NativeType("FT_Char")
public byte left() { return nleft(address()); }
/** @return the value of the {@code top} field. */
@NativeType("FT_Char")
public byte top() { return ntop(address()); }
/** @return the value of the {@code format} field. */
@NativeType("FT_Byte")
public byte format() { return nformat(address()); }
/** @return the value of the {@code max_grays} field. */
@NativeType("FT_Byte")
public byte max_grays() { return nmax_grays(address()); }
/** @return the value of the {@code pitch} field. */
@NativeType("FT_Short")
public short pitch() { return npitch(address()); }
/** @return the value of the {@code xadvance} field. */
@NativeType("FT_Char")
public byte xadvance() { return nxadvance(address()); }
/** @return the value of the {@code yadvance} field. */
@NativeType("FT_Char")
public byte yadvance() { return nyadvance(address()); }
/**
* @return a {@link ByteBuffer} view of the data pointed to by the {@code buffer} field.
*
* @param capacity the number of elements in the returned buffer
*/
@NativeType("FT_Byte *")
public ByteBuffer buffer(int capacity) { return nbuffer(address(), capacity); }
// -----------------------------------
/** Returns a new {@code FTC_SBit} instance for the specified memory address. */
public static FTC_SBit create(long address) {
return new FTC_SBit(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FTC_SBit createSafe(long address) {
return address == NULL ? null : new FTC_SBit(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #width}. */
public static byte nwidth(long struct) { return UNSAFE.getByte(null, struct + FTC_SBit.WIDTH); }
/** Unsafe version of {@link #height}. */
public static byte nheight(long struct) { return UNSAFE.getByte(null, struct + FTC_SBit.HEIGHT); }
/** Unsafe version of {@link #left}. */
public static byte nleft(long struct) { return UNSAFE.getByte(null, struct + FTC_SBit.LEFT); }
/** Unsafe version of {@link #top}. */
public static byte ntop(long struct) { return UNSAFE.getByte(null, struct + FTC_SBit.TOP); }
/** Unsafe version of {@link #format}. */
public static byte nformat(long struct) { return UNSAFE.getByte(null, struct + FTC_SBit.FORMAT); }
/** Unsafe version of {@link #max_grays}. */
public static byte nmax_grays(long struct) { return UNSAFE.getByte(null, struct + FTC_SBit.MAX_GRAYS); }
/** Unsafe version of {@link #pitch}. */
public static short npitch(long struct) { return UNSAFE.getShort(null, struct + FTC_SBit.PITCH); }
/** Unsafe version of {@link #xadvance}. */
public static byte nxadvance(long struct) { return UNSAFE.getByte(null, struct + FTC_SBit.XADVANCE); }
/** Unsafe version of {@link #yadvance}. */
public static byte nyadvance(long struct) { return UNSAFE.getByte(null, struct + FTC_SBit.YADVANCE); }
/** Unsafe version of {@link #buffer(int) buffer}. */
public static ByteBuffer nbuffer(long struct, int capacity) { return memByteBuffer(memGetAddress(struct + FTC_SBit.BUFFER), capacity); }
// -----------------------------------
/** An array of {@link FTC_SBit} structs. */
public static class Buffer extends StructBuffer<FTC_SBit, Buffer> {
private static final FTC_SBit ELEMENT_FACTORY = FTC_SBit.create(-1L);
/**
* Creates a new {@code FTC_SBit.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FTC_SBit#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FTC_SBit getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code width} field. */
@NativeType("FT_Byte")
public byte width() { return FTC_SBit.nwidth(address()); }
/** @return the value of the {@code height} field. */
@NativeType("FT_Byte")
public byte height() { return FTC_SBit.nheight(address()); }
/** @return the value of the {@code left} field. */
@NativeType("FT_Char")
public byte left() { return FTC_SBit.nleft(address()); }
/** @return the value of the {@code top} field. */
@NativeType("FT_Char")
public byte top() { return FTC_SBit.ntop(address()); }
/** @return the value of the {@code format} field. */
@NativeType("FT_Byte")
public byte format() { return FTC_SBit.nformat(address()); }
/** @return the value of the {@code max_grays} field. */
@NativeType("FT_Byte")
public byte max_grays() { return FTC_SBit.nmax_grays(address()); }
/** @return the value of the {@code pitch} field. */
@NativeType("FT_Short")
public short pitch() { return FTC_SBit.npitch(address()); }
/** @return the value of the {@code xadvance} field. */
@NativeType("FT_Char")
public byte xadvance() { return FTC_SBit.nxadvance(address()); }
/** @return the value of the {@code yadvance} field. */
@NativeType("FT_Char")
public byte yadvance() { return FTC_SBit.nyadvance(address()); }
/**
* @return a {@link ByteBuffer} view of the data pointed to by the {@code buffer} field.
*
* @param capacity the number of elements in the returned buffer
*/
@NativeType("FT_Byte *")
public ByteBuffer buffer(int capacity) { return FTC_SBit.nbuffer(address(), capacity); }
}
}

View File

@ -0,0 +1,214 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure used to describe a given character size in either pixels or points to the cache manager. See {@link FreeType#FTC_Manager_LookupSize}.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FTC_ScalerRec {
* FTC_FaceID face_id;
* FT_UInt width;
* FT_UInt height;
* FT_Int pixel;
* FT_UInt x_res;
* FT_UInt y_res;
* }</code></pre>
*/
@NativeType("struct FTC_ScalerRec")
public class FTC_Scaler extends Struct<FTC_Scaler> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
FACE_ID,
WIDTH,
HEIGHT,
PIXEL,
X_RES,
Y_RES;
static {
Layout layout = __struct(
__member(POINTER_SIZE),
__member(4),
__member(4),
__member(4),
__member(4),
__member(4)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
FACE_ID = layout.offsetof(0);
WIDTH = layout.offsetof(1);
HEIGHT = layout.offsetof(2);
PIXEL = layout.offsetof(3);
X_RES = layout.offsetof(4);
Y_RES = layout.offsetof(5);
}
protected FTC_Scaler(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FTC_Scaler create(long address, @Nullable ByteBuffer container) {
return new FTC_Scaler(address, container);
}
/**
* Creates a {@code FTC_Scaler} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FTC_Scaler(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code face_id} field. */
@NativeType("FTC_FaceID")
public long face_id() { return nface_id(address()); }
/** @return the value of the {@code width} field. */
@NativeType("FT_UInt")
public int width() { return nwidth(address()); }
/** @return the value of the {@code height} field. */
@NativeType("FT_UInt")
public int height() { return nheight(address()); }
/** @return the value of the {@code pixel} field. */
@NativeType("FT_Int")
public int pixel() { return npixel(address()); }
/** @return the value of the {@code x_res} field. */
@NativeType("FT_UInt")
public int x_res() { return nx_res(address()); }
/** @return the value of the {@code y_res} field. */
@NativeType("FT_UInt")
public int y_res() { return ny_res(address()); }
// -----------------------------------
/** Returns a new {@code FTC_Scaler} instance for the specified memory address. */
public static FTC_Scaler create(long address) {
return new FTC_Scaler(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FTC_Scaler createSafe(long address) {
return address == NULL ? null : new FTC_Scaler(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #face_id}. */
public static long nface_id(long struct) { return memGetAddress(struct + FTC_Scaler.FACE_ID); }
/** Unsafe version of {@link #width}. */
public static int nwidth(long struct) { return UNSAFE.getInt(null, struct + FTC_Scaler.WIDTH); }
/** Unsafe version of {@link #height}. */
public static int nheight(long struct) { return UNSAFE.getInt(null, struct + FTC_Scaler.HEIGHT); }
/** Unsafe version of {@link #pixel}. */
public static int npixel(long struct) { return UNSAFE.getInt(null, struct + FTC_Scaler.PIXEL); }
/** Unsafe version of {@link #x_res}. */
public static int nx_res(long struct) { return UNSAFE.getInt(null, struct + FTC_Scaler.X_RES); }
/** Unsafe version of {@link #y_res}. */
public static int ny_res(long struct) { return UNSAFE.getInt(null, struct + FTC_Scaler.Y_RES); }
// -----------------------------------
/** An array of {@link FTC_Scaler} structs. */
public static class Buffer extends StructBuffer<FTC_Scaler, Buffer> {
private static final FTC_Scaler ELEMENT_FACTORY = FTC_Scaler.create(-1L);
/**
* Creates a new {@code FTC_Scaler.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FTC_Scaler#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FTC_Scaler getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code face_id} field. */
@NativeType("FTC_FaceID")
public long face_id() { return FTC_Scaler.nface_id(address()); }
/** @return the value of the {@code width} field. */
@NativeType("FT_UInt")
public int width() { return FTC_Scaler.nwidth(address()); }
/** @return the value of the {@code height} field. */
@NativeType("FT_UInt")
public int height() { return FTC_Scaler.nheight(address()); }
/** @return the value of the {@code pixel} field. */
@NativeType("FT_Int")
public int pixel() { return FTC_Scaler.npixel(address()); }
/** @return the value of the {@code x_res} field. */
@NativeType("FT_UInt")
public int x_res() { return FTC_Scaler.nx_res(address()); }
/** @return the value of the {@code y_res} field. */
@NativeType("FT_UInt")
public int y_res() { return FTC_Scaler.ny_res(address()); }
}
}

View File

@ -0,0 +1,213 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure used to store a 2x3 matrix. Coefficients are in 16.16 fixed-point format.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Affine23 {
* FT_Fixed xx;
* FT_Fixed xy;
* FT_Fixed dx;
* FT_Fixed yx;
* FT_Fixed yy;
* FT_Fixed dy;
* }</code></pre>
*/
public class FT_Affine23 extends Struct<FT_Affine23> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
XX,
XY,
DX,
YX,
YY,
DY;
static {
Layout layout = __struct(
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
XX = layout.offsetof(0);
XY = layout.offsetof(1);
DX = layout.offsetof(2);
YX = layout.offsetof(3);
YY = layout.offsetof(4);
DY = layout.offsetof(5);
}
protected FT_Affine23(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Affine23 create(long address, @Nullable ByteBuffer container) {
return new FT_Affine23(address, container);
}
/**
* Creates a {@code FT_Affine23} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Affine23(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code xx} field. */
@NativeType("FT_Fixed")
public long xx() { return nxx(address()); }
/** @return the value of the {@code xy} field. */
@NativeType("FT_Fixed")
public long xy() { return nxy(address()); }
/** @return the value of the {@code dx} field. */
@NativeType("FT_Fixed")
public long dx() { return ndx(address()); }
/** @return the value of the {@code yx} field. */
@NativeType("FT_Fixed")
public long yx() { return nyx(address()); }
/** @return the value of the {@code yy} field. */
@NativeType("FT_Fixed")
public long yy() { return nyy(address()); }
/** @return the value of the {@code dy} field. */
@NativeType("FT_Fixed")
public long dy() { return ndy(address()); }
// -----------------------------------
/** Returns a new {@code FT_Affine23} instance for the specified memory address. */
public static FT_Affine23 create(long address) {
return new FT_Affine23(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Affine23 createSafe(long address) {
return address == NULL ? null : new FT_Affine23(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #xx}. */
public static long nxx(long struct) { return memGetCLong(struct + FT_Affine23.XX); }
/** Unsafe version of {@link #xy}. */
public static long nxy(long struct) { return memGetCLong(struct + FT_Affine23.XY); }
/** Unsafe version of {@link #dx}. */
public static long ndx(long struct) { return memGetCLong(struct + FT_Affine23.DX); }
/** Unsafe version of {@link #yx}. */
public static long nyx(long struct) { return memGetCLong(struct + FT_Affine23.YX); }
/** Unsafe version of {@link #yy}. */
public static long nyy(long struct) { return memGetCLong(struct + FT_Affine23.YY); }
/** Unsafe version of {@link #dy}. */
public static long ndy(long struct) { return memGetCLong(struct + FT_Affine23.DY); }
// -----------------------------------
/** An array of {@link FT_Affine23} structs. */
public static class Buffer extends StructBuffer<FT_Affine23, Buffer> {
private static final FT_Affine23 ELEMENT_FACTORY = FT_Affine23.create(-1L);
/**
* Creates a new {@code FT_Affine23.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Affine23#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Affine23 getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code xx} field. */
@NativeType("FT_Fixed")
public long xx() { return FT_Affine23.nxx(address()); }
/** @return the value of the {@code xy} field. */
@NativeType("FT_Fixed")
public long xy() { return FT_Affine23.nxy(address()); }
/** @return the value of the {@code dx} field. */
@NativeType("FT_Fixed")
public long dx() { return FT_Affine23.ndx(address()); }
/** @return the value of the {@code yx} field. */
@NativeType("FT_Fixed")
public long yx() { return FT_Affine23.nyx(address()); }
/** @return the value of the {@code yy} field. */
@NativeType("FT_Fixed")
public long yy() { return FT_Affine23.nyy(address()); }
/** @return the value of the {@code dy} field. */
@NativeType("FT_Fixed")
public long dy() { return FT_Affine23.ndy(address()); }
}
}

View File

@ -0,0 +1,74 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* void * (*{@link #invoke}) (
* FT_Memory memory,
* long size
* )</code></pre>
*/
public abstract class FT_Alloc_Func extends Callback implements FT_Alloc_FuncI {
/**
* Creates a {@code FT_Alloc_Func} instance from the specified function pointer.
*
* @return the new {@code FT_Alloc_Func}
*/
public static FT_Alloc_Func create(long functionPointer) {
FT_Alloc_FuncI instance = Callback.get(functionPointer);
return instance instanceof FT_Alloc_Func
? (FT_Alloc_Func)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static FT_Alloc_Func createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code FT_Alloc_Func} instance that delegates to the specified {@code FT_Alloc_FuncI} instance. */
public static FT_Alloc_Func create(FT_Alloc_FuncI instance) {
return instance instanceof FT_Alloc_Func
? (FT_Alloc_Func)instance
: new Container(instance.address(), instance);
}
protected FT_Alloc_Func() {
super(CIF);
}
FT_Alloc_Func(long functionPointer) {
super(functionPointer);
}
private static final class Container extends FT_Alloc_Func {
private final FT_Alloc_FuncI delegate;
Container(long functionPointer, FT_Alloc_FuncI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public long invoke(long memory, long size) {
return delegate.invoke(memory, size);
}
}
}

View File

@ -0,0 +1,49 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* void * (*{@link #invoke}) (
* FT_Memory memory,
* long size
* )</code></pre>
*/
@FunctionalInterface
@NativeType("FT_Alloc_Func")
public interface FT_Alloc_FuncI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_pointer,
ffi_type_pointer, ffi_type_slong
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
long __result = invoke(
memGetAddress(memGetAddress(args)),
memGetCLong(memGetAddress(args + POINTER_SIZE))
);
apiClosureRetP(ret, __result);
}
/** A function used to allocate {@code size} bytes from {@code memory}. */
@NativeType("void *") long invoke(@NativeType("FT_Memory") long memory, long size);
}

View File

@ -0,0 +1,327 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* A structure used to hold an outline's bounding box, i.e., the coordinates of its extrema in the horizontal and vertical directions.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_BBox {
* FT_Pos xMin;
* FT_Pos yMin;
* FT_Pos xMax;
* FT_Pos yMax;
* }</code></pre>
*/
public class FT_BBox extends Struct<FT_BBox> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
XMIN,
YMIN,
XMAX,
YMAX;
static {
Layout layout = __struct(
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
XMIN = layout.offsetof(0);
YMIN = layout.offsetof(1);
XMAX = layout.offsetof(2);
YMAX = layout.offsetof(3);
}
protected FT_BBox(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_BBox create(long address, @Nullable ByteBuffer container) {
return new FT_BBox(address, container);
}
/**
* Creates a {@code FT_BBox} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_BBox(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code xMin} field. */
@NativeType("FT_Pos")
public long xMin() { return nxMin(address()); }
/** @return the value of the {@code yMin} field. */
@NativeType("FT_Pos")
public long yMin() { return nyMin(address()); }
/** @return the value of the {@code xMax} field. */
@NativeType("FT_Pos")
public long xMax() { return nxMax(address()); }
/** @return the value of the {@code yMax} field. */
@NativeType("FT_Pos")
public long yMax() { return nyMax(address()); }
/** Sets the specified value to the {@code xMin} field. */
public FT_BBox xMin(@NativeType("FT_Pos") long value) { nxMin(address(), value); return this; }
/** Sets the specified value to the {@code yMin} field. */
public FT_BBox yMin(@NativeType("FT_Pos") long value) { nyMin(address(), value); return this; }
/** Sets the specified value to the {@code xMax} field. */
public FT_BBox xMax(@NativeType("FT_Pos") long value) { nxMax(address(), value); return this; }
/** Sets the specified value to the {@code yMax} field. */
public FT_BBox yMax(@NativeType("FT_Pos") long value) { nyMax(address(), value); return this; }
/** Initializes this struct with the specified values. */
public FT_BBox set(
long xMin,
long yMin,
long xMax,
long yMax
) {
xMin(xMin);
yMin(yMin);
xMax(xMax);
yMax(yMax);
return this;
}
/**
* Copies the specified struct data to this struct.
*
* @param src the source struct
*
* @return this struct
*/
public FT_BBox set(FT_BBox src) {
memCopy(src.address(), address(), SIZEOF);
return this;
}
// -----------------------------------
/** Returns a new {@code FT_BBox} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_BBox malloc() {
return new FT_BBox(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_BBox} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_BBox calloc() {
return new FT_BBox(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_BBox} instance allocated with {@link BufferUtils}. */
public static FT_BBox create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_BBox(memAddress(container), container);
}
/** Returns a new {@code FT_BBox} instance for the specified memory address. */
public static FT_BBox create(long address) {
return new FT_BBox(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_BBox createSafe(long address) {
return address == NULL ? null : new FT_BBox(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_BBox} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_BBox malloc(MemoryStack stack) {
return new FT_BBox(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_BBox} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_BBox calloc(MemoryStack stack) {
return new FT_BBox(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #xMin}. */
public static long nxMin(long struct) { return memGetCLong(struct + FT_BBox.XMIN); }
/** Unsafe version of {@link #yMin}. */
public static long nyMin(long struct) { return memGetCLong(struct + FT_BBox.YMIN); }
/** Unsafe version of {@link #xMax}. */
public static long nxMax(long struct) { return memGetCLong(struct + FT_BBox.XMAX); }
/** Unsafe version of {@link #yMax}. */
public static long nyMax(long struct) { return memGetCLong(struct + FT_BBox.YMAX); }
/** Unsafe version of {@link #xMin(long) xMin}. */
public static void nxMin(long struct, long value) { memPutCLong(struct + FT_BBox.XMIN, value); }
/** Unsafe version of {@link #yMin(long) yMin}. */
public static void nyMin(long struct, long value) { memPutCLong(struct + FT_BBox.YMIN, value); }
/** Unsafe version of {@link #xMax(long) xMax}. */
public static void nxMax(long struct, long value) { memPutCLong(struct + FT_BBox.XMAX, value); }
/** Unsafe version of {@link #yMax(long) yMax}. */
public static void nyMax(long struct, long value) { memPutCLong(struct + FT_BBox.YMAX, value); }
// -----------------------------------
/** An array of {@link FT_BBox} structs. */
public static class Buffer extends StructBuffer<FT_BBox, Buffer> implements NativeResource {
private static final FT_BBox ELEMENT_FACTORY = FT_BBox.create(-1L);
/**
* Creates a new {@code FT_BBox.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_BBox#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_BBox getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code xMin} field. */
@NativeType("FT_Pos")
public long xMin() { return FT_BBox.nxMin(address()); }
/** @return the value of the {@code yMin} field. */
@NativeType("FT_Pos")
public long yMin() { return FT_BBox.nyMin(address()); }
/** @return the value of the {@code xMax} field. */
@NativeType("FT_Pos")
public long xMax() { return FT_BBox.nxMax(address()); }
/** @return the value of the {@code yMax} field. */
@NativeType("FT_Pos")
public long yMax() { return FT_BBox.nyMax(address()); }
/** Sets the specified value to the {@code xMin} field. */
public Buffer xMin(@NativeType("FT_Pos") long value) { FT_BBox.nxMin(address(), value); return this; }
/** Sets the specified value to the {@code yMin} field. */
public Buffer yMin(@NativeType("FT_Pos") long value) { FT_BBox.nyMin(address(), value); return this; }
/** Sets the specified value to the {@code xMax} field. */
public Buffer xMax(@NativeType("FT_Pos") long value) { FT_BBox.nxMax(address(), value); return this; }
/** Sets the specified value to the {@code yMax} field. */
public Buffer yMax(@NativeType("FT_Pos") long value) { FT_BBox.nyMax(address(), value); return this; }
}
}

View File

@ -0,0 +1,329 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* A structure used to describe a bitmap or pixmap to the raster. Note that we now manage pixmaps of various depths through the {@code pixel_mode} field.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Bitmap {
* unsigned int rows;
* unsigned int width;
* int pitch;
* unsigned char * buffer;
* unsigned short num_grays;
* unsigned char pixel_mode;
* unsigned char palette_mode;
* void * palette;
* }</code></pre>
*/
public class FT_Bitmap extends Struct<FT_Bitmap> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
ROWS,
WIDTH,
PITCH,
BUFFER,
NUM_GRAYS,
PIXEL_MODE,
PALETTE_MODE,
PALETTE;
static {
Layout layout = __struct(
__member(4),
__member(4),
__member(4),
__member(POINTER_SIZE),
__member(2),
__member(1),
__member(1),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
ROWS = layout.offsetof(0);
WIDTH = layout.offsetof(1);
PITCH = layout.offsetof(2);
BUFFER = layout.offsetof(3);
NUM_GRAYS = layout.offsetof(4);
PIXEL_MODE = layout.offsetof(5);
PALETTE_MODE = layout.offsetof(6);
PALETTE = layout.offsetof(7);
}
protected FT_Bitmap(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Bitmap create(long address, @Nullable ByteBuffer container) {
return new FT_Bitmap(address, container);
}
/**
* Creates a {@code FT_Bitmap} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Bitmap(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code rows} field. */
@NativeType("unsigned int")
public int rows() { return nrows(address()); }
/** @return the value of the {@code width} field. */
@NativeType("unsigned int")
public int width() { return nwidth(address()); }
/** @return the value of the {@code pitch} field. */
public int pitch() { return npitch(address()); }
/**
* @return a {@link ByteBuffer} view of the data pointed to by the {@code buffer} field.
*
* @param capacity the number of elements in the returned buffer
*/
@Nullable
@NativeType("unsigned char *")
public ByteBuffer buffer(int capacity) { return nbuffer(address(), capacity); }
/** @return the value of the {@code num_grays} field. */
@NativeType("unsigned short")
public short num_grays() { return nnum_grays(address()); }
/** @return the value of the {@code pixel_mode} field. */
@NativeType("unsigned char")
public byte pixel_mode() { return npixel_mode(address()); }
/** @return the value of the {@code palette_mode} field. */
@NativeType("unsigned char")
public byte palette_mode() { return npalette_mode(address()); }
/** @return the value of the {@code palette} field. */
@NativeType("void *")
public long palette() { return npalette(address()); }
// -----------------------------------
/** Returns a new {@code FT_Bitmap} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_Bitmap malloc() {
return new FT_Bitmap(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_Bitmap} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_Bitmap calloc() {
return new FT_Bitmap(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_Bitmap} instance allocated with {@link BufferUtils}. */
public static FT_Bitmap create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_Bitmap(memAddress(container), container);
}
/** Returns a new {@code FT_Bitmap} instance for the specified memory address. */
public static FT_Bitmap create(long address) {
return new FT_Bitmap(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Bitmap createSafe(long address) {
return address == NULL ? null : new FT_Bitmap(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_Bitmap} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_Bitmap malloc(MemoryStack stack) {
return new FT_Bitmap(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_Bitmap} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_Bitmap calloc(MemoryStack stack) {
return new FT_Bitmap(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #rows}. */
public static int nrows(long struct) { return UNSAFE.getInt(null, struct + FT_Bitmap.ROWS); }
/** Unsafe version of {@link #width}. */
public static int nwidth(long struct) { return UNSAFE.getInt(null, struct + FT_Bitmap.WIDTH); }
/** Unsafe version of {@link #pitch}. */
public static int npitch(long struct) { return UNSAFE.getInt(null, struct + FT_Bitmap.PITCH); }
/** Unsafe version of {@link #buffer(int) buffer}. */
@Nullable public static ByteBuffer nbuffer(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + FT_Bitmap.BUFFER), capacity); }
/** Unsafe version of {@link #num_grays}. */
public static short nnum_grays(long struct) { return UNSAFE.getShort(null, struct + FT_Bitmap.NUM_GRAYS); }
/** Unsafe version of {@link #pixel_mode}. */
public static byte npixel_mode(long struct) { return UNSAFE.getByte(null, struct + FT_Bitmap.PIXEL_MODE); }
/** Unsafe version of {@link #palette_mode}. */
public static byte npalette_mode(long struct) { return UNSAFE.getByte(null, struct + FT_Bitmap.PALETTE_MODE); }
/** Unsafe version of {@link #palette}. */
public static long npalette(long struct) { return memGetAddress(struct + FT_Bitmap.PALETTE); }
// -----------------------------------
/** An array of {@link FT_Bitmap} structs. */
public static class Buffer extends StructBuffer<FT_Bitmap, Buffer> implements NativeResource {
private static final FT_Bitmap ELEMENT_FACTORY = FT_Bitmap.create(-1L);
/**
* Creates a new {@code FT_Bitmap.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Bitmap#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Bitmap getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code rows} field. */
@NativeType("unsigned int")
public int rows() { return FT_Bitmap.nrows(address()); }
/** @return the value of the {@code width} field. */
@NativeType("unsigned int")
public int width() { return FT_Bitmap.nwidth(address()); }
/** @return the value of the {@code pitch} field. */
public int pitch() { return FT_Bitmap.npitch(address()); }
/**
* @return a {@link ByteBuffer} view of the data pointed to by the {@code buffer} field.
*
* @param capacity the number of elements in the returned buffer
*/
@Nullable
@NativeType("unsigned char *")
public ByteBuffer buffer(int capacity) { return FT_Bitmap.nbuffer(address(), capacity); }
/** @return the value of the {@code num_grays} field. */
@NativeType("unsigned short")
public short num_grays() { return FT_Bitmap.nnum_grays(address()); }
/** @return the value of the {@code pixel_mode} field. */
@NativeType("unsigned char")
public byte pixel_mode() { return FT_Bitmap.npixel_mode(address()); }
/** @return the value of the {@code palette_mode} field. */
@NativeType("unsigned char")
public byte palette_mode() { return FT_Bitmap.npalette_mode(address()); }
/** @return the value of the {@code palette} field. */
@NativeType("void *")
public long palette() { return FT_Bitmap.npalette(address()); }
}
}

View File

@ -0,0 +1,188 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure used for bitmap glyph images. This really is a 'sub-class' of {@link FT_Glyph}.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_BitmapGlyphRec {
* {@link FT_Glyph FT_GlyphRec} root;
* FT_Int left;
* FT_Int top;
* {@link FT_Bitmap FT_Bitmap} bitmap;
* }</code></pre>
*/
@NativeType("struct FT_BitmapGlyphRec")
public class FT_BitmapGlyph extends Struct<FT_BitmapGlyph> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
ROOT,
LEFT,
TOP,
BITMAP;
static {
Layout layout = __struct(
__member(FT_Glyph.SIZEOF, FT_Glyph.ALIGNOF),
__member(4),
__member(4),
__member(FT_Bitmap.SIZEOF, FT_Bitmap.ALIGNOF)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
ROOT = layout.offsetof(0);
LEFT = layout.offsetof(1);
TOP = layout.offsetof(2);
BITMAP = layout.offsetof(3);
}
protected FT_BitmapGlyph(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_BitmapGlyph create(long address, @Nullable ByteBuffer container) {
return new FT_BitmapGlyph(address, container);
}
/**
* Creates a {@code FT_BitmapGlyph} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_BitmapGlyph(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link FT_Glyph} view of the {@code root} field. */
@NativeType("FT_GlyphRec")
public FT_Glyph root() { return nroot(address()); }
/** @return the value of the {@code left} field. */
@NativeType("FT_Int")
public int left() { return nleft(address()); }
/** @return the value of the {@code top} field. */
@NativeType("FT_Int")
public int top() { return ntop(address()); }
/** @return a {@link FT_Bitmap} view of the {@code bitmap} field. */
public FT_Bitmap bitmap() { return nbitmap(address()); }
// -----------------------------------
/** Returns a new {@code FT_BitmapGlyph} instance for the specified memory address. */
public static FT_BitmapGlyph create(long address) {
return new FT_BitmapGlyph(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_BitmapGlyph createSafe(long address) {
return address == NULL ? null : new FT_BitmapGlyph(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #root}. */
public static FT_Glyph nroot(long struct) { return FT_Glyph.create(struct + FT_BitmapGlyph.ROOT); }
/** Unsafe version of {@link #left}. */
public static int nleft(long struct) { return UNSAFE.getInt(null, struct + FT_BitmapGlyph.LEFT); }
/** Unsafe version of {@link #top}. */
public static int ntop(long struct) { return UNSAFE.getInt(null, struct + FT_BitmapGlyph.TOP); }
/** Unsafe version of {@link #bitmap}. */
public static FT_Bitmap nbitmap(long struct) { return FT_Bitmap.create(struct + FT_BitmapGlyph.BITMAP); }
// -----------------------------------
/** An array of {@link FT_BitmapGlyph} structs. */
public static class Buffer extends StructBuffer<FT_BitmapGlyph, Buffer> {
private static final FT_BitmapGlyph ELEMENT_FACTORY = FT_BitmapGlyph.create(-1L);
/**
* Creates a new {@code FT_BitmapGlyph.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_BitmapGlyph#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_BitmapGlyph getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_Glyph} view of the {@code root} field. */
@NativeType("FT_GlyphRec")
public FT_Glyph root() { return FT_BitmapGlyph.nroot(address()); }
/** @return the value of the {@code left} field. */
@NativeType("FT_Int")
public int left() { return FT_BitmapGlyph.nleft(address()); }
/** @return the value of the {@code top} field. */
@NativeType("FT_Int")
public int top() { return FT_BitmapGlyph.ntop(address()); }
/** @return a {@link FT_Bitmap} view of the {@code bitmap} field. */
public FT_Bitmap bitmap() { return FT_BitmapGlyph.nbitmap(address()); }
}
}

View File

@ -0,0 +1,212 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* This structure models the metrics of a bitmap strike (i.e., a set of glyphs for a given point size and resolution) in a bitmap font. It
* is used for the {@code available_sizes} field of {@code FT_Face}.
*
* <div style="margin-left: 26px; border-left: 1px solid gray; padding-left: 14px;"><h5>Note</h5>
*
* <p>Windows FNT: The nominal size given in a FNT font is not reliable. If the driver finds it incorrect, it sets {@code size} to some calculated
* values, and {@code x_ppem} and {@code y_ppem} to the pixel width and height given in the font, respectively.</p></div>
*
* <div style="margin-left: 26px; border-left: 1px solid gray; padding-left: 14px;"><h5>Note</h5>
*
* <p>TrueType embedded bitmaps: {@code size}, {@code width}, and {@code height} values are not contained in the bitmap strike itself. They are
* computed from the global font parameters.</p></div>
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Bitmap_Size {
* FT_Short {@link #height};
* FT_Short {@link #width};
* FT_Pos {@link #size};
* FT_Pos {@link #x_ppem};
* FT_Pos {@link #y_ppem};
* }</code></pre>
*/
public class FT_Bitmap_Size extends Struct<FT_Bitmap_Size> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
HEIGHT,
WIDTH,
SIZE,
X_PPEM,
Y_PPEM;
static {
Layout layout = __struct(
__member(2),
__member(2),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
HEIGHT = layout.offsetof(0);
WIDTH = layout.offsetof(1);
SIZE = layout.offsetof(2);
X_PPEM = layout.offsetof(3);
Y_PPEM = layout.offsetof(4);
}
protected FT_Bitmap_Size(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Bitmap_Size create(long address, @Nullable ByteBuffer container) {
return new FT_Bitmap_Size(address, container);
}
/**
* Creates a {@code FT_Bitmap_Size} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Bitmap_Size(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** the vertical distance, in pixels, between two consecutive baselines. It is always positive. */
@NativeType("FT_Short")
public short height() { return nheight(address()); }
/** the average width, in pixels, of all glyphs in the strike */
@NativeType("FT_Short")
public short width() { return nwidth(address()); }
/** the nominal size of the strike in 26.6 fractional points. This field is not very useful. */
@NativeType("FT_Pos")
public long size() { return nsize(address()); }
/** the horizontal ppem (nominal width) in 26.6 fractional pixels */
@NativeType("FT_Pos")
public long x_ppem() { return nx_ppem(address()); }
/** the vertical ppem (nominal height) in 26.6 fractional pixels */
@NativeType("FT_Pos")
public long y_ppem() { return ny_ppem(address()); }
// -----------------------------------
/** Returns a new {@code FT_Bitmap_Size} instance for the specified memory address. */
public static FT_Bitmap_Size create(long address) {
return new FT_Bitmap_Size(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Bitmap_Size createSafe(long address) {
return address == NULL ? null : new FT_Bitmap_Size(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #height}. */
public static short nheight(long struct) { return UNSAFE.getShort(null, struct + FT_Bitmap_Size.HEIGHT); }
/** Unsafe version of {@link #width}. */
public static short nwidth(long struct) { return UNSAFE.getShort(null, struct + FT_Bitmap_Size.WIDTH); }
/** Unsafe version of {@link #size}. */
public static long nsize(long struct) { return memGetCLong(struct + FT_Bitmap_Size.SIZE); }
/** Unsafe version of {@link #x_ppem}. */
public static long nx_ppem(long struct) { return memGetCLong(struct + FT_Bitmap_Size.X_PPEM); }
/** Unsafe version of {@link #y_ppem}. */
public static long ny_ppem(long struct) { return memGetCLong(struct + FT_Bitmap_Size.Y_PPEM); }
// -----------------------------------
/** An array of {@link FT_Bitmap_Size} structs. */
public static class Buffer extends StructBuffer<FT_Bitmap_Size, Buffer> {
private static final FT_Bitmap_Size ELEMENT_FACTORY = FT_Bitmap_Size.create(-1L);
/**
* Creates a new {@code FT_Bitmap_Size.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Bitmap_Size#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Bitmap_Size getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@link FT_Bitmap_Size#height} field. */
@NativeType("FT_Short")
public short height() { return FT_Bitmap_Size.nheight(address()); }
/** @return the value of the {@link FT_Bitmap_Size#width} field. */
@NativeType("FT_Short")
public short width() { return FT_Bitmap_Size.nwidth(address()); }
/** @return the value of the {@link FT_Bitmap_Size#size} field. */
@NativeType("FT_Pos")
public long size() { return FT_Bitmap_Size.nsize(address()); }
/** @return the value of the {@link FT_Bitmap_Size#x_ppem} field. */
@NativeType("FT_Pos")
public long x_ppem() { return FT_Bitmap_Size.nx_ppem(address()); }
/** @return the value of the {@link FT_Bitmap_Size#y_ppem} field. */
@NativeType("FT_Pos")
public long y_ppem() { return FT_Bitmap_Size.ny_ppem(address()); }
}
}

View File

@ -0,0 +1,373 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* A union object representing format and details of a paint table of a {@code COLR} v1 font.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_COLR_Paint {
* FT_PaintFormat format;
* union {
* {@link FT_PaintColrLayers FT_PaintColrLayers} colr_layers;
* {@link FT_PaintGlyph FT_PaintGlyph} glyph;
* {@link FT_PaintSolid FT_PaintSolid} solid;
* {@link FT_PaintLinearGradient FT_PaintLinearGradient} linear_gradient;
* {@link FT_PaintRadialGradient FT_PaintRadialGradient} radial_gradient;
* {@link FT_PaintSweepGradient FT_PaintSweepGradient} sweep_gradient;
* {@link FT_PaintTransform FT_PaintTransform} transform;
* {@link FT_PaintTranslate FT_PaintTranslate} translate;
* {@link FT_PaintScale FT_PaintScale} scale;
* {@link FT_PaintRotate FT_PaintRotate} rotate;
* {@link FT_PaintSkew FT_PaintSkew} skew;
* {@link FT_PaintComposite FT_PaintComposite} composite;
* {@link FT_PaintColrGlyph FT_PaintColrGlyph} colr_glyph;
* } u;
* }</code></pre>
*/
public class FT_COLR_Paint extends Struct<FT_COLR_Paint> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
FORMAT,
U,
U_COLR_LAYERS,
U_GLYPH,
U_SOLID,
U_LINEAR_GRADIENT,
U_RADIAL_GRADIENT,
U_SWEEP_GRADIENT,
U_TRANSFORM,
U_TRANSLATE,
U_SCALE,
U_ROTATE,
U_SKEW,
U_COMPOSITE,
U_COLR_GLYPH;
static {
Layout layout = __struct(
__member(4),
__union(
__member(FT_PaintColrLayers.SIZEOF, FT_PaintColrLayers.ALIGNOF),
__member(FT_PaintGlyph.SIZEOF, FT_PaintGlyph.ALIGNOF),
__member(FT_PaintSolid.SIZEOF, FT_PaintSolid.ALIGNOF),
__member(FT_PaintLinearGradient.SIZEOF, FT_PaintLinearGradient.ALIGNOF),
__member(FT_PaintRadialGradient.SIZEOF, FT_PaintRadialGradient.ALIGNOF),
__member(FT_PaintSweepGradient.SIZEOF, FT_PaintSweepGradient.ALIGNOF),
__member(FT_PaintTransform.SIZEOF, FT_PaintTransform.ALIGNOF),
__member(FT_PaintTranslate.SIZEOF, FT_PaintTranslate.ALIGNOF),
__member(FT_PaintScale.SIZEOF, FT_PaintScale.ALIGNOF),
__member(FT_PaintRotate.SIZEOF, FT_PaintRotate.ALIGNOF),
__member(FT_PaintSkew.SIZEOF, FT_PaintSkew.ALIGNOF),
__member(FT_PaintComposite.SIZEOF, FT_PaintComposite.ALIGNOF),
__member(FT_PaintColrGlyph.SIZEOF, FT_PaintColrGlyph.ALIGNOF)
)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
FORMAT = layout.offsetof(0);
U = layout.offsetof(1);
U_COLR_LAYERS = layout.offsetof(2);
U_GLYPH = layout.offsetof(3);
U_SOLID = layout.offsetof(4);
U_LINEAR_GRADIENT = layout.offsetof(5);
U_RADIAL_GRADIENT = layout.offsetof(6);
U_SWEEP_GRADIENT = layout.offsetof(7);
U_TRANSFORM = layout.offsetof(8);
U_TRANSLATE = layout.offsetof(9);
U_SCALE = layout.offsetof(10);
U_ROTATE = layout.offsetof(11);
U_SKEW = layout.offsetof(12);
U_COMPOSITE = layout.offsetof(13);
U_COLR_GLYPH = layout.offsetof(14);
}
protected FT_COLR_Paint(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_COLR_Paint create(long address, @Nullable ByteBuffer container) {
return new FT_COLR_Paint(address, container);
}
/**
* Creates a {@code FT_COLR_Paint} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_COLR_Paint(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code format} field. */
@NativeType("FT_PaintFormat")
public int format() { return nformat(address()); }
/** @return a {@link FT_PaintColrLayers} view of the {@code u.colr_layers} field. */
public FT_PaintColrLayers u_colr_layers() { return nu_colr_layers(address()); }
/** @return a {@link FT_PaintGlyph} view of the {@code u.glyph} field. */
public FT_PaintGlyph u_glyph() { return nu_glyph(address()); }
/** @return a {@link FT_PaintSolid} view of the {@code u.solid} field. */
public FT_PaintSolid u_solid() { return nu_solid(address()); }
/** @return a {@link FT_PaintLinearGradient} view of the {@code u.linear_gradient} field. */
public FT_PaintLinearGradient u_linear_gradient() { return nu_linear_gradient(address()); }
/** @return a {@link FT_PaintRadialGradient} view of the {@code u.radial_gradient} field. */
public FT_PaintRadialGradient u_radial_gradient() { return nu_radial_gradient(address()); }
/** @return a {@link FT_PaintSweepGradient} view of the {@code u.sweep_gradient} field. */
public FT_PaintSweepGradient u_sweep_gradient() { return nu_sweep_gradient(address()); }
/** @return a {@link FT_PaintTransform} view of the {@code u.transform} field. */
public FT_PaintTransform u_transform() { return nu_transform(address()); }
/** @return a {@link FT_PaintTranslate} view of the {@code u.translate} field. */
public FT_PaintTranslate u_translate() { return nu_translate(address()); }
/** @return a {@link FT_PaintScale} view of the {@code u.scale} field. */
public FT_PaintScale u_scale() { return nu_scale(address()); }
/** @return a {@link FT_PaintRotate} view of the {@code u.rotate} field. */
public FT_PaintRotate u_rotate() { return nu_rotate(address()); }
/** @return a {@link FT_PaintSkew} view of the {@code u.skew} field. */
public FT_PaintSkew u_skew() { return nu_skew(address()); }
/** @return a {@link FT_PaintComposite} view of the {@code u.composite} field. */
public FT_PaintComposite u_composite() { return nu_composite(address()); }
/** @return a {@link FT_PaintColrGlyph} view of the {@code u.colr_glyph} field. */
public FT_PaintColrGlyph u_colr_glyph() { return nu_colr_glyph(address()); }
// -----------------------------------
/** Returns a new {@code FT_COLR_Paint} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_COLR_Paint malloc() {
return new FT_COLR_Paint(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_COLR_Paint} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_COLR_Paint calloc() {
return new FT_COLR_Paint(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_COLR_Paint} instance allocated with {@link BufferUtils}. */
public static FT_COLR_Paint create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_COLR_Paint(memAddress(container), container);
}
/** Returns a new {@code FT_COLR_Paint} instance for the specified memory address. */
public static FT_COLR_Paint create(long address) {
return new FT_COLR_Paint(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_COLR_Paint createSafe(long address) {
return address == NULL ? null : new FT_COLR_Paint(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_COLR_Paint} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_COLR_Paint malloc(MemoryStack stack) {
return new FT_COLR_Paint(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_COLR_Paint} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_COLR_Paint calloc(MemoryStack stack) {
return new FT_COLR_Paint(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #format}. */
public static int nformat(long struct) { return UNSAFE.getInt(null, struct + FT_COLR_Paint.FORMAT); }
/** Unsafe version of {@link #u_colr_layers}. */
public static FT_PaintColrLayers nu_colr_layers(long struct) { return FT_PaintColrLayers.create(struct + FT_COLR_Paint.U_COLR_LAYERS); }
/** Unsafe version of {@link #u_glyph}. */
public static FT_PaintGlyph nu_glyph(long struct) { return FT_PaintGlyph.create(struct + FT_COLR_Paint.U_GLYPH); }
/** Unsafe version of {@link #u_solid}. */
public static FT_PaintSolid nu_solid(long struct) { return FT_PaintSolid.create(struct + FT_COLR_Paint.U_SOLID); }
/** Unsafe version of {@link #u_linear_gradient}. */
public static FT_PaintLinearGradient nu_linear_gradient(long struct) { return FT_PaintLinearGradient.create(struct + FT_COLR_Paint.U_LINEAR_GRADIENT); }
/** Unsafe version of {@link #u_radial_gradient}. */
public static FT_PaintRadialGradient nu_radial_gradient(long struct) { return FT_PaintRadialGradient.create(struct + FT_COLR_Paint.U_RADIAL_GRADIENT); }
/** Unsafe version of {@link #u_sweep_gradient}. */
public static FT_PaintSweepGradient nu_sweep_gradient(long struct) { return FT_PaintSweepGradient.create(struct + FT_COLR_Paint.U_SWEEP_GRADIENT); }
/** Unsafe version of {@link #u_transform}. */
public static FT_PaintTransform nu_transform(long struct) { return FT_PaintTransform.create(struct + FT_COLR_Paint.U_TRANSFORM); }
/** Unsafe version of {@link #u_translate}. */
public static FT_PaintTranslate nu_translate(long struct) { return FT_PaintTranslate.create(struct + FT_COLR_Paint.U_TRANSLATE); }
/** Unsafe version of {@link #u_scale}. */
public static FT_PaintScale nu_scale(long struct) { return FT_PaintScale.create(struct + FT_COLR_Paint.U_SCALE); }
/** Unsafe version of {@link #u_rotate}. */
public static FT_PaintRotate nu_rotate(long struct) { return FT_PaintRotate.create(struct + FT_COLR_Paint.U_ROTATE); }
/** Unsafe version of {@link #u_skew}. */
public static FT_PaintSkew nu_skew(long struct) { return FT_PaintSkew.create(struct + FT_COLR_Paint.U_SKEW); }
/** Unsafe version of {@link #u_composite}. */
public static FT_PaintComposite nu_composite(long struct) { return FT_PaintComposite.create(struct + FT_COLR_Paint.U_COMPOSITE); }
/** Unsafe version of {@link #u_colr_glyph}. */
public static FT_PaintColrGlyph nu_colr_glyph(long struct) { return FT_PaintColrGlyph.create(struct + FT_COLR_Paint.U_COLR_GLYPH); }
// -----------------------------------
/** An array of {@link FT_COLR_Paint} structs. */
public static class Buffer extends StructBuffer<FT_COLR_Paint, Buffer> implements NativeResource {
private static final FT_COLR_Paint ELEMENT_FACTORY = FT_COLR_Paint.create(-1L);
/**
* Creates a new {@code FT_COLR_Paint.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_COLR_Paint#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_COLR_Paint getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code format} field. */
@NativeType("FT_PaintFormat")
public int format() { return FT_COLR_Paint.nformat(address()); }
/** @return a {@link FT_PaintColrLayers} view of the {@code u.colr_layers} field. */
public FT_PaintColrLayers u_colr_layers() { return FT_COLR_Paint.nu_colr_layers(address()); }
/** @return a {@link FT_PaintGlyph} view of the {@code u.glyph} field. */
public FT_PaintGlyph u_glyph() { return FT_COLR_Paint.nu_glyph(address()); }
/** @return a {@link FT_PaintSolid} view of the {@code u.solid} field. */
public FT_PaintSolid u_solid() { return FT_COLR_Paint.nu_solid(address()); }
/** @return a {@link FT_PaintLinearGradient} view of the {@code u.linear_gradient} field. */
public FT_PaintLinearGradient u_linear_gradient() { return FT_COLR_Paint.nu_linear_gradient(address()); }
/** @return a {@link FT_PaintRadialGradient} view of the {@code u.radial_gradient} field. */
public FT_PaintRadialGradient u_radial_gradient() { return FT_COLR_Paint.nu_radial_gradient(address()); }
/** @return a {@link FT_PaintSweepGradient} view of the {@code u.sweep_gradient} field. */
public FT_PaintSweepGradient u_sweep_gradient() { return FT_COLR_Paint.nu_sweep_gradient(address()); }
/** @return a {@link FT_PaintTransform} view of the {@code u.transform} field. */
public FT_PaintTransform u_transform() { return FT_COLR_Paint.nu_transform(address()); }
/** @return a {@link FT_PaintTranslate} view of the {@code u.translate} field. */
public FT_PaintTranslate u_translate() { return FT_COLR_Paint.nu_translate(address()); }
/** @return a {@link FT_PaintScale} view of the {@code u.scale} field. */
public FT_PaintScale u_scale() { return FT_COLR_Paint.nu_scale(address()); }
/** @return a {@link FT_PaintRotate} view of the {@code u.rotate} field. */
public FT_PaintRotate u_rotate() { return FT_COLR_Paint.nu_rotate(address()); }
/** @return a {@link FT_PaintSkew} view of the {@code u.skew} field. */
public FT_PaintSkew u_skew() { return FT_COLR_Paint.nu_skew(address()); }
/** @return a {@link FT_PaintComposite} view of the {@code u.composite} field. */
public FT_PaintComposite u_composite() { return FT_COLR_Paint.nu_composite(address()); }
/** @return a {@link FT_PaintColrGlyph} view of the {@code u.colr_glyph} field. */
public FT_PaintColrGlyph u_colr_glyph() { return FT_COLR_Paint.nu_colr_glyph(address()); }
}
}

View File

@ -0,0 +1,191 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* The base charmap structure.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_CharMapRec {
* {@link FT_Face FT_Face} {@link #face};
* FT_Encoding {@link #encoding};
* FT_UShort {@link #platform_id};
* FT_UShort {@link #encoding_id};
* }</code></pre>
*/
@NativeType("struct FT_CharMapRec")
public class FT_CharMap extends Struct<FT_CharMap> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
FACE,
ENCODING,
PLATFORM_ID,
ENCODING_ID;
static {
Layout layout = __struct(
__member(POINTER_SIZE),
__member(4),
__member(2),
__member(2)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
FACE = layout.offsetof(0);
ENCODING = layout.offsetof(1);
PLATFORM_ID = layout.offsetof(2);
ENCODING_ID = layout.offsetof(3);
}
protected FT_CharMap(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_CharMap create(long address, @Nullable ByteBuffer container) {
return new FT_CharMap(address, container);
}
/**
* Creates a {@code FT_CharMap} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_CharMap(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** a handle to the parent face object */
public FT_Face face() { return nface(address()); }
/** an {@code FT_Encoding} tag identifying the charmap. Use this with {@link FreeType#FT_Select_Charmap Select_Charmap}. */
@NativeType("FT_Encoding")
public int encoding() { return nencoding(address()); }
/**
* an ID number describing the platform for the following encoding ID. This comes directly from the TrueType specification and gets emulated for other
* formats.
*/
@NativeType("FT_UShort")
public short platform_id() { return nplatform_id(address()); }
/** a platform-specific encoding number. This also comes from the TrueType specification and gets emulated similarly. */
@NativeType("FT_UShort")
public short encoding_id() { return nencoding_id(address()); }
// -----------------------------------
/** Returns a new {@code FT_CharMap} instance for the specified memory address. */
public static FT_CharMap create(long address) {
return new FT_CharMap(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_CharMap createSafe(long address) {
return address == NULL ? null : new FT_CharMap(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #face}. */
public static FT_Face nface(long struct) { return FT_Face.create(memGetAddress(struct + FT_CharMap.FACE)); }
/** Unsafe version of {@link #encoding}. */
public static int nencoding(long struct) { return UNSAFE.getInt(null, struct + FT_CharMap.ENCODING); }
/** Unsafe version of {@link #platform_id}. */
public static short nplatform_id(long struct) { return UNSAFE.getShort(null, struct + FT_CharMap.PLATFORM_ID); }
/** Unsafe version of {@link #encoding_id}. */
public static short nencoding_id(long struct) { return UNSAFE.getShort(null, struct + FT_CharMap.ENCODING_ID); }
// -----------------------------------
/** An array of {@link FT_CharMap} structs. */
public static class Buffer extends StructBuffer<FT_CharMap, Buffer> {
private static final FT_CharMap ELEMENT_FACTORY = FT_CharMap.create(-1L);
/**
* Creates a new {@code FT_CharMap.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_CharMap#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_CharMap getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_Face} view of the struct pointed to by the {@link FT_CharMap#face} field. */
public FT_Face face() { return FT_CharMap.nface(address()); }
/** @return the value of the {@link FT_CharMap#encoding} field. */
@NativeType("FT_Encoding")
public int encoding() { return FT_CharMap.nencoding(address()); }
/** @return the value of the {@link FT_CharMap#platform_id} field. */
@NativeType("FT_UShort")
public short platform_id() { return FT_CharMap.nplatform_id(address()); }
/** @return the value of the {@link FT_CharMap#encoding_id} field. */
@NativeType("FT_UShort")
public short encoding_id() { return FT_CharMap.nencoding_id(address()); }
}
}

View File

@ -0,0 +1,265 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* A structure representing a {@code COLR} v1 {@code ClipBox} table.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_ClipBox {
* {@link FT_Vector FT_Vector} bottom_left;
* {@link FT_Vector FT_Vector} top_left;
* {@link FT_Vector FT_Vector} top_right;
* {@link FT_Vector FT_Vector} bottom_right;
* }</code></pre>
*/
public class FT_ClipBox extends Struct<FT_ClipBox> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
BOTTOM_LEFT,
TOP_LEFT,
TOP_RIGHT,
BOTTOM_RIGHT;
static {
Layout layout = __struct(
__member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF),
__member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF),
__member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF),
__member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
BOTTOM_LEFT = layout.offsetof(0);
TOP_LEFT = layout.offsetof(1);
TOP_RIGHT = layout.offsetof(2);
BOTTOM_RIGHT = layout.offsetof(3);
}
protected FT_ClipBox(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_ClipBox create(long address, @Nullable ByteBuffer container) {
return new FT_ClipBox(address, container);
}
/**
* Creates a {@code FT_ClipBox} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_ClipBox(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link FT_Vector} view of the {@code bottom_left} field. */
public FT_Vector bottom_left() { return nbottom_left(address()); }
/** @return a {@link FT_Vector} view of the {@code top_left} field. */
public FT_Vector top_left() { return ntop_left(address()); }
/** @return a {@link FT_Vector} view of the {@code top_right} field. */
public FT_Vector top_right() { return ntop_right(address()); }
/** @return a {@link FT_Vector} view of the {@code bottom_right} field. */
public FT_Vector bottom_right() { return nbottom_right(address()); }
// -----------------------------------
/** Returns a new {@code FT_ClipBox} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_ClipBox malloc() {
return new FT_ClipBox(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_ClipBox} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_ClipBox calloc() {
return new FT_ClipBox(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_ClipBox} instance allocated with {@link BufferUtils}. */
public static FT_ClipBox create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_ClipBox(memAddress(container), container);
}
/** Returns a new {@code FT_ClipBox} instance for the specified memory address. */
public static FT_ClipBox create(long address) {
return new FT_ClipBox(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_ClipBox createSafe(long address) {
return address == NULL ? null : new FT_ClipBox(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_ClipBox} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_ClipBox malloc(MemoryStack stack) {
return new FT_ClipBox(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_ClipBox} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_ClipBox calloc(MemoryStack stack) {
return new FT_ClipBox(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #bottom_left}. */
public static FT_Vector nbottom_left(long struct) { return FT_Vector.create(struct + FT_ClipBox.BOTTOM_LEFT); }
/** Unsafe version of {@link #top_left}. */
public static FT_Vector ntop_left(long struct) { return FT_Vector.create(struct + FT_ClipBox.TOP_LEFT); }
/** Unsafe version of {@link #top_right}. */
public static FT_Vector ntop_right(long struct) { return FT_Vector.create(struct + FT_ClipBox.TOP_RIGHT); }
/** Unsafe version of {@link #bottom_right}. */
public static FT_Vector nbottom_right(long struct) { return FT_Vector.create(struct + FT_ClipBox.BOTTOM_RIGHT); }
// -----------------------------------
/** An array of {@link FT_ClipBox} structs. */
public static class Buffer extends StructBuffer<FT_ClipBox, Buffer> implements NativeResource {
private static final FT_ClipBox ELEMENT_FACTORY = FT_ClipBox.create(-1L);
/**
* Creates a new {@code FT_ClipBox.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_ClipBox#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_ClipBox getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_Vector} view of the {@code bottom_left} field. */
public FT_Vector bottom_left() { return FT_ClipBox.nbottom_left(address()); }
/** @return a {@link FT_Vector} view of the {@code top_left} field. */
public FT_Vector top_left() { return FT_ClipBox.ntop_left(address()); }
/** @return a {@link FT_Vector} view of the {@code top_right} field. */
public FT_Vector top_right() { return FT_ClipBox.ntop_right(address()); }
/** @return a {@link FT_Vector} view of the {@code bottom_right} field. */
public FT_Vector bottom_right() { return FT_ClipBox.nbottom_right(address()); }
}
}

View File

@ -0,0 +1,327 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* This structure models a BGRA color value of a {@code CPAL} palette entry.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Color {
* FT_Byte blue;
* FT_Byte green;
* FT_Byte red;
* FT_Byte alpha;
* }</code></pre>
*/
public class FT_Color extends Struct<FT_Color> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
BLUE,
GREEN,
RED,
ALPHA;
static {
Layout layout = __struct(
__member(1),
__member(1),
__member(1),
__member(1)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
BLUE = layout.offsetof(0);
GREEN = layout.offsetof(1);
RED = layout.offsetof(2);
ALPHA = layout.offsetof(3);
}
protected FT_Color(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Color create(long address, @Nullable ByteBuffer container) {
return new FT_Color(address, container);
}
/**
* Creates a {@code FT_Color} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Color(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code blue} field. */
@NativeType("FT_Byte")
public byte blue() { return nblue(address()); }
/** @return the value of the {@code green} field. */
@NativeType("FT_Byte")
public byte green() { return ngreen(address()); }
/** @return the value of the {@code red} field. */
@NativeType("FT_Byte")
public byte red() { return nred(address()); }
/** @return the value of the {@code alpha} field. */
@NativeType("FT_Byte")
public byte alpha() { return nalpha(address()); }
/** Sets the specified value to the {@code blue} field. */
public FT_Color blue(@NativeType("FT_Byte") byte value) { nblue(address(), value); return this; }
/** Sets the specified value to the {@code green} field. */
public FT_Color green(@NativeType("FT_Byte") byte value) { ngreen(address(), value); return this; }
/** Sets the specified value to the {@code red} field. */
public FT_Color red(@NativeType("FT_Byte") byte value) { nred(address(), value); return this; }
/** Sets the specified value to the {@code alpha} field. */
public FT_Color alpha(@NativeType("FT_Byte") byte value) { nalpha(address(), value); return this; }
/** Initializes this struct with the specified values. */
public FT_Color set(
byte blue,
byte green,
byte red,
byte alpha
) {
blue(blue);
green(green);
red(red);
alpha(alpha);
return this;
}
/**
* Copies the specified struct data to this struct.
*
* @param src the source struct
*
* @return this struct
*/
public FT_Color set(FT_Color src) {
memCopy(src.address(), address(), SIZEOF);
return this;
}
// -----------------------------------
/** Returns a new {@code FT_Color} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_Color malloc() {
return new FT_Color(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_Color} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_Color calloc() {
return new FT_Color(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_Color} instance allocated with {@link BufferUtils}. */
public static FT_Color create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_Color(memAddress(container), container);
}
/** Returns a new {@code FT_Color} instance for the specified memory address. */
public static FT_Color create(long address) {
return new FT_Color(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Color createSafe(long address) {
return address == NULL ? null : new FT_Color(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_Color} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_Color malloc(MemoryStack stack) {
return new FT_Color(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_Color} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_Color calloc(MemoryStack stack) {
return new FT_Color(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #blue}. */
public static byte nblue(long struct) { return UNSAFE.getByte(null, struct + FT_Color.BLUE); }
/** Unsafe version of {@link #green}. */
public static byte ngreen(long struct) { return UNSAFE.getByte(null, struct + FT_Color.GREEN); }
/** Unsafe version of {@link #red}. */
public static byte nred(long struct) { return UNSAFE.getByte(null, struct + FT_Color.RED); }
/** Unsafe version of {@link #alpha}. */
public static byte nalpha(long struct) { return UNSAFE.getByte(null, struct + FT_Color.ALPHA); }
/** Unsafe version of {@link #blue(byte) blue}. */
public static void nblue(long struct, byte value) { UNSAFE.putByte(null, struct + FT_Color.BLUE, value); }
/** Unsafe version of {@link #green(byte) green}. */
public static void ngreen(long struct, byte value) { UNSAFE.putByte(null, struct + FT_Color.GREEN, value); }
/** Unsafe version of {@link #red(byte) red}. */
public static void nred(long struct, byte value) { UNSAFE.putByte(null, struct + FT_Color.RED, value); }
/** Unsafe version of {@link #alpha(byte) alpha}. */
public static void nalpha(long struct, byte value) { UNSAFE.putByte(null, struct + FT_Color.ALPHA, value); }
// -----------------------------------
/** An array of {@link FT_Color} structs. */
public static class Buffer extends StructBuffer<FT_Color, Buffer> implements NativeResource {
private static final FT_Color ELEMENT_FACTORY = FT_Color.create(-1L);
/**
* Creates a new {@code FT_Color.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Color#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Color getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code blue} field. */
@NativeType("FT_Byte")
public byte blue() { return FT_Color.nblue(address()); }
/** @return the value of the {@code green} field. */
@NativeType("FT_Byte")
public byte green() { return FT_Color.ngreen(address()); }
/** @return the value of the {@code red} field. */
@NativeType("FT_Byte")
public byte red() { return FT_Color.nred(address()); }
/** @return the value of the {@code alpha} field. */
@NativeType("FT_Byte")
public byte alpha() { return FT_Color.nalpha(address()); }
/** Sets the specified value to the {@code blue} field. */
public Buffer blue(@NativeType("FT_Byte") byte value) { FT_Color.nblue(address(), value); return this; }
/** Sets the specified value to the {@code green} field. */
public Buffer green(@NativeType("FT_Byte") byte value) { FT_Color.ngreen(address(), value); return this; }
/** Sets the specified value to the {@code red} field. */
public Buffer red(@NativeType("FT_Byte") byte value) { FT_Color.nred(address(), value); return this; }
/** Sets the specified value to the {@code alpha} field. */
public Buffer alpha(@NativeType("FT_Byte") byte value) { FT_Color.nalpha(address(), value); return this; }
}
}

View File

@ -0,0 +1,165 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure representing a {@code ColorIndex} value of the {@code COLR} v1 extensions.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_ColorIndex {
* FT_UInt16 palette_index;
* FT_F2Dot14 alpha;
* }</code></pre>
*/
public class FT_ColorIndex extends Struct<FT_ColorIndex> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
PALETTE_INDEX,
ALPHA;
static {
Layout layout = __struct(
__member(2),
__member(2)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
PALETTE_INDEX = layout.offsetof(0);
ALPHA = layout.offsetof(1);
}
protected FT_ColorIndex(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_ColorIndex create(long address, @Nullable ByteBuffer container) {
return new FT_ColorIndex(address, container);
}
/**
* Creates a {@code FT_ColorIndex} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_ColorIndex(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code palette_index} field. */
@NativeType("FT_UInt16")
public short palette_index() { return npalette_index(address()); }
/** @return the value of the {@code alpha} field. */
@NativeType("FT_F2Dot14")
public short alpha() { return nalpha(address()); }
// -----------------------------------
/** Returns a new {@code FT_ColorIndex} instance for the specified memory address. */
public static FT_ColorIndex create(long address) {
return new FT_ColorIndex(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_ColorIndex createSafe(long address) {
return address == NULL ? null : new FT_ColorIndex(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #palette_index}. */
public static short npalette_index(long struct) { return UNSAFE.getShort(null, struct + FT_ColorIndex.PALETTE_INDEX); }
/** Unsafe version of {@link #alpha}. */
public static short nalpha(long struct) { return UNSAFE.getShort(null, struct + FT_ColorIndex.ALPHA); }
// -----------------------------------
/** An array of {@link FT_ColorIndex} structs. */
public static class Buffer extends StructBuffer<FT_ColorIndex, Buffer> {
private static final FT_ColorIndex ELEMENT_FACTORY = FT_ColorIndex.create(-1L);
/**
* Creates a new {@code FT_ColorIndex.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_ColorIndex#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_ColorIndex getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code palette_index} field. */
@NativeType("FT_UInt16")
public short palette_index() { return FT_ColorIndex.npalette_index(address()); }
/** @return the value of the {@code alpha} field. */
@NativeType("FT_F2Dot14")
public short alpha() { return FT_ColorIndex.nalpha(address()); }
}
}

View File

@ -0,0 +1,163 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure representing a {@code ColorLine} value of the {@code COLR} v1 extensions.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_ColorLine {
* FT_PaintExtend extend;
* {@link FT_ColorStopIterator FT_ColorStopIterator} color_stop_iterator;
* }</code></pre>
*/
public class FT_ColorLine extends Struct<FT_ColorLine> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
EXTEND,
COLOR_STOP_ITERATOR;
static {
Layout layout = __struct(
__member(4),
__member(FT_ColorStopIterator.SIZEOF, FT_ColorStopIterator.ALIGNOF)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
EXTEND = layout.offsetof(0);
COLOR_STOP_ITERATOR = layout.offsetof(1);
}
protected FT_ColorLine(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_ColorLine create(long address, @Nullable ByteBuffer container) {
return new FT_ColorLine(address, container);
}
/**
* Creates a {@code FT_ColorLine} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_ColorLine(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code extend} field. */
@NativeType("FT_PaintExtend")
public int extend() { return nextend(address()); }
/** @return a {@link FT_ColorStopIterator} view of the {@code color_stop_iterator} field. */
public FT_ColorStopIterator color_stop_iterator() { return ncolor_stop_iterator(address()); }
// -----------------------------------
/** Returns a new {@code FT_ColorLine} instance for the specified memory address. */
public static FT_ColorLine create(long address) {
return new FT_ColorLine(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_ColorLine createSafe(long address) {
return address == NULL ? null : new FT_ColorLine(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #extend}. */
public static int nextend(long struct) { return UNSAFE.getInt(null, struct + FT_ColorLine.EXTEND); }
/** Unsafe version of {@link #color_stop_iterator}. */
public static FT_ColorStopIterator ncolor_stop_iterator(long struct) { return FT_ColorStopIterator.create(struct + FT_ColorLine.COLOR_STOP_ITERATOR); }
// -----------------------------------
/** An array of {@link FT_ColorLine} structs. */
public static class Buffer extends StructBuffer<FT_ColorLine, Buffer> {
private static final FT_ColorLine ELEMENT_FACTORY = FT_ColorLine.create(-1L);
/**
* Creates a new {@code FT_ColorLine.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_ColorLine#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_ColorLine getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code extend} field. */
@NativeType("FT_PaintExtend")
public int extend() { return FT_ColorLine.nextend(address()); }
/** @return a {@link FT_ColorStopIterator} view of the {@code color_stop_iterator} field. */
public FT_ColorStopIterator color_stop_iterator() { return FT_ColorLine.ncolor_stop_iterator(address()); }
}
}

View File

@ -0,0 +1,247 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* A structure representing a {@code ColorStop} value of the 'COLR' v1 extensions.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_ColorStop {
* FT_Fixed stop_offset;
* {@link FT_ColorIndex FT_ColorIndex} color;
* }</code></pre>
*/
public class FT_ColorStop extends Struct<FT_ColorStop> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
STOP_OFFSET,
COLOR;
static {
Layout layout = __struct(
__member(CLONG_SIZE),
__member(FT_ColorIndex.SIZEOF, FT_ColorIndex.ALIGNOF)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
STOP_OFFSET = layout.offsetof(0);
COLOR = layout.offsetof(1);
}
protected FT_ColorStop(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_ColorStop create(long address, @Nullable ByteBuffer container) {
return new FT_ColorStop(address, container);
}
/**
* Creates a {@code FT_ColorStop} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_ColorStop(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code stop_offset} field. */
@NativeType("FT_Fixed")
public long stop_offset() { return nstop_offset(address()); }
/** @return a {@link FT_ColorIndex} view of the {@code color} field. */
public FT_ColorIndex color() { return ncolor(address()); }
// -----------------------------------
/** Returns a new {@code FT_ColorStop} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_ColorStop malloc() {
return new FT_ColorStop(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_ColorStop} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_ColorStop calloc() {
return new FT_ColorStop(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_ColorStop} instance allocated with {@link BufferUtils}. */
public static FT_ColorStop create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_ColorStop(memAddress(container), container);
}
/** Returns a new {@code FT_ColorStop} instance for the specified memory address. */
public static FT_ColorStop create(long address) {
return new FT_ColorStop(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_ColorStop createSafe(long address) {
return address == NULL ? null : new FT_ColorStop(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_ColorStop} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_ColorStop malloc(MemoryStack stack) {
return new FT_ColorStop(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_ColorStop} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_ColorStop calloc(MemoryStack stack) {
return new FT_ColorStop(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #stop_offset}. */
public static long nstop_offset(long struct) { return memGetCLong(struct + FT_ColorStop.STOP_OFFSET); }
/** Unsafe version of {@link #color}. */
public static FT_ColorIndex ncolor(long struct) { return FT_ColorIndex.create(struct + FT_ColorStop.COLOR); }
// -----------------------------------
/** An array of {@link FT_ColorStop} structs. */
public static class Buffer extends StructBuffer<FT_ColorStop, Buffer> implements NativeResource {
private static final FT_ColorStop ELEMENT_FACTORY = FT_ColorStop.create(-1L);
/**
* Creates a new {@code FT_ColorStop.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_ColorStop#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_ColorStop getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code stop_offset} field. */
@NativeType("FT_Fixed")
public long stop_offset() { return FT_ColorStop.nstop_offset(address()); }
/** @return a {@link FT_ColorIndex} view of the {@code color} field. */
public FT_ColorIndex color() { return FT_ColorStop.ncolor(address()); }
}
}

View File

@ -0,0 +1,283 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* This iterator object is needed for {@link FreeType#FT_Get_Colorline_Stops Get_Colorline_Stops}.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_ColorStopIterator {
* FT_UInt num_color_stops;
* FT_UInt current_color_stop;
* FT_Byte * p;
* FT_Bool read_variable;
* }</code></pre>
*/
public class FT_ColorStopIterator extends Struct<FT_ColorStopIterator> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
NUM_COLOR_STOPS,
CURRENT_COLOR_STOP,
P,
READ_VARIABLE;
static {
Layout layout = __struct(
__member(4),
__member(4),
__member(POINTER_SIZE),
__member(1)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
NUM_COLOR_STOPS = layout.offsetof(0);
CURRENT_COLOR_STOP = layout.offsetof(1);
P = layout.offsetof(2);
READ_VARIABLE = layout.offsetof(3);
}
protected FT_ColorStopIterator(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_ColorStopIterator create(long address, @Nullable ByteBuffer container) {
return new FT_ColorStopIterator(address, container);
}
/**
* Creates a {@code FT_ColorStopIterator} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_ColorStopIterator(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code num_color_stops} field. */
@NativeType("FT_UInt")
public int num_color_stops() { return nnum_color_stops(address()); }
/** @return the value of the {@code current_color_stop} field. */
@NativeType("FT_UInt")
public int current_color_stop() { return ncurrent_color_stop(address()); }
/**
* @return a {@link ByteBuffer} view of the data pointed to by the {@code p} field.
*
* @param capacity the number of elements in the returned buffer
*/
@Nullable
@NativeType("FT_Byte *")
public ByteBuffer p(int capacity) { return np(address(), capacity); }
/** @return the value of the {@code read_variable} field. */
@NativeType("FT_Bool")
public boolean read_variable() { return nread_variable(address()); }
// -----------------------------------
/** Returns a new {@code FT_ColorStopIterator} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_ColorStopIterator malloc() {
return new FT_ColorStopIterator(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_ColorStopIterator} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_ColorStopIterator calloc() {
return new FT_ColorStopIterator(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_ColorStopIterator} instance allocated with {@link BufferUtils}. */
public static FT_ColorStopIterator create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_ColorStopIterator(memAddress(container), container);
}
/** Returns a new {@code FT_ColorStopIterator} instance for the specified memory address. */
public static FT_ColorStopIterator create(long address) {
return new FT_ColorStopIterator(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_ColorStopIterator createSafe(long address) {
return address == NULL ? null : new FT_ColorStopIterator(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_ColorStopIterator} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_ColorStopIterator malloc(MemoryStack stack) {
return new FT_ColorStopIterator(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_ColorStopIterator} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_ColorStopIterator calloc(MemoryStack stack) {
return new FT_ColorStopIterator(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #num_color_stops}. */
public static int nnum_color_stops(long struct) { return UNSAFE.getInt(null, struct + FT_ColorStopIterator.NUM_COLOR_STOPS); }
/** Unsafe version of {@link #current_color_stop}. */
public static int ncurrent_color_stop(long struct) { return UNSAFE.getInt(null, struct + FT_ColorStopIterator.CURRENT_COLOR_STOP); }
/** Unsafe version of {@link #p(int) p}. */
@Nullable public static ByteBuffer np(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + FT_ColorStopIterator.P), capacity); }
/** Unsafe version of {@link #read_variable}. */
public static boolean nread_variable(long struct) { return UNSAFE.getByte(null, struct + FT_ColorStopIterator.READ_VARIABLE) != 0; }
// -----------------------------------
/** An array of {@link FT_ColorStopIterator} structs. */
public static class Buffer extends StructBuffer<FT_ColorStopIterator, Buffer> implements NativeResource {
private static final FT_ColorStopIterator ELEMENT_FACTORY = FT_ColorStopIterator.create(-1L);
/**
* Creates a new {@code FT_ColorStopIterator.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_ColorStopIterator#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_ColorStopIterator getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code num_color_stops} field. */
@NativeType("FT_UInt")
public int num_color_stops() { return FT_ColorStopIterator.nnum_color_stops(address()); }
/** @return the value of the {@code current_color_stop} field. */
@NativeType("FT_UInt")
public int current_color_stop() { return FT_ColorStopIterator.ncurrent_color_stop(address()); }
/**
* @return a {@link ByteBuffer} view of the data pointed to by the {@code p} field.
*
* @param capacity the number of elements in the returned buffer
*/
@Nullable
@NativeType("FT_Byte *")
public ByteBuffer p(int capacity) { return FT_ColorStopIterator.np(address(), capacity); }
/** @return the value of the {@code read_variable} field. */
@NativeType("FT_Bool")
public boolean read_variable() { return FT_ColorStopIterator.nread_variable(address()); }
}
}

View File

@ -0,0 +1,282 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* Read-only binary data represented as a pointer and a length.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Data {
* FT_Byte const * pointer;
* FT_UInt length;
* }</code></pre>
*/
public class FT_Data extends Struct<FT_Data> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
POINTER,
LENGTH;
static {
Layout layout = __struct(
__member(POINTER_SIZE),
__member(4)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
POINTER = layout.offsetof(0);
LENGTH = layout.offsetof(1);
}
protected FT_Data(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Data create(long address, @Nullable ByteBuffer container) {
return new FT_Data(address, container);
}
/**
* Creates a {@code FT_Data} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Data(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link ByteBuffer} view of the data pointed to by the {@code pointer} field. */
@NativeType("FT_Byte const *")
public ByteBuffer pointer() { return npointer(address()); }
/** @return the value of the {@code length} field. */
@NativeType("FT_UInt")
public int length() { return nlength(address()); }
/** Sets the address of the specified {@link ByteBuffer} to the {@code pointer} field. */
public FT_Data pointer(@NativeType("FT_Byte const *") ByteBuffer value) { npointer(address(), value); return this; }
/**
* Copies the specified struct data to this struct.
*
* @param src the source struct
*
* @return this struct
*/
public FT_Data set(FT_Data src) {
memCopy(src.address(), address(), SIZEOF);
return this;
}
// -----------------------------------
/** Returns a new {@code FT_Data} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_Data malloc() {
return new FT_Data(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_Data} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_Data calloc() {
return new FT_Data(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_Data} instance allocated with {@link BufferUtils}. */
public static FT_Data create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_Data(memAddress(container), container);
}
/** Returns a new {@code FT_Data} instance for the specified memory address. */
public static FT_Data create(long address) {
return new FT_Data(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Data createSafe(long address) {
return address == NULL ? null : new FT_Data(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_Data} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_Data malloc(MemoryStack stack) {
return new FT_Data(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_Data} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_Data calloc(MemoryStack stack) {
return new FT_Data(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #pointer() pointer}. */
public static ByteBuffer npointer(long struct) { return memByteBuffer(memGetAddress(struct + FT_Data.POINTER), nlength(struct)); }
/** Unsafe version of {@link #length}. */
public static int nlength(long struct) { return UNSAFE.getInt(null, struct + FT_Data.LENGTH); }
/** Unsafe version of {@link #pointer(ByteBuffer) pointer}. */
public static void npointer(long struct, ByteBuffer value) { memPutAddress(struct + FT_Data.POINTER, memAddress(value)); nlength(struct, value.remaining()); }
/** Sets the specified value to the {@code length} field of the specified {@code struct}. */
public static void nlength(long struct, int value) { UNSAFE.putInt(null, struct + FT_Data.LENGTH, value); }
/**
* Validates pointer members that should not be {@code NULL}.
*
* @param struct the struct to validate
*/
public static void validate(long struct) {
check(memGetAddress(struct + FT_Data.POINTER));
}
// -----------------------------------
/** An array of {@link FT_Data} structs. */
public static class Buffer extends StructBuffer<FT_Data, Buffer> implements NativeResource {
private static final FT_Data ELEMENT_FACTORY = FT_Data.create(-1L);
/**
* Creates a new {@code FT_Data.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Data#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Data getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link ByteBuffer} view of the data pointed to by the {@code pointer} field. */
@NativeType("FT_Byte const *")
public ByteBuffer pointer() { return FT_Data.npointer(address()); }
/** @return the value of the {@code length} field. */
@NativeType("FT_UInt")
public int length() { return FT_Data.nlength(address()); }
/** Sets the address of the specified {@link ByteBuffer} to the {@code pointer} field. */
public Buffer pointer(@NativeType("FT_Byte const *") ByteBuffer value) { FT_Data.npointer(address(), value); return this; }
}
}

View File

@ -0,0 +1,73 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* FT_Error (*{@link #invoke}) (
* void *arg
* )</code></pre>
*/
public abstract class FT_DebugHook_Func extends Callback implements FT_DebugHook_FuncI {
/**
* Creates a {@code FT_DebugHook_Func} instance from the specified function pointer.
*
* @return the new {@code FT_DebugHook_Func}
*/
public static FT_DebugHook_Func create(long functionPointer) {
FT_DebugHook_FuncI instance = Callback.get(functionPointer);
return instance instanceof FT_DebugHook_Func
? (FT_DebugHook_Func)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static FT_DebugHook_Func createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code FT_DebugHook_Func} instance that delegates to the specified {@code FT_DebugHook_FuncI} instance. */
public static FT_DebugHook_Func create(FT_DebugHook_FuncI instance) {
return instance instanceof FT_DebugHook_Func
? (FT_DebugHook_Func)instance
: new Container(instance.address(), instance);
}
protected FT_DebugHook_Func() {
super(CIF);
}
FT_DebugHook_Func(long functionPointer) {
super(functionPointer);
}
private static final class Container extends FT_DebugHook_Func {
private final FT_DebugHook_FuncI delegate;
Container(long functionPointer, FT_DebugHook_FuncI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public int invoke(long arg) {
return delegate.invoke(arg);
}
}
}

View File

@ -0,0 +1,47 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* FT_Error (*{@link #invoke}) (
* void *arg
* )</code></pre>
*/
@FunctionalInterface
@NativeType("FT_DebugHook_Func")
public interface FT_DebugHook_FuncI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_sint32,
ffi_type_pointer
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
int __result = invoke(
memGetAddress(memGetAddress(args))
);
apiClosureRet(ret, __result);
}
/** A drop-in replacement (or rather a wrapper) for the bytecode or charstring interpreter's main loop function. */
@NativeType("FT_Error") int invoke(@NativeType("void *") long arg);
}

View File

@ -0,0 +1,480 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* FreeType root face class structure. A face object models a typeface in a font file.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_FaceRec {
* FT_Long num_faces;
* FT_Long face_index;
* FT_Long face_flags;
* FT_Long style_flags;
* FT_Long num_glyphs;
* FT_String * family_name;
* FT_String * style_name;
* FT_Int num_fixed_sizes;
* {@link FT_Bitmap_Size FT_Bitmap_Size} * available_sizes;
* FT_Int num_charmaps;
* {@link FT_CharMap FT_CharMap} * charmaps;
* {@link FT_Generic FT_Generic} generic;
* {@link FT_BBox FT_BBox} bbox;
* FT_UShort units_per_EM;
* FT_Short ascender;
* FT_Short descender;
* FT_Short height;
* FT_Short max_advance_width;
* FT_Short max_advance_height;
* FT_Short underline_position;
* FT_Short underline_thickness;
* {@link FT_GlyphSlot FT_GlyphSlot} glyph;
* {@link FT_Size FT_Size} size;
* {@link FT_CharMap FT_CharMap} charmap;
* FT_Driver driver;
* FT_Memory memory;
* {@link FT_Stream FT_Stream} stream;
* {@link FT_List FT_ListRec} sizes_list;
* {@link FT_Generic FT_Generic} autohint;
* void * extensions;
* FT_Face_Internal internal;
* }</code></pre>
*/
@NativeType("struct FT_FaceRec")
public class FT_Face extends Struct<FT_Face> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
NUM_FACES,
FACE_INDEX,
FACE_FLAGS,
STYLE_FLAGS,
NUM_GLYPHS,
FAMILY_NAME,
STYLE_NAME,
NUM_FIXED_SIZES,
AVAILABLE_SIZES,
NUM_CHARMAPS,
CHARMAPS,
GENERIC,
BBOX,
UNITS_PER_EM,
ASCENDER,
DESCENDER,
HEIGHT,
MAX_ADVANCE_WIDTH,
MAX_ADVANCE_HEIGHT,
UNDERLINE_POSITION,
UNDERLINE_THICKNESS,
GLYPH,
SIZE,
CHARMAP,
DRIVER,
MEMORY,
STREAM,
SIZES_LIST,
AUTOHINT,
EXTENSIONS,
INTERNAL;
static {
Layout layout = __struct(
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(4),
__member(POINTER_SIZE),
__member(4),
__member(POINTER_SIZE),
__member(FT_Generic.SIZEOF, FT_Generic.ALIGNOF),
__member(FT_BBox.SIZEOF, FT_BBox.ALIGNOF),
__member(2),
__member(2),
__member(2),
__member(2),
__member(2),
__member(2),
__member(2),
__member(2),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(FT_List.SIZEOF, FT_List.ALIGNOF),
__member(FT_Generic.SIZEOF, FT_Generic.ALIGNOF),
__member(POINTER_SIZE),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
NUM_FACES = layout.offsetof(0);
FACE_INDEX = layout.offsetof(1);
FACE_FLAGS = layout.offsetof(2);
STYLE_FLAGS = layout.offsetof(3);
NUM_GLYPHS = layout.offsetof(4);
FAMILY_NAME = layout.offsetof(5);
STYLE_NAME = layout.offsetof(6);
NUM_FIXED_SIZES = layout.offsetof(7);
AVAILABLE_SIZES = layout.offsetof(8);
NUM_CHARMAPS = layout.offsetof(9);
CHARMAPS = layout.offsetof(10);
GENERIC = layout.offsetof(11);
BBOX = layout.offsetof(12);
UNITS_PER_EM = layout.offsetof(13);
ASCENDER = layout.offsetof(14);
DESCENDER = layout.offsetof(15);
HEIGHT = layout.offsetof(16);
MAX_ADVANCE_WIDTH = layout.offsetof(17);
MAX_ADVANCE_HEIGHT = layout.offsetof(18);
UNDERLINE_POSITION = layout.offsetof(19);
UNDERLINE_THICKNESS = layout.offsetof(20);
GLYPH = layout.offsetof(21);
SIZE = layout.offsetof(22);
CHARMAP = layout.offsetof(23);
DRIVER = layout.offsetof(24);
MEMORY = layout.offsetof(25);
STREAM = layout.offsetof(26);
SIZES_LIST = layout.offsetof(27);
AUTOHINT = layout.offsetof(28);
EXTENSIONS = layout.offsetof(29);
INTERNAL = layout.offsetof(30);
}
protected FT_Face(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Face create(long address, @Nullable ByteBuffer container) {
return new FT_Face(address, container);
}
/**
* Creates a {@code FT_Face} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Face(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code num_faces} field. */
@NativeType("FT_Long")
public long num_faces() { return nnum_faces(address()); }
/** @return the value of the {@code face_index} field. */
@NativeType("FT_Long")
public long face_index() { return nface_index(address()); }
/** @return the value of the {@code face_flags} field. */
@NativeType("FT_Long")
public long face_flags() { return nface_flags(address()); }
/** @return the value of the {@code style_flags} field. */
@NativeType("FT_Long")
public long style_flags() { return nstyle_flags(address()); }
/** @return the value of the {@code num_glyphs} field. */
@NativeType("FT_Long")
public long num_glyphs() { return nnum_glyphs(address()); }
/** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code family_name} field. */
@NativeType("FT_String *")
public ByteBuffer family_name() { return nfamily_name(address()); }
/** @return the null-terminated string pointed to by the {@code family_name} field. */
@NativeType("FT_String *")
public String family_nameString() { return nfamily_nameString(address()); }
/** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code style_name} field. */
@NativeType("FT_String *")
public ByteBuffer style_name() { return nstyle_name(address()); }
/** @return the null-terminated string pointed to by the {@code style_name} field. */
@NativeType("FT_String *")
public String style_nameString() { return nstyle_nameString(address()); }
/** @return the value of the {@code num_fixed_sizes} field. */
@NativeType("FT_Int")
public int num_fixed_sizes() { return nnum_fixed_sizes(address()); }
/** @return a {@link FT_Bitmap_Size.Buffer} view of the struct array pointed to by the {@code available_sizes} field. */
@Nullable
@NativeType("FT_Bitmap_Size *")
public FT_Bitmap_Size.Buffer available_sizes() { return navailable_sizes(address()); }
/** @return the value of the {@code num_charmaps} field. */
@NativeType("FT_Int")
public int num_charmaps() { return nnum_charmaps(address()); }
/** @return a {@link PointerBuffer} view of the data pointed to by the {@code charmaps} field. */
@NativeType("FT_CharMap *")
public PointerBuffer charmaps() { return ncharmaps(address()); }
/** @return a {@link FT_Generic} view of the {@code generic} field. */
public FT_Generic generic() { return ngeneric(address()); }
/** @return a {@link FT_BBox} view of the {@code bbox} field. */
public FT_BBox bbox() { return nbbox(address()); }
/** @return the value of the {@code units_per_EM} field. */
@NativeType("FT_UShort")
public short units_per_EM() { return nunits_per_EM(address()); }
/** @return the value of the {@code ascender} field. */
@NativeType("FT_Short")
public short ascender() { return nascender(address()); }
/** @return the value of the {@code descender} field. */
@NativeType("FT_Short")
public short descender() { return ndescender(address()); }
/** @return the value of the {@code height} field. */
@NativeType("FT_Short")
public short height() { return nheight(address()); }
/** @return the value of the {@code max_advance_width} field. */
@NativeType("FT_Short")
public short max_advance_width() { return nmax_advance_width(address()); }
/** @return the value of the {@code max_advance_height} field. */
@NativeType("FT_Short")
public short max_advance_height() { return nmax_advance_height(address()); }
/** @return the value of the {@code underline_position} field. */
@NativeType("FT_Short")
public short underline_position() { return nunderline_position(address()); }
/** @return the value of the {@code underline_thickness} field. */
@NativeType("FT_Short")
public short underline_thickness() { return nunderline_thickness(address()); }
/** @return a {@link FT_GlyphSlot} view of the struct pointed to by the {@code glyph} field. */
@Nullable
public FT_GlyphSlot glyph() { return nglyph(address()); }
/** @return a {@link FT_Size} view of the struct pointed to by the {@code size} field. */
@Nullable
public FT_Size size() { return nsize(address()); }
/** @return a {@link FT_CharMap} view of the struct pointed to by the {@code charmap} field. */
@Nullable
public FT_CharMap charmap() { return ncharmap(address()); }
// -----------------------------------
/** Returns a new {@code FT_Face} instance for the specified memory address. */
public static FT_Face create(long address) {
return new FT_Face(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Face createSafe(long address) {
return address == NULL ? null : new FT_Face(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #num_faces}. */
public static long nnum_faces(long struct) { return memGetCLong(struct + FT_Face.NUM_FACES); }
/** Unsafe version of {@link #face_index}. */
public static long nface_index(long struct) { return memGetCLong(struct + FT_Face.FACE_INDEX); }
/** Unsafe version of {@link #face_flags}. */
public static long nface_flags(long struct) { return memGetCLong(struct + FT_Face.FACE_FLAGS); }
/** Unsafe version of {@link #style_flags}. */
public static long nstyle_flags(long struct) { return memGetCLong(struct + FT_Face.STYLE_FLAGS); }
/** Unsafe version of {@link #num_glyphs}. */
public static long nnum_glyphs(long struct) { return memGetCLong(struct + FT_Face.NUM_GLYPHS); }
/** Unsafe version of {@link #family_name}. */
public static ByteBuffer nfamily_name(long struct) { return memByteBufferNT1(memGetAddress(struct + FT_Face.FAMILY_NAME)); }
/** Unsafe version of {@link #family_nameString}. */
public static String nfamily_nameString(long struct) { return memUTF8(memGetAddress(struct + FT_Face.FAMILY_NAME)); }
/** Unsafe version of {@link #style_name}. */
public static ByteBuffer nstyle_name(long struct) { return memByteBufferNT1(memGetAddress(struct + FT_Face.STYLE_NAME)); }
/** Unsafe version of {@link #style_nameString}. */
public static String nstyle_nameString(long struct) { return memUTF8(memGetAddress(struct + FT_Face.STYLE_NAME)); }
/** Unsafe version of {@link #num_fixed_sizes}. */
public static int nnum_fixed_sizes(long struct) { return UNSAFE.getInt(null, struct + FT_Face.NUM_FIXED_SIZES); }
/** Unsafe version of {@link #available_sizes}. */
@Nullable public static FT_Bitmap_Size.Buffer navailable_sizes(long struct) { return FT_Bitmap_Size.createSafe(memGetAddress(struct + FT_Face.AVAILABLE_SIZES), nnum_fixed_sizes(struct)); }
/** Unsafe version of {@link #num_charmaps}. */
public static int nnum_charmaps(long struct) { return UNSAFE.getInt(null, struct + FT_Face.NUM_CHARMAPS); }
/** Unsafe version of {@link #charmaps() charmaps}. */
public static PointerBuffer ncharmaps(long struct) { return memPointerBuffer(memGetAddress(struct + FT_Face.CHARMAPS), nnum_charmaps(struct)); }
/** Unsafe version of {@link #generic}. */
public static FT_Generic ngeneric(long struct) { return FT_Generic.create(struct + FT_Face.GENERIC); }
/** Unsafe version of {@link #bbox}. */
public static FT_BBox nbbox(long struct) { return FT_BBox.create(struct + FT_Face.BBOX); }
/** Unsafe version of {@link #units_per_EM}. */
public static short nunits_per_EM(long struct) { return UNSAFE.getShort(null, struct + FT_Face.UNITS_PER_EM); }
/** Unsafe version of {@link #ascender}. */
public static short nascender(long struct) { return UNSAFE.getShort(null, struct + FT_Face.ASCENDER); }
/** Unsafe version of {@link #descender}. */
public static short ndescender(long struct) { return UNSAFE.getShort(null, struct + FT_Face.DESCENDER); }
/** Unsafe version of {@link #height}. */
public static short nheight(long struct) { return UNSAFE.getShort(null, struct + FT_Face.HEIGHT); }
/** Unsafe version of {@link #max_advance_width}. */
public static short nmax_advance_width(long struct) { return UNSAFE.getShort(null, struct + FT_Face.MAX_ADVANCE_WIDTH); }
/** Unsafe version of {@link #max_advance_height}. */
public static short nmax_advance_height(long struct) { return UNSAFE.getShort(null, struct + FT_Face.MAX_ADVANCE_HEIGHT); }
/** Unsafe version of {@link #underline_position}. */
public static short nunderline_position(long struct) { return UNSAFE.getShort(null, struct + FT_Face.UNDERLINE_POSITION); }
/** Unsafe version of {@link #underline_thickness}. */
public static short nunderline_thickness(long struct) { return UNSAFE.getShort(null, struct + FT_Face.UNDERLINE_THICKNESS); }
/** Unsafe version of {@link #glyph}. */
@Nullable public static FT_GlyphSlot nglyph(long struct) { return FT_GlyphSlot.createSafe(memGetAddress(struct + FT_Face.GLYPH)); }
/** Unsafe version of {@link #size}. */
@Nullable public static FT_Size nsize(long struct) { return FT_Size.createSafe(memGetAddress(struct + FT_Face.SIZE)); }
/** Unsafe version of {@link #charmap}. */
@Nullable public static FT_CharMap ncharmap(long struct) { return FT_CharMap.createSafe(memGetAddress(struct + FT_Face.CHARMAP)); }
public static long ndriver(long struct) { return memGetAddress(struct + FT_Face.DRIVER); }
@Nullable public static FT_Memory nmemory(long struct) { return FT_Memory.createSafe(memGetAddress(struct + FT_Face.MEMORY)); }
@Nullable public static FT_Stream nstream$(long struct) { return FT_Stream.createSafe(memGetAddress(struct + FT_Face.STREAM)); }
public static FT_List nsizes_list(long struct) { return FT_List.create(struct + FT_Face.SIZES_LIST); }
public static FT_Generic nautohint(long struct) { return FT_Generic.create(struct + FT_Face.AUTOHINT); }
public static long nextensions(long struct) { return memGetAddress(struct + FT_Face.EXTENSIONS); }
public static long ninternal(long struct) { return memGetAddress(struct + FT_Face.INTERNAL); }
// -----------------------------------
/** An array of {@link FT_Face} structs. */
public static class Buffer extends StructBuffer<FT_Face, Buffer> {
private static final FT_Face ELEMENT_FACTORY = FT_Face.create(-1L);
/**
* Creates a new {@code FT_Face.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Face#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Face getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code num_faces} field. */
@NativeType("FT_Long")
public long num_faces() { return FT_Face.nnum_faces(address()); }
/** @return the value of the {@code face_index} field. */
@NativeType("FT_Long")
public long face_index() { return FT_Face.nface_index(address()); }
/** @return the value of the {@code face_flags} field. */
@NativeType("FT_Long")
public long face_flags() { return FT_Face.nface_flags(address()); }
/** @return the value of the {@code style_flags} field. */
@NativeType("FT_Long")
public long style_flags() { return FT_Face.nstyle_flags(address()); }
/** @return the value of the {@code num_glyphs} field. */
@NativeType("FT_Long")
public long num_glyphs() { return FT_Face.nnum_glyphs(address()); }
/** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code family_name} field. */
@NativeType("FT_String *")
public ByteBuffer family_name() { return FT_Face.nfamily_name(address()); }
/** @return the null-terminated string pointed to by the {@code family_name} field. */
@NativeType("FT_String *")
public String family_nameString() { return FT_Face.nfamily_nameString(address()); }
/** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code style_name} field. */
@NativeType("FT_String *")
public ByteBuffer style_name() { return FT_Face.nstyle_name(address()); }
/** @return the null-terminated string pointed to by the {@code style_name} field. */
@NativeType("FT_String *")
public String style_nameString() { return FT_Face.nstyle_nameString(address()); }
/** @return the value of the {@code num_fixed_sizes} field. */
@NativeType("FT_Int")
public int num_fixed_sizes() { return FT_Face.nnum_fixed_sizes(address()); }
/** @return a {@link FT_Bitmap_Size.Buffer} view of the struct array pointed to by the {@code available_sizes} field. */
@Nullable
@NativeType("FT_Bitmap_Size *")
public FT_Bitmap_Size.Buffer available_sizes() { return FT_Face.navailable_sizes(address()); }
/** @return the value of the {@code num_charmaps} field. */
@NativeType("FT_Int")
public int num_charmaps() { return FT_Face.nnum_charmaps(address()); }
/** @return a {@link PointerBuffer} view of the data pointed to by the {@code charmaps} field. */
@NativeType("FT_CharMap *")
public PointerBuffer charmaps() { return FT_Face.ncharmaps(address()); }
/** @return a {@link FT_Generic} view of the {@code generic} field. */
public FT_Generic generic() { return FT_Face.ngeneric(address()); }
/** @return a {@link FT_BBox} view of the {@code bbox} field. */
public FT_BBox bbox() { return FT_Face.nbbox(address()); }
/** @return the value of the {@code units_per_EM} field. */
@NativeType("FT_UShort")
public short units_per_EM() { return FT_Face.nunits_per_EM(address()); }
/** @return the value of the {@code ascender} field. */
@NativeType("FT_Short")
public short ascender() { return FT_Face.nascender(address()); }
/** @return the value of the {@code descender} field. */
@NativeType("FT_Short")
public short descender() { return FT_Face.ndescender(address()); }
/** @return the value of the {@code height} field. */
@NativeType("FT_Short")
public short height() { return FT_Face.nheight(address()); }
/** @return the value of the {@code max_advance_width} field. */
@NativeType("FT_Short")
public short max_advance_width() { return FT_Face.nmax_advance_width(address()); }
/** @return the value of the {@code max_advance_height} field. */
@NativeType("FT_Short")
public short max_advance_height() { return FT_Face.nmax_advance_height(address()); }
/** @return the value of the {@code underline_position} field. */
@NativeType("FT_Short")
public short underline_position() { return FT_Face.nunderline_position(address()); }
/** @return the value of the {@code underline_thickness} field. */
@NativeType("FT_Short")
public short underline_thickness() { return FT_Face.nunderline_thickness(address()); }
/** @return a {@link FT_GlyphSlot} view of the struct pointed to by the {@code glyph} field. */
@Nullable
public FT_GlyphSlot glyph() { return FT_Face.nglyph(address()); }
/** @return a {@link FT_Size} view of the struct pointed to by the {@code size} field. */
@Nullable
public FT_Size size() { return FT_Face.nsize(address()); }
/** @return a {@link FT_CharMap} view of the struct pointed to by the {@code charmap} field. */
@Nullable
public FT_CharMap charmap() { return FT_Face.ncharmap(address()); }
}
}

View File

@ -0,0 +1,74 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* void (*{@link #invoke}) (
* FT_Memory memory,
* void *block
* )</code></pre>
*/
public abstract class FT_Free_Func extends Callback implements FT_Free_FuncI {
/**
* Creates a {@code FT_Free_Func} instance from the specified function pointer.
*
* @return the new {@code FT_Free_Func}
*/
public static FT_Free_Func create(long functionPointer) {
FT_Free_FuncI instance = Callback.get(functionPointer);
return instance instanceof FT_Free_Func
? (FT_Free_Func)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static FT_Free_Func createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code FT_Free_Func} instance that delegates to the specified {@code FT_Free_FuncI} instance. */
public static FT_Free_Func create(FT_Free_FuncI instance) {
return instance instanceof FT_Free_Func
? (FT_Free_Func)instance
: new Container(instance.address(), instance);
}
protected FT_Free_Func() {
super(CIF);
}
FT_Free_Func(long functionPointer) {
super(functionPointer);
}
private static final class Container extends FT_Free_Func {
private final FT_Free_FuncI delegate;
Container(long functionPointer, FT_Free_FuncI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public void invoke(long memory, long block) {
delegate.invoke(memory, block);
}
}
}

View File

@ -0,0 +1,48 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* void (*{@link #invoke}) (
* FT_Memory memory,
* void *block
* )</code></pre>
*/
@FunctionalInterface
@NativeType("FT_Free_Func")
public interface FT_Free_FuncI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_void,
ffi_type_pointer, ffi_type_pointer
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
invoke(
memGetAddress(memGetAddress(args)),
memGetAddress(memGetAddress(args + POINTER_SIZE))
);
}
/** A function used to release a given block of memory. */
void invoke(@NativeType("FT_Memory") long memory, @NativeType("void *") long block);
}

View File

@ -0,0 +1,296 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* Client applications often need to associate their own data to a variety of FreeType core objects. For example, a text layout API might
* want to associate a glyph cache to a given size object.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Generic {
* void * data;
* {@link FT_Generic_FinalizerI FT_Generic_Finalizer} finalizer;
* }</code></pre>
*/
public class FT_Generic extends Struct<FT_Generic> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
DATA,
FINALIZER;
static {
Layout layout = __struct(
__member(POINTER_SIZE),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
DATA = layout.offsetof(0);
FINALIZER = layout.offsetof(1);
}
protected FT_Generic(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Generic create(long address, @Nullable ByteBuffer container) {
return new FT_Generic(address, container);
}
/**
* Creates a {@code FT_Generic} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Generic(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code data} field. */
@NativeType("void *")
public long data() { return ndata(address()); }
/** @return the value of the {@code finalizer} field. */
public FT_Generic_Finalizer finalizer() { return nfinalizer(address()); }
/** Sets the specified value to the {@code data} field. */
public FT_Generic data(@NativeType("void *") long value) { ndata(address(), value); return this; }
/** Sets the specified value to the {@code finalizer} field. */
public FT_Generic finalizer(@NativeType("FT_Generic_Finalizer") FT_Generic_FinalizerI value) { nfinalizer(address(), value); return this; }
/** Initializes this struct with the specified values. */
public FT_Generic set(
long data,
FT_Generic_FinalizerI finalizer
) {
data(data);
finalizer(finalizer);
return this;
}
/**
* Copies the specified struct data to this struct.
*
* @param src the source struct
*
* @return this struct
*/
public FT_Generic set(FT_Generic src) {
memCopy(src.address(), address(), SIZEOF);
return this;
}
// -----------------------------------
/** Returns a new {@code FT_Generic} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_Generic malloc() {
return new FT_Generic(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_Generic} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_Generic calloc() {
return new FT_Generic(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_Generic} instance allocated with {@link BufferUtils}. */
public static FT_Generic create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_Generic(memAddress(container), container);
}
/** Returns a new {@code FT_Generic} instance for the specified memory address. */
public static FT_Generic create(long address) {
return new FT_Generic(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Generic createSafe(long address) {
return address == NULL ? null : new FT_Generic(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_Generic} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_Generic malloc(MemoryStack stack) {
return new FT_Generic(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_Generic} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_Generic calloc(MemoryStack stack) {
return new FT_Generic(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #data}. */
public static long ndata(long struct) { return memGetAddress(struct + FT_Generic.DATA); }
/** Unsafe version of {@link #finalizer}. */
public static FT_Generic_Finalizer nfinalizer(long struct) { return FT_Generic_Finalizer.create(memGetAddress(struct + FT_Generic.FINALIZER)); }
/** Unsafe version of {@link #data(long) data}. */
public static void ndata(long struct, long value) { memPutAddress(struct + FT_Generic.DATA, value); }
/** Unsafe version of {@link #finalizer(FT_Generic_FinalizerI) finalizer}. */
public static void nfinalizer(long struct, FT_Generic_FinalizerI value) { memPutAddress(struct + FT_Generic.FINALIZER, value.address()); }
/**
* Validates pointer members that should not be {@code NULL}.
*
* @param struct the struct to validate
*/
public static void validate(long struct) {
check(memGetAddress(struct + FT_Generic.FINALIZER));
}
// -----------------------------------
/** An array of {@link FT_Generic} structs. */
public static class Buffer extends StructBuffer<FT_Generic, Buffer> implements NativeResource {
private static final FT_Generic ELEMENT_FACTORY = FT_Generic.create(-1L);
/**
* Creates a new {@code FT_Generic.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Generic#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Generic getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code data} field. */
@NativeType("void *")
public long data() { return FT_Generic.ndata(address()); }
/** @return the value of the {@code finalizer} field. */
public FT_Generic_Finalizer finalizer() { return FT_Generic.nfinalizer(address()); }
/** Sets the specified value to the {@code data} field. */
public Buffer data(@NativeType("void *") long value) { FT_Generic.ndata(address(), value); return this; }
/** Sets the specified value to the {@code finalizer} field. */
public Buffer finalizer(@NativeType("FT_Generic_Finalizer") FT_Generic_FinalizerI value) { FT_Generic.nfinalizer(address(), value); return this; }
}
}

View File

@ -0,0 +1,73 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* void (*{@link #invoke}) (
* void *object
* )</code></pre>
*/
public abstract class FT_Generic_Finalizer extends Callback implements FT_Generic_FinalizerI {
/**
* Creates a {@code FT_Generic_Finalizer} instance from the specified function pointer.
*
* @return the new {@code FT_Generic_Finalizer}
*/
public static FT_Generic_Finalizer create(long functionPointer) {
FT_Generic_FinalizerI instance = Callback.get(functionPointer);
return instance instanceof FT_Generic_Finalizer
? (FT_Generic_Finalizer)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static FT_Generic_Finalizer createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code FT_Generic_Finalizer} instance that delegates to the specified {@code FT_Generic_FinalizerI} instance. */
public static FT_Generic_Finalizer create(FT_Generic_FinalizerI instance) {
return instance instanceof FT_Generic_Finalizer
? (FT_Generic_Finalizer)instance
: new Container(instance.address(), instance);
}
protected FT_Generic_Finalizer() {
super(CIF);
}
FT_Generic_Finalizer(long functionPointer) {
super(functionPointer);
}
private static final class Container extends FT_Generic_Finalizer {
private final FT_Generic_FinalizerI delegate;
Container(long functionPointer, FT_Generic_FinalizerI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public void invoke(long object) {
delegate.invoke(object);
}
}
}

View File

@ -0,0 +1,50 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* void (*{@link #invoke}) (
* void *object
* )</code></pre>
*/
@FunctionalInterface
@NativeType("FT_Generic_Finalizer")
public interface FT_Generic_FinalizerI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_void,
ffi_type_pointer
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
invoke(
memGetAddress(memGetAddress(args))
);
}
/**
* Describe a function used to destroy the {@code client} data of any FreeType object.
*
* @param object the address of the FreeType object that is under finalization. Its client data is accessed through its {@code generic} field.
*/
void invoke(@NativeType("void *") long object);
}

View File

@ -0,0 +1,181 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* The root glyph structure contains a given glyph image plus its advance width in 16.16 fixed-point format.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_GlyphRec {
* FT_Library library;
* FT_Glyph_Class const * clazz;
* FT_Glyph_Format format;
* {@link FT_Vector FT_Vector} advance;
* }</code></pre>
*/
@NativeType("struct FT_GlyphRec")
public class FT_Glyph extends Struct<FT_Glyph> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
LIBRARY,
CLAZZ,
FORMAT,
ADVANCE;
static {
Layout layout = __struct(
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(4),
__member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
LIBRARY = layout.offsetof(0);
CLAZZ = layout.offsetof(1);
FORMAT = layout.offsetof(2);
ADVANCE = layout.offsetof(3);
}
protected FT_Glyph(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Glyph create(long address, @Nullable ByteBuffer container) {
return new FT_Glyph(address, container);
}
/**
* Creates a {@code FT_Glyph} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Glyph(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code library} field. */
@NativeType("FT_Library")
public long library() { return nlibrary(address()); }
/** @return the value of the {@code format} field. */
@NativeType("FT_Glyph_Format")
public int format() { return nformat(address()); }
/** @return a {@link FT_Vector} view of the {@code advance} field. */
public FT_Vector advance() { return nadvance(address()); }
// -----------------------------------
/** Returns a new {@code FT_Glyph} instance for the specified memory address. */
public static FT_Glyph create(long address) {
return new FT_Glyph(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Glyph createSafe(long address) {
return address == NULL ? null : new FT_Glyph(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #library}. */
public static long nlibrary(long struct) { return memGetAddress(struct + FT_Glyph.LIBRARY); }
public static long nclazz(long struct) { return memGetAddress(struct + FT_Glyph.CLAZZ); }
/** Unsafe version of {@link #format}. */
public static int nformat(long struct) { return UNSAFE.getInt(null, struct + FT_Glyph.FORMAT); }
/** Unsafe version of {@link #advance}. */
public static FT_Vector nadvance(long struct) { return FT_Vector.create(struct + FT_Glyph.ADVANCE); }
// -----------------------------------
/** An array of {@link FT_Glyph} structs. */
public static class Buffer extends StructBuffer<FT_Glyph, Buffer> {
private static final FT_Glyph ELEMENT_FACTORY = FT_Glyph.create(-1L);
/**
* Creates a new {@code FT_Glyph.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Glyph#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Glyph getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code library} field. */
@NativeType("FT_Library")
public long library() { return FT_Glyph.nlibrary(address()); }
/** @return the value of the {@code format} field. */
@NativeType("FT_Glyph_Format")
public int format() { return FT_Glyph.nformat(address()); }
/** @return a {@link FT_Vector} view of the {@code advance} field. */
public FT_Vector advance() { return FT_Glyph.nadvance(address()); }
}
}

View File

@ -0,0 +1,352 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* FreeType root glyph slot class structure. A glyph slot is a container where individual glyphs can be loaded, be they in outline or bitmap format.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_GlyphSlotRec {
* FT_Library library;
* {@link FT_Face FT_Face} face;
* {@link FT_GlyphSlot FT_GlyphSlot} next;
* FT_UInt glyph_index;
* {@link FT_Generic FT_Generic} generic;
* {@link FT_Glyph_Metrics FT_Glyph_Metrics} metrics;
* FT_Fixed linearHoriAdvance;
* FT_Fixed linearVertAdvance;
* {@link FT_Vector FT_Vector} advance;
* FT_Glyph_Format format;
* {@link FT_Bitmap FT_Bitmap} bitmap;
* FT_Int bitmap_left;
* FT_Int bitmap_top;
* {@link FT_Outline FT_Outline} outline;
* FT_UInt num_subglyphs;
* FT_SubGlyph subglyphs;
* void * control_data;
* long control_len;
* FT_Pos lsb_delta;
* FT_Pos rsb_delta;
* void * other;
* FT_Slot_Internal internal;
* }</code></pre>
*/
@NativeType("struct FT_GlyphSlotRec")
public class FT_GlyphSlot extends Struct<FT_GlyphSlot> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
LIBRARY,
FACE,
NEXT,
GLYPH_INDEX,
GENERIC,
METRICS,
LINEARHORIADVANCE,
LINEARVERTADVANCE,
ADVANCE,
FORMAT,
BITMAP,
BITMAP_LEFT,
BITMAP_TOP,
OUTLINE,
NUM_SUBGLYPHS,
SUBGLYPHS,
CONTROL_DATA,
CONTROL_LEN,
LSB_DELTA,
RSB_DELTA,
OTHER,
INTERNAL;
static {
Layout layout = __struct(
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(4),
__member(FT_Generic.SIZEOF, FT_Generic.ALIGNOF),
__member(FT_Glyph_Metrics.SIZEOF, FT_Glyph_Metrics.ALIGNOF),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF),
__member(4),
__member(FT_Bitmap.SIZEOF, FT_Bitmap.ALIGNOF),
__member(4),
__member(4),
__member(FT_Outline.SIZEOF, FT_Outline.ALIGNOF),
__member(4),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
LIBRARY = layout.offsetof(0);
FACE = layout.offsetof(1);
NEXT = layout.offsetof(2);
GLYPH_INDEX = layout.offsetof(3);
GENERIC = layout.offsetof(4);
METRICS = layout.offsetof(5);
LINEARHORIADVANCE = layout.offsetof(6);
LINEARVERTADVANCE = layout.offsetof(7);
ADVANCE = layout.offsetof(8);
FORMAT = layout.offsetof(9);
BITMAP = layout.offsetof(10);
BITMAP_LEFT = layout.offsetof(11);
BITMAP_TOP = layout.offsetof(12);
OUTLINE = layout.offsetof(13);
NUM_SUBGLYPHS = layout.offsetof(14);
SUBGLYPHS = layout.offsetof(15);
CONTROL_DATA = layout.offsetof(16);
CONTROL_LEN = layout.offsetof(17);
LSB_DELTA = layout.offsetof(18);
RSB_DELTA = layout.offsetof(19);
OTHER = layout.offsetof(20);
INTERNAL = layout.offsetof(21);
}
protected FT_GlyphSlot(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_GlyphSlot create(long address, @Nullable ByteBuffer container) {
return new FT_GlyphSlot(address, container);
}
/**
* Creates a {@code FT_GlyphSlot} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_GlyphSlot(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code library} field. */
@NativeType("FT_Library")
public long library() { return nlibrary(address()); }
/** @return a {@link FT_Face} view of the struct pointed to by the {@code face} field. */
public FT_Face face() { return nface(address()); }
/** @return a {@link FT_GlyphSlot} view of the struct pointed to by the {@code next} field. */
@Nullable
public FT_GlyphSlot next() { return nnext(address()); }
/** @return the value of the {@code glyph_index} field. */
@NativeType("FT_UInt")
public int glyph_index() { return nglyph_index(address()); }
/** @return a {@link FT_Generic} view of the {@code generic} field. */
public FT_Generic generic() { return ngeneric(address()); }
/** @return a {@link FT_Glyph_Metrics} view of the {@code metrics} field. */
public FT_Glyph_Metrics metrics() { return nmetrics(address()); }
/** @return the value of the {@code linearHoriAdvance} field. */
@NativeType("FT_Fixed")
public long linearHoriAdvance() { return nlinearHoriAdvance(address()); }
/** @return the value of the {@code linearVertAdvance} field. */
@NativeType("FT_Fixed")
public long linearVertAdvance() { return nlinearVertAdvance(address()); }
/** @return a {@link FT_Vector} view of the {@code advance} field. */
public FT_Vector advance() { return nadvance(address()); }
/** @return the value of the {@code format} field. */
@NativeType("FT_Glyph_Format")
public int format() { return nformat(address()); }
/** @return a {@link FT_Bitmap} view of the {@code bitmap} field. */
public FT_Bitmap bitmap() { return nbitmap(address()); }
/** @return the value of the {@code bitmap_left} field. */
@NativeType("FT_Int")
public int bitmap_left() { return nbitmap_left(address()); }
/** @return the value of the {@code bitmap_top} field. */
@NativeType("FT_Int")
public int bitmap_top() { return nbitmap_top(address()); }
/** @return a {@link FT_Outline} view of the {@code outline} field. */
public FT_Outline outline() { return noutline(address()); }
/** @return the value of the {@code lsb_delta} field. */
@NativeType("FT_Pos")
public long lsb_delta() { return nlsb_delta(address()); }
/** @return the value of the {@code rsb_delta} field. */
@NativeType("FT_Pos")
public long rsb_delta() { return nrsb_delta(address()); }
// -----------------------------------
/** Returns a new {@code FT_GlyphSlot} instance for the specified memory address. */
public static FT_GlyphSlot create(long address) {
return new FT_GlyphSlot(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_GlyphSlot createSafe(long address) {
return address == NULL ? null : new FT_GlyphSlot(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #library}. */
public static long nlibrary(long struct) { return memGetAddress(struct + FT_GlyphSlot.LIBRARY); }
/** Unsafe version of {@link #face}. */
public static FT_Face nface(long struct) { return FT_Face.create(memGetAddress(struct + FT_GlyphSlot.FACE)); }
/** Unsafe version of {@link #next}. */
@Nullable public static FT_GlyphSlot nnext(long struct) { return FT_GlyphSlot.createSafe(memGetAddress(struct + FT_GlyphSlot.NEXT)); }
/** Unsafe version of {@link #glyph_index}. */
public static int nglyph_index(long struct) { return UNSAFE.getInt(null, struct + FT_GlyphSlot.GLYPH_INDEX); }
/** Unsafe version of {@link #generic}. */
public static FT_Generic ngeneric(long struct) { return FT_Generic.create(struct + FT_GlyphSlot.GENERIC); }
/** Unsafe version of {@link #metrics}. */
public static FT_Glyph_Metrics nmetrics(long struct) { return FT_Glyph_Metrics.create(struct + FT_GlyphSlot.METRICS); }
/** Unsafe version of {@link #linearHoriAdvance}. */
public static long nlinearHoriAdvance(long struct) { return memGetCLong(struct + FT_GlyphSlot.LINEARHORIADVANCE); }
/** Unsafe version of {@link #linearVertAdvance}. */
public static long nlinearVertAdvance(long struct) { return memGetCLong(struct + FT_GlyphSlot.LINEARVERTADVANCE); }
/** Unsafe version of {@link #advance}. */
public static FT_Vector nadvance(long struct) { return FT_Vector.create(struct + FT_GlyphSlot.ADVANCE); }
/** Unsafe version of {@link #format}. */
public static int nformat(long struct) { return UNSAFE.getInt(null, struct + FT_GlyphSlot.FORMAT); }
/** Unsafe version of {@link #bitmap}. */
public static FT_Bitmap nbitmap(long struct) { return FT_Bitmap.create(struct + FT_GlyphSlot.BITMAP); }
/** Unsafe version of {@link #bitmap_left}. */
public static int nbitmap_left(long struct) { return UNSAFE.getInt(null, struct + FT_GlyphSlot.BITMAP_LEFT); }
/** Unsafe version of {@link #bitmap_top}. */
public static int nbitmap_top(long struct) { return UNSAFE.getInt(null, struct + FT_GlyphSlot.BITMAP_TOP); }
/** Unsafe version of {@link #outline}. */
public static FT_Outline noutline(long struct) { return FT_Outline.create(struct + FT_GlyphSlot.OUTLINE); }
public static int nnum_subglyphs(long struct) { return UNSAFE.getInt(null, struct + FT_GlyphSlot.NUM_SUBGLYPHS); }
public static long nsubglyphs(long struct) { return memGetAddress(struct + FT_GlyphSlot.SUBGLYPHS); }
@Nullable public static ByteBuffer ncontrol_data(long struct) { return memByteBufferSafe(memGetAddress(struct + FT_GlyphSlot.CONTROL_DATA), (int)ncontrol_len(struct)); }
public static long ncontrol_len(long struct) { return memGetCLong(struct + FT_GlyphSlot.CONTROL_LEN); }
/** Unsafe version of {@link #lsb_delta}. */
public static long nlsb_delta(long struct) { return memGetCLong(struct + FT_GlyphSlot.LSB_DELTA); }
/** Unsafe version of {@link #rsb_delta}. */
public static long nrsb_delta(long struct) { return memGetCLong(struct + FT_GlyphSlot.RSB_DELTA); }
public static long nother(long struct) { return memGetAddress(struct + FT_GlyphSlot.OTHER); }
public static long ninternal(long struct) { return memGetAddress(struct + FT_GlyphSlot.INTERNAL); }
// -----------------------------------
/** An array of {@link FT_GlyphSlot} structs. */
public static class Buffer extends StructBuffer<FT_GlyphSlot, Buffer> {
private static final FT_GlyphSlot ELEMENT_FACTORY = FT_GlyphSlot.create(-1L);
/**
* Creates a new {@code FT_GlyphSlot.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_GlyphSlot#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_GlyphSlot getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code library} field. */
@NativeType("FT_Library")
public long library() { return FT_GlyphSlot.nlibrary(address()); }
/** @return a {@link FT_Face} view of the struct pointed to by the {@code face} field. */
public FT_Face face() { return FT_GlyphSlot.nface(address()); }
/** @return a {@link FT_GlyphSlot} view of the struct pointed to by the {@code next} field. */
@Nullable
public FT_GlyphSlot next() { return FT_GlyphSlot.nnext(address()); }
/** @return the value of the {@code glyph_index} field. */
@NativeType("FT_UInt")
public int glyph_index() { return FT_GlyphSlot.nglyph_index(address()); }
/** @return a {@link FT_Generic} view of the {@code generic} field. */
public FT_Generic generic() { return FT_GlyphSlot.ngeneric(address()); }
/** @return a {@link FT_Glyph_Metrics} view of the {@code metrics} field. */
public FT_Glyph_Metrics metrics() { return FT_GlyphSlot.nmetrics(address()); }
/** @return the value of the {@code linearHoriAdvance} field. */
@NativeType("FT_Fixed")
public long linearHoriAdvance() { return FT_GlyphSlot.nlinearHoriAdvance(address()); }
/** @return the value of the {@code linearVertAdvance} field. */
@NativeType("FT_Fixed")
public long linearVertAdvance() { return FT_GlyphSlot.nlinearVertAdvance(address()); }
/** @return a {@link FT_Vector} view of the {@code advance} field. */
public FT_Vector advance() { return FT_GlyphSlot.nadvance(address()); }
/** @return the value of the {@code format} field. */
@NativeType("FT_Glyph_Format")
public int format() { return FT_GlyphSlot.nformat(address()); }
/** @return a {@link FT_Bitmap} view of the {@code bitmap} field. */
public FT_Bitmap bitmap() { return FT_GlyphSlot.nbitmap(address()); }
/** @return the value of the {@code bitmap_left} field. */
@NativeType("FT_Int")
public int bitmap_left() { return FT_GlyphSlot.nbitmap_left(address()); }
/** @return the value of the {@code bitmap_top} field. */
@NativeType("FT_Int")
public int bitmap_top() { return FT_GlyphSlot.nbitmap_top(address()); }
/** @return a {@link FT_Outline} view of the {@code outline} field. */
public FT_Outline outline() { return FT_GlyphSlot.noutline(address()); }
/** @return the value of the {@code lsb_delta} field. */
@NativeType("FT_Pos")
public long lsb_delta() { return FT_GlyphSlot.nlsb_delta(address()); }
/** @return the value of the {@code rsb_delta} field. */
@NativeType("FT_Pos")
public long rsb_delta() { return FT_GlyphSlot.nrsb_delta(address()); }
}
}

View File

@ -0,0 +1,250 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure to model the metrics of a single glyph.
*
* <p>The values are expressed in 26.6 fractional pixel format; if the flag {@link FreeType#FT_LOAD_NO_SCALE LOAD_NO_SCALE} has been used while loading the glyph, values are expressed in
* font units instead.</p>
*
* <div style="margin-left: 26px; border-left: 1px solid gray; padding-left: 14px;"><h5>Note</h5>
*
* <p>If not disabled with {@link FreeType#FT_LOAD_NO_HINTING LOAD_NO_HINTING}, the values represent dimensions of the hinted glyph (in case hinting is applicable).</p></div>
*
* <p>Stroking a glyph with an outside border does not increase {@code horiAdvance} or {@code vertAdvance}; you have to manually adjust these values to
* account for the added width and height.</p>
*
* <p>FreeType doesn't use the {@code VORG} table data for CFF fonts because it doesn't have an interface to quickly retrieve the glyph height. The
* y~coordinate of the vertical origin can be simply computed as {@code vertBearingY + height} after loading a glyph.</p>
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Glyph_Metrics {
* FT_Pos {@link #width};
* FT_Pos {@link #height};
* FT_Pos {@link #horiBearingX};
* FT_Pos {@link #horiBearingY};
* FT_Pos {@link #horiAdvance};
* FT_Pos {@link #vertBearingX};
* FT_Pos {@link #vertBearingY};
* FT_Pos {@link #vertAdvance};
* }</code></pre>
*/
public class FT_Glyph_Metrics extends Struct<FT_Glyph_Metrics> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
WIDTH,
HEIGHT,
HORIBEARINGX,
HORIBEARINGY,
HORIADVANCE,
VERTBEARINGX,
VERTBEARINGY,
VERTADVANCE;
static {
Layout layout = __struct(
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
WIDTH = layout.offsetof(0);
HEIGHT = layout.offsetof(1);
HORIBEARINGX = layout.offsetof(2);
HORIBEARINGY = layout.offsetof(3);
HORIADVANCE = layout.offsetof(4);
VERTBEARINGX = layout.offsetof(5);
VERTBEARINGY = layout.offsetof(6);
VERTADVANCE = layout.offsetof(7);
}
protected FT_Glyph_Metrics(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Glyph_Metrics create(long address, @Nullable ByteBuffer container) {
return new FT_Glyph_Metrics(address, container);
}
/**
* Creates a {@code FT_Glyph_Metrics} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Glyph_Metrics(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** the glyph's width */
@NativeType("FT_Pos")
public long width() { return nwidth(address()); }
/** the glyph's height */
@NativeType("FT_Pos")
public long height() { return nheight(address()); }
/** left side bearing for horizontal layout */
@NativeType("FT_Pos")
public long horiBearingX() { return nhoriBearingX(address()); }
/** top side bearing for horizontal layout */
@NativeType("FT_Pos")
public long horiBearingY() { return nhoriBearingY(address()); }
/** advance width for horizontal layout */
@NativeType("FT_Pos")
public long horiAdvance() { return nhoriAdvance(address()); }
/** left side bearing for vertical layout */
@NativeType("FT_Pos")
public long vertBearingX() { return nvertBearingX(address()); }
/** top side bearing for vertical layout. Larger positive values mean further below the vertical glyph origin */
@NativeType("FT_Pos")
public long vertBearingY() { return nvertBearingY(address()); }
/** advance height for vertical layout. Positive values mean the glyph has a positive advance downward */
@NativeType("FT_Pos")
public long vertAdvance() { return nvertAdvance(address()); }
// -----------------------------------
/** Returns a new {@code FT_Glyph_Metrics} instance for the specified memory address. */
public static FT_Glyph_Metrics create(long address) {
return new FT_Glyph_Metrics(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Glyph_Metrics createSafe(long address) {
return address == NULL ? null : new FT_Glyph_Metrics(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #width}. */
public static long nwidth(long struct) { return memGetCLong(struct + FT_Glyph_Metrics.WIDTH); }
/** Unsafe version of {@link #height}. */
public static long nheight(long struct) { return memGetCLong(struct + FT_Glyph_Metrics.HEIGHT); }
/** Unsafe version of {@link #horiBearingX}. */
public static long nhoriBearingX(long struct) { return memGetCLong(struct + FT_Glyph_Metrics.HORIBEARINGX); }
/** Unsafe version of {@link #horiBearingY}. */
public static long nhoriBearingY(long struct) { return memGetCLong(struct + FT_Glyph_Metrics.HORIBEARINGY); }
/** Unsafe version of {@link #horiAdvance}. */
public static long nhoriAdvance(long struct) { return memGetCLong(struct + FT_Glyph_Metrics.HORIADVANCE); }
/** Unsafe version of {@link #vertBearingX}. */
public static long nvertBearingX(long struct) { return memGetCLong(struct + FT_Glyph_Metrics.VERTBEARINGX); }
/** Unsafe version of {@link #vertBearingY}. */
public static long nvertBearingY(long struct) { return memGetCLong(struct + FT_Glyph_Metrics.VERTBEARINGY); }
/** Unsafe version of {@link #vertAdvance}. */
public static long nvertAdvance(long struct) { return memGetCLong(struct + FT_Glyph_Metrics.VERTADVANCE); }
// -----------------------------------
/** An array of {@link FT_Glyph_Metrics} structs. */
public static class Buffer extends StructBuffer<FT_Glyph_Metrics, Buffer> {
private static final FT_Glyph_Metrics ELEMENT_FACTORY = FT_Glyph_Metrics.create(-1L);
/**
* Creates a new {@code FT_Glyph_Metrics.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Glyph_Metrics#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Glyph_Metrics getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@link FT_Glyph_Metrics#width} field. */
@NativeType("FT_Pos")
public long width() { return FT_Glyph_Metrics.nwidth(address()); }
/** @return the value of the {@link FT_Glyph_Metrics#height} field. */
@NativeType("FT_Pos")
public long height() { return FT_Glyph_Metrics.nheight(address()); }
/** @return the value of the {@link FT_Glyph_Metrics#horiBearingX} field. */
@NativeType("FT_Pos")
public long horiBearingX() { return FT_Glyph_Metrics.nhoriBearingX(address()); }
/** @return the value of the {@link FT_Glyph_Metrics#horiBearingY} field. */
@NativeType("FT_Pos")
public long horiBearingY() { return FT_Glyph_Metrics.nhoriBearingY(address()); }
/** @return the value of the {@link FT_Glyph_Metrics#horiAdvance} field. */
@NativeType("FT_Pos")
public long horiAdvance() { return FT_Glyph_Metrics.nhoriAdvance(address()); }
/** @return the value of the {@link FT_Glyph_Metrics#vertBearingX} field. */
@NativeType("FT_Pos")
public long vertBearingX() { return FT_Glyph_Metrics.nvertBearingX(address()); }
/** @return the value of the {@link FT_Glyph_Metrics#vertBearingY} field. */
@NativeType("FT_Pos")
public long vertBearingY() { return FT_Glyph_Metrics.nvertBearingY(address()); }
/** @return the value of the {@link FT_Glyph_Metrics#vertAdvance} field. */
@NativeType("FT_Pos")
public long vertAdvance() { return FT_Glyph_Metrics.nvertAdvance(address()); }
}
}

View File

@ -0,0 +1,74 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* void (*{@link #invoke}) (
* FT_Incremental incremental,
* FT_Data *data
* )</code></pre>
*/
public abstract class FT_Incremental_FreeGlyphDataFunc extends Callback implements FT_Incremental_FreeGlyphDataFuncI {
/**
* Creates a {@code FT_Incremental_FreeGlyphDataFunc} instance from the specified function pointer.
*
* @return the new {@code FT_Incremental_FreeGlyphDataFunc}
*/
public static FT_Incremental_FreeGlyphDataFunc create(long functionPointer) {
FT_Incremental_FreeGlyphDataFuncI instance = Callback.get(functionPointer);
return instance instanceof FT_Incremental_FreeGlyphDataFunc
? (FT_Incremental_FreeGlyphDataFunc)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static FT_Incremental_FreeGlyphDataFunc createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code FT_Incremental_FreeGlyphDataFunc} instance that delegates to the specified {@code FT_Incremental_FreeGlyphDataFuncI} instance. */
public static FT_Incremental_FreeGlyphDataFunc create(FT_Incremental_FreeGlyphDataFuncI instance) {
return instance instanceof FT_Incremental_FreeGlyphDataFunc
? (FT_Incremental_FreeGlyphDataFunc)instance
: new Container(instance.address(), instance);
}
protected FT_Incremental_FreeGlyphDataFunc() {
super(CIF);
}
FT_Incremental_FreeGlyphDataFunc(long functionPointer) {
super(functionPointer);
}
private static final class Container extends FT_Incremental_FreeGlyphDataFunc {
private final FT_Incremental_FreeGlyphDataFuncI delegate;
Container(long functionPointer, FT_Incremental_FreeGlyphDataFuncI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public void invoke(long incremental, long data) {
delegate.invoke(incremental, data);
}
}
}

View File

@ -0,0 +1,48 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* void (*{@link #invoke}) (
* FT_Incremental incremental,
* FT_Data *data
* )</code></pre>
*/
@FunctionalInterface
@NativeType("FT_Incremental_FreeGlyphDataFunc")
public interface FT_Incremental_FreeGlyphDataFuncI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_void,
ffi_type_pointer, ffi_type_pointer
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
invoke(
memGetAddress(memGetAddress(args)),
memGetAddress(memGetAddress(args + POINTER_SIZE))
);
}
/** A function used to release the glyph data bytes returned by a successful call to {@link FT_Incremental_GetGlyphDataFunc}. */
void invoke(@NativeType("FT_Incremental") long incremental, @NativeType("FT_Data *") long data);
}

View File

@ -0,0 +1,315 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* A table of functions for accessing fonts that load data incrementally. Used in {@link FT_Incremental_Interface}.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Incremental_FuncsRec {
* {@link FT_Incremental_GetGlyphDataFuncI FT_Incremental_GetGlyphDataFunc} get_glyph_data;
* {@link FT_Incremental_FreeGlyphDataFuncI FT_Incremental_FreeGlyphDataFunc} free_glyph_data;
* {@link FT_Incremental_GetGlyphMetricsFuncI FT_Incremental_GetGlyphMetricsFunc} get_glyph_metrics;
* }</code></pre>
*/
@NativeType("struct FT_Incremental_FuncsRec")
public class FT_Incremental_Funcs extends Struct<FT_Incremental_Funcs> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
GET_GLYPH_DATA,
FREE_GLYPH_DATA,
GET_GLYPH_METRICS;
static {
Layout layout = __struct(
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
GET_GLYPH_DATA = layout.offsetof(0);
FREE_GLYPH_DATA = layout.offsetof(1);
GET_GLYPH_METRICS = layout.offsetof(2);
}
protected FT_Incremental_Funcs(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Incremental_Funcs create(long address, @Nullable ByteBuffer container) {
return new FT_Incremental_Funcs(address, container);
}
/**
* Creates a {@code FT_Incremental_Funcs} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Incremental_Funcs(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code get_glyph_data} field. */
public FT_Incremental_GetGlyphDataFunc get_glyph_data() { return nget_glyph_data(address()); }
/** @return the value of the {@code free_glyph_data} field. */
public FT_Incremental_FreeGlyphDataFunc free_glyph_data() { return nfree_glyph_data(address()); }
/** @return the value of the {@code get_glyph_metrics} field. */
@Nullable
public FT_Incremental_GetGlyphMetricsFunc get_glyph_metrics() { return nget_glyph_metrics(address()); }
/** Sets the specified value to the {@code get_glyph_data} field. */
public FT_Incremental_Funcs get_glyph_data(@NativeType("FT_Incremental_GetGlyphDataFunc") FT_Incremental_GetGlyphDataFuncI value) { nget_glyph_data(address(), value); return this; }
/** Sets the specified value to the {@code free_glyph_data} field. */
public FT_Incremental_Funcs free_glyph_data(@NativeType("FT_Incremental_FreeGlyphDataFunc") FT_Incremental_FreeGlyphDataFuncI value) { nfree_glyph_data(address(), value); return this; }
/** Sets the specified value to the {@code get_glyph_metrics} field. */
public FT_Incremental_Funcs get_glyph_metrics(@Nullable @NativeType("FT_Incremental_GetGlyphMetricsFunc") FT_Incremental_GetGlyphMetricsFuncI value) { nget_glyph_metrics(address(), value); return this; }
/** Initializes this struct with the specified values. */
public FT_Incremental_Funcs set(
FT_Incremental_GetGlyphDataFuncI get_glyph_data,
FT_Incremental_FreeGlyphDataFuncI free_glyph_data,
FT_Incremental_GetGlyphMetricsFuncI get_glyph_metrics
) {
get_glyph_data(get_glyph_data);
free_glyph_data(free_glyph_data);
get_glyph_metrics(get_glyph_metrics);
return this;
}
/**
* Copies the specified struct data to this struct.
*
* @param src the source struct
*
* @return this struct
*/
public FT_Incremental_Funcs set(FT_Incremental_Funcs src) {
memCopy(src.address(), address(), SIZEOF);
return this;
}
// -----------------------------------
/** Returns a new {@code FT_Incremental_Funcs} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_Incremental_Funcs malloc() {
return new FT_Incremental_Funcs(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_Incremental_Funcs} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_Incremental_Funcs calloc() {
return new FT_Incremental_Funcs(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_Incremental_Funcs} instance allocated with {@link BufferUtils}. */
public static FT_Incremental_Funcs create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_Incremental_Funcs(memAddress(container), container);
}
/** Returns a new {@code FT_Incremental_Funcs} instance for the specified memory address. */
public static FT_Incremental_Funcs create(long address) {
return new FT_Incremental_Funcs(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Incremental_Funcs createSafe(long address) {
return address == NULL ? null : new FT_Incremental_Funcs(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_Incremental_Funcs} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_Incremental_Funcs malloc(MemoryStack stack) {
return new FT_Incremental_Funcs(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_Incremental_Funcs} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_Incremental_Funcs calloc(MemoryStack stack) {
return new FT_Incremental_Funcs(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #get_glyph_data}. */
public static FT_Incremental_GetGlyphDataFunc nget_glyph_data(long struct) { return FT_Incremental_GetGlyphDataFunc.create(memGetAddress(struct + FT_Incremental_Funcs.GET_GLYPH_DATA)); }
/** Unsafe version of {@link #free_glyph_data}. */
public static FT_Incremental_FreeGlyphDataFunc nfree_glyph_data(long struct) { return FT_Incremental_FreeGlyphDataFunc.create(memGetAddress(struct + FT_Incremental_Funcs.FREE_GLYPH_DATA)); }
/** Unsafe version of {@link #get_glyph_metrics}. */
@Nullable public static FT_Incremental_GetGlyphMetricsFunc nget_glyph_metrics(long struct) { return FT_Incremental_GetGlyphMetricsFunc.createSafe(memGetAddress(struct + FT_Incremental_Funcs.GET_GLYPH_METRICS)); }
/** Unsafe version of {@link #get_glyph_data(FT_Incremental_GetGlyphDataFuncI) get_glyph_data}. */
public static void nget_glyph_data(long struct, FT_Incremental_GetGlyphDataFuncI value) { memPutAddress(struct + FT_Incremental_Funcs.GET_GLYPH_DATA, value.address()); }
/** Unsafe version of {@link #free_glyph_data(FT_Incremental_FreeGlyphDataFuncI) free_glyph_data}. */
public static void nfree_glyph_data(long struct, FT_Incremental_FreeGlyphDataFuncI value) { memPutAddress(struct + FT_Incremental_Funcs.FREE_GLYPH_DATA, value.address()); }
/** Unsafe version of {@link #get_glyph_metrics(FT_Incremental_GetGlyphMetricsFuncI) get_glyph_metrics}. */
public static void nget_glyph_metrics(long struct, @Nullable FT_Incremental_GetGlyphMetricsFuncI value) { memPutAddress(struct + FT_Incremental_Funcs.GET_GLYPH_METRICS, memAddressSafe(value)); }
/**
* Validates pointer members that should not be {@code NULL}.
*
* @param struct the struct to validate
*/
public static void validate(long struct) {
check(memGetAddress(struct + FT_Incremental_Funcs.GET_GLYPH_DATA));
check(memGetAddress(struct + FT_Incremental_Funcs.FREE_GLYPH_DATA));
}
// -----------------------------------
/** An array of {@link FT_Incremental_Funcs} structs. */
public static class Buffer extends StructBuffer<FT_Incremental_Funcs, Buffer> implements NativeResource {
private static final FT_Incremental_Funcs ELEMENT_FACTORY = FT_Incremental_Funcs.create(-1L);
/**
* Creates a new {@code FT_Incremental_Funcs.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Incremental_Funcs#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Incremental_Funcs getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code get_glyph_data} field. */
public FT_Incremental_GetGlyphDataFunc get_glyph_data() { return FT_Incremental_Funcs.nget_glyph_data(address()); }
/** @return the value of the {@code free_glyph_data} field. */
public FT_Incremental_FreeGlyphDataFunc free_glyph_data() { return FT_Incremental_Funcs.nfree_glyph_data(address()); }
/** @return the value of the {@code get_glyph_metrics} field. */
@Nullable
public FT_Incremental_GetGlyphMetricsFunc get_glyph_metrics() { return FT_Incremental_Funcs.nget_glyph_metrics(address()); }
/** Sets the specified value to the {@code get_glyph_data} field. */
public Buffer get_glyph_data(@NativeType("FT_Incremental_GetGlyphDataFunc") FT_Incremental_GetGlyphDataFuncI value) { FT_Incremental_Funcs.nget_glyph_data(address(), value); return this; }
/** Sets the specified value to the {@code free_glyph_data} field. */
public Buffer free_glyph_data(@NativeType("FT_Incremental_FreeGlyphDataFunc") FT_Incremental_FreeGlyphDataFuncI value) { FT_Incremental_Funcs.nfree_glyph_data(address(), value); return this; }
/** Sets the specified value to the {@code get_glyph_metrics} field. */
public Buffer get_glyph_metrics(@Nullable @NativeType("FT_Incremental_GetGlyphMetricsFunc") FT_Incremental_GetGlyphMetricsFuncI value) { FT_Incremental_Funcs.nget_glyph_metrics(address(), value); return this; }
}
}

View File

@ -0,0 +1,75 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* FT_Error (*{@link #invoke}) (
* FT_Incremental incremental,
* FT_UInt glyph_index,
* FT_Data *adata
* )</code></pre>
*/
public abstract class FT_Incremental_GetGlyphDataFunc extends Callback implements FT_Incremental_GetGlyphDataFuncI {
/**
* Creates a {@code FT_Incremental_GetGlyphDataFunc} instance from the specified function pointer.
*
* @return the new {@code FT_Incremental_GetGlyphDataFunc}
*/
public static FT_Incremental_GetGlyphDataFunc create(long functionPointer) {
FT_Incremental_GetGlyphDataFuncI instance = Callback.get(functionPointer);
return instance instanceof FT_Incremental_GetGlyphDataFunc
? (FT_Incremental_GetGlyphDataFunc)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static FT_Incremental_GetGlyphDataFunc createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code FT_Incremental_GetGlyphDataFunc} instance that delegates to the specified {@code FT_Incremental_GetGlyphDataFuncI} instance. */
public static FT_Incremental_GetGlyphDataFunc create(FT_Incremental_GetGlyphDataFuncI instance) {
return instance instanceof FT_Incremental_GetGlyphDataFunc
? (FT_Incremental_GetGlyphDataFunc)instance
: new Container(instance.address(), instance);
}
protected FT_Incremental_GetGlyphDataFunc() {
super(CIF);
}
FT_Incremental_GetGlyphDataFunc(long functionPointer) {
super(functionPointer);
}
private static final class Container extends FT_Incremental_GetGlyphDataFunc {
private final FT_Incremental_GetGlyphDataFuncI delegate;
Container(long functionPointer, FT_Incremental_GetGlyphDataFuncI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public int invoke(long incremental, int glyph_index, long adata) {
return delegate.invoke(incremental, glyph_index, adata);
}
}
}

View File

@ -0,0 +1,51 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* FT_Error (*{@link #invoke}) (
* FT_Incremental incremental,
* FT_UInt glyph_index,
* FT_Data *adata
* )</code></pre>
*/
@FunctionalInterface
@NativeType("FT_Incremental_GetGlyphDataFunc")
public interface FT_Incremental_GetGlyphDataFuncI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_sint32,
ffi_type_pointer, ffi_type_uint32, ffi_type_pointer
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
int __result = invoke(
memGetAddress(memGetAddress(args)),
memGetInt(memGetAddress(args + POINTER_SIZE)),
memGetAddress(memGetAddress(args + 2 * POINTER_SIZE))
);
apiClosureRet(ret, __result);
}
/** A function called by FreeType to access a given glyph's data bytes during {@link FreeType#FT_Load_Glyph Load_Glyph} or {@link FreeType#FT_Load_Char Load_Char} if incremental loading is enabled. */
@NativeType("FT_Error") int invoke(@NativeType("FT_Incremental") long incremental, @NativeType("FT_UInt") int glyph_index, @NativeType("FT_Data *") long adata);
}

View File

@ -0,0 +1,76 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* FT_Error (*{@link #invoke}) (
* FT_Incremental incremental,
* FT_UInt glyph_index,
* FT_Bool vertical,
* FT_Incremental_MetricsRec *ametrics
* )</code></pre>
*/
public abstract class FT_Incremental_GetGlyphMetricsFunc extends Callback implements FT_Incremental_GetGlyphMetricsFuncI {
/**
* Creates a {@code FT_Incremental_GetGlyphMetricsFunc} instance from the specified function pointer.
*
* @return the new {@code FT_Incremental_GetGlyphMetricsFunc}
*/
public static FT_Incremental_GetGlyphMetricsFunc create(long functionPointer) {
FT_Incremental_GetGlyphMetricsFuncI instance = Callback.get(functionPointer);
return instance instanceof FT_Incremental_GetGlyphMetricsFunc
? (FT_Incremental_GetGlyphMetricsFunc)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static FT_Incremental_GetGlyphMetricsFunc createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code FT_Incremental_GetGlyphMetricsFunc} instance that delegates to the specified {@code FT_Incremental_GetGlyphMetricsFuncI} instance. */
public static FT_Incremental_GetGlyphMetricsFunc create(FT_Incremental_GetGlyphMetricsFuncI instance) {
return instance instanceof FT_Incremental_GetGlyphMetricsFunc
? (FT_Incremental_GetGlyphMetricsFunc)instance
: new Container(instance.address(), instance);
}
protected FT_Incremental_GetGlyphMetricsFunc() {
super(CIF);
}
FT_Incremental_GetGlyphMetricsFunc(long functionPointer) {
super(functionPointer);
}
private static final class Container extends FT_Incremental_GetGlyphMetricsFunc {
private final FT_Incremental_GetGlyphMetricsFuncI delegate;
Container(long functionPointer, FT_Incremental_GetGlyphMetricsFuncI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public int invoke(long incremental, int glyph_index, boolean vertical, long ametrics) {
return delegate.invoke(incremental, glyph_index, vertical, ametrics);
}
}
}

View File

@ -0,0 +1,53 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* FT_Error (*{@link #invoke}) (
* FT_Incremental incremental,
* FT_UInt glyph_index,
* FT_Bool vertical,
* FT_Incremental_MetricsRec *ametrics
* )</code></pre>
*/
@FunctionalInterface
@NativeType("FT_Incremental_GetGlyphMetricsFunc")
public interface FT_Incremental_GetGlyphMetricsFuncI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_sint32,
ffi_type_pointer, ffi_type_uint32, ffi_type_uint8, ffi_type_pointer
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
int __result = invoke(
memGetAddress(memGetAddress(args)),
memGetInt(memGetAddress(args + POINTER_SIZE)),
memGetByte(memGetAddress(args + 2 * POINTER_SIZE)) != 0,
memGetAddress(memGetAddress(args + 3 * POINTER_SIZE))
);
apiClosureRet(ret, __result);
}
/** A function used to retrieve the basic metrics of a given glyph index before accessing its data. */
@NativeType("FT_Error") int invoke(@NativeType("FT_Incremental") long incremental, @NativeType("FT_UInt") int glyph_index, @NativeType("FT_Bool") boolean vertical, @NativeType("FT_Incremental_MetricsRec *") long ametrics);
}

View File

@ -0,0 +1,300 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* A structure to be used with {@link FreeType#FT_Open_Face Open_Face} to indicate that the user wants to support incremental glyph loading.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Incremental_InterfaceRec {
* {@link FT_Incremental_Funcs FT_Incremental_FuncsRec} const * funcs;
* FT_Incremental object;
* }</code></pre>
*/
@NativeType("struct FT_Incremental_InterfaceRec")
public class FT_Incremental_Interface extends Struct<FT_Incremental_Interface> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
FUNCS,
OBJECT;
static {
Layout layout = __struct(
__member(POINTER_SIZE),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
FUNCS = layout.offsetof(0);
OBJECT = layout.offsetof(1);
}
protected FT_Incremental_Interface(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Incremental_Interface create(long address, @Nullable ByteBuffer container) {
return new FT_Incremental_Interface(address, container);
}
/**
* Creates a {@code FT_Incremental_Interface} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Incremental_Interface(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link FT_Incremental_Funcs} view of the struct pointed to by the {@code funcs} field. */
@NativeType("FT_Incremental_FuncsRec const *")
public FT_Incremental_Funcs funcs() { return nfuncs(address()); }
/** @return the value of the {@code object} field. */
@NativeType("FT_Incremental")
public long object() { return nobject(address()); }
/** Sets the address of the specified {@link FT_Incremental_Funcs} to the {@code funcs} field. */
public FT_Incremental_Interface funcs(@NativeType("FT_Incremental_FuncsRec const *") FT_Incremental_Funcs value) { nfuncs(address(), value); return this; }
/** Sets the specified value to the {@code object} field. */
public FT_Incremental_Interface object(@NativeType("FT_Incremental") long value) { nobject(address(), value); return this; }
/** Initializes this struct with the specified values. */
public FT_Incremental_Interface set(
FT_Incremental_Funcs funcs,
long object
) {
funcs(funcs);
object(object);
return this;
}
/**
* Copies the specified struct data to this struct.
*
* @param src the source struct
*
* @return this struct
*/
public FT_Incremental_Interface set(FT_Incremental_Interface src) {
memCopy(src.address(), address(), SIZEOF);
return this;
}
// -----------------------------------
/** Returns a new {@code FT_Incremental_Interface} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_Incremental_Interface malloc() {
return new FT_Incremental_Interface(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_Incremental_Interface} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_Incremental_Interface calloc() {
return new FT_Incremental_Interface(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_Incremental_Interface} instance allocated with {@link BufferUtils}. */
public static FT_Incremental_Interface create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_Incremental_Interface(memAddress(container), container);
}
/** Returns a new {@code FT_Incremental_Interface} instance for the specified memory address. */
public static FT_Incremental_Interface create(long address) {
return new FT_Incremental_Interface(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Incremental_Interface createSafe(long address) {
return address == NULL ? null : new FT_Incremental_Interface(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_Incremental_Interface} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_Incremental_Interface malloc(MemoryStack stack) {
return new FT_Incremental_Interface(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_Incremental_Interface} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_Incremental_Interface calloc(MemoryStack stack) {
return new FT_Incremental_Interface(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #funcs}. */
public static FT_Incremental_Funcs nfuncs(long struct) { return FT_Incremental_Funcs.create(memGetAddress(struct + FT_Incremental_Interface.FUNCS)); }
/** Unsafe version of {@link #object}. */
public static long nobject(long struct) { return memGetAddress(struct + FT_Incremental_Interface.OBJECT); }
/** Unsafe version of {@link #funcs(FT_Incremental_Funcs) funcs}. */
public static void nfuncs(long struct, FT_Incremental_Funcs value) { memPutAddress(struct + FT_Incremental_Interface.FUNCS, value.address()); }
/** Unsafe version of {@link #object(long) object}. */
public static void nobject(long struct, long value) { memPutAddress(struct + FT_Incremental_Interface.OBJECT, value); }
/**
* Validates pointer members that should not be {@code NULL}.
*
* @param struct the struct to validate
*/
public static void validate(long struct) {
long funcs = memGetAddress(struct + FT_Incremental_Interface.FUNCS);
check(funcs);
FT_Incremental_Funcs.validate(funcs);
}
// -----------------------------------
/** An array of {@link FT_Incremental_Interface} structs. */
public static class Buffer extends StructBuffer<FT_Incremental_Interface, Buffer> implements NativeResource {
private static final FT_Incremental_Interface ELEMENT_FACTORY = FT_Incremental_Interface.create(-1L);
/**
* Creates a new {@code FT_Incremental_Interface.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Incremental_Interface#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Incremental_Interface getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_Incremental_Funcs} view of the struct pointed to by the {@code funcs} field. */
@NativeType("FT_Incremental_FuncsRec const *")
public FT_Incremental_Funcs funcs() { return FT_Incremental_Interface.nfuncs(address()); }
/** @return the value of the {@code object} field. */
@NativeType("FT_Incremental")
public long object() { return FT_Incremental_Interface.nobject(address()); }
/** Sets the address of the specified {@link FT_Incremental_Funcs} to the {@code funcs} field. */
public Buffer funcs(@NativeType("FT_Incremental_FuncsRec const *") FT_Incremental_Funcs value) { FT_Incremental_Interface.nfuncs(address(), value); return this; }
/** Sets the specified value to the {@code object} field. */
public Buffer object(@NativeType("FT_Incremental") long value) { FT_Incremental_Interface.nobject(address(), value); return this; }
}
}

View File

@ -0,0 +1,190 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A small structure used to contain the basic glyph metrics returned by the {@link FT_Incremental_GetGlyphMetricsFunc} method.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Incremental_MetricsRec {
* FT_Long bearing_x;
* FT_Long bearing_y;
* FT_Long advance;
* FT_Long advance_v;
* }</code></pre>
*/
@NativeType("struct FT_Incremental_MetricsRec")
public class FT_Incremental_Metrics extends Struct<FT_Incremental_Metrics> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
BEARING_X,
BEARING_Y,
ADVANCE,
ADVANCE_V;
static {
Layout layout = __struct(
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
BEARING_X = layout.offsetof(0);
BEARING_Y = layout.offsetof(1);
ADVANCE = layout.offsetof(2);
ADVANCE_V = layout.offsetof(3);
}
protected FT_Incremental_Metrics(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Incremental_Metrics create(long address, @Nullable ByteBuffer container) {
return new FT_Incremental_Metrics(address, container);
}
/**
* Creates a {@code FT_Incremental_Metrics} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Incremental_Metrics(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code bearing_x} field. */
@NativeType("FT_Long")
public long bearing_x() { return nbearing_x(address()); }
/** @return the value of the {@code bearing_y} field. */
@NativeType("FT_Long")
public long bearing_y() { return nbearing_y(address()); }
/** @return the value of the {@code advance} field. */
@NativeType("FT_Long")
public long advance() { return nadvance(address()); }
/** @return the value of the {@code advance_v} field. */
@NativeType("FT_Long")
public long advance_v() { return nadvance_v(address()); }
// -----------------------------------
/** Returns a new {@code FT_Incremental_Metrics} instance for the specified memory address. */
public static FT_Incremental_Metrics create(long address) {
return new FT_Incremental_Metrics(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Incremental_Metrics createSafe(long address) {
return address == NULL ? null : new FT_Incremental_Metrics(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #bearing_x}. */
public static long nbearing_x(long struct) { return memGetCLong(struct + FT_Incremental_Metrics.BEARING_X); }
/** Unsafe version of {@link #bearing_y}. */
public static long nbearing_y(long struct) { return memGetCLong(struct + FT_Incremental_Metrics.BEARING_Y); }
/** Unsafe version of {@link #advance}. */
public static long nadvance(long struct) { return memGetCLong(struct + FT_Incremental_Metrics.ADVANCE); }
/** Unsafe version of {@link #advance_v}. */
public static long nadvance_v(long struct) { return memGetCLong(struct + FT_Incremental_Metrics.ADVANCE_V); }
// -----------------------------------
/** An array of {@link FT_Incremental_Metrics} structs. */
public static class Buffer extends StructBuffer<FT_Incremental_Metrics, Buffer> {
private static final FT_Incremental_Metrics ELEMENT_FACTORY = FT_Incremental_Metrics.create(-1L);
/**
* Creates a new {@code FT_Incremental_Metrics.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Incremental_Metrics#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Incremental_Metrics getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code bearing_x} field. */
@NativeType("FT_Long")
public long bearing_x() { return FT_Incremental_Metrics.nbearing_x(address()); }
/** @return the value of the {@code bearing_y} field. */
@NativeType("FT_Long")
public long bearing_y() { return FT_Incremental_Metrics.nbearing_y(address()); }
/** @return the value of the {@code advance} field. */
@NativeType("FT_Long")
public long advance() { return FT_Incremental_Metrics.nadvance(address()); }
/** @return the value of the {@code advance_v} field. */
@NativeType("FT_Long")
public long advance_v() { return FT_Incremental_Metrics.nadvance_v(address()); }
}
}

View File

@ -0,0 +1,271 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* This iterator object is needed for {@link FreeType#FT_Get_Color_Glyph_Layer Get_Color_Glyph_Layer}.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_LayerIterator {
* FT_UInt num_layers;
* FT_UInt layer;
* FT_Byte * p;
* }</code></pre>
*/
public class FT_LayerIterator extends Struct<FT_LayerIterator> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
NUM_LAYERS,
LAYER,
P;
static {
Layout layout = __struct(
__member(4),
__member(4),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
NUM_LAYERS = layout.offsetof(0);
LAYER = layout.offsetof(1);
P = layout.offsetof(2);
}
protected FT_LayerIterator(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_LayerIterator create(long address, @Nullable ByteBuffer container) {
return new FT_LayerIterator(address, container);
}
/**
* Creates a {@code FT_LayerIterator} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_LayerIterator(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code num_layers} field. */
@NativeType("FT_UInt")
public int num_layers() { return nnum_layers(address()); }
/** @return the value of the {@code layer} field. */
@NativeType("FT_UInt")
public int layer() { return nlayer(address()); }
/**
* @return a {@link ByteBuffer} view of the data pointed to by the {@code p} field.
*
* @param capacity the number of elements in the returned buffer
*/
@Nullable
@NativeType("FT_Byte *")
public ByteBuffer p(int capacity) { return np(address(), capacity); }
// -----------------------------------
/** Returns a new {@code FT_LayerIterator} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_LayerIterator malloc() {
return new FT_LayerIterator(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_LayerIterator} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_LayerIterator calloc() {
return new FT_LayerIterator(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_LayerIterator} instance allocated with {@link BufferUtils}. */
public static FT_LayerIterator create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_LayerIterator(memAddress(container), container);
}
/** Returns a new {@code FT_LayerIterator} instance for the specified memory address. */
public static FT_LayerIterator create(long address) {
return new FT_LayerIterator(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_LayerIterator createSafe(long address) {
return address == NULL ? null : new FT_LayerIterator(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_LayerIterator} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_LayerIterator malloc(MemoryStack stack) {
return new FT_LayerIterator(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_LayerIterator} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_LayerIterator calloc(MemoryStack stack) {
return new FT_LayerIterator(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #num_layers}. */
public static int nnum_layers(long struct) { return UNSAFE.getInt(null, struct + FT_LayerIterator.NUM_LAYERS); }
/** Unsafe version of {@link #layer}. */
public static int nlayer(long struct) { return UNSAFE.getInt(null, struct + FT_LayerIterator.LAYER); }
/** Unsafe version of {@link #p(int) p}. */
@Nullable public static ByteBuffer np(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + FT_LayerIterator.P), capacity); }
// -----------------------------------
/** An array of {@link FT_LayerIterator} structs. */
public static class Buffer extends StructBuffer<FT_LayerIterator, Buffer> implements NativeResource {
private static final FT_LayerIterator ELEMENT_FACTORY = FT_LayerIterator.create(-1L);
/**
* Creates a new {@code FT_LayerIterator.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_LayerIterator#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_LayerIterator getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code num_layers} field. */
@NativeType("FT_UInt")
public int num_layers() { return FT_LayerIterator.nnum_layers(address()); }
/** @return the value of the {@code layer} field. */
@NativeType("FT_UInt")
public int layer() { return FT_LayerIterator.nlayer(address()); }
/**
* @return a {@link ByteBuffer} view of the data pointed to by the {@code p} field.
*
* @param capacity the number of elements in the returned buffer
*/
@Nullable
@NativeType("FT_Byte *")
public ByteBuffer p(int capacity) { return FT_LayerIterator.np(address(), capacity); }
}
}

View File

@ -0,0 +1,166 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure used to hold a simple doubly-linked list. These are used in many parts of FreeType.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_ListRec {
* {@link FT_ListNode FT_ListNode} head;
* {@link FT_ListNode FT_ListNode} tail;
* }</code></pre>
*/
@NativeType("struct FT_ListRec")
public class FT_List extends Struct<FT_List> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
HEAD,
TAIL;
static {
Layout layout = __struct(
__member(POINTER_SIZE),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
HEAD = layout.offsetof(0);
TAIL = layout.offsetof(1);
}
protected FT_List(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_List create(long address, @Nullable ByteBuffer container) {
return new FT_List(address, container);
}
/**
* Creates a {@code FT_List} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_List(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link FT_ListNode} view of the struct pointed to by the {@code head} field. */
@Nullable
public FT_ListNode head() { return nhead(address()); }
/** @return a {@link FT_ListNode} view of the struct pointed to by the {@code tail} field. */
@Nullable
public FT_ListNode tail() { return ntail(address()); }
// -----------------------------------
/** Returns a new {@code FT_List} instance for the specified memory address. */
public static FT_List create(long address) {
return new FT_List(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_List createSafe(long address) {
return address == NULL ? null : new FT_List(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #head}. */
@Nullable public static FT_ListNode nhead(long struct) { return FT_ListNode.createSafe(memGetAddress(struct + FT_List.HEAD)); }
/** Unsafe version of {@link #tail}. */
@Nullable public static FT_ListNode ntail(long struct) { return FT_ListNode.createSafe(memGetAddress(struct + FT_List.TAIL)); }
// -----------------------------------
/** An array of {@link FT_List} structs. */
public static class Buffer extends StructBuffer<FT_List, Buffer> {
private static final FT_List ELEMENT_FACTORY = FT_List.create(-1L);
/**
* Creates a new {@code FT_List.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_List#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_List getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_ListNode} view of the struct pointed to by the {@code head} field. */
@Nullable
public FT_ListNode head() { return FT_List.nhead(address()); }
/** @return a {@link FT_ListNode} view of the struct pointed to by the {@code tail} field. */
@Nullable
public FT_ListNode tail() { return FT_List.ntail(address()); }
}
}

View File

@ -0,0 +1,186 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure used to hold a single list element.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_ListNodeRec {
* {@link FT_ListNode FT_ListNode} prev;
* {@link FT_ListNode FT_ListNode} next;
* void * data;
* }</code></pre>
*/
@NativeType("struct FT_ListNodeRec")
public class FT_ListNode extends Struct<FT_ListNode> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
PREV,
NEXT,
DATA;
static {
Layout layout = __struct(
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
PREV = layout.offsetof(0);
NEXT = layout.offsetof(1);
DATA = layout.offsetof(2);
}
protected FT_ListNode(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_ListNode create(long address, @Nullable ByteBuffer container) {
return new FT_ListNode(address, container);
}
/**
* Creates a {@code FT_ListNode} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_ListNode(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link FT_ListNode} view of the struct pointed to by the {@code prev} field. */
@Nullable
public FT_ListNode prev() { return nprev(address()); }
/** @return a {@link FT_ListNode} view of the struct pointed to by the {@code next} field. */
@Nullable
public FT_ListNode next() { return nnext(address()); }
/**
* @return a {@link ByteBuffer} view of the data pointed to by the {@code data} field.
*
* @param capacity the number of elements in the returned buffer
*/
@NativeType("void *")
public ByteBuffer data(int capacity) { return ndata(address(), capacity); }
// -----------------------------------
/** Returns a new {@code FT_ListNode} instance for the specified memory address. */
public static FT_ListNode create(long address) {
return new FT_ListNode(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_ListNode createSafe(long address) {
return address == NULL ? null : new FT_ListNode(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #prev}. */
@Nullable public static FT_ListNode nprev(long struct) { return FT_ListNode.createSafe(memGetAddress(struct + FT_ListNode.PREV)); }
/** Unsafe version of {@link #next}. */
@Nullable public static FT_ListNode nnext(long struct) { return FT_ListNode.createSafe(memGetAddress(struct + FT_ListNode.NEXT)); }
/** Unsafe version of {@link #data(int) data}. */
public static ByteBuffer ndata(long struct, int capacity) { return memByteBuffer(memGetAddress(struct + FT_ListNode.DATA), capacity); }
// -----------------------------------
/** An array of {@link FT_ListNode} structs. */
public static class Buffer extends StructBuffer<FT_ListNode, Buffer> {
private static final FT_ListNode ELEMENT_FACTORY = FT_ListNode.create(-1L);
/**
* Creates a new {@code FT_ListNode.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_ListNode#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_ListNode getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_ListNode} view of the struct pointed to by the {@code prev} field. */
@Nullable
public FT_ListNode prev() { return FT_ListNode.nprev(address()); }
/** @return a {@link FT_ListNode} view of the struct pointed to by the {@code next} field. */
@Nullable
public FT_ListNode next() { return FT_ListNode.nnext(address()); }
/**
* @return a {@link ByteBuffer} view of the data pointed to by the {@code data} field.
*
* @param capacity the number of elements in the returned buffer
*/
@NativeType("void *")
public ByteBuffer data(int capacity) { return FT_ListNode.ndata(address(), capacity); }
}
}

View File

@ -0,0 +1,75 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* void (*{@link #invoke}) (
* FT_Memory memory,
* void *data,
* void *user
* )</code></pre>
*/
public abstract class FT_List_Destructor extends Callback implements FT_List_DestructorI {
/**
* Creates a {@code FT_List_Destructor} instance from the specified function pointer.
*
* @return the new {@code FT_List_Destructor}
*/
public static FT_List_Destructor create(long functionPointer) {
FT_List_DestructorI instance = Callback.get(functionPointer);
return instance instanceof FT_List_Destructor
? (FT_List_Destructor)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static FT_List_Destructor createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code FT_List_Destructor} instance that delegates to the specified {@code FT_List_DestructorI} instance. */
public static FT_List_Destructor create(FT_List_DestructorI instance) {
return instance instanceof FT_List_Destructor
? (FT_List_Destructor)instance
: new Container(instance.address(), instance);
}
protected FT_List_Destructor() {
super(CIF);
}
FT_List_Destructor(long functionPointer) {
super(functionPointer);
}
private static final class Container extends FT_List_Destructor {
private final FT_List_DestructorI delegate;
Container(long functionPointer, FT_List_DestructorI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public void invoke(long memory, long data, long user) {
delegate.invoke(memory, data, user);
}
}
}

View File

@ -0,0 +1,50 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* void (*{@link #invoke}) (
* FT_Memory memory,
* void *data,
* void *user
* )</code></pre>
*/
@FunctionalInterface
@NativeType("FT_List_Destructor")
public interface FT_List_DestructorI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_void,
ffi_type_pointer, ffi_type_pointer, ffi_type_pointer
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
invoke(
memGetAddress(memGetAddress(args)),
memGetAddress(memGetAddress(args + POINTER_SIZE)),
memGetAddress(memGetAddress(args + 2 * POINTER_SIZE))
);
}
/** An {@code FT_List} iterator function that is called during a list finalization by {@link FreeType#FT_List_Finalize List_Finalize} to destroy all elements in a given list. */
void invoke(@NativeType("FT_Memory") long memory, @NativeType("void *") long data, @NativeType("void *") long user);
}

View File

@ -0,0 +1,74 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* FT_Error (*{@link #invoke}) (
* FT_ListNode node,
* void *user
* )</code></pre>
*/
public abstract class FT_List_Iterator extends Callback implements FT_List_IteratorI {
/**
* Creates a {@code FT_List_Iterator} instance from the specified function pointer.
*
* @return the new {@code FT_List_Iterator}
*/
public static FT_List_Iterator create(long functionPointer) {
FT_List_IteratorI instance = Callback.get(functionPointer);
return instance instanceof FT_List_Iterator
? (FT_List_Iterator)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static FT_List_Iterator createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code FT_List_Iterator} instance that delegates to the specified {@code FT_List_IteratorI} instance. */
public static FT_List_Iterator create(FT_List_IteratorI instance) {
return instance instanceof FT_List_Iterator
? (FT_List_Iterator)instance
: new Container(instance.address(), instance);
}
protected FT_List_Iterator() {
super(CIF);
}
FT_List_Iterator(long functionPointer) {
super(functionPointer);
}
private static final class Container extends FT_List_Iterator {
private final FT_List_IteratorI delegate;
Container(long functionPointer, FT_List_IteratorI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public int invoke(long node, long user) {
return delegate.invoke(node, user);
}
}
}

View File

@ -0,0 +1,49 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* FT_Error (*{@link #invoke}) (
* FT_ListNode node,
* void *user
* )</code></pre>
*/
@FunctionalInterface
@NativeType("FT_List_Iterator")
public interface FT_List_IteratorI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_sint32,
ffi_type_pointer, ffi_type_pointer
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
int __result = invoke(
memGetAddress(memGetAddress(args)),
memGetAddress(memGetAddress(args + POINTER_SIZE))
);
apiClosureRet(ret, __result);
}
/** An {@code FT_List} iterator function that is called during a list parse by {@link FreeType#FT_List_Iterate List_Iterate}. */
@NativeType("FT_Error") int invoke(@NativeType("FT_ListNode") long node, @NativeType("void *") long user);
}

View File

@ -0,0 +1,185 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure to model a given axis in design space for Multiple Masters fonts.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_MM_Axis {
* FT_String * name;
* FT_Long minimum;
* FT_Long maximum;
* }</code></pre>
*/
public class FT_MM_Axis extends Struct<FT_MM_Axis> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
NAME,
MINIMUM,
MAXIMUM;
static {
Layout layout = __struct(
__member(POINTER_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
NAME = layout.offsetof(0);
MINIMUM = layout.offsetof(1);
MAXIMUM = layout.offsetof(2);
}
protected FT_MM_Axis(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_MM_Axis create(long address, @Nullable ByteBuffer container) {
return new FT_MM_Axis(address, container);
}
/**
* Creates a {@code FT_MM_Axis} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_MM_Axis(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code name} field. */
@NativeType("FT_String *")
public ByteBuffer name() { return nname(address()); }
/** @return the null-terminated string pointed to by the {@code name} field. */
@NativeType("FT_String *")
public String nameString() { return nnameString(address()); }
/** @return the value of the {@code minimum} field. */
@NativeType("FT_Long")
public long minimum() { return nminimum(address()); }
/** @return the value of the {@code maximum} field. */
@NativeType("FT_Long")
public long maximum() { return nmaximum(address()); }
// -----------------------------------
/** Returns a new {@code FT_MM_Axis} instance for the specified memory address. */
public static FT_MM_Axis create(long address) {
return new FT_MM_Axis(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_MM_Axis createSafe(long address) {
return address == NULL ? null : new FT_MM_Axis(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #name}. */
public static ByteBuffer nname(long struct) { return memByteBufferNT1(memGetAddress(struct + FT_MM_Axis.NAME)); }
/** Unsafe version of {@link #nameString}. */
public static String nnameString(long struct) { return memUTF8(memGetAddress(struct + FT_MM_Axis.NAME)); }
/** Unsafe version of {@link #minimum}. */
public static long nminimum(long struct) { return memGetCLong(struct + FT_MM_Axis.MINIMUM); }
/** Unsafe version of {@link #maximum}. */
public static long nmaximum(long struct) { return memGetCLong(struct + FT_MM_Axis.MAXIMUM); }
// -----------------------------------
/** An array of {@link FT_MM_Axis} structs. */
public static class Buffer extends StructBuffer<FT_MM_Axis, Buffer> {
private static final FT_MM_Axis ELEMENT_FACTORY = FT_MM_Axis.create(-1L);
/**
* Creates a new {@code FT_MM_Axis.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_MM_Axis#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_MM_Axis getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code name} field. */
@NativeType("FT_String *")
public ByteBuffer name() { return FT_MM_Axis.nname(address()); }
/** @return the null-terminated string pointed to by the {@code name} field. */
@NativeType("FT_String *")
public String nameString() { return FT_MM_Axis.nnameString(address()); }
/** @return the value of the {@code minimum} field. */
@NativeType("FT_Long")
public long minimum() { return FT_MM_Axis.nminimum(address()); }
/** @return the value of the {@code maximum} field. */
@NativeType("FT_Long")
public long maximum() { return FT_MM_Axis.nmaximum(address()); }
}
}

View File

@ -0,0 +1,285 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* A structure to model the axes and space of an Adobe MM, TrueType GX, or OpenType variation font.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_MM_Var {
* FT_UInt num_axis;
* FT_UInt num_designs;
* FT_UInt num_namedstyles;
* {@link FT_Var_Axis FT_Var_Axis} * axis;
* {@link FT_Var_Named_Style FT_Var_Named_Style} * namedstyle;
* }</code></pre>
*/
public class FT_MM_Var extends Struct<FT_MM_Var> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
NUM_AXIS,
NUM_DESIGNS,
NUM_NAMEDSTYLES,
AXIS,
NAMEDSTYLE;
static {
Layout layout = __struct(
__member(4),
__member(4),
__member(4),
__member(POINTER_SIZE),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
NUM_AXIS = layout.offsetof(0);
NUM_DESIGNS = layout.offsetof(1);
NUM_NAMEDSTYLES = layout.offsetof(2);
AXIS = layout.offsetof(3);
NAMEDSTYLE = layout.offsetof(4);
}
protected FT_MM_Var(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_MM_Var create(long address, @Nullable ByteBuffer container) {
return new FT_MM_Var(address, container);
}
/**
* Creates a {@code FT_MM_Var} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_MM_Var(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code num_axis} field. */
@NativeType("FT_UInt")
public int num_axis() { return nnum_axis(address()); }
/** @return the value of the {@code num_designs} field. */
@NativeType("FT_UInt")
public int num_designs() { return nnum_designs(address()); }
/** @return the value of the {@code num_namedstyles} field. */
@NativeType("FT_UInt")
public int num_namedstyles() { return nnum_namedstyles(address()); }
/** @return a {@link FT_Var_Axis.Buffer} view of the struct array pointed to by the {@code axis} field. */
@NativeType("FT_Var_Axis *")
public FT_Var_Axis.Buffer axis() { return naxis(address()); }
/** @return a {@link FT_Var_Named_Style.Buffer} view of the struct array pointed to by the {@code namedstyle} field. */
@NativeType("FT_Var_Named_Style *")
public FT_Var_Named_Style.Buffer namedstyle() { return nnamedstyle(address()); }
// -----------------------------------
/** Returns a new {@code FT_MM_Var} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_MM_Var malloc() {
return new FT_MM_Var(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_MM_Var} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_MM_Var calloc() {
return new FT_MM_Var(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_MM_Var} instance allocated with {@link BufferUtils}. */
public static FT_MM_Var create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_MM_Var(memAddress(container), container);
}
/** Returns a new {@code FT_MM_Var} instance for the specified memory address. */
public static FT_MM_Var create(long address) {
return new FT_MM_Var(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_MM_Var createSafe(long address) {
return address == NULL ? null : new FT_MM_Var(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_MM_Var} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_MM_Var malloc(MemoryStack stack) {
return new FT_MM_Var(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_MM_Var} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_MM_Var calloc(MemoryStack stack) {
return new FT_MM_Var(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #num_axis}. */
public static int nnum_axis(long struct) { return UNSAFE.getInt(null, struct + FT_MM_Var.NUM_AXIS); }
/** Unsafe version of {@link #num_designs}. */
public static int nnum_designs(long struct) { return UNSAFE.getInt(null, struct + FT_MM_Var.NUM_DESIGNS); }
/** Unsafe version of {@link #num_namedstyles}. */
public static int nnum_namedstyles(long struct) { return UNSAFE.getInt(null, struct + FT_MM_Var.NUM_NAMEDSTYLES); }
/** Unsafe version of {@link #axis}. */
public static FT_Var_Axis.Buffer naxis(long struct) { return FT_Var_Axis.create(memGetAddress(struct + FT_MM_Var.AXIS), nnum_axis(struct)); }
/** Unsafe version of {@link #namedstyle}. */
public static FT_Var_Named_Style.Buffer nnamedstyle(long struct) { return FT_Var_Named_Style.create(memGetAddress(struct + FT_MM_Var.NAMEDSTYLE), nnum_namedstyles(struct)); }
// -----------------------------------
/** An array of {@link FT_MM_Var} structs. */
public static class Buffer extends StructBuffer<FT_MM_Var, Buffer> implements NativeResource {
private static final FT_MM_Var ELEMENT_FACTORY = FT_MM_Var.create(-1L);
/**
* Creates a new {@code FT_MM_Var.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_MM_Var#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_MM_Var getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code num_axis} field. */
@NativeType("FT_UInt")
public int num_axis() { return FT_MM_Var.nnum_axis(address()); }
/** @return the value of the {@code num_designs} field. */
@NativeType("FT_UInt")
public int num_designs() { return FT_MM_Var.nnum_designs(address()); }
/** @return the value of the {@code num_namedstyles} field. */
@NativeType("FT_UInt")
public int num_namedstyles() { return FT_MM_Var.nnum_namedstyles(address()); }
/** @return a {@link FT_Var_Axis.Buffer} view of the struct array pointed to by the {@code axis} field. */
@NativeType("FT_Var_Axis *")
public FT_Var_Axis.Buffer axis() { return FT_MM_Var.naxis(address()); }
/** @return a {@link FT_Var_Named_Style.Buffer} view of the struct array pointed to by the {@code namedstyle} field. */
@NativeType("FT_Var_Named_Style *")
public FT_Var_Named_Style.Buffer namedstyle() { return FT_MM_Var.nnamedstyle(address()); }
}
}

View File

@ -0,0 +1,327 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* A simple structure used to store a 2x2 matrix. Coefficients are in 16.16 fixed-point format.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Matrix {
* FT_Fixed xx;
* FT_Fixed xy;
* FT_Fixed yx;
* FT_Fixed yy;
* }</code></pre>
*/
public class FT_Matrix extends Struct<FT_Matrix> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
XX,
XY,
YX,
YY;
static {
Layout layout = __struct(
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
XX = layout.offsetof(0);
XY = layout.offsetof(1);
YX = layout.offsetof(2);
YY = layout.offsetof(3);
}
protected FT_Matrix(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Matrix create(long address, @Nullable ByteBuffer container) {
return new FT_Matrix(address, container);
}
/**
* Creates a {@code FT_Matrix} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Matrix(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code xx} field. */
@NativeType("FT_Fixed")
public long xx() { return nxx(address()); }
/** @return the value of the {@code xy} field. */
@NativeType("FT_Fixed")
public long xy() { return nxy(address()); }
/** @return the value of the {@code yx} field. */
@NativeType("FT_Fixed")
public long yx() { return nyx(address()); }
/** @return the value of the {@code yy} field. */
@NativeType("FT_Fixed")
public long yy() { return nyy(address()); }
/** Sets the specified value to the {@code xx} field. */
public FT_Matrix xx(@NativeType("FT_Fixed") long value) { nxx(address(), value); return this; }
/** Sets the specified value to the {@code xy} field. */
public FT_Matrix xy(@NativeType("FT_Fixed") long value) { nxy(address(), value); return this; }
/** Sets the specified value to the {@code yx} field. */
public FT_Matrix yx(@NativeType("FT_Fixed") long value) { nyx(address(), value); return this; }
/** Sets the specified value to the {@code yy} field. */
public FT_Matrix yy(@NativeType("FT_Fixed") long value) { nyy(address(), value); return this; }
/** Initializes this struct with the specified values. */
public FT_Matrix set(
long xx,
long xy,
long yx,
long yy
) {
xx(xx);
xy(xy);
yx(yx);
yy(yy);
return this;
}
/**
* Copies the specified struct data to this struct.
*
* @param src the source struct
*
* @return this struct
*/
public FT_Matrix set(FT_Matrix src) {
memCopy(src.address(), address(), SIZEOF);
return this;
}
// -----------------------------------
/** Returns a new {@code FT_Matrix} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_Matrix malloc() {
return new FT_Matrix(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_Matrix} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_Matrix calloc() {
return new FT_Matrix(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_Matrix} instance allocated with {@link BufferUtils}. */
public static FT_Matrix create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_Matrix(memAddress(container), container);
}
/** Returns a new {@code FT_Matrix} instance for the specified memory address. */
public static FT_Matrix create(long address) {
return new FT_Matrix(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Matrix createSafe(long address) {
return address == NULL ? null : new FT_Matrix(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_Matrix} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_Matrix malloc(MemoryStack stack) {
return new FT_Matrix(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_Matrix} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_Matrix calloc(MemoryStack stack) {
return new FT_Matrix(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #xx}. */
public static long nxx(long struct) { return memGetCLong(struct + FT_Matrix.XX); }
/** Unsafe version of {@link #xy}. */
public static long nxy(long struct) { return memGetCLong(struct + FT_Matrix.XY); }
/** Unsafe version of {@link #yx}. */
public static long nyx(long struct) { return memGetCLong(struct + FT_Matrix.YX); }
/** Unsafe version of {@link #yy}. */
public static long nyy(long struct) { return memGetCLong(struct + FT_Matrix.YY); }
/** Unsafe version of {@link #xx(long) xx}. */
public static void nxx(long struct, long value) { memPutCLong(struct + FT_Matrix.XX, value); }
/** Unsafe version of {@link #xy(long) xy}. */
public static void nxy(long struct, long value) { memPutCLong(struct + FT_Matrix.XY, value); }
/** Unsafe version of {@link #yx(long) yx}. */
public static void nyx(long struct, long value) { memPutCLong(struct + FT_Matrix.YX, value); }
/** Unsafe version of {@link #yy(long) yy}. */
public static void nyy(long struct, long value) { memPutCLong(struct + FT_Matrix.YY, value); }
// -----------------------------------
/** An array of {@link FT_Matrix} structs. */
public static class Buffer extends StructBuffer<FT_Matrix, Buffer> implements NativeResource {
private static final FT_Matrix ELEMENT_FACTORY = FT_Matrix.create(-1L);
/**
* Creates a new {@code FT_Matrix.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Matrix#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Matrix getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code xx} field. */
@NativeType("FT_Fixed")
public long xx() { return FT_Matrix.nxx(address()); }
/** @return the value of the {@code xy} field. */
@NativeType("FT_Fixed")
public long xy() { return FT_Matrix.nxy(address()); }
/** @return the value of the {@code yx} field. */
@NativeType("FT_Fixed")
public long yx() { return FT_Matrix.nyx(address()); }
/** @return the value of the {@code yy} field. */
@NativeType("FT_Fixed")
public long yy() { return FT_Matrix.nyy(address()); }
/** Sets the specified value to the {@code xx} field. */
public Buffer xx(@NativeType("FT_Fixed") long value) { FT_Matrix.nxx(address(), value); return this; }
/** Sets the specified value to the {@code xy} field. */
public Buffer xy(@NativeType("FT_Fixed") long value) { FT_Matrix.nxy(address(), value); return this; }
/** Sets the specified value to the {@code yx} field. */
public Buffer yx(@NativeType("FT_Fixed") long value) { FT_Matrix.nyx(address(), value); return this; }
/** Sets the specified value to the {@code yy} field. */
public Buffer yy(@NativeType("FT_Fixed") long value) { FT_Matrix.nyy(address(), value); return this; }
}
}

View File

@ -0,0 +1,328 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* A structure used to describe a given memory manager to FreeType~2.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_MemoryRec_ {
* void * user;
* {@link FT_Alloc_FuncI FT_Alloc_Func} alloc;
* {@link FT_Free_FuncI FT_Free_Func} free;
* {@link FT_Realloc_FuncI FT_Realloc_Func} realloc;
* }</code></pre>
*/
@NativeType("struct FT_MemoryRec_")
public class FT_Memory extends Struct<FT_Memory> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
USER,
ALLOC,
FREE,
REALLOC;
static {
Layout layout = __struct(
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
USER = layout.offsetof(0);
ALLOC = layout.offsetof(1);
FREE = layout.offsetof(2);
REALLOC = layout.offsetof(3);
}
protected FT_Memory(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Memory create(long address, @Nullable ByteBuffer container) {
return new FT_Memory(address, container);
}
/**
* Creates a {@code FT_Memory} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Memory(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code user} field. */
@NativeType("void *")
public long user() { return nuser(address()); }
/** @return the value of the {@code alloc} field. */
@Nullable
public FT_Alloc_Func alloc() { return nalloc(address()); }
/** @return the value of the {@code free} field. */
@Nullable
public FT_Free_Func free$() { return nfree$(address()); }
/** @return the value of the {@code realloc} field. */
@Nullable
public FT_Realloc_Func realloc() { return nrealloc(address()); }
/** Sets the specified value to the {@code user} field. */
public FT_Memory user(@NativeType("void *") long value) { nuser(address(), value); return this; }
/** Sets the specified value to the {@code alloc} field. */
public FT_Memory alloc(@Nullable @NativeType("FT_Alloc_Func") FT_Alloc_FuncI value) { nalloc(address(), value); return this; }
/** Sets the specified value to the {@code free} field. */
public FT_Memory free$(@Nullable @NativeType("FT_Free_Func") FT_Free_FuncI value) { nfree$(address(), value); return this; }
/** Sets the specified value to the {@code realloc} field. */
public FT_Memory realloc(@Nullable @NativeType("FT_Realloc_Func") FT_Realloc_FuncI value) { nrealloc(address(), value); return this; }
/** Initializes this struct with the specified values. */
public FT_Memory set(
long user,
FT_Alloc_FuncI alloc,
FT_Free_FuncI free$,
FT_Realloc_FuncI realloc
) {
user(user);
alloc(alloc);
free$(free$);
realloc(realloc);
return this;
}
/**
* Copies the specified struct data to this struct.
*
* @param src the source struct
*
* @return this struct
*/
public FT_Memory set(FT_Memory src) {
memCopy(src.address(), address(), SIZEOF);
return this;
}
// -----------------------------------
/** Returns a new {@code FT_Memory} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_Memory malloc() {
return new FT_Memory(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_Memory} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_Memory calloc() {
return new FT_Memory(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_Memory} instance allocated with {@link BufferUtils}. */
public static FT_Memory create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_Memory(memAddress(container), container);
}
/** Returns a new {@code FT_Memory} instance for the specified memory address. */
public static FT_Memory create(long address) {
return new FT_Memory(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Memory createSafe(long address) {
return address == NULL ? null : new FT_Memory(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_Memory} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_Memory malloc(MemoryStack stack) {
return new FT_Memory(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_Memory} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_Memory calloc(MemoryStack stack) {
return new FT_Memory(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #user}. */
public static long nuser(long struct) { return memGetAddress(struct + FT_Memory.USER); }
/** Unsafe version of {@link #alloc}. */
@Nullable public static FT_Alloc_Func nalloc(long struct) { return FT_Alloc_Func.createSafe(memGetAddress(struct + FT_Memory.ALLOC)); }
/** Unsafe version of {@link #free$}. */
@Nullable public static FT_Free_Func nfree$(long struct) { return FT_Free_Func.createSafe(memGetAddress(struct + FT_Memory.FREE)); }
/** Unsafe version of {@link #realloc}. */
@Nullable public static FT_Realloc_Func nrealloc(long struct) { return FT_Realloc_Func.createSafe(memGetAddress(struct + FT_Memory.REALLOC)); }
/** Unsafe version of {@link #user(long) user}. */
public static void nuser(long struct, long value) { memPutAddress(struct + FT_Memory.USER, value); }
/** Unsafe version of {@link #alloc(FT_Alloc_FuncI) alloc}. */
public static void nalloc(long struct, @Nullable FT_Alloc_FuncI value) { memPutAddress(struct + FT_Memory.ALLOC, memAddressSafe(value)); }
/** Unsafe version of {@link #free$(FT_Free_FuncI) free$}. */
public static void nfree$(long struct, @Nullable FT_Free_FuncI value) { memPutAddress(struct + FT_Memory.FREE, memAddressSafe(value)); }
/** Unsafe version of {@link #realloc(FT_Realloc_FuncI) realloc}. */
public static void nrealloc(long struct, @Nullable FT_Realloc_FuncI value) { memPutAddress(struct + FT_Memory.REALLOC, memAddressSafe(value)); }
// -----------------------------------
/** An array of {@link FT_Memory} structs. */
public static class Buffer extends StructBuffer<FT_Memory, Buffer> implements NativeResource {
private static final FT_Memory ELEMENT_FACTORY = FT_Memory.create(-1L);
/**
* Creates a new {@code FT_Memory.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Memory#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Memory getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code user} field. */
@NativeType("void *")
public long user() { return FT_Memory.nuser(address()); }
/** @return the value of the {@code alloc} field. */
@Nullable
public FT_Alloc_Func alloc() { return FT_Memory.nalloc(address()); }
/** @return the value of the {@code free} field. */
@Nullable
public FT_Free_Func free$() { return FT_Memory.nfree$(address()); }
/** @return the value of the {@code realloc} field. */
@Nullable
public FT_Realloc_Func realloc() { return FT_Memory.nrealloc(address()); }
/** Sets the specified value to the {@code user} field. */
public Buffer user(@NativeType("void *") long value) { FT_Memory.nuser(address(), value); return this; }
/** Sets the specified value to the {@code alloc} field. */
public Buffer alloc(@Nullable @NativeType("FT_Alloc_Func") FT_Alloc_FuncI value) { FT_Memory.nalloc(address(), value); return this; }
/** Sets the specified value to the {@code free} field. */
public Buffer free$(@Nullable @NativeType("FT_Free_Func") FT_Free_FuncI value) { FT_Memory.nfree$(address(), value); return this; }
/** Sets the specified value to the {@code realloc} field. */
public Buffer realloc(@Nullable @NativeType("FT_Realloc_Func") FT_Realloc_FuncI value) { FT_Memory.nrealloc(address(), value); return this; }
}
}

View File

@ -0,0 +1,458 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* The module class descriptor.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Module_Class {
* FT_ULong module_flags;
* FT_Long module_size;
* FT_String const * module_name;
* FT_Fixed module_version;
* FT_Fixed module_requires;
* void const * module_interface;
* {@link FT_Module_ConstructorI FT_Module_Constructor} module_init;
* {@link FT_Module_DestructorI FT_Module_Destructor} module_done;
* {@link FT_Module_RequesterI FT_Module_Requester} get_interface;
* }</code></pre>
*/
public class FT_Module_Class extends Struct<FT_Module_Class> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
MODULE_FLAGS,
MODULE_SIZE,
MODULE_NAME,
MODULE_VERSION,
MODULE_REQUIRES,
MODULE_INTERFACE,
MODULE_INIT,
MODULE_DONE,
GET_INTERFACE;
static {
Layout layout = __struct(
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(POINTER_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
MODULE_FLAGS = layout.offsetof(0);
MODULE_SIZE = layout.offsetof(1);
MODULE_NAME = layout.offsetof(2);
MODULE_VERSION = layout.offsetof(3);
MODULE_REQUIRES = layout.offsetof(4);
MODULE_INTERFACE = layout.offsetof(5);
MODULE_INIT = layout.offsetof(6);
MODULE_DONE = layout.offsetof(7);
GET_INTERFACE = layout.offsetof(8);
}
protected FT_Module_Class(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Module_Class create(long address, @Nullable ByteBuffer container) {
return new FT_Module_Class(address, container);
}
/**
* Creates a {@code FT_Module_Class} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Module_Class(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code module_flags} field. */
@NativeType("FT_ULong")
public long module_flags() { return nmodule_flags(address()); }
/** @return the value of the {@code module_size} field. */
@NativeType("FT_Long")
public long module_size() { return nmodule_size(address()); }
/** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code module_name} field. */
@NativeType("FT_String const *")
public ByteBuffer module_name() { return nmodule_name(address()); }
/** @return the null-terminated string pointed to by the {@code module_name} field. */
@NativeType("FT_String const *")
public String module_nameString() { return nmodule_nameString(address()); }
/** @return the value of the {@code module_version} field. */
@NativeType("FT_Fixed")
public long module_version() { return nmodule_version(address()); }
/** @return the value of the {@code module_requires} field. */
@NativeType("FT_Fixed")
public long module_requires() { return nmodule_requires(address()); }
/**
* @return a {@link ByteBuffer} view of the data pointed to by the {@code module_interface} field.
*
* @param capacity the number of elements in the returned buffer
*/
@Nullable
@NativeType("void const *")
public ByteBuffer module_interface(int capacity) { return nmodule_interface(address(), capacity); }
/** @return the value of the {@code module_init} field. */
@Nullable
public FT_Module_Constructor module_init() { return nmodule_init(address()); }
/** @return the value of the {@code module_done} field. */
@Nullable
public FT_Module_Destructor module_done() { return nmodule_done(address()); }
/** @return the value of the {@code get_interface} field. */
@Nullable
public FT_Module_Requester get_interface() { return nget_interface(address()); }
/** Sets the specified value to the {@code module_flags} field. */
public FT_Module_Class module_flags(@NativeType("FT_ULong") long value) { nmodule_flags(address(), value); return this; }
/** Sets the specified value to the {@code module_size} field. */
public FT_Module_Class module_size(@NativeType("FT_Long") long value) { nmodule_size(address(), value); return this; }
/** Sets the address of the specified encoded string to the {@code module_name} field. */
public FT_Module_Class module_name(@NativeType("FT_String const *") ByteBuffer value) { nmodule_name(address(), value); return this; }
/** Sets the specified value to the {@code module_version} field. */
public FT_Module_Class module_version(@NativeType("FT_Fixed") long value) { nmodule_version(address(), value); return this; }
/** Sets the specified value to the {@code module_requires} field. */
public FT_Module_Class module_requires(@NativeType("FT_Fixed") long value) { nmodule_requires(address(), value); return this; }
/** Sets the address of the specified {@link ByteBuffer} to the {@code module_interface} field. */
public FT_Module_Class module_interface(@Nullable @NativeType("void const *") ByteBuffer value) { nmodule_interface(address(), value); return this; }
/** Sets the specified value to the {@code module_init} field. */
public FT_Module_Class module_init(@Nullable @NativeType("FT_Module_Constructor") FT_Module_ConstructorI value) { nmodule_init(address(), value); return this; }
/** Sets the specified value to the {@code module_done} field. */
public FT_Module_Class module_done(@Nullable @NativeType("FT_Module_Destructor") FT_Module_DestructorI value) { nmodule_done(address(), value); return this; }
/** Sets the specified value to the {@code get_interface} field. */
public FT_Module_Class get_interface(@Nullable @NativeType("FT_Module_Requester") FT_Module_RequesterI value) { nget_interface(address(), value); return this; }
/** Initializes this struct with the specified values. */
public FT_Module_Class set(
long module_flags,
long module_size,
ByteBuffer module_name,
long module_version,
long module_requires,
@Nullable ByteBuffer module_interface,
@Nullable FT_Module_ConstructorI module_init,
@Nullable FT_Module_DestructorI module_done,
@Nullable FT_Module_RequesterI get_interface
) {
module_flags(module_flags);
module_size(module_size);
module_name(module_name);
module_version(module_version);
module_requires(module_requires);
module_interface(module_interface);
module_init(module_init);
module_done(module_done);
get_interface(get_interface);
return this;
}
/**
* Copies the specified struct data to this struct.
*
* @param src the source struct
*
* @return this struct
*/
public FT_Module_Class set(FT_Module_Class src) {
memCopy(src.address(), address(), SIZEOF);
return this;
}
// -----------------------------------
/** Returns a new {@code FT_Module_Class} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_Module_Class malloc() {
return new FT_Module_Class(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_Module_Class} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_Module_Class calloc() {
return new FT_Module_Class(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_Module_Class} instance allocated with {@link BufferUtils}. */
public static FT_Module_Class create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_Module_Class(memAddress(container), container);
}
/** Returns a new {@code FT_Module_Class} instance for the specified memory address. */
public static FT_Module_Class create(long address) {
return new FT_Module_Class(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Module_Class createSafe(long address) {
return address == NULL ? null : new FT_Module_Class(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_Module_Class} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_Module_Class malloc(MemoryStack stack) {
return new FT_Module_Class(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_Module_Class} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_Module_Class calloc(MemoryStack stack) {
return new FT_Module_Class(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #module_flags}. */
public static long nmodule_flags(long struct) { return memGetCLong(struct + FT_Module_Class.MODULE_FLAGS); }
/** Unsafe version of {@link #module_size}. */
public static long nmodule_size(long struct) { return memGetCLong(struct + FT_Module_Class.MODULE_SIZE); }
/** Unsafe version of {@link #module_name}. */
public static ByteBuffer nmodule_name(long struct) { return memByteBufferNT1(memGetAddress(struct + FT_Module_Class.MODULE_NAME)); }
/** Unsafe version of {@link #module_nameString}. */
public static String nmodule_nameString(long struct) { return memUTF8(memGetAddress(struct + FT_Module_Class.MODULE_NAME)); }
/** Unsafe version of {@link #module_version}. */
public static long nmodule_version(long struct) { return memGetCLong(struct + FT_Module_Class.MODULE_VERSION); }
/** Unsafe version of {@link #module_requires}. */
public static long nmodule_requires(long struct) { return memGetCLong(struct + FT_Module_Class.MODULE_REQUIRES); }
/** Unsafe version of {@link #module_interface(int) module_interface}. */
@Nullable public static ByteBuffer nmodule_interface(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + FT_Module_Class.MODULE_INTERFACE), capacity); }
/** Unsafe version of {@link #module_init}. */
@Nullable public static FT_Module_Constructor nmodule_init(long struct) { return FT_Module_Constructor.createSafe(memGetAddress(struct + FT_Module_Class.MODULE_INIT)); }
/** Unsafe version of {@link #module_done}. */
@Nullable public static FT_Module_Destructor nmodule_done(long struct) { return FT_Module_Destructor.createSafe(memGetAddress(struct + FT_Module_Class.MODULE_DONE)); }
/** Unsafe version of {@link #get_interface}. */
@Nullable public static FT_Module_Requester nget_interface(long struct) { return FT_Module_Requester.createSafe(memGetAddress(struct + FT_Module_Class.GET_INTERFACE)); }
/** Unsafe version of {@link #module_flags(long) module_flags}. */
public static void nmodule_flags(long struct, long value) { memPutCLong(struct + FT_Module_Class.MODULE_FLAGS, value); }
/** Unsafe version of {@link #module_size(long) module_size}. */
public static void nmodule_size(long struct, long value) { memPutCLong(struct + FT_Module_Class.MODULE_SIZE, value); }
/** Unsafe version of {@link #module_name(ByteBuffer) module_name}. */
public static void nmodule_name(long struct, ByteBuffer value) {
if (CHECKS) { checkNT1(value); }
memPutAddress(struct + FT_Module_Class.MODULE_NAME, memAddress(value));
}
/** Unsafe version of {@link #module_version(long) module_version}. */
public static void nmodule_version(long struct, long value) { memPutCLong(struct + FT_Module_Class.MODULE_VERSION, value); }
/** Unsafe version of {@link #module_requires(long) module_requires}. */
public static void nmodule_requires(long struct, long value) { memPutCLong(struct + FT_Module_Class.MODULE_REQUIRES, value); }
/** Unsafe version of {@link #module_interface(ByteBuffer) module_interface}. */
public static void nmodule_interface(long struct, @Nullable ByteBuffer value) { memPutAddress(struct + FT_Module_Class.MODULE_INTERFACE, memAddressSafe(value)); }
/** Unsafe version of {@link #module_init(FT_Module_ConstructorI) module_init}. */
public static void nmodule_init(long struct, @Nullable FT_Module_ConstructorI value) { memPutAddress(struct + FT_Module_Class.MODULE_INIT, memAddressSafe(value)); }
/** Unsafe version of {@link #module_done(FT_Module_DestructorI) module_done}. */
public static void nmodule_done(long struct, @Nullable FT_Module_DestructorI value) { memPutAddress(struct + FT_Module_Class.MODULE_DONE, memAddressSafe(value)); }
/** Unsafe version of {@link #get_interface(FT_Module_RequesterI) get_interface}. */
public static void nget_interface(long struct, @Nullable FT_Module_RequesterI value) { memPutAddress(struct + FT_Module_Class.GET_INTERFACE, memAddressSafe(value)); }
/**
* Validates pointer members that should not be {@code NULL}.
*
* @param struct the struct to validate
*/
public static void validate(long struct) {
check(memGetAddress(struct + FT_Module_Class.MODULE_NAME));
}
// -----------------------------------
/** An array of {@link FT_Module_Class} structs. */
public static class Buffer extends StructBuffer<FT_Module_Class, Buffer> implements NativeResource {
private static final FT_Module_Class ELEMENT_FACTORY = FT_Module_Class.create(-1L);
/**
* Creates a new {@code FT_Module_Class.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Module_Class#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Module_Class getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code module_flags} field. */
@NativeType("FT_ULong")
public long module_flags() { return FT_Module_Class.nmodule_flags(address()); }
/** @return the value of the {@code module_size} field. */
@NativeType("FT_Long")
public long module_size() { return FT_Module_Class.nmodule_size(address()); }
/** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code module_name} field. */
@NativeType("FT_String const *")
public ByteBuffer module_name() { return FT_Module_Class.nmodule_name(address()); }
/** @return the null-terminated string pointed to by the {@code module_name} field. */
@NativeType("FT_String const *")
public String module_nameString() { return FT_Module_Class.nmodule_nameString(address()); }
/** @return the value of the {@code module_version} field. */
@NativeType("FT_Fixed")
public long module_version() { return FT_Module_Class.nmodule_version(address()); }
/** @return the value of the {@code module_requires} field. */
@NativeType("FT_Fixed")
public long module_requires() { return FT_Module_Class.nmodule_requires(address()); }
/**
* @return a {@link ByteBuffer} view of the data pointed to by the {@code module_interface} field.
*
* @param capacity the number of elements in the returned buffer
*/
@Nullable
@NativeType("void const *")
public ByteBuffer module_interface(int capacity) { return FT_Module_Class.nmodule_interface(address(), capacity); }
/** @return the value of the {@code module_init} field. */
@Nullable
public FT_Module_Constructor module_init() { return FT_Module_Class.nmodule_init(address()); }
/** @return the value of the {@code module_done} field. */
@Nullable
public FT_Module_Destructor module_done() { return FT_Module_Class.nmodule_done(address()); }
/** @return the value of the {@code get_interface} field. */
@Nullable
public FT_Module_Requester get_interface() { return FT_Module_Class.nget_interface(address()); }
/** Sets the specified value to the {@code module_flags} field. */
public Buffer module_flags(@NativeType("FT_ULong") long value) { FT_Module_Class.nmodule_flags(address(), value); return this; }
/** Sets the specified value to the {@code module_size} field. */
public Buffer module_size(@NativeType("FT_Long") long value) { FT_Module_Class.nmodule_size(address(), value); return this; }
/** Sets the address of the specified encoded string to the {@code module_name} field. */
public Buffer module_name(@NativeType("FT_String const *") ByteBuffer value) { FT_Module_Class.nmodule_name(address(), value); return this; }
/** Sets the specified value to the {@code module_version} field. */
public Buffer module_version(@NativeType("FT_Fixed") long value) { FT_Module_Class.nmodule_version(address(), value); return this; }
/** Sets the specified value to the {@code module_requires} field. */
public Buffer module_requires(@NativeType("FT_Fixed") long value) { FT_Module_Class.nmodule_requires(address(), value); return this; }
/** Sets the address of the specified {@link ByteBuffer} to the {@code module_interface} field. */
public Buffer module_interface(@Nullable @NativeType("void const *") ByteBuffer value) { FT_Module_Class.nmodule_interface(address(), value); return this; }
/** Sets the specified value to the {@code module_init} field. */
public Buffer module_init(@Nullable @NativeType("FT_Module_Constructor") FT_Module_ConstructorI value) { FT_Module_Class.nmodule_init(address(), value); return this; }
/** Sets the specified value to the {@code module_done} field. */
public Buffer module_done(@Nullable @NativeType("FT_Module_Destructor") FT_Module_DestructorI value) { FT_Module_Class.nmodule_done(address(), value); return this; }
/** Sets the specified value to the {@code get_interface} field. */
public Buffer get_interface(@Nullable @NativeType("FT_Module_Requester") FT_Module_RequesterI value) { FT_Module_Class.nget_interface(address(), value); return this; }
}
}

View File

@ -0,0 +1,73 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* FT_Error (*{@link #invoke}) (
* FT_Module module
* )</code></pre>
*/
public abstract class FT_Module_Constructor extends Callback implements FT_Module_ConstructorI {
/**
* Creates a {@code FT_Module_Constructor} instance from the specified function pointer.
*
* @return the new {@code FT_Module_Constructor}
*/
public static FT_Module_Constructor create(long functionPointer) {
FT_Module_ConstructorI instance = Callback.get(functionPointer);
return instance instanceof FT_Module_Constructor
? (FT_Module_Constructor)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static FT_Module_Constructor createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code FT_Module_Constructor} instance that delegates to the specified {@code FT_Module_ConstructorI} instance. */
public static FT_Module_Constructor create(FT_Module_ConstructorI instance) {
return instance instanceof FT_Module_Constructor
? (FT_Module_Constructor)instance
: new Container(instance.address(), instance);
}
protected FT_Module_Constructor() {
super(CIF);
}
FT_Module_Constructor(long functionPointer) {
super(functionPointer);
}
private static final class Container extends FT_Module_Constructor {
private final FT_Module_ConstructorI delegate;
Container(long functionPointer, FT_Module_ConstructorI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public int invoke(long module) {
return delegate.invoke(module);
}
}
}

View File

@ -0,0 +1,47 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* FT_Error (*{@link #invoke}) (
* FT_Module module
* )</code></pre>
*/
@FunctionalInterface
@NativeType("FT_Module_Constructor")
public interface FT_Module_ConstructorI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_sint32,
ffi_type_pointer
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
int __result = invoke(
memGetAddress(memGetAddress(args))
);
apiClosureRet(ret, __result);
}
/** A function used to initialize (not create) a new module object. */
@NativeType("FT_Error") int invoke(@NativeType("FT_Module") long module);
}

View File

@ -0,0 +1,73 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* void (*{@link #invoke}) (
* FT_Module module
* )</code></pre>
*/
public abstract class FT_Module_Destructor extends Callback implements FT_Module_DestructorI {
/**
* Creates a {@code FT_Module_Destructor} instance from the specified function pointer.
*
* @return the new {@code FT_Module_Destructor}
*/
public static FT_Module_Destructor create(long functionPointer) {
FT_Module_DestructorI instance = Callback.get(functionPointer);
return instance instanceof FT_Module_Destructor
? (FT_Module_Destructor)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static FT_Module_Destructor createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code FT_Module_Destructor} instance that delegates to the specified {@code FT_Module_DestructorI} instance. */
public static FT_Module_Destructor create(FT_Module_DestructorI instance) {
return instance instanceof FT_Module_Destructor
? (FT_Module_Destructor)instance
: new Container(instance.address(), instance);
}
protected FT_Module_Destructor() {
super(CIF);
}
FT_Module_Destructor(long functionPointer) {
super(functionPointer);
}
private static final class Container extends FT_Module_Destructor {
private final FT_Module_DestructorI delegate;
Container(long functionPointer, FT_Module_DestructorI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public void invoke(long module) {
delegate.invoke(module);
}
}
}

View File

@ -0,0 +1,46 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* void (*{@link #invoke}) (
* FT_Module module
* )</code></pre>
*/
@FunctionalInterface
@NativeType("FT_Module_Destructor")
public interface FT_Module_DestructorI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_void,
ffi_type_pointer
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
invoke(
memGetAddress(memGetAddress(args))
);
}
/** A function used to finalize (not destroy) a given module object. */
void invoke(@NativeType("FT_Module") long module);
}

View File

@ -0,0 +1,74 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* FT_Module_Interface (*{@link #invoke}) (
* FT_Module module,
* char const *name
* )</code></pre>
*/
public abstract class FT_Module_Requester extends Callback implements FT_Module_RequesterI {
/**
* Creates a {@code FT_Module_Requester} instance from the specified function pointer.
*
* @return the new {@code FT_Module_Requester}
*/
public static FT_Module_Requester create(long functionPointer) {
FT_Module_RequesterI instance = Callback.get(functionPointer);
return instance instanceof FT_Module_Requester
? (FT_Module_Requester)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static FT_Module_Requester createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code FT_Module_Requester} instance that delegates to the specified {@code FT_Module_RequesterI} instance. */
public static FT_Module_Requester create(FT_Module_RequesterI instance) {
return instance instanceof FT_Module_Requester
? (FT_Module_Requester)instance
: new Container(instance.address(), instance);
}
protected FT_Module_Requester() {
super(CIF);
}
FT_Module_Requester(long functionPointer) {
super(functionPointer);
}
private static final class Container extends FT_Module_Requester {
private final FT_Module_RequesterI delegate;
Container(long functionPointer, FT_Module_RequesterI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public long invoke(long module, long name) {
return delegate.invoke(module, name);
}
}
}

View File

@ -0,0 +1,49 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* FT_Module_Interface (*{@link #invoke}) (
* FT_Module module,
* char const *name
* )</code></pre>
*/
@FunctionalInterface
@NativeType("FT_Module_Requester")
public interface FT_Module_RequesterI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_pointer,
ffi_type_pointer, ffi_type_pointer
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
long __result = invoke(
memGetAddress(memGetAddress(args)),
memGetAddress(memGetAddress(args + POINTER_SIZE))
);
apiClosureRetP(ret, __result);
}
/** A function used to query a given module for a specific interface. */
@NativeType("FT_Module_Interface") long invoke(@NativeType("FT_Module") long module, @NativeType("char const *") long name);
}

View File

@ -0,0 +1,272 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
import static org.lwjgl.util.freetype.FreeType.*;
/**
* A structure to model the axes and space of a Multiple Masters font.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Multi_Master {
* FT_UInt num_axis;
* FT_UInt num_designs;
* {@link FT_MM_Axis FT_MM_Axis} axis[T1_MAX_MM_AXIS];
* }</code></pre>
*/
public class FT_Multi_Master extends Struct<FT_Multi_Master> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
NUM_AXIS,
NUM_DESIGNS,
AXIS;
static {
Layout layout = __struct(
__member(4),
__member(4),
__array(FT_MM_Axis.SIZEOF, FT_MM_Axis.ALIGNOF, T1_MAX_MM_AXIS)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
NUM_AXIS = layout.offsetof(0);
NUM_DESIGNS = layout.offsetof(1);
AXIS = layout.offsetof(2);
}
protected FT_Multi_Master(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Multi_Master create(long address, @Nullable ByteBuffer container) {
return new FT_Multi_Master(address, container);
}
/**
* Creates a {@code FT_Multi_Master} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Multi_Master(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code num_axis} field. */
@NativeType("FT_UInt")
public int num_axis() { return nnum_axis(address()); }
/** @return the value of the {@code num_designs} field. */
@NativeType("FT_UInt")
public int num_designs() { return nnum_designs(address()); }
/** @return a {@link FT_MM_Axis}.Buffer view of the {@code axis} field. */
@NativeType("FT_MM_Axis[T1_MAX_MM_AXIS]")
public FT_MM_Axis.Buffer axis() { return naxis(address()); }
/** @return a {@link FT_MM_Axis} view of the struct at the specified index of the {@code axis} field. */
public FT_MM_Axis axis(int index) { return naxis(address(), index); }
// -----------------------------------
/** Returns a new {@code FT_Multi_Master} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_Multi_Master malloc() {
return new FT_Multi_Master(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_Multi_Master} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_Multi_Master calloc() {
return new FT_Multi_Master(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_Multi_Master} instance allocated with {@link BufferUtils}. */
public static FT_Multi_Master create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_Multi_Master(memAddress(container), container);
}
/** Returns a new {@code FT_Multi_Master} instance for the specified memory address. */
public static FT_Multi_Master create(long address) {
return new FT_Multi_Master(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Multi_Master createSafe(long address) {
return address == NULL ? null : new FT_Multi_Master(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_Multi_Master} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_Multi_Master malloc(MemoryStack stack) {
return new FT_Multi_Master(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_Multi_Master} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_Multi_Master calloc(MemoryStack stack) {
return new FT_Multi_Master(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #num_axis}. */
public static int nnum_axis(long struct) { return UNSAFE.getInt(null, struct + FT_Multi_Master.NUM_AXIS); }
/** Unsafe version of {@link #num_designs}. */
public static int nnum_designs(long struct) { return UNSAFE.getInt(null, struct + FT_Multi_Master.NUM_DESIGNS); }
/** Unsafe version of {@link #axis}. */
public static FT_MM_Axis.Buffer naxis(long struct) { return FT_MM_Axis.create(struct + FT_Multi_Master.AXIS, T1_MAX_MM_AXIS); }
/** Unsafe version of {@link #axis(int) axis}. */
public static FT_MM_Axis naxis(long struct, int index) {
return FT_MM_Axis.create(struct + FT_Multi_Master.AXIS + check(index, T1_MAX_MM_AXIS) * FT_MM_Axis.SIZEOF);
}
// -----------------------------------
/** An array of {@link FT_Multi_Master} structs. */
public static class Buffer extends StructBuffer<FT_Multi_Master, Buffer> implements NativeResource {
private static final FT_Multi_Master ELEMENT_FACTORY = FT_Multi_Master.create(-1L);
/**
* Creates a new {@code FT_Multi_Master.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Multi_Master#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Multi_Master getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code num_axis} field. */
@NativeType("FT_UInt")
public int num_axis() { return FT_Multi_Master.nnum_axis(address()); }
/** @return the value of the {@code num_designs} field. */
@NativeType("FT_UInt")
public int num_designs() { return FT_Multi_Master.nnum_designs(address()); }
/** @return a {@link FT_MM_Axis}.Buffer view of the {@code axis} field. */
@NativeType("FT_MM_Axis[T1_MAX_MM_AXIS]")
public FT_MM_Axis.Buffer axis() { return FT_Multi_Master.naxis(address()); }
/** @return a {@link FT_MM_Axis} view of the struct at the specified index of the {@code axis} field. */
public FT_MM_Axis axis(int index) { return FT_Multi_Master.naxis(address(), index); }
}
}

View File

@ -0,0 +1,260 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* A structure representing an offset to a {@code Paint} value stored in any of the paint tables of a {@code COLR} v1 font.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_OpaquePaintRec {
* FT_Byte * p;
* FT_Bool insert_root_transform;
* }</code></pre>
*/
@NativeType("struct FT_OpaquePaintRec")
public class FT_OpaquePaint extends Struct<FT_OpaquePaint> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
P,
INSERT_ROOT_TRANSFORM;
static {
Layout layout = __struct(
__member(POINTER_SIZE),
__member(1)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
P = layout.offsetof(0);
INSERT_ROOT_TRANSFORM = layout.offsetof(1);
}
protected FT_OpaquePaint(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_OpaquePaint create(long address, @Nullable ByteBuffer container) {
return new FT_OpaquePaint(address, container);
}
/**
* Creates a {@code FT_OpaquePaint} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_OpaquePaint(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/**
* @return a {@link ByteBuffer} view of the data pointed to by the {@code p} field.
*
* @param capacity the number of elements in the returned buffer
*/
@Nullable
@NativeType("FT_Byte *")
public ByteBuffer p(int capacity) { return np(address(), capacity); }
/** @return the value of the {@code insert_root_transform} field. */
@NativeType("FT_Bool")
public boolean insert_root_transform() { return ninsert_root_transform(address()); }
// -----------------------------------
/** Returns a new {@code FT_OpaquePaint} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_OpaquePaint malloc() {
return new FT_OpaquePaint(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_OpaquePaint} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_OpaquePaint calloc() {
return new FT_OpaquePaint(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_OpaquePaint} instance allocated with {@link BufferUtils}. */
public static FT_OpaquePaint create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_OpaquePaint(memAddress(container), container);
}
/** Returns a new {@code FT_OpaquePaint} instance for the specified memory address. */
public static FT_OpaquePaint create(long address) {
return new FT_OpaquePaint(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_OpaquePaint createSafe(long address) {
return address == NULL ? null : new FT_OpaquePaint(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_OpaquePaint} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_OpaquePaint malloc(MemoryStack stack) {
return new FT_OpaquePaint(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_OpaquePaint} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_OpaquePaint calloc(MemoryStack stack) {
return new FT_OpaquePaint(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #p(int) p}. */
@Nullable public static ByteBuffer np(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + FT_OpaquePaint.P), capacity); }
/** Unsafe version of {@link #insert_root_transform}. */
public static boolean ninsert_root_transform(long struct) { return UNSAFE.getByte(null, struct + FT_OpaquePaint.INSERT_ROOT_TRANSFORM) != 0; }
// -----------------------------------
/** An array of {@link FT_OpaquePaint} structs. */
public static class Buffer extends StructBuffer<FT_OpaquePaint, Buffer> implements NativeResource {
private static final FT_OpaquePaint ELEMENT_FACTORY = FT_OpaquePaint.create(-1L);
/**
* Creates a new {@code FT_OpaquePaint.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_OpaquePaint#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_OpaquePaint getElementFactory() {
return ELEMENT_FACTORY;
}
/**
* @return a {@link ByteBuffer} view of the data pointed to by the {@code p} field.
*
* @param capacity the number of elements in the returned buffer
*/
@Nullable
@NativeType("FT_Byte *")
public ByteBuffer p(int capacity) { return FT_OpaquePaint.np(address(), capacity); }
/** @return the value of the {@code insert_root_transform} field. */
@NativeType("FT_Bool")
public boolean insert_root_transform() { return FT_OpaquePaint.ninsert_root_transform(address()); }
}
}

View File

@ -0,0 +1,428 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* A structure to indicate how to open a new font file or stream. A pointer to such a structure can be used as a parameter for the functions
* {@link FreeType#FT_Open_Face Open_Face} and {@link FreeType#FT_Attach_Stream Attach_Stream}.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Open_Args {
* FT_UInt flags;
* FT_Byte const * memory_base;
* FT_Long memory_size;
* FT_String * pathname;
* {@link FT_Stream FT_Stream} stream;
* FT_Module driver;
* FT_Int num_params;
* {@link FT_Parameter FT_Parameter} * params;
* }</code></pre>
*/
public class FT_Open_Args extends Struct<FT_Open_Args> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
FLAGS,
MEMORY_BASE,
MEMORY_SIZE,
PATHNAME,
STREAM,
DRIVER,
NUM_PARAMS,
PARAMS;
static {
Layout layout = __struct(
__member(4),
__member(POINTER_SIZE),
__member(CLONG_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(4),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
FLAGS = layout.offsetof(0);
MEMORY_BASE = layout.offsetof(1);
MEMORY_SIZE = layout.offsetof(2);
PATHNAME = layout.offsetof(3);
STREAM = layout.offsetof(4);
DRIVER = layout.offsetof(5);
NUM_PARAMS = layout.offsetof(6);
PARAMS = layout.offsetof(7);
}
protected FT_Open_Args(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Open_Args create(long address, @Nullable ByteBuffer container) {
return new FT_Open_Args(address, container);
}
/**
* Creates a {@code FT_Open_Args} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Open_Args(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code flags} field. */
@NativeType("FT_UInt")
public int flags() { return nflags(address()); }
/** @return a {@link ByteBuffer} view of the data pointed to by the {@code memory_base} field. */
@Nullable
@NativeType("FT_Byte const *")
public ByteBuffer memory_base() { return nmemory_base(address()); }
/** @return the value of the {@code memory_size} field. */
@NativeType("FT_Long")
public long memory_size() { return nmemory_size(address()); }
/** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code pathname} field. */
@Nullable
@NativeType("FT_String *")
public ByteBuffer pathname() { return npathname(address()); }
/** @return the null-terminated string pointed to by the {@code pathname} field. */
@Nullable
@NativeType("FT_String *")
public String pathnameString() { return npathnameString(address()); }
/** @return a {@link FT_Stream} view of the struct pointed to by the {@code stream} field. */
@Nullable
public FT_Stream stream$() { return nstream$(address()); }
/** @return the value of the {@code driver} field. */
@NativeType("FT_Module")
public long driver() { return ndriver(address()); }
/** @return the value of the {@code num_params} field. */
@NativeType("FT_Int")
public int num_params() { return nnum_params(address()); }
/** @return a {@link FT_Parameter.Buffer} view of the struct array pointed to by the {@code params} field. */
@Nullable
@NativeType("FT_Parameter *")
public FT_Parameter.Buffer params() { return nparams(address()); }
/** Sets the specified value to the {@code flags} field. */
public FT_Open_Args flags(@NativeType("FT_UInt") int value) { nflags(address(), value); return this; }
/** Sets the address of the specified {@link ByteBuffer} to the {@code memory_base} field. */
public FT_Open_Args memory_base(@Nullable @NativeType("FT_Byte const *") ByteBuffer value) { nmemory_base(address(), value); return this; }
/** Sets the specified value to the {@code memory_size} field. */
public FT_Open_Args memory_size(@NativeType("FT_Long") long value) { nmemory_size(address(), value); return this; }
/** Sets the address of the specified encoded string to the {@code pathname} field. */
public FT_Open_Args pathname(@Nullable @NativeType("FT_String *") ByteBuffer value) { npathname(address(), value); return this; }
/** Sets the address of the specified {@link FT_Stream} to the {@code stream} field. */
public FT_Open_Args stream$(@Nullable FT_Stream value) { nstream$(address(), value); return this; }
/** Sets the specified value to the {@code driver} field. */
public FT_Open_Args driver(@NativeType("FT_Module") long value) { ndriver(address(), value); return this; }
/** Sets the specified value to the {@code num_params} field. */
public FT_Open_Args num_params(@NativeType("FT_Int") int value) { nnum_params(address(), value); return this; }
/** Sets the address of the specified {@link FT_Parameter.Buffer} to the {@code params} field. */
public FT_Open_Args params(@Nullable @NativeType("FT_Parameter *") FT_Parameter.Buffer value) { nparams(address(), value); return this; }
/** Initializes this struct with the specified values. */
public FT_Open_Args set(
int flags,
@Nullable ByteBuffer memory_base,
long memory_size,
@Nullable ByteBuffer pathname,
@Nullable FT_Stream stream$,
long driver,
int num_params,
@Nullable FT_Parameter.Buffer params
) {
flags(flags);
memory_base(memory_base);
memory_size(memory_size);
pathname(pathname);
stream$(stream$);
driver(driver);
num_params(num_params);
params(params);
return this;
}
/**
* Copies the specified struct data to this struct.
*
* @param src the source struct
*
* @return this struct
*/
public FT_Open_Args set(FT_Open_Args src) {
memCopy(src.address(), address(), SIZEOF);
return this;
}
// -----------------------------------
/** Returns a new {@code FT_Open_Args} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_Open_Args malloc() {
return new FT_Open_Args(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_Open_Args} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_Open_Args calloc() {
return new FT_Open_Args(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_Open_Args} instance allocated with {@link BufferUtils}. */
public static FT_Open_Args create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_Open_Args(memAddress(container), container);
}
/** Returns a new {@code FT_Open_Args} instance for the specified memory address. */
public static FT_Open_Args create(long address) {
return new FT_Open_Args(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Open_Args createSafe(long address) {
return address == NULL ? null : new FT_Open_Args(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_Open_Args} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_Open_Args malloc(MemoryStack stack) {
return new FT_Open_Args(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_Open_Args} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_Open_Args calloc(MemoryStack stack) {
return new FT_Open_Args(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #flags}. */
public static int nflags(long struct) { return UNSAFE.getInt(null, struct + FT_Open_Args.FLAGS); }
/** Unsafe version of {@link #memory_base() memory_base}. */
@Nullable public static ByteBuffer nmemory_base(long struct) { return memByteBufferSafe(memGetAddress(struct + FT_Open_Args.MEMORY_BASE), (int)nmemory_size(struct)); }
/** Unsafe version of {@link #memory_size}. */
public static long nmemory_size(long struct) { return memGetCLong(struct + FT_Open_Args.MEMORY_SIZE); }
/** Unsafe version of {@link #pathname}. */
@Nullable public static ByteBuffer npathname(long struct) { return memByteBufferNT1Safe(memGetAddress(struct + FT_Open_Args.PATHNAME)); }
/** Unsafe version of {@link #pathnameString}. */
@Nullable public static String npathnameString(long struct) { return memUTF8Safe(memGetAddress(struct + FT_Open_Args.PATHNAME)); }
/** Unsafe version of {@link #stream$}. */
@Nullable public static FT_Stream nstream$(long struct) { return FT_Stream.createSafe(memGetAddress(struct + FT_Open_Args.STREAM)); }
/** Unsafe version of {@link #driver}. */
public static long ndriver(long struct) { return memGetAddress(struct + FT_Open_Args.DRIVER); }
/** Unsafe version of {@link #num_params}. */
public static int nnum_params(long struct) { return UNSAFE.getInt(null, struct + FT_Open_Args.NUM_PARAMS); }
/** Unsafe version of {@link #params}. */
@Nullable public static FT_Parameter.Buffer nparams(long struct) { return FT_Parameter.createSafe(memGetAddress(struct + FT_Open_Args.PARAMS), nnum_params(struct)); }
/** Unsafe version of {@link #flags(int) flags}. */
public static void nflags(long struct, int value) { UNSAFE.putInt(null, struct + FT_Open_Args.FLAGS, value); }
/** Unsafe version of {@link #memory_base(ByteBuffer) memory_base}. */
public static void nmemory_base(long struct, @Nullable ByteBuffer value) { memPutAddress(struct + FT_Open_Args.MEMORY_BASE, memAddressSafe(value)); nmemory_size(struct, value == null ? 0 : value.remaining()); }
/** Sets the specified value to the {@code memory_size} field of the specified {@code struct}. */
public static void nmemory_size(long struct, long value) { memPutCLong(struct + FT_Open_Args.MEMORY_SIZE, value); }
/** Unsafe version of {@link #pathname(ByteBuffer) pathname}. */
public static void npathname(long struct, @Nullable ByteBuffer value) {
if (CHECKS) { checkNT1Safe(value); }
memPutAddress(struct + FT_Open_Args.PATHNAME, memAddressSafe(value));
}
/** Unsafe version of {@link #stream$(FT_Stream) stream$}. */
public static void nstream$(long struct, @Nullable FT_Stream value) { memPutAddress(struct + FT_Open_Args.STREAM, memAddressSafe(value)); }
/** Unsafe version of {@link #driver(long) driver}. */
public static void ndriver(long struct, long value) { memPutAddress(struct + FT_Open_Args.DRIVER, value); }
/** Sets the specified value to the {@code num_params} field of the specified {@code struct}. */
public static void nnum_params(long struct, int value) { UNSAFE.putInt(null, struct + FT_Open_Args.NUM_PARAMS, value); }
/** Unsafe version of {@link #params(FT_Parameter.Buffer) params}. */
public static void nparams(long struct, @Nullable FT_Parameter.Buffer value) { memPutAddress(struct + FT_Open_Args.PARAMS, memAddressSafe(value)); nnum_params(struct, value == null ? 0 : value.remaining()); }
// -----------------------------------
/** An array of {@link FT_Open_Args} structs. */
public static class Buffer extends StructBuffer<FT_Open_Args, Buffer> implements NativeResource {
private static final FT_Open_Args ELEMENT_FACTORY = FT_Open_Args.create(-1L);
/**
* Creates a new {@code FT_Open_Args.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Open_Args#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Open_Args getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code flags} field. */
@NativeType("FT_UInt")
public int flags() { return FT_Open_Args.nflags(address()); }
/** @return a {@link ByteBuffer} view of the data pointed to by the {@code memory_base} field. */
@Nullable
@NativeType("FT_Byte const *")
public ByteBuffer memory_base() { return FT_Open_Args.nmemory_base(address()); }
/** @return the value of the {@code memory_size} field. */
@NativeType("FT_Long")
public long memory_size() { return FT_Open_Args.nmemory_size(address()); }
/** @return a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code pathname} field. */
@Nullable
@NativeType("FT_String *")
public ByteBuffer pathname() { return FT_Open_Args.npathname(address()); }
/** @return the null-terminated string pointed to by the {@code pathname} field. */
@Nullable
@NativeType("FT_String *")
public String pathnameString() { return FT_Open_Args.npathnameString(address()); }
/** @return a {@link FT_Stream} view of the struct pointed to by the {@code stream} field. */
@Nullable
public FT_Stream stream$() { return FT_Open_Args.nstream$(address()); }
/** @return the value of the {@code driver} field. */
@NativeType("FT_Module")
public long driver() { return FT_Open_Args.ndriver(address()); }
/** @return the value of the {@code num_params} field. */
@NativeType("FT_Int")
public int num_params() { return FT_Open_Args.nnum_params(address()); }
/** @return a {@link FT_Parameter.Buffer} view of the struct array pointed to by the {@code params} field. */
@Nullable
@NativeType("FT_Parameter *")
public FT_Parameter.Buffer params() { return FT_Open_Args.nparams(address()); }
/** Sets the specified value to the {@code flags} field. */
public Buffer flags(@NativeType("FT_UInt") int value) { FT_Open_Args.nflags(address(), value); return this; }
/** Sets the address of the specified {@link ByteBuffer} to the {@code memory_base} field. */
public Buffer memory_base(@Nullable @NativeType("FT_Byte const *") ByteBuffer value) { FT_Open_Args.nmemory_base(address(), value); return this; }
/** Sets the specified value to the {@code memory_size} field. */
public Buffer memory_size(@NativeType("FT_Long") long value) { FT_Open_Args.nmemory_size(address(), value); return this; }
/** Sets the address of the specified encoded string to the {@code pathname} field. */
public Buffer pathname(@Nullable @NativeType("FT_String *") ByteBuffer value) { FT_Open_Args.npathname(address(), value); return this; }
/** Sets the address of the specified {@link FT_Stream} to the {@code stream} field. */
public Buffer stream$(@Nullable FT_Stream value) { FT_Open_Args.nstream$(address(), value); return this; }
/** Sets the specified value to the {@code driver} field. */
public Buffer driver(@NativeType("FT_Module") long value) { FT_Open_Args.ndriver(address(), value); return this; }
/** Sets the specified value to the {@code num_params} field. */
public Buffer num_params(@NativeType("FT_Int") int value) { FT_Open_Args.nnum_params(address(), value); return this; }
/** Sets the address of the specified {@link FT_Parameter.Buffer} to the {@code params} field. */
public Buffer params(@Nullable @NativeType("FT_Parameter *") FT_Parameter.Buffer value) { FT_Open_Args.nparams(address(), value); return this; }
}
}

View File

@ -0,0 +1,291 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* This structure is used to describe an outline to the scan-line converter.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Outline {
* short {@link #n_contours};
* short {@link #n_points};
* {@link FT_Vector FT_Vector} * {@link #points};
* char * {@link #tags};
* short * {@link #contours};
* int {@link #flags};
* }</code></pre>
*/
public class FT_Outline extends Struct<FT_Outline> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
N_CONTOURS,
N_POINTS,
POINTS,
TAGS,
CONTOURS,
FLAGS;
static {
Layout layout = __struct(
__member(2),
__member(2),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(4)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
N_CONTOURS = layout.offsetof(0);
N_POINTS = layout.offsetof(1);
POINTS = layout.offsetof(2);
TAGS = layout.offsetof(3);
CONTOURS = layout.offsetof(4);
FLAGS = layout.offsetof(5);
}
protected FT_Outline(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Outline create(long address, @Nullable ByteBuffer container) {
return new FT_Outline(address, container);
}
/**
* Creates a {@code FT_Outline} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Outline(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** number of contours in glyph */
public short n_contours() { return nn_contours(address()); }
/** number of points in the glyph */
public short n_points() { return nn_points(address()); }
/** the outline's points */
@NativeType("FT_Vector *")
public FT_Vector.Buffer points() { return npoints(address()); }
/** the points flags */
@NativeType("char *")
public ByteBuffer tags() { return ntags(address()); }
/** the contour end points */
@NativeType("short *")
public ShortBuffer contours() { return ncontours(address()); }
/** outline masks */
public int flags() { return nflags(address()); }
// -----------------------------------
/** Returns a new {@code FT_Outline} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_Outline malloc() {
return new FT_Outline(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_Outline} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_Outline calloc() {
return new FT_Outline(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_Outline} instance allocated with {@link BufferUtils}. */
public static FT_Outline create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_Outline(memAddress(container), container);
}
/** Returns a new {@code FT_Outline} instance for the specified memory address. */
public static FT_Outline create(long address) {
return new FT_Outline(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Outline createSafe(long address) {
return address == NULL ? null : new FT_Outline(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_Outline} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_Outline malloc(MemoryStack stack) {
return new FT_Outline(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_Outline} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_Outline calloc(MemoryStack stack) {
return new FT_Outline(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #n_contours}. */
public static short nn_contours(long struct) { return UNSAFE.getShort(null, struct + FT_Outline.N_CONTOURS); }
/** Unsafe version of {@link #n_points}. */
public static short nn_points(long struct) { return UNSAFE.getShort(null, struct + FT_Outline.N_POINTS); }
/** Unsafe version of {@link #points}. */
public static FT_Vector.Buffer npoints(long struct) { return FT_Vector.create(memGetAddress(struct + FT_Outline.POINTS), nn_points(struct)); }
/** Unsafe version of {@link #tags() tags}. */
public static ByteBuffer ntags(long struct) { return memByteBuffer(memGetAddress(struct + FT_Outline.TAGS), nn_points(struct)); }
/** Unsafe version of {@link #contours() contours}. */
public static ShortBuffer ncontours(long struct) { return memShortBuffer(memGetAddress(struct + FT_Outline.CONTOURS), nn_contours(struct)); }
/** Unsafe version of {@link #flags}. */
public static int nflags(long struct) { return UNSAFE.getInt(null, struct + FT_Outline.FLAGS); }
// -----------------------------------
/** An array of {@link FT_Outline} structs. */
public static class Buffer extends StructBuffer<FT_Outline, Buffer> implements NativeResource {
private static final FT_Outline ELEMENT_FACTORY = FT_Outline.create(-1L);
/**
* Creates a new {@code FT_Outline.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Outline#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Outline getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@link FT_Outline#n_contours} field. */
public short n_contours() { return FT_Outline.nn_contours(address()); }
/** @return the value of the {@link FT_Outline#n_points} field. */
public short n_points() { return FT_Outline.nn_points(address()); }
/** @return a {@link FT_Vector.Buffer} view of the struct array pointed to by the {@link FT_Outline#points} field. */
@NativeType("FT_Vector *")
public FT_Vector.Buffer points() { return FT_Outline.npoints(address()); }
/** @return a {@link ByteBuffer} view of the data pointed to by the {@link FT_Outline#tags} field. */
@NativeType("char *")
public ByteBuffer tags() { return FT_Outline.ntags(address()); }
/** @return a {@link ShortBuffer} view of the data pointed to by the {@link FT_Outline#contours} field. */
@NativeType("short *")
public ShortBuffer contours() { return FT_Outline.ncontours(address()); }
/** @return the value of the {@link FT_Outline#flags} field. */
public int flags() { return FT_Outline.nflags(address()); }
}
}

View File

@ -0,0 +1,164 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure used for outline (vectorial) glyph images. This really is a 'sub-class' of {@link FT_Glyph}.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_OutlineGlyphRec {
* {@link FT_Glyph FT_GlyphRec} root;
* {@link FT_Outline FT_Outline} outline;
* }</code></pre>
*/
@NativeType("struct FT_OutlineGlyphRec")
public class FT_OutlineGlyph extends Struct<FT_OutlineGlyph> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
ROOT,
OUTLINE;
static {
Layout layout = __struct(
__member(FT_Glyph.SIZEOF, FT_Glyph.ALIGNOF),
__member(FT_Outline.SIZEOF, FT_Outline.ALIGNOF)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
ROOT = layout.offsetof(0);
OUTLINE = layout.offsetof(1);
}
protected FT_OutlineGlyph(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_OutlineGlyph create(long address, @Nullable ByteBuffer container) {
return new FT_OutlineGlyph(address, container);
}
/**
* Creates a {@code FT_OutlineGlyph} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_OutlineGlyph(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link FT_Glyph} view of the {@code root} field. */
@NativeType("FT_GlyphRec")
public FT_Glyph root() { return nroot(address()); }
/** @return a {@link FT_Outline} view of the {@code outline} field. */
public FT_Outline outline() { return noutline(address()); }
// -----------------------------------
/** Returns a new {@code FT_OutlineGlyph} instance for the specified memory address. */
public static FT_OutlineGlyph create(long address) {
return new FT_OutlineGlyph(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_OutlineGlyph createSafe(long address) {
return address == NULL ? null : new FT_OutlineGlyph(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #root}. */
public static FT_Glyph nroot(long struct) { return FT_Glyph.create(struct + FT_OutlineGlyph.ROOT); }
/** Unsafe version of {@link #outline}. */
public static FT_Outline noutline(long struct) { return FT_Outline.create(struct + FT_OutlineGlyph.OUTLINE); }
// -----------------------------------
/** An array of {@link FT_OutlineGlyph} structs. */
public static class Buffer extends StructBuffer<FT_OutlineGlyph, Buffer> {
private static final FT_OutlineGlyph ELEMENT_FACTORY = FT_OutlineGlyph.create(-1L);
/**
* Creates a new {@code FT_OutlineGlyph.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_OutlineGlyph#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_OutlineGlyph getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_Glyph} view of the {@code root} field. */
@NativeType("FT_GlyphRec")
public FT_Glyph root() { return FT_OutlineGlyph.nroot(address()); }
/** @return a {@link FT_Outline} view of the {@code outline} field. */
public FT_Outline outline() { return FT_OutlineGlyph.noutline(address()); }
}
}

View File

@ -0,0 +1,75 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* int (*{@link #invoke}) (
* FT_Vector const *control,
* FT_Vector const *to,
* void *user
* )</code></pre>
*/
public abstract class FT_Outline_ConicToFunc extends Callback implements FT_Outline_ConicToFuncI {
/**
* Creates a {@code FT_Outline_ConicToFunc} instance from the specified function pointer.
*
* @return the new {@code FT_Outline_ConicToFunc}
*/
public static FT_Outline_ConicToFunc create(long functionPointer) {
FT_Outline_ConicToFuncI instance = Callback.get(functionPointer);
return instance instanceof FT_Outline_ConicToFunc
? (FT_Outline_ConicToFunc)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static FT_Outline_ConicToFunc createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code FT_Outline_ConicToFunc} instance that delegates to the specified {@code FT_Outline_ConicToFuncI} instance. */
public static FT_Outline_ConicToFunc create(FT_Outline_ConicToFuncI instance) {
return instance instanceof FT_Outline_ConicToFunc
? (FT_Outline_ConicToFunc)instance
: new Container(instance.address(), instance);
}
protected FT_Outline_ConicToFunc() {
super(CIF);
}
FT_Outline_ConicToFunc(long functionPointer) {
super(functionPointer);
}
private static final class Container extends FT_Outline_ConicToFunc {
private final FT_Outline_ConicToFuncI delegate;
Container(long functionPointer, FT_Outline_ConicToFuncI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public int invoke(long control, long to, long user) {
return delegate.invoke(control, to, user);
}
}
}

View File

@ -0,0 +1,51 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* int (*{@link #invoke}) (
* FT_Vector const *control,
* FT_Vector const *to,
* void *user
* )</code></pre>
*/
@FunctionalInterface
@NativeType("FT_Outline_ConicToFunc")
public interface FT_Outline_ConicToFuncI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_sint32,
ffi_type_pointer, ffi_type_pointer, ffi_type_pointer
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
int __result = invoke(
memGetAddress(memGetAddress(args)),
memGetAddress(memGetAddress(args + POINTER_SIZE)),
memGetAddress(memGetAddress(args + 2 * POINTER_SIZE))
);
apiClosureRet(ret, __result);
}
/** A function pointer type used to describe the signature of a 'conic to' function during outline walking or decomposition. */
int invoke(@NativeType("FT_Vector const *") long control, @NativeType("FT_Vector const *") long to, @NativeType("void *") long user);
}

View File

@ -0,0 +1,76 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* int (*{@link #invoke}) (
* FT_Vector const *control1,
* FT_Vector const *control2,
* FT_Vector const *to,
* void *user
* )</code></pre>
*/
public abstract class FT_Outline_CubicToFunc extends Callback implements FT_Outline_CubicToFuncI {
/**
* Creates a {@code FT_Outline_CubicToFunc} instance from the specified function pointer.
*
* @return the new {@code FT_Outline_CubicToFunc}
*/
public static FT_Outline_CubicToFunc create(long functionPointer) {
FT_Outline_CubicToFuncI instance = Callback.get(functionPointer);
return instance instanceof FT_Outline_CubicToFunc
? (FT_Outline_CubicToFunc)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static FT_Outline_CubicToFunc createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code FT_Outline_CubicToFunc} instance that delegates to the specified {@code FT_Outline_CubicToFuncI} instance. */
public static FT_Outline_CubicToFunc create(FT_Outline_CubicToFuncI instance) {
return instance instanceof FT_Outline_CubicToFunc
? (FT_Outline_CubicToFunc)instance
: new Container(instance.address(), instance);
}
protected FT_Outline_CubicToFunc() {
super(CIF);
}
FT_Outline_CubicToFunc(long functionPointer) {
super(functionPointer);
}
private static final class Container extends FT_Outline_CubicToFunc {
private final FT_Outline_CubicToFuncI delegate;
Container(long functionPointer, FT_Outline_CubicToFuncI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public int invoke(long control1, long control2, long to, long user) {
return delegate.invoke(control1, control2, to, user);
}
}
}

View File

@ -0,0 +1,53 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* int (*{@link #invoke}) (
* FT_Vector const *control1,
* FT_Vector const *control2,
* FT_Vector const *to,
* void *user
* )</code></pre>
*/
@FunctionalInterface
@NativeType("FT_Outline_CubicToFunc")
public interface FT_Outline_CubicToFuncI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_sint32,
ffi_type_pointer, ffi_type_pointer, ffi_type_pointer, ffi_type_pointer
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
int __result = invoke(
memGetAddress(memGetAddress(args)),
memGetAddress(memGetAddress(args + POINTER_SIZE)),
memGetAddress(memGetAddress(args + 2 * POINTER_SIZE)),
memGetAddress(memGetAddress(args + 3 * POINTER_SIZE))
);
apiClosureRet(ret, __result);
}
/** A function pointer type used to describe the signature of a 'cubic to' function during outline walking or decomposition. */
int invoke(@NativeType("FT_Vector const *") long control1, @NativeType("FT_Vector const *") long control2, @NativeType("FT_Vector const *") long to, @NativeType("void *") long user);
}

View File

@ -0,0 +1,365 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* A structure to hold various function pointers used during outline decomposition in order to emit segments, conic, and cubic Beziers.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Outline_Funcs {
* {@link FT_Outline_MoveToFuncI FT_Outline_MoveToFunc} move_to;
* {@link FT_Outline_LineToFuncI FT_Outline_LineToFunc} line_to;
* {@link FT_Outline_ConicToFuncI FT_Outline_ConicToFunc} conic_to;
* {@link FT_Outline_CubicToFuncI FT_Outline_CubicToFunc} cubic_to;
* int shift;
* FT_Pos delta;
* }</code></pre>
*/
public class FT_Outline_Funcs extends Struct<FT_Outline_Funcs> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
MOVE_TO,
LINE_TO,
CONIC_TO,
CUBIC_TO,
SHIFT,
DELTA;
static {
Layout layout = __struct(
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(4),
__member(CLONG_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
MOVE_TO = layout.offsetof(0);
LINE_TO = layout.offsetof(1);
CONIC_TO = layout.offsetof(2);
CUBIC_TO = layout.offsetof(3);
SHIFT = layout.offsetof(4);
DELTA = layout.offsetof(5);
}
protected FT_Outline_Funcs(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Outline_Funcs create(long address, @Nullable ByteBuffer container) {
return new FT_Outline_Funcs(address, container);
}
/**
* Creates a {@code FT_Outline_Funcs} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Outline_Funcs(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code move_to} field. */
@Nullable
public FT_Outline_MoveToFunc move_to() { return nmove_to(address()); }
/** @return the value of the {@code line_to} field. */
@Nullable
public FT_Outline_LineToFunc line_to() { return nline_to(address()); }
/** @return the value of the {@code conic_to} field. */
@Nullable
public FT_Outline_ConicToFunc conic_to() { return nconic_to(address()); }
/** @return the value of the {@code cubic_to} field. */
@Nullable
public FT_Outline_CubicToFunc cubic_to() { return ncubic_to(address()); }
/** @return the value of the {@code shift} field. */
public int shift() { return nshift(address()); }
/** @return the value of the {@code delta} field. */
@NativeType("FT_Pos")
public long delta() { return ndelta(address()); }
/** Sets the specified value to the {@code move_to} field. */
public FT_Outline_Funcs move_to(@Nullable @NativeType("FT_Outline_MoveToFunc") FT_Outline_MoveToFuncI value) { nmove_to(address(), value); return this; }
/** Sets the specified value to the {@code line_to} field. */
public FT_Outline_Funcs line_to(@Nullable @NativeType("FT_Outline_LineToFunc") FT_Outline_LineToFuncI value) { nline_to(address(), value); return this; }
/** Sets the specified value to the {@code conic_to} field. */
public FT_Outline_Funcs conic_to(@Nullable @NativeType("FT_Outline_ConicToFunc") FT_Outline_ConicToFuncI value) { nconic_to(address(), value); return this; }
/** Sets the specified value to the {@code cubic_to} field. */
public FT_Outline_Funcs cubic_to(@Nullable @NativeType("FT_Outline_CubicToFunc") FT_Outline_CubicToFuncI value) { ncubic_to(address(), value); return this; }
/** Sets the specified value to the {@code shift} field. */
public FT_Outline_Funcs shift(int value) { nshift(address(), value); return this; }
/** Sets the specified value to the {@code delta} field. */
public FT_Outline_Funcs delta(@NativeType("FT_Pos") long value) { ndelta(address(), value); return this; }
/** Initializes this struct with the specified values. */
public FT_Outline_Funcs set(
FT_Outline_MoveToFuncI move_to,
FT_Outline_LineToFuncI line_to,
FT_Outline_ConicToFuncI conic_to,
FT_Outline_CubicToFuncI cubic_to,
int shift,
long delta
) {
move_to(move_to);
line_to(line_to);
conic_to(conic_to);
cubic_to(cubic_to);
shift(shift);
delta(delta);
return this;
}
/**
* Copies the specified struct data to this struct.
*
* @param src the source struct
*
* @return this struct
*/
public FT_Outline_Funcs set(FT_Outline_Funcs src) {
memCopy(src.address(), address(), SIZEOF);
return this;
}
// -----------------------------------
/** Returns a new {@code FT_Outline_Funcs} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_Outline_Funcs malloc() {
return new FT_Outline_Funcs(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_Outline_Funcs} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_Outline_Funcs calloc() {
return new FT_Outline_Funcs(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_Outline_Funcs} instance allocated with {@link BufferUtils}. */
public static FT_Outline_Funcs create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_Outline_Funcs(memAddress(container), container);
}
/** Returns a new {@code FT_Outline_Funcs} instance for the specified memory address. */
public static FT_Outline_Funcs create(long address) {
return new FT_Outline_Funcs(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Outline_Funcs createSafe(long address) {
return address == NULL ? null : new FT_Outline_Funcs(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_Outline_Funcs} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_Outline_Funcs malloc(MemoryStack stack) {
return new FT_Outline_Funcs(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_Outline_Funcs} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_Outline_Funcs calloc(MemoryStack stack) {
return new FT_Outline_Funcs(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #move_to}. */
@Nullable public static FT_Outline_MoveToFunc nmove_to(long struct) { return FT_Outline_MoveToFunc.createSafe(memGetAddress(struct + FT_Outline_Funcs.MOVE_TO)); }
/** Unsafe version of {@link #line_to}. */
@Nullable public static FT_Outline_LineToFunc nline_to(long struct) { return FT_Outline_LineToFunc.createSafe(memGetAddress(struct + FT_Outline_Funcs.LINE_TO)); }
/** Unsafe version of {@link #conic_to}. */
@Nullable public static FT_Outline_ConicToFunc nconic_to(long struct) { return FT_Outline_ConicToFunc.createSafe(memGetAddress(struct + FT_Outline_Funcs.CONIC_TO)); }
/** Unsafe version of {@link #cubic_to}. */
@Nullable public static FT_Outline_CubicToFunc ncubic_to(long struct) { return FT_Outline_CubicToFunc.createSafe(memGetAddress(struct + FT_Outline_Funcs.CUBIC_TO)); }
/** Unsafe version of {@link #shift}. */
public static int nshift(long struct) { return UNSAFE.getInt(null, struct + FT_Outline_Funcs.SHIFT); }
/** Unsafe version of {@link #delta}. */
public static long ndelta(long struct) { return memGetCLong(struct + FT_Outline_Funcs.DELTA); }
/** Unsafe version of {@link #move_to(FT_Outline_MoveToFuncI) move_to}. */
public static void nmove_to(long struct, @Nullable FT_Outline_MoveToFuncI value) { memPutAddress(struct + FT_Outline_Funcs.MOVE_TO, memAddressSafe(value)); }
/** Unsafe version of {@link #line_to(FT_Outline_LineToFuncI) line_to}. */
public static void nline_to(long struct, @Nullable FT_Outline_LineToFuncI value) { memPutAddress(struct + FT_Outline_Funcs.LINE_TO, memAddressSafe(value)); }
/** Unsafe version of {@link #conic_to(FT_Outline_ConicToFuncI) conic_to}. */
public static void nconic_to(long struct, @Nullable FT_Outline_ConicToFuncI value) { memPutAddress(struct + FT_Outline_Funcs.CONIC_TO, memAddressSafe(value)); }
/** Unsafe version of {@link #cubic_to(FT_Outline_CubicToFuncI) cubic_to}. */
public static void ncubic_to(long struct, @Nullable FT_Outline_CubicToFuncI value) { memPutAddress(struct + FT_Outline_Funcs.CUBIC_TO, memAddressSafe(value)); }
/** Unsafe version of {@link #shift(int) shift}. */
public static void nshift(long struct, int value) { UNSAFE.putInt(null, struct + FT_Outline_Funcs.SHIFT, value); }
/** Unsafe version of {@link #delta(long) delta}. */
public static void ndelta(long struct, long value) { memPutCLong(struct + FT_Outline_Funcs.DELTA, value); }
// -----------------------------------
/** An array of {@link FT_Outline_Funcs} structs. */
public static class Buffer extends StructBuffer<FT_Outline_Funcs, Buffer> implements NativeResource {
private static final FT_Outline_Funcs ELEMENT_FACTORY = FT_Outline_Funcs.create(-1L);
/**
* Creates a new {@code FT_Outline_Funcs.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Outline_Funcs#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Outline_Funcs getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code move_to} field. */
@Nullable
public FT_Outline_MoveToFunc move_to() { return FT_Outline_Funcs.nmove_to(address()); }
/** @return the value of the {@code line_to} field. */
@Nullable
public FT_Outline_LineToFunc line_to() { return FT_Outline_Funcs.nline_to(address()); }
/** @return the value of the {@code conic_to} field. */
@Nullable
public FT_Outline_ConicToFunc conic_to() { return FT_Outline_Funcs.nconic_to(address()); }
/** @return the value of the {@code cubic_to} field. */
@Nullable
public FT_Outline_CubicToFunc cubic_to() { return FT_Outline_Funcs.ncubic_to(address()); }
/** @return the value of the {@code shift} field. */
public int shift() { return FT_Outline_Funcs.nshift(address()); }
/** @return the value of the {@code delta} field. */
@NativeType("FT_Pos")
public long delta() { return FT_Outline_Funcs.ndelta(address()); }
/** Sets the specified value to the {@code move_to} field. */
public Buffer move_to(@Nullable @NativeType("FT_Outline_MoveToFunc") FT_Outline_MoveToFuncI value) { FT_Outline_Funcs.nmove_to(address(), value); return this; }
/** Sets the specified value to the {@code line_to} field. */
public Buffer line_to(@Nullable @NativeType("FT_Outline_LineToFunc") FT_Outline_LineToFuncI value) { FT_Outline_Funcs.nline_to(address(), value); return this; }
/** Sets the specified value to the {@code conic_to} field. */
public Buffer conic_to(@Nullable @NativeType("FT_Outline_ConicToFunc") FT_Outline_ConicToFuncI value) { FT_Outline_Funcs.nconic_to(address(), value); return this; }
/** Sets the specified value to the {@code cubic_to} field. */
public Buffer cubic_to(@Nullable @NativeType("FT_Outline_CubicToFunc") FT_Outline_CubicToFuncI value) { FT_Outline_Funcs.ncubic_to(address(), value); return this; }
/** Sets the specified value to the {@code shift} field. */
public Buffer shift(int value) { FT_Outline_Funcs.nshift(address(), value); return this; }
/** Sets the specified value to the {@code delta} field. */
public Buffer delta(@NativeType("FT_Pos") long value) { FT_Outline_Funcs.ndelta(address(), value); return this; }
}
}

View File

@ -0,0 +1,74 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* int (*{@link #invoke}) (
* FT_Vector const *to,
* void *user
* )</code></pre>
*/
public abstract class FT_Outline_LineToFunc extends Callback implements FT_Outline_LineToFuncI {
/**
* Creates a {@code FT_Outline_LineToFunc} instance from the specified function pointer.
*
* @return the new {@code FT_Outline_LineToFunc}
*/
public static FT_Outline_LineToFunc create(long functionPointer) {
FT_Outline_LineToFuncI instance = Callback.get(functionPointer);
return instance instanceof FT_Outline_LineToFunc
? (FT_Outline_LineToFunc)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static FT_Outline_LineToFunc createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code FT_Outline_LineToFunc} instance that delegates to the specified {@code FT_Outline_LineToFuncI} instance. */
public static FT_Outline_LineToFunc create(FT_Outline_LineToFuncI instance) {
return instance instanceof FT_Outline_LineToFunc
? (FT_Outline_LineToFunc)instance
: new Container(instance.address(), instance);
}
protected FT_Outline_LineToFunc() {
super(CIF);
}
FT_Outline_LineToFunc(long functionPointer) {
super(functionPointer);
}
private static final class Container extends FT_Outline_LineToFunc {
private final FT_Outline_LineToFuncI delegate;
Container(long functionPointer, FT_Outline_LineToFuncI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public int invoke(long to, long user) {
return delegate.invoke(to, user);
}
}
}

View File

@ -0,0 +1,49 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* int (*{@link #invoke}) (
* FT_Vector const *to,
* void *user
* )</code></pre>
*/
@FunctionalInterface
@NativeType("FT_Outline_LineToFunc")
public interface FT_Outline_LineToFuncI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_sint32,
ffi_type_pointer, ffi_type_pointer
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
int __result = invoke(
memGetAddress(memGetAddress(args)),
memGetAddress(memGetAddress(args + POINTER_SIZE))
);
apiClosureRet(ret, __result);
}
/** A function pointer type used to describe the signature of a 'line to' function during outline walking/decomposition. */
int invoke(@NativeType("FT_Vector const *") long to, @NativeType("void *") long user);
}

View File

@ -0,0 +1,74 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* int (*{@link #invoke}) (
* FT_Vector const *to,
* void *user
* )</code></pre>
*/
public abstract class FT_Outline_MoveToFunc extends Callback implements FT_Outline_MoveToFuncI {
/**
* Creates a {@code FT_Outline_MoveToFunc} instance from the specified function pointer.
*
* @return the new {@code FT_Outline_MoveToFunc}
*/
public static FT_Outline_MoveToFunc create(long functionPointer) {
FT_Outline_MoveToFuncI instance = Callback.get(functionPointer);
return instance instanceof FT_Outline_MoveToFunc
? (FT_Outline_MoveToFunc)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static FT_Outline_MoveToFunc createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code FT_Outline_MoveToFunc} instance that delegates to the specified {@code FT_Outline_MoveToFuncI} instance. */
public static FT_Outline_MoveToFunc create(FT_Outline_MoveToFuncI instance) {
return instance instanceof FT_Outline_MoveToFunc
? (FT_Outline_MoveToFunc)instance
: new Container(instance.address(), instance);
}
protected FT_Outline_MoveToFunc() {
super(CIF);
}
FT_Outline_MoveToFunc(long functionPointer) {
super(functionPointer);
}
private static final class Container extends FT_Outline_MoveToFunc {
private final FT_Outline_MoveToFuncI delegate;
Container(long functionPointer, FT_Outline_MoveToFuncI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public int invoke(long to, long user) {
return delegate.invoke(to, user);
}
}
}

View File

@ -0,0 +1,49 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* int (*{@link #invoke}) (
* FT_Vector const *to,
* void *user
* )</code></pre>
*/
@FunctionalInterface
@NativeType("FT_Outline_MoveToFunc")
public interface FT_Outline_MoveToFuncI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_sint32,
ffi_type_pointer, ffi_type_pointer
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
int __result = invoke(
memGetAddress(memGetAddress(args)),
memGetAddress(memGetAddress(args + POINTER_SIZE))
);
apiClosureRet(ret, __result);
}
/** A function pointer type used to describe the signature of a 'move to' function during outline walking/decomposition. */
int invoke(@NativeType("FT_Vector const *") long to, @NativeType("void *") long user);
}

View File

@ -0,0 +1,153 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure representing a {@code COLR} v1 {@code PaintColorGlyph} paint table.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_PaintColrGlyph {
* FT_UInt glyphID;
* }</code></pre>
*/
public class FT_PaintColrGlyph extends Struct<FT_PaintColrGlyph> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
GLYPHID;
static {
Layout layout = __struct(
__member(4)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
GLYPHID = layout.offsetof(0);
}
protected FT_PaintColrGlyph(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_PaintColrGlyph create(long address, @Nullable ByteBuffer container) {
return new FT_PaintColrGlyph(address, container);
}
/**
* Creates a {@code FT_PaintColrGlyph} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_PaintColrGlyph(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code glyphID} field. */
@NativeType("FT_UInt")
public int glyphID() { return nglyphID(address()); }
// -----------------------------------
/** Returns a new {@code FT_PaintColrGlyph} instance for the specified memory address. */
public static FT_PaintColrGlyph create(long address) {
return new FT_PaintColrGlyph(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_PaintColrGlyph createSafe(long address) {
return address == NULL ? null : new FT_PaintColrGlyph(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #glyphID}. */
public static int nglyphID(long struct) { return UNSAFE.getInt(null, struct + FT_PaintColrGlyph.GLYPHID); }
// -----------------------------------
/** An array of {@link FT_PaintColrGlyph} structs. */
public static class Buffer extends StructBuffer<FT_PaintColrGlyph, Buffer> {
private static final FT_PaintColrGlyph ELEMENT_FACTORY = FT_PaintColrGlyph.create(-1L);
/**
* Creates a new {@code FT_PaintColrGlyph.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_PaintColrGlyph#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_PaintColrGlyph getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code glyphID} field. */
@NativeType("FT_UInt")
public int glyphID() { return FT_PaintColrGlyph.nglyphID(address()); }
}
}

View File

@ -0,0 +1,151 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure representing a {@code PaintColrLayers} table of a {@code COLR} v1 font.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_PaintColrLayers {
* {@link FT_LayerIterator FT_LayerIterator} layer_iterator;
* }</code></pre>
*/
public class FT_PaintColrLayers extends Struct<FT_PaintColrLayers> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
LAYER_ITERATOR;
static {
Layout layout = __struct(
__member(FT_LayerIterator.SIZEOF, FT_LayerIterator.ALIGNOF)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
LAYER_ITERATOR = layout.offsetof(0);
}
protected FT_PaintColrLayers(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_PaintColrLayers create(long address, @Nullable ByteBuffer container) {
return new FT_PaintColrLayers(address, container);
}
/**
* Creates a {@code FT_PaintColrLayers} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_PaintColrLayers(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link FT_LayerIterator} view of the {@code layer_iterator} field. */
public FT_LayerIterator layer_iterator() { return nlayer_iterator(address()); }
// -----------------------------------
/** Returns a new {@code FT_PaintColrLayers} instance for the specified memory address. */
public static FT_PaintColrLayers create(long address) {
return new FT_PaintColrLayers(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_PaintColrLayers createSafe(long address) {
return address == NULL ? null : new FT_PaintColrLayers(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #layer_iterator}. */
public static FT_LayerIterator nlayer_iterator(long struct) { return FT_LayerIterator.create(struct + FT_PaintColrLayers.LAYER_ITERATOR); }
// -----------------------------------
/** An array of {@link FT_PaintColrLayers} structs. */
public static class Buffer extends StructBuffer<FT_PaintColrLayers, Buffer> {
private static final FT_PaintColrLayers ELEMENT_FACTORY = FT_PaintColrLayers.create(-1L);
/**
* Creates a new {@code FT_PaintColrLayers.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_PaintColrLayers#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_PaintColrLayers getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_LayerIterator} view of the {@code layer_iterator} field. */
public FT_LayerIterator layer_iterator() { return FT_PaintColrLayers.nlayer_iterator(address()); }
}
}

View File

@ -0,0 +1,178 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure representing a {@code COLR} v1 {@code PaintComposite} paint table. Used for compositing two paints in a {@code COLR} v1 directed acyclic
* graph.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_PaintComposite {
* {@link FT_OpaquePaint FT_OpaquePaintRec} source_paint;
* FT_Composite_Mode composite_mode;
* {@link FT_OpaquePaint FT_OpaquePaintRec} backdrop_paint;
* }</code></pre>
*/
public class FT_PaintComposite extends Struct<FT_PaintComposite> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
SOURCE_PAINT,
COMPOSITE_MODE,
BACKDROP_PAINT;
static {
Layout layout = __struct(
__member(FT_OpaquePaint.SIZEOF, FT_OpaquePaint.ALIGNOF),
__member(4),
__member(FT_OpaquePaint.SIZEOF, FT_OpaquePaint.ALIGNOF)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
SOURCE_PAINT = layout.offsetof(0);
COMPOSITE_MODE = layout.offsetof(1);
BACKDROP_PAINT = layout.offsetof(2);
}
protected FT_PaintComposite(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_PaintComposite create(long address, @Nullable ByteBuffer container) {
return new FT_PaintComposite(address, container);
}
/**
* Creates a {@code FT_PaintComposite} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_PaintComposite(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link FT_OpaquePaint} view of the {@code source_paint} field. */
@NativeType("FT_OpaquePaintRec")
public FT_OpaquePaint source_paint() { return nsource_paint(address()); }
/** @return the value of the {@code composite_mode} field. */
@NativeType("FT_Composite_Mode")
public int composite_mode() { return ncomposite_mode(address()); }
/** @return a {@link FT_OpaquePaint} view of the {@code backdrop_paint} field. */
@NativeType("FT_OpaquePaintRec")
public FT_OpaquePaint backdrop_paint() { return nbackdrop_paint(address()); }
// -----------------------------------
/** Returns a new {@code FT_PaintComposite} instance for the specified memory address. */
public static FT_PaintComposite create(long address) {
return new FT_PaintComposite(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_PaintComposite createSafe(long address) {
return address == NULL ? null : new FT_PaintComposite(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #source_paint}. */
public static FT_OpaquePaint nsource_paint(long struct) { return FT_OpaquePaint.create(struct + FT_PaintComposite.SOURCE_PAINT); }
/** Unsafe version of {@link #composite_mode}. */
public static int ncomposite_mode(long struct) { return UNSAFE.getInt(null, struct + FT_PaintComposite.COMPOSITE_MODE); }
/** Unsafe version of {@link #backdrop_paint}. */
public static FT_OpaquePaint nbackdrop_paint(long struct) { return FT_OpaquePaint.create(struct + FT_PaintComposite.BACKDROP_PAINT); }
// -----------------------------------
/** An array of {@link FT_PaintComposite} structs. */
public static class Buffer extends StructBuffer<FT_PaintComposite, Buffer> {
private static final FT_PaintComposite ELEMENT_FACTORY = FT_PaintComposite.create(-1L);
/**
* Creates a new {@code FT_PaintComposite.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_PaintComposite#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_PaintComposite getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_OpaquePaint} view of the {@code source_paint} field. */
@NativeType("FT_OpaquePaintRec")
public FT_OpaquePaint source_paint() { return FT_PaintComposite.nsource_paint(address()); }
/** @return the value of the {@code composite_mode} field. */
@NativeType("FT_Composite_Mode")
public int composite_mode() { return FT_PaintComposite.ncomposite_mode(address()); }
/** @return a {@link FT_OpaquePaint} view of the {@code backdrop_paint} field. */
@NativeType("FT_OpaquePaintRec")
public FT_OpaquePaint backdrop_paint() { return FT_PaintComposite.nbackdrop_paint(address()); }
}
}

View File

@ -0,0 +1,165 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure representing a {@code COLR} v1 {@code PaintGlyph} paint table.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_PaintGlyph {
* {@link FT_OpaquePaint FT_OpaquePaintRec} paint;
* FT_UInt glyphID;
* }</code></pre>
*/
public class FT_PaintGlyph extends Struct<FT_PaintGlyph> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
PAINT,
GLYPHID;
static {
Layout layout = __struct(
__member(FT_OpaquePaint.SIZEOF, FT_OpaquePaint.ALIGNOF),
__member(4)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
PAINT = layout.offsetof(0);
GLYPHID = layout.offsetof(1);
}
protected FT_PaintGlyph(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_PaintGlyph create(long address, @Nullable ByteBuffer container) {
return new FT_PaintGlyph(address, container);
}
/**
* Creates a {@code FT_PaintGlyph} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_PaintGlyph(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */
@NativeType("FT_OpaquePaintRec")
public FT_OpaquePaint paint() { return npaint(address()); }
/** @return the value of the {@code glyphID} field. */
@NativeType("FT_UInt")
public int glyphID() { return nglyphID(address()); }
// -----------------------------------
/** Returns a new {@code FT_PaintGlyph} instance for the specified memory address. */
public static FT_PaintGlyph create(long address) {
return new FT_PaintGlyph(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_PaintGlyph createSafe(long address) {
return address == NULL ? null : new FT_PaintGlyph(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #paint}. */
public static FT_OpaquePaint npaint(long struct) { return FT_OpaquePaint.create(struct + FT_PaintGlyph.PAINT); }
/** Unsafe version of {@link #glyphID}. */
public static int nglyphID(long struct) { return UNSAFE.getInt(null, struct + FT_PaintGlyph.GLYPHID); }
// -----------------------------------
/** An array of {@link FT_PaintGlyph} structs. */
public static class Buffer extends StructBuffer<FT_PaintGlyph, Buffer> {
private static final FT_PaintGlyph ELEMENT_FACTORY = FT_PaintGlyph.create(-1L);
/**
* Creates a new {@code FT_PaintGlyph.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_PaintGlyph#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_PaintGlyph getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */
@NativeType("FT_OpaquePaintRec")
public FT_OpaquePaint paint() { return FT_PaintGlyph.npaint(address()); }
/** @return the value of the {@code glyphID} field. */
@NativeType("FT_UInt")
public int glyphID() { return FT_PaintGlyph.nglyphID(address()); }
}
}

View File

@ -0,0 +1,181 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure representing a {@code PaintLinearGradient} value of the {@code COLR} v1 extensions.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_PaintLinearGradient {
* {@link FT_ColorLine FT_ColorLine} colorline;
* {@link FT_Vector FT_Vector} p0;
* {@link FT_Vector FT_Vector} p1;
* {@link FT_Vector FT_Vector} p2;
* }</code></pre>
*/
public class FT_PaintLinearGradient extends Struct<FT_PaintLinearGradient> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
COLORLINE,
P0,
P1,
P2;
static {
Layout layout = __struct(
__member(FT_ColorLine.SIZEOF, FT_ColorLine.ALIGNOF),
__member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF),
__member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF),
__member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
COLORLINE = layout.offsetof(0);
P0 = layout.offsetof(1);
P1 = layout.offsetof(2);
P2 = layout.offsetof(3);
}
protected FT_PaintLinearGradient(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_PaintLinearGradient create(long address, @Nullable ByteBuffer container) {
return new FT_PaintLinearGradient(address, container);
}
/**
* Creates a {@code FT_PaintLinearGradient} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_PaintLinearGradient(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link FT_ColorLine} view of the {@code colorline} field. */
public FT_ColorLine colorline() { return ncolorline(address()); }
/** @return a {@link FT_Vector} view of the {@code p0} field. */
public FT_Vector p0() { return np0(address()); }
/** @return a {@link FT_Vector} view of the {@code p1} field. */
public FT_Vector p1() { return np1(address()); }
/** @return a {@link FT_Vector} view of the {@code p2} field. */
public FT_Vector p2() { return np2(address()); }
// -----------------------------------
/** Returns a new {@code FT_PaintLinearGradient} instance for the specified memory address. */
public static FT_PaintLinearGradient create(long address) {
return new FT_PaintLinearGradient(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_PaintLinearGradient createSafe(long address) {
return address == NULL ? null : new FT_PaintLinearGradient(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #colorline}. */
public static FT_ColorLine ncolorline(long struct) { return FT_ColorLine.create(struct + FT_PaintLinearGradient.COLORLINE); }
/** Unsafe version of {@link #p0}. */
public static FT_Vector np0(long struct) { return FT_Vector.create(struct + FT_PaintLinearGradient.P0); }
/** Unsafe version of {@link #p1}. */
public static FT_Vector np1(long struct) { return FT_Vector.create(struct + FT_PaintLinearGradient.P1); }
/** Unsafe version of {@link #p2}. */
public static FT_Vector np2(long struct) { return FT_Vector.create(struct + FT_PaintLinearGradient.P2); }
// -----------------------------------
/** An array of {@link FT_PaintLinearGradient} structs. */
public static class Buffer extends StructBuffer<FT_PaintLinearGradient, Buffer> {
private static final FT_PaintLinearGradient ELEMENT_FACTORY = FT_PaintLinearGradient.create(-1L);
/**
* Creates a new {@code FT_PaintLinearGradient.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_PaintLinearGradient#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_PaintLinearGradient getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_ColorLine} view of the {@code colorline} field. */
public FT_ColorLine colorline() { return FT_PaintLinearGradient.ncolorline(address()); }
/** @return a {@link FT_Vector} view of the {@code p0} field. */
public FT_Vector p0() { return FT_PaintLinearGradient.np0(address()); }
/** @return a {@link FT_Vector} view of the {@code p1} field. */
public FT_Vector p1() { return FT_PaintLinearGradient.np1(address()); }
/** @return a {@link FT_Vector} view of the {@code p2} field. */
public FT_Vector p2() { return FT_PaintLinearGradient.np2(address()); }
}
}

View File

@ -0,0 +1,195 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure representing a {@code PaintRadialGradient} value of the {@code COLR} v1 extensions.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_PaintRadialGradient {
* {@link FT_ColorLine FT_ColorLine} colorline;
* {@link FT_Vector FT_Vector} c0;
* FT_Pos r0;
* {@link FT_Vector FT_Vector} c1;
* FT_Pos r1;
* }</code></pre>
*/
public class FT_PaintRadialGradient extends Struct<FT_PaintRadialGradient> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
COLORLINE,
C0,
R0,
C1,
R1;
static {
Layout layout = __struct(
__member(FT_ColorLine.SIZEOF, FT_ColorLine.ALIGNOF),
__member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF),
__member(CLONG_SIZE),
__member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF),
__member(CLONG_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
COLORLINE = layout.offsetof(0);
C0 = layout.offsetof(1);
R0 = layout.offsetof(2);
C1 = layout.offsetof(3);
R1 = layout.offsetof(4);
}
protected FT_PaintRadialGradient(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_PaintRadialGradient create(long address, @Nullable ByteBuffer container) {
return new FT_PaintRadialGradient(address, container);
}
/**
* Creates a {@code FT_PaintRadialGradient} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_PaintRadialGradient(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link FT_ColorLine} view of the {@code colorline} field. */
public FT_ColorLine colorline() { return ncolorline(address()); }
/** @return a {@link FT_Vector} view of the {@code c0} field. */
public FT_Vector c0() { return nc0(address()); }
/** @return the value of the {@code r0} field. */
@NativeType("FT_Pos")
public long r0() { return nr0(address()); }
/** @return a {@link FT_Vector} view of the {@code c1} field. */
public FT_Vector c1() { return nc1(address()); }
/** @return the value of the {@code r1} field. */
@NativeType("FT_Pos")
public long r1() { return nr1(address()); }
// -----------------------------------
/** Returns a new {@code FT_PaintRadialGradient} instance for the specified memory address. */
public static FT_PaintRadialGradient create(long address) {
return new FT_PaintRadialGradient(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_PaintRadialGradient createSafe(long address) {
return address == NULL ? null : new FT_PaintRadialGradient(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #colorline}. */
public static FT_ColorLine ncolorline(long struct) { return FT_ColorLine.create(struct + FT_PaintRadialGradient.COLORLINE); }
/** Unsafe version of {@link #c0}. */
public static FT_Vector nc0(long struct) { return FT_Vector.create(struct + FT_PaintRadialGradient.C0); }
/** Unsafe version of {@link #r0}. */
public static long nr0(long struct) { return memGetCLong(struct + FT_PaintRadialGradient.R0); }
/** Unsafe version of {@link #c1}. */
public static FT_Vector nc1(long struct) { return FT_Vector.create(struct + FT_PaintRadialGradient.C1); }
/** Unsafe version of {@link #r1}. */
public static long nr1(long struct) { return memGetCLong(struct + FT_PaintRadialGradient.R1); }
// -----------------------------------
/** An array of {@link FT_PaintRadialGradient} structs. */
public static class Buffer extends StructBuffer<FT_PaintRadialGradient, Buffer> {
private static final FT_PaintRadialGradient ELEMENT_FACTORY = FT_PaintRadialGradient.create(-1L);
/**
* Creates a new {@code FT_PaintRadialGradient.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_PaintRadialGradient#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_PaintRadialGradient getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_ColorLine} view of the {@code colorline} field. */
public FT_ColorLine colorline() { return FT_PaintRadialGradient.ncolorline(address()); }
/** @return a {@link FT_Vector} view of the {@code c0} field. */
public FT_Vector c0() { return FT_PaintRadialGradient.nc0(address()); }
/** @return the value of the {@code r0} field. */
@NativeType("FT_Pos")
public long r0() { return FT_PaintRadialGradient.nr0(address()); }
/** @return a {@link FT_Vector} view of the {@code c1} field. */
public FT_Vector c1() { return FT_PaintRadialGradient.nc1(address()); }
/** @return the value of the {@code r1} field. */
@NativeType("FT_Pos")
public long r1() { return FT_PaintRadialGradient.nr1(address()); }
}
}

View File

@ -0,0 +1,189 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure representing a {@code COLR} v1 {@code PaintRotate} paint table. Used for rotating downstream paints with a given center and angle.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_PaintRotate {
* {@link FT_OpaquePaint FT_OpaquePaintRec} paint;
* FT_Fixed angle;
* FT_Fixed center_x;
* FT_Fixed center_y;
* }</code></pre>
*/
public class FT_PaintRotate extends Struct<FT_PaintRotate> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
PAINT,
ANGLE,
CENTER_X,
CENTER_Y;
static {
Layout layout = __struct(
__member(FT_OpaquePaint.SIZEOF, FT_OpaquePaint.ALIGNOF),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
PAINT = layout.offsetof(0);
ANGLE = layout.offsetof(1);
CENTER_X = layout.offsetof(2);
CENTER_Y = layout.offsetof(3);
}
protected FT_PaintRotate(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_PaintRotate create(long address, @Nullable ByteBuffer container) {
return new FT_PaintRotate(address, container);
}
/**
* Creates a {@code FT_PaintRotate} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_PaintRotate(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */
@NativeType("FT_OpaquePaintRec")
public FT_OpaquePaint paint() { return npaint(address()); }
/** @return the value of the {@code angle} field. */
@NativeType("FT_Fixed")
public long angle() { return nangle(address()); }
/** @return the value of the {@code center_x} field. */
@NativeType("FT_Fixed")
public long center_x() { return ncenter_x(address()); }
/** @return the value of the {@code center_y} field. */
@NativeType("FT_Fixed")
public long center_y() { return ncenter_y(address()); }
// -----------------------------------
/** Returns a new {@code FT_PaintRotate} instance for the specified memory address. */
public static FT_PaintRotate create(long address) {
return new FT_PaintRotate(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_PaintRotate createSafe(long address) {
return address == NULL ? null : new FT_PaintRotate(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #paint}. */
public static FT_OpaquePaint npaint(long struct) { return FT_OpaquePaint.create(struct + FT_PaintRotate.PAINT); }
/** Unsafe version of {@link #angle}. */
public static long nangle(long struct) { return memGetCLong(struct + FT_PaintRotate.ANGLE); }
/** Unsafe version of {@link #center_x}. */
public static long ncenter_x(long struct) { return memGetCLong(struct + FT_PaintRotate.CENTER_X); }
/** Unsafe version of {@link #center_y}. */
public static long ncenter_y(long struct) { return memGetCLong(struct + FT_PaintRotate.CENTER_Y); }
// -----------------------------------
/** An array of {@link FT_PaintRotate} structs. */
public static class Buffer extends StructBuffer<FT_PaintRotate, Buffer> {
private static final FT_PaintRotate ELEMENT_FACTORY = FT_PaintRotate.create(-1L);
/**
* Creates a new {@code FT_PaintRotate.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_PaintRotate#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_PaintRotate getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */
@NativeType("FT_OpaquePaintRec")
public FT_OpaquePaint paint() { return FT_PaintRotate.npaint(address()); }
/** @return the value of the {@code angle} field. */
@NativeType("FT_Fixed")
public long angle() { return FT_PaintRotate.nangle(address()); }
/** @return the value of the {@code center_x} field. */
@NativeType("FT_Fixed")
public long center_x() { return FT_PaintRotate.ncenter_x(address()); }
/** @return the value of the {@code center_y} field. */
@NativeType("FT_Fixed")
public long center_y() { return FT_PaintRotate.ncenter_y(address()); }
}
}

View File

@ -0,0 +1,201 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure representing all of the {@code COLR} v1 {@code PaintScale*} paint tables.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_PaintScale {
* {@link FT_OpaquePaint FT_OpaquePaintRec} paint;
* FT_Fixed scale_x;
* FT_Fixed scale_y;
* FT_Fixed center_x;
* FT_Fixed center_y;
* }</code></pre>
*/
public class FT_PaintScale extends Struct<FT_PaintScale> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
PAINT,
SCALE_X,
SCALE_Y,
CENTER_X,
CENTER_Y;
static {
Layout layout = __struct(
__member(FT_OpaquePaint.SIZEOF, FT_OpaquePaint.ALIGNOF),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
PAINT = layout.offsetof(0);
SCALE_X = layout.offsetof(1);
SCALE_Y = layout.offsetof(2);
CENTER_X = layout.offsetof(3);
CENTER_Y = layout.offsetof(4);
}
protected FT_PaintScale(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_PaintScale create(long address, @Nullable ByteBuffer container) {
return new FT_PaintScale(address, container);
}
/**
* Creates a {@code FT_PaintScale} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_PaintScale(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */
@NativeType("FT_OpaquePaintRec")
public FT_OpaquePaint paint() { return npaint(address()); }
/** @return the value of the {@code scale_x} field. */
@NativeType("FT_Fixed")
public long scale_x() { return nscale_x(address()); }
/** @return the value of the {@code scale_y} field. */
@NativeType("FT_Fixed")
public long scale_y() { return nscale_y(address()); }
/** @return the value of the {@code center_x} field. */
@NativeType("FT_Fixed")
public long center_x() { return ncenter_x(address()); }
/** @return the value of the {@code center_y} field. */
@NativeType("FT_Fixed")
public long center_y() { return ncenter_y(address()); }
// -----------------------------------
/** Returns a new {@code FT_PaintScale} instance for the specified memory address. */
public static FT_PaintScale create(long address) {
return new FT_PaintScale(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_PaintScale createSafe(long address) {
return address == NULL ? null : new FT_PaintScale(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #paint}. */
public static FT_OpaquePaint npaint(long struct) { return FT_OpaquePaint.create(struct + FT_PaintScale.PAINT); }
/** Unsafe version of {@link #scale_x}. */
public static long nscale_x(long struct) { return memGetCLong(struct + FT_PaintScale.SCALE_X); }
/** Unsafe version of {@link #scale_y}. */
public static long nscale_y(long struct) { return memGetCLong(struct + FT_PaintScale.SCALE_Y); }
/** Unsafe version of {@link #center_x}. */
public static long ncenter_x(long struct) { return memGetCLong(struct + FT_PaintScale.CENTER_X); }
/** Unsafe version of {@link #center_y}. */
public static long ncenter_y(long struct) { return memGetCLong(struct + FT_PaintScale.CENTER_Y); }
// -----------------------------------
/** An array of {@link FT_PaintScale} structs. */
public static class Buffer extends StructBuffer<FT_PaintScale, Buffer> {
private static final FT_PaintScale ELEMENT_FACTORY = FT_PaintScale.create(-1L);
/**
* Creates a new {@code FT_PaintScale.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_PaintScale#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_PaintScale getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */
@NativeType("FT_OpaquePaintRec")
public FT_OpaquePaint paint() { return FT_PaintScale.npaint(address()); }
/** @return the value of the {@code scale_x} field. */
@NativeType("FT_Fixed")
public long scale_x() { return FT_PaintScale.nscale_x(address()); }
/** @return the value of the {@code scale_y} field. */
@NativeType("FT_Fixed")
public long scale_y() { return FT_PaintScale.nscale_y(address()); }
/** @return the value of the {@code center_x} field. */
@NativeType("FT_Fixed")
public long center_x() { return FT_PaintScale.ncenter_x(address()); }
/** @return the value of the {@code center_y} field. */
@NativeType("FT_Fixed")
public long center_y() { return FT_PaintScale.ncenter_y(address()); }
}
}

View File

@ -0,0 +1,201 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure representing a {@code COLR} v1 {@code PaintSkew} paint table. Used for skewing or shearing downstream paints by a given center and angle.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_PaintSkew {
* {@link FT_OpaquePaint FT_OpaquePaintRec} paint;
* FT_Fixed x_skew_angle;
* FT_Fixed y_skew_angle;
* FT_Fixed center_x;
* FT_Fixed center_y;
* }</code></pre>
*/
public class FT_PaintSkew extends Struct<FT_PaintSkew> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
PAINT,
X_SKEW_ANGLE,
Y_SKEW_ANGLE,
CENTER_X,
CENTER_Y;
static {
Layout layout = __struct(
__member(FT_OpaquePaint.SIZEOF, FT_OpaquePaint.ALIGNOF),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE),
__member(CLONG_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
PAINT = layout.offsetof(0);
X_SKEW_ANGLE = layout.offsetof(1);
Y_SKEW_ANGLE = layout.offsetof(2);
CENTER_X = layout.offsetof(3);
CENTER_Y = layout.offsetof(4);
}
protected FT_PaintSkew(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_PaintSkew create(long address, @Nullable ByteBuffer container) {
return new FT_PaintSkew(address, container);
}
/**
* Creates a {@code FT_PaintSkew} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_PaintSkew(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */
@NativeType("FT_OpaquePaintRec")
public FT_OpaquePaint paint() { return npaint(address()); }
/** @return the value of the {@code x_skew_angle} field. */
@NativeType("FT_Fixed")
public long x_skew_angle() { return nx_skew_angle(address()); }
/** @return the value of the {@code y_skew_angle} field. */
@NativeType("FT_Fixed")
public long y_skew_angle() { return ny_skew_angle(address()); }
/** @return the value of the {@code center_x} field. */
@NativeType("FT_Fixed")
public long center_x() { return ncenter_x(address()); }
/** @return the value of the {@code center_y} field. */
@NativeType("FT_Fixed")
public long center_y() { return ncenter_y(address()); }
// -----------------------------------
/** Returns a new {@code FT_PaintSkew} instance for the specified memory address. */
public static FT_PaintSkew create(long address) {
return new FT_PaintSkew(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_PaintSkew createSafe(long address) {
return address == NULL ? null : new FT_PaintSkew(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #paint}. */
public static FT_OpaquePaint npaint(long struct) { return FT_OpaquePaint.create(struct + FT_PaintSkew.PAINT); }
/** Unsafe version of {@link #x_skew_angle}. */
public static long nx_skew_angle(long struct) { return memGetCLong(struct + FT_PaintSkew.X_SKEW_ANGLE); }
/** Unsafe version of {@link #y_skew_angle}. */
public static long ny_skew_angle(long struct) { return memGetCLong(struct + FT_PaintSkew.Y_SKEW_ANGLE); }
/** Unsafe version of {@link #center_x}. */
public static long ncenter_x(long struct) { return memGetCLong(struct + FT_PaintSkew.CENTER_X); }
/** Unsafe version of {@link #center_y}. */
public static long ncenter_y(long struct) { return memGetCLong(struct + FT_PaintSkew.CENTER_Y); }
// -----------------------------------
/** An array of {@link FT_PaintSkew} structs. */
public static class Buffer extends StructBuffer<FT_PaintSkew, Buffer> {
private static final FT_PaintSkew ELEMENT_FACTORY = FT_PaintSkew.create(-1L);
/**
* Creates a new {@code FT_PaintSkew.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_PaintSkew#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_PaintSkew getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */
@NativeType("FT_OpaquePaintRec")
public FT_OpaquePaint paint() { return FT_PaintSkew.npaint(address()); }
/** @return the value of the {@code x_skew_angle} field. */
@NativeType("FT_Fixed")
public long x_skew_angle() { return FT_PaintSkew.nx_skew_angle(address()); }
/** @return the value of the {@code y_skew_angle} field. */
@NativeType("FT_Fixed")
public long y_skew_angle() { return FT_PaintSkew.ny_skew_angle(address()); }
/** @return the value of the {@code center_x} field. */
@NativeType("FT_Fixed")
public long center_x() { return FT_PaintSkew.ncenter_x(address()); }
/** @return the value of the {@code center_y} field. */
@NativeType("FT_Fixed")
public long center_y() { return FT_PaintSkew.ncenter_y(address()); }
}
}

View File

@ -0,0 +1,151 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure representing a {@code PaintSolid} value of the {@code COLR} v1 extensions.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_PaintSolid {
* {@link FT_ColorIndex FT_ColorIndex} color;
* }</code></pre>
*/
public class FT_PaintSolid extends Struct<FT_PaintSolid> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
COLOR;
static {
Layout layout = __struct(
__member(FT_ColorIndex.SIZEOF, FT_ColorIndex.ALIGNOF)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
COLOR = layout.offsetof(0);
}
protected FT_PaintSolid(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_PaintSolid create(long address, @Nullable ByteBuffer container) {
return new FT_PaintSolid(address, container);
}
/**
* Creates a {@code FT_PaintSolid} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_PaintSolid(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link FT_ColorIndex} view of the {@code color} field. */
public FT_ColorIndex color() { return ncolor(address()); }
// -----------------------------------
/** Returns a new {@code FT_PaintSolid} instance for the specified memory address. */
public static FT_PaintSolid create(long address) {
return new FT_PaintSolid(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_PaintSolid createSafe(long address) {
return address == NULL ? null : new FT_PaintSolid(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #color}. */
public static FT_ColorIndex ncolor(long struct) { return FT_ColorIndex.create(struct + FT_PaintSolid.COLOR); }
// -----------------------------------
/** An array of {@link FT_PaintSolid} structs. */
public static class Buffer extends StructBuffer<FT_PaintSolid, Buffer> {
private static final FT_PaintSolid ELEMENT_FACTORY = FT_PaintSolid.create(-1L);
/**
* Creates a new {@code FT_PaintSolid.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_PaintSolid#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_PaintSolid getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_ColorIndex} view of the {@code color} field. */
public FT_ColorIndex color() { return FT_PaintSolid.ncolor(address()); }
}
}

View File

@ -0,0 +1,185 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure representing a {@code PaintSweepGradient} value of the {@code COLR} v1 extensions.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_PaintSweepGradient {
* {@link FT_ColorLine FT_ColorLine} colorline;
* {@link FT_Vector FT_Vector} center;
* FT_Fixed start_angle;
* FT_Fixed end_angle;
* }</code></pre>
*/
public class FT_PaintSweepGradient extends Struct<FT_PaintSweepGradient> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
COLORLINE,
CENTER,
START_ANGLE,
END_ANGLE;
static {
Layout layout = __struct(
__member(FT_ColorLine.SIZEOF, FT_ColorLine.ALIGNOF),
__member(FT_Vector.SIZEOF, FT_Vector.ALIGNOF),
__member(CLONG_SIZE),
__member(CLONG_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
COLORLINE = layout.offsetof(0);
CENTER = layout.offsetof(1);
START_ANGLE = layout.offsetof(2);
END_ANGLE = layout.offsetof(3);
}
protected FT_PaintSweepGradient(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_PaintSweepGradient create(long address, @Nullable ByteBuffer container) {
return new FT_PaintSweepGradient(address, container);
}
/**
* Creates a {@code FT_PaintSweepGradient} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_PaintSweepGradient(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link FT_ColorLine} view of the {@code colorline} field. */
public FT_ColorLine colorline() { return ncolorline(address()); }
/** @return a {@link FT_Vector} view of the {@code center} field. */
public FT_Vector center() { return ncenter(address()); }
/** @return the value of the {@code start_angle} field. */
@NativeType("FT_Fixed")
public long start_angle() { return nstart_angle(address()); }
/** @return the value of the {@code end_angle} field. */
@NativeType("FT_Fixed")
public long end_angle() { return nend_angle(address()); }
// -----------------------------------
/** Returns a new {@code FT_PaintSweepGradient} instance for the specified memory address. */
public static FT_PaintSweepGradient create(long address) {
return new FT_PaintSweepGradient(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_PaintSweepGradient createSafe(long address) {
return address == NULL ? null : new FT_PaintSweepGradient(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #colorline}. */
public static FT_ColorLine ncolorline(long struct) { return FT_ColorLine.create(struct + FT_PaintSweepGradient.COLORLINE); }
/** Unsafe version of {@link #center}. */
public static FT_Vector ncenter(long struct) { return FT_Vector.create(struct + FT_PaintSweepGradient.CENTER); }
/** Unsafe version of {@link #start_angle}. */
public static long nstart_angle(long struct) { return memGetCLong(struct + FT_PaintSweepGradient.START_ANGLE); }
/** Unsafe version of {@link #end_angle}. */
public static long nend_angle(long struct) { return memGetCLong(struct + FT_PaintSweepGradient.END_ANGLE); }
// -----------------------------------
/** An array of {@link FT_PaintSweepGradient} structs. */
public static class Buffer extends StructBuffer<FT_PaintSweepGradient, Buffer> {
private static final FT_PaintSweepGradient ELEMENT_FACTORY = FT_PaintSweepGradient.create(-1L);
/**
* Creates a new {@code FT_PaintSweepGradient.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_PaintSweepGradient#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_PaintSweepGradient getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_ColorLine} view of the {@code colorline} field. */
public FT_ColorLine colorline() { return FT_PaintSweepGradient.ncolorline(address()); }
/** @return a {@link FT_Vector} view of the {@code center} field. */
public FT_Vector center() { return FT_PaintSweepGradient.ncenter(address()); }
/** @return the value of the {@code start_angle} field. */
@NativeType("FT_Fixed")
public long start_angle() { return FT_PaintSweepGradient.nstart_angle(address()); }
/** @return the value of the {@code end_angle} field. */
@NativeType("FT_Fixed")
public long end_angle() { return FT_PaintSweepGradient.nend_angle(address()); }
}
}

View File

@ -0,0 +1,163 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure representing a {@code COLR} v1 {@code PaintTransform} paint table.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_PaintTransform {
* {@link FT_OpaquePaint FT_OpaquePaintRec} paint;
* {@link FT_Affine23 FT_Affine23} affine;
* }</code></pre>
*/
public class FT_PaintTransform extends Struct<FT_PaintTransform> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
PAINT,
AFFINE;
static {
Layout layout = __struct(
__member(FT_OpaquePaint.SIZEOF, FT_OpaquePaint.ALIGNOF),
__member(FT_Affine23.SIZEOF, FT_Affine23.ALIGNOF)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
PAINT = layout.offsetof(0);
AFFINE = layout.offsetof(1);
}
protected FT_PaintTransform(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_PaintTransform create(long address, @Nullable ByteBuffer container) {
return new FT_PaintTransform(address, container);
}
/**
* Creates a {@code FT_PaintTransform} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_PaintTransform(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */
@NativeType("FT_OpaquePaintRec")
public FT_OpaquePaint paint() { return npaint(address()); }
/** @return a {@link FT_Affine23} view of the {@code affine} field. */
public FT_Affine23 affine() { return naffine(address()); }
// -----------------------------------
/** Returns a new {@code FT_PaintTransform} instance for the specified memory address. */
public static FT_PaintTransform create(long address) {
return new FT_PaintTransform(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_PaintTransform createSafe(long address) {
return address == NULL ? null : new FT_PaintTransform(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #paint}. */
public static FT_OpaquePaint npaint(long struct) { return FT_OpaquePaint.create(struct + FT_PaintTransform.PAINT); }
/** Unsafe version of {@link #affine}. */
public static FT_Affine23 naffine(long struct) { return FT_Affine23.create(struct + FT_PaintTransform.AFFINE); }
// -----------------------------------
/** An array of {@link FT_PaintTransform} structs. */
public static class Buffer extends StructBuffer<FT_PaintTransform, Buffer> {
private static final FT_PaintTransform ELEMENT_FACTORY = FT_PaintTransform.create(-1L);
/**
* Creates a new {@code FT_PaintTransform.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_PaintTransform#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_PaintTransform getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */
@NativeType("FT_OpaquePaintRec")
public FT_OpaquePaint paint() { return FT_PaintTransform.npaint(address()); }
/** @return a {@link FT_Affine23} view of the {@code affine} field. */
public FT_Affine23 affine() { return FT_PaintTransform.naffine(address()); }
}
}

View File

@ -0,0 +1,177 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* A structure representing a {@code COLR} v1 {@code PaintTranslate} paint table. Used for translating downstream paints by a given x and y~delta.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_PaintTranslate {
* {@link FT_OpaquePaint FT_OpaquePaintRec} paint;
* FT_Fixed dx;
* FT_Fixed dy;
* }</code></pre>
*/
public class FT_PaintTranslate extends Struct<FT_PaintTranslate> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
PAINT,
DX,
DY;
static {
Layout layout = __struct(
__member(FT_OpaquePaint.SIZEOF, FT_OpaquePaint.ALIGNOF),
__member(CLONG_SIZE),
__member(CLONG_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
PAINT = layout.offsetof(0);
DX = layout.offsetof(1);
DY = layout.offsetof(2);
}
protected FT_PaintTranslate(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_PaintTranslate create(long address, @Nullable ByteBuffer container) {
return new FT_PaintTranslate(address, container);
}
/**
* Creates a {@code FT_PaintTranslate} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_PaintTranslate(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */
@NativeType("FT_OpaquePaintRec")
public FT_OpaquePaint paint() { return npaint(address()); }
/** @return the value of the {@code dx} field. */
@NativeType("FT_Fixed")
public long dx() { return ndx(address()); }
/** @return the value of the {@code dy} field. */
@NativeType("FT_Fixed")
public long dy() { return ndy(address()); }
// -----------------------------------
/** Returns a new {@code FT_PaintTranslate} instance for the specified memory address. */
public static FT_PaintTranslate create(long address) {
return new FT_PaintTranslate(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_PaintTranslate createSafe(long address) {
return address == NULL ? null : new FT_PaintTranslate(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #paint}. */
public static FT_OpaquePaint npaint(long struct) { return FT_OpaquePaint.create(struct + FT_PaintTranslate.PAINT); }
/** Unsafe version of {@link #dx}. */
public static long ndx(long struct) { return memGetCLong(struct + FT_PaintTranslate.DX); }
/** Unsafe version of {@link #dy}. */
public static long ndy(long struct) { return memGetCLong(struct + FT_PaintTranslate.DY); }
// -----------------------------------
/** An array of {@link FT_PaintTranslate} structs. */
public static class Buffer extends StructBuffer<FT_PaintTranslate, Buffer> {
private static final FT_PaintTranslate ELEMENT_FACTORY = FT_PaintTranslate.create(-1L);
/**
* Creates a new {@code FT_PaintTranslate.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_PaintTranslate#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_PaintTranslate getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_OpaquePaint} view of the {@code paint} field. */
@NativeType("FT_OpaquePaintRec")
public FT_OpaquePaint paint() { return FT_PaintTranslate.npaint(address()); }
/** @return the value of the {@code dx} field. */
@NativeType("FT_Fixed")
public long dx() { return FT_PaintTranslate.ndx(address()); }
/** @return the value of the {@code dy} field. */
@NativeType("FT_Fixed")
public long dy() { return FT_PaintTranslate.ndy(address()); }
}
}

View File

@ -0,0 +1,291 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* This structure holds the data of the {@code CPAL} table.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Palette_Data {
* FT_UShort num_palettes;
* FT_UShort const * palette_name_ids;
* FT_UShort const * palette_flags;
* FT_UShort num_palette_entries;
* FT_UShort const * palette_entry_name_ids;
* }</code></pre>
*/
public class FT_Palette_Data extends Struct<FT_Palette_Data> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
NUM_PALETTES,
PALETTE_NAME_IDS,
PALETTE_FLAGS,
NUM_PALETTE_ENTRIES,
PALETTE_ENTRY_NAME_IDS;
static {
Layout layout = __struct(
__member(2),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(2),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
NUM_PALETTES = layout.offsetof(0);
PALETTE_NAME_IDS = layout.offsetof(1);
PALETTE_FLAGS = layout.offsetof(2);
NUM_PALETTE_ENTRIES = layout.offsetof(3);
PALETTE_ENTRY_NAME_IDS = layout.offsetof(4);
}
protected FT_Palette_Data(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Palette_Data create(long address, @Nullable ByteBuffer container) {
return new FT_Palette_Data(address, container);
}
/**
* Creates a {@code FT_Palette_Data} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Palette_Data(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code num_palettes} field. */
@NativeType("FT_UShort")
public short num_palettes() { return nnum_palettes(address()); }
/** @return a {@link ShortBuffer} view of the data pointed to by the {@code palette_name_ids} field. */
@Nullable
@NativeType("FT_UShort const *")
public ShortBuffer palette_name_ids() { return npalette_name_ids(address()); }
/** @return a {@link ShortBuffer} view of the data pointed to by the {@code palette_flags} field. */
@Nullable
@NativeType("FT_UShort const *")
public ShortBuffer palette_flags() { return npalette_flags(address()); }
/** @return the value of the {@code num_palette_entries} field. */
@NativeType("FT_UShort")
public short num_palette_entries() { return nnum_palette_entries(address()); }
/** @return a {@link ShortBuffer} view of the data pointed to by the {@code palette_entry_name_ids} field. */
@Nullable
@NativeType("FT_UShort const *")
public ShortBuffer palette_entry_name_ids() { return npalette_entry_name_ids(address()); }
// -----------------------------------
/** Returns a new {@code FT_Palette_Data} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_Palette_Data malloc() {
return new FT_Palette_Data(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_Palette_Data} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_Palette_Data calloc() {
return new FT_Palette_Data(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_Palette_Data} instance allocated with {@link BufferUtils}. */
public static FT_Palette_Data create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_Palette_Data(memAddress(container), container);
}
/** Returns a new {@code FT_Palette_Data} instance for the specified memory address. */
public static FT_Palette_Data create(long address) {
return new FT_Palette_Data(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Palette_Data createSafe(long address) {
return address == NULL ? null : new FT_Palette_Data(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_Palette_Data} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_Palette_Data malloc(MemoryStack stack) {
return new FT_Palette_Data(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_Palette_Data} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_Palette_Data calloc(MemoryStack stack) {
return new FT_Palette_Data(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #num_palettes}. */
public static short nnum_palettes(long struct) { return UNSAFE.getShort(null, struct + FT_Palette_Data.NUM_PALETTES); }
/** Unsafe version of {@link #palette_name_ids() palette_name_ids}. */
@Nullable public static ShortBuffer npalette_name_ids(long struct) { return memShortBufferSafe(memGetAddress(struct + FT_Palette_Data.PALETTE_NAME_IDS), Short.toUnsignedInt(nnum_palettes(struct))); }
/** Unsafe version of {@link #palette_flags() palette_flags}. */
@Nullable public static ShortBuffer npalette_flags(long struct) { return memShortBufferSafe(memGetAddress(struct + FT_Palette_Data.PALETTE_FLAGS), Short.toUnsignedInt(nnum_palettes(struct))); }
/** Unsafe version of {@link #num_palette_entries}. */
public static short nnum_palette_entries(long struct) { return UNSAFE.getShort(null, struct + FT_Palette_Data.NUM_PALETTE_ENTRIES); }
/** Unsafe version of {@link #palette_entry_name_ids() palette_entry_name_ids}. */
@Nullable public static ShortBuffer npalette_entry_name_ids(long struct) { return memShortBufferSafe(memGetAddress(struct + FT_Palette_Data.PALETTE_ENTRY_NAME_IDS), Short.toUnsignedInt(nnum_palette_entries(struct))); }
// -----------------------------------
/** An array of {@link FT_Palette_Data} structs. */
public static class Buffer extends StructBuffer<FT_Palette_Data, Buffer> implements NativeResource {
private static final FT_Palette_Data ELEMENT_FACTORY = FT_Palette_Data.create(-1L);
/**
* Creates a new {@code FT_Palette_Data.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Palette_Data#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Palette_Data getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code num_palettes} field. */
@NativeType("FT_UShort")
public short num_palettes() { return FT_Palette_Data.nnum_palettes(address()); }
/** @return a {@link ShortBuffer} view of the data pointed to by the {@code palette_name_ids} field. */
@Nullable
@NativeType("FT_UShort const *")
public ShortBuffer palette_name_ids() { return FT_Palette_Data.npalette_name_ids(address()); }
/** @return a {@link ShortBuffer} view of the data pointed to by the {@code palette_flags} field. */
@Nullable
@NativeType("FT_UShort const *")
public ShortBuffer palette_flags() { return FT_Palette_Data.npalette_flags(address()); }
/** @return the value of the {@code num_palette_entries} field. */
@NativeType("FT_UShort")
public short num_palette_entries() { return FT_Palette_Data.nnum_palette_entries(address()); }
/** @return a {@link ShortBuffer} view of the data pointed to by the {@code palette_entry_name_ids} field. */
@Nullable
@NativeType("FT_UShort const *")
public ShortBuffer palette_entry_name_ids() { return FT_Palette_Data.npalette_entry_name_ids(address()); }
}
}

View File

@ -0,0 +1,297 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* A simple structure to pass more or less generic parameters to {@link FreeType#FT_Open_Face Open_Face} and {@link FreeType#FT_Face_Properties Face_Properties}.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Parameter {
* FT_ULong tag;
* FT_Pointer data;
* }</code></pre>
*/
public class FT_Parameter extends Struct<FT_Parameter> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
TAG,
DATA;
static {
Layout layout = __struct(
__member(CLONG_SIZE),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
TAG = layout.offsetof(0);
DATA = layout.offsetof(1);
}
protected FT_Parameter(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Parameter create(long address, @Nullable ByteBuffer container) {
return new FT_Parameter(address, container);
}
/**
* Creates a {@code FT_Parameter} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Parameter(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code tag} field. */
@NativeType("FT_ULong")
public long tag() { return ntag(address()); }
/**
* @return a {@link ByteBuffer} view of the data pointed to by the {@code data} field.
*
* @param capacity the number of elements in the returned buffer
*/
@Nullable
@NativeType("FT_Pointer")
public ByteBuffer data(int capacity) { return ndata(address(), capacity); }
/** Sets the specified value to the {@code tag} field. */
public FT_Parameter tag(@NativeType("FT_ULong") long value) { ntag(address(), value); return this; }
/** Sets the address of the specified {@link ByteBuffer} to the {@code data} field. */
public FT_Parameter data(@Nullable @NativeType("FT_Pointer") ByteBuffer value) { ndata(address(), value); return this; }
/** Initializes this struct with the specified values. */
public FT_Parameter set(
long tag,
@Nullable ByteBuffer data
) {
tag(tag);
data(data);
return this;
}
/**
* Copies the specified struct data to this struct.
*
* @param src the source struct
*
* @return this struct
*/
public FT_Parameter set(FT_Parameter src) {
memCopy(src.address(), address(), SIZEOF);
return this;
}
// -----------------------------------
/** Returns a new {@code FT_Parameter} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_Parameter malloc() {
return new FT_Parameter(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_Parameter} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_Parameter calloc() {
return new FT_Parameter(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_Parameter} instance allocated with {@link BufferUtils}. */
public static FT_Parameter create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_Parameter(memAddress(container), container);
}
/** Returns a new {@code FT_Parameter} instance for the specified memory address. */
public static FT_Parameter create(long address) {
return new FT_Parameter(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Parameter createSafe(long address) {
return address == NULL ? null : new FT_Parameter(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_Parameter} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_Parameter malloc(MemoryStack stack) {
return new FT_Parameter(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_Parameter} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_Parameter calloc(MemoryStack stack) {
return new FT_Parameter(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #tag}. */
public static long ntag(long struct) { return memGetCLong(struct + FT_Parameter.TAG); }
/** Unsafe version of {@link #data(int) data}. */
@Nullable public static ByteBuffer ndata(long struct, int capacity) { return memByteBufferSafe(memGetAddress(struct + FT_Parameter.DATA), capacity); }
/** Unsafe version of {@link #tag(long) tag}. */
public static void ntag(long struct, long value) { memPutCLong(struct + FT_Parameter.TAG, value); }
/** Unsafe version of {@link #data(ByteBuffer) data}. */
public static void ndata(long struct, @Nullable ByteBuffer value) { memPutAddress(struct + FT_Parameter.DATA, memAddressSafe(value)); }
// -----------------------------------
/** An array of {@link FT_Parameter} structs. */
public static class Buffer extends StructBuffer<FT_Parameter, Buffer> implements NativeResource {
private static final FT_Parameter ELEMENT_FACTORY = FT_Parameter.create(-1L);
/**
* Creates a new {@code FT_Parameter.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Parameter#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Parameter getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code tag} field. */
@NativeType("FT_ULong")
public long tag() { return FT_Parameter.ntag(address()); }
/**
* @return a {@link ByteBuffer} view of the data pointed to by the {@code data} field.
*
* @param capacity the number of elements in the returned buffer
*/
@Nullable
@NativeType("FT_Pointer")
public ByteBuffer data(int capacity) { return FT_Parameter.ndata(address(), capacity); }
/** Sets the specified value to the {@code tag} field. */
public Buffer tag(@NativeType("FT_ULong") long value) { FT_Parameter.ntag(address(), value); return this; }
/** Sets the address of the specified {@link ByteBuffer} to the {@code data} field. */
public Buffer data(@Nullable @NativeType("FT_Pointer") ByteBuffer value) { FT_Parameter.ndata(address(), value); return this; }
}
}

View File

@ -0,0 +1,173 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* The data exchange structure for the glyph -to-script-map property.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Prop_GlyphToScriptMap {
* {@link FT_Face FT_Face} face;
* FT_UShort * map;
* }</code></pre>
*/
public class FT_Prop_GlyphToScriptMap extends Struct<FT_Prop_GlyphToScriptMap> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
FACE,
MAP;
static {
Layout layout = __struct(
__member(POINTER_SIZE),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
FACE = layout.offsetof(0);
MAP = layout.offsetof(1);
}
protected FT_Prop_GlyphToScriptMap(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Prop_GlyphToScriptMap create(long address, @Nullable ByteBuffer container) {
return new FT_Prop_GlyphToScriptMap(address, container);
}
/**
* Creates a {@code FT_Prop_GlyphToScriptMap} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Prop_GlyphToScriptMap(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link FT_Face} view of the struct pointed to by the {@code face} field. */
public FT_Face face() { return nface(address()); }
/**
* @return a {@link ShortBuffer} view of the data pointed to by the {@code map} field.
*
* @param capacity the number of elements in the returned buffer
*/
@Nullable
@NativeType("FT_UShort *")
public ShortBuffer map(int capacity) { return nmap(address(), capacity); }
// -----------------------------------
/** Returns a new {@code FT_Prop_GlyphToScriptMap} instance for the specified memory address. */
public static FT_Prop_GlyphToScriptMap create(long address) {
return new FT_Prop_GlyphToScriptMap(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Prop_GlyphToScriptMap createSafe(long address) {
return address == NULL ? null : new FT_Prop_GlyphToScriptMap(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #face}. */
public static FT_Face nface(long struct) { return FT_Face.create(memGetAddress(struct + FT_Prop_GlyphToScriptMap.FACE)); }
/** Unsafe version of {@link #map(int) map}. */
@Nullable public static ShortBuffer nmap(long struct, int capacity) { return memShortBufferSafe(memGetAddress(struct + FT_Prop_GlyphToScriptMap.MAP), capacity); }
// -----------------------------------
/** An array of {@link FT_Prop_GlyphToScriptMap} structs. */
public static class Buffer extends StructBuffer<FT_Prop_GlyphToScriptMap, Buffer> {
private static final FT_Prop_GlyphToScriptMap ELEMENT_FACTORY = FT_Prop_GlyphToScriptMap.create(-1L);
/**
* Creates a new {@code FT_Prop_GlyphToScriptMap.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Prop_GlyphToScriptMap#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Prop_GlyphToScriptMap getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_Face} view of the struct pointed to by the {@code face} field. */
public FT_Face face() { return FT_Prop_GlyphToScriptMap.nface(address()); }
/**
* @return a {@link ShortBuffer} view of the data pointed to by the {@code map} field.
*
* @param capacity the number of elements in the returned buffer
*/
@Nullable
@NativeType("FT_UShort *")
public ShortBuffer map(int capacity) { return FT_Prop_GlyphToScriptMap.nmap(address(), capacity); }
}
}

View File

@ -0,0 +1,163 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* The data exchange structure for the {@code increase-x-height} property.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Prop_IncreaseXHeight {
* {@link FT_Face FT_Face} face;
* FT_UInt limit;
* }</code></pre>
*/
public class FT_Prop_IncreaseXHeight extends Struct<FT_Prop_IncreaseXHeight> {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
FACE,
LIMIT;
static {
Layout layout = __struct(
__member(POINTER_SIZE),
__member(4)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
FACE = layout.offsetof(0);
LIMIT = layout.offsetof(1);
}
protected FT_Prop_IncreaseXHeight(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Prop_IncreaseXHeight create(long address, @Nullable ByteBuffer container) {
return new FT_Prop_IncreaseXHeight(address, container);
}
/**
* Creates a {@code FT_Prop_IncreaseXHeight} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Prop_IncreaseXHeight(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return a {@link FT_Face} view of the struct pointed to by the {@code face} field. */
public FT_Face face() { return nface(address()); }
/** @return the value of the {@code limit} field. */
@NativeType("FT_UInt")
public int limit$() { return nlimit$(address()); }
// -----------------------------------
/** Returns a new {@code FT_Prop_IncreaseXHeight} instance for the specified memory address. */
public static FT_Prop_IncreaseXHeight create(long address) {
return new FT_Prop_IncreaseXHeight(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Prop_IncreaseXHeight createSafe(long address) {
return address == NULL ? null : new FT_Prop_IncreaseXHeight(address, null);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
// -----------------------------------
/** Unsafe version of {@link #face}. */
public static FT_Face nface(long struct) { return FT_Face.create(memGetAddress(struct + FT_Prop_IncreaseXHeight.FACE)); }
/** Unsafe version of {@link #limit$}. */
public static int nlimit$(long struct) { return UNSAFE.getInt(null, struct + FT_Prop_IncreaseXHeight.LIMIT); }
// -----------------------------------
/** An array of {@link FT_Prop_IncreaseXHeight} structs. */
public static class Buffer extends StructBuffer<FT_Prop_IncreaseXHeight, Buffer> {
private static final FT_Prop_IncreaseXHeight ELEMENT_FACTORY = FT_Prop_IncreaseXHeight.create(-1L);
/**
* Creates a new {@code FT_Prop_IncreaseXHeight.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Prop_IncreaseXHeight#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Prop_IncreaseXHeight getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return a {@link FT_Face} view of the struct pointed to by the {@code face} field. */
public FT_Face face() { return FT_Prop_IncreaseXHeight.nface(address()); }
/** @return the value of the {@code limit} field. */
@NativeType("FT_UInt")
public int limit$() { return FT_Prop_IncreaseXHeight.nlimit$(address()); }
}
}

View File

@ -0,0 +1,73 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* void (*{@link #invoke}) (
* FT_Raster raster
* )</code></pre>
*/
public abstract class FT_Raster_DoneFunc extends Callback implements FT_Raster_DoneFuncI {
/**
* Creates a {@code FT_Raster_DoneFunc} instance from the specified function pointer.
*
* @return the new {@code FT_Raster_DoneFunc}
*/
public static FT_Raster_DoneFunc create(long functionPointer) {
FT_Raster_DoneFuncI instance = Callback.get(functionPointer);
return instance instanceof FT_Raster_DoneFunc
? (FT_Raster_DoneFunc)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static FT_Raster_DoneFunc createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code FT_Raster_DoneFunc} instance that delegates to the specified {@code FT_Raster_DoneFuncI} instance. */
public static FT_Raster_DoneFunc create(FT_Raster_DoneFuncI instance) {
return instance instanceof FT_Raster_DoneFunc
? (FT_Raster_DoneFunc)instance
: new Container(instance.address(), instance);
}
protected FT_Raster_DoneFunc() {
super(CIF);
}
FT_Raster_DoneFunc(long functionPointer) {
super(functionPointer);
}
private static final class Container extends FT_Raster_DoneFunc {
private final FT_Raster_DoneFuncI delegate;
Container(long functionPointer, FT_Raster_DoneFuncI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public void invoke(long raster) {
delegate.invoke(raster);
}
}
}

View File

@ -0,0 +1,46 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* void (*{@link #invoke}) (
* FT_Raster raster
* )</code></pre>
*/
@FunctionalInterface
@NativeType("FT_Raster_DoneFunc")
public interface FT_Raster_DoneFuncI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_void,
ffi_type_pointer
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
invoke(
memGetAddress(memGetAddress(args))
);
}
/** A function used to destroy a given raster object. */
void invoke(@NativeType("FT_Raster") long raster);
}

View File

@ -0,0 +1,367 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
/**
* A structure used to describe a given raster class to the library.
*
* <h3>Layout</h3>
*
* <pre><code>
* struct FT_Raster_Funcs {
* FT_Glyph_Format glyph_format;
* {@link FT_Raster_NewFuncI FT_Raster_NewFunc} raster_new;
* {@link FT_Raster_ResetFuncI FT_Raster_ResetFunc} raster_reset;
* {@link FT_Raster_SetModeFuncI FT_Raster_SetModeFunc} raster_set_mode;
* {@link FT_Raster_RenderFuncI FT_Raster_RenderFunc} raster_render;
* {@link FT_Raster_DoneFuncI FT_Raster_DoneFunc} raster_done;
* }</code></pre>
*/
public class FT_Raster_Funcs extends Struct<FT_Raster_Funcs> implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
GLYPH_FORMAT,
RASTER_NEW,
RASTER_RESET,
RASTER_SET_MODE,
RASTER_RENDER,
RASTER_DONE;
static {
Layout layout = __struct(
__member(4),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
GLYPH_FORMAT = layout.offsetof(0);
RASTER_NEW = layout.offsetof(1);
RASTER_RESET = layout.offsetof(2);
RASTER_SET_MODE = layout.offsetof(3);
RASTER_RENDER = layout.offsetof(4);
RASTER_DONE = layout.offsetof(5);
}
protected FT_Raster_Funcs(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected FT_Raster_Funcs create(long address, @Nullable ByteBuffer container) {
return new FT_Raster_Funcs(address, container);
}
/**
* Creates a {@code FT_Raster_Funcs} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
* visible to the struct instance and vice versa.
*
* <p>The created instance holds a strong reference to the container object.</p>
*/
public FT_Raster_Funcs(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** @return the value of the {@code glyph_format} field. */
@NativeType("FT_Glyph_Format")
public int glyph_format() { return nglyph_format(address()); }
/** @return the value of the {@code raster_new} field. */
@Nullable
public FT_Raster_NewFunc raster_new() { return nraster_new(address()); }
/** @return the value of the {@code raster_reset} field. */
@Nullable
public FT_Raster_ResetFunc raster_reset() { return nraster_reset(address()); }
/** @return the value of the {@code raster_set_mode} field. */
@Nullable
public FT_Raster_SetModeFunc raster_set_mode() { return nraster_set_mode(address()); }
/** @return the value of the {@code raster_render} field. */
@Nullable
public FT_Raster_RenderFunc raster_render() { return nraster_render(address()); }
/** @return the value of the {@code raster_done} field. */
@Nullable
public FT_Raster_DoneFunc raster_done() { return nraster_done(address()); }
/** Sets the specified value to the {@code glyph_format} field. */
public FT_Raster_Funcs glyph_format(@NativeType("FT_Glyph_Format") int value) { nglyph_format(address(), value); return this; }
/** Sets the specified value to the {@code raster_new} field. */
public FT_Raster_Funcs raster_new(@Nullable @NativeType("FT_Raster_NewFunc") FT_Raster_NewFuncI value) { nraster_new(address(), value); return this; }
/** Sets the specified value to the {@code raster_reset} field. */
public FT_Raster_Funcs raster_reset(@Nullable @NativeType("FT_Raster_ResetFunc") FT_Raster_ResetFuncI value) { nraster_reset(address(), value); return this; }
/** Sets the specified value to the {@code raster_set_mode} field. */
public FT_Raster_Funcs raster_set_mode(@Nullable @NativeType("FT_Raster_SetModeFunc") FT_Raster_SetModeFuncI value) { nraster_set_mode(address(), value); return this; }
/** Sets the specified value to the {@code raster_render} field. */
public FT_Raster_Funcs raster_render(@Nullable @NativeType("FT_Raster_RenderFunc") FT_Raster_RenderFuncI value) { nraster_render(address(), value); return this; }
/** Sets the specified value to the {@code raster_done} field. */
public FT_Raster_Funcs raster_done(@Nullable @NativeType("FT_Raster_DoneFunc") FT_Raster_DoneFuncI value) { nraster_done(address(), value); return this; }
/** Initializes this struct with the specified values. */
public FT_Raster_Funcs set(
int glyph_format,
FT_Raster_NewFuncI raster_new,
FT_Raster_ResetFuncI raster_reset,
FT_Raster_SetModeFuncI raster_set_mode,
FT_Raster_RenderFuncI raster_render,
FT_Raster_DoneFuncI raster_done
) {
glyph_format(glyph_format);
raster_new(raster_new);
raster_reset(raster_reset);
raster_set_mode(raster_set_mode);
raster_render(raster_render);
raster_done(raster_done);
return this;
}
/**
* Copies the specified struct data to this struct.
*
* @param src the source struct
*
* @return this struct
*/
public FT_Raster_Funcs set(FT_Raster_Funcs src) {
memCopy(src.address(), address(), SIZEOF);
return this;
}
// -----------------------------------
/** Returns a new {@code FT_Raster_Funcs} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static FT_Raster_Funcs malloc() {
return new FT_Raster_Funcs(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code FT_Raster_Funcs} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static FT_Raster_Funcs calloc() {
return new FT_Raster_Funcs(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code FT_Raster_Funcs} instance allocated with {@link BufferUtils}. */
public static FT_Raster_Funcs create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new FT_Raster_Funcs(memAddress(container), container);
}
/** Returns a new {@code FT_Raster_Funcs} instance for the specified memory address. */
public static FT_Raster_Funcs create(long address) {
return new FT_Raster_Funcs(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static FT_Raster_Funcs createSafe(long address) {
return address == NULL ? null : new FT_Raster_Funcs(address, null);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code FT_Raster_Funcs} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static FT_Raster_Funcs malloc(MemoryStack stack) {
return new FT_Raster_Funcs(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code FT_Raster_Funcs} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static FT_Raster_Funcs calloc(MemoryStack stack) {
return new FT_Raster_Funcs(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #glyph_format}. */
public static int nglyph_format(long struct) { return UNSAFE.getInt(null, struct + FT_Raster_Funcs.GLYPH_FORMAT); }
/** Unsafe version of {@link #raster_new}. */
@Nullable public static FT_Raster_NewFunc nraster_new(long struct) { return FT_Raster_NewFunc.createSafe(memGetAddress(struct + FT_Raster_Funcs.RASTER_NEW)); }
/** Unsafe version of {@link #raster_reset}. */
@Nullable public static FT_Raster_ResetFunc nraster_reset(long struct) { return FT_Raster_ResetFunc.createSafe(memGetAddress(struct + FT_Raster_Funcs.RASTER_RESET)); }
/** Unsafe version of {@link #raster_set_mode}. */
@Nullable public static FT_Raster_SetModeFunc nraster_set_mode(long struct) { return FT_Raster_SetModeFunc.createSafe(memGetAddress(struct + FT_Raster_Funcs.RASTER_SET_MODE)); }
/** Unsafe version of {@link #raster_render}. */
@Nullable public static FT_Raster_RenderFunc nraster_render(long struct) { return FT_Raster_RenderFunc.createSafe(memGetAddress(struct + FT_Raster_Funcs.RASTER_RENDER)); }
/** Unsafe version of {@link #raster_done}. */
@Nullable public static FT_Raster_DoneFunc nraster_done(long struct) { return FT_Raster_DoneFunc.createSafe(memGetAddress(struct + FT_Raster_Funcs.RASTER_DONE)); }
/** Unsafe version of {@link #glyph_format(int) glyph_format}. */
public static void nglyph_format(long struct, int value) { UNSAFE.putInt(null, struct + FT_Raster_Funcs.GLYPH_FORMAT, value); }
/** Unsafe version of {@link #raster_new(FT_Raster_NewFuncI) raster_new}. */
public static void nraster_new(long struct, @Nullable FT_Raster_NewFuncI value) { memPutAddress(struct + FT_Raster_Funcs.RASTER_NEW, memAddressSafe(value)); }
/** Unsafe version of {@link #raster_reset(FT_Raster_ResetFuncI) raster_reset}. */
public static void nraster_reset(long struct, @Nullable FT_Raster_ResetFuncI value) { memPutAddress(struct + FT_Raster_Funcs.RASTER_RESET, memAddressSafe(value)); }
/** Unsafe version of {@link #raster_set_mode(FT_Raster_SetModeFuncI) raster_set_mode}. */
public static void nraster_set_mode(long struct, @Nullable FT_Raster_SetModeFuncI value) { memPutAddress(struct + FT_Raster_Funcs.RASTER_SET_MODE, memAddressSafe(value)); }
/** Unsafe version of {@link #raster_render(FT_Raster_RenderFuncI) raster_render}. */
public static void nraster_render(long struct, @Nullable FT_Raster_RenderFuncI value) { memPutAddress(struct + FT_Raster_Funcs.RASTER_RENDER, memAddressSafe(value)); }
/** Unsafe version of {@link #raster_done(FT_Raster_DoneFuncI) raster_done}. */
public static void nraster_done(long struct, @Nullable FT_Raster_DoneFuncI value) { memPutAddress(struct + FT_Raster_Funcs.RASTER_DONE, memAddressSafe(value)); }
// -----------------------------------
/** An array of {@link FT_Raster_Funcs} structs. */
public static class Buffer extends StructBuffer<FT_Raster_Funcs, Buffer> implements NativeResource {
private static final FT_Raster_Funcs ELEMENT_FACTORY = FT_Raster_Funcs.create(-1L);
/**
* Creates a new {@code FT_Raster_Funcs.Buffer} instance backed by the specified container.
*
* <p>Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link FT_Raster_Funcs#SIZEOF}, and its mark will be undefined.</p>
*
* <p>The created buffer instance holds a strong reference to the container object.</p>
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected FT_Raster_Funcs getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@code glyph_format} field. */
@NativeType("FT_Glyph_Format")
public int glyph_format() { return FT_Raster_Funcs.nglyph_format(address()); }
/** @return the value of the {@code raster_new} field. */
@Nullable
public FT_Raster_NewFunc raster_new() { return FT_Raster_Funcs.nraster_new(address()); }
/** @return the value of the {@code raster_reset} field. */
@Nullable
public FT_Raster_ResetFunc raster_reset() { return FT_Raster_Funcs.nraster_reset(address()); }
/** @return the value of the {@code raster_set_mode} field. */
@Nullable
public FT_Raster_SetModeFunc raster_set_mode() { return FT_Raster_Funcs.nraster_set_mode(address()); }
/** @return the value of the {@code raster_render} field. */
@Nullable
public FT_Raster_RenderFunc raster_render() { return FT_Raster_Funcs.nraster_render(address()); }
/** @return the value of the {@code raster_done} field. */
@Nullable
public FT_Raster_DoneFunc raster_done() { return FT_Raster_Funcs.nraster_done(address()); }
/** Sets the specified value to the {@code glyph_format} field. */
public Buffer glyph_format(@NativeType("FT_Glyph_Format") int value) { FT_Raster_Funcs.nglyph_format(address(), value); return this; }
/** Sets the specified value to the {@code raster_new} field. */
public Buffer raster_new(@Nullable @NativeType("FT_Raster_NewFunc") FT_Raster_NewFuncI value) { FT_Raster_Funcs.nraster_new(address(), value); return this; }
/** Sets the specified value to the {@code raster_reset} field. */
public Buffer raster_reset(@Nullable @NativeType("FT_Raster_ResetFunc") FT_Raster_ResetFuncI value) { FT_Raster_Funcs.nraster_reset(address(), value); return this; }
/** Sets the specified value to the {@code raster_set_mode} field. */
public Buffer raster_set_mode(@Nullable @NativeType("FT_Raster_SetModeFunc") FT_Raster_SetModeFuncI value) { FT_Raster_Funcs.nraster_set_mode(address(), value); return this; }
/** Sets the specified value to the {@code raster_render} field. */
public Buffer raster_render(@Nullable @NativeType("FT_Raster_RenderFunc") FT_Raster_RenderFuncI value) { FT_Raster_Funcs.nraster_render(address(), value); return this; }
/** Sets the specified value to the {@code raster_done} field. */
public Buffer raster_done(@Nullable @NativeType("FT_Raster_DoneFunc") FT_Raster_DoneFuncI value) { FT_Raster_Funcs.nraster_done(address(), value); return this; }
}
}

View File

@ -0,0 +1,74 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* int (*{@link #invoke}) (
* void *memory,
* FT_Raster *raster
* )</code></pre>
*/
public abstract class FT_Raster_NewFunc extends Callback implements FT_Raster_NewFuncI {
/**
* Creates a {@code FT_Raster_NewFunc} instance from the specified function pointer.
*
* @return the new {@code FT_Raster_NewFunc}
*/
public static FT_Raster_NewFunc create(long functionPointer) {
FT_Raster_NewFuncI instance = Callback.get(functionPointer);
return instance instanceof FT_Raster_NewFunc
? (FT_Raster_NewFunc)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static FT_Raster_NewFunc createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code FT_Raster_NewFunc} instance that delegates to the specified {@code FT_Raster_NewFuncI} instance. */
public static FT_Raster_NewFunc create(FT_Raster_NewFuncI instance) {
return instance instanceof FT_Raster_NewFunc
? (FT_Raster_NewFunc)instance
: new Container(instance.address(), instance);
}
protected FT_Raster_NewFunc() {
super(CIF);
}
FT_Raster_NewFunc(long functionPointer) {
super(functionPointer);
}
private static final class Container extends FT_Raster_NewFunc {
private final FT_Raster_NewFuncI delegate;
Container(long functionPointer, FT_Raster_NewFuncI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public int invoke(long memory, long raster) {
return delegate.invoke(memory, raster);
}
}
}

View File

@ -0,0 +1,49 @@
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.freetype;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* <h3>Type</h3>
*
* <pre><code>
* int (*{@link #invoke}) (
* void *memory,
* FT_Raster *raster
* )</code></pre>
*/
@FunctionalInterface
@NativeType("FT_Raster_NewFunc")
public interface FT_Raster_NewFuncI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_sint32,
ffi_type_pointer, ffi_type_pointer
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
int __result = invoke(
memGetAddress(memGetAddress(args)),
memGetAddress(memGetAddress(args + POINTER_SIZE))
);
apiClosureRet(ret, __result);
}
/** A function used to create a new raster object. */
int invoke(@NativeType("void *") long memory, @NativeType("FT_Raster *") long raster);
}

Some files were not shown because too many files have changed in this diff Show More